DAS  3.1.6 - 18/09/2017
CreateForms.c
Go to the documentation of this file.
1  /*
2  **********************************************************************
3  * Module : CreateForms.c *
4  * Description : Functions to create shells and CallBack *
5  * *
6  **********************************************************************
7 */
8 
17 #include <windows.h>
18 #include <stdio.h>
19 #include <io.h>
20 #include <fcntl.h>
21 #include <sys/stat.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <conio.h>
25 #include <direct.h>
26 #include <ctype.h>
27 #include <math.h>
28 #include <fcntl.h>
29 
30 #include "mgui.h"
31 #include "dscud.h"
32 #include "DAS_Spatram.h"
33 #include "dcl.h"
34 #include "dil.h"
35 #include "wsc.h"
36 #include "dxl.h"
37 #include "bil.h"
38 //#include "dibed.h"
39 #include "DOAS.h"
40 #include "portio32.h"
41 
42 
43 extern int Com;
44 static int WlFlg=0;
45 char *WlBuff;
46 
47 static int MirFlg=0;
48 const char *MirBuff;
49 
50 static int FilFlg=0;
51 const char *FilBuff;
52 
53 static int NDFilFlg=0;
54 const char *NDFilBuff;
55 
56 static int HomeFlg=0;
57 char *HomeBuff;
58 
59 
60 static int GratFlg=0;
61 
62 
63 long STEPS;
64 int GrDIR;
65 
66 extern MTFont font;
67 extern DSCB dscb;
68 extern char PrgFile[16];// Nome della tabella da eseguire
69 
70 
72 
73 
74 // CCD & Camera vars
75 ccd DC_CCD; // CCD settings
76 ptf DC_HP; // Platform settings
77 config Cfg; // Camera controls & Options
79 dpwd DPWD; // Danbo Passw
80 //stepm STEPM; //Stepper Motors
81 tools TOOLS; //tools structure
82 GratingSt GRS; //Grating
86 
89 flag FLAG; //flags structure
90 paramini PARAM; //Param.ini
91 tools TOOLS; //tools structure
92 d_geo DGEO; // geographical coordinates structure
93 bil BIL; //Bortul Library Structure
94 GratingSt GRS; //Grating
96 
97 
99 ZenithSt ZST; //Zenith
100 AzimuthSt AST; //Azimuth
101 
102 void DB_Redraw_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
103 {
104 
105  int c = (int) a_data;
106 
107  switch (pe->type)
108  {
109  case (E_MOTION)://E_WINDOW_ENTER
110  //case (E_WINDOW_ENTER)://E_WINDOW_ENTER
111  {
112  switch (c)
113  {
114  case 0:
115  MObjectSetBackgroundRGB(obj, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
116  MObjectSetForegroundRGB(obj, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
117  break;
118  case 1:
119  MObjectSetBackgroundRGB(obj, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
120  MObjectSetForegroundRGB(obj, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
121  break;
122  case 2:
123  MObjectSetForegroundRGB(obj, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
124  MObjectSetBackgroundRGB(obj, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
125  break;
126  case 3:
127  MObjectSetForegroundRGB(obj, DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
128  MObjectSetBackgroundRGB(obj, DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
129  break;
130  case 4:
131  MObjectSetForegroundRGB(obj, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
132  MObjectSetBackgroundRGB(obj, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
133  break;
134  case 5:
135  MObjectSetForegroundRGB(obj, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
136  MObjectSetBackgroundRGB(obj, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
137  break;
138  case 6:
139  MObjectSetForegroundRGB(obj, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
140  MObjectSetBackgroundRGB(obj, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
141  break;
142  }
143  break;
144  }
145  }
146 
147 }
148 
149 
150 
152 {
153 
154  int i;
155  char buf[32];
156  MOBJECT tb, lbl;
157 
158  const char *channel[] ={{"Optic "}, //0
159  {"Out DX"}, //1
160  {"Out SX"}, //2
161  {"In DX "}, //3
162  {"In SX "}, //4
163  {"Grat. "}, //5
164  {"Elect."}, //6
165  {"MIGE "},//7
166  {"SPARE "},//8
167  {"SPARE "},//9
168  {"SPARE "},//10
169  {"SPARE "},//11
170  {"SPARE "},//12
171  {"SPARE "},//13
172  {"SPARE "},//14
173  {"SPARE "}};//15
174 
176  sprintf(buf,"Page 1");
177  MObjectSetText(pf, buf);
178  MObjectSetForegroundRGB(pf, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
179 
180 
181  tb = MCreateTableForm(pf, 2);
182  MObjectSetForegroundRGB(tb, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
183  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
184  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
188 
189 
190  for(i=0;i<8;i++)
191  {
192 
193 /*
194  DAS.Gui.ContrPanel.Plbl_LT[i] = MCreateLabel(tb, channel[i], FIXED_SMALL);
195  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LT[i], LEFT_ALIGN);
196  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LT[i], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
197  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LT[i], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
198  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LT[i], 0);
199 */
200 
201  lbl = MCreateLabel(tb, channel[i], FIXED_SMALL);
202  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
203  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
204  MObjectSetTransparency(lbl, 0);
206 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
207 
208  DAS.Gui.ContrPanel.Albl_LT[i] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
210  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_LT[i], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
211  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_LT[i], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
213 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LT[i], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
214  }
215 
217  sprintf(buf,"Page 2");
218  MObjectSetText(pf, buf);
219  MObjectSetForegroundRGB(pf, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
220 
221  tb = MCreateTableForm(pf, 2);
222  MObjectSetForegroundRGB(tb, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
223  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
224  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
228 
229  for(i=8;i<16;i++)
230  {
231 
232 /*
233  DAS.Gui.ContrPanel.Plbl_LT[i] = MCreateLabel(tb, channel[i], FIXED_SMALL);
234  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LT[i], LEFT_ALIGN);
235  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LT[i], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
236  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LT[i], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
237  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LT[i], 0);
238 */
239  lbl = MCreateLabel(tb, channel[i], FIXED_SMALL);
240  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
241  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
242  MObjectSetTransparency(lbl, 0);
244 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
245 
246  DAS.Gui.ContrPanel.Albl_LT[i] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
248  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_LT[i], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
249  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_LT[i], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
251 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LT[i], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
252  }
253 
255 
256 
257 }
258 
259 void StepperPagForm(int p, int q)
260 {
261 
262 
263  char buf[64];
264  int snum;
265  MOBJECT lbl;
266 
267  snum = 2 * p + q; //Stepper Number
268 
270  sprintf(buf,"SM%d",snum+1);
273 
274 
276  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
277  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
278  MObjectSetTransparency(lbl, 0);
279  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
280 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
281 
282  switch (snum)
283  {
284  case 0:
285  sprintf(buf, "Stepper Motor 1 - MIRROR ");
286  break;
287  case 1:
288  sprintf(buf, "Stepper Motor 2 - GRATING");
289  break;
290  case 2:
291  sprintf(buf, "Stepper Motor 3 - FILTER ");
292  break;
293  case 3:
294  sprintf(buf, "Stepper Motor 4 - NOT Con.");
295  break;
296  case 4:
297  sprintf(buf, "Stepper Motor 5 - ZENITH ");
298  break;
299  case 5:
300  sprintf(buf, "Stepper Motor 6 - AZIMUTH");
301  break;
302  }
303 
304  MObjectSetText(lbl,buf);
305 
307  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.frm_tbSM[p][q], DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
308  MBottomAttach(DAS.Gui.ContrPanel.frm_tbSM[p][q], F_ATT_NONE, 3, NULL);
313 
314  lbl = MCreateLabel(DAS.Gui.ContrPanel.frm_tbSM[p][q], "Power:", FIXED_SMALL);
315  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
316  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
317  MObjectSetTransparency(lbl, 0);
320  MObjectSetResize(lbl, True, True);
321 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
322 
323  DAS.Gui.ContrPanel.power[p][q] = MCreateLabel(DAS.Gui.ContrPanel.frm_tbSM[p][q], "000000", HELV_SMALL);
326  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.power[p][q], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
327  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.power[p][q], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
330 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.power[p][q], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
331 
332  lbl = MCreateLabel(DAS.Gui.ContrPanel.frm_tbSM[p][q], "Step:", FIXED_SMALL);
333  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
334  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
335  MObjectSetTransparency(lbl, 0);
338  MObjectSetResize(lbl, True, True);
339 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
340 
341  DAS.Gui.ContrPanel.step[p][q] = MCreateLabel(DAS.Gui.ContrPanel.frm_tbSM[p][q], "000000", HELV_SMALL);
344  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.step[p][q], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
345  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.step[p][q], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
348 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.step[p][q], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
349 
350  lbl = MCreateLabel(DAS.Gui.ContrPanel.frm_tbSM[p][q], "Slope:", FIXED_SMALL);
351  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
352  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
353  MObjectSetTransparency(lbl, 0);
356  MObjectSetResize(lbl, True, True);
357 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
358 
359  DAS.Gui.ContrPanel.slope[p][q] = MCreateLabel(DAS.Gui.ContrPanel.frm_tbSM[p][q], "00000", HELV_SMALL);
362  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.slope[p][q], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
363  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.slope[p][q], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
366 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.slope[p][q], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
367 
368 
369  lbl = MCreateLabel(DAS.Gui.ContrPanel.frm_tbSM[p][q], "Speed:", FIXED_SMALL);
370  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
371  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
372  MObjectSetTransparency(lbl, 0);
375  MObjectSetResize(lbl, True, True);
376 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
377 
378  DAS.Gui.ContrPanel.speed[p][q] = MCreateLabel(DAS.Gui.ContrPanel.frm_tbSM[p][q], "00000", HELV_SMALL);
381  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.speed[p][q], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
382  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.speed[p][q], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
385 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.speed[p][q], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
386 
387 
388 
389 }
390 
391 
392 /*
393 void FrmBuildStepper( struct cpl *pcpl,int snum)
394 {
395 
396  char buf[8];
397 
398  MPagedFormSetActivePage(pcpl->Pagedfrm_SM, snum);
399  sprintf(buf,"SM%d",snum+1);
400  MObjectSetText(pcpl->Pagedfrm_SM, buf);
401 
402  MObjectSetForegroundRGB(pcpl->Pagedfrm_SM, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
403 
404  switch (snum)
405  {
406  case 0:
407  pcpl->lbl[snum * 5] = MCreateLabel(pcpl->Pagedfrm_SM, "Stepper Motor 1 - MIRROR ", FIXED_SMALL);
408  break;
409  case 1:
410  pcpl->lbl[snum * 5] = MCreateLabel(pcpl->Pagedfrm_SM, "Stepper Motor 2 - GRATING", FIXED_SMALL);
411  break;
412  case 2:
413  pcpl->lbl[snum * 5] = MCreateLabel(pcpl->Pagedfrm_SM, "Stepper Motor 3 - FILTER ", FIXED_SMALL);
414  break;
415  case 3:
416  pcpl->lbl[snum * 5] = MCreateLabel(pcpl->Pagedfrm_SM, "Stepper Motor 4 - NOT Conn.", FIXED_SMALL);
417  break;
418  case 4:
419  pcpl->lbl[snum * 5] = MCreateLabel(pcpl->Pagedfrm_SM, "Stepper Motor 5 - ZENITH ", FIXED_SMALL);
420  break;
421  case 5:
422  pcpl->lbl[snum * 5] = MCreateLabel(pcpl->Pagedfrm_SM, "Stepper Motor 6 - AZIMUTH", FIXED_SMALL);
423  break;
424  }
425  MObjectSetForegroundRGB(pcpl->lbl[snum * 5], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
426  MObjectSetBackgroundRGB(pcpl->lbl[snum * 5], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
427  MObjectSetTransparency(pcpl->lbl[snum * 5], 0);
428  MObjectSetShadow(pcpl->lbl[snum * 5], WS_SHADOW_OUT, 1, 0);
429 
430 
431  pcpl->frm_tbSM[snum] = MCreateTableForm(pcpl->Pagedfrm_SM, 4);
432  MObjectSetBackgroundRGB(pcpl->frm_tbSM[snum], DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
433  MBottomAttach(pcpl->frm_tbSM[snum], F_ATT_NONE, 3, NULL);
434  MObjectAlign(pcpl->frm_tbSM[snum], UNDEF_ALIGN, TOP_ALIGN);
435  MObjectSetShadow(pcpl->frm_tbSM[snum], WS_SHADOW_IN, 2, 0);
436  MObjectSetBGColorFromParent(pcpl->frm_tbSM[snum], True, 100);
437 
438 
439  MObjectSetResize(pcpl->frm_tbSM[snum], True, False);
440 
441  pcpl->lbl[snum * 5 + 1] = MCreateLabel(pcpl->frm_tbSM[snum], "Power:", FIXED_SMALL);
442  MObjectSetForegroundRGB(pcpl->lbl[snum * 5 + 1], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
443  MObjectSetBackgroundRGB(pcpl->lbl[snum * 5 + 1], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
444  MObjectSetTransparency(pcpl->lbl[snum * 5 + 1], 0);
445  MLabelSetAlignment(pcpl->lbl[snum * 5 + 1], LEFT_ALIGN);
446  MObjectAlign(pcpl->lbl[snum * 5 + 1], LEFT_ALIGN, TOP_ALIGN);
447  MObjectSetResize(pcpl->lbl[snum * 5 + 1], True, True);
448 
449 
450  pcpl->cop[snum] = MCreateLabel(pcpl->frm_tbSM[snum], "000000", HELV_SMALL);
451  MObjectAlign(pcpl->cop[snum], RIGHT_ALIGN, TOP_ALIGN);
452  MLabelSetAlignment(pcpl->cop[snum], RIGHT_ALIGN);
453  MObjectSetForegroundRGB(pcpl->cop[snum], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
454  MObjectSetBackgroundRGB(pcpl->cop[snum], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
455  MObjectSetResize(pcpl->cop[snum], True, True);
456  MObjectSetTransparency(pcpl->cop[snum], 0);
457 
458  pcpl->lbl[snum * 5 + 2] = MCreateLabel(pcpl->frm_tbSM[snum], "Step:", FIXED_SMALL);
459  MLabelSetAlignment(pcpl->lbl[snum * 5 + 2], LEFT_ALIGN);
460  MObjectAlign(pcpl->lbl[snum * 5 + 2], RIGHT_ALIGN, TOP_ALIGN);
461  MObjectSetForegroundRGB(pcpl->lbl[snum * 5 + 2], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
462  MObjectSetBackgroundRGB(pcpl->lbl[snum * 5 + 2], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
463  MObjectSetTransparency(pcpl->lbl[snum * 5 + 2], 0);
464 
465  pcpl->step[snum] = MCreateLabel(pcpl->frm_tbSM[snum], "000000", HELV_SMALL);
466  MLabelSetAlignment(pcpl->step[snum], RIGHT_ALIGN);
467  MObjectAlign(pcpl->step[snum], RIGHT_ALIGN, TOP_ALIGN);
468  MObjectSetForegroundRGB(pcpl->step[snum], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
469  MObjectSetBackgroundRGB(pcpl->step[snum], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
470  MObjectSetResize(pcpl->step[snum], True, False);
471  MObjectSetTransparency(pcpl->step[snum], 0);
472 
473  pcpl->lbl[snum * 5 + 3] = MCreateLabel(pcpl->frm_tbSM[snum], "Slope:", FIXED_SMALL);
474  MLabelSetAlignment(pcpl->lbl[snum * 5 + 3], LEFT_ALIGN);
475  MObjectAlign(pcpl->lbl[snum * 5 + 3], LEFT_ALIGN, TOP_ALIGN);
476  MObjectSetForegroundRGB(pcpl->lbl[snum * 5 + 3], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
477  MObjectSetBackgroundRGB(pcpl->lbl[snum * 5 + 3], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
478  MObjectSetTransparency(pcpl->lbl[snum * 5 + 3], 0);
479 
480  pcpl->slope[snum] = MCreateLabel(pcpl->frm_tbSM[snum], "00000", HELV_SMALL);
481  MLabelSetAlignment(pcpl->slope[snum], RIGHT_ALIGN);
482  MObjectAlign(pcpl->slope[snum], RIGHT_ALIGN, TOP_ALIGN);
483  MObjectSetForegroundRGB(pcpl->slope[snum], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
484  MObjectSetBackgroundRGB(pcpl->slope[snum], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
485  MObjectSetResize(pcpl->slope[snum], True, False);
486  MObjectSetTransparency(pcpl->slope[snum], 0);
487 
488  pcpl->lbl[snum * 5 + 4] = MCreateLabel(pcpl->frm_tbSM[snum], "Speed:", FIXED_SMALL);
489  MLabelSetAlignment(pcpl->lbl[snum * 5 + 4], LEFT_ALIGN);
490  MObjectAlign(pcpl->lbl[snum * 5 + 4], RIGHT_ALIGN, TOP_ALIGN);
491  MObjectSetForegroundRGB(pcpl->lbl[snum * 5 + 4], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
492  MObjectSetBackgroundRGB(pcpl->lbl[snum * 5 + 4], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
493  MObjectSetTransparency(pcpl->lbl[snum * 5 + 4], 0);
494 
495  pcpl->speed[snum] = MCreateLabel(pcpl->frm_tbSM[snum], "00000", HELV_SMALL);
496  MLabelSetAlignment(pcpl->speed[snum], RIGHT_ALIGN);
497  MObjectAlign(pcpl->speed[snum], RIGHT_ALIGN, TOP_ALIGN);
498  MObjectSetForegroundRGB(pcpl->speed[snum], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
499  MObjectSetBackgroundRGB(pcpl->speed[snum], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
500  MObjectSetResize(pcpl->speed[snum], True, False);
501  MObjectSetTransparency(pcpl->speed[snum], 0);
502 
503 
504 }
505 */
506 void DB_HorComm_CB(MOBJECT p, void *od, void *ad)
507 {
508  int c = (int) ad;
509  int er = 0;
510  char buf[_MAX_PATH];
511  char fext[4];
512 
513  FB_PREFS fbp;
514 
515  memset (&fbp, 0, sizeof (fbp));
516 
517  fbp.change_cwd = True;
518  fbp.allow_dir_create = True;
519  fbp.allow_dir_rename = True;
520  fbp.allow_dir_delete = True;
521  fbp.transparent_tree = False;
522  fbp.font = HELV_SMALL;
523  fbp.button_font = HELV_SMALL;
524  //Set Img file
525  sprintf(buf, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "sys\\Tile2.bmp" );
526  fbp.bg_image_file =buf;
527 
528 
529  switch(c)
530  {
531  // External Lamp
532  case 3:
533  ExtLamp(0);
534  if(FLAG.extlamp == 0)
535  {
536  FLAG.extlamp = 1;
537  MObjectSetText(DAS.Gui.HorizMeas.lbl[3], " ON ");
538  MPixmapSetImageFile(DAS.Gui.HorizMeas.led[0], "SYS\\ledonQJ.bmp");
539 
540 
541  }
542  else
543  {
544  FLAG.extlamp = 0;
545  MObjectSetText(DAS.Gui.HorizMeas.lbl[3], " OFF ");
546  MPixmapSetImageFile(DAS.Gui.HorizMeas.led[0], "SYS\\ledoff.bmp");
547 
548  }
549  break;
550 
551  // External Shutter
552  case 4:
553  ExtShutt(FLAG.extshutter);
554  if(FLAG.extshutter == 0)
555  {
556  FLAG.extshutter = 1;
557  MObjectSetText(DAS.Gui.HorizMeas.lbl[4], "Close ");
558  MPixmapSetImageFile(DAS.Gui.HorizMeas.led[1], "SYS\\ledoff.bmp");
559 
560 
561  }
562  else
563  {
564  FLAG.extshutter = 0;
565  MObjectSetText(DAS.Gui.HorizMeas.lbl[4], "Open ");
566  MPixmapSetImageFile(DAS.Gui.HorizMeas.led[1], "SYS\\ledonQJ.bmp");
567 
568  }
569  break;
570 
571  // Calib
572  case 5:
573  D_Calibra();
574  break;
575 
576  //Autoranging
577  case 6:
578  AutoRange(0);
579  break;
580  //GetCCD
581  case 7:
582  sprintf(buf, "%.3lf", TExp);
583  er = DB_Ask("DOWNLOAD IMAGE", "", "Time Exposure: ", buf, 6, "Get Light");
584  if(er == 0)
585  {
586  DB_GetCCD(1);
587  }
588  break;
589  //Average
590  case 8:
591  D_Average(1);
592  break;
593  //Dark
594  case 9:
595  strcpy(buf, "1.0");
596  er = DB_Ask("DOWNLOAD DARK", "", "Time Exposure: ", buf, 6, "Get Dark");
597  if(er == 0)
598  {
599  DB_GetCCD(0);
600  }
601  break;
602 
603  //Save CCD Data
604  case 10:
605 
606  if(DAS.DOption.filename) // Automatic file Names
607  {
608  D_Saving();
609  }
610  else // free choice
611  {
612  if(DAS.DOption.savingmode)
613  er = MFileBrowseExt ("Save File as...", "*.bif", NFileNameF, BIL.DFILEM.DATADIRECTORY, &fbp);
614  else
615  er = MFileBrowseExt ("Save File as...", "*.dat", NFileNameF, BIL.DFILEM.DATADIRECTORY, &fbp);
616  if(er)
617  {
618  //check the presence of the extension
619  DI_FindExtName(NFileNameF, fext);
620  if( strcmp(fext,"") == 0 )
621  {
622  if(DAS.DOption.savingmode)
623  strcat(NFileNameF, ".bif");
624  else
625  strcat(NFileNameF, ".dat");
626  }
627  //check the the extension
628  DI_FindExtName(NFileNameF, fext);
629  if( (strcmp(fext,".dat") == 0) | (strcmp(fext,".Dat") == 0) )
630  {
631  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",BIL.DFILEM.DATADIRECTORY, NFileNameF);
632  DB_Save(BIL.DFILEM.DBFILENAME, 0);
633  }
634  else if( (strcmp(fext,".bif") == 0) | (strcmp(fext,".Bif") == 0) )
635  {
636  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",BIL.DFILEM.DATADIRECTORY, NFileNameF);
637  DB_Save(BIL.DFILEM.DBFILENAME, 1);
638  }
639  else
640  {
641  sprintf(buf, "The extension is not recognaized! Please re-type",fext);
642  MMessageDialog("DAS information", buf, " Ok ", NULL);
643  break;
644  }
645  }
646 
647 
648  sprintf(buf, "%s", NFileNameF );
649  MObjectSetText(DAS.Gui.ContrPanel.Albl_CS[3], buf);
650  sprintf(buf, "%05d", SaveCnt);
651  MObjectSetText(DAS.Gui.ContrPanel.Albl_CS[2], buf);
652  SaveCnt++;
653 
654  }
655  break;
656 
657  //On line Plot
658  case 11:
659  ViewPlot(1);
660  break;
661 
662  // ZOOM
663  case 12:
664  DI_Lens();
665  break;
666  //Close
667  case 13:
671  DAS.Flag.manhormeas = 0;
672 
673  break;
674 
675 
676  }
677 }
678 
679 
680 
682 {
683 
684  char buff[128];
685 
686  MOBJECT rowfrm,rowfrm1,rowfrm2, tb;
687 
688  MOBJECT _colform000;
689 // MOBJECT _colform001;
690 // MOBJECT _colform005;
691 // MOBJECT _rowform001;
692 // MOBJECT _rowform002;
693 // MOBJECT _tablefrm002;
694 // MOBJECT _tablefrm004;
695 // MOBJECT _tablefrm005;
696 // MOBJECT _tablefrm006;
697 
698  int i;
699 const char *KeyCom_Code[] = {{"Mirror "}, //0
700  {"Grating "}, //1
701  {"Filter "}, //2
702  {"Ext Lamp"}, //3
703  {"Ext Shut"}, //4
704  {"Calib "}, //5
705  {"ARange "}, //6
706  {"GetCCD "}, //7
707  {"Average "}, //8
708  {"Dark "}, //9
709  {"Save "}, //10
710  {"PLOT "}, //11
711  {"ZOOM "},//12
712  {"Close "}};//13
713 
714 
716  FLAG.manhormeas = 1;
717 
718 
719  DAS.Gui.HorizMeas.shell = MCreateShell("Horizontal Measurements", SF_NO_RESIZE|SF_NO_MAXIMIZE|SF_NO_CLOSE);
720  MObjectSetBackgroundRGB(DAS.Gui.HorizMeas.shell, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
722 
723  _colform000 = MCreateColForm(DAS.Gui.HorizMeas.shell);
724  MObjectSetBackgroundRGB(_colform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
725  MObjectSetShadow(_colform000, WS_NONE, 0, 0);
726 
727  rowfrm = MCreateRowForm(_colform000);
728  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
729  MObjectSetShadow(rowfrm, WS_NONE, 0, 0);
731 
732  tb = MCreateTableForm(rowfrm, 2);
733  MBottomAttach(tb, F_ATT_NONE, 3, NULL);
735  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
737  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
738 // MObjectAlign(tb, UNDEF_ALIGN, TOP_ALIGN);
739 
740  for (i=0; i < 3; i++)
741  {
742  DAS.Gui.HorizMeas.pbutt[i] = MCreatePButton(tb, KeyCom_Code[i], HELV_SMALL);
743  MObjectSetBackgroundRGB(DAS.Gui.HorizMeas.pbutt[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
744  MObjectSetForegroundRGB(DAS.Gui.HorizMeas.pbutt[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
746  MPButtonSetCallback(DAS.Gui.HorizMeas.pbutt[i], DB_KeyB_CB, (void *) i);
748 
749  // if (i==0)
750  MObjectGetText(DAS.Gui.ContrPanel.Albl_LS[i], buff);
751  /* if (i==1)
752  MObjectGetText(CPL.Albl_LS[1], buff);
753  if (i==2)
754  MObjectGetText(CPL.Albl_LS[2], buff);
755  */
756  DAS.Gui.HorizMeas.lbl[i] = MCreateLabel(tb, buff, HELV_SMALL);
758  MObjectSetForegroundRGB(DAS.Gui.HorizMeas.lbl[i], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
759  MObjectSetBackgroundRGB(DAS.Gui.HorizMeas.lbl[i], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
761  }
762 
763 
764  rowfrm1 = MCreateRowForm(_colform000);
765  MObjectSetBackgroundRGB(rowfrm1, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
766  MObjectSetShadow(rowfrm1, WS_NONE, 0, 0);
768 
769  tb = MCreateTableForm(rowfrm1, 3);
770  MBottomAttach(tb, F_ATT_NONE, 3, NULL);
772  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
774  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
775 // MObjectAlign(tb, UNDEF_ALIGN, TOP_ALIGN);
776 
777  for (i=3; i < 5; i++)
778  {
779  DAS.Gui.HorizMeas.pbutt[i] = MCreatePButton(tb, KeyCom_Code[i], HELV_SMALL);
780  MObjectSetBackgroundRGB(DAS.Gui.HorizMeas.pbutt[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
781  MObjectSetForegroundRGB(DAS.Gui.HorizMeas.pbutt[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
782  //if (i==0)
783  // MObjectSetBackgroundRGB(DAS.Gui.HorizMeas.pbutt[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
785  MPButtonSetCallback(DAS.Gui.HorizMeas.pbutt[i], DB_HorComm_CB, (void *) i);
786  //MObjectAddEventNotifyCallback(DAS.Gui.HorizMeas.pbutt[i], (OBJ_EVENT_CB) DB_KeyComSelButtKB_CB, EM_KEY_PRESS, (void *) i);
787  //MObjectAddEventNotifyCallback(DAS.Gui.HorizMeas.pbutt[i], (OBJ_EVENT_CB) DB_KeyComSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
789 
790  if (i == 4)
791  {
792  if(FLAG.extshutter == 0)
793  {
794  sprintf (buff,"Open ");
795  DAS.Gui.HorizMeas.led[i - 3] = MCreatePixmapFromFile(tb, "SYS\\ledonQJ.bmp");
796  MObjectSetShadow(DAS.Gui.HorizMeas.led[i - 3], WS_NONE, 0, 0);
797  }
798  else
799  {
800 
801  sprintf (buff,"Close ");
802  DAS.Gui.HorizMeas.led[i - 3] = MCreatePixmapFromFile(tb, "SYS\\ledoff.bmp");
803  MObjectSetShadow(DAS.Gui.HorizMeas.led[i - 3], WS_NONE, 0, 0);
804  }
805  DAS.Gui.HorizMeas.lbl[i] = MCreateLabel(tb, buff, HELV_SMALL);
807  MObjectSetForegroundRGB(DAS.Gui.HorizMeas.lbl[i], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
808  MObjectSetBackgroundRGB(DAS.Gui.HorizMeas.lbl[i], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
810  }
811  if (i == 3)
812  {
813  if(FLAG.extlamp == 0)
814  {
815  sprintf (buff,"On ");
816  DAS.Gui.HorizMeas.led[i - 3] = MCreatePixmapFromFile(tb, "SYS\\ledonQJ.bmp");
817  MObjectSetShadow(DAS.Gui.HorizMeas.led[i - 3], WS_NONE, 0, 0);
818  }
819  else
820  {
821  sprintf (buff,"OFF ");
822  DAS.Gui.HorizMeas.led[i - 3] = MCreatePixmapFromFile(tb, "SYS\\ledoff.bmp");
823  MObjectSetShadow(DAS.Gui.HorizMeas.led[i - 3], WS_NONE, 0, 0);
824  }
825 
827  DAS.Gui.HorizMeas.lbl[i] = MCreateLabel(tb, buff, HELV_SMALL);
829  MObjectSetForegroundRGB(DAS.Gui.HorizMeas.lbl[i], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
830  MObjectSetBackgroundRGB(DAS.Gui.HorizMeas.lbl[i], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
832 
833  }
834 /* DAS.Gui.HorizMeas.lbl[i] = MCreateLabel(tb, buff, HELV_SMALL);
835  MLabelSetAlignment(DAS.Gui.HorizMeas.lbl[i], RIGHT_ALIGN);
836  MObjectSetForegroundRGB(DAS.Gui.HorizMeas.lbl[i], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
837  MObjectSetBackgroundRGB(DAS.Gui.HorizMeas.lbl[i], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
838  MObjectSetTransparency(DAS.Gui.HorizMeas.lbl[i], 0);
839 
840 */
841 // DAS.Gui.HorizMeas.led[i - 3] = MCreatePixmapFromFile(tb, "SYS\\ledonQJ.bmp");
842 // MObjectSetShadow(DAS.Gui.HorizMeas.led[i - 3], WS_NONE, 0, 0);
843 
844  }
845 
846  rowfrm2 = MCreateRowForm(_colform000);
847  MObjectSetBackgroundRGB(rowfrm2, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
848  MObjectSetShadow(rowfrm2, WS_NONE, 0, 0);
850 
851  tb = MCreateTableForm(rowfrm2, 3);
852  MBottomAttach(tb, F_ATT_NONE, 3, NULL);
854  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
856  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
857 // MObjectAlign(tb, UNDEF_ALIGN, TOP_ALIGN);
858 
859  for (i=5; i < 14; i++)
860  {
861  DAS.Gui.HorizMeas.pbutt[i] = MCreatePButton(tb, KeyCom_Code[i], HELV_SMALL);
862  MObjectSetBackgroundRGB(DAS.Gui.HorizMeas.pbutt[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
863  MObjectSetForegroundRGB(DAS.Gui.HorizMeas.pbutt[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
864  //if (i==0)
865  // MObjectSetBackgroundRGB(DAS.Gui.HorizMeas.pbutt[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
867  MPButtonSetCallback(DAS.Gui.HorizMeas.pbutt[i], DB_HorComm_CB, (void *) i);
868  //MObjectAddEventNotifyCallback(DAS.Gui.HorizMeas.pbutt[i], (OBJ_EVENT_CB) DB_KeyComSelButtKB_CB, EM_KEY_PRESS, (void *) i);
869  //MObjectAddEventNotifyCallback(DAS.Gui.HorizMeas.pbutt[i], (OBJ_EVENT_CB) DB_KeyComSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
871  }
872 
874 
875  return 0;
876 
877 }
878 /**********************************************************************/
879 /* Control Panel Shell and CallBaks */
880 /**********************************************************************/
881 
882 void DB_PushButtonMouse(int mod, int event, MOBJECT obj, struct pbutt *ppbutt)
883 {
884 
885  int i, count;
886  switch (mod)
887  {
888  case (1): //Input Mirror Buttons
889  {
890  count = (sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0]);
891  for (i=0; i<count; i++)
892  {
893  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
894  MObjectSetForegroundRGB(DAS.Gui.PushButt.Mir[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
895  if (i==MIS.Pos)
896  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], 0, 0, 255);
897  }
898  switch (event)
899  {
900  case (0):
901  {
902  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
903  break;
904  }
905  case (1):
906  {
907  for (i=0; i<count; i++)
908  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
909  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
910  MSelectObject(obj);
911  break;
912  }
913  }
914  break;
915  }
916  case (2): //Grating Buttons
917  {
918  count = (sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0]);
919  for (i=0; i<count; i++)
920  {
921  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
922  MObjectSetForegroundRGB(DAS.Gui.PushButt.Wl[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
923  if (i==GRS.Wl)
924  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[i], 0, 0, 255);
925  }
926  switch (event)
927  {
928  case (0):
929  {
930  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
931  break;
932  }
933  case (1):
934  {
935  for (i=0; i<count; i++)
936  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
937  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
938  MSelectObject(obj);
939  break;
940  }
941  }
942  break;
943  }
944 
945  }
946 
947 
948 
949 }
950 void DB_PushButtonMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
951 {
952 
953 
954  int c = (int) a_data, i, count;
955  switch (c)
956  {
957  case (1): // Input Mirror
958  {
959  count = (sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0]);
960  for (i=0; i<count; i++)
961  {
962  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
963  MObjectSetForegroundRGB(DAS.Gui.PushButt.Mir[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
964  if (i==MIS.Pos)
965  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], 0, 0, 255);
966  }
967  switch (pe->button)
968  {
969  case (Button1):
970  {
971  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
972  break;
973  }
974  }
975 
976  switch (pe->type)
977  {
978  case (E_MOTION):
979  {
980 
981  for (i=0; i<count; i++)
982  { MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
983  if (i==MIS.Pos)
984  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], 0, 0, 255);
985  }
986  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
987  MSelectObject(obj);
988  break;
989  }
990  }
991  break;
992  }
993  case (2): // Grating
994  {
995  count = (sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0]);
996  for (i=0; i<count; i++)
997  {
998 // MObjectSetBackgroundRGB(PBUTT.Wl[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
999 // MObjectSetForegroundRGB(PBUTT.Wl[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1000  if (i==GRS.Wl)
1001  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[i], 0, 0, 255);
1002  }
1003  switch (pe->button)
1004  {
1005  case (Button1):
1006  {
1007  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
1008  break;
1009  }
1010  }
1011 
1012  switch (pe->type)
1013  {
1014  case (E_MOTION):
1015  {
1016 
1017  for (i=0; i<count; i++)
1018  {
1019  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1020  if (i==GRS.Wl)
1021  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[i], 0, 0, 255);
1022  }
1023  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
1024  MSelectObject(obj);
1025  break;
1026  }
1027  }
1028  break;
1029  }
1030  case (3): // Filter
1031  {
1032  count = (sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]);
1033  for (i=0; i<count; i++)
1034  {
1035 // MObjectSetBackgroundRGB(PBUTT.Wl[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1036 // MObjectSetForegroundRGB(PBUTT.Wl[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1037  if (i==FWS.Pos)
1038  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], 0, 0, 255);
1039  }
1040  switch (pe->button)
1041  {
1042  case (Button1):
1043  {
1044  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
1045  break;
1046  }
1047  }
1048 
1049  switch (pe->type)
1050  {
1051  case (E_MOTION):
1052  {
1053 
1054  for (i=0; i<count; i++)
1055  {
1056  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1057  if (i==FWS.Pos)
1058  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], 0, 0, 255);
1059  }
1060  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
1061  MSelectObject(obj);
1062  break;
1063  }
1064  }
1065  break;
1066  }
1067  case (4): // NDFilter
1068  {
1069  count = (sizeof DAS.Gui.PushButt.NDFil / sizeof DAS.Gui.PushButt.NDFil[0]);
1070  for (i=0; i<count; i++)
1071  {
1072 // MObjectSetBackgroundRGB(PBUTT.Wl[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1073 // MObjectSetForegroundRGB(PBUTT.Wl[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1074  if (i==NDFWS.Pos)
1075  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[i], 0, 0, 255);
1076  }
1077  switch (pe->button)
1078  {
1079  case (Button1):
1080  {
1081  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
1082  break;
1083  }
1084  }
1085 
1086  switch (pe->type)
1087  {
1088  case (E_MOTION):
1089  {
1090 
1091  for (i=0; i<count; i++)
1092  {
1093  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1094  if (i==NDFWS.Pos)
1095  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[i], 0, 0, 255);
1096  }
1097  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
1098  MSelectObject(obj);
1099  break;
1100  }
1101  }
1102  break;
1103 
1104  }
1105  }
1106 
1107 
1108 }
1109 
1110 void PopUpAdvCal_CB(MOBJECT obj, void *item, void *data)
1111 {
1112  int c = (int) data;
1113 // char buf[16];
1114 
1115  MMessageDialog("DAS Inf", "Procedure not implemented yet!!!", "OK", NULL);
1116 
1117 }
1118 
1119 /**************************************************
1120  * This callback opens a popup menu when the right
1121  * mouse button is pressed within the Object which
1122  * this callback is set to.
1123  * X and Y positions for this popup are those in the
1124  * mouse event.
1125  **************************************************/
1126 void PupAdvCal_CB(MOBJECT obj, MEvent * pe, void *pdown)
1127 {
1128 
1129 // char buf[16];
1130 
1131  if (pe->mouse.button == Button3)
1132 
1133  MPopupMenu ((MOBJECT) pdown, pe->mouse.x_root, pe->mouse.y_root);
1134 
1135 }
1136 
1137 
1140 
1141 
1142 
1144 {
1145 
1146  MOBJECT colfrm; //main Container
1147 
1148  MOBJECT rowfrm; //left buttons container (first column)
1149 
1150  MOBJECT tb, pb;
1151  MOBJECT lbl; //
1152 
1153  MOBJECT Pagedfrm_Temp;
1154 
1155  int i, k, c = 0;
1156  int d_events = 0;
1157  char buff[128];
1158 const char *KeyCom_Code[] = {{"&Mirror"}, //0 0
1159  {"&Grating"}, //1 1
1160  {"&Filter "}, //2 2
1161 
1162  {"&NDFilter"}, //5 4
1163  {"&MIGE Pos"}, //4 3
1164 
1165  {"&Ref. Pos."}, //6 5
1166  {"F ECU Off "}, //7 6
1167  {"SPARE "}, //8 7
1168 
1169  {"SPARE "}, //10 8
1170  {"SPARE "}, //11 9
1171  {"Sim.Pos."}, //9 10
1172  {"&Horiz M"}, //3 11
1173 
1174  {"M&vGrat."}, //12 12
1175  {"&Config"},//13 13
1176 
1177  {" Ca&lib "}, //14
1178  {"ARan&ge "}, //15
1179  {"Ge&tCCD "}, //16
1180  {"Average"}, //17
1181  {"Dark "}, //18
1182  {"Save "}, //19
1183  {" PLOT "}, //20
1184  {" ZOOM "},//21
1185  {"P &X Off"},//22
1186  {"P &Y Off"},//23
1187  {"A&bout "},//24
1188  {"&Pause "},//25
1189  {"&Tools "},//26
1190  {"&Quit "}};//27
1191 
1192 const char *KeyCom_CodePopUpHelp[]= {{"Set Input Mirror position"}, //0
1193  {"Set Grating Position"}, //1
1194  {"Set Filter wheel Position"}, //2
1195  {"Set Zenith and Azimuth Position"}, //4
1196  {"Set zimuth Position"}, //5
1197  {"Look for Input Mirror Ref. Pos."}, //6
1198  {"Look for Grating Ref. Pos."}, //7
1199  {"Look for Filter Wheel Ref. Pos."}, //8
1200  {"Look for Zenith Ref. Pos. "}, //10
1201  {"Look for Azimuth Ref. Pos."}, //11
1202  {"Create shell for Simultaneous Positioning"}, //9
1203  {"Create Shell for Horizontal Measurements"}, //3
1204  {"Create Shell for free Grating movements"}, //12
1205  {"Open DAS Configuration tool"},//13
1206 
1207  {"Automatic Calibration "}, //14
1208  {"Computation Optimum Exposure time "}, //15
1209  {"Carry out Light Measurement"}, //16
1210  {"Perform Averaged Measurement"}, //17
1211  {"Carry out Dark Measurement "}, //18
1212  {"Save current measurements "}, //19
1213  {"2D Plot of image"}, //20
1214  {"Image Zoom "},//21
1215  {"X Profile On/Off"},//22
1216  {"Y Profile On/Off"},//23
1217  {"Info & Help "},//24
1218  {"Pause/Resume Script Execution "},//25
1219  {"Open tools Shell "},//26
1220  {"Exit Program "}};//27
1221 
1222 
1223  /**********************************************************************************/
1224  // Set the message dialog color and font format
1225  MSetMessageDialogRGB(DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1226  MSetMessageDialogFgRGB(DPAL.DB_FG_Albl[0],DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1228  MSetInputPromptRGB(DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1229  MSetInputPromptFgRGB(DPAL.DB_FG_Albl[0],DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1231  /**********************************************************************************/
1232 
1234  MObjectSetBackgroundRGB(CP_Sh, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1235  //MObjectAddEventNotifyCallback(CP_Sh, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1237 
1238  // Come si mette un'icona nella shell?
1239  //pix = MCreatePixmapFromFile(CP_Sh, "SYS\\ledoff.bmp");
1240 
1241  colfrm = MCreateColForm(CP_Sh);
1242  MObjectSetShadow(colfrm, WS_NONE, 0, 0);
1243  //MObjectAddEventNotifyCallback(colfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1244  MObjectSetBGColorFromParent(colfrm, True, 100);
1245  // Row form for the command buttons
1246  rowfrm = MCreateRowForm(colfrm);
1247  MObjectSetShadow(rowfrm, WS_SHADOW_IN, 2, 0);
1249  //MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1250  MObjectSetBGColorFromParent(rowfrm, True, 100);
1251  c = EM_MOTION | EM_BUTTON_PRESS;
1252  for (i=0; i < 14; i++)
1253  {
1254  //PBUTT.KeyB[i] = MCreatePButton(tb, KeyCom_Code[i], HELV_SMALL);
1255  DAS.Gui.PushButt.KeyB[i] = MCreatePButton(rowfrm, KeyCom_Code[i], HELV_SMALL);
1256  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1257  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1258  //MObjectSetPopupHelp(DAS.Gui.PushButt.KeyB[i] ,KeyCom_CodePopUpHelp[i] , 200, 5000);
1259  if (i==0)
1260  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
1262  MPButtonSetCallback(DAS.Gui.PushButt.KeyB[i], DB_KeyB_CB, (void *) i);
1263 
1267 /*
1268 
1269  This code is for activation\deacivation of some pushbuttons depending on
1270  instrument type\esecution mode\option flags
1271 
1272  these functions are collected in the
1273  "DB_KB_ButtonActive" procedure placed after the creation of the second column of buttons
1274 
1275  if (DAS.Paramini.EqType == TROPOGAS ||
1276  DAS.Paramini.EqType == SPATRAMPLUS ||
1277  DAS.Paramini.EqType == GASCODNG1 ||
1278  DAS.Paramini.EqType == GASCODNG2 ||
1279  DAS.Paramini.EqType == GASCODNG3 ||
1280  DAS.Paramini.EqType == SPATRAM2)
1281  {
1282  if(i==11)
1283  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]);
1284 
1285 
1286  if(i==3 || i==4 || i==8 || i==9)
1287  {
1288  if(DAS.MIGE.linked == 0)
1289  {
1290  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]);
1291  //MObjectSetBackgroundRGB(optedit, 192, 192, 192);
1292 
1293  }
1294  }
1295  }
1296  if (DAS.Paramini.EqType == SPATRAM || DAS.Paramini.EqType == LIS_)
1297  if(i==3 || i==4 || i==8 || i==9 || i==10 || i== 11)
1298  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]);
1299 // if (DAS.Paramini.EqType == GASCODNG)
1300 // if(i==4 || i==5 || i==9 || i==10 || i== 11)
1301 // MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]);
1302 */
1303  }
1304 
1305 
1306 
1307 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1308 
1309  //Second column of labels and controls
1310  /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1311  rowfrm = MCreateRowForm(colfrm);
1312  MBottomAttach(rowfrm, F_ATT_NONE, 3, NULL);
1314 // MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1315  MObjectSetShadow(rowfrm, WS_NONE, 0, 0);
1316  MObjectSetResize(rowfrm, True, True);
1317 // MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1318  MObjectSetBGColorFromParent(rowfrm, True, 100);
1319 
1320  DAS.Gui.ContrPanel.lblK[0] = MCreateLabel(rowfrm, "CONTROL PARAMETERS", HELV_SMALL);
1321  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[0], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1322  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[0], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1325 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1326 
1327  tb = MCreateTableForm(rowfrm, 2);
1328  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1329  MObjectSetResize(tb, True, False);
1330  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1331 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1333 /*
1334  DAS.Gui.ContrPanel.lbl_NP[0] = MCreateLabel(tb, "CCD Target Temp.:", FIXED_SMALL);
1335  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[0], LEFT_ALIGN);
1336  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[0], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1337  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[0], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1338  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[0], 0);
1339 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1340 */
1341  d_events = EM_WINDOW_ENTER | EM_MOTION;
1342 
1343  lbl = MCreateLabel(tb, "CCD Target Temp.:", FIXED_SMALL);
1345  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1346  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1347  MObjectSetTransparency(lbl, 0);
1348 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, d_events , (void *) 1);
1349 
1350 
1351  DAS.Gui.ContrPanel.lbl_Par[0] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
1353  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[0], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1354  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[0], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1356 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1357 
1358 /* DAS.Gui.ContrPanel.lbl_NP[1] = MCreateLabel(tb, "CCD Pelt. Init Pwr:", FIXED_SMALL);
1359  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[1], LEFT_ALIGN);
1360  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[1], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1361  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[1], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1362  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[1], 0);
1363  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[1], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1364 */
1365  lbl = MCreateLabel(tb, "CCD Pelt. Init Pwr:", FIXED_SMALL);
1367  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1368  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1369  MObjectSetTransparency(lbl, 0);
1370 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1371 
1372  DAS.Gui.ContrPanel.lbl_Par[1] = MCreateLabel(tb, "100%", HELV_SMALL);
1373  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[1], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1374  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[1], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1377 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[1], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1378 /*
1379  DAS.Gui.ContrPanel.lbl_NP[2] = MCreateLabel(tb, "OMU Target Temp.:", FIXED_SMALL);
1380  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[2], LEFT_ALIGN);
1381  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[2], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1382  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[2], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1383  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[2], 0);
1384  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[2], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1385 */
1386 
1387  lbl = MCreateLabel(tb, "OMU Target Temp.:", FIXED_SMALL);
1389  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1390  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1391  MObjectSetTransparency(lbl, 0);
1392 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1393 
1394  DAS.Gui.ContrPanel.lbl_Par[2] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
1396  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[2], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1397  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[2], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1399 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[2], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1400 /*
1401  DAS.Gui.ContrPanel.lbl_NP[10] = MCreateLabel(tb, "OMU Pelt. Init Pwr:", FIXED_SMALL);
1402  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[10], LEFT_ALIGN);
1403  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[10], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1404  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[10], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1405  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[10], 0);
1406  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[10], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1407 */
1408  lbl = MCreateLabel(tb, "OMU Pelt. Init Pwr:", FIXED_SMALL);
1410  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1411  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1412  MObjectSetTransparency(lbl, 0);
1413 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1414 
1415  DAS.Gui.ContrPanel.lbl_Par[10] = MCreateLabel(tb, "100%", HELV_SMALL);
1416  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[10], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1417  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[10], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1420 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[10], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1421 
1422 /*******************************************************************************************************/
1423  DAS.Gui.ContrPanel.lblK[1] = MCreateLabel(rowfrm, "CCD PARAMETERS", HELV_SMALL);
1424  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[1], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1425  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[1], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1428 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[1], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1429 
1430  tb = MCreateTableForm(rowfrm, 4);
1431  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1432  MObjectSetResize(tb, True, False);
1433  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1434 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1436 /*
1437  DAS.Gui.ContrPanel.lbl_NP[3] = MCreateLabel(tb, "H. Pix.:", FIXED_SMALL);
1438  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[3], LEFT_ALIGN);
1439  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[3], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1440  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[3], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1441  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[3], 0);
1442 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[3], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1443 */
1444  lbl = MCreateLabel(tb, "H. Pix:", FIXED_SMALL);
1446  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1447  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1448  MObjectSetTransparency(lbl, 0);
1449 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1450 
1451  DAS.Gui.ContrPanel.lbl_Par[3] = MCreateLabel(tb, "0000", HELV_SMALL);
1453  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[3], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1454  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[3], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1456 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[3], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1457 /*
1458  DAS.Gui.ContrPanel.lbl_NP[4] = MCreateLabel(tb, "V. Pix:", FIXED_SMALL);
1459  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[4], LEFT_ALIGN);
1460  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[4], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1461  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[4], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1462  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[4], WS_SHADOW_IN, 2, 1);
1463  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[4], 0);
1464 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[4], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1465  */
1466  lbl = MCreateLabel(tb, "V. Pix:", FIXED_SMALL);
1468  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1469  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1470  MObjectSetTransparency(lbl, 0);
1471 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1472 
1473  DAS.Gui.ContrPanel.lbl_Par[4] = MCreateLabel(tb, " 0000", HELV_SMALL);
1475  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[4], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1476  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[4], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1478 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[4], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1479 
1480 /*******************************************************************************************************/
1481 
1482  DAS.Gui.ContrPanel.lblK[2] = MCreateLabel(rowfrm, "CCD WINDOW", HELV_SMALL);
1483  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[2], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1484  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[2], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1487 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[2], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1488 
1489  tb = MCreateTableForm(rowfrm, 4);
1490  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1491  MObjectSetResize(tb, True, False);
1492  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1493 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1495 /*
1496 
1497  DAS.Gui.ContrPanel.lbl_NP[5] = MCreateLabel(tb , "X Start:", FIXED_SMALL);
1498  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[5], LEFT_ALIGN);
1499  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[5], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1500  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[5], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1501  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[5], WS_SHADOW_IN, 2, 1);
1502  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[5], 0);
1503  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[5], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1504 */
1505  lbl = MCreateLabel(tb, "X Start:", FIXED_SMALL);
1507  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1508  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1509  MObjectSetTransparency(lbl, 0);
1510 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1511 
1512  DAS.Gui.ContrPanel.lbl_Par[5] = MCreateLabel(tb, " ", HELV_SMALL);
1514  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[5], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1515  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[5], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1517 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[5], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1518 /*
1519  DAS.Gui.ContrPanel.lbl_NP[6] = MCreateLabel(tb, "Y Start:", FIXED_SMALL);
1520  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[6], LEFT_ALIGN);
1521  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[6], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1522  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[6], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1523  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[6], WS_SHADOW_IN, 2, 1);
1524  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[6], 0);
1525  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[6], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1526 */
1527  lbl = MCreateLabel(tb, "Y Start:", FIXED_SMALL);
1529  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1530  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1531  MObjectSetTransparency(lbl, 0);
1532 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1533 
1534  DAS.Gui.ContrPanel.lbl_Par[6] = MCreateLabel(tb, " ", HELV_SMALL);
1536  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[6], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1537  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[6], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1539 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[6], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1540 /*
1541  DAS.Gui.ContrPanel.lbl_NP[7] = MCreateLabel(tb, "X End:", FIXED_SMALL);
1542  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[7], LEFT_ALIGN);
1543  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[7], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1544  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[7], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1545  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[7], WS_SHADOW_IN, 2, 1);
1546  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[7], 0);
1547  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[7], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1548 */
1549  lbl = MCreateLabel(tb, "X End:", FIXED_SMALL);
1551  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1552  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1553  MObjectSetTransparency(lbl, 0);
1554 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1555 
1556  DAS.Gui.ContrPanel.lbl_Par[7] = MCreateLabel(tb, " ", HELV_SMALL);
1558  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[7], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1559  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[7], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1561 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[7], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1562 /*
1563  DAS.Gui.ContrPanel.lbl_NP[8] = MCreateLabel(tb, "Y End:", FIXED_SMALL);
1564  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[8], LEFT_ALIGN);
1565  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[8], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1566  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[8], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1567  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[8], WS_SHADOW_IN, 2, 1);
1568  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[8], 0);
1569  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[8], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1570 */
1571  lbl = MCreateLabel(tb, "Y End:", FIXED_SMALL);
1573  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1574  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1575  MObjectSetTransparency(lbl, 0);
1576 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1577 
1578  DAS.Gui.ContrPanel.lbl_Par[8] = MCreateLabel(tb, " ", HELV_SMALL);
1580  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[8], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1581  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[8], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1583 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[8], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1584 
1585 /*******************************************************************************************************/
1586 
1587  tb = MCreateTableForm(rowfrm, 2);
1588  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1589  MObjectSetResize(tb, True, False);
1590  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1591 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1593 
1594 /*
1595  DAS.Gui.ContrPanel.lbl_NP[9] = MCreateLabel(tb, "Vert.Bin.", FIXED_SMALL);
1596  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[9], LEFT_ALIGN);
1597  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[9], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1598  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[9], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1599  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[9], WS_SHADOW_IN, 2, 1);
1600  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[9], 0);
1601  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[9], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1602 */
1603  lbl = MCreateLabel(tb, "Vert.Bin:", FIXED_SMALL);
1605  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1606  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1607  MObjectSetTransparency(lbl, 0);
1608 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1609 
1610  DAS.Gui.ContrPanel.lbl_Par[9] = MCreateLabel(tb, "00", HELV_SMALL);
1612  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[9], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1613  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[9], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1615 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[9], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1616 
1617  /*********************** STEPPERS *************************/
1618 
1619  DAS.Gui.ContrPanel.lblK[3] = MCreateLabel(rowfrm, "STEPPER MOTORS", HELV_SMALL);
1620  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[3], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1621  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[3], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1624 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[3], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1625 
1626 
1629  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Pagedfrm_SM, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1630 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Pagedfrm_SM, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1632 
1633  for (i=0;i<DAS.StepM.NAMS;i++)
1634  {
1635  for(k=0;k<2;k++)
1636  {
1637  StepperPagForm(i, k);
1638  }
1639  }
1641 
1642  /*********************** STEPPERS END *************************/
1643 
1644 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1645 
1646 
1647  //Seconda colonna di labels e controlli
1648  rowfrm = MCreateRowForm(colfrm);
1649  MBottomAttach(rowfrm, F_ATT_NONE, 3, NULL);
1651  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1652  MObjectSetShadow(rowfrm, WS_NONE, 0, 0);
1653  MObjectSetResize(rowfrm, True, True);
1654 // MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1655  MObjectSetBGColorFromParent(rowfrm, True, 100);
1656 
1657  DAS.Gui.ContrPanel.lblK[4] = MCreateLabel(rowfrm, "CCD-OMU STATUS", HELV_SMALL);
1658  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[4], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1659  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[4], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1662 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[4], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1663 
1664  tb = MCreateTableForm(rowfrm, 2);
1665  MObjectSetForegroundRGB(tb, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1666  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1667  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1668  MObjectSetResize(tb, True, False);
1669 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1671 
1672 /* DAS.Gui.ContrPanel.Plbl_CS[0] = MCreateLabel(tb, "CCD Actual Temp.:", FIXED_SMALL);
1673  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_CS[0], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1674  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_CS[0], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1675  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_CS[0], 0);
1676  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_CS[0], LEFT_ALIGN);
1677 */
1678  lbl = MCreateLabel(tb, "CCD Actual Temp.:", FIXED_SMALL);
1679  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1680  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1681  MObjectSetTransparency(lbl, 0);
1683 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1684 
1685 
1686  DAS.Gui.ContrPanel.Albl_CS[0] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
1688  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_CS[0], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1689  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_CS[0], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1691 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_CS[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1692 /*
1693  DAS.Gui.ContrPanel.Plbl_CS[1] = MCreateLabel(tb, "CCD Pelt. Act. Pwr.:", FIXED_SMALL);
1694  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_CS[1], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1695  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_CS[1], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1696  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_CS[1], 0);
1697  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_CS[1], LEFT_ALIGN);
1698 */
1699  lbl = MCreateLabel(tb, "CCD Pelt Act Pwr:", FIXED_SMALL);
1700  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1701  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1702  MObjectSetTransparency(lbl, 0);
1704 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1705 
1706  DAS.Gui.ContrPanel.Albl_CS[1] = MCreateLabel(tb, "100%", HELV_SMALL);
1708  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_CS[1], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1709  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_CS[1], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1711 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_CS[1], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1712  /*
1713  DAS.Gui.ContrPanel.Plbl_LS[6] = MCreateLabel(tb, "Delta Temp.", FIXED_SMALL);
1714  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[6], LEFT_ALIGN);
1715  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[6], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1716  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[6], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1717  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[6], 0);
1718 */
1719  lbl = MCreateLabel(tb, "Delta Temp.:", FIXED_SMALL);
1720  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1721  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1722  MObjectSetTransparency(lbl, 0);
1724 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1725 
1726  DAS.Gui.ContrPanel.Albl_LS[6] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
1728  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_LS[6], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1729  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_LS[6], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1731 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[6], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1732 /*
1733  DAS.Gui.ContrPanel.Plbl_LS[7] = MCreateLabel(tb, "OMU Pelt.Act.Pwr:", FIXED_SMALL);
1734  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[7], LEFT_ALIGN);
1735  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[7], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1736  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[7], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1737  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[7], 0);
1738 */
1739  lbl = MCreateLabel(tb, "OMU Pelt.Act.Pwr:", FIXED_SMALL);
1740  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1741  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1742  MObjectSetTransparency(lbl, 0);
1744 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1745 
1746  DAS.Gui.ContrPanel.Albl_LS[7] = MCreateLabel(tb, "100%", HELV_SMALL);
1748  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_LS[7], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1749  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_LS[7], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1751 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[7], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1752 
1753  DAS.Gui.ContrPanel.ledpelt[0] = MCreatePixmapFromFile(tb, "SYS\\pltoff.bmp");
1756 
1757  DAS.Gui.ContrPanel.ledpelt[1] = MCreatePixmapFromFile(tb, "SYS\\pltoff.bmp");
1760 
1761 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1762 
1763 
1764  DAS.Gui.ContrPanel.lblK[5] = MCreateLabel(rowfrm, "STEPPERS STATUS", HELV_SMALL);
1765  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[5], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1766  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[5], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1769 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[5], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1770 
1771  tb = MCreateTableForm(rowfrm, DAS.StepM.NAMS*2);
1772  MObjectSetForegroundRGB(tb, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1773  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1774  MObjectSetResize(tb, True, False);
1775  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1776 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1778 
1779  for (i=0;i<DAS.StepM.NAMS;i++)
1780  {
1781  for(k=0;k<2;k++)
1782  {
1783  sprintf(buff,"SM%d", (2*i+k+1));
1784 /*
1785  DAS.Gui.ContrPanel.Plbl_SM[i][k] = MCreateLabel(tb, buff, FIXED_SMALL);
1786  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_SM[i][k], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1787  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_SM[i][k], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1788  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_SM[i][k], 0);
1789  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_SM[i][k], CENTER_ALIGN);
1790 */
1791  lbl = MCreateLabel(tb, buff, FIXED_SMALL);
1792  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1793  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1794  MObjectSetTransparency(lbl, 0);
1796 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1797 
1798 
1799  DAS.Gui.ContrPanel.LedSM[i][k] = MCreatePixmapFromFile(tb, "SYS\\ledoff.bmp");
1800  MObjectSetShadow(DAS.Gui.ContrPanel.LedSM[i][k], WS_NONE, 0, 0);
1801  }
1802  }
1803 
1804 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1805 
1806  DAS.Gui.ContrPanel.lblK[6] = MCreateLabel(rowfrm, "ACTIVITY ", HELV_SMALL);
1807  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[6], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1808  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[6], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1811 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[6], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1812 
1813  tb = MCreateTableForm(rowfrm, 2);
1814  MObjectSetForegroundRGB(tb, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1815  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1816  MObjectSetResize(tb, True, True);
1817  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1819 /*
1820  DAS.Gui.ContrPanel.Plbl_Script = MCreateLabel(tb, "Script-Use:", FIXED_SMALL);
1821  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_Script, LEFT_ALIGN);
1822  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_Script, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1823  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_Script, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1824  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_Script, 0);
1825 */
1826  lbl = MCreateLabel(tb, "Script-Use:", FIXED_SMALL);
1827  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1828  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1829  MObjectSetTransparency(lbl, 0);
1831 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1832 
1833  DAS.Gui.ContrPanel.Albl_Script = MCreateLabel(tb, "XXXXXXXX.PRG", HELV_SMALL);
1838 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_Script, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1839 
1840 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1841 /*
1842  DAS.Gui.ContrPanel.lblK[9] = MCreateLabel(_rowform002, "ACTIVITY ", HELV_SMALL);
1843  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[9], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1844  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[9], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1845  MObjectSetShadow(DAS.Gui.ContrPanel.lblK[9], WS_SHADOW_OUT, 1, 0);
1846  MObjectSetTransparency(DAS.Gui.ContrPanel.lblK[9], 0);
1847 */
1848  tb = MCreateTableForm(rowfrm, 2);
1849  MObjectSetForegroundRGB(tb, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1850  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1851  MObjectSetResize(tb, True, True);
1852  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1853 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1855 /*
1856  DAS.Gui.ContrPanel.Plbl_CS[2] = MCreateLabel(tb, "Acq.#:", FIXED_SMALL);
1857  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_CS[2], LEFT_ALIGN);
1858  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_CS[2], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1859  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_CS[2], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1860  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_CS[2], 0);
1861 */
1862 
1863  lbl = MCreateLabel(tb, "Acq.#:", FIXED_SMALL);
1864  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1865  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1866  MObjectSetTransparency(lbl, 0);
1868 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1869 
1870  DAS.Gui.ContrPanel.Albl_CS[2] = MCreateLabel(tb, " 0", HELV_SMALL);
1872  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_CS[2], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1873  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_CS[2], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1875 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_CS[2], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1876 /*
1877  DAS.Gui.ContrPanel.Plbl_CS[3] = MCreateLabel(tb, "File:", FIXED_SMALL);
1878  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_CS[3], LEFT_ALIGN);
1879  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_CS[3], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1880  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_CS[3], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1881  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_CS[3], 0);
1882 */
1883 
1884  lbl = MCreateLabel(tb, "File:", FIXED_SMALL);
1885  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1886  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1887  MObjectSetTransparency(lbl, 0);
1889 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1890 
1891 
1892  DAS.Gui.ContrPanel.Albl_CS[3] = MCreateLabel(tb, " ", HELV_SMALL);
1894  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_CS[3], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1895  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_CS[3], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1897 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_CS[3], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1898 
1899 /*
1900  DAS.Gui.ContrPanel.Plbl_IE[0] = MCreateLabel(tb, "AutoR:", FIXED_SMALL);
1901  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_IE[0], LEFT_ALIGN);
1902  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_IE[0], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1903  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_IE[0], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1904  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_IE[0], 0);
1905 */
1906  lbl = MCreateLabel(tb, "AutoR:", FIXED_SMALL);
1907  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1908  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1909  MObjectSetTransparency(lbl, 0);
1911 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1912 
1913 
1914  DAS.Gui.ContrPanel.Albl_IE[0] = MCreateLabel(tb, "0.002", HELV_SMALL);
1916  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_IE[0], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1917  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_IE[0], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1919 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_IE[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1920  /*
1921  DAS.Gui.ContrPanel.Plbl_IE[1] = MCreateLabel(tb, "Dwnld:", FIXED_SMALL);
1922  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_IE[1], LEFT_ALIGN);
1923  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_IE[1], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1924  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_IE[1], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1925  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_IE[1], 0);
1926 
1927  DAS.Gui.ContrPanel.Albl_IE[1] = MCreateLabel(tb, "xxxxx", HELV_SMALL);
1928  MLabelSetAlignment(DAS.Gui.ContrPanel.Albl_IE[1], RIGHT_ALIGN);
1929  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_IE[1], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1930  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_IE[1], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1931  MObjectSetTransparency(DAS.Gui.ContrPanel.Albl_IE[1], 0);
1932  */
1933 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1934  DAS.Gui.ContrPanel.lblK[7] = MCreateLabel(rowfrm, "LAMPS STATUS", HELV_SMALL);
1935  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[7], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1936  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[7], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1939 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[7], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1940 
1941 
1942  tb = MCreateTableForm(rowfrm, 4);
1944  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1945  MObjectSetResize(tb, True, True);
1946  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1947 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1949 
1950  DAS.Gui.ContrPanel.LedHG = MCreatePixmapFromFile(tb, "SYS\\ledoff.bmp");
1952 
1953  DAS.Gui.ContrPanel.pblamps[0] = MCreatePButton(tb, "Hg Off", HELV_SMALL);
1954  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.pblamps[0], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1955  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.pblamps[0], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1956  MPButtonSetCallback(DAS.Gui.ContrPanel.pblamps[0], DB_KeyB_CB, (void *) 100);
1961 
1962 
1963  DAS.Gui.ContrPanel.LedQJ = MCreatePixmapFromFile(tb, "SYS\\ledoff.bmp");
1965 
1966  DAS.Gui.ContrPanel.pblamps[1] = MCreatePButton(tb, "Qj Off", HELV_SMALL);
1967  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.pblamps[1], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1968  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.pblamps[1], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1969  MPButtonSetCallback(DAS.Gui.ContrPanel.pblamps[1], DB_KeyB_CB, (void *) 111);
1971  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.pblamps[1], (OBJ_EVENT_CB) DB_LampSelButtMouse_CB, c , (void *) 1);
1974 
1975 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1976 
1977  /*******************************************************************/
1978 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1979  rowfrm = MCreateRowForm(colfrm);
1980  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1981  MObjectSetShadow(rowfrm, WS_NONE, 0, 0);
1982  MObjectSetResize(rowfrm, True, False);
1984 // MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1985  MObjectSetBGColorFromParent(rowfrm, True, 100);
1986 
1987  DAS.Gui.ContrPanel.lblK[8] = MCreateLabel(rowfrm, "DEVICES STATUS", HELV_SMALL);
1988  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[8], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1989  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[8], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1993 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[8], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1994 
1995  tb = MCreateTableForm(rowfrm, 2);
1996  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1997  MObjectSetResize(tb, True, False);
1998  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
2000 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2002 /*
2003  DAS.Gui.ContrPanel.Plbl_LS[0] = MCreateLabel(tb, "Source Mirror:", FIXED_SMALL);
2004  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[0], LEFT_ALIGN);
2005  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[0], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2006  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[0], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2007  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[0], 0);
2008  MObjectAlign(DAS.Gui.ContrPanel.Plbl_LS[0], CENTER_ALIGN, TOP_ALIGN);
2009 */
2010  lbl = MCreateLabel(tb, "Source Mirror", FIXED_SMALL);
2011  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2012  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2013  MObjectSetTransparency(lbl, 0);
2016 
2017  DAS.Gui.ContrPanel.Albl_LS[0] = MCreateLabel(tb, " ", HELV_SMALL);
2020  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_LS[0], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
2021  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_LS[0], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
2023 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2024 
2025 /* DAS.Gui.ContrPanel.Plbl_LS[1] = MCreateLabel(tb, "Grating:", FIXED_SMALL);
2026  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[1], LEFT_ALIGN);
2027  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[1], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2028  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[1], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2029  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[1], 0);
2030 */
2031  lbl = MCreateLabel(tb, "Grating:", FIXED_SMALL);
2032  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2033  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2034  MObjectSetTransparency(lbl, 0);
2036 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2037 
2038  DAS.Gui.ContrPanel.Albl_LS[1] = MCreateLabel(tb, "", HELV_SMALL);
2040  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_LS[1], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
2041  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_LS[1], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
2043 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[1], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2044 
2045 /* DAS.Gui.ContrPanel.Plbl_LS[2] = MCreateLabel(tb, "Filter Wheel:", FIXED_SMALL);
2046  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[2], LEFT_ALIGN);
2047  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[2], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2048  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[2], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2049  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[2], 0);
2050 */
2051  lbl = MCreateLabel(tb, "Filter Wheel:", FIXED_SMALL);
2052  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2053  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2054  MObjectSetTransparency(lbl, 0);
2056 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2057 
2058 
2059  DAS.Gui.ContrPanel.Albl_LS[2] = MCreateLabel(tb, " ", HELV_SMALL);
2061  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_LS[2], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
2062  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_LS[2], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
2064 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[2], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2065 /*
2066  DAS.Gui.ContrPanel.Plbl_LS[3] = MCreateLabel(tb, "Unused", FIXED_SMALL);
2067  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[3], LEFT_ALIGN);
2068  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[3], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2069  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[3], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2070  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[3], 0);
2071  MObjectAlign(DAS.Gui.ContrPanel.Plbl_LS[3], CENTER_ALIGN, TOP_ALIGN);
2072 */
2073 
2074 
2075  if((DAS.DOption.filtertype == FPLUS) | (DAS.DOption.filtertype == FDOUBLE) )
2076  lbl = MCreateLabel(tb, "NDFiter", FIXED_SMALL);
2077  if(DAS.DOption.filtertype == FSIMPLE)
2078  lbl = MCreateLabel(tb, "Not Used", FIXED_SMALL);
2079 
2080  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2081  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2082  MObjectSetTransparency(lbl, 0);
2084 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2085 
2086  if((DAS.DOption.filtertype == FPLUS) | (DAS.DOption.filtertype == FDOUBLE) )
2087  DAS.Gui.ContrPanel.Albl_LS[3] = MCreateLabel(tb, " OFF", HELV_SMALL);
2088  if(DAS.DOption.filtertype == FSIMPLE)
2089  DAS.Gui.ContrPanel.Albl_LS[3] = MCreateLabel(tb, " ", HELV_SMALL);
2090 
2093  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_LS[3], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
2094  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_LS[3], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
2096 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[3], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2097 
2098 /* DAS.Gui.ContrPanel.Plbl_LS[4] = MCreateLabel(tb, "Zenith:", FIXED_SMALL);
2099  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[4], LEFT_ALIGN);
2100  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[4], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2101  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[4], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2102  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[4], 0);
2103 */
2104  lbl = MCreateLabel(tb, "Zenith:", FIXED_SMALL);
2105  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2106  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2107  MObjectSetTransparency(lbl, 0);
2109 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2110 
2111 
2112  DAS.Gui.ContrPanel.Albl_LS[4] = MCreateLabel(tb, "", HELV_SMALL);
2114  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_LS[4], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
2115  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_LS[4], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
2117 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[4], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2118 
2119 /* DAS.Gui.ContrPanel.Plbl_LS[5] = MCreateLabel(tb, "Azimuth:", FIXED_SMALL);
2120  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[5], LEFT_ALIGN);
2121  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[5], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2122  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[5], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2123  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[5], 0);
2124 */
2125  lbl = MCreateLabel(tb, "Azimuth:", FIXED_SMALL);
2126  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2127  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2128  MObjectSetTransparency(lbl, 0);
2130 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2131 
2132 
2133  DAS.Gui.ContrPanel.Albl_LS[5] = MCreateLabel(tb, " ", HELV_SMALL);
2135  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_LS[5], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
2136  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_LS[5], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
2138 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[5], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2139 
2140 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
2141 
2142  DAS.Gui.ContrPanel.lblK[9] = MCreateLabel(rowfrm, "TEMPERATURES", HELV_SMALL);
2143  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[9], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
2144  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[9], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
2148 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[9], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
2149 
2150 
2151  Pagedfrm_Temp = MCreateTabbedRowForm(rowfrm, 2, FIXED_SMALL);
2152  MObjectSetForegroundRGB(Pagedfrm_Temp, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2153  MObjectSetBackgroundRGB(Pagedfrm_Temp, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2154  MObjectSetBGColorFromParent(Pagedfrm_Temp, True, 100);
2155 
2156  FrmBuildTemperature(Pagedfrm_Temp);
2157 
2158 /*************************** COMMANDS *********************************************/
2159 
2161  item_advc = MMenuAddItemObsolete(popup_advcalib, "Adv. Calib", PopUpAdvCal_CB, (void *) 0);
2162  MObjectSetBackgroundRGB(popup_advcalib, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
2164 
2165 
2166 
2167  rowfrm = MCreateRowForm(colfrm);
2168  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2169  MObjectSetShadow(rowfrm, WS_SHADOW_IN, 2, 0);
2171  MObjectSetResize(rowfrm, True, False);
2172 // MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2173  MObjectSetBGColorFromParent(rowfrm, True, 100);
2174 
2175  for (i=14; i < 28; i++)
2176  {
2177  DAS.Gui.PushButt.KeyB[i] = MCreatePButton(rowfrm, KeyCom_Code[i], HELV_SMALL);
2178  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
2179  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
2180  //MObjectSetPopupHelp(DAS.Gui.PushButt.KeyB[i] ,KeyCom_CodePopUpHelp[i] , 200, 5000);
2181  if (i==0)
2182  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
2184  MPButtonSetCallback(DAS.Gui.PushButt.KeyB[i], DB_KeyB_CB, (void *) i);
2189  if (i==14)
2191 
2192  }
2193 
2194 
2195  DB_KB_ButtonActive(1);
2196 
2197 
2198 /**************************************************************************************/
2199  rowfrm = MCreateRowForm(CP_Sh);
2200  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2201  MObjectSetShadow(rowfrm, WS_SHADOW_OUT, 2, 2);
2202 // MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2203  MObjectSetBGColorFromParent(rowfrm, True, 100);
2204 
2205  tb = MCreateTableForm(rowfrm, 3);
2206  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2208  //MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
2210  //MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2212 
2213  pb = MCreatePButton(tb, "Help ", HELV_MEDIUM);
2214  MPButtonSetCallback(pb, DB_HelpCB, (void *) 0);
2216  MObjectSetShadow(pb, WS_SHADOW_OUT, 3, 0);
2217 
2218  DAS.Gui.ContrPanel.lbl_Time = MCreateLabel(tb, "Station: XXX, Date: YYYY/MM/DD, Time: HH:MM:SS, SolarZenithAngle: xxx.xx", HELV_MEDIUM);
2224 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Time, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2225 
2226  pb = MCreatePButton(tb, " Inf. ", HELV_MEDIUM);
2227  MPButtonSetCallback(pb, DB_InfCB, (void *) 0);
2229  MObjectSetShadow(pb, WS_SHADOW_OUT, 3, 0);
2230 
2231 
2232  colfrm = MCreateColForm(CP_Sh);
2233  MObjectSetBackgroundRGB(colfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2234  MObjectSetShadow(colfrm, WS_SHADOW_IN, 2, 2);
2235  MObjectSetBGColorFromParent(colfrm, True, 100);
2236 // MObjectAddEventNotifyCallback(colfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2237 
2238 /* DAS.Gui.ContrPanel.Plbl_Elev = MCreateLabel(colfrm, "Sun Elev:", HELV_MEDIUM);
2239  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_Elev, LEFT_ALIGN);
2240  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_Elev, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2241  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_Elev, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2242  MObjectSetResize(DAS.Gui.ContrPanel.Plbl_Elev, False, True);
2243  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_Elev, 0);
2244 */
2245  lbl = MCreateLabel(colfrm, "Sun Elev:", HELV_MEDIUM);
2246  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2247  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2248  MObjectSetTransparency(lbl, 0);
2250  MObjectSetResize(lbl, False, True);
2251 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2252 
2253  DAS.Gui.ContrPanel.Albl_Elev = MCreateLabel(colfrm, "XX.X", HELV_MEDIUM);
2259 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_Elev, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2260 
2261 /* DAS.Gui.ContrPanel.Plbl_Azim = MCreateLabel(colfrm, "Sun Az.:", HELV_MEDIUM);
2262  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_Azim, LEFT_ALIGN);
2263  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_Azim, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2264  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_Azim, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2265  MObjectSetResize(DAS.Gui.ContrPanel.Plbl_Azim, False, True);
2266  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_Azim, 0);
2267 */
2268  lbl = MCreateLabel(colfrm, "Sun Az.:", HELV_MEDIUM);
2269  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2270  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2271  MObjectSetTransparency(lbl, 0);
2273  MObjectSetResize(lbl, False, True);
2274 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2275 
2276  DAS.Gui.ContrPanel.Albl_Azim = MCreateLabel(colfrm, "XXX.XX", HELV_MEDIUM);
2282 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_Azim, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2283 
2284  lbl = MCreateLabel(colfrm, "SunR:", HELV_MEDIUM);
2285  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2286  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2287  MObjectSetTransparency(lbl, 0);
2289  MObjectSetResize(lbl, False, True);
2290 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2291 
2292  DAS.Gui.ContrPanel.Albl_sunr = MCreateLabel(colfrm, "XXXX.XX", HELV_MEDIUM);
2298 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_sunr, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2299 
2300  lbl = MCreateLabel(colfrm, "SunS:", HELV_MEDIUM);
2301  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2302  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2303  MObjectSetTransparency(lbl, 0);
2305  MObjectSetResize(lbl, False, True);
2306 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2307 
2308  DAS.Gui.ContrPanel.Albl_suns = MCreateLabel(colfrm, "XXXX.XX", HELV_MEDIUM);
2314 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_suns, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2315 
2316 /*
2317  DAS.Gui.ContrPanel.Plbl_Status = MCreateLabel(colfrm, "Status:", HELV_MEDIUM);
2318  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_Status, LEFT_ALIGN);
2319  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_Status, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2320  MObjectSetResize(DAS.Gui.ContrPanel.Plbl_Status, False, True);
2321  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_Status, 0);
2322 */
2323  lbl = MCreateLabel(colfrm, "Status:", HELV_MEDIUM);
2324  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2325  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2326  MObjectSetTransparency(lbl, 0);
2328  MObjectSetResize(lbl, False, True);
2329 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2330 
2331  DAS.Gui.ContrPanel.Albl_Status = MCreateLabel(colfrm, " ", HELV_MEDIUM);
2336 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_Status, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2337 
2338 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
2339 
2340  return CP_Sh;
2341 }
2342 /**********************************************************************/
2343 /**********************************************************************/
2344 /* Key Commander Shell and CallBaks */
2345 /**********************************************************************/
2346 /*void MDCreateLISC(int c, int e)
2347 {
2348  MOBJECT _tablefrm000;
2349  MOBJECT FrmMnu;
2350 // char buf[12];
2351 // MOBJECT menu, pdown;
2352 // MOBJECT submenu, subsubmenu;
2353 // MENU_ITEM item_id;
2354 // MENU_ITEM item1_id,item2_id, item3_id, item111_id, item222_id, item11_id, item22_id;
2355 
2356  int i;
2357 
2358 
2359  int WSc, HSc, WSh, HSh;
2360 /*
2361 const char *KeyCom_Code[] = {{"F1-Mirror"},
2362  {"F2-Grating"},
2363  {"F3-Filter "},
2364  {" F5-Calib "},
2365  {"F6-ARange "},
2366  {"F7-GetCCD "},
2367  {"F8-Average"},
2368  {" F9-Dark "},
2369  {"F10-HgOff "},
2370  {"F11-QjOff "},
2371  {" F12-Save "},
2372  {" H_Mirror "},
2373  {" H_Grating"},
2374  {" H_Filter "},
2375  {" Plot "},
2376  {" ESC-Quit "},
2377  {" Spare "},
2378  {" Spare "},
2379  {" Spare "},
2380  {" Config "},
2381  {" About "},
2382  {" Spare "},
2383  {" Spare "},
2384  {" Spare "}};
2385 */
2386 /*const char *KeyCom_Code[] = {{"Mirror"}, //0
2387  {"Grating"}, //1
2388  {"Filter "}, //2
2389  {" Calib "}, //3
2390  {"ARange "}, //4
2391  {"GetCCD "}, //5
2392  {"Average"}, //6
2393  {"Dark "}, //7
2394  {"Save "}, //8
2395  {"HgOff "}, //9
2396  {"QjOff "}, //10
2397  {"H_Mir "}, //11
2398  {"H_Grat"},
2399  {"H_Filt"},
2400  {"OnLPLOT "},
2401  {"OffLPLOT"},
2402  {"CldOut"},
2403  {" ZOOM "},//{"FANOff"},
2404  {"MvGrat"},
2405  {"Coord0"},
2406  {"P X Off"},
2407  {"P Y Off"},
2408  {"Config"},
2409  {"About "},
2410  {"Pause "},
2411  {"Tools "},
2412  {"Quit "}};
2413 
2414 
2415 
2416 //int KeyCom_StK[] = {F1,F2,F3,F5,F6,F7,F8,F9,F10,F11,F12,A_F1,A_F2,A_F3,0,ESC,0,0,0,0,0};
2417 int KeyCom_StK[] = {F1,F2,F3,F5,F6,F7,F8,F9,F10,F11,F12,0,0,0,0,ESC,0,0,0,0,0,0,0,0};
2418 
2419  LIS.Sh_KeyB = MCreateShell("SPATRAM Control KeyBoard", SF_NO_MAXIMIZE|SF_NO_CLOSE);
2420  MObjectSetBackgroundRGB(LIS.Sh_KeyB, 91, 74, 74);
2421 
2422 
2423  FrmMnu= MCreateColForm(LIS.Sh_KeyB);
2424  MObjectSetBackgroundRGB(FrmMnu, 91, 74, 74);
2425  MObjectSetShadow(FrmMnu, WS_NONE, 0, 0);
2426  MObjectSetResize(FrmMnu, True, False);
2427 
2428 // Menu Creation
2429 /*****************************************************************/
2430 // menu = MCreateMenuBar(FrmMnu, HELV_SMALL);
2431  // MMenuBarSetAcc(menu, F10);
2432 // pdown = MCreateMenu(menu, "File");
2433  // MMenuAddSeparator(pdown);
2434 // item_id = MMenuAddItem(pdown, "Quit", (MENU_ITEM_CB) ShutDOWN, 0L);
2435 // MMenuItemSetAccel(item_id, C_Q, "Ctrl+Q");
2436 
2437 // pdown = MCreateMenu(menu, "Tools");
2438  //#if !defined BC_MGUI && !defined WATC_MGUI || defined LIBGRX
2439  /* Font loading not supported in BORLANDC BGI */
2440  // MMenuAddItem(pdown, "Font Browser", (MENU_ITEM_CB) FontViewCB, 0L);
2441  //#endif
2442  // MMenuAddItem(pdown, "Color Browser", (MENU_ITEM_CB) ColPickCB, 0L);
2443 // MMenuAddItem(pdown, "Config", (MENU_ITEM_CB) ConfigCB, 0L);
2444 
2445 
2446 // pdown = MCreateMenu(menu, "Options");
2447 // item_id = MMenuAddItemObsolete(pdown, "Save", NULL, 0L);
2448 //
2449 // submenu = MCreateSubMenu(item_id);
2450 // item1_id = MMenuAddItemObsolete(submenu, "Mode", NULL, 0L);
2451 // subsubmenu = MCreateSubMenu(item1_id);
2452 
2453 // item11_id = MMenuAddRadioItem(subsubmenu, "ASCII", (MENU_ITEM_CB) DB_RadioModeSelCB, (void *) 0);
2454 // item22_id = MMenuAddRadioItem(subsubmenu, "Binary", (MENU_ITEM_CB) DB_RadioModeSelCB, (void *) 1);
2455 
2456 
2457 // item3_id = MMenuAddItem(submenu, "View Plot before..", (MENU_ITEM_CB) AboutCB, 0L);
2458 
2459 // item1_id = MMenuAddItemObsolete(submenu, "File Names", NULL, 0);
2460 // subsubmenu = MCreateSubMenu(item1_id);
2461 
2462 // item111_id = MMenuAddRadioItem(subsubmenu, "Single", (MENU_ITEM_CB) DB_RadioFNSelCB, (void *) 0L);
2463 // item222_id = MMenuAddRadioItem(subsubmenu, "Multiple", (MENU_ITEM_CB) DB_RadioFNSelCB, (void *) 1L);
2464 
2465 // pdown = MCreateMenu(menu, "Help");
2466 // MMenuAddItem(pdown, "About", (MENU_ITEM_CB) AboutCB, 0L);
2467 
2468  /*****************************************************************/
2469 
2470 
2471 
2472 // pdown = MCreateMenu(menu, "Pulldown");
2473 // MMenuAddToggleItem(pdown, "Item 1", ItemCheckCB, 0L);
2474 // item_id = MMenuAddItemObsolete(pdown, "Subpulldown", NULL, 0L);
2475 // MMenuAddItemObsolete(pdown, "Change me", ChangeItemTextCB, 0L);
2476 // MMenuAddItemObsolete(pdown, "Change title", ChangeTitleTextCB, 0L);
2477 // item2_id = MMenuAddItemObsolete(pdown, "Unsensitive", MakeItemUnsensitiveCB, 0L);
2478 // MMenuItemSetAccel(item2_id, C_U, "Ctrl+U");
2479 
2480 // submenu = MCreateSubMenu(item_id);
2481 // MMenuAddToggleItem(submenu, "subItem 2-1", ItemCheckCB, 0L);
2482 // MMenuAddToggleItem(submenu, "subItem 2-2", ItemCheckCB, 0L);
2483 // item_id = MMenuAddItemObsolete(submenu, "Subpulldown", NULL, 0L);
2484 
2485 // submenu = MCreateSubMenu(item_id);
2486 // item_id = MMenuAddRadioItem(submenu, "option 1-1", RadioItemSelectCB, 0L);
2487 // MMenuItemSetCheckStatus(item_id, True);
2488 // MMenuAddRadioItem(submenu, "option 1-2", RadioItemSelectCB, 0L);
2489 // MMenuAddRadioItem(submenu, "option 1-3", RadioItemSelectCB, 0L);
2490 // MMenuAddSeparator(submenu);
2491 // MMenuAddRadioItem(submenu, "option 2-1", RadioItemSelectCB, 0L);
2492 // item_id = MMenuAddRadioItem(submenu, "option 2-2", RadioItemSelectCB, 0L);
2493 // MMenuItemSetCheckStatus(item_id, True);
2494 // MMenuAddItemObsolete(submenu, "Change me", ChangeItemTextCB, 0L);
2495 // MMenuAddItemObsolete(submenu, "Change title", ChangeTitleTextCB, 0L);
2496 // MMenuAddItemObsolete(submenu, "Destroy SubMenu", DestroyMenuCB, 0L);
2497 // MMenuAddItemObsolete(submenu, "Destroy Menu", DestroyMenuCB, pdown);
2498 
2499 // MObjectEnableOptions(menu, "menu", MO_ALL);
2500 
2501 
2502 
2503  /*****************************************************************/
2504 
2505 /*
2506  _tablefrm000 = MCreateTableForm(LIS.Sh_KeyB, 9);
2507  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
2508  MObjectSetShadow(_tablefrm000, WS_NONE, 0, 0);
2509  MObjectSetResize(_tablefrm000, True, True);
2510 
2511 
2512 
2513 
2514  for (i=0; i < (sizeof PBUTT.KeyB / sizeof PBUTT.KeyB[0]); i++)
2515  {
2516  PBUTT.KeyB[i] = MCreatePButton(_tablefrm000, KeyCom_Code[i], HELV_SMALL);
2517  MObjectSetBackgroundRGB(PBUTT.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
2518  MObjectSetForegroundRGB(PBUTT.KeyB[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
2519  if (i==0)
2520  MObjectSetBackgroundRGB(PBUTT.KeyB[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
2521  MObjectSetCompositeWidth(PBUTT.KeyB[i], 90);
2522  /***************************************/
2523  /* SHAREWARE */
2524 // if (i==2 | i==9 |i==3 | i==4 |i==6 | i==11 |i==12 | i==13 |i==19 | i== 20| i==17 |i==10 | i== 21)
2525 // {
2526 // MObjectSetBackgroundRGB(PBUTT.KeyB[i], 150, 150, 150);
2527 // }
2528  /***************************************/
2529 /* MPButtonSetCallback(PBUTT.KeyB[i], DB_KeyB_CB, (void *) i);
2530 // MObjectAddEventNotifyCallback(PBUTT.KeyB[i], (OBJ_EVENT_CB) DB_KeyComSelButtKB_CB, EM_KEY_PRESS, (void *) i);
2531 // MObjectAddEventNotifyCallback(PBUTT.KeyB[i], (OBJ_EVENT_CB) DB_KeyComSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
2532  //MButtonSetAccelerator(PBUTT.KeyB[i], KeyCom_StK[i]);
2533  MButtonSetOnMouseOverForegroundRGB(PBUTT.KeyB[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
2534 // MObjectEnableOptions (PBUTT.KeyB[i], "button", MO_ALL);
2535  //MObjectSetResize(PBUTT.KeyB[i], True, True);
2536  }
2537 
2538 
2539  WSc = MGetScreenWidth();
2540  HSc = MGetScreenHeight();
2541 // XF=(int)((float)(WSc - WSh) / 4);
2542  //Posiziona la shell al centro dello schermo
2543 
2544  //Yc = b + 85;
2545  MShellRealizeXY(LIS.Sh_KeyB, (WSc-846)/2, c+50);
2546 
2547 
2548 
2549  WSh = MObjectGetWidth(LIS.Sh_KeyB);
2550  HSh = MObjectGetHeight(LIS.Sh_KeyB);
2551 
2552 
2553 // XF = MObjectGetX(LIS.Sh_KeyB);
2554 // sprintf(buf, "%d", XF);
2555 // MMessageDialog("Xf", buf, " Ok ", NULL);
2556 }
2557 
2558 */
2559 
2560 void DB_ChooseButtons( int w)
2561 {
2562 
2563  int c = w;
2564 
2565  switch(c)
2566  {
2567  case TEMPORIZED :
2568  break;
2569  case PRGFILE:
2570  break;
2571  case TESTAMS:
2572  //DB_KB_ButtonActive(c);
2573  break;
2574  case OFFLINEPLOT:
2575  DB_KB_ButtonActive(c);
2576 
2577  break;
2578  case TESTCCD:
2579  break;
2580  case HELP:
2581  break;
2582  case DBDEMO :
2583  break;
2584  case MANUAL:
2585  break;
2586  case TESTAD:
2587  break;
2588 
2589  }
2590 
2591 
2592 
2593 }
2594 
2595 
2596 
2597 int DefPWD_OK = 0;
2598 extern int NumRip;
2599 
2600 void DB_PasWd(void)
2601 {
2602  char DefPwdSys[10]="nefertari";
2603  char ttest[32];
2604  int er;
2605 
2606  sprintf(ttest,"%s","DAS Config");
2607 
2608 /* MSetMessageDialogRGB(DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2609  MSetMessageDialogFgRGB(DPAL.DB_FG_Albl[0],DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
2610  MSetMessageDialogFonts(FIXED_SMALL, FIXED_SMALL);
2611  MSetInputPromptRGB(DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2612  MSetInputPromptFgRGB(DPAL.DB_FG_Albl[0],DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
2613  MSetInputPromptFonts(FIXED_SMALL, FIXED_SMALL, FIXED_SMALL);
2614 
2615  er = MDCreateSh_PWD();
2616  if(er == 0)
2617  {
2618 */
2619  //er = ChkConfigInstance();
2620  er = ChkWinInstance(ttest, DAS.Gui.ConfigPanel.ShellConfig);
2621  if (er==0)
2622  {
2624  DPWD.FlgSh_PWD = 1;
2625  }
2626 /*
2627  }
2628  else
2629  {
2630  MMessageDialog("INF PWD", "You insert a wrong PWD! Retry or Contact DanBo", "Ok", NULL);
2631  DPWD.FlgSh_PWD = 1;
2632 
2633  }
2634 */
2635 }
2636 
2637 static YProfOn = 0;
2638 void D_YProfile(void)
2639 {
2640  if (YProfOn == 0)
2641  {
2642  YProfOn = 1;
2643  DIL.Img.Prof[Server]=1;
2644  MObjectSetText(DAS.Gui.PushButt.KeyB[23], "P Y On");
2645  }
2646  else
2647  {
2648  YProfOn = 0;
2649  DIL.Img.Prof[Server]=0;
2650  MObjectSetText(DAS.Gui.PushButt.KeyB[23], "P Y Off");
2651  }
2652 
2653 }
2654 
2655 static XProfOn = 0;
2656 void D_XProfile(void)
2657 {
2658 
2659  if (XProfOn == 0)
2660  {
2661  XProfOn = 1;
2662  DIL.Img.Prof[Server]=2;
2663  MObjectSetText(DAS.Gui.PushButt.KeyB[22], "P X On");
2664  }
2665  else
2666  {
2667  XProfOn = 0;
2668  DIL.Img.Prof[Server]=0;
2669  MObjectSetText(DAS.Gui.PushButt.KeyB[22], "P X Off");
2670  }
2671 }
2672 /**************************************************************/
2673 void DB_dirCB(MOBJECT o, void *id, void *a_data)
2674 {
2675 
2676  int c = (int) a_data;
2677 
2678  switch(c)
2679  {
2680  case 0 :
2681  GrDIR = 0;
2682  break;
2683  case 1:
2684  GrDIR = 1;
2685  break;
2686 
2687  }
2688 }
2689 
2690 
2691 void ActMvGratCB(MOBJECT edit, char *text, void *ed)
2692 {
2693  static int notify;
2694  long npt, x, dp = 500;
2695  char buf[32];
2696  int er = 0, id;
2697  float k;
2698  long period = 5000;
2699 
2700  //id = DAS.StepM.Addr[AMS1];
2701  id=0;
2702 
2703 
2704 
2705 
2706  if(DAS.Flag.gratposmode == 0) //Step
2707  {
2708  if( DAS.Flag.stepgratenc == 0) // No Parametrization
2709  {
2710  // OLD
2711  x = (long) atoi(text);
2712  }
2713  else
2714  {
2715  // New
2716  k = (float)SM_stepr(DAS.StepM.step[id][1])/3200;
2717  npt = (long) atoi(text);
2718  x = (long)(float) (npt * DAS.StepM.multiplier[id][1] * k);
2719  }
2720  }
2721  else if(DAS.Flag.gratposmode == 1) //Wl
2722  {
2723  k = (float)SM_stepr(DAS.StepM.step[id][1])/3200;
2724  npt = (long) atoi(text);
2725  x = (long) (npt * 24.33 * DAS.StepM.multiplier[id][1] * k);
2726 
2727  }
2728 
2729  if(x)
2730  {
2731  if(DAS.Flag.backlashrec==0) // Perform backlash recovery
2732  {
2733  if(GrDIR == 0)
2734  {
2735  x += GRS.dp;
2736  }
2737 
2738  er = DB_StepMotor(AMS1, 1, x, GrDIR);
2739  if (er)
2740  {
2741  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][DAS.StepM.SM_B], "SYS\\ledGreen.bmp");
2742  sprintf(buf, "%s", "Done");
2743  MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[1], buf);
2744  }
2745  //Se ci si e' mossi verso l'UV si fa il recupero del gioco
2746  if(GrDIR == 0) // faccio recupero gioco
2747  {
2748  er = DB_StepMotor(AMS1, 1, GRS.dp, 1);
2749  if (er)
2750  {
2751  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][DAS.StepM.SM_B], "SYS\\ledGreen.bmp");
2752  sprintf(buf, "%s", "Done");
2753  MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[1], buf);
2754  }
2755  }
2756  }
2757  else // DO NOT Perform backlash recovery
2758  {
2759  er = DB_StepMotor(AMS1, 1, x, GrDIR);
2760  if (er)
2761  {
2762  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][DAS.StepM.SM_B], "SYS\\ledGreen.bmp");
2763  sprintf(buf, "%s", "Done");
2764  MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[1], buf);
2765  }
2766 
2767  }
2768 
2769  }
2770 
2771 
2772  GratFlg = 1;
2773  sprintf(text, "", "");
2774  notify ^= 1;
2775  MEditSetTextExt((MOBJECT) ed, text, False, notify);
2776 }
2777 
2778 void DB_GratPosMode_CB(MOBJECT o, void *a, void *v)
2779 {
2780 
2781  int er = 0;
2782  int c = (int) v;
2783 
2784 
2786 
2787  if(er)
2788  {
2789  switch (c)
2790  {
2791  case 0:
2792  DAS.Flag.gratposmode = 0; //step
2793  MObjectSetText(DAS.Gui.ContrPanel.lbl_mvgratmode, " Steps:");
2796 
2797  break;
2798  case 1:
2799  DAS.Flag.gratposmode = 1; //wl
2800  MObjectSetText(DAS.Gui.ContrPanel.lbl_mvgratmode, "Amstrongs:");
2803  DAS.Flag.stepgratenc = 0;
2804  ;
2805  break;
2806  }
2807  }
2808 
2809 }
2810 
2811 void DB_StepGratEnc_CB(MOBJECT o, void *a, void *v)
2812 {
2813 
2814  int er = 0;
2815  int c = (int) v;
2817 
2818  if(er)
2819  {
2820  switch (c)
2821  {
2822  case 0:
2823  DAS.Flag.stepgratenc = 0;
2824  break;
2825  case 1:
2826  DAS.Flag.stepgratenc = 1;
2827  break;
2828  }
2829  }
2830 
2831 
2832 }
2833 
2834 
2835 void DB_RecGio_CB(MOBJECT o, void *a, void *v)
2836 {
2837 
2838  int er = 0;
2839  int c = (int) v;
2841 
2842  if(er)
2843  {
2844  switch (c)
2845  {
2846  case 0:
2847  DAS.Flag.backlashrec = 0;
2848  break;
2849  case 1:
2850  DAS.Flag.backlashrec = 1;
2851  break;
2852  }
2853  }
2854 
2855 
2856 }
2857 
2858 
2860 {
2861 
2862 
2863  MOBJECT lbl;
2864  MOBJECT rb;
2865 
2866 // MOBJECT lbl1;
2867  MOBJECT edt;
2868 // MOBJECT pbut;
2869  MOBJECT rowfrm, rowfrm1, colfrm;
2870  MOBJECT tb;
2871  char buff[255];
2872  DAS.Gui.Shells.Sh_mg = MCreateShell("MOVE GRATING", 0);
2873  MObjectSetBackgroundRGB(DAS.Gui.Shells.Sh_mg, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2874 // MObjectAddEventNotifyCallback(DAS.Gui.Shells.Sh_mg, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2876 
2877  rowfrm = MCreateRowForm(DAS.Gui.Shells.Sh_mg);
2878  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2879 
2880 // MObjectSetBackgroundRGB(rowfrm, 96, 133, 149);
2881  MObjectSetResize(rowfrm, False, False);
2882 
2883 /*
2884  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2885  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2886  MObjectSetTransparency(lbl, 0);
2887  MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, d_events , (void *) 1);
2888 
2889 
2890  DAS.Gui.ContrPanel.lbl_Par[0] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
2891  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_Par[0], RIGHT_ALIGN);
2892  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[0], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
2893  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[0], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
2894 
2895 
2896 */
2897  sprintf(buff,"FREE GRATING POSITIONING");
2898  lbl = MCreateLabel(rowfrm, buff, HELV_MEDIUM);
2899  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
2900  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
2901  MObjectSetTransparency(lbl, 0);
2902 
2903  // MObjectSetForegroundRGB(lbl, 255, 255, 255);
2904 // MObjectSetBackgroundRGB(lbl, 53, 112, 112);
2905  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
2906 
2907  sprintf(buff," NOTE:\nThe Grating is moving, so if you want to shift\n \
2908 a spectral line towards the visible,\nyou have to move the grating in the UV direction.");
2909 
2910  lbl = MCreateLabel(rowfrm, buff, HELV_MEDIUM);
2911  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2912  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2913  MObjectSetResize(lbl, False, False);
2914 
2915 // MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
2916  MObjectSetTransparency(lbl, 0);
2917 
2918 
2919  rowfrm1 = MCreateRowForm(rowfrm);
2920  MObjectSetBackgroundRGB(rowfrm1, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2921  MObjectSetResize(rowfrm1, True, True);
2922  MObjectSetTransparency(rowfrm1, 0);
2923 
2924 /********************/
2925  tb = MCreateTableForm(rowfrm1, 2);
2926  MObjectSetBackgroundRGB(tb, 95, 3, 3);
2928 
2929  if(DAS.Flag.gratposmode == 0)
2930  sprintf(buff, "_ Steps:");
2931  if(DAS.Flag.gratposmode == 1)
2932  sprintf(buff, "Amstrongs:");
2937 
2938  edt = MCreateEdit(tb, "0", 12, FIXED_MEDIUM);
2939  //MEditSetFilter(edt, 4, "");
2940  MObjectSetForegroundRGB(edt, 255, 255, 255);
2941  MObjectSetBackgroundRGB(edt, 0, 0, 90);
2942  MObjectSetShadow(edt, WS_ETCHED_OUT, 2, 1);
2943  MEditSetActCallback(edt, ActMvGratCB, edt);
2944 
2945 /**************************************/
2946 
2947 
2948  lbl = MCreateLabel(rowfrm1, "The typed steps have to be directly sent to the Grating stepper? ", HELV_SMALL);
2949  MObjectSetTransparency(lbl, 0);
2950  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2951  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2952  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
2953 
2954  tb = MCreateTableForm(rowfrm1, 2);
2955  // MObjectSetBackgroundRGB(tb, 96, 133, 149);
2956  MObjectSetBackgroundRGB(tb, 129, 77, 77);
2957  MObjectSetResize(tb, True, False);
2958 
2959  DAS.Gui.ContrPanel.rbStepGratEnc[0] = MCreateRButton(tb, "Yes - Send direct", FIXED_SMALL);
2960  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.rbStepGratEnc[0], 255, 255, 255);
2963 
2964  DAS.Gui.ContrPanel.rbStepGratEnc[1] = MCreateRButton(tb, "No - Use the DAS encoding", FIXED_SMALL);
2965  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.rbStepGratEnc[1], 255, 255, 255);
2967 
2968 
2969 
2970  lbl = MCreateLabel(rowfrm1, "Do you want to perform the backlash recovery? ", HELV_SMALL);
2971  MObjectSetTransparency(lbl, 0);
2972  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2973  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2974  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
2975 
2976  tb = MCreateTableForm(rowfrm1, 2);
2977  // MObjectSetBackgroundRGB(tb, 96, 133, 149);
2978  MObjectSetBackgroundRGB(tb, 129, 77, 77);
2979  MObjectSetResize(tb, True, False);
2980 
2981  rb = MCreateRButton(tb, "Yes ", FIXED_SMALL);
2982  MObjectSetForegroundRGB(rb, 255, 255, 255);
2983  MPButtonSetCallback(rb, DB_RecGio_CB, (void *) 0);
2984  MRButtonActivate(rb);
2985 
2986  rb = MCreateRButton(tb, "No", FIXED_SMALL);
2987  MObjectSetForegroundRGB(rb, 255, 255, 255);
2988  MPButtonSetCallback(rb, DB_RecGio_CB, (void *) 1);
2989 
2990 
2991 
2992  colfrm = MCreateColForm(rowfrm1);
2993  MObjectSetBackgroundRGB(colfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2994  MObjectSetResize(colfrm, False, True);
2995  MObjectSetTransparency(colfrm, 0);
2996 
2997 
2998  lbl = MCreateLabel(colfrm, "Select dir.", TIMES_SMALL);
2999  MObjectSetTransparency(lbl, 0);
3000  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
3001  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
3002  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3003 
3004  tb = MCreateTableForm(colfrm, 1);
3005  // MObjectSetBackgroundRGB(tb, 96, 133, 149);
3006  //MObjectSetBackgroundRGB(tb, 112, 128, 112);
3007  MObjectSetBackgroundRGB(tb, 129, 77, 77);
3008  MObjectSetResize(tb, False, True);
3009 
3010  rb = MCreateRButton(tb, "CW - UV", FIXED_SMALL);
3011  MObjectSetForegroundRGB(rb, 255, 255, 255);
3012  MPButtonSetCallback(rb, DB_dirCB, (void *) 0);
3013  MRButtonActivate(rb);
3014  GrDIR = 0;
3015 
3016  rb = MCreateRButton(tb, "CCW - Vis", FIXED_SMALL);
3017  MObjectSetForegroundRGB(rb, 255, 255, 255);
3018  MPButtonSetCallback(rb, DB_dirCB, (void *) 1);
3019 
3020 /* colfrm = MCreateColForm(rowfrm1);
3021  MObjectSetBackgroundRGB(colfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
3022  MObjectSetResize(colfrm, True, True);
3023  MObjectSetTransparency(colfrm, 0);
3024 */
3025  lbl = MCreateLabel(colfrm, "Positioning with:", TIMES_SMALL);
3026  MObjectSetTransparency(lbl, 0);
3027  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
3028  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
3029  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3030 
3031  tb = MCreateTableForm(colfrm, 1);
3032  //MObjectSetBackgroundRGB(tb, 112, 128, 112);
3033  MObjectSetBackgroundRGB(tb, 129, 77, 77);
3034  MObjectSetResize(tb, False, True);
3035 
3036  rb = MCreateRButton(tb, "Step", FIXED_SMALL);
3037  MPButtonSetCallback(rb, DB_GratPosMode_CB, (void *) 0);
3039  MObjectSetForegroundRGB(rb, 255, 255, 255);
3040  MObjectSetCompositeWidth(rb, 100);
3041  if(DAS.Flag.gratposmode == 0)
3042  MRButtonActivate(rb);
3043 
3044  rb = MCreateRButton(tb, "Wavelength", FIXED_SMALL);
3045  MPButtonSetCallback(rb, DB_GratPosMode_CB, (void *) 1);
3047  MObjectSetForegroundRGB(rb, 255, 255, 255);
3048  MObjectSetCompositeWidth(rb, 100);
3049  if(DAS.Flag.gratposmode == 1)
3050  MRButtonActivate(rb);
3051 
3052 
3053 
3054 
3055  MShellRealizeXY(DAS.Gui.Shells.Sh_mg, 0, 0);
3056 
3057  GratFlg = 0;
3058  MLoopWhileFlag(&GratFlg, 0);
3059 
3062 
3063 
3064 }
3065 
3066 
3067 void ActMvAzimCB(MOBJECT edit, char *text, void *ed)
3068 {
3069  static int notify;
3070  long x, dp = 500;
3071  char buf[32];
3072  int er = 0, id;
3073  float k;
3074  long period = 5000;
3075 
3076  id = DAS.StepM.Addr[AMS3];
3077 
3078  k = SMfraz(DAS.StepM.step[id][DAS.StepM.SM_B]);
3079 
3080  x = (long) atoi(text);// * (long) 4; //c'era un * k, 4 e' la riduzione;
3081 
3082 // if(GrDIR == 0) //si va verso l'UV
3083 // {
3084 // x += dp; // add fixed step number for backlash recovery
3085 // }
3086  if(x)
3087  {
3088  er = DB_StepMotor(AMS3, 5, x, GrDIR);
3089  if (er)
3090  {
3091  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][DAS.StepM.SM_B], "SYS\\ledGreen.bmp");
3092  sprintf(buf, "%s", "Done");
3093  MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[5], buf);
3094  }
3095  }
3096 
3097  //Se ci si e' mossi verso l'UV si fa il recupero del gioco
3098 
3099 // if(GrDIR == 0) // faccio recupero gioco
3100 // {
3101 // er = DB_StepMotor(AMS3, 5, dp, 1);
3102 // if (er)
3103 // {
3104 // MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][DAS.StepM.SM_B], "SYS\\ledGreen.bmp");
3105 // sprintf(buf, "%s", "Done");
3106 // MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[5], buf);
3107 // }
3108 // }
3109 // }
3110  GratFlg = 1;
3111  sprintf(text, "", "");
3112  notify ^= 1;
3113  MEditSetTextExt((MOBJECT) ed, text, False, notify);
3114 }
3115 
3116 void ActMvZenCB(MOBJECT edit, char *text, void *ed)
3117 {
3118  static int notify;
3119  long x, dp = 500;
3120  char buf[32];
3121  int er = 0, id;
3122  float k;
3123  long period = 5000;
3124 
3125  id = DAS.StepM.Addr[AMS3];
3126 
3127  k = SMfraz(DAS.StepM.step[id][DAS.StepM.SM_A]);
3128 
3129 
3130 // k = SMfraz(DAS.StepM.step[4]);
3131 
3132  x = (long) atoi(text);// * (long) 4; //c'era un * k, 4 e' la riduzione;
3133 
3134 // if(GrDIR == 0) //si va verso l'UV
3135 // {
3136 // x += dp; // add fixed step number for backlash recovery
3137 // }
3138 
3139  if(x)
3140  {
3141 
3142  er = DB_StepMotor(AMS3, 4, x, GrDIR);
3143  if (er)
3144  {
3145  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][DAS.StepM.SM_A], "SYS\\ledGreen.bmp");
3146  sprintf(buf, "%s", "Done");
3147  MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[4], buf);
3148  }
3149  }
3150 
3151  //Se ci si e' mossi verso l'UV si fa il recupero del gioco
3152 
3153 /* if(GrDIR == 0) // faccio recupero gioco
3154  {
3155  er = DB_StepMotor(AMS3, 4, dp, 1);
3156  if (er)
3157  {
3158  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][DAS.StepM.SM_A], "SYS\\ledGreen.bmp");
3159  sprintf(buf, "%s", "Done");
3160  MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[4], buf);
3161  }
3162  }
3163 */
3164 // }
3165  GratFlg = 1;
3166  sprintf(text, "", "");
3167  notify ^= 1;
3168  MEditSetTextExt((MOBJECT) ed, text, False, notify);
3169 }
3170 
3171 
3172 void ActMvZenDegCB(MOBJECT edit, char *text, void *ed)
3173 {
3174  static int notify;
3175  float x;
3176 // char buf[32];
3177  int er = 0;
3178 // float k;
3179 // long period = 5000;
3180 
3181 
3182  x = (float) atof(text);
3183 
3184  SD_Zenith(x);
3185 
3186  GratFlg = 1;
3187  sprintf(text, "", "");
3188  notify ^= 1;
3189  MEditSetTextExt((MOBJECT) ed, text, False, notify);
3190 }
3191 
3193 {
3194 
3195 
3196  MOBJECT lbl;
3197 // MOBJECT rbut;
3198 // MOBJECT rbutt;
3199  MOBJECT lbl1;
3200  MOBJECT edt;
3201 // MOBJECT pbut;
3202  MOBJECT _rowform000;
3203  MOBJECT _tablefrm000;
3204  char buff[255];
3205  DAS.Gui.Shells.Sh_mg = MCreateShell("MOVE Zenith Axes", 0);
3206  MObjectSetBackgroundRGB(DAS.Gui.Shells.Sh_mg, 96, 133, 149);
3207 
3208  _rowform000 = MCreateRowForm(DAS.Gui.Shells.Sh_mg);
3209  MObjectSetBackgroundRGB(_rowform000, 96, 133, 149);
3210  MObjectSetResize(_rowform000, True, True);
3211 
3212  sprintf(buff,"This tool allows for the positioning of the Zenith\n \
3213 Axis at the typed angle. \n ");
3214 
3215  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3216  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3217  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3218  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3219 // if(DAS.MIGE.type)
3220 // {
3221  sprintf(buff," NOTE: Allowed values: -90 < angle < 90.\n");
3222 // }
3223 // else
3224 // {
3225 // sprintf(buff," NOTE: Allowed values: -91 < angle < 45.\n");
3226 // }
3227  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3228  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3229  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3230  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3231 
3232 
3233  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_mg, 2);
3234  MObjectSetBackgroundRGB(_tablefrm000, 96, 133, 149);
3235  MObjectSetResize(_tablefrm000, True, True);
3236 
3237  lbl1 = MCreateLabel(_tablefrm000, "Degrees (xx.x):", FIXED_SMALL);
3238  MObjectSetForegroundRGB(lbl1, 255, 255, 255);
3239 
3240  edt = MCreateEdit(_tablefrm000, "0", 12, FIXED_MEDIUM);
3241  //MEditSetFilter(edt, 4, "");
3242  MObjectSetForegroundRGB(edt, 255, 255, 255);
3243  MObjectSetBackgroundRGB(edt, 0, 0, 0);
3244  MObjectSetShadow(edt, WS_ETCHED_OUT, 2, 1);
3246 
3247 
3248 
3249  MShellRealizeXY(DAS.Gui.Shells.Sh_mg, 0, 0);
3250 
3251  GratFlg = 0;
3252  MLoopWhileFlag(&GratFlg, 0);
3253 
3256 
3257 
3258 }
3259 
3260 
3262 {
3263 
3264 
3265  MOBJECT lbl;
3266  MOBJECT rbut;
3267  MOBJECT rbutt;
3268  MOBJECT lbl1;
3269  MOBJECT edt;
3270 // MOBJECT pbut;
3271  MOBJECT _rowform000;
3272  MOBJECT _tablefrm000;
3273  char buff[255];
3274  DAS.Gui.Shells.Sh_mg = MCreateShell("MOVE Zenith Axes", 0);
3275  MObjectSetBackgroundRGB(DAS.Gui.Shells.Sh_mg, 96, 133, 149);
3276 
3277  _rowform000 = MCreateRowForm(DAS.Gui.Shells.Sh_mg);
3278  MObjectSetBackgroundRGB(_rowform000, 96, 133, 149);
3279  MObjectSetResize(_rowform000, True, True);
3280 
3281  sprintf(buff,"This tool allows for the positioning of the Zenith\n \
3282 Axis of a free number of steps\n ");
3283 
3284  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3285  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3286  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3287  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3288 
3289  sprintf(buff," NOTE:\n");
3290 
3291  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3292  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3293  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3294  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3295 
3296 
3297  lbl = MCreateLabel(_rowform000, "Select dir.", TIMES_SMALL);
3298  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3299  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3300  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3301 
3302  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_mg, 2);
3303  MObjectSetBackgroundRGB(_tablefrm000, 96, 133, 149);
3304  MObjectSetResize(_tablefrm000, True, True);
3305 
3306  rbut = MCreateRButton(_tablefrm000, "CCW", FIXED_SMALL);
3307  MObjectSetForegroundRGB(rbut, 255, 255, 255);
3308  MPButtonSetCallback(rbut, DB_dirCB, (void *) 0);
3309  MRButtonActivate(rbut);
3310  GrDIR = 0;
3311 
3312  rbutt = MCreateRButton(_tablefrm000, "CW", FIXED_SMALL);
3313  MObjectSetForegroundRGB(rbutt, 255, 255, 255);
3314  MPButtonSetCallback(rbut, DB_dirCB, (void *) 1);
3315 
3316  lbl1 = MCreateLabel(_tablefrm000, "Step:", FIXED_SMALL);
3317  MObjectSetForegroundRGB(lbl1, 255, 255, 255);
3318 
3319  edt = MCreateEdit(_tablefrm000, "0", 12, FIXED_MEDIUM);
3320  //MEditSetFilter(edt, 4, "");
3321  MObjectSetForegroundRGB(edt, 255, 255, 255);
3322  MObjectSetBackgroundRGB(edt, 0, 0, 0);
3323  MObjectSetShadow(edt, WS_ETCHED_OUT, 2, 1);
3324  MEditSetActCallback(edt, ActMvZenCB, edt);
3325 
3326 
3327 
3328  MShellRealizeXY(DAS.Gui.Shells.Sh_mg, 0, 0);
3329 
3330  GratFlg = 0;
3331  MLoopWhileFlag(&GratFlg, 0);
3332 
3335 
3336 
3337 }
3338 
3339 
3341 {
3342 
3343 
3344  MOBJECT lbl;
3345  MOBJECT rbut;
3346  MOBJECT rbutt;
3347  MOBJECT lbl1;
3348  MOBJECT edt;
3349 // MOBJECT pbut;
3350  MOBJECT _rowform000;
3351  MOBJECT _tablefrm000;
3352  char buff[255];
3353  DAS.Gui.Shells.Sh_mg = MCreateShell("MOVE Azimuth Axes", 0);
3354  MObjectSetBackgroundRGB(DAS.Gui.Shells.Sh_mg, 96, 133, 149);
3355 
3356  _rowform000 = MCreateRowForm(DAS.Gui.Shells.Sh_mg);
3357  MObjectSetBackgroundRGB(_rowform000, 96, 133, 149);
3358  MObjectSetResize(_rowform000, True, True);
3359 
3360  sprintf(buff,"This tool allows for the positioning of the Azimuth\n \
3361 Axis of a free number of steps\n ");
3362 
3363  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3364  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3365  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3366  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3367 
3368  sprintf(buff," NOTE:\n");
3369 
3370  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3371  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3372  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3373  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3374 
3375 
3376  lbl = MCreateLabel(_rowform000, "Select dir.", TIMES_SMALL);
3377  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3378  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3379  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3380 
3381  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_mg, 2);
3382  MObjectSetBackgroundRGB(_tablefrm000, 96, 133, 149);
3383  MObjectSetResize(_tablefrm000, True, True);
3384 
3385  rbut = MCreateRButton(_tablefrm000, "CCW", FIXED_SMALL);
3386  MObjectSetForegroundRGB(rbut, 255, 255, 255);
3387  MPButtonSetCallback(rbut, DB_dirCB, (void *) 0);
3388  MRButtonActivate(rbut);
3389  GrDIR = 0;
3390 
3391  rbutt = MCreateRButton(_tablefrm000, "CW", FIXED_SMALL);
3392  MObjectSetForegroundRGB(rbutt, 255, 255, 255);
3393  MPButtonSetCallback(rbut, DB_dirCB, (void *) 1);
3394 
3395  lbl1 = MCreateLabel(_tablefrm000, "Step:", FIXED_SMALL);
3396  MObjectSetForegroundRGB(lbl1, 255, 255, 255);
3397 
3398  edt = MCreateEdit(_tablefrm000, "0", 12, FIXED_MEDIUM);
3399  //MEditSetFilter(edt, 4, "");
3400  MObjectSetForegroundRGB(edt, 255, 255, 255);
3401  MObjectSetBackgroundRGB(edt, 0, 0, 0);
3402  MObjectSetShadow(edt, WS_ETCHED_OUT, 2, 1);
3403  MEditSetActCallback(edt, ActMvAzimCB, edt);
3404 
3405 
3406 
3407  MShellRealizeXY(DAS.Gui.Shells.Sh_mg, 0, 0);
3408 
3409  GratFlg = 0;
3410  MLoopWhileFlag(&GratFlg, 0);
3411 
3414 
3415 
3416 }
3417 
3418 
3419 float MIGEZen(float p)
3420 {
3421  float MAZMax; //MIGE Azimut MAX
3422  float MAZMin; //MIGE Azimut Min
3423  float SAA, az;
3424  char str[80];
3425 
3426 
3427  if (DAS.MIGE.type == 1 & DAS.Paramini.EqType == GASCODNG2)
3428  {
3429  MAZMax = 120.0; //MIGE Azimut MAX - Silver Model
3430  MAZMin = -60.0; //MIGE Azimut Min - Silver Model
3431  }
3432  else if (DAS.MIGE.type == 1 & DAS.Paramini.EqType == TROPOGAS)
3433  {
3434  MAZMax = 160.0; //MIGE Azimut MAX - Silver Model
3435  MAZMin = -20.0; //MIGE Azimut Min - Silver Model
3436  }
3437  else if (DAS.MIGE.type == 1)
3438  {
3439  MAZMax = 60.0; //MIGE Azimut MAX - Black Prototype Model
3440  MAZMin = -120.0; //MIGE Azimut Min - Black Prototype Model
3441  }
3442  if (DAS.MIGE.type == 2)
3443  {
3444  MAZMax = 90.0; //MIGE Azimut MAX - COM Model (slip ring)
3445  MAZMin = -90.0; //MIGE Azimut Min - COM Model (slip Ring)
3446  }
3447  //Need condition for the latitude?
3448  // Inside Tropics
3449 
3450  //sun Azimuth angle
3451  sprintf(str, "%.01lf", AST.realazpos);
3452  SAA = (float)atof(str);
3453 
3454 
3455  if (SAA >= 0 && SAA <= MAZMax)
3456  {
3457  p = p;
3458  }
3459  if (SAA > MAZMax && SAA <= (MAZMax + 180))
3460  {
3461  //p = -p;
3462  p= 180 - p;
3463  }
3464  if (SAA > (MAZMax + 180) && SAA < 360)
3465  {
3466  p = p;
3467  }
3468 
3469  return p;
3470 
3471 }
3472 
3473 
3474 
3475 float MIGEAz(float p)
3476 {
3477 
3478  float MAZMax; //MIGE Azimut MAX
3479  float MAZMin; //MIGE Azimut Min
3480  float SAA, az;
3481  char str[80];
3482 
3483  if( (DAS.MIGE.type == 1 & DAS.Paramini.EqType == GASCODNG2) )
3484  {
3485  MAZMax = 120.0; //MIGE Azimut MAX - Silver Model
3486  MAZMin = -60.0; //MIGE Azimut Min - Silver Model
3487  }
3488  else if (DAS.MIGE.type == 1 & DAS.Paramini.EqType == TROPOGAS)
3489  {
3490  MAZMax = 160.0; //MIGE Azimut MAX - Silver Model
3491  MAZMin = -20.0; //MIGE Azimut Min - Silver Model
3492  }
3493  else if (DAS.MIGE.type == 1)
3494  {
3495  MAZMax = 60.0; //MIGE Azimut MAX - Black Prototype Model
3496  MAZMin = -120.0; //MIGE Azimut Min - Black Prototype Model
3497  }
3498  if (DAS.MIGE.type == 2)
3499  {
3500  MAZMax = 90.0; //MIGE Azimut MAX - COM Model (slip ring)
3501  MAZMin = -90.0; //MIGE Azimut Min - COM Model (slip Ring)
3502 
3503 
3504  }
3505  //Need condition for the latitude?
3506  // Inside Tropics
3507 
3508  //sun Azimuth angle
3509  sprintf(str, "%.01lf", S_azim);
3510  SAA = p;
3511 
3512 
3513  if (SAA >= 0 && SAA <= MAZMax)
3514  {
3515  az = SAA;
3516  }
3517  if (SAA > MAZMax && SAA <= (MAZMax + 180))
3518  {
3519  az = SAA - 180;
3520  }
3521  if (SAA > (MAZMax+180) && SAA < 360)
3522  {
3523  az = SAA - 360;
3524  }
3525 
3526  return az;
3527 }
3528 
3529 
3530 void ActMvAzimDegCB(MOBJECT edit, char *text, void *ed)
3531 {
3532  static int notify;
3533  float x;
3534 // char buf[32];
3535  int er = 0;
3536  float k;
3537  long period = 5000;
3538 
3539 
3540  x = (float) atof(text);
3541 
3542  k=MIGEAz(x);
3543 
3544  SD_Azimuth(k, x);
3545  //SD_Azimuth(x, x);
3546 
3547  GratFlg = 1;
3548  sprintf(text, "", "");
3549  notify ^= 1;
3550  MEditSetTextExt((MOBJECT) ed, text, False, notify);
3551 }
3552 
3553 
3554 void MIGEZenAzPos_CB(MOBJECT o, void *a, void *v)
3555 {
3556 
3557  int er = 0;
3558  int c = (int) v;
3559  char buf[32];
3560  float z, az;
3561 
3562  MObjectGetText(DAS.MIGE.edtzen, buf);
3563  z = (float) atof(buf);
3564  MObjectGetText(DAS.MIGE.edtaz, buf);
3565  az = (float) atof(buf);
3566 
3567  SD_Position(-1, -1, -1, z, az);
3568 
3569  GratFlg = 1;
3570 
3571 }
3572 
3574 {
3575 
3576  MOBJECT lbl;
3577  MOBJECT pbut;
3578 // MOBJECT rbutt;
3579  MOBJECT lbl1;
3580 // MOBJECT edt;
3581 // MOBJECT pbut;
3582  MOBJECT _rowform000;
3583  MOBJECT _tablefrm000;
3584  char buff[255];
3585  DAS.Gui.Shells.Sh_mg = MCreateShell("MOVE Zenith and Azimuth Axis", 0);
3586  MObjectSetBackgroundRGB(DAS.Gui.Shells.Sh_mg, 96, 133, 149);
3587 
3588  _rowform000 = MCreateRowForm(DAS.Gui.Shells.Sh_mg);
3589  MObjectSetBackgroundRGB(_rowform000, 96, 133, 149);
3590  MObjectSetResize(_rowform000, True, True);
3591 
3592  sprintf(buff,"This tool allows for the positioning of the Zenith and Azimuth\n \
3593 Axes at the typed angles.");
3594 
3595  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3596  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3597  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3598  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3599 
3600 
3601 
3602  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_mg, 3);
3603  MObjectSetBackgroundRGB(_tablefrm000, 96, 133, 149);
3604  MObjectSetResize(_tablefrm000, True, True);
3605 
3606  lbl1 = MCreateLabel(_tablefrm000, "Zenith (xxx.x):", FIXED_SMALL);
3607  MObjectSetForegroundRGB(lbl1, 255, 255, 255);
3608  MObjectSetShadow(lbl1, WS_SHADOW_IN, 1, 0);
3609 
3610  sprintf(buff, "%.1lf", ZST.realzenpos);
3611  DAS.MIGE.edtzen = MCreateEdit(_tablefrm000, buff, 6, FIXED_MEDIUM);
3612  //MEditSetFilter(edt, 4, "");
3613  MObjectSetForegroundRGB(DAS.MIGE.edtzen, 255, 255, 255);
3614  MObjectSetBackgroundRGB(DAS.MIGE.edtzen, 0, 0, 0);
3616  //MEditSetActCallback(edt, ActMvZenDegCB, edt);
3617 
3618  sprintf(buff," Allowed values: 0 <= x <= 180.");
3619  lbl = MCreateLabel(_tablefrm000, buff, TIMES_SMALL);
3620  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3621  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3622  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3623 
3624 
3625 
3626  lbl1 = MCreateLabel(_tablefrm000, "Azimuth (xxx.x):", FIXED_SMALL);
3627  MObjectSetForegroundRGB(lbl1, 255, 255, 255);
3628  MObjectSetShadow(lbl1, WS_SHADOW_IN, 1, 0);
3629 
3630  //sprintf(buff, "%.1lf", AST.Pos);
3631  sprintf(buff, "%.1lf", AST.realazpos);
3632  DAS.MIGE.edtaz = MCreateEdit(_tablefrm000, buff, 6, FIXED_MEDIUM);
3633  //MEditSetFilter(edt, 4, "");
3634  MObjectSetForegroundRGB(DAS.MIGE.edtaz, 255, 255, 255);
3635  MObjectSetBackgroundRGB(DAS.MIGE.edtaz, 0, 0, 0);
3637  //MEditSetActCallback(edt, ActMvAzimDegCB, edt);
3638 
3639 
3640  sprintf(buff," Allowed values: 0 <= x <= 360.");
3641  lbl = MCreateLabel(_tablefrm000, buff, TIMES_SMALL);
3642  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3643  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3644  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3645 
3646 
3647 
3648  _rowform000 = MCreateRowForm(DAS.Gui.Shells.Sh_mg);
3649  MObjectSetBackgroundRGB(_rowform000, 96, 133, 149);
3650  MObjectSetResize(_rowform000, True, True);
3651 
3652 
3653  pbut = MCreatePButton(_rowform000, "DO POSIT.", FIXED_SMALL);
3654  MObjectSetBackgroundRGB(pbut, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
3655  MObjectSetForegroundRGB(pbut, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
3656  //MObjectSetForegroundRGB(pbut, 255, 255, 255);
3657  MPButtonSetCallback(pbut, MIGEZenAzPos_CB, (void *) 0);
3658 
3659 
3660  MShellRealizeXY(DAS.Gui.Shells.Sh_mg, 0, 0);
3661 
3662  GratFlg = 0;
3663  MLoopWhileFlag(&GratFlg, 0);
3664 
3667 
3668 
3669 
3670 }
3671 
3672 
3674 {
3675 
3676 
3677  MOBJECT lbl;
3678 // MOBJECT rbut;
3679 // MOBJECT rbutt;
3680  MOBJECT lbl1;
3681  MOBJECT edt;
3682 // MOBJECT pbut;
3683  MOBJECT _rowform000;
3684  MOBJECT _tablefrm000;
3685  char buff[255];
3686  DAS.Gui.Shells.Sh_mg = MCreateShell("MOVE Azimuth Axes", 0);
3687  MObjectSetBackgroundRGB(DAS.Gui.Shells.Sh_mg, 96, 133, 149);
3688 
3689  _rowform000 = MCreateRowForm(DAS.Gui.Shells.Sh_mg);
3690  MObjectSetBackgroundRGB(_rowform000, 96, 133, 149);
3691  MObjectSetResize(_rowform000, True, True);
3692 
3693  sprintf(buff,"This tool allows for the positioning of the Azimuth\n \
3694 Axis at the typed angle. \n ");
3695 
3696  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3697  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3698  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3699  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3700 // if(DAS.MIGE.type)
3701 // {
3702 // sprintf(buff," NOTE: Allowed values: -130 < angle < 80\n since the Home position has been set to 0°N");
3703 // }
3704 // else
3705 // {
3706 // sprintf(buff," NOTE: Allowed values: 20 < angle < 305\n since the Home position has been set to 55°N");
3707 // }
3708 //sprintf(buff," NOTE: Allowed values: -150 < angle < 30");
3709  sprintf(buff," Allowed Azimuth angles: [0, 360]");
3710  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3711  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3712  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3713  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3714 
3715 
3716  sprintf(buff," NOTE: If Azimuth is [0, 120] or [300, 360] --> Zenith [-90, 0]");
3717  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3718  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3719  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3720  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3721 
3722  sprintf(buff," NOTE 1: If Azimuth is [120, 300] --> Zenith [0, 90]");
3723  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3724  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3725  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3726  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3727 
3728 
3729 
3730 
3731 
3732 
3733 
3734  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_mg, 2);
3735  MObjectSetBackgroundRGB(_tablefrm000, 96, 133, 149);
3736  MObjectSetResize(_tablefrm000, True, True);
3737 
3738 
3739  lbl1 = MCreateLabel(_tablefrm000, "angle:", FIXED_SMALL);
3740  MObjectSetForegroundRGB(lbl1, 255, 255, 255);
3741 
3742 
3743  //sprintf(buff, "%.1lf", AST.Pos);
3744  sprintf(buff, "%.1lf", AST.realazpos);
3745  edt = MCreateEdit(_tablefrm000, buff, 12, FIXED_MEDIUM);
3746  //MEditSetFilter(edt, 4, "");
3747  MObjectSetForegroundRGB(edt, 255, 255, 255);
3748  MObjectSetBackgroundRGB(edt, 0, 0, 0);
3749  MObjectSetShadow(edt, WS_ETCHED_OUT, 2, 1);
3751 
3752 
3753 
3754  MShellRealizeXY(DAS.Gui.Shells.Sh_mg, 0, 0);
3755 
3756  GratFlg = 0;
3757  MLoopWhileFlag(&GratFlg, 0);
3758 
3761 
3762 
3763 }
3764 
3765 
3766 void DB_Pause(void)
3767 {
3768 
3769  if(FLAG.exec)
3770  {
3771  FLAG.exec = 0;
3772  Status("Waiting for the end of current instruction");
3773  MObjectSetText(DAS.Gui.PushButt.KeyB[25],"Resume");
3774  DB_KB_ButtonActive(1);
3775 
3776  if(DAS.Flag.DeltaSZA == 1)
3777  {
3778  DAS.Flag.ExeDSZA = 0; //Stop PRG Execution
3779 
3780 // SZADelta.LastMSZA = S_zenetr;
3781 // D_FixSZA();
3782  }
3783 
3784 
3785  }
3786  else if(FLAG.exec == 0)
3787  {
3788  FLAG.exec = 1;
3789  Status("Execution Resumed");
3790  MObjectSetText(DAS.Gui.PushButt.KeyB[25],"Pause");
3791  DB_KB_ButtonActive(0);
3794  // If a SZAPRG or a *.PRG file is in execution with the DeltaSZA Mode activated
3795  // the next SZA has to be recalculated
3796 
3797 
3798  if(DAS.Flag.DeltaSZA == 1)
3799  {
3800  DAS.Flag.ExeDSZA = 1; //PRG Execution
3801 
3803  D_FixSZA();
3804 
3805  }
3806  }
3807 
3808 }
3809 
3810 void DB_KB_ButtonActive(int mod)
3811 {
3812  int i;
3813  int eqtype;
3814  eqtype = DAS.Paramini.EqType;
3815 
3816  if(mod == 1)
3817  {
3818  for (i=0; i < (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
3819  {
3820 
3821  MObjectSetSensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Sensitive
3822  if (eqtype == TROPOGAS)
3823  {
3824 
3825  }
3826  if (eqtype == SPATRAMPLUS ||
3827  eqtype == GASCODNG1 ||
3828  eqtype == GASCODNG2 ||
3829  eqtype == GASCODNG3 ||
3830  eqtype == GASCODNG4 ||
3831  eqtype == SPATRAM2 ||
3832  eqtype == SPATRAM3)
3833  if(i==11 )
3834  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]); // Horiz Measur
3835  if(i==8 || i==9)
3836  {
3837  if(DAS.MIGE.linked == 0)
3838  {
3840  //MObjectSetBackgroundRGB(optedit, 192, 192, 192);
3841 
3842  }
3843  }
3844 
3845 
3846  if (DAS.Paramini.EqType == SPATRAM || DAS.Paramini.EqType == LIS_)
3847  {
3848  if(i==3 || i==4 || i==8 || i==9 || i==10 || i== 11)
3850  }
3851  //if (DAS.Paramini.EqType == GASCODNG)
3852  // if(i==4 || i==5 || i==10 || i== 11)
3853  // MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]);
3854 
3855  }
3856  }
3857  else if(mod == 0)
3858  {
3859  for (i=0; i < (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) - 1; i++)
3860  {
3861 
3862  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Unsensitive
3863  }
3864 
3865  }
3866  else if(mod == 3) //Case off lineplot
3867  {
3868  for (i=0; i < (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
3869  {
3870 
3871  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Unsensitive
3872  }
3873 
3880 
3881  }
3882 
3883  else if(mod == 2) //Case TEST AMS
3884  {
3885  for (i=0; i < (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
3886  {
3887 
3888  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Unensitive
3889  }
3890 
3906 
3907  }
3908 
3909  else if(mod == 4) //Case Horizontal Measurements (Deactivation)
3910  {
3911 
3915  //MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[3]);
3916 
3917  for (i=14; i < 22; i++)
3918  {
3919 
3920  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Unensitive
3921  }
3922 
3923 
3924  }
3925 
3926  else if(mod == 5) //Case Horizontal Measurements (Activation)
3927  {
3928 
3933 
3934  for (i=14; i < 22; i++)
3935  {
3936 
3937  MObjectSetSensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Unensitive
3938  }
3939 
3940 
3941  }
3942 
3943 
3944 }
3945 
3946 void DT_ShutterCB(MOBJECT p, void *od, void *ad)
3947 {
3948 
3949  MOBJECT c = ad;
3950 
3951  if (DAS.Tools.FlagShutter == 0)
3952  {
3953  DAS.Tools.FlagShutter = 1;
3954  MObjectSetText(p, "Shutter Open");
3955  MPixmapSetImageFile(c, "SYS\\ledon.bmp");
3956  DC_SetMode(CLEARCCD, 0, 0);
3957  DC_SetMode(NOSHUTTER, 1, 0);
3958  DC_ShutterControl(1, 0);
3959  }
3960  else if (DAS.Tools.FlagShutter == 1)
3961  {
3962  DAS.Tools.FlagShutter = 0;
3963  MObjectSetText(p, "Shutter Closed");
3964 
3965  MPixmapSetImageFile(c, "SYS\\ledoff.bmp");
3966  DC_SetMode(CLEARCCD, 1, 0);
3967  DC_SetMode(NOSHUTTER, 0, 0);
3968  DC_ShutterControl(0, 0);
3969  }
3970 }
3971 
3972 
3973 void DB_ToolsKeyB_CB(MOBJECT p, void *od, void *ad)
3974 {
3975 
3976  int c = (int) ad;
3977  int er = 0;
3978  char buf[_MAX_PATH];
3979  char fname[128], dirname[128];
3980  unsigned long ns;
3981 
3982 
3983  FB_PREFS fbp;
3984  strcpy (dirname, MGetCurrentDirectory ());
3985  fname[0] = '\0';
3986  memset (&fbp, 0, sizeof (fbp));
3987 
3988  fbp.change_cwd = True;
3989  fbp.allow_dir_create = True;
3990  fbp.allow_dir_rename = True;
3991  fbp.allow_dir_delete = True;
3992  fbp.transparent_tree = False;
3993  fbp.font = HELV_SMALL;
3994  fbp.button_font = HELV_SMALL;
3995  //Set Img file
3996  sprintf(buf, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "sys\\Tile2.bmp" );
3997  fbp.bg_image_file =buf;
3998 
3999  switch(c)
4000  {
4001 
4002  case 0 :
4003 
4004  break;
4005  //Column Format
4006  case 1:
4007  UPS_Status();
4008  //DT_ColFormat();
4009  break;
4010  //Link Spectra
4011  case 2:
4012  DT_LinkSpectra();
4013  break;
4014  //Doas Analisys
4015  case 3:
4016  BuildLogRatio();
4017  break;
4018  //Flux Index
4019  case 4:
4020  DT_FluxIndex();
4021  break;
4022  //spare
4023  case 5:
4025  //DT_CorrHeader();
4026  break;
4027  //Spare
4028  case 6:
4029  //DT_CorrFileEvora();
4030  //MClearTimeout(&IDS.TIMER);
4032  break;
4033  //Read Grating Steps
4034  case 7:
4035  ns = AMS_ReadStep(AMS1, 1);
4036  sprintf(buf, "Steps Grating: %ld", ns);
4037  Status(buf);
4038  break;
4039  //ZERO Grating Steps
4040  case 8:
4041  er = AMS_AzzeraCoord(AMS1, 1);
4042  if(er)
4043  {
4044  Message("No Zero Coord Grating", er);
4045  }
4046  else
4047  {
4048 
4049  }
4050  break;
4051  //Compile PRG File
4052  case 9:
4053  er = MFileBrowseExt ("Select PRG File", "*.PRG", fname, dirname, &fbp);
4054  sprintf(buf, "%s%s", dirname, fname);
4055  er = PRG_Check(1, buf);
4056  if (er == 0)
4057  {
4058  sprintf(buf, "The PRG File: %s was correctly compiled.", fname);
4059  MMessageDialog("DAS Inf.", buf, "OK", NULL);
4060  }
4061 
4062 
4063  break;
4064  //Load PRG File
4065  case 10:
4066  if (DAS.Flag.exemode == MANUAL )
4067  {
4068  er = MFileBrowseExt ("Select PRG File", "*.PRG", fname, dirname, &fbp);
4069  DAS.Flag.exemode = PRGFILE;
4070  sprintf(PrgFile, "%s%s", dirname, fname);
4071  //Compile PRG File
4072  er = PRG_Check(1, PrgFile);
4073  if (er == 0)
4074  {
4075  sprintf(buf, "The PRG File: %s was correctly compiled.", fname);
4076  MMessageDialog("DAS Inf.", buf, "OK", NULL);
4077  }
4078 
4079  on = LoadExec(PrgFile);
4080  DI_SplitName(PrgFile, dirname, buf);
4082  // DAS Working directory and MGUI Environment
4083  sprintf(buf, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "DAS.exe");
4084  er = SetWorkDirMGUIenv(buf);
4085  if (er == -1)
4086  {
4087  //Unable to set the enviromental variable
4088  }
4089 
4090  MShellUnrealize(TOOLS.Sh_Tools);
4091  MShellDestroy(TOOLS.Sh_Tools);
4092  }
4093  else if (DAS.Flag.exemode == DBDEMO )
4094  {
4095 
4096  er = MFileBrowseExt ("Select PRG File", "*.PRG", fname, dirname, &fbp);
4097  DAS.Flag.exemode = PRGFILE;
4098  sprintf(PrgFile, "%s%s", dirname, fname);
4099  //Compile PRG File
4100  er = PRG_Check(1, PrgFile);
4101  if (er == 0)
4102  {
4103  sprintf(buf, "The PRG File: %s was correctly compiled.", fname);
4104  MMessageDialog("DAS Inf.", buf, "OK", NULL);
4105  on = LoadExec(PrgFile);
4106  DI_SplitName(PrgFile, dirname, buf);
4108  // DAS Working directory and MGUI Environment
4109  sprintf(buf, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "DAS.exe");
4110  er = SetWorkDirMGUIenv(buf);
4111  if (er == -1)
4112  {
4113  //Unable to set the enviromental variable
4114  }
4115 
4116  MShellUnrealize(TOOLS.Sh_Tools);
4117  MShellDestroy(TOOLS.Sh_Tools);
4118  }
4119 
4120  }
4121 
4122 
4123  else if (DAS.Flag.exemode == PRGFILE)
4124  {
4125 
4126  er = MFileBrowseExt ("Replace PRG File in Execution with:", "*.PRG", fname, dirname, &fbp);
4127  //Put something to verify that this is a good PRG file
4128  sprintf(PrgFile, "%s%s", dirname, fname);
4129  on = LoadExec(PrgFile);
4130  DI_SplitName(PrgFile, dirname, buf);
4132  MShellUnrealize(TOOLS.Sh_Tools);
4133  MShellDestroy(TOOLS.Sh_Tools);
4134  }
4135  else
4136  {
4137  MMessageDialog("DAS Inf.","In this Execution Mode the requested oparation can not be executed." , "OK", NULL);
4138 
4139  }
4140 
4141 
4142  break;
4143  //temp history
4144  case 11:
4145  er = BrowseLog();
4146  break;
4147  //Close
4148  case 12:
4149  MShellUnrealize(TOOLS.Sh_Tools);
4150  MShellDestroy(TOOLS.Sh_Tools);
4151  break;
4152  }
4153 
4154 
4155 }
4156 
4157 
4158 void DB_Tools()
4159 {
4160 
4161 
4162  MOBJECT tb, rowf, lbl,rowf1;
4163  int i;
4164 // char buf[80];
4165 
4166  MOBJECT colform;//, rowform1;
4167  MOBJECT pixmap,pixbut;
4168 
4169 
4170 const char *KeyCom_Code[] = {{"Shutter Closed"},//0
4171  {"Column Format"}, //1
4172  {"Link Spectra "}, //2
4173  {"DOAS Analisys"}, //3
4174  {"Calc Flx Indx"}, //4
4175  {"Reload timer task "},//{"Correct H "}, //5
4176  {"Clear timer task "}, //{"CorrFileEvora"}, //6
4177  {"READ Grat. Steps"}, //7
4178  {"ZERO Grat. Steps"}, //8
4179  {"Compile PRG"}, //9
4180  {"Load PRG"}, //10
4181  {"Temp. History"}, //11
4182  {"Close"}}; //12
4183 
4184 
4185 
4186  TOOLS.Sh_Tools = MCreateShell("DAS TOOLS", SF_NO_MAXIMIZE);
4187  MObjectSetBackgroundRGB(TOOLS.Sh_Tools, 91, 74, 74);
4188 
4189 
4190  rowf = MCreateRowForm(TOOLS.Sh_Tools);
4191  MObjectSetResize(rowf, True, True);
4192  MObjectSetBackgroundRGB(rowf, 91, 74, 74);
4193 
4194  lbl = MCreateLabel(rowf, "TOOLS", HELV_MEDIUM);
4195  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
4196  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4197  MObjectSetResize(lbl, False, True);
4198 
4199 
4200  rowf1 = MCreateRowForm(rowf);
4201  MObjectSetResize(rowf1, True, True);
4202  MObjectSetBackgroundRGB(rowf1, 74, 60, 0);
4203 
4204  lbl = MCreateLabel(rowf1, "Shutter Control", HELV_SMALL);
4205  MObjectSetForegroundRGB(lbl, 255, 255, 255);
4206  MObjectSetBackgroundRGB(lbl, 96, 132, 152);
4207  MObjectSetTransparency(lbl, 0);
4208  MObjectSetShadow(lbl, WS_ETCHED_IN, 1, 1);
4209  MObjectSetCompositeWidth(lbl, 150);
4210 
4211 
4212  colform = MCreateColForm(rowf1);
4213  MObjectSetForegroundRGB(colform, 255, 255, 255);
4214  MObjectSetBackgroundRGB(colform, 74, 60, 0);
4215  MObjectSetShadow(colform, WS_NONE, 0, 0);
4216  MObjectSetResize(colform, False, False);
4217 
4218 
4219  pixbut = MCreatePixmapFromFile(colform, "SYS\\ledoff.bmp");
4221 
4222  TOOLS.KeyB[0] = MCreatePButton(colform, KeyCom_Code[0], HELV_SMALL);
4223  MObjectSetBackgroundRGB(TOOLS.KeyB[0], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
4224  MObjectSetForegroundRGB(TOOLS.KeyB[0], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
4225  MPButtonSetCallback(TOOLS.KeyB[0], DT_ShutterCB, (void *) pixbut);
4226  MButtonSetOnMouseOverForegroundRGB(TOOLS.KeyB[0], 255, 255, 255);
4228 
4229  tb = MCreateTableForm(colform, 2);
4230  MFormSetSpacing(tb, 1);
4233  MObjectSetBackgroundRGB(tb, 112, 128, 112);
4235 
4236  pixmap = MCreatePixmapFromFile(tb, "sys\\LEDOFFsmall.BMP");
4237 
4238  lbl = MCreateLabel(tb, "Close", HELV_SMALL);
4239  MLabelSetMargin(lbl, 3, 1);
4240  MObjectSetBackgroundRGB(lbl, 74, 60, 0);
4241  MObjectSetTransparency(lbl, 0);
4242  MObjectSetResize(lbl, False, False);
4243 
4244  pixmap = MCreatePixmapFromFile(tb, "sys\\LEDONsmall.BMP");
4245 
4246  lbl = MCreateLabel(tb, "Open", HELV_SMALL);
4248  MLabelSetMargin(lbl, 3, 1);
4250  MObjectSetBackgroundRGB(lbl, 74, 60, 0);
4251  MObjectSetTransparency(lbl, 0);
4252 
4253 
4254 
4255  tb = MCreateTableForm(rowf, 2);
4256  MObjectSetBackgroundRGB(tb, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4257  MObjectSetShadow(tb, WS_NONE, 0, 0);
4258  MObjectSetResize(tb, True, True);
4259 
4260 
4261 
4262 
4263  for (i=1; i < (sizeof TOOLS.KeyB / sizeof TOOLS.KeyB[0]); i++)
4264  {
4265  TOOLS.KeyB[i] = MCreatePButton(tb, KeyCom_Code[i], HELV_SMALL);
4266  MObjectSetBackgroundRGB(TOOLS.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
4267  MObjectSetCompositeWidth(TOOLS.KeyB[i], 120);
4268  MPButtonSetCallback(TOOLS.KeyB[i], DB_ToolsKeyB_CB, (void *) i);
4269  MButtonSetOnMouseOverForegroundRGB(TOOLS.KeyB[i], 0, 0, 255);
4270  /***************************************/
4271  /* DeActivated Buttons */
4272 // if ((i==0) || (i==1) || (i==2) || (i==3) || (i==4) || (i==5) || (i==6))
4273  if ((i==0) || (i==2) || (i==3) || (i==4) || (i==5) || (i==6))
4274  {
4275  MObjectSetUnsensitive(TOOLS.KeyB[i]);
4276  }
4277  /***************************************/
4278 
4279  }
4280 
4281 
4282  MShellRealize(TOOLS.Sh_Tools);
4283 
4284 
4285 
4286 
4287 }
4288 /*
4289 //Find Char in a string
4290 Param : mod --> direction of search: mod = 0 --> left to right
4291  mod = 1 --> right to left
4292  char string --> source for search
4293  int ch --> char to be found
4294 */
4295 int DB_FindChar(int mod, char *string, int ch)
4296 {
4297 
4298  int result;
4299  char *pdest;
4300 
4301  if (mod) /* Search backward. */
4302  {
4303  pdest = strrchr( string, ch );
4304  result = pdest - string + 1;
4305  return result;
4306  }
4307  else
4308  {
4309  pdest = strchr( string, ch );
4310  result = pdest - string + 1;
4311  return result;
4312  }
4313 
4314  return -1;
4315 }
4316 
4318 
4319 
4320 void CloseShCB(MOBJECT p, void *od, void *ad)
4321 {
4322  int c = (int) ad;
4323 
4324  switch(c)
4325  {
4326  case 0:
4327  MShellUnrealize(p);
4328  MShellDestroy(p);
4329  break;
4330  case 1:
4331  MShellUnrealize(p);
4332  MShellDestroy(p);
4333  break;
4334  case 2:
4335  MShellUnrealize(p);
4336  MShellDestroy(p);
4337  break;
4338  case 3:
4339  MShellUnrealize(p);
4340  MShellDestroy(p);
4341  break;
4342  case 4:
4343  MShellUnrealize(p);
4344  MShellDestroy(p);
4345  break;
4346 
4347  }
4348 
4349 }
4350 
4351 void SimPosShClose_CB(MOBJECT p, void *od, void *ad)
4352 {
4353 
4354  MOBJECT c = (MOBJECT) ad;
4355 
4356  FLAG.SimShell = 0;
4357  MShellUnrealize(c);
4358  MShellDestroy(c);
4359 }
4360 
4361 
4362 void ExecSimPosCB(MOBJECT p, void *od, void *ad)
4363 {
4364 
4365 
4366  SD_Position(MIS.target, GRS.target, FWS.target, ZST.target, AST.target);
4367 
4368 }
4369 
4370 
4371 void ListTargetCB(MOBJECT p, LIST_ACT *la, void *ad)
4372 {
4373 
4374  int c = (int) ad;
4375  int er = 0;
4376  char buf[16];
4377 
4378  switch (c)
4379  {
4380  case 0:
4381  MIS.target = la->pos;
4382  break;
4383  case 1:
4384  GRS.target = la->pos;
4385 
4386  break;
4387  case 2:
4388  FWS.target = la->pos;
4389 
4390  break;
4391  case 4:
4392  sprintf(buf,"%s", la->item);
4393  ZST.target = atof(buf);
4394 
4395  break;
4396  case 5:
4397  sprintf(buf,"%s", la->item);
4398  AST.target = atof(buf);
4399 
4400  break;
4401 
4402  }
4403 
4404 
4405 
4406 }
4407 
4408 
4409 
4410 
4412 {
4413  int i, er = 0, nfilt;
4414  char buf[80];
4415  MOBJECT tb, tb1;
4416  MOBJECT pb;
4417  MOBJECT rowform;
4418 // MOBJECT colform;
4419  MOBJECT lbl;
4420  MOBJECT optedit;
4421  MOBJECT list;
4422 
4423  LIST_ACT * pla;
4424 
4425 
4426  //DAS.Gui.Shells.Sh_SimPos = MCreateShell("SET DESIRED POSITION",SF_SAVEUNDER);
4427  DAS.Gui.Shells.Sh_SimPos = MCreateShell("SET DEVICE POSITION",SF_MODAL);
4428  MObjectSetForegroundRGB(DAS.Gui.Shells.Sh_SimPos, 255, 255, 255);
4429  MObjectSetBackgroundRGB(DAS.Gui.Shells.Sh_SimPos, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4430 
4431  rowform = MCreateRowForm(DAS.Gui.Shells.Sh_SimPos);
4432  MObjectSetBackgroundRGB(rowform, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4433  MObjectSetWidth(rowform, 250);
4434  //MObjectSetResize(rowform, True, True);
4435 
4436  tb = MCreateTableForm(rowform, 2);
4437  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4438  MObjectSetResize(tb, True, True);
4439 
4440  /*********************************************/
4441  lbl = MCreateLabel(tb, "Mirror", FIXED_SMALL);
4444  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
4445  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
4446  MObjectSetTransparency(lbl, 0);
4447  MObjectSetResize(lbl, True, True);
4448 
4449  optedit = MCreateOptionEdit(tb, "", 8, 8, 4, FIXED_SMALL);
4450  MEditDisableEditing(optedit);
4451  MObjectAlign(optedit, RIGHT_ALIGN, TOP_ALIGN);
4452  MObjectSetForegroundRGB(optedit, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4453  MObjectSetBackgroundRGB(optedit, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4454  list = MOptionEditGetList(optedit);
4455  for (i=0; i < (sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0]); i++)
4456  {
4457  if (DAS.Paramini.EqType == TROPOGAS || DAS.Paramini.EqType == SPATRAM3 || DAS.Paramini.EqType == GASCODNG4 )
4458  sprintf(buf, "%s",Mir_CodeTropo[i]);
4459  else
4460  sprintf(buf, "%s",Mir_Code[i]);
4461  MSListAddItem(list, buf, 0L);
4462  }
4463  MSListSelectElement(list, MIS.Pos);
4464  MIS.target = MIS.Pos;
4465  MOptionEditSetListCallback(optedit, ListTargetCB, (void *) 0);
4466  pla = MSListGetSelected(list);
4467  sprintf(buf, "%s",pla->item);
4468  MObjectSetText(optedit, buf);
4469  /*********************************************/
4470 
4471  /*********************************************/
4472  lbl = MCreateLabel(tb, "Grating", FIXED_SMALL);
4475  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
4476  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
4477  MObjectSetTransparency(lbl, 0);
4478  MObjectSetResize(lbl, True, True);
4479 
4480  optedit = MCreateOptionEdit(tb, "", 8, 8, 14, FIXED_SMALL);
4481  MEditDisableEditing(optedit);
4482  MObjectAlign(optedit, RIGHT_ALIGN, TOP_ALIGN);
4483  MObjectSetForegroundRGB(optedit, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4484  MObjectSetBackgroundRGB(optedit, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4485  list = MOptionEditGetList(optedit);
4486  for (i=0; i < (sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0]); i++)
4487  {
4488  //sprintf(buf, "%s",Wl_Code[i]);
4489  itoa(wl[i], buf,10);
4490  MSListAddItem(list, buf, 0L);
4491  }
4492  MSListSelectElement(list, GRS.Wl);
4493  GRS.target = GRS.Wl;
4494  MOptionEditSetListCallback(optedit, ListTargetCB, (void *) 1);
4495  pla = MSListGetSelected(list);
4496  sprintf(buf, "%s",pla->item);
4497  MObjectSetText(optedit, buf);
4498  /*********************************************/
4499 
4500  /*********************************************/
4501  lbl = MCreateLabel(tb, "Filter", FIXED_SMALL);
4504  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
4505  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
4506  MObjectSetTransparency(lbl, 0);
4507  MObjectSetResize(lbl, True, True);
4508 
4509  if(DAS.Paramini.EqType == LIS_)
4510  nfilt = 8;
4511  else
4512  nfilt = 6;
4513 
4514  optedit = MCreateOptionEdit(tb, "", 8, 8, nfilt, FIXED_SMALL);
4515  MEditDisableEditing(optedit);
4516  MObjectAlign(optedit, RIGHT_ALIGN, TOP_ALIGN);
4517  MObjectSetForegroundRGB(optedit, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4518  MObjectSetBackgroundRGB(optedit, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4519  list = MOptionEditGetList(optedit);
4520 
4521 
4522 
4523  for (i=0; i < nfilt; i++)
4524  {
4525  if(nfilt==8)
4526  sprintf(buf, "%s",Fil_Code8H[i]);
4527  else
4528  {
4529  if(DAS.Paramini.EqType == TROPOGAS)
4530  sprintf(buf, "%s",Fil_CodeTropo[i]);
4531  else if (DAS.Paramini.EqType == GASCODNG2 ||
4532  DAS.Paramini.EqType == GASCODNG3 ||
4533  DAS.Paramini.EqType == GASCODNG4)
4534  sprintf(buf, "%s",Fil_CodeNG[i]);
4535  else if (DAS.Paramini.EqType == GASCODNG1)
4536  sprintf(buf, "%s",Fil_CodeNG1[i]);
4537  else
4538  sprintf(buf, "%s",Fil_Code[i]);
4539  }
4540 
4541 
4542 
4543  MSListAddItem(list, buf, 0L);
4544  }
4545  MSListSelectElement(list, FWS.Pos);
4546  FWS.target = FWS.Pos;
4547  MOptionEditSetListCallback(optedit, ListTargetCB, (void *) 2);
4548  pla = MSListGetSelected(list);
4549  sprintf(buf, "%s",pla->item);
4550  MObjectSetText(optedit, buf);
4551  /*********************************************/
4552 
4553  if(DAS.Paramini.EqType == TROPOGAS ||
4554  DAS.Paramini.EqType == SPATRAMPLUS ||
4555  DAS.Paramini.EqType == GASCODNG1 ||
4556  DAS.Paramini.EqType == GASCODNG2 ||
4557  DAS.Paramini.EqType == GASCODNG3 ||
4558  DAS.Paramini.EqType == GASCODNG4 ||
4559  DAS.Paramini.EqType == SPATRAM2 ||
4560  DAS.Paramini.EqType == SPATRAM3)
4561  {
4562  if (DAS.MIGE.linked)
4563  {
4564  /*********************************************/
4565  lbl = MCreateLabel(tb, "Zenith", FIXED_SMALL);
4568  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
4569  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
4570  MObjectSetTransparency(lbl, 0);
4571  MObjectSetResize(lbl, True, True);
4572 
4573  optedit = MCreateOptionEdit(tb, "", 8, 8, 15, FIXED_SMALL);
4574  MEditDisableEditing(optedit);
4575  MObjectAlign(optedit, RIGHT_ALIGN, TOP_ALIGN);
4576  MObjectSetForegroundRGB(optedit, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4577  MObjectSetBackgroundRGB(optedit, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4578  list = MOptionEditGetList(optedit);
4579 // if(DAS.MIGE.type)
4580 // {
4581  for (i=-90; i < 91; i++)
4582  {
4583  sprintf(buf, "%d",i);
4584  MSListAddItem(list, buf, 0L);
4585  }
4586  MSListSelectElement(list, (long) ZST.Pos+90);
4587 // }
4588 /* else
4589  {
4590  for (i=-91; i < 45; i++)
4591  {
4592  sprintf(buf, "%d",i);
4593  MSListAddItem(list, buf, 0L);
4594  }
4595  MSListSelectElement(list, (long) ZST.Pos+91);
4596  }
4597 */
4598  ZST.target = ZST.Pos;
4599  MOptionEditSetListCallback(optedit, ListTargetCB, (void *) 4);
4600  pla = MSListGetSelected(list);
4601  sprintf(buf, "%s",pla->item);
4602  MObjectSetText(optedit, buf);
4603  if(DAS.DOption.aaopmode == 0)
4604  {
4605  MObjectSetUnsensitive(optedit);
4606  MObjectSetBackgroundRGB(optedit, 192, 192, 192);
4607  }
4608  /*********************************************/
4609 
4610  /*********************************************/
4611  lbl = MCreateLabel(tb, "Azimuth", FIXED_SMALL);
4614  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
4615  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
4616  MObjectSetTransparency(lbl, 0);
4617  MObjectSetResize(lbl, True, True);
4618 
4619  optedit = MCreateOptionEdit(tb, "", 8, 8, 20, FIXED_SMALL);
4620  MEditDisableEditing(optedit);
4621  MObjectAlign(optedit, RIGHT_ALIGN, TOP_ALIGN);
4622  MObjectSetForegroundRGB(optedit, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4623  MObjectSetBackgroundRGB(optedit, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4624  list = MOptionEditGetList(optedit);
4625 // if(DAS.MIGE.type)
4626 // {
4627  for (i = 0; i < 361; i++)
4628  {
4629  sprintf(buf, "%d",i);
4630  MSListAddItem(list, buf, 0L);
4631  }
4632 
4633  MSListSelectElement(list,(long) (AST.Pos));
4634 /* }
4635  else
4636  {
4637  for (i = 20; i < 306; i++)
4638  {
4639  sprintf(buf, "%d",i);
4640  MSListAddItem(list, buf, 0L);
4641  }
4642 
4643  MSListSelectElement(list,(long) (AST.Pos - 20));
4644 
4645  }
4646 */ AST.target = AST.Pos ;
4647  MOptionEditSetListCallback(optedit, ListTargetCB, (void *) 5);
4648  pla = MSListGetSelected(list);
4649  sprintf(buf, "%s",pla->item);
4650  MObjectSetText(optedit, buf);
4651  if(DAS.DOption.aaopmode == 0)
4652  {
4653  MObjectSetUnsensitive(optedit);
4654  MObjectSetBackgroundRGB(optedit, 192, 192, 192);
4655  }
4656  /*********************************************/
4657  }
4658  }
4659 
4660  tb1 = MCreateTableForm(rowform, 2);
4661  MObjectSetBackgroundRGB(tb1, 91, 74, 74);
4662  MObjectSetResize(tb1, True, True);
4663 
4664  pb = MCreatePButton(tb1, "GO", TIMES_SMALL);
4666  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
4667  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
4668  MButtonSetOnMouseOverForegroundRGB(pb, 255, 0, 0);
4669  MObjectSetCompositeWidth(pb, 70);
4671 
4672  pb = MCreatePButton(tb1, "Close", TIMES_SMALL);
4674  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
4675  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
4676  MButtonSetOnMouseOverForegroundRGB(pb, 255, 0, 0);
4677  MObjectSetCompositeWidth(pb, 70);
4679 
4680 //
4681 
4684 
4685  FLAG.SimShell = 1;
4686 
4687  return 0;
4688 
4689 }
4690 
4691 
4692 /***********************************************************************************************/
4693 void DB_KeyB_CB(MOBJECT p, void *od, void *ad)
4694 {
4695  int c = (int) ad;
4696  int er = 0;
4697  char buf[_MAX_PATH];
4698  char fext[4];
4699 
4700  FB_PREFS fbp;
4701 
4702  memset (&fbp, 0, sizeof (fbp));
4703 
4704  fbp.change_cwd = True;
4705  fbp.allow_dir_create = True;
4706  fbp.allow_dir_rename = True;
4707  fbp.allow_dir_delete = True;
4708  fbp.transparent_tree = False;
4709  fbp.font = HELV_SMALL;
4710  fbp.button_font = HELV_SMALL;
4711  //Set Img file
4712  sprintf(buf, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "sys\\Tile2.bmp" );
4713  fbp.bg_image_file =buf;
4714 
4715 
4716  switch(c)
4717  {
4718  //Mirror Shell
4719  case 0 :
4720  er = MDCreateSh_Mir();
4721  if(er == 0)
4722  {
4723  SD_Mirror(MirSet);
4724 // if(er) Status("Ready");
4725  }
4726  break;
4727  //Wavelwngth Shell
4728  case 1:
4729  er = MDCreateSh_Wl();
4730  if(er == 0)
4731  {
4732  er = SD_Grating(WlSet);
4733 // if(er) Status("Ready");
4734  }
4735  break;
4736  //Filter Shell
4737  case 2:
4738  er = MDCreateSh_Fil();
4739  if(er == 0)
4740  {
4741  SD_FilterW(FilSet);
4742 // if(er) Status("Ready");
4743  }
4744  break;
4745  // NDFilter shell
4746  case 3:
4747 
4748  if(DAS.DOption.filtertype == FPLUS )
4749  {
4750  if(TMFlg)
4751  SD_FNTorqueM(0);
4752  else
4753  SD_FNTorqueM(1);
4754  }
4755  if(DAS.DOption.filtertype == FDOUBLE)
4756  {
4757  er = MDCreateSh_NDFil();
4758  if(er == 0)
4759  {
4761 // if(er) Status("Ready");
4762  }
4763  }
4764 
4765  break;
4766 
4767  // Move Zenith Azimuth of a Free step number
4768  case 4:
4770  break;
4771  //Home Mirror
4772  case 5:
4773  // Reference position of All devices
4774  // er = MDCreateSh_Home();
4775  sprintf(buf, "%s", "SET HOME POSITION");
4776  er = ChkWinInstance(buf, DAS.Gui.Shells.Sh_Home);
4777  if (er==0)
4778  MDCreateSh_Home();
4779 /*
4780 
4781  //Disattiva i pulsanti sulla keyboard
4782  DB_KB_ButtonActive(0);
4783  er = DB_InitAMS(AMS1, 2, DAS.StepM.power[AMS1][DAS.StepM.SM_A],
4784  DAS.StepM.step[AMS1][DAS.StepM.SM_A], DAS.StepM.slope[AMS1][DAS.StepM.SM_A],
4785  DAS.StepM.speed[AMS1][DAS.StepM.SM_A], DAS.StepM.power[AMS1][DAS.StepM.SM_B],
4786  DAS.StepM.step[AMS1][DAS.StepM.SM_B], DAS.StepM.slope[AMS1][DAS.StepM.SM_B],
4787  DAS.StepM.speed[AMS1][DAS.StepM.SM_B]);
4788  //Attiva i pulsanti sulla keyboard
4789  DB_KB_ButtonActive(1);
4790 */
4791  break;
4792  //Home Grating
4793  case 6:
4794 
4795  er = ChkDigIO(DAS.StepM.OOP[AMS3], 1);
4796  if (er)
4797  {
4798  FANECU(0);
4799  }
4800  else
4801  {
4802  FANECU(1);
4803  }
4804  // Setto direzioni finali
4805  //AMS_dirfin(AMS1, 0, 0);
4806  // Set default values
4807  //Disattiva i pulsanti sulla keyboard
4808  /* DB_KB_ButtonActive(0);
4809  AMS_Default(AMS1);
4810  er = DB_InitAMS(AMS1, 3, DAS.StepM.power[AMS1][DAS.StepM.SM_A],
4811  DAS.StepM.step[AMS1][DAS.StepM.SM_A], DAS.StepM.slope[AMS1][DAS.StepM.SM_A],
4812  DAS.StepM.speed[AMS1][DAS.StepM.SM_A], DAS.StepM.power[AMS1][DAS.StepM.SM_B],
4813  DAS.StepM.step[AMS1][DAS.StepM.SM_B], DAS.StepM.slope[AMS1][DAS.StepM.SM_B],
4814  DAS.StepM.speed[AMS1][DAS.StepM.SM_B]);
4815  //Attiva i pulsanti sulla keyboard
4816  DB_KB_ButtonActive(1);
4817  */
4818  break;
4819 
4820  //Home Filter
4821  case 7:
4822  //Disattiva i pulsanti sulla keyboard
4823  /*
4824  DB_KB_ButtonActive(0);
4825  //HomeFiltersFast();
4826  AMS_Default(AMS2);
4827  er = DB_InitAMS(AMS2, 4, DAS.StepM.power[AMS2][DAS.StepM.SM_A],
4828  DAS.StepM.step[AMS2][DAS.StepM.SM_A], DAS.StepM.slope[AMS2][DAS.StepM.SM_A],
4829  DAS.StepM.speed[AMS2][DAS.StepM.SM_A], DAS.StepM.power[AMS2][DAS.StepM.SM_B],
4830  DAS.StepM.step[AMS2][DAS.StepM.SM_B], DAS.StepM.slope[AMS2][DAS.StepM.SM_B],
4831  DAS.StepM.speed[AMS2][DAS.StepM.SM_B]);
4832  //Attiva i pulsanti sulla keyboard
4833  DB_KB_ButtonActive(1);
4834  */
4835  break;
4836 
4837 
4838 
4839 
4840  //Home Zenith
4841  case 8:
4842  /*
4843  //Disattiva i pulsanti sulla keyboard
4844  DB_KB_ButtonActive(0);
4845  AMS_Default(AMS3);
4846  er = DB_InitAMS(AMS3, 5, DAS.StepM.power[AMS3][DAS.StepM.SM_A],
4847  DAS.StepM.step[AMS3][DAS.StepM.SM_A], DAS.StepM.slope[AMS3][DAS.StepM.SM_A],
4848  DAS.StepM.speed[AMS3][DAS.StepM.SM_A], DAS.StepM.power[AMS3][DAS.StepM.SM_B],
4849  DAS.StepM.step[AMS3][DAS.StepM.SM_B], DAS.StepM.slope[AMS3][DAS.StepM.SM_B],
4850  DAS.StepM.speed[AMS3][DAS.StepM.SM_B]);
4851  AMS_dirfin(AMS3, 0, 1);
4852  //Attiva i pulsanti sulla keyboard
4853  DB_KB_ButtonActive(1);
4854  */
4855  break;
4856 
4857  //Home Azimuth
4858  case 9:
4859  /*
4860  //Disattiva i pulsanti sulla keyboard
4861  DB_KB_ButtonActive(0);
4862  AMS_Default(AMS3);
4863  er = DB_InitAMS(AMS3, 6, DAS.StepM.power[AMS3][DAS.StepM.SM_A],
4864  DAS.StepM.step[AMS3][DAS.StepM.SM_A], DAS.StepM.slope[AMS3][DAS.StepM.SM_A],
4865  DAS.StepM.speed[AMS3][DAS.StepM.SM_A], DAS.StepM.power[AMS3][DAS.StepM.SM_B],
4866  DAS.StepM.step[AMS3][DAS.StepM.SM_B], DAS.StepM.slope[AMS3][DAS.StepM.SM_B],
4867  DAS.StepM.speed[AMS3][DAS.StepM.SM_B]);
4868  //Attiva i pulsanti sulla keyboard
4869  DB_KB_ButtonActive(1);
4870  */
4871  break;
4872 
4873  // Spectrometer Devices Simultaneous Positioning
4874  case 10:
4875  er = MDCreateSh_SimPos();
4876  break;
4877  //Horizontal Measurement shell
4878  case 11:
4879  MDCreateHorMeas();
4880  break;
4881 
4882  // Move Grating Free step number
4883  case 12:
4884  sprintf(buf, "%s", "MOVE GRATING");
4885  er = ChkWinInstance(buf, DAS.Gui.Shells.Sh_mg);
4886  if (er==0)
4887  MDCreateMoveGrat();
4888  break;
4889  //Configuration Shell
4890  case 13:
4891  DB_PasWd();
4892  break;
4893  //Calibration
4894  case 14:
4895  D_Calibra();
4896  break;
4897  //AutoRange
4898  case 15:
4899  AutoRange(0);
4900  break;
4901  //Get CCD
4902  case 16:
4903  sprintf(buf, "%.3lf", TExp);
4904  er = DB_Ask("DOWNLOAD IMAGE", "", "Time Exposure: ", buf, 6, "Get Light");
4905 
4906  if(er == 0)
4907  {
4908  // sscanf(buf, "%lf", &TExp);
4909  DB_GetCCD(1);
4910  // save_imgASCII(filedati, 1);
4911  }
4912  break;
4913  //Averaging
4914  case 17:
4915  D_Average(1);
4916  break;
4917  //Dark
4918  case 18:
4919  //strcpy(buf, "0.000");
4920  sprintf(buf, "%.3lf", TExp);
4921  er = DB_Ask("DOWNLOAD DARK", "", "Time Exposure: ", buf, 6, "Get Dark");
4922  if(er == 0)
4923  {
4924  // sscanf(buf, "%lf", &TExp);
4925  DB_GetCCD(0);
4926  }
4927  break;
4928  //Save CCD Data
4929  case 19:
4930 
4931  if(DAS.DOption.filename) // Automatic file Names
4932  {
4933  D_Saving();
4934  }
4935  else // free choice
4936  {
4937  if(DAS.DOption.savingmode)
4938  er = MFileBrowseExt ("Save File as...", "*.bif", NFileNameF, BIL.DFILEM.DATADIRECTORY, &fbp);
4939  else
4940  er = MFileBrowseExt ("Save File as...", "*.dat", NFileNameF, BIL.DFILEM.DATADIRECTORY, &fbp);
4941  if(er)
4942  {
4943  //check the presence of the extension
4944  DI_FindExtName(NFileNameF, fext);
4945  if( strcmp(fext,"") == 0 )
4946  {
4947  if(DAS.DOption.savingmode)
4948  strcat(NFileNameF, ".bif");
4949  else
4950  strcat(NFileNameF, ".dat");
4951  }
4952  //check the the extension
4953  DI_FindExtName(NFileNameF, fext);
4954  if( (strcmp(fext,".dat") == 0) | (strcmp(fext,".Dat") == 0) )
4955  {
4956  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",BIL.DFILEM.DATADIRECTORY, NFileNameF);
4957  DB_Save(BIL.DFILEM.DBFILENAME, 0);
4958  }
4959  else if( (strcmp(fext,".bif") == 0) | (strcmp(fext,".Bif") == 0) )
4960  {
4961  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",BIL.DFILEM.DATADIRECTORY, NFileNameF);
4962  DB_Save(BIL.DFILEM.DBFILENAME, 1);
4963  }
4964  else
4965  {
4966  sprintf(buf, "The extension is not recognaized! Please re-type",fext);
4967  MMessageDialog("DAS information", buf, " Ok ", NULL);
4968  break;
4969  }
4970  }
4971 
4972 
4973  sprintf(buf, "%s", NFileNameF );
4974  MObjectSetText(DAS.Gui.ContrPanel.Albl_CS[3], buf);
4975  sprintf(buf, "%05d", SaveCnt);
4976  MObjectSetText(DAS.Gui.ContrPanel.Albl_CS[2], buf);
4977  SaveCnt++;
4978 
4979  }
4980  break;
4981 
4982 
4983  case 20:
4984  //On line Plot
4985  ViewPlot(1);
4986  break;
4987 
4988 
4989  case 21:
4990  DI_Lens();
4991  break;
4992  //Profiling X Axis
4993  case 22:
4994  D_XProfile();
4995  break;
4996  //Profiling Y Axis
4997  case 23:
4998  D_YProfile();;
4999  break;
5000  //Configuration Shell
5001  //About Shell
5002  case 24:
5003  AboutCB(NULL, NULL, 0);
5004  break;
5005  //Pause shell
5006  case 25:
5007  DB_Pause();
5008  break;
5009  //Tools shell
5010  case 26:
5011  sprintf(buf, "%s", "DAS TOOLS");
5012  er = ChkWinInstance(buf, TOOLS.Sh_Tools);
5013  if (er==0)
5014  DB_Tools();
5015  break;
5016  //Quit shell
5017  case 27:
5018  ShutDOWN();
5019  break;
5020  //HG Lamp
5021  case 100:
5022  if(HGFlg)
5023  HgLamp(0);
5024  else
5025  HgLamp(1);
5026  break;
5027  //Qj Lamp
5028  case 111:
5029  if(QJFlg)
5030  QjLamp(0);
5031  else
5032  QjLamp(1);
5033  break;
5034 
5035 
5036 
5037  }
5038 }
5039 
5040 
5041 void DB_LampSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
5042 {
5043  int c = (int) a_data, i;
5044 
5045 
5046  switch (pe->type)
5047  {
5048  case (E_MOTION):
5049  {
5050 
5051  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5052  MSelectObject(obj);
5053  switch (c)
5054  {
5055  case 0:
5056  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.pblamps[1], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5057  break;
5058  case 1:
5059  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.pblamps[0], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5060  break;
5061  }
5062  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5063  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5064  }
5065  break;
5066  }
5067 
5068 }
5069 
5070 
5071 
5072 void DB_KeyComSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
5073 {
5074 
5075  int c = (int) a_data, i;
5076 
5077 /* for (i=0; i<(sizeof PBUTT.KeyB / sizeof PBUTT.KeyB[0]); i++)
5078  {
5079  MObjectSetBackgroundRGB(PBUTT.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5080 
5081  /**************************************
5082  SHAREWARE
5083  if (i==2 | i==9 |i==3 | i==4 |i==6 | i==11 |i==12 | i==13 |i==19 | i== 20| i==17 |i==10 | i== 21)
5084  {
5085  MObjectSetBackgroundRGB(PBUTT.KeyB[i], 150, 150, 150);
5086  }
5087  /***************************************/
5088 
5089 // }
5090 
5091 
5092 
5093  switch (pe->button)
5094  {
5095 
5096  case (Button1):
5097  {
5098  //MObjectSetBackgroundRGB(PBUTT.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5099  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5100  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5101  if(i != c)
5102  {
5103  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5104  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5105  }
5106  /***************************************/
5107  /* SHAREWARE */
5108 // if (c==2 | c==9 |c==3 | c==4 |c==6 | c==11 |c==12 | c==13 |c==19 | c== 20| c==17 |c==10 | c== 21)
5109 // {
5110 // MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], 150, 150, 150);
5111 // }
5112  /***************************************/
5113 
5114 
5115  break;
5116  }
5117  }
5118  switch (pe->type)
5119  {
5120 
5121  case (E_MOTION):
5122  {
5123  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5124  MSelectObject(obj);
5125  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5126  {
5127  if(i != c)
5128  {
5129  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5130  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5131  }
5132  }
5133  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.pblamps[1], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5134  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.pblamps[1], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5135 
5136  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.pblamps[0], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5137  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.pblamps[0], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5138  if(DAS.DOption.aaopmode == 0)
5139  {
5142  //MObjectSetBackgroundRGB(optedit, 192, 192, 192);
5143  }
5144 
5145  break;
5146  }
5147  }
5148 }
5149 
5150 
5151 
5152 void DB_KeyComSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
5153 {
5154 
5155  int c = (int) a_data, i;
5156 
5157 
5158  switch (pe->keycode)
5159  {
5160  case R_A:
5161  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5162  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5163  if (c == (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) - 1)
5164  {
5165  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5166  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[0], ~DPAL.DB_Sel[0], ~DPAL.DB_Sel[1], ~DPAL.DB_Sel[2]);
5167  break;
5168  }
5169  else
5170  {
5171  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c + 1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5172  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[c + 1], ~DPAL.DB_Sel[0], ~DPAL.DB_Sel[1], ~DPAL.DB_Sel[2]);
5173  break;
5174  }
5175  case D_A:
5176 // MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5177 // MObjectSetForegroundRGB(obj, 255 ,0,0);
5178 
5179  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5180  {
5181  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5182  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5183  if (i == c + 1)
5184  {
5185  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5186  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[i], 255,0,0);
5187  MSelectObject(obj);
5188  }
5189 
5190 
5191  }
5192  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.pblamps[1], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5193  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.pblamps[0], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5194  break;
5195 /* MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5196  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5197  if (c == (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) - 1)
5198  {
5199  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5200  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[0], ~DPAL.DB_Sel[0], ~DPAL.DB_Sel[1], ~DPAL.DB_Sel[2]);
5201  break;
5202  }
5203  else
5204  {
5205  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c + 1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5206  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[c + 1], ~DPAL.DB_Sel[0], ~DPAL.DB_Sel[1], ~DPAL.DB_Sel[2]);
5207  break;
5208  }
5209 */
5210  case L_A:
5211  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5212  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5213  if (c == 0)
5214  {
5215  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) - 1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5216  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) - 1], ~DPAL.DB_Sel[0], ~DPAL.DB_Sel[1], ~DPAL.DB_Sel[2]);
5217  break;
5218  }
5219  else
5220  {
5221  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c - 1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5222  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[c - 1], ~DPAL.DB_Sel[0], ~DPAL.DB_Sel[1], ~DPAL.DB_Sel[2]);
5223  break;
5224  }
5225  case U_A:
5226  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5227  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5228  if (c == 0)
5229  {
5230  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) - 1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5231  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) - 1], ~DPAL.DB_Sel[0], ~DPAL.DB_Sel[1], ~DPAL.DB_Sel[2]);
5232  break;
5233  }
5234  else
5235  {
5236  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c - 1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5237  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[c - 1], ~DPAL.DB_Sel[0], ~DPAL.DB_Sel[1], ~DPAL.DB_Sel[2]);
5238  break;
5239  }
5240  case F1:
5241  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) ; i++)
5242  {
5243  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5244  }
5245  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5246  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5247  break;
5248  case F2:
5249  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5250  {
5251  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5252  }
5253  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5254  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5255  break;
5256  case F3:
5257  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5258  {
5259  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5260  }
5261  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5262  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5263  break;
5264  case F5:
5265  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5266  {
5267  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5268  }
5269  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5270  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5271  break;
5272  case F6:
5273  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5274  {
5275  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5276  }
5277  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5278  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5279  break;
5280  case F7:
5281  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5282  {
5283  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5284  }
5285  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5286  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5287  break;
5288  case F8:
5289  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5290  {
5291  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5292  }
5293  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5294  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5295  break;
5296  case F9:
5297  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5298  {
5299  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5300  }
5301  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5302  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5303  break;
5304  case F10:
5305  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5306  {
5307  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5308  }
5309  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5310  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5311  break;
5312  case F11:
5313  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5314  {
5315  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5316  }
5317  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5318  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5319  break;
5320  case F12:
5321  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5322  {
5323  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5324  }
5325  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5326  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5327  break;
5328 /* case A_F1:
5329  for (i=0; i<21; i++)
5330  {
5331  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5332  }
5333  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5334  break;
5335  case A_F2:
5336  for (i=0; i<21; i++)
5337  {
5338  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5339  }
5340  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5341  break;
5342  case A_F3:
5343  for (i=0; i<21; i++)
5344  {
5345  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5346  }
5347  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5348  break;
5349 */
5350  case ESC:
5351  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5352  {
5353  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5354  }
5355  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5356  MSelectObject(DAS.Gui.PushButt.KeyB[c]);
5357  break;
5358  }
5359 }
5360 
5361 
5362 
5363 
5364 /**********************************************************************/
5365 
5366 /**********************************************************************/
5367 /* DB_Ask Shell and CallBaks */
5368 /**********************************************************************/
5369 char *AskBuff;
5370 static int AskFlg=0;
5371 
5372 
5373 int DB_Ask(char *tit,char *bmp, char *label, char *pre, int len, char *pbtype)
5374 {
5375 
5376  MOBJECT _shell005;
5377  MOBJECT _rowform005;
5378  MOBJECT _colform005;
5379  MOBJECT _tablefrm005;
5380  MOBJECT pbut;
5381  MOBJECT edt;
5382  MOBJECT pix;
5383  MOBJECT lbl;
5384 
5385  int er = 0;
5386 
5387  AskBuff = pre;
5388 
5389 
5390  _shell005 = MCreateShell(tit, SF_MODAL);
5391  MObjectSetBackgroundRGB(_shell005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
5392 
5393 
5394  _colform005 = MCreateColForm(_shell005);
5395  MObjectSetBackgroundRGB(_colform005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
5396  MObjectSetShadow(_colform005, WS_NONE, 0, 0);
5397 
5398  _rowform005 = MCreateRowForm(_colform005);
5399  MBottomAttach(_rowform005, F_ATT_NONE, 1, NULL);
5400  MObjectAlign(_rowform005, UNDEF_ALIGN, TOP_ALIGN);
5401  MObjectSetBackgroundRGB(_rowform005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
5402  MObjectSetShadow(_rowform005, WS_NONE, 0, 0);
5403  MObjectSetResize(_rowform005, True, True);
5404 
5405 
5406  _tablefrm005 = MCreateTableForm(_rowform005, 2);
5407  MObjectSetBackgroundRGB(_tablefrm005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
5408  MObjectSetResize(_tablefrm005, True, False);
5409 
5410  lbl = MCreateLabel(_tablefrm005, label, FIXED_SMALL);
5412  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
5413  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
5414 
5415  if(strlen(bmp) > 0)
5416  pix = MCreatePixmapFromFile(_tablefrm005, bmp);
5417 
5418  if(len < 16)
5419  {
5420  edt = MCreateEdit(_tablefrm005, pre, len, FIXED_SMALL);
5421  MObjectSetForegroundRGB(edt, 255, 255, 255);
5422  MObjectSetBackgroundRGB(edt, 0, 0, 0);
5423  MObjectSetShadow(edt, WS_ETCHED_OUT, 2, 1);
5424  //MObjectSetCompositeWidth(edt, 150);
5425 
5426 
5427  }
5428  else
5429  {
5430  edt = MCreateClippedEdit(_tablefrm005, pre, len, 18, FIXED_SMALL);
5431  MObjectSetForegroundRGB(edt, 255, 255, 255);
5432  MObjectSetBackgroundRGB(edt, 0, 0, 0);
5433  MObjectSetShadow(edt, WS_ETCHED_OUT, 2, 1);
5434  MObjectSetCompositeWidth(edt, 150);
5435  }
5436 
5438 // MObjectAddEventNotifyCallback(_shell005, (OBJ_EVENT_CB) DB_Ask_SheelESC, EM_KEY_PRESS, NULL);
5439 
5440 
5441  pbut = MCreatePButton(_colform005, pbtype, HELV_SMALL);
5442  MPButtonSetCallback(pbut, DB_AskCB, (void *) edt);
5443  MObjectSetBackgroundRGB(pbut, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5444  MObjectSetCompositeWidth(pbut, 90);
5445 
5446 
5447 
5448  MShellSetWMCloseCallback(_shell005, DB_CloseAsk, NULL);
5449 
5450 
5451  MShellRealizeXY(_shell005, 0, 0);
5452 
5453  AskFlg = 0;
5454  MLoopWhileFlag(&AskFlg, 0);
5455  if(AskBuff[0] == 0) er = 1;
5456 
5457  MShellUnrealize(_shell005);
5458  MShellDestroy(_shell005);
5459 // MShellRaise(LIS.Sh_KeyB);
5460  return er;
5461 }
5462 void DB_AskCB(MOBJECT p, void *od, void *ad)
5463 {
5464 
5465  char buff[32], tb[32];
5466 
5467  MOBJECT c = ad;
5468 
5469  MObjectGetText(c, buff);
5470 
5471  MObjectGetText(p, tb);
5472 
5473  AskBuff[0] = 0;
5474  AskFlg = 1;
5475 
5476 
5477  sscanf(buff, "%lf", &TExp);
5478  if(strcmp(tb, "Get Light") == 0)
5479  DB_GetCCD(1);
5480  else if(strcmp(tb, "Get Dark") == 0)
5481  DB_GetCCD(0);
5482 }
5483 void DB_CloseAsk(MOBJECT p, void *od, void *ad)
5484 {
5485 
5486  char buff[80];
5487 
5488  MObjectGetText(p, buff);
5489  sscanf(buff, "%lf", &TExp);
5490 
5491 // AskBuff[0] = 0;
5492  AskFlg = 1;
5493 
5494 }
5495 
5496 void DB_Ask_SheelESC(MOBJECT obj, MKeyEvent *pe, void *a_data)
5497 {
5498 
5499  switch (pe->keycode)
5500  {
5501  case ESC:
5502  {
5503  AskBuff[0] = 0;
5504  AskFlg = 1;
5505  }
5506  }
5507 }
5508 
5509 
5510 /**********************************************************************/
5511 void DB_Close_Sh(MOBJECT p, void *od, void *ad)
5512 {
5513  int c = (int) ad;
5514  switch(c)
5515  {
5516  case 0:
5517  MirBuff = "0";
5518  MirFlg = 1;
5519  break;
5520 
5521  case 1:
5522  WlBuff = "0";
5523  WlFlg = 1;
5524  break;
5525 
5526  case 2:
5527  FilBuff = "0";
5528  FilFlg = 1;
5529  break;
5530 
5531  case 3:
5532  NDFilBuff = "0";
5533  NDFilFlg = 1;
5534  break;
5535 
5536 
5537  }
5538 }
5539 
5540 void DB_Esc_CB(MOBJECT p, void *od, void *ad)
5541 {
5542  int c = (int) ad;
5543  switch(c)
5544  {
5545  case 0:
5546  MirBuff = "0";
5547  MirFlg = 1;
5548  break;
5549 
5550  case 1:
5551  WlBuff = "0";
5552  WlFlg = 1;
5553  break;
5554 
5555  case 2:
5556  FilBuff = "0";
5557  FilFlg = 1;
5558  break;
5559 
5560  case 3:
5561  NDFilBuff = "0";
5562  NDFilFlg = 1;
5563  break;
5564 
5565 
5566  }
5567 }
5568 
5569 void DB_SheelESC(MOBJECT obj, MKeyEvent *pe, void *a_data)
5570 {
5571  int c = (int) a_data;
5572  switch(c)
5573  {
5574  case 0:
5575  switch (pe->keycode)
5576  {
5577  case ESC:
5578  MirBuff = "0";
5579  MirFlg = 1;
5580  break;
5581  }
5582  case 1:
5583  switch (pe->keycode)
5584  {
5585  case ESC:
5586  WlSet = GRS.Pos;
5587  WlBuff = "0";
5588  WlFlg = 1;
5589  break;
5590  }
5591  case 2:
5592  switch (pe->keycode)
5593  {
5594  case ESC:
5595  FilBuff = "0";
5596  FilFlg = 1;
5597  break;
5598  }
5599  case 3:
5600  switch (pe->keycode)
5601  {
5602  case ESC:
5603  NDFilBuff = "0";
5604  NDFilFlg = 1;
5605  break;
5606  }
5607  }
5608 }
5609 /**********************************************************************/
5610 /* Mirror Shell and CallBaks */
5611 /**********************************************************************/
5612 int MirSet = 0;
5613 
5615 {
5616  int i, er = 0;
5617  MOBJECT _tablefrm000;
5618 // MOBJECT _tablefrm001;
5619 // MOBJECT Esc_But;
5620  char buf[16];
5621 
5622  DAS.Gui.Shells.Sh_Mir = MCreateShell("SET INPUT MIRROR POSITION", SF_MODAL);
5623  MObjectSetForegroundRGB(DAS.Gui.Shells.Sh_Mir, 255, 255, 255);
5624 
5625 /*
5626  _tablefrm001 = MCreateTableForm(DAS.Gui.Shells.Sh_Mir, 1);
5627  MObjectSetBackgroundRGB(_tablefrm001, 91, 74, 74);
5628  MObjectSetResize(_tablefrm001, True, True);
5629 
5630  Esc_But = MCreatePButton(_tablefrm001, "ESC-Return", HELV_SMALL);
5631  MObjectSetBackgroundRGB(Esc_But, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
5632  MObjectSetShadow(Esc_But, WS_SHADOW_OUT, 3, 0);
5633  MObjectSetCompositeWidth(Esc_But, 180);
5634  MButtonSetAccelerator(Esc_But, ESC);
5635  MButtonSetOnMouseOverForegroundRGB(Esc_But, 255, 255, 255);
5636  MPButtonSetCallback(Esc_But, DB_Esc_CB, (void *) 0);
5637 */
5638  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_Mir, 1);
5639  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
5640  MObjectSetResize(_tablefrm000, True, True);
5641 
5642  for (i=0; i < (sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0]); i++)
5643  {
5644  if (DAS.Paramini.EqType == TROPOGAS || DAS.Paramini.EqType == SPATRAM3 || DAS.Paramini.EqType == GASCODNG4 )
5645  sprintf(buf, "%s",Mir_CodeTropo[i]);
5646  else
5647  sprintf(buf, "%s",Mir_Code[i]);
5648 
5649 
5650  DAS.Gui.PushButt.Mir[i] = MCreatePButton(_tablefrm000, buf, HELV_SMALL);
5651  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5652  MObjectSetForegroundRGB(DAS.Gui.PushButt.Mir[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5653  if (i==MIS.Pos)
5654  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], 0, 0, 255);
5655  //MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5658  //MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Mir[i], (OBJ_EVENT_CB) DB_MirSelButtMouse_CB, EM_BUTTON_PRESS | EM_MOTION, (void *) 1);
5660 
5662  MPButtonSetCallback(DAS.Gui.PushButt.Mir[i], DB_Mir_CB, (void *) i);
5663 // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Mir[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
5665  }
5666 
5669 
5670  MShellRealizeXY(DAS.Gui.Shells.Sh_Mir, 0, 0);
5671 
5672  MirFlg = 0;
5673  MLoopWhileFlag(&MirFlg, 0);
5674  if(MirBuff == "0")
5675  {
5676  MirFlg = 1;
5679 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
5680  return er;
5681  }
5682  else
5683  {
5686 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
5687  return er;
5688  }
5689 
5690 }
5691 
5692 void DB_Mir_CB(MOBJECT p, void *od, void *ad)
5693 {
5694  int c = (int) ad;
5695 
5696 
5697  if (DAS.Paramini.EqType == TROPOGAS || DAS.Paramini.EqType == SPATRAM3 || DAS.Paramini.EqType == GASCODNG4 )
5698  MirBuff = Mir_CodeTropo[c];
5699  else
5700  MirBuff = Mir_Code[c];
5701 
5702 
5703  MirSet = c;
5704  MirFlg = 1;
5705 }
5706 
5707 
5708 void DB_MirSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
5709 {
5710 
5711  int c = (int) a_data, i;
5712 
5713  for (i=0; i<(sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0]); i++)
5714  {
5715  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5716  MObjectSetForegroundRGB(DAS.Gui.PushButt.Mir[c], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5717  }
5718 
5719  switch (pe->button)
5720  {
5721  case (Button1):
5722  {
5723  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5724 // MObjectSetForegroundRGB(DAS.Gui.PushButt.Mir[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5725  break;
5726  }
5727  }
5728  switch (pe->type)
5729  {
5730 
5731  case (E_MOTION):
5732  {
5733  MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5734  MSelectObject(obj);
5735  for (i=0; i<(sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0]); i++)
5736  {
5737  if(i != c)
5738  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5739 
5740  }
5741 
5742  break;
5743  }
5744  }
5745 }
5746 
5747 
5748 void DB_MirSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
5749 {
5750 
5751  int c = (int) a_data;
5752 
5753  switch (pe->keycode)
5754  {
5755  case R_A:
5756  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5757  if (c == (sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0])-1)
5758  {
5759  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5760  break;
5761  }
5762  else
5763  {
5764  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[c+1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5765  break;
5766  }
5767  case D_A:
5768  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5769  if (c == (sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0])-1)
5770  {
5771  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5772  break;
5773  }
5774  else
5775  {
5776  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[c+1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5777  break;
5778  }
5779 
5780  case L_A:
5781  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5782  if (c == 0)
5783  {
5784  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[(sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0])-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5785  break;
5786  }
5787  else
5788  {
5789  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[c-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5790  break;
5791  }
5792  case U_A:
5793  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5794  if (c == 0)
5795  {
5796  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[(sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0])-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5797  break;
5798  }
5799  else
5800  {
5801  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[c-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5802  break;
5803  }
5804  }
5805 }
5806 
5807 
5808 /**********************************************************************/
5809 
5810 /**********************************************************************/
5811 /* Wavelengths Shell and CallBaks */
5812 /**********************************************************************/
5813 
5814 
5815 int MDCreateSh_Wl(void)
5816 {
5817  int i, er = 0;
5818  MOBJECT _tablefrm000;
5819 // MOBJECT _tablefrm001;
5820 // MOBJECT Esc_But;
5821  char buff[16];
5822 
5823  DAS.Gui.Shells.Sh_Wl = MCreateShell("SET WORK WAVELENGTH", SF_MODAL);
5824  MObjectSetForegroundRGB(DAS.Gui.Shells.Sh_Wl, 255, 255, 255);
5825 
5826 /* _tablefrm001 = MCreateTableForm(DAS.Gui.Shells.Sh_Wl, 1);
5827  MObjectSetBackgroundRGB(_tablefrm001, 91, 74, 74);
5828  MObjectSetResize(_tablefrm001, True, True);
5829 
5830  Esc_But = MCreatePButton(_tablefrm001, "ESC-Return", HELV_SMALL);
5831  MObjectSetBackgroundRGB(Esc_But, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
5832  MObjectSetShadow(Esc_But, WS_SHADOW_OUT, 3, 0);
5833  MObjectSetCompositeWidth(Esc_But, 180);
5834  MButtonSetAccelerator(Esc_But, ESC);
5835  MButtonSetOnMouseOverForegroundRGB(Esc_But, 255, 255, 255);
5836  MPButtonSetCallback(Esc_But, DB_Esc_CB, (void *) 1);
5837 */
5838  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_Wl, 3);
5839  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
5840  MObjectSetResize(_tablefrm000, True, True);
5841 
5842  for (i=0; i<(sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0]); i++)
5843  {
5844  itoa(wl[i],buff,10);
5845  DAS.Gui.PushButt.Wl[i] = MCreatePButton(_tablefrm000, buff, HELV_SMALL);
5846 // DAS.Gui.PushButt.Wl[i] = MCreatePButton(_tablefrm000, Wl_Code[i], HELV_SMALL);
5847  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5848  MObjectSetForegroundRGB(DAS.Gui.PushButt.Wl[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5849  if (i==GRS.Wl)
5850  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[i], 0, 0, 255);
5851 
5853 // MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Wl[i], (OBJ_EVENT_CB) DB_WlSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
5855  //if (i > 14 )
5856  //{
5857  // MObjectSetUnsensitive(DAS.Gui.PushButt.Wl[i]);
5858  //}
5859  MObjectSetShadow(DAS.Gui.PushButt.Wl[i], WS_SHADOW_OUT, 3, 0);
5861  MPButtonSetCallback(DAS.Gui.PushButt.Wl[i], DB_Wl_CB, (void *) i);
5862 // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Wl[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
5864  }
5865 
5868 
5869  MShellRealizeXY(DAS.Gui.Shells.Sh_Wl, 0, 0);
5870 
5871  WlFlg = 0;
5872  MLoopWhileFlag(&WlFlg, 0);
5873  if(WlBuff == "0")
5874  {
5875  WlFlg = 1;
5878 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
5879  return er;
5880  }
5881  else
5882  {
5885 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
5886  return er;
5887  }
5888 
5889 }
5890 
5891 void DB_Wl_CB(MOBJECT p, void *od, void *ad)
5892 {
5893  int c = (int) ad ;
5894 
5895  //WlBuff = Wl_Code[c];
5896  //itoa(wl[c], WlBuff, 10);
5897  WlSet = c;
5898  WlFlg = 1;
5899 
5900 }
5901 
5902 
5903 
5904 
5905 void DB_WlSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
5906 {
5907 
5908  int c = (int) a_data, i;
5909 
5910  for (i=0; i<(sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0]); i++)
5911  {
5912  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5913  }
5914 
5915  switch (pe->button)
5916  {
5917 
5918  case (Button1):
5919  {
5920  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5921  break;
5922  }
5923  }
5924 }
5925 
5926 
5927 void DB_WlSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
5928 {
5929 
5930  int c = (int) a_data;
5931 
5932  switch (pe->keycode)
5933  {
5934  case R_A:
5935  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5936  if (c == (sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0])-1)
5937  {
5938  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5939  break;
5940  }
5941  else
5942  {
5943  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[c+1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5944  break;
5945  }
5946  case D_A:
5947  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5948  if (c == (sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0])-1)
5949  {
5950  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5951  break;
5952  }
5953  else
5954  {
5955  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[c+1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5956  break;
5957  }
5958 
5959  case L_A:
5960  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5961  if (c == 0)
5962  {
5963  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[(sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0])-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5964  break;
5965  }
5966  else
5967  {
5968  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[c-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5969  break;
5970  }
5971  case U_A:
5972  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5973  if (c == 0)
5974  {
5975  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[(sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0])-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5976  break;
5977  }
5978  else
5979  {
5980  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[c-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5981  break;
5982  }
5983  }
5984 }
5985 
5986 /**********************************************************************/
5987 
5988 
5989 /**********************************************************************/
5990 /* Filter Shell and CallBaks */
5991 /**********************************************************************/
5992 int FilSet = 0;
5993 
5995 {
5996  int i, er = 0;
5997  int bas = 0; //button array size
5998  MOBJECT _tablefrm000;
5999 // MOBJECT _tablefrm001;
6000 // MOBJECT Esc_But;
6001 
6002  DAS.Gui.Shells.Sh_Fil = MCreateShell("SET FILTER", SF_MODAL);
6003  MObjectSetForegroundRGB(DAS.Gui.Shells.Sh_Fil, 255, 255, 255);
6004 
6005 /*
6006  _tablefrm001 = MCreateTableForm(DAS.Gui.Shells.Sh_Fil, 1);
6007  MObjectSetBackgroundRGB(_tablefrm001, 91, 74, 74);
6008  MObjectSetResize(_tablefrm001, True, True);
6009 
6010  Esc_But = MCreatePButton(_tablefrm001, "ESC-Return", HELV_SMALL);
6011  MObjectSetBackgroundRGB(Esc_But, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
6012  MObjectSetShadow(Esc_But, WS_SHADOW_OUT, 3, 0);
6013  MObjectSetCompositeWidth(Esc_But, 180);
6014  MButtonSetAccelerator(Esc_But, ESC);
6015  MButtonSetOnMouseOverForegroundRGB(Esc_But, 255, 255, 255);
6016  MPButtonSetCallback(Esc_But, DB_Esc_CB, (void *) 2);
6017 */
6018  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_Fil, 1);
6019  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
6020  MObjectSetResize(_tablefrm000, True, True);
6021 
6022 
6023 
6024  if(DAS.Paramini.EqType == LIS_)
6025  {
6026  bas = 8;
6027  for (i=0; i<bas; i++)
6028  {
6029  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_Code8H[i], HELV_SMALL);
6030  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6031  MObjectSetForegroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
6032  if (i==FWS.Pos)
6033  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], 0, 0, 255);
6034 
6036  // MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6040  MPButtonSetCallback(DAS.Gui.PushButt.Fil[i], DB_Fil_CB, (void *) i);
6041  // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6043  }
6044 
6045  }
6046  else
6047  {
6048  bas = 6;
6049  for (i=0; i<bas; i++)
6050  {
6051  if(DAS.Paramini.EqType == TROPOGAS)
6052  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_CodeTropo[i], HELV_SMALL);
6053  else if (DAS.Paramini.EqType == GASCODNG2 || DAS.Paramini.EqType == GASCODNG3 || DAS.Paramini.EqType == GASCODNG4)
6054  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_CodeNG[i], HELV_SMALL);
6055  else if (DAS.Paramini.EqType == GASCODNG1)
6056  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_CodeNG1[i], HELV_SMALL);
6057  else
6058  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_Code[i], HELV_SMALL);
6059 
6060  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6061  MObjectSetForegroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
6062  if (i==FWS.Pos)
6063  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], 0, 0, 255);
6064 
6066  // MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6070  MPButtonSetCallback(DAS.Gui.PushButt.Fil[i], DB_Fil_CB, (void *) i);
6071  // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6073  }
6074 
6075  }
6076 /*
6077  for (i=0; i<(sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]); i++)
6078  {
6079  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_Code[i], HELV_SMALL);
6080  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6081  MObjectSetForegroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
6082  if (i==0)
6083  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6084 
6085  MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtKB_CB, EM_KEY_PRESS, (void *) i);
6086  MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6087  MObjectSetShadow(DAS.Gui.PushButt.Fil[i], WS_SHADOW_OUT, 4, 0);
6088  MObjectSetCompositeWidth(DAS.Gui.PushButt.Fil[i], 150);
6089  MPButtonSetCallback(DAS.Gui.PushButt.Fil[i], DB_Fil_CB, (void *) i);
6090  MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6091  }
6092 
6093 */
6094 
6097 
6098  MShellRealizeXY(DAS.Gui.Shells.Sh_Fil, 0, 0);
6099 
6100  FilFlg = 0;
6101  MLoopWhileFlag(&FilFlg, 0);
6102  if(FilBuff == "0")
6103  {
6104  FilFlg = 1;
6107 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
6108  return er;
6109  }
6110  else
6111  {
6114 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
6115  return er;
6116  }
6117 
6118 }
6119 
6120 void DB_Fil_CB(MOBJECT p, void *od, void *ad)
6121 {
6122  int c = (int) ad;
6123 
6124  if(DAS.Paramini.EqType == LIS_)
6125  FilBuff = Fil_Code8H[c];
6126  else
6127  {
6128  if(DAS.Paramini.EqType == TROPOGAS)
6129  FilBuff = Fil_CodeTropo[c];
6130  else if (DAS.Paramini.EqType == GASCODNG2 || DAS.Paramini.EqType == GASCODNG3 || DAS.Paramini.EqType == GASCODNG4)
6131  FilBuff = Fil_CodeNG[c];
6132  else if (DAS.Paramini.EqType == GASCODNG1)
6133  FilBuff = Fil_CodeNG1[c];
6134  else
6135  FilBuff = Fil_Code[c];
6136  }
6137 
6138  FilSet = c;
6139  FilFlg = 1;
6140 }
6141 
6142 
6143 
6144 void DB_FilSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
6145 {
6146 
6147  int c = (int) a_data, i;
6148 
6149  for (i=0; i<(sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]); i++)
6150  {
6151  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6152  }
6153 
6154  switch (pe->button)
6155  {
6156 
6157  case (Button1):
6158  {
6159  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6160  break;
6161  }
6162  }
6163 }
6164 
6165 
6166 void DB_FilSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
6167 {
6168 
6169  int c = (int) a_data;
6170 
6171  switch (pe->keycode)
6172  {
6173  case R_A:
6174  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6175  if (c == (sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]) - 1)
6176  {
6177  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6178  break;
6179  }
6180  else
6181  {
6182  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[c+1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6183  break;
6184  }
6185  case D_A:
6186  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6187  if (c == (sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]) - 1)
6188  {
6189  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6190  break;
6191  }
6192  else
6193  {
6194  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[c+1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6195  break;
6196  }
6197 
6198  case L_A:
6199  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6200  if (c == 0)
6201  {
6202  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[(sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]) - 1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6203  break;
6204  }
6205  else
6206  {
6207  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[c-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6208  break;
6209  }
6210  case U_A:
6211  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6212  if (c == 0)
6213  {
6214  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[(sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]) - 1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6215  break;
6216  }
6217  else
6218  {
6219  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[c-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6220  break;
6221  }
6222  }
6223 }
6224 
6225 /**********************************************************************/
6226 
6227 
6228 /**********************************************************************/
6229 /* Neutral Density Filter Shell and CallBaks */
6230 /**********************************************************************/
6231 int NDFilSet = 0;
6232 
6234 {
6235  int i, er = 0;
6236  int bas = 0; //button array size
6237  MOBJECT _tablefrm000;
6238 // MOBJECT _tablefrm001;
6239 // MOBJECT Esc_But;
6240 
6241  DAS.Gui.Shells.Sh_NDFil = MCreateShell("SET ND FILTER", SF_MODAL);
6242  MObjectSetForegroundRGB(DAS.Gui.Shells.Sh_NDFil, 255, 255, 255);
6243 
6244 /*
6245  _tablefrm001 = MCreateTableForm(DAS.Gui.Shells.Sh_Fil, 1);
6246  MObjectSetBackgroundRGB(_tablefrm001, 91, 74, 74);
6247  MObjectSetResize(_tablefrm001, True, True);
6248 
6249  Esc_But = MCreatePButton(_tablefrm001, "ESC-Return", HELV_SMALL);
6250  MObjectSetBackgroundRGB(Esc_But, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
6251  MObjectSetShadow(Esc_But, WS_SHADOW_OUT, 3, 0);
6252  MObjectSetCompositeWidth(Esc_But, 180);
6253  MButtonSetAccelerator(Esc_But, ESC);
6254  MButtonSetOnMouseOverForegroundRGB(Esc_But, 255, 255, 255);
6255  MPButtonSetCallback(Esc_But, DB_Esc_CB, (void *) 2);
6256 */
6257  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_NDFil, 1);
6258  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
6259  MObjectSetResize(_tablefrm000, True, True);
6260 
6261 
6262 
6263  if(DAS.Paramini.EqType == LIS_)
6264  {
6265  bas = 8;
6266  for (i=0; i<bas; i++)
6267  {
6268  DAS.Gui.PushButt.NDFil[i] = MCreatePButton(_tablefrm000, Fil_Code8H[i], HELV_SMALL);
6269  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6270  MObjectSetForegroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
6271  if (i==FWS.Pos)
6272  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], 0, 0, 255);
6273 
6275  // MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6279  MPButtonSetCallback(DAS.Gui.PushButt.Fil[i], DB_Fil_CB, (void *) i);
6280  // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6282  }
6283 
6284  }
6285  else
6286  {
6287  bas = 6;
6288  for (i=0; i<bas; i++)
6289  {
6290  if(DAS.Paramini.EqType == TROPOGAS)
6291  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_CodeTropo[i], HELV_SMALL);
6292  else if (DAS.Paramini.EqType == GASCODNG1 ||
6293  DAS.Paramini.EqType == GASCODNG2 ||
6294  DAS.Paramini.EqType == GASCODNG3 ||
6295  DAS.Paramini.EqType == GASCODNG4)
6296  DAS.Gui.PushButt.NDFil[i] = MCreatePButton(_tablefrm000, Fil_CodeNG[i], HELV_SMALL);
6297  else
6298  DAS.Gui.PushButt.NDFil[i] = MCreatePButton(_tablefrm000, NDFil_Code[i], HELV_SMALL);
6299 
6300  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6301  MObjectSetForegroundRGB(DAS.Gui.PushButt.NDFil[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
6302  if (i==NDFWS.Pos)
6303  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[i], 0, 0, 255);
6304 
6306  // MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6310  MPButtonSetCallback(DAS.Gui.PushButt.NDFil[i], DB_NDFil_CB, (void *) i);
6311  // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6313  }
6314 
6315  }
6316 /*
6317  for (i=0; i<(sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]); i++)
6318  {
6319  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_Code[i], HELV_SMALL);
6320  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6321  MObjectSetForegroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
6322  if (i==0)
6323  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6324 
6325  MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtKB_CB, EM_KEY_PRESS, (void *) i);
6326  MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6327  MObjectSetShadow(DAS.Gui.PushButt.Fil[i], WS_SHADOW_OUT, 4, 0);
6328  MObjectSetCompositeWidth(DAS.Gui.PushButt.Fil[i], 150);
6329  MPButtonSetCallback(DAS.Gui.PushButt.Fil[i], DB_Fil_CB, (void *) i);
6330  MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6331  }
6332 
6333 */
6334 
6337 
6338  MShellRealizeXY(DAS.Gui.Shells.Sh_NDFil, 0, 0);
6339 
6340  NDFilFlg = 0;
6341  MLoopWhileFlag(&NDFilFlg, 0);
6342  if(NDFilBuff == "0")
6343  {
6344  NDFilFlg = 1;
6347 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
6348  return er;
6349  }
6350  else
6351  {
6354 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
6355  return er;
6356  }
6357 
6358 }
6359 
6360 void DB_NDFil_CB(MOBJECT p, void *od, void *ad)
6361 {
6362  int c = (int) ad;
6363 
6364  if(DAS.Paramini.EqType == LIS_)
6365  FilBuff = Fil_Code8H[c];
6366  else
6367  {
6368  if(DAS.Paramini.EqType == TROPOGAS)
6369  FilBuff = Fil_CodeTropo[c];
6370  else if (DAS.Paramini.EqType == GASCODNG1 || DAS.Paramini.EqType == GASCODNG2 || DAS.Paramini.EqType == GASCODNG3 || DAS.Paramini.EqType == GASCODNG4)
6371  FilBuff = Fil_CodeNG[c];
6372  else
6373  NDFilBuff = NDFil_Code[c];
6374  }
6375 
6376  NDFilSet = c;
6377  NDFilFlg = 1;
6378 }
6379 
6380 
6381 
6382 void DB_NDFilSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
6383 {
6384 
6385  int c = (int) a_data, i;
6386 
6387  for (i=0; i<(sizeof DAS.Gui.PushButt.NDFil / sizeof DAS.Gui.PushButt.NDFil[0]); i++)
6388  {
6389  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6390  }
6391 
6392  switch (pe->button)
6393  {
6394 
6395  case (Button1):
6396  {
6397  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6398  break;
6399  }
6400  }
6401 }
6402 
6403 
6404 void DB_NDFilSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
6405 {
6406 
6407  int c = (int) a_data;
6408 
6409  switch (pe->keycode)
6410  {
6411  case R_A:
6412  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6413  if (c == (sizeof DAS.Gui.PushButt.NDFil / sizeof DAS.Gui.PushButt.NDFil[0]) - 1)
6414  {
6415  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6416  break;
6417  }
6418  else
6419  {
6420  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[c+1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6421  break;
6422  }
6423  case D_A:
6424  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6425  if (c == (sizeof DAS.Gui.PushButt.NDFil / sizeof DAS.Gui.PushButt.NDFil[0]) - 1)
6426  {
6427  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6428  break;
6429  }
6430  else
6431  {
6432  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[c+1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6433  break;
6434  }
6435 
6436  case L_A:
6437  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6438  if (c == 0)
6439  {
6440  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[(sizeof DAS.Gui.PushButt.NDFil / sizeof DAS.Gui.PushButt.NDFil[0]) - 1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6441  break;
6442  }
6443  else
6444  {
6445  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[c-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6446  break;
6447  }
6448  case U_A:
6449  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6450  if (c == 0)
6451  {
6452  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[(sizeof DAS.Gui.PushButt.NDFil / sizeof DAS.Gui.PushButt.NDFil[0]) - 1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6453  break;
6454  }
6455  else
6456  {
6457  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[c-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6458  break;
6459  }
6460  }
6461 }
6462 
6463 
6464 /**********************************************************************/
6465 /* References Position Shell and CallBaks */
6466 /**********************************************************************/
6467 
6468 void DB_HomeSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
6469 {
6470 
6471  int c = (int) a_data, i;
6472 
6473  for (i=0; i<(sizeof DAS.Gui.PushButt.HomePos / sizeof DAS.Gui.PushButt.HomePos[0]); i++)
6474  {
6475  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6476  }
6477 
6478  switch (pe->button)
6479  {
6480 
6481  case (Button1):
6482  {
6483  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6484  break;
6485  }
6486  }
6487 }
6488 
6489 
6490 void DB_HomeSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
6491 {
6492 
6493  int c = (int) a_data;
6494 
6495  switch (pe->keycode)
6496  {
6497  case R_A:
6498  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6499  if (c == (sizeof DAS.Gui.PushButt.HomePos / sizeof DAS.Gui.PushButt.HomePos[0])-1)
6500  {
6501  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6502  break;
6503  }
6504  else
6505  {
6506  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[c+1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6507  break;
6508  }
6509  case D_A:
6510  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6511  if (c == (sizeof DAS.Gui.PushButt.HomePos / sizeof DAS.Gui.PushButt.HomePos[0])-1)
6512  {
6513  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6514  break;
6515  }
6516  else
6517  {
6518  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[c+1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6519  break;
6520  }
6521 
6522  case L_A:
6523  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6524  if (c == 0)
6525  {
6526  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[(sizeof DAS.Gui.PushButt.HomePos / sizeof DAS.Gui.PushButt.HomePos[0])-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6527  break;
6528  }
6529  else
6530  {
6531  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[c-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6532  break;
6533  }
6534  case U_A:
6535  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6536  if (c == 0)
6537  {
6538  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[(sizeof DAS.Gui.PushButt.HomePos / sizeof DAS.Gui.PushButt.HomePos[0])-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6539  break;
6540  }
6541  else
6542  {
6543  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[c-1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6544  break;
6545  }
6546  }
6547 }
6548 
6549 
6550 
6551 
6552 void DB_Home_CB(MOBJECT p, void *od, void *ad)
6553 {
6554  int c = (int) ad ;
6555  int er = 0;
6556 
6557 
6558  switch (c)
6559  {
6560  //Home Mirror
6561  case 0:
6562  //Disattiva i pulsanti sulla keyboard
6563  DB_KB_ButtonActive(0);
6564  er = DB_InitAMS(AMS1, 2, DAS.StepM.power[AMS1][DAS.StepM.SM_A],
6565  DAS.StepM.step[AMS1][DAS.StepM.SM_A], DAS.StepM.slope[AMS1][DAS.StepM.SM_A],
6566  DAS.StepM.speed[AMS1][DAS.StepM.SM_A], DAS.StepM.power[AMS1][DAS.StepM.SM_B],
6567  DAS.StepM.step[AMS1][DAS.StepM.SM_B], DAS.StepM.slope[AMS1][DAS.StepM.SM_B],
6568  DAS.StepM.speed[AMS1][DAS.StepM.SM_B]);
6569  //Attiva i pulsanti sulla keyboard
6570  DB_KB_ButtonActive(1);
6571  break;
6572  //Home Grating
6573  case 1:
6574  //Disattiva i pulsanti sulla keyboard
6575  DB_KB_ButtonActive(0);
6576  AMS_Default(AMS1);
6577  er = DB_InitAMS(AMS1, 3, DAS.StepM.power[AMS1][DAS.StepM.SM_A],
6578  DAS.StepM.step[AMS1][DAS.StepM.SM_A], DAS.StepM.slope[AMS1][DAS.StepM.SM_A],
6579  DAS.StepM.speed[AMS1][DAS.StepM.SM_A], DAS.StepM.power[AMS1][DAS.StepM.SM_B],
6580  DAS.StepM.step[AMS1][DAS.StepM.SM_B], DAS.StepM.slope[AMS1][DAS.StepM.SM_B],
6581  DAS.StepM.speed[AMS1][DAS.StepM.SM_B]);
6582  //Attiva i pulsanti sulla keyboard
6583  DB_KB_ButtonActive(1);
6584  break;
6585 
6586  //Home Filter Wheel
6587  case 2:
6588  //Disattiva i pulsanti sulla keyboard
6589  DB_KB_ButtonActive(0);
6590  //HomeFiltersFast();
6591  AMS_Default(AMS2);
6592  er = DB_InitAMS(AMS2, 4, DAS.StepM.power[AMS2][DAS.StepM.SM_A],
6593  DAS.StepM.step[AMS2][DAS.StepM.SM_A], DAS.StepM.slope[AMS2][DAS.StepM.SM_A],
6594  DAS.StepM.speed[AMS2][DAS.StepM.SM_A], DAS.StepM.power[AMS2][DAS.StepM.SM_B],
6595  DAS.StepM.step[AMS2][DAS.StepM.SM_B], DAS.StepM.slope[AMS2][DAS.StepM.SM_B],
6596  DAS.StepM.speed[AMS2][DAS.StepM.SM_B]);
6597  //Attiva i pulsanti sulla keyboard
6598  DB_KB_ButtonActive(1);
6599  break;
6600 
6601  //Home Neutral density Filter Wheel
6602  case 3:
6603  DB_KB_ButtonActive(0);
6604  AMS_Default(AMS2);
6605  er = DB_InitAMS(AMS2, 7, DAS.StepM.power[AMS2][DAS.StepM.SM_A],
6606  DAS.StepM.step[AMS2][DAS.StepM.SM_A], DAS.StepM.slope[AMS2][DAS.StepM.SM_A],
6607  DAS.StepM.speed[AMS2][DAS.StepM.SM_A], DAS.StepM.power[AMS2][DAS.StepM.SM_B],
6608  DAS.StepM.step[AMS2][DAS.StepM.SM_B], DAS.StepM.slope[AMS2][DAS.StepM.SM_B],
6609  DAS.StepM.speed[AMS2][DAS.StepM.SM_B]);
6610  //Attiva i pulsanti sulla keyboard
6611  DB_KB_ButtonActive(1);
6612 
6613  break;
6614  //Home Zenith
6615  case 4:
6616  //Disattiva i pulsanti sulla keyboard
6617  DB_KB_ButtonActive(0);
6618  AMS_Default(AMS3);
6619  er = DB_InitAMS(AMS3, 5, DAS.StepM.power[AMS3][DAS.StepM.SM_A],
6620  DAS.StepM.step[AMS3][DAS.StepM.SM_A], DAS.StepM.slope[AMS3][DAS.StepM.SM_A],
6621  DAS.StepM.speed[AMS3][DAS.StepM.SM_A], DAS.StepM.power[AMS3][DAS.StepM.SM_B],
6622  DAS.StepM.step[AMS3][DAS.StepM.SM_B], DAS.StepM.slope[AMS3][DAS.StepM.SM_B],
6623  DAS.StepM.speed[AMS3][DAS.StepM.SM_B]);
6624  AMS_dirfin(AMS3, 0, 1);
6625  //Attiva i pulsanti sulla keyboard
6626  DB_KB_ButtonActive(1);
6627  break;
6628 
6629  //Home Azimuth
6630  case 5:
6631  //Disattiva i pulsanti sulla keyboard
6632  DB_KB_ButtonActive(0);
6633  AMS_Default(AMS3);
6634  er = DB_InitAMS(AMS3, 6, DAS.StepM.power[AMS3][DAS.StepM.SM_A],
6635  DAS.StepM.step[AMS3][DAS.StepM.SM_A], DAS.StepM.slope[AMS3][DAS.StepM.SM_A],
6636  DAS.StepM.speed[AMS3][DAS.StepM.SM_A], DAS.StepM.power[AMS3][DAS.StepM.SM_B],
6637  DAS.StepM.step[AMS3][DAS.StepM.SM_B], DAS.StepM.slope[AMS3][DAS.StepM.SM_B],
6638  DAS.StepM.speed[AMS3][DAS.StepM.SM_B]);
6639  //Attiva i pulsanti sulla keyboard
6640  DB_KB_ButtonActive(1);
6641  break;
6642 
6643  //Close panel
6644  case 6:
6647 
6648  break;
6649 
6650 
6651 
6652 
6653 
6654  }
6655 
6656 
6657 
6658 }
6659 
6660 
6661 
6663 {
6664  int i, er = 0;
6665  MOBJECT _tablefrm000;
6666  char buff[16];
6667 
6668  DAS.Gui.Shells.Sh_Home = MCreateShell("SET HOME POSITION",SF_NO_MAXIMIZE);
6669  MObjectSetForegroundRGB(DAS.Gui.Shells.Sh_Home, 255, 255, 255);
6670 
6671  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_Home, 3);
6672  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
6673  MObjectSetResize(_tablefrm000, True, True);
6674 
6675  for (i=0; i<(sizeof DAS.Gui.PushButt.HomePos / sizeof DAS.Gui.PushButt.HomePos[0]); i++)
6676  {
6677  itoa(wl[i],buff,10);
6678  DAS.Gui.PushButt.HomePos[i] = MCreatePButton(_tablefrm000, HomePosition[i], HELV_SMALL);
6679  MObjectSetBackgroundRGB(DAS.Gui.PushButt.HomePos[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6680  MObjectSetForegroundRGB(DAS.Gui.PushButt.HomePos[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
6681  //MObjectAddEventNotifyCallback(DAS.Gui.PushButt.HomePos[i], (OBJ_EVENT_CB) DB_HomeSelButtKB_CB, EM_KEY_PRESS, (void *) i);
6682  //MObjectAddEventNotifyCallback(DAS.Gui.PushButt.HomePos[i], (OBJ_EVENT_CB) DB_PushButtonMouse_CB, EM_BUTTON_PRESS | EM_MOTION, (void *) 2);
6683 
6686  MPButtonSetCallback(DAS.Gui.PushButt.HomePos[i], DB_Home_CB, (void *) i);
6687  //MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.HomePos[i], 255, 0, 0);
6688  }
6689 
6690  //MShellSetWMCloseCallback(DAS.Gui.Shells.Sh_Home, DB_Close_Sh, (void *) 1);
6691  //MObjectAddEventNotifyCallback(DAS.Gui.Shells.Sh_Home, (OBJ_EVENT_CB) DB_SheelESC, EM_KEY_PRESS, (void *) 1);
6692 
6693  MShellRealizeXY(DAS.Gui.Shells.Sh_Home, 0, 0);
6694 /*
6695  HomeFlg = 0;
6696  MLoopWhileFlag(&HomeFlg, 0);
6697  if(WlBuff == "0")
6698  {
6699  WlFlg = 1;
6700  MShellUnrealize(DAS.Gui.Shells.Sh_Wl);
6701  MShellDestroy(DAS.Gui.Shells.Sh_Wl);
6702  return er;
6703  }
6704  else
6705  {
6706  MShellUnrealize(DAS.Gui.Shells.Sh_Wl);
6707  MShellDestroy(DAS.Gui.Shells.Sh_Wl);
6708  return er;
6709  }
6710 */
6711 }
6712 
6713 
6714 
6715 
6716 
6717 
6718 
6719 /**********************************************************************/
6720 /* ShutDown Shell and CallBaks */
6721 /**********************************************************************/
6722 void DB_WriteMode(int mod)
6723 {
6724  FILE *fs;
6725 
6726  fs = fopen("LOG\\Paramini.LOG", "w");
6727 
6728  fprintf(fs, "%d %s", mod, "0 = reinizializza CCD, 1 = mantiene lo stato " );
6729 
6730  fclose(fs);
6731 
6732 }
6733 
6735 
6736 
6737 
6738 
6739 
6740 void ShutCB(MOBJECT p, void *od, void *ad)
6741 {
6742  int c = (int) ad;
6743  int er = 0;
6744  char buf[128];
6745  int PowerOn, PowerOff;
6746 
6747  _chdir( BIL.DFILEM.HOMEDIRECTORY);
6748 
6749 
6750 // char buf[80];
6751 
6752 /* FILE *fs;
6753  fs = fopen("Status.log", "w");
6754  fprintf(fs, "%d\n", CoolPw);
6755  fprintf(fs, "%.1lf\n", Temp);
6756  fclose(fs);
6757 */
6758  switch(c)
6759  {
6760  case 0:
6761  //CCD Shutting Down Cooler On
6762  er = DC_Status(Cfg.CamAdd);
6763  if (er)
6764  {
6765  sprintf(buf,DC_ErrorMessage(er));
6766  CCD_Error(buf);
6767  CloseShCB(sdsh, 0, (void *) c);
6768  }
6769  else
6770  {
6771  DC_SetTemp(25.0, CELSIUS, 0);
6772  Status("CCD Shuting Down - Cooler On ");
6773  CloseShCB(sdsh, 0, (void *) c);
6774  }
6775  break;
6776  case 1:
6777  //CCD Shutting Down (cooler Off)
6778  DC_SetTemp(25.0, CELSIUS, 0);
6779  Status("CCD Shuting Down - Cooler Off");
6780  CloseShCB(sdsh, 0, ad);
6781  break;
6782  case 2:
6783  //NO CCD Shutting Down (cooler On)
6784  DB_WriteMode(1);
6785  ShutterOpening(1);
6786  DC_Close(0); //DA RIMETTERE!!!!!!!!!!!!!!!!!1
6787  if (HGFlg)
6788  HgLamp(0);//HG Off
6789  if (QJFlg)
6790  QjLamp(0);//QJ Off
6791  CloseShCB(sdsh, 0, ad);
6792  WDT_func(0); //Stop WDT
6793  MGUITerm();
6794  SioDone(DXL.com);//Close Com connection
6795  exit(0);
6796 
6797  break;
6798 
6799  case 3:
6800  ShutterOpening(1);
6801  // All Off
6802  DB_WriteMode(0);//Write 0 on the Paramini.Log
6803  dscFreeBoard(dscb);//Free resources from PC104 board
6804  dscFree();//Free resources from PC104 board
6805  PowerOn = 1;
6806  PowerOff = LISTEMP_TASK_TIME ;
6807  AMS_PWM(AMS2, PowerOn, PowerOff);//Peltier Power a 0
6808 // DTxStr(AMS2, "7", 1);//PWM off
6809 // er = DRxStr(AMS2, buf, &d, 50);
6810  //Rele'
6811  if(PeltFlg)
6812  Peltier(0); //Peltier Off
6813  if (HGFlg)
6814  HgLamp(0);//HG Off
6815  if (QJFlg)
6816  QjLamp(0);//QJ Off
6817  if (FANFlg)
6818  FANPeltier(0);//FAN Off
6819 
6820 
6821  DC_Cooler(0,0); //Camera cooler OFF
6822  DC_Close(0); // Close Camera Communication DA RIMETTERE!!!!!!!!!!!!!!!!!1
6823 
6824  //Switch OFF the Power supplyes (put to 0 the NOVA Dig Output - For GASCODNG2 and GASCODNG3)
6825  if (DAS.Paramini.EqType == GASCODNG1 ||
6826  DAS.Paramini.EqType == GASCODNG2 ||
6827  DAS.Paramini.EqType == GASCODNG3 ||
6828  DAS.Paramini.EqType == GASCODNG4 ||
6829  DAS.Paramini.EqType == SPATRAM2 ||
6830  DAS.Paramini.EqType == SPATRAM3 ||
6831  DAS.Paramini.EqType == SPATRAMPLUS)
6832  {
6833 
6834 
6835  /****************************************************
6836  nb = 1; //24 V
6837  er = ChkDigIO(DAS.Nova.DigOut, nb);
6838  if (er == 1)
6839  DAS.Nova.DigOut &= ~((unsigned char) pow(2,(double)(nb)));
6840  else if (er == 0)
6841  DAS.Nova.DigOut |= (unsigned char) pow(2,(double)(nb));
6842 
6843  er = NOVA_Out(DAS.Nova.type, DAS.Nova.DigOut);
6844  delay(500);
6845  /*****************************************************/
6846 
6847  /****************************************************
6848  nb = 2; //12 V and Hires
6849  er = ChkDigIO(DAS.Nova.DigOut, nb);
6850  if (er == 1)
6851  DAS.Nova.DigOut &= ~((unsigned char) pow(2,(double)(nb)));
6852  else if (er == 0)
6853  DAS.Nova.DigOut |= (unsigned char) pow(2,(double)(nb));
6854 
6855  er = NOVA_Out(DAS.Nova.type, DAS.Nova.DigOut);
6856  delay(500);
6857  /*****************************************************/
6858  if (DAS.Nova.type == NOVA7892)
6859  {
6860  er = NOVA_Out(DAS.Nova.type, 0);
6861  }
6862  if (DAS.Nova.type == NOVA945GSE)
6863  {
6864  //switch off all
6865  er = NOVA_Out(DAS.Nova.type, 15);
6866  }
6867 
6868 
6869 
6870  //ExtShutt(0); //Close the external shutter (Not used)
6871 
6872  }
6873  //Switch OFF the Hires and disconnect the 24V Power supplyes
6874  if (DAS.Paramini.EqType == TROPOGAS )
6875  {
6876  HiresPS(0);
6877 
6878  Status ("Waiting 50ms.");
6879  delay(50);
6880 
6881 
6882  PeltierPS(0);
6883  Status ("Waiting 50ms.");
6884  delay(50);
6885 
6886 
6887  }
6888 
6889  WDT_func(0); //Stop WDT
6890  CloseShCB(sdsh, 0, ad);
6891  MGUITerm();
6892  SioDone(DXL.com);//Close Com connection
6893  exit(0);
6894  break;
6895  case 4:
6896  CloseShCB(sdsh, 0, ad);
6897  break;
6898 
6899  }
6900 }
6901 
6902 
6903 void ShutDOWN(void)
6904 {
6905 
6906  MOBJECT lbl, pb[4], a, b;
6907 
6908 
6909  const char *ShDwn_Code[] = {{"F1 - CCD ShutDown, Cooler On"},
6910  {"F2 - CCD ShutDown, Cooler Off"},
6911  {"F3 - No CCD ShutDown, Cooler On"},
6912  {"F4- No CCD ShutDown, Cooler Off"},
6913  {"ESC-Cancel"}};
6914 
6915  int ShDwn_StK[] = {F1,F2,F3,F4,ESC}, i;
6916 
6917 
6918  if(DAS.Flag.exemode == OFFLINEPLOT)
6919  {
6920  sdsh = MCreateShell("DAS CLOSE ", SF_MODAL);
6921  MObjectSetBackgroundRGB(sdsh, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
6922 
6923  a = MCreateRowForm(sdsh);
6924 
6925  lbl = MCreateLabel(a, "Exit Program ?", HELV_MEDIUM);
6926  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
6927  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
6928  MObjectSetTransparency(lbl, 0);
6929 
6930  b = MCreateTableForm(sdsh, 1);
6931  MObjectSetBackgroundRGB(b, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
6932  MObjectSetShadow(b, WS_NONE, 0, 0);
6933  MObjectSetResize(b, True, True);
6934 
6935  pb[0] = MCreatePButton(b, "Yes - F1", HELV_SMALL);
6936  MObjectSetBackgroundRGB(pb[0], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6937  MObjectSetCompositeWidth(pb[0], 100);
6938  MObjectSetShadow(pb[0], WS_SHADOW_OUT, 3, 0);
6939  MButtonSetOnMouseOverForegroundRGB(pb[0], 255, 255, 255);
6940  MButtonSetAccelerator(pb[0], ShDwn_StK[0]);
6941  MPButtonSetCallback(pb[0], ShutCB, (void *) 2);
6942 
6943  pb[1] = MCreatePButton(b, "No - F2", HELV_SMALL);
6944  MObjectSetBackgroundRGB(pb[1], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6945  MObjectSetCompositeWidth(pb[1], 100);
6946  MObjectSetShadow(pb[1], WS_SHADOW_OUT, 3, 0);
6947  MButtonSetOnMouseOverForegroundRGB(pb[1], 255, 255, 255);
6948  MButtonSetAccelerator(pb[1], ShDwn_StK[1]);
6949  MPButtonSetCallback(pb[1], ShutCB, (void *) 4);
6950 
6952  MShellRealizeXY(sdsh, 0, 0);
6953  //MObjectSetPosition(sdsh, 500, 0);
6954 
6955  }
6956  else
6957  {
6958  sdsh = MCreateShell("EXIT AND/OR SHUTDOWN", SF_MODAL);
6959  MObjectSetBackgroundRGB(sdsh, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
6960 
6961  //
6962 
6963  a = MCreateRowForm(sdsh);
6964  MObjectSetBackgroundRGB(a, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
6965 
6966  lbl = MCreateLabel(a, "Choose the exit mode", HELV_MEDIUM);
6967  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
6968  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
6969  MObjectSetTransparency(lbl, 0);
6970 
6971 
6972  b = MCreateTableForm(sdsh, 1);
6973  MObjectSetBackgroundRGB(b, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
6974  MObjectSetShadow(b, WS_NONE, 0, 0);
6975  MObjectSetResize(b, True, True);
6976 
6977  for (i=0; i<5; i++)
6978  {
6979  pb[i] = MCreatePButton(b, ShDwn_Code[i], HELV_SMALL);
6980 
6981  MObjectSetBackgroundRGB(pb[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6982  MObjectSetForegroundRGB(pb[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
6983  MObjectSetCompositeWidth(pb[i], 300);
6984  MObjectSetShadow(pb[i], WS_SHADOW_OUT, 3, 0);
6985  MButtonSetOnMouseOverForegroundRGB(pb[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6986  MButtonSetAccelerator(pb[i], ShDwn_StK[i]);
6987  MPButtonSetCallback(pb[i], ShutCB, (void *) i);
6988  if (DAS.Flag.exemode == DBDEMO )
6989  if(i==0 || i==1 || i==3 )
6990  MObjectSetUnsensitive(pb[i]);
6991  else if(i==2)
6992  MObjectSetText(pb[i],"Exit Program");
6993 
6994  }
6995 
6996 
6997 
6998 
6999 
7001 // MShellRealizeXY(sdsh, 0,0);
7003  }
7004 }
7005 
7006 /**********************************************************************/
7007 
7008 
int DefPWD_OK
Definition: CreateForms.c:2597
char PrgFile[16]
Name of the PRG file.
Definition: DAS_Spat.c:91
dpwd DPWD
Definition: CreateForms.c:79
void MEditDisableEditing(MOBJECT edit)
void CloseShCB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:4320
flag FLAG
Definition: CreateForms.c:84
short DB_BG_lblUP[3]
Background Capital Letters Labels Color UP.
MOBJECT Sh_Tools
Shell for tools.
stepm StepM
Stepper motors parameters structure.
#define SPATRAM
SPectrometer for Atmospheric TRAcers Measurements - CGE-UE Portugal.
Status of the Zenith .
NDFilterWheelSt NDFWS
ND Filter Wheel.
Definition: DAS_Spat.c:58
#define RIGHT_ALIGN
Definition: Mguidefs.h:916
MTFont newfont
Definition: CreateForms.c:95
void FANPeltier(int mod)
FAN ON/OFF .
Definition: Spat_Device.c:2652
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
#define WS_NONE
Definition: Mguidefs.h:956
#define SF_NO_RESIZE
Definition: Mguidefs.h:1038
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
void MRefreshTimeout(TIMEOUT_ID *pid, CARD32 msec, TIMEOUT_CB cb, void *ud)
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int Pos
Filter Wheel current Position.
MOBJECT CP_Sh
Definition: CreateForms.c:85
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
int ExtLamp(int mod)
change the status of the external lamp change the status of the external lamp (ON or OFF) through a r...
Definition: Exec.c:1117
void MDCreateMoveZenAzimDeg(void)
Definition: CreateForms.c:3573
shells Shells
Shells structure.
void DB_GratPosMode_CB(MOBJECT o, void *a, void *v)
Definition: CreateForms.c:2778
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
MOBJECT MCreatePixmapFromFile(MOBJECT parent, const char *fname)
unsigned int keycode
Code for the pressed key.
Definition: Mguidefs.h:541
MOBJECT lbl
Definition: DFileMan.c:42
double S_zenetr
Definition: SOLPOS.C:92
void HgLamp(int mod)
HG Lamp ON/OFF .
Definition: Spat_Device.c:2673
MOBJECT rbStepGratEnc[2]
radio buttons for steps encoding (move Grating free positioning)
int Server
Definition: DAS_Spat.c:253
#define WS_SHADOW_IN
Definition: Mguidefs.h:958
MOBJECT speed[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "speed".
void MSetInputPromptRGB(int r, int g, int b)
void DB_NDFilSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
callback for select a specified filter push button with the keyboard
Definition: CreateForms.c:6404
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
MOBJECT MOptionEditGetList(MOBJECT ce)
optionini DOption
Options for DAS execution.
void ListTargetCB(MOBJECT p, LIST_ACT *la, void *ad)
Definition: CreateForms.c:4371
int extlamp
0 = external lamp OFF; 1 = external lamp ON
CTYPE void DLL DC_SetMode(int TaskSettings, int SetRes, int camera)
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
#define AMS2
AMS2 address.
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
const char * Mir_Code[]
const char array for the realisation of the Mirrors buttons in the Mirror shell
Definition: DAS_Spat.c:231
#define TESTCCD
execution for testing CCD Camera
void SD_FNTorqueM(int mod)
Positioning NDFilter. .
Definition: Spat_Device.c:3066
double target
Azimuth Targrt position.
void MSelectObject(MOBJECT f)
void MShellRealize(MOBJECT obj)
void PopUpAdvCal_CB(MOBJECT obj, void *item, void *data)
Definition: CreateForms.c:1110
void DB_Mir_CB(MOBJECT p, void *od, void *ad)
callback for input mirror positioning in Mirror shell
Definition: CreateForms.c:5692
dsza SZADelta
Definition: DAS_Spat.c:76
MOBJECT KeyB[28]
Keyboard Buttons.
int DB_InitAMS(int nid, int mod, int powera, int stepa, int slopea, int speeda, int powerb, int stepb, int slopeb, int speedb)
Init selected AMS.
Definition: Init.c:1391
int NAMS
Number of AMSs Devices.
MOBJECT Albl_sunr
Active Control Panel Labels for Sunrise.
MOBJECT Sh_Wl
Wavelength Shell.
CARD8 change_cwd
Definition: Mguidefs.h:1485
MOBJECT MCreateEdit(MOBJECT parent, const char *text, int len, MTFont font)
static int FilFlg
Definition: CreateForms.c:50
#define ESC
Definition: KEYCODES.H:265
#define SF_NO_MAXIMIZE
Definition: Mguidefs.h:1034
MOBJECT LedQJ
Control Panel Led for QJ Lamp.
double LastMSZA
SZA of the previous measurement.
double realazpos
void MObjectSetUnsensitive(MOBJECT obj)
void MEditSetTextExt(MOBJECT edit, const char *text, int validated, int notify)
void MBottomAttach(MOBJECT child, int att_type, int off, MOBJECT obj)
void DB_KeyComSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
callback for selsct a specified push button with the keyboard
Definition: CreateForms.c:5072
MOBJECT sdsh
Definition: CreateForms.c:6734
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
#define EM_WINDOW_ENTER
Definition: Mguidefs.h:320
#define F3
Definition: KEYCODES.H:339
int gratposmode
Grating position mode flag: = 0 step mode; = 1 Wl mode.
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
char * HomePosition[]
const char array for the realisation of the Filters buttons in the ND Filter shell ...
Definition: DAS_Spat.c:227
void ActMvZenDegCB(MOBJECT edit, char *text, void *ed)
Definition: CreateForms.c:3172
void D_XProfile(void)
Definition: CreateForms.c:2656
List Item Activation.
Definition: Mguidefs.h:1179
#define WS_ETCHED_OUT
Definition: Mguidefs.h:960
DXL structure. Structure for the serial communication with the AMS adapter.
Definition: DXL.H:16
void MOptionEditSetListCallback(MOBJECT obj, LIST_ACT_CB cb, void *data)
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
void DB_CloseAsk(MOBJECT p, void *od, void *ad)
Input Shell Callback Callback for the Input Shell destruction.
Definition: CreateForms.c:5483
das structure (contain all the previous structures) .
CARD8 allow_dir_create
Definition: Mguidefs.h:1487
MOBJECT MDCreateDASConfig(void)
DAS Config shell. Procedure that build the shell for the DAS Config panels. The DAS Config allow for ...
AzimuthSt AST
Definition: CreateForms.c:100
MOBJECT Sh_Mir
Mirror Shell.
MOBJECT lbl_mvgratmode
Active Control Panel Labels for Sunset.
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
int DB_Ask(char *tit, char *bmp, char *label, char *pre, int len, char *pbtype)
Input Shell Create an input box.
Definition: CreateForms.c:5373
void DB_Ask_SheelESC(MOBJECT obj, MKeyEvent *pe, void *a_data)
Input Shell Callback Callback for the Input Shell destruction at the pression of the ESC key...
Definition: CreateForms.c:5496
Control Panel and push buttons colors .
int SaveCnt
Definition: Procedures.c:49
DXL_par DXL
Definition: CreateForms.c:78
void MSetMessageDialogFonts(MTFont text_font, MTFont buttons_font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
bil BIL
Definition: CreateForms.c:83
void DB_MirSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
callback for selsct a specified mirror push button with the keyboard
Definition: CreateForms.c:5748
void ExecSimPosCB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:4362
Union for MGui events.
Definition: Mguidefs.h:828
MOBJECT KeyB[13]
buttons tools
MTFont button_font
Definition: Mguidefs.h:1501
int Pos
Mirror Current Position.
int QJFlg
Definition: DAS_Spatram.h:2969
CARD8 allow_dir_delete
Definition: Mguidefs.h:1493
flag Flag
Structure for different flags.
#define F10
Definition: KEYCODES.H:346
int MDCreateSh_Mir(void)
Create the shell for the available Mirror Positions. Procedure that build the shell for the positioni...
Definition: CreateForms.c:5614
MOBJECT MDCreate_CP(void)
Create Spectrometer Control Panel. Procedure that build the Control Panel for checking the spectromet...
Definition: CreateForms.c:1143
int MDCreateSh_Fil(void)
Create the shell for the available Filters. Procedure that build the shell for the positioning of the...
Definition: CreateForms.c:5994
#define F2
Definition: KEYCODES.H:338
#define HELP
Help mode.
void DB_Home_CB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:6552
void WDT_func(int mod)
Definition: DAS_Spat.c:1572
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
MOBJECT Sh_Home
Home Shell.
MTFont alfont
Definition: CreateForms.c:95
paramini PARAM
Definition: CreateForms.c:90
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
#define DBDEMO
execution in demo mode
MTFont font
Definition: Mguidefs.h:1499
MOBJECT MDCreateHorMeas(void)
Definition: CreateForms.c:681
#define False
Definition: Mguidefs.h:236
MOBJECT pblamps[2]
Control Panel Push buttons for HG and QJ Lamps.
void MSetInputPromptFonts(MTFont text, MTFont edit, MTFont btn)
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
int FlgSh_PWD
void MSetInputPromptFgRGB(int r, int g, int b)
MENU_ITEM item_advc
Definition: CreateForms.c:1139
void D_Average(int mod)
Performs averaged measurements .
Definition: Procedures.c:2655
#define R_A
Definition: KEYCODES.H:280
int PRG_Check(int mod, char *prgname)
Definition: DAS_Spat.c:531
int SD_Zenith(float ang)
Positioning Zenith. The Zenith reaches the position specified by ang.
Definition: Spat_Device.c:2916
int SimShell
= 1 Simultaneous positioning Shell opened
#define NOVA945GSE
NOVA945GSE (SPATRAM2, GASCODNG1, GASCODNG4)
void * MENU_ITEM
Definition: Mguidefs.h:1418
int slope[AMSMAX][2]
Stepper Motors Slope.
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
U32 CamAdd
(R/W) Intrinsic camera address
Definition: dcldef.h:1069
void DB_AskCB(MOBJECT p, void *od, void *ad)
Input Shell Callback Callback for the Input Shell.
Definition: CreateForms.c:5462
MOBJECT Sh_mg
Password Shell.
void MTableFormSetColAlign(MOBJECT form, int col, int al)
char DATADIRECTORY[_MAX_PATH]
Definition: bildef.h:201
void ActMvAzimDegCB(MOBJECT edit, char *text, void *ed)
Definition: CreateForms.c:3530
MOBJECT step[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "step".
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
short DB_Sel[3]
Selected Buttons Colors.
#define F9
Definition: KEYCODES.H:345
void MSetMessageDialogFgRGB(int r, int g, int b)
static int MirFlg
Definition: CreateForms.c:47
double target
Zenith target position.
void MSListSelectElement(MOBJECT p, long n)
void AMS_PWM(int id, int on, int off)
set the on/off time on the PWM set the on/off time on the PWM.
Definition: Dxl.c:492
#define SF_NO_CLOSE
Definition: Mguidefs.h:1032
char * MObjectGetText(MOBJECT obj, char *text)
void DB_RecGio_CB(MOBJECT o, void *a, void *v)
Definition: CreateForms.c:2835
geographical coordinate structure .
void AMS_Default(int id)
Set default values to AMS parameters Procedure for setting the default values of power.speed, stepping and slope to the selected AMS adapter.
Definition: Dxl.c:174
int type
int y_root
Definition: Mguidefs.h:618
char * item
Definition: Mguidefs.h:1181
MOBJECT MCreateClippedEdit(MOBJECT parent, const char *text, int len, int clip_len, MTFont font)
int WlSet
Wavelength position definition - for SD_Grating.
Definition: DAS_Spat.c:135
#define F4
Definition: KEYCODES.H:340
int target
Mirror Target position.
ZenithSt ZST
Definition: CreateForms.c:99
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
#define TEMPORIZED
execution driven by MASTER file
void MSetMessageDialogRGB(int r, int g, int b)
void PeltierPS(int mod)
Peltier Power Supply ON/OFF .
Definition: Spat_Device.c:2551
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
MOBJECT MCreateOptionEdit(MOBJECT parent, const char *text, int len, int clip_len, int nrow, MTFont font)
MOBJECT Albl_CS[4]
Active Control Panel Labels for Camera Status 4.
long pos
Definition: Mguidefs.h:1185
void MShellUnrealize(MOBJECT obj)
void DB_Save(char *tit, int mod)
Save the acquired spectrum. Procedure that Save the acquired spectrum.
Definition: Save.c:552
void Peltier(int mod)
Peltier ON/OFF .
Definition: Spat_Device.c:2597
#define UNDEF_ALIGN
Definition: Mguidefs.h:920
#define F7
Definition: KEYCODES.H:343
#define TIMES_SMALL
Definition: Mguidefs.h:883
long STEPS
Definition: CreateForms.c:63
NoMangle int DLL_IMPORT_EXPORT SioDone(int)
void MObjectSetText(MOBJECT obj, const char *text)
int TMFlg
Definition: DAS_Spatram.h:2972
void QjLamp(int mod)
QJ Lamp ON/OFF .
Definition: Spat_Device.c:2724
void MButtonSetAccelerator(MOBJECT button, int key)
CTYPE const char *PROC_CALL DC_ErrorMessage(int ErrorCode)
Convert an error code into an error message (string). DC_Status returns an error code of the previous...
void(* OBJ_STRING_CB)(MOBJECT obj, char *str, void *ad)
Definition: Mguidefs.h:1457
void DB_KeyComSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
callback for selsct a specified push button with the keyboard
Definition: CreateForms.c:5152
int MDCreateSh_Home(void)
Definition: CreateForms.c:6662
static double ch
Definition: SOLPOS.C:120
void DB_PasWd(void)
Definition: CreateForms.c:2600
int ChkDigIO(unsigned char word, int bitn)
check for digital I/O Status
image Img
Definition: Dildef.h:675
MOBJECT Albl_suns
Active Control Panel Labels for Sunset.
int Pos
Filter Wheel current Position.
#define U_A
Definition: KEYCODES.H:278
void DB_Fil_CB(MOBJECT p, void *od, void *ad)
callback for filter wheel positioning in Filter shell
Definition: CreateForms.c:6120
MENU_ITEM MMenuAddItemObsolete(MOBJECT pd, const char *item, MGUI_CB cb, void *ad)
MOBJECT Fil[6]
Filter Buttons.
void DT_ShutterCB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:3946
MMouseEvent mouse
Definition: Mguidefs.h:832
void ActMvAzimCB(MOBJECT edit, char *text, void *ed)
Definition: CreateForms.c:3067
#define EM_MOTION
Definition: Mguidefs.h:319
MOBJECT Albl_Azim
Active Control Panel Labels for Sun Azimuth.
void MRemoveTimeout(TIMEOUT_ID id)
void Task_Timer(TIMEOUT_ID id, void *data)
Timer Task. Very useful procedure that: 1) Provide to refresh the clock display 2) Check if daylight ...
Definition: RTC_Time.c:1184
U8 Prof[MAXIMG]
Definition: Dildef.h:561
void MShellDestroy(MOBJECT obj)
MOBJECT slope[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "Slope".
int MRButtonGetActivationStatus(MOBJECT o)
void DB_Wl_CB(MOBJECT p, void *od, void *ad)
callback for grating positioning in Wavelength shell
Definition: CreateForms.c:5891
void DB_WlSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
callback for selsct a specified wavelength push button with the keyboard
Definition: CreateForms.c:5927
static int NDFilFlg
Definition: CreateForms.c:53
#define LIS_
Lampedusa Island Spectrometer - ENEA.
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
#define FIXED_MEDIUM
Definition: Mguidefs.h:879
#define L_A
Definition: KEYCODES.H:281
unsigned int button
button pressed/released (Button1, Button2 or Button3), 0 if no button involved
Definition: Mguidefs.h:622
Control Flags.
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
int Wl
Grating Wavelength.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
File Browser Preferences. Used by the Utility functions MFileBowserExt() and MDirBowserExt().
Definition: Mguidefs.h:1482
int PeltFlg
Definition: DAS_Spatram.h:2971
#define EM_KEY_PRESS
Definition: Mguidefs.h:316
horizmeas HorizMeas
Structure for Horizontal Measurements.
void D_Saving(void)
Saving image. Procedure for saving the CCD Image Used since version 2.1.0. The coiche between binary ...
Definition: Procedures.c:1369
MOBJECT edtaz
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
tools Tools
Push buttons for various tools.
void UPS_Status(void)
Definition: Save.c:32
int TIMER
Timer ID.
MOBJECT lbl_Time
Control Panel Labels for Time.
long dp
Grating backslash recovery steps.
MOBJECT shell
Horizontal measurements shell.
#define F12
Definition: KEYCODES.H:348
void StepperPagForm(int p, int q)
Definition: CreateForms.c:259
unsigned int data[576]
Conversion data buffer 64 samples * 8 channels * 2 bytes.
void DB_Tools()
Definition: CreateForms.c:4158
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define FDOUBLE
double filter wheel
#define FPLUS
Filter Wheel Torque Motor.
CTYPE void DLL DC_SetTemp(double TargetTemperature, int Scale, int Camera)
Procedure that turns the camera cooler on and allows you to set an operative temperature of the CCD...
CTYPE void DLL DC_Close(int Camera)
Shuts down the control operations of the camera. Procedure that shuts down the control operations of ...
CARD8 transparent_tree
Definition: Mguidefs.h:1495
d_fileman DFILEM
Definition: bildef.h:257
C_DEF void DI_SplitName(char *fullname, char *fpath, char *fname)
int SD_Azimuth(float ang, float raz)
Positioning Azimuth. The Zenith reaches the position specified by ang.
Definition: Spat_Device.c:3110
#define OFFLINEPLOT
execution for archived data visualisation
void MGUITerm(void)
MOBJECT popup_advcalib
Definition: CreateForms.c:1138
#define CENTER_ALIGN
Definition: Mguidefs.h:917
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
MOBJECT ledpelt[2]
Control Panel Leds for Peltier Activity.
#define EM_BUTTON_PRESS
Definition: Mguidefs.h:317
MTFont font
Definition: DAS_Spatram.h:3066
void MPopupMenu(MOBJECT pm, int x, int y)
void DB_ChooseButtons(int w)
Definition: CreateForms.c:2560
int MDCreateSh_Wl(void)
Create the shell for the available Wavelength. Procedure that build the shell for the availables wave...
Definition: CreateForms.c:5815
void MObjectSetWidth(MOBJECT obj, int w)
int BrowseLog(void)
int D_Calibra(void)
Spectral Calibration Procedure for the spectral calibration with HG lamp. Shift of HG spectral line a...
Definition: Procedures.c:2313
#define DSCB
Definition: DSCUD.H:140
void DB_MirSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
callback changing the bakground color of the push button passing the mouse over it ...
Definition: CreateForms.c:5708
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
void DB_FilSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
callback for select a specified filter push button with the keyboard
Definition: CreateForms.c:6166
void DB_KeyB_CB(MOBJECT p, void *od, void *ad)
Push buttons callback .
Definition: CreateForms.c:4693
MOBJECT Albl_Script
Active Control Panel Labels for Script in execution.
MOBJECT Sh_Fil
Filter Shell.
#define HELV_SMALL
Definition: Mguidefs.h:881
char * AskBuff
Definition: CreateForms.c:5369
void AboutCB(MOBJECT o, void *s, void *v)
Create the About information shell. .
Definition: About.c:39
void DB_dirCB(MOBJECT o, void *id, void *a_data)
Definition: CreateForms.c:2673
paramini structure . It contains some of the parameters defined in the file PARAM.INI .
void DB_HomeSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
Definition: CreateForms.c:6468
#define SPATRAM2
SPATRAM2 (with ATX power supply & HiresV)
void MEditSetActCallback(MOBJECT edit, OBJ_STRING_CB cb, void *data)
MOBJECT HomePos[7]
Reference Position Buttons.
#define F11
Definition: KEYCODES.H:347
int Addr[AMSMAX]
address of AMs
#define FIXED_SMALL
Definition: Mguidefs.h:878
char NFileNameF[_MAX_PATH]
Definition: CreateForms.c:71
int ViewPlot(int mod)
Create the plot shell. Procedure that build the plot shell for the data visualization.
Definition: Spat_Plot.c:3775
int MTFont
Definition: Mguidefs.h:175
#define SPATRAMPLUS
As SPATRAM plus AltAzimuth platform.
void MDCreateMoveZen(void)
Definition: CreateForms.c:3261
#define SF_MODAL
Definition: Mguidefs.h:1019
const char * MGetCurrentDirectory(void)
MOBJECT Wl[18]
Wavelength Buttons.
#define F5
Definition: KEYCODES.H:341
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
int ExtShutt(int mod)
change the status of the external shutter change the status of the external shutter (OPEN or CLOSED) ...
Definition: Exec.c:1155
void DB_Redraw_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
Definition: CreateForms.c:102
int NOVA_Out(int novatype, unsigned int out)
Write the NOVA Output port.
Definition: DAS_Spat.c:1375
mige MIGE
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
MOBJECT pbutt[15]
Horizontal Measurements Buttons.
int ChkWinInstance(char *buff, MOBJECT obj)
Definition: DAS_Spat.c:2153
int DeltaSZA
= 1 Delta SZA measurements activated, = 0 Continous measurements
void MLabelSetMargin(MOBJECT p, int wm, int hm)
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
void(* OBJ_EVENT_CB)(MOBJECT obj, MEvent *e, void *ad)
Definition: Mguidefs.h:1456
void MRButtonActivate(MOBJECT o)
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
void ActMvGratCB(MOBJECT edit, char *text, void *ed)
Move Grating of a free steps number callback. .
Definition: CreateForms.c:2691
int DB_FindChar(int mod, char *string, int ch)
Definition: CreateForms.c:4295
#define LISTEMP_TASK_TIME
spectrometer termoregulation
char * WlBuff
Definition: CreateForms.c:45
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
#define PRGFILE
execution driven by *.prg file
MOBJECT MCreateColForm(MOBJECT parent)
int MFileBrowseExt(const char *t, const char *ext, char *fname, char *dname, FB_PREFS *prefs)
palette DPAL
Definition: CreateForms.c:88
void HiresPS(int mod)
Hires Power Supply ON/OFF .
Definition: Spat_Device.c:2532
void MObjectAddEventNotifyCallback(MOBJECT obj, OBJ_EVENT_CB cb, CARD32 event_mask, void *a_data)
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
Definition: Procedures.c:899
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
void DB_Pause(void)
Definition: CreateForms.c:3766
MOBJECT Sh_NDFil
ND Filter Shell.
tools buttons . Push buttons for various tools .
pushbutt PushButt
Push buttons.
void MDCreateMoveGrat(void)
Free Grating positioning. Procedure that build the shell for Free Grating positioning.
Definition: CreateForms.c:2859
void ShutDOWN(void)
Creates shell for Shutting down the instrument .
Definition: CreateForms.c:6903
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
MOBJECT led[2]
led[0] = Lamp, led[1] = Shutter
void DB_LampSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
callback for selsct a specified push button with the keyboard
Definition: CreateForms.c:5041
void DB_ToolsKeyB_CB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:3973
void MShellRealizeXY(MOBJECT obj, int x, int y)
Function prototypes.
#define F8
Definition: KEYCODES.H:344
#define GASCODNG4
GASCODNG 4.
static int WlFlg
Definition: CreateForms.c:44
unsigned long AMS_ReadStep(int id, int motor)
read performed steps Procedure for the determination of the number of steps executed.
Definition: Dxl.c:60
int backlashrec
flag for backlash recovery: =0 perform backlash rec.; = 1 DO NOT perform backlash rec...
char * Fil_CodeNG1[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrum...
Definition: DAS_Spat.c:213
void MIGEZenAzPos_CB(MOBJECT o, void *a, void *v)
Definition: CreateForms.c:3554
void ActMvZenCB(MOBJECT edit, char *text, void *ed)
Definition: CreateForms.c:3116
const char * bg_image_file
Definition: Mguidefs.h:1519
d_geo DGEO
Definition: CreateForms.c:92
static YProfOn
Definition: CreateForms.c:2637
#define FSIMPLE
simple filter wheel
#define _MAX_PATH
Definition: Dildef.h:202
MOBJECT MCreateShell(const char *title, int flags)
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int MDCreateSh_NDFil(void)
Definition: CreateForms.c:6233
int linked
ids IDS
ID tasks.
Definition: DAS_Spat.c:54
int BuildLogRatio(void)
first attempt to apply the DOAS algorithm (..on going!!!)
Definition: DOAS.c:178
void Message(char *str, int er)
Create a message shell for the AMS errors (Debug Use). .
Definition: Dxl.c:1085
#define SPATRAM3
SPATRAM3.
const char * MirBuff
Definition: CreateForms.c:48
CTYPE int DLL DC_Status(int Camera)
Return the status of the last operations performed on the camera. This procedure allows you to check ...
short DB_BG[3]
Default Background Color.
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
MirrorSt MIS
Mirror.
Definition: DAS_Spat.c:61
MOBJECT MCreateRButton(MOBJECT parent, const char *text, MTFont font)
void DB_NDFilSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
callback changing the bakground color of the push button passing the mouse over it ...
Definition: CreateForms.c:6382
int DB_HelpCB(MOBJECT o, void *od, void *ad)
Help Callback Create the help in the predefined WEB Browser.
Definition: DAS_Spat.c:881
nova Nova
NOVA structure.
static int AskFlg
Definition: CreateForms.c:5370
configpanel ConfigPanel
Configuration panel structure.
MOBJECT Albl_Status
Active Control Panel Labels for Status.
MOBJECT Sh_SimPos
Simultaneous Positioning Shell.
int NDFilSet
ND filter wheel position definition - for SD_NDFilterW.
Definition: CreateForms.c:6231
MOBJECT Albl_LT[16]
Active Control Panel Labels for LIS Temperature 16.
Function prototypes.
void MDCreateMoveAzimDeg(void)
Definition: CreateForms.c:3673
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
const char * NDFilBuff
Definition: CreateForms.c:54
#define CELSIUS
Return CCD temperature in Celsius.
Definition: dcldef.h:449
void D_FixSZA(void)
Definition: RTC_Time.c:467
static double p
Definition: SOLPOS.C:131
int SetWorkDirMGUIenv(char *buff)
set DAS and MGUI enviroment when the program is launched undirectly (for offlineplot or log or auto o...
Definition: DAS_Spat.c:3353
char * Fil_Code[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:207
void DB_Esc_CB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:5540
BYTE DSCUDAPICALL dscFreeBoard(DSCB board)
ccd DC_CCD
Definition: CreateForms.c:75
#define TIMER_TASK_TIME
timer
void DB_FilSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
callback changing the bakground color of the push button passing the mouse over it ...
Definition: CreateForms.c:6144
void SimPosShClose_CB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:4351
void MLabelSetAlignment(MOBJECT p, int align)
int DT_LinkSpectra(void)
For the linked spectra (..on going!!!)
Definition: Utils.c:915
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
MOBJECT tb1
Definition: DFileMan.c:41
MOBJECT ShellConfig
Shell configuration panel.
#define CLEARCCD
Clear CCD before acquire.
Definition: dcldef.h:405
controlpanel ContrPanel
Control Panel Structure.
BYTE result
Definition: Dscad.c:30
Bortul Image Library Structure .
Definition: bildef.h:250
void FANECU(int mod)
FAN ON/OFF .
Definition: Spat_Device.c:2619
Definition: Dildef.h:674
CTYPE void DLL DC_ShutterControl(int mode, int camera)
int AMS_AzzeraCoord(int id, int mtr)
Set to zero the number of steps on the selected motor Set to zero the number of steps on the selecte...
Definition: Dxl.c:439
void MPagedFormSetActivePage(MOBJECT form, int page)
das DAS
Definition: CreateForms.c:98
void MFormSetSpacing(MOBJECT p, int offset)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
int target
Filter target Position.
#define AMS1
AMS1 address.
#define D_A
Definition: KEYCODES.H:279
int MDCreateSh_SimPos(void)
Definition: CreateForms.c:4411
void MObjectSetCompositeWidth(MOBJECT obj, int w)
int LoadExec(char *fname)
Load file for automatic execution. Procedure that load the file for automatic execution.
Definition: Load.c:1534
MOBJECT frm_tbSM[AMSMAX][2]
tab for Stepper Motors
short DB_UnSelFG[3]
Unselected Buttons Colors.
void DB_WlSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
callback changing the bakground color of the push button passing the mouse over it ...
Definition: CreateForms.c:5905
static int HomeFlg
Definition: CreateForms.c:56
int SD_Position(int m, int w, int f, double z, double a)
perform the simoultaneous positioning of the Spectrometer Devices m = mirror w = wavelength (Grating)...
Definition: Spat_Device.c:1243
int speed[AMSMAX][2]
Stepper Motors Speed.
MOBJECT Albl_IE[1]
Active Control Panel Labels for In Execution status.
int manhormeas
1 = horizontal measurements in manual mode
int step[AMSMAX][2]
Stepper Motors Step.
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
void DB_HorComm_CB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:506
void DB_Close_Sh(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:5511
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
int ExeDSZA
= 1 the measurements are performed, = 0 waiting for the next deltasza.
int GrDIR
Definition: CreateForms.c:64
void DB_WriteMode(int mod)
Definition: CreateForms.c:6722
int aaopmode
operation mode for the Alt Az Platform, 0 = solar Traxker; 1 = Anti-Solar Tracker; 2 = Free Positioni...
Definition: dcldef.h:1020
char * HomeBuff
Definition: CreateForms.c:57
int AMS_dirfin(int id, int dira, int dirb)
Set Final Directions .
Definition: Dxl.c:457
void FrmBuildTemperature(MOBJECT pf)
Definition: CreateForms.c:151
int type
Event type (E_BUTTON_PRESS, E_BUTTON_RELEASE, E_MOTION, E_MOUSE_WHEEL)
Definition: Mguidefs.h:612
int MSListAddItem(MOBJECT p, const char *item, void *data)
C_DEF void DI_FindExtName(char *fullname, char *fext)
static int GratFlg
Definition: CreateForms.c:60
Definition: dcldef.h:1043
MOBJECT NDFil[6]
ND Filter Buttons.
int DT_FluxIndex(void)
Callback for Flux Index Calculation.
Definition: Utils.c:499
void DB_PushButtonMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
Definition: CreateForms.c:950
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
void MButtonSetOnMouseOverForegroundRGB(MOBJECT button, int r, int g, int b)
void MLoopWhileFlag(int *pflag, int value)
CTYPE void DLL DC_Cooler(int Mode, int Camera)
Procedure that allows you to control the cooler manually. Procedure that allows you to control the co...
#define NOSHUTTER
Do not control shutter.
Definition: dcldef.h:407
double realzenpos
void CCD_Error(char *str)
Alerts for CCD errors Creates a message window reporting the number of the error. ...
Definition: Errors.c:279
int DB_InfCB(MOBJECT o, void *od, void *ad)
Inf Callback Create the Inf shell.
Definition: DAS_Spat.c:915
void DB_StepGratEnc_CB(MOBJECT o, void *a, void *v)
Definition: CreateForms.c:2811
int FilSet
filter wheel position definition - for SD_FilterW
Definition: CreateForms.c:5992
char * NDFil_Code[]
const char array for the realisation of the Filters buttons in the ND Filter shell ...
Definition: DAS_Spat.c:219
int filename
Flag to set file name mode 0=Free choice, 1 = Automatic.
MOBJECT Albl_Elev
Active Control Panel Labels for Sun Elevation.
dil DIL
Definition: CreateForms.c:87
long Pos
Grating Position.
int EqType
Spectrometer Type.
#define E_MOTION
Definition: Mguidefs.h:277
static XProfOn
Definition: CreateForms.c:2655
DSCB dscb
Definition: DAS_Spat.c:67
CARD8 allow_dir_rename
Definition: Mguidefs.h:1490
#define TESTAD
execution for testing PC 104 AD converter
#define HELV_MEDIUM
Definition: Mguidefs.h:882
int HGFlg
Definition: DAS_Spatram.h:2968
#define NOVA7892
NOVA7892 monoboard (old)
MOBJECT shell_1
Definition: CreateForms.c:4317
#define F6
Definition: KEYCODES.H:342
int com
Comunication port.
Definition: DXL.H:17
int Com
void DB_PushButtonMouse(int mod, int event, MOBJECT obj, struct pbutt *ppbutt)
Definition: CreateForms.c:882
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
double Pos
Azimuth Current Position.
int NumRip
Definition: PWD.C:28
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void MObjectSetSensitive(MOBJECT obj)
int type
type of NOVA monoboard used (7892 or 945GSE)
float MIGEZen(float p)
Definition: CreateForms.c:3419
int stepgratenc
step to the grating mode: = 0 typed steps sent to the stepper; = 1 typed step are parametrized ...
int on
PRG execution control variabile.
Definition: DAS_Spat.c:109
void ShutCB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:6740
double Pos
Zenith Current Position.
Status of the Azimuth .
int SD_NDFilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2354
MOBJECT LedHG
Control Panel Led for HG Lamp.
MOBJECT MCreateRowForm(MOBJECT parent)
#define WS_ETCHED_IN
Definition: Mguidefs.h:959
int FlagShutter
flag for shutter status. =1–> Shutter Open; =0->shutter Closed
float SMfraz(int t)
denominator value of the stepping ratio
Definition: Spat_Device.c:129
void D_YProfile(void)
Definition: CreateForms.c:2638
void PupAdvCal_CB(MOBJECT obj, MEvent *pe, void *pdown)
Definition: CreateForms.c:1126
MOBJECT lbl[15]
generic labels for hor meas shell
int extshutter
0 = external shutter open; 1 = external shutter closed
System password structure .
float MIGEAz(float p)
Definition: CreateForms.c:3475
BYTE DSCUDAPICALL dscFree(void)
void ShutterOpening(int mod)
Definition: Procedures.c:1685
MOBJECT Pagedfrm_SM
Pged form for Stepper Motors.
tools TOOLS
Definition: CreateForms.c:81
MOBJECT MCreatePopupMenu(MTFont font)
void DB_NDFil_CB(MOBJECT p, void *od, void *ad)
callback for filter wheel positioning in Filter shell
Definition: CreateForms.c:6360
MOBJECT power[AMSMAX][2]
active Control Panel Labels for Stepper Motors "power"
#define TOP_ALIGN
Definition: Mguidefs.h:918
Status of the Grating .
MOBJECT MCreateTabbedRowForm(MOBJECT parent, int npage, MTFont f)
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
int exemode
Set the Execution MODE (Execution modes)
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
void DB_SheelESC(MOBJECT obj, MKeyEvent *pe, void *a_data)
Definition: CreateForms.c:5569
long target
Grating target Wl.
#define AMS3
AMS3 address.
void DB_HomeSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
Definition: CreateForms.c:6490
MOBJECT lblK[10]
Capital Labels Up.
#define F_ATT_NONE
Definition: Mguidefs.h:1106
GratingSt GRS
Definition: CreateForms.c:82
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
ptf DC_HP
Definition: CreateForms.c:76
int x_root
coordinates relative to root
Definition: Mguidefs.h:618
void MObjectSetBGColorFromParent(MOBJECT obj, int true_false, int percentage)
const char * FilBuff
Definition: CreateForms.c:51
#define TESTAMS
execution for testing AMS&#39;s devices
C_DEF void DI_Lens(void)
void MDCreateMoveZenDeg(void)
Definition: CreateForms.c:3192
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
short DB_FG_lblUP[3]
Foreground Capital Letters Labels Color UP.
MOBJECT edtzen
MTFont plfont
Definition: CreateForms.c:95
int MirSet
mirror position definition - for SD_Mirror
Definition: CreateForms.c:5612
int FANFlg
Definition: DAS_Spatram.h:2970
void MDCreateMoveAzim(void)
Definition: CreateForms.c:3340
#define MANUAL
execution in manual mode (for lab use)
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
MOBJECT Mir[4]
Mirror Buttons.
config Cfg
Definition: CreateForms.c:77
int power[AMSMAX][2]
Stepper Motors Power.
const char * Mir_CodeTropo[]
const char array for the realisation of the Mirrors buttons in the Mirror shell for TROPOGAS ...
Definition: DAS_Spat.c:234
#define F1
Definition: KEYCODES.H:337
paramini Paramini
structure for the parameters defined in param.ini configuration file
LIST_ACT * MSListGetSelected(MOBJECT p)
______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:44:07 for DAS - Rel. 3.1.6 - 18/09/2017.