DAS  3.1.6 - 18/09/2017
DOAS_FullProj.c
Go to the documentation of this file.
1 /*
2  * Code generated by MGUI Designer
3  */
4 #include <windows.h>
5 #include <errno.h>
6 #include <io.h>
7 #include <malloc.h>
8 #include <math.h>
9 #include <direct.h>
10 #include <fcntl.h>
11 #include <sys/stat.h>
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <string.h>
15 #include "mgui.h"
16 #include "DOAS_FullProj.h"
17 #include "Bil.h"
18 #include "DAS_Spatram.h"
19 #include "dcl.h"
20 #include "dil.h"
21 #include "DOAS.h"
22 #include "dscud.h"
23 
31 // CCD & Camera vars
32 //ccd DC_CCD; // CCD settings
33 //ptf DC_HP; // Platform settings
34 //config Cfg; // Camera controls & Options
35 //dil DIL;
37 flag FLAG; //flags structure
38 //paramini PARAM; //Param.ini
39 //marc MARC; // Marconi struct
40 //tools TOOLS; //tools structure
41 //d_geo DGEO; // geographical coordinates structure
42 bil BIL; //Bortul Library Structure
43 //GratingSt GRS; //Grating
46 
48 
49 
50  /*
51  * External User Defined Callbacks
52  */
53 //void ChangeFormatCB(MOBJECT p, void *od, void *ad);
54 /*
55  * Global Variables
56  */
62 
67 /*
68  * Shell creation prototypes
69  */
71 //MOBJECT MDCreateDOAS_MainSh(struct doas *pdoas);
75 
76 /*
77  * Project Defined Callbacks
78  */
79 
80 void ExitCB(MOBJECT p, void *od, void *ad)
81 {
82 
83  MGUITerm();
84 
85 }
86 void IoSetupCB(MOBJECT p, void *od, void *ad)
87 {
88 
89 }
90 void IoCreateCB(MOBJECT p, void *od, void *ad)
91 {
92 
93 }
94 void DOASSetupCB(MOBJECT p, void *od, void *ad)
95 {
96 
99 
100 
101 }
102 void DOASProcCB(MOBJECT p, void *od, void *ad)
103 {
104 
107 
108 }
109 void DiffCB(MOBJECT p, void *od, void *ad)
110 {
111 
112  MDCreateDiff_Sh(0);
113 
114 }
115 void FixStepCB(MOBJECT p, void *od, void *ad)
116 {
117 
118  MDCreateFixed_Sh(0);
119 
120 }
121 void ViewCB(MOBJECT p, void *od, void *ad)
122 {
123 
124  ViewPlot(0); //OffLine Plot
125 
126 }
127 void D_SunCalc (void)
128 {
129 
130  char buff[_MAX_PATH];
131 
132  sprintf(buff,"%s\\%s",BIL.DFILEM.HOMEDIRECTORY, "SolPosCalc");
133 
134  chdir(buff);
135 
136  sprintf(buff,"%s\\%s",BIL.DFILEM.HOMEDIRECTORY, "SolPosCalc\\D_solpos1.exe");
137 
138  WinExec(buff, 1);
139 
140 // sprintf(buff,"%ss",BIL.DFILEM.HOMEDIRECTORY, "SolPosCalc");
141 
142  chdir(BIL.DFILEM.HOMEDIRECTORY);
143 
144 
145 }
146 
147 
148 void SunCalcCB(MOBJECT p, void *od, void *ad)
149 {
150 
151  D_SunCalc();
152 
153 }
154 void ShStCB(MOBJECT p, void *od, void *ad)
155 {
156 
157  MMessageDialog("DAS information", "The procedure is not yet implemented!!", " Ok ", NULL);
158 
159 }
160 void FilterCB(MOBJECT p, void *od, void *ad)
161 {
163 }
164 void ColumnFCB(MOBJECT p, void *od, void *ad)
165 {
166 
169 
170 
171 
172 }
173 
174 void ResumeCB(MOBJECT p, void *od, void *ad)
175 {
176 
177  MMessageDialog("DAS information", "The procedure is not yet implemented!!", " Ok ", NULL);
178 }
179 void LinkSpectraCB(MOBJECT p, void *od, void *ad)
180 {
181 
182  MMessageDialog("DAS information", "The procedure is not yet implemented!!", " Ok ", NULL);
183 }
184 
185 
186 void ChooseFormatCB(MOBJECT p, void *od, void *ad)
187 {
188  int c = (int) ad;
189 
190  switch (c)
191  {
192  case 0:
193  MDCreateFormat_Sh(0); //BIN 2 ASCII
194  break;
195  case 1:
196  MDCreateFormat_Sh(1); //ASCII 2 BIN
197  break;
198  }
199 
200 
201 }
202 
203 
204 void HlpTopCB(MOBJECT p, void *od, void *ad)
205 {
206 
207  int c;
208  c = (int) ad;
209  switch (c)
210  {
211  case 0:
212  DB_HelpCB(NULL, NULL, NULL);; //Help
213  break;
214  case 1:
215  AboutCB(NULL, NULL, 0); //About
216  break;
217  }
218 
219 }
220 /*
221  * Shell creation functions
222  */
223 /*
224  Close and destroy the "p" MOBJECT
225 */
226 void CloseMObjCB(MOBJECT p, void *od, void *ad)
227 {
228 
229  MOBJECT c;
230  c = (MOBJECT) ad;
231 
232  MShellUnrealize(c);
233  MShellDestroy(c);
234 
235 }
236 
237 void RBListFileCB(MOBJECT p, void *od, void *ad)
238 {
239  int er = 0;
240  int c = (int) ad;
241 
242 
244 
245  if(er)
246  {
247  switch (c)
248  {
249  case 0:
250  LISTF.sortmode = SBNAME;
251  break;
252  case 1:
253  LISTF.sortmode = SBDATE;
254  break;
255  case 2:
256  LISTF.sortmode = SBDIM;
257  break;
258  case 3:
259  LISTF.sortmode = SBTYPE;
260  break;
261 
262 
263  }
264  }
265 }
266 
267 void RBEditListCB(MOBJECT p, void *od, void *ad)
268 {
269  int er = 0;
270  int c = (int) ad;
271 
273 
274  if(er)
275  {
276  switch (c)
277  {
278  case 0:
279  LISTF.edit = 0;
280  break;
281  case 1:
282  LISTF.edit = 1;
283  break;
284  case 2:
285  LISTF.type = 0; // compact list
286  break;
287  case 3:
288  LISTF.type = 1; // Detailed List
289  break;
290  case 4:
291  LISTF.subdir = 1; // list files in subdir
292  break;
293  case 5:
294  LISTF.subdir = 0; // NO List files in subdir
295  break;
296 
297  }
298  }
299 
300 }
301 
303 {
304  int er = 0;
305  int c = 0;
306  char com[255], str[255], buf[4];
307 
308  char fname[128], dirname[128];
309 
310  FB_PREFS prefs;
311 
312  prefs.allow_dir_create = True;
313  prefs.allow_dir_delete = True;
314  prefs.allow_dir_rename = True;
315  prefs.change_cwd = False;
316  prefs.allow_dir_create = True;
317  prefs.allow_dir_rename = True;
318  prefs.bg_image = False;
319  prefs.bg_image_file = "";
320  prefs.button_font = HELV_SMALL;
321  prefs.close_button = "CANCEL";
322  prefs.create_menu = "CREATE";
323  prefs.file_label = "File:";
324  prefs.filter_label = "Filter:";
325  prefs.font = HELV_SMALL;
326  prefs.ok_button = "OK";
327  prefs.remove_menu = "REMOVE";
328  prefs.rename_menu = "RENAME";
329  prefs.transparent_tree = False;
330 
331  strcpy (dirname, BIL.DFILEM.DATADIRECTORY);
332  fname[0] = '\0';
333  com[0] = '\0';
334 
335 
336  MObjectGetText(ed, buf);
337  sprintf(str, "*.%s", buf);
338 
339 
340  if(MDirBrowseExt("Select Directory for Listing Files", str, dirname, &prefs))
341  {
342  sprintf(com, "dir %s", dirname);
343 
344  }
345  else
346  return 0;
347 
348  MObjectGetText(ed, buf);
349  sprintf(str, "*.%s ", buf);
350  strcat(com, str);
351 
352  c = LISTF.type;
353  switch (c)
354  {
355  case 0:
356  sprintf(str, "/b ");
357  break;
358  case 1:
359  str[0] = '\0';
360  break;
361  }
362  strcat(com, str);
363 
364  c = LISTF.sortmode;
365  switch (c)
366  {
367  case SBNAME:
368  sprintf(str, "/o:n ");
369  break;
370  case SBDATE:
371  sprintf(str, "/o:d ");
372  break;
373  case SBDIM:
374  sprintf(str, "/o:s ");
375  break;
376  case SBTYPE:
377  sprintf(str, "/o:e ");
378  break;
379  }
380  strcat(com, str);
381 
382  c = LISTF.subdir;
383  switch (c)
384  {
385  case 1:
386  sprintf(str, "/s ");
387  break;
388  case 0:
389  str[0] = '\0';
390  break;
391  }
392  strcat(com, str);
393 
394  if(MFileBrowseExt("Type Name for the list", "*.ele", fname, dirname, &prefs))
395  {
396 
397  sprintf(str, "> %s%s", dirname, fname);
398  }
399  else
400  return 0;
401 
402  strcat(com, str);
403 
404  system(com);
405 
406  delay(500);
407 
408  //Show the created list
409  if(!LISTF.edit)
410  {
411  sprintf(str,"%s\\MEDIT.EXE %s%s",BIL.DFILEM.HOMEDIRECTORY, dirname, fname);
412  er = WinExec(str, SW_SHOW);
413 
414  }
415  return 0;
416 
417 }
418 
419 void CreateFileListCB(MOBJECT p, void *od, void *ad)
420 {
421 
422  MOBJECT ed;
423 
424 
425 
426  ed = (MOBJECT) ad;
427 
428  CreateList(ed);
429 
430 
431 }
432 
433 /*
434  Realize the Build List MOBJECT
435 */
437 {
438 // MOBJECT rowfrm;
439 // MOBJECT sh, pb, tb, lbl, rb, ed;
440 
441  LISTF.shell = MCreateShell("Build File List", 0);
442 
443  MObjectSetBackgroundRGB(LISTF.shell, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
444 
445  LISTF.rowfrm = MCreateRowForm(LISTF.shell);
446  MObjectSetForegroundRGB(LISTF.rowfrm, 255, 255, 0);
447  MObjectSetBackgroundRGB(LISTF.rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
448 
449  LISTF.lbl[0] = MCreateLabel(LISTF.rowfrm, "ORDER FOR:", HELV_SMALL);
450  MObjectSetForegroundRGB(LISTF.lbl[0], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
451  MObjectSetBackgroundRGB(LISTF.lbl[0], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
452  MObjectSetTransparency(LISTF.lbl[0], 0);
453 
454  LISTF.tb[0] = MCreateTableForm(LISTF.rowfrm, 4);
455  MObjectSetBackgroundRGB(LISTF.tb[0], DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
456  MObjectSetResize(LISTF.tb[0], True, True);
457 
458  LISTF.rb[0] = MCreateRButton(LISTF.tb[0], "Name", HELV_SMALL);
459  MObjectSetBackgroundRGB(LISTF.rb[0], DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
460  MObjectSetForegroundRGB(LISTF.rb[0], DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
461  MObjectSetTransparency(LISTF.rb[0], 0);
462  MRButtonActivate(LISTF.rb[0]);
463  MPButtonSetCallback(LISTF.rb[0], RBListFileCB, (void *) 0);
464 
465  LISTF.rb[1] = MCreateRButton(LISTF.tb[0], "Date", HELV_SMALL);
466  MObjectSetBackgroundRGB(LISTF.rb[1], DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
467  MObjectSetForegroundRGB(LISTF.rb[1], DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
468  MObjectSetTransparency(LISTF.rb[1], 0);
469  MPButtonSetCallback(LISTF.rb[1], RBEditListCB, (void *) 1);
470 
471  LISTF.rb[2] = MCreateRButton(LISTF.tb[0], "Dimension", HELV_SMALL);
472  MObjectSetBackgroundRGB(LISTF.rb[2], DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
473  MObjectSetForegroundRGB(LISTF.rb[2], DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
474  MObjectSetTransparency(LISTF.rb[2], 0);
475  MPButtonSetCallback(LISTF.rb[2], RBEditListCB, (void *) 2);
476 
477  LISTF.rb[3] = MCreateRButton(LISTF.tb[0], "Type", HELV_SMALL);
478  MObjectSetBackgroundRGB(LISTF.rb[3], DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
479  MObjectSetForegroundRGB(LISTF.rb[3], DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
480  MObjectSetTransparency(LISTF.rb[3], 0);
481  MPButtonSetCallback(LISTF.rb[3], RBEditListCB, (void *) 3);
482 
483  LISTF.lbl[1] = MCreateLabel(LISTF.rowfrm, "FILE EXTENSION TO LIST:", HELV_SMALL);
484  MObjectSetForegroundRGB(LISTF.lbl[1], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
485  MObjectSetBackgroundRGB(LISTF.lbl[1], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
486  MObjectSetTransparency(LISTF.lbl[1], 0);
487 
488  LISTF.tb[1] = MCreateTableForm(LISTF.rowfrm, 2);
489  MObjectSetBackgroundRGB(LISTF.tb[1], DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
490 
491 
492  LISTF.lblpass = MCreateLabel(LISTF.tb[1], "Type it (dat, bif, *, gif...): ", HELV_SMALL);
493  MObjectSetBackgroundRGB(LISTF.lblpass, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
494  MObjectSetForegroundRGB(LISTF.lblpass, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
495  MObjectSetTransparency(LISTF.lblpass , 0);
496 
497  LISTF.ed = MCreateEdit(LISTF.tb[1], "dat", 4, FIXED_SMALL);
498  // MEditSetFilter(ed, 772, "");
499  // MEditSetActCallback(ed, SactedtCB, (void *) 6);
500  // MEditSetValCallback(ed, SvaledtCB, (void *) 6);
501  MObjectSetForegroundRGB(LISTF.ed, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
502  MObjectSetBackgroundRGB(LISTF.ed, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
503 
504  LISTF.lbl[2] = MCreateLabel(LISTF.rowfrm, "LIST FILES IN SUBDIR ?", HELV_SMALL);
505  MObjectSetForegroundRGB(LISTF.lbl[2], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
506  MObjectSetBackgroundRGB(LISTF.lbl[2], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
507  MObjectSetTransparency(LISTF.lbl[2], 0);
508 
509  LISTF.tb[2] = MCreateTableForm(LISTF.rowfrm, 4);
510  MObjectSetForegroundRGB(LISTF.tb[2], 255, 255, 0);
511  MObjectSetBackgroundRGB(LISTF.tb[2], DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
512  MObjectSetResize(LISTF.tb[2], True, True);
513 
514  LISTF.rb[4] = MCreateRButton(LISTF.tb[2], "Yes", HELV_SMALL);
515  MObjectSetBackgroundRGB(LISTF.rb[4], DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
516  MObjectSetForegroundRGB(LISTF.rb[4], DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
517  MObjectSetTransparency(LISTF.rb[4], 0);
518  MPButtonSetCallback(LISTF.rb[4], RBEditListCB, (void *) 4);
519 
520  LISTF.rb[5] = MCreateRButton(LISTF.tb[2], "No", HELV_SMALL);
521  MObjectSetBackgroundRGB(LISTF.rb[5], DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
522  MObjectSetForegroundRGB(LISTF.rb[5], DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
523  MObjectSetTransparency(LISTF.rb[5], 0);
524  MRButtonActivate(LISTF.rb[5]);
525  MPButtonSetCallback(LISTF.rb[5], RBEditListCB, (void *) 5);
526 /**********************************************************/
527 
528 
529  LISTF.lbl[3] = MCreateLabel(LISTF.rowfrm, "TYPE OF THE LIST", HELV_SMALL);
530  MObjectSetForegroundRGB(LISTF.lbl[3], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
531  MObjectSetBackgroundRGB(LISTF.lbl[3], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
532  MObjectSetTransparency(LISTF.lbl[3], 0);
533 
534  LISTF.tb[3] = MCreateTableForm(LISTF.rowfrm, 4);
535  MObjectSetForegroundRGB(LISTF.tb[3], 255, 255, 0);
536  MObjectSetBackgroundRGB(LISTF.tb[3], DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
537  MObjectSetResize(LISTF.tb[3], True, True);
538 
539  LISTF.rb[6] = MCreateRButton(LISTF.tb[3], "Compact", HELV_SMALL);
540  MObjectSetBackgroundRGB(LISTF.rb[6], DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
541  MObjectSetForegroundRGB(LISTF.rb[6], DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
542  MObjectSetTransparency(LISTF.rb[6], 0);
543  MRButtonActivate(LISTF.rb[6]);
544  MPButtonSetCallback(LISTF.rb[6], RBEditListCB, (void *) 2);
545 
546  LISTF.rb[7] = MCreateRButton(LISTF.tb[3], "Detailed", HELV_SMALL);
547  MObjectSetBackgroundRGB(LISTF.rb[7], DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
548  MObjectSetForegroundRGB(LISTF.rb[7], DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
549  MObjectSetTransparency(LISTF.rb[7], 0);
550  MPButtonSetCallback(LISTF.rb[7], RBEditListCB, (void *) 3);
551 /**********************************************************/
552  LISTF.lbl[4] = MCreateLabel(LISTF.rowfrm, "VIEW LIST AFTER CREATION ?", HELV_SMALL);
553  MObjectSetForegroundRGB(LISTF.lbl[4], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
554  MObjectSetBackgroundRGB(LISTF.lbl[4], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
555  MObjectSetTransparency(LISTF.lbl[4], 0);
556 
557  LISTF.tb[4] = MCreateTableForm(LISTF.rowfrm, 4);
558  MObjectSetForegroundRGB(LISTF.tb[4], 255, 255, 0);
559  MObjectSetBackgroundRGB(LISTF.tb[4], DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
560  MObjectSetResize(LISTF.tb[4], True, True);
561 
562  LISTF.rb[8] = MCreateRButton(LISTF.tb[4], "Yes", HELV_SMALL);
563  MObjectSetBackgroundRGB(LISTF.rb[8], DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
564  MObjectSetForegroundRGB(LISTF.rb[8], DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
565  MObjectSetTransparency(LISTF.rb[8], 0);
566  MRButtonActivate(LISTF.rb[8]);
567  MPButtonSetCallback(LISTF.rb[8], RBEditListCB, (void *) 0);
568 
569  LISTF.rb[9] = MCreateRButton(LISTF.tb[4], "No", HELV_SMALL);
570  MObjectSetBackgroundRGB(LISTF.rb[9], DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
571  MObjectSetForegroundRGB(LISTF.rb[9], DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
572  MObjectSetTransparency(LISTF.rb[9], 0);
573  MPButtonSetCallback(LISTF.rb[9], RBEditListCB, (void *) 1);
574 
575 /**********************************************************/
576  LISTF.tb[5] = MCreateTableForm(LISTF.rowfrm, 2);
577  MObjectSetBackgroundRGB(LISTF.tb[5],DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
578 
579 
580  LISTF.pb[0] = MCreatePButton(LISTF.tb[5], "Execute", HELV_SMALL);
581  MPButtonSetCallback(LISTF.pb[0], CreateFileListCB, (void *)LISTF.ed);
582  MObjectSetBackgroundRGB(LISTF.pb[0], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
583  MObjectSetForegroundRGB(LISTF.pb[0], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
584  MButtonSetOnMouseOverForegroundRGB(LISTF.pb[0], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
585 
586 
587  LISTF.pb[1] = MCreatePButton(LISTF.tb[5], " Close ", HELV_SMALL);
588  MPButtonSetCallback(LISTF.pb[1], CloseMObjCB, (void *) LISTF.shell);
589  MObjectSetBackgroundRGB(LISTF.pb[1], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
590  MObjectSetForegroundRGB(LISTF.pb[1], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
591  MButtonSetOnMouseOverForegroundRGB(LISTF.pb[1], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
592 
593  MShellRealize(LISTF.shell);
594 
595 
596  return 0;
597 }
598 
599 /*
600  Build List Callback
601 */
602 void BuildListCB(MOBJECT p, void *od, void *ad)
603 {
604 
606 }
607 
608 /*
609 int BuildList(void)
610 {
611 
612 
613  //Show the created list
614  if( LISTF.edit)
615  {
616 
617  }
618  return 0;
619 
620 }
621 */
622 
623 void FixedStepCB(MOBJECT p, void *od, void *ad)
624 {
625 
626  MMessageDialog("DAS information", "The procedure is not yet implemented!!", " Ok ", NULL);
627 }
628 
629 /*
630  Realize the Fixed step Tool MOBJECT
631 */
633 {
634  MOBJECT rowfrm;
635  MOBJECT sh, pb, tb, lbl, ed;
636 
637  sh = MCreateShell("Fixed Step Tool", 0);
638  MObjectSetBackgroundRGB(sh, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
639 
640  rowfrm = MCreateRowForm(sh);
641  MObjectSetForegroundRGB(rowfrm, 255, 255, 0);
642  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
643 
644  lbl = MCreateLabel(rowfrm, "This tool allows for fixing the step\nof an inhomogeneous spectral series\nby using the interpolation procedure\nover the specified\n known points and of the desired order.", HELV_SMALL);
645  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
646  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
647  MObjectSetTransparency(lbl, 0);
648 
649 
650 
651  tb = MCreateTableForm(rowfrm, 2);
652  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
653 
654  lbl = MCreateLabel(tb, "Final Step", HELV_SMALL);
655  MObjectSetBackgroundRGB(lbl, 65, 51, 0);
656  MObjectSetForegroundRGB(lbl, 255, 255, 255);
657  MObjectSetTransparency(lbl, 0);
658 
659  ed = MCreateEdit(tb, "2", 4, FIXED_SMALL);
660  MEditSetFilter(ed, 772, "");
661 // MEditSetActCallback(ed, SactedtCB, (void *) 6);
662 // MEditSetValCallback(ed, SvaledtCB, (void *) 6);
663  MObjectSetForegroundRGB(ed, 255, 255, 0);
664  MObjectSetBackgroundRGB(ed, 117, 117, 169);
665 
666  lbl = MCreateLabel(tb, "Known Points", HELV_SMALL);
667  MObjectSetBackgroundRGB(lbl, 65, 51, 0);
668  MObjectSetForegroundRGB(lbl, 255, 255, 255);
669  MObjectSetTransparency(lbl, 0);
670 
671  ed = MCreateEdit(tb, "3", 4, FIXED_SMALL);
672 // MEditSetFilter(ed, 772, "");
673 // MEditSetActCallback(ed, SactedtCB, (void *) 6);
674 // MEditSetValCallback(ed, SvaledtCB, (void *) 6);
675  MObjectSetForegroundRGB(ed, 255, 255, 0);
676  MObjectSetBackgroundRGB(ed, 117, 117, 169);
677 
678  lbl = MCreateLabel(tb, "Regression Order", HELV_SMALL);
679  MObjectSetBackgroundRGB(lbl, 65, 51, 0);
680  MObjectSetForegroundRGB(lbl, 255, 255, 255);
681  MObjectSetTransparency(lbl, 0);
682 
683  ed = MCreateEdit(tb, "3", 4, FIXED_SMALL);
684 // MEditSetFilter(ed, 772, "");
685 // MEditSetActCallback(ed, SactedtCB, (void *) 6);
686 // MEditSetValCallback(ed, SvaledtCB, (void *) 6);
687  MObjectSetForegroundRGB(ed, 255, 255, 0);
688  MObjectSetBackgroundRGB(ed, 117, 117, 169);
689 
690  tb = MCreateTableForm(rowfrm, 2);
691  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
692 
693 
694  pb = MCreatePButton(tb, "Execute", HELV_SMALL);
696  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
697  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
698  MButtonSetOnMouseOverForegroundRGB(pb, ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
699 
700 
701  pb = MCreatePButton(tb, " Close ", HELV_SMALL);
702  MPButtonSetCallback(pb, CloseMObjCB, (void *) sh);
703  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
704  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
705  MButtonSetOnMouseOverForegroundRGB(pb, ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
706 
707  MShellRealize(sh);
708 
709 
710  return 0;
711 }
712 
713 /*
714  Realize the Create differential MOBJECT
715 */
717 {
718  MOBJECT rowfrm;
719  MOBJECT sh, pb, tb, lbl, rb, ed;
720 
721  sh = MCreateShell("Differentiate File", 0);
722  MObjectSetBackgroundRGB(sh, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
723 
724  rowfrm = MCreateRowForm(sh);
725  MObjectSetForegroundRGB(rowfrm, 255, 255, 0);
726  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
727 
728  lbl = MCreateLabel(rowfrm, "FILTER DATA ?", HELV_SMALL);
729  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
730  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
731  MObjectSetTransparency(lbl, 0);
732 
733  tb = MCreateTableForm(rowfrm, 2);
734  MObjectSetForegroundRGB(tb, 255, 255, 0);
735  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
736  MObjectSetResize(tb, True, True);
737 
738  rb = MCreateRButton(tb, "Yes", HELV_SMALL);
739  MObjectSetBackgroundRGB(rb, DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
740  MObjectSetForegroundRGB(rb, DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
741  MObjectSetTransparency(rb, 0);
742 
743  rb = MCreateRButton(tb, "No", HELV_SMALL);
744  MObjectSetBackgroundRGB(rb, DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
745  MObjectSetForegroundRGB(rb, DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
746  MObjectSetTransparency(rb, 0);
747 
748  tb = MCreateTableForm(rowfrm, 2);
749  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
750 
751  lbl = MCreateLabel(tb, "Filter Windows", HELV_SMALL);
752  MObjectSetBackgroundRGB(lbl, 65, 51, 0);
753  MObjectSetForegroundRGB(lbl, 255, 255, 255);
754  MObjectSetTransparency(lbl, 0);
755 
756  ed = MCreateEdit(tb, "", 4, FIXED_SMALL);
757  MEditSetFilter(ed, 772, "");
758 // MEditSetActCallback(ed, SactedtCB, (void *) 6);
759 // MEditSetValCallback(ed, SvaledtCB, (void *) 6);
760  MObjectSetForegroundRGB(ed, 255, 255, 0);
761  MObjectSetBackgroundRGB(ed, 117, 117, 169);
762 
763  lbl = MCreateLabel(tb, "Differential Windows", HELV_SMALL);
764  MObjectSetBackgroundRGB(lbl, 65, 51, 0);
765  MObjectSetForegroundRGB(lbl, 255, 255, 255);
766  MObjectSetTransparency(lbl, 0);
767 
768  ed = MCreateEdit(tb, "", 4, FIXED_SMALL);
769  MEditSetFilter(ed, 772, "");
770 // MEditSetActCallback(ed, SactedtCB, (void *) 6);
771 // MEditSetValCallback(ed, SvaledtCB, (void *) 6);
772  MObjectSetForegroundRGB(ed, 255, 255, 0);
773  MObjectSetBackgroundRGB(ed, 117, 117, 169);
774 
775  tb = MCreateTableForm(rowfrm, 2);
776  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
777 
778 
779  pb = MCreatePButton(tb, "Execute", HELV_SMALL);
781  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
782  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
783  MButtonSetOnMouseOverForegroundRGB(pb, ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
784 
785 
786  pb = MCreatePButton(tb, " Close ", HELV_SMALL);
787  MPButtonSetCallback(pb, CloseMObjCB, (void *) sh);
788  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
789  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
790  MButtonSetOnMouseOverForegroundRGB(pb, ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
791 
792  MShellRealize(sh);
793 
794 
795  return 0;
796 }
797 
798 
799 void ColumnFormatCB(MOBJECT p, void *od, void *ad)
800 {
801 
802  int c = (int) ad;
803 
804  switch (c)
805  {
806  case 0:
807  MMessageDialog("DAS information", "The procedure is not yet implemented!!", " Ok ", NULL);
808  break;
809  case 1:
810  DT_ColFormat();
811  break;
812  }
813 
814 
815 }
816 
818 int fwstatus = 0;
819 
820 void DB_FilterColumnCB(MOBJECT p, void *od, void *ad)
821 {
822 
823  int er = 0;
824  int c = (int) ad;
825 
826 
828 
829  if(er)
830  {
831  switch (c)
832  {
833  case 0:
834  TOOLS.FlagFilter = 0;
835  if (fwstatus)
836  {
839  fwstatus = 0;
840  }
841 
842  break;
843  case 1:
844  TOOLS.FlagFilter = 1;
845 
846  MObjectMap(lblwf);
847  MObjectMap(edtwf);
848  fwstatus = 1;
849 
850  break;
851  }
852  }
853 
854 
855 
856 }
857 
858 
859 /*
860  Realize the Column format MOBJECT
861 */
863 {
864  MOBJECT rowfrm, pagfrm;
865  MOBJECT _oedit000;
866  MOBJECT _oedit001;
867  MOBJECT sh, pb, tb, lbl, rb;
868  char str[32];
869  int k,*p;
870 
871 
872  sh = MCreateShell("Column Format", 0);
873  MObjectSetBackgroundRGB(sh, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
874 
875 
876  pagfrm = MCreateTabbedRowForm(sh, 2, FIXED_SMALL);
877  MObjectSetForegroundRGB(pagfrm, 255, 255, 255);
878  MObjectSetBackgroundRGB(pagfrm, 96, 132, 152);
879  MObjectSetResize(pagfrm, True, False);
880 
881  /* Start Activation and creation of page 0 0000000000000*/
882  /* 00000000000000000000000000000000000000000000000000000000*/
883  MPagedFormSetActivePage(pagfrm, 0);
884  MObjectSetText(pagfrm, "Advanced Mode");
885 
886 
887 
888 
889  rowfrm = MCreateRowForm(pagfrm);
890  MObjectSetForegroundRGB(rowfrm, 255, 255, 0);
891  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
892 
893  lbl = MCreateLabel(rowfrm, "SELECT FILE MODE", HELV_SMALL);
894  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
895  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
896  MObjectSetTransparency(lbl, 0);
897 
898  tb = MCreateTableForm(rowfrm, 2);
899  MObjectSetForegroundRGB(tb, 255, 255, 0);
900  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
901  MObjectSetResize(tb, True, True);
902 
903  rb = MCreateRButton(tb, "Single", HELV_SMALL);
904  MObjectSetBackgroundRGB(rb, DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
905  MObjectSetForegroundRGB(rb, DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
906  MObjectSetTransparency(rb, 0);
907 
908  rb = MCreateRButton(tb, "List of...", HELV_SMALL);
909  MObjectSetBackgroundRGB(rb, DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
910  MObjectSetForegroundRGB(rb, DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
911  MObjectSetTransparency(rb, 0);
912 
913  lbl = MCreateLabel(rowfrm, "Order for Wavelength ?", HELV_SMALL);
914  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
915  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
916  MObjectSetTransparency(lbl, 0);
917 
918  tb = MCreateTableForm(rowfrm, 2);
919  MObjectSetForegroundRGB(tb, 255, 255, 0);
920  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
921  MObjectSetResize(tb, True, True);
922 
923  rb = MCreateRButton(tb, "Yes", HELV_SMALL);
924  MObjectSetBackgroundRGB(rb, DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
925  MObjectSetForegroundRGB(rb, DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
926  MObjectSetTransparency(rb, 0);
927 
928  rb = MCreateRButton(tb, "No", HELV_SMALL);
929  MObjectSetBackgroundRGB(rb, DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
930  MObjectSetForegroundRGB(rb, DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
931  MObjectSetTransparency(rb, 0);
932 
933  tb = MCreateTableForm(rowfrm, 2);
934  MObjectSetForegroundRGB(tb, 255, 255, 0);
935  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
936  MObjectSetResize(tb, True, True);
937 
938  lbl = MCreateLabel(tb, "Select the init Wl.", HELV_SMALL);
939  MObjectSetBackgroundRGB(lbl, 120, 177, 218);
940  MObjectSetTransparency(lbl, 0);
941 
942  _oedit000 = MCreateOptionEdit(tb, "2823", 5, 5, 15, FIXED_SMALL);
943  {
944  MOBJECT slist = MOptionEditGetList(_oedit000);
945  MSListSetSortCallback(slist, strcmp);
946  MSListAddItem(slist, "2823", (void *)0);
947  MSListAddItem(slist, "3337", (void *)1);
948  MSListAddItem(slist, "3850", (void *)2);
949  MSListAddItem(slist, "4358", (void *)3);
950  MSListAddItem(slist, "4861", (void *)4);
951  MSListAddItem(slist, "5332", (void *)5);
952  MSListAddItem(slist, "5814", (void *)6);
953  MSListAddItem(slist, "6282", (void *)7);
954  MSListAddItem(slist, "6734", (void *)8);
955  MSListAddItem(slist, "7201", (void *)9);
956  MSListAddItem(slist, "7677", (void *)10);
957  MSListAddItem(slist, "8195", (void *)11);
958  MSListAddItem(slist, "8622", (void *)12);
959  MSListAddItem(slist, "9023", (void *)13);
960  MSListAddItem(slist, "9405", (void *)14);
961  }
962  MEditSetFilter(_oedit000, 260, "");
963  MEditDisableEditing(_oedit000);
964  MEditEnableAutoControlColor(_oedit000);
965  MObjectSetForegroundRGB(_oedit000, 255, 255, 0);
966  MObjectSetBackgroundRGB(_oedit000, 117, 117, 169);
967 
968  lbl = MCreateLabel(tb, "Select the end Wl.", HELV_SMALL);
969  MObjectSetBackgroundRGB(lbl, 120, 177, 218);
970  MObjectSetTransparency(lbl, 0);
971 
972  _oedit001 = MCreateOptionEdit(tb, "9405", 5, 5, 15, FIXED_SMALL);
973  {
974  MOBJECT slist = MOptionEditGetList(_oedit001);
975  MSListSetSortCallback(slist, strcmp);
976  MSListAddItem(slist, "2823", (void *)0);
977  MSListAddItem(slist, "3337", (void *)1);
978  MSListAddItem(slist, "3850", (void *)2);
979  MSListAddItem(slist, "4358", (void *)3);
980  MSListAddItem(slist, "4861", (void *)4);
981  MSListAddItem(slist, "5332", (void *)5);
982  MSListAddItem(slist, "5814", (void *)6);
983  MSListAddItem(slist, "6282", (void *)7);
984  MSListAddItem(slist, "6734", (void *)8);
985  MSListAddItem(slist, "7201", (void *)9);
986  MSListAddItem(slist, "7677", (void *)10);
987  MSListAddItem(slist, "8195", (void *)11);
988  MSListAddItem(slist, "8622", (void *)12);
989  MSListAddItem(slist, "9023", (void *)13);
990  MSListAddItem(slist, "9405", (void *)14);
991  }
992  MEditSetFilter(_oedit001, 260, "");
993  MEditDisableEditing(_oedit001);
994  MEditEnableAutoControlColor(_oedit001);
995  MObjectSetForegroundRGB(_oedit001, 255, 255, 0);
996  MObjectSetBackgroundRGB(_oedit001, 117, 117, 169);
997 
998  tb = MCreateTableForm(rowfrm, 2);
999  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1000 
1001 
1002 
1003  pb = MCreatePButton(tb, "Execute", HELV_SMALL);
1004  MPButtonSetCallback(pb, ColumnFormatCB, (void *) 0);
1005  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1006  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1007  MButtonSetOnMouseOverForegroundRGB(pb, ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
1008 
1009 
1010  pb = MCreatePButton(tb, " Close ", HELV_SMALL);
1011  MPButtonSetCallback(pb, CloseMObjCB, (void *) sh);
1012  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1013  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1014  MButtonSetOnMouseOverForegroundRGB(pb, ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
1015 
1016  /* Start Activation and creation of page 1 0000000000000*/
1017  /* 00000000000000000000000000000000000000000000000000000000*/
1018  MPagedFormSetActivePage(pagfrm, 1);
1019  MObjectSetText(pagfrm, "Easy Mode");
1020 
1021  rowfrm = MCreateRowForm(pagfrm);
1022  MObjectSetForegroundRGB(rowfrm, 255, 255, 0);
1023  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1024 
1025  lbl = MCreateLabel(rowfrm, "PUSH the 'Execute' Button\n and\n select the file to put in column format", HELV_SMALL);
1026  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
1027  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
1028  MObjectSetTransparency(lbl, 0);
1029  MObjectSetResize(lbl, True, True);
1030 
1031 /****************/
1032  lbl = MCreateLabel(rowfrm, "FILTER", FIXED_SMALL);
1034  MObjectSetForegroundRGB(lbl, 255, 255, 255);
1035  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
1036  MObjectSetTransparency(lbl, 0);
1037 
1038 
1039  tb = MCreateTableForm(rowfrm, 2);
1040  MObjectSetBackgroundRGB(tb, 112, 128, 112);
1041  MObjectSetResize(tb, True, False);
1043 
1044  rb = MCreateRButton(tb, "Disabled", FIXED_SMALL);
1045  MPButtonSetCallback(rb, DB_FilterColumnCB, (void *) 0);
1047  MObjectSetForegroundRGB(rb, 255, 255, 255);
1048  //MObjectSetCompositeWidth(rb, 85);
1049  if(TOOLS.FlagFilter == 0)
1050  MRButtonActivate(rb);
1051 
1052  rb= MCreateRButton(tb, "Enabled", FIXED_SMALL);
1053  MPButtonSetCallback(rb, DB_FilterColumnCB, (void *) 1);
1055  MObjectSetForegroundRGB(rb, 255, 255, 255);
1056  //MObjectSetCompositeWidth(rb, 123);
1057  if(TOOLS.FlagFilter == 1)
1058  MRButtonActivate(rb);
1059 
1060 
1061 
1062  lblwf = MCreateLabel(tb, "Window Filter:", FIXED_SMALL);
1064  MObjectSetForegroundRGB(lblwf, 255, 255, 255);
1068 
1069 
1070  sprintf(str,"%d",DOAS.FFTFilter);
1071  edtwf = MCreateClippedEdit(tb, str, 10, 5, FIXED_SMALL);
1072  MObjectSetForegroundRGB(edtwf, 255, 255, 255);
1073  MObjectSetBackgroundRGB(edtwf, 40, 96, 72);
1074 // MObjectSetCompositeWidth(level, 35);
1076  k = 151;
1077  p = (void *) k;
1080 
1081  if(TOOLS.FlagFilter == 0)
1082  {
1085 
1086  }
1087  else
1088  {
1089  MObjectMap(lblwf);
1090  MObjectMap(edtwf);
1091  }
1092 
1093 
1094 /*****************/
1095 
1096  tb = MCreateTableForm(rowfrm, 2);
1097  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1098 
1099 
1100 
1101 
1102  pb = MCreatePButton(tb, "Execute", HELV_SMALL);
1103  MPButtonSetCallback(pb, ColumnFormatCB, (void *) 1);
1104  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1105  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1106  MButtonSetOnMouseOverForegroundRGB(pb, ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
1107 
1108 
1109  pb = MCreatePButton(tb, " Close ", HELV_SMALL);
1110  MPButtonSetCallback(pb, CloseMObjCB, (void *) sh);
1111  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1112  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1113  MButtonSetOnMouseOverForegroundRGB(pb, ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
1114 
1115 
1116  return sh;
1117 }
1118 
1119 int WriteDataFile(int c, char *filed)
1120 {
1121 
1122  int x, y, ft;
1123  FILE *fd;
1124  unsigned long info = 0;
1125 
1126  switch (c)
1127  {
1128  case 0: //BIN 2 ASCII
1129  fd = fopen(filed, "a");
1130  if(fd < 0) return 1;
1131 
1132  if (DOAS.FMMode == BFILE)
1133  VRange("Export as ASCII", 0);
1134 
1135  // Print on file the header
1136  D_PrintBILSPH(fd);
1137 
1138  for(y = 0; y < IDY; y++)
1139  {
1140  for(x = 0; x < IDX; x++)
1141  {
1142  if((x % 10) == 0)
1143  {
1144  if(y == 0 && x == 0)
1145  {
1146  }
1147  else
1148  fprintf(fd, "\n", NULL);
1149  }
1150  fprintf(fd, "%5u ", BIL.DPLOT.ImatOrig[y * IDX + x]);
1151  }
1152  if (DOAS.FMMode == BFILE)
1153  if((y % 40) == 0 && y > 0)
1154  VRange(NULL, (long) y * 100 / IDY);
1155 
1156  }
1157  fprintf(fd, "\n", NULL);
1158  fclose(fd);
1159  if (DOAS.FMMode == BFILE)
1160  VRange(NULL, 100);
1161 
1162  break;
1163  case 1: //Dat Ext
1164  ft = open(filed, O_WRONLY | O_BINARY | O_CREAT | O_APPEND, S_IWRITE);
1165  if(ft < 0) return(-1);
1166 
1167  // if(DI_FileExist(filedest))
1168  // {
1169  // er = MMessageDialog("DAS information", "The File already exist!!!. What do you want to do ?" , "Overwrite","Overwrite", "Specify different name","Cancel operation", NULL);
1170 
1171  // }
1172  if (DOAS.FMMode == BFILE)
1173  VRange("Export as Binary", 0);
1174  // Print on file the header
1175  D_PrintBILSPH_BIN(ft);
1176 
1177  for(x = 0; x < IDX; x++)
1178  {
1179  for(y = 0; y < IDY; y++)
1180  {
1181  info += write(ft, &BIL.DPLOT.ImatOrig[y * IDX + x], 2);
1182  }
1183  if (DOAS.FMMode == BFILE)
1184  if((x % 40) == 0 && x > 0)
1185  VRange(NULL, (long) x * 100 / IDX);
1186 
1187  }
1188 
1189  close(ft);
1190  if (DOAS.FMMode == BFILE)
1191  VRange(NULL, 100);
1192 
1193  break;
1194  }
1195 
1196  return 0;
1197 }
1198 
1199 /*
1200  Procedure for changing the data file format
1201  mod = 0 -> Binary to ASCII format (BIF -> DAT)
1202  mod = 1 -> ASCII to Binary format (DAT -> BIF)
1203 
1204  dir = input and output directory
1205  filename = input file name, the output file name is automatically generated
1206 */
1207 int DatOrBinFormat(int mod, char *dir, char *filename)
1208 {
1209 
1210  FILE *fs;
1211  int fn, er = 0;
1212  unsigned int l;
1213  int eofreach = 0;
1214  char fileorigin[_MAX_PATH];
1215  char filedest[_MAX_PATH];
1216  char *pdest;
1217  unsigned long info = 0;
1218  char ch[1];
1219 // char *chest = '\0';
1220 
1221 
1222 
1223  //if the second character of the 'filename' is not ':',
1224  //build the complete name (path + filename) for the origin file
1225  // else it means that a complete filename (with also the path) is furnished.
1226 
1227  sprintf(ch, "%c", filename[1]);
1228 
1229  if( strcmp(ch,":") == 0)
1230  sprintf(fileorigin,"%s", filename);
1231  else
1232  sprintf(fileorigin,"%s%s", dir, filename);
1233 
1234 
1235  l = strlen(fileorigin);
1236  pdest = _memccpy( filedest, fileorigin, '.', l );
1237  *pdest = '\0'; //
1238 
1239  //open the origin file and build the destination file
1240  switch (mod)
1241  {
1242  case 0: //BIN 2 ASCII
1243  strcat(filedest, "Dat");
1244  fn = open(fileorigin, O_RDONLY | O_BINARY, S_IREAD );
1245  if(fn < 0) return(-1);
1246  break;
1247  case 1: //Dat Ext
1248  strcat(filedest, "Bif");
1249  fs = fopen(fileorigin, "r");
1250  if(fs < 0) return 1;
1251  break;
1252  }
1253 
1254  //Init the reading of the origin file
1255  do
1256  {
1257  switch (mod)
1258  {
1259  case 0: //Bif Ext
1260  er = ReadHeader_BIN(fn);
1261  break;
1262 
1263  case 1: //dat Ext
1264  er = ReadHeader_ASCII(0, fs); //New Format (data after 10/12/03)
1265  break;
1266  }
1267 
1268  //Alloc the buffer for the data
1269  BIL.DPLOT.ImatOrig = AllocUSMat(IDX, IDY);
1270 
1271  //Read image
1272  switch (mod)
1273  {
1274  case 0: //Bif Ext
1275 
1276  ReadIMG_BIN(fn, BIL.DPLOT.ImatOrig, IDX, IDY);
1277  break;
1278 
1279  case 1: //Dat Ext
1280  ReadIMG(fs, BIL.DPLOT.ImatOrig, IDX, IDY);
1281  break;
1282  }
1283  //write data on the destination file
1284  switch (mod)
1285  {
1286  case 0: //BIN 2 ASCII
1287  WriteDataFile(mod, filedest);
1288  break;
1289  case 1: //ASCII 2 BIN
1290  WriteDataFile(mod, filedest);
1291  break;
1292  }
1293 
1294  //Dealloc the data buffer
1296 
1297  //Check for the End Of File
1298  switch (mod)
1299  {
1300  case 0: //Bif Ext
1301  eofreach = eof(fn);
1302  break;
1303 
1304  case 1: //Dat Ext
1305  eofreach = feof(fs);
1306  break;
1307  }
1308 
1309 
1310  }while(!eofreach);
1311 
1312  //Close the origin file
1313  switch (mod)
1314  {
1315  case 0: //Bif Ext
1316  close(fn);
1317  break;
1318 
1319  case 1: //Dat Ext
1320  fclose(fs);
1321  break;
1322  }
1323 
1324  return 0;
1325 }
1326 
1327 
1328 int EleDatOrBinFormat(int c, char *dirname, char *fname)
1329 {
1330 
1331  FILE *fs;
1332  char buf[_MAX_PATH], str[64];
1333  char filedatan[64] ;
1334  int k, i, numerofile;
1335 
1336  strcpy(buf, dirname);
1337  strcat(buf, fname);
1338 
1339 // Lettura file elenco
1340  i=0;
1341  fs = fopen(buf, "r");
1342  if(fs < 0) return 1;
1343  while( !feof( fs ) )
1344  {
1345  fgets(filedatan, 80, fs);
1346  i++;
1347  }
1348  fclose(fs);
1349 
1350  numerofile = i;
1351 
1352 
1353  fs = fopen(buf, "r");
1354  if(fs < 0) return 2;
1355 
1356 
1357 
1358  //Read the file names
1359  k = 0;
1360  while( !feof( fs ) )
1361  {
1362 
1363  D_VRange(str,0, 0, 222, 235);
1364 
1365  MLoopWhileEvents(2);
1366  k++;
1367 
1368  fscanf(fs, "%s", filedatan);
1369 
1370  switch (c)
1371  {
1372  case 0: //Bif Ext
1373  sprintf(str,"%d/%d, %s -> %s", k, numerofile, filedatan, "DAT");
1374  break;
1375 
1376  case 1: //Dat Ext
1377  sprintf(str,"%d/%d, %s -> %s", k, numerofile, filedatan, "BIF");
1378  break;
1379  }
1380 
1381 
1382  // build the complete file name
1383  D_VRange(str, (long) k * 100 / numerofile, 0, 222, 235 );
1384 
1385  DatOrBinFormat(c, dirname, filedatan);
1386 
1387  D_VRange(NULL, 100, 0,0,0);
1388 
1389  }
1390 
1391 
1392  fclose(fs);
1393 
1394  return 0;
1395 }
1396 
1397 
1398 void ChangeFormatCB(MOBJECT p, void *od, void *ad)
1399 {
1400 
1401  int er = 0, c = 0, d = 0;
1402  char fname[128], dirname[128];
1403 
1404 
1405  FB_PREFS prefs;
1406 
1407  prefs.allow_dir_create = True;
1408  prefs.allow_dir_delete = True;
1409  prefs.allow_dir_rename = True;
1410  prefs.change_cwd = False;
1411  prefs.allow_dir_create = True;
1412  prefs.allow_dir_rename = True;
1413  prefs.bg_image = False;
1414  prefs.bg_image_file = "";
1415  prefs.button_font = HELV_SMALL;
1416  prefs.close_button = "CANCEL";
1417  prefs.create_menu = "CREATE";
1418  prefs.file_label = "File:";
1419  prefs.filter_label = "Filter:";
1420  prefs.font = HELV_SMALL;
1421  prefs.ok_button = "OK";
1422  prefs.remove_menu = "REMOVE";
1423  prefs.rename_menu = "RENAME";
1424  prefs.transparent_tree = False;
1425 
1426  strcpy (dirname, BIL.DFILEM.DATADIRECTORY);
1427  fname[0] = '\0';
1428 
1429 
1430  c = (int) ad;
1431  d = DOAS.FMMode;
1432  switch(c)
1433  {
1434  // BIN 2 ASCII
1435  case 0:
1436  switch(d)
1437  {
1438  case 0: //Single File
1439  if(MFileBrowseExt("Select File for Binary to ASCII processing", "*.bif", fname, dirname, &prefs))
1440  {
1441  DatOrBinFormat(c, dirname, fname);
1442  break;
1443  }
1444  else
1445  break;
1446  case 1: //List of File
1447  if(MFileBrowseExt("Select List of Files for Binary to ASCII processing", "*.ele", fname, dirname, &prefs))
1448  {
1449  EleDatOrBinFormat(c, dirname, fname);
1450  break;
1451  }
1452 
1453  else
1454  break;
1455  case 2: //Directory
1456  if(MDirBrowseExt("Select Directory for Binary to ASCII processing", "*.*", DOAS.SYSDIR, &prefs))
1457 
1458 
1459  break;
1460  else
1461  break;
1462  case 3: //Drive
1463  break;
1464 
1465  }
1466 
1467  break;
1468  // ASCII 2 BIN
1469  case 1:
1470  switch(d)
1471  {
1472  case 0: //Single File
1473  if(MFileBrowseExt("Select File for ASCII to Binary processing", "*.dat", fname, dirname, &prefs))
1474  {
1475  DatOrBinFormat(c, dirname, fname);
1476  break;
1477  }
1478  else
1479  break;
1480  case 1: //List of File
1481  if(MFileBrowseExt("Select List of Files for ASCII to Binary processing", "*.ele", fname, dirname, &prefs))
1482  {
1483  EleDatOrBinFormat(c, dirname, fname);
1484  break;
1485  }
1486  else
1487  break;
1488 
1489  case 2: //Directory
1490  if(MDirBrowseExt("Select Directory for ASCII to Binary processing", "*.*", DOAS.SYSDIR, &prefs))
1491 
1492 
1493  break;
1494  else
1495  break;
1496  case 3: //Drive
1497  break;
1498 
1499  }
1500 
1501  break;
1502  }
1503 
1504 
1505 }
1506 
1507 void RBFormatCB(MOBJECT p, void *od, void *ad)
1508 {
1509  int er = 0;
1510  int c = (int) ad;
1511 
1512 
1514 
1515  if(er)
1516  {
1517  switch (c)
1518  {
1519  case 0:
1520  DOAS.FMMode = BFILE;
1521  break;
1522  case 1:
1523  DOAS.FMMode = BFILELIST;
1524  break;
1525  case 2:
1526  DOAS.FMMode = BDIR;
1527  break;
1528  case 3:
1529  DOAS.FMMode = BDRIVE;
1530  break;
1531 
1532 
1533  }
1534  }
1535 
1536 
1537 }
1538 
1539 
1540 void FilterRawDataCB(MOBJECT p, void *od, void *ad)
1541 {
1542 
1543  MMessageDialog("DAS information", "The procedure is not yet implemented!!", " Ok ", NULL);
1544 
1545 }
1546 
1547 
1549 {
1550  MOBJECT rowfrm;
1551  MOBJECT sh, pb, tb, lbl, rb, ed;
1552 
1553  if (mod == 1) // ASCII 2 BIN
1554  sh = MCreateShell("ASCII 2 Binary Format", 0);
1555  else if (mod == 0)
1556  sh = MCreateShell("Binary 2 ASCII Format", 0);
1557  else if (mod == 2)
1558  sh = MCreateShell("Filter Raw Data", 0);
1559 
1560  MObjectSetBackgroundRGB(sh, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1561 
1562  rowfrm = MCreateRowForm(sh);
1563 // MObjectSetForegroundRGB(rowfrm, 255, 255, 0);
1564  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1565 
1566  lbl = MCreateLabel(rowfrm, "SELECT FILE MODE", HELV_SMALL);
1567  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1568  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1569  MObjectSetTransparency(lbl, 0);
1570 
1571  tb = MCreateTableForm(rowfrm, 4);
1572 // MObjectSetForegroundRGB(tb, 255, 255, 0);
1573  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1574  MObjectSetResize(tb, True, True);
1575 
1576  rb = MCreateRButton(tb, "Single", HELV_SMALL);
1577  MObjectSetBackgroundRGB(rb, DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
1578  MObjectSetForegroundRGB(rb, DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
1579  MObjectSetTransparency(rb, 0);
1580  MRButtonActivate(rb);
1581  MPButtonSetCallback(rb, RBFormatCB, (void *) 0);
1582 
1583  rb = MCreateRButton(tb, "List of...", HELV_SMALL);
1584  MObjectSetBackgroundRGB(rb, DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
1585  MObjectSetForegroundRGB(rb, DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
1586  MObjectSetTransparency(rb, 0);
1587  MPButtonSetCallback(rb, RBFormatCB, (void *) 1);
1588 
1589  rb = MCreateRButton(tb, "Directory", HELV_SMALL);
1590  MObjectSetBackgroundRGB(rb, DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
1591  MObjectSetForegroundRGB(rb, DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
1592  MObjectSetTransparency(rb, 0);
1593  MPButtonSetCallback(rb, RBFormatCB, (void *) 2);
1595 
1596  rb = MCreateRButton(tb, "Drive", HELV_SMALL);
1597  MObjectSetBackgroundRGB(rb, DPAL.DB_BG_RButt[0], DPAL.DB_BG_RButt[1], DPAL.DB_BG_RButt[2]);
1598  MObjectSetForegroundRGB(rb, DPAL.DB_FG_RButt[0], DPAL.DB_FG_RButt[1], DPAL.DB_FG_RButt[2]);
1599  MObjectSetTransparency(rb, 0);
1600  MPButtonSetCallback(rb, RBFormatCB, (void *) 3);
1602 
1603  if (mod == 2)
1604  {
1605  tb = MCreateTableForm(rowfrm, 2);
1606  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1607 
1608  lbl = MCreateLabel(tb, "Filter Windows", HELV_SMALL);
1609  MObjectSetBackgroundRGB(lbl, 65, 51, 0);
1610  MObjectSetForegroundRGB(lbl, 255, 255, 255);
1611  MObjectSetTransparency(lbl, 0);
1612 
1613  ed = MCreateEdit(tb, "", 4, FIXED_SMALL);
1614  MEditSetFilter(ed, 772, "");
1615  // MEditSetActCallback(ed, SactedtCB, (void *) 6);
1616  // MEditSetValCallback(ed, SvaledtCB, (void *) 6);
1617  MObjectSetForegroundRGB(ed, 255, 255, 0);
1618  MObjectSetBackgroundRGB(ed, 117, 117, 169);
1619 
1620  }
1621  tb = MCreateTableForm(rowfrm, 2);
1622  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1623 
1624 
1625  pb = MCreatePButton(tb, "Execute", HELV_SMALL);
1626  if (mod == 1) // ASCII 2 BIN
1627  MPButtonSetCallback(pb, ChangeFormatCB, (void *)mod);
1628  else if (mod == 0)
1629  MPButtonSetCallback(pb, ChangeFormatCB, (void *)mod);
1630  else if (mod == 2)
1632 
1633  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1634  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1635  MButtonSetOnMouseOverForegroundRGB(pb, ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
1636 
1637  pb = MCreatePButton(tb, " Close ", HELV_SMALL);
1638  MPButtonSetCallback(pb, CloseMObjCB, (void *) sh);
1639  MObjectSetBackgroundRGB(pb, DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
1640  MObjectSetForegroundRGB(pb, DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
1641  MButtonSetOnMouseOverForegroundRGB(pb, ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
1642 
1643  MShellRealize(sh);
1644 
1645 
1646  return 0;
1647 }
1648 
1650 {
1651  FILE *fs;
1652  char str[80];
1653 
1654  fs = fopen("DOAS\\DOAS.cfg", "w");
1655 
1656 
1657  if(fs == NULL)
1658  {
1659  MMessageDialog("DAS information", "Problems in opening file", " Ok ", NULL);
1660  return 1;
1661  }
1662 
1663 
1664 
1665  sprintf(str, "##############################################\n");
1666  fprintf(fs,str);
1667  sprintf(str, "# DOAS Config File #\n");
1668  fprintf(fs,str);
1669  sprintf(str, "##############################################\n");
1670  fprintf(fs,str);
1671  sprintf(str, "#--------------------------------------------#\n");
1672  fprintf(fs,str);
1673  sprintf(str, "# PLEASE DO NOT MODIFY #\n");
1674  fprintf(fs,str);
1675  sprintf(str, "#--------------------------------------------#\n");
1676  fprintf(fs,str);
1677  sprintf(str, "#DOAS System Directory-----------------------#\n");
1678  fprintf(fs,str);
1679  sprintf(str, "%s\n", DOAS.SYSDIR);
1680  fprintf(fs,str);
1681 
1682  sprintf(str, "#DOAS Results Directory-----------------------#\n");
1683  fprintf(fs,str);
1684  sprintf(str, "%s\n", DOAS.RISDIR);
1685  fprintf(fs,str);
1686 
1687 
1688 
1689  sprintf(str, "##############################################\n");
1690  fprintf(fs,str);
1691 
1692  fclose(fs);
1693 
1694  return 0;
1695 
1696 }
1697 
1698 
1699 int DOAS_LoadConfig(struct doas *pdoas)
1700 {
1701 
1702  FILE *fs;
1703  char str[80];
1704  fs = fopen("DOAS\\DOAS.cfg", "r");
1705 
1706  if(fs == NULL) return 1;
1707 
1708  ReadLine(str, 80, fs); // ##############################################
1709  ReadLine(str, 80, fs); // # DOAS Config File #
1710  ReadLine(str, 80, fs); // ##############################################
1711  ReadLine(str, 80, fs); // #--------------------------------------------#
1712  ReadLine(str, 80, fs); // # PLEASE DO NOT MODIFY #
1713  ReadLine(str, 80, fs); // #--------------------------------------------#
1714  ReadLine(str, 80, fs); // #DOAS System Directory-----------------------#
1715  fscanf(fs, "%s\n", &pdoas->SYSDIR);
1716 
1717  ReadLine(str, 80, fs); // #DOAS Reults Directory-----------------------#
1718  fscanf(fs, "%s\n", &pdoas->RISDIR);
1719 
1720  ReadLine(str, 80, fs); // ##############################################
1721 
1722  fclose(fs);
1723 
1724  return 0;
1725 
1726 
1727 }
1728 
1729 
1730 
1731 void EditorCB(MOBJECT p, void *od, void *ad)
1732 {
1733  int er = 0;
1734  char str[255];
1735 
1736  sprintf(str,"%s\\MEDIT.EXE NoName.txt", BIL.DFILEM.HOMEDIRECTORY);
1737  er = WinExec(str, SW_SHOW);
1738 
1739 
1740 }
1741 
1742 void BrowseCB(MOBJECT p, void *od, void *ad)
1743 {
1744 
1745  int er = 0;
1746  FB_PREFS prefs;
1747 
1748 // MIMAGE img;
1749  prefs.allow_dir_create = True;
1750  prefs.allow_dir_delete = True;
1751  prefs.allow_dir_rename = True;
1752  prefs.change_cwd = False;
1753  prefs.allow_dir_create = True;
1754  prefs.allow_dir_rename = True;
1755  prefs.bg_image = NULL;
1756  prefs.bg_image_file = "sys\\images\\tiles\\tile2.bmp";
1757  prefs.button_font = HELV_SMALL;
1758  prefs.close_button = "CANCEL";
1759  prefs.create_menu = "CREATE";
1760  prefs.file_label = "File:";
1761  prefs.filter_label = "Filter:";
1762  prefs.font = HELV_SMALL;
1763  prefs.ok_button = "OK";
1764  prefs.remove_menu = "REMOVE";
1765  prefs.rename_menu = "RENAME";
1766  prefs.transparent_tree = False;
1767 
1768 
1769  switch((int) ad)
1770  {
1771  // DOAS System directory
1772  case 0:
1773 
1774 
1775  if(MDirBrowseExt("SELECT DOAS SYS DIRECTORY", "*.*", DOAS.SYSDIR, &prefs))
1776  MObjectSetText(lblsys, DOAS.SYSDIR);
1777  er = WriteDOASConfig();
1778  break;
1779  // DOAS Results directory
1780  case 1:
1781  if(MDirBrowseExt("SELECT DOAS RESULTS DIRECTORY", "*.*",DOAS.RISDIR, &prefs))
1782  MObjectSetText(lblris, DOAS.RISDIR);
1783  er = WriteDOASConfig();
1784  break;
1785  // Selected directory
1786  case 2:
1787  if(MDirBrowseExt("SELECT DIRECTORY", "*.*",DOAS.RISDIR, &prefs))
1788 
1789  break;
1790 
1791  }
1792 
1793 }
1794 
1795 void DOASConfigCB(MOBJECT p, void *od, void *ad)
1796 {
1797 
1798 
1799 // MDCreateBuildList_Sh(0);
1800 // ConfigCB(p, od, ad);
1801 
1802 }
1803 
1804 void VitesaCB(MOBJECT p, void *od, void *ad)
1805 {
1806 
1807  MOBJECT shell;
1808  int er = 0;
1809 
1810  shell = MDCreatesh_vitesa();
1811  MShellRealize(shell);
1812 
1813 
1814 
1815 }
1816 
1817 
1818 void FluxIndexCB(MOBJECT p, void *od, void *ad)
1819 {
1820 
1821 
1822  int er =0;
1823  char fname[128];
1824  char buff[_MAX_PATH];
1825 // int l;
1826 
1827 
1828  FB_PREFS fbp;
1829 
1830  fname[0] = '\0';
1831  buff[0] = '\0';
1832 
1833  memset (&fbp, 0, sizeof (fbp));
1834 
1835  fbp.change_cwd = True;
1836  fbp.allow_dir_create = True;
1837  fbp.allow_dir_rename = True;
1838  fbp.allow_dir_delete = True;
1839  fbp.transparent_tree = False;
1840  fbp.font = HELV_SMALL;
1841  fbp.button_font = HELV_SMALL;
1842  //Set Img file
1843  sprintf(buff, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "sys\\Tile2.bmp" );
1844  fbp.bg_image_file =buff;
1845 
1846 
1847  er = MFileBrowseExt ("Select List File for FluxIndex Calculation", "*.ele", fname, BIL.DFILEM.DATADIRECTORY, &fbp);
1848  if(er)
1849  {
1850  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",BIL.DFILEM.DATADIRECTORY, fname);
1852  }
1853 
1854 
1855 
1856 }
1857 
1858 
1860 {
1861  MOBJECT _rowform001;
1862  MOBJECT _tablefrm003;
1863  MOBJECT _label004;
1864  MOBJECT _label006;
1865  MOBJECT pb;
1866 
1867  MOBJECT menu;
1868 
1869  DOAS_LoadConfig(pdoas);
1870 
1871  // Load the dispersion coefficient for DOAS Use
1872  LoadDB_DispCoeff();
1873 
1874  LoadParam();
1875 
1876  sprintf(pdoas->family, "Arial");
1877  pdoas->fsize = 32;
1878  pdoas->fbold = 0;
1879  pdoas->fitalic = 0;
1880 
1881 
1882  pdoas->font = MLoadFont(pdoas->family, pdoas->fsize, pdoas->fbold, pdoas->fitalic);
1883 
1884 
1885  DOAS_MainSh = MCreateShell("DOAS Main Panel", 0);
1886 
1887  {
1888 /*
1889 
1890  */
1891 
1893 
1895 
1896 // menubar = MCreateMenuBar(DOAS_MainSh, pdoas->font);
1897 
1899 
1900  menu = MCreateMenu(menubar, "File");
1901  id_menu = MMenuAddItem(menu, "Load Img", (MENU_ITEM_CB) ExitCB, NULL);
1902  id_menu = MMenuAddItem(menu, "Load Ris", (MENU_ITEM_CB) ExitCB, NULL);
1903  id_menu = MMenuAddItem(menu, "Close", (MENU_ITEM_CB) ExitCB, NULL);
1904 
1905  MMenuAddSeparator(menu);
1906 
1907  id_menu = MMenuAddItem(menu, "Exit", (MENU_ITEM_CB) MGUIQuitCB, NULL);
1908  MMenuItemSetAccel(id_menu, C_X, "Ctrl+X");
1909 
1910  menu = MCreateMenu(menubar, "Analisys");
1911 
1912  id_menu = MMenuAddItem(menu, "Io", NULL, NULL);
1913  submenu = MCreateSubMenu(id_menu);
1914  id_menu = MMenuAddItem(submenu, "Setup", (MENU_ITEM_CB)IoSetupCB, 0);
1915  MMenuItemSetAccel(id_menu, C_S, "Ctrl+S");
1916  id_menu = MMenuAddItem(submenu, "Create", (MENU_ITEM_CB)IoCreateCB, 0);
1917  MMenuItemSetAccel(id_menu, C_C, "Ctrl+C");
1918 
1919  MMenuAddSeparator(menu);
1920 
1921  id_menu = MMenuAddItem(menu, "DOAS", NULL, NULL);
1922  submenu = MCreateSubMenu(id_menu);
1923  id_menu = MMenuAddItem(submenu, "Setup", (MENU_ITEM_CB)DOASSetupCB, 0);
1924  MMenuItemSetAccel(id_menu, C_S, "Ctrl+S");
1925  id_menu = MMenuAddItem(submenu, "Processing", (MENU_ITEM_CB)DOASProcCB, 0);
1926  MMenuItemSetAccel(id_menu, C_P, "Ctrl+P");
1927 
1928  menu = MCreateMenu(menubar, "Utility");
1929  id_item = MMenuAddItem(menu, "Differential", (MENU_ITEM_CB)DiffCB, 0);
1930  MMenuItemSetAccel(id_item, C_E, "Ctrl+E");
1931  id_item = MMenuAddItem(menu, "Fixed Step", (MENU_ITEM_CB)FixStepCB, 0);
1932  MMenuItemSetAccel(id_item, C_T, "Ctrl+T");
1933  id_item = MMenuAddItem(menu, "View Spectra", (MENU_ITEM_CB)ViewCB, 0);
1934  MMenuItemSetAccel(id_item, C_W, "Ctrl+W");
1935  id_item = MMenuAddItem(menu, "Sun Calculator", (MENU_ITEM_CB)SunCalcCB, 0);
1936  MMenuItemSetAccel(id_item, C_S, "Ctrl+S");
1937  id_item = MMenuAddItem(menu, "ShiftStretch", (MENU_ITEM_CB)ShStCB, 0);
1938  MMenuItemSetAccel(id_item, C_H, "Ctrl+H");
1939  id_item = MMenuAddItem(menu, "Filter Data", (MENU_ITEM_CB)FilterCB, 0);
1940  MMenuItemSetAccel(id_item, C_T, "Ctrl+T");
1941  id_item = MMenuAddItem(menu, "Column Format", (MENU_ITEM_CB)ColumnFCB, 0);
1942  MMenuItemSetAccel(id_item, C_C, "Ctrl+C");
1943  id_item = MMenuAddItem(menu, "Resume", (MENU_ITEM_CB)ResumeCB, 0);
1944  MMenuItemSetAccel(id_item, C_R, "Ctrl+R");
1945  id_item = MMenuAddItem(menu, "Link Spectra", (MENU_ITEM_CB)LinkSpectraCB, 0);
1946  MMenuItemSetAccel(id_item, C_L, "Ctrl+L");
1947 
1948  id_item = MMenuAddItem(menu, "Editor", (MENU_ITEM_CB)EditorCB, (void *) 0);
1949  MMenuItemSetAccel(id_item, C_D, "Ctrl+D");
1950 
1951  id_item = MMenuAddItem(menu, "Create List", (MENU_ITEM_CB)BuildListCB, (void *) 0);
1952  MMenuItemSetAccel(id_item, C_C, "Ctrl+C");
1953 
1954  id_item = MMenuAddItem(menu, "ASCII to Binary", (MENU_ITEM_CB)ChooseFormatCB, (void *) 1);
1955  MMenuItemSetAccel(id_item, C_A, "Ctrl+A");
1956 
1957  id_item = MMenuAddItem(menu, "Binary to ASCII ", (MENU_ITEM_CB)ChooseFormatCB, 0);
1958  MMenuItemSetAccel(id_item, C_B, "Ctrl+B");
1959 
1960  id_item = MMenuAddItem(menu, "Flux Index ", (MENU_ITEM_CB)FluxIndexCB, 0);
1961  MMenuItemSetAccel(id_item, C_U, "Ctrl+U");
1962 
1963  id_item = MMenuAddItem(menu, "Temp History ", (MENU_ITEM_CB)PBTempHistoCB, 0);
1964  MMenuItemSetAccel(id_item, C_H, "Ctrl+H");
1965 
1966  menu = MCreateMenu(menubar, "Tools");
1967  id_item = MMenuAddItem(menu, "Config", (MENU_ITEM_CB) DOASConfigCB, 0);
1968 
1969  id_item = MMenuAddItem(menu, "ViTESA", (MENU_ITEM_CB) VitesaCB, 0);
1970 
1971 
1972  menu = MCreateMenu(menubar, "Help");
1973  id_item = MMenuAddItem(menu, "Topics", (MENU_ITEM_CB) HlpTopCB, 0);
1974 
1975  id_item = MMenuAddItem(menu, "About", (MENU_ITEM_CB) HlpTopCB, (void *)1);
1976 
1977  }
1978  MObjectSetForegroundRGB(menubar, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1979  MObjectSetBackgroundRGB(menubar, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1980 
1981  _rowform001 = MCreateRowForm(DOAS_MainSh);
1982  MObjectSetBackgroundRGB(_rowform001, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1983 
1984  _tablefrm003 = MCreateTableForm(_rowform001, 3);
1985  MObjectSetBackgroundRGB(_tablefrm003, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1986 
1987  _label004 = MCreateLabel(_tablefrm003, "DOAS Sys Directory:", HELV_SMALL);
1988  MLabelSetAlignment(_label004, LEFT_ALIGN);
1989  MObjectSetForegroundRGB(_label004, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1990  MObjectSetBackgroundRGB(_label004, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1991  MObjectSetTransparency(_label004, 0);
1992 
1993 
1994  //lblsys = MCreateLabel(_tablefrm003, "..\\DOAS\\Sys\\ ", TIMES_SMALL);
1995  lblsys = MCreateLabel(_tablefrm003, pdoas->SYSDIR, TIMES_SMALL);
1997  MObjectSetForegroundRGB(lblsys, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1998  MObjectSetBackgroundRGB(lblsys, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
2001 
2002  pb = MCreateImagePButton(_tablefrm003, "sys\\fbsfold.bmp", "", "");
2003  MPButtonSetCallback(pb, BrowseCB, (void *) 0);
2004  MObjectSetPopupHelp(pb, "Change DOAS\nSystem Directory", 20, 2000);
2006 
2007  _label006 = MCreateLabel(_tablefrm003, "DOAS Results Directory:", HELV_SMALL);
2008  MLabelSetAlignment(_label006, LEFT_ALIGN);
2009  MObjectSetForegroundRGB(_label006, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2010  MObjectSetBackgroundRGB(_label006, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2011  MObjectSetTransparency(_label006, 0);
2012 
2013  lblris = MCreateLabel(_tablefrm003, pdoas->RISDIR, HELV_SMALL);
2015  MObjectSetForegroundRGB(lblris, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
2016  MObjectSetBackgroundRGB(lblris, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
2019 
2020  pb = MCreateImagePButton(_tablefrm003, "sys\\fbsfold.bmp", "", "");
2021  MPButtonSetCallback(pb, BrowseCB, (void *) 1);
2022  MObjectSetPopupHelp(pb, "Change DOAS\nResults Directory", 20, 2000);
2024 
2026 
2027 
2028 
2030 
2031  MMainLoop();
2032 
2033 
2034  return 0;
2035 }
2036 
2037 
2039 {
2040 
2041  MObjectRedraw(obj);
2042 /* if (mode)
2043  MDrawAreaSetExposeCallback(BIL.DPLOT.drawapl, DAExOnLineCB, NULL);
2044  else
2045  MDrawAreaSetExposeCallback(BIL.DPLOT.drawapl, DrawAreaExposeCB, NULL);
2046 */
2047 // MDrawAreaSetExposeCallback(obj, DrawAreaPlotCB, NULL);
2048  MObjectRedraw(obj);
2049 
2050 }
2051 
2052 
2053 //MOBJECT obj = draw control:
2054 // drwa[0] = PLOTIOIS
2055 
2056 void PlotDOAS_Spectra(int mod, MOBJECT obj, unsigned short plotmat[], int idx,
2057  int idy, double costx, double costy, int min, int max,
2058  int ox, int oy )
2059 {
2060 
2061 //void PlotSpectrum(MOBJECT obj, MOBJECT pb[], MIMAGE mim, unsigned short plotmat[], int idx,
2062 // int idy, unsigned long pe[], double costx, double costy, int min, int max,
2063 // int ox, int oy, int bp, int hlb, int hla)
2064 
2065  int t, j;
2066  int X1, X, Y1, Y;
2067  t=2;
2068  for(j = 0; j < idx ; j++)
2069  {
2070  X = (int) (ox + (j * costx));
2071  Y = (int) (oy - abs((int)((double)(plotmat[t * idx + j] - min) / costy)));
2072  X1 = (int) (ox + (j + 1) * costx);
2073  Y1 = (int) (oy - abs((int)((double)(plotmat[t * idx + j + 1] - min) / costy)));
2074 // MDrawLine(obj, X, Y, X1, Y1, pe[t]);
2075  }
2076 
2077 
2078 
2079 }
2080 
2081 
2082 
2083 void DOAS_Plot(int mod, int plottype, MOBJECT obj, char *text, struct doas *pdoas )
2084  {
2085  MOBJECT lbl;
2086  MOBJECT tb0, rform0;
2087  MOBJECT tb1, rform1, rform2;
2088  MOBJECT edit0;
2089  int i, iinf, isup,c;
2090  char buff[32];
2091 
2092 
2093 
2094  c = plottype;
2095  switch(c)
2096  {
2097  case 0:
2098  iinf = 0; isup = 10;
2099  break;
2100  case 1:
2101  iinf = 10; isup = 20;
2102  break;
2103  case 2:
2104  iinf = 20; isup = 30;
2105  break;
2106  case 3:
2107  iinf = 30; isup = 40;
2108  break;
2109  case 4:
2110  iinf = 40; isup = 50;
2111  break;
2112  case 5:
2113  iinf = 50; isup = 60;
2114  break;
2115  case 6:
2116  iinf = 60; isup = 70;
2117  break;
2118  case 7:
2119  iinf = 70; isup = 80;
2120  break;
2121  }
2122 
2123  if(mod == 0)
2124  {
2125 
2126  lbl = MCreateLabel(obj, text, HELV_SMALL);
2128  MObjectSetForegroundRGB(lbl, 255, 255, 0);
2129  MObjectSetBackgroundRGB(lbl, 117, 117, 169);
2130  MObjectSetTransparency(lbl, 0);
2131  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
2132  MObjectSetResize(lbl, False, False);
2133  }
2134  if(mod==1)
2135  {
2136  edit0 = MCreateOptionEdit(obj, "NO2", 5, 5, 6, FIXED_SMALL);
2137  {
2138  MOBJECT slist = MOptionEditGetList(edit0);
2139  MSListSetSortCallback(slist, strcmp);
2140  MSListAddItem(slist, "BrO", (void *)3);
2141  MSListAddItem(slist, "HCHO", (void *)4);
2142  MSListAddItem(slist, "HONO", (void *)5);
2143  MSListAddItem(slist, "NO2", (void *)0);
2144  MSListAddItem(slist, "NO3", (void *)6);
2145  MSListAddItem(slist, "O3", (void *)1);
2146  MSListAddItem(slist, "OClO", (void *)7);
2147  MSListAddItem(slist, "SO2", (void *)2);
2148  }
2149  MObjectSetForegroundRGB(edit0, 255, 255, 0);
2150  MObjectSetBackgroundRGB(edit0, 117, 117, 169);
2151 
2152  }
2153 
2154  tb0 = MCreateTableForm(obj, 2);
2155  MFormSetSpacing(tb0, 1);
2156  MTableFormShowGrid(tb0);
2157  MObjectSetResize(tb0, True, True);
2158 
2159  rform0 = MCreateRowForm(tb0);
2160  MFormSetSpacing(rform0, 1);
2161  MObjectAlign(rform0, LEFT_ALIGN, TOP_ALIGN);
2162  MObjectSetBackgroundRGB(rform0, 120, 177, 218);
2163  MObjectSetResize(rform0, False, True);
2164 
2165  for(i=iinf;i<isup;i++)
2166  {
2167  sprintf(buff,"%d", i);
2168  pdoas->lbly[i] = MCreateLabel(rform0, buff, HELV_SMALL);
2169  MObjectSetShadow(pdoas->lbly[i], WS_SHADOW_IN, 1, 0);
2170  MObjectSetResize(pdoas->lbly[i], False, False);
2171 
2172  }
2173 
2174  pdoas->drwa[c] = MCreateDrawArea(tb0, 221, 205);
2175  MObjectAlign(pdoas->drwa[c], LEFT_ALIGN, TOP_ALIGN);
2176  MObjectSetResize(pdoas->drwa[c], True, True);
2177 // MDrawAreaSetExposeCallback(pdoas->drwa[c], DOASPlotCB, NULL);
2178 
2179 
2180 
2181  rform1 = MCreateRowForm(tb0);
2182  MFormSetSpacing(rform1, 1);
2184  MObjectSetResize(rform1, False, False);
2185 
2186 
2187  rform2 = MCreateRowForm(tb0);
2188  MFormSetSpacing(rform2, 1);
2190  MObjectSetResize(rform2, True, True);
2191 
2192 
2193  tb1 = MCreateTableForm(rform2, 10);
2194  MFormSetSpacing(tb1, 1);
2195  MTableFormShowGrid(tb1);
2197  MObjectSetBackgroundRGB(tb1, 120, 177, 218);
2198 
2199 
2200  for(i=iinf;i<isup;i++)
2201  {
2202  sprintf(buff,"%d", i);
2203  pdoas->lblx[i] = MCreateLabel(tb1, buff, HELV_SMALL);
2204  MObjectSetShadow(pdoas->lblx[i], WS_SHADOW_IN, 1, 0);
2205  MObjectSetResize(pdoas->lblx[i], False, False);
2206 
2207 
2208  }
2209 
2210  }
2211 
2212 
2213 
2214 void LoadIoCB(MOBJECT p, void *od, void *ad)
2215 {
2216 
2217 
2218  int c = (int) ad, er =0;
2219 // int l;
2220  char buff[32],str[_MAX_PATH] ;
2221  char fname[128], dirname[128];
2222 
2223  FB_PREFS fbp;
2224  strcpy (dirname, MGetCurrentDirectory ());
2225  fname[0] = '\0';
2226  memset (&fbp, 0, sizeof (fbp));
2227 
2228  fbp.change_cwd = True;
2229  fbp.allow_dir_create = True;
2230  fbp.allow_dir_rename = True;
2231  fbp.allow_dir_delete = True;
2232  fbp.transparent_tree = False;
2233  fbp.font = HELV_SMALL;
2234  fbp.button_font = HELV_SMALL;
2235  //Set Img file
2236  sprintf(str, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "sys\\Tile2.bmp" );
2237  fbp.bg_image_file =str;
2238 
2239 
2240  switch (c)
2241  {
2242  case 0:
2243  sprintf(buff,"1234");
2244  er = MFileBrowseExt ("Select Io File", "*.*", fname, dirname, &fbp);
2245  if(er)
2246  {
2247  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",dirname, fname);
2248  LoadIo(1,BIL.DFILEM.DBFILENAME);
2249  }
2250  break;
2251 /* case 1:
2252  break;
2253  case 2:
2254  BuildLogRatio();
2255  break;
2256 */
2257  }
2258 
2259 
2260 
2261 
2262 
2263 }
2264 
2265 
2267 {
2268 
2269  MOBJECT sh;
2270 
2271  MOBJECT _menu000;
2272 
2273  MOBJECT _colform000;
2274  MOBJECT _rowform002;
2275  MOBJECT _rowform003;
2276  MOBJECT _rowform004;
2277  MOBJECT _rowform005;
2278  MOBJECT _rowform009;
2279  MOBJECT _rowform013;
2280  MOBJECT _rowform017;
2281  MOBJECT _rowform021;
2282  MOBJECT _rowform025;
2283  MOBJECT _rowform029;
2284  MOBJECT _rowform033;
2285  MOBJECT _rowform037;
2286 
2287 
2288  MOBJECT _tabform000;
2289 
2290  MOBJECT _tablefrm004;
2291  MOBJECT _tablefrm005;
2292  MOBJECT _tablefrm014;
2293  MOBJECT _tablefrm023;
2294 
2295 
2296  MOBJECT _label008;
2297  MOBJECT _label009;
2298  MOBJECT _label010;
2299  MOBJECT _label011;
2300  MOBJECT _label012;
2301  MOBJECT _label013;
2302  MOBJECT _label014;
2303  MOBJECT _label015;
2304  MOBJECT _label016;
2305  MOBJECT _label017;
2306  MOBJECT _label018;
2307  MOBJECT _label019;
2308  MOBJECT _label020;
2309  MOBJECT _label021;
2310  MOBJECT _label022;
2311  MOBJECT _label023;
2312 
2313 
2314  MOBJECT _label174;
2315  MOBJECT _label175;
2316  MOBJECT _label176;
2317  MOBJECT _label177;
2318  MOBJECT _label178;
2319 
2320  sh = MCreateShell("DOAS Processing", 0);
2321  MObjectSetBackgroundRGB(sh, 80, 80, 80);
2322 
2323  {
2324  MOBJECT pd;
2325  MENU_ITEM item;
2326 
2327  _menu000 = MCreateMenuBar(sh, HELV_SMALL);
2328  MMenuBarSetAcc(_menu000, F10);
2329  pd = MCreateMenu(_menu000, "File");
2330  item = MMenuAddItem(pd, "Load...", NULL, NULL);
2331 
2332  item = MMenuAddItem(pd, "Exit", (MENU_ITEM_CB) CloseMObjCB, (void *) sh);
2333 
2334 
2335 
2336  pd = MCreateMenu(_menu000, "Analisys");
2337  item = MMenuAddItem(pd, "Load Io", (MENU_ITEM_CB) LoadIoCB, (void *) 0);
2338  item = MMenuAddItem(pd, "DOAS Processing", NULL, NULL);
2339  pd = MCreateMenu(_menu000, "Utility");
2340  item = MMenuAddItem(pd, "Print", NULL, NULL);
2341  pd = MCreateMenu(_menu000, "Help");
2342  item = MMenuAddItem(pd, "Help Topics", NULL, NULL);
2343  item = MMenuAddItem(pd, "About", NULL, NULL);
2344  }
2345  MTopAttach(_menu000, F_ATT_FORM, 1, NULL);
2346  MLeftAttach(_menu000, F_ATT_FORM, 1, NULL);
2347  MObjectSetForegroundRGB(_menu000, 255, 255, 0);
2348 
2349  _rowform002 = MCreateRowForm(sh);
2350  MTopAttach(_rowform002, F_ATT_OBJ, 1, _menu000);
2351  MObjectAlign(_rowform002, CENTER_ALIGN, TOP_ALIGN);
2352  MObjectSetBackgroundRGB(_rowform002, 80, 80, 80);
2353  MObjectSetResize(_rowform002, True, True);
2354 
2355  _tablefrm004 = MCreateTableForm(_rowform002, 7);
2356  MFormSetSpacing(_tablefrm004, 1);
2357  MObjectSetBackgroundRGB(_tablefrm004, 80, 80, 80);
2358 
2359  _label008 = MCreateLabel(_tablefrm004, "Measurement Header", HELV_SMALL);
2360  MObjectSetForegroundRGB(_label008, 255, 255, 0);
2361 
2362  _colform000 = MCreateColForm(_rowform002);
2363  MFormSetSpacing(_colform000, 1);
2364  MObjectSetBackgroundRGB(_colform000, 80, 80, 80);
2365  MObjectSetResize(_colform000, True, True);
2366 
2367  _rowform003 = MCreateRowForm(_colform000);
2368  MFormSetSpacing(_rowform003, 1);
2369  MObjectAlign(_rowform003, LEFT_ALIGN, TOP_ALIGN);
2370  MObjectSetBackgroundRGB(_rowform003, 80, 80, 80);
2371  MObjectSetResize(_rowform003, False, False);
2372 
2373  _label009 = MCreateLabel(_rowform003, "Incremental\nParameters", HELV_MEDIUM);
2374  MObjectAlign(_label009, CENTER_ALIGN, TOP_ALIGN);
2375  MObjectSetForegroundRGB(_label009, 255, 255, 0);
2376  MObjectSetBackgroundRGB(_label009, 60, 140, 190);
2377  MObjectSetTransparency(_label009, 0);
2378  MObjectSetShadow(_label009, WS_SHADOW_OUT, 1, 0);
2379  MObjectSetResize(_label009, False, False);
2380 
2381  _tablefrm005 = MCreateTableForm(_rowform003, 1);
2382  MFormSetSpacing(_tablefrm005, 1);
2383  MTableFormSetColAlign(_tablefrm005, 0, LEFT_ALIGN);
2384  MObjectAlign(_tablefrm005, LEFT_ALIGN, TOP_ALIGN);
2385  MObjectSetBackgroundRGB(_tablefrm005, 80, 80, 80);
2386  MObjectSetResize(_tablefrm005, False, False);
2387 
2388  _label010 = MCreateLabel(_tablefrm005, "Iteration #:", HELV_SMALL);
2389  MObjectAlign(_label010, LEFT_ALIGN, TOP_ALIGN);
2390  MObjectSetForegroundRGB(_label010, 255, 255, 0);
2391  MObjectSetResize(_label010, False, False);
2392 
2393  _label011 = MCreateLabel(_tablefrm005, "0", HELV_SMALL);
2394  MLabelSetAlignment(_label011, RIGHT_ALIGN);
2395  MObjectAlign(_label011, RIGHT_ALIGN, TOP_ALIGN);
2396  MObjectSetForegroundRGB(_label011, 255, 255, 0);
2397  MObjectSetBackgroundRGB(_label011, 117, 117, 169);
2398  MObjectSetTransparency(_label011, 0);
2399  MObjectSetShadow(_label011, WS_SHADOW_IN, 1, 0);
2400 
2401  _label012 = MCreateLabel(_tablefrm005, "Shift:", HELV_SMALL);
2402  MObjectAlign(_label012, LEFT_ALIGN, TOP_ALIGN);
2403  MObjectSetForegroundRGB(_label012, 255, 255, 0);
2404  MObjectSetResize(_label012, False, False);
2405 
2406  _label013 = MCreateLabel(_tablefrm005, "+0.0000E+00", HELV_SMALL);
2407  MObjectSetForegroundRGB(_label013, 255, 255, 0);
2408  MObjectSetBackgroundRGB(_label013, 117, 117, 169);
2409  MObjectSetTransparency(_label013, 0);
2410  MObjectSetShadow(_label013, WS_SHADOW_IN, 1, 0);
2411  MObjectSetResize(_label013, False, False);
2412 
2413  _label014 = MCreateLabel(_tablefrm005, "Eps.Shift:", HELV_SMALL);
2414  MObjectAlign(_label014, LEFT_ALIGN, TOP_ALIGN);
2415  MObjectSetForegroundRGB(_label014, 255, 255, 0);
2416  MObjectSetResize(_label014, False, False);
2417 
2418  _label015 = MCreateLabel(_tablefrm005, "+0.0000E+00", HELV_SMALL);
2419  MObjectSetForegroundRGB(_label015, 255, 255, 0);
2420  MObjectSetBackgroundRGB(_label015, 117, 117, 169);
2421  MObjectSetTransparency(_label015, 0);
2422  MObjectSetShadow(_label015, WS_SHADOW_IN, 1, 0);
2423  MObjectSetResize(_label015, False, False);
2424 
2425  _label016 = MCreateLabel(_tablefrm005, "Stretch_0:", HELV_SMALL);
2426  MObjectSetForegroundRGB(_label016, 255, 255, 0);
2427  MObjectSetResize(_label016, False, False);
2428 
2429  _label017 = MCreateLabel(_tablefrm005, "+0.0000E+00", HELV_SMALL);
2430  MObjectSetForegroundRGB(_label017, 255, 255, 0);
2431  MObjectSetBackgroundRGB(_label017, 117, 117, 169);
2432  MObjectSetTransparency(_label017, 0);
2433  MObjectSetShadow(_label017, WS_SHADOW_IN, 1, 0);
2434  MObjectSetResize(_label017, False, False);
2435 
2436  _label018 = MCreateLabel(_tablefrm005, "Eps.Stretch_0:", HELV_SMALL);
2437  MObjectSetForegroundRGB(_label018, 255, 255, 0);
2438  MObjectSetResize(_label018, False, False);
2439 
2440  _label019 = MCreateLabel(_tablefrm005, "+0.0000E+00", HELV_SMALL);
2441  MObjectSetForegroundRGB(_label019, 255, 255, 0);
2442  MObjectSetBackgroundRGB(_label019, 117, 117, 169);
2443  MObjectSetTransparency(_label019, 0);
2444  MObjectSetShadow(_label019, WS_SHADOW_IN, 1, 0);
2445  MObjectSetResize(_label019, False, False);
2446 
2447  _label020 = MCreateLabel(_tablefrm005, "Stretch_1:", HELV_SMALL);
2448  MObjectSetForegroundRGB(_label020, 255, 255, 0);
2449  MObjectSetResize(_label020, False, False);
2450 
2451  _label021 = MCreateLabel(_tablefrm005, "+0.0000E+00", HELV_SMALL);
2452  MObjectSetForegroundRGB(_label021, 255, 255, 0);
2453  MObjectSetBackgroundRGB(_label021, 117, 117, 169);
2454  MObjectSetTransparency(_label021, 0);
2455  MObjectSetShadow(_label021, WS_SHADOW_IN, 1, 0);
2456  MObjectSetResize(_label021, False, False);
2457 
2458  _label022 = MCreateLabel(_tablefrm005, "Eps.Stretch_1:", HELV_SMALL);
2459  MObjectSetForegroundRGB(_label022, 255, 255, 0);
2460  MObjectSetResize(_label022, False, False);
2461 
2462  _label023 = MCreateLabel(_tablefrm005, "+0.0000E+00", HELV_SMALL);
2463  MObjectSetForegroundRGB(_label023, 255, 255, 0);
2464  MObjectSetBackgroundRGB(_label023, 117, 117, 169);
2465  MObjectSetTransparency(_label023, 0);
2466  MObjectSetShadow(_label023, WS_SHADOW_IN, 1, 0);
2467  MObjectSetResize(_label023, False, False);
2468 
2469  _rowform004 = MCreateRowForm(_colform000);
2470  MFormSetSpacing(_rowform004, 4);
2471  MObjectSetBackgroundRGB(_rowform004, 197, 197, 144);
2472  MObjectSetShadow(_rowform004, WS_NONE, 0, 0);
2473  MObjectSetResize(_rowform004, True, True);
2474 
2475  _tabform000 = MCreateTabbedRowForm(_rowform004, 5, HELV_SMALL);
2476  MFormSetSpacing(_tabform000, 1);
2477  MObjectAlign(_tabform000, CENTER_ALIGN, TOP_ALIGN);
2478  MObjectSetForegroundRGB(_tabform000, 255, 255, 0);
2479  MObjectSetBackgroundRGB(_tabform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2480  MObjectSetShadow(_tabform000, WS_SHADOW_IN, 1, 0);
2481  MObjectSetResize(_tabform000, True, True);
2482 
2483  MPagedFormSetActivePage(_tabform000, 0);
2484 
2485 
2486 /*-----------------------------------------------------*/
2487 /******** START PLOT SECTION ******************/
2488 
2489  //graph for Io/Is
2490  MObjectSetText(_tabform000, "Io_Is");
2491 
2492  _rowform005 = MCreateRowForm(_tabform000);
2493  MFormSetSpacing(_rowform005, 1);
2494  MObjectAlign(_rowform005, CENTER_ALIGN, TOP_ALIGN);
2495  MObjectSetFGColorFromParent(_rowform005, False);
2496  MObjectSetShadow(_rowform005, WS_SHADOW_IN, 1, 0);
2497  MObjectSetResize(_rowform005, True, True);
2498 
2499  DOAS_Plot(0, PLOTIOIS, _rowform005, "Io -> Blu Line; Is -> Red Line" ,&DOAS);
2500 
2501  MPagedFormSetActivePage(_tabform000, 1);
2502 
2503 
2504  MObjectSetText(_tabform000, "VarY_DCS");
2505 
2506  _rowform009 = MCreateRowForm(_tabform000);
2507  MObjectAlign(_rowform009, CENTER_ALIGN, TOP_ALIGN);
2508  MObjectSetFGColorFromParent(_rowform009, False);
2509  MObjectSetResize(_rowform009, True, True);
2510 
2511  DOAS_Plot(0, PLOTVARY, _rowform009, "VarY_DCS" ,&DOAS);
2512 
2513 
2514  MPagedFormSetActivePage(_tabform000, 2);
2515 
2516  MObjectSetText(_tabform000, "Residual");
2517 
2518  _rowform013 = MCreateRowForm(_tabform000);
2519  MObjectAlign(_rowform013, CENTER_ALIGN, TOP_ALIGN);
2520  MObjectSetFGColorFromParent(_rowform013, False);
2521  MObjectSetResize(_rowform013, True, True);
2522 
2523  DOAS_Plot(0, PLOTRES, _rowform013, "Residual" ,&DOAS);
2524 
2525 
2526  MPagedFormSetActivePage(_tabform000, 3);
2527 
2528  MObjectSetText(_tabform000, "Slant_SZA");
2529 
2530  _rowform017 = MCreateRowForm(_tabform000);
2531  MObjectAlign(_rowform017, CENTER_ALIGN, TOP_ALIGN);
2532  MObjectSetFGColorFromParent(_rowform017, False);
2533  MObjectSetResize(_rowform017, True, True);
2534 
2535  DOAS_Plot(1, PLOTSLANT, _rowform017, "Slant_SZA" ,&DOAS);
2536 
2537 
2538  MPagedFormSetActivePage(_tabform000, 4);
2539 
2540  MObjectSetText(_tabform000, "Plot All");
2541 
2542  _tablefrm014 = MCreateTableForm(_tabform000, 2);
2543  MObjectAlign(_tablefrm014, CENTER_ALIGN, TOP_ALIGN);
2544  MObjectSetFGColorFromParent(_tablefrm014, False);
2545  MObjectSetResize(_tablefrm014, True, True);
2546 
2547  _rowform021 = MCreateRowForm(_tablefrm014);
2548  MFormSetSpacing(_rowform021, 1);
2549  MObjectSetFGColorFromParent(_rowform021, False);
2550  MObjectSetShadow(_rowform021, WS_SHADOW_IN, 1, 0);
2551  MObjectSetResize(_rowform021, True, True);
2552 
2553 
2554  DOAS_Plot(0, PLOTIOIS_S, _rowform021, "Io -> Blu Line; Is -> Red Line" ,&DOAS);
2555 
2556 
2557  _rowform025 = MCreateRowForm(_tablefrm014);
2558  MObjectSetFGColorFromParent(_rowform025, False);
2559  MObjectSetShadow(_rowform025, WS_SHADOW_IN, 1, 0);
2560  MObjectSetResize(_rowform025, True, True);
2561 
2562  DOAS_Plot(0, PLOTVARY_S, _rowform025, "VarY -> Blu Line" ,&DOAS);
2563 
2564 
2565  _rowform029 = MCreateRowForm(_tablefrm014);
2566  MObjectSetFGColorFromParent(_rowform029, False);
2567  MObjectSetShadow(_rowform029, WS_SHADOW_IN, 1, 0);
2568  MObjectSetResize(_rowform029, True, True);
2569 
2570  DOAS_Plot(0, PLOTRES_S, _rowform029, "Residual" ,&DOAS);
2571 
2572 
2573  _rowform033 = MCreateRowForm(_tablefrm014);
2574  MObjectSetFGColorFromParent(_rowform033, False);
2575  MObjectSetShadow(_rowform033, WS_SHADOW_IN, 1, 0);
2576  MObjectSetResize(_rowform033, True, True);
2577 
2578  DOAS_Plot(1, PLOTSLANT_S, _rowform033, "Slant_SZA" ,&DOAS);
2579 /******** END PLOT SECTION ******************/
2580 /*-----------------------------------------------------*/
2581  MPagedFormSetActivePage(_tabform000, 0);
2582 
2583  _rowform037 = MCreateRowForm(_colform000);
2584  MFormSetSpacing(_rowform037, 1);
2585  MObjectAlign(_rowform037, LEFT_ALIGN, TOP_ALIGN);
2586  MObjectSetBackgroundRGB(_rowform037, 80, 80, 80);
2587  MObjectSetResize(_rowform037, False, False);
2588 
2589  _label174 = MCreateLabel(_rowform037, "Results", HELV_MEDIUM);
2590  MObjectAlign(_label174, CENTER_ALIGN, TOP_ALIGN);
2591  MObjectSetForegroundRGB(_label174, 255, 255, 0);
2592  MObjectSetBackgroundRGB(_label174, 60, 140, 190);
2593  MObjectSetTransparency(_label174, 0);
2594  MObjectSetShadow(_label174, WS_SHADOW_OUT, 1, 0);
2595  MObjectSetResize(_label174, False, False);
2596 
2597  _tablefrm023 = MCreateTableForm(_rowform037, 2);
2598  MTableFormSetRowAlign(_tablefrm023, 0, TOP_ALIGN);
2599  MObjectAlign(_tablefrm023, UNDEF_ALIGN, TOP_ALIGN);
2600  MObjectSetBackgroundRGB(_tablefrm023, 80, 80, 80);
2601  MObjectSetResize(_tablefrm023, False, True);
2602 
2603  _label175 = MCreateLabel(_tablefrm023, "SCD_", HELV_SMALL);
2604  MObjectAlign(_label175, LEFT_ALIGN, TOP_ALIGN);
2605  MObjectSetForegroundRGB(_label175, 255, 255, 0);
2606  MObjectSetResize(_label175, False, True);
2607 
2608  _label176 = MCreateLabel(_tablefrm023, "0.0000E+00", HELV_SMALL);
2609  MObjectAlign(_label176, RIGHT_ALIGN, TOP_ALIGN);
2610  MObjectSetForegroundRGB(_label176, 255, 255, 0);
2611  MObjectSetBackgroundRGB(_label176, 117, 117, 169);
2612  MObjectSetTransparency(_label176, 0);
2613  MObjectSetShadow(_label176, WS_SHADOW_IN, 1, 0);
2614 
2615  _label177 = MCreateLabel(_tablefrm023, "Err.", HELV_SMALL);
2616  MObjectSetForegroundRGB(_label177, 255, 255, 0);
2617 
2618  _label178 = MCreateLabel(_tablefrm023, "00.00%", HELV_SMALL);
2619  MObjectSetForegroundRGB(_label178, 255, 255, 0);
2620  MObjectSetBackgroundRGB(_label178, 117, 117, 169);
2621  MObjectSetTransparency(_label178, 0);
2622  MObjectSetShadow(_label178, WS_SHADOW_IN, 1, 0);
2623 
2624 
2625  return sh;
2626 }
2627 
2628 void DOASTogButCB(MOBJECT p, MVALUE od, void *ad)
2629 {
2630 
2631  int c, er;
2632 
2633  c = (int) ad;
2634 
2636 
2637  if(er)
2638  {
2640 
2641  //MMessageDialog(" ", "Activated","ok", NULL);
2642 
2643  }
2644  else
2645  MMessageDialog(" ", "NOT Activated","ok", NULL);
2646 
2647 }
2648 
2649 
2650 void DOAS_SetupPagedForm(int c, struct doas *pdoas)
2651 {
2652 
2653  MOBJECT lbl, rowfrm, tb, rb, tbutt[20];
2654  int i;
2655 
2656  MPagedFormSetActivePage(pdoas->WlTabFrm, c);
2657 
2658  rowfrm = MCreateRowForm(pdoas->WlTabFrm);
2659  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2660  MObjectSetResize(rowfrm, False, False);
2661  MObjectAlign(rowfrm, LEFT_ALIGN, TOP_ALIGN);
2662 
2663 
2664  lbl = MCreateLabel(rowfrm, "Cross Section", HELV_SMALL);
2665  MObjectSetForegroundRGB(lbl, 255, 255, 0);
2666  MObjectSetBackgroundRGB(lbl, 120, 177, 218);
2667  MObjectSetTransparency(lbl, 0);
2668  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
2670 
2671  tb = MCreateTableForm(rowfrm, 2);
2672  MObjectSetForegroundRGB(tb, 255, 255, 0);
2673  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2675 
2676  rb = MCreateRButton(tb, "From File", HELV_SMALL);
2677 
2678  rb = MCreateRButton(tb, "Select", HELV_SMALL);
2679 
2680  tb = MCreateTableForm(rowfrm, 2);
2681  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2683 
2684  for (i=0;i<20;i++)
2685  {
2686  tbutt[i] = MCreateTButton(tb, " ", HELV_SMALL);
2687  MObjectSetForegroundRGB(tbutt[i], 255, 255, 0);
2688  MObjectSetBackgroundRGB(tbutt[i], 117, 117, 169);
2689  MObjectSetTransparency(tbutt[i], 0);
2690  }
2691 
2692 /* _tbutton001 = MCreateTButton(_tablefrm025, "Mie", HELV_SMALL);
2693  MObjectSetForegroundRGB(_tbutton001, 255, 255, 0);
2694  MObjectSetBackgroundRGB(_tbutton001, 117, 117, 169);
2695  MObjectSetTransparency(_tbutton001, 0);
2696 
2697  _tbutton002 = MCreateTButton(_tablefrm025, "NO2_220K", HELV_SMALL);
2698  MObjectSetForegroundRGB(_tbutton002, 255, 255, 0);
2699  MObjectSetBackgroundRGB(_tbutton002, 117, 117, 169);
2700  MObjectSetTransparency(_tbutton002, 0);
2701 
2702  _tbutton003 = MCreateTButton(_tablefrm025, "NO2_240K", HELV_SMALL);
2703  MObjectSetForegroundRGB(_tbutton003, 255, 255, 0);
2704  MObjectSetBackgroundRGB(_tbutton003, 117, 117, 169);
2705  MObjectSetTransparency(_tbutton003, 0);
2706 
2707  _tbutton004 = MCreateTButton(_tablefrm025, "NO2_260K", HELV_SMALL);
2708  MObjectSetForegroundRGB(_tbutton004, 255, 255, 0);
2709  MObjectSetBackgroundRGB(_tbutton004, 117, 117, 169);
2710  MObjectSetTransparency(_tbutton004, 0);
2711 
2712  _tbutton005 = MCreateTButton(_tablefrm025, "NO2_293K", HELV_SMALL);
2713  MObjectSetForegroundRGB(_tbutton005, 255, 255, 0);
2714  MObjectSetBackgroundRGB(_tbutton005, 117, 117, 169);
2715  MObjectSetTransparency(_tbutton005, 0);
2716 
2717  _tbutton006 = MCreateTButton(_tablefrm025, "O3_220K", HELV_SMALL);
2718  MObjectSetForegroundRGB(_tbutton006, 255, 255, 0);
2719  MObjectSetBackgroundRGB(_tbutton006, 117, 117, 169);
2720  MObjectSetTransparency(_tbutton006, 0);
2721 
2722  _tbutton007 = MCreateTButton(_tablefrm025, "O3_240K", HELV_SMALL);
2723  MObjectSetForegroundRGB(_tbutton007, 255, 255, 0);
2724  MObjectSetBackgroundRGB(_tbutton007, 117, 117, 169);
2725  MObjectSetTransparency(_tbutton007, 0);
2726 
2727  _tbutton008 = MCreateTButton(_tablefrm025, "O3_260K", HELV_SMALL);
2728  MObjectSetForegroundRGB(_tbutton008, 255, 255, 0);
2729  MObjectSetBackgroundRGB(_tbutton008, 117, 117, 169);
2730  MObjectSetTransparency(_tbutton008, 0);
2731 
2732  _tbutton009 = MCreateTButton(_tablefrm025, "O3_293K", HELV_SMALL);
2733  MObjectSetForegroundRGB(_tbutton009, 255, 255, 0);
2734  MObjectSetBackgroundRGB(_tbutton009, 117, 117, 169);
2735  MObjectSetTransparency(_tbutton009, 0);
2736 
2737  _tbutton010 = MCreateTButton(_tablefrm025, "BrO", HELV_SMALL);
2738  MObjectSetForegroundRGB(_tbutton010, 255, 255, 0);
2739  MObjectSetBackgroundRGB(_tbutton010, 117, 117, 169);
2740  MObjectSetTransparency(_tbutton010, 0);
2741 
2742  _tbutton011 = MCreateTButton(_tablefrm025, "OClO", HELV_SMALL);
2743  MObjectSetForegroundRGB(_tbutton011, 255, 255, 0);
2744  MObjectSetBackgroundRGB(_tbutton011, 117, 117, 169);
2745  MObjectSetTransparency(_tbutton011, 0);
2746 
2747  _tbutton012 = MCreateTButton(_tablefrm025, "SO2", HELV_SMALL);
2748  MObjectSetForegroundRGB(_tbutton012, 255, 255, 0);
2749  MObjectSetBackgroundRGB(_tbutton012, 117, 117, 169);
2750  MObjectSetTransparency(_tbutton012, 0);
2751 
2752  _tbutton013 = MCreateTButton(_tablefrm025, "IO", HELV_SMALL);
2753  MObjectSetForegroundRGB(_tbutton013, 255, 255, 0);
2754  MObjectSetBackgroundRGB(_tbutton013, 117, 117, 169);
2755  MObjectSetTransparency(_tbutton013, 0);
2756 
2757  _tbutton014 = MCreateTButton(_tablefrm025, "O4", HELV_SMALL);
2758  MObjectSetForegroundRGB(_tbutton014, 255, 255, 0);
2759  MObjectSetBackgroundRGB(_tbutton014, 117, 117, 169);
2760  MObjectSetTransparency(_tbutton014, 0);
2761 
2762  _tbutton015 = MCreateTButton(_tablefrm025, "H2CO", HELV_SMALL);
2763  MObjectSetForegroundRGB(_tbutton015, 255, 255, 0);
2764  MObjectSetBackgroundRGB(_tbutton015, 117, 117, 169);
2765  MObjectSetTransparency(_tbutton015, 0);
2766 
2767  _tbutton016 = MCreateTButton(_tablefrm025, "H2O", HELV_SMALL);
2768  MObjectSetForegroundRGB(_tbutton016, 255, 255, 0);
2769  MObjectSetBackgroundRGB(_tbutton016, 117, 117, 169);
2770  MObjectSetTransparency(_tbutton016, 0);
2771 
2772  _tbutton017 = MCreateTButton(_tablefrm025, "Raman", HELV_SMALL);
2773  MObjectSetForegroundRGB(_tbutton017, 255, 255, 0);
2774  MObjectSetBackgroundRGB(_tbutton017, 117, 117, 169);
2775  MObjectSetTransparency(_tbutton017, 0);
2776 
2777  _tbutton018 = MCreateTButton(_tablefrm025, "Polar", HELV_SMALL);
2778  MObjectSetForegroundRGB(_tbutton018, 255, 255, 0);
2779  MObjectSetBackgroundRGB(_tbutton018, 117, 117, 169);
2780  MObjectSetTransparency(_tbutton018, 0);
2781 
2782  _tbutton019 = MCreateTButton(_tablefrm025, "BTX", HELV_SMALL);
2783  MObjectSetForegroundRGB(_tbutton019, 255, 255, 0);
2784  MObjectSetBackgroundRGB(_tbutton019, 117, 117, 169);
2785  MObjectSetTransparency(_tbutton019, 0);
2786 */
2787 
2788  rowfrm = MCreateRowForm(pdoas->WlTabFrm);
2789  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2790  MObjectSetResize(rowfrm, False, False);
2791  MObjectAlign(rowfrm, LEFT_ALIGN, TOP_ALIGN);
2792 
2793 
2794  lbl = MCreateLabel(lbl, "DCS Convolution Method", HELV_SMALL);
2795  MObjectSetForegroundRGB(lbl, 255, 255, 0);
2796  MObjectSetBackgroundRGB(lbl, 120, 177, 218);
2797  MObjectSetTransparency(lbl, 0);
2798  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
2799 
2800  tb = MCreateTableForm(rowfrm, 2);
2801  MObjectSetForegroundRGB(tb, 255, 255, 0);
2802  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2804 
2805  rb = MCreateRButton(tb, "FFT", HELV_SMALL);
2806 
2807  rb = MCreateRButton(tb, "Calc.Function", HELV_SMALL);
2808 
2809  tb = MCreateTableForm(rowfrm, 2);
2810  MObjectSetForegroundRGB(tb, 255, 255, 0);
2811  MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2813 
2814  lbl = MCreateLabel(lbl, "FFT Win.", HELV_SMALL);
2816  MObjectSetResize(lbl, False, False);
2817 /*
2818  _edit000 = MCreateEdit(_tablefrm027, "", 3, FIXED_MEDIUM);
2819  MEditSetFilter(_edit000, 260, "");
2820  MObjectAlign(_edit000, RIGHT_ALIGN, TOP_ALIGN);
2821  MObjectSetForegroundRGB(_edit000, 255, 255, 0);
2822  MObjectSetBackgroundRGB(_edit000, 117, 117, 169);
2823 
2824  rowfrm = MCreateRowForm(pdoas->WlTabFrm);
2825  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2826  MObjectSetResize(rowfrm, False, False);
2827  MObjectAlign(rowfrm, LEFT_ALIGN, TOP_ALIGN);
2828 
2829  _label182 = MCreateLabel(rowfrm, "Filter Raw Data?", HELV_SMALL);
2830  MObjectAlign(_label182, CENTER_ALIGN, TOP_ALIGN);
2831  MObjectSetBackgroundRGB(_label182, 120, 177, 218);
2832  MObjectSetTransparency(_label182, 0);
2833 
2834  _tablefrm028 = MCreateTableForm(rowfrm, 2);
2835  MObjectAlign(_tablefrm028, CENTER_ALIGN, TOP_ALIGN);
2836  MObjectSetBackgroundRGB(_tablefrm028, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2837 
2838  _rbutton008 = MCreateRButton(_tablefrm028, "Yes", HELV_SMALL);
2839 
2840  _rbutton009 = MCreateRButton(_tablefrm028, "No", HELV_SMALL);
2841 
2842  _label183 = MCreateLabel(_tablefrm028, "Filter Win", HELV_SMALL);
2843  MObjectAlign(_label183, LEFT_ALIGN, TOP_ALIGN);
2844  MObjectSetResize(_label183, False, False);
2845 
2846  _edit001 = MCreateEdit(_tablefrm028, "", 3, FIXED_SMALL);
2847  MEditSetFilter(_edit001, 4, "");
2848  MObjectAlign(_edit001, RIGHT_ALIGN, TOP_ALIGN);
2849  MObjectSetForegroundRGB(_edit001, 255, 255, 0);
2850  MObjectSetBackgroundRGB(_edit001, 117, 117, 169);
2851 
2852  _tablefrm029 = MCreateTableForm(rowfrm, 2);
2853  MObjectSetForegroundRGB(_tablefrm029, 255, 255, 0);
2854  MObjectSetBackgroundRGB(_tablefrm029, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2855 
2856  _label184 = MCreateLabel(_tablefrm029, "Win for Dif", HELV_SMALL);
2857 
2858  _edit002 = MCreateEdit(_tablefrm029, "", 3, FIXED_SMALL);
2859  MEditSetFilter(_edit002, 4, "");
2860  MObjectSetForegroundRGB(_edit002, 255, 255, 0);
2861  MObjectSetBackgroundRGB(_edit002, 117, 117, 169);
2862 
2863  rowfrm = MCreateRowForm(pdoas->WlTabFrm);
2864  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2865  MObjectSetResize(rowfrm, False, False);
2866  MObjectAlign(rowfrm, LEFT_ALIGN, TOP_ALIGN);
2867 
2868  _label185 = MCreateLabel(rowfrm, "Spectral Step [A]", HELV_SMALL);
2869  MObjectAlign(_label185, CENTER_ALIGN, TOP_ALIGN);
2870  MObjectSetBackgroundRGB(_label185, 120, 177, 218);
2871  MObjectSetTransparency(_label185, 0);
2872 
2873  _tablefrm030 = MCreateTableForm(rowfrm, 2);
2874  MObjectAlign(_tablefrm030, CENTER_ALIGN, TOP_ALIGN);
2875  MObjectSetBackgroundRGB(_tablefrm030, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2876 
2877  _rbutton010 = MCreateRButton(_tablefrm030, "1", HELV_SMALL);
2878 
2879  _rbutton011 = MCreateRButton(_tablefrm030, "2", HELV_SMALL);
2880 
2881  _rbutton012 = MCreateRButton(_tablefrm030, "3", HELV_SMALL);
2882 
2883  _rbutton013 = MCreateRButton(_tablefrm030, "4", HELV_SMALL);
2884 
2885  _rbutton014 = MCreateRButton(_tablefrm030, "5", HELV_SMALL);
2886 
2887  _rbutton015 = MCreateRButton(_tablefrm030, "10", HELV_SMALL);
2888 */
2889 
2890 }
2891 
2892 
2894 {
2895 
2896  MOBJECT sh, pb, colfrm, rowfrm,lbl;
2897  int i;
2898  char buff[16];
2899 
2900 
2901 
2902 
2903  sh = MCreateShell("DOAS Setup", 0);
2904  MObjectSetBackgroundRGB(sh, 80, 80, 80);
2905  MObjectSetResize(sh, True, True);
2906 
2907  colfrm = MCreateColForm(sh);
2908  MObjectSetBackgroundRGB(colfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2910  MObjectSetResize(colfrm, True, True);
2911 
2912  rowfrm = MCreateRowForm(colfrm);
2913  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2914  MObjectSetResize(rowfrm, False, False);
2916 
2917  lbl = MCreateLabel(rowfrm, "Select the Spectral\nRange to be processed", HELV_SMALL);
2918  MObjectSetForegroundRGB(lbl, 255, 255, 0);
2919  MObjectSetBackgroundRGB(lbl, 120, 177, 218);
2920  MObjectSetTransparency(lbl, 0);
2921  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
2923 
2924 // tb = MCreateTableForm(rowfrm, 2);
2925 // MObjectSetForegroundRGB(tb, 255, 255, 0);
2926 // MObjectSetBackgroundRGB(tb, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2927 
2928  for (i=0; i<(sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0]); i++)
2929  {
2930  itoa(wl[i], buff, 10);
2931  DOAS.WlTogButt[i] = MCreateTButton(rowfrm, buff, HELV_SMALL);
2932  //DOAS.WlTogButt[i] = MCreateTButton(rowfrm, Wl_Code[i], HELV_SMALL);
2933  MObjectSetForegroundRGB(DOAS.WlTogButt[i], 255, 255, 0);
2934 // MObjectSetBackgroundRGB(tbutt, 117, 117, 169);
2935  MObjectSetTransparency(DOAS.WlTogButt[i], 0);
2938  MTButtonSetCallback(DOAS.WlTogButt[i], (OBJ_VALUE_CB) DOASTogButCB, (void *) i);
2939  }
2940 
2941  rowfrm = MCreateRowForm(colfrm);
2942  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2943  MObjectSetResize(rowfrm, True, True);
2944  MObjectAlign(rowfrm, LEFT_ALIGN, TOP_ALIGN);
2945 
2946 
2947  DOAS.WlTabFrm = MCreateTabbedColForm(rowfrm, sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0], FIXED_SMALL);
2948  MObjectSetForegroundRGB(DOAS.WlTabFrm, 255, 255, 255);
2949  MObjectSetBackgroundRGB(DOAS.WlTabFrm, 96, 132, 152);
2953 
2954 
2955  for (i=0; i<(sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0]); i++)
2956  {
2958  itoa(wl[i], buff, 10);
2959  //MObjectSetText(DOAS.WlTabFrm, Wl_Code[i]);
2960  MObjectSetText(DOAS.WlTabFrm, buff);
2961  MObjectSetBackgroundRGB(DOAS.WlTabFrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2962 
2963 
2964  DOAS_SetupPagedForm(i, &DOAS);
2965 
2966  }
2967  /* Start Activation and creation of page 0 0000000000000*/
2968  /* 00000000000000000000000000000000000000000000000000000000*/
2969 
2970 
2971 
2972 
2973  colfrm = MCreateColForm(sh);
2974  MObjectSetBackgroundRGB(colfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2975  MObjectAlign(colfrm, LEFT_ALIGN, TOP_ALIGN);
2976 
2977  pb = MCreatePButton(colfrm, "Apply", HELV_SMALL);
2978  MObjectSetForegroundRGB(pb, 255, 255, 0);
2979  MObjectSetBackgroundRGB(pb, 124, 173, 71);
2980 
2981  pb = MCreatePButton(colfrm, "Store", HELV_SMALL);
2982  MObjectSetForegroundRGB(pb, 255, 255, 0);
2983  MObjectSetBackgroundRGB(pb, 124, 173, 71);
2984 
2985  pb = MCreatePButton(colfrm, "Cancel", HELV_SMALL);
2986  MPButtonSetCallback(pb, CloseMObjCB, (void *) sh);
2987  MObjectSetForegroundRGB(pb, 255, 255, 0);
2988  MObjectSetBackgroundRGB(pb, 124, 173, 71);
2989 
2990 
2991  return sh;
2992 }
MOBJECT WlTabFrm
Definition: DOASdef.h:46
void MEditDisableEditing(MOBJECT edit)
short DB_BG_lblUP[3]
Background Capital Letters Labels Color UP.
const char * rename_menu
Definition: Mguidefs.h:1513
#define RIGHT_ALIGN
Definition: Mguidefs.h:916
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
MOBJECT rb[10]
Definition: DOASdef.h:62
#define WS_NONE
Definition: Mguidefs.h:956
MOBJECT MCreateTButton(MOBJECT parent, const char *text, MTFont font)
char RISDIR[_MAX_PATH]
DOAS results directory.
Definition: DOASdef.h:34
const char * create_menu
Definition: Mguidefs.h:1511
MOBJECT menubar
Definition: DOAS_FullProj.c:59
void LinkSpectraCB(MOBJECT p, void *od, void *ad)
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
void HlpTopCB(MOBJECT p, void *od, void *ad)
MOBJECT lbl
Definition: DFileMan.c:42
MOBJECT pb[2]
Definition: DOASdef.h:63
const char * remove_menu
Definition: Mguidefs.h:1515
MOBJECT MDCreateDOAS_ProcSh(void)
#define WS_SHADOW_IN
Definition: Mguidefs.h:958
Definition: DOASdef.h:16
const char * close_button
Definition: Mguidefs.h:1509
void D_PrintBILSPH_BIN(int fd)
Print on file the binary header of the measured spectrum.
Definition: Utils.c:540
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
void MLoopWhileEvents(int discard)
MOBJECT MOptionEditGetList(MOBJECT ce)
int CreateList(MOBJECT ed)
void MMenuBarSetAcc(MOBJECT menu, int acc)
MOBJECT ColFor_Sh
Definition: DOAS_FullProj.c:57
INT32 MVALUE
Definition: Mguidefs.h:1422
#define BFILE
Definition: DOASdef.h:4
#define C_A
Definition: KEYCODES.H:283
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MShellRealize(MOBJECT obj)
void D_VRange(char *str, int val, int, int g, int b)
Create and display the status bar.
Definition: Utils.c:206
#define C_H
Definition: KEYCODES.H:290
char SYSDIR[_MAX_PATH]
DOAS system directory.
Definition: DOASdef.h:33
#define SBNAME
Definition: DOASdef.h:9
MTFont font
Definition: DOASdef.h:43
CARD8 change_cwd
Definition: Mguidefs.h:1485
MOBJECT MCreateEdit(MOBJECT parent, const char *text, int len, MTFont font)
MOBJECT lblx[80]
Definition: DOASdef.h:36
#define O_BINARY
Definition: Dildef.h:201
void MObjectSetUnsensitive(MOBJECT obj)
MOBJECT lblsys
Definition: DOAS_FullProj.c:66
MOBJECT lbly[80]
Definition: DOASdef.h:37
void RBFormatCB(MOBJECT p, void *od, void *ad)
#define SBTYPE
Definition: DOASdef.h:12
void ViewCB(MOBJECT p, void *od, void *ad)
das structure (contain all the previous structures) .
CARD8 allow_dir_create
Definition: Mguidefs.h:1487
void(* MENU_ITEM_CB)(MENU_ITEM item, MVALUE status, void *ad)
Definition: Mguidefs.h:1468
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
MENU_ITEM MMenuAddItem(MOBJECT pd, const char *item, MENU_ITEM_CB cb, void *ad)
Control Panel and push buttons colors .
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
void SunCalcCB(MOBJECT p, void *od, void *ad)
MOBJECT DOAS_ProcSh
Definition: DOAS_FullProj.c:63
MTFont button_font
Definition: Mguidefs.h:1501
CARD8 allow_dir_delete
Definition: Mguidefs.h:1493
#define F10
Definition: KEYCODES.H:346
void MMainLoop(void)
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
MOBJECT tb[6]
Definition: DOASdef.h:64
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
MTFont font
Definition: Mguidefs.h:1499
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
MOBJECT WlTogButt[21]
Definition: DOASdef.h:44
void * MENU_ITEM
Definition: Mguidefs.h:1418
void ActEditCB(MOBJECT edit, char *text, void *ed)
Text Application callback Apply to the variables the text typed in various text box and validated by ...
MOBJECT MCreateSubMenu(MENU_ITEM item)
#define PLOTRES
Definition: DOASdef.h:74
void MTableFormSetColAlign(MOBJECT form, int col, int al)
char DATADIRECTORY[_MAX_PATH]
Definition: bildef.h:201
#define C_T
Definition: KEYCODES.H:302
#define C_X
Definition: KEYCODES.H:306
Definition: Dildef.h:423
#define BDRIVE
Definition: DOASdef.h:7
char * MObjectGetText(MOBJECT obj, char *text)
int edit
Definition: DOASdef.h:56
MOBJECT MCreateClippedEdit(MOBJECT parent, const char *text, int len, int clip_len, MTFont font)
MOBJECT lblpass
Definition: DOASdef.h:61
void ColumnFCB(MOBJECT p, void *od, void *ad)
void MObjectSetPopupHelp(MOBJECT obj, const char *str, int delay, int duration)
void ReadIMG(FILE *file, unsigned short *mat, int hp, int vp)
Read ASCII Image (Spectral Data only) .
Definition: Spat_Plot.c:1206
MOBJECT MCreateOptionEdit(MOBJECT parent, const char *text, int len, int clip_len, int nrow, MTFont font)
void MShellUnrealize(MOBJECT obj)
#define UNDEF_ALIGN
Definition: Mguidefs.h:920
#define PLOTIOIS_S
Definition: DOASdef.h:76
#define TIMES_SMALL
Definition: Mguidefs.h:883
void MObjectSetText(MOBJECT obj, const char *text)
void ChangeFormatCB(MOBJECT p, void *od, void *ad)
MOBJECT edtwf
static double ch
Definition: SOLPOS.C:120
void DOASTogButCB(MOBJECT p, MVALUE od, void *ad)
short DB_BG_RButt[3]
Background Radio Buttons.
#define BFILELIST
Definition: DOASdef.h:5
#define PLOTSLANT_S
Definition: DOASdef.h:79
MOBJECT lblris
Definition: DOAS_FullProj.c:66
MOBJECT shell
Definition: DOASdef.h:66
void MShellDestroy(MOBJECT obj)
MOBJECT MDCreateBuildList_Sh(int mod)
int MRButtonGetActivationStatus(MOBJECT o)
MOBJECT menu
Definition: DOAS_FullProj.c:60
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
Control Flags.
listf LISTF
Definition: DOAS_FullProj.c:45
MOBJECT ed
Definition: DOASdef.h:67
File Browser Preferences. Used by the Utility functions MFileBowserExt() and MDirBowserExt().
Definition: Mguidefs.h:1482
MOBJECT rowfrm
Definition: DOASdef.h:65
void IoCreateCB(MOBJECT p, void *od, void *ad)
Definition: DOAS_FullProj.c:90
int fbold
Definition: DOASdef.h:40
int subdir
Definition: DOASdef.h:59
#define C_B
Definition: KEYCODES.H:284
void MTButtonSetCallback(MOBJECT button, OBJ_VALUE_CB cb, void *data)
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
const char * ok_button
Definition: Mguidefs.h:1507
int ReadHeader_ASCII(int mod, FILE *fd)
Read ASCII Header of the measurement. .
Definition: Spat_Plot.c:1877
doas DOAS
Definition: DOAS_FullProj.c:44
CARD8 transparent_tree
Definition: Mguidefs.h:1495
d_fileman DFILEM
Definition: bildef.h:257
int WriteDataFile(int c, char *filed)
void MGUITerm(void)
#define PLOTSLANT
Definition: DOASdef.h:75
#define CENTER_ALIGN
Definition: Mguidefs.h:917
MOBJECT MDCreateDOAS_SetupSh(void)
void MObjectSetFGColorFromParent(MOBJECT obj, int true_false)
#define PLOTVARY_S
Definition: DOASdef.h:77
void ReadLine(char *buf, int nc, FILE *f)
Read Line on a file Read one record of nc character on the file f.
Definition: Load.c:72
unsigned short * ImatOrig
Definition: bildef.h:180
void LoadIoCB(MOBJECT p, void *od, void *ad)
int fsize
Definition: DOASdef.h:42
d_view DPLOT
Definition: bildef.h:254
void ExitCB(MOBJECT p, void *od, void *ad)
Definition: DOAS_FullProj.c:80
#define C_S
Definition: KEYCODES.H:301
void FixStepCB(MOBJECT p, void *od, void *ad)
#define HELV_SMALL
Definition: Mguidefs.h:881
void AboutCB(MOBJECT o, void *s, void *v)
Create the About information shell. .
Definition: About.c:39
void DOAS_SetupPagedForm(int c, struct doas *pdoas)
MOBJECT MDCreateDiff_Sh(int mod)
void MEditSetActCallback(MOBJECT edit, OBJ_STRING_CB cb, void *data)
#define FIXED_SMALL
Definition: Mguidefs.h:878
MOBJECT MCreateTabbedColForm(MOBJECT parent, int npage, MTFont f)
int ViewPlot(int mod)
Create the plot shell. Procedure that build the plot shell for the data visualization.
Definition: Spat_Plot.c:3775
unsigned short * DeallocUSMat(unsigned short *mat)
Definition: Spat_Plot.c:145
int DatOrBinFormat(int mod, char *dir, char *filename)
const char * MGetCurrentDirectory(void)
MOBJECT Wl[18]
Wavelength Buttons.
void DiffCB(MOBJECT p, void *od, void *ad)
MTFont MLoadFont(const char *family, int h, int bold, int italic)
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
void CloseMObjCB(MOBJECT p, void *od, void *ad)
MENU_ITEM id_menu
Definition: DOAS_FullProj.h:11
MOBJECT MDCreateFixed_Sh(int mod)
void ValidateCB(MOBJECT edit, EDIT_VAL *ev, void *ii)
Text Validation callback Validation callback for the text typed in different text box...
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
void MEditSetValCallback(MOBJECT edit, EDIT_VAL_CB cb, void *data)
void MRButtonActivate(MOBJECT o)
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
void MPButtonSetAlignment(MOBJECT p, int align)
int EleDatOrBinFormat(int c, char *dirname, char *fname)
int ReadHeader_BIN(int fd)
read the BINARY header of the stored spectrum
Definition: Spat_Plot.c:1798
const char * file_label
Definition: Mguidefs.h:1505
MOBJECT MCreateDrawArea(MOBJECT parent, int width, int height)
MOBJECT MCreateColForm(MOBJECT parent)
int MFileBrowseExt(const char *t, const char *ext, char *fname, char *dname, FB_PREFS *prefs)
void ReadIMG_BIN(int fd, unsigned short *mat, int hp, int vp)
read the BINARY stored spectrum
Definition: Spat_Plot.c:1166
void MLeftAttach(MOBJECT child, int att_type, int off, MOBJECT obj)
void MObjectRedraw(MOBJECT obj)
#define C_E
Definition: KEYCODES.H:287
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
#define BDIR
Definition: DOASdef.h:6
#define SBDIM
Definition: DOASdef.h:11
pushbutt PushButt
Push buttons.
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
void MShellRealizeXY(MOBJECT obj, int x, int y)
Function prototypes.
void CreateFileListCB(MOBJECT p, void *od, void *ad)
#define C_L
Definition: KEYCODES.H:294
void VitesaCB(MOBJECT p, void *od, void *ad)
const char * bg_image_file
Definition: Mguidefs.h:1519
int MDirBrowseExt(const char *t, const char *ext, char *dname, FB_PREFS *prefs)
int DT_ColFormat(void)
Callback for Column format.
Definition: Utils.c:431
#define _MAX_PATH
Definition: Dildef.h:202
int FFTFilter
Fast Fourier Trasform Filter windows.
Definition: DOASdef.h:25
MOBJECT MCreateShell(const char *title, int flags)
void D_PrintBILSPH(FILE *fff)
Print Header.
Definition: Utils.c:581
void ShStCB(MOBJECT p, void *od, void *ad)
int FlagFilter
flag for filterinf
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int DB_CalcFluxI(char *nomefile)
Definition: Utils.c:328
void ResumeCB(MOBJECT p, void *od, void *ad)
short DB_BG[3]
Default Background Color.
void FixedStepCB(MOBJECT p, void *od, void *ad)
MOBJECT MCreateRButton(MOBJECT parent, const char *text, MTFont font)
void MObjectUnmap(MOBJECT obj)
Definition: DOASdef.h:54
short DB_FG_RButt[3]
Foreground Radio Buttons.
int DB_HelpCB(MOBJECT o, void *od, void *ad)
Help Callback Create the help in the predefined WEB Browser.
Definition: DAS_Spat.c:881
void BuildListCB(MOBJECT p, void *od, void *ad)
int sortmode
Definition: DOASdef.h:57
Function prototypes.
#define C_C
Definition: KEYCODES.H:285
void LoadIo(int mod, char *fname)
Definition: Spat_Plot.c:2678
void MSListSetSortCallback(MOBJECT obj, STRCMP_CB cb)
void FluxIndexCB(MOBJECT p, void *od, void *ad)
MOBJECT submenu
Definition: DOAS_FullProj.c:61
void MTableFormShowGrid(MOBJECT form)
void DOASSetupCB(MOBJECT p, void *od, void *ad)
Definition: DOAS_FullProj.c:94
static double p
Definition: SOLPOS.C:131
void RBEditListCB(MOBJECT p, void *od, void *ad)
void EditorCB(MOBJECT p, void *od, void *ad)
MOBJECT MCreateImagePButton(MOBJECT parent, const char *npf, const char *apf, const char *upf)
MIMAGE bg_image
Definition: Mguidefs.h:1517
palette DPAL
Definition: DOAS_FullProj.c:36
int DOAS_LoadConfig(struct doas *pdoas)
C_DEF void VRange(char *str, int val)
void MTableFormSetRowAlign(MOBJECT form, int row, int al)
MOBJECT DOAS_MainSh
Definition: DOAS_FullProj.c:58
#define C_R
Definition: KEYCODES.H:300
void(* OBJ_VALUE_CB)(MOBJECT obj, MVALUE value, void *ad)
Definition: Mguidefs.h:1458
#define PLOTIOIS
Definition: DOASdef.h:72
int LoadDB_DispCoeff(void)
Load dispersion parameters. Procedure that load the dispersion parameters from file {homedir}/DOAS/Di...
Definition: Load.c:234
void MEditSetFilter(MOBJECT edit, int filter, const char *extra_chars)
void MLabelSetAlignment(MOBJECT p, int align)
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
MOBJECT tb1
Definition: DFileMan.c:41
#define F_ATT_FORM
Definition: Mguidefs.h:1107
MOBJECT DOAS_SetupSh
Definition: DOAS_FullProj.c:64
int fwstatus
Bortul Image Library Structure .
Definition: bildef.h:250
MOBJECT SolPosCalc
Definition: DOAS_FullProj.c:65
int LoadParam(void)
Load the exe parameters. Procedure that load the parameters for CCD, Stepper Motors and Peltier from ...
Definition: Load.c:1215
void MPagedFormSetActivePage(MOBJECT form, int page)
#define C_U
Definition: KEYCODES.H:303
MOBJECT lbl[5]
Definition: DOASdef.h:60
void MFormSetSpacing(MOBJECT p, int offset)
MENU_ITEM id_item
Definition: DOAS_FullProj.h:19
void DOASConfigCB(MOBJECT p, void *od, void *ad)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
#define PLOTRES_S
Definition: DOASdef.h:78
void DOASProcCB(MOBJECT p, void *od, void *ad)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
short DB_UnSelFG[3]
Unselected Buttons Colors.
#define F_ATT_OBJ
Definition: Mguidefs.h:1108
MOBJECT MDCreateFormat_Sh(int mod)
void DOAS_Plot(int mod, int plottype, MOBJECT obj, char *text, struct doas *pdoas)
das DAS
Definition: DOAS_FullProj.c:47
MOBJECT MDCreatesh_vitesa(void)
Definition: ViTES_1.c:295
const char * filter_label
Definition: Mguidefs.h:1503
#define C_P
Definition: KEYCODES.H:298
MOBJECT MDCreateDOAS_MainSh(struct doas *pdoas)
DOAS shell. Procedure that build the shell for the DOAS main panels.
void FilterCB(MOBJECT p, void *od, void *ad)
MOBJECT MDCreateSolPosCalc(void)
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
#define BOTTOM_ALIGN
Definition: Mguidefs.h:919
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
void ChooseFormatCB(MOBJECT p, void *od, void *ad)
int MSListAddItem(MOBJECT p, const char *item, void *data)
int fitalic
Definition: DOASdef.h:41
int MTButtonGetActivationStatus(MOBJECT o)
#define C_D
Definition: KEYCODES.H:286
void MButtonSetOnMouseOverForegroundRGB(MOBJECT button, int r, int g, int b)
void MObjectMap(MOBJECT obj)
MOBJECT MCreateMenuBar(MOBJECT parent, MTFont font)
void BrowseCB(MOBJECT p, void *od, void *ad)
CARD8 allow_dir_rename
Definition: Mguidefs.h:1490
MENU_ITEM MMenuAddSeparator(MOBJECT pd)
#define HELV_MEDIUM
Definition: Mguidefs.h:882
void PlotDOAS(MOBJECT obj)
flag FLAG
Definition: DOAS_FullProj.c:37
void D_SunCalc(void)
Sun Calculator Callback.
void MGUIQuitCB(MOBJECT shell, void *od, void *ad)
Exit MGUI Library. Procedure that close MGUI .
Definition: DAS_Spat.c:728
unsigned short * AllocUSMat(int hp, int vp)
Definition: Spat_Plot.c:1994
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
int type
Definition: DOASdef.h:58
MOBJECT MDCreateColFor_Sh(void)
MOBJECT lblwf
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void FilterRawDataCB(MOBJECT p, void *od, void *ad)
MOBJECT drwa[8]
Definition: DOASdef.h:38
void MMenuItemSetAccel(MENU_ITEM item, int acc, const char *at)
int FMMode
File manager Mode (browse files, list of file, directory, drive)
Definition: DOASdef.h:35
MOBJECT MCreateRowForm(MOBJECT parent)
void PBTempHistoCB(MOBJECT o, void *a, void *v)
#define SBDATE
Definition: DOASdef.h:10
tools TOOLS
Definition: CreateForms.c:81
void PlotDOAS_Spectra(int mod, MOBJECT obj, unsigned short plotmat[], int idx, int idy, double costx, double costy, int min, int max, int ox, int oy)
void MEditEnableAutoControlColor(MOBJECT edit)
void MTopAttach(MOBJECT child, int att_type, int off, MOBJECT obj)
#define TOP_ALIGN
Definition: Mguidefs.h:918
MOBJECT MCreateTabbedRowForm(MOBJECT parent, int npage, MTFont f)
#define PLOTVARY
Definition: DOASdef.h:73
void IoSetupCB(MOBJECT p, void *od, void *ad)
Definition: DOAS_FullProj.c:86
char family[32]
Definition: DOASdef.h:39
#define C_W
Definition: KEYCODES.H:305
bil BIL
Definition: DOAS_FullProj.c:42
MOBJECT MCreateMenu(MOBJECT menu, const char *text)
void RBListFileCB(MOBJECT p, void *od, void *ad)
void DB_FilterColumnCB(MOBJECT p, void *od, void *ad)
short DB_FG_lblUP[3]
Foreground Capital Letters Labels Color UP.
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
void ColumnFormatCB(MOBJECT p, void *od, void *ad)
int WriteDOASConfig(void)
______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:44:08 for DAS - Rel. 3.1.6 - 18/09/2017.