DAS  3.1.6 - 18/09/2017
Functions | Variables
DAS_Spat.c File Reference

DAS main file. More...

#include <windows.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winioctl.h>
#include <direct.h>
#include <io.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "mgui.h"
#include "DAS_Spatram.h"
#include "dcl.h"
#include "dil.h"
#include "dscud.h"
#include "wsc.h"
#include "dxl.h"
#include "solpos.h"
#include "bil.h"
#include "DOAS.h"
#include "nrutil.h"
#include "Marq.h"
#include "portio32.h"
#include "ISMMDLL.h"
#include "wdt.h"
+ Include dependency graph for DAS_Spat.c:

Go to the source code of this file.

Functions

void AMSINI_Err (int c)
 
void BuildMainShell (void)
 
void BuildShell (int emode, char **argum)
 
int ChkConfigInstance (void)
 
void ChkDASInstance (int etype)
 
void ChkExeMode (int mod, char **p)
 
int ChkMaster (int mod)
 
int ChkWinInstance (char *buff, MOBJECT obj)
 
int D_Timing (int id, long tout)
 
int DB_HelpCB (MOBJECT o, void *od, void *ad)
 Help Callback
Create the help in the predefined WEB Browser. More...
 
int DB_InfCB (MOBJECT o, void *od, void *ad)
 Inf Callback
Create the Inf shell. More...
 
void DB_SelButt_CB (MOBJECT obj, MKeyEvent *pe, void *a_data)
 
void DemoInitMotor (void)
 
int ExMaster (int m, int mode)
 
int Fetch ()
 Reads the key-word in PRG Files
. More...
 
int InitCCD_AMS (int mod, int emode)
 
void InitColors (void)
 
void InitDefaultOptions (void)
 
void InitFlags (void)
 
int InitTempAD (int mod)
 
void LaunchBackTask (void)
 Launch the DAS Background tasks Common Tasks launched when the DAS MAIN Graphic User Interface is loaded: More...
 
int LoadAMS (void)
 
void LoadSetDirs (void)
 
int LoadWlstep (void)
 load the file of the wavelength vs steps More...
 
void ManualModeCB (MOBJECT p, void *od, void *ad)
 
void MDCreateSplashExe ()
 
void MDCreateWaitShell (void)
 Create a waiting window . More...
 
void MGUIMain (int argc, char **argv)
 MAIN PROGRAM starting point
Actions:
. More...
 
void MGUIQuitCB (MOBJECT shell, void *od, void *ad)
 Exit MGUI Library. Procedure that close MGUI . More...
 
int NOVA_In (int novatype, unsigned int DigIn)
 Read the NOVA Input port. More...
 
int NOVA_Out (int novatype, unsigned int out)
 Write the NOVA Output port. More...
 
void NoWaitCB (MOBJECT p, void *od, void *ad)
 
void NoWaitSplashCB (MOBJECT p, void *od, void *ad)
 
int PRG_Check (int mod, char *prgname)
 
int PRG_ChKBegin (int line, char *fname)
 
int PRG_ChkGrating (int mod, char *filename, int record, int par)
 
int PRG_ChkKeyW (int line, char *fname)
 
int PRG_ChkMeasAvg (int line, char *fname)
 
int PRG_ChkMirror (int mod, char *filename, int record, int par)
 
void RunFULL (void)
 DAS Main LOOP for Equipment management
This Procedure is called by the MGUIMain function when the execution mode is:
. More...
 
void RunLogMode (int mod, char *p)
 
void RunOLP (char *fname)
 
void SetScriptUseLabel (int master, char *prgf, int emode, MOBJECT lbl)
 
int SetWorkDirMGUIenv (char *buff)
 set DAS and MGUI enviroment when the program is launched undirectly (for offlineplot or log or auto or autotimed modes) More...
 
void SZA_FindMin ()
 computation of daily minimum SZA More...
 
void SZA_FirstCalc (void)
 
void TaskWDT (TIMEOUT_ID id, void *data)
 
void WDT_CB (MOBJECT p, void *od, void *ad)
 
void WDT_func (int mod)
 
void WDT_Task_CB (MOBJECT o, void *od, void *ad)
 
void WDTRefresh (void)
 
void WriteShellTitle (MOBJECT o, int eqt)
 

Variables

long AbsFilePos
 Absolute File position. More...
 
AzimuthSt AST
 
bil BIL
 
int BlindPix = 0
 Number of blind pixels (usefull for Dark Current) More...
 
int CCD_SetupFlg = 0
 
config Cfg
 Camera controls & Options. More...
 
int ContFP = 0
 Counter for File position. More...
 
unsigned long countsopsh
 counting the number of opening shutter More...
 
das DAS
 
int DAS_StartDOY
 
int DAS_StartHour
 
ccd DC_CCD
 CCD settings. More...
 
ptf DC_HP
 Platform settings. More...
 
int DeltaTPrec
 
const char * DeviceTypeInput [] = {{"Direct"}, {"TelesExtLamp"}, {"Calib Lamps"}, {"Alt-Az Platf"}, {"Radiometer"}, {"TelesIntLamp"}, {"TelescopeV"}, {""}}
 const char array for the Device type <-> Input association More...
 
d_geo DGEO
 geographical coordinates structure More...
 
dil DIL
 
dlog DLOG
 
doas DOAS
 
palette DPAL
 
dpwd DPWD
 Danbo Passw. More...
 
DSCB dscb
 
DSCCB dsccb
 
int ExeREM = 1
 
master ExMast [PRGMAXNUM]
 
char * Fil_Code [] = {{"NULL"}, {"UG11"}, {"UG1 "}, {"BG12"}, {"BG25"}, {"H475"}}
 const char array for the realisation of the Filters buttons in the Filter shell More...
 
char * Fil_Code8H [] = {{"NULL"}, {"UG5"}, {"UG11"}, {"BG23"}, {"NULL"}, {"NULL"}, {"LPAS"}, {"NULL"}}
 const char array for the realisation of the Filters buttons in the Filter shell More...
 
char * Fil_CodeNG [] = {{"NULL"}, {"B12 "}, {"B12F"}, {"B39 "}, {"B39F"}, {"UG5 "}}
 const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3 instruments More...
 
char * Fil_CodeNG1 [] = {{"NULL"}, {"B12 "}, {"S400"}, {"B39 "}, {"S500"}, {"UG5 "}}
 const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrument More...
 
char * Fil_CodeTropo [] = {{"NULL"}, {"BG28"}, {"UG11"}, {"BG12"}, {"BG23"}, {"HPas"}}
 const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrument More...
 
int FirstTime = 1
 
int FlgSM_Stop = 1
 Steppers Motor Activity: 0 = Motors moving; 1 = Motors stopped. More...
 
FilterWheelSt FWS
 Filter Wheel. More...
 
GratingSt GRS
 Grating. More...
 
char * HomePosition [] = {{"H_Mir"}, {"H_Grat"}, {"H_Filt"}, {"H_NDFilt"}, {"H_Zen"}, {"H_Azi"}, {"Close"}}
 const char array for the realisation of the Filters buttons in the ND Filter shell More...
 
ids IDS
 ID tasks. More...
 
int IDX
 Number of sensible horizontal pixels. More...
 
int IDY
 Number of sensible vertical pixels. More...
 
int Incr_Read_Temp =0
 
const char * KeyCode []
 
unsigned int LevelDefPix = 100
 
int MainCommand =0
 Command switch in main loop. More...
 
int Master = 0
 
unsigned int * mattempbuff
 
const char * Mir_Code [] = {{"Zenith "}, {"HorizDX"}, {"Calibra"}, {"HorizSX"}, {""}, {""}, {""}, {""}}
 const char array for the realisation of the Mirrors buttons in the Mirror shell More...
 
const char * Mir_CodeTropo [] = {{"Calibra "}, {"HorizDX"}, {"NULL "}, {"HorizSX"}, {""}, {""}, {""}, {""}}
 const char array for the realisation of the Mirrors buttons in the Mirror shell for TROPOGAS More...
 
MirrorSt MIS
 Mirror. More...
 
int Mode
 
mtcl MTCL
 MTColor. More...
 
int N_AVG = 25
 Number of measurements for Averaging mode in fixed number of meas. mode. More...
 
int N_RM = 0
 Number of measurements for Averaging mode in fixed exposure time mode. More...
 
char * NDFil_Code [] = {{"NULL"}, {"ND1"}, {"ND2"}, {"ND3"}, {"ND4"}, {"H645"}}
 const char array for the realisation of the Filters buttons in the ND Filter shell More...
 
NDFilterWheelSt NDFWS
 ND Filter Wheel. More...
 
nova NOVA
 
int nowait = 1
 
int nowaitsplash = 1
 
omutemp OMUTEMP
 structure for OMU temperatures More...
 
omuthr OMUTHR
 
int on = 0
 PRG execution control variabile. More...
 
int ON_OFFLINEPLOT = 0
 
int PaletteMode
 
unsigned long * PLColor [] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 
long PrgCnt
 Counter for the position in the PRG file. More...
 
char PrgFile [_MAX_PATH]
 Name of the PRG file. More...
 
int PrgNum = 0
 
int PrgNumExe = 0
 number of PRG file in execution More...
 
int PrgNumInM = 0
 Actual number of PRG File in current MASTER or MASTERSZA File. More...
 
long PrgSiz
 Size of the PRG file. More...
 
char * Program
 buffer for the PRG file More...
 
long REL_FILE_POS [51]
 relative File position More...
 
int Server = 0
 
stepm STEPM
 Stepper Motors. More...
 
dsza SZADelta
 
int SZAMax = 100
 Maximum SZA for performing measurements. More...
 
double TExp
 CCD Exposure time. More...
 
tools TOOLS
 tools structure More...
 
long Total_Spec
 
int TOTTEXP = 5
 Total Exposure time in Averaging mode. More...
 
long wav []
 Step Number definition - for SD_Grating. More...
 
int WDT_flagstop
 
unsigned char WDT_Timeout = 100
 
int wl []
 WaveLength definition - for SD_Grating. More...
 
int WlSet
 Wavelength position definition - for SD_Grating. More...
 
ZenithSt ZST
 

Detailed Description

DAS main file.

Author
Daniele Bortoli

Definition in file DAS_Spat.c.

Function Documentation

§ AMSINI_Err()

void AMSINI_Err ( int  c)

Definition at line 2573 of file DAS_Spat.c.

References _MAX_PATH, d_fileman::CONFIGDIREQUIPMENT, D_WriteInitLog(), bil::DFILEM, and MMessageDialog().

Referenced by SZA_FirstCalc().

2574 {
2575  char buf[512];
2576  char str[_MAX_PATH];
2577 
2578  switch (c)
2579  {
2580  case 1:
2581  sprintf(str,"File %s\\AMS.ini not found,\nThe program will be closed.\n ", BIL.DFILEM.CONFIGDIREQUIPMENT);
2582  MMessageDialog ("DAS ERROR ", str, "OK",NULL);
2583  sprintf(buf,"File 'AMS.INI' not found");
2584  D_WriteInitLog(buf);
2585  exit(0);
2586  break;
2587  case 2:
2588  MMessageDialog ("DAS ERROR ", "Error in reading the AMS Power in file '.\\Config\\AMS.INI',\n\
2589 The program will be closed.\n ", "OK",NULL);
2590  sprintf(buf,"Bad AMS Power read");
2591  D_WriteInitLog(buf);
2592  exit(0);
2593  break;
2594  }
2595 }
bil BIL
Definition: DAS_Spat.c:74
d_fileman DFILEM
Definition: bildef.h:257
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int D_WriteInitLog(char *str)
writes devices errors(AMS, CCD...) on the Devices.log file.
Definition: Save.c:144
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ BuildMainShell()

void BuildMainShell ( void  )

Definition at line 2597 of file DAS_Spat.c.

References DB_SelButt_CB(), EM_KEY_PRESS, das::Gui, MDCreate_CP(), MGetScreenHeight(), MGetScreenWidth(), MObjectAddEventNotifyCallback(), MObjectGetHeight(), MObjectGetWidth(), MShellRealizeXY(), shells::Sh_Main, and gui::Shells.

Referenced by SZA_FirstCalc().

2598 {
2599  int WSc, WSh,HSc, HSh;
2600 
2602  WSc = MGetScreenWidth();
2603  HSc = MGetScreenHeight();
2604  MShellRealizeXY( DAS.Gui.Shells.Sh_Main, (WSc-901)/2, 0);
2608 
2609 }
gui Gui
Graphic User Interface Structure.
shells Shells
Shells structure.
int MObjectGetHeight(MOBJECT obj)
MOBJECT Sh_Main
Main shell for control panel.
MOBJECT MDCreate_CP(void)
Create Spectrometer Control Panel. Procedure that build the Control Panel for checking the spectromet...
Definition: CreateForms.c:1143
int MObjectGetWidth(MOBJECT obj)
#define EM_KEY_PRESS
Definition: Mguidefs.h:316
void(* OBJ_EVENT_CB)(MOBJECT obj, MEvent *e, void *ad)
Definition: Mguidefs.h:1456
void MObjectAddEventNotifyCallback(MOBJECT obj, OBJ_EVENT_CB cb, CARD32 event_mask, void *a_data)
void MShellRealizeXY(MOBJECT obj, int x, int y)
das DAS
Definition: DAS_Spat.c:85
void DB_SelButt_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
Definition: DAS_Spat.c:858
int MGetScreenWidth(void)
int MGetScreenHeight(void)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ BuildShell()

void BuildShell ( int  emode,
char **  argum 
)

Definition at line 3516 of file DAS_Spat.c.

References DB_HelpCB(), DOASMODE, HELP, LOGMODE, MDCreateDOAS_MainSh(), OFFLINEPLOT, RunFULL(), RunLogMode(), and RunOLP().

Referenced by MGUIMain().

3517 {
3518 
3519  int c = emode;
3520  int er = 0;
3521  switch (c)
3522  {
3523  case OFFLINEPLOT:
3524  if(argum[2] != 0)
3525  RunOLP(argum[2]);
3526  else
3527  RunOLP(NULL);
3528  break;
3529  case HELP:
3530  er = DB_HelpCB(NULL, NULL, NULL);
3531  break;
3532  case DOASMODE:
3534  break;
3535  case LOGMODE:
3536  RunLogMode(0, argum[1]);
3537  break;
3538  default:
3539  RunFULL();
3540  break;
3541  }
3542 
3543 }
#define DOASMODE
execution for DOAS Processing
#define HELP
Help mode.
doas DOAS
Definition: DAS_Spat.c:63
#define LOGMODE
execution for LOG View
#define OFFLINEPLOT
execution for archived data visualisation
void RunFULL(void)
DAS Main LOOP for Equipment management This Procedure is called by the MGUIMain function when the exe...
Definition: DAS_Spat.c:2994
int DB_HelpCB(MOBJECT o, void *od, void *ad)
Help Callback Create the help in the predefined WEB Browser.
Definition: DAS_Spat.c:881
MOBJECT MDCreateDOAS_MainSh(struct doas *pdoas)
DOAS shell. Procedure that build the shell for the DOAS main panels.
void RunOLP(char *fname)
Definition: DAS_Spat.c:3114
void RunLogMode(int mod, char *p)
Definition: DAS_Spat.c:3478
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ChkConfigInstance()

int ChkConfigInstance ( void  )

Definition at line 2128 of file DAS_Spat.c.

References MMessageDialog().

2129 {
2130 
2131  HWND wconfig;
2132  char buff[1024];
2133 
2134  sprintf(buff,"DAS Config");
2135 
2136 
2137  wconfig = FindWindow(NULL, buff);
2138  if(wconfig != NULL)
2139  {
2140  sprintf(buff,"'DAS Config' window is already open!!!!");
2141  MMessageDialog("DAS Info", buff, "OK",NULL);
2142  return 1;
2143 
2144  }
2145  else
2146  return 0;
2147 
2148 
2149 }
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
+ Here is the call graph for this function:

§ ChkDASInstance()

void ChkDASInstance ( int  etype)

Definition at line 2048 of file DAS_Spat.c.

References DASREL, DASREV, DASREVDATE, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, LIS_, MGUITerm(), MMessageDialog(), SPATRAM, SPATRAM2, SPATRAM3, SPATRAMPLUS, and TROPOGAS.

Referenced by SZA_FirstCalc().

2049 {
2050 
2051  HWND das;
2052  char buff[1024], str[32];
2053  int c = etype;
2054 
2055 
2056  switch (c)
2057  {
2058  case TROPOGAS:
2059  sprintf(str,"TROPOGAS");
2060  break;
2061  case SPATRAM:
2062  sprintf(str,"SPATRAM");
2063  break;
2064  case LIS_:
2065  sprintf(str,"LIS");
2066  break;
2067  case SPATRAMPLUS:
2068  sprintf(str,"SPATRAMPLUS");
2069  break;
2070  case GASCODNG1:
2071  sprintf(str,"GASCODNG1");
2072  break;
2073  case GASCODNG2:
2074  sprintf(str,"GASCODNG2");
2075  break;
2076  case GASCODNG3:
2077  sprintf(str,"GASCODNG3");
2078  break;
2079  case GASCODNG4:
2080  sprintf(str,"GASCODNG4");
2081  break;
2082  case SPATRAM3:
2083  sprintf(str,"SPATRAM3");
2084  break;
2085  case SPATRAM2:
2086  sprintf(str,"SPATRAM2");
2087  break;
2088 
2089  default:
2090  sprintf(str,"UNKNOWN");
2091  break;
2092  }
2093 
2094  sprintf(buff,"DAS Release %d.%.1lf (%s) - [Setting for %s]", DASREL, DASREV, DASREVDATE, str);
2095 
2096 
2097  das = FindWindow(NULL, buff);
2098  if(das != NULL)
2099  {
2100  sprintf(buff,"A copy of DAS is already running\nIn this execution mode \
2101 you can't execute more than 1 DAS instance at the same time !!!\n\
2102 Please contact DanBo for more information's \n\n\
2103 If you are Dr. G. Giovanelli please press the GG button\n\n");
2104 
2105 /* sprintf(buff,"A copy of DAS is already running\nIn this execution mode \
2106 you can't execute more than 1 DAS instance at the same time !!!\n\
2107 Please contact DanBo for more information's \n\n\
2108 if you are Dr. G. Giovanelli please press the GG button\n\n");
2109 */
2110  MMessageDialog("DAS Info", buff, "OK","GG",NULL);
2111 
2112 // MMessageDialog("DAS Info", buff, "OK",NULL);
2113 
2114  sprintf(buff,"CAZZO Giorgio ti ho detto N+1 volte che ne puoi \
2115 avviare uno solo alla volta\n\n\
2116 Domina il tuo dito indice!!!\n\n ");
2117  MMessageDialog("DAS Info", buff, "OK",NULL);
2118 
2119  MGUITerm();
2120  exit(0);
2121  }
2122 
2123 
2124 }
#define SPATRAM
SPectrometer for Atmospheric TRAcers Measurements - CGE-UE Portugal.
#define DASREV
DAS Revision Number.
struct das das
das structure (contain all the previous structures) .
#define LIS_
Lampedusa Island Spectrometer - ENEA.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
#define DASREVDATE
DAS Revision Date.
void MGUITerm(void)
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
#define SPATRAM2
SPATRAM2 (with ATX power supply & HiresV)
#define SPATRAMPLUS
As SPATRAM plus AltAzimuth platform.
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
#define SPATRAM3
SPATRAM3.
#define DASREL
DAS Release Number.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ChkExeMode()

void ChkExeMode ( int  mod,
char **  p 
)

Definition at line 3177 of file DAS_Spat.c.

References _MAX_PATH, DBDEMO, DI_FileExist(), DI_FindDirName(), DI_FindDrive(), DOASMODE, env, flag::exemode, das::Flag, HELP, LOGMODE, MANUAL, Master, MDCreateSplashExe(), MGetCurrentDirectory(), MGUITerm(), MMessageDialog(), OFFLINEPLOT, PRG_Check(), PrgFile, PRGFILE, SetWorkDirMGUIenv(), SZAMASTERM, SZAMODE, TEMPORIZED, TESTAD, TESTAMS, TESTCCD, and TESTSZAMODE.

Referenced by MGUIMain().

