1
/* @(#)myaux.c 19.1 (ES0-DMD) 02/25/03 22:42:42 */
2
/*===========================================================================
3
Copyright (C) 1995 European Southern Observatory (ESO)
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.
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.
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,
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
27
===========================================================================*/
30
this file `myaux.c' is included as an auxiliary function
31
use the Declaration Editor of UIMX to store it there
33
if modified it has to be copied over to ../src so that it is found
37
#include <midas_def.h>
39
/******************************************************************
40
This function establishes a protocol callback that detects
41
the window manager Close command. */
43
void CreateWindowManagerProtocols(shell)
46
Atom xa_WM_DELETE_WINDOW;
48
xa_WM_DELETE_WINDOW = XInternAtom (UxDisplay, "WM_DELETE_WINDOW", False);
50
XmAddWMProtocolCallback (shell, xa_WM_DELETE_WINDOW, ExitCB, NULL);
54
/* This function pops up the Exit dialog box. */
56
void ExitCB(w, client_data, call_data)
61
UxPopupInterface (exitDialog, no_grab);
66
/******************************************************************
67
This function establishes a protocol callback to detect a "save
68
yourself" message from the session manager. */
70
void CreateSessionManagerProtocols()
72
Atom xa_WM_SAVE_YOURSELF;
74
xa_WM_SAVE_YOURSELF = XInternAtom (UxDisplay, "WM_SAVE_YOURSELF", False);
75
XmAddWMProtocolCallback (UxTopLevel, xa_WM_SAVE_YOURSELF, SaveSessionCB, NULL);
79
/*****************************************************************
80
This callback function is executed whenever this application
81
receives a "save yourself" callback from the session manager. */
86
printf("The session manager is saving a session ...\n");
87
printf(" ... (New Application) should save itself now!\n");
97
/* `applycom.c' the Activate Callback of the `Apply' button */
102
#define NOEXSTAT -999
103
#define SENDSTAT -1000
104
#define BUSYSTAT -1001
105
#define RETSTAT -1002
107
#define UNDEFINED -1009
114
extern int MonitorPid;
116
char command[160], *single, *singlf, *cpp, *cqq;
117
char cswk[40][8], cbuf[80], cd;
119
extern char actdisp[8];
120
static char dispbuf[8] = "false", appitt[8] = "false";
121
static char Qlut[40] = "";
122
static char Qima[64] = "";
124
extern int menuact[8];
126
int kk, jj, loop, looplim, miderr[2], comndno;
132
/* first check for the menu generated commands ... */
136
comndno = 100 + flag;
140
strcpy(command,"CLEAR/CHAN OVER");
144
strcpy(command,"CLEAR/ITT");
148
strcpy(command,"SET/ITT");
152
strcpy(command,"SET/LUT");
156
strcpy(command,"CLEAR/LUT");
160
strcpy(command,"CLEAR/DISPLAY");
164
strcpy(command,"CLEAR/CHAN");
168
strcpy(command,"RESET/DISPLAY");
172
strcpy(command,"CLEAR/OVER");
176
strcpy(command,"SET/OVER");
180
strcpy(command,"DISPLAY/LUT");
184
strcpy(command,"DISPLAY/LUT OFF");
188
strcpy(command,"DELETE/DISPLAY");
192
strcpy(command,"DELETE/GRAPHICS");
198
/* collect the different fields */
201
if (Widget_managed[0] == UxGetWidget(form2)) /* Load Image */
203
single = XmTextGetString(UxGetWidget(text41)); /* get display ID */
204
if (strcmp(actdisp,single) != 0)
206
strcpy(actdisp,single);
208
strcpy(command,"ASSIGN/DISP ");
209
strcpy(&command[12],actdisp);
214
strcpy(command,"LOAD/IMAG ");
219
for (loop=0; loop<looplim; loop++)
220
jswk[loop] = 0; /* = 0, indicates `text swidget' */
222
single = XmTextGetString(UxGetWidget(text16));
224
while (*cpp == ' ') cpp++;
227
if (*cpp == '\0') goto no_command; /* no image name there... */
229
swk[0] = text16; /* image name */
230
swk[1] = text2; /* channel */
231
swk[2] = text39; /* X scale */
233
swk[3] = text40; /* Y scale */
234
swk[4] = text20; /* X center */
236
swk[5] = text24; /* Y center */
237
swk[6] = text15; /* low cut */
239
swk[7] = text22; /* hi cut */
242
else if (Widget_managed[0] == UxGetWidget(form5)) /* Quick Load */
245
strcpy(cbuf,UxGetSet(toggleButton13));
248
strcpy(command,"CREATE/DISP 0 ");
249
single = XmTextGetString(UxGetWidget(text30));
251
while (*cpp == ' ') cpp++;
252
singlf = XmTextGetString(UxGetWidget(text32));
254
while (*cqq == ' ') cqq++;
255
if ((*cpp != '\0') && (*cqq != '\0'))
258
kk = strlen(command);
260
strcpy(&command[kk],cqq);
261
strcat(command,",630,330");
266
kk = strlen(command);
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);
277
Qima[0] = '\0'; /* force new loading */
287
single = XmTextGetString(UxGetWidget(text28)); /* get file name */
289
while (*cpp == ' ') cpp++;
292
if (strcmp(Qima,cpp) != 0)
294
strcpy(Qima,cpp); /* save new image name */
295
strcpy(&command[kk],"LOAD/IMAGE ");
297
strcpy(&command[kk],cpp);
298
kk = strlen(command);
299
strcpy(&command[kk]," ? ?");
301
singlf = XmTextGetString(UxGetWidget(text31)); /* scaleX */
303
while (*cpp == ' ') cpp++;
306
strcpy(&command[--kk],cpp);
307
kk = strlen(command);
310
singlf = XmTextGetString(UxGetWidget(text33)); /* scaleY */
312
while (*cpp == ' ') cpp++;
316
strcpy(&command[kk],cpp);
317
kk = strlen(command);
320
strcpy(&command[kk]," ? ");
322
singlf = XmTextGetString(UxGetWidget(text34)); /* low cut */
324
while (*cpp == ' ') cpp++;
331
singlf = XmTextGetString(UxGetWidget(text35)); /* high cut */
333
while (*cpp == ' ') cpp++;
337
strcpy(&cbuf[jj],cpp);
338
strcpy(&command[kk],cbuf);
346
kk = strlen(command);
347
if ((kk > 0) && (command[kk-1] != ';'))
353
single = XmTextGetString(UxGetWidget(text29)); /* get LUT name */
355
while (*cpp == ' ') cpp++;
358
if (strcmp(Qlut,cpp) != 0)
360
strcpy(Qlut,cpp); /* save new LUT */
361
strcpy(&command[kk],"LOAD/LUT ");
363
strcpy(&command[kk],cpp);
368
kk = strlen(command);
372
if (command[kk] == ';') command[kk] = '\0';
380
strcpy(Qima," !@#"); /* if nothing load image ... */
389
else if (Widget_managed[0] == UxGetWidget(form6)) /* Create Display/Graphics */
392
strcpy(cbuf,UxGetSet(toggleButton15));
404
for (loop=0; loop<looplim; loop++)
405
jswk[loop] = 0; /* = 0, indicates `text swidget' */
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 */
412
swk[3] = text6; /* dspoffsetX */
414
swk[4] = text8; /* dspoffsetY */
417
jswk[5] = -2; /* meminfo is set to ? */
418
strcpy(cbuf,UxGetSet(toggleButton25));
420
strcpy(cswk[6] ,"Yes");
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 ");
431
swk[5] = text13; /* Gsize */
432
swk[6] = text21; /* Xstation */
433
strcpy(command,"CREATE/GRAPH ");
438
else if (Widget_managed[0] == UxGetWidget(form4)) /* LOAD/LUT + ITT */
442
single = XmTextGetString(UxGetWidget(text9)); /* LUT name */
445
strcpy(command,"LOAD/LUT ");
447
strcpy(&command[kk],single);
448
kk = strlen(command);
454
strcpy(cbuf,UxGetSet(toggleButton10)); /* DisplayLUT */
455
if (strcmp(dispbuf,cbuf) != 0)
457
strcpy(dispbuf,cbuf);
458
if (dispbuf[0] == 't')
459
strcpy(&command[kk],"DISPLAY/LUT ON;");
461
strcpy(&command[kk],"DISPLAY/LUT OFF;");
465
single = XmTextGetString(UxGetWidget(text23)); /* ITT name */
468
strcpy(&command[kk],"LOAD/ITT ");
470
strcpy(&command[kk],single);
474
if (kk > 0) /* anything to send? */
476
kk = strlen(command) - 1;
477
if (command[kk] == ';') command[kk] = '\0'; /* omit last ';' */
485
else if (Widget_managed[0] == UxGetWidget(form8)) /* MODIFY/LUT + ITT */
488
strcpy(cbuf,UxGetSet(toggleButton3)); /* check LUT button */
492
strcpy(command,"MODIFY/LUT ");
494
strcpy(cbuf,UxGetMenuHistory(method2));
495
strcpy(&command[kk],UxGetLabelString(UxFindSwidget(cbuf)));
496
kk = strlen(command);
498
strcpy(cbuf,UxGetMenuHistory(color1));
499
strcpy(&command[kk],UxGetLabelString(UxFindSwidget(cbuf)));
500
kk = strlen(command);
503
strcpy(cbuf,UxGetSet(toggleButton5)); /* check ITT button */
506
if (kk > 0) /* also MODIFY/LUT selected ... */
511
strcpy(&command[kk],"MODIFY/ITT ");
513
strcpy(cbuf,UxGetMenuHistory(method1));
514
strcpy(&command[kk],UxGetLabelString(UxFindSwidget(cbuf)));
515
if (command[kk] == 'B') /* for BAND we also need value */
517
kk = strlen(command);
519
single = XmTextGetString(UxGetWidget(text27)); /* ITT value */
520
strcpy(&command[kk],single);
528
else if (Widget_managed[0] == UxGetWidget(form3)) /* VIEW/IMAGE */
531
for (loop=0; loop<4; loop++)
532
jswk[loop] = 0; /* = 0, indicates `text swidget' */
534
swk[0] = text10; /* image name */
535
swk[1] = text17; /* out_table */
536
strcpy(cbuf,UxGetSet(toggleButton2)); /* plot_option */
538
strcpy(cswk[2],"Plot");
540
strcpy(cswk[2],"NoPlot");
542
strcpy(cbuf,UxGetSet(toggleButton4)); /* file_format */
544
strcpy(cswk[3],"Midas");
546
strcpy(cswk[3],"FITS");
549
strcpy(command,"VIEW/IMAG ");
553
else if (Widget_managed[0] == UxGetWidget(form7)) /* GET/CURSOR */
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 */
561
strcpy(cswk[2],"YN");
563
strcpy(cswk[2],"NN");
565
strcpy(cbuf,UxGetSet(toggleButton9)); /* No_Curs */
567
strcpy(cswk[3],"9999,1");
569
strcpy(cswk[3],"9999,2");
571
strcpy(cbuf,UxGetSet(toggleButton8)); /* zoom_window */
578
strcpy(command,"GET/CURSOR ");
583
else if (Widget_managed[0] == UxGetWidget(form1)) /* EXTRACT/TRACE */
586
swk[0] = text14; /* stepsize */
588
swk[1] = text7; /* frame */
590
strcpy(cbuf,UxGetMenuHistory(plotflag));
591
swk[2] = UxFindSwidget(cbuf); /* plot_flag */
593
strcpy(cbuf,UxGetSet(toggleButton6)); /* cut_option */
595
strcpy(cswk[3],"NoCut");
597
strcpy(cswk[3],"Cut");
600
strcpy(command,"EXTRACT/TRACE ");
609
printf("We should not come here...\n");
616
for (loop=0; loop<looplim; loop++)
618
if (jswk[loop] == -1)
620
strcpy(cbuf,UxGetLabelString(swk[loop]));
623
else if (jswk[loop] == -2)
625
else if (jswk[loop] == -3)
628
single = XmTextGetString(UxGetWidget(swk[loop]));
630
if ((loop > 1) && (jswk[loop-1] == 1)) /* glue together */
632
if (single[0] != '\0')
635
while (*cpp == ' ') cpp++; /* skip blanks */
636
command[kk-1] = ','; /* change ' ' to ',' */
637
strcpy(&command[kk],cpp);
638
kk = strlen(command);
643
if (single[0] == '\0')
647
strcpy(&command[kk],single);
648
kk = strlen(command);
652
if (jswk[loop] >= 0) XtFree(single);
661
printf("Midas> %s\n",command);
664
UxPutText(SHelp,"Command sent to Midas.");
665
XtSetSensitive(UxGetWidget(pushButton1),FALSE);
668
/* XFlush(*UxDisplay); <=== gives trouble on the HP + DECStation!! */
671
/* send command to Midas + wait for response */
673
kk = AppendDialogText(command);
677
strcpy(cbuf,"WARNING: ");
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...");
689
StatMidas("get",miderr,cbuf); /* get Midas return status */
690
if (miderr[0] == 0) strcpy(cbuf,"all O.K.");
692
UxPutText(SHelp,cbuf);
694
if ((miderr[0] == 0) && (comndno == 0)) goto begin;
696
XtSetSensitive(UxGetWidget(pushButton1),TRUE);
701
UxPutText(SHelp,"No command sent to Midas !!!");
720
extern double stepsize[2];
725
int dval[9], null, iav, imnoa;
730
float cuts[4], cutdelt;
734
/* for chosen frame read the descriptors */
736
if (Widget_managed[0] == UxGetWidget(form2)) /* Load Image */
741
strcpy(cbuf,UxGetSet(toggleButton1)); /* test DescrVal flag */
745
sprintf(cbuf,"%8.4f",cutdelt);
746
UxPutText(text25,cbuf);
750
cpp = XmTextGetString(UxGetWidget(text16));
751
mstatus = SCFOPN(cpp,D_OLD_FORMAT,0,F_IMA_TYPE,&imnoa);
752
if (mstatus != ERR_NORMAL)
755
strcpy(cbuf,"Could not open image...");
756
UxPutText(SHelp,cbuf);
759
mstatus = SCDRDI(imnoa,"DISPLAY_DATA",1,9,&iav,dval,&unit,&null);
760
if (mstatus != ERR_NORMAL)
762
dval[0] = 1; /* default to scale 1,1 */
767
if (dval[0] != 1) dval[0] = -dval[0];
768
if (dval[1] != 1) dval[1] = -dval[1];
770
sprintf(cbuf,"%d",dval[0]); /* X-scale */
771
UxPutText(text39,cbuf);
772
sprintf(cbuf,"%d",dval[1]); /* Y-scale */
773
UxPutText(text40,cbuf);
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)
780
strcpy(cbuf,"Descr. START/STEP not found...");
781
UxPutText(SHelp,cbuf);
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);
792
mstatus = SCDRDR(imnoa,"LHCUTS",1,4,&iav,cuts,&unit,&null);
793
if (mstatus != ERR_NORMAL)
796
UxPutText(text11,cbuf);
797
UxPutText(text12,cbuf);
798
UxPutText(text15,cbuf);
799
UxPutText(text22,cbuf);
800
UxPutText(text25,cbuf);
804
sprintf(cbuf,"%8.4f",cuts[2]); /* min + max */
805
UxPutText(text11,cbuf);
806
sprintf(cbuf,"%8.4f",cuts[3]);
807
UxPutText(text12,cbuf);
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);
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);
825
else if (Widget_managed[0] == UxGetWidget(form5)) /* EZ Load */
830
strcpy(cbuf,UxGetSet(toggleButton7)); /* test DescrVal flag */
834
sprintf(cbuf,"%8.4f",cutdelt);
835
UxPutText(text36,cbuf);
839
cpp = XmTextGetString(UxGetWidget(text28));
840
mstatus = SCFOPN(cpp,D_OLD_FORMAT,0,F_IMA_TYPE,&imnoa);
841
if (mstatus != ERR_NORMAL)
844
strcpy(cbuf,"Could not open image...");
845
UxPutText(SHelp,cbuf);
848
mstatus = SCDRDI(imnoa,"DISPLAY_DATA",1,9,&iav,dval,&unit,&null);
849
if (mstatus != ERR_NORMAL)
851
dval[0] = 1; /* default to scale 1,1 */
856
if (dval[0] != 1) dval[0] = -dval[0];
857
if (dval[1] != 1) dval[1] = -dval[1];
860
sprintf(cbuf,"%d",dval[0]); /* X-scale */
861
UxPutText(text31,cbuf);
862
sprintf(cbuf,"%d",dval[1]); /* Y-scale */
863
UxPutText(text33,cbuf);
865
mstatus = SCDRDR(imnoa,"LHCUTS",1,4,&iav,cuts,&unit,&null);
866
if (mstatus != ERR_NORMAL)
869
UxPutText(text37,cbuf);
870
UxPutText(text38,cbuf);
871
UxPutText(text34,cbuf);
872
UxPutText(text35,cbuf);
873
UxPutText(text36,cbuf);
877
sprintf(cbuf,"%8.4f",cuts[2]); /* min + max */
878
UxPutText(text37,cbuf);
879
sprintf(cbuf,"%8.4f",cuts[3]);
880
UxPutText(text38,cbuf);
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);
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);
912
extern Widget help_widget;
914
extern swidget swhelp, shtext;
918
kick[4] = 0; /* remember which help was last */
920
if (flg == 0) /* the general help */
923
"The `XDisplay' graphical user interface provides a collection\n ");
925
"of interfaces for the commonly used Display related MIDAS commands.\n\n");
927
"At the top, there is a menu bar containing pull-down menus for MIDAS\n");
929
"commands, the help menu and the QUIT menu for exiting XDisplay.\n");
931
"You activate a menu by clicking the left mouse button, then click again\n");
933
"on the desired menu item.\n");
935
"Below the menu bar is the space for the individual interfaces.\n\n");
937
"Below that is a `Short Help' field. In here, help text is displayed, when\n");
939
"you move the mouse over the labels of the interfaces. Also, status\n");
941
"messages from `XDisplay' will be displayed in the `Short Help' field.\n\n");
943
"Below the `Short Help' field are different `Command' buttons and \nthe ");
945
"`Apply' button.\n");
947
"You choose an interface by clicking with the left mouse button on a \n");
949
"specific command button. ");
951
"The corresponding interface pops up and\nthe command button is disabled.\n");
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");
956
"Messages about the status of that command will be displayed\n");
958
"in the `Short Help' field\n\n");
960
"Not all options of the used MIDAS commands can be accessed via\nXDisplay. ");
962
"Use the MIDAS help to find out about more exotic options of\ne.g. LOAD/IMAGE.");
965
else if (flg == 2) /* the editing help */
967
strcpy(help,"Editing a text field is done the Motif-style:\n");
969
"Moving the text cursor around in a text field is done via the arrow keys\n");
971
"of the terminal or by clicking at the desired position.\n");
973
"If you want to delete a character (done with the `Backspace' key),\n");
975
"you have to first move the text cursor to the right of that character.\n\n");
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");
982
else if (flg == 3) /* the selection help */
985
"With a File_Selection_Window there are two ways to select a file:\n");
987
"Click the left mouse button to select a file and return to the interface.\n");
989
"Click the right mouse button to select a file and immediately send the");
990
strcat(help,"\ncommand to MIDAS.\n");
992
"I.e., in that case there is no need to push the `Apply' button...\n");
995
else if (flg == 1) /* the selection help */
999
if (Widget_managed[0] == UxGetWidget(form5)) /* Quick Load */
1001
strcpy(help,"This is the interface to quickly load an image. \n\n");
1003
"You type/edit the image name in the text field labelled `Frame' or\n");
1005
"click the right button of the mouse in there to get a list of all\n");
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");
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");
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.");
1023
else if (Widget_managed[0] == UxGetWidget(form2)) /* Load Image */
1026
"This is the interface to load an image into an existing display. \n\n");
1028
"You type/edit the image name in the text field labelled `Frame' \n");
1030
"or click the right button of the mouse in there to get a list of all\n");
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");
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.");
1043
else if (Widget_managed[0] == UxGetWidget(form4)) /* Load LUT */
1045
strcpy(help,"This is the interface to load a LUT and/or ITT. \n\n");
1047
"You type/edit the name of the LUT in the text field labelled `LUT' or\n");
1049
"click the right button of the mouse in there to get a list of all\n");
1050
strcat(help, "available LUTs.\n");
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");
1055
"Type/edit the name of the ITT in the text field labelled `ITT' or click\n");
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.");
1063
else if (Widget_managed[0] == UxGetWidget(form7)) /* Get Cursor */
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");
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");
1076
"With `No. Curs' you choose if one or two cursors are going to be used.\n");
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.");
1086
else if (Widget_managed[0] == UxGetWidget(form1)) /* Extract Line */
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 ");
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");
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 ");
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.");
1109
else if (Widget_managed[0] == UxGetWidget(form8)) /* Modify LUT */
1112
"This is the interface to interactively modify the current LUT and/or ITT. \n");
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. ");
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. ");
1123
"And in the field labelled `ITT value' you specify the value\nwhich ");
1124
strcat(help,"is used in the chosen method.\n");
1126
"The toggle buttons to the right indicate which command is executed,\n");
1128
"either the LUT modification, or the ITT modfication, or both.\n");
1130
"\nThe corresponding MIDAS commands are: MODIFY/LUT, MODIFY/ITT.");
1133
else if (Widget_managed[0] == UxGetWidget(form3)) /* Explore Image */
1136
"This is the interface to interactively explore an image in detail.\n\n");
1138
"If you leave the text field labelled `Frame' blank, the currently");
1140
" displayed\nframe will be used. ");
1142
"You can type/edit the image name in the text field\nlabelled `Frame' ");
1144
"or click the right button of the mouse in there to get a list\n");
1146
"of all available `bdf' files in your directory.\n");
1148
"If `Plot_Option' is toggled to `Plot', histograms, line/column traces,");
1150
" etc.\nare plotted in a graphics window, else nothing is plotted.\n");
1152
"If `File_Format' is toggled to `FITS', the input frame specified in the");
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 ");
1157
"table name for\nsaving all image coordinates you click on in that table.\n");
1159
"\nThe corresponding MIDAS command is: VIEW/IMAGE.");
1162
else if (Widget_managed[0] == UxGetWidget(form6)) /* Create Displ/Graphics */
1165
"This is the interface to create a display or graphics window.\n\n");
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. ");
1171
"Specify the\nsize and offset of the window via the fields which are");
1173
" labelled `SizeX',\n`SizeY', `OffsetX' and `OffsetY'.\n");
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");
1178
"The field labelled `Gsize' holds the no. of graphic segments saved for the\n");
1180
"refreshing of the window. This value has to be increased to e.g. 100000\n");
1181
strcat(help, "for very big spectra.\n");
1183
"To create a display/graphics window on a different display, edit\n`Xstation'");
1184
strcat(help, " to specify that.\n");
1186
"\nThe corresponding MIDAS commands are: CREATE/DISPLAY,\nCREATE/GRAPHICS.");
1189
} /* flag = 1 section end */
1194
UxPutText(shtext,help);
1196
UxPopupInterface(swhelp,no_grab);