~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to gui/XDisplay/src/myaux.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @(#)myaux.c  19.1 (ES0-DMD) 02/25/03 22:42:42 */
 
2
/*===========================================================================
 
3
  Copyright (C) 1995 European Southern Observatory (ESO)
 
4
 
 
5
  This program is free software; you can redistribute it and/or 
 
6
  modify it under the terms of the GNU General Public License as 
 
7
  published by the Free Software Foundation; either version 2 of 
 
8
  the License, or (at your option) any later version.
 
9
 
 
10
  This program is distributed in the hope that it will be useful,
 
11
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
  GNU General Public License for more details.
 
14
 
 
15
  You should have received a copy of the GNU General Public 
 
16
  License along with this program; if not, write to the Free 
 
17
  Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
 
18
  MA 02139, USA.
 
19
 
 
20
  Corresponding concerning ESO-MIDAS should be addressed as follows:
 
21
        Internet e-mail: midas@eso.org
 
22
        Postal address: European Southern Observatory
 
23
                        Data Management Division 
 
24
                        Karl-Schwarzschild-Strasse 2
 
25
                        D 85748 Garching bei Muenchen 
 
26
                        GERMANY
 
27
===========================================================================*/
 
28
 
 
29
/*
 
30
    this file `myaux.c'  is included as an auxiliary function 
 
31
    use the Declaration Editor of UIMX to store it there 
 
32
 
 
33
    if modified it has to be copied over to ../src so that it is found
 
34
    in the make
 
35
*/
 
36
 
 
37
#include <midas_def.h>
 
38
 
 
39
/******************************************************************
 
40
   This function establishes a protocol callback that detects 
 
41
   the window manager Close command.  */
 
42
 
 
43
void CreateWindowManagerProtocols(shell)
 
44
     Widget shell;
 
45
{
 
46
  Atom  xa_WM_DELETE_WINDOW;
 
47
 
 
48
  xa_WM_DELETE_WINDOW = XInternAtom (UxDisplay, "WM_DELETE_WINDOW", False);
 
49
/*
 
50
  XmAddWMProtocolCallback (shell, xa_WM_DELETE_WINDOW, ExitCB, NULL);
 
51
*/
 
52
}
 
53
 
 
54
/* This function pops up the Exit dialog box. */
 
55
/*
 
56
void ExitCB(w, client_data, call_data)
 
57
     Widget  w;
 
58
     caddr_t client_data;
 
59
     caddr_t call_data;
 
60
{
 
61
  UxPopupInterface (exitDialog, no_grab);
 
62
}
 
63
*/
 
64
 
 
65
 
 
66
/****************************************************************** 
 
67
   This function establishes a protocol callback to detect a "save 
 
68
   yourself" message from the session manager. */
 
69
 
 
70
void CreateSessionManagerProtocols()
 
71
{
 
72
  Atom  xa_WM_SAVE_YOURSELF;
 
73
  
 
74
  xa_WM_SAVE_YOURSELF = XInternAtom (UxDisplay, "WM_SAVE_YOURSELF", False);
 
75
  XmAddWMProtocolCallback (UxTopLevel, xa_WM_SAVE_YOURSELF, SaveSessionCB, NULL);
 
76
}
 
77
 
 
78
 
 
79
/*****************************************************************
 
80
   This callback function is executed whenever this application 
 
81
   receives a "save yourself" callback from the session manager. */
 
82
 
 
83
void SaveSessionCB()
 
84
{
 
85
 
 
86
  printf("The session manager is saving a session ...\n");
 
87
  printf(" ... (New Application) should save itself now!\n");
 
88
 
 
89
}
 
90
 
 
91
/*
 
92
 
 
93
*/
 
94
 
 
95
 
 
96
 
 
97
/* `applycom.c'  the Activate Callback of the `Apply' button */
 
98
 
 
99
 
 
100
#define OKSTAT     0
 
101
 
 
102
#define NOEXSTAT   -999
 
103
#define SENDSTAT  -1000
 
104
#define BUSYSTAT  -1001
 
105
#define RETSTAT   -1002
 
106
 
 
107
#define UNDEFINED -1009
 
108
 
 
109
applycom(flag)
 
110
int flag;
 
111
 
 
112
{
 
113
 
 
114
extern int MonitorPid;
 
115
 
 
116
char  command[160], *single, *singlf, *cpp, *cqq;
 
117
char  cswk[40][8], cbuf[80], cd;
 
118
 
 
119
extern char  actdisp[8];
 
120
static char  dispbuf[8] = "false", appitt[8] = "false";
 
121
static char  Qlut[40] = "";
 
122
static char  Qima[64] = "";
 
123
 
 
124
extern int menuact[8];
 
125
 
 
126
int  kk, jj, loop, looplim, miderr[2], comndno;
 
127
 
 
128
short int jswk[12];
 
129
swidget  swk[12];
 
130
 
 
131
 
 
132
/* first check for the menu generated commands ... */
 
133
 
 
134
if (flag > 0)
 
135
   {
 
136
   comndno = 100 + flag;
 
137
   switch (flag)
 
138
      {
 
139
     case 1:
 
140
      strcpy(command,"CLEAR/CHAN OVER");
 
141
      goto send_comnd;
 
142
 
 
143
     case 2:
 
144
      strcpy(command,"CLEAR/ITT");
 
145
      goto send_comnd;
 
146
 
 
147
     case 3:
 
148
      strcpy(command,"SET/ITT");
 
149
      goto send_comnd;
 
150
 
 
151
     case 4:
 
152
      strcpy(command,"SET/LUT");
 
153
      goto send_comnd;
 
154
 
 
155
     case 5:
 
156
      strcpy(command,"CLEAR/LUT");
 
157
      goto send_comnd;
 
158
 
 
159
     case 6:
 
160
      strcpy(command,"CLEAR/DISPLAY");
 
161
      goto send_comnd;
 
162
 
 
163
     case 7:
 
164
      strcpy(command,"CLEAR/CHAN");
 
165
      goto send_comnd;
 
166
 
 
167
     case 8:
 
168
      strcpy(command,"RESET/DISPLAY");
 
169
      goto send_comnd;
 
170
 
 
171
     case 9:
 
172
      strcpy(command,"CLEAR/OVER");
 
173
      goto send_comnd;
 
174
 
 
175
     case 10:
 
176
      strcpy(command,"SET/OVER");
 
177
      goto send_comnd;
 
178
 
 
179
     case 11:
 
180
      strcpy(command,"DISPLAY/LUT");
 
181
      goto send_comnd;
 
182
 
 
183
     case 12:
 
184
      strcpy(command,"DISPLAY/LUT OFF");
 
185
      goto send_comnd;
 
186
 
 
187
     case 13:
 
188
      strcpy(command,"DELETE/DISPLAY");
 
189
      goto send_comnd;
 
190
 
 
191
     case 14:
 
192
      strcpy(command,"DELETE/GRAPHICS");
 
193
      goto send_comnd;
 
194
      }
 
195
   }
 
196
 
 
197
   
 
198
/* collect the different fields */
 
199
 
 
200
begin:
 
201
if (Widget_managed[0] == UxGetWidget(form2))    /* Load Image */
 
202
   {
 
203
   single = XmTextGetString(UxGetWidget(text41));       /* get display ID */
 
204
   if (strcmp(actdisp,single) != 0)
 
205
      {
 
206
      strcpy(actdisp,single);
 
207
      comndno = 0;
 
208
      strcpy(command,"ASSIGN/DISP ");
 
209
      strcpy(&command[12],actdisp);
 
210
      goto send_comnd;
 
211
      }
 
212
 
 
213
   comndno = 1;
 
214
   strcpy(command,"LOAD/IMAG ");
 
215
   kk = 10;
 
216
   XtFree(single);
 
217
 
 
218
   looplim = 8;
 
219
   for (loop=0; loop<looplim; loop++)
 
220
      jswk[loop] = 0;           /* = 0, indicates `text swidget' */
 
221
 
 
222
   single = XmTextGetString(UxGetWidget(text16));
 
223
   cpp = single;
 
224
   while (*cpp == ' ') cpp++;
 
225
   cd = *cpp;
 
226
   XtFree(single);
 
227
   if (*cpp == '\0') goto no_command;           /* no image name there... */
 
228
 
 
229
   swk[0] = text16;     /* image name */
 
230
   swk[1] = text2;      /* channel */
 
231
   swk[2] = text39;     /* X scale */
 
232
   jswk[2] = 1;
 
233
   swk[3] = text40;     /* Y scale */
 
234
   swk[4] = text20;     /* X center */
 
235
   jswk[4] = 1;
 
236
   swk[5] = text24;     /* Y center */
 
237
   swk[6] = text15;     /* low cut */
 
238
   jswk[6] = 1;
 
239
   swk[7] = text22;     /* hi cut */
 
240
   }
 
241
 
 
242
else if (Widget_managed[0] == UxGetWidget(form5))       /* Quick Load */
 
243
   {
 
244
   comndno = 9;
 
245
   strcpy(cbuf,UxGetSet(toggleButton13));
 
246
   if (cbuf[0] == 't')
 
247
      {
 
248
      strcpy(command,"CREATE/DISP 0 ");
 
249
      single = XmTextGetString(UxGetWidget(text30)); 
 
250
      cpp = single;
 
251
      while (*cpp == ' ') cpp++;
 
252
      singlf = XmTextGetString(UxGetWidget(text32));
 
253
      cqq = singlf;
 
254
      while (*cqq == ' ') cqq++;
 
255
      if ((*cpp != '\0') && (*cqq != '\0'))
 
256
         {
 
257
         strcat(command,cpp);
 
258
         kk = strlen(command);
 
259
         command[kk++] = ',';
 
260
         strcpy(&command[kk],cqq);
 
261
         strcat(command,",630,330");
 
262
         }
 
263
 
 
264
      XtFree(single);
 
265
      XtFree(singlf);
 
266
      kk = strlen(command);
 
267
      command[kk++] = ';';
 
268
      command[kk] = '\0';
 
269
   
 
270
      UxPutSet(toggleButton13,"false");
 
271
      UxPutLabelString(toggleButton13,"No");
 
272
      XtSetSensitive(UxGetWidget(label44),FALSE);
 
273
      XtSetSensitive(UxGetWidget(label49),FALSE);
 
274
      XtSetSensitive(UxGetWidget(rowColumn23),FALSE);
 
275
      XtSetSensitive(UxGetWidget(rowColumn25),FALSE);
 
276
 
 
277
      Qima[0] = '\0';                   /* force new loading */
 
278
      Qlut[0] = '\0';
 
279
      }
 
280
   else
 
281
      {
 
282
      command[0] = '\0';
 
283
      kk = 0;
 
284
      }
 
285
 
 
286
qload:
 
287
   single = XmTextGetString(UxGetWidget(text28));       /* get file name */
 
288
   cpp = single;
 
289
   while (*cpp == ' ') cpp++;
 
290
   if (*cpp != '\0')
 
291
      {
 
292
      if (strcmp(Qima,cpp) != 0)
 
293
         {
 
294
         strcpy(Qima,cpp);                      /* save new image name */
 
295
         strcpy(&command[kk],"LOAD/IMAGE ");
 
296
         kk += 11;
 
297
         strcpy(&command[kk],cpp);
 
298
         kk = strlen(command);
 
299
         strcpy(&command[kk]," ? ?");
 
300
         kk += 4; 
 
301
         singlf = XmTextGetString(UxGetWidget(text31)); /* scaleX */
 
302
         cpp = singlf;
 
303
         while (*cpp == ' ') cpp++;
 
304
         if (*cpp != '\0')
 
305
            {
 
306
            strcpy(&command[--kk],cpp);
 
307
            kk = strlen(command);
 
308
            }
 
309
         XtFree(singlf);
 
310
         singlf = XmTextGetString(UxGetWidget(text33));    /* scaleY */
 
311
         cpp = singlf;
 
312
         while (*cpp == ' ') cpp++;
 
313
         if (*cpp != '\0')
 
314
            {
 
315
            command[kk++] = ',';
 
316
            strcpy(&command[kk],cpp);
 
317
            kk = strlen(command);
 
318
            }
 
319
         XtFree(singlf);
 
320
         strcpy(&command[kk]," ? ");
 
321
         kk += 3; 
 
322
         singlf = XmTextGetString(UxGetWidget(text34));    /* low cut */
 
323
         cpp = singlf;
 
324
         while (*cpp == ' ') cpp++;
 
325
         if (*cpp != '\0')
 
326
            {
 
327
            strcpy(cbuf,cpp);
 
328
            jj = strlen(cbuf);
 
329
            XtFree(singlf);
 
330
     
 
331
            singlf = XmTextGetString(UxGetWidget(text35));    /* high cut */
 
332
            cpp = singlf;
 
333
            while (*cpp == ' ') cpp++;
 
334
            if (*cpp != '\0')
 
335
               {
 
336
               cbuf[jj++] = ',';
 
337
               strcpy(&cbuf[jj],cpp);
 
338
               strcpy(&command[kk],cbuf);
 
339
               }
 
340
            }
 
341
         XtFree(singlf);
 
342
         }
 
343
      }
 
344
   XtFree(single);
 
345
 
 
346
   kk = strlen(command);
 
347
   if ((kk > 0) && (command[kk-1] != ';'))
 
348
      {
 
349
      command[kk++] = ';';
 
350
      command[kk] = '\0';
 
351
      }
 
352
 
 
353
   single = XmTextGetString(UxGetWidget(text29));       /* get LUT name */
 
354
   cpp = single;
 
355
   while (*cpp == ' ') cpp++;
 
356
   if (*cpp != '\0')
 
357
      {
 
358
      if (strcmp(Qlut,cpp) != 0)
 
359
         {
 
360
         strcpy(Qlut,cpp);                      /* save new LUT */
 
361
         strcpy(&command[kk],"LOAD/LUT ");
 
362
         kk += 9;
 
363
         strcpy(&command[kk],cpp);
 
364
         }
 
365
      }
 
366
 
 
367
   XtFree(single);
 
368
   kk = strlen(command);
 
369
   if (kk > 0)
 
370
      {
 
371
      kk --;
 
372
      if (command[kk] == ';') command[kk] = '\0';
 
373
      goto send_comnd;
 
374
      }
 
375
   else
 
376
      {
 
377
      if (comndno == 9)
 
378
         {
 
379
         comndno = 9000;
 
380
         strcpy(Qima," !@#");                   /* if nothing load image ... */
 
381
         goto qload;
 
382
         }
 
383
      return;
 
384
      }
 
385
 
 
386
   }
 
387
 
 
388
 
 
389
else if (Widget_managed[0] == UxGetWidget(form6))  /* Create Display/Graphics */
 
390
   {
 
391
   comndno = 2;
 
392
   strcpy(cbuf,UxGetSet(toggleButton15));
 
393
   if (cbuf[0] == 't')
 
394
      {
 
395
      cd = 'D';
 
396
      looplim = 9;
 
397
      }
 
398
   else
 
399
      {
 
400
      cd = 'G';
 
401
      looplim = 7;
 
402
      }
 
403
 
 
404
   for (loop=0; loop<looplim; loop++)
 
405
      jswk[loop] = 0;           /* = 0, indicates `text swidget' */
 
406
 
 
407
   swk[0] = text1;              /* display id */
 
408
   swk[1] = text4;              /* dspsizeX */
 
409
   jswk[1] = 1;                 /* add `,' and append following `swk' */
 
410
   swk[2] = text5;              /* dspsizeY */
 
411
   jswk[2] = 1;
 
412
   swk[3] = text6;              /* dspoffsetX */
 
413
   jswk[3] = 1;
 
414
   swk[4] = text8;              /* dspoffsetY */
 
415
   if (cd == 'D')
 
416
      {
 
417
      jswk[5] = -2;             /* meminfo  is set to ? */
 
418
      strcpy(cbuf,UxGetSet(toggleButton25));
 
419
      if (cbuf[0] == 't')
 
420
         strcpy(cswk[6] ,"Yes");
 
421
      else
 
422
         strcpy(cswk[6] ,"No"); /* alpha_flag */
 
423
      jswk[6] = -3;             /* = -3, indicates: use cswk[6]  */
 
424
      swk[7] = text13;          /* Gsize */
 
425
      swk[8] = text21;          /* Xstation */
 
426
      strcpy(command,"CREATE/DISP ");
 
427
      kk = 12;
 
428
      }
 
429
   else 
 
430
      {
 
431
      swk[5] = text13;          /* Gsize */
 
432
      swk[6] = text21;          /* Xstation */
 
433
      strcpy(command,"CREATE/GRAPH ");
 
434
      kk = 13;
 
435
      }
 
436
   }
 
437
 
 
438
else if (Widget_managed[0] == UxGetWidget(form4))       /* LOAD/LUT + ITT */
 
439
   {    
 
440
   comndno = 3;
 
441
   kk = 0;
 
442
   single = XmTextGetString(UxGetWidget(text9));        /* LUT name */
 
443
   if (*single != '\0')
 
444
      {
 
445
      strcpy(command,"LOAD/LUT ");
 
446
      kk = 9;
 
447
      strcpy(&command[kk],single);
 
448
      kk = strlen(command);
 
449
      command[kk++] = ';';
 
450
      command[kk] = '\0';
 
451
      }
 
452
   XtFree(single);
 
453
 
 
454
   strcpy(cbuf,UxGetSet(toggleButton10));               /* DisplayLUT */
 
455
   if (strcmp(dispbuf,cbuf) != 0)
 
456
      {
 
457
      strcpy(dispbuf,cbuf);
 
458
      if (dispbuf[0] == 't')
 
459
         strcpy(&command[kk],"DISPLAY/LUT  ON;");
 
460
      else
 
461
         strcpy(&command[kk],"DISPLAY/LUT OFF;");
 
462
      kk += 16;
 
463
      }
 
464
 
 
465
   single = XmTextGetString(UxGetWidget(text23));       /* ITT name */
 
466
   if (*single != '\0')
 
467
      {
 
468
      strcpy(&command[kk],"LOAD/ITT ");
 
469
      kk += 9;
 
470
      strcpy(&command[kk],single);
 
471
      }
 
472
   XtFree(single);
 
473
 
 
474
   if (kk > 0)                          /* anything to send?  */
 
475
      {
 
476
      kk = strlen(command) - 1;
 
477
      if (command[kk] == ';') command[kk] = '\0';       /* omit last ';'  */
 
478
      goto send_comnd;
 
479
      }
 
480
   else
 
481
      return;
 
482
   }
 
483
 
 
484
 
 
485
else if (Widget_managed[0] == UxGetWidget(form8))       /* MODIFY/LUT + ITT */
 
486
   {
 
487
   comndno = 4;
 
488
   strcpy(cbuf,UxGetSet(toggleButton3));                /* check LUT button */
 
489
   kk = 0;
 
490
   if (cbuf[0] == 't')
 
491
      {
 
492
      strcpy(command,"MODIFY/LUT ");
 
493
      kk = 11;
 
494
      strcpy(cbuf,UxGetMenuHistory(method2));
 
495
      strcpy(&command[kk],UxGetLabelString(UxFindSwidget(cbuf)));
 
496
      kk = strlen(command);
 
497
      command[kk++] = ' ';
 
498
      strcpy(cbuf,UxGetMenuHistory(color1));
 
499
      strcpy(&command[kk],UxGetLabelString(UxFindSwidget(cbuf)));
 
500
      kk = strlen(command);
 
501
      }
 
502
 
 
503
   strcpy(cbuf,UxGetSet(toggleButton5));                /* check ITT button */
 
504
   if (cbuf[0] == 't')
 
505
      {
 
506
      if (kk > 0)                       /* also MODIFY/LUT selected ... */
 
507
         {
 
508
         command[kk++] = ';';
 
509
         command[kk++] = ' ';
 
510
         }
 
511
      strcpy(&command[kk],"MODIFY/ITT ");
 
512
      kk += 11;
 
513
      strcpy(cbuf,UxGetMenuHistory(method1));
 
514
      strcpy(&command[kk],UxGetLabelString(UxFindSwidget(cbuf)));
 
515
      if (command[kk] == 'B')           /* for BAND we also need value */
 
516
         {
 
517
         kk = strlen(command);
 
518
         command[kk++] = ' ';
 
519
         single = XmTextGetString(UxGetWidget(text27));         /* ITT value */
 
520
         strcpy(&command[kk],single);
 
521
         XtFree(single);
 
522
         }
 
523
      }
 
524
   goto send_comnd;
 
525
   }
 
526
 
 
527
 
 
528
else if (Widget_managed[0] == UxGetWidget(form3))       /* VIEW/IMAGE */
 
529
   {
 
530
   comndno = 5;
 
531
   for (loop=0; loop<4; loop++)
 
532
      jswk[loop] = 0;           /* = 0, indicates `text swidget' */
 
533
 
 
534
   swk[0] = text10;             /* image name */
 
535
   swk[1] = text17;             /* out_table */
 
536
   strcpy(cbuf,UxGetSet(toggleButton2));                /* plot_option */
 
537
   if (cbuf[0] == 't')
 
538
      strcpy(cswk[2],"Plot");
 
539
   else
 
540
      strcpy(cswk[2],"NoPlot");
 
541
   jswk[2] = -3;
 
542
   strcpy(cbuf,UxGetSet(toggleButton4));                /* file_format */
 
543
   if (cbuf[0] == 't')
 
544
      strcpy(cswk[3],"Midas");
 
545
   else
 
546
      strcpy(cswk[3],"FITS");
 
547
   jswk[3] = -3;
 
548
   looplim = 4;
 
549
   strcpy(command,"VIEW/IMAG ");
 
550
   kk = 10;
 
551
   }
 
552
 
 
553
else if (Widget_managed[0] == UxGetWidget(form7))       /* GET/CURSOR */
 
554
   {
 
555
   comndno = 6;
 
556
   swk[0] = text3;              /* out_specs */
 
557
   jswk[0] = 0;         /* = 0, indicates `text swidget' */
 
558
   jswk[1] = -2;                /* option  is set to ? */
 
559
   strcpy(cbuf,UxGetSet(toggleButton14));               /* mark */
 
560
   if (cbuf[0] == 't')
 
561
      strcpy(cswk[2],"YN");
 
562
   else
 
563
      strcpy(cswk[2],"NN");
 
564
   jswk[2] = -3;
 
565
   strcpy(cbuf,UxGetSet(toggleButton9));                /* No_Curs */
 
566
   if (cbuf[0] == 't')
 
567
      strcpy(cswk[3],"9999,1");
 
568
   else
 
569
      strcpy(cswk[3],"9999,2");
 
570
   jswk[3] = -3;
 
571
   strcpy(cbuf,UxGetSet(toggleButton8));                /* zoom_window */
 
572
   if (cbuf[0] == 't')
 
573
      strcpy(cswk[4],"N");
 
574
   else
 
575
      strcpy(cswk[4],"W");
 
576
   jswk[4] = -3;
 
577
   looplim = 5;
 
578
   strcpy(command,"GET/CURSOR ");
 
579
   kk = 11;
 
580
   }
 
581
 
 
582
 
 
583
else if (Widget_managed[0] == UxGetWidget(form1))       /* EXTRACT/TRACE */
 
584
   {
 
585
   comndno = 7;  
 
586
   swk[0] = text14;             /* stepsize */
 
587
   jswk[0] = 0;
 
588
   swk[1] = text7;              /* frame */
 
589
   jswk[1] = 0;
 
590
   strcpy(cbuf,UxGetMenuHistory(plotflag));
 
591
   swk[2] = UxFindSwidget(cbuf);        /* plot_flag */
 
592
   jswk[2] = -1;
 
593
   strcpy(cbuf,UxGetSet(toggleButton6));                /* cut_option */
 
594
   if (cbuf[0] == 't')
 
595
      strcpy(cswk[3],"NoCut");
 
596
   else
 
597
      strcpy(cswk[3],"Cut");
 
598
   jswk[3] = -3;
 
599
   looplim = 4;
 
600
   strcpy(command,"EXTRACT/TRACE ");
 
601
   kk = 14;
 
602
   }
 
603
 
 
604
 
 
605
 
 
606
 
 
607
else
 
608
   {
 
609
   printf("We should not come here...\n");
 
610
   return;
 
611
   }
 
612
 
 
613
 
 
614
 
 
615
 
 
616
for (loop=0; loop<looplim; loop++)
 
617
   {
 
618
   if (jswk[loop] == -1)
 
619
      {
 
620
      strcpy(cbuf,UxGetLabelString(swk[loop]));
 
621
      single = cbuf;
 
622
      }
 
623
   else if (jswk[loop] == -2)
 
624
      *single = '\0';
 
625
   else if (jswk[loop] == -3)
 
626
      single = cswk[loop];
 
627
   else
 
628
      single = XmTextGetString(UxGetWidget(swk[loop]));
 
629
 
 
630
   if ((loop > 1) && (jswk[loop-1] == 1))       /* glue together */
 
631
      {
 
632
      if (single[0] != '\0')
 
633
         {
 
634
         cpp = single;
 
635
         while (*cpp == ' ') cpp++;             /* skip blanks */
 
636
         command[kk-1] = ',';                   /* change ' ' to ','  */
 
637
         strcpy(&command[kk],cpp);
 
638
         kk = strlen(command);
 
639
         }
 
640
      }
 
641
   else
 
642
      {
 
643
      if (single[0] == '\0')
 
644
         command[kk++] = '?';
 
645
      else
 
646
         {
 
647
         strcpy(&command[kk],single);
 
648
         kk = strlen(command);
 
649
         }
 
650
      }
 
651
 
 
652
   if (jswk[loop] >= 0) XtFree(single);
 
653
   command[kk++] = ' ';
 
654
   }
 
655
 
 
656
command[kk] = '\0';
 
657
 
 
658
 
 
659
send_comnd:
 
660
if (MonitorPid == 0)
 
661
   printf("Midas> %s\n",command);
 
662
else
 
663
   {
 
664
   UxPutText(SHelp,"Command sent to Midas.");
 
665
   XtSetSensitive(UxGetWidget(pushButton1),FALSE);
 
666
 
 
667
 
 
668
/* XFlush(*UxDisplay);  <===  gives trouble on the HP + DECStation!!    */
 
669
 
 
670
 
 
671
/* send command to Midas + wait for response */
 
672
 
 
673
   kk = AppendDialogText(command);
 
674
   if (kk != OKSTAT)
 
675
      {
 
676
      miderr[0] = -1;
 
677
      strcpy(cbuf,"WARNING: ");
 
678
      if (kk == NOEXSTAT)
 
679
         strcpy(&cbuf[9],"No Midas there to talk to..."); 
 
680
      else if (kk == SENDSTAT)
 
681
         strcpy(&cbuf[9],"Could not write Midas command file..."); 
 
682
      else if (kk == RETSTAT)
 
683
         strcpy(&cbuf[9],"Could not read Midas response file...");
 
684
      else if (kk == BUSYSTAT)
 
685
         strcpy(&cbuf[9],"Midas is busy - resubmit command again...");
 
686
      }
 
687
   else
 
688
      {
 
689
      StatMidas("get",miderr,cbuf);             /* get  Midas return status */
 
690
      if (miderr[0] == 0) strcpy(cbuf,"all O.K.");
 
691
      }
 
692
   UxPutText(SHelp,cbuf);
 
693
 
 
694
   if ((miderr[0] == 0) && (comndno == 0)) goto begin;
 
695
 
 
696
   XtSetSensitive(UxGetWidget(pushButton1),TRUE);
 
697
   return;
 
698
   }
 
699
 
 
700
no_command:
 
701
   UxPutText(SHelp,"No command sent to Midas !!!");
 
702
 
 
703
 
 
704
}
 
705
 
 
706
 
 
707
/*
 
708
 
 
709
*/
 
710
 
 
711
 
 
712
 
 
713
 
 
714
utila(flag)
 
715
int  flag;
 
716
 
 
717
{
 
718
 
 
719
 
 
720
extern double stepsize[2];
 
721
 
 
722
char *cpp;
 
723
char cbuf[80];
 
724
 
 
725
int  dval[9], null, iav, imnoa;
 
726
int  mstatus;
 
727
 
 
728
int unit;
 
729
 
 
730
float  cuts[4], cutdelt;
 
731
double start[2];
 
732
 
 
733
 
 
734
/*  for chosen frame read the descriptors */
 
735
 
 
736
if (Widget_managed[0] == UxGetWidget(form2))    /* Load Image */
 
737
   {
 
738
   stepsize[0] = 1.0;
 
739
   stepsize[1] = 1.0;
 
740
 
 
741
   strcpy(cbuf,UxGetSet(toggleButton1));        /* test DescrVal flag */
 
742
   if (cbuf[0] != 't')
 
743
      {
 
744
      cutdelt = 1.0;
 
745
      sprintf(cbuf,"%8.4f",cutdelt);
 
746
      UxPutText(text25,cbuf);
 
747
      return;
 
748
      }
 
749
 
 
750
   cpp = XmTextGetString(UxGetWidget(text16));
 
751
   mstatus = SCFOPN(cpp,D_OLD_FORMAT,0,F_IMA_TYPE,&imnoa);
 
752
   if (mstatus != ERR_NORMAL) 
 
753
      {
 
754
      XtFree(cpp);
 
755
      strcpy(cbuf,"Could not open image...");
 
756
      UxPutText(SHelp,cbuf);
 
757
      return;
 
758
      }
 
759
   mstatus = SCDRDI(imnoa,"DISPLAY_DATA",1,9,&iav,dval,&unit,&null);
 
760
   if (mstatus != ERR_NORMAL)
 
761
      {
 
762
      dval[0] = 1;              /* default to scale 1,1 */
 
763
      dval[1] = 1;
 
764
      }
 
765
   else
 
766
      {
 
767
      if (dval[0] != 1) dval[0] = -dval[0];
 
768
      if (dval[1] != 1) dval[1] = -dval[1];
 
769
      }
 
770
   sprintf(cbuf,"%d",dval[0]);          /* X-scale */
 
771
   UxPutText(text39,cbuf);
 
772
   sprintf(cbuf,"%d",dval[1]);          /* Y-scale */
 
773
   UxPutText(text40,cbuf);
 
774
 
 
775
   mstatus = SCDRDD(imnoa,"START",1,2,&iav,start,&unit,&null);
 
776
   if (mstatus == ERR_NORMAL)
 
777
      mstatus = SCDRDD(imnoa,"STEP",1,2,&iav,stepsize,&unit,&null);
 
778
   if (mstatus != ERR_NORMAL)
 
779
      {
 
780
      strcpy(cbuf,"Descr. START/STEP not found...");
 
781
      UxPutText(SHelp,cbuf);
 
782
      goto close_it;
 
783
      }
 
784
 
 
785
   cutdelt = ((dval[2]-1)*stepsize[0]) + start[0];      /* convert to WC */
 
786
   sprintf(cbuf,"%8.4f",cutdelt);
 
787
   UxPutText(text20,cbuf);
 
788
   cutdelt = ((dval[3]-1)*stepsize[1]) + start[1];      /* convert to WC */
 
789
   sprintf(cbuf,"%8.4f",cutdelt);
 
790
   UxPutText(text24,cbuf);
 
791
 
 
792
   mstatus = SCDRDR(imnoa,"LHCUTS",1,4,&iav,cuts,&unit,&null);
 
793
   if (mstatus != ERR_NORMAL)
 
794
      {
 
795
      strcpy(cbuf,"     ");
 
796
      UxPutText(text11,cbuf);
 
797
      UxPutText(text12,cbuf);
 
798
      UxPutText(text15,cbuf);
 
799
      UxPutText(text22,cbuf);
 
800
      UxPutText(text25,cbuf);
 
801
      }
 
802
   else
 
803
      {
 
804
      sprintf(cbuf,"%8.4f",cuts[2]);            /* min + max */
 
805
      UxPutText(text11,cbuf);
 
806
      sprintf(cbuf,"%8.4f",cuts[3]);
 
807
      UxPutText(text12,cbuf);
 
808
 
 
809
      sprintf(cbuf,"%8.4f",cuts[0]);            /* low cut */
 
810
      UxPutText(text15,cbuf);
 
811
      sprintf(cbuf,"%8.4f",cuts[1]);            /* high cut */
 
812
      UxPutText(text22,cbuf);
 
813
 
 
814
      cutdelt = (cuts[1]-cuts[0])*0.1;
 
815
      if (cutdelt <= 10.e-20) cutdelt = 1.0;
 
816
      sprintf(cbuf,"%8.4f",cutdelt);
 
817
      UxPutText(text25,cbuf);
 
818
      }
 
819
 
 
820
close_it:
 
821
   SCFCLO(imnoa);
 
822
   XtFree(cpp);
 
823
   }
 
824
 
 
825
else if (Widget_managed[0] == UxGetWidget(form5))    /* EZ Load */
 
826
   {
 
827
   stepsize[0] = 1.0;
 
828
   stepsize[1] = 1.0;
 
829
 
 
830
   strcpy(cbuf,UxGetSet(toggleButton7));        /* test DescrVal flag */
 
831
   if (cbuf[0] != 't')
 
832
      {
 
833
      cutdelt = 1.0;
 
834
      sprintf(cbuf,"%8.4f",cutdelt);
 
835
      UxPutText(text36,cbuf);
 
836
      return;
 
837
      }
 
838
 
 
839
   cpp = XmTextGetString(UxGetWidget(text28));
 
840
   mstatus = SCFOPN(cpp,D_OLD_FORMAT,0,F_IMA_TYPE,&imnoa);
 
841
   if (mstatus != ERR_NORMAL) 
 
842
      {
 
843
      XtFree(cpp);
 
844
      strcpy(cbuf,"Could not open image...");
 
845
      UxPutText(SHelp,cbuf);
 
846
      return;
 
847
      }
 
848
   mstatus = SCDRDI(imnoa,"DISPLAY_DATA",1,9,&iav,dval,&unit,&null);
 
849
   if (mstatus != ERR_NORMAL)
 
850
      {
 
851
      dval[0] = 1;              /* default to scale 1,1 */
 
852
      dval[1] = 1;
 
853
      }
 
854
   else
 
855
      {
 
856
      if (dval[0] != 1) dval[0] = -dval[0];
 
857
      if (dval[1] != 1) dval[1] = -dval[1];
 
858
      }
 
859
 
 
860
   sprintf(cbuf,"%d",dval[0]);          /* X-scale */
 
861
   UxPutText(text31,cbuf);
 
862
   sprintf(cbuf,"%d",dval[1]);          /* Y-scale */
 
863
   UxPutText(text33,cbuf);
 
864
 
 
865
   mstatus = SCDRDR(imnoa,"LHCUTS",1,4,&iav,cuts,&unit,&null);
 
866
   if (mstatus != ERR_NORMAL)
 
867
      {
 
868
      strcpy(cbuf,"     ");
 
869
      UxPutText(text37,cbuf);
 
870
      UxPutText(text38,cbuf);
 
871
      UxPutText(text34,cbuf);
 
872
      UxPutText(text35,cbuf);
 
873
      UxPutText(text36,cbuf);
 
874
      }
 
875
   else
 
876
      {
 
877
      sprintf(cbuf,"%8.4f",cuts[2]);            /* min + max */
 
878
      UxPutText(text37,cbuf);
 
879
      sprintf(cbuf,"%8.4f",cuts[3]);
 
880
      UxPutText(text38,cbuf);
 
881
  
 
882
      sprintf(cbuf,"%8.4f",cuts[0]);            /* low cut */
 
883
      UxPutText(text34,cbuf);
 
884
      sprintf(cbuf,"%8.4f",cuts[1]);            /* high cut */
 
885
      UxPutText(text35,cbuf);
 
886
  
 
887
      cutdelt = (cuts[1]-cuts[0])*0.1;
 
888
      if (cutdelt <= 10.e-20) cutdelt = 1.0;
 
889
      sprintf(cbuf,"%8.4f",cutdelt);
 
890
      UxPutText(text36,cbuf);
 
891
      }
 
892
 
 
893
close_ita:
 
894
   SCFCLO(imnoa);
 
895
   XtFree(cpp);
 
896
   }
 
897
 
 
898
}
 
899
 
 
900
/*
 
901
 
 
902
*/
 
903
 
 
904
XD_Help(flg)
 
905
int  flg;
 
906
 
 
907
 
 
908
{
 
909
 
 
910
extern int kick[5];
 
911
 
 
912
extern Widget help_widget;
 
913
 
 
914
extern swidget  swhelp, shtext;
 
915
 
 
916
char   help[2000];
 
917
 
 
918
kick[4] = 0;                            /* remember which help was last */
 
919
 
 
920
if (flg == 0)                           /* the general help */
 
921
   {
 
922
   strcpy(help,
 
923
   "The `XDisplay' graphical user interface provides a collection\n ");
 
924
   strcat(help,
 
925
   "of interfaces for the commonly used Display related MIDAS commands.\n\n");
 
926
   strcat(help,
 
927
   "At the top, there is a menu bar containing pull-down menus for MIDAS\n");
 
928
   strcat(help,
 
929
   "commands, the help menu and the QUIT menu for exiting XDisplay.\n");
 
930
   strcat(help,
 
931
   "You activate a menu by clicking the left mouse button, then click again\n");
 
932
   strcat(help,
 
933
   "on the desired menu item.\n");
 
934
   strcat(help,
 
935
   "Below the menu bar is the space for the individual interfaces.\n\n");
 
936
   strcat(help,
 
937
   "Below that is a `Short Help' field. In here, help text is displayed, when\n");
 
938
   strcat(help,
 
939
   "you move the mouse over the labels of the interfaces. Also, status\n");
 
940
   strcat(help,
 
941
"messages from `XDisplay' will be displayed in the `Short Help' field.\n\n");
 
942
   strcat(help,
 
943
   "Below the `Short Help' field are different `Command' buttons and \nthe ");
 
944
   strcat(help,
 
945
   "`Apply' button.\n");
 
946
   strcat(help,
 
947
   "You choose an interface by clicking with the left mouse button on a \n");
 
948
   strcat(help,
 
949
    "specific command button. ");
 
950
  strcat(help,
 
951
  "The corresponding interface pops up and\nthe command button is disabled.\n");
 
952
  strcat(help,
 
953
   "You fill in the desired parameters and execute the command by\n");
 
954
   strcat(help,"clicking on the `Apply' button (left mouse button).\n\n");
 
955
  strcat(help,
 
956
   "Messages about the status of that command will be displayed\n");
 
957
  strcat(help,
 
958
   "in the `Short Help' field\n\n");
 
959
  strcat(help,
 
960
 "Not all options of the used MIDAS commands can be accessed via\nXDisplay. ");
 
961
  strcat(help,
 
962
"Use the MIDAS help to find out about more exotic options of\ne.g. LOAD/IMAGE.");
 
963
   }
 
964
 
 
965
else if (flg == 2)                           /* the editing help */
 
966
   {
 
967
   strcpy(help,"Editing a text field is done the Motif-style:\n");
 
968
   strcat(help,
 
969
"Moving the text cursor around in a text field is done via the arrow keys\n");
 
970
   strcat(help,
 
971
"of the terminal or by clicking at the desired position.\n");
 
972
   strcat(help,
 
973
   "If you want to delete a character (done with the `Backspace' key),\n");
 
974
   strcat(help,
 
975
   "you have to first move the text cursor to the right of that character.\n\n");
 
976
   strcat(help,
 
977
   "If there are arrows (up/down) next to a field with numerical data, you\n");
 
978
   strcat(help,"can click on these arrows to in/decrease the data values.\n");
 
979
   strcat(help,"A double click on the arrows changes the speed of the in/decrease.\n");
 
980
   }
 
981
 
 
982
else if (flg == 3)                              /* the selection help */
 
983
   {
 
984
   strcpy(help,
 
985
   "With a File_Selection_Window there are two ways to select a file:\n");
 
986
   strcat(help,
 
987
 "Click the left mouse button to select a file and return to the interface.\n");
 
988
   strcat(help,
 
989
   "Click the right mouse button to select a file and immediately send the");
 
990
   strcat(help,"\ncommand to MIDAS.\n");
 
991
   strcat(help,
 
992
   "I.e., in that case there is no need to push the `Apply' button...\n");
 
993
   }
 
994
 
 
995
else if (flg == 1)                              /* the selection help */
 
996
   {
 
997
   kick[4] = 1;
 
998
 
 
999
if (Widget_managed[0] == UxGetWidget(form5))    /* Quick Load */
 
1000
   {
 
1001
   strcpy(help,"This is the interface to quickly load an image. \n\n");
 
1002
   strcat(help,
 
1003
     "You type/edit the image name in the text field labelled `Frame' or\n");
 
1004
   strcat(help,
 
1005
   "click the right button of the mouse in there to get a list of all\n");
 
1006
   strcat(help,
 
1007
   "available `bdf' files in your directory.\n\n");
 
1008
   strcat(help,"If `Use Descr Values' is toggled to `Yes', then the Scale ");
 
1009
   strcat(help,"and Cut\nvalues are taken from the descriptors of the image.\n");
 
1010
   strcat(help,"The `MinMax' fields show the physical Minimum,  Maximum");
 
1011
   strcat(help," of the image\nand cannot be edited.\n \n");
 
1012
   strcat(help,
 
1013
     "Type/edit the name of the LUT in the text field labelled `LUT' or click\n");
 
1014
   strcat(help,"the right button of the mouse in there ");
 
1015
   strcat(help, "to get a list of all available LUTs.\n\n");
 
1016
   strcat(help,
 
1017
     "If you also want to create a display window,");
 
1018
   strcat(help," specify the size\nin the fileds labelled `SizeX', `SizeY'.\n");
 
1019
   strcat(help,"If not, toggle the `Create Display' button to `No'. \n");
 
1020
   strcat(help,"\nThe corresponding MIDAS commands are:\nLOAD/IMA, LOAD/LUT, CREATE/DISPLAY.");
 
1021
   }
 
1022
 
 
1023
else if (Widget_managed[0] == UxGetWidget(form2))    /* Load Image */
 
1024
   {
 
1025
   strcpy(help,
 
1026
   "This is the interface to load an image into an existing display. \n\n");
 
1027
   strcat(help,
 
1028
     "You type/edit the image name in the text field labelled `Frame' \n");
 
1029
   strcat(help,
 
1030
   "or click the right button of the mouse in there to get a list of all\n");
 
1031
   strcat(help,
 
1032
   "available `bdf' files in your directory.\n\n");
 
1033
   strcat(help,"If `Use Descr Values' is toggled to `Yes', then the Scale ");
 
1034
strcat(help,"and Cut\n values are taken from the descriptors of the image.\n");
 
1035
   strcat(help,"The `MinMax' fields show the physical Minimum,  Maximum");
 
1036
   strcat(help," of the image\nand cannot be edited.\n \n");
 
1037
   strcat(help,
 
1038
   "Modify the center image pixels via the arrows or type the values \n");
 
1039
   strcat(help,"directly into the text fields. \n");
 
1040
   strcat(help,"\nThe corresponding MIDAS command is: LOAD/IMAGE.");
 
1041
   }
 
1042
 
 
1043
else if (Widget_managed[0] == UxGetWidget(form4))    /* Load LUT */
 
1044
   {
 
1045
   strcpy(help,"This is the interface to load a LUT and/or ITT. \n\n");
 
1046
   strcat(help,
 
1047
     "You type/edit the name of the LUT in the text field labelled `LUT' or\n");
 
1048
   strcat(help,
 
1049
   "click the right button of the mouse in there to get a list of all\n");
 
1050
   strcat(help, "available LUTs.\n");
 
1051
   strcat(help,
 
1052
   "If `Display LUT' is toggled to `Yes', then a LUT bar is displayed at");
 
1053
   strcat(help," the\nbottom of the display.\n\n");
 
1054
   strcat(help,
 
1055
     "Type/edit the name of the ITT in the text field labelled `ITT' or click\n");
 
1056
   strcat(help,
 
1057
   "the right button of the mouse in there to get a list");
 
1058
   strcat(help, "of all available ITTs.\n");
 
1059
   strcat(help,"\nThe corresponding MIDAS commands are: LOAD/LUT, DISPLAY/LUT, LOAD/ITT.");
 
1060
   }
 
1061
 
 
1062
 
 
1063
else if (Widget_managed[0] == UxGetWidget(form7))    /* Get Cursor */
 
1064
   {
 
1065
   strcpy(help,"This is the interface to obtain image coordinates via ");
 
1066
   strcat(help,"the cursor (mouse). \n\n");
 
1067
   strcat(help,"You specify in the field labelled `Out_specs' where ");
 
1068
   strcat(help,"the results should go\n");
 
1069
   strcat(help,"to: either a table name, or a descriptor (via descr,DESC) or ");
 
1070
   strcat(help,"nothing\nif results are just displayed on the terminal.\n");
 
1071
   strcat(help,
 
1072
   "If `Mark Position' is toggled to `Yes', then the cursor position ");
 
1073
   strcat(help,"in the\n");
 
1074
   strcat(help,"display is marked with a cross or rectangle. \n");
 
1075
   strcat(help,
 
1076
   "With `No. Curs' you choose if one or two cursors are going to be used.\n");
 
1077
   strcat(help,
 
1078
   "If `Zoom Window' is toggled to `Yes', an additional window is opened;\n");
 
1079
   strcat(help,"clicking in the main window will choose a region which is");
 
1080
   strcat(help," zoomed and\nloaded into the zoom window.\n");
 
1081
   strcat(help,"Cursor coordinates are then picked in that window.\n");
 
1082
   strcat(help,"\nThe corresponding MIDAS command is: GET/CURSOR.");
 
1083
   } 
 
1084
 
 
1085
 
 
1086
else if (Widget_managed[0] == UxGetWidget(form1))    /* Extract Line */
 
1087
   {
 
1088
   strcpy(help,"This is the interface to extract a 1-dim line from the ");
 
1089
   strcat(help,"displayed image\nusing the mouse + arrow keys. \n\n");
 
1090
   strcat(help,"You specify in the field labelled `Out_Frame' the ");
 
1091
   strcat(help,"name of the resulting\n1-dim image (defaulted to `trace'). \n");
 
1092
   strcat(help,"With the menu labelled `Plot_Flag' you choose if the trace ");
 
1093
   strcat(help,
 
1094
   "is plotted\neither in the overlay plane of the display (Draw),\n");
 
1095
   strcat(help,"or in the graphics window (Plot),\nor not at all (None).\n");
 
1096
   strcat(help,
 
1097
   "If `Cut_Option' is toggled to `NoCut', then the trace extends through\n");
 
1098
   strcat(help,"the two cursor points to the ");
 
1099
   strcat(help,"borders of the image\n");
 
1100
   strcat(help,"if toggled to `Cut' only the line between the two cursors ");
 
1101
   strcat(help,
 
1102
   "is extracted.\n");
 
1103
   strcat(help,"In the field labelled `Stepsize' you set the sampling size ");
 
1104
   strcat(help,"along the\nextracted line ");
 
1105
   strcat(help,"(defaulted to the Stepsize in X of the displayed frame). \n");
 
1106
   strcat(help,"\nThe corresponding MIDAS command is: EXTRACT/TRACE.");
 
1107
   }
 
1108
 
 
1109
else if (Widget_managed[0] == UxGetWidget(form8))    /* Modify LUT */
 
1110
   {
 
1111
   strcpy(help,
 
1112
   "This is the interface to interactively modify the current LUT and/or ITT. \n");
 
1113
   strcat(help,
 
1114
   "Do not forget, that the cursor must be inside the image display.\n\n");
 
1115
   strcat(help,"With the menu labelled `LUT Method' you choose the method ");
 
1116
   strcat(help,"used for\nthe LUT modification. ");
 
1117
   strcat(help,
 
1118
   "And with the menu `LUT Colour' you specify\nthe colour to which ");
 
1119
   strcat(help,"this method is applied.\n");
 
1120
   strcat(help,"With the menu `ITT Method' you choose the method ");
 
1121
   strcat(help,"used for the ITT\nmodification. ");
 
1122
   strcat(help,
 
1123
   "And in the field labelled `ITT value' you specify the value\nwhich ");
 
1124
   strcat(help,"is used in the chosen method.\n");
 
1125
   strcat(help,
 
1126
   "The toggle buttons to the right indicate which command is executed,\n");
 
1127
   strcat(help,
 
1128
   "either the LUT modification, or the ITT modfication, or both.\n");
 
1129
   strcat(help,
 
1130
    "\nThe corresponding MIDAS commands are: MODIFY/LUT, MODIFY/ITT.");
 
1131
   }
 
1132
 
 
1133
else if (Widget_managed[0] == UxGetWidget(form3))    /* Explore Image */
 
1134
   {
 
1135
   strcpy(help,
 
1136
   "This is the interface to interactively explore an image in detail.\n\n");
 
1137
   strcat(help,
 
1138
     "If you leave the text field labelled `Frame' blank, the currently");   
 
1139
   strcat(help,
 
1140
   " displayed\nframe will be used. ");
 
1141
   strcat(help,
 
1142
     "You can type/edit the image name in the text field\nlabelled `Frame' ");
 
1143
   strcat(help,
 
1144
   "or click the right button of the mouse in there to get a list\n");
 
1145
   strcat(help,
 
1146
   "of all available `bdf' files in your directory.\n");
 
1147
   strcat(help,
 
1148
   "If `Plot_Option' is toggled to `Plot', histograms, line/column traces,");
 
1149
   strcat(help,
 
1150
" etc.\nare plotted in a graphics window, else nothing is plotted.\n");
 
1151
   strcat(help,
 
1152
   "If `File_Format' is toggled to `FITS', the input frame specified in the");
 
1153
   strcat(help,
 
1154
"\n`Frame' field should be in FITS format else it should be a MIDAS file.\n");
 
1155
   strcat(help,"In the field labelled `Out_Table' you specify an optional ");
 
1156
   strcat(help,
 
1157
"table name for\nsaving all image coordinates you click on in that table.\n");
 
1158
   strcat(help,
 
1159
    "\nThe corresponding MIDAS command is: VIEW/IMAGE.");
 
1160
   }
 
1161
 
 
1162
else if (Widget_managed[0] == UxGetWidget(form6))    /* Create Displ/Graphics */
 
1163
   {
 
1164
   strcpy(help,
 
1165
   "This is the interface to create a display or graphics window.\n\n");
 
1166
   strcat(help,
 
1167
   "Toggle `Type' to Display or Graphics, in order to create a display or\n");
 
1168
   strcat(help,"graphics window.\n");
 
1169
   strcat(help,"In the `Window_ID' field the display or graphics ID is set. ");
 
1170
   strcat(help,
 
1171
"Specify the\nsize and offset of the window via the fields which are");
 
1172
   strcat(help,
 
1173
" labelled `SizeX',\n`SizeY', `OffsetX' and `OffsetY'.\n");
 
1174
   strcat(help,
 
1175
"Only for a display window toggle `Alpha_Memory' to get an alphanumeric\n");
 
1176
   strcat(help, "field at the bottom of the display or not.\n");
 
1177
   strcat(help,
 
1178
 "The field labelled `Gsize' holds the no. of graphic segments saved for the\n");
 
1179
   strcat(help,
 
1180
"refreshing of the window. This value has to be increased to e.g. 100000\n");
 
1181
   strcat(help, "for very big spectra.\n");
 
1182
   strcat(help,
 
1183
"To create a display/graphics window on a different display, edit\n`Xstation'");
 
1184
   strcat(help, " to specify that.\n");
 
1185
   strcat(help,
 
1186
    "\nThe corresponding MIDAS commands are: CREATE/DISPLAY,\nCREATE/GRAPHICS.");
 
1187
   }
 
1188
 
 
1189
   }                                    /* flag = 1 section end */
 
1190
 
 
1191
else
 
1192
   return;
 
1193
 
 
1194
UxPutText(shtext,help);
 
1195
 
 
1196
UxPopupInterface(swhelp,no_grab);
 
1197
 
 
1198
}
 
1199