3178 {
3179 
3180  char buff[_MAX_PATH], str[_MAX_PATH];
3181  int er, l;
3182 
3183  if(mod > 1)
3184  {
3185  if((strcmp(p[1], "MASTER") == 0)) // MASTER
3186  {
3187  Master = 1;
3189 
3190  }
3191  else if ((strcmp(p[1], "MASTERSZA") == 0)) // MASTERSZA
3192  {
3193  Master = 1;
3195  //Effemeridis Computation
3196 
3197  }
3198  else if ((strcmp(p[1], "SZAPRG") == 0)) // SZAPRG
3199  {
3200  Master = 1;
3201  DAS.Flag.exemode = SZAMODE;
3202  }
3203  else if ((strcmp(p[1], "TESTSZAPRG") == 0)) // STESTZAPRG
3204  {
3205  Master = 1;
3207  }
3208 
3209  else if( (strcmp(p[1], "TESTAMS") == 0) | (strcmp(p[1], "testams") == 0)| (strcmp(p[1], "TestAMS") == 0)) //si vogliono testare i motori e i rele'
3210  {
3211  DAS.Flag.exemode = TESTAMS;
3212 
3213  }
3214  else if( (strcmp(p[1], "OFFLINEPLOT") == 0) | (strcmp(p[1], "offlineplot") == 0) )//si vuole utilizzare il PLOT offline
3215  {
3217 
3218 
3219  }
3220  else if( (strcmp(p[1], "TESTCCD") == 0) | (strcmp(p[1], "testccd") == 0) | (strcmp(p[1], "TestCCD") == 0)) //si vuole testare la camera a CCD
3221  {
3222  DAS.Flag.exemode = TESTCCD;
3223 
3224  }
3225  else if( (strcmp(p[1], "TESTAD") == 0) | (strcmp(p[1], "testad") == 0)| (strcmp(p[1], "TestAD") == 0)) //si vuole testare il convAD delle temp
3226  {
3227  DAS.Flag.exemode = TESTAD;
3228 
3229  }
3230  else if( (strcmp(p[1], "?") == 0) | (strcmp(p[1], "help") == 0) | (strcmp(p[1], "HELP") == 0)) // ovvio
3231  {
3232  DAS.Flag.exemode = HELP;
3233 // er = DB_HelpCB(NULL, NULL, NULL);
3234 // if (er)
3235 // exit(0);
3236 
3237  }
3238  else if( (strcmp(p[1], "demo") == 0) | (strcmp(p[1], "DEMO") == 0) | (strcmp(p[1], "Demo") == 0)) // ovvio
3239  {
3240 // FLAG.demo = 1;
3241 // FLAG.testams = 1;
3242 // FLAG.testccd = 1;
3243 // FLAG.plotoffline = 1;
3244  DAS.Flag.exemode = DBDEMO;
3245 
3246 
3247  }
3248  else if( (strcmp(p[1], "DOAS") == 0) | (strcmp(p[1], "doas") == 0)| (strcmp(p[1], "Doas") == 0)) //si vuole testare il convAD delle temp
3249  {
3251 
3252  }
3253 
3254  else
3255  {
3256  //Check if the argument is a valid PRG file or LOG files
3257  sprintf(str,"%s",p[1]);
3258  l = strlen(str);
3259  sprintf(buff,"%s", "xxxx");
3260  strncpy(buff, str+l-4, 4);
3261 
3262  if( (strcmp(buff,".prg") == 0) |(strcmp(buff,".PRG") == 0) |(strcmp(buff,".Prg") == 0) )
3263  {
3264 
3265  if(DI_FileExist(p[1])) // DI_FileExist --> Return: 1 if PATH exist, else return 0
3266  {
3267  strcpy(PrgFile, p[1]);
3268  //Check the syntax of the PRG file
3269  er = PRG_Check(0, PrgFile);
3270 // if er
3271 // //SET Execution Mode
3272  DAS.Flag.exemode = PRGFILE;
3273  }
3274  else
3275  {
3276  sprintf(str, "PRG file:\n'%s'\n not encountred.\n Please check the name of the file\n Now the program will be terminated", p[1]);
3277  MMessageDialog("DAS information", str, " Ok ", NULL);
3278  MGUITerm();
3279  exit(0);
3280  }
3281 
3282  }
3283  else if( (strcmp(buff,".log") == 0) |(strcmp(buff,".LOG") == 0) |(strcmp(buff,".Log") == 0) )
3284  {
3285 
3286  DAS.Flag.exemode = LOGMODE;
3287 
3288 
3289  }
3290  else
3291  {
3292  sprintf(str, "'%s'\nUnrecognized Argument \n The Program will be terminated", p[1]);
3293  if(MMessageDialog("DAS inf.", str, " Ok ", "Quick Help", NULL))
3294  {
3295  sprintf(str, "'Allowed Arguments:\n\n\
3296 1) DEMO\n\
3297 2) DOAS\n\
3298 3) TESTAD\n\
3299 4) TESTCCD\n\
3300 5) TESTAMS\n\
3301 6) MASTER\n\
3302 7) SZAPRG\n\
3303 8) OFFLINEPLOT\n\
3304 9) OFFLINEPLOT Valid *.bif (dat) file\n\
3305 10) Valid *.LOG file\n\
3306 11) Valid *.PRG file\n");
3307  if(!MMessageDialog("DAS information", str, " Ok ", NULL))
3308  MGUITerm();
3309  exit(0);
3310 
3311 
3312  }
3313  else
3314  {
3315  MGUITerm();
3316  exit(0);
3317  }
3318  }
3319 
3320  }
3321  }
3322  else
3323  DAS.Flag.exemode = MANUAL;
3324 
3325 
3326 
3327  // If DAS executed in one of the automatic modes,
3328  // a Splash window is created allowing the user to select
3329  // to start the program in MANUAL mode or let it continue
3330  // Usefull when DAS is automatically loaded at the BOOT of the instrument!!!!!
3331  if ((DAS.Flag.exemode == SZAMASTERM) |
3332  (DAS.Flag.exemode == TEMPORIZED) |
3333  (DAS.Flag.exemode == SZAMODE) |
3334  (DAS.Flag.exemode == TESTSZAMODE) |
3335  (DAS.Flag.exemode == PRGFILE) )
3336  {
3338  }
3339 
3340 
3341 
3342 
3343 
3344 
3345 }
#define TESTCCD
execution for testing CCD Camera
int Master
Definition: DAS_Spat.c:100
#define TESTSZAMODE
execution driven by SZAPRG file
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
#define HELP
Help mode.
#define DBDEMO
execution in demo mode
int PRG_Check(int mod, char *prgname)
Definition: DAS_Spat.c:531
#define TEMPORIZED
execution driven by MASTER file
#define SZAMASTERM
execution driven by MASTERSZA file ( there is the possibility to distinguish between AM and PM measur...
#define LOGMODE
execution for LOG View
#define OFFLINEPLOT
execution for archived data visualisation
void MGUITerm(void)
#define PRGFILE
execution driven by *.prg file
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
das DAS
Definition: DAS_Spat.c:85
void MDCreateSplashExe()
Definition: DAS_Spat.c:2267
#define SZAMODE
execution driven by SZAPRG file
static double p
Definition: SOLPOS.C:131
char PrgFile[_MAX_PATH]
Name of the PRG file.
Definition: DAS_Spat.c:91
#define TESTAD
execution for testing PC 104 AD converter
C_DEF int DI_FileExist(char *tit)
int exemode
Set the Execution MODE (Execution modes)
#define TESTAMS
execution for testing AMS&#39;s devices
#define MANUAL
execution in manual mode (for lab use)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ChkMaster()

int ChkMaster ( int  mod)

Definition at line 2730 of file DAS_Spat.c.

References master::eora, GetDateTime(), PrgNumExe, PrgNumInM, S_zenetr, master::sora, time::ti_hour, time::ti_min, and time::ti_sec.

Referenced by D_AutoExecution(), and SZA_FirstCalc().

2731 {
2732 
2733  int i, c = mod;
2734  struct time RTime;
2735  struct date RDate;
2736  struct tm today;
2737  float DecActTime, DecTimeStart, DecTimeStop;
2738 
2739  switch (c)
2740  {
2741  case 0: // Temporized Mode (DAS argument MASTER)
2742 
2743  //gettime(&RTime);
2744  GetDateTime(&RDate, &RTime, &today);
2745 
2746  // Time to decimal time
2747  DecActTime = RTime.ti_hour + ((float) RTime.ti_min / 60) + ((float) RTime.ti_sec / 3600);
2748 
2749  for (i=0;i<PrgNumInM; i++)
2750  {
2751  DecTimeStart = ExMast[i].sora + ((float)ExMast[i].smin / 60) + ((float)ExMast[i].ssec / 3600);
2752  DecTimeStop = ExMast[i].eora + ((float)ExMast[i].emin / 60) + ((float)ExMast[i].esec / 3600);
2753  if((DecActTime > DecTimeStart) && (DecActTime < DecTimeStop))
2754  //if(ExMast[i].sora == (int) RTime.ti_hour &&
2755  //ExMast[i].smin <= (int) RTime.ti_min)
2756  {
2757 
2758  PrgNumExe = i;
2759  }
2760  }
2761 
2762  break;
2763 
2764  case 1: // MASTERSZA Mode 1
2765  /************************************************************************/
2766  GetDateTime(&RDate, &RTime, &today);
2767 
2768 // gettime(&RTime);
2769  for (i=0;i<PrgNumInM; i++)
2770  {
2771  if((int) RTime.ti_hour <= 12)
2772  {
2773  //Actual SZA between Start SZA and End SZA
2774  if ( ((int)(S_zenetr * 100) < (int)(ExMast[i].ssza * 100))
2775  && ((int)(S_zenetr * 100) > (int)(ExMast[i].esza * 100)) )
2776  PrgNumExe = i;
2777 
2778  }
2779  if((int) RTime.ti_hour > 12)
2780  {
2781  if ( ((int)(S_zenetr * 100) > (int)(ExMast[i].ssza * 100))
2782  && ((int)(S_zenetr * 100) < (int)(ExMast[i].esza * 100)) )
2783  {
2784  PrgNumExe = i;
2785  }
2786  }
2787  }
2788  break;
2789  /************************************************************************/
2790  case 2: // SZAMODE
2791  for (i=0;i<PrgNumInM; i++)
2792  {
2793  if ( ((int)(S_zenetr * 100) > (int)(ExMast[i].minsza * 100))
2794  && ((int)(S_zenetr * 100) < (int)(ExMast[i].maxsza * 100)) )
2795  {
2796  PrgNumExe = i;
2797  }
2798  }
2799  break;
2800 
2801  }
2802 
2803  return PrgNumExe;
2804 }
double S_zenetr
Definition: SOLPOS.C:92
int PrgNumExe
number of PRG file in execution
Definition: DAS_Spat.c:98
int eora
End hour.
int PrgNumInM
Actual number of PRG File in current MASTER or MASTERSZA File.
Definition: DAS_Spat.c:97
int sora
Start hour.
Definition: Dildef.h:240
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
Definition: Dildef.h:234
master ExMast[PRGMAXNUM]
Definition: DAS_Spat.c:55
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ChkWinInstance()

int ChkWinInstance ( char *  buff,
MOBJECT  obj 
)

Definition at line 2153 of file DAS_Spat.c.

References MShellRaise().

Referenced by DB_KeyB_CB(), and DB_PasWd().

2154 {
2155 
2156  HWND wtest;
2157 // char str[1024];
2158 
2159  wtest = FindWindow(NULL, buff);
2160  if(wtest != NULL)
2161  {
2162  //sprintf(str,"'%s' window is already open!!!!", buff);
2163  //MMessageDialog("DAS Info", str, "OK",NULL);
2164  MShellRaise(obj);
2165  return 1;
2166 
2167  }
2168  else
2169  return 0;
2170 
2171 
2172 }
void MShellRaise(MOBJECT obj)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_Timing()

int D_Timing ( int  id,
long  tout 
)

Definition at line 1477 of file DAS_Spat.c.

References gui::ConfigPanel, das::Gui, configpanel::lbltelap, MLoopWhileEvents(), MObjectSetText(), st, WDT_flagstop, and WDT_func().

Referenced by WDT_CB().

1478 {
1479  unsigned long st, et, x;
1480  char buf[80];
1481 
1482  st = GetTickCount();
1483  do
1484  {
1485  et = GetTickCount();
1486  x = labs(et - st);
1487  MLoopWhileEvents(0);
1488  if((x % 10) == 0 && x > 0)
1489  {
1490  sprintf(buf, "%.1lf", (double)fabs((tout-(double)(labs(et - st) ))/1000.0 ));
1492  }
1493  if (WDT_flagstop)
1494  {
1495  WDT_func(0);
1496  return 0;
1497  }
1498  }while((labs(et - st) < tout) && (WDT_flagstop == 0));
1499  return 0;
1500 }
gui Gui
Graphic User Interface Structure.
int WDT_flagstop
Definition: DAS_Spat.c:146
void MLoopWhileEvents(int discard)
void WDT_func(int mod)
Definition: DAS_Spat.c:1572
void MObjectSetText(MOBJECT obj, const char *text)
das DAS
Definition: DAS_Spat.c:85
configpanel ConfigPanel
Configuration panel structure.
static double st
Definition: SOLPOS.C:142
MOBJECT lbltelap
label elapsed time (for WDT)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_HelpCB()

int DB_HelpCB ( MOBJECT  o,
void *  od,
void *  ad 
)

Help Callback
Create the help in the predefined WEB Browser.

Definition at line 881 of file DAS_Spat.c.

References _MAX_PATH, bil::DFILEM, DI_FileExist(), and d_fileman::HOMEDIRECTORY.

Referenced by AboutCB(), BuildShell(), HlpTopCB(), and MDCreate_CP().

882 {
883  int er;
884  char str[_MAX_PATH];
885  char buf[_MAX_PATH];
886 /* er = MMessageDialog("?", "Informations ?", "Yes", "No", NULL);
887  if (!er)
888  return 1;
889  return 0;
890 */
891  //build the help file name
892  sprintf(str, "%s\\Help\\html\\chm\\DAS.chm",BIL.DFILEM.HOMEDIRECTORY);
893 
894  //check for the existence of the hh.exe int the winnt dir
895  if(DI_FileExist("C:\\WINNT\\hh.exe")) // DI_FileExist --> Return: 1 if PATH exist, else return 0
896  {
897  sprintf(buf, "C:\\WINNT\\hh.exe %s",str);
898  er = WinExec(buf, SW_SHOWMAXIMIZED);
899  }
900  else if(DI_FileExist("C:\\Windows\\hh.exe"))
901  {
902  sprintf(buf, "C:\\Windows\\hh.exe %s",str);
903  er = WinExec(buf, SW_SHOWMAXIMIZED);
904  }
905  else
906  {
907  sprintf(buf, "%s\\Help\\html\\index.html",BIL.DFILEM.HOMEDIRECTORY);
908  system(buf);
909  }
910 
911  return 0;
912 
913 }
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
bil BIL
Definition: DAS_Spat.c:74
d_fileman DFILEM
Definition: bildef.h:257
#define _MAX_PATH
Definition: Dildef.h:202
C_DEF int DI_FileExist(char *tit)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_InfCB()

int DB_InfCB ( MOBJECT  o,
void *  od,
void *  ad 
)

Inf Callback
Create the Inf shell.

Definition at line 915 of file DAS_Spat.c.

References _MAX_PATH, bil::DFILEM, DI_FileExist(), and d_fileman::HOMEDIRECTORY.

Referenced by MDCreate_CP().

916 {
917  int er;
918  char str[_MAX_PATH];
919  char buf[_MAX_PATH];
920 /* er = MMessageDialog("?", "Informations ?", "Yes", "No", NULL);
921  if (!er)
922  return 1;
923  return 0;
924 */
925  //build the help file name
926  sprintf(str, "%s\\Help\\html\\chm\\DAS.chm",BIL.DFILEM.HOMEDIRECTORY);
927 
928  //check for the existence of the hh.exe int the winnt dir
929  if(DI_FileExist("C:\\WINNT\\hh.exe")) // DI_FileExist --> Return: 1 if PATH exist, else return 0
930  {
931  sprintf(buf, "C:\\WINNT\\hh.exe %s",str);
932  er = WinExec(buf, SW_SHOWMAXIMIZED);
933  }
934  else if(DI_FileExist("C:\\Windows\\hh.exe"))
935  {
936  sprintf(buf, "C:\\Windows\\hh.exe %s",str);
937  er = WinExec(buf, SW_SHOWMAXIMIZED);
938  }
939  else
940  {
941  sprintf(buf, "%s\\Help\\html\\index.html",BIL.DFILEM.HOMEDIRECTORY);
942  system(buf);
943  }
944 
945  return 0;
946 
947 }
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
bil BIL
Definition: DAS_Spat.c:74
d_fileman DFILEM
Definition: bildef.h:257
#define _MAX_PATH
Definition: Dildef.h:202
C_DEF int DI_FileExist(char *tit)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_SelButt_CB()

void DB_SelButt_CB ( MOBJECT  obj,
MKeyEvent pe,
void *  a_data 
)

Definition at line 858 of file DAS_Spat.c.

References ESC, MKeyEvent::keycode, on, SPACEBAR, and Status().

Referenced by BuildMainShell().

859 {
860  int c = (int) a_data;
861  switch (pe->keycode)
862  {
863 
864  case ESC:
865  on = 0;
866  Status("PROGRAM HALTED");
867  break;
868 
869 
870  case SPACEBAR:
871  on = 1;
872  Status(" ");
873 
874  break;
875 
876 
877  }
878 
879 }
unsigned int keycode
Code for the pressed key.
Definition: Mguidefs.h:541
#define ESC
Definition: KEYCODES.H:265
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
#define SPACEBAR
Definition: KEYCODES.H:276
int on
PRG execution control variabile.
Definition: DAS_Spat.c:109
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DemoInitMotor()

void DemoInitMotor ( void  )

Definition at line 1047 of file DAS_Spat.c.

References controlpanel::Albl_LS, optionini::amsprogbar, gui::ContrPanel, D_Positioning(), D_VRange(), das::DOption, paramini::EqType, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, das::Gui, controlpanel::LedSM, mige::linked, LookforWl_X(), das::MIGE, Mir_Code, Mir_CodeTropo, MObjectSetText(), MPixmapSetImageFile(), das::Paramini, FilterWheelSt::Pos, MirrorSt::Pos, ZenithSt::Pos, AzimuthSt::Pos, SPATRAM2, SPATRAM3, SPATRAMPLUS, st, Status(), TROPOGAS, and GratingSt::Wl.

Referenced by InitCCD_AMS().

1048 {
1049 
1050  char buf[80];
1051  unsigned long st;
1052 
1053 
1054  //Simulate home mirror
1055  /*************************************************/
1056  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][0], "SYS\\ledoff.bmp");
1057  sprintf(buf, "%s", "Homing");
1059  Status("Home for Mirror...");
1060 
1061  st = GetTickCount();
1062 
1063  if(DAS.DOption.amsprogbar)
1064  D_VRange("Homing Mirror",0, 255, 0, 0);
1065 
1066  D_Positioning(DAS.Gui.ContrPanel.Albl_LS[0], 1, 1000);
1067 
1068  if(DAS.DOption.amsprogbar)
1069  D_VRange(NULL, 100, 0,0,0);
1070 
1071  MIS.Pos = 0;
1073  sprintf(buf, "%s",Mir_CodeTropo[MIS.Pos]);
1074  else
1075  sprintf(buf, "%s",Mir_Code[MIS.Pos]);
1076 
1078  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][0], "SYS\\ledGreen.bmp");
1079  Status("Home for Mirror..DONE");
1080  /**************************************************/
1081  //Simulate home grating
1082  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][1], "SYS\\ledoff.bmp");
1083  sprintf(buf, "%s", "Homing");
1085  Status("Home for Grating...");
1086 
1087  st = GetTickCount();
1088 
1089  if(DAS.DOption.amsprogbar)
1090  D_VRange("Homing Grating",0, 255, 255, 0);
1091 
1092  D_Positioning(DAS.Gui.ContrPanel.Albl_LS[1], 1, 1000);
1093 
1094  if(DAS.DOption.amsprogbar)
1095  D_VRange(NULL, 100, 0,0,0);
1096 
1097  GRS.Wl = LookforWl_X(4358);//Lookfor4358();
1098  sprintf(buf, "%d", 4358);
1100  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][1], "SYS\\ledGreen.bmp");
1101  Status("Home for Grating..DONE");
1102 
1103  /**************************************************/
1104  //Simulate home filter wheel
1105  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[1][0], "SYS\\ledoff.bmp");
1106  sprintf(buf, "%s", "Homing");
1108  Status("Home for Filter Wheel...");
1109 
1110  st = GetTickCount();
1111 
1112  if(DAS.DOption.amsprogbar)
1113  D_VRange("Homing Filter Wheel",0, 0, 0, 255);
1114 
1115  D_Positioning(DAS.Gui.ContrPanel.Albl_LS[2], 1, 1000);
1116 
1117  if(DAS.DOption.amsprogbar)
1118  D_VRange(NULL, 100, 0,0,0);
1119 
1120  FWS.Pos = 0;
1121  sprintf(buf, "%s", "NULL");
1123  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[1][0], "SYS\\ledGreen.bmp");
1124  Status("Home for Filter Wheel..DONE");
1125 
1126  if(DAS.Paramini.EqType == TROPOGAS||
1132  DAS.Paramini.EqType == SPATRAM2 ||
1134  {
1135  if(DAS.MIGE.linked == 1)
1136  {
1137  /**************************************************/
1138  //Simulate home Zenith
1139  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][0], "SYS\\ledoff.bmp");
1140  sprintf(buf, "%s", "Homing");
1142  Status("Home for Zenith Axis...");
1143 
1144  st = GetTickCount();
1145 
1146  if(DAS.DOption.amsprogbar)
1147  D_VRange("Homing Zenit Axis",0, 0, 128, 255);
1148 
1149  D_Positioning(DAS.Gui.ContrPanel.Albl_LS[4], 1, 1000);
1150 
1151  if(DAS.DOption.amsprogbar)
1152  D_VRange(NULL, 100, 0,0,0);
1153 
1154  ZST.Pos = 0;
1155  sprintf(buf, "%s", "0");
1157  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][0], "SYS\\ledGreen.bmp");
1158  Status("Home for Zenith Wheel..DONE");
1159 
1160  /**************************************************/
1161  //Simulate home Azimuth
1162  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][1], "SYS\\ledoff.bmp");
1163  sprintf(buf, "%s", "Homing");
1165  Status("Home for Azimuth Axis...");
1166 
1167  st = GetTickCount();
1168 
1169  if(DAS.DOption.amsprogbar)
1170  D_VRange("Homing Azimuth Axis",0, 128, 128, 255);
1171 
1172  D_Positioning(DAS.Gui.ContrPanel.Albl_LS[5], 1, 1000);
1173 
1174  if(DAS.DOption.amsprogbar)
1175  D_VRange(NULL, 100, 0,0,0);
1176 
1177  AST.Pos = 0;
1178  sprintf(buf, "%s", "0");
1180  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][1], "SYS\\ledGreen.bmp");
1181  Status("Home for Azimuth..DONE");
1182  }
1183  else
1184  {
1185  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][1], "SYS\\ledoffg.bmp");
1186  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][0], "SYS\\ledoffg.bmp");
1187  }
1188  }
1189  else
1190  {
1191  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][1], "SYS\\ledoffg.bmp");
1192  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][0], "SYS\\ledoffg.bmp");
1193 
1194 
1195  }
1196 
1197 }
gui Gui
Graphic User Interface Structure.
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
optionini DOption
Options for DAS execution.
const char * Mir_Code[]
const char array for the realisation of the Mirrors buttons in the Mirror shell
Definition: DAS_Spat.c:231
void D_VRange(char *str, int val, int, int g, int b)
Create and display the status bar.
Definition: Utils.c:206
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
int Pos
Mirror Current Position.
void MObjectSetText(MOBJECT obj, const char *text)
int Pos
Filter Wheel current Position.
int Wl
Grating Wavelength.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
#define SPATRAM2
SPATRAM2 (with ATX power supply & HiresV)
#define SPATRAMPLUS
As SPATRAM plus AltAzimuth platform.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
mige MIGE
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
ZenithSt ZST
Definition: DAS_Spat.c:70
das DAS
Definition: DAS_Spat.c:85
int linked
#define SPATRAM3
SPATRAM3.
MirrorSt MIS
Mirror.
Definition: DAS_Spat.c:61
controlpanel ContrPanel
Control Panel Structure.
void D_Positioning(MOBJECT p, int id, long tout)
Callback for the void D_VRange and display also the status in the corresponding CP labels...
Definition: Dxl.c:607
static double st
Definition: SOLPOS.C:142
GratingSt GRS
Grating.
Definition: DAS_Spat.c:60
int EqType
Spectrometer Type.
double Pos
Azimuth Current Position.
double Pos
Zenith Current Position.
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
AzimuthSt AST
Definition: DAS_Spat.c:71
int LookforWl_X(int x)
Definition: Procedures.c:2295
const char * Mir_CodeTropo[]
const char array for the realisation of the Mirrors buttons in the Mirror shell for TROPOGAS ...
Definition: DAS_Spat.c:234
paramini Paramini
structure for the parameters defined in param.ini configuration file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ExMaster()

int ExMaster ( int  m,
int  mode 
)

Definition at line 739 of file DAS_Spat.c.

References delay(), bil::DFILEM, d_fileman::HOMEDIRECTORY, MMessageDialog(), master::prg, PRG_Check(), PRGMAXNUM, PrgNumInM, ReadLine(), SaveCnt, Status(), SZAMASTERM, SZAMODE, TEMPORIZED, and TESTSZAMODE.

Referenced by SZA_FirstCalc().

740 {
741  FILE *fd;
742  char buf[MAX_PATH];
743  int i,fn, er;
744 
745  if(m == 0) return 0;
746 
747  if (mode == TEMPORIZED)
748  {
749  fd = fopen("MASTER", "rt");
750  if(fd == NULL) return -1;
751  //Read 3 line of comments
752  ReadLine(buf, 80, fd);
753  ReadLine(buf, 80, fd);
754  ReadLine(buf, 80, fd);
755  do
756  {
757  //Read the start time (hour and minutes), the end time and the PRG file to be executed -
758  //format:HHs MMs HHe MMe filename.PRG (es. 15 45 16 45 Test.prg)
759  fscanf(fd, "%d%d%d%d%d%d%s", &ExMast[PrgNumInM].sora, &ExMast[PrgNumInM].smin,&ExMast[PrgNumInM].ssec,
760  &ExMast[PrgNumInM].eora, &ExMast[PrgNumInM].emin, &ExMast[PrgNumInM].esec,
761  &ExMast[PrgNumInM].prg);
762 
763  //PrgNum++;
764  PrgNumInM++;
765  SaveCnt = 1;
766  fgets(buf, 80, fd);
767 
768  }while(!feof(fd) && PrgNumInM < PRGMAXNUM);
769  fclose(fd);
770  }
771  if (mode == SZAMASTERM)
772  {
773  fd = fopen("MASTERSZA", "rt");
774  if(fd == NULL) return -2;
775  do
776  {
777  //Read the start and end values for SZA and the PRG file to be executed
778  //format:SZAs SZAe filename.PRG (es. 85.00 95.00 Test.prg
779  fscanf(fd, "%f %f %s", &ExMast[PrgNumInM].ssza, &ExMast[PrgNumInM].esza, &ExMast[PrgNumInM].prg);
780 
781  PrgNumInM++;
782  SaveCnt = 1;
783  fgets(buf, 80, fd);
784 
785  }while(!feof(fd) && PrgNumInM < PRGMAXNUM);
786  fclose(fd);
787  }
788 
789  if (mode == SZAMODE)
790  {
791  fd = fopen("SZAPRG", "rt");
792  if(fd == NULL) return -3;
793  do
794  {
795  //Read the Min and Max SZA and the PRG file to be executed
796  //format:MinSZA (xxx.xx) MaxSZA (yyy.yy) filename.PRG (es. 85.00 95.00 Test.prg)
797  fscanf(fd, "%f %f %s", &ExMast[PrgNumInM].minsza, &ExMast[PrgNumInM].maxsza, &ExMast[PrgNumInM].prg);
798 
799  PrgNumInM++;
800  SaveCnt = 1;
801  fgets(buf, 80, fd);
802 
803  } while(!feof(fd) && PrgNumInM < PRGMAXNUM);
804  fclose(fd);
805 
806  }
807  if (mode == TESTSZAMODE)
808  {
809  fd = fopen("SZAPRG", "rt");
810  if(fd == NULL) return -3;
811  do
812  {
813  //Read the Min and Max SZA and the PRG file to be executed
814  //format:MinSZA (xxx.xx) MaxSZA (yyy.yy) filename.PRG (es. 85.00 95.00 Test.prg)
815  fscanf(fd, "%f %f %s", &ExMast[PrgNumInM].minsza, &ExMast[PrgNumInM].maxsza, &ExMast[PrgNumInM].prg);
816 
817  PrgNumInM++;
818  SaveCnt = 1;
819  fgets(buf, 80, fd);
820 
821  } while(!feof(fd) && PrgNumInM < PRGMAXNUM);
822 
823 
824  fclose(fd);
825 
826  }
827 
828  //Check Existence of all PRG files
829  for (i=0; i<PrgNumInM; i++)
830  {
831  sprintf(buf, "%s\\%s",BIL.DFILEM.HOMEDIRECTORY, ExMast[i].prg);
832  fn = access(buf, 0);
833  if (fn == -1)
834  {
835  sprintf(buf, "File %s\\%s NOT Encountred.\n Please Check!!!!!",BIL.DFILEM.HOMEDIRECTORY, ExMast[i].prg);
836  MMessageDialog("DAS Information", buf, " Ok ", NULL);
837 
838  }
839  else
840  {
841  Status("PRG Files encountered");
842  delay(1000);
843  }
844 
845  }
846 
847  //Check the é.PRGs Syntax
848  for (i=0; i<PrgNumInM; i++)
849  {
850  er = PRG_Check(0, ExMast[i].prg);
851  }
852 
853 
854 
855  return 1;
856 }
char prg[16]
PRG Filename.
#define TESTSZAMODE
execution driven by SZAPRG file
int SaveCnt
Definition: Procedures.c:49
#define PRGMAXNUM
Maximum number of PRG File in MASTER or MASTERSZA File.
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
int PRG_Check(int mod, char *prgname)
Definition: DAS_Spat.c:531
#define TEMPORIZED
execution driven by MASTER file
int PrgNumInM
Actual number of PRG File in current MASTER or MASTERSZA File.
Definition: DAS_Spat.c:97
#define SZAMASTERM
execution driven by MASTERSZA file ( there is the possibility to distinguish between AM and PM measur...
bil BIL
Definition: DAS_Spat.c:74
d_fileman DFILEM
Definition: bildef.h:257
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
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
#define SZAMODE
execution driven by SZAPRG file
master ExMast[PRGMAXNUM]
Definition: DAS_Spat.c:55
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Fetch()

int Fetch ( void  )

Reads the key-word in PRG Files
.

Returns
int = keyword's code (see Automatic and Unattended Mode)

Definition at line 298 of file DAS_Spat.c.

References KeyCode, PrgCnt, and Program.

Referenced by D_AutoExecution(), and PRG_Check().

299 {
300  //Read the key-word
301  char cmd[16];
302  char buf[16];
303  int c;
304  int lencmd = 0;
305  int NumCommands;
306  int PosComm = 0;
307 
308 
309 
310  //if (Program[PrgCnt]!= 10)
311  //0x0a = line feed
312  //0x0d = carriage return
313  if (Program[PrgCnt]!= 10)
314  {
315  sscanf(&Program[PrgCnt], "%s", cmd);
316  sprintf (buf, "%s", cmd);
317 // Status(buf);
318 
319  //******************************
320  //Added on 15/01/2005 Remember to remove the commands
321  // "PrgCnt += X" in the E_xxxxxx Functions
322  lencmd =strlen(cmd);
323  PrgCnt += lencmd;
324  NumCommands = sizeof(KeyCode)/sizeof (KeyCode[0]);
325  //****************************
326  for(c = 0; c < NumCommands; c++)
327  {
328  if(strcmp(cmd, KeyCode[c]) == 0)
329  {
330  PosComm = c + 1;
331  break;
332  }
333  else
334  PosComm = 0;
335 
336  }
337  return PosComm;
338 
339  }
340  else
341  {
342 
343  return 2000;
344  }
345 
346 }
const char * KeyCode[]
Definition: DAS_Spat.c:164
char * Program
buffer for the PRG file
Definition: DAS_Spat.c:90
long PrgCnt
Counter for the position in the PRG file.
Definition: DAS_Spat.c:93
+ Here is the caller graph for this function:

§ InitCCD_AMS()

int InitCCD_AMS ( int  mod,
int  emode 
)

Definition at line 1793 of file DAS_Spat.c.

References flag::AMSPres, CCD_Error(), D_WriteInitLog(), DB_InitCamera(), DB_InitMotor(), DB_KB_ButtonActive(), DBDEMO, DC_ErrorMessage(), delay(), DemoInitMotor(), FLAG, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, das::Gui, HiresPS(), LIS_, LoadDB_DispCoeff(), MANUAL, MDCreateWaitShell(), MShellRaise(), das::Nova, NOVA7892, NOVA945GSE, NOVA_Out(), PeltierPS(), PRGFILE, shells::Sh_Main, gui::Shells, ShutterOpening(), SPATRAM, SPATRAM2, SPATRAM3, SPATRAMPLUS, Status(), SZAMASTERM, SZAMODE, TEMPORIZED, TESTAMS, TESTSZAMODE, TROPOGAS, and nova::type.

Referenced by SZA_FirstCalc().

1794 {
1795 
1796  int er;
1797  char buf[1024];
1798 
1799 
1800  ShutterOpening(0);
1801 
1802  if(mod == TROPOGAS )
1803  {
1804 
1805  //1) Init AMS
1806  //2) Switch-on Power Supply for CCD Camera
1807  //3) Init Camera
1808  //4) Switch-on Power Supply for OMU Peltier (24V)
1809 
1810  /********************************************************
1811  ***************** INIT AMS *********************
1812  *********************************************************/
1813 
1814  if ((emode == TEMPORIZED) | (emode == PRGFILE) | (emode == TESTAMS) | (emode == MANUAL) | (emode == SZAMASTERM)| (emode == SZAMODE))
1815  //if ((emode == TEMPORIZED) | (emode == PRGFILE) | (emode == TESTAMS) | (emode == MANUAL) )
1816  {
1817  //Disattiva i pulsanti sulla keyboard
1818  DB_KB_ButtonActive(0);
1819  // Inizializza ed esegue l'home per i motori
1820  er = DB_InitMotor(1);
1821  //Attiva i pulsanti sulla keyboard
1822  DB_KB_ButtonActive(1);
1823  }
1824  else if((emode == DBDEMO) || (emode == TESTSZAMODE ))
1825  {
1826  DemoInitMotor();
1827  }
1828 
1829  //Switch on the HIRES Power supply
1830  if (emode != TESTAMS)
1831  {
1832  if(!FLAG.AMSPres)
1833  HiresPS(1);
1834 
1835  Status ("Waiting 1 Sec.");
1836  delay(1000);
1837  Status("Init CCD Camera");
1838  //Init Camera
1839  /********************************************************
1840  ***************** INIT CAMERA *********************
1841  *********************************************************/
1842  DB_KB_ButtonActive(0);
1843  // Init HIRES_IV and MARCONI CCD sensor
1844  er = DB_InitCamera(0);
1845  if(er)
1846  {
1847  if ((er > 0) & (er < 50))
1848  {
1849  sprintf(buf,DC_ErrorMessage(er));
1850  CCD_Error(buf);
1851  }
1852  else
1853  sprintf(buf,"Error %d in DB_InitCamera", er);
1854 
1855  Status(buf);
1856  //sprintf(buf," Camera NOT Found");
1857  D_WriteInitLog(buf);
1858  }
1859  else
1860  {
1861  sprintf(buf," Camera found");
1862  D_WriteInitLog(buf);
1863  }
1864  }
1865  DB_KB_ButtonActive(1);
1866 
1867  //The focus is taken by the Control Panel
1869  /******************************************************/
1870  // Load the dispersion coefficient for DOAS Use
1871  er = LoadDB_DispCoeff();
1872  /*******************************************************/
1873 
1874  //Switch on the 24V Power Supply
1875  if (emode != TESTAMS)
1876  if(!FLAG.AMSPres)
1877  {
1878  PeltierPS(1);
1879  Status ("Waiting 1 Sec.");
1880  delay(1000);
1881  }
1882  }
1883  else if((mod == LIS_) | (mod == SPATRAM))// for SPATRAM, LIS
1884  {
1885  //1) Init Camera
1886  //2) Init AMS
1887  /********************************************************
1888  ***************** INIT CAMERA *********************
1889  *********************************************************/
1890  DB_KB_ButtonActive(0);
1891  // Init HIRES_IV and MARCONI CCD sensor
1892  er = DB_InitCamera(0);
1893  if(er)
1894  {
1895  if ((er > 0) & (er < 50))
1896  {
1897  sprintf(buf,DC_ErrorMessage(er));
1898  CCD_Error(buf);
1899  }
1900  else
1901  sprintf(buf,"Error %d in DB_InitCamera", er);
1902 
1903  Status(buf);
1904  //sprintf(buf," Camera NOT Found");
1905  D_WriteInitLog(buf);
1906  }
1907  else
1908  {
1909  sprintf(buf," Camera found");
1910  D_WriteInitLog(buf);
1911  }
1912  DB_KB_ButtonActive(1);
1913 
1914  //The focus taken by the CP shell
1916  /******************************************************/
1917  // Load the dispersion coefficient for DOAS Use
1918  er = LoadDB_DispCoeff();
1919  /*******************************************************/
1920  /********************************************************
1921  ***************** INIT AMS *********************
1922  *********************************************************/
1923  if ((emode == TEMPORIZED) | (emode == PRGFILE) | (emode == TESTAMS) | (emode == MANUAL)| (emode == SZAMASTERM)| (emode == SZAMODE))
1924  {
1925  //Disattiva i pulsanti sulla keyboard
1926  DB_KB_ButtonActive(0);
1927  // Inizializza ed esegue l'home per i 3 motori
1928  er = DB_InitMotor(1);
1929  //Attiva i pulsanti sulla keyboard
1930  DB_KB_ButtonActive(1);
1931  }
1932  else if((emode == DBDEMO)||(emode == TESTSZAMODE))
1933  {
1934  DemoInitMotor();
1935  }
1936  }
1937  else if(mod == GASCODNG2 ||
1938  mod == GASCODNG3 ||
1939  mod == GASCODNG4 ||
1940  mod == SPATRAM3 ||
1941  mod == SPATRAM2 ||
1942  mod == SPATRAMPLUS ||
1943  mod == GASCODNG1 )// for GASCODNG1, NG2, NG3, SPATRAM2, SPATRAMPLUS
1944  {
1945  //0) Switch ON Hires and AMS Power supply through the NOVA Digital Output port
1946  //1) Init Camera
1947  //2) Init AMS
1948  //3) Switch ON 24V Power supply (for Peltier) through the NOVA Digital Output port
1949 
1950  /*********************************************************/
1951  //switch on the 12 Volt and Hires Power Supply
1952  /*********************************************************/
1953  if (DAS.Nova.type == NOVA7892)
1954  {
1955  er = NOVA_Out(DAS.Nova.type, 6); //0110 bin
1956  delay(1000);
1957  }
1958  if (DAS.Nova.type == NOVA945GSE)
1959  {
1960  er = NOVA_Out(DAS.Nova.type, 9); //1001 bin
1961  delay(3000);
1962  }
1963 /*
1964  nb = 2;
1965  er = ChkDigIO(DAS.Nova.DigOut, nb);
1966  if (er == 1)
1967  DAS.Nova.DigOut &= ~((unsigned char) pow(2,(double)(nb)));
1968  else if (er == 0)
1969  DAS.Nova.DigOut |= (unsigned char) pow(2,(double)(nb));
1970 
1971  er = NOVA_Out(DAS.Nova.type, DAS.Nova.DigOut);
1972 */
1973  //OutByte(576, DAS.Nova.DigOut);
1974 
1975  if(mod == SPATRAM2 || mod == GASCODNG4 || mod== SPATRAM3)
1977  /********************************************************
1978  ***************** INIT CAMERA *********************
1979  *********************************************************/
1980  DB_KB_ButtonActive(0);
1981  // Init HIRES_IV and MARCONI CCD sensor
1982  er = DB_InitCamera(0);
1983  if(er)
1984  {
1985  if ((er > 0) & (er < 50))
1986  {
1987  sprintf(buf,DC_ErrorMessage(er));
1988  CCD_Error(buf);
1989  }
1990  else
1991  sprintf(buf,"Error %d in DB_InitCamera", er);
1992 
1993  Status(buf);
1994  //sprintf(buf," Camera NOT Found");
1995  D_WriteInitLog(buf);
1996  }
1997  else
1998  {
1999  sprintf(buf," Camera found");
2000  D_WriteInitLog(buf);
2001  }
2002  DB_KB_ButtonActive(1);
2003 
2004  //The focus taken by the CP shell
2006  /******************************************************/
2007  // Load the dispersion coefficient for DOAS Use
2008  er = LoadDB_DispCoeff();
2009  /*******************************************************/
2010  /********************************************************
2011  ***************** INIT AMS *********************
2012  *********************************************************/
2013  if ((emode == TEMPORIZED) | (emode == PRGFILE) | (emode == TESTAMS) | (emode == MANUAL)| (emode == SZAMASTERM)| (emode == SZAMODE))
2014  {
2015  //Disattiva i pulsanti sulla keyboard
2016  DB_KB_ButtonActive(0);
2017  // Inizializza ed esegue l'home per i 3 motori
2018  er = DB_InitMotor(1);
2019  //Attiva i pulsanti sulla keyboard
2020  DB_KB_ButtonActive(1);
2021  }
2022  else if((emode == DBDEMO) | (emode == TESTSZAMODE))
2023  {
2024  DemoInitMotor();
2025  }
2026 
2027  /*********************************************************/
2028  //switch on the 24 Volt Power Supply
2029  /*********************************************************/
2030 /* nb = 1;
2031 
2032  er = ChkDigIO(DAS.Nova.DigOut, nb);
2033  if (er == 1)
2034  DAS.Nova.DigOut &= ~((unsigned char) pow(2,(double)(nb)));
2035  else if (er == 0)
2036  DAS.Nova.DigOut |= (unsigned char) pow(2,(double)(nb));
2037  er = NOVA_Out(DAS.Nova.type, DAS.Nova.DigOut);
2038 */
2039  //OutByte(576, DAS.Nova.DigOut);
2040  delay(1000);
2041 
2042  }
2043  //return er;
2044  return 0;
2045 }
flag FLAG
Definition: CreateForms.c:84
#define SPATRAM
SPectrometer for Atmospheric TRAcers Measurements - CGE-UE Portugal.
gui Gui
Graphic User Interface Structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
shells Shells
Shells structure.
int DB_InitMotor(int mod)
Initialize AMS. Procedure that initialize the parameters for the AMS&#39;s devices.
Definition: Init.c:1584
int DB_InitCamera(int mod)
Initialize Camera Parameters. Procedure that initialize the CCD Camera.
Definition: Init.c:170
#define TESTSZAMODE
execution driven by SZAPRG file
MOBJECT Sh_Main
Main shell for control panel.
#define DBDEMO
execution in demo mode
#define NOVA945GSE
NOVA945GSE (SPATRAM2, GASCODNG1, GASCODNG4)
#define TEMPORIZED
execution driven by MASTER file
void PeltierPS(int mod)
Peltier Power Supply ON/OFF .
Definition: Spat_Device.c:2551
#define SZAMASTERM
execution driven by MASTERSZA file ( there is the possibility to distinguish between AM and PM measur...
CTYPE const char *PROC_CALL DC_ErrorMessage(int ErrorCode)
Convert an error code into an error message (string). DC_Status returns an error code of the previous...
#define LIS_
Lampedusa Island Spectrometer - ENEA.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
#define SPATRAM2
SPATRAM2 (with ATX power supply & HiresV)
#define SPATRAMPLUS
As SPATRAM plus AltAzimuth platform.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
int NOVA_Out(int novatype, unsigned int out)
Write the NOVA Output port.
Definition: DAS_Spat.c:1375
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
void DemoInitMotor(void)
Definition: DAS_Spat.c:1047
#define PRGFILE
execution driven by *.prg file
void HiresPS(int mod)
Hires Power Supply ON/OFF .
Definition: Spat_Device.c:2532
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
das DAS
Definition: DAS_Spat.c:85
#define SPATRAM3
SPATRAM3.
void MShellRaise(MOBJECT obj)
nova Nova
NOVA structure.
#define SZAMODE
execution driven by SZAPRG file
int LoadDB_DispCoeff(void)
Load dispersion parameters. Procedure that load the dispersion parameters from file {homedir}/DOAS/Di...
Definition: Load.c:234
int D_WriteInitLog(char *str)
writes devices errors(AMS, CCD...) on the Devices.log file.
Definition: Save.c:144
void MDCreateWaitShell(void)
Create a waiting window .
Definition: DAS_Spat.c:2408
void CCD_Error(char *str)
Alerts for CCD errors Creates a message window reporting the number of the error. ...
Definition: Errors.c:279
#define NOVA7892
NOVA7892 monoboard (old)
int type
type of NOVA monoboard used (7892 or 945GSE)
void ShutterOpening(int mod)
Definition: Procedures.c:1685
int AMSPres
AMS Presence: 0 = AMS FOUND; 1 = AMS NOT FOUND.
#define TESTAMS
execution for testing AMS&#39;s devices
#define MANUAL
execution in manual mode (for lab use)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ InitColors()

void InitColors ( void  )

Definition at line 3371 of file DAS_Spat.c.

References mtcl::black, dil::Cfg, bil::DPLOT, d_view::DrawBG, MAllocColor(), MGetNColors(), MPaletteMode(), cfg::NColors, PaletteMode, mtcl::PLColor, and mtcl::white.

Referenced by MGUIMain().

3372 {
3373 
3375  DIL.Cfg.NColors = MGetNColors();
3376 
3377  // Colors allocation ( for compatibility with old version)
3378  BIL.DPLOT.DrawBG = MAllocColor(220, 220, 220);
3379  MTCL.PLColor[0] = MTCL.black;
3380  MTCL.PLColor[1] = MTCL.white;
3381 }
int PaletteMode
Definition: DAS_Spat.c:158
cfg Cfg
Definition: Dildef.h:678
MTColor DrawBG
Definition: bildef.h:184
MTColor black
MTColor white
dil DIL
Definition: DAS_Spat.c:72
U32 NColors
Definition: Dildef.h:648
int MPaletteMode(void)
bil BIL
Definition: DAS_Spat.c:74
mtcl MTCL
MTColor.
Definition: DAS_Spat.c:62
d_view DPLOT
Definition: bildef.h:254
long MGetNColors(void)
MTColor MAllocColor(int r, int g, int b)
MTColor PLColor[264]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ InitDefaultOptions()

void InitDefaultOptions ( void  )

Definition at line 3448 of file DAS_Spat.c.

References optionini::avgmode, optionini::darkremove, optionini::darksource, flag::DeltaSZA, das::DOption, flag::ExeDSZA, optionini::filename, FLAG, das::Flag, optionini::ftpbackup, optionini::hlineafter, optionini::hlinebefore, optionini::imgtype, optionini::pixcorr, flag::plotW, flag::plotYRange, optionini::resetFreq, optionini::resetType, optionini::savingmode, flag::settempvar, flag::WindowsReboot, and flag::Wl.

3449 {
3450 
3451  // Assign the default values
3452  DAS.DOption.savingmode = 1; //Flag to set saving mode: 0=ASCII, 1=Binary
3453  DAS.DOption.filename = 1; //Flag to set file name mode 0=free choice, 1 = automatic file names
3454  DAS.DOption.imgtype = 0; //Flag to set image mode 0=Mono, 1 = RGB
3455  DAS.DOption.pixcorr = 1; //Flag to set defective pixel correction: 0=NOT Corrected, 1=Corrected
3456  DAS.DOption.avgmode = 1;//Flag to set Averaging mode: 0 = Repeat measurements for fixed number,
3457  // 1 = Repeat measurements for fixed time
3458  DAS.DOption.darkremove = 1; // Flag to set Dark Removal from measurements; 0 = No Dark Removal
3459  // 1 = Dark Removal
3460  DAS.DOption.darksource = 1; //Flag to set Dark source: 0 = Blind Pixels
3461  // 1 = Full Frame
3462  FLAG.Wl = 1; //Flag for X scale: 0 = Pixel;1 = WL [A]; 2 = WL [nm]
3463  DAS.Flag.plotW = 0;
3464  //FLAG.plotW = 0; //Flag for the plot display: 0 = NO Plot; 1 = PLOT
3465  FLAG.plotYRange = 1; //0 = full range; 1 = min/max
3466  FLAG.settempvar = 0; //0 = Fixed CCD Temp, 1 = CCD Temp VS sza
3467  DAS.DOption.hlinebefore = 1; //Number of HiddenLines before the central line in Plot
3468  DAS.DOption.hlineafter = 1; //Number of HiddenLines after the central line in Plot
3469  DAS.DOption.ftpbackup = 0;
3470  DAS.Flag.DeltaSZA = 0; //flag for continuos measurements (0) or delta sza meas (1)
3471  DAS.Flag.ExeDSZA = 1;//flag for the activation of measurement in case of DeltaSZA measurements
3472  DAS.DOption.resetType = 1; //Reset type 1=day(s), 0=hour(s)
3473  DAS.DOption.resetFreq = 7; //Reset frequency
3474  DAS.Flag.WindowsReboot = 0; //Flag that became 1 when Windows reboot is setted (\ref SetWinowsReset)
3475 
3476 }
flag FLAG
Definition: CreateForms.c:84
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
int Wl
Flag for the units on the X scale plot.
int plotW
Flag for the plot display.
flag Flag
Structure for different flags.
int darkremove
Flag to set Dark Removal from measurements; motors0 = No Dark Removal, 1 = Dark Removal.
int hlinebefore
Number of HiddenLines before the central line in Plot.
int avgmode
Flag to set Averaging mode: 0 = Repeat measurements for fixed number, 1 = Repeat measurements for fix...
int DeltaSZA
= 1 Delta SZA measurements activated, = 0 Continous measurements
int plotYRange
0 –> full range; 1 –> min/max
int resetFreq
frequency of DAS/Windows Reset
int WindowsReboot
Flag that became 1 when Windows reboot is setted (SetWinowsReset)
int hlineafter
Number of HiddenLines after the central line in Plot.
das DAS
Definition: DAS_Spat.c:85
int pixcorr
Flag to set defective pixel correction: 0=NOT Corrected, 1=Corrected.
int ftpbackup
Flag to set back up: 0 = NO FTP Back-UP; 1 = Perform FTP Back-UP.
int imgtype
Flag to set Image type: 0=MONOINT, 1=RGB.
int settempvar
int ExeDSZA
= 1 the measurements are performed, = 0 waiting for the next deltasza.
int filename
Flag to set file name mode 0=Free choice, 1 = Automatic.
int darksource
Flag to set Dark source: 0 = Blind Pixels, 1 = Full Frame.
int resetType
type of period for DAS Reset: 0=Hours, 1=Days

§ InitFlags()

void InitFlags ( void  )

Definition at line 952 of file DAS_Spat.c.

References stepm::Addr, flag::ADPC104, flag::ADTempTest, ADTESTER, AMS1, AMS2, AMS3, flag::AMS_H, optionini::amsprogbar, bil::BLENS, omuthr::CoolCnt, nova::DigIn, nova::DigOut, MirrorSt::Dir, das::DOption, GratingSt::dp, flag::exec, flag::extlamp, flag::extshutter, doas::FFTFilter, flag::fileprg, FLAG, das::Flag, tools::FlagDisplay, tools::FlagFilter, tools::FlagShutter, tools::FlagSpikes, dpwd::FlgSh_PWD, flag::manhormeas, das::Marconi, das::Nova, MirrorSt::Off, marconi::Offset, flag::OMU_TempReached, adtester::OutputMode, omuthr::PID_kd, omuthr::PID_ki, omuthr::PID_kp, omuthr::PID_On, blens::Pix, MirrorSt::Pos, ZenithSt::Pos, PrgFile, marconi::ReachTemp, optionini::resetEnabled, optionini::resetFreq, optionini::resetType, flag::settemp070, flag::settemp7080, flag::settemp8095, stepm::SM_A, stepm::SM_B, das::StepM, flag::sza, das::Tools, flag::UPS_Battery, flag::VMRsf, nova::WDT_TOUT, and flag::WindowsReboot.

Referenced by MGUIMain().

953 {
954 
955 
956 
957  ZST.Pos = 0;
958 
959 
960  FLAG.ADPC104 = 0; //Flag for PC104 Presence
961 
962  DPWD.FlgSh_PWD = 1; //PassWord Flag
963 
964  PrgFile[0] = 0; //PRG File
965 
966  DAS.Marconi.ReachTemp = 0;
967 
968  GRS.dp = 1500; //dead pulse for grating backlash recovery
969 
970 
971  ADTESTER.OutputMode = 0; // for the AD Converter
972 
973  BIL.BLENS.Pix = 1; // for the lens tool
974 
975  MIS.Pos = 0; //Init Mirror Position
976  MIS.Dir = 0; //Init Mirror Direction
977  MIS.Off = 0; //Init Mirror Offset
978 
979  DAS.StepM.SM_A = 0;
980  DAS.StepM.SM_B = 1;
981  DAS.StepM.Addr[AMS1] = 0;
982  DAS.StepM.Addr[AMS2] = 1;
983  DAS.StepM.Addr[AMS3] = 2;
984 /*
985  DAS.StepM.SM1 = 0; //Motor A (su Y11) InputMirror
986  DAS.StepM.SM2 = 1; //Motor B (su Y12) Grating
987  DAS.StepM.SM3 = 2; //Motor A (su Y11) FilterWheel
988  DAS.StepM.SM4 = 3; //Not Available
989  DAS.StepM.SM5 = 4; //Motor A (su Y11) Zenith
990  DAS.StepM.SM6 = 5; //Motor B (su Y12) Azimuth
991 */
992  FLAG.sza = 0;
993  FLAG.exec = 1;
994  FLAG.settemp8095 = 1;
995  FLAG.settemp7080 = 1;
996  FLAG.settemp070 = 1;
997 
998  FLAG.fileprg = 0; //Flag indicating the execution of a PRG file: = 0 --> No PRG File; = 1 --> PRG file in execution
999  FLAG.ADTempTest = 0;
1000  FLAG.VMRsf = 0;
1001 
1002  TOOLS.FlagFilter = 0;
1003  TOOLS.FlagSpikes = 0;
1004  TOOLS.FlagDisplay = 2;
1005 
1006  DOAS.FFTFilter = 5;
1007 
1008  FLAG.OMU_TempReached = 0;
1009 
1010 
1011 // pdas->pOMUTHR.->CoolCnt = 1;
1012 // pdas->pOMUTHR.->PID_On = 1;
1013 
1014  OMUTHR.CoolCnt = 1;
1015  OMUTHR.PID_On = 1;
1016 
1017  OMUTHR.PID_kp = 38;
1018  OMUTHR.PID_ki = 5;
1019  OMUTHR.PID_kd = (float) 0.008;
1020 
1021  FLAG.extshutter = 0; // 0 = external shutter open; 1 = external shutter closed
1022 
1023  //on 15/06/2005 only the shutter channel is used
1024  FLAG.extlamp = 0; // 0 = external lamp OFF; 1 = external lamp ON
1025  FLAG.manhormeas = 0;
1026  FLAG.AMS_H = 0;
1027  DAS.DOption.amsprogbar =0;
1028  DAS.Nova.DigOut = 0;
1029  DAS.Nova.DigIn = 0;
1030  DAS.Tools.FlagShutter = 0;
1031 
1032  DAS.Marconi.Offset = 270;
1033 
1034  DAS.Flag.UPS_Battery = 0;
1035 
1036  DAS.Nova.WDT_TOUT = 250;
1037  DAS.DOption.resetEnabled = 1;
1038  DAS.DOption.resetType = 1; //Reset period type 1=day(s), 0=hour(s)
1039  DAS.DOption.resetFreq = 7; //Reset period interval
1040  DAS.Flag.WindowsReboot = 0; //Flag that became 1 when Windows reboot is setted (\ref SetWinowsReset)
1041 
1042 
1043 
1044 }
int settemp070
flag FLAG
Definition: CreateForms.c:84
stepm StepM
Stepper motors parameters structure.
int settemp7080
optionini DOption
Options for DAS execution.
int extlamp
0 = external lamp OFF; 1 = external lamp ON
#define AMS2
AMS2 address.
tools TOOLS
tools structure
Definition: DAS_Spat.c:51
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
int sza
= 1 -> perform measurements; = 0 -> waiting mode
int VMRsf
ViewModifyReloadsystemfile: 0 = ViewModify, 1 = Reload.
short OMU_TempReached
OMU presetted temperature reached -> = 1.
int Pos
Mirror Current Position.
flag Flag
Structure for different flags.
int FlgSh_PWD
unsigned short DigOut
Digital Output.
doas DOAS
Definition: DAS_Spat.c:63
bil BIL
Definition: DAS_Spat.c:74
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
tools Tools
Push buttons for various tools.
long dp
Grating backslash recovery steps.
int ADTempTest
= 0 -> AD Converter results on the Control Panel; = 1 -> AD Converter Testing Phase(results on the co...
float PID_ki
int CoolCnt
Time Counter.
int settemp8095
int ReachTemp
CCD Temperature Reached.
int PID_On
PID activation.
int Dir
Mirror direction.
int Addr[AMSMAX]
address of AMs
int UPS_Battery
flag for UPS Battery: = 0 Normal Operation, 1 = working on UPS battery
dpwd DPWD
Danbo Passw.
Definition: DAS_Spat.c:49
int resetFreq
frequency of DAS/Windows Reset
int ADPC104
0 –> Device PC104 exist, 1 –> PC104 DOESN&#39;T exist
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
int WindowsReboot
Flag that became 1 when Windows reboot is setted (SetWinowsReset)
int FFTFilter
Fast Fourier Trasform Filter windows.
Definition: DOASdef.h:25
ZenithSt ZST
Definition: DAS_Spat.c:70
int FlagFilter
flag for filterinf
das DAS
Definition: DAS_Spat.c:85
MirrorSt MIS
Mirror.
Definition: DAS_Spat.c:61
nova Nova
NOVA structure.
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
int AMS_H
Home AMS.
int FlagDisplay
char PrgFile[_MAX_PATH]
Name of the PRG file.
Definition: DAS_Spat.c:91
int Off
Mirror Offset.
int fileprg
Flag indicating the execution of a PRG file: = 0 –> No PRG File; = 1 –> PRG file in execution...
#define AMS1
AMS1 address.
float PID_kp
int manhormeas
1 = horizontal measurements in manual mode
blens BLENS
Definition: bildef.h:252
double Pix
Definition: bildef.h:16
GratingSt GRS
Grating.
Definition: DAS_Spat.c:60
omuthr OMUTHR
Definition: DAS_Spat.c:75
unsigned char DigIn
Digital Input.
int resetEnabled
DAS/Windows reset option (1 = Enabled; 0 = disabled)
int resetType
type of period for DAS Reset: 0=Hours, 1=Days
double Pos
Zenith Current Position.
adtester ADTESTER
Definition: Chktemp.c:20
int FlagShutter
flag for shutter status. =1–> Shutter Open; =0->shutter Closed
int extshutter
0 = external shutter open; 1 = external shutter closed
unsigned short WDT_TOUT
WDT timeout.
#define AMS3
AMS3 address.
int FlagSpikes
float PID_kd
marconi Marconi
CCD Sensor struct.
+ Here is the caller graph for this function:

§ InitTempAD()

int InitTempAD ( int  mod)

Definition at line 2681 of file DAS_Spat.c.

References AllocFloatMat(), omuthr::CoolPT, D_InitPC104(), D_WriteInitLog(), DB_Pause(), MANUAL, das::Paramini, PRGFILE, SZAMASTERM, SZAMODE, TEMPORIZED, omuthr::Temptemp, TESTAD, paramini::TPelt, and WinRes().

Referenced by SZA_FirstCalc().

2682 {
2683 
2684  int er = 0;
2685  char buf[64];
2686  int adsts;
2687 
2688  if ((mod == TEMPORIZED) |
2689  (mod == PRGFILE) |
2690  (mod == TESTAD) |
2691  (mod == MANUAL) |
2692  (mod == SZAMASTERM) |
2693  (mod == SZAMODE))
2694  {
2695  er = D_InitPC104();
2696  if(er)
2697  {
2698  sprintf(buf," DMM NOT Found");
2699  D_WriteInitLog(buf);
2700 
2701  adsts = 1;
2702 
2703  //Pause Execution
2704  DB_Pause();
2705  //Windows reset
2706  WinRes();
2707 
2708  }
2709  else
2710  {
2711  sprintf(buf," DMM Found");
2712  D_WriteInitLog(buf);
2713  OMUTHR.Temptemp = AllocFloatMat(16, 4096);//buffer per la normalizzazione delle temperature
2714  OMUTHR.CoolPT = (float)DAS.Paramini.TPelt * 10;
2715  adsts = 0;
2716 
2717  }
2718  }
2719  else
2720  adsts = 1;
2721 
2722 
2723  return adsts;
2724 }
void WinRes(void)
Definition: RTC_Time.c:1067
#define TEMPORIZED
execution driven by MASTER file
#define SZAMASTERM
execution driven by MASTERSZA file ( there is the possibility to distinguish between AM and PM measur...
float CoolPT
Previous Temperature (DTA -> DC_CoolPT)
float * Temptemp
Buffer for lis temperature.
#define PRGFILE
execution driven by *.prg file
void DB_Pause(void)
Definition: CreateForms.c:3766
das DAS
Definition: DAS_Spat.c:85
int D_InitPC104(void)
Starting function that calls the driver functions used NOTE: By convention, you should capture the BY...
Definition: Dscad.c:120
#define SZAMODE
execution driven by SZAPRG file
int D_WriteInitLog(char *str)
writes devices errors(AMS, CCD...) on the Devices.log file.
Definition: Save.c:144
float * AllocFloatMat(int hp, int vp)
Definition: Spat_Plot.c:2009
omuthr OMUTHR
Definition: DAS_Spat.c:75
#define TESTAD
execution for testing PC 104 AD converter
double TPelt
OMU Target Temperature.
#define MANUAL
execution in manual mode (for lab use)
paramini Paramini
structure for the parameters defined in param.ini configuration file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LaunchBackTask()

void LaunchBackTask ( void  )

Launch the DAS Background tasks Common Tasks launched when the DAS MAIN Graphic User Interface is loaded:

Tasks depending on the Execution Modes:

Returns
void

Definition at line 2624 of file DAS_Spat.c.

References flag::ADPC104, flag::ADTempTest, ids::AUTOEX, AUTOEX_TASK_TIME, ids::CCDTEMP, CCDTEMP_TASK_TIME, flag::exemode, FLAG, das::Flag, GRAT_TASK_TIME, ids::GRATHOME, ids::LISTEMP, LISTEMP_TASK_TIME, ids::LOG, LOG_TASK_TIME, MANUAL, MRefreshTimeout(), PRGFILE, REFRESHTEMP_TASK_TIME, ids::REFRTEMP, SZAMASTERM, SZAMODE, Task_AutoEx(), Task_CCD_Temp(), Task_HomeGrat(), Task_LIS_Temp(), Task_LOG(), Task_REFRESH_Temp(), Task_Timer(), TEMPORIZED, TESTAD, TESTCCD, TESTSZAMODE, ids::TIMER, and TIMER_TASK_TIME.

Referenced by SZA_FirstCalc().

2625 {
2626  //Timer Task
2628 
2629  //Home Grating Task
2631 
2632  //Log Task
2634 
2635  //Refresh Temperatures Task
2636  if ((DAS.Flag.exemode == TEMPORIZED)|
2637  (DAS.Flag.exemode == PRGFILE) |
2638  (DAS.Flag.exemode == TESTAD) |
2639  (DAS.Flag.exemode == MANUAL) |
2640  (DAS.Flag.exemode == SZAMASTERM)|
2641  (DAS.Flag.exemode == SZAMODE))
2642  {
2643  if(FLAG.ADTempTest == 0)
2645  }
2646 
2647  if ((DAS.Flag.exemode == TEMPORIZED)|
2648  (DAS.Flag.exemode == PRGFILE) |
2649  (DAS.Flag.exemode == TESTCCD) |
2650  (DAS.Flag.exemode == MANUAL) |
2651  (DAS.Flag.exemode == SZAMASTERM)|
2652  (DAS.Flag.exemode == SZAMODE) )
2653  {
2654  // CCDTemp Task
2656 
2657  // PeltierTemp Task
2658  if((FLAG.ADPC104 == 0) | (FLAG.ADTempTest == 1))
2659  {
2661  }
2662 
2663  // Automatic Execution
2665 
2666  }
2667 
2668  if (DAS.Flag.exemode == TESTSZAMODE)
2669  {
2670  // Automatic Execution
2672 
2673  }
2674 
2675  //WDT (Watch Dog Timer) task
2676  //MRefreshTimeout(&IDS.WDT, WDT_TASK_TIME, TaskWDT, NULL);
2677 
2678 }
flag FLAG
Definition: CreateForms.c:84
int AUTOEX
Automatic Execution ID.
void MRefreshTimeout(TIMEOUT_ID *pid, CARD32 msec, TIMEOUT_CB cb, void *ud)
#define TESTCCD
execution for testing CCD Camera
#define TESTSZAMODE
execution driven by SZAPRG file
flag Flag
Structure for different flags.
#define AUTOEX_TASK_TIME
Autoexecution.
void Task_LOG(TIMEOUT_ID id, void *data)
LOG Task. Write on the LOG file during DAS execution.
Definition: RTC_Time.c:246
#define TEMPORIZED
execution driven by MASTER file
#define SZAMASTERM
execution driven by MASTERSZA file ( there is the possibility to distinguish between AM and PM measur...
void Task_REFRESH_Temp(TIMEOUT_ID id, void *data)
Temperatures Task. Refresh the temperatures during DAS execution.
Definition: Chktemp.c:1579
int GRATHOME
Home for Grating ID.
void Task_HomeGrat(TIMEOUT_ID id, void *data)
Home grating Task. 5) Check for reached end-run of the stepper motor for the grating ...
Definition: RTC_Time.c:980
void Task_Timer(TIMEOUT_ID id, void *data)
Timer Task. Very useful procedure that: 1) Provide to refresh the clock display 2) Check if daylight ...
Definition: RTC_Time.c:1184
void Task_LIS_Temp(TIMEOUT_ID id, void *data)
OMU Thermoregulation Task. Provide the thermoregulation of the Optical Mechanical Unit In addition al...
Definition: Chktemp.c:873
int TIMER
Timer ID.
int ADTempTest
= 0 -> AD Converter results on the Control Panel; = 1 -> AD Converter Testing Phase(results on the co...
int CCDTEMP
CCD Temperature ID.
int REFRTEMP
REFRESH Temperature ID.
#define LISTEMP_TASK_TIME
spectrometer termoregulation
#define GRAT_TASK_TIME
Grating Home.
#define PRGFILE
execution driven by *.prg file
int ADPC104
0 –> Device PC104 exist, 1 –> PC104 DOESN&#39;T exist
void Task_AutoEx(TIMEOUT_ID id, void *data)
Automatic Execution Task. .
Definition: RTC_Time.c:963
das DAS
Definition: DAS_Spat.c:85
ids IDS
ID tasks.
Definition: DAS_Spat.c:54
#define SZAMODE
execution driven by SZAPRG file
int LISTEMP
Lis Temperature ID.
#define TIMER_TASK_TIME
timer
#define REFRESHTEMP_TASK_TIME
refresh of the spectrometer&#39;s temperatures.
int LOG
Log ID.
#define CCDTEMP_TASK_TIME
CCD temperature.
#define LOG_TASK_TIME
LOG files.
#define TESTAD
execution for testing PC 104 AD converter
int exemode
Set the Execution MODE (Execution modes)
#define MANUAL
execution in manual mode (for lab use)
void Task_CCD_Temp(TIMEOUT_ID id, void *data)
CCD Temperature Task. Provide the thermoregulation of the CCD sensor during DAS execution.
Definition: Chktemp.c:1068
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadAMS()

int LoadAMS ( void  )

Definition at line 1201 of file DAS_Spat.c.

References _MAX_PATH, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, FlushLine(), stepm::hometype, stepm::multiplier, stepm::NAMS, paramini::Offset, das::Paramini, stepm::power, ReadLine(), stepm::slope, stepm::speed, stepm::step, and das::StepM.

Referenced by SZA_FirstCalc().

1202 {
1203 
1204  FILE *fs;
1205  char str[80];
1206  int c, i, k;
1207 
1208  char buff[_MAX_PATH];
1209 
1210  sprintf(buff, "%s\\AMS.INI", BIL.DFILEM.CONFIGDIREQUIPMENT);
1211 
1212 
1213  fs = fopen(buff, "r");
1214  if(fs == NULL) return 1;
1215 
1216  // Header
1217  ReadLine(str, 80, fs); //###############################################
1218  ReadLine(str, 80, fs); //# AMS.INI #
1219  ReadLine(str, 80, fs); //# Main configuration file for AMS Devices #
1220  ReadLine(str, 80, fs); //###############################################
1221  ReadLine(str, 80, fs); //# ------------------------------------------- #
1222  ReadLine(str, 80, fs); //# by DanBo Date at Time #
1223  ReadLine(str, 80, fs); //# ------------------------------------------- #
1224 
1225  // Number of AMS
1226  ReadLine(str, 80, fs);//# Number of AMS #
1227  fscanf(fs, "%d", &DAS.StepM.NAMS);
1228  FlushLine(str, 80, fs);
1229 
1230 
1231  for (i = 0; i < DAS.StepM.NAMS; i++)
1232  {
1233  for (k=0; k<2; k++)
1234  {
1235  ReadLine(str, 80, fs);//# Input Mirror Stepper Motor - SM1 #
1236  ReadLine(str, 80, fs);//# SM1 Power (0 = 0A - 76 = 1.52A) #
1237 
1238  fscanf(fs, "%d", &DAS.StepM.power[i][k]);
1239  if((DAS.StepM.power[i][k] < 0) | (DAS.StepM.power[i][k] > 76))
1240  return 2;
1241 
1242  FlushLine(str, 80, fs);
1243  ReadLine(str, 80, fs);//# SM1 Step (0=400s/r, 1=800s/r,2=1000/sr) #
1244 
1245  fscanf(fs, "%d", &DAS.StepM.step[i][k]);
1246  if((DAS.StepM.step[i][k] < 0) | (DAS.StepM.step[i][k] > 14))
1247  return 3;
1248 
1249  FlushLine(str, 80, fs);
1250  ReadLine(str, 80, fs);//# SM1 Slope (0 - 255) #
1251 
1252  fscanf(fs, "%d", &DAS.StepM.slope[i][k]);
1253  if((DAS.StepM.slope[i][k] < 0) | (DAS.StepM.slope[i][k] > 255))
1254  return 4;
1255 
1256  FlushLine(str, 80, fs);
1257  ReadLine(str, 80, fs);//# SM1 Speed Hz (PS = 125*(n+1), n=0,1..255) #
1258 
1259  fscanf(fs, "%d", &DAS.StepM.speed[i][k]);
1260  if((DAS.StepM.speed[i][k] < 0) | (DAS.StepM.speed[i][k] > 255))
1261  return 5;
1262 
1263  FlushLine(str, 80, fs);
1264  ReadLine(str, 80, fs);//# SM1 Multiplier #
1265 
1266  fscanf(fs, "%f", &DAS.StepM.multiplier[i][k]);
1267  FlushLine(str, 80, fs);
1268 
1269 
1270  }
1271  }
1272 
1273 
1274 
1275  // Legge gli offset dei vari stepper
1276  // ad oggi 9 valori
1277  ReadLine(str, 80, fs);
1278  ReadLine(str, 80, fs);
1279  for(c = 0; c < 9; c++)
1280  fscanf(fs,"%d" , &DAS.Paramini.Offset[c]);
1281  FlushLine(str, 80, fs);
1282 
1283  ReadLine(str, 80, fs);
1284  ReadLine(str, 80, fs);
1285 
1286  for(i = 0; i < DAS.StepM.NAMS; i++)
1287  {
1288  for(k = 0; k < 2; k++)
1289  {
1290  fscanf(fs,"%d" , &DAS.StepM.hometype[i][k]);
1291  }
1292  }
1293 
1294  FlushLine(str, 80, fs);
1295 
1296 
1297  ReadLine(str, 80, fs);
1298  fclose(fs);
1299 
1300  return 0;
1301 
1302 
1303 
1304 }
stepm StepM
Stepper motors parameters structure.
int hometype[AMSMAX][2]
int NAMS
Number of AMSs Devices.
int Offset[16]
Offset of the hardware devices (Input Mirror (5), Grating, Filter Wheel...)
int slope[AMSMAX][2]
Stepper Motors Slope.
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
bil BIL
Definition: DAS_Spat.c:74
d_fileman DFILEM
Definition: bildef.h:257
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
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
#define _MAX_PATH
Definition: Dildef.h:202
das DAS
Definition: DAS_Spat.c:85
void FlushLine(char *buf, int nc, FILE *f)
Flush line of file f read a maximum of nc character since when the read char is different from ch(10)...
Definition: Load.c:54
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
int power[AMSMAX][2]
Stepper Motors Power.
paramini Paramini
structure for the parameters defined in param.ini configuration file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadSetDirs()

void LoadSetDirs ( void  )

Definition at line 3384 of file DAS_Spat.c.

References _MAX_PATH, d_fileman::CONFIGDIRCOMMON, DAS_Message(), d_fileman::DATADIRECTORY, bil::DFILEM, DI_PathExist(), d_fileman::DIRDCL, d_fileman::HOMEDIRECTORY, and d_fileman::LOGDIR.

Referenced by MGUIMain().

3385 {
3386 
3387 
3388  int er;
3389  char buf[_MAX_PATH];
3390 
3391  /**********************************************************************/
3392  //Load home Directory
3393  _getcwd( BIL.DFILEM.HOMEDIRECTORY, _MAX_PATH );
3394  /**********************************************************************/
3395  /**********************************************************************/
3396  //Set LOG Directory
3397  sprintf(BIL.DFILEM.LOGDIR, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "Log" );
3398  sprintf(buf, "%s\\", BIL.DFILEM.LOGDIR );
3399  // Check Path Existence
3400  // Return: 1 if PATH exist, else return 0
3401  er = DI_PathExist(buf);
3402  if (!er)
3403  {
3404  sprintf(buf,"Path '%s' deos not exist,\nDAS will create the requested folder ", BIL.DFILEM.LOGDIR);
3405  DAS_Message(buf, 0);
3406  //er = MMessageDialog ("DAS ERROR ", buf, "OK",NULL);
3407  if( _mkdir( BIL.DFILEM.LOGDIR ) == 0 ) //Create LOG Folder
3408  {
3409  sprintf(buf,"Path '%s' created ", BIL.DFILEM.LOGDIR);
3410  DAS_Message(buf, 0);
3411  //MMessageDialog ("DAS inf ", "Path created", "OK",NULL);
3412  }
3413  }
3414  /**********************************************************************/
3415  /**********************************************************************/
3416  //Set Data Directory
3417  sprintf(BIL.DFILEM.DATADIRECTORY, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "Data" );
3418  sprintf(buf, "%s\\", BIL.DFILEM.DATADIRECTORY );
3419  // Check Path Existence
3420  // Return: 1 if PATH exist, else return 0
3421  er = DI_PathExist(buf);
3422  if (!er)
3423  {
3424  sprintf(buf,"Path '%s' deos not exist,\nDAS will create the requested folder ", BIL.DFILEM.DATADIRECTORY);
3425  DAS_Message(buf, 0);
3426  //er = MMessageDialog ("DAS ERROR ", buf, "OK",NULL);
3427  if( _mkdir( BIL.DFILEM.DATADIRECTORY ) == 0 ) //Create DATA Folder
3428  {
3429  sprintf(buf,"Path '%s' created ", BIL.DFILEM.DATADIRECTORY);
3430  DAS_Message(buf, 0);
3431  //MMessageDialog ("DAS inf ", "Path created", "OK",NULL);
3432  }
3433  }
3434 
3435  /**********************************************************************/
3436  //Set Common Config Directory
3437  sprintf(BIL.DFILEM.CONFIGDIRCOMMON, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "Config" );
3438  /**********************************************************************/
3439  /**********************************************************************/
3440  //Set Camera Select Config Directory
3441  sprintf(BIL.DFILEM.DIRDCL, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "dcl");
3442  /**********************************************************************/
3443 
3444 
3445 }
char LOGDIR[_MAX_PATH]
Definition: bildef.h:209
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
char DATADIRECTORY[_MAX_PATH]
Definition: bildef.h:201
void DAS_Message(char *str, int er)
Definition: Errors.c:74
bil BIL
Definition: DAS_Spat.c:74
d_fileman DFILEM
Definition: bildef.h:257
char DIRDCL[_MAX_PATH]
Definition: bildef.h:210
#define _MAX_PATH
Definition: Dildef.h:202
C_DEF int DI_PathExist(char *path)
char CONFIGDIRCOMMON[_MAX_PATH]
Definition: bildef.h:206
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadWlstep()

int LoadWlstep ( void  )

load the file of the wavelength vs steps

Definition at line 258 of file DAS_Spat.c.

References _MAX_PATH, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, FlushLine(), ReadLine(), wav, and wl.

Referenced by MGUIMain().

259 {
260  FILE *fs;
261  char str[80];
262  int c, i;
263  char buff[_MAX_PATH];
264 
265  sprintf(buff, "%s\\wlstep.ini",BIL.DFILEM.CONFIGDIREQUIPMENT);
266 
267 
268  fs = fopen(buff, "r");
269  if(fs == NULL) return 1;
270 
271  //
272  ReadLine(str, 80, fs); //###############################################
273  ReadLine(str, 80, fs); //# Param.INI #
274  ReadLine(str, 80, fs); //# Main configuration file for SPATRAM #
275  ReadLine(str, 80, fs); //# equipment #
276  ReadLine(str, 80, fs); //###############################################
277  ReadLine(str, 80, fs); //# ------------------------------------------- #
278  ReadLine(str, 80, fs); //# by DanBo Date at Time #
279 
280  fscanf(fs, "%d", &c); //Number of items
281  FlushLine(str, 80, fs);
282 
283  for (i=0;i<c;i++)
284  {
285  fscanf(fs, "%d %d", &wl[i], &wav[i]);
286 
287 
288  }
289  fclose(fs);
290 
291 
292  return 0;
293 }
bil BIL
Definition: DAS_Spat.c:74
d_fileman DFILEM
Definition: bildef.h:257
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
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
#define _MAX_PATH
Definition: Dildef.h:202
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
void FlushLine(char *buf, int nc, FILE *f)
Flush line of file f read a maximum of nc character since when the read char is different from ch(10)...
Definition: Load.c:54
long wav[]
Step Number definition - for SD_Grating.
Definition: DAS_Spat.c:195
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ManualModeCB()

void ManualModeCB ( MOBJECT  p,
void *  od,
void *  ad 
)

Definition at line 2224 of file DAS_Spat.c.

References flag::exemode, das::Flag, MANUAL, Master, MGUITerm(), MObjectSetBackgroundRGB(), and PrgFile.

Referenced by MDCreateSplashExe().

2225 {
2226 
2227 
2228  MOBJECT c = (void *)ad;
2229 
2230 
2231  if (c==0)
2232  {
2233  DAS.Flag.exemode = MANUAL;
2234  Master=0;
2235  PrgFile[0] = 0;
2236  MObjectSetBackgroundRGB(p, 1, 255, 0);
2237  }
2238  else
2239  {
2240  MObjectSetBackgroundRGB(p, 1, 255, 0);
2241  MGUITerm();
2242  exit(0);
2243 
2244  }
2245 // MShellUnrealize(c);
2246 // MShellDestroy(c);
2247 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
int Master
Definition: DAS_Spat.c:100
flag Flag
Structure for different flags.
void MGUITerm(void)
das DAS
Definition: DAS_Spat.c:85
static double p
Definition: SOLPOS.C:131
char PrgFile[_MAX_PATH]
Name of the PRG file.
Definition: DAS_Spat.c:91
void * MOBJECT
Definition: Mguidefs.h:192
int exemode
Set the Execution MODE (Execution modes)
#define MANUAL
execution in manual mode (for lab use)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreateSplashExe()

void MDCreateSplashExe ( )

Definition at line 2267 of file DAS_Spat.c.

References BOTTOM_ALIGN, CENTER_ALIGN, palette::DB_BG, palette::DB_BG_Albl, palette::DB_FG_Plbl, paramini::EqType, flag::exemode, False, das::Flag, GASCODNG1, HELV_LARGE, HELV_MEDIUM, lbl, MANUAL, ManualModeCB(), MCreateColForm(), MCreateLabel(), MCreatePButton(), MCreatePixmapFromFile(), MCreateRowForm(), MCreateShell(), MLoopWhileEvents(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetCompositeHeight(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MObjectSetText(), MObjectSetTransparency(), MPButtonSetCallback(), MShellDestroy(), MShellRealize(), MShellUnrealize(), das::Nova, NOVA_Out(), nowaitsplash, NoWaitSplashCB(), das::Paramini, SF_MODAL, st, TOP_ALIGN, True, nova::type, WS_ETCHED_IN, WS_NONE, and WS_SHADOW_OUT.

Referenced by ChkExeMode().

2268 {
2269 
2270 
2271  MOBJECT _colform000;
2272  MOBJECT _rowform000;
2273  MOBJECT lbl;
2274  MOBJECT lbl1;
2275  MOBJECT sh1;
2276  MOBJECT px1;
2277  MOBJECT pbutt1;
2278  char buff[128];
2279 
2280  unsigned long st, et, x;
2281  char buf[80];
2282  double tout;
2283  int er;
2284 
2285 
2286 
2287 
2288  sh1 = MCreateShell("About DAS Execution", SF_MODAL);
2289 
2290  _colform000 = MCreateColForm(sh1);
2291  MObjectSetBackgroundRGB(_colform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2292 
2293  px1 = MCreatePixmapFromFile(_colform000, "sys\\info1.bmp");
2295  MObjectSetShadow(px1, WS_NONE, 0, 0);
2296  MObjectSetCompositeWidth(px1, 32);
2297  MObjectSetCompositeHeight(px1, 32);
2298 
2299  _rowform000 = MCreateRowForm(_colform000);
2300  MObjectSetResize(_rowform000, True, True);
2301  MObjectSetBackgroundRGB(_rowform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2302 
2303  sprintf(buff, "%s","DAS Info");
2304  lbl = MCreateLabel(_rowform000, buff, HELV_LARGE);
2307  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
2308  MObjectSetTransparency(lbl, 0);
2309 
2310  sprintf(buff, "%s"," DAS is setted for automatic execution ");
2311  lbl = MCreateLabel(_rowform000, buff, HELV_MEDIUM);
2313  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
2314 
2315  sprintf(buff, "%s", " The program will start in %.1lf seconds ");
2316  lbl1 = MCreateLabel(_rowform000, buff, HELV_MEDIUM);
2318  MObjectSetShadow(lbl1, WS_ETCHED_IN, 3, 0);
2319 
2320 
2321  sprintf(buff, "%s"," You can select the 'Manual mode' or to Quit the DAS with the buttons on the right! ");
2322  lbl = MCreateLabel(_rowform000, buff, HELV_MEDIUM);
2324  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
2325 
2326 
2327  _rowform000 = MCreateRowForm(_colform000);
2328  MObjectSetResize(_rowform000, False, False);
2329  MObjectAlign(_rowform000, CENTER_ALIGN, BOTTOM_ALIGN);
2330  MObjectSetBackgroundRGB(_rowform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2331 
2332 
2333 
2334  pbutt1 = MCreatePButton(_rowform000, "MANUAL MODE", HELV_MEDIUM);
2335  MPButtonSetCallback(pbutt1, ManualModeCB, (void *) 0);
2337  MObjectSetShadow(pbutt1, WS_SHADOW_OUT, 3, 0);
2338 
2339  pbutt1 = MCreatePButton(_rowform000, "QUIT", HELV_MEDIUM);
2340  MPButtonSetCallback(pbutt1, ManualModeCB, (void *) 1);
2342  MObjectSetShadow(pbutt1, WS_SHADOW_OUT, 3, 0);
2343 
2344  pbutt1 = MCreatePButton(_rowform000, "Skip Wait", HELV_MEDIUM);
2345  MPButtonSetCallback(pbutt1, NoWaitSplashCB, (void *) 0);
2347  MObjectSetShadow(pbutt1, WS_SHADOW_OUT, 3, 0);
2348 
2349 
2350  MShellRealize(sh1);
2351 
2352  //Switch on 12 V, Hires, 24V
2353  if(DAS.Paramini.EqType == GASCODNG1)
2354  er = NOVA_Out(DAS.Nova.type, 9); //1001 bin
2355 
2356 
2357  tout = 30000;
2358  st = GetTickCount();
2359 
2360  do
2361  {
2362  et = GetTickCount();
2363  x = labs(et - st);
2364  //g = x % 10;
2365  //sprintf(buf, " %u %u", x, g);
2366  //Status (buf);
2367  MLoopWhileEvents(0);
2368  if((x % 100 == 0) && (x > 0))
2369  //if(x > 0)
2370  {
2371 
2372 // if(DAS.DOption.amsprogbar)
2373 // {
2374  //D_VRange(NULL, (long) x * 100 / tout, 255, 0, 0 );
2375 
2376  sprintf(buf, "The program will start in %.1lf seconds ", fabs(((double)(labs(et - st) - tout))/1000.0 ));
2377  MObjectSetText(lbl1,buf);
2378 
2379 // }
2380  }
2381  }while((labs(et - st) < tout) & (DAS.Flag.exemode != MANUAL) & nowaitsplash == 1);
2382 
2383  MShellUnrealize(sh1);
2384  MShellDestroy(sh1);
2385 
2386 
2387 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
#define WS_NONE
Definition: Mguidefs.h:956
MOBJECT MCreatePixmapFromFile(MOBJECT parent, const char *fname)
void ManualModeCB(MOBJECT p, void *od, void *ad)
Definition: DAS_Spat.c:2224
MOBJECT lbl
Definition: DFileMan.c:42
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
void MLoopWhileEvents(int discard)
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MShellRealize(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
flag Flag
Structure for different flags.
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
void MShellUnrealize(MOBJECT obj)
void MObjectSetText(MOBJECT obj, const char *text)
void MShellDestroy(MOBJECT obj)
palette DPAL
Definition: DAS_Spat.c:73
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define CENTER_ALIGN
Definition: Mguidefs.h:917
void MObjectSetCompositeHeight(MOBJECT obj, int h)
#define SF_MODAL
Definition: Mguidefs.h:1019
int NOVA_Out(int novatype, unsigned int out)
Write the NOVA Output port.
Definition: DAS_Spat.c:1375
MOBJECT MCreateColForm(MOBJECT parent)
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
MOBJECT MCreateShell(const char *title, int flags)
das DAS
Definition: DAS_Spat.c:85
short DB_BG[3]
Default Background Color.
nova Nova
NOVA structure.
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
static double st
Definition: SOLPOS.C:142
void * MOBJECT
Definition: Mguidefs.h:192
#define BOTTOM_ALIGN
Definition: Mguidefs.h:919
#define True
Definition: Mguidefs.h:235
int EqType
Spectrometer Type.
#define HELV_MEDIUM
Definition: Mguidefs.h:882
int nowaitsplash
Definition: DAS_Spat.c:2249
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
#define HELV_LARGE
Definition: Mguidefs.h:885
int type
type of NOVA monoboard used (7892 or 945GSE)
MOBJECT MCreateRowForm(MOBJECT parent)
#define WS_ETCHED_IN
Definition: Mguidefs.h:959
#define TOP_ALIGN
Definition: Mguidefs.h:918
void NoWaitSplashCB(MOBJECT p, void *od, void *ad)
Definition: DAS_Spat.c:2251
int exemode
Set the Execution MODE (Execution modes)
#define MANUAL
execution in manual mode (for lab use)
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
paramini Paramini
structure for the parameters defined in param.ini configuration file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreateWaitShell()

void MDCreateWaitShell ( void  )

Create a waiting window .

Returns
void

Definition at line 2408 of file DAS_Spat.c.

References BOTTOM_ALIGN, CENTER_ALIGN, palette::DB_BG, palette::DB_BG_Albl, palette::DB_FG_Plbl, False, HELV_LARGE, HELV_MEDIUM, lbl, MCreateColForm(), MCreateLabel(), MCreatePButton(), MCreatePixmapFromFile(), MCreateRowForm(), MCreateShell(), MLoopWhileEvents(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetCompositeHeight(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MObjectSetText(), MObjectSetTransparency(), MPButtonSetCallback(), MShellDestroy(), MShellRealize(), MShellUnrealize(), nowait, NoWaitCB(), SF_MODAL, st, TOP_ALIGN, True, WS_ETCHED_IN, WS_NONE, and WS_SHADOW_OUT.

Referenced by InitCCD_AMS().

2409 {
2410 
2411 
2412  MOBJECT _colform000;
2413  MOBJECT _rowform000;
2414  MOBJECT lbl;
2415  MOBJECT lbl1;
2416  MOBJECT sh1;
2417  MOBJECT px1;
2418  MOBJECT pbutt1;
2419  char buff[128];
2420 
2421  unsigned long st, et, x;
2422  char buf[80];
2423  double tout;
2424 
2425 
2426 
2427  sh1 = MCreateShell("DAS Procedure", SF_MODAL);
2428 
2429  _colform000 = MCreateColForm(sh1);
2430  MObjectSetBackgroundRGB(_colform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2431 
2432  px1 = MCreatePixmapFromFile(_colform000, "sys\\info1.bmp");
2434  MObjectSetShadow(px1, WS_NONE, 0, 0);
2435  MObjectSetCompositeWidth(px1, 32);
2436  MObjectSetCompositeHeight(px1, 32);
2437 
2438  _rowform000 = MCreateRowForm(_colform000);
2439  MObjectSetResize(_rowform000, True, True);
2440  MObjectSetBackgroundRGB(_rowform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2441 
2442  sprintf(buff, "%s","DAS Info");
2443  lbl = MCreateLabel(_rowform000, buff, HELV_LARGE);
2446  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
2447  MObjectSetTransparency(lbl, 0);
2448 
2449  sprintf(buff, "%s"," DAS is waiting for the identification of the USB driver for Hires V ");
2450  lbl = MCreateLabel(_rowform000, buff, HELV_MEDIUM);
2452  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
2453 
2454  sprintf(buff, "%s", " The program will start in %.1lf seconds ");
2455  lbl1 = MCreateLabel(_rowform000, buff, HELV_MEDIUM);
2457  MObjectSetShadow(lbl1, WS_ETCHED_IN, 3, 0);
2458 
2459 
2460  sprintf(buff, "%s"," You can continue DAS (if the driver is already loaded!!! )selecting \n the button on the right! ");
2461  lbl = MCreateLabel(_rowform000, buff, HELV_MEDIUM);
2463  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
2464 
2465 
2466  _rowform000 = MCreateRowForm(_colform000);
2467  MObjectSetResize(_rowform000, False, False);
2468  MObjectAlign(_rowform000, CENTER_ALIGN, BOTTOM_ALIGN);
2469  MObjectSetBackgroundRGB(_rowform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2470 
2471 
2472 
2473  pbutt1 = MCreatePButton(_rowform000, "Skip Wait", HELV_MEDIUM);
2474  MPButtonSetCallback(pbutt1, NoWaitCB, (void *) 0);
2476  MObjectSetShadow(pbutt1, WS_SHADOW_OUT, 3, 0);
2477 
2478  MShellRealize(sh1);
2479 
2480 
2481 
2482  tout = 20000;
2483  st = GetTickCount();
2484 
2485  do
2486  {
2487  et = GetTickCount();
2488  x = labs(et - st);
2489  MLoopWhileEvents(0);
2490  if((x % 100 == 0) && (x > 0))
2491  {
2492 // if(DAS.DOption.amsprogbar)
2493 // {
2494 
2495  sprintf(buf, "The program will start in %.1lf seconds ", fabs(((double)(labs(et - st) - tout))/1000.0 ));
2496  MObjectSetText(lbl1,buf);
2497 
2498 // }
2499  }
2500  }while(labs(et - st) < tout && nowait == 1);
2501 
2502  MShellUnrealize(sh1);
2503  MShellDestroy(sh1);
2504 
2505 
2506 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
#define WS_NONE
Definition: Mguidefs.h:956
MOBJECT MCreatePixmapFromFile(MOBJECT parent, const char *fname)
MOBJECT lbl
Definition: DFileMan.c:42
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
void MLoopWhileEvents(int discard)
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MShellRealize(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
void NoWaitCB(MOBJECT p, void *od, void *ad)
Definition: DAS_Spat.c:2393
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
void MShellUnrealize(MOBJECT obj)
void MObjectSetText(MOBJECT obj, const char *text)
void MShellDestroy(MOBJECT obj)
palette DPAL
Definition: DAS_Spat.c:73
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define CENTER_ALIGN
Definition: Mguidefs.h:917
void MObjectSetCompositeHeight(MOBJECT obj, int h)
#define SF_MODAL
Definition: Mguidefs.h:1019
MOBJECT MCreateColForm(MOBJECT parent)
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
static double st
Definition: SOLPOS.C:142
void * MOBJECT
Definition: Mguidefs.h:192
#define BOTTOM_ALIGN
Definition: Mguidefs.h:919
#define True
Definition: Mguidefs.h:235
int nowait
Definition: DAS_Spat.c:2389
#define HELV_MEDIUM
Definition: Mguidefs.h:882
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
#define HELV_LARGE
Definition: Mguidefs.h:885
MOBJECT MCreateRowForm(MOBJECT parent)
#define WS_ETCHED_IN
Definition: Mguidefs.h:959
#define TOP_ALIGN
Definition: Mguidefs.h:918
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MGUIMain()

void MGUIMain ( int  argc,
char **  argv 
)

MAIN PROGRAM starting point
Actions:
.

  • Detect and set the DAS Working Dir and set the MGUI environment (SetWorkDirMGUIenv)
  • Init Flags and Structure's elements(InitFlags)
  • Alloc colors and init palette mode (InitColors)
  • Load DAS home Dir and set Data, Config and LOG dirs (LoadSetDirs)
  • Load the actual date of program start
  • Load Geo coordinates of the station (LoadGeoCoord)
  • Load the palette for data visualization (LoadTruePalette)
  • Load the color table for the MGUI objects (LoadDasSysCol)
  • Load some of the run-time options from the file .\config\options.ini (LoadDB_Options)
  • Load the FTP settings for the data backup via FTP (LoadFTPSetting)
  • Check 2nd argument in order to set the execution mode (ChkExeMode):
    • arg = MASTER –> Exemode = TEMPORIZED (Automatic timed)
    • arg = SZAPRG –> Exemode = SZAMODE (SZA Driven)
    • arg = *.prg –> Exemode = PRGFILE (Automatic)
    • arg = TESTAMS –> Exemode = TESTAMS
    • arg = OFFLINEPLOT –> Exemode = OFFLINEPLOT(Off Line Plot)
    • arg = TESTCCD –> Exemode = TESTCCD,
    • arg = HELP –> Exemode = HELP,
    • arg = DEMO –> Exemode = DBDEMO
    • arg = " " –> Exemode = MANUAL (DAS MAIN Graphic User Interface)
    • arg = TESTAD –> Exemode = TESTAD
    • arg = DOAS –> Exemode = DOASMODE (DOAS Mode)
    • arg = *.log –> Exemode = LOGMODE (LOG Mode)
  • Build appropriate GUI depending on the selected execution mode
    • Execution Mode = OFFLINEPLOT
      • Check the existence of a 3rd argument (data file name - *.dat or *.bif)
        • 3rd argument –> Buid the GUI and Plot the selected data file (RunOLP)
        • NO 3rd arhument –> Buid the GUI for the data visualization (RunOLP)
    • Execution mode = DOASMODE
    • Execution mode = LOGMODE
      • Check if the argument is a valid LOG file, read the file and plot it (LOG Mode)
    • Execution mode = TEMPORIZED, TESTAMS, TESTCCD, TESTAD, DBDEMO, PRGGFILE, MANUAL)
      • Create the DAS main shell (RunFULL)
        Returns
        void

Definition at line 3546 of file DAS_Spat.c.

References _MAX_PATH, BuildShell(), ChkExeMode(), d_fileman::CONFIGDIRCOMMON, d_fileman::CONFIGDIREQUIPMENT, D_WriteInitLog(), DAS_StartDOY, DAS_StartHour, bil::DFILEM, das::DGeo, DI_PathExist(), das::DOption, ERR_Option(), flag::exemode, das::Flag, optionini::ftpbackup, GetDateTime(), d_fileman::HOMEDIRECTORY, InitColors(), InitFlags(), LoadDasSysCol(), LoadDB_DispCoeff(), LoadDB_Options(), LoadDefaultDPAL(), LoadEquipment(), LoadFTPSetting(), LoadGeoCoord(), LoadGeoDB(), LoadHardware(), LoadSetDirs(), LoadTruePalette(), LoadWlstep(), MEnableCustomizing(), MMessageDialog(), dlog::odate, spectrumheader::olddate, dlog::otime, d_geo::s_name, SetWorkDirMGUIenv(), bil::SPH, and WriteInit().

3547 {
3548 
3549 // int mrun = 0;
3550  int er;
3551 // time_t ltime;
3552  struct tm today;
3553  char buff[128], str[_MAX_PATH];
3554 
3555  struct date RDate;
3556  struct time RTime;
3557 
3558 
3559 
3560 
3562 
3563 
3564 
3565 
3566  /**********************************************************************/
3567  /**********************************************************************/
3568  // DAS Working directory and MGUI Environment
3569  er = SetWorkDirMGUIenv(argv[0]);
3570  if (er == -1)
3571  {
3572  //Unable to set the enviromental variable
3573  }
3574 
3575  /**********************************************************************/
3576  /**********************************************************************/
3577 
3578  InitFlags();// For Flags and structure initialization
3579  /**********************************************************************/
3580  /**********************************************************************/
3581  // For Color and palette init
3582  InitColors();
3583  /**********************************************************************/
3584 
3585  /**********************************************************************/
3586  //Load home dir. and set Data, Config and Log Dirs
3587  LoadSetDirs();
3588  /**********************************************************************/
3589 
3590  /**********************************************************************/
3591  // Load Equipment.ini
3592  er = LoadEquipment(); //In order to know wich instrument will be used
3593  if(er == 1)
3594  {
3595  sprintf(str,"File %s\\Equipment.ini not found,\nThe program will be closed.\n ", BIL.DFILEM.CONFIGDIRCOMMON);
3596  MMessageDialog ("DAS ERROR ", str, "OK",NULL);
3597  exit(0);
3598  }
3599  if(er > 1)
3600  {
3601  sprintf(str,"Equipment with code '%d' not recognized!!!!\nCheck the '%s\\Equipment.ini' file\nor\nConsulte the DAS Help\nThe program will be closed.\n ", er, BIL.DFILEM.CONFIGDIRCOMMON);
3602  MMessageDialog ("DAS ERROR ", str, "OK",NULL);
3603  exit(0);
3604  }
3605  /**********************************************************************/
3606  //Set path for the DCL
3607  sprintf(buff, "%s", BIL.DFILEM.CONFIGDIREQUIPMENT );
3608  // Return: 1 if PATH exist, else return 0
3609  er = DI_PathExist(buff);
3610  if (er)
3611  {
3612  //Set path for the DCL
3613 // DC_SetPathName(buff);
3614  }
3615 
3616  /**********************************************************************/
3617  er = LoadWlstep();
3618  if(er)
3619  {
3620  sprintf(str,"File '%s\\WlStep.ini' not found,\nThe program will be closed.\n ", BIL.DFILEM.CONFIGDIREQUIPMENT);
3621  MMessageDialog ("DAS ERROR ", str, "OK",NULL);
3622  exit(0);
3623  }
3624 
3625  er = LoadHardware();
3626  if(er)
3627  {
3628  sprintf(str,"File %s\\Hardware.ini not found,\nThe program will be closed.\n ", BIL.DFILEM.CONFIGDIREQUIPMENT);
3629  MMessageDialog ("DAS ERROR ", str, "OK",NULL);
3630  exit(0);
3631  }
3632 
3633 
3634  /**********************************************************************/
3635  //Load the actual date of program start
3636 
3637  GetDateTime(&RDate, &RTime, &today);
3638  /* Get UNIX-style time */
3639  //time( &ltime );
3640  /* Use time structure to build a customized time string. */
3641  //today = localtime( &ltime );
3642  /* Use strftime to build a customized time string. */
3643  strftime( DLOG.odate, 7,"%y%m%d", &today );
3644  strftime( DLOG.otime, 9,"%H:%M:%S", &today );
3645  sprintf(BIL.SPH.olddate, "%s",DLOG.odate);
3646  DAS_StartHour = (int)(((double)today.tm_hour + 30.0/60.0) * 10);
3647  DAS_StartDOY = (int)(((double)today.tm_yday + 12.0/24.0) * 10); //next reset at StartDay + DAS.DOption.resetFreq
3648 
3649 
3650  sprintf(buff, "*******************************************************");
3651  D_WriteInitLog(buff);
3652  sprintf(buff, "DAS Started on %s at %s", DLOG.odate, DLOG.otime );
3653  D_WriteInitLog(buff);
3654 
3655  /**********************************************************************/
3656 
3657  /**********************************************************************/
3658  //Load the color table for the MGUI objects
3659  er = LoadDasSysCol();
3660  if(er)
3661  {
3662  LoadDefaultDPAL();
3663  sprintf(str,"File %s\\DASSysColor.INI not found,\nThe default DAS colors will be used.\n ", BIL.DFILEM.CONFIGDIREQUIPMENT);
3664  MMessageDialog ("DAS ERROR ", str, "OK",NULL);
3665 
3666  LoadDefaultDPAL();
3667  }
3668  /**********************************************************************/
3669  /**********************************************************************/
3670  // Load the palette for data visualization
3671  er = LoadTruePalette();
3672  if(er)
3673  {
3674  sprintf(str,"File '%s\\PALETTES\\DANBOMAP1.MAP' not found,\n", BIL.DFILEM.HOMEDIRECTORY);
3675  MMessageDialog ("DAS ERROR ", str, "OK",NULL);
3676 
3677  }
3678 
3679  /**********************************************************************/
3680 
3681  /**********************************************************************/
3682  //Load Geo coordinates of the station
3683  er = LoadGeoCoord();
3684  if(er)
3685  {
3686  sprintf(str,"File '%s\\GeoCoord.INI' not found,\nPlease supply a valid GeoCoord.INI file for the computation of the SZA and Sun Position", BIL.DFILEM.CONFIGDIREQUIPMENT);
3687  MMessageDialog ("DAS ERROR ", str, "OK",NULL);
3688  }
3689  /**********************************************************************/
3690  //Load Database of stations Geo coordinates
3691  er = LoadGeoDB();
3692  /**********************************************************************/
3693  //Load dispersion Parameters
3694  er = LoadDB_DispCoeff();
3695 
3696 
3697  /**********************************************************************/
3698  /**********************************************************************/
3699  //Log File
3701  /**********************************************************************/
3702  /**********************************************************************/
3703  //Load Fonts
3704  // er = LoadDFONT();
3705  // if(er)
3706  // {
3707  // LoadDefaultDFONT();
3708  // }
3709  /**********************************************************************/
3710  /**********************************************************************/
3711  //Load options from file .\config\'Instrument'\options.ini
3712 
3713 
3714  er = LoadDB_Options();
3715  if(er)
3716  {
3717  if (er == 1)
3718  {
3719  sprintf(str, "%s\nPlease supply a valid %s\\Option.INI file or contact Danbo - db@uevora.pt\nNow DAS will quit!!", ERR_Option(er), BIL.DFILEM.CONFIGDIREQUIPMENT );
3720  MMessageDialog("DAS Inf. - Errors in OPTION.INI file", str, "OK", NULL);
3721  exit(0);
3722 
3723  }
3724  if (er > 1 && er < 40)
3725  {
3726  //Errors for OPTION.INI files
3727  sprintf(str, "Err.: %d - %s\nEdit %s\\Option.INI file and correct or contact Danbo - db@uevora.pt\nNow DAS will quit!!",er, ERR_Option(er), BIL.DFILEM.CONFIGDIREQUIPMENT );
3728  MMessageDialog("DAS Inf. - Errors in OPTION.INI file", str, "OK", NULL);
3729  exit(0);
3730 
3731 
3732  //Init Default Options
3733  //InitDefaultOptions();
3734  }
3735  if (er == 999)
3736  {
3737  sprintf(str, "The %s\\Option.INI file is present but not valid.\nProbably the file is from a previous DAS realise\nPlease supply a valid %s\\Option.INI file or contact Danbo - db@uevora.pt\nDAS can NOT continue the execution and it will quit!!", BIL.DFILEM.CONFIGDIREQUIPMENT,BIL.DFILEM.CONFIGDIREQUIPMENT );
3738  MMessageDialog("DAS Inf. - Errors in OPTION.INI file", str, "OK", NULL);
3739  exit(0);
3740 
3741  }
3742 
3743  }
3744  /**********************************************************************/
3745  /**********************************************************************/
3746  // Load the FTP settings for the data backup via FTP
3747  if(DAS.DOption.ftpbackup)
3748  {
3749  er = LoadFTPSetting();
3750  if (er)
3751  {
3752  sprintf(str, "The %s\\FTP.INI file not found.\n The Data back-up can not be done!\nPlease supply a valid %s\\FTP.INI file or contact Danbo - db@uevora.pt\nNow DAS will quit!!", BIL.DFILEM.CONFIGDIREQUIPMENT,BIL.DFILEM.CONFIGDIREQUIPMENT );
3753  MMessageDialog("DAS Inf. - Errors in FTP.INI file", str, "OK", NULL);
3754 
3755  DAS.DOption.ftpbackup = 0;
3756  }
3757  }
3758  /**********************************************************************/
3759  /**********************************************************************/
3760  // Check the execution mode (TEMPORIZED, TESTAMS, OFFLINEPLOT, TESTCCD,
3761  // TESTAD, DEMO, ?, PrgFile, MANUAL)
3762  ChkExeMode(argc, argv);
3763  /**********************************************************************/
3764 
3765 
3766  /**********************************************************************/
3767 
3768  /**********************************************************************/
3769  /* Build and Execute the shell depending on the execution mode*/
3770  /**********************************************************************/
3771  BuildShell(DAS.Flag.exemode, argv);
3772 
3773 }
char odate[10]
Old Date.
void InitFlags(void)
Definition: DAS_Spat.c:952
optionini DOption
Options for DAS execution.
int LoadHardware(void)
Definition: Load.c:1170
int LoadWlstep(void)
load the file of the wavelength vs steps
Definition: DAS_Spat.c:258
dlog DLOG
Definition: DAS_Spat.c:52
void ChkExeMode(int mod, char **p)
Definition: DAS_Spat.c:3177
flag Flag
Structure for different flags.
void LoadDefaultDPAL(void)
Load Default system colors. Procedure that load the DAS colors if the file {homedir}/config/DASSysCol...
Definition: Load.c:762
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
char otime[10]
Old Time.
int LoadGeoCoord(void)
Load Geographic Coordinate of the station. Procedure that load the Geographic Coordinate of the stati...
Definition: Load.c:1477
int LoadGeoDB(void)
Definition: Load.c:1432
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
int LoadDB_Options(void)
Load Options. Procedure that load the Options in the file {homedir}/config/Options.INI.
Definition: Load.c:390
char olddate[8]
Definition: bildef.h:158
void MEnableCustomizing(void)
int LoadTruePalette(void)
Load the palette map. Procedure that load the palette map from file {homedir}/Palettes/Danbomap1.map.
Definition: Load.c:948
void InitColors(void)
Definition: DAS_Spat.c:3371
bil BIL
Definition: DAS_Spat.c:74
d_geo DGeo
struct for Station location
char s_name[4]
Station name.
d_fileman DFILEM
Definition: bildef.h:257
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
char * ERR_Option(int ercode)
Alerts for OPTION.INI errors Creates a message window reporting the reasons for the error...
Definition: Load.c:325
Definition: Dildef.h:240
int DAS_StartDOY
Definition: DAS_Spat.c:107
void WriteInit(const char *sname, char *dateffn, char *timebuff)
Init the daily LOG file .
Definition: RTC_Time.c:158
int LoadDasSysCol(void)
Load system colors. Procedure that load the DAS colors in the file {homedir}/config/DASSysColor.INI.
Definition: Load.c:811
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
das DAS
Definition: DAS_Spat.c:85
int LoadFTPSetting(void)
Load FTP Setting for daily back-up.
Definition: Load.c:286
int LoadEquipment(void)
Load the type of Equipment. {homedir}/config/param.ini.
Definition: Load.c:1089
int SetWorkDirMGUIenv(char *buff)
set DAS and MGUI enviroment when the program is launched undirectly (for offlineplot or log or auto o...
Definition: DAS_Spat.c:3353
int LoadDB_DispCoeff(void)
Load dispersion parameters. Procedure that load the dispersion parameters from file {homedir}/DOAS/Di...
Definition: Load.c:234
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
int ftpbackup
Flag to set back up: 0 = NO FTP Back-UP; 1 = Perform FTP Back-UP.
int D_WriteInitLog(char *str)
writes devices errors(AMS, CCD...) on the Devices.log file.
Definition: Save.c:144
Definition: Dildef.h:234
C_DEF int DI_PathExist(char *path)
char CONFIGDIRCOMMON[_MAX_PATH]
Definition: bildef.h:206
void BuildShell(int emode, char **argum)
Definition: DAS_Spat.c:3516
int exemode
Set the Execution MODE (Execution modes)
int DAS_StartHour
Definition: DAS_Spat.c:106
void LoadSetDirs(void)
Definition: DAS_Spat.c:3384
+ Here is the call graph for this function:

§ MGUIQuitCB()

int MGUIQuitCB ( MOBJECT  shell,
void *  od,
void *  ad 
)

Exit MGUI Library. Procedure that close MGUI .

Returns
void

Definition at line 728 of file DAS_Spat.c.

References MGUITerm(), MMessageDialog(), MShellDestroy(), and MShellUnrealize().

Referenced by MDCreateDOAS_MainSh(), RunLogMode(), and RunOLP().

729 {
730  if (MMessageDialog("DAS Exit Message", "Do you really want to quit ?", " Yes ", " No ", NULL))
731  return;
732  MShellUnrealize(shell);
733  MShellDestroy(shell);
734  MGUITerm();
735  exit(0);
736 }
void MShellUnrealize(MOBJECT obj)
void MShellDestroy(MOBJECT obj)
void MGUITerm(void)
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ NOVA_In()

int NOVA_In ( int  novatype,
unsigned int  DigIn 
)

Read the NOVA Input port.

Parameters
novatype= type of NOVA monoboard
DigIn= value read on the input port

Definition at line 1306 of file DAS_Spat.c.

References DBDEMO, DIO_GetInput(), flag::exemode, das::Flag, InByte(), ISMM_Close(), ISMM_Open(), MMessageDialog(), NOVA7892, and NOVA945GSE.

Referenced by CONFP_AMS_NOVA(), and NOVAIn_CB().

1307 {
1308 
1309  int er=0;
1310 
1311 
1312 
1313  if(novatype == NOVA7892)
1314  {
1315  er=InByte(0x240, &DigIn);
1316  return er;
1317  }
1318  if(novatype == NOVA945GSE)
1319  {
1320 
1321  //Definition for NOVA945GSE I/O (IT8712F)
1322  HANDLE hIsmm;
1323 // HWM_DATA gHwmData;
1324 // UCHAR szBuf[32];
1325 // WORD wNodeCount, wBufSize, ii;
1326 // FLOAT *pfValue;
1327 // ULONG *plValue;
1328  //DIO Var
1329 // WORD wDioConfig;
1330 // WORD wDioOut;
1331 
1332 
1333 
1334  hIsmm = ISMM_Open();
1335  if (hIsmm == INVALID_HANDLE_VALUE)
1336  {
1337  //printf("Can not open iSMM device\n");
1338  if (DAS.Flag.exemode == DBDEMO)
1339  return 0;
1340  else
1341  {
1342  MMessageDialog("I/O Tester", "Can not open iSMM device", "OK", NULL);
1343  return -1;
1344  }
1345  }
1346  // get DIO Config
1347  //if ( DIO_GetConfig(hIsmm, &wDioConfig) )
1348 // er = DIO_GetConfig(hIsmm, &wDioConfig) ;
1349 // if ( er )
1350 // { MMessageDialog("Super I/O Tester", "DIO Found", "OK", NULL);
1351 // }
1352 
1353  // get DIO Input
1354  if ( DIO_GetInput(hIsmm, &(unsigned short) DigIn))
1355  {
1356 
1357  }
1358 
1359  // set DIO OutPut
1360  //if ( DIO_SetOutput(hIsmm, (WORD) &DigIn) )
1361  //{
1362 
1363  //}
1364 
1365 
1366 
1367  ISMM_Close(hIsmm);
1368  return er;
1369  }
1370  return er;
1371 
1372 }
flag Flag
Structure for different flags.
#define DBDEMO
execution in demo mode
#define NOVA945GSE
NOVA945GSE (SPATRAM2, GASCODNG1, GASCODNG4)
PREFUNCTION int MIDFUNCTION InByte(unsigned short Port, int *Data)
ISMM_API BOOL ISMM_Close(HANDLE hIsmm)
ISMM_API BOOL DIO_GetInput(HANDLE hIsmm, PWORD pwDioData)
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
das DAS
Definition: DAS_Spat.c:85
#define NOVA7892
NOVA7892 monoboard (old)
ISMM_API HANDLE ISMM_Open(void)
int exemode
Set the Execution MODE (Execution modes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ NOVA_Out()

int NOVA_Out ( int  novatype,
unsigned int  DigOut 
)

Write the NOVA Output port.

Parameters
novatype= type of NOVA monoboard
DigOut= value to be written on the output port

Definition at line 1375 of file DAS_Spat.c.

References DBDEMO, DIO_GetConfig(), DIO_GetOutput(), DIO_SetOutput(), DWORD, flag::exemode, das::Flag, ISMM_Close(), ISMM_Open(), MMessageDialog(), NOVA6612G2, NOVA7892, NOVA945GSE, OutByte(), and WORD.

Referenced by InitCCD_AMS(), MDCreateSplashExe(), NOVAOut_CB(), ShutCB(), and WinRes().

1376 {
1377 
1378  int er=0;
1379 
1380 
1381 
1382  if(novatype == NOVA7892)
1383  {
1384  er=OutByte(0x240, out);
1385  return er;
1386  }
1387 
1388  if(novatype == NOVA6612G2)
1389  {
1390 
1391  //Definition for NOVA6612G2 I/O (W83697HF)
1392  HANDLE hndFile; // Handle to device, obtain from CreateFile
1393 // UCHAR data_b;
1394  WDTPARAM cParam;
1395  DWORD nReturn;
1396 
1397  hndFile = CreateFile(WDT_DEVICE, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE,
1398  NULL, OPEN_EXISTING, 0, NULL);
1399 
1400  cParam.data_b=out;
1401  DeviceIoControl(hndFile, IOCTL_SYS_DIO_WRITE,
1402  &cParam, sizeof(WDTPARAM), 0, 0, &nReturn, NULL);
1403 
1404  CloseHandle(hndFile);
1405  return er;
1406  }
1407 
1408 
1409  if(novatype == NOVA945GSE)
1410  {
1411 
1412  //Definition for NOVA945GSE I/O (IT8712F)
1413  HANDLE hIsmm;
1414 // HWM_DATA gHwmData;
1415 // UCHAR szBuf[32];
1416 // WORD wNodeCount, wBufSize, ii;
1417 // FLOAT *pfValue;
1418 // ULONG *plValue;
1419  //DIO Var
1420  WORD wDioConfig;
1421  WORD wDioOut;
1422 
1423 
1424 
1425  hIsmm = ISMM_Open();
1426  if (hIsmm == INVALID_HANDLE_VALUE)
1427  {
1428  //printf("Can not open iSMM device\n");
1429  if (DAS.Flag.exemode == DBDEMO)
1430  return 0;
1431  else
1432  {
1433 
1434  MMessageDialog("I/O Tester", "Can not open iSMM device", "OK", NULL);
1435  return -1;
1436  }
1437  }
1438  // get DIO Config
1439  if ( DIO_GetConfig(hIsmm, &wDioConfig) )
1440  er = DIO_GetConfig(hIsmm, &wDioConfig) ;
1441 // if ( er )
1442 // { MMessageDialog("Super I/O Tester", "DIO Found", "OK", NULL);
1443 // }
1444 
1445  // get DIO Output
1446  if ( DIO_GetOutput(hIsmm, &wDioOut) )
1447  {
1448  }
1449 
1450  // set DIO OutPut
1451  if ( DIO_SetOutput(hIsmm, (WORD) out) )
1452  {
1453 
1454  }
1455 
1456 
1457  ISMM_Close(hIsmm);
1458  return er;
1459  }
1460 
1461  return er;
1462 
1463 }
PREFUNCTION int MIDFUNCTION OutByte(unsigned short Port, int Data)
flag Flag
Structure for different flags.
#define DBDEMO
execution in demo mode
#define NOVA945GSE
NOVA945GSE (SPATRAM2, GASCODNG1, GASCODNG4)
#define NOVA6612G2
NOVA6612G2 (not used in TROPOGAS, LIS, GASCODNG2/3)
#define WORD
Definition: DSCUD.H:65
ISMM_API BOOL ISMM_Close(HANDLE hIsmm)
ISMM_API BOOL DIO_GetConfig(HANDLE hIsmm, PWORD pwDioConfig)
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
das DAS
Definition: DAS_Spat.c:85
#define DWORD
Definition: DSCUD.H:75
#define NOVA7892
NOVA7892 monoboard (old)
ISMM_API HANDLE ISMM_Open(void)
ISMM_API BOOL DIO_SetOutput(HANDLE hIsmm, WORD wDioData)
int exemode
Set the Execution MODE (Execution modes)
ISMM_API BOOL DIO_GetOutput(HANDLE hIsmm, PWORD pwDioData)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ NoWaitCB()

void NoWaitCB ( MOBJECT  p,
void *  od,
void *  ad 
)

Definition at line 2393 of file DAS_Spat.c.

References nowait.

Referenced by MDCreateWaitShell().

2394 {
2395 
2396 
2397  MOBJECT c = (void *)ad;
2398 
2399  nowait = 0;
2400 
2401 
2402 
2403 }
void * MOBJECT
Definition: Mguidefs.h:192
int nowait
Definition: DAS_Spat.c:2389
+ Here is the caller graph for this function:

§ NoWaitSplashCB()

void NoWaitSplashCB ( MOBJECT  p,
void *  od,
void *  ad 
)

Definition at line 2251 of file DAS_Spat.c.

References nowaitsplash.

Referenced by MDCreateSplashExe().

2252 {
2253 
2254 
2255  MOBJECT c = (void *)ad;
2256 
2257  nowaitsplash = 0;
2258 
2259 
2260 
2261 }
void * MOBJECT
Definition: Mguidefs.h:192
int nowaitsplash
Definition: DAS_Spat.c:2249
+ Here is the caller graph for this function:

§ PRG_Check()

int PRG_Check ( int  mod,
char *  prgname 
)

Definition at line 531 of file DAS_Spat.c.

References _MAX_PATH, AAMEASURE, AAPOSIT, ALMUCANTAR, AUTORNG, AVGCCD, AVGCCDHOR, AZIMUTH, BEGIN, CALIBRA, CHKEXLAMP, DARKC, delay(), bil::DFILEM, DFMEASURE, DI_FileExist(), DI_SplitName(), DIRECTSUN, ELAMPOFF, ELAMPON, ESHUTCL, ESHUTOP, EXPO, Fetch(), FILTER, GETCCD, H_AZI, H_FILTER, H_GRAT, H_GRAT_CAL, H_MIRROR, H_NDFW, H_ZEN, HG_OFF, HG_ON, HGSCAN, d_fileman::HOMEDIRECTORY, IREFSUN, LABEL, LoadExec(), MEASHOR, MEASHOR2, MEASURE, MGUITerm(), MIRROR, MMessageDialog(), NDFILTER, PLOT, PRG_ChKBegin(), PRG_ChkGrating(), PRG_ChkMeasAvg(), PRG_ChkMirror(), PrgCnt, PrgSiz, Program, QJ_OFF, QJ_ON, QJSCAN, RADIO, REM, SAVE, SETCCDOFFS, SETCCDPOW, SETCCDTEMP, SETCCDVBIN, WAIT, WAVELEN, XEND, and ZENITH.

Referenced by ChkExeMode(), DB_ToolsKeyB_CB(), and ExMaster().

532 {
533  int er = 0, flin = 0, ls, ferr;
534  int inf = 0, error = 0 ;
535  long siz = 0;
536  long accbyte = 0;
537  long tmp;
538  char buff[32], str[_MAX_PATH], fname[32],ffnerr[_MAX_PATH];
539  int m ;
540 
541  //sprintf(buff,"\0");
542 
543  er = LoadExec(prgname);
544 
545  DI_SplitName(prgname, str, buff);
546 
547 
548  ls = strlen(buff);
549  sprintf(fname,"\0");
550  sprintf(ffnerr,"\0");
551  strncat(fname, buff, ls-3);
552  strcat(fname,"err");
553  strcat(str,fname);
554  strcat(ffnerr,str);
555 
556 /**********************/
557  if(DI_FileExist(ffnerr)) // DI_FileExist --> Return: 1 if PATH exist, else return 0
558  {
559  //Delete the old err file
560  remove(ffnerr);
561  }
562 
563 
564 /**********************/
565  if (er)
566  {
567  do
568  {
569  flin ++;
570  er = Fetch();
571  switch(er)
572  {
573  case AUTORNG: while(Program[PrgCnt++] != 10); break; // 1
574  case AVGCCD:
575  error = PRG_ChkMeasAvg(flin, ffnerr);
576  while(Program[PrgCnt++] != 10);
577  break; // 2
578  case BEGIN:
579  error = PRG_ChKBegin(flin, ffnerr);
580  while(Program[PrgCnt++] != 10);
581  break; // 3
582 
583  case CALIBRA: while(Program[PrgCnt++] != 10); break; // 4
584  case DARKC: while(Program[PrgCnt++] != 10); break; // 5
585  case EXPO: while(Program[PrgCnt++] != 10); break; // 6
586  case FILTER: while(Program[PrgCnt++] != 10); break; // 7
587  case GETCCD: while(Program[PrgCnt++] != 10); break; // 8
588  case H_FILTER: while(Program[PrgCnt++] != 10); break; // 9
589  case H_GRAT: while(Program[PrgCnt++] != 10); break; // 10
590  case H_MIRROR: while(Program[PrgCnt++] != 10); break; // 11
591  case HG_OFF: while(Program[PrgCnt++] != 10); break; // 12
592  case HG_ON: while(Program[PrgCnt++] != 10); break; // 13
593  case LABEL: while(Program[PrgCnt++] != 10); break; // 14
594  case MEASURE:
595  error = PRG_ChkMeasAvg(flin, ffnerr);
596  while(Program[PrgCnt++] != 10);
597  break; // 15
598  case MEASHOR:
599  error = PRG_ChkMeasAvg(flin, ffnerr);
600  while(Program[PrgCnt++] != 10);
601  break; // 16
602  case MIRROR:
603  sscanf(&Program[PrgCnt], "%d", &m);
604  error = PRG_ChkMirror(0, ffnerr, flin, m);
605  while(Program[PrgCnt++] != 10);
606  break; // 17
607  case PLOT: while(Program[PrgCnt++] != 10); break; // 18
608  case QJ_OFF: while(Program[PrgCnt++] != 10); break; // 19
609  case QJ_ON: while(Program[PrgCnt++] != 10); break; // 20
610  case RADIO: while(Program[PrgCnt++] != 10); break; // 21
611  case REM: while(Program[PrgCnt++] != 10); break; // 22
612  case SAVE: while(Program[PrgCnt++] != 10); break; // 23
613  case WAIT: while(Program[PrgCnt++] != 10); break; // 24
614  case WAVELEN:
615  sscanf(&Program[PrgCnt], "%d", &m);
616  error = PRG_ChkGrating(0, ffnerr, flin, m);
617  while(Program[PrgCnt++] != 10); break; // 25
618  case XEND: PrgCnt = PrgSiz; break; // 26
619 
620  case ELAMPON: while(Program[PrgCnt++] != 10); break; // 27
621  case ELAMPOFF: while(Program[PrgCnt++] != 10); break; // 28
622  case ESHUTOP: while(Program[PrgCnt++] != 10); break; // 29
623  case ESHUTCL: while(Program[PrgCnt++] != 10); break; // 30
624 
625  case H_ZEN: while(Program[PrgCnt++] != 10); break; // 31
626  case H_AZI: while(Program[PrgCnt++] != 10); break; // 32
627  case ZENITH: while(Program[PrgCnt++] != 10); break; // 33
628  case AZIMUTH: while(Program[PrgCnt++] != 10); break; // 34
629  case AAMEASURE:while(Program[PrgCnt++] != 10); break; // 35
630  case AVGCCDHOR:while(Program[PrgCnt++] != 10); break; // 36
631  case CHKEXLAMP:while(Program[PrgCnt++] != 10); break; // 37
632  case AAPOSIT :while(Program[PrgCnt++] != 10); break; // 38
633  case IREFSUN :while(Program[PrgCnt++] != 10); break; // 39
634  case MEASHOR2 :while(Program[PrgCnt++] != 10); break; // 40
635  case SETCCDTEMP :while(Program[PrgCnt++] != 10); break; // 41
636  case SETCCDVBIN :while(Program[PrgCnt++] != 10); break; // 42
637  case SETCCDPOW :while(Program[PrgCnt++] != 10); break; // 43
638  case NDFILTER :while(Program[PrgCnt++] != 10); break; // 44
639  case DFMEASURE:while(Program[PrgCnt++] != 10); break; // 44
640  case H_NDFW :while(Program[PrgCnt++] != 10); break; // 45
641  case SETCCDOFFS :while(Program[PrgCnt++] != 10); break; // 47
642  case QJSCAN :while(Program[PrgCnt++] != 10); break; // 48
643  case H_GRAT_CAL :while(Program[PrgCnt++] != 10); break; // 49
644  case HGSCAN :while(Program[PrgCnt++] != 10); break; // 50
645  case ALMUCANTAR :while(Program[PrgCnt++] != 10); break; // 51
646  case DIRECTSUN :while(Program[PrgCnt++] != 10); break; // 52
647 
648  case 0:
649  while(Program[PrgCnt++] != 10);
650  inf = 1;
651  //OpenFile for Writing errors
652  ferr = open(ffnerr, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
653  sprintf(buff, "Error at line %d: Command NOT FOUND\n", flin);
654  write(ferr, buff, strlen(buff));
655  close(ferr);
656  //sprintf(buff,"Command not found at line %d ", flin );
657  //MMessageDialog("DAS Inf.", buff,"OK", NULL);
658 
659  break;
660  case 2000:
661  PrgCnt = PrgSiz;
662  inf = 1;
663  //OpenFile for Writing errors
664  ferr = open(ffnerr, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
665  sprintf(buff, "Error at line %d: XEND NOT FOUND\n", flin);
666  write(ferr, buff, strlen(buff));
667  close(ferr);
668  //sprintf(buff,"Command not found at line %d ", flin );
669  //MMessageDialog("DAS Inf.", buff,"OK", NULL);
670 
671 
672 
673 
674  }
675  inf = inf + error;
676  tmp = (PrgCnt + 2) - (accbyte);
677  accbyte= accbyte + tmp;
678  // accbyte= PrgCnt;
679 
680  //}while (accbyte < PrgSiz );
681  }while (PrgCnt < PrgSiz );
682  if (inf == 0)
683  {
684  //DI_SplitName(PrgFile, str, buff);
685  sprintf(str, "File:%s correctely Compiled",prgname);
686  if (mod)
687  MMessageDialog("DAS Inf.", str,"OK", NULL);
688  //Status (str);
689  delay(1000);
690  return 0;
691 
692  }
693  else
694  {
695  //DI_SplitName(PrgFile, str, buff);
696 // sprintf(str, "PRG File:\n%s\ncontains error/s\nThe DAS will close!!!!\n Retry with other PRG.",PrgFile);
697 // MMessageDialog("DAS Inf.", str,"OK", NULL);
698  sprintf(str, "PRG File:\n%s\ncontains error/s\nYou can:\n Close DAS\nView the errors\n ",prgname);
699  er = MMessageDialog("DAS Inf. - PRG Errors", str,"Close", "View err",NULL);
700  if (er)
701  {
702  sprintf(str,"%s\\MEDIT.EXE %s", BIL.DFILEM.HOMEDIRECTORY, ffnerr);
703  er = WinExec(str, SW_SHOW);
704  sprintf(str,"%s\\MEDIT.EXE %s", BIL.DFILEM.HOMEDIRECTORY, prgname);
705  er = WinExec(str, SW_SHOW);
706  //exit(0);
707  return 1;
708 
709  }
710  else
711  {
712  MGUITerm();
713  exit(0);
714  }
715 
716  }
717  }
718  else
719  {
720  sprintf(buff,"Problem in opening the PRG file!!!!");
721  MMessageDialog("DAS Inf.", buff,"OK", NULL);
722  return 2;
723  }
724 
725 }
#define ELAMPOFF
External Lamp OFF.
#define H_NDFW
Home for ND FilterWheel.
#define LABEL
text after this command is displayed in the status label
#define SETCCDVBIN
SET the CCD vertical Binning.
#define H_GRAT_CAL
Perform home for the grating and executa a calibration.
#define H_ZEN
Home for zenith Axis.
#define AAMEASURE
Measuremets with Alt Azimut platform (stepper motors positioning simoultaneously) ...
#define AAPOSIT
Position the Alt Azimuth Platform.
#define QJ_ON
QJ lamp on.
#define WAIT
stop the program execution for xx millisec
#define PLOT
display plot
#define HG_ON
HG lamp on.
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
#define QJSCAN
Scan spectral range with QJ on.
int Fetch()
Reads the key-word in PRG Files .
Definition: DAS_Spat.c:298
#define CHKEXLAMP
Check External lamp status.
#define GETCCD
Performs a LIGHT Measurement (shutter opened)
#define IREFSUN
Io Measurement with AA Platform near the Sun.
bil BIL
Definition: DAS_Spat.c:74
long PrgSiz
Size of the PRG file.
Definition: DAS_Spat.c:94
#define MEASHOR
horizontal measurements with external lamp (lamp,
char * Program
buffer for the PRG file
Definition: DAS_Spat.c:90
#define H_FILTER
Home for filter wheel.
#define WAVELEN
set the grating position
d_fileman DFILEM
Definition: bildef.h:257
C_DEF void DI_SplitName(char *fullname, char *fpath, char *fname)
void MGUITerm(void)
#define AUTORNG
Autoranging for optimal exposure time.
#define ESHUTCL
External Shutter CLOSED.
#define AZIMUTH
Positioning of Azimut Axis.
long PrgCnt
Counter for the position in the PRG file.
Definition: DAS_Spat.c:93
#define AVGCCDHOR
horizontal AVERAGED measurements with external lamp
int PRG_ChkMirror(int mod, char *filename, int record, int par)
Definition: DAS_Spat.c:355
int PRG_ChkMeasAvg(int line, char *fname)
Definition: DAS_Spat.c:414
int PRG_ChkGrating(int mod, char *filename, int record, int par)
Definition: DAS_Spat.c:376
#define EXPO
Set the exposure time.
#define QJ_OFF
QJ lamp off.
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
#define DARKC
Perform a DARK Measurement (shutter closed)
#define DIRECTSUN
#define SAVE
save the measurement in the predefined file
#define ELAMPON
External Lamp ON.
#define FILTER
Set the filter position (0 - 6)
#define ZENITH
Positioning of zenith Axis.
#define MEASHOR2
Perform horizontal measurement.
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
#define ALMUCANTAR
#define H_AZI
Home for Azimut Axis.
#define SETCCDOFFS
CCD Offset for HiresV.
#define DFMEASURE
Measurement procedure using the double ND FilterWheel (when Installed)
#define CALIBRA
Auto calibration with HG Lamp (hg line at 4358A on pix 512)
int PRG_ChKBegin(int line, char *fname)
Definition: DAS_Spat.c:515
#define SETCCDPOW
SET the CCD Power.
#define MEASURE
Performs a measurement setting mirror, filter, grating, TExp...
#define H_MIRROR
Home for Mirror.
int LoadExec(char *fname)
Load file for automatic execution. Procedure that load the file for automatic execution.
Definition: Load.c:1534
#define BEGIN
re-start the execution of the PRG file
#define H_GRAT
Home for Grating.
#define XEND
stop the execution of the PRG file
#define RADIO
Unused.
#define HG_OFF
HG lamp off.
#define SETCCDTEMP
SET the CCD working Temperature.
#define HGSCAN
Scan spectral range with HG on.
C_DEF int DI_FileExist(char *tit)
#define ESHUTOP
External Shutter OPEN.
#define MIRROR
set mirror position (0-3)
#define NDFILTER
SET the ND FilterWheel Position.
#define AVGCCD
Averaged measurement.
#define REM
text after this is a comment
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PRG_ChKBegin()

int PRG_ChKBegin ( int  line,
char *  fname 
)

Definition at line 515 of file DAS_Spat.c.

Referenced by PRG_Check().

516 {
517  int er = 0, eracc = 0;
518 // int l, m, g;
519 // double t;
520 // char buff[_MAX_PATH];
521 
522 
523 
524 
525  return er;
526 }
+ Here is the caller graph for this function:

§ PRG_ChkGrating()

int PRG_ChkGrating ( int  mod,
char *  filename,
int  record,
int  par 
)

Definition at line 376 of file DAS_Spat.c.

References _MAX_PATH, and LookforWl_X().

Referenced by PRG_Check(), and PRG_ChkMeasAvg().

377 {
378 
379  int ferr, er = 0;
380  char buff[_MAX_PATH];
381  int l;
382 
383  l= LookforWl_X(par);
384  if (l> 18 ) //error on grating position
385  {
386  //OpenFile for Writing errors
387  ferr = open(filename, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
388  sprintf(buff, "Error at line %d: Grating Position Current value %d. Allowed values 0 to 13\n", record, l);
389  write(ferr, buff, strlen(buff));
390  close(ferr);
391  //sprintf(buff,"Error in file:%s\nLine:%d\nMirror position: \nCurrent value %d\nAllowed values 0 to 3",PrgFile, line,m);
392  //MMessageDialog("DAS Inf.", buff,"OK", NULL);
393  er = 1;
394  }
395  else if (l<0)
396  {
397  //OpenFile for Writing errors
398  ferr = open(filename, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
399  sprintf(buff, "Error at line %d: Wavelength value %d not encounterd in the wlstep.ini file\n", record, par);
400  write(ferr, buff, strlen(buff));
401  close(ferr);
402  //sprintf(buff,"Error in file:%s\nLine:%d\nMirror position: \nCurrent value %d\nAllowed values 0 to 3",PrgFile, line,m);
403  //MMessageDialog("DAS Inf.", buff,"OK", NULL);
404  er = 1;
405  }
406 
407 
408 
409 
410 
411  return er;
412 }
#define _MAX_PATH
Definition: Dildef.h:202
int LookforWl_X(int x)
Definition: Procedures.c:2295
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PRG_ChkKeyW()

int PRG_ChkKeyW ( int  line,
char *  fname 
)

Definition at line 348 of file DAS_Spat.c.

349 {
350 
351 
352  return 0;
353 }

§ PRG_ChkMeasAvg()

int PRG_ChkMeasAvg ( int  line,
char *  fname 
)

Definition at line 414 of file DAS_Spat.c.

References _MAX_PATH, PRG_ChkGrating(), PRG_ChkMirror(), PrgCnt, Program, and wl.

Referenced by PRG_Check().

415 {
416 
417  int er = 0, eracc = 0;
418  int f, m, a, d, s, g, ferr,wl;
419  double t;
420  char buff[_MAX_PATH];
421 
422 
423  sscanf(&Program[PrgCnt], "%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
424 
425  er = PRG_ChkMirror(0,fname, line, m);
426  eracc = eracc + er;
427 
428  er = PRG_ChkGrating(0,fname, line, wl);
429  eracc = eracc + er;
430 
431  if ((f < 0) | (f > 6)) //error on filter position
432  {
433  //OpenFile for Writing errors
434  ferr = open(fname, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
435  sprintf(buff, "Error at line %d: Filter Position Current value %d. Allowed values 0 to 6\n", line,f);
436  write(ferr, buff, strlen(buff));
437  close(ferr);
438  //sprintf(buff,"Error in file:%s\nLine:%d\nMirror position: \nCurrent value %d\nAllowed values 0 to 3",PrgFile, line,m);
439  //MMessageDialog("DAS Inf.", buff,"OK", NULL);
440  er = 1;
441 
442  }
443 
444  if ((a < 0) | (a > 1)) //error on autoranging
445  {
446  //OpenFile for Writing errors
447  ferr = open(fname, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
448  sprintf(buff, "Error at line %d: Autoranging Mode, Current value %d. Allowed values 0 to 1\n", line,a);
449  write(ferr, buff, strlen(buff));
450  close(ferr);
451  //sprintf(buff,"Error in file:%s\nLine:%d\nMirror position: \nCurrent value %d\nAllowed values 0 to 3",PrgFile, line,m);
452  //MMessageDialog("DAS Inf.", buff,"OK", NULL);
453  er = 1;
454 
455  }
456 
457  if ((t < 0) | (t > 45)) //error on exposure time
458  {
459  //OpenFile for Writing errors
460  ferr = open(fname, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
461  sprintf(buff, "Error at line %d: Exposure Time Current value %f. Allowed values 0 to 45 sec\n", line,t);
462  write(ferr, buff, strlen(buff));
463  close(ferr);
464  //sprintf(buff,"Error in file:%s\nLine:%d\nMirror position: \nCurrent value %d\nAllowed values 0 to 3",PrgFile, line,m);
465  //MMessageDialog("DAS Inf.", buff,"OK", NULL);
466  er = 1;
467 
468  }
469 
470  if ((d < 0) | (d > 1)) //error on dark or light
471  {
472  //OpenFile for Writing errors
473  ferr = open(fname, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
474  sprintf(buff, "Error at line %d: type of Measurements Current value %d. Allowed values 0 (Dark) to 1 (Light)\n", line,d);
475  write(ferr, buff, strlen(buff));
476  close(ferr);
477  //sprintf(buff,"Error in file:%s\nLine:%d\nMirror position: \nCurrent value %d\nAllowed values 0 to 3",PrgFile, line,m);
478  //MMessageDialog("DAS Inf.", buff,"OK", NULL);
479  er = 1;
480 
481  }
482 
483  if ((s < 0) | (s > 1)) //error on saving file parameter
484  {
485  //OpenFile for Writing errors
486  ferr = open(fname, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
487  sprintf(buff, "Error at line %d: Saving on file, Current value %d. Allowed values 0 (NO SAVE) to 1 (SAVE)\n", line,s);
488  write(ferr, buff, strlen(buff));
489  close(ferr);
490  //sprintf(buff,"Error in file:%s\nLine:%d\nMirror position: \nCurrent value %d\nAllowed values 0 to 3",PrgFile, line,m);
491  //MMessageDialog("DAS Inf.", buff,"OK", NULL);
492  er = 1;
493 
494  }
495 
496  if ((g < 0) | (g > 1)) //error on plot display
497  {
498  //OpenFile for Writing errors
499  ferr = open(fname, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
500  sprintf(buff, "Error at line %d: Plot Display Current value %d. Allowed values 0 (NO PLOT) to 1 (SHOW PLOT)\n", line,g);
501  write(ferr, buff, strlen(buff));
502  close(ferr);
503  //sprintf(buff,"Error in file:%s\nLine:%d\nMirror position: \nCurrent value %d\nAllowed values 0 to 3",PrgFile, line,m);
504  //MMessageDialog("DAS Inf.", buff,"OK", NULL);
505  er = 1;
506 
507  }
508 
509 
510  return eracc;
511 }
char * Program
buffer for the PRG file
Definition: DAS_Spat.c:90
long PrgCnt
Counter for the position in the PRG file.
Definition: DAS_Spat.c:93
int PRG_ChkMirror(int mod, char *filename, int record, int par)
Definition: DAS_Spat.c:355
int PRG_ChkGrating(int mod, char *filename, int record, int par)
Definition: DAS_Spat.c:376
#define _MAX_PATH
Definition: Dildef.h:202
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PRG_ChkMirror()

int PRG_ChkMirror ( int  mod,
char *  filename,
int  record,
int  par 
)

Definition at line 355 of file DAS_Spat.c.

References _MAX_PATH.

Referenced by PRG_Check(), and PRG_ChkMeasAvg().

356 {
357 
358  int ferr, er = 0;
359  char buff[_MAX_PATH];
360 
361  if ((par < 0) | (par > 3)) //error on mirror position
362  {
363  //OpenFile for Writing errors
364  ferr = open(filename, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
365  sprintf(buff, "Error at line %d: Mirror Position Current value %d. Allowed values 0 to 3\n", record,par);
366  write(ferr, buff, strlen(buff));
367  close(ferr);
368  //sprintf(buff,"Error in file:%s\nLine:%d\nMirror position: \nCurrent value %d\nAllowed values 0 to 3",PrgFile, line,m);
369  //MMessageDialog("DAS Inf.", buff,"OK", NULL);
370  er = 1;
371  }
372 
373  return er;
374 }
#define _MAX_PATH
Definition: Dildef.h:202
+ Here is the caller graph for this function:

§ RunFULL()

void RunFULL ( void  )

DAS Main LOOP for Equipment management
This Procedure is called by the MGUIMain function when the execution mode is:
.

  • TEMPORIZED: execution driven by MASTER file
  • PRGFILE: execution driven by *.prg file
  • TESTAMS: execution for testing AMS's devices
  • TESTCCD: execution for testing CCD Camera
  • DBDEMO: execution in demo mode
  • MANUAL: execution in manual mode (for lab use)
  • TESTAD: execution for testing PC 104 AD converter
  • SZAPRG: execution driven by SZAPRG File

Actions:

  • Load file Param.ini (Equipment type and CCD parameters) (LoadParam)
  • Check if only 1 instance of DAS is running (ChkDASInstance)
  • Load file AMS.ini (Stepper Motors Parameters) (LoadAMS)
  • Crate the main shell (BuildMainShell)
  • Init CCD Camera and AMS Controller (InitCCD_AMS)
  • Choose the sensitive Keyboard buttons (Checking the DAS.Flag.exemode status) (DB_ChooseButtons)
  • Read the PRG file if PRGFILE mode (LoadExec) or read the MASTER or the MASTERSZA or SZAPRG projects (ExMaster)
  • first SZA Calculation (SZA_FirstCalc)
  • Launch background tasks (LaunchBackTask)
  • the program transfer the control to MGUI library and gains control only through callbacks (as button press) or events generated by the background's tasks (MMainLoop)
    Returns
    void

Definition at line 2994 of file DAS_Spat.c.

Referenced by BuildShell(), and SZA_FirstCalc().

2995 {
2996 
2997  char str[_MAX_PATH];
2998 // struct time RTime;
2999  int er = 0;
3000  long np;
3001 
3002  // Load Param.ini
3003  er = LoadParam();
3004  if (er) //Param.ini not found
3005  {
3006  sprintf(str,"File %s\\Param.ini not found,\nPlease supply a valid 'Param.ini' file in the %s forlder\n\
3007 or contact Danbo - db@uevora.pt\nNow DAS will quit!! ", BIL.DFILEM.CONFIGDIREQUIPMENT,BIL.DFILEM.CONFIGDIREQUIPMENT);
3008  MMessageDialog ("DAS ERROR ", str, "OK",NULL);
3009  DAS_Error(2);
3010  exit(0);
3011  }
3012 
3013  DAS.Flag.ExeDSZA = 1; //To enable the SZAPRG measurement mode
3014 
3015  DAS_Error(0); //Write on LOG "Param.ini Loaded OK"
3016 
3017  //check if more than 1 instance of DAS is running
3019 
3020  //Load AMS.ini
3021  er = LoadAMS(); //AMS.ini not found
3022  if(er)
3023  {
3024  if (er == 1)
3025  {
3026  sprintf(str,"File %s\\Param.ini not found,\nPlease supply a valid 'Param.ini' file in the %s forlder\n\
3027  or contact Danbo - db@uevora.pt\nNow DAS will quit!! ", BIL.DFILEM.CONFIGDIREQUIPMENT,BIL.DFILEM.CONFIGDIREQUIPMENT);
3028  MMessageDialog ("DAS ERROR ", str, "OK",NULL);
3029  exit(0);
3030 
3031  }
3032  else
3033  //Error in reading AMS.ini
3034  AMSINI_Err(er);
3035  }
3036 
3037  DAS_Error(1); //Write on LOG "AMS.ini Loaded OK"
3038 
3039  // CREATE the MAIN SHELL (Control Panel)
3040  BuildMainShell();
3041 
3042  //Write the Parameters on the appropriate labels in the control Panel
3043  AssignParam(0);
3044 
3045  //Write the title of the Main Shell depending on the Equipment
3047 
3048  // Write in the Script-Use Label the execution mode or the PRG file or MASTER
3050 
3051  //Start WDT
3052 // WDT_func(1);
3053 
3054  //Init CCD and AMS
3056 
3057  //Stop WDT
3058 // WDT_func(0);
3059 
3060  if (er)
3061  {
3062  DAS_Error(3);
3063  }
3064 
3065 
3066  // Init AD Converter - PC_104 device.
3067  //if DMM NOT Found the InitTempAD function return 1
3069 
3070  // choose the sensitive Keyboard buttons ( checking the DAS.Flag.exemode status)
3072 
3073  // Read the PRG file if not in TEMPORIZED or SZAMASTERM or SZAMODE modes
3074  //if(PrgFile[0] != 0 && Master == 0)
3075  if(DAS.Flag.exemode == PRGFILE && Master == 0)
3076  {
3077  DB_KB_ButtonActive(0);
3080  FLAG.fileprg = 1;
3081  on = LoadExec(PrgFile);
3082  }
3083  else on = 0;
3084 
3085 
3086  //DAS.Marconi.AVGmat = AllocLongMat(IDX, IDY);
3087 
3088 
3089 
3090  //Read the MASTER or the MASTERSZA or SZAPRG projects or the *.prg file and check the syntax of the *.PRG
3092 
3093  //Check the "Master" value
3095 
3096  PrgNum = 0;
3097 
3098  //first SZA Calculation
3099  SZA_FirstCalc();
3100 
3101 
3102  // Launch background tasks
3103  LaunchBackTask();
3104 
3105  OMU_HC();
3106 
3107 
3108  // Now DAS transfer the control to MGUI library and gains control only through
3109  // callbacks (as button press) or events generated by the background's tasks
3110  MMainLoop();
3111 
3112 }
flag FLAG
Definition: CreateForms.c:84
gui Gui
Graphic User Interface Structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
shells Shells
Shells structure.
void SZA_FirstCalc(void)
Definition: DAS_Spat.c:2858
int InitCCD_AMS(int mod, int emode)
Definition: DAS_Spat.c:1793
void ChkDASInstance(int etype)
Definition: DAS_Spat.c:2048
int InitTempAD(int mod)
Definition: DAS_Spat.c:2681
MOBJECT KeyB[28]
Keyboard Buttons.
int Master
Definition: DAS_Spat.c:100
int OMU_HC(void)
Definition: Chktemp.c:597
flag Flag
Structure for different flags.
MOBJECT Sh_Main
Main shell for control panel.
void MMainLoop(void)
int LoadAMS(void)
Definition: DAS_Spat.c:1201
int PrgNum
Definition: DAS_Spat.c:96
void BuildMainShell(void)
Definition: DAS_Spat.c:2597
int AssignParam(int mod)
Assign parameters to the CP labels. .
Definition: Load.c:990
bil BIL
Definition: DAS_Spat.c:74
void DAS_Error(int c)
Definition: Errors.c:124
void LaunchBackTask(void)
Launch the DAS Background tasks Common Tasks launched when the DAS MAIN Graphic User Interface is loa...
Definition: DAS_Spat.c:2624
d_fileman DFILEM
Definition: bildef.h:257
void DB_ChooseButtons(int w)
Definition: CreateForms.c:2560
MOBJECT Albl_Script
Active Control Panel Labels for Script in execution.
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
#define PRGFILE
execution driven by *.prg file
void SetScriptUseLabel(int master, char *prgf, int emode, MOBJECT lbl)
Definition: DAS_Spat.c:2509
int ADPC104
0 –> Device PC104 exist, 1 –> PC104 DOESN&#39;T exist
pushbutt PushButt
Push buttons.
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
das DAS
Definition: DAS_Spat.c:85
int ExMaster(int m, int mode)
Definition: DAS_Spat.c:739
char PrgFile[_MAX_PATH]
Name of the PRG file.
Definition: DAS_Spat.c:91
int fileprg
Flag indicating the execution of a PRG file: = 0 –> No PRG File; = 1 –> PRG file in execution...
controlpanel ContrPanel
Control Panel Structure.
int LoadParam(void)
Load the exe parameters. Procedure that load the parameters for CCD, Stepper Motors and Peltier from ...
Definition: Load.c:1215
void AMSINI_Err(int c)
Definition: DAS_Spat.c:2573
int LoadExec(char *fname)
Load file for automatic execution. Procedure that load the file for automatic execution.
Definition: Load.c:1534
int ExeDSZA
= 1 the measurements are performed, = 0 waiting for the next deltasza.
int EqType
Spectrometer Type.
void MObjectSetSensitive(MOBJECT obj)
int on
PRG execution control variabile.
Definition: DAS_Spat.c:109
int exemode
Set the Execution MODE (Execution modes)
void WriteShellTitle(MOBJECT o, int eqt)
Definition: DAS_Spat.c:2176
void Master_Error(int w)
Definition: Errors.c:98
paramini Paramini
structure for the parameters defined in param.ini configuration file
+ Here is the caller graph for this function:

§ RunLogMode()

void RunLogMode ( int  mod,
char *  p 
)

Definition at line 3478 of file DAS_Spat.c.

References _MAX_PATH, AllocFloatMat(), omutemp::CCDPwr, omutemp::CCDTemp, DB_2DPlot(), DI_SplitName(), omutemp::dimx, omutemp::dimy, MGUIQuitCB(), MGUITerm(), MMainLoop(), MMessageDialog(), MShellSetWMCloseCallback(), omutemp::PltPwr, omutemp::pTempMat, omutemp::ptimeMat, ReadLogFile(), SET2D_GRID, and omutemp::sh.

Referenced by BuildShell().

3479 {
3480 
3481  char buff[128], str[_MAX_PATH];
3482  unsigned long lx;
3483  int tiy = OMUTEMP.dimy = 16;
3484 
3485 
3486  DI_SplitName(p, str, buff);
3487  OMUTEMP.dimx = ReadLogFile(0, str, buff, 0, 0, OMUTEMP);
3488  if (OMUTEMP.dimx >=5)
3489  {
3490  //Remenber to de-alloc theese arrays
3492  lx = (unsigned long) OMUTEMP.dimx;
3493  OMUTEMP.ptimeMat = (struct dtime *) calloc( lx, sizeof(struct dtime ));
3494  OMUTEMP.CCDTemp = (float *) calloc( lx, sizeof(float));
3495  OMUTEMP.CCDPwr = (float *) calloc( lx, sizeof(float));
3496  OMUTEMP.PltPwr = (float *) calloc( lx, sizeof(float));
3497  }
3498  else
3499  {
3500  sprintf(str, "'%s'\nUnrecognized Argument \n The Program will be terminated", p);
3501  MMessageDialog("DAS information", str, " Ok ", NULL);
3502  MGUITerm();
3503  exit(0);
3504  }
3505  ReadLogFile(1, str, buff, OMUTEMP.dimx, OMUTEMP.dimy, OMUTEMP);
3506  sprintf(str,"TEMPERATURE HISTORY - File:%s", p);
3507 
3508  DB_2DPlot(str, OMUTEMP.dimx, OMUTEMP.dimy, 512, 256, SET2D_GRID);
3509 
3511  MMainLoop();
3512 
3513 }
struct dtime * ptimeMat
Definition: bildef.h:101
int ReadLogFile(int mod, char *dir, char *filename, int nx, int ny, struct omutemp datatemp)
Read DAS LOG File. .
void MMainLoop(void)
float * CCDPwr
Definition: bildef.h:103
int dimx
Definition: bildef.h:113
C_DEF void DI_SplitName(char *fullname, char *fpath, char *fname)
void MGUITerm(void)
Definition: bildef.h:77
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
#define SET2D_GRID
Definition: Dildef.h:156
static double p
Definition: SOLPOS.C:131
float * PltPwr
Definition: bildef.h:104
float * AllocFloatMat(int hp, int vp)
Definition: Spat_Plot.c:2009
omutemp OMUTEMP
structure for OMU temperatures
Definition: DAS_Spat.c:65
int dimy
Definition: bildef.h:113
float * CCDTemp
Definition: bildef.h:102
void MGUIQuitCB(MOBJECT shell, void *od, void *ad)
Exit MGUI Library. Procedure that close MGUI .
Definition: DAS_Spat.c:728
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void DB_2DPlot(char *title, int x, int y, int dx, int dy, int mode)
2D_Plot panel callback.
float * pTempMat
Definition: bildef.h:100
MOBJECT sh
Definition: bildef.h:108
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ RunOLP()

void RunOLP ( char *  fname)

Definition at line 3114 of file DAS_Spat.c.

References d_fileman::DBFILENAME, bil::DFILEM, FBIF, FDAT, d_fileman::FKIND, LoadDB_DispCoeff(), LoadParam(), MGUIQuitCB(), MMainLoop(), MMessageDialog(), MShellSetWMCloseCallback(), bil::VFO, viewformobj::View_Sh, ViewPlot(), and Visualizza().

Referenced by BuildShell().

3115 {
3116 
3117  int er = 0, l;
3118  char buff[32];
3119 
3120  er = LoadParam();
3121 
3122  /******************************************************/
3123  // Load the dispersion coefficient for DOAS Use
3124  er = LoadDB_DispCoeff();
3125  /*******************************************************/
3126 
3127 
3128  // Create Command KeyBoard
3129 // MDCreateLISC(0, 0);
3130 /**********************************************************************/
3131  // choose the sensitive Keyboard buttons ( checking the DAS.Flag.exemode status)
3132 // DB_ChooseButtons(DAS.Flag.exemode);
3133 /**********************************************************************/
3134 
3135  ViewPlot(0); //OffLine Plot
3136 
3137 // Server = DI_Init(0); //0=No Pop-Up Menu, 1=Yes Pop-Up Menu
3138 
3139  if(fname != 0)
3140  {
3141  sprintf(BIL.DFILEM.DBFILENAME,"%s",fname);
3142  l = strlen(BIL.DFILEM.DBFILENAME);
3143  sprintf(buff,"%s", "xxxx");
3144  strncpy(buff, BIL.DFILEM.DBFILENAME+l-4, 4);
3145 
3146  if( (strcmp(buff,".dat") == 0) |(strcmp(buff,".Dat") == 0) )
3147  {
3148  BIL.DFILEM.FKIND = FDAT;
3150  }
3151  else if( (strcmp(buff,".bif") == 0) | (strcmp(buff,".Bif") == 0) )
3152  {
3153  BIL.DFILEM.FKIND = FBIF;
3155  }
3156  else if( (strcmp(buff,".bhg") == 0) | (strcmp(buff,".Bhg") == 0) )
3157  {
3158  BIL.DFILEM.FKIND = FBIF;
3160  }
3161  else
3162  {
3163  MMessageDialog("DAS information", "Unsupported format!!", " Ok ", NULL);
3164 // break;
3165  }
3166 
3167  }
3168 
3169 
3171  MMainLoop();
3172 
3173 
3174 }
void MMainLoop(void)
#define FDAT
Definition: bildef.h:221
int FKIND
Definition: bildef.h:211
bil BIL
Definition: DAS_Spat.c:74
d_fileman DFILEM
Definition: bildef.h:257
int ViewPlot(int mod)
Create the plot shell. Procedure that build the plot shell for the data visualization.
Definition: Spat_Plot.c:3775
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
MOBJECT View_Sh
Definition: bildef.h:35
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int LoadDB_DispCoeff(void)
Load dispersion parameters. Procedure that load the dispersion parameters from file {homedir}/DOAS/Di...
Definition: Load.c:234
int LoadParam(void)
Load the exe parameters. Procedure that load the parameters for CCD, Stepper Motors and Peltier from ...
Definition: Load.c:1215
int Visualizza(int mod, char *nomefile)
Definition: Spat_Plot.c:2069
viewformobj VFO
Definition: bildef.h:255
void MGUIQuitCB(MOBJECT shell, void *od, void *ad)
Exit MGUI Library. Procedure that close MGUI .
Definition: DAS_Spat.c:728
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
#define FBIF
Definition: bildef.h:229
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SetScriptUseLabel()

void SetScriptUseLabel ( int  master,
char *  prgf,
int  emode,
MOBJECT  lbl 
)

Definition at line 2509 of file DAS_Spat.c.

References AboutCB(), DBDEMO, DI_SplitName(), MObjectSetText(), PRGFILE, SZAMASTERM, SZAMODE, TEMPORIZED, TESTAD, TESTAMS, TESTCCD, and TESTSZAMODE.

Referenced by SZA_FirstCalc().

2510 {
2511 
2512  char buf[32];
2513  char str[255];
2514  int er=0;
2515 
2516 
2517 
2518 
2519  //If the program started in temporized mode write MASTER on the label on the control panel
2520  if(master)
2521  {
2522  if (emode == SZAMASTERM)
2523  sprintf(buf,"MASTER SZA" );
2524  if (emode == TEMPORIZED)
2525  sprintf(buf,"MASTER" );
2526  if ((emode == SZAMODE))
2527  sprintf(buf,"SZAMODE" );
2528  if ((emode == TESTSZAMODE))
2529  sprintf(buf,"TESTSZAMODE" );
2530 
2531  MObjectSetText(lbl, buf);
2532  }
2533  // altrimenti scrive il nome della tabella da eseguire
2534  else if(emode == PRGFILE)
2535  {
2536  //Devo mettere qualcosa che costruisca solo il nome del file
2537  //(devo leggere il file al contrario fino a che trovo "\")
2538  DI_SplitName(prgf, str, buf);
2539  //sprintf(buf,"%s",PrgFile );
2540  MObjectSetText(lbl, buf);
2541 
2542  }
2543  else
2544  {
2545  switch (emode)
2546  {
2547  case DBDEMO:
2548  sprintf(buf,"DEMO Use" );
2549  MObjectSetText(lbl, buf);
2550  AboutCB(NULL, NULL, (void *)1); //with 1 is a Modal Shell
2551  break;
2552  case TESTAMS:
2553  sprintf(buf,"TEST AMS Use" );
2554  MObjectSetText(lbl, buf);
2555  break;
2556  case TESTCCD:
2557  sprintf(buf,"TEST CCD Use" );
2558  MObjectSetText(lbl, buf);
2559  break;
2560  case TESTAD:
2561  sprintf(buf,"TEST AD Use" );
2562  MObjectSetText(lbl, buf);
2563  break;
2564  default:
2565  sprintf(buf,"Man Use" );
2566  MObjectSetText(lbl, buf);
2567  break;
2568  }
2569  }
2570 
2571 }
MOBJECT lbl
Definition: DFileMan.c:42
#define TESTCCD
execution for testing CCD Camera
#define TESTSZAMODE
execution driven by SZAPRG file
#define DBDEMO
execution in demo mode
#define TEMPORIZED
execution driven by MASTER file
#define SZAMASTERM
execution driven by MASTERSZA file ( there is the possibility to distinguish between AM and PM measur...
void MObjectSetText(MOBJECT obj, const char *text)
C_DEF void DI_SplitName(char *fullname, char *fpath, char *fname)
void AboutCB(MOBJECT o, void *s, void *v)
Create the About information shell. .
Definition: About.c:39
#define PRGFILE
execution driven by *.prg file
#define SZAMODE
execution driven by SZAPRG file
#define TESTAD
execution for testing PC 104 AD converter
master structure .
#define TESTAMS
execution for testing AMS&#39;s devices
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SetWorkDirMGUIenv()

int SetWorkDirMGUIenv ( char *  buff)

set DAS and MGUI enviroment when the program is launched undirectly (for offlineplot or log or auto or autotimed modes)

Returns
int er = 0 –> Env setted er = -1–> ERROR Env. NOT setted

Definition at line 3353 of file DAS_Spat.c.

Referenced by ChkExeMode(), CloseShTempCB(), DB_ToolsKeyB_CB(), MDCreate2DPlot(), and MGUIMain().

3354 {
3355  int s, er;
3356 
3357  // Sets the DAS Working Directory
3358  s = DI_FindDrive(buff);
3359  er = _chdrive(s);
3360  DI_FindDirName(buff, env);
3361  er = _chdir(env);
3362 
3363  // Set MGUI path
3364  sprintf(env, "MGUIDIR=%sSYS", MGetCurrentDirectory());
3365  er = putenv(env);
3366 
3367  return er;
3368 
3369 }
char env[_MAX_PATH]
Environment path.
Definition: DAS_Spatram.h:3075
C_DEF int DI_FindDrive(char *fullname)
C_DEF void DI_FindDirName(char *fullname, char *fdir)
const char * MGetCurrentDirectory(void)
+ Here is the caller graph for this function:

§ SZA_FindMin()

void SZA_FindMin ( void  )

computation of daily minimum SZA

Definition at line 2808 of file DAS_Spat.c.

References dsza::Dailymaxsza, dsza::Dailyminsza, das::DGeo, d_geo::latitude, d_geo::longitude, S_zenetr, SZACalc(), and d_geo::timezone.

Referenced by SZA_FirstCalc(), and Task_LOG().

2809 {
2810 
2811  struct tm *newtime;
2812  long ltime;
2813  int h, m, t, er;
2814  float SZA[1440];
2815  float min = 360.0;
2816  float max= 0.0;
2817 
2818 
2819  time( &ltime );
2820  newtime = localtime( &ltime );
2821 
2822 
2823  t=0;
2824  for(h=0;h<24;h++)
2825  {
2826  for(m=0;m<60;m++)
2827  {
2828 
2829  newtime ->tm_hour = h;
2830  newtime ->tm_min = m;
2831  newtime ->tm_sec = 0;
2832 
2834  (float) DAS.DGeo.timezone, newtime ->tm_year + 1900,
2835  newtime -> tm_yday, newtime ->tm_hour, newtime ->tm_min,
2836  newtime ->tm_sec, 0, 1024, 0, 0);
2837 
2838  SZA[t] = (float)S_zenetr;
2839  t++;
2840 
2841  }
2842  }
2843 
2844 
2845  for(h = 0; h< t; h++)
2846  {
2847  if(SZA[h] < min) min = SZA[h];
2848  if(SZA[h] > max) max = SZA[h];
2849  }
2850  // return the minimum element in the Numbers
2851  SZADelta.Dailyminsza = min;
2852  SZADelta.Dailymaxsza = max;
2853 
2854 }
double S_zenetr
Definition: SOLPOS.C:92
dsza SZADelta
Definition: DAS_Spat.c:76
double Dailymaxsza
Daily maximum SZA.
double latitude
Station latitude.
d_geo DGeo
struct for Station location
int timezone
Station timezone.
double Dailyminsza
Daily minimum SZA.
das DAS
Definition: DAS_Spat.c:85
double longitude
Station longitude.
Definition: Dildef.h:234
int SZACalc(double d_lat, double d_long, double d_tzone, int d_year, int d_daynum, int d_hour, int d_minute, int d_second, float d_temp, float d_press, float d_tilt, float d_aspect)
Calc. Solar angles and radiatives quantities. .
Definition: CalcSZA.c:89
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SZA_FirstCalc()

void SZA_FirstCalc ( void  )

Definition at line 2858 of file DAS_Spat.c.

References _MAX_PATH, flag::ADPC104, controlpanel::Albl_Azim, controlpanel::Albl_Elev, controlpanel::Albl_Script, controlpanel::Albl_sunr, controlpanel::Albl_suns, AMSINI_Err(), AssignParam(), BuildMainShell(), ChkDASInstance(), ChkMaster(), d_fileman::CONFIGDIREQUIPMENT, gui::ContrPanel, DAS_Error(), DB_ChooseButtons(), DB_KB_ButtonActive(), bil::DFILEM, das::DGeo, paramini::EqType, flag::ExeDSZA, flag::exemode, ExMaster(), flag::fileprg, FLAG, das::Flag, flag::ftpstatus, GetDateTime(), das::Gui, InitCCD_AMS(), InitTempAD(), pushbutt::KeyB, d_geo::latitude, LaunchBackTask(), controlpanel::lbl_Time, LoadAMS(), LoadExec(), LoadParam(), d_geo::longitude, Master, Master_Error(), MMainLoop(), MMessageDialog(), MObjectSetSensitive(), MObjectSetText(), OMU_HC(), on, das::Paramini, PrgFile, PRGFILE, PrgNum, gui::PushButt, RunFULL(), S_azim, d_geo::s_name, S_sunrise, S_sunset, S_zenetr, SetScriptUseLabel(), shells::Sh_Main, gui::Shells, flag::sza, SZA_FindMin(), SZACalc(), SZAMASTERM, SZAMax, SZAMODE, TEMPORIZED, TESTSZAMODE, d_geo::timezone, and WriteShellTitle().

2859 {
2860 
2861  char str[80];
2862  int er;
2863 // char timebuf[9];
2864 // char datebuf[9];
2865 // long dp = 500;
2866  struct tm newtime;
2867  struct time RTime;
2868  struct date RDate;
2869 // long ltime;
2870  float t_acc = 0;
2871  int mode;
2872 // _strdate(datebuf);
2873 
2874 // time( &ltime );
2875 // _strtime(timebuf);
2876  //time( &ltime );
2877 
2878  //newtime = localtime( &ltime );
2879 
2880  GetDateTime(&RDate, &RTime, &newtime);
2881 
2882 
2883  /**************************************************************/
2884  // Check if daylight saving time is in effect
2885  // tm_isdst > 0 if daylight saving time is in effect
2886  // tm_isdst = 0 if daylight saving time is not in effect
2887  // tm_isdst < 0 if status of daylight saving time is unknown.
2888  //if (newtime ->tm_isdst)
2889  // newtime ->tm_hour = newtime ->tm_hour - 1;
2890  //NOTE - In Daylight saving period on midnight the hours became -1 so...
2891  //if((newtime -> tm_hour) == -1)
2892  //{
2893  // Necessary for measurements performed at high latitude in summer seasons
2894  // newtime->tm_hour = 23;
2895  // newtime -> tm_yday = newtime -> tm_yday - 1;
2896  //}
2897 
2898  /**************************************************************/
2899 
2900  /**************************************************************/
2901  // Calc solar Zenith Angle (SZA)
2903  newtime.tm_year + 1900,
2904  newtime.tm_yday,
2905  newtime.tm_hour,
2906  newtime.tm_min,
2907  newtime .tm_sec,
2908  0, 1024, 0, 0);
2909  /**************************************************************/
2910  sprintf(str, "%.01lf", 90 - S_zenetr); //S_elevref = elevation refracted
2912 
2913  sprintf(str, "%.01lf", S_azim);
2915 
2916 
2917  sprintf(str, "%.02lf", S_sunrise); //S_elevref = elevation refracted
2919 
2920  sprintf(str, "%.02lf", S_sunset);
2922 
2923 // S_sunrise = 720.0 - 4.0 * S_ssha - S_tstfix;
2924 // S_sunset = 720.0 + 4.0 * S_ssha - S_tstfix;
2925 
2926  /**************************************************************/
2927  // Set FLAG.sza
2928  // FLAG.sza = 1 --> perform measurements
2929  // FLAG.sza = 0 --> waiting mode
2930  if(S_zenetr < SZAMax)
2931  {
2932  FLAG.sza =1;
2933  FLAG.ftpstatus = 0; // back-up that will be performed when FLAG.sza = 0
2934  }
2935  else
2936  {
2937  FLAG.sza =0;
2938  if(FLAG.ftpstatus == 1) //Back-up performed
2939  FLAG.ftpstatus = 2; //Wait until the next sunset
2940 
2941  }
2942  /**************************************************************/
2943 
2944  /**************************************************************/
2945  // write on the STATUS label
2946  sprintf(str, "Station: %s, Date: %d/%02d/%02d, Time: %02d:%02d:%02d, SolarZenithAngle:%.02lf",
2947  DAS.DGeo.s_name, newtime.tm_year + 1900, newtime.tm_mon + 1,newtime.tm_mday,
2948  newtime.tm_hour, newtime.tm_min, newtime.tm_sec, S_zenetr);
2950  /**************************************************************/
2951 
2952  if (DAS.Flag.exemode == TEMPORIZED)
2953  mode = 0;
2954  else if (DAS.Flag.exemode == SZAMASTERM)
2955  mode = 1;
2956  else if(DAS.Flag.exemode == SZAMODE)
2957  mode = 2;
2958  else if(DAS.Flag.exemode == TESTSZAMODE)
2959  mode = 2;
2960 
2961  er = ChkMaster(mode);
2962 
2963  SZA_FindMin();
2964 }
flag FLAG
Definition: CreateForms.c:84
gui Gui
Graphic User Interface Structure.
double S_zenetr
Definition: SOLPOS.C:92
MOBJECT Albl_sunr
Active Control Panel Labels for Sunrise.
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
int sza
= 1 -> perform measurements; = 0 -> waiting mode
#define TESTSZAMODE
execution driven by SZAPRG file
double latitude
Station latitude.
flag Flag
Structure for different flags.
#define TEMPORIZED
execution driven by MASTER file
#define SZAMASTERM
execution driven by MASTERSZA file ( there is the possibility to distinguish between AM and PM measur...
void MObjectSetText(MOBJECT obj, const char *text)
int SZAMax
Maximum SZA for performing measurements.
Definition: DAS_Spat.c:116
MOBJECT Albl_suns
Active Control Panel Labels for Sunset.
*double S_sunset
Definition: SOLPOS.C:82
d_geo DGeo
struct for Station location
MOBJECT Albl_Azim
Active Control Panel Labels for Sun Azimuth.
MOBJECT lbl_Time
Control Panel Labels for Time.
int timezone
Station timezone.
char s_name[4]
Station name.
double S_sunrise
Definition: SOLPOS.C:80
Definition: Dildef.h:240
das DAS
Definition: DAS_Spat.c:85
void SZA_FindMin()
computation of daily minimum SZA
Definition: DAS_Spat.c:2808
int ftpstatus
0 = FTP Back-UP Not executed; 1 = FTP Back-UP executed;
#define SZAMODE
execution driven by SZAPRG file
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
controlpanel ContrPanel
Control Panel Structure.
double longitude
Station longitude.
Definition: Dildef.h:234
int ChkMaster(int mod)
Definition: DAS_Spat.c:2730
MOBJECT Albl_Elev
Active Control Panel Labels for Sun Elevation.
int exemode
Set the Execution MODE (Execution modes)
int SZACalc(double d_lat, double d_long, double d_tzone, int d_year, int d_daynum, int d_hour, int d_minute, int d_second, float d_temp, float d_press, float d_tilt, float d_aspect)
Calc. Solar angles and radiatives quantities. .
Definition: CalcSZA.c:89
+ Here is the call graph for this function:

§ TaskWDT()

void TaskWDT ( TIMEOUT_ID  id,
void *  data 
)

Definition at line 1767 of file DAS_Spat.c.

References MRefreshTimeout(), TaskWDT(), ids::WDT, WDT_TASK_TIME, and WDTRefresh().

Referenced by TaskWDT(), and WDT_Task_CB().

1768 {
1769 
1770  WDTRefresh();
1771 
1772  // Refresh the WDT tineout (if this instruction is not executed
1773  //after 250 sec the PC reboot!!!)
1774 
1776 }
void MRefreshTimeout(TIMEOUT_ID *pid, CARD32 msec, TIMEOUT_CB cb, void *ud)
void TaskWDT(TIMEOUT_ID id, void *data)
Definition: DAS_Spat.c:1767
int WDT
Watch Dog.
#define WDT_TASK_TIME
Watch Dog Timer.
ids IDS
ID tasks.
Definition: DAS_Spat.c:54
void WDTRefresh(void)
Definition: DAS_Spat.c:1701
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ WDT_CB()

void WDT_CB ( MOBJECT  p,
void *  od,
void *  ad 
)

Definition at line 1507 of file DAS_Spat.c.

References gui::ConfigPanel, D_Timing(), das::Gui, configpanel::lbltelap, MObjectGetText(), MObjectSetText(), das::Nova, configpanel::WDT_edt, WDT_flagstop, WDT_func(), and nova::WDT_TOUT.

Referenced by CONFP_AMS_NOVA().

1508 {
1509  int c = (int) ad, er;
1510  char buf[80];
1511  long timeout;
1512 
1513  MObjectGetText(p, buf);
1514  er = strcmp(buf, "Start");
1515  if (er==0)
1516  {
1517  MObjectSetText(p, "Stop");
1519  DAS.Nova.WDT_TOUT = atoi(buf);
1520 
1521  timeout = (long) (DAS.Nova.WDT_TOUT) * 1000;
1522  WDT_flagstop = 0;
1523 
1524  WDT_func(1); //1 --> Start WDT
1525  D_Timing(0, timeout);
1526  }
1527  else
1528  {
1529  WDT_flagstop = 1;
1530  MObjectSetText(p, "Start");
1531  WDT_func(0); //0 --> Stop WDT
1533  }
1534 }
gui Gui
Graphic User Interface Structure.
int WDT_flagstop
Definition: DAS_Spat.c:146
int D_Timing(int id, long tout)
Definition: DAS_Spat.c:1477
void WDT_func(int mod)
Definition: DAS_Spat.c:1572
MOBJECT WDT_edt
edit Mobject for Watch-Dog elapsed time
char * MObjectGetText(MOBJECT obj, char *text)
void MObjectSetText(MOBJECT obj, const char *text)
das DAS
Definition: DAS_Spat.c:85
nova Nova
NOVA structure.
configpanel ConfigPanel
Configuration panel structure.
static double p
Definition: SOLPOS.C:131
unsigned short WDT_TOUT
WDT timeout.
MOBJECT lbltelap
label elapsed time (for WDT)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ WDT_func()

void WDT_func ( int  mod)

Definition at line 1572 of file DAS_Spat.c.

References DWORD, InByteR(), ISMM_Close(), ISMM_Open(), das::Nova, NOVA6612G2, NOVA7892, NOVA945GSE, OutByte(), nova::type, WDT_SetTimeout(), WDT_Start(), WDT_TASK_TIME, WDT_TIMEOPT_SECOND, and nova::WDT_TOUT.

Referenced by D_Timing(), ShutCB(), WDT_CB(), WDT_Task_CB(), and WinRes().

1573 {
1574 
1575  int er;
1576 
1577 
1578  if (mod) //Start WDT
1579  {
1580  if(DAS.Nova.type == NOVA7892)
1581  {
1582  er = OutByte(0x443, WDT_TASK_TIME);
1583  er = InByteR(0x443);
1584  }
1585  if(DAS.Nova.type == NOVA6612G2)
1586  {
1587 
1588  // The following parameters are used in the IOCTL call
1589  HANDLE hndFile; // Handle to device, obtain from CreateFile
1590 // UCHAR data_b;
1591  WDTPARAM cParam;
1592  DWORD nReturn;
1593 
1594 
1595 
1596  hndFile = CreateFile(WDT_DEVICE, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE,
1597  NULL, OPEN_EXISTING, 0, NULL);
1598 
1599  cParam.timeout=(unsigned char) WDT_TASK_TIME;
1600  DeviceIoControl(hndFile, IOCTL_SYS_WDT_SET_TIMEOUT,
1601  &cParam, sizeof(WDTPARAM), NULL, 0, &nReturn, NULL);
1602  DeviceIoControl(hndFile, IOCTL_SYS_WDT_START,
1603  NULL, 0, NULL, 0, &nReturn, NULL);
1604 
1605  CloseHandle(hndFile);
1606  }
1607  if(DAS.Nova.type == NOVA945GSE)
1608  {
1609 
1610  //Definition for NOVA945GSE I/O (IT8712F)
1611  HANDLE hIsmm;
1612 // HWM_DATA gHwmData;
1613 // UCHAR szBuf[32];
1614 // WORD wNodeCount, wBufSize, ii;
1615 // FLOAT *pfValue;
1616 // ULONG *plValue;
1617  //DIO Var
1618 // WORD wDioConfig;
1619 // WORD wDioOut;
1620 
1621 
1622 
1623 
1624  hIsmm = ISMM_Open();
1625  if (hIsmm == INVALID_HANDLE_VALUE)
1626  {
1627  printf("Can not open iSMM device\n");
1628  }
1629 
1631 
1632  WDT_Start(hIsmm,1);
1633 
1634  ISMM_Close(hIsmm);
1635  }
1636 
1637 
1638 
1639  }
1640  else //STOP WDT
1641  {
1642  if(DAS.Nova.type == NOVA7892)
1643  {
1644  er = InByteR(0x843);
1645  }
1646  if(DAS.Nova.type == NOVA6612G2)
1647  {
1648 
1649  // The following parameters are used in the IOCTL call
1650  HANDLE hndFile; // Handle to device, obtain from CreateFile
1651 // UCHAR data_b;
1652 // WDTPARAM cParam;
1653  DWORD nReturn;
1654 
1655 
1656  hndFile = CreateFile(WDT_DEVICE, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE,
1657  NULL, OPEN_EXISTING, 0, NULL);
1658 
1659  DeviceIoControl(hndFile, IOCTL_SYS_WDT_STOP,
1660  NULL, 0, NULL, 0, &nReturn, NULL);
1661 
1662  CloseHandle(hndFile);
1663  }
1664  if(DAS.Nova.type == NOVA945GSE)
1665  {
1666  //Definition for NOVA945GSE I/O (IT8712F)
1667  HANDLE hIsmm;
1668 // HWM_DATA gHwmData;
1669 // UCHAR szBuf[32];
1670 // WORD wNodeCount, wBufSize, ii;
1671 // FLOAT *pfValue;
1672 // ULONG *plValue;
1673  //DIO Var
1674 // WORD wDioConfig;
1675 // WORD wDioOut;
1676 
1677  hIsmm = ISMM_Open();
1678  if (hIsmm == INVALID_HANDLE_VALUE)
1679  {
1680  printf("Can not open iSMM device\n");
1681  }
1682 
1683  WDT_Start(hIsmm,0);
1684 
1685  ISMM_Close(hIsmm);
1686  }
1687 
1688  }
1689 }
PREFUNCTION int MIDFUNCTION OutByte(unsigned short Port, int Data)
#define NOVA945GSE
NOVA945GSE (SPATRAM2, GASCODNG1, GASCODNG4)
#define NOVA6612G2
NOVA6612G2 (not used in TROPOGAS, LIS, GASCODNG2/3)
#define WDT_TASK_TIME
Watch Dog Timer.
PREFUNCTION int MIDFUNCTION InByteR(unsigned short Port)
ISMM_API BOOL WDT_SetTimeout(HANDLE hIsmm, WORD wTimeout, WORD wTimeOption)
ISMM_API BOOL ISMM_Close(HANDLE hIsmm)
das DAS
Definition: DAS_Spat.c:85
nova Nova
NOVA structure.
ISMM_API BOOL WDT_Start(HANDLE hIsmm, BOOL bControlState)
#define DWORD
Definition: DSCUD.H:75
#define NOVA7892
NOVA7892 monoboard (old)
int type
type of NOVA monoboard used (7892 or 945GSE)
unsigned short WDT_TOUT
WDT timeout.
ISMM_API HANDLE ISMM_Open(void)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ WDT_Task_CB()

void WDT_Task_CB ( MOBJECT  o,
void *  od,
void *  ad 
)

Definition at line 1547 of file DAS_Spat.c.

References MObjectGetText(), MObjectSetText(), MRefreshTimeout(), TaskWDT(), ids::WDT, WDT_func(), and WDT_TASK_TIME.

Referenced by CONFP_AMS_NOVA().

1548 {
1549 
1550  int er;
1551  char buf[80];
1552 
1553  MObjectGetText(o, buf);
1554  er = strcmp(buf, "Launch Task");
1555  if (er==0)
1556  {
1557  MObjectSetText(o, "Task in Exec.");
1559  }
1560  else
1561  {
1562  MObjectSetText(o, "Launch Task");
1563  WDT_func(0);
1564  }
1565 }
void MRefreshTimeout(TIMEOUT_ID *pid, CARD32 msec, TIMEOUT_CB cb, void *ud)
void WDT_func(int mod)
Definition: DAS_Spat.c:1572
char * MObjectGetText(MOBJECT obj, char *text)
void TaskWDT(TIMEOUT_ID id, void *data)
Definition: DAS_Spat.c:1767
void MObjectSetText(MOBJECT obj, const char *text)
int WDT
Watch Dog.
#define WDT_TASK_TIME
Watch Dog Timer.
ids IDS
ID tasks.
Definition: DAS_Spat.c:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ WDTRefresh()

void WDTRefresh ( void  )

Definition at line 1701 of file DAS_Spat.c.

References DWORD, InByteR(), ISMM_Close(), ISMM_Open(), das::Nova, NOVA6612G2, NOVA7892, NOVA945GSE, nova::type, WDT_SetTimeout(), WDT_Start(), WDT_TASK_TIME, WDT_TIMEOPT_SECOND, and nova::WDT_TOUT.

Referenced by TaskWDT().

1702 {
1703  int er=0;
1704 
1705  // The following parameters are used in the IOCTL call
1706 // HANDLE hndFile; // Handle to device, obtain from CreateFile
1707 // UCHAR data_b;
1708 // WDTPARAM cParam;
1709 // DWORD nReturn;
1710  if(DAS.Nova.type == NOVA7892)
1711  {
1712  er = InByteR(0x843); //TIMER STOP
1713 
1714  er = InByteR(0x443); //TIMER START
1715  }
1716  if(DAS.Nova.type == NOVA6612G2)
1717  {
1718 
1719  // The following parameters are used in the IOCTL call
1720  HANDLE hndFile; // Handle to device, obtain from CreateFile
1721 // UCHAR data_b;
1722  WDTPARAM cParam;
1723  DWORD nReturn;
1724 
1725 
1726  hndFile = CreateFile(WDT_DEVICE, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE,
1727  NULL, OPEN_EXISTING, 0, NULL);
1728  cParam.timeout=(unsigned char) WDT_TASK_TIME;
1729  DeviceIoControl(hndFile, IOCTL_SYS_WDT_SET_TIMEOUT,
1730  &cParam, sizeof(WDTPARAM), NULL, 0, &nReturn, NULL);
1731  CloseHandle(hndFile);
1732  }
1733  if(DAS.Nova.type == NOVA945GSE)
1734  {
1735  //Definition for NOVA945GSE I/O (IT8712F)
1736  HANDLE hIsmm;
1737 // HWM_DATA gHwmData;
1738 // UCHAR szBuf[32];
1739 // WORD wNodeCount, wBufSize, ii;
1740 // FLOAT *pfValue;
1741 // ULONG *plValue;
1742  //DIO Var
1743 // WORD wDioConfig;
1744 // WORD wDioOut;
1745 
1746  hIsmm = ISMM_Open();
1747  if (hIsmm == INVALID_HANDLE_VALUE)
1748  {
1749  printf("Can not open iSMM device\n");
1750  }
1751 
1753 
1754  WDT_Start(hIsmm,1);
1755 
1756  ISMM_Close(hIsmm);
1757  }
1758 
1759 
1760 }
#define NOVA945GSE
NOVA945GSE (SPATRAM2, GASCODNG1, GASCODNG4)
#define NOVA6612G2
NOVA6612G2 (not used in TROPOGAS, LIS, GASCODNG2/3)
#define WDT_TASK_TIME
Watch Dog Timer.
PREFUNCTION int MIDFUNCTION InByteR(unsigned short Port)
ISMM_API BOOL WDT_SetTimeout(HANDLE hIsmm, WORD wTimeout, WORD wTimeOption)
ISMM_API BOOL ISMM_Close(HANDLE hIsmm)
das DAS
Definition: DAS_Spat.c:85
nova Nova
NOVA structure.
ISMM_API BOOL WDT_Start(HANDLE hIsmm, BOOL bControlState)
#define DWORD
Definition: DSCUD.H:75
#define NOVA7892
NOVA7892 monoboard (old)
int type
type of NOVA monoboard used (7892 or 945GSE)
unsigned short WDT_TOUT
WDT timeout.
ISMM_API HANDLE ISMM_Open(void)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ WriteShellTitle()

void WriteShellTitle ( MOBJECT  o,
int  eqt 
)

Definition at line 2176 of file DAS_Spat.c.

References DASREL, DASREV, DASREVDATE, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, LIS_, MShellSetTitle(), SPATRAM, SPATRAM2, SPATRAM3, SPATRAMPLUS, and TROPOGAS.

Referenced by SZA_FirstCalc().

2177 {
2178 
2179  int c = eqt;
2180  char buf[128], str[16];
2181 
2182  switch (c)
2183  {
2184  case TROPOGAS:
2185  sprintf(str,"TROPOGAS");
2186  break;
2187  case SPATRAM:
2188  sprintf(str,"SPATRAM");
2189  break;
2190  case LIS_:
2191  sprintf(str,"LIS");
2192  break;
2193  case SPATRAMPLUS:
2194  sprintf(str,"SPATRAMPLUS");
2195  break;
2196  case GASCODNG1:
2197  sprintf(str,"GASCODNG1");
2198  break;
2199  case GASCODNG2:
2200  sprintf(str,"GASCODNG2");
2201  break;
2202  case GASCODNG3:
2203  sprintf(str,"GASCODNG3");
2204  break;
2205  case GASCODNG4:
2206  sprintf(str, "GASCODNG4");
2207  break;
2208  case SPATRAM3:
2209  sprintf(str,"SPATRAM3");
2210  break;
2211  case SPATRAM2:
2212  sprintf(str,"SPATRAM2");
2213  break;
2214 
2215  default:
2216  sprintf(str,"UNKNOWN");
2217  break;
2218  }
2219  sprintf(buf,"DAS Release %d.%.1lf (%s) - [Setting for %s]", DASREL, DASREV, DASREVDATE, str);
2220  MShellSetTitle(o, buf);
2221 
2222 }
#define SPATRAM
SPectrometer for Atmospheric TRAcers Measurements - CGE-UE Portugal.
#define DASREV
DAS Revision Number.
#define LIS_
Lampedusa Island Spectrometer - ENEA.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
#define DASREVDATE
DAS Revision Date.
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
#define SPATRAM2
SPATRAM2 (with ATX power supply & HiresV)
#define SPATRAMPLUS
As SPATRAM plus AltAzimuth platform.
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
#define SPATRAM3
SPATRAM3.
void MShellSetTitle(MOBJECT obj, const char *title)
#define DASREL
DAS Release Number.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

§ AbsFilePos

long AbsFilePos

Absolute File position.

Definition at line 122 of file DAS_Spat.c.

Referenced by ViewNext(), and ViewNext_BIN().

§ AST

AzimuthSt AST

Definition at line 71 of file DAS_Spat.c.

§ BIL

bil BIL

Definition at line 74 of file DAS_Spat.c.

§ BlindPix

int BlindPix = 0

§ CCD_SetupFlg

int CCD_SetupFlg = 0

Definition at line 138 of file DAS_Spat.c.

Referenced by ApplyChCB(), CCDSetupCB(), and WriteParaminiCB().

§ Cfg

config Cfg

Camera controls & Options.

Definition at line 46 of file DAS_Spat.c.

§ ContFP

int ContFP = 0

Counter for File position.

Definition at line 123 of file DAS_Spat.c.

Referenced by CloseFile(), CloseFile_BIN(), ClosePlotCB(), D_PButt_CB(), MenuFileOLP_CB(), ViewNext(), ViewNext_BIN(), ViewPre(), and ViewPre_BIN().

§ countsopsh

unsigned long countsopsh

counting the number of opening shutter

Definition at line 133 of file DAS_Spat.c.

Referenced by DB_GetCCD(), and ShutterOpening().

§ DAS

das DAS

Definition at line 85 of file DAS_Spat.c.

§ DAS_StartDOY

int DAS_StartDOY

Definition at line 107 of file DAS_Spat.c.

Referenced by MGUIMain(), and SetWindowsReset().

§ DAS_StartHour

int DAS_StartHour

Definition at line 106 of file DAS_Spat.c.

Referenced by MGUIMain(), and SetWindowsReset().

§ DC_CCD

ccd DC_CCD

CCD settings.

Definition at line 44 of file DAS_Spat.c.

§ DC_HP

ptf DC_HP

Platform settings.

Definition at line 45 of file DAS_Spat.c.

§ DeltaTPrec

int DeltaTPrec

Definition at line 111 of file DAS_Spat.c.

Referenced by Task_LIS_Temp().

§ DeviceTypeInput

const char* DeviceTypeInput[] = {{"Direct"}, {"TelesExtLamp"}, {"Calib Lamps"}, {"Alt-Az Platf"}, {"Radiometer"}, {"TelesIntLamp"}, {"TelescopeV"}, {""}}

const char array for the Device type <-> Input association

Definition at line 247 of file DAS_Spat.c.

Referenced by CONFP_opt_page6().

§ DGEO

d_geo DGEO

geographical coordinates structure

Definition at line 53 of file DAS_Spat.c.

§ DIL

dil DIL

Definition at line 72 of file DAS_Spat.c.

§ DLOG

dlog DLOG

Definition at line 52 of file DAS_Spat.c.

Referenced by WriteLogAMS(), and writelogmotor().

§ DOAS

doas DOAS

Definition at line 63 of file DAS_Spat.c.

§ DPAL

palette DPAL

Definition at line 73 of file DAS_Spat.c.

§ DPWD

dpwd DPWD

Danbo Passw.

Definition at line 49 of file DAS_Spat.c.

§ dscb

DSCB dscb

Definition at line 67 of file DAS_Spat.c.

§ dsccb

DSCCB dsccb

Definition at line 68 of file DAS_Spat.c.

§ ExeREM

int ExeREM = 1

§ ExMast

master ExMast[PRGMAXNUM]

Definition at line 55 of file DAS_Spat.c.

Referenced by D_AutoExecution().

§ Fil_Code

char* Fil_Code[] = {{"NULL"}, {"UG11"}, {"UG1 "}, {"BG12"}, {"BG25"}, {"H475"}}

const char array for the realisation of the Filters buttons in the Filter shell

Definition at line 207 of file DAS_Spat.c.

Referenced by D_BuildH(), DB_Fil_CB(), HeaderInPlot(), MDCreateSh_Fil(), MDCreateSh_SimPos(), SD_FilterW(), SD_Position(), and SD_PosOMUDev().

§ Fil_Code8H

char* Fil_Code8H[] = {{"NULL"}, {"UG5"}, {"UG11"}, {"BG23"}, {"NULL"}, {"NULL"}, {"LPAS"}, {"NULL"}}

const char array for the realisation of the Filters buttons in the Filter shell

Definition at line 204 of file DAS_Spat.c.

Referenced by D_BuildH(), DB_Fil_CB(), DB_NDFil_CB(), HeaderInPlot(), MDCreateSh_Fil(), MDCreateSh_NDFil(), MDCreateSh_SimPos(), SD_FilterW(), SD_NDFilterW(), SD_Position(), and SD_PosOMUDev().

§ Fil_CodeNG

char* Fil_CodeNG[] = {{"NULL"}, {"B12 "}, {"B12F"}, {"B39 "}, {"B39F"}, {"UG5 "}}

const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3 instruments

Definition at line 216 of file DAS_Spat.c.

Referenced by D_BuildH(), DB_Fil_CB(), DB_NDFil_CB(), HeaderInPlot(), MDCreateSh_Fil(), MDCreateSh_NDFil(), MDCreateSh_SimPos(), SD_FilterW(), SD_NDFilterW(), SD_Position(), and SD_PosOMUDev().

§ Fil_CodeNG1

char* Fil_CodeNG1[] = {{"NULL"}, {"B12 "}, {"S400"}, {"B39 "}, {"S500"}, {"UG5 "}}

const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrument

Definition at line 213 of file DAS_Spat.c.

Referenced by D_BuildH(), DB_Fil_CB(), HeaderInPlot(), MDCreateSh_Fil(), MDCreateSh_SimPos(), SD_FilterW(), SD_Position(), and SD_PosOMUDev().

§ Fil_CodeTropo

char* Fil_CodeTropo[] = {{"NULL"}, {"BG28"}, {"UG11"}, {"BG12"}, {"BG23"}, {"HPas"}}

const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrument

Definition at line 210 of file DAS_Spat.c.

Referenced by D_BuildH(), DB_Fil_CB(), DB_NDFil_CB(), HeaderInPlot(), MDCreateSh_Fil(), MDCreateSh_NDFil(), MDCreateSh_SimPos(), SD_FilterW(), SD_NDFilterW(), SD_Position(), and SD_PosOMUDev().

§ FirstTime

int FirstTime = 1

Definition at line 110 of file DAS_Spat.c.

Referenced by Task_LIS_Temp().

§ FlgSM_Stop

int FlgSM_Stop = 1

Steppers Motor Activity: 0 = Motors moving; 1 = Motors stopped.

Definition at line 140 of file DAS_Spat.c.

Referenced by AMS_DoPos(), Task_CCD_Temp(), and Task_LIS_Temp().

§ FWS

§ GRS

GratingSt GRS

Grating.

Definition at line 60 of file DAS_Spat.c.

§ HomePosition

char* HomePosition[] = {{"H_Mir"}, {"H_Grat"}, {"H_Filt"}, {"H_NDFilt"}, {"H_Zen"}, {"H_Azi"}, {"Close"}}

const char array for the realisation of the Filters buttons in the ND Filter shell

Definition at line 227 of file DAS_Spat.c.

Referenced by MDCreateSh_Home().

§ IDS

ids IDS

ID tasks.

Definition at line 54 of file DAS_Spat.c.

Referenced by DB_ToolsKeyB_CB(), E_Home_SM1(), HomeTrack(), and Task_HomeGrat().

§ IDX

int IDX

§ IDY

int IDY

§ Incr_Read_Temp

int Incr_Read_Temp =0

Definition at line 101 of file DAS_Spat.c.

Referenced by D_readtemp(), and Task_LIS_Temp().

§ KeyCode

const char* KeyCode[]
Initial value:
= {{"AUTORNG"}, {"AVGCCD"}, {"BEGIN"}, {"CALIBRA"}, {"DARKC"}, {"EXPO"},
{"FILTER"}, {"GETCCD"}, {"H_FILTER"}, {"H_GRAT"}, {"H_MIRROR"}, {"HG_OFF"},
{"HG_ON"}, {"LABEL"}, {"MEASURE"}, {"MIRROR"}, {"PLOT"},{"QJ_OFF"},
{"QJ_ON"}, {"RADIO"}, {"REM"}, {"SAVE"}, {"WAIT"}, {"WAVELEN"}, {"XEND"},
{"MEASHOR"}, {"ELAMPON"}, {"ELAMPOFF"}, {"ESHUTOP"}, {"ESHUTCL"},
{"H_ZEN"}, {"H_AZI"}, {"ZENITH"}, {"AZIMUTH"}, {"AAMEASURE"}, {"AVGCCDHOR"},
{"CHKEXLAMP"}, {"AAPOSIT"}, {"IREFSUN"}, {"MEASHOR2"},{"SETCCDTEMP"},{"SETCCDVBIN"},
{"SETCCDPOW"}, {"NDFILTER"}, {"H_NDFW"}, {"DFMEASURE"}, {"SETCCDOFFS"}, {"QJSCAN"},
{"H_GRAT_CAL"}, {"HGSCAN"}, {"ALMUCANTAR"}, {"DIRECTSUN"} }

Definition at line 164 of file DAS_Spat.c.

Referenced by Fetch(), and MDCreatesh_vitesa().

§ LevelDefPix

unsigned int LevelDefPix = 100

Definition at line 126 of file DAS_Spat.c.

Referenced by ActEditCB(), and GetDefPix().

§ MainCommand

int MainCommand =0

Command switch in main loop.

Definition at line 105 of file DAS_Spat.c.

Referenced by D_AutoExecution().

§ Master

int Master = 0

§ mattempbuff

unsigned int* mattempbuff

Definition at line 128 of file DAS_Spat.c.

§ Mir_Code

const char* Mir_Code[] = {{"Zenith "}, {"HorizDX"}, {"Calibra"}, {"HorizSX"}, {""}, {""}, {""}, {""}}

const char array for the realisation of the Mirrors buttons in the Mirror shell

Definition at line 231 of file DAS_Spat.c.

Referenced by CONFP_AMS_SM_OFFSET(), CONFP_opt_page6(), D_BuildH(), DB_Mir_CB(), DemoInitMotor(), HeaderInPlot(), HomeMirror(), MDCreateSh_Mir(), MDCreateSh_SimPos(), SD_Mirror(), SD_Position(), and SD_PosOMUDev().

§ Mir_CodeTropo

const char* Mir_CodeTropo[] = {{"Calibra "}, {"HorizDX"}, {"NULL "}, {"HorizSX"}, {""}, {""}, {""}, {""}}

const char array for the realisation of the Mirrors buttons in the Mirror shell for TROPOGAS

Definition at line 234 of file DAS_Spat.c.

Referenced by CONFP_AMS_SM_OFFSET(), CONFP_opt_page6(), D_BuildH(), DB_Mir_CB(), DemoInitMotor(), HeaderInPlot(), HomeMirror(), MDCreateSh_Mir(), MDCreateSh_SimPos(), SD_Mirror(), SD_Position(), and SD_PosOMUDev().

§ MIS

MirrorSt MIS

§ Mode

int Mode

Definition at line 108 of file DAS_Spat.c.

§ MTCL

mtcl MTCL

MTColor.

Definition at line 62 of file DAS_Spat.c.

§ N_AVG

int N_AVG = 25

Number of measurements for Averaging mode in fixed number of meas. mode.

Definition at line 113 of file DAS_Spat.c.

Referenced by ActEditCB(), CONFP_opt_page1(), D_Average(), D_BuildH(), DB_RadioAvgModeCB(), HeaderInPlot(), LoadDB_Options(), and WriteOptioniniCB().

§ N_RM

int N_RM = 0

Number of measurements for Averaging mode in fixed exposure time mode.

Definition at line 114 of file DAS_Spat.c.

Referenced by D_Average(), D_BuildH(), and HeaderInPlot().

§ NDFil_Code

char* NDFil_Code[] = {{"NULL"}, {"ND1"}, {"ND2"}, {"ND3"}, {"ND4"}, {"H645"}}

const char array for the realisation of the Filters buttons in the ND Filter shell

Definition at line 219 of file DAS_Spat.c.

Referenced by D_AssignLabelPlot(), DB_NDFil_CB(), HeaderInPlot(), MDCreateSh_NDFil(), and SD_NDFilterW().

§ NDFWS

ND Filter Wheel.

Definition at line 58 of file DAS_Spat.c.

Referenced by DB_PushButtonMouse_CB(), MDCreateSh_NDFil(), and SD_NDFilterW().

§ NOVA

nova NOVA

Definition at line 77 of file DAS_Spat.c.

§ nowait

int nowait = 1

Definition at line 2389 of file DAS_Spat.c.

Referenced by MDCreateWaitShell(), and NoWaitCB().

§ nowaitsplash

int nowaitsplash = 1

Definition at line 2249 of file DAS_Spat.c.

Referenced by MDCreateSplashExe(), and NoWaitSplashCB().

§ OMUTEMP

omutemp OMUTEMP

structure for OMU temperatures

Definition at line 65 of file DAS_Spat.c.

§ OMUTHR

omuthr OMUTHR

Definition at line 75 of file DAS_Spat.c.

§ on

int on = 0

PRG execution control variabile.

Definition at line 109 of file DAS_Spat.c.

Referenced by D_AutoExecution(), DB_SelButt_CB(), DB_ToolsKeyB_CB(), and SZA_FirstCalc().

§ ON_OFFLINEPLOT

int ON_OFFLINEPLOT = 0

§ PaletteMode

int PaletteMode

Definition at line 158 of file DAS_Spat.c.

Referenced by ColorSaveCB(), DB_CellExposeCB(), DB_ChangeColorCellCB(), and InitColors().

§ PLColor

unsigned long* PLColor[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

Definition at line 251 of file DAS_Spat.c.

§ PrgCnt

long PrgCnt

§ PrgFile

char PrgFile[_MAX_PATH]

Name of the PRG file.

Definition at line 91 of file DAS_Spat.c.

Referenced by ChkExeMode(), DB_ToolsKeyB_CB(), InitFlags(), ManualModeCB(), SZA_FirstCalc(), Task_LIS_Temp(), and ViewPlot().

§ PrgNum

int PrgNum = 0

Definition at line 96 of file DAS_Spat.c.

Referenced by SZA_FirstCalc().

§ PrgNumExe

int PrgNumExe = 0

number of PRG file in execution

Definition at line 98 of file DAS_Spat.c.

Referenced by ChkMaster(), and D_AutoExecution().

§ PrgNumInM

int PrgNumInM = 0

Actual number of PRG File in current MASTER or MASTERSZA File.

Definition at line 97 of file DAS_Spat.c.

Referenced by ChkMaster(), D_AutoExecution(), and ExMaster().

§ PrgSiz

long PrgSiz

Size of the PRG file.

Length of PRG file (bytes)

Definition at line 94 of file DAS_Spat.c.

Referenced by LoadExec(), and PRG_Check().

§ Program

char* Program

§ REL_FILE_POS

long REL_FILE_POS[51]

relative File position

Definition at line 124 of file DAS_Spat.c.

Referenced by D_PButt_CB(), MenuFileOLP_CB(), ViewNext(), ViewNext_BIN(), and Visualizza().

§ Server

int Server = 0

§ STEPM

stepm STEPM

Stepper Motors.

Definition at line 50 of file DAS_Spat.c.

§ SZADelta

dsza SZADelta

§ SZAMax

int SZAMax = 100

Maximum SZA for performing measurements.

Definition at line 116 of file DAS_Spat.c.

Referenced by ActEditCB(), CONFP_opt_page3(), LoadDB_Options(), SZA_FirstCalc(), Task_Timer(), and WriteOptioniniCB().

§ TExp

double TExp

§ TOOLS

tools TOOLS

tools structure

Definition at line 51 of file DAS_Spat.c.

§ Total_Spec

long Total_Spec

Definition at line 95 of file DAS_Spat.c.

§ TOTTEXP

int TOTTEXP = 5

Total Exposure time in Averaging mode.

Definition at line 115 of file DAS_Spat.c.

Referenced by ActEditCB(), CONFP_opt_page1(), D_Average(), DB_RadioAvgModeCB(), LoadDB_Options(), and WriteOptioniniCB().

§ wav

long wav[]
Initial value:
= { 36803, 24479, 12180, 0, -12238, -24031, -35587,
-46808, -57645, -68842, -80254, -92674, -102911, -112526,
-121684, -130148, -137532, -144533}

Step Number definition - for SD_Grating.

Definition at line 195 of file DAS_Spat.c.

Referenced by CONFP_param_page2(), LoadWlstep(), SD_Grating(), SD_Position(), SD_PosOMUDev(), valstedt(), and WritewlstepiniCB().

§ WDT_flagstop

int WDT_flagstop

Definition at line 146 of file DAS_Spat.c.

Referenced by D_Timing(), and WDT_CB().

§ WDT_Timeout

unsigned char WDT_Timeout = 100

Definition at line 145 of file DAS_Spat.c.

§ wl

int wl[]

§ WlSet

int WlSet

Wavelength position definition - for SD_Grating.

Definition at line 135 of file DAS_Spat.c.

Referenced by DB_KeyB_CB(), DB_SheelESC(), and DB_Wl_CB().

§ ZST

ZenithSt ZST

Definition at line 70 of file DAS_Spat.c.

______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:44:36 for DAS - Rel. 3.1.6 - 18/09/2017.