SPATRAM  18/09/2017
DAS_Spatram.h File Reference

Function prototypes. More...

#include "DAS_Spatramdef.h"
#include "solpos.h"
+ Include dependency graph for DAS_Spatram.h:

Go to the source code of this file.

Functions

void AboutCB (MOBJECT o, void *s, void *v)
 Create the About information shell.
. More...
 
void ActEditCB (MOBJECT edit, char *text, void *ed)
 Text Application callback Apply to the variables the text typed in various text box and validated by ValidateCB(MOBJECT edit, EDIT_VAL *ev, void *ii) More...
 
void ActMvGratCB (MOBJECT edit, char *text, void *ed)
 Move Grating of a free steps number callback.
. More...
 
void ADTesterCB (MOBJECT shell, void *od, void *ad)
 Test Temperature AD Converter callback. More...
 
long * AllocLongMat (int hp, int vp)
 
void AMS_Error (int w)
 Alerts for AMS errors
Creates a message window reporting the number of the error. More...
 
void ApplyChCB (MOBJECT shell, void *od, void *ad)
 Apply changes in DAS Config callback. More...
 
void ApplyImgCB (MOBJECT shell, void *od, void *ad)
 Image type Application callback Apply to the CCD buffer the selected type of image (MONO or RGB) More...
 
int AssignParam (int mod)
 Assign parameters to the CP labels.
. More...
 
double AutoRange (int mod)
 Calculate the exposure time
The optimum exposure time (TExp) is calculated with an initial TExpAR=0.1 s, and assuming the linearity between the CCD signal and the exposure time.
If TExp calculated is lower than the minimum TExp allowed (0.02s) (meaning a saturation of the CCD), the appropriate filter is positioned and the procedure is repeated.
If with TExpAR the delta(CCD(x,y))=Max(CCD(x,y))-Min(CCD(x,y)) is lower than 2000 counts (meaning very low radiation intensity) TExpAR is increased and the procedure repeated for at least 4 times (Max TExpAR ~ 5 s) More...
 
int BrowseLog (void)
 
int BuildLogRatio (void)
 first attempt to apply the DOAS algorithm (..on going!!!) More...
 
double CalcFluxIndex (unsigned short mis[], int dx, int dy, float te)
 calculates the Flux Index of a measurement More...
 
void CCD_Error (char *str)
 Alerts for CCD errors
Creates a message window reporting the number of the error. More...
 
void CCDSetupCB (MOBJECT shell, void *od, void *ad)
 CCD setup Callback. Execute DCS.exe (DTA Camera Select) More...
 
int ChkConfigInstance (void)
 
int ChkDigIO (unsigned char word, int bitn)
 check for digital I/O Status More...
 
int ChkMaster (int mod)
 
int ChkWinInstance (char *buff, MOBJECT obj)
 
void CloseColPickCB (MOBJECT obj, void *s, void *v)
 Declared but not used. More...
 
void CloseConfigCB (MOBJECT shell, void *od, void *ad)
 Close DAS-Config callback close the DAS_Config window. If the testing of the ADConverter is running it is stopped. More...
 
void CloseFontViewCB (MOBJECT p, void *a, void *data)
 This callback Unloads the latest loaded font and destroys the dialog. More...
 
char * CodeEq2Name (int code)
 code Equipment to Name
More...
 
void ColObjCB (MOBJECT o, void *a, void *v)
 select the object to consider for color picking More...
 
void ColorAssignCB (MOBJECT o, void *o_data, void *a_data)
 
void ColorFreeCB (MOBJECT o, void *o_data, void *a_data)
 Declared but not used. More...
 
void ColorMapExposeCB (MOBJECT obj, MEvent *pexp, void *a_data)
 Declared but not used. More...
 
void ColorMapInputCB (MOBJECT obj, MEvent *pe, void *a_data)
 Declared but not used. More...
 
void ColorMapResizeCB (MOBJECT obj, DRAWAREA_PREF *pref, void *a_data)
 Declared but not used. More...
 
void ColorSaveCB (MOBJECT o, void *o_data, void *a_data)
 Declared but not used. More...
 
void ColPickBackForeGCB (MOBJECT o, void *a, void *v)
 select if the foreground or background color of the selected object will be picked More...
 
void ColumnFCB (MOBJECT p, void *od, void *ad)
 
void ComErrors (int w)
 Alerts for COM errors
Creates a message window reporting the number of the error. More...
 
void ConfigCB (MOBJECT p, void *od, void *ad)
 DAS Configuration shell creation callback. More...
 
void D_AutoExecution (void)
 *.PRG Automatic Execution in Automatic Mode
More...
 
void D_Average (int mod)
 Performs averaged measurements
. More...
 
void D_AverageTFix (void)
 NOT Used
. More...
 
void D_BuildH (int mod, int s)
 Build Header of the measurements .
. More...
 
int D_Calibra (void)
 Spectral Calibration
Procedure for the spectral calibration with HG lamp. Shift of HG spectral line at 4358.4 on pixel 512. More...
 
void D_CloseVR (MOBJECT p, void *od, void *ad)
 Callback closing the status bar. More...
 
void D_FixSZA (void)
 
int D_InitPC104 (void)
 Starting function that calls the driver functions used NOTE: By convention, you should capture the BYTE return value for each driver API call, and check the error code. I. Driver Initialization II. Board Initialization III. AD Settings. More...
 
void D_Plot (void)
 ViewPlot callback
. More...
 
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. More...
 
void D_Print_BIL_H_ASCII (int mod, FILE *fff)
 
void D_PrintBILSPH (FILE *fff)
 Print Header. More...
 
void D_PrintBILSPH_BIN (int fd)
 Print on file the binary header of the measured spectrum. More...
 
void D_PrintHMod (FILE *fff)
 Print the header in Column format. More...
 
void D_PrintSpectrum (FILE *fff)
 Print Spectrum. More...
 
void D_rt (void)
 D_readtemp_int callback
. More...
 
void D_Saving (void)
 Saving image.
Procedure for saving the CCD Image Used since version 2.1.0. The coiche between binary and ASCII saving mode is obtained with the mode Flag optionini. More...
 
void D_SunCalc (void)
 Sun Calculator Callback. More...
 
void D_UndoCB (MOBJECT o, void *a, void *v)
 Undo the previous color setting operation. More...
 
void D_VRange (char *str, int val, int r, int g, int b)
 Create and display the status bar. More...
 
void D_VRangeSim (int id, char *str, int val, int r, int g, int b, int x, int y)
 init progress bar during simultaneous positioning More...
 
int D_WriteInitLog (char *str)
 writes devices errors(AMS, CCD...) on the Devices.log file.
More...
 
void DAS_Error (int c)
 
void DAS_Message (char *str, int er)
 
void DB_2DPlot (char *title, int x, int y, int dx, int dy, int mode)
 2D_Plot panel callback. More...
 
void DB_AMSposmode_CB (MOBJECT o, void *a, void *v)
 callback selecting the positioning mode for stepper motors ( sequential or simulaneaous)
More...
 
void DB_AMSProgBar_CB (MOBJECT o, void *a, void *v)
 callback selecting if show or not the progress bar for motor positioning
More...
 
int DB_Ask (char *tit, char *bmp, char *label, char *pre, int len, char *pbtype)
 Input Shell Create an input box. More...
 
void DB_Ask_SheelESC (MOBJECT obj, MKeyEvent *pe, void *a_data)
 Input Shell Callback Callback for the Input Shell destruction at the pression of the ESC key. More...
 
void DB_AskCB (MOBJECT p, void *od, void *ad)
 Input Shell Callback Callback for the Input Shell. More...
 
int DB_CalcFluxI (char *nomefile)
 
void DB_CellExposeCB (MOBJECT obj, MEvent *pexp, void *a_data)
 display selected Color More...
 
void DB_CellResizeCB (MOBJECT obj, DRAWAREA_PREF *pref, void *a_data)
 display selected Color More...
 
void DB_ChangeColorCellCB (MOBJECT o, MVALUE o_data, void *a_data)
 draw the object 'o' with the selected color More...
 
void DB_ChooseButtons (int w)
 
void DB_CloseAsk (MOBJECT p, void *od, void *ad)
 Input Shell Callback Callback for the Input Shell destruction. More...
 
int DB_CloseCOM (void)
 Close the previously opened COM port. More...
 
void DB_ColorAssign (MOBJECT a[], int numel, short tc[])
 Assign to the selected object the chosen color. More...
 
void DB_ColorPick (MOBJECT o)
 
int DB_Column (char *sourcefilename)
 Column format. More...
 
void DB_DefectPixCorr (void)
 Apply thew pixel correction.
. More...
 
void DB_DispBlindPixCB (MOBJECT o, void *id, void *a_data)
 Display Blind Pixel Callback
Set if the blind pixels will be displayed or not on the plot window. More...
 
void DB_Do2Undo_Colors (short docol[], short undocol[])
 
void DB_Do2Undo_Fonts (MTFont dofont, MTFont undofont)
 
void DB_EqTypeCB (MOBJECT o, void *a, void *v)
 
void DB_Fil_CB (MOBJECT p, void *od, void *ad)
 callback for filter wheel positioning in Filter shell
More...
 
void DB_FilSelButtKB_CB (MOBJECT obj, MKeyEvent *pe, void *a_data)
 callback for select a specified filter push button with the keyboard
More...
 
void DB_FilSelButtMouse_CB (MOBJECT obj, MMouseEvent *pe, void *a_data)
 callback changing the bakground color of the push button passing the mouse over it
More...
 
void DB_FilterCB (MOBJECT p, void *od, void *ad)
 Filter positioning callback. More...
 
void DB_FilterType_CB (MOBJECT o, void *a, void *v)
 callback selecting the type of installed filter wheel module
More...
 
void DB_FontAssign (MOBJECT a[], int numel, MTFont fnt)
 This callback assign font to the selected object. More...
 
int DB_GetCCD (int mod)
 Get CCD Image.
. More...
 
int DB_HelpCB (MOBJECT o, void *od, void *ad)
 Help Callback
Create the help in the predefined WEB Browser. More...
 
void DB_ImgTypeCB (MOBJECT o, void *id, void *a_data)
 Set the Image type. More...
 
int DB_InfCB (MOBJECT o, void *od, void *ad)
 Inf Callback
Create the Inf shell. More...
 
int DB_InitAMS (int nid, int mod, int powera, int stepa, int slopea, int speeda, int powerb, int stepb, int slopeb, int speedb)
 Init selected AMS. More...
 
int DB_InitCamera (int mod)
 Initialize Camera Parameters.
Procedure that initialize the CCD Camera. More...
 
int DB_InitCOM (int comn)
 Init selected COM port. More...
 
int DB_InitDil (void)
 Initialize DIL. Procedure that initialize the DTA Imaging library. More...
 
int DB_InitMotor (int mod)
 Initialize AMS. Procedure that initialize the parameters for the AMS's devices. More...
 
void DB_KB_ButtonActive (int mod)
 Enable/Disable Push buttons on the Control Panel. More...
 
void DB_KeyB_CB (MOBJECT p, void *od, void *ad)
 Push buttons callback
. More...
 
void DB_KeyComSelButtKB_CB (MOBJECT obj, MKeyEvent *pe, void *a_data)
 callback for selsct a specified push button with the keyboard
More...
 
void DB_KeyComSelButtMouse_CB (MOBJECT obj, MMouseEvent *pe, void *a_data)
 callback for selsct a specified push button with the keyboard
More...
 
void DB_LampSelButtMouse_CB (MOBJECT obj, MMouseEvent *pe, void *a_data)
 callback for selsct a specified push button with the keyboard
More...
 
void DB_MIGE_CB (MOBJECT o, void *a, void *v)
 callback selecting the operation mode for the AltAzPlatform
More...
 
void DB_MIGEopmode_CB (MOBJECT o, void *a, void *v)
 callback selecting the operation mode for the AltAzPlatform
More...
 
void DB_MIGEType_CB (MOBJECT o, void *a, void *v)
 
void DB_Mir_CB (MOBJECT p, void *od, void *ad)
 callback for input mirror positioning in Mirror shell
More...
 
void DB_MirrorImg_CB (MOBJECT o, void *a, void *v)
 callback selecting the activation of the mirroring of the CCD image along the X or Y axis
More...
 
void DB_MirSelButtKB_CB (MOBJECT obj, MKeyEvent *pe, void *a_data)
 callback for selsct a specified mirror push button with the keyboard
More...
 
void DB_MirSelButtMouse_CB (MOBJECT obj, MMouseEvent *pe, void *a_data)
 callback changing the bakground color of the push button passing the mouse over it
More...
 
void DB_NDFil_CB (MOBJECT p, void *od, void *ad)
 callback for filter wheel positioning in Filter shell
More...
 
void DB_NDFilSelButtKB_CB (MOBJECT obj, MKeyEvent *pe, void *a_data)
 callback for select a specified filter push button with the keyboard
More...
 
void DB_NDFilSelButtMouse_CB (MOBJECT obj, MMouseEvent *pe, void *a_data)
 callback changing the bakground color of the push button passing the mouse over it
More...
 
void DB_Pause (void)
 
void DB_PlotDisplayCB (MOBJECT o, void *id, void *a_data)
 Select if the PLOT will be displayed after the measurement
. More...
 
void DB_PlotYAxisCB (MOBJECT o, void *id, void *a_data)
 Select the Y axis Unit mode
. More...
 
void DB_RadDrkSourceCB (MOBJECT o, void *a, void *v)
 Set the dark source. More...
 
void DB_RadioAvgModeCB (MOBJECT o, void *id, void *a_data)
 Set the Averaging mode flag. More...
 
void DB_RadioDarkCB (MOBJECT o, void *id, void *a_data)
 Set the dark removing from the measurements. More...
 
void DB_RadioFNSelCB (MOBJECT o, void *id, void *a_data)
 Set the file name mode. More...
 
void DB_RadioModeSelCB (MOBJECT o, void *id, void *a_data)
 Set the saving mode. More...
 
void DB_RadioPixCorrCB (MOBJECT o, void *id, void *a_data)
 Set the image Correction flag. More...
 
int DB_ReInitCamera (void)
 Re-Initialize Camera Parameters. Procedure that re-initialize the parameters for the CCD Camera. More...
 
void DB_Save (char *tit, int mod)
 Save the acquired spectrum. Procedure that Save the acquired spectrum. More...
 
void DB_save_img (char *tit, int mod)
 Saving image. Procedure for saving the CCD Image Used until version 2.0.9, Since 2.1.0 D_Saving(void) is used. More...
 
double DB_ScanMaxMin (int w, float *mx, float *mi, int bp)
 Find Max and Min values for the buffer of order w. More...
 
void DB_SelOutModeCB (MOBJECT o, void *id, void *a_data)
 Select the Output for the Temperature AD Converter
. More...
 
void DB_SetCCDTargetTempCB (MOBJECT o, void *id, void *a_data)
 Select the CCD temperature mode
. More...
 
void DB_SetXUnitsCB (MOBJECT o, void *id, void *a_data)
 Select the X axis Unit mode
. More...
 
void DB_Shutter_CB (MOBJECT o, void *a, void *v)
 callback selecting if the shutter is installed or not
More...
 
void DB_ShutterType_CB (MOBJECT o, void *a, void *v)
 callback selecting the type of installed shutter
More...
 
int DB_StepMotor (int id, int motor, long step, int dir)
 Send steps to the selected stepper motor.
. More...
 
void DB_Undo2Do_Colors (short undocol[], short docol[])
 Assign to the DO_Color structure the Color Values of the UNDO_Color Structure. More...
 
void DB_Undo2Do_Fonts (MTFont undofont, MTFont dofont)
 
void DB_VMRsfCB (MOBJECT o, void *id, void *a_data)
 Set the flag for modification or reload of DAS configuration files
Set the VMRsf (View Modify Re-load system files) flag. More...
 
void DB_Wl_CB (MOBJECT p, void *od, void *ad)
 callback for grating positioning in Wavelength shell
More...
 
void DB_WlSelButtKB_CB (MOBJECT obj, MKeyEvent *pe, void *a_data)
 callback for selsct a specified wavelength push button with the keyboard
More...
 
void DB_WlSelButtMouse_CB (MOBJECT obj, MMouseEvent *pe, void *a_data)
 callback changing the bakground color of the push button passing the mouse over it
More...
 
void DB_WriteMode (int mod)
 
void __stdcall DD_VRange (const char *str, int perc, int Port)
 
void DDMessage (char *str)
 
void delay (unsigned long d)
 Pauses for a specified number of milliseconds.
. More...
 
void DiffCB (MOBJECT p, void *od, void *ad)
 
void DMessage (char *str)
 
void DOASProcCB (MOBJECT p, void *od, void *ad)
 
void DOASSetupCB (MOBJECT p, void *od, void *ad)
 
void DrawAreaExpFontCB (MOBJECT obj, MEvent *pe, void *data)
 This callback draws strings using the selected font. More...
 
int DT_ColFormat (void)
 Callback for Column format. More...
 
int DT_CorrFileEvora (void)
 Used to correct some data files. More...
 
int DT_CorrHeader ()
 Used to correct the header in some data files. More...
 
int DT_FluxIndex (void)
 Callback for Flux Index Calculation. More...
 
int DT_LinkSpectra (void)
 For the linked spectra (..on going!!!) More...
 
void E_AAMeasure (void)
 perform measurements with the Alt Azimuth Platform perform measurements with the Alt Azimuth Platform positioning all the spectrometer devices More...
 
void E_AAPos (void)
 alt Az Positioning.
Available for SPATRAMPLUS and TROPOGAS (with the AltAzPlatform) More...
 
void E_Almucantar (void)
 .
All the E_xxxxx() function are used during the execution in PRG mode More...
 
void E_AutoRange (void)
 Autoranging.
Procedure for Autoranging. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Average (void)
 Averaged Measurements.
Procedure for Averaged Measurements. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_AvgCCDHor (void)
 Averaged Horizontal Measurements.
Procedure for Averaged Measurements with external lamp. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Azimuth (void)
 Position Azimuth Axis. More...
 
void E_Calibra (void)
 Execute D_Calibra.
D_Calibra is a procedure for the spectral calibration with HG lamp. Shift of HG spectral line at 4358.4 on pixel 512 All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_ChkExLamp (void)
 
void E_Dark (void)
 Execute Dark Measurement.
Procedure for Dark Measurement. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_DFMeasure (void)
 Perform Measurement setting the ND Filter Wheel also.
All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_DirectSun (void)
 .
All the E_xxxxx() function are used during the execution in PRG mode More...
 
void E_Expo (void)
 Exposuring.
Read the Exposure time from PRG file. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_ExtLampOFF (void)
 External lamp OFF. More...
 
void E_ExtLampON (void)
 External lamp ON. More...
 
void E_ExtShutClose (void)
 Close External Shutter. More...
 
void E_ExtShutOpen (void)
 Open External Shutter. More...
 
void E_Filter (void)
 Filter Wheel positioning.
Procedure for Filter Wheel positioning. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
int E_GetCCD (void)
 Get CCD.
Execute DB_GetCCD. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Hg_Off (void)
 HG OFF.
Hg lamp OFF. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Hg_On (void)
 HG ON.
Hg lamp ON. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_HGratCal (void)
 Perform home grating and HG Calibration.
All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_HgScan (void)
 Check the full spectral range with HG ON.
All the E_xxxxx() function are used during the execution in PRG mode. More...
 
int E_Home_SM1 (void)
 Home for SM1.
Set the reference position for Stepper motor 1 (Input Mirror). All the E_xxxxx() function are used during the execution in PRG mode. More...
 
int E_Home_SM2 (void)
 Home for SM2.
Set the reference position for Stepper motor 2 (Grating). All the E_xxxxx() function are used during the execution in PRG mode. More...
 
int E_Home_SM3 (void)
 Home for SM3.
Set the reference position for Stepper motor 3 (Filter Wheel). All the E_xxxxx() function are used during the execution in PRG mode. More...
 
int E_Home_SM4 (void)
 Home for SM4.
Set the reference position for Stepper motor 4 (Neutral density filter wheel). All the E_xxxxx() function are used during the execution in PRG mode. More...
 
int E_Home_SM5 (void)
 Home for SM5.
Set the reference position for Stepper motor 5 (MIGE Zenith). All the E_xxxxx() function are used during the execution in PRG mode. More...
 
int E_Home_SM6 (void)
 Home for SM6.
Set the reference position for Stepper motor 6 (MIGE Azimuth). All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_IRefSun (void)
 Io Measured near the sun.
This procedure carries out a measurements for the reference spectrum used in DOAS analysis, with the alt Azimut platfor pointing the sun. Available for SPATRAMPLUS and TROPOGAS (with the AltAzPlatform) More...
 
void E_Label (void)
 labeling.
The text after the key-word is a label. All the E_xxxxx() function are used during the execution in PRG mode More...
 
void E_Lambda (void)
 Lambda Reading.
When the WAVELEN key-word is encountred in the PRG file, the Wavelength code from PRG file is read and the grating is positioned. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Meashor (void)
 perform horizontal measurements (3) 1) measurement with external lamp 2) measurement without the external lamp (same exposure time than 1) 3) measurement without the external lamp (exposure time recalculated) More...
 
void E_Meashor2 (void)
 perform horizontal measurements (2) 1) measurement with external lamp 2) measurement without the external lamp (same exposure time than 1) More...
 
void E_Measure (void)
 Perform Measurement.
All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Mirror (void)
 Inpot Mirror positioning.
Procedure for Input mirror positioning. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_NDFilter (void)
 Set ND Filter.
Set ND Filter All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Plot (void)
 Plot Spectrum.
Plot Spectrum. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Qj_Off (void)
 Qj OFF.
QJ - Halogen - lamp OFF. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Qj_On (void)
 Qj ON.
QJ - Halogen - lamp ON. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_QjScan (void)
 Check the full spectral range with QJ ON.
All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Radio (void)
 Radiometric Measurements.
Procedure for Radiometric Measurements. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_REM (void)
 Flush string since the Carriege Return.
Procedure for flushing the readed string since the Carriege Return. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Save (void)
 Save Image.
Procedure for saving image or data. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_SetCCDOffSet (void)
 Set the CCD Offst (only for HIRES-V.
All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_SetCCDPow (void)
 Set CCD Power.
Set CCD Power. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_SetCCDTemp (void)
 Set CCD Temp.
Set CCD Temp. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_SetCCDVBin (void)
 Set CCD Vert Binn.
Set CCD Vert Binn. All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_WAIT (void)
 Delay Procedure.
sleep the program . All the E_xxxxx() function are used during the execution in PRG mode. More...
 
void E_Zenith (void)
 Position Zenith Axis. More...
 
char * EquipCode2Name (int eqcode, char *src, char *dest)
 translate the Equipment Code in the Equipment Name More...
 
char * ERR_Option (int ercode)
 Alerts for OPTION.INI errors
Creates a message window reporting the reasons for the error. More...
 
void ExitCB (MOBJECT p, void *od, void *ad)
 
int ExtLamp (int mod)
 change the status of the external lamp change the status of the external lamp (ON or OFF) through a radio signal controlled by the AMS output port (bit 7) NOTE - This feature is not used!!!!!! More...
 
int ExtShutt (int mod)
 change the status of the external shutter change the status of the external shutter (OPEN or CLOSED) through a radio signal controlled by the AMS output port (bit 6) More...
 
void FANECU (int mod)
 FAN ON/OFF
. More...
 
void FANPeltier (int mod)
 FAN ON/OFF
. More...
 
int Fetch (void)
 Reads the key-word in PRG Files
. More...
 
void FilterCB (MOBJECT p, void *od, void *ad)
 
void FixStepCB (MOBJECT p, void *od, void *ad)
 
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) =line feed =LF. More...
 
void FontOBJSelCB (MOBJECT obj, void *a, void *v)
 This callback select the object for applying font. More...
 
void FormatData (void)
 trasform mm/gg/aa in gg/mm/aa More...
 
int fraz2val (int mod, char *val)
 ratio value to decimal value
opposite than listval2fraz or val2fraz More...
 
void getdate (struct date *tp)
 get current date
More...
 
void GetDateTime (struct date *dp, struct time *tp, struct tm *when)
 
int GetDefPix (int mod)
 Maps the defective pixel. More...
 
void gettime (struct time *tp)
 get current time
More...
 
int HeaderInPlot (void)
 Shows the measurements parameters
. More...
 
int hertz2int (int mod, char *string)
 translate the Hertz speed in AMS digit unit.
More...
 
void HgLamp (int mod)
 HG Lamp ON/OFF
. More...
 
void HiresPS (int mod)
 Hires Power Supply ON/OFF
. More...
 
int HomeAzimFast (void)
 Home for Azimuth Axis. More...
 
int HomeFiltersFast (void)
 (Fastest) Fliter wheel in the reference Position.
The Fliter wheel reaches the reference Position. Similar to HomeFilterWheel(void), but faster More...
 
int HomeFilterWheel (void)
 Fliter wheel in the reference Position.
The Fliter wheel reaches the reference Position. More...
 
int HomeGrating (void)
 Grating in the reference Position.
The Grating reaches the reference Position. More...
 
int HomeGratingFast (int mod)
 (Fastest) Grating in the reference Position.
The Grating reaches the reference Position. Similar to HomeGrating(void), but faster More...
 
int HomeMirror (void)
 Input Mirror in the reference Position.
The Input Mirror reaches the reference Position. More...
 
int HomeMirrorFast (void)
 (Fastest) Mirror in the reference Position.
The Mirror reaches the reference Position. Similar to HomeMirror(void), but faster More...
 
int HomeNDFiltersFast (void)
 (Fastest) ND Fliter wheel in the reference Position.
The ND Fliter wheel reaches the reference Position. Similar to HomeFilterWheel(void), but faster More...
 
int HomeZenithFast (void)
 Home for Zenith Axis. More...
 
double int2hertz (int mod, int k)
 
double int2perc (int mod, int k)
 translate the AMS digit unit in text.
The power assigned to the motor trough the AMS, is translated in text More...
 
void IoCreateCB (MOBJECT p, void *od, void *ad)
 
void IoSetupCB (MOBJECT p, void *od, void *ad)
 
void LinkSpectraCB (MOBJECT p, void *od, void *ad)
 
void listval2fraz (int mod, int val)
 Decimal value to ratio value
The decimal value indicating the fractioning of the step is translated in ratio (i.e. 0 –> 1/2 = 400 s/r, 1–> 1/4 =800 s/r) More...
 
int LoadDasSysCol (void)
 Load system colors. Procedure that load the DAS colors in the file {homedir}/config/DASSysColor.INI. More...
 
int LoadDB_DefectPixel (char *buff)
 Load Defective pixel mask. Procedure that load the Defective pixel mask in the file {homedir}/config/ccd_defect_Danbo.cor. More...
 
int LoadDB_DispCoeff (void)
 Load dispersion parameters. Procedure that load the dispersion parameters from file {homedir}/DOAS/DispCoeff.ini. More...
 
int LoadDB_Options (void)
 Load Options. Procedure that load the Options in the file {homedir}/config/Options.INI. More...
 
void LoadDefaultDFONT (void)
 Load Default Fonts. Procedure that load the DAS fonts if the file {homedir}/config/DASFonts.ini is not present. More...
 
void LoadDefaultDPAL (void)
 Load Default system colors. Procedure that load the DAS colors if the file {homedir}/config/DASSysColor.INI is not present. More...
 
int LoadDFONT (void)
 Load Fonts. Procedure that load the DAS fonts from {homedir}/config/DASFonts.ini AVAILABLE for Releases > 2.5.5. More...
 
int LoadEquipment (void)
 Load the type of Equipment. {homedir}/config/param.ini. More...
 
int LoadExec (char *fname)
 Load file for automatic execution. Procedure that load the file for automatic execution. More...
 
void LoadFontCB (MOBJECT obj, void *a, void *data)
 This callback tries to load the specified font. More...
 
int LoadFTPSetting (void)
 Load FTP Setting for daily back-up. More...
 
int LoadGeoCoord (void)
 Load Geographic Coordinate of the station. Procedure that load the Geographic Coordinate of the station in the file {homedir}/config/GeoCoord.INI. More...
 
int LoadGeoDB (void)
 
int LoadHardware (void)
 
void LoadIo (int mod, char *fname)
 
int LoadPaletteCB (MOBJECT o, void *o_data, void *a_data)
 Callback for LoadTestPalette. More...
 
int LoadParam (void)
 Load the exe parameters. Procedure that load the parameters for CCD, Stepper Motors and Peltier from file {homedir}/config/param.ini. More...
 
int LoadParamLog (void)
 Load file for CCD status. Procedure that load the file {homedir}/config/paramlog.ini, for the actual status of the CCD. More...
 
int LoadTestPalette (char *nf)
 Load a test palette. Procedure that load a test palette. More...
 
int LoadTruePalette (void)
 Load the palette map. Procedure that load the palette map from file {homedir}/Palettes/Danbomap1.map. More...
 
int LoadWlstep (void)
 load the file of the wavelength vs steps More...
 
int Lookfor4358 (void)
 function to scan the wl() array in order to identify the position of the 4358 reference wavelength return value: er = -1 –> value 4358 not encountered er >= 0 –> value 4358 found at er position More...
 
int LookforWl_X (int x)
 
void MAPDefPix (int mod)
 create the Under/Over exposed pixels window
At the pression of the button in DAS_Config the appropriate shell (For the creation of the Under or Over exposed pixel map) will be created. More...
 
void MAPDefPixCB (MOBJECT o, void *id, void *a_data)
 GetDefPix(mod) Callback At the pression of the 'Execute' button in the appropriate shell the GetDefPix procedure will be executed. More...
 
void Master_Error (int w)
 
int MD_CreateBRowShell (int nrows)
 Create windows of buttons.
During the plotting of the measurements, create a shell of buttons if the raws of the CCD are more than 16. More...
 
MOBJECT MDCreate2DPlot (char *title, int x, int y, int dx, int dy, int mode)
 create the 2D_Plot panel via the MDCreate_2DPlot. More...
 
MOBJECT MDCreate_2DPlot (char *title)
 2DPlot Panel. Procedure that build the shell for the plotting of the LOG files. More...
 
MOBJECT MDCreate_CP (void)
 Create Spectrometer Control Panel. Procedure that build the Control Panel for checking the spectrometer operations such as temperature monitoring, stepper motor positioning, data acquisition ... More...
 
MOBJECT MDCreateDASConfig (void)
 DAS Config shell. Procedure that build the shell for the DAS Config panels. The DAS Config allow for setting a lot of the application parameters. More...
 
MOBJECT MDCreateDOAS_MainSh (struct doas *pdoas)
 DOAS shell. Procedure that build the shell for the DOAS main panels. More...
 
MOBJECT MDCreateExpo (char *tit)
 Create Exposure/countdown shell. Procedure that build the Exposure/countdown shell during the calculated or "apriori" imposed integration time. More...
 
void MDCreateLISC (int c, int e)
 Command KEYBOARD. Procedure that build the shell for the Command KEYBOARD. Used in old versions. More...
 
void MDCreateMoveGrat (void)
 Free Grating positioning. Procedure that build the shell for Free Grating positioning. More...
 
void MDCreateMoveZenAzimDeg (void)
 
int MDCreateSh_Fil (void)
 Create the shell for the available Filters. Procedure that build the shell for the positioning of the filter wheel. They are installed during the instrument setup. More...
 
int MDCreateSh_Home (void)
 
int MDCreateSh_Mir (void)
 Create the shell for the available Mirror Positions. Procedure that build the shell for the positioning of the Input Mirror.
They are: 1) Zenith 2) Horizontal Right 3) Calibra (Down for the calibration sphere) 4) Horizontal Left. More...
 
int MDCreateSh_NDFil (void)
 
void MDCreateSh_Plot (void)
 Plot shell. Procedure that build the shell for plotting the data. More...
 
int MDCreateSh_PWD (void)
 Password shell. Procedure that build the shell for the System password in order to access the control panel of the application. More...
 
MOBJECT MDCreatesh_vitesa (void)
 
int MDCreateSh_Wl (void)
 Create the shell for the available Wavelength. Procedure that build the shell for the availables wavelength. They are fixed and setted during the testing phase. More...
 
void MDCreateWaitShell (void)
 Create a waiting window . More...
 
void MDQuitCB (MOBJECT shell, void *od, void *ad)
 callback for closing a generic MGUI shell More...
 
void Message (char *str, int er)
 Create a message shell for the AMS errors (Debug Use).
. 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...
 
float MIGEActualZenAz (int mode)
 convert SUN AZIMUTH and ZENITH angles, to be used with MIGE mode = 0 –> fix azimuth and return azimuth for MIGE positioning mode = 1 –> fix zenith and return zenith for MIGE positioning More...
 
void MIGEAntiSunTrack (void)
 
float MIGEAz (float p)
 
void MIGESunTrack (void)
 
float MIGEZen (float p)
 
void ModifyConfFileCB (MOBJECT o, void *id, void *a_data)
 Modification DAS Configuration files Callback
Set if the blind pixels will be displayed or not on the plot window. More...
 
int NOVA_In (int novatype, unsigned int DigIn)
 Read the NOVA Input port. More...
 
int NOVA_Out (int novatype, unsigned int DigOut)
 Write the NOVA Output port. More...
 
void NovaTypeCB (MOBJECT p, void *od, void *ad)
 Callback for NOVA selection. More...
 
void PB_H_CB (MOBJECT p, void *od, void *ad)
 Quick Help Callback. More...
 
void PBTempHistoCB (MOBJECT p, void *od, void *ad)
 
void Peltier (int mod)
 Peltier ON/OFF
. More...
 
void PeltierPS (int mod)
 Peltier Power Supply ON/OFF
. More...
 
int perc2int (int mod, char *string)
 translate the percent power in AMS digit unit.
The percent power assigned to the motor trough the AMS , is translated in digital unit (i.e. 50% –> 38) More...
 
void PerformMeas (int mod, int ar, double te, int mt, int sv, int pl)
 Perform Averaged or single measurements. More...
 
int PID_Calc (int mod, int pow)
 
int PRG_Check (int mod, char *prgname)
 
void print2file (FILE *ff, int x, int y, unsigned int m)
 Print to file the defective pixel. More...
 
void q_sort (float numbers[], int left, int right)
 quick sort of one array More...
 
void QjLamp (int mod)
 QJ Lamp ON/OFF
. More...
 
void quickSort (float numbers[], int array_size)
 callback for q_sort() More...
 
void Radio (int g)
 NOT Used
. More...
 
int ReadHeader_ASCII (int mod, FILE *fd)
 Read ASCII Header of the measurement.
. More...
 
int ReadHeader_BIN (int fd)
 read the BINARY header of the stored spectrum More...
 
int ReadHeaderOldF (FILE *fd)
 read the ASCII header of the stored spectrum (OLD FORMAT - replaced by ReadHeaderOnly(FILE *fd) More...
 
int ReadHeaderOnly (FILE *fd)
 read the ASCII header of the stored spectrum More...
 
void ReadIMG (FILE *file, unsigned short *mat, int hp, int vp)
 Read ASCII Image (Spectral Data only)
. More...
 
void ReadIMG_BIN (int fd, unsigned short *mat, int hp, int vp)
 read the BINARY stored spectrum More...
 
void ReadIMG_old (FILE *file, int hp, int vp)
 NOT Used
. More...
 
void ReadLine (char *buf, int nc, FILE *f)
 Read Line on a file
Read one record of nc character on the file f. More...
 
int ReadLogFile (int mod, char *dir, char *filename, int nx, int ny, struct omutemp)
 Read DAS LOG File.
. More...
 
int RefreshDrArea (MOBJECT obj)
 Redraw the draw arwa in a 2D Plot window. More...
 
int RemoveSpikes (int mod, unsigned short *mat, int horpix, int verpix, int blindpix)
 Removes Spikes on a measure. More...
 
void ResumeCB (MOBJECT p, void *od, void *ad)
 
void RunFULL (void)
 DAS Main LOOP for Equipment management
This Procedure is called by the MGUIMain function when the execution mode is:
. More...
 
void SaveCalib (int mod)
 
void ScreenInfoCB (MOBJECT o, void *s, void *v)
 
int SD_Azimuth (float ang, float raz)
 Positioning Azimuth.
The Zenith reaches the position specified by ang. More...
 
int SD_FilterW (int filter)
 Positioning Filter wheel.
The filter wheel move on the filter number specified by filter.
See also Filter Wheel page. More...
 
void SD_FNTorqueM (int mod)
 Positioning NDFilter.
. More...
 
int SD_Grating (int ang)
 Positioning Grating.
The Grating move to the position specified by ang (Wavelength) More...
 
int SD_Mirror (int where)
 Positioning Input Mirror.
The Input Mirror reaches the position specified by where. More...
 
int SD_NDFilterW (int filter)
 Positioning Filter wheel.
The filter wheel move on the filter number specified by filter.
See also Filter Wheel page. More...
 
int SD_PosAADev (double z, double a)
 perform the simoultaneous positioning of the AltAzimuth platform z = Zenith Axis a = Grating Position More...
 
int SD_Position (int m, int w, int f, double z, double a)
 perform the simoultaneous positioning of the Spectrometer Devices m = mirror w = wavelength (Grating) f = filter wheel z = zenith a = azimuth More...
 
int SD_PosOMUDev (int m, int w, int f)
 perform the simoultaneous positioning of the Spectrometer Devices in the OMU Unit m = mirror w = wavelength (Grating) f = filter wheel More...
 
int SD_Zenith (float ang)
 Positioning Zenith.
The Zenith reaches the position specified by ang. More...
 
int SD_Zenith_H (float ang)
 
void SetBoldCB (MOBJECT obj, MVALUE a, void *data)
 This callback toggles the Bold attribute. More...
 
void SetItalicCB (MOBJECT obj, MVALUE a, void *data)
 This callback toggles the Italic attribute. More...
 
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 ShiftImg (int hp, int vp)
 Used to correct some data files. More...
 
void __stdcall ShowDown (const char *str, int port)
 Shows the countdown.
Procedure for the visualisation of the countdown. More...
 
void ShStCB (MOBJECT p, void *od, void *ad)
 
void ShutDOWN (void)
 Creates shell for Shutting down the instrument
. More...
 
void ShutterOpening (int mod)
 
void sleep (clock_t wait)
 Pauses for a specified number of milliseconds.
. More...
 
int SM_stepr (int t)
 AMS 'steps/round' value return the AMS 'steps/round' value (microstepping) depending on the setted step fractioning. More...
 
float SMfraz (int t)
 denominator value of the stepping ratio
More...
 
int SmoothData (unsigned short *source, float *destination, int horpix, int verpix, int filw, int bp)
 Calc. the smoothed matrix of an unsigned short one.
. More...
 
int SmoothFloatData (float *source, float *destination, int horpix, int verpix, int filw, int bp)
 Calc. the smoothed matrix of a float one.
. More...
 
int SmoothingF (double *tmp, int npix, int pts)
 Smoothing of 1D array. More...
 
void Status (char *tit)
 Writes information's on the Status label
. More...
 
void SunCalcCB (MOBJECT p, void *od, void *ad)
 
void SwapMatrix (unsigned short *source, unsigned short *dest, int hp, int vp)
 Copy the source matrix in the Destination one
. More...
 
void SZA_FindMin (void)
 computation of daily minimum SZA More...
 
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.
. More...
 
void Task_AMSH (TIMEOUT_ID id, void *data)
 AMS Home Task.
Refresh the temperatures during DAS execution. More...
 
void Task_AutoEx (TIMEOUT_ID id, void *data)
 Automatic Execution Task.
. More...
 
void Task_CCD_Temp (TIMEOUT_ID id, void *data)
 CCD Temperature Task.
Provide the thermoregulation of the CCD sensor during DAS execution. More...
 
void Task_HomeGrat (TIMEOUT_ID id, void *data)
 Home grating Task.
5) Check for reached end-run of the stepper motor for the grating
. More...
 
void Task_LIS_Temp (TIMEOUT_ID id, void *data)
 OMU Thermoregulation Task.
Provide the thermoregulation of the Optical Mechanical Unit
In addition allows the CCD sensor temperature to be driven by the SZA
. More...
 
void Task_LOG (TIMEOUT_ID id, void *data)
 LOG Task.
Write on the LOG file during DAS execution. More...
 
void Task_REFRESH_Temp (TIMEOUT_ID id, void *data)
 Temperatures Task.
Refresh the temperatures during DAS execution. More...
 
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 saving time is in effect
3) Calculate the Solar Zenith Angle
4) Check the FLAG.sza in order to back-up the daily data via FTP and if all the condition are satisfied the back-up is performed
5) Check for reached end-run of the stepper motor for the grating
. More...
 
void TaskWDT (TIMEOUT_ID id, void *data)
 
void TestFontCB (MOBJECT obj, void *a, void *data)
 This callback tries to load the specified font. More...
 
void TextColorAssignCB (MOBJECT o, MVALUE o_data, void *a_data)
 
void UnderOverPixCB (MOBJECT o, void *id, void *a_data)
 Under/Over exposed pixels Callback
At the pression of the button in DAS_Config the appropriate shell (For the creation of the Under or Over exposed pixel map - with the MAPDefPix() function) will be created. More...
 
void UndoFCB (MOBJECT obj, void *a, void *v)
 This callback UnDo the font choice (Not implemented yet) More...
 
void UPS_Status (void)
 
void val2fraz (int id, int sn, int val)
 Decimal value to ratio value
Similar to listval2fraz The decimal value indicating the fractioning of the step is translated in ratio (i.e. 0 –> 1/2 = 400 s/r, 1–> 1/4 =800 s/r) More...
 
void ValidateCB (MOBJECT edit, EDIT_VAL *ev, void *ii)
 Text Validation callback Validation callback for the text typed in different text box. More...
 
void ViewCB (MOBJECT p, void *od, void *ad)
 
int ViewPlot (int mod)
 Create the plot shell. Procedure that build the plot shell for the data visualization. More...
 
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 WinRes (void)
 
int WriteAMSCB (MOBJECT shell, void *od, void *ad)
 Write AMS.ini file
. More...
 
int WriteColorsCB (MOBJECT o, void *a, void *v)
 Write selected color in DASSysColor.INI. More...
 
int WriteEquipini (void)
 Write equipment.ini file
. More...
 
void WriteFontCB (MOBJECT obj, void *a, void *v)
 This callback write on file the selected font (Not implemented yet) More...
 
int WriteHardwareiniCB (MOBJECT shell, void *od, void *ad)
 Write hardware.ini file
. More...
 
void WriteIMG (FILE *file, unsigned short *mat, int hp, int vp)
 
void WriteIMG_BIN (int fd, unsigned short *mat, int hp, int vp)
 
void WriteInit (const char *sname, char *dateffn, char *timebuff)
 Init the daily LOG file
. More...
 
void writelogmotor (int mod, int id_motore, int k, int d, long steps, unsigned char ams_id)
 Write Motor Operations on Log File.
Write on the SM.LOG file the commands send to the motors. More...
 
int WriteOptioniniCB (MOBJECT shell, void *od, void *ad)
 Write Options.ini file
. More...
 
int WriteParaminiCB (MOBJECT shell, void *od, void *ad)
 Write Param.ini file
. More...
 
void WriteSelColandSmoothed (int mod, FILE *fd, int selcol)
 write selected Column More...
 
void WriteStatusD (int w)
 NOT Used
. More...
 
int WritewlstepiniCB (MOBJECT shell, void *od, void *ad)
 Write wlstep.ini file
. More...
 

Variables

MOBJECT _shell000
 
long AbsFilePos
 Absolute File position. More...
 
adtester ADTESTER
 
int b_c
 
MOBJECT b_label
 
MOBJECT b_sbar
 
int BlindPix
 Number of blind pixels (usefull for Dark Current) More...
 
int bold
 
int CCD_SetupFlg
 
MTColor cell_color
 
MOBJECT cell_drawa
 
MOBJECT cell_form
 
MOBJECT cell_label
 
int CItem
 
int ContFP
 Counter for File position. More...
 
unsigned long countsopsh
 counting the number of opening shutter More...
 
das DAS
 DAS structure. More...
 
int DAS_StartDOY
 
int DAS_StartHour
 
unsigned int data [576]
 Conversion data buffer 64 samples * 8 channels * 2 bytes. More...
 
int DD_VOpen [16]
 
int DD_VRip [16]
 
char ddmmyy [8]
 
char ddmmyyf [6]
 
const char * DeviceTypeInput []
 const char array for the Device type <-> Input association More...
 
dfont DFONT
 
dftp DFTP
 
d_geo DGEO
 geographical coordinates structure More...
 
dlog DLOG
 
palette DPAL
 
dpwd DPWD
 Danbo Passw. More...
 
MOBJECT drawa
 
MTColor drawarea_bgc
 
 dsave
 
MOBJECT e_fname
 
MOBJECT e_fsize
 
char env [_MAX_PATH]
 Environment path. More...
 
master ExMast [PRGMAXNUM]
 
int FANFlg
 
char * Fil_Code []
 const char array for the realisation of the Filters buttons in the Filter shell More...
 
char * Fil_Code8H []
 const char array for the realisation of the Filters buttons in the Filter shell More...
 
char * Fil_CodeNG []
 const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3 instruments More...
 
char * Fil_CodeNG1 []
 const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrument More...
 
char * Fil_CodeTropo []
 const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrument More...
 
int FilSet
 filter wheel position definition - for SD_FilterW More...
 
flag FLAG
 flags structure More...
 
int FlgBG
 
int FlgFG
 
int FlgOBJ
 
int FlgSM_Stop
 Steppers Motor Activity: 0 = Motors moving; 1 = Motors stopped. More...
 
MTFont font
 
MOBJECT frm3_dr1
 
FilterWheelSt FWS
 Filter Wheel. More...
 
int g_c
 
MOBJECT g_label
 
MOBJECT g_sbar
 
GratingSt GRS
 Grating. More...
 
int HGFlg
 
char * HomePosition []
 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...
 
unsigned short * ImatDark
 buffer for the dark image More...
 
int italic
 
const char * KeyCode []
 
MTColor label_fgc
 
unsigned int LevelDefPix
 
char lfraz [6]
 
int MainCommand
 Command switch in main loop. More...
 
int MaskedCol [100][6]
 Masked column array. More...
 
int MaskedPix [100][6]
 Masked pixel's array. More...
 
int MaskedRow [100][6]
 Masked rows array. More...
 
int Master
 
unsigned int * mattempbuff
 
mige Mige
 
const char * Mir_Code []
 const char array for the realisation of the Mirrors buttons in the Mirror shell More...
 
const char * Mir_CodeTropo []
 const char array for the realisation of the Mirrors buttons in the Mirror shell for TROPOGAS More...
 
int MirSet
 mirror position definition - for SD_Mirror More...
 
MirrorSt MIS
 Mirror. More...
 
mtcl MTCL
 MTColor. More...
 
int N_AVG
 Number of measurements for Averaging mode in fixed number of meas. mode. More...
 
int N_RM
 Number of measurements for Averaging mode in fixed exposure time mode. More...
 
char * NDFil_Code []
 const char array for the realisation of the Filters buttons in the ND Filter shell More...
 
int NDFilSet
 ND filter wheel position definition - for SD_NDFilterW. More...
 
NDFilterWheelSt NDFWS
 ND Filter Wheel. More...
 
nova NOVA
 
int on
 PRG execution control variabile. More...
 
int ON_OFFLINEPLOT
 
int PaletteMode
 
paramini PARAM
 Param.ini. More...
 
int PeltFlg
 
int PItem
 
MTColorPLColor []
 
long PrgCnt
 For PRG File. More...
 
int PrgNum
 
int PrgNumExe
 number of PRG file in execution More...
 
int PrgNumInM
 Actual number of PRG File in current MASTER or MASTERSZA File. More...
 
long PrgSiz
 Length of PRG file (bytes) More...
 
char * Program
 pointer to PRG file More...
 
int QJFlg
 
int r_c
 
MOBJECT r_label
 
MOBJECT r_sbar
 
long REL_FILE_POS [51]
 relative File position More...
 
int RItem
 number of Pixel, Column, Row Item More...
 
int SaveCnt
 
int sel_cell
 
int sel_x
 
int sel_y
 
int Server
 
stepm STEPM
 Stepper Motors. More...
 
dsza SZADelta
 
int SZAMax
 Maximum SZA for performing measurements. More...
 
double TExp
 CCD Exposure time [sec]. More...
 
int TMFlg
 
tools TOOLS
 tools structure More...
 
int Total
 Progressive acquisition number for file (MAX defined = 50) More...
 
int TOTTEXP
 Total Exposure time in Averaging mode. More...
 
double TPelt
 CCD Temperature. More...
 
undopal UDPAL
 
long wav []
 Step Number definition - for SD_Grating. More...
 
int wl []
 WaveLength definition - for SD_Grating. More...
 
const char * Wl_Code []
 const char array for the realisation of the wavelength buttons in the wavelength shell More...
 
int WlSet
 Wavelength position definition - for SD_Grating. More...
 

Detailed Description

Function prototypes.

Author
Daniele Bortoli

Definition in file DAS_Spatram.h.

Function Documentation

§ AboutCB()

void AboutCB ( MOBJECT  o,
void *  s,
void *  v 
)

Create the About information shell.
.

Returns
void

Definition at line 39 of file About.c.

References BOTTOM_ALIGN, CENTER_ALIGN, CloseCB(), DASREL, DASREV, DASREVDATE, palette::DB_BG, palette::DB_BG_Albl, palette::DB_FG_Plbl, DB_HelpCB(), DC_Ver(), DI_Ver(), DPAL, False, HELV_LARGE, HELV_MEDIUM, lbl, MCreateColForm(), MCreateLabel(), MCreatePButton(), MCreatePixmapFromFile(), MCreateRowForm(), MCreateShell(), MGUI_RELEASE, MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetCompositeHeight(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MObjectSetTransparency(), MPButtonSetCallback(), MShellRealize(), SF_MODAL, TIMES_SMALL, TOP_ALIGN, True, WS_ETCHED_IN, WS_NONE, and WS_SHADOW_OUT.

Referenced by DB_KeyB_CB(), HlpTopCB(), and SetScriptUseLabel().

40 {
41 
42 
43  MOBJECT _colform000;
44  MOBJECT _rowform000;
45  MOBJECT lbl;
46  MOBJECT sh1;
47  MOBJECT px1;
48  MOBJECT pbutt1;
49  char buff[256], mguirev[4];
50  int DCLREV, DILREV;
51  int c = (int) v;
52 
53  if (c)
54  sh1 = MCreateShell("About DAS", SF_MODAL);
55  else
56  sh1 = MCreateShell("About DAS", 0);
57 
58  _colform000 = MCreateColForm(sh1);
59  MObjectSetBackgroundRGB(_colform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
60 
61  px1 = MCreatePixmapFromFile(_colform000, "sys\\info1.bmp");
63  MObjectSetShadow(px1, WS_NONE, 0, 0);
64  MObjectSetCompositeWidth(px1, 32);
66 
67  _rowform000 = MCreateRowForm(_colform000);
68  MObjectSetResize(_rowform000, True, True);
69  MObjectSetBackgroundRGB(_rowform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
70 
71  sprintf(buff, "%s","DAS");
72  lbl = MCreateLabel(_rowform000, buff, HELV_LARGE);
75  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
76  MObjectSetTransparency(lbl, 0);
77 
78  sprintf(buff, "%s","Data Acquisition System\n developed for UV-Vis Spectrometers \n (SPATRAM & GASCOD type equipments)");
79  lbl = MCreateLabel(_rowform000, buff, HELV_MEDIUM);
81  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
82 
83 
84  //DAS Release and version
85  sprintf(buff, "Release: %d, Rev: %.1lf on %s",DASREL, DASREV, DASREVDATE );
86  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
88  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
89 
90  sprintf(buff, "%s", " Copyright © 2000-2016 Daniele Bortoli (DanBo) \n CGE University of Evora, Portugal\n 'db@uevora.pt' \nISAC-CNR Bolgna, Italy \n 'd.bortoli@isac.cnr.it'");
91  lbl = MCreateLabel(_rowform000, buff, HELV_MEDIUM);
93  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
94 
95  //MGUI release
96  itoa(MGUI_RELEASE, mguirev, 16);
97  sprintf(buff, "Morello Graphic User Interface - MGUI: %c.%c.%c", mguirev[0], mguirev[1], mguirev[2]);
98  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
100  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
101 
102  //DIL Release
103  DILREV = DI_Ver(NULL);
104  sprintf(buff, "DTA Image Library - DIL Rev: %.2lf", (double)DILREV/100);
105  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
107  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
108 
109  //DCL Release
110  DCLREV = DC_Ver(NULL);
111 // itoa(DCLREV, dclrev, 10);
112 // sprintf(buff, "DTA Camera Library - DCL Rev: %c.%c.%c", dclrev[0], dclrev[1], dclrev[2]);
113  sprintf(buff, "DTA Camera Library - DCL Rev: %.2lf", (double)DCLREV/100);
114  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
116  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
117 
118 
119 
120  sprintf(buff, "%s", "Platforms: Win9x, WinME, Win2000, WinNT4, WinXP\nCompiler: Microsoft Visual C++ 6.0 ");
121  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
123  MObjectSetShadow(lbl, WS_ETCHED_IN, 3, 0);
124 
125 
126  _rowform000 = MCreateRowForm(_colform000);
127  MObjectSetResize(_rowform000, False, False);
128  MObjectAlign(_rowform000, CENTER_ALIGN, BOTTOM_ALIGN);
129  MObjectSetBackgroundRGB(_rowform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
130 
131 
132  pbutt1 = MCreatePButton(_rowform000, "Help ", HELV_MEDIUM);
133  MPButtonSetCallback(pbutt1, DB_HelpCB, (void *) 0);
135  MObjectSetShadow(pbutt1, WS_SHADOW_OUT, 3, 0);
136 
137  pbutt1 = MCreatePButton(_rowform000, "Close", HELV_MEDIUM);
138  MPButtonSetCallback(pbutt1, CloseCB, (void *) sh1);
140  MObjectSetShadow(pbutt1, WS_SHADOW_OUT, 3, 0);
141 
142  MShellRealize(sh1);
143 }
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 MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MShellRealize(MOBJECT obj)
#define DASREV
DAS Revision Number.
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.
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
#define TIMES_SMALL
Definition: Mguidefs.h:883
palette DPAL
Definition: 2DPlot.c:27
#define DASREVDATE
DAS Revision Date.
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
C_DEF int DI_Ver(char *ver)
MOBJECT MCreateColForm(MOBJECT parent)
MOBJECT MCreateShell(const char *title, int flags)
void CloseCB(MOBJECT p, void *od, void *ad)
Close the About information shell. .
Definition: About.c:25
short DB_BG[3]
Default Background Color.
int DB_HelpCB(MOBJECT o, void *od, void *ad)
Help Callback Create the help in the predefined WEB Browser.
Definition: DAS_Spat.c:881
CTYPE int DLL DC_Ver(char *LibraryVersion)
Return the library version. Procedure returning the number of the revision of the library...
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
void * MOBJECT
Definition: Mguidefs.h:192
#define BOTTOM_ALIGN
Definition: Mguidefs.h:919
#define True
Definition: Mguidefs.h:235
#define HELV_MEDIUM
Definition: Mguidefs.h:882
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
#define MGUI_RELEASE
Definition: Mguidefs.h:11
#define HELV_LARGE
Definition: Mguidefs.h:885
#define DASREL
DAS Release Number.
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:

§ ActEditCB()

void ActEditCB ( MOBJECT  edit,
char *  text,
void *  ed 
)

Text Application callback Apply to the variables the text typed in various text box and validated by ValidateCB(MOBJECT edit, EDIT_VAL *ev, void *ii)

Definition at line 1877 of file DAS_Spat_ConfCBs.c.

References optionini::avgmode, paramini::ccdWx, paramini::ccdWy, paramini::ccdXoff, paramini::ccdYoff, paramini::CoolPw, das::DOption, doas::FFTFilter, dftp::ftppwd, dftp::ftpserver, dftp::ftpuser, GrafoIMG(), optionini::hlineafter, optionini::hlinebefore, paramini::ITemp, LevelDefPix, optionini::maxlvlar, paramini::maxtexp, N_AVG, paramini::Offset, ON_OFFLINEPLOT, das::Paramini, omuthr::PCPower, omuthr::PID_kd, omuthr::PID_ki, omuthr::PID_kp, SZAMax, TOTTEXP, paramini::TPelt, and paramini::VBin.

Referenced by CONFP_AMS_SM_OFFSET(), CONFP_opt_page1(), CONFP_opt_page2(), CONFP_opt_page3(), CONFP_opt_page4(), CONFP_param_page1(), D_PlotTools(), MAPDefPix(), and MDCreateColFor_Sh().

1878 {
1879 
1880  int c = (int) ed;
1881 
1882  switch (c)
1883  {
1884 
1885  case 1:
1886  {
1887  DAS.Paramini.ITemp = strtod( text, &text );
1888  break;
1889  }
1890  case 2:
1891  {
1892  DAS.Paramini.CoolPw = (int) (strtod( text, &text ) * 10);
1893  break;
1894  }
1895  case 3:
1896  {
1897  DAS.Paramini.TPelt = strtod( text, &text );
1898  break;
1899  }
1900  case 2000:
1901  {
1902  OMUTHR.PCPower = (int) (strtod( text, &text ) * 10);
1903  break;
1904  }
1905 
1906  case 4:
1907  {
1908  DAS.Paramini.ccdXoff = (int) strtol( text, &text, 10 );
1909  break;
1910  }
1911  case 5:
1912  {
1913  DAS.Paramini.ccdWx = (int) strtol( text, &text, 10 );
1914  break;
1915  }
1916  case 6:
1917  {
1918  DAS.Paramini.ccdYoff = (int) strtol( text, &text, 10 );
1919  break;
1920  }
1921  case 7:
1922  {
1923  DAS.Paramini.ccdWy = (int) strtol( text, &text, 10 );
1924  break;
1925  }
1926  case 8:
1927  {
1928  DAS.Paramini.VBin = (int) strtol( text, &text, 10 );
1929  break;
1930  }
1931 /*
1932  case 9:
1933  {
1934 
1935  DAS.StepM.cop[0] = (int) strtol( text, &text, 10 );
1936  break;
1937  }
1938  case 10:
1939  {
1940  DAS.StepM.step[0] = (int) strtol( text, &text, 10 );
1941  break;
1942  }
1943  case 11:
1944  {
1945  DAS.StepM.slope[0] = (int) strtol( text, &text, 10 );
1946  break;
1947  }
1948  case 12:
1949  {
1950  DAS.StepM.speed[0] = (int) strtol( text, &text, 10 );
1951  break;
1952  }
1953 
1954  case 13:
1955  {
1956  DAS.StepM.cop[1] = (int) strtol( text, &text, 10 );
1957  break;
1958  }
1959  case 14:
1960  {
1961  DAS.StepM.step[1] = (int) strtol( text, &text, 10 );
1962  break;
1963  }
1964  case 15:
1965  {
1966  DAS.StepM.slope[1] = (int) strtol( text, &text, 10 );
1967  break;
1968  }
1969  case 16:
1970  {
1971  DAS.StepM.speed[1] = (int) strtol( text, &text, 10 );
1972  break;
1973  }
1974 
1975  case 17:
1976  {
1977  DAS.StepM.cop[2] = (int) strtol( text, &text, 10 );
1978  break;
1979  }
1980  case 18:
1981  {
1982  DAS.StepM.step[2] = (int) strtol( text, &text, 10 );
1983  break;
1984  }
1985  case 19:
1986  {
1987  DAS.StepM.slope[2] = (int) strtol( text, &text, 10 );
1988  break;
1989  }
1990  case 20:
1991  {
1992  DAS.StepM.speed[2] = (int) strtol( text, &text, 10 );
1993  break;
1994  }
1995 */
1996  case 111:
1997  {
1998  if(DAS.DOption.avgmode)
1999  {
2000  TOTTEXP = (int) strtol( text, &text, 10 );
2001  }
2002  else
2003  N_AVG = (int) strtol( text, &text, 10 );
2004  break;
2005  }
2006  case 120:
2007  {
2008  SZAMax = (int) strtol( text, &text, 10 );
2009  break;
2010  }
2011  case 130:
2012  {
2013  DAS.DOption.hlinebefore = (int) strtol( text, &text, 10 );
2014  break;
2015  }
2016  case 135:
2017  {
2018  DAS.DOption.hlineafter = (int) strtol( text, &text, 10 );
2019  break;
2020  }
2021 
2022  case 140:
2023  {
2024  LevelDefPix = (int) strtol( text, &text, 10 );
2025  break;
2026  }
2027  case 150:
2028  {
2029  DOAS.FFTFilter = (int) strtol( text, &text, 10 );
2031  break;
2032  }
2033  case 151:
2034  {
2035  DOAS.FFTFilter = (int) strtol( text, &text, 10 );
2036  break;
2037  }
2038 
2039  case 200:
2040  {
2041  sprintf(DFTP.ftpserver, "%s", text);
2042  break;
2043  }
2044  case 210:
2045  {
2046  sprintf(DFTP.ftpuser, "%s", text);
2047  break;
2048  }
2049  case 220:
2050  {
2051  sprintf(DFTP.ftppwd, "%s", text);
2052  break;
2053  }
2054 
2055 // for DEVICES OFFSETS
2056  case 300:
2057  {
2058  DAS.Paramini.Offset[0] = (int) strtol( text, &text, 10 );
2059  break;
2060  }
2061  case 301:
2062  {
2063  DAS.Paramini.Offset[1] = (int) strtol( text, &text, 10 );
2064  break;
2065  }
2066  case 302:
2067  {
2068  DAS.Paramini.Offset[2] = (int) strtol( text, &text, 10 );
2069  break;
2070  }
2071  case 303:
2072  {
2073  DAS.Paramini.Offset[3] = (int) strtol( text, &text, 10 );
2074  break;
2075  }
2076  case 304:
2077  {
2078  DAS.Paramini.Offset[4] = (int) strtol( text, &text, 10 );
2079  break;
2080  }
2081  case 123:
2082  {
2083  DAS.Paramini.maxtexp = strtod( text, &text);
2084  break;
2085  }
2086  /********************************************************/
2087  //PID Parameters
2088  case 500: //kp
2089  {
2090  OMUTHR.PID_kp = (float)strtod( text, &text);
2091  }
2092  case 501: //ki
2093  {
2094  OMUTHR.PID_ki = (float)strtod( text, &text);
2095  }
2096  case 502: //kd
2097  {
2098  OMUTHR.PID_kd = (float)strtod( text, &text);
2099  }
2100 
2101  /********************************************************/
2102  case 600: //Autoranging max level
2103  {
2104  DAS.DOption.maxlvlar = strtol( text, &text, 10);
2105  }
2106 
2107 
2108 
2109 
2110  }
2111 
2112 }
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
optionini DOption
Options for DAS execution.
int PCPower
Power to the Peltier for Cooling.
int ccdWx
CCD X End.
int Offset[16]
Offset of the hardware devices (Input Mirror (5), Grating, Filter Wheel...)
int ccdXoff
CCD X Start.
omuthr OMUTHR
int SZAMax
Maximum SZA for performing measurements.
Definition: DAS_Spat.c:116
int ccdWy
CCD Y End.
int hlinebefore
Number of HiddenLines before the central line in Plot.
float PID_ki
int avgmode
Flag to set Averaging mode: 0 = Repeat measurements for fixed number, 1 = Repeat measurements for fix...
int VBin
CCD Vertical Binning.
int CoolPw
CCD Init Power.
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
dftp DFTP
char ftpuser[32]
FTP server users.
int TOTTEXP
Total Exposure time in Averaging mode.
Definition: DAS_Spat.c:115
char ftpserver[32]
FTP server address.
int FFTFilter
Fast Fourier Trasform Filter windows.
Definition: DOASdef.h:25
doas DOAS
int hlineafter
Number of HiddenLines after the central line in Plot.
das DAS
float PID_kp
double maxtexp
Maximum exposure time (used in Autorange())
unsigned int LevelDefPix
Definition: DAS_Spat.c:126
char ftppwd[32]
FTP server pwd.
int N_AVG
Number of measurements for Averaging mode in fixed number of meas. mode.
Definition: DAS_Spat.c:113
int ccdYoff
CCD Y Start.
double ITemp
CCD Target Temperature.
unsigned int maxlvlar
maximum level of autoranging (max 65000)
double TPelt
OMU Target Temperature.
float PID_kd
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:

§ ActMvGratCB()

void ActMvGratCB ( MOBJECT  edit,
char *  text,
void *  ed 
)

Move Grating of a free steps number callback.
.

Parameters
editEdit MObject where the number of steps are typed
*textNumber of steps
Returns
void

Definition at line 2691 of file CreateForms.c.

References controlpanel::Albl_LS, AMS1, flag::backlashrec, gui::ContrPanel, DB_StepMotor(), GratingSt::dp, False, das::Flag, GratFlg, flag::gratposmode, GrDIR, das::Gui, controlpanel::LedSM, MEditSetTextExt(), MObjectSetText(), MPixmapSetImageFile(), stepm::multiplier, stepm::SM_B, SM_stepr(), stepm::step, flag::stepgratenc, and das::StepM.

Referenced by MDCreateMoveGrat().

2692 {
2693  static int notify;
2694  long npt, x, dp = 500;
2695  char buf[32];
2696  int er = 0, id;
2697  float k;
2698  long period = 5000;
2699 
2700  //id = DAS.StepM.Addr[AMS1];
2701  id=0;
2702 
2703 
2704 
2705 
2706  if(DAS.Flag.gratposmode == 0) //Step
2707  {
2708  if( DAS.Flag.stepgratenc == 0) // No Parametrization
2709  {
2710  // OLD
2711  x = (long) atoi(text);
2712  }
2713  else
2714  {
2715  // New
2716  k = (float)SM_stepr(DAS.StepM.step[id][1])/3200;
2717  npt = (long) atoi(text);
2718  x = (long)(float) (npt * DAS.StepM.multiplier[id][1] * k);
2719  }
2720  }
2721  else if(DAS.Flag.gratposmode == 1) //Wl
2722  {
2723  k = (float)SM_stepr(DAS.StepM.step[id][1])/3200;
2724  npt = (long) atoi(text);
2725  x = (long) (npt * 24.33 * DAS.StepM.multiplier[id][1] * k);
2726 
2727  }
2728 
2729  if(x)
2730  {
2731  if(DAS.Flag.backlashrec==0) // Perform backlash recovery
2732  {
2733  if(GrDIR == 0)
2734  {
2735  x += GRS.dp;
2736  }
2737 
2738  er = DB_StepMotor(AMS1, 1, x, GrDIR);
2739  if (er)
2740  {
2741  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][DAS.StepM.SM_B], "SYS\\ledGreen.bmp");
2742  sprintf(buf, "%s", "Done");
2744  }
2745  //Se ci si e' mossi verso l'UV si fa il recupero del gioco
2746  if(GrDIR == 0) // faccio recupero gioco
2747  {
2748  er = DB_StepMotor(AMS1, 1, GRS.dp, 1);
2749  if (er)
2750  {
2751  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][DAS.StepM.SM_B], "SYS\\ledGreen.bmp");
2752  sprintf(buf, "%s", "Done");
2754  }
2755  }
2756  }
2757  else // DO NOT Perform backlash recovery
2758  {
2759  er = DB_StepMotor(AMS1, 1, x, GrDIR);
2760  if (er)
2761  {
2762  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][DAS.StepM.SM_B], "SYS\\ledGreen.bmp");
2763  sprintf(buf, "%s", "Done");
2765  }
2766 
2767  }
2768 
2769  }
2770 
2771 
2772  GratFlg = 1;
2773  sprintf(text, "", "");
2774  notify ^= 1;
2775  MEditSetTextExt((MOBJECT) ed, text, False, notify);
2776 }
stepm StepM
Stepper motors parameters structure.
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.
void MEditSetTextExt(MOBJECT edit, const char *text, int validated, int notify)
int gratposmode
Grating position mode flag: = 0 step mode; = 1 Wl mode.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
flag Flag
Structure for different flags.
#define False
Definition: Mguidefs.h:236
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
void MObjectSetText(MOBJECT obj, const char *text)
long dp
Grating backslash recovery steps.
int backlashrec
flag for backlash recovery: =0 perform backlash rec.; = 1 DO NOT perform backlash rec...
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
controlpanel ContrPanel
Control Panel Structure.
das DAS
Definition: CreateForms.c:98
#define AMS1
AMS1 address.
int step[AMSMAX][2]
Stepper Motors Step.
void * MOBJECT
Definition: Mguidefs.h:192
int GrDIR
Definition: CreateForms.c:64
static int GratFlg
Definition: CreateForms.c:60
int stepgratenc
step to the grating mode: = 0 typed steps sent to the stepper; = 1 typed step are parametrized ...
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
GratingSt GRS
Definition: CreateForms.c:82
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ADTesterCB()

void ADTesterCB ( MOBJECT  shell,
void *  od,
void *  ad 
)

Test Temperature AD Converter callback.

Definition at line 3576 of file DAS_Spat_ConfCBs.c.

References adtester::ADInflbl, adtester::ADpb, flag::ADPC104, flag::ADTempTest, AMS2, AMS_PWM(), FANPeltier(), adtester::lblADvalue, ids::LISTEMP, LISTEMP_TASK_TIME, MMessageDialog(), MObjectSetText(), MRefreshTimeout(), Peltier(), and Task_LIS_Temp().

Referenced by MDCreateDASConfig().

3577 {
3578 
3579  int PowerOn, PowerOff,i;
3580 
3581  if(FLAG.ADTempTest == 0)
3582  {
3583 
3584  MObjectSetText(ADTESTER.ADpb, "AD_Testing");
3585  MObjectSetText(ADTESTER.ADInflbl, "Click AD_Test to stop ");
3586  if(FLAG.ADPC104 == 0)
3587  {
3588  FLAG.ADTempTest = 1;
3589  PowerOn = 1;
3590  PowerOff = LISTEMP_TASK_TIME ;
3591  AMS_PWM(AMS2, PowerOn, PowerOff);//Peltier Power a 0
3592  Peltier(0); //Peltier Off
3593  FANPeltier(0);
3594  }
3595  else
3596  MMessageDialog("ADTEST","AD Test Not possible \n Check the PC104 Connection","OK", NULL);
3597 
3598  }
3599  else if(FLAG.ADTempTest == 1)
3600  {
3601 
3602  MObjectSetText(ADTESTER.ADpb, "Start");
3603  MObjectSetText(ADTESTER.ADInflbl, "Click Start to Test ");
3604 
3605  FLAG.ADTempTest = 0;
3606 
3608  for (i=0; i<16; i++)
3609  {
3610  MObjectSetText(ADTESTER.lblADvalue[i], "0.0");
3611  }
3612 
3613 
3614  }
3615 
3616 
3617 }
void FANPeltier(int mod)
FAN ON/OFF .
Definition: Spat_Device.c:2652
void MRefreshTimeout(TIMEOUT_ID *pid, CARD32 msec, TIMEOUT_CB cb, void *ud)
#define AMS2
AMS2 address.
void AMS_PWM(int id, int on, int off)
set the on/off time on the PWM set the on/off time on the PWM.
Definition: Dxl.c:492
void Peltier(int mod)
Peltier ON/OFF .
Definition: Spat_Device.c:2597
void MObjectSetText(MOBJECT obj, const char *text)
ids IDS
ID tasks.
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
MOBJECT lblADvalue[16]
int ADTempTest
= 0 -> AD Converter results on the Control Panel; = 1 -> AD Converter Testing Phase(results on the co...
MOBJECT ADInflbl
#define LISTEMP_TASK_TIME
spectrometer termoregulation
int ADPC104
0 –> Device PC104 exist, 1 –> PC104 DOESN&#39;T exist
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int LISTEMP
Lis Temperature ID.
MOBJECT ADpb
adtester ADTESTER
flag FLAG
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ AllocLongMat()

long* AllocLongMat ( int  hp,
int  vp 
)

Definition at line 2024 of file Spat_Plot.c.

2025 {
2026 
2027  unsigned long mx;
2028  long *mat;
2029  mx = (unsigned long) hp * (unsigned long) vp;
2030  mat = (long *) calloc( mx, sizeof(long));
2031 // if(mat == NULL ) //Only for malloc
2032 // return 1;
2033 
2034  return mat;
2035 
2036 }

§ AMS_Error()

void AMS_Error ( int  w)

Alerts for AMS errors
Creates a message window reporting the number of the error.

Parameters
w= code of the error

Definition at line 254 of file Errors.c.

References AMS_Err, D_WriteInitLog(), palette::DB_BG, palette::DB_BG_Albl, palette::DB_FG_Albl, DPAL, HELV_SMALL, lbl, MCreateLabel(), MCreateShell(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MObjectSetShadow(), MShellRealize(), and WS_SHADOW_OUT.

Referenced by DB_InitAMS().

255 {
256  MOBJECT sh, lbl;
257  char buf[80];
258 
259  if(w < 0 || w > 7) return;
260  //sh = MCreateShell("AMS_Error", SF_MODAL);
261  sh = MCreateShell("AMS_Error", 0);
263 
264  lbl = MCreateLabel(sh, AMS_Err[w], HELV_SMALL);
267  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
268  MShellRealize(sh);
269 
270  sprintf(buf, AMS_Err[w]);
271  D_WriteInitLog(buf);
272 
273 
274 
275 
276 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lbl
Definition: DFileMan.c:42
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MShellRealize(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
palette DPAL
Definition: 2DPlot.c:27
#define HELV_SMALL
Definition: Mguidefs.h:881
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
const char * AMS_Err[]
Definition: Errors.c:36
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
int D_WriteInitLog(char *str)
writes devices errors(AMS, CCD...) on the Devices.log file.
Definition: Save.c:144
void * MOBJECT
Definition: Mguidefs.h:192
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ApplyChCB()

void ApplyChCB ( MOBJECT  shell,
void *  od,
void *  ad 
)

Apply changes in DAS Config callback.

Parameters
a_data
  • = 0 –> Apply to CCD camera
  • = 1 –> Apply to AMS devices

Definition at line 3446 of file DAS_Spat_ConfCBs.c.

References _MAX_PATH, CCD_SetupFlg, d_fileman::CONFIGDIREQUIPMENT, gui::ConfigPanel, gui::ContrPanel, paramini::CoolPw, stepm::cop_perc, DB_InitCamera(), DB_InitMotor(), DB_KB_ButtonActive(), bil::DFILEM, d_fileman::DIRDCL, fraz2val(), das::Gui, hertz2int(), paramini::ITemp, controlpanel::lbl_Par, MObjectGetText(), MObjectSetText(), stepm::multiplier, stepm::NAMS, das::Paramini, omuthr::PCPower, perc2int(), controlpanel::power, stepm::power, controlpanel::slope, stepm::slope, configpanel::SM_multiplier, configpanel::SM_power, configpanel::SM_slope, configpanel::SM_speed, configpanel::SM_step, controlpanel::speed, stepm::speed, stepm::speed_Hz, controlpanel::step, stepm::step, stepm::step_fraz, das::StepM, paramini::TPelt, val2fraz(), and paramini::VBin.

Referenced by CONFP_param_page1(), and MDCreateDASConfig().

3447 {
3448  int c = (int) ad, i;
3449  char str[16];
3450  int er, nummot = 0;
3451  int ans = 0, k;
3452 
3453 // char destination[_MAX_PATH];
3454 // char working_dir[_MAX_PATH];
3455 // char source[_MAX_PATH];
3456  char buf[_MAX_PATH];
3457 
3458  sprintf(str, "%.1lf", DAS.Paramini.ITemp);
3460 
3461  sprintf(str,"%.1lf%%",(double)DAS.Paramini.CoolPw / 10);
3463 
3464  sprintf(str,"%.1lf", DAS.Paramini.TPelt);
3466 
3467 
3468  sprintf(str,"%.1lf%%",(double)OMUTHR.PCPower / 10);
3470 
3471 
3472 /*
3473  sprintf(str,"%d", DAS.Paramini.ccdXoff);
3474  MObjectSetText(DAS.Gui.ContrPanel.lbl_Par[3], str);
3475 
3476  sprintf(str,"%d", DAS.Paramini.ccdYoff);
3477  MObjectSetText(DAS.Gui.ContrPanel.lbl_Par[4], str);
3478 
3479  sprintf(str,"%d", DAS.Paramini.ccdWx);
3480  MObjectSetText(DAS.Gui.ContrPanel.lbl_Par[5], str);
3481 
3482  sprintf(str,"%d", DAS.Paramini.ccdWy);
3483  MObjectSetText(DAS.Gui.ContrPanel.lbl_Par[6], str);
3484 */
3485 
3486  sprintf(str, "%d", DAS.Paramini.VBin);
3488 
3489 
3490  if(CCD_SetupFlg)
3491  {
3492  CCD_SetupFlg = 0;
3493 
3494  //Copy camera.cfg
3495  sprintf(buf, "copy %s\\camera.cfg %s\\", BIL.DFILEM.DIRDCL, BIL.DFILEM.CONFIGDIREQUIPMENT);
3496  er = system(buf);
3497  //sprintf(buf, "copy %s\\dcl.cfg %s\\dcl", BIL.DFILEM.DIRDCL, BIL.DFILEM.CONFIGDIREQUIPMENT);
3498  //er = system(buf);
3499 
3500  }
3501 
3502 
3503 // Stepper Motors Parameters
3504  for (i=0;i<DAS.StepM.NAMS;i++)
3505  {
3506  for(k=0;k<2;k++)
3507  {
3508  /*
3509  * Get user preferences from the EDIT Objects for Power SMx
3510  */
3511  //Power
3513  DAS.StepM.cop_perc[i][k] = atof(str);
3514  DAS.StepM.power[i][k] = perc2int(0, str);
3515  MObjectSetText(DAS.Gui.ContrPanel.power[i][k], str);
3516 
3517  /*
3518  * Get user preferences from the EDIT Objects for Step SMx
3519  */
3520  //Step
3522  DAS.StepM.step[i][k] = fraz2val(0, str);
3523  val2fraz(i, k, DAS.StepM.step[i][k]);
3524  sprintf(str, "%s", DAS.StepM.step_fraz[i][k]);
3525  MObjectSetText(DAS.Gui.ContrPanel.step[i][k], str);
3526 
3527  // Slope
3529  DAS.StepM.slope[i][k] = atoi(str);
3530  sprintf(str, "%d", DAS.StepM.slope[i][k]);
3531  MObjectSetText(DAS.Gui.ContrPanel.slope[i][k], str);
3532 
3533  //speed
3535  DAS.StepM.speed_Hz[i][k] = atof(str);
3536  DAS.StepM.speed[i][k] = hertz2int(0, str);
3537  MObjectSetText(DAS.Gui.ContrPanel.speed[i][k], str);
3538 
3539  //multiplier
3541  DAS.StepM.multiplier[i][k] = atof(str);
3542 
3543  }
3544  }
3545 
3546  if (c == 0)
3547  {
3548  er = DB_InitCamera(1);
3549 
3550 
3551  }
3552  if (c)
3553  {
3554  //Disattiva i pulsanti sulla keyboard
3555  DB_KB_ButtonActive(0);
3556 
3557 
3558  //er = DB_CloseCOM();
3559  //if(er)
3560  // ComErrors(er);
3561 
3562 
3563  er = DB_InitMotor(0);
3564  //Attiva i pulsanti sulla keyboard
3565  DB_KB_ButtonActive(1);
3566 
3567 
3568  }
3569 
3570 
3571 
3572 }
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
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
MOBJECT speed[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "speed".
int NAMS
Number of AMSs Devices.
MOBJECT SM_multiplier[AMSMAX][2]
int PCPower
Power to the Peltier for Cooling.
int slope[AMSMAX][2]
Stepper Motors Slope.
MOBJECT step[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "step".
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
int perc2int(int mod, char *string)
translate the percent power in AMS digit unit. The percent power assigned to the motor trough the AMS...
char * MObjectGetText(MOBJECT obj, char *text)
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
omuthr OMUTHR
void MObjectSetText(MOBJECT obj, const char *text)
MOBJECT slope[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "Slope".
MOBJECT SM_power[AMSMAX][2]
d_fileman DFILEM
Definition: bildef.h:257
char DIRDCL[_MAX_PATH]
Definition: bildef.h:210
int VBin
CCD Vertical Binning.
int CoolPw
CCD Init Power.
MOBJECT SM_step[AMSMAX][2]
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
int hertz2int(int mod, char *string)
translate the Hertz speed in AMS digit unit.
MOBJECT SM_slope[AMSMAX][2]
double cop_perc[AMSMAX][2]
Stepper Motors Power percent.
#define _MAX_PATH
Definition: Dildef.h:202
int fraz2val(int mod, char *val)
ratio value to decimal value opposite than listval2fraz or val2fraz
das DAS
configpanel ConfigPanel
Configuration panel structure.
char step_fraz[AMSMAX][2][6]
Stepper Motors Step fraction.
void val2fraz(int id, int sn, int val)
Decimal value to ratio value Similar to listval2fraz The decimal value indicating the fractioning of ...
controlpanel ContrPanel
Control Panel Structure.
int CCD_SetupFlg
Definition: DAS_Spat.c:138
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
MOBJECT SM_speed[AMSMAX][2]
double ITemp
CCD Target Temperature.
MOBJECT power[AMSMAX][2]
active Control Panel Labels for Stepper Motors "power"
double TPelt
OMU Target Temperature.
bil BIL
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:

§ ApplyImgCB()

void ApplyImgCB ( MOBJECT  shell,
void *  od,
void *  ad 
)

Image type Application callback Apply to the CCD buffer the selected type of image (MONO or RGB)

Definition at line 2116 of file DAS_Spat_ConfCBs.c.

References img::attrib, DI_CloseImage(), DI_OpenImage(), DI_RunHisto(), das::DOption, ccd::dx, ccd::dy, IDX, IDY, dil::Img, optionini::imgtype, ccd::kind, image::Mat, das::Paramini, Server, and paramini::VBin.

Referenced by CONFP_opt_page1().

2117 {
2118 
2119 // int er;
2120  char buf[64];
2121 
2122  IDX = DC_CCD.dx;
2124 
2125  //sprintf(buf, "Marconi %s %d x %d Image",DC_CCD.name, IDX, IDY);
2126  sprintf(buf, "Marconi %d %d x %d Image",DC_CCD.kind , IDX, IDY);
2127  Server = DI_OpenImage((unsigned short)IDX, (unsigned short)IDY, (unsigned short)DAS.DOption.imgtype, 1, buf);
2128  DI_RunHisto();
2129 
2130  if(Server)
2131  {
2132  DIL.Img.Mat[Server - 1].attrib = 0;
2133  DI_CloseImage(Server - 1);
2134  }
2135 
2136  if(Server == 0)
2137  {
2138  DIL.Img.Mat[Server + 1].attrib = 0;
2139  DI_CloseImage(Server + 1);
2140  }
2141 
2142 
2143  /*
2144  er = DI_OpenImage(IDX, IDY, DAS.DOption.flgimgtype, 1, "NONAME");
2145  if(DAS.DOption.flgimgtype)
2146  er= DI_CloseImage(0);
2147  if(!DAS.DOption.flgimgtype)
2148  er= DI_CloseImage(1);
2149 */
2150 
2151 }
ccd DC_CCD
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int Server
Definition: DAS_Spat.c:253
optionini DOption
Options for DAS execution.
C_DEF int DI_CloseImage(int s)
S16 dx
Num. of X pixels.
Definition: dcldef.h:1022
S16 kind
CCD manufacturer codes CCD code definitions.
Definition: dcldef.h:1021
img Mat[MAXIMG]
Definition: Dildef.h:552
image Img
Definition: Dildef.h:675
int VBin
CCD Vertical Binning.
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
S16 dy
Num. of Y pixels.
Definition: dcldef.h:1023
C_DEF void DI_RunHisto(void)
das DAS
int imgtype
Flag to set Image type: 0=MONOINT, 1=RGB.
dil DIL
C_DEF int DI_OpenImage(U16 dx, U16 dy, U16 ifmt, U16 type, char *tit)
S16 attrib
Definition: Dildef.h:279
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:

§ AssignParam()

int AssignParam ( int  mod)

Assign parameters to the CP labels.
.

Parameters
mod– Not used
Returns
int = 0

Definition at line 990 of file Load.c.

References paramini::ccdWx, paramini::ccdWy, paramini::ccdXoff, paramini::ccdYoff, gui::ContrPanel, paramini::CoolPw, stepm::cop_perc, DBDEMO, flag::exemode, das::Flag, das::Gui, int2hertz(), int2perc(), paramini::ITemp, controlpanel::lbl_Par, MANUAL, MObjectSetText(), stepm::NAMS, das::Paramini, omuthr::PCPower, controlpanel::power, stepm::power, PRGFILE, controlpanel::slope, stepm::slope, controlpanel::speed, stepm::speed, stepm::speed_Hz, controlpanel::step, stepm::step, stepm::step_fraz, das::StepM, SZAMASTERM, SZAMODE, TEMPORIZED, TESTAD, TESTAMS, TESTCCD, paramini::TPelt, val2fraz(), and paramini::VBin.

Referenced by SZA_FirstCalc().

991 {
992 
993  char str[80];
994  int i, k, tmp;
995 
999  | (DAS.Flag.exemode == SZAMASTERM) | (DAS.Flag.exemode == SZAMODE) )
1000  {
1001 
1002  //writing on the appropriate labels
1003  //CCD and OMU Parameters
1004  sprintf(str, "%.1lf", DAS.Paramini.ITemp);
1006 
1007  sprintf(str,"%.1lf%%",(double)DAS.Paramini.CoolPw / 10);
1009 
1010  sprintf(str,"%.1lf", DAS.Paramini.TPelt);
1012 
1013  sprintf(str,"%.1lf%%",(double)OMUTHR.PCPower / 10);
1015 
1016  sprintf(str,"%d", DAS.Paramini.ccdXoff);
1018 
1019  sprintf(str,"%d", DAS.Paramini.ccdYoff);
1021  sprintf(str,"%d", DAS.Paramini.ccdWx);
1023  sprintf(str,"%d", DAS.Paramini.ccdWy);
1025  sprintf(str, "%d", DAS.Paramini.VBin);
1027 
1028  for (i=0;i<DAS.StepM.NAMS; i++)
1029  {
1030  for (k=0;k<2; k++)
1031  {
1032  tmp = DAS.StepM.power[i][k];
1033  DAS.StepM.cop_perc[i][k] = int2perc(i, DAS.StepM.power[i][k]);
1034  sprintf(str, "%.1f%%", DAS.StepM.cop_perc[i][k]);
1035  MObjectSetText(DAS.Gui.ContrPanel.power[i][k], str);
1036 
1037  val2fraz(i, k, DAS.StepM.step[i][k]);
1039 
1040  sprintf(str, "%d", DAS.StepM.slope[i][k]);
1041  MObjectSetText(DAS.Gui.ContrPanel.slope[i][k], str);
1042 
1043  DAS.StepM.speed_Hz[i][k] = int2hertz(i, DAS.StepM.speed[i][k]);
1044  sprintf(str, "%.3lf", DAS.StepM.speed_Hz[i][k]);
1045  MObjectSetText(DAS.Gui.ContrPanel.speed[i][k], str);
1046 
1047 
1048  }
1049 
1050  }
1051 /* if (DAS.Paramini.EqType == TROPOGAS)
1052  {
1053  for (i=0;i<6; i++)
1054  {
1055  DAS.StepM.cop_perc[i] = int2perc(i, DAS.StepM.cop[i]);
1056  sprintf(str, "%.1f%%", DAS.StepM.cop_perc[i]);
1057  MObjectSetText(DAS.Gui.ContrPanel.cop[i], str);
1058  val2fraz(i, DAS.StepM.step[i]);
1059  MObjectSetText(DAS.Gui.ContrPanel.step[i], DAS.StepM.step_fraz[i]);
1060  sprintf(str, "%d", DAS.StepM.slope[i]);
1061  MObjectSetText(DAS.Gui.ContrPanel.slope[i], str);
1062  DAS.StepM.speed_Hz[i] = int2hertz(i, DAS.StepM.speed[i]);
1063  sprintf(str, "%.3lf", DAS.StepM.speed_Hz[i]);
1064  MObjectSetText(DAS.Gui.ContrPanel.speed[i], str);
1065  }
1066  }
1067  else
1068  {
1069  for (i=0;i<4; i++)
1070  {
1071  DAS.StepM.cop_perc[i] = int2perc(i, DAS.StepM.cop[i]);
1072  sprintf(str, "%.1f%%", DAS.StepM.cop_perc[i]);
1073  MObjectSetText(DAS.Gui.ContrPanel.cop[i], str);
1074  val2fraz(i, DAS.StepM.step[i]);
1075  MObjectSetText(DAS.Gui.ContrPanel.step[i], DAS.StepM.step_fraz[i]);
1076  sprintf(str, "%d", DAS.StepM.slope[i]);
1077  MObjectSetText(DAS.Gui.ContrPanel.slope[i], str);
1078  DAS.StepM.speed_Hz[i] = int2hertz(i, DAS.StepM.speed[i]);
1079  sprintf(str, "%.3lf", DAS.StepM.speed_Hz[i]);
1080  MObjectSetText(DAS.Gui.ContrPanel.speed[i], str);
1081  }
1082  }
1083  */
1084  }
1085 
1086  return 0;
1087 }
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
MOBJECT speed[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "speed".
#define TESTCCD
execution for testing CCD Camera
int NAMS
Number of AMSs Devices.
int PCPower
Power to the Peltier for Cooling.
int ccdWx
CCD X End.
flag Flag
Structure for different flags.
#define DBDEMO
execution in demo mode
int slope[AMSMAX][2]
Stepper Motors Slope.
int ccdXoff
CCD X Start.
MOBJECT step[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "step".
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
#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)
MOBJECT slope[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "Slope".
int ccdWy
CCD Y End.
omuthr OMUTHR
Definition: Load.c:33
das DAS
DAS structure.
Definition: Load.c:32
int VBin
CCD Vertical Binning.
int CoolPw
CCD Init Power.
#define PRGFILE
execution driven by *.prg file
double int2hertz(int mod, int k)
double cop_perc[AMSMAX][2]
Stepper Motors Power percent.
double int2perc(int mod, int k)
translate the AMS digit unit in text. The power assigned to the motor trough the AMS, is translated in text
#define SZAMODE
execution driven by SZAPRG file
char step_fraz[AMSMAX][2][6]
Stepper Motors Step fraction.
void val2fraz(int id, int sn, int val)
Decimal value to ratio value Similar to listval2fraz The decimal value indicating the fractioning of ...
controlpanel ContrPanel
Control Panel Structure.
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
#define TESTAD
execution for testing PC 104 AD converter
int ccdYoff
CCD Y Start.
double ITemp
CCD Target Temperature.
MOBJECT power[AMSMAX][2]
active Control Panel Labels for Stepper Motors "power"
int exemode
Set the Execution MODE (Execution modes)
double TPelt
OMU Target Temperature.
#define TESTAMS
execution for testing AMS&#39;s devices
#define MANUAL
execution in manual mode (for lab use)
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:

§ AutoRange()

double AutoRange ( int  mod)

Calculate the exposure time
The optimum exposure time (TExp) is calculated with an initial TExpAR=0.1 s, and assuming the linearity between the CCD signal and the exposure time.
If TExp calculated is lower than the minimum TExp allowed (0.02s) (meaning a saturation of the CCD), the appropriate filter is positioned and the procedure is repeated.
If with TExpAR the delta(CCD(x,y))=Max(CCD(x,y))-Min(CCD(x,y)) is lower than 2000 counts (meaning very low radiation intensity) TExpAR is increased and the procedure repeated for at least 4 times (Max TExpAR ~ 5 s)

Parameters
mod
  • 0 = first attempt (with no filter)
  • 1 = second attempt (with the filter positioned
Returns
double = exposure time (x.xx sec)

Definition at line 899 of file Procedures.c.

References controlpanel::Albl_IE, AutoR_No_Shutt(), AutoR_With_Shutt(), gui::ContrPanel, DB_GetCCD(), DBDEMO, delay(), das::DOption, optionini::emshutter, paramini::EqType, flag::exemode, das::Flag, FlagTExp, GASCODNG1, das::Gui, MObjectSetText(), das::Paramini, MirrorSt::Pos, S_zenetr, ShuttDelay, Status(), TESTSZAMODE, and TExp.

Referenced by D_Average(), D_AverageTFix(), D_Calibra(), D_Measure(), DB_HorComm_CB(), DB_KeyB_CB(), E_AutoRange(), E_ChkExLamp(), E_HgScan(), E_QjScan(), GetDefPix(), and PerformMeas().

900 {
901  char buf[80];
902  int i;
903  int FlgSat = 1;
904  double FlagTExp = 2.0;
905  double TExpAutoR = 0.2;
906  //double TExpMin=0;
907 // double TExpLast;
908  double temp = 0;
909  int Lim_supinf = 0;
910 
911  float Level = 55000;
912 // float LevelInf;
913  float lowval = 700;
914  float Offset = 0;
915  static int numrip = 0;
916 
917  /*****************************************************************************************/
918  // For DEMO Mode
920  {
921  for(i=0;i<3; i++)
922  {
923  delay(ShuttDelay);
924  TExp =(float) (3 - i);
925  DB_GetCCD(1);
926 
927  }
928  TExp = 1.2;
929  return TExp;
930  }
931  /*****************************************************************************************/
932 
933 
934 
935  /******************************************************************************************
936  If the Shutter Uniblitz VS25 is present the minimum Exposure time is 0.02 sec
937  otherwise (if the shutter is NOT installed) the minimum exposure time depends on the CCD
938  Reading Time. This last is a function of the binning parameters and it can be calculated
939  according to the formula (for HIRES_IV):
940 
941  RT (in ms)= (vp/vb)*Kv + (vp/vb)*(hp/hb)*Kh
942  where:
943  vp = vertical pixels number
944  vb = vertical binning
945  Kv = 0.024 for hires
946  hp = horizontal pixels number
947  hb = horizontal binning
948  Kh = 0.0125
949 
950  For High values of Vertical Binning the Reading Time (RT) is very short
951  (i.e for VertBin of41-the maximum supported by HiRESIV-RT is less than 0.09 sec)
952  therefore the excess of signal due to the over-exposition of the sensor
953  can be neglected.
954  ******************************************************************************************/
955  Status("Autoranging");
956 if (S_zenetr>= 100 & DAS.Paramini.EqType == GASCODNG1 & MIS.Pos != 2)
957 {
958  TExp = 300.0;
959 }
960 else
961 {
962  if (DAS.DOption.emshutter)
963  {
965  }
966  else
967  {
968  TExp = AutoR_No_Shutt();
969  }
970 }
971  /*****************************************************************************************/
972 
973 
974  sprintf(buf, "%.3lf", TExp);
976 
977  Status("Autoranging DONE");
978  return TExp;
979 
980 
981 }
gui Gui
Graphic User Interface Structure.
double S_zenetr
Definition: SOLPOS.C:92
optionini DOption
Options for DAS execution.
#define TESTSZAMODE
execution driven by SZAPRG file
int Pos
Mirror Current Position.
flag Flag
Structure for different flags.
#define DBDEMO
execution in demo mode
double AutoR_No_Shutt(void)
Definition: Procedures.c:468
void MObjectSetText(MOBJECT obj, const char *text)
das DAS
DAS structure.
Definition: Procedures.c:47
int ShuttDelay
Definition: Procedures.c:255
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
double FlagTExp
Definition: Exec.c:38
int emshutter
Presence of the CCD Shutter, emshutter = 1 –> Shutter IS Installed, = 0 –> Shutter NOT Installed...
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
controlpanel ContrPanel
Control Panel Structure.
MOBJECT Albl_IE[1]
Active Control Panel Labels for In Execution status.
int EqType
Spectrometer Type.
MirrorSt MIS
Mirror.
Definition: Procedures.c:33
int exemode
Set the Execution MODE (Execution modes)
double AutoR_With_Shutt()
Definition: Procedures.c:627
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:

§ BrowseLog()

int BrowseLog ( void  )

Definition at line 456 of file DAS_Spat_Conf.c.

References AllocFloatMat(), FB_PREFS::allow_dir_create, FB_PREFS::allow_dir_delete, FB_PREFS::allow_dir_rename, FB_PREFS::bg_image, FB_PREFS::bg_image_file, FB_PREFS::button_font, omutemp::CCDPwr, omutemp::CCDTemp, FB_PREFS::change_cwd, FB_PREFS::close_button, FB_PREFS::create_menu, DB_2DPlot(), bil::DFILEM, omutemp::dimx, omutemp::dimy, False, FB_PREFS::file_label, FB_PREFS::filter_label, FB_PREFS::font, HELV_SMALL, d_fileman::LOGDIR, MFileBrowseExt(), FB_PREFS::ok_button, omutemp::PltPwr, omutemp::pTempMat, omutemp::ptimeMat, ReadLogFile(), FB_PREFS::remove_menu, FB_PREFS::rename_menu, SET2D_GRID, FB_PREFS::transparent_tree, and True.

Referenced by DB_ToolsKeyB_CB(), and PBTempHistoCB().

457 {
458  int er = 0;
459  char buf[255];
460  int tix = 0, tiy = OMUTEMP.dimy = 16;
461 
462  char fname[128], dirname[128];
463  unsigned long mx;
464 
465 
466  FB_PREFS prefs;
467 
468  prefs.allow_dir_create = True;
469  prefs.allow_dir_delete = True;
470  prefs.allow_dir_rename = True;
471  prefs.change_cwd = True;
472  prefs.allow_dir_create = True;
473  prefs.allow_dir_rename = True;
474  prefs.bg_image = False;
475  prefs.bg_image_file = "";
476  prefs.button_font = HELV_SMALL;
477  prefs.close_button = "CANCEL";
478  prefs.create_menu = "CREATE";
479  prefs.file_label = "File:";
480  prefs.filter_label = "Filter:";
481  prefs.font = HELV_SMALL;
482  prefs.ok_button = "OK";
483  prefs.remove_menu = "REMOVE";
484  prefs.rename_menu = "RENAME";
485  prefs.transparent_tree = False;
486 
487  strcpy (dirname, BIL.DFILEM.LOGDIR);
488  fname[0] = '\0';
489 
490 
491 
492 
493  if(MFileBrowseExt("Select LOG file", "*.log", fname, dirname, &prefs))
494  {
495 
496  sprintf(buf, "%s%s", dirname, fname);
497  }
498  else
499  return 1;
500 
501  OMUTEMP.dimx = ReadLogFile(0, dirname, fname, 0, 0, OMUTEMP);
502  if (OMUTEMP.dimx >=5)
503  {
504  //Remenber to de-alloc theese arrays
506 
507  mx = (unsigned long) OMUTEMP.dimx;
508  OMUTEMP.ptimeMat = (struct dtime *) calloc( mx, sizeof(struct dtime ));
509  OMUTEMP.CCDTemp = (float *) calloc( mx, sizeof(float));
510  OMUTEMP.CCDPwr = (float *) calloc( mx, sizeof(float));
511  OMUTEMP.PltPwr = (float *) calloc( mx, sizeof(float));
512 
513  }
514  else
515  return 1;
516 
517  ReadLogFile(1, dirname, fname, OMUTEMP.dimx, OMUTEMP.dimy, OMUTEMP);
518 
519  sprintf(buf,"TEMPERATURE HISTORY - File:%s", fname);
520 
521  DB_2DPlot(buf, OMUTEMP.dimx, OMUTEMP.dimy, 512, 256, SET2D_GRID);
522 
523  return 0;
524 
525 }
const char * rename_menu
Definition: Mguidefs.h:1513
const char * create_menu
Definition: Mguidefs.h:1511
const char * remove_menu
Definition: Mguidefs.h:1515
const char * close_button
Definition: Mguidefs.h:1509
CARD8 change_cwd
Definition: Mguidefs.h:1485
char LOGDIR[_MAX_PATH]
Definition: bildef.h:209
omutemp OMUTEMP
structure for OMU temperatures
Definition: DAS_Spat_Conf.c:50
struct dtime * ptimeMat
Definition: bildef.h:101
CARD8 allow_dir_create
Definition: Mguidefs.h:1487
int ReadLogFile(int mod, char *dir, char *filename, int nx, int ny, struct omutemp datatemp)
Read DAS LOG File. .
MTFont button_font
Definition: Mguidefs.h:1501
CARD8 allow_dir_delete
Definition: Mguidefs.h:1493
MTFont font
Definition: Mguidefs.h:1499
#define False
Definition: Mguidefs.h:236
float * CCDPwr
Definition: bildef.h:103
File Browser Preferences. Used by the Utility functions MFileBowserExt() and MDirBowserExt().
Definition: Mguidefs.h:1482
const char * ok_button
Definition: Mguidefs.h:1507
int dimx
Definition: bildef.h:113
CARD8 transparent_tree
Definition: Mguidefs.h:1495
d_fileman DFILEM
Definition: bildef.h:257
#define HELV_SMALL
Definition: Mguidefs.h:881
bil BIL
Definition: DAS_Spat_Conf.c:51
const char * file_label
Definition: Mguidefs.h:1505
int MFileBrowseExt(const char *t, const char *ext, char *fname, char *dname, FB_PREFS *prefs)
Definition: bildef.h:77
const char * bg_image_file
Definition: Mguidefs.h:1519
#define SET2D_GRID
Definition: Dildef.h:156
MIMAGE bg_image
Definition: Mguidefs.h:1517
float * PltPwr
Definition: bildef.h:104
const char * filter_label
Definition: Mguidefs.h:1503
#define True
Definition: Mguidefs.h:235
float * AllocFloatMat(int hp, int vp)
Definition: Spat_Plot.c:2009
int dimy
Definition: bildef.h:113
float * CCDTemp
Definition: bildef.h:102
CARD8 allow_dir_rename
Definition: Mguidefs.h:1490
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ BuildLogRatio()

int BuildLogRatio ( void  )

first attempt to apply the DOAS algorithm (..on going!!!)

Definition at line 178 of file DOAS.c.

References AllocFloatMat(), BIL, spectrumheader::ccdex, spectrumheader::ccdwx, bil::DPLOT, doas::FFTFilter, FilterData(), GrafoIMG(), IDX, IDY, d_view::ImatOrig, doas::IoMat, doas::IoSmoothed, doas::IsSmoothed, doas::lambda, doas::LogRatioMat, doas::LogRatioSmoothed, ON_OFFLINEPLOT, SmoothData(), SmoothFloatData(), bil::SPH, and doas::VarY.

Referenced by DB_ToolsKeyB_CB(), and PlotToolsPBs().

179 {
180 
181  int x, y, BlindPix_1;
182  FILE *fd;
183  float low = 65535;
184  float high= -65535;
185 
186  IDY = IDY -1;
187 
188 
189  BlindPix_1 = 0;
190  if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
191  BlindPix_1 = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
192 
193 
194 // FixedStep();
195 
196 
197 
200 
202 
204 
206 
207  FilterData(DOAS.IoMat, IDX, IDY, 5, BlindPix_1);
208  FilterData(BIL.DPLOT.ImatOrig, IDX, IDY, 5, BlindPix_1);
209 
212 
213  for(x = 2; x < IDX - BlindPix_1; x++)
214  {
215 
216  for(y = 0; y < IDY; y++)
217  {
218  DOAS.LogRatioMat[y * IDX + x] = (float) log( DOAS.IoMat[y * IDX + x] / ( BIL.DPLOT.ImatOrig[y * IDX + x] * (DOAS.IoSmoothed[y * IDX + x] / DOAS.IsSmoothed[y * IDX + x])));
219  }
220  }
221 
223 
224 // for(x = 2; x < IDX - BlindPix_1 + 1; x++)
225  for(x = 2; x < IDX - BlindPix_1; x++)
226  {
227 
228  for(y = 0; y < IDY; y++)
229  {
230  DOAS.VarY[y * IDX + x] = DOAS.LogRatioMat[y * IDX + x] - DOAS.LogRatioSmoothed[y * IDX + x];
231  }
232  }
233 
234 
235  fd = fopen("TestLogRatio.dat", "w");
236  if(fd < 0) return 1;
237 
238 
239 // for(x = 2; x < IDX - BlindPix_1 + 1; x++)
240  for(x = 2; x < IDX - BlindPix_1; x++)
241  {
242 
243  fprintf(fd, " %9.4lf", DOAS.lambda[x]);
244  for(y = 0; y < IDY; y++)
245  {
246 
247 
248 // DOAS.LogRatioMat[y * IDX + x] = log( DOAS.IoMat[y * IDX + x] / ( BIL.DPLOT.ImatOrig[y * IDX + x] * (DOAS.IoSmoothed[y * IDX + x] / DOAS.IsSmoothed[y * IDX + x])));
249  fprintf(fd, " %9.4lf", DOAS.VarY[y * IDX + x]);
250  }
251  fprintf(fd, "\n", NULL);
252  }
253  fprintf(fd, "\n", NULL);
254  fclose(fd);
255 
256 
257 
258 
259 
260 // for(x = 2; x < IDX - BlindPix_1 + 1; x++)
261  for(x = 2; x < IDX - BlindPix_1; x++)
262  {
263  for(y = 0; y < IDY; y++)
264  {
265  if(DOAS.VarY[y * IDX + x] < low) low = DOAS.VarY[y * IDX + x];
266  if(DOAS.VarY[y * IDX + x] > high) high = DOAS.VarY[y * IDX + x];
267  }
268  }
269 
270 
271 // for(x = 2; x < IDX - BlindPix_1 + 1; x++)
272  for(x = 2; x < IDX - BlindPix_1; x++)
273  {
274 
275  for(y = 0; y < IDY; y++)
276  {
277  BIL.DPLOT.ImatOrig[y * IDX + x] = (unsigned short)((DOAS.VarY[y * IDX + x] - low) * 100000);
278  }
279  }
280 
281 
282 
283 
284 
285 
286 // SwapMatrix((unsigned short *) DOAS.VarY, BIL.DPLOT.ImatOrig, IDX, IDY);
288 
289 /*
290  DOAS.IoSmoothed = DeallocFloatMat(DOAS.IoSmoothed);
291  DOAS.IsSmoothed = DeallocFloatMat(DOAS.IsSmoothed);
292 
293  DOAS.LogRatioMat = DeallocFloatMat(DOAS.LogRatioMat);
294 
295  DOAS.LogRatioSmoothed = DeallocFloatMat(DOAS.LogRatioSmoothed);
296 
297  DOAS.VarY = DeallocFloatMat(DOAS.VarY);
298 */
299  return 0;
300 
301 }
int SmoothFloatData(float *source, float *destination, int horpix, int verpix, int filw, int bp)
Calc. the smoothed matrix of a float one. .
Definition: Save.c:890
float * IsSmoothed
Smoothed measured spectrum.
Definition: DOASdef.h:29
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
float * IoSmoothed
Smoothed ref spectrum.
Definition: DOASdef.h:28
int FilterData(unsigned short *mat, int horpix, int verpix, int filw, int bp)
Definition: FFT.c:250
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
int SmoothData(unsigned short *source, float *destination, int horpix, int verpix, int filw, int bp)
Calc. the smoothed matrix of an unsigned short one. .
Definition: Save.c:973
float * LogRatioSmoothed
Definition: DOASdef.h:32
unsigned short * ImatOrig
Definition: bildef.h:180
d_view DPLOT
Definition: bildef.h:254
double lambda[1055]
Wavelength series.
Definition: DOASdef.h:18
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
float * VarY
Definition: DOASdef.h:31
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
int FFTFilter
Fast Fourier Trasform Filter windows.
Definition: DOASdef.h:25
bil BIL
Definition: 2DPlot.c:28
unsigned short * IoMat
Reference spectrum.
Definition: DOASdef.h:27
doas DOAS
Definition: DOAS.c:20
float * AllocFloatMat(int hp, int vp)
Definition: Spat_Plot.c:2009
float * LogRatioMat
log of the ratio
Definition: DOASdef.h:30
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ CalcFluxIndex()

double CalcFluxIndex ( unsigned short  mis[],
int  dx,
int  dy,
float  te 
)

calculates the Flux Index of a measurement

Parameters
mis[]data array
dxhorizontal pixels
dyvertical pixels
teexposure time
Returns
: Flux Index
Parameters
*nomefilesource file name

Definition at line 306 of file Utils.c.

Referenced by DB_CalcFluxI().

307 {
308 
309  int x;
310  long sumdata = 0;
311  double average = 0;
312  double fluxi = 0;
313 
314 
315  for(x = 200; x < dx - 200 ; x++)
316  {
317  sumdata += mis[ dy * dx + x];
318  }
319 
320  average = sumdata / (double) (dx - 400);
321 
322  fluxi = average / (double)(te * 1000000);
323 
324  return fluxi;
325 
326 }
+ Here is the caller graph for this function:

§ CCD_Error()

void CCD_Error ( char *  str)

Alerts for CCD errors
Creates a message window reporting the number of the error.

Parameters
w= code of the error

Definition at line 279 of file Errors.c.

References D_WriteInitLog(), palette::DB_BG, palette::DB_BG_Albl, palette::DB_FG_Albl, DPAL, HELV_SMALL, lbl, MCreateLabel(), MCreateShell(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MObjectSetShadow(), MShellRealize(), and WS_SHADOW_OUT.

Referenced by InitCCD_AMS(), and ShutCB().

280 {
281  MOBJECT sh, lbl;
282 // char buf[80];
283 
284 // if(w == 0 || w > 16) return;
285 // sh = MCreateShell("CCD_Error", SF_MODAL);
286  sh = MCreateShell("CCD_Error", 0);
288 
289  //lbl = MCreateLabel(sh, CCD_Err[--w], HELV_SMALL);
290  lbl = MCreateLabel(sh, str, HELV_SMALL);
293  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
294  MShellRealize(sh);
295 
296  //sprintf(buf, CCD_Err[w]);
297  //D_WriteInitLog(buf);
298  D_WriteInitLog(str);
299 
300 
301 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lbl
Definition: DFileMan.c:42
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MShellRealize(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
palette DPAL
Definition: 2DPlot.c:27
#define HELV_SMALL
Definition: Mguidefs.h:881
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
int D_WriteInitLog(char *str)
writes devices errors(AMS, CCD...) on the Devices.log file.
Definition: Save.c:144
void * MOBJECT
Definition: Mguidefs.h:192
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ CCDSetupCB()

void CCDSetupCB ( MOBJECT  shell,
void *  od,
void *  ad 
)

CCD setup Callback. Execute DCS.exe (DTA Camera Select)

Definition at line 3385 of file DAS_Spat_ConfCBs.c.

References _MAX_PATH, CCD_SetupFlg, CodeEq2Name(), d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, DI_FileExist(), paramini::EqType, d_fileman::HOMEDIRECTORY, MMessageDialog(), and das::Paramini.

Referenced by CONFP_param_page1().

3386 {
3387 
3388  int er = 0;
3389  char str[_MAX_PATH];
3390 // char buf[_MAX_PATH];
3391  char buff[_MAX_PATH];
3392 
3393  CCD_SetupFlg = 1;
3394 /*
3395  //Set path for the DCL
3396  sprintf(buff, "%s\\dcl\\", BIL.DFILEM.CONFIGDIREQUIPMENT );
3397  // Return: 1 if PATH exist, else return 0
3398  er = DI_PathExist(buff);
3399  if (er)
3400  {
3401  //Set path for the DCL
3402  DC_SetPathName(buff);
3403  }
3404  else
3405  {
3406  sprintf(buf,"Path '%s' deos not exist,\nPlease create and fill ", buff);
3407  MMessageDialog ("DAS ERROR ", buf, "OK",NULL);
3408  return 1001;
3409 
3410  }
3411 
3412  sprintf(str, "%s%s", buff , "dcs.exe -f ");
3413 */
3414 
3415 
3416 
3417 
3418  sprintf(buff, "%s\\%s.cfg", BIL.DFILEM.CONFIGDIREQUIPMENT,CodeEq2Name(DAS.Paramini.EqType));
3419 
3420  //Return: 1 if file exist, else return 0
3421  er = DI_FileExist(buff);
3422  if (er)
3423  {
3424  sprintf(str, "%s\\%s -f %s", BIL.DFILEM.HOMEDIRECTORY , "dcs.exe", buff);
3425 
3426  }
3427  else
3428  {
3429  sprintf(buff,"File'%s\\%s.cfg' not found,\n\
3430 Now 'dcs.exe' will load the standard 'camera.cfg' configuration file\n\
3431 Set the camera parameters, copy the '%s\\dcl\\camera.cfg' file in the %s folder\n\
3432 and rename in '%s.cfg'", BIL.DFILEM.CONFIGDIREQUIPMENT, CodeEq2Name(DAS.Paramini.EqType),
3434  MMessageDialog ("DAS ERROR ", buff, "OK",NULL);
3435  sprintf(str, "%s//%s", BIL.DFILEM.HOMEDIRECTORY , "dcs.exe");
3436 
3437  }
3438 
3439  er = WinExec(str, SW_SHOW);
3440 
3441 
3442 }
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
char * CodeEq2Name(int code)
code Equipment to Name
Definition: Load.c:371
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,...)
das DAS
int CCD_SetupFlg
Definition: DAS_Spat.c:138
int EqType
Spectrometer Type.
C_DEF int DI_FileExist(char *tit)
bil BIL
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:

§ 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:

§ ChkDigIO()

int ChkDigIO ( unsigned char  word,
int  bitn 
)

check for digital I/O Status

Parameters
word= 8 bit word to be checked
bitn= bit number to be checked (0 to 7)

Definition at line 997 of file DAS_Spat_Conf.c.

Referenced by AMS_PWM_Zero(), CONFP_AMS_IOPort(), CONFP_AMS_NOVA(), DB_KeyB_CB(), NOVAIn_CB(), NOVAOut_CB(), and OOP_CB().

998 {
999 
1000 
1001  int bn = bitn;
1002  int sts = 2;
1003  char str[80], *s;
1004  int er;
1005  unsigned long stbyte = 0;
1006 
1007  er = 0;
1008 // strcpy(
1009  sprintf(str,"0x%0x",word);
1010  stbyte = strtol(str, &s, 16);
1011  //stbyte = strtol(word, &s, 16);
1012 
1013  sts = stbyte & (unsigned char) pow(2,(double)(bn));
1014  sts = sts >> bn;
1015  if (sts == 2)
1016  return 2;
1017  else
1018  return sts;
1019 
1020 
1021 }
+ 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:

§ CloseColPickCB()

void CloseColPickCB ( MOBJECT  obj,
void *  s,
void *  v 
)

Declared but not used.

Definition at line 776 of file DAS_Spat_ConfCBs.c.

References cell_color, drawarea_bgc, MFreeCell(), MFreeColor(), MObjectShell(), MShellDestroy(), MShellUnrealize(), and p.

777 {
778  MOBJECT p;
779 
782  p = MObjectShell(obj);
783 
784  MShellUnrealize(p);
785  MShellDestroy(p);
786 }
void MShellUnrealize(MOBJECT obj)
void MShellDestroy(MOBJECT obj)
MOBJECT MObjectShell(MOBJECT obj)
MTColor cell_color
Definition: DAS_Spatram.h:3059
static double p
Definition: SOLPOS.C:131
void * MOBJECT
Definition: Mguidefs.h:192
void MFreeCell(MTColor c)
void MFreeColor(MTColor col)
MTColor drawarea_bgc
Definition: DAS_Spatram.h:3062
+ Here is the call graph for this function:

§ CloseConfigCB()

void CloseConfigCB ( MOBJECT  shell,
void *  od,
void *  ad 
)

Close DAS-Config callback close the DAS_Config window. If the testing of the ADConverter is running it is stopped.

Definition at line 2153 of file DAS_Spat_ConfCBs.c.

References adtester::ADpb, flag::ADTempTest, DPWD, adtester::lblADvalue, ids::LISTEMP, LISTEMP_TASK_TIME, MObjectSetText(), MRefreshTimeout(), MShellDestroy(), MShellUnrealize(), dpwd::OwnPwdOk, dpwd::ROwnPwdOk, and Task_LIS_Temp().

Referenced by CONFP_Options(), CONFP_param_page1(), CONFP_param_page2(), CONFP_param_page3(), CONFP_param_page4(), CONFP_param_page5(), and MDCreateDASConfig().

2154 {
2155 
2156  MOBJECT c;
2157  int i;
2158 
2159  DPWD.ROwnPwdOk = 1;
2160  DPWD.OwnPwdOk = 1;
2161 
2162 
2163  c = (MOBJECT) ad;
2164  if(FLAG.ADTempTest == 1)
2165  {
2166 
2167  MObjectSetText(ADTESTER.ADpb, "Start");
2168  FLAG.ADTempTest = 0;
2170  for (i=0; i<16; i++)
2171  MObjectSetText(ADTESTER.lblADvalue[i], "0.0");
2172 
2173 
2174 
2175  }
2176 
2177 
2178  MShellUnrealize(c);
2179  MShellDestroy(c);
2180 }
dpwd DPWD
Definition: CreateForms.c:79
void MRefreshTimeout(TIMEOUT_ID *pid, CARD32 msec, TIMEOUT_CB cb, void *ud)
int OwnPwdOk
void MShellUnrealize(MOBJECT obj)
void MObjectSetText(MOBJECT obj, const char *text)
ids IDS
ID tasks.
void MShellDestroy(MOBJECT obj)
int ROwnPwdOk
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
MOBJECT lblADvalue[16]
int ADTempTest
= 0 -> AD Converter results on the Control Panel; = 1 -> AD Converter Testing Phase(results on the co...
#define LISTEMP_TASK_TIME
spectrometer termoregulation
int LISTEMP
Lis Temperature ID.
void * MOBJECT
Definition: Mguidefs.h:192
MOBJECT ADpb
adtester ADTESTER
flag FLAG
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ CloseFontViewCB()

void CloseFontViewCB ( MOBJECT  p,
void *  a,
void *  data 
)

This callback Unloads the latest loaded font and destroys the dialog.

Definition at line 1474 of file DAS_Spat_ConfCBs.c.

References FIXED_MEDIUM, font, MObjectShell(), MShellDestroy(), MShellUnrealize(), and MUnloadFont().

1475 {
1476  if (font != FIXED_MEDIUM)
1477  MUnloadFont(font);
1478  font = FIXED_MEDIUM;
1479  p = MObjectShell(p);
1480 
1481  MShellUnrealize(p);
1482  MShellDestroy(p);
1483 }
void MUnloadFont(MTFont font)
void MShellUnrealize(MOBJECT obj)
void MShellDestroy(MOBJECT obj)
MOBJECT MObjectShell(MOBJECT obj)
#define FIXED_MEDIUM
Definition: Mguidefs.h:879
MTFont font
Definition: DAS_Spatram.h:3066
static double p
Definition: SOLPOS.C:131
+ Here is the call graph for this function:

§ CodeEq2Name()

char * CodeEq2Name ( int  code)

code Equipment to Name

Parameters
code= code of the equipment

Definition at line 371 of file Load.c.

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

372 {
373 
374  static char *EqName[] = {{"SPATRAM"},
375  {"TROPOGAS"},
376  {"LIS"},
377  {"SPATRAMPLUS"},
378  {"GASCODNG1"},
379  {"GASCODOFAX"},
380  {"GASCODNG2"},
381  {"GASCODNG3"},
382  {"GASCODNG4"},
383  {"SPATRAM2"},
384  {"SPATRAM3"}};
385 
386  return EqName[code];
387 
388 }
+ Here is the caller graph for this function:

§ ColObjCB()

void ColObjCB ( MOBJECT  o,
void *  a,
void *  v 
)

select the object to consider for color picking

Definition at line 413 of file DAS_Spat_ConfCBs.c.

References b_sbar, palette::DB_BG, palette::DB_BG_Albl, palette::DB_BG_lblUP, palette::DB_BG_Plbl, DB_ColorPick(), palette::DB_FG_Albl, palette::DB_FG_lblUP, palette::DB_FG_Plbl, palette::DB_Sel, palette::DB_UnSel, DOASMODE, flag::exemode, das::Flag, FlgBG, FlgFG, FlgOBJ, g_sbar, listf::lbl, MMessageDialog(), MRButtonDeactivate(), MRButtonGetActivationStatus(), MScrollBarSetPos(), OFFLINEPLOT, r_sbar, listf::rb, and listf::shell.

Referenced by ColPickBackForeGCB(), and MDCreateDASConfig().

414 {
415 //sceglie l'oggetto da considerare label, buttons....
416 
417  int c = (int) v;
418  int er = 0;
419  int r, g, b;
420 
422  if (er)
423  {
424  switch (c)
425  {
426  case 0:
427  FlgOBJ=0; //Unselected Command Button
428  if(FlgBG)
429  {
430  r = DPAL.DB_UnSel[0];
431  g = DPAL.DB_UnSel[1];
432  b = DPAL.DB_UnSel[2];
433  }
434  break;
435  case 1:
436  FlgOBJ=1; //Selected KeyCom
437  if(FlgBG)
438  {
439  r = DPAL.DB_Sel[0];
440  g = DPAL.DB_Sel[1];
441  b = DPAL.DB_Sel[2];
442  }
443  break;
444 
445  case 2:
446  FlgOBJ=2; //Active Labels
448  {
449  if(FlgBG)
450  {
451  r = DPAL.DB_BG_Albl[0];
452  g = DPAL.DB_BG_Albl[1];
453  b = DPAL.DB_BG_Albl[2];
454  }
455  if(FlgFG)
456  {
457  r = DPAL.DB_FG_Albl[0];
458  g = DPAL.DB_FG_Albl[1];
459  b = DPAL.DB_FG_Albl[2];
460  }
461  break;
462  }
463  else
464  {
465  if(!MMessageDialog("DAS information", "Not Available in this Execution mode", " Ok ", NULL))
467  break;
468  }
469  case 3:
470  FlgOBJ=3; //Passive Labels
472  {
473  if(FlgBG)
474  {
475  r = DPAL.DB_BG_Plbl[0];
476  g = DPAL.DB_BG_Plbl[1];
477  b = DPAL.DB_BG_Plbl[2];
478  }
479  if(FlgFG)
480  {
481  r = DPAL.DB_FG_Plbl[0];
482  g = DPAL.DB_FG_Plbl[1];
483  b = DPAL.DB_FG_Plbl[2];
484  }
485  break;
486  }
487  else
488  {
489  if(!MMessageDialog("DAS information", "Not Available in this Execution mode", " Ok ", NULL))
491  break;
492  }
493  case 4:
494  FlgOBJ=4; //Forms Background
496  {
497  r = DPAL.DB_BG[0];
498  g = DPAL.DB_BG[1];
499  b = DPAL.DB_BG[2];
500 // DB_ColorPick(DAS.Gui.ContrPanel.RwFrm0);
501  break;
502  }
503  else
504  {
506  break;
507  }
508  case 5:
509  FlgOBJ=5; //Kapital Labels UP
511  {
512  if(FlgBG)
513  {
514  r = DPAL.DB_BG_lblUP[0];
515  g = DPAL.DB_BG_lblUP[1];
516  b = DPAL.DB_BG_lblUP[2];
517  }
518  if(FlgFG)
519  {
520  r = DPAL.DB_FG_lblUP[0];
521  g = DPAL.DB_FG_lblUP[1];
522  b = DPAL.DB_FG_lblUP[2];
523  }
524  break;
525  }
526  else
527  {
528  DB_ColorPick(LISTF.lbl[0]);
529  break;
530  }
531  case 6:
532  FlgOBJ=6; //Radio Buttons
533  DB_ColorPick(LISTF.rb[0]);
534  break;
535  }
536 
537  MScrollBarSetPos(r_sbar, (long) r);
538  MScrollBarSetPos(g_sbar, (long) g);
539  MScrollBarSetPos(b_sbar, (long) b);
540  }
541 }
short DB_BG_lblUP[3]
Background Capital Letters Labels Color UP.
MOBJECT rb[10]
Definition: DOASdef.h:62
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
MOBJECT b_sbar
Definition: DAS_Spatram.h:3057
MOBJECT r_sbar
Definition: DAS_Spatram.h:3057
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
short DB_Sel[3]
Selected Buttons Colors.
int FlgBG
Definition: DAS_Spat_Conf.c:91
MOBJECT shell
Definition: DOASdef.h:66
int MRButtonGetActivationStatus(MOBJECT o)
#define OFFLINEPLOT
execution for archived data visualisation
void MScrollBarSetPos(MOBJECT p, long pos)
void MRButtonDeactivate(MOBJECT o)
void DB_ColorPick(MOBJECT o)
int FlgFG
Definition: DAS_Spat_Conf.c:92
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
MOBJECT g_sbar
Definition: DAS_Spatram.h:3057
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
das DAS
short DB_BG[3]
Default Background Color.
int FlgOBJ
Definition: DAS_Spat_Conf.c:93
MOBJECT lbl[5]
Definition: DOASdef.h:60
palette DPAL
short DB_UnSel[3]
Unselected Buttons Colors.
int exemode
Set the Execution MODE (Execution modes)
listf LISTF
short DB_FG_lblUP[3]
Foreground Capital Letters Labels Color UP.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ColorAssignCB()

void ColorAssignCB ( MOBJECT  o,
void *  o_data,
void *  a_data 
)

Definition at line 635 of file DAS_Spat_ConfCBs.c.

References b_c, palette::DB_BG, palette::DB_BG_Albl, palette::DB_BG_lblUP, palette::DB_BG_Plbl, palette::DB_BG_RButt, palette::DB_FG_Albl, palette::DB_FG_lblUP, palette::DB_FG_Plbl, palette::DB_FG_RButt, palette::DB_Sel, palette::DB_UnSel, palette::DB_UnSelFG, FlgBG, FlgFG, FlgOBJ, g_c, das::Gui, MObjectMap(), MObjectRedraw(), MObjectUnmap(), r_c, shells::Sh_Main, and gui::Shells.

Referenced by MDCreateDASConfig().

636 {
637 
638 // int i;
639  // Unselected Buttons BG
640  if(FlgBG && (FlgOBJ==0))
641  {
642  DPAL.DB_UnSel[0] = r_c;
643  DPAL.DB_UnSel[1] = g_c;
644  DPAL.DB_UnSel[2] = b_c;
645  }
646  // Unselected Buttons FG
647  if(FlgFG && (FlgOBJ==0))
648  {
649  DPAL.DB_UnSelFG[0] = r_c;
650  DPAL.DB_UnSelFG[1] = g_c;
651  DPAL.DB_UnSelFG[2] = b_c;
652  }
653  // Selected Buttons
654  if (FlgBG && (FlgOBJ==1))
655  {
656  DPAL.DB_Sel[0] = r_c;
657  DPAL.DB_Sel[1] = g_c;
658  DPAL.DB_Sel[2] = b_c;
659  }
660  //Active Labels BG
661  if (FlgBG && (FlgOBJ==2))
662  {
663  DPAL.DB_BG_Albl[0] = r_c;
664  DPAL.DB_BG_Albl[1] = g_c;
665  DPAL.DB_BG_Albl[2] = b_c;
666  }
667 
668  //Active Labels FG
669  if (FlgFG && (FlgOBJ==2))
670  {
671  DPAL.DB_FG_Albl[0] = r_c;
672  DPAL.DB_FG_Albl[1] = g_c;
673  DPAL.DB_FG_Albl[2] = b_c;
674 
675  }
676 
677  //Passive Labels BG
678  if (FlgBG && (FlgOBJ==3))
679  {
680  DPAL.DB_BG_Plbl[0] = r_c;
681  DPAL.DB_BG_Plbl[1] = g_c;
682  DPAL.DB_BG_Plbl[2] = b_c;
683  }
684 
685  //Passive Labels FG
686  if (FlgFG && (FlgOBJ==3))
687  {
688  DPAL.DB_FG_Plbl[0] = r_c;
689  DPAL.DB_FG_Plbl[1] = g_c;
690  DPAL.DB_FG_Plbl[2] = b_c;
691  }
692 
693  //Forms BG
694  if (FlgBG && (FlgOBJ==4))
695  {
696  DPAL.DB_BG[0] = r_c;
697  DPAL.DB_BG[1] = g_c;
698  DPAL.DB_BG[2] = b_c;
699  }
700 
701  // Kapital Labels UP BG
702  if (FlgBG && (FlgOBJ==5))
703  {
704  DPAL.DB_BG_lblUP[0] = r_c;
705  DPAL.DB_BG_lblUP[1] = g_c;
706  DPAL.DB_BG_lblUP[2] = b_c;
707  }
708 
709  // Kapital Labels UP FG
710  if (FlgFG && (FlgOBJ==5))
711  {
712  DPAL.DB_FG_lblUP[0] = r_c;
713  DPAL.DB_FG_lblUP[1] = g_c;
714  DPAL.DB_FG_lblUP[2] = b_c;
715  }
716 
717  // Radio Buttons DW BG
718  if (FlgBG && (FlgOBJ==6))
719  {
720  DPAL.DB_BG_RButt[0] = r_c;
721  DPAL.DB_BG_RButt[1] = g_c;
722  DPAL.DB_BG_RButt[2] = b_c;
723  }
724 
725 
726  // Radio Buttons FG
727  if (FlgFG && (FlgOBJ==6))
728  {
729  DPAL.DB_FG_RButt[0] = r_c;
730  DPAL.DB_FG_RButt[1] = g_c;
731  DPAL.DB_FG_RButt[2] = b_c;
732  }
733 
734 
738 
739 
740 
741 
742 }
short DB_BG_lblUP[3]
Background Capital Letters Labels Color UP.
gui Gui
Graphic User Interface Structure.
shells Shells
Shells structure.
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
MOBJECT Sh_Main
Main shell for control panel.
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
short DB_Sel[3]
Selected Buttons Colors.
int FlgBG
Definition: DAS_Spat_Conf.c:91
short DB_BG_RButt[3]
Background Radio Buttons.
int b_c
Definition: DAS_Spatram.h:3060
int FlgFG
Definition: DAS_Spat_Conf.c:92
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
void MObjectRedraw(MOBJECT obj)
int r_c
Definition: DAS_Spatram.h:3060
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
das DAS
short DB_BG[3]
Default Background Color.
void MObjectUnmap(MOBJECT obj)
int FlgOBJ
Definition: DAS_Spat_Conf.c:93
short DB_FG_RButt[3]
Foreground Radio Buttons.
short DB_UnSelFG[3]
Unselected Buttons Colors.
int g_c
Definition: DAS_Spatram.h:3060
palette DPAL
short DB_UnSel[3]
Unselected Buttons Colors.
void MObjectMap(MOBJECT obj)
short DB_FG_lblUP[3]
Foreground Capital Letters Labels Color UP.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ColorFreeCB()

void ColorFreeCB ( MOBJECT  o,
void *  o_data,
void *  a_data 
)

Declared but not used.

Definition at line 767 of file DAS_Spat_ConfCBs.c.

References cell_color, MFreeCell(), MSetCellColor(), and sel_cell.

768 {
769  if (sel_cell != (int) cell_color)
770  {
771  MSetCellColor(sel_cell, 0, 0, 0);
773  }
774 }
int sel_cell
Definition: DAS_Spatram.h:3060
MTColor cell_color
Definition: DAS_Spatram.h:3059
void MFreeCell(MTColor c)
void MSetCellColor(MTColor c, int r, int g, int b)
+ Here is the call graph for this function:

§ ColorMapExposeCB()

void ColorMapExposeCB ( MOBJECT  obj,
MEvent pexp,
void *  a_data 
)

Declared but not used.

Definition at line 803 of file DAS_Spat_ConfCBs.c.

References dil::Cfg, MDrawBox(), MDrawFilledBox(), MObjectGetHeight(), MObjectGetWidth(), cfg::NColors, sel_x, sel_y, and mtcl::white.

Referenced by ColorSaveCB().

804 {
805  int n, hsize, wsize, i, j;
806 
807  n = (DIL.Cfg.NColors == 16 ? 4 : 16);
808  wsize = MObjectGetWidth(obj) / n;
809  hsize = MObjectGetHeight(obj) / n;
810  for (i = 0; i < n; i++)
811  for (j = 0; j < n; j++)
812  MDrawFilledBox(obj, wsize * j + 1, hsize * i + 1, wsize - 2, hsize - 2, i * n + j);
813  MDrawBox(obj, sel_x, sel_y, wsize, hsize, MTCL.white);
814 }
cfg Cfg
Definition: Dildef.h:678
void MDrawFilledBox(MOBJECT p, int x, int y, int w, int h, MTColor bgc)
int MObjectGetHeight(MOBJECT obj)
mtcl MTCL
MTColor.
MTColor white
U32 NColors
Definition: Dildef.h:648
int MObjectGetWidth(MOBJECT obj)
void MDrawBox(MOBJECT p, int x, int y, int w, int h, MTColor bgc)
dil DIL
int sel_x
Definition: DAS_Spatram.h:3060
int sel_y
Definition: DAS_Spatram.h:3060
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ColorMapInputCB()

void ColorMapInputCB ( MOBJECT  obj,
MEvent pe,
void *  a_data 
)

Declared but not used.

Definition at line 831 of file DAS_Spat_ConfCBs.c.

References b_sbar, dil::Cfg, D_A, drawarea_bgc, E_BUTTON_PRESS, E_KEY_PRESS, g_sbar, MEvent::key, MKeyEvent::keycode, L_A, MDrawBox(), MObjectGetHeight(), MObjectGetWidth(), MEvent::mouse, MQueryColor(), MScrollBarSetPos(), cfg::NColors, R_A, r_sbar, sel_cell, sel_x, sel_y, MEvent::type, U_A, mtcl::white, MMouseEvent::x, and MMouseEvent::y.

832 {
833  int n, hsize, wsize;
834  int r, g, b, old_x, old_y;
835 
836  n = (DIL.Cfg.NColors == 16 ? 4 : 16);
837  wsize = MObjectGetWidth(obj) / n;
838  hsize = MObjectGetHeight(obj) / n;
839  old_x = sel_x;
840  old_y = sel_y;
841  if (pe->type == E_KEY_PRESS)
842  {
843  switch (pe->key.keycode)
844  {
845  case U_A:
846  sel_cell -= n;
847  if (sel_cell < 0)
848  sel_cell += (int) DIL.Cfg.NColors;
849  break;
850  case D_A:
851  sel_cell += n;
852  if (sel_cell > (int) DIL.Cfg.NColors)
853  sel_cell -= (int) DIL.Cfg.NColors;
854  break;
855  case R_A:
856  if (++sel_cell >= (int) DIL.Cfg.NColors)
857  sel_cell = 0;
858  break;
859  case L_A:
860  if (--sel_cell < 0)
861  sel_cell = (int) DIL.Cfg.NColors - 1;
862  break;
863  default:
864  return;
865  }
866  sel_x = (sel_cell % n) * wsize;
867  sel_y = (sel_cell / n) * hsize;
868  }
869  else if (pe->type == E_BUTTON_PRESS)
870  {
871  sel_x = (pe->mouse.x / wsize) * wsize;
872  sel_y = (pe->mouse.y / hsize) * hsize;
873  sel_cell = sel_x / wsize + sel_y / hsize * n;
874  }
875  else
876  return;
877  MDrawBox(obj, old_x, old_y, wsize, hsize, drawarea_bgc);
878  MDrawBox(obj, sel_x, sel_y, wsize, hsize, MTCL.white);
879  MQueryColor(sel_cell, &r, &g, &b);
880  MScrollBarSetPos(r_sbar, (long) r);
881  MScrollBarSetPos(g_sbar, (long) g);
882  MScrollBarSetPos(b_sbar, (long) b);
883 
884 }
void MQueryColor(MTColor col, int *pr, int *pg, int *pb)
cfg Cfg
Definition: Dildef.h:678
unsigned int keycode
Code for the pressed key.
Definition: Mguidefs.h:541
MOBJECT b_sbar
Definition: DAS_Spatram.h:3057
MOBJECT r_sbar
Definition: DAS_Spatram.h:3057
int MObjectGetHeight(MOBJECT obj)
mtcl MTCL
MTColor.
MTColor white
#define R_A
Definition: KEYCODES.H:280
U32 NColors
Definition: Dildef.h:648
#define U_A
Definition: KEYCODES.H:278
MMouseEvent mouse
Definition: Mguidefs.h:832
int MObjectGetWidth(MOBJECT obj)
#define L_A
Definition: KEYCODES.H:281
#define E_BUTTON_PRESS
Definition: Mguidefs.h:275
#define E_KEY_PRESS
Definition: Mguidefs.h:274
MKeyEvent key
Definition: Mguidefs.h:831
void MScrollBarSetPos(MOBJECT p, long pos)
void MDrawBox(MOBJECT p, int x, int y, int w, int h, MTColor bgc)
int sel_cell
Definition: DAS_Spatram.h:3060
MOBJECT g_sbar
Definition: DAS_Spatram.h:3057
#define D_A
Definition: KEYCODES.H:279
dil DIL
int type
Definition: Mguidefs.h:829
int x
pointer x, y coordinates in event window
Definition: Mguidefs.h:616
MTColor drawarea_bgc
Definition: DAS_Spatram.h:3062
int sel_x
Definition: DAS_Spatram.h:3060
int sel_y
Definition: DAS_Spatram.h:3060
+ Here is the call graph for this function:

§ ColorMapResizeCB()

void ColorMapResizeCB ( MOBJECT  obj,
DRAWAREA_PREF pref,
void *  a_data 
)

Declared but not used.

Definition at line 816 of file DAS_Spat_ConfCBs.c.

References dil::Cfg, cfg::NColors, DRAWAREA_PREF::new_h, DRAWAREA_PREF::new_w, DRAWAREA_PREF::old_h, DRAWAREA_PREF::old_w, sel_x, and sel_y.

817 {
818  int n, new_hsize, new_wsize, old_hsize, old_wsize;
819 
820  n = (DIL.Cfg.NColors == 16 ? 4 : 16);
821  old_wsize = pref->old_w / n;
822  old_hsize = pref->old_h / n;
823  new_wsize = pref->new_w / n;
824  new_hsize = pref->new_h / n;
825  sel_x = (sel_x * new_wsize) / old_wsize;
826  sel_y = (sel_y * new_hsize) / old_hsize;
827  pref->new_w = new_wsize * n;
828  pref->new_h = new_hsize * n;
829 }
cfg Cfg
Definition: Dildef.h:678
U32 NColors
Definition: Dildef.h:648
dil DIL
int sel_x
Definition: DAS_Spatram.h:3060
int sel_y
Definition: DAS_Spatram.h:3060

§ ColorSaveCB()

void ColorSaveCB ( MOBJECT  o,
void *  o_data,
void *  a_data 
)

Declared but not used.

Definition at line 754 of file DAS_Spat_ConfCBs.c.

References b_c, ColorMapExposeCB(), frm3_dr1, g_c, MAllocCell(), PaletteMode, and r_c.

755 {
756  MAllocCell(r_c, g_c, b_c);
757 #ifdef WINDOWS
758 /*
759  * Windows palette is indirect, so it is
760  * necessary to redraw rectangles with a new color
761  */
762  if (PaletteMode)
763  ColorMapExposeCB(frm3_dr1, NULL, 0L);
764 #endif
765 }
int PaletteMode
Definition: DAS_Spat.c:158
MTColor MAllocCell(int r, int g, int b)
int b_c
Definition: DAS_Spatram.h:3060
int r_c
Definition: DAS_Spatram.h:3060
MOBJECT frm3_dr1
Definition: DAS_Spatram.h:3058
void ColorMapExposeCB(MOBJECT obj, MEvent *pexp, void *a_data)
Declared but not used.
int g_c
Definition: DAS_Spatram.h:3060
+ Here is the call graph for this function:

§ ColPickBackForeGCB()

void ColPickBackForeGCB ( MOBJECT  o,
void *  a,
void *  v 
)

select if the foreground or background color of the selected object will be picked

pick the color of the selected object

Parameters
v
  • 0 = background color
  • 1 = foreground color

Definition at line 167 of file DAS_Spat_ConfCBs.c.

References ColObjCB(), gui::ConfigPanel, DOASMODE, flag::exemode, False, das::Flag, FlgBG, FlgFG, das::Gui, configpanel::RBColObj, and True.

Referenced by MDCreateDASConfig().

168 {
169 //setta i flag foreground e background
170  int i;
171  switch ((int) v)
172  {
173  case 0:
174  FlgBG = True;
175  FlgFG = False;
176  break;
177  case 1:
178  FlgFG = True;
179  FlgBG = False;
180  break;
181  }
182  if (DAS.Flag.exemode == DOASMODE )
183  for (i = 0;i<7; i++)
184  ColObjCB(DAS.Gui.ConfigPanel.RBColObj[i], NULL, (void *) i);
185  else
186  for (i = 0;i<6; i++)
187  ColObjCB(DAS.Gui.ConfigPanel.RBColObj[i], NULL, (void *) i);
188 }
gui Gui
Graphic User Interface Structure.
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
#define False
Definition: Mguidefs.h:236
int FlgBG
Definition: DAS_Spat_Conf.c:91
MOBJECT RBColObj[7]
int FlgFG
Definition: DAS_Spat_Conf.c:92
das DAS
configpanel ConfigPanel
Configuration panel structure.
void ColObjCB(MOBJECT o, void *a, void *v)
select the object to consider for color picking
#define True
Definition: Mguidefs.h:235
int exemode
Set the Execution MODE (Execution modes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ColumnFCB()

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

Definition at line 164 of file DOAS_FullProj.c.

References ColFor_Sh, MDCreateColFor_Sh(), and MShellRealize().

Referenced by MDCreateDOAS_MainSh().

165 {
166 
169 
170 
171 
172 }
MOBJECT ColFor_Sh
Definition: DOAS_FullProj.c:57
void MShellRealize(MOBJECT obj)
MOBJECT MDCreateColFor_Sh(void)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ComErrors()

void ComErrors ( int  w)

Alerts for COM errors
Creates a message window reporting the number of the error.

Parameters
w= code of the error

Definition at line 164 of file Errors.c.

References palette::DB_BG, palette::DB_BG_Albl, palette::DB_FG_Albl, DPAL, HELV_SMALL, lbl, MCreateLabel(), MCreateShell(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MObjectSetShadow(), MShellRealize(), and WS_SHADOW_OUT.

Referenced by DB_InitMotor().

165 {
166  int c = w;
167  char buf[64];
168  MOBJECT sh, lbl;
169 
170 
171  switch (c)
172  {
173  case -1:
174  {
175  sprintf(buf, "IE_BADID");
176  break;
177  }
178  case -2:
179  {
180  sprintf(buf, "IE_OPEN");
181  break;
182  }
183  case -3:
184  {
185  sprintf(buf, "IE_NOPEN");
186  break;
187  }
188  case -4:
189  {
190  sprintf(buf, "IE_MEMORY");
191  break;
192  }
193  case -5:
194  {
195  sprintf(buf, "IE_DEFAULT");
196  break;
197  }
198  case -10:
199  {
200  sprintf(buf, "IE_HARDWARE");
201  break;
202  }
203  case -11:
204  {
205  sprintf(buf, "IE_BYTESIZE");
206  break;
207  }
208  case -12:
209  {
210  sprintf(buf, "IE_BAUDRATE");
211  break;
212  }
213  case -100:
214  {
215  sprintf(buf, "WSC_NO_DATA");
216  break;
217  }
218  case -101:
219  {
220  sprintf(buf, "WSC_RANGE ");
221  break;
222  }
223  case -102:
224  {
225  sprintf(buf, "WSC_ABORTED");
226  break;
227  }
228  case -103:
229  {
230  sprintf(buf, "WSC_WIN32ERR");
231  break;
232  }
233  case -104:
234  {
235  sprintf(buf, "WSC_EXPIRED");
236  break;
237  }
238  }
239 
240 
241  sh = MCreateShell("COM_Error", 0);
243 
244  lbl = MCreateLabel(sh, buf, HELV_SMALL);
247  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
248  MShellRealize(sh);
249 
250 
251 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lbl
Definition: DFileMan.c:42
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MShellRealize(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
palette DPAL
Definition: 2DPlot.c:27
#define HELV_SMALL
Definition: Mguidefs.h:881
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
void * MOBJECT
Definition: Mguidefs.h:192
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ConfigCB()

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

DAS Configuration shell creation callback.

Definition at line 2182 of file DAS_Spat_ConfCBs.c.

References MDCreateDASConfig().

2183 {
2184  MDCreateDASConfig();
2185 }
MOBJECT MDCreateDASConfig(void)
DAS Config shell. Procedure that build the shell for the DAS Config panels. The DAS Config allow for ...
+ Here is the call graph for this function:

§ D_AutoExecution()

void D_AutoExecution ( void  )

*.PRG Automatic Execution in Automatic Mode

Definition at line 560 of file RTC_Time.c.

References AAMEASURE, AAPOSIT, controlpanel::Albl_Azim, controlpanel::Albl_Elev, controlpanel::Albl_Script, ALMUCANTAR, AUTORNG, AVGCCD, AVGCCDHOR, AZIMUTH, BEGIN, CALIBRA, CHKEXLAMP, ChkMaster(), gui::ContrPanel, D_FixSZA(), D_WaitSZA(), DARKC, flag::DeltaSZA, DFMEASURE, das::DGeo, DIRECTSUN, E_AAMeasure(), E_AAPos(), E_Almucantar(), E_AutoRange(), E_Average(), E_AvgCCDHor(), E_Azimuth(), E_Calibra(), E_ChkExLamp(), E_Dark(), E_DeltaSZA(), E_DFMeasure(), E_DirectSun(), E_Expo(), E_ExtLampOFF(), E_ExtLampON(), E_ExtShutClose(), E_ExtShutOpen(), E_Filter(), E_GetCCD(), E_Hg_Off(), E_Hg_On(), E_HGratCal(), E_HgScan(), E_Home_SM1(), E_Home_SM2(), E_Home_SM3(), E_Home_SM4(), E_Home_SM5(), E_Home_SM6(), E_IRefSun(), E_Label(), E_Lambda(), E_Meashor(), E_Meashor2(), E_Measure(), E_Mirror(), E_NDFilter(), E_Plot(), E_Qj_Off(), E_Qj_On(), E_QjScan(), E_Radio(), E_REM(), E_Save(), E_SetCCDOffSet(), E_SetCCDPow(), E_SetCCDTemp(), E_SetCCDVBin(), E_WAIT(), E_Zenith(), ELAMPOFF, ELAMPON, master::eora, ESHUTCL, ESHUTOP, flag::exec, flag::ExeDSZA, flag::exemode, ExMast, EXPO, Fetch(), FILTER, das::Flag, GETCCD, GetDateTime(), das::Gui, H_AZI, H_FILTER, H_GRAT, H_GRAT_CAL, H_MIRROR, H_NDFW, H_ZEN, HG_OFF, HG_ON, HGSCAN, IREFSUN, LABEL, dsza::LastMSZA, d_geo::latitude, LoadExec(), d_geo::longitude, MainCommand, Master, MEASHOR, MEASHOR2, MEASURE, MIRROR, MMessageDialog(), MObjectSetText(), NDFILTER, on, PLOT, PrgNumExe, PrgNumInM, QJ_OFF, QJ_ON, QJSCAN, RADIO, omuthr::ReachTemp, REM, S_azim, S_zenetr, SAVE, SETCCDOFFS, SETCCDPOW, SETCCDTEMP, SETCCDVBIN, master::sora, Status(), flag::sza, SZACalc(), SZAMASTERM, SZAMODE, TEMPORIZED, TESTSZAMODE, time::ti_hour, time::ti_min, d_geo::timezone, WAIT, WAVELEN, XEND, and ZENITH.

Referenced by Task_AutoEx().

561 {
562 
563  struct time RTime;
564  struct date RDate;
565  struct tm today;
566  char buf[128];
567  static int mrun = 0;
568  float DecTimeStart;
569  float DecTimeStop;
570  float DecActTime;
571 
572 //int PrgNumInM = 0; ///< Actual number of PRG File in current MASTER or MASTERSZA File
573 //int PrgNumExe = 0; ///< number of PRG file in execution
574 /*************************/
575  char str[80];
576  int er;
577 // char timebuf[9];
578 // char datebuf[9];
579 // long dp = 500;
580  struct tm newtime;
581 // long ltime;
582  float t_acc = 0;
583 // int sunrs;
584 // int sunsm;
585 
586 // _strdate(datebuf);
587 
588 // time( &ltime );
589 // _strtime(timebuf);
590 // time( &ltime );
591 
592 // newtime = localtime( &ltime );
593 
594  /**************************************************************/
595  // Check if daylight saving time is in effect
596  // tm_isdst > 0 if daylight saving time is in effect
597  // tm_isdst = 0 if daylight saving time is not in effect
598  // tm_isdst < 0 if status of daylight saving time is unknown.
599 // if (newtime ->tm_isdst)
600 // newtime ->tm_hour = newtime ->tm_hour - 1;
601  //NOTE - In Daylight saving period on midnight the hours became -1 so...
602 // if((newtime -> tm_hour) == -1)
603  {
604  // Necessary for measurements performed at high latitude in summer seasons
605 // newtime->tm_hour = 23;
606 // newtime -> tm_yday = newtime -> tm_yday - 1;
607  }
608 
609  /**************************************************************/
610  GetDateTime(&RDate, &RTime, &newtime);
611 
612  /**************************************************************/
613  // Calc solar Zenith Angle (SZA)
614 // er = SZACalc(DAS.DGeo.latitude, DAS.DGeo.longitude, (float) DAS.DGeo.timezone, newtime ->tm_year + 1900,
615 // newtime -> tm_yday, newtime ->tm_hour, newtime ->tm_min, newtime ->tm_sec,
616 // 0, 1024, 0, 0);
617 
619  newtime.tm_year + 1900,
620  newtime.tm_yday, newtime.tm_hour, newtime.tm_min, newtime.tm_sec,
621  0, 1024, 0, 0);
622 
623  /**************************************************************/
624  sprintf(str, "%.1lf", 90 - S_zenetr); //S_elevref = elevation refracted
626 
627  sprintf(str, "%.1lf", S_azim);
629 
630 
631 
632 /****************************/
633 
634 
635  //gettime(&RTime);
636  GetDateTime(&RDate, &RTime, &today);
637  if(Master)
638  {
639  if(DAS.Flag.exemode == TEMPORIZED)
640  {
641 
642  if(mrun == 0)
643  {
644 
645  // check for the next available prg
646  PrgNumExe = ChkMaster(0);
647  // Time to decimal time
648  DecActTime = RTime.ti_hour + ((float)RTime.ti_min / 60);
649  DecTimeStart = ExMast[PrgNumExe].sora + ((float) ExMast[PrgNumExe].smin / 60) + ((float) ExMast[PrgNumExe].ssec / 3600);
650  DecTimeStop = ExMast[PrgNumExe].eora + ((float) ExMast[PrgNumExe].emin / 60) + ((float) ExMast[PrgNumExe].esec / 3600);
651 
652  if((DecActTime >= DecTimeStart) && (DecActTime <= DecTimeStop))
653  //if(ExMast[PrgNumExe].sora == (int) RTime.ti_hour &&
654  // ExMast[PrgNumExe].smin <= (int) RTime.ti_min)
655  {
656  on = LoadExec(ExMast[PrgNumExe].prg);
657  mrun = 1;
658  sprintf(buf,"%s",ExMast[PrgNumExe].prg );
660  }
661  }
662  else //mrun = 1
663  {
664 // if(ExMast[PrgNumExe].eora == (int) RTime.ti_hour &&
665 // ExMast[PrgNumExe].emin <= (int) RTime.ti_min)
666  // Time to decimal time
667  DecActTime = RTime.ti_hour + ((float)RTime.ti_min / 60);
668  DecTimeStart = ExMast[PrgNumExe].sora + ((float) ExMast[PrgNumExe].smin / 60) + ((float) ExMast[PrgNumExe].ssec / 3600);
669  DecTimeStop = ExMast[PrgNumExe].eora + ((float) ExMast[PrgNumExe].emin / 60) + ((float) ExMast[PrgNumExe].esec / 3600);
670 
671  if((DecActTime < DecTimeStart) || (DecActTime > DecTimeStop))
672 
673  {
674  on = 0;
675  mrun = 0;
676  //PrgNumExe = ChkMaster(0);
677  sprintf(buf,"MASTER-Wait");
679 // if(PrgNumExe > PrgNumInM || ExMast[PrgNumExe].prg == NULL)
680 // PrgNumExe = 0;
681  }
682  }
683  }
684  else if (DAS.Flag.exemode == SZAMASTERM)
685  {
686  /*********************************************************************************************/
687  //SZAMASTERM Mode 1
688  /*********************************************************************************************/
689  // This part of code take into account the different slope of the SZA function from
690  // the local noon to the local midnigth and from the local midnight to the local noon.
691  // It allows also the the execution of a MASTERSZA file where can appear different PRG
692  // files for the AM and PM Measurements
693  // FORMAT MASTERSZA: Start SZA, End SZA , PRG file
694  // (i.e.) 100.00 88.00 a.prg
695  // 87.99 70.00 e.prg
696  // 69.99 0.00 b.prg
697  // 0.00 87.99 b.prg
698  // 88.00 100.00 a.prg
699  // 100.01 180.00 c.prg
700  // 180.00 100.01 c.prg
701  // TO BE DONE: the conditions "<=12" and ">12" have to be replaced with something
702  // indicating the real time of local noon and local midnight ( I have to calculate
703  // the "effemeridis" at the begining of the program and each time the date change!!!)
704  if(mrun == 0)
705  {
706  if((int) RTime.ti_hour <= 12)
707  {
708  //Actual SZA between Start SZA and End SZA
709  if ( ((int)(S_zenetr * 100) < (int)(ExMast[PrgNumExe].ssza * 100))
710  && ((int)(S_zenetr * 100) > (int)(ExMast[PrgNumExe].esza * 100)) )
711  {
712  on = LoadExec(ExMast[PrgNumExe].prg);
713  mrun = 1;
714  sprintf(buf,"%s",ExMast[PrgNumExe].prg );
716  }
717  }
718  if((int) RTime.ti_hour > 12)
719  {
720  if ( ((int)(S_zenetr * 100) > (int)(ExMast[PrgNumExe].ssza * 100))
721  && ((int)(S_zenetr * 100) < (int)(ExMast[PrgNumExe].esza * 100)) )
722  {
723  on = LoadExec(ExMast[PrgNumExe].prg);
724  mrun = 1;
725  sprintf(buf,"%s",ExMast[PrgNumExe].prg );
727  }
728  }
729  }
730  else //mrun=1
731  {
732  if((int) RTime.ti_hour <= 12)
733  {
734  if ( ((int)(S_zenetr * 100) > (int)(ExMast[PrgNumExe].ssza * 100))
735  || ((int)(S_zenetr * 100) < (int)(ExMast[PrgNumExe].esza * 100)) )
736  {
737  on = 0;
738  mrun = 0;
739  PrgNumExe = ChkMaster(1);
740  sprintf(buf,"MASTERSZA-Wait");
742  if(PrgNumExe > PrgNumInM || ExMast[PrgNumExe].prg == NULL)
743  PrgNumExe = 0;
744  }
745  }
746  if((int) RTime.ti_hour > 12)
747  {
748  if ( ((int)(S_zenetr * 100) < (int)(ExMast[PrgNumExe].ssza * 100))
749  || ((int)(S_zenetr * 100) > (int)(ExMast[PrgNumExe].esza * 100)) )
750  {
751  on = 0;
752  mrun = 0;
753  PrgNumExe = ChkMaster(1);
754  sprintf(buf,"MASTERSZA-Wait");
756  if(PrgNumExe > PrgNumInM || ExMast[PrgNumExe].prg == NULL)
757  PrgNumExe = 0;
758  }
759  }
760  }
761  }
762  /*********************************************************************************************/
763  /*********************************************************************************************/
764  else if ((DAS.Flag.exemode == SZAMODE) | (DAS.Flag.exemode == TESTSZAMODE))
765  {
766  /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
767  //SZAMASTERM Mode 2
768  /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
769 
770  // This part of code instead doesn't consider the different slope of the SZA Function
771  // The scheduled PRG files can be specified in any order, and they will be executed
772  // when the Actual SZA is between SZAMax and SZAMin (S_zenetr > ssza & S_zenetr < esza)
773  // but when the PRG file changes (the SZAs condition are not satisfied) I have to
774  // look for the following available scheduled PRG. This means that I can't increase the
775  // "PrgNumExe" of 1, but I have to scan all the entries in the MASTERSZA.
776  // The main advantege of this mode is the possibility to write the half of record in the
777  // MASTERSZA file, but the measurements will be the same in the 24 hours.
778  // More over I don't have to use something like
779  // "88.00 0.00 namefileprg
780  // 0.00 88.00 namefileprg"
781  // to ensure the continuity of measurements during the day
782  //
783  // FORMAT MASTERSZA: SZA Min, SZA Max, PRG file
784  // (i.e.) 20.00 90.00 a.prg
785  // 90.01 100.00 b.prg
786  // 100.01 180 c.prg
787  // When the SZA is between 20 and 90 degrees DAS will execute the a.prg table (Daylight measurements)
788  // When the SZA is between 90.01 and 100.00 degrees DAS will execute the b.prg table (twilight measurements)
789  // When the SZA is between 100.01 and 180.00 degrees DAS will execute the c.prg table (night measurements)
790 
791  if(mrun == 0)
792  {
793  // check for the next available prg
794  PrgNumExe = ChkMaster(2);
795 
796  if ( ((int)(S_zenetr * 100) > (int)(ExMast[PrgNumExe].minsza * 100))
797  && ((int)(S_zenetr * 100) < (int)(ExMast[PrgNumExe].maxsza * 100)) )
798  {
799  on = LoadExec(ExMast[PrgNumExe].prg);
800  mrun = 1;
801  sprintf(buf,"%s",ExMast[PrgNumExe].prg );
803  }
804  }
805  else //mrun = 1
806  {
807  if ( ((int)(S_zenetr * 100) < (int)(ExMast[PrgNumExe].minsza * 100))
808  || ((int)(S_zenetr * 100) > (int)(ExMast[PrgNumExe].maxsza * 100)) )
809  {
810  on = 0;
811  mrun = 0;
812  sprintf(buf,"SZA MODE Wait");
814  }
815 
816  }
817  /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
818  }
819 
820  }
821 
822 /*
823 Il flag ExeDSZA all'inizio deve essere 1
824 
825  si entra nel ciclo e sicuramente esegue un ciclo di prg (fino a BEGIN)
826  poi BEGIN mette il flag ExeDSZA a zero se il SZA e' tra il massimo e il minimo di
827  SZA (E_DeltaSZA).
828  al successivo passaggio nell'autoexecution se ExeDSZA = 0 esegue il FixNextSZA e
829  fissa il SZA della prossima misura (NextSZA) e mette il flag ExeDSZA = -1.
830  Al successivo passaggio se il Flag ExeDSZA = -1 esegue il CheckSZA che mette a 1 il
831  Flag se il SZA e' uguale al NextSZA
832 
833 
834 
835 */
836 // DAS.Flag.ExeDSZA = 0;
837  if(DAS.Flag.DeltaSZA == 1)
838  {
839  if (DAS.Flag.ExeDSZA == 1) //PRG Execution
840  {
841  //Store last SZA
843  }
844  else if (DAS.Flag.ExeDSZA == 0)//Fix next SZA
845  {
846  D_FixSZA();
847  }
848  else if (DAS.Flag.ExeDSZA == -1) //Waiting next SZA
849  {
850  D_WaitSZA();
851 
852  }
853  else
854  {
855  MMessageDialog("DAS information", "Unknow value for DAS.Flag.ExeDSZA" , "OK", NULL);
856  }
857  }
858  else
859  //DAS.Flag.ExeDSZA = 1;
860 
861  // A background task or an event can launch a procedure initializing the
862  // variable MainCommand
863 
864  // Temperature of the CCD
865  // If the following instruction is commented the measdurements are carried out only
866  // when the CCD reach the working temperature, otherwise the measurements are
867  // performed continuosly
868  OMUTHR.ReachTemp = 1;
869 
870  //if(on && (OMUTHR.ReachTemp == 1) && FLAG.sza && FLAG.exec && (DAS.Flag.ExeDSZA == 1))
871  if(on && FLAG.sza && FLAG.exec && (DAS.Flag.ExeDSZA == 1))
872  {
873  /* if((SaveCnt % CHECKDGR) == 0)
874  MainCommand = QJSCAN;
875  else if ((SaveCnt % SCHEDHGRAT) == 0)
876  {
877  MainCommand = H_GRAT_CAL;
878  SaveCnt++;
879  }
880  else
881  */
882 
883  MainCommand = Fetch();
884 
885 
886  if(MainCommand)
887  {
888  // List of the activable procedures
889  switch(MainCommand)
890  {
891 
892  case AUTORNG: on = MainCommand = 0; E_AutoRange(); on = 1; break; // 1
893  case AVGCCD: on = MainCommand = 0; E_Average(); on = 1; break; // 2
894  case BEGIN: MainCommand = 0; E_DeltaSZA(); break; // 3
895  case CALIBRA: on = MainCommand = 0; E_Calibra(); on = 1; break; // 4
896  case DARKC: on = MainCommand = 0; E_Dark(); on = 1; break; // 5
897  case EXPO: on = MainCommand = 0; E_Expo(); on = 1; break; // 6
898  case FILTER: on = MainCommand = 0; E_Filter(); on = 1; break; // 7
899  case GETCCD: on = MainCommand = 0; E_GetCCD(); on = 1; break; // 8
900  case H_FILTER: on = MainCommand = 0; E_Home_SM3(); on = 1; break; // 9
901  case H_GRAT: on = MainCommand = 0; E_Home_SM2(); on = 1; break; // 10
902  case H_MIRROR: on = MainCommand = 0; E_Home_SM1(); on = 1; break; // 11
903  case HG_OFF: on = MainCommand = 0; E_Hg_Off(); on = 1; break; // 12
904  case HG_ON: on = MainCommand = 0; E_Hg_On(); on = 1; break; // 13
905  case LABEL: on = MainCommand = 0; E_Label(); on = 1; break; // 14
906  case MEASURE: on = MainCommand = 0; E_Measure(); on = 1; break; // 15
907  case MEASHOR: on = MainCommand = 0; E_Meashor(); on = 1; break; // 16
908  case MIRROR: on = MainCommand = 0; E_Mirror(); on = 1; break; // 17
909  case PLOT: on = MainCommand = 0; E_Plot(); on = 1; break; // 18
910  case QJ_OFF: on = MainCommand = 0; E_Qj_Off(); on = 1; break; // 19
911  case QJ_ON: on = MainCommand = 0; E_Qj_On(); on = 1; break; // 20
912  case RADIO: on = MainCommand = 0; E_Radio(); on = 1; break; // 21
913  case REM: on = MainCommand = 0; E_REM(); on = 1; break; // 22
914  case SAVE: on = MainCommand = 0; E_Save(); on = 1; break; // 23
915  case WAIT: on = MainCommand = 0; E_WAIT(); on = 1; break; // 24
916  case WAVELEN: on = MainCommand = 0; E_Lambda(); on = 1; break; // 25
917  case XEND: MainCommand = 0; Status("End"); on = 0; break; // 26
918  case ELAMPON: on = MainCommand = 0; E_ExtLampON(); on = 1; break; // 27
919  case ELAMPOFF: on = MainCommand = 0; E_ExtLampOFF(); on = 1; break; // 28
920  case ESHUTOP: on = MainCommand = 0; E_ExtShutOpen(); on = 1; break; // 29
921  case ESHUTCL: on = MainCommand = 0; E_ExtShutClose(); on = 1; break; // 30
922  case H_ZEN: on = MainCommand = 0; E_Home_SM5(); on = 1; break; // 31
923  case H_AZI: on = MainCommand = 0; E_Home_SM6(); on = 1; break; // 32
924  case ZENITH: on = MainCommand = 0; E_Zenith(); on = 1; break; // 33
925  case AZIMUTH: on = MainCommand = 0; E_Azimuth(); on = 1; break; // 34
926  case AAMEASURE:on = MainCommand = 0; E_AAMeasure(); on = 1; break; // 35
927  case AVGCCDHOR:on = MainCommand = 0; E_AvgCCDHor(); on = 1; break; // 36
928  case CHKEXLAMP:on = MainCommand = 0; E_ChkExLamp(); on = 1; break; // 37
929  case AAPOSIT :on = MainCommand = 0; E_AAPos(); on = 1; break; // 38
930  case IREFSUN :on = MainCommand = 0; E_IRefSun(); on = 1; break; // 39
931  case MEASHOR2 :on = MainCommand = 0; E_Meashor2(); on = 1; break; // 40
932  case SETCCDTEMP :on = MainCommand = 0; E_SetCCDTemp(); on = 1; break; // 41
933  case SETCCDVBIN :on = MainCommand = 0; E_SetCCDVBin(); on = 1; break; // 42
934  case SETCCDPOW :on = MainCommand = 0; E_SetCCDPow(); on = 1; break; // 43
935  case NDFILTER :on = MainCommand = 0; E_NDFilter(); on = 1; break; // 44
936  case H_NDFW :on = MainCommand = 0; E_Home_SM4(); on = 1; break; // 45
937  case DFMEASURE :on = MainCommand = 0; E_DFMeasure(); on = 1; break; // 46
938  case SETCCDOFFS :on = MainCommand = 0; E_SetCCDOffSet();on = 1; break; // 47
939  case QJSCAN :on = MainCommand = 0; E_QjScan(); on = 1; break; // 48
940  case H_GRAT_CAL :on = MainCommand = 0; E_HGratCal(); on = 1; break; // 49
941  case HGSCAN :on = MainCommand = 0; E_HgScan(); on = 1; break; // 49
942  case ALMUCANTAR :on = MainCommand = 0; E_Almucantar(); on = 1; break; // 51
943  case DIRECTSUN :on = MainCommand = 0; E_DirectSun(); on = 1; break; // 52
944  /*
945  case 100: MainCommand = 0; on = 0; // 26
946  Status("PROGRAM HALTED"); break;
947  case 101: MainCommand = 0; on = 1; break; // 27
948  */
949 
950  }
951 
952  }
953 
954  }
955 }
#define ELAMPOFF
External Lamp OFF.
#define H_NDFW
Home for ND FilterWheel.
gui Gui
Graphic User Interface Structure.
void E_NDFilter(void)
Set ND Filter. Set ND Filter All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:429
void E_DeltaSZA(void)
Re-Start or Stop the execution of the PRG file (depending on the SZA) If the measurements at fixed de...
Definition: RTC_Time.c:436
double S_zenetr
Definition: SOLPOS.C:92
void E_Meashor2(void)
perform horizontal measurements (2) 1) measurement with external lamp 2) measurement without the exte...
Definition: Exec.c:1370
#define LABEL
text after this command is displayed in the status label
void E_Filter(void)
Filter Wheel positioning. Procedure for Filter Wheel positioning. All the E_xxxxx() function are used...
Definition: Exec.c:761
#define SETCCDVBIN
SET the CCD vertical Binning.
void E_Hg_On(void)
HG ON. Hg lamp ON. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:246
void E_Lambda(void)
Lambda Reading. When the WAVELEN key-word is encountred in the PRG file, the Wavelength code from PRG...
Definition: Exec.c:718
#define H_GRAT_CAL
Perform home for the grating and executa a calibration.
#define H_ZEN
Home for zenith Axis.
void E_IRefSun(void)
Io Measured near the sun. This procedure carries out a measurements for the reference spectrum used i...
Definition: Exec.c:845
void E_DirectSun(void)
. All the E_xxxxx() function are used during the execution in PRG mode
Definition: Exec.c:1596
int E_Home_SM4(void)
Home for SM4. Set the reference position for Stepper motor 4 (Neutral density filter wheel)...
Definition: Exec.c:209
int Master
Definition: DAS_Spat.c:100
void E_WAIT(void)
Delay Procedure. sleep the program . All the E_xxxxx() function are used during the execution in PRG ...
Definition: Exec.c:731
double LastMSZA
SZA of the previous measurement.
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
#define AAMEASURE
Measuremets with Alt Azimut platform (stepper motors positioning simoultaneously) ...
#define AAPOSIT
Position the Alt Azimuth Platform.
int sza
= 1 -> perform measurements; = 0 -> waiting mode
int PrgNumExe
number of PRG file in execution
Definition: DAS_Spat.c:98
void E_Radio(void)
Radiometric Measurements. Procedure for Radiometric Measurements. All the E_xxxxx() function are used...
Definition: Exec.c:684
#define QJ_ON
QJ lamp on.
#define TESTSZAMODE
execution driven by SZAPRG file
double latitude
Station latitude.
int eora
End hour.
#define WAIT
stop the program execution for xx millisec
omuthr OMUTHR
Definition: RTC_Time.c:36
#define PLOT
display plot
flag Flag
Structure for different flags.
void E_Meashor(void)
perform horizontal measurements (3) 1) measurement with external lamp 2) measurement without the exte...
Definition: Exec.c:1280
#define HG_ON
HG lamp on.
void E_Label(void)
labeling. The text after the key-word is a label. All the E_xxxxx() function are used during the exec...
Definition: Exec.c:745
#define QJSCAN
Scan spectral range with QJ on.
int Fetch()
Reads the key-word in PRG Files .
Definition: DAS_Spat.c:298
void E_Hg_Off(void)
HG OFF. Hg lamp OFF. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:255
void E_AAPos(void)
alt Az Positioning. Available for SPATRAMPLUS and TROPOGAS (with the AltAzPlatform) ...
Definition: Exec.c:893
int E_Home_SM6(void)
Home for SM6. Set the reference position for Stepper motor 6 (MIGE Azimuth). All the E_xxxxx() functi...
Definition: Exec.c:182
#define CHKEXLAMP
Check External lamp status.
#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...
#define GETCCD
Performs a LIGHT Measurement (shutter opened)
int E_Home_SM5(void)
Home for SM5. Set the reference position for Stepper motor 5 (MIGE Zenith). All the E_xxxxx() functio...
Definition: Exec.c:168
void MObjectSetText(MOBJECT obj, const char *text)
#define IREFSUN
Io Measurement with AA Platform near the Sun.
void E_ExtLampON(void)
External lamp ON.
Definition: Exec.c:54
void E_Calibra(void)
Execute D_Calibra. D_Calibra is a procedure for the spectral calibration with HG lamp. Shift of HG spectral line at 4358.4 on pixel 512 All the E_xxxxx() function are used during the execution in PRG mode.
Definition: Exec.c:330
void D_FixSZA(void)
Definition: RTC_Time.c:467
d_geo DGeo
struct for Station location
MOBJECT Albl_Azim
Active Control Panel Labels for Sun Azimuth.
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
#define MEASHOR
horizontal measurements with external lamp (lamp,
void E_Azimuth(void)
Position Azimuth Axis.
Definition: Exec.c:1473
int timezone
Station timezone.
void E_HgScan(void)
Check the full spectral range with HG ON. All the E_xxxxx() function are used during the execution in...
Definition: Exec.c:1504
#define H_FILTER
Home for filter wheel.
#define WAVELEN
set the grating position
void E_Dark(void)
Execute Dark Measurement. Procedure for Dark Measurement. All the E_xxxxx() function are used during ...
Definition: Exec.c:279
void E_Qj_On(void)
Qj ON. QJ - Halogen - lamp ON. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:263
#define AUTORNG
Autoranging for optimal exposure time.
int E_GetCCD(void)
Get CCD. Execute DB_GetCCD. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:705
void E_ExtLampOFF(void)
External lamp OFF.
Definition: Exec.c:66
#define ESHUTCL
External Shutter CLOSED.
#define AZIMUTH
Positioning of Azimut Axis.
#define AVGCCDHOR
horizontal AVERAGED measurements with external lamp
void E_DFMeasure(void)
Perform Measurement setting the ND Filter Wheel also. All the E_xxxxx() function are used during the ...
Definition: Exec.c:911
int sora
Start hour.
MOBJECT Albl_Script
Active Control Panel Labels for Script in execution.
void E_SetCCDPow(void)
Set CCD Power. Set CCD Power. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:411
#define EXPO
Set the exposure time.
#define QJ_OFF
QJ lamp off.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void E_ChkExLamp(void)
Definition: Exec.c:1225
void E_Mirror(void)
Inpot Mirror positioning. Procedure for Input mirror positioning. All the E_xxxxx() function are used...
Definition: Exec.c:773
int DeltaSZA
= 1 Delta SZA measurements activated, = 0 Continous measurements
Definition: Dildef.h:240
void E_SetCCDTemp(void)
Set CCD Temp. Set CCD Temp. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:375
#define DARKC
Perform a DARK Measurement (shutter closed)
#define DIRECTSUN
#define SAVE
save the measurement in the predefined file
#define ELAMPON
External Lamp ON.
das DAS
DAS structure.
Definition: RTC_Time.c:34
#define FILTER
Set the filter position (0 - 6)
#define ZENITH
Positioning of zenith Axis.
#define MEASHOR2
Perform horizontal measurement.
void E_Average(void)
Averaged Measurements. Procedure for Averaged Measurements. All the E_xxxxx() function are used durin...
Definition: Exec.c:612
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
#define ALMUCANTAR
void D_WaitSZA(void)
Definition: RTC_Time.c:532
void E_Measure(void)
Perform Measurement. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:1060
flag FLAG
flags structure
Definition: RTC_Time.c:25
#define H_AZI
Home for Azimut Axis.
#define SETCCDOFFS
CCD Offset for HiresV.
int E_Home_SM2(void)
Home for SM2. Set the reference position for Stepper motor 2 (Grating). All the E_xxxxx() function ar...
Definition: Exec.c:139
#define SZAMODE
execution driven by SZAPRG file
int E_Home_SM3(void)
Home for SM3. Set the reference position for Stepper motor 3 (Filter Wheel). All the E_xxxxx() functi...
Definition: Exec.c:154
int MainCommand
Command switch in main loop.
Definition: DAS_Spat.c:105
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
#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)
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
#define SETCCDPOW
SET the CCD Power.
void E_Expo(void)
Exposuring. Read the Exposure time from PRG file. All the E_xxxxx() function are used during the exec...
Definition: Exec.c:365
controlpanel ContrPanel
Control Panel Structure.
#define MEASURE
Performs a measurement setting mirror, filter, grating, TExp...
void E_QjScan(void)
Check the full spectral range with QJ ON. All the E_xxxxx() function are used during the execution in...
Definition: Exec.c:1548
void E_HGratCal(void)
Perform home grating and HG Calibration. All the E_xxxxx() function are used during the execution in ...
Definition: Exec.c:1488
#define H_MIRROR
Home for Mirror.
void E_Save(void)
Save Image. Procedure for saving image or data. All the E_xxxxx() function are used during the execut...
Definition: Exec.c:355
double longitude
Station longitude.
int LoadExec(char *fname)
Load file for automatic execution. Procedure that load the file for automatic execution.
Definition: Load.c:1534
void E_Almucantar(void)
. All the E_xxxxx() function are used during the execution in PRG mode
Definition: Exec.c:1680
#define BEGIN
re-start the execution of the PRG file
void E_Zenith(void)
Position Zenith Axis.
Definition: Exec.c:1461
Definition: Dildef.h:234
int ExeDSZA
= 1 the measurements are performed, = 0 waiting for the next deltasza.
void E_SetCCDVBin(void)
Set CCD Vert Binn. Set CCD Vert Binn. All the E_xxxxx() function are used during the execution in PRG...
Definition: Exec.c:446
#define H_GRAT
Home for Grating.
void E_AutoRange(void)
Autoranging. Procedure for Autoranging. All the E_xxxxx() function are used during the execution in P...
Definition: Exec.c:342
#define XEND
stop the execution of the PRG file
int ChkMaster(int mod)
Definition: DAS_Spat.c:2730
void E_AAMeasure(void)
perform measurements with the Alt Azimuth Platform perform measurements with the Alt Azimuth Platform...
Definition: Exec.c:997
MOBJECT Albl_Elev
Active Control Panel Labels for Sun Elevation.
void E_SetCCDOffSet(void)
Set the CCD Offst (only for HIRES-V. All the E_xxxxx() function are used during the execution in PRG ...
Definition: Exec.c:394
#define RADIO
Unused.
void E_ExtShutClose(void)
Close External Shutter.
Definition: Exec.c:91
#define HG_OFF
HG lamp off.
#define SETCCDTEMP
SET the CCD working Temperature.
void E_AvgCCDHor(void)
Averaged Horizontal Measurements. Procedure for Averaged Measurements with external lamp...
Definition: Exec.c:538
#define HGSCAN
Scan spectral range with HG on.
master ExMast[PRGMAXNUM]
Definition: DAS_Spat.c:55
int on
PRG execution control variabile.
Definition: DAS_Spat.c:109
int exemode
Set the Execution MODE (Execution modes)
void E_Qj_Off(void)
Qj OFF. QJ - Halogen - lamp OFF. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:271
#define ESHUTOP
External Shutter OPEN.
void E_Plot(void)
Plot Spectrum. Plot Spectrum. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:237
dsza SZADelta
Definition: RTC_Time.c:32
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
int E_Home_SM1(void)
Home for SM1. Set the reference position for Stepper motor 1 (Input Mirror). All the E_xxxxx() functi...
Definition: Exec.c:111
#define MIRROR
set mirror position (0-3)
#define NDFILTER
SET the ND FilterWheel Position.
int ReachTemp
Target Temperature status.
#define AVGCCD
Averaged measurement.
#define REM
text after this is a comment
void E_ExtShutOpen(void)
Open External Shutter.
Definition: Exec.c:79
+ Here is the caller graph for this function:

§ D_Average()

void D_Average ( int  mod)

Performs averaged measurements
.

Parameters
mod= 1 –> perform AutoRanging, = 0 –> DO NOT PERFORM AutoRange

Definition at line 2655 of file Procedures.c.

References AutoRange(), optionini::avgautor, marconi::AVGmat, optionini::avgmode, BlindPix, DB_GetCCD(), DB_ScanMaxMin(), delay(), DI_Regen(), DIL, das::DOption, HGFlg, img::High, IDX, IDY, img::IHigh, img::ILow, img::Imat, dil::Img, img::Low, das::Marconi, image::Mat, MLoopWhileEvents(), MMessageDialog(), N_AVG, N_RM, QJFlg, Server, ShuttDelay, st, Status(), TExp, and TOTTEXP.

Referenced by DB_HorComm_CB(), DB_KeyB_CB(), and PerformMeas().

2657 {
2658  char buf[64];
2659  int c;
2660 // int fd;
2661  long n, np;
2662  double TT, DeadTime,availabletime;
2663  int NM; //Number of calculated/setted measurements
2664  //int NRM; // Number of measurements effectively obtained (without the saturated measurements that can occur
2665  int tmpnavg = 0;
2666 
2667  MOBJECT sh;
2668  int t, j;
2669  unsigned long st, et, x;
2670  struct tm today;
2671 
2672 
2673 
2674  if(mod) // perform autoranging
2675  {
2676  if(DAS.DOption.avgautor)
2677  AutoRange(0);
2678  else
2679  {
2680  if (TExp==0)
2681  MMessageDialog("DAS information", "TExp = 0\nThe Average procedure can NOT be executed\nPlease provide a valid TExp\n(Executing a GetCCD or Autoranging)!!", " Ok ", NULL);
2682  return ;
2683  }
2684  }
2685 
2686  //DAS.Marconi.AVGmat = AllocFloatMat(IDX, IDY);
2687  np = IDX * IDY;// * 2;
2688  //memset(DAS.Marconi.AVGmat, 0, np);
2689  for(n = 0; n < np; n++)
2690  DAS.Marconi.AVGmat[n] = 0;
2691 
2692  // Fix Number of Measurements
2693  if(DAS.DOption.avgmode == 0)
2694  {
2695 
2696  tmpnavg = N_AVG;
2697  if(TExp > 0.5 && TExp <= 1.0) tmpnavg = 10;
2698  else
2699  if(TExp > 1.0) tmpnavg = 2;
2700 
2701  for(c = 0; c < tmpnavg; c++)
2702  {
2703  DB_GetCCD(1);
2704  MLoopWhileEvents(0);
2705  sprintf(buf,"Averaging #: %d", c+1);
2706  Status(buf);
2707 
2708 
2709  for(n = 0; n < np; n++)
2710  DAS.Marconi.AVGmat[n] += DIL.Img.Mat[Server].Imat[n];
2711  //AVGmat[n] += (long) DIL.Img.Mat[Server].Imat[n];
2712  delay(50);
2713  }
2714 
2715  for(n = 0; n < np; n++)
2716  DIL.Img.Mat[Server].Imat[n] = (DAS.Marconi.AVGmat[n] / tmpnavg);
2717  //DIL.Img.Mat[Server].Imat[n] = AVGmat[n] / tmpnavg;
2718 
2719 
2720 
2721 // if(DAS.DOption.measmode == 0) //Single
2722 // {
2726  DI_Regen(Server);
2727 // }
2728  Status("Ready");
2729 
2730  }
2731  //Fix TOT Exposure Time
2732  else if(DAS.DOption.avgmode == 1)
2733  {
2734  NM = 0;
2735  if(QJFlg)
2736  TT = 1;
2737  if(HGFlg)
2738  TT = 2;
2739  if(!HGFlg & !QJFlg)
2740  TT = TOTTEXP;
2741 
2742  //If there is a delay in the shutter opening, this is accounted for
2743  //in the computation of the number of measurements
2744  if(ShuttDelay > 0)
2745  DeadTime = (TT * (double) ShuttDelay/1000 );
2746  else
2747  DeadTime = 0;
2748 
2749 
2750  availabletime = TT - DeadTime;
2751 
2752  if (availabletime > 0)
2753  TT = availabletime;
2754  else
2755  TT = TT;
2756 
2757  //First computation of number of measurement
2758  NM = (int)(TT / (TExp + 0.5)); //0.5 is the average download time for each measurement
2759  // This is tested for SPATRAM2 instrument
2760 
2761 
2762 /*
2763  Computation of CCD reading time
2764  DTA Formula: RT (in ms)= (vp/vb)*Kv + (vp/vb)*(hp/hb)*Kh
2765  where:
2766  vp = vertical pixels number
2767  vb = vertical binning
2768  Kv = 0.024 for hires
2769  hp = horizontal pixels number
2770  hb = horizontal binning
2771  Kh = 0.0125
2772 
2773 */
2774 /* RT = (((float)DC_CCD.dy / (float)DAS.Paramini.VBin) * 0.024 + ((float)DC_CCD.dy / (float)DAS.Paramini.VBin) * DC_CCD.dx * 0.0125)/1000;
2775 
2776 
2777  if(TExp > RT)
2778  {
2779  RTot = NM * RT;
2780  TT = TT - RTot;
2781  //Second computation of number of measurement (after the correction due to the reading time
2782  NM = (int)(TT / TExp);
2783  }
2784 
2785 
2786 /*
2787  Computation of CCD downloading time ( in ms)
2788  DT = ((vp/vb)*(hp/hb))/KCCD
2789  where:
2790  vp = vertical pixels number
2791  vb = vertical binning
2792  hp = horizontal pixels number
2793  hb = horizontal binning
2794  KCCD = frequency of the CCD (Front = 40Khz; Back = 60Khz)
2795 */
2796 /* DT = (((float)DC_CCD.dy / (float)DAS.Paramini.VBin) * DC_CCD.dx) / 60000;
2797 
2798 // if(TExp > DT)
2799 // {
2800  DTot = NM * DT;
2801  TT = TT - DTot;
2802 // }
2803 
2804  //Third computation of number of measurement (after the correction due to the Downloading time
2805  NM = (int)(TT / TExp);
2806 
2807 */
2808  N_RM = NM;
2809  if(NM > 1)
2810  {
2811  for(c = 0; c < NM; c++)
2812  {
2813 
2814  //st = GetTickCount();
2815 
2816  DB_GetCCD(1);
2817  MLoopWhileEvents(0);
2818 
2819  //et = GetTickCount();
2820 
2821  //x = labs(et - st);
2822 
2823  //sprintf(buf, "%6.3lf", x - (TExp * 1000.0) );
2824  sprintf(buf,"Avg #: %d on %d. TotTExp: %d s", c+1, NM, TOTTEXP);
2825 
2826  Status(buf);
2827  // If the spectrum is saturated
2828  if ((DIL.Img.Mat[Server].IHigh > 65000) & (c != 0))
2829  {
2830  N_RM = N_RM - 1;
2831  }
2832  else
2833  {
2834 
2835  for(n = 0; n < np; n++)
2836  DAS.Marconi.AVGmat[n] += DIL.Img.Mat[Server].Imat[n];
2837  }
2838  }
2839 
2840  for(n = 0; n < np; n++)
2841  DIL.Img.Mat[Server].Imat[n] = ( DAS.Marconi.AVGmat[n] / N_RM);
2842 
2843 
2844 
2845 // if(DAS.DOption.measmode == 0) //Single
2846 // {
2850  DI_Regen(Server);
2851 // }
2852 
2853  }
2854  else //if(NM == 0 or NM ==1)
2855  {
2856 /* if(TExp > .5)
2857  {
2858  sh = MDCreateExpo("EXPOSURE");
2859  sprintf(buf, "%6.1lf", TExp);
2860  DI_WriteDigit(DAS.Marconi.LblExpP, buf);
2861  DI_WriteDigit(DAS.Marconi.LblExpD, buf);
2862  }
2863 */
2864  sprintf(buf,"Measuring with TExp = %3.1lf" , TExp);
2865  Status(buf);
2866 
2867  DB_GetCCD(1);
2868 
2869 /* GetDateTime(&DIL.Img.Mat[Server].DATE, &DIL.Img.Mat[Server].TIME, &today);
2870 
2871  st = GetTickCount();
2872  do
2873  {
2874  et = GetTickCount();
2875  x = labs(et - st);
2876  MLoopWhileEvents(1);
2877  //if((x % 10) == 0 && x > 0)
2878  if(x > 0)
2879  {
2880  sprintf(buf, "%6.1lf", TExp - x / 1000.0 );
2881  //sprintf(TTot, "%6.1lf", TExp );
2882  //ShowDown(buf, TTot);
2883 
2884  ShowDown(buf, 0);
2885 
2886 
2887  }
2888  }while(labs(et - st) < (TExp * 1000));
2889 */
2890 /* if(TExp > .5)
2891  {
2892  MShellUnrealize(sh);
2893  MShellDestroy(sh);
2894  }
2895 */
2896  N_RM = 1;
2897  }
2898  }
2899 
2900  Status("Ready");
2901 // D_Plot();
2902  //free(DAS.Marconi.AVGmat);
2903 
2904 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int Server
Definition: DAS_Spat.c:253
dil DIL
Definition: 2DPlot.c:26
void MLoopWhileEvents(int discard)
optionini DOption
Options for DAS execution.
C_DEF void DI_Regen(int s)
int QJFlg
Definition: DAS_Spatram.h:2969
U16 * Imat
Definition: Dildef.h:286
int avgautor
autoranging for averaged measurement, 0 = NO AutoR before average; 1 = AutoR before average; ...
img Mat[MAXIMG]
Definition: Dildef.h:552
image Img
Definition: Dildef.h:675
das DAS
DAS structure.
Definition: Procedures.c:47
double DB_ScanMaxMin(int w, float *mx, float *mi, int bp)
Find Max and Min values for the buffer of order w.
Definition: Procedures.c:1632
int avgmode
Flag to set Averaging mode: 0 = Repeat measurements for fixed number, 1 = Repeat measurements for fix...
int ShuttDelay
Definition: Procedures.c:255
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
float IHigh
Definition: Dildef.h:303
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
Definition: Procedures.c:899
int TOTTEXP
Total Exposure time in Averaging mode.
Definition: DAS_Spat.c:115
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
float ILow
Definition: Dildef.h:302
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
long * AVGmat
buffer for averaging measurements
static double st
Definition: SOLPOS.C:142
void * MOBJECT
Definition: Mguidefs.h:192
int N_RM
Number of measurements for Averaging mode in fixed exposure time mode.
Definition: DAS_Spat.c:114
int HGFlg
Definition: DAS_Spatram.h:2968
int BlindPix
Number of blind pixels (usefull for Dark Current)
Definition: DAS_Spat.c:120
int N_AVG
Number of measurements for Averaging mode in fixed number of meas. mode.
Definition: DAS_Spat.c:113
float Low
Definition: Dildef.h:294
float High
Definition: Dildef.h:295
marconi Marconi
CCD Sensor struct.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_AverageTFix()

void D_AverageTFix ( void  )

NOT Used
.

Definition at line 2597 of file Procedures.c.

References AutoRange(), marconi::AVGmat, D_Plot(), DB_GetCCD(), DIL, HGFlg, IDX, IDY, img::Imat, dil::Img, das::Marconi, image::Mat, QJFlg, Server, Status(), and TExp.

2598 {
2599 
2600  char buf[64];
2601  int c;
2602 // int fd;
2603  long n, np;
2604  double TT;
2605  int NM;
2606 
2607  NM = 0;
2608 
2609  if(QJFlg)
2610  TT = 1;
2611  if(HGFlg)
2612  TT = 2;
2613  if(!HGFlg & !QJFlg)
2614  TT = 15;
2615 
2616 
2617  AutoRange(0);
2618 
2619 
2620  NM = (int)(TT / TExp);
2621 
2622  np = (long) IDX * IDY * 2;
2623 
2624  DAS.Marconi.AVGmat = malloc(np * 4);
2625  memset(DAS.Marconi.AVGmat, 0, np * 4);
2626 
2627 
2628  if(NM > 0)
2629  {
2630  for(c = 0; c < NM; c++)
2631  {
2632  DB_GetCCD(1);
2633  sprintf(buf,"Averaging #: %d on %d", c, NM);
2634  Status(buf);
2635  for(n = 0; n < np; n++)
2636  DAS.Marconi.AVGmat[n] += (long) DIL.Img.Mat[Server].Imat[n];
2637  }
2638 
2639  for(n = 0; n < np; n++)
2640  DIL.Img.Mat[Server].Imat[n] = (unsigned short) DAS.Marconi.AVGmat[n] / NM;
2641 
2642  }
2643  if(NM == 0)
2644  {
2645  DB_GetCCD(1);
2646  }
2647 
2648  D_Plot();
2649 
2650  free(DAS.Marconi.AVGmat);
2651 
2652 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int Server
Definition: DAS_Spat.c:253
dil DIL
Definition: 2DPlot.c:26
int QJFlg
Definition: DAS_Spatram.h:2969
U16 * Imat
Definition: Dildef.h:286
void D_Plot(void)
ViewPlot callback .
Definition: Procedures.c:192
img Mat[MAXIMG]
Definition: Dildef.h:552
image Img
Definition: Dildef.h:675
das DAS
DAS structure.
Definition: Procedures.c:47
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
Definition: Procedures.c:899
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
long * AVGmat
buffer for averaging measurements
int HGFlg
Definition: DAS_Spatram.h:2968
marconi Marconi
CCD Sensor struct.
+ Here is the call graph for this function:

§ D_BuildH()

void D_BuildH ( int  mod,
int  s 
)

Build Header of the measurements .
.

Parameters
mod
  • 0 = ASCII Header
  • 1 = BINARY Header
s
  • 0, 1 = Buffer ccd identifier

Definition at line 63 of file Procedures.c.

References d_geo::alititude, optionini::avgmode, hdrsp::bincomment, hdrsp::binfilpos, hdrsp::binmirpos, hdrsp::ccdnr, marconi::CCDTemp, hdrsp::ccdtemp, hdrsp::ccdtexp, hdrsp::ccdvbin, paramini::ccdWx, hdrsp::ccdwx, paramini::ccdWy, hdrsp::ccdwy, hdrsp::ccdxe, paramini::ccdXoff, hdrsp::ccdxs, hdrsp::ccdye, paramini::ccdYoff, hdrsp::ccdys, hdrsp::comment, img::DATE, hdrsp::DATE, das::DGeo, DIL, das::DOption, hdrsp::dummy1, hdrsp::dummy2, hdrsp::dummy3, hdrsp::dummy4, ccd::dx, ccd::dy, paramini::EqType, FDOUBLE, Fil_Code, Fil_Code8H, Fil_CodeNG, Fil_CodeNG1, Fil_CodeTropo, hdrsp::filpos, optionini::filtertype, FPLUS, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, img::High, dil::Img, hdrsp::imgfmt, hdrsp::imgmax, hdrsp::imgmin, hdrsp::lambda, d_geo::latitude, LIS_, d_geo::longitude, img::Low, das::Marconi, image::Mat, optionini::measmode, Mir_Code, Mir_CodeTropo, hdrsp::mirpos, N_AVG, N_RM, das::Paramini, FilterWheelSt::Pos, NDFilterWheelSt::Pos, MirrorSt::Pos, AzimuthSt::realazpos, ZenithSt::realzenpos, hdrsp::s_alt, hdrsp::s_latitude, hdrsp::s_longitude, d_geo::s_name, hdrsp::s_name, hdrsp::s_sza, S_zenetr, optionini::savingmode, Server, SPATRAM3, TExp, img::TIME, hdrsp::TIME, TMFlg, TROPOGAS, paramini::VBin, wl, and GratingSt::Wl.

Referenced by DB_GetCCD(), and DB_Save().

64 {
65 
66  char buf[16];
67  // Image format
69  HDRSP.imgfmt=1;
70  else
71  HDRSP.imgfmt=0;
72 
73  HDRSP.ccdwx = DC_CCD.dx; //X Pixel Number
74  HDRSP.ccdwy = DC_CCD.dy; //Y Pixel Number
75 
76 
77  HDRSP.ccdxs = DAS.Paramini.ccdXoff; // window X Start
78  HDRSP.ccdys = DAS.Paramini.ccdYoff; // windowY Start
79  HDRSP.ccdxe = DAS.Paramini.ccdWx; // windowX End
80  HDRSP.ccdye = DAS.Paramini.ccdWy; // windowY End
81 
82  HDRSP.ccdvbin = DAS.Paramini.VBin; //Vertical Binning
86 
87 
88  if(mod) //binary
89  {
91  sprintf(buf, "%s",Mir_CodeTropo[MIS.Pos]);
92  else
93  sprintf(buf, "%s",Mir_Code[MIS.Pos]);
94 
95 
96  sprintf(HDRSP.binmirpos, buf);
97  }
98  else
99  {
101  sprintf(buf, "%s",Mir_CodeTropo[MIS.Pos]);
102  else
103  sprintf(buf, "%s",Mir_Code[MIS.Pos]);
104 
105 
106  sprintf(HDRSP.mirpos, buf);
107  }
108  HDRSP.lambda = wl[GRS.Wl];
109 
110  if(mod)
111  {
112  if(DAS.Paramini.EqType == LIS_)
113  sprintf(HDRSP.binfilpos, Fil_Code8H[FWS.Pos]);
114  else
115  {
116  if(DAS.Paramini.EqType == TROPOGAS)
117  sprintf(HDRSP.binfilpos, Fil_CodeTropo[FWS.Pos]);
119  sprintf(HDRSP.binfilpos, Fil_CodeNG[FWS.Pos]);
120  else if (DAS.Paramini.EqType == GASCODNG1)
121  sprintf(HDRSP.binfilpos, Fil_CodeNG1[FWS.Pos]);
122  else
123  sprintf(HDRSP.binfilpos, Fil_Code[FWS.Pos]);
124  }
125  }
126  else
127  {
128  if(DAS.Paramini.EqType == LIS_)
130  else
131  {
132  if(DAS.Paramini.EqType == TROPOGAS)
136  else if (DAS.Paramini.EqType == GASCODNG1)
137  sprintf(HDRSP.binfilpos, Fil_CodeNG1[FWS.Pos]);
138  else
140  }
141  }
142 
144 
145  HDRSP.ccdtexp = (float) TExp;
146  HDRSP.imgmax = (unsigned int) DIL.Img.Mat[s].High;
147  HDRSP.imgmin = (unsigned int) DIL.Img.Mat[s].Low;
148 /* HDRSP.imgavg =
149  HDRSP.imgsig =
150 */
151  HDRSP.dummy1 = (int)(ZST.realzenpos * 100); //elevation angle
152  HDRSP.dummy2 = (int)(AST.realazpos * 100); //azimuth angle
153 
154 
156  HDRSP.dummy3 = NDFWS.Pos;
157  else if(DAS.DOption.filtertype == FPLUS)
158  HDRSP.dummy3 = TMFlg;
159  else
160  HDRSP.dummy3 = 0;
161 
162  if(DAS.DOption.measmode == 1) //measuring with average
163  {
164  if(DAS.DOption.avgmode == 0)
165  HDRSP.dummy4 = N_AVG; // number of measurements in fixed number of measurements
166  else
167  HDRSP.dummy4 = N_RM; // number of measurements in fixed exposure time
168  }
169  else
170  HDRSP.dummy4 = 0;
171 
172  if(mod) //binary
173  sprintf(HDRSP.bincomment, "Default Comment");
174  else
175  HDRSP.comment = "Default Comment ";
176 
177  sprintf(HDRSP.s_name, "%s", DAS.DGeo.s_name);
178  HDRSP.s_latitude = (float)DAS.DGeo.latitude;
180  HDRSP.s_alt = (unsigned int) DAS.DGeo.alititude;
181  HDRSP.s_sza = (float)S_zenetr;
182 
183 
184  //Image Type, Camera Type, CCD Type, CCDWx, CCDWy, CCDXoff, CCDYoff, VBin
185  //Date, Time, MirrorPos, Lambda, Filter, TempCCD, T_Exp,
186  //Max, Min, Media, Deviazione, Dummy1, Dummy2, Dummy3, Dummy4
187  //Riga di commento
188 
189 }
int Pos
Filter Wheel current Position.
double S_zenetr
Definition: SOLPOS.C:92
int Server
Definition: DAS_Spat.c:253
dil DIL
Definition: 2DPlot.c:26
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
double alititude
Station altitude.
const char * Mir_Code[]
const char array for the realisation of the Mirrors buttons in the Mirror shell
Definition: DAS_Spat.c:231
hdrsp HDRSP
Definition: Procedures.c:32
unsigned int imgmin
Image minimum value.
Definition: Dildef.h:710
double realazpos
ccd DC_CCD
Definition: Procedures.c:29
int ccdwy
Total Number of Y Pixels.
Definition: Dildef.h:693
int ccdWx
CCD X End.
double latitude
Station latitude.
int ccdwx
Total Number of X Pixels.
Definition: Dildef.h:692
int dummy4
Definition: Dildef.h:716
int dummy3
Definition: Dildef.h:715
int Pos
Mirror Current Position.
struct date DATE
Registration date.
Definition: Dildef.h:701
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
int ccdys
Y Start.
Definition: Dildef.h:695
int ccdXoff
CCD X Start.
float ccdtemp
CCD Temperature.
Definition: Dildef.h:707
NDFilterWheelSt NDFWS
ND Filter Wheel.
Definition: Procedures.c:35
S16 dx
Num. of X pixels.
Definition: dcldef.h:1022
img Mat[MAXIMG]
Definition: Dildef.h:552
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
struct date DATE
Definition: Dildef.h:348
int ccdxe
X End.
Definition: Dildef.h:696
int TMFlg
Definition: DAS_Spatram.h:2972
image Img
Definition: Dildef.h:675
int Pos
Filter Wheel current Position.
das DAS
DAS structure.
Definition: Procedures.c:47
d_geo DGeo
struct for Station location
#define LIS_
Lampedusa Island Spectrometer - ENEA.
int ccdWy
CCD Y End.
int Wl
Grating Wavelength.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
unsigned int s_alt
station altitude
Definition: Dildef.h:722
float s_longitude
station longitude
Definition: Dildef.h:720
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
char s_name[4]
Station name.
float CCDTemp
Actual CCD Temperature.
struct time TIME
Registration time.
Definition: Dildef.h:700
#define FDOUBLE
double filter wheel
#define FPLUS
Filter Wheel Torque Motor.
char binmirpos[8]
Mirror position.
Definition: Dildef.h:703
int avgmode
Flag to set Averaging mode: 0 = Repeat measurements for fixed number, 1 = Repeat measurements for fix...
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
char * comment
comment
Definition: Dildef.h:717
int VBin
CCD Vertical Binning.
int imgfmt
Image format: 0 = ASCII, 1 = BIN.
Definition: Dildef.h:688
int dummy2
Definition: Dildef.h:714
int ccdnr
Row number (ccdyoff-ccdwx)/ccdvbin.
Definition: Dildef.h:699
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
float s_sza
sun solar zenith angles
Definition: Dildef.h:724
char bincomment[255]
comment
Definition: Dildef.h:718
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
FilterWheelSt FWS
Filter Wheel.
Definition: Procedures.c:34
#define GASCODNG4
GASCODNG 4.
char * Fil_CodeNG1[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrum...
Definition: DAS_Spat.c:213
float s_latitude
station latitude
Definition: Dildef.h:719
S16 dy
Num. of Y pixels.
Definition: dcldef.h:1023
#define SPATRAM3
SPATRAM3.
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
char binfilpos[5]
Filter position.
Definition: Dildef.h:706
const char * filpos
Filter position.
Definition: Dildef.h:705
ZenithSt ZST
Definition: Procedures.c:44
char s_name[4]
station localization
Definition: Dildef.h:721
char * Fil_Code[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:207
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
AzimuthSt AST
Definition: Procedures.c:45
char mirpos[8]
Mirror position.
Definition: Dildef.h:702
double longitude
Station longitude.
int ccdye
Y End.
Definition: Dildef.h:697
int measmode
measuring mode: 0 = Single; 1 = Averaged
int dummy1
Definition: Dildef.h:713
int ccdxs
X Start.
Definition: Dildef.h:694
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
struct time TIME
Definition: Dildef.h:347
double realzenpos
int EqType
Spectrometer Type.
int N_RM
Number of measurements for Averaging mode in fixed exposure time mode.
Definition: DAS_Spat.c:114
int lambda
wavelength value
Definition: Dildef.h:704
int N_AVG
Number of measurements for Averaging mode in fixed number of meas. mode.
Definition: DAS_Spat.c:113
float Low
Definition: Dildef.h:294
float ccdtexp
ccd Exposure time
Definition: Dildef.h:708
int ccdYoff
CCD Y Start.
GratingSt GRS
Grating.
Definition: Procedures.c:36
unsigned int imgmax
Image maximum value.
Definition: Dildef.h:709
float High
Definition: Dildef.h:295
MirrorSt MIS
Mirror.
Definition: Procedures.c:33
int ccdvbin
Vertical binning value.
Definition: Dildef.h:698
marconi Marconi
CCD Sensor struct.
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 caller graph for this function:

§ D_Calibra()

int D_Calibra ( void  )

Spectral Calibration
Procedure for the spectral calibration with HG lamp. Shift of HG spectral line at 4358.4 on pixel 512.

Definition at line 2313 of file Procedures.c.

References controlpanel::Albl_LS, AMS1, AutoRange(), BlindPix, gui::ContrPanel, D_Plot(), DB_GetCCD(), DB_StepMotor(), DBDEMO, delay(), DIL, GratingSt::dp, paramini::EqType, flag::exec, flag::exemode, ExeREM, das::Flag, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, das::Gui, HgLamp(), IDX, IDY, img::Imat, dil::Img, controlpanel::LedSM, LookforWl_X(), MANUAL, image::Mat, MMessageDialog(), MObjectSetText(), MPixmapSetImageFile(), das::Paramini, flag::plotW, PRGFILE, SaveCalib(), SD_FilterW(), SD_Grating(), SD_Mirror(), Server, stepm::SM_B, SM_stepr(), SPATRAM2, SPATRAM3, SPATRAMPLUS, Status(), stepm::step, das::StepM, SZAMODE, TESTSZAMODE, TROPOGAS, wl, and GratingSt::Wl.

Referenced by DB_HorComm_CB(), DB_KeyB_CB(), E_Calibra(), and E_HGratCal().

2314 {
2315 
2316 
2317  long n;
2318 // unsigned v;
2319  int x, y, px, DirCal, er = 0, c;
2320  int k;
2321  int PxHg;
2322  int exm;
2323 // int count, i;
2324  int PosRefWl;
2325 
2326  char buf[256];
2327  unsigned int mx;
2328 
2329  Status("Hg Calibration");
2330 
2332  SD_FilterW(0); //Hole
2334  SD_FilterW(1); //BG12
2335  if(DAS.Paramini.EqType == GASCODNG1)
2336  SD_FilterW(0); //Hole
2337  if(DAS.Paramini.EqType == GASCODNG4)
2338  SD_FilterW(2); //BG12F
2339 
2340 
2341 
2342  BlindPix = 0;
2343 // SaveCalib();
2344  if (IDX>=1024)
2345  BlindPix = IDX - 1024;
2346 
2347  PxHg = (IDX - BlindPix) / 2;
2348 
2349  exm = DAS.Flag.exemode;
2350 
2351 
2352  //PosRefWl = Lookfor4358();
2353  PosRefWl = LookforWl_X(4358);
2354  /************************************************************/
2355  if ((exm == DBDEMO) ||
2356  (exm == MANUAL) ||
2357  (FLAG.exec == 0 && exm == PRGFILE))
2358  {
2359 
2360  if (GRS.Wl != PosRefWl)
2361  {
2362  //If is not the 4358 spectral window
2363  sprintf(buf, "You are performing HG calibration in the %.1lf nm spectral window!!!\nUsually this operation is performed in the 435.8 nm window \nDo you want to continue ?", (double)wl[GRS.Wl]/10);
2364  er = MMessageDialog("DAS information", buf, "Yes, in this window", "Yes, but go to 435.8!", "Cancel Calibration", NULL);
2365  //if it was chosen to calibrate in the actual spectral window the filter is removed
2366  if (er==0)
2367  {
2368  SD_FilterW(0); //Hole
2369  }
2370 
2371  if (er == 1)
2372  {
2373 
2374  SD_Grating(PosRefWl); //Positioning at 4358 A
2375 
2376  }
2377  else if (er == 2)
2378  return 1;
2379  }
2380  }
2381  else if ((exm == DBDEMO) ||
2382  (exm == MANUAL) ||
2383  (FLAG.exec == 1 && exm == PRGFILE) ||
2384  (FLAG.exec == 1 && exm == TESTSZAMODE) ||
2385  (FLAG.exec == 1 && exm == SZAMODE))
2386 
2387  {
2388  ExeREM = 0;
2389  SD_Grating(PosRefWl); //Positioning at 4358 A
2390  ExeREM = 1;
2391 
2392 
2393  }
2394  /************************************************************/
2395 
2396  HgLamp(1);
2398  SD_Mirror(0);
2399  else
2400  SD_Mirror(2);
2401 
2402  sprintf(buf, "Wait 5 sec. for HG lamp Heating");
2403  Status(buf);
2404  delay(5000);
2405 // FlagCalibra = 1;
2406 
2407 
2408 
2409 
2410  for(c = 0; c < 10; c++)
2411  {
2412  sprintf(buf, "Guess %d", c+1);
2413  Status(buf);
2414 
2415 
2416  AutoRange(0);
2417 
2418  DB_GetCCD(1);
2419 
2420  //Save Calibration
2421  if (c==0)
2422  SaveCalib(0);
2423 
2424  y = IDY / 2 ;
2425 
2426 
2427  px = (IDX - BlindPix) / 2;
2428  mx = 5000;
2429  for(x = PxHg - 200; x < PxHg + 200; x++)
2430  {
2431  if(DIL.Img.Mat[Server].Imat[x + y * IDX] > mx)
2432  {
2433  px = x;
2434  mx = DIL.Img.Mat[Server].Imat[x + y * IDX];
2435  }
2436  }
2437  sprintf(buf, "Hg: %u, found at: %d", mx, px);
2438  Status(buf);
2439  delay(1000);
2440  if((px > (PxHg + 1)) || (px < (PxHg - 1))) //grosso
2441  {
2442 
2444  n = (PxHg - px) * (k/200-5) * 4; //4 e' il rapporto di riduzione
2445  // il 60
2446 
2447  if(n < 0)
2448  DirCal = 1;
2449  else
2450  DirCal = 0;
2451 
2452  n = labs(n);
2453  if(n & DirCal == 0) //si va verso l'UV
2454  n += GRS.dp; // add fixed step number for backlash recovery
2455  // Eseguo NStep
2456  if(n)
2457  {
2458  er = DB_StepMotor(AMS1, 1, n, DirCal);
2459  if (er)
2460  {
2461  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][1], "SYS\\ledGreen.bmp");
2462  }
2463  }
2464 
2465  //Se ci si e' mossi verso l'UV si fa il recupero del gioco
2466 
2467  if(n & DirCal == 0) // faccio recupero gioco
2468  {
2469  er=DB_StepMotor(AMS1, 1, GRS.dp, 1);
2470  if (er)
2471  {
2472  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][1], "SYS\\ledGreen.bmp");
2473  }
2474  }
2475 
2476  }
2477 
2478  else break;
2479  }
2480 
2481 
2482  HgLamp(0);
2483  MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[1], "4358");
2484 
2485  SaveCalib(0);
2486 
2487 // er = AMS_AzzeraCoord(AMS1, 1);
2488 // if(er) { Message("No Zero Coord Grating", er); }
2489 
2490 
2491  if(DAS.Flag.plotW)
2492  D_Plot();
2493 
2494 
2495 
2496  sprintf(buf, "Hg: %u, found at: %d", mx, px);
2497  Status(buf);
2498  delay(500);
2499 
2500  return 0;
2501 
2502 }
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
void HgLamp(int mod)
HG Lamp ON/OFF .
Definition: Spat_Device.c:2673
int Server
Definition: DAS_Spat.c:253
dil DIL
Definition: 2DPlot.c:26
int LookforWl_X(int x)
Definition: Procedures.c:2295
int ExeREM
Definition: DAS_Spat.c:143
int plotW
Flag for the plot display.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
#define TESTSZAMODE
execution driven by SZAPRG file
flag Flag
Structure for different flags.
U16 * Imat
Definition: Dildef.h:286
#define DBDEMO
execution in demo mode
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
void D_Plot(void)
ViewPlot callback .
Definition: Procedures.c:192
img Mat[MAXIMG]
Definition: Dildef.h:552
void MObjectSetText(MOBJECT obj, const char *text)
image Img
Definition: Dildef.h:675
das DAS
DAS structure.
Definition: Procedures.c:47
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
int Wl
Grating Wavelength.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
long dp
Grating backslash recovery steps.
#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
void SaveCalib(int mod)
Definition: Procedures.c:2130
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)
#define PRGFILE
execution driven by *.prg file
flag FLAG
flags structure
Definition: Procedures.c:37
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
Definition: Procedures.c:899
#define GASCODNG4
GASCODNG 4.
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
#define SPATRAM3
SPATRAM3.
#define SZAMODE
execution driven by SZAPRG file
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
controlpanel ContrPanel
Control Panel Structure.
#define AMS1
AMS1 address.
int step[AMSMAX][2]
Stepper Motors Step.
int EqType
Spectrometer Type.
int BlindPix
Number of blind pixels (usefull for Dark Current)
Definition: DAS_Spat.c:120
GratingSt GRS
Grating.
Definition: Procedures.c:36
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
int exemode
Set the Execution MODE (Execution modes)
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
#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:

§ D_CloseVR()

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

Callback closing the status bar.

Definition at line 140 of file Utils.c.

References MShellDestroy(), and MShellUnrealize().

Referenced by D_VRange(), D_VRangeSim(), and DD_VRange().

141 {
143  MShellDestroy(p);
144 
145 
146 }
void MShellUnrealize(MOBJECT obj)
void MShellDestroy(MOBJECT obj)
static double p
Definition: SOLPOS.C:131
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_FixSZA()

void D_FixSZA ( void  )

Definition at line 467 of file RTC_Time.c.

References dsza::Dailymaxsza, dsza::Dailyminsza, dsza::DeltaSZA, flag::ExeDSZA, das::Flag, dsza::LastMSZA, dsza::NextSZA, and S_zenetr.

Referenced by D_AutoExecution(), DB_Pause(), and Task_CCD_Temp().

468 {
469 
470 
471  double SZAInt;
472  double SZATest;
473  int k=0;
474  double er;
475 
476  if((S_zenetr - SZADelta.LastMSZA) > 0) // 66.5-66 > 0 --> Afternoon period -->After local noon
477  {
478 
479  SZAInt = floor(S_zenetr);
480  k = 1;
481  do
482  {
483  SZATest = SZAInt + ((double)k * SZADelta.DeltaSZA);
484  SZADelta.NextSZA = SZATest;
485  k++;
486  er = SZATest - (S_zenetr + SZADelta.DeltaSZA);
487  }while(er<0);
489  DAS.Flag.ExeDSZA = -1;
491  {
493  DAS.Flag.ExeDSZA = 1;
494  }
496  {
498  DAS.Flag.ExeDSZA = 1;
499  }
500 
501 
502 
503  }
504  else if ((S_zenetr - SZADelta.LastMSZA) < 0)//66.2-66.5 < 0 --> Morning Period --> Before Local Noon
505  {
506  SZAInt = ceil((double)S_zenetr); //62 62.45
507  k = 1;
508  do
509  {
510  SZATest = SZAInt - ((double)k * SZADelta.DeltaSZA); //62.1
511  SZADelta.NextSZA = SZATest;
512  k++;
513  er = SZATest-(S_zenetr );
514 
515  }while(er > 0 );
516  DAS.Flag.ExeDSZA = -1;
517 
519  {
521  DAS.Flag.ExeDSZA = 1;
522  }
524  {
526  DAS.Flag.ExeDSZA = 1;
527  }
528 
529  }
530 }
double S_zenetr
Definition: SOLPOS.C:92
double Dailymaxsza
Daily maximum SZA.
double LastMSZA
SZA of the previous measurement.
flag Flag
Structure for different flags.
double Dailyminsza
Daily minimum SZA.
double DeltaSZA
DeltaSZA.
das DAS
DAS structure.
Definition: RTC_Time.c:34
double NextSZA
SZA of the Next measurement.
int ExeDSZA
= 1 the measurements are performed, = 0 waiting for the next deltasza.
dsza SZADelta
Definition: RTC_Time.c:32
+ Here is the caller graph for this function:

§ D_InitPC104()

int D_InitPC104 ( void  )

Starting function that calls the driver functions used NOTE: By convention, you should capture the BYTE return value for each driver API call, and check the error code. I. Driver Initialization II. Board Initialization III. AD Settings.

Definition at line 120 of file Dscad.c.

Referenced by D_readtemp_int(), and InitTempAD().

121 {
122  //=========================================================================
123  // I. DRIVER INITIALIZATION
124  //
125  // Initializes the DSCUD library.
126  //
127  // Initialize the driver, using the driver version for validation
128  //=========================================================================
129 
130  if( dscInit( DSC_VERSION ) != DE_NONE )
131  {
134  return 1;
135  }
136 
137  //=========================================================================
138  // II. BOARD INITIALIZATION
139  //
140  // Initialize the DMM board. This function passes the various
141  // hardware parameters to the driver and resets the hardware.
142  //
143  //=========================================================================
144 
146  dsccb.base_address = 0x300;
147  dsccb.int_level = 3;
148  dsccb.dma_level = 3;
149  dsccb.clock_freq = 1000000;
150 
152  {
155  return 1;
156  }
157 
158  //=========================================================================
159  // III. AD SETTINGS INITIALIZATION
160  //
161  // Initialize the structure containing the AD conversion settings and
162  // then pass it to the driver.
163  //
164  //=========================================================================
165 
166  // PRE-FILLED EXAMPLE
172 
173  if( ( result = dscADSetSettings( dscb, &dscadsettings ) ) != DE_NONE )
174  {
177  return 2;
178  }
179 
180  //=========================================================================
181  // IV. AD SCAN INITIALIZATION
182  //
183  // Initialize the structure containing the AD scan setting and allocate
184  // memory for our buffer containing sample values.
185  //
186  //=========================================================================
187 
188  // PRE-FILLED EXAMPLE
190  dscadscan.high_channel = 15;
192 
193  samples = (WORD*)malloc( sizeof( WORD ) * ( dscadscan.high_channel - dscadscan.low_channel + 1 ) );
194 
195  return 0;
196 
197 }
DSCADSCAN dscadscan
Definition: Dscad.c:34
void DSCAD_Error(char *err, int w)
Definition: Dscad.c:48
WORD * samples
Definition: Dscad.c:35
WORD base_address
Definition: DSCUD.H:353
BYTE DSCUDAPICALL dscADSetSettings(DSCB board, DSCADSETTINGS *settings)
BYTE range
Definition: DSCUD.H:433
BYTE current_channel
Definition: DSCUD.H:431
BYTE DSCUDAPICALL dscGetLastError(ERRPARAMS *errparams)
BYTE polarity
Definition: DSCUD.H:434
ERRPARAMS errorParams
Definition: Dscad.c:37
#define DSC_VERSION
Definition: DSCUD.H:155
BYTE load_cal
Definition: DSCUD.H:435
DSCCB dsccb
Definition: Dscad.c:32
char * errstring
Definition: DSCUD.H:479
#define WORD
Definition: DSCUD.H:65
BYTE dma_level
Definition: DSCUD.H:354
BYTE DSCUDAPICALL dscInitBoard(BYTE boardtype, DSCCB *dsccb, DSCB *board)
LONG clock_freq
Definition: DSCUD.H:355
#define GAIN_1
Definition: DSCUD.H:195
DSCB dscb
Definition: Dscad.c:31
BYTE gain
Definition: DSCUD.H:432
BYTE boardtype
Definition: DSCUD.H:346
BYTE gain
Definition: DSCUD.H:451
#define DE_NONE
Definition: DSCUD.H:273
DSCADSETTINGS dscadsettings
Definition: Dscad.c:33
#define RANGE_5
Definition: DSCUD.H:189
BYTE low_channel
Definition: DSCUD.H:448
#define UNIPOLAR
Definition: DSCUD.H:193
BYTE result
Definition: Dscad.c:30
BYTE high_channel
Definition: DSCUD.H:449
#define TRUE
Definition: DSCUD.H:105
#define BYTE
Definition: DSCUD.H:55
#define DSC_DMM
Definition: DSCUD.H:165
BYTE int_level
Definition: DSCUD.H:360
BYTE DSCUDAPICALL dscInit(WORD version)
+ Here is the caller graph for this function:

§ D_Plot()

void D_Plot ( void  )

ViewPlot callback
.

Definition at line 192 of file Procedures.c.

References ViewPlot().

Referenced by D_AverageTFix(), D_Calibra(), D_Measure(), E_HgScan(), E_Meashor(), E_Meashor2(), E_QjScan(), and PerformMeas().

193 {
194 
195 
196  ViewPlot(1);
197  //MDCreateSh_Plot();
198 
199 }
int ViewPlot(int mod)
Create the plot shell. Procedure that build the plot shell for the data visualization.
Definition: Spat_Plot.c:3775
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_Positioning()

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.

Parameters
pMGUI Object (label in CP)
idmotor positioning /param tout: time out

Definition at line 607 of file Dxl.c.

References AMS1, optionini::amsprogbar, D_VRange(), DBDEMO, das::DOption, flag::exemode, das::Flag, MObjectSetText(), stepm::postime, stepm::SM_B, st, and das::StepM.

Referenced by AMS_DoPos(), and DemoInitMotor().

608 {
609  unsigned long st, et, x;
610  long tl;
611  char buf[80];
612 
613  if (DAS.Flag.exemode == DBDEMO)
614  tout = 1000;
615 
616  st = GetTickCount();
617  do
618  {
619  et = GetTickCount();
620  x = labs(et - st);
621  //g = x % 10;
622  //sprintf(buf, " %u %u", x, g);
623  //Status (buf);
624  //MLoopWhileEvents(0);
625  //if((x % 10 == 0) && (x > 0))
626  if(x > 0)
627  {
629  {
630  D_VRange(NULL, (long) x * 100 / tout, 255, 0, 0 );
631  tl = (long) ((double)fabs(((double)(labs(et - st) - tout))/1000.0 ));
632  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(labs(et - st) - tout))/1000.0 ));
633  MObjectSetText(p, buf);
634  DAS.StepM.postime[AMS1][DAS.StepM.SM_B]=(unsigned long)(tl*1000);
635 
636  }
637  }
638  }while(labs(et - st) < tout);
639 
640 }
stepm StepM
Stepper motors parameters structure.
optionini DOption
Options for DAS execution.
void D_VRange(char *str, int val, int, int g, int b)
Create and display the status bar.
Definition: Utils.c:206
flag Flag
Structure for different flags.
#define DBDEMO
execution in demo mode
void MObjectSetText(MOBJECT obj, const char *text)
long postime[AMSMAX][2]
time necessary for positioning
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
static double p
Definition: SOLPOS.C:131
#define AMS1
AMS1 address.
static double st
Definition: SOLPOS.C:142
das DAS
Definition: Dxl.c:22
int exemode
Set the Execution MODE (Execution modes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_Print_BIL_H_ASCII()

void D_Print_BIL_H_ASCII ( int  mod,
FILE *  fff 
)

Definition at line 621 of file Utils.c.

References spectrumheader::altitude, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdmin, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, spectrumheader::comment, ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, and spectrumheader::wavelen.

Referenced by SaveDataOffLine(), and SaveIo().

622 {
623 
624  fprintf(fff, "LOC: %s ", BIL.SPH.location); //Name of the station
625  fprintf(fff, "LAT: %.2lf ", BIL.SPH.latitude);//Station latitude
626  fprintf(fff, "LON: %.2lf ", BIL.SPH.longitude);//Station latitude
627  fprintf(fff, "ALT[m/asl]: %u ", BIL.SPH.altitude);//Station altitude
628  fprintf(fff, "SZA: %.2lf\n", BIL.SPH.sza);//SZA
629 
630  fprintf(fff, "%d/%02d/%02d ", BIL.SPH.DATE.da_year, BIL.SPH.DATE.da_mon, BIL.SPH.DATE.da_day);
631  fprintf(fff, "%02d:%02d:%02d LT ",BIL.SPH.TIME.ti_hour, BIL.SPH.TIME.ti_min,BIL.SPH.TIME.ti_sec);
632  fprintf(fff, "%s ", BIL.SPH.mirpos);
633  fprintf(fff, "%d ", BIL.SPH.wavelen);
634  fprintf(fff, "%s ", BIL.SPH.filpos);
635  fprintf(fff, "%.2lf ", BIL.SPH.ccdtemp);
636  fprintf(fff, "%.2lf ", BIL.SPH.ccdtexp);
637  fprintf(fff, "%5u ", BIL.SPH.ccdmax);
638  fprintf(fff, "%5u\n", BIL.SPH.ccdmin);
639 
640 
641  // Image format
642  fprintf(fff, "%d ", BIL.SPH.imgtype);
643  fprintf(fff, "%d ", BIL.SPH.ccdwx);
644  fprintf(fff, "%d ", BIL.SPH.ccdwy);
645  fprintf(fff, "%d ", BIL.SPH.ccdsx);
646  fprintf(fff, "%d ", BIL.SPH.ccdsy);
647  fprintf(fff, "%d ", BIL.SPH.ccdex);
648  fprintf(fff, "%d ", BIL.SPH.ccdey);
649  fprintf(fff, "%d ", BIL.SPH.ccdvb);
650  fprintf(fff, "%d ", BIL.SPH.ccdnr);
651  fprintf(fff, "%d ", BIL.SPH.dummy1);
652  fprintf(fff, "%d ", BIL.SPH.dummy2);
653  fprintf(fff, "%d ", BIL.SPH.dummy3);
654  fprintf(fff, "%d\n", BIL.SPH.dummy4);
655  fprintf(fff, "%s\n", BIL.SPH.comment);
656 
657 
658 }
struct ddate DATE
Definition: bildef.h:134
char comment[255]
Definition: bildef.h:157
unsigned int ccdmax
Definition: bildef.h:142
unsigned int altitude
Altitude of the Station.
Definition: bildef.h:131
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
unsigned char ti_hour
Definition: bildef.h:79
bil BIL
Definition: Utils.c:27
unsigned char ti_sec
Definition: bildef.h:81
char filpos[5]
Definition: bildef.h:139
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
float ccdtexp
Definition: bildef.h:140
unsigned char ti_min
Definition: bildef.h:78
float longitude
Longitude of the Station.
Definition: bildef.h:130
unsigned char da_mon
Definition: bildef.h:86
float latitude
Latitude of the Station.
Definition: bildef.h:129
unsigned char da_day
Definition: bildef.h:85
char location[4]
Name of the Station (BLQ, LPA, EVR, TNB, DMC.....)
Definition: bildef.h:128
short int da_year
Definition: bildef.h:84
float ccdtemp
Definition: bildef.h:141
unsigned int ccdmin
Definition: bildef.h:143
float sza
Solar Zenith Angle.
Definition: bildef.h:132
+ Here is the caller graph for this function:

§ D_PrintBILSPH()

void D_PrintBILSPH ( FILE *  fff)

Print Header.

Parameters
*fffASCII file number

Definition at line 581 of file Utils.c.

References spectrumheader::altitude, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdmin, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, spectrumheader::comment, ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, and spectrumheader::wavelen.

Referenced by DT_CorrFileEvora(), DT_CorrHeader(), and WriteDataFile().

582 {
583 
584  fprintf(fff, "LOC: %s ", BIL.SPH.location); //Name of the station
585  fprintf(fff, "LAT: %.2lf ", BIL.SPH.latitude);//Station latitude
586  fprintf(fff, "LON: %.2lf ", BIL.SPH.longitude);//Station latitude
587  fprintf(fff, "ALT[m/asl]: %u ", BIL.SPH.altitude);//Station altitude
588  fprintf(fff, "SZA: %.2lf\n", BIL.SPH.sza);//SZA
589 
590  fprintf(fff, "%d/%02d/%02d ", BIL.SPH.DATE.da_year, BIL.SPH.DATE.da_mon, BIL.SPH.DATE.da_day);
591  fprintf(fff, "%02d:%02d:%02d LT ",BIL.SPH.TIME.ti_hour, BIL.SPH.TIME.ti_min,BIL.SPH.TIME.ti_sec);
592  fprintf(fff, "%s ", BIL.SPH.mirpos);
593  fprintf(fff, "%d ", BIL.SPH.wavelen);
594  fprintf(fff, "%s ", BIL.SPH.filpos);
595  fprintf(fff, "%.2lf ", BIL.SPH.ccdtemp);
596  fprintf(fff, "%.2lf ", BIL.SPH.ccdtexp);
597  fprintf(fff, "%5u ", BIL.SPH.ccdmax);
598  fprintf(fff, "%5u\n", BIL.SPH.ccdmin);
599 
600 
601  // Image format
602  fprintf(fff, "%d ", BIL.SPH.imgtype);
603  fprintf(fff, "%d ", BIL.SPH.ccdwx);
604  fprintf(fff, "%d ", BIL.SPH.ccdwy);
605  fprintf(fff, "%d ", BIL.SPH.ccdsx);
606  fprintf(fff, "%d ", BIL.SPH.ccdsy);
607  fprintf(fff, "%d ", BIL.SPH.ccdex);
608  fprintf(fff, "%d ", BIL.SPH.ccdey);
609  fprintf(fff, "%d ", BIL.SPH.ccdvb);
610  fprintf(fff, "%d ", BIL.SPH.ccdnr);
611  fprintf(fff, "%d ", BIL.SPH.dummy1);
612  fprintf(fff, "%d ", BIL.SPH.dummy2);
613  fprintf(fff, "%d ", BIL.SPH.dummy3);
614  fprintf(fff, "%d\n", BIL.SPH.dummy4);
615  fprintf(fff, "%s\n", BIL.SPH.comment);
616 
617 
618 }
struct ddate DATE
Definition: bildef.h:134
char comment[255]
Definition: bildef.h:157
unsigned int ccdmax
Definition: bildef.h:142
unsigned int altitude
Altitude of the Station.
Definition: bildef.h:131
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
unsigned char ti_hour
Definition: bildef.h:79
bil BIL
Definition: Utils.c:27
unsigned char ti_sec
Definition: bildef.h:81
char filpos[5]
Definition: bildef.h:139
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
float ccdtexp
Definition: bildef.h:140
unsigned char ti_min
Definition: bildef.h:78
float longitude
Longitude of the Station.
Definition: bildef.h:130
unsigned char da_mon
Definition: bildef.h:86
float latitude
Latitude of the Station.
Definition: bildef.h:129
unsigned char da_day
Definition: bildef.h:85
char location[4]
Name of the Station (BLQ, LPA, EVR, TNB, DMC.....)
Definition: bildef.h:128
short int da_year
Definition: bildef.h:84
float ccdtemp
Definition: bildef.h:141
unsigned int ccdmin
Definition: bildef.h:143
float sza
Solar Zenith Angle.
Definition: bildef.h:132
+ Here is the caller graph for this function:

§ D_PrintBILSPH_BIN()

void D_PrintBILSPH_BIN ( int  fd)

Print on file the binary header of the measured spectrum.

Parameters
fdnumber of destination file

Definition at line 540 of file Utils.c.

References spectrumheader::altitude, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, spectrumheader::comment, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, spectrumheader::TIME, and spectrumheader::wavelen.

Referenced by WriteDataFile().

541 {
542 
543 
544  unsigned long info = 0;
545 
546 
547  info =0;
548 
549  info += write(fd, BIL.SPH.location, sizeof(BIL.SPH.location));
550  info += write(fd, &BIL.SPH.latitude, sizeof(BIL.SPH.latitude));
551  info += write(fd, &BIL.SPH.longitude, sizeof(BIL.SPH.longitude));
552  info += write(fd, &BIL.SPH.altitude, sizeof(BIL.SPH.altitude));
553  info += write(fd, &BIL.SPH.sza, sizeof(BIL.SPH.sza));
554  info += write(fd, &BIL.SPH.DATE, sizeof(struct ddate));
555  info += write(fd, &BIL.SPH.TIME, sizeof(struct dtime));
556 
557  info += write(fd, BIL.SPH.mirpos, sizeof(BIL.SPH.mirpos));
558  info += write(fd, &BIL.SPH.wavelen, sizeof(BIL.SPH.wavelen));
559  info += write(fd, BIL.SPH.filpos, sizeof(BIL.SPH.filpos));
560 
561  info += write(fd, &BIL.SPH.ccdtemp, sizeof(BIL.SPH.ccdtemp));
562  info += write(fd, &BIL.SPH.ccdtexp, sizeof(BIL.SPH.ccdtexp));
563  info += write(fd, &BIL.SPH.ccdmax, sizeof(BIL.SPH.ccdmax));
564 
565  info += write(fd, &BIL.SPH.imgtype, sizeof(BIL.SPH.imgtype));
566  info += write(fd, &BIL.SPH.ccdwx, sizeof(BIL.SPH.ccdwx));
567  info += write(fd, &BIL.SPH.ccdwy, sizeof(BIL.SPH.ccdwy));
568  info += write(fd, &BIL.SPH.ccdsx, sizeof(BIL.SPH.ccdsx));
569  info += write(fd, &BIL.SPH.ccdsy, sizeof(BIL.SPH.ccdsy));
570  info += write(fd, &BIL.SPH.ccdex, sizeof(BIL.SPH.ccdex));
571  info += write(fd, &BIL.SPH.ccdey, sizeof(BIL.SPH.ccdey));
572  info += write(fd, &BIL.SPH.ccdvb, sizeof(BIL.SPH.ccdvb));
573  info += write(fd, &BIL.SPH.ccdnr, sizeof(BIL.SPH.ccdnr));
574  info += write(fd, &BIL.SPH.dummy1, sizeof(BIL.SPH.dummy1));
575  info += write(fd, &BIL.SPH.dummy2, sizeof(BIL.SPH.dummy2));
576  info += write(fd, &BIL.SPH.dummy3, sizeof(BIL.SPH.dummy3));
577  info += write(fd, &BIL.SPH.dummy4, sizeof(BIL.SPH.dummy4));
578  info += write(fd, &BIL.SPH.comment, sizeof(BIL.SPH.comment));
579 
580 }
struct ddate DATE
Definition: bildef.h:134
char comment[255]
Definition: bildef.h:157
unsigned int ccdmax
Definition: bildef.h:142
Definition: bildef.h:83
unsigned int altitude
Altitude of the Station.
Definition: bildef.h:131
Definition: Dildef.h:423
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
bil BIL
Definition: Utils.c:27
char filpos[5]
Definition: bildef.h:139
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
Definition: bildef.h:77
float ccdtexp
Definition: bildef.h:140
float longitude
Longitude of the Station.
Definition: bildef.h:130
float latitude
Latitude of the Station.
Definition: bildef.h:129
char location[4]
Name of the Station (BLQ, LPA, EVR, TNB, DMC.....)
Definition: bildef.h:128
float ccdtemp
Definition: bildef.h:141
float sza
Solar Zenith Angle.
Definition: bildef.h:132
+ Here is the caller graph for this function:

§ D_PrintHMod()

void D_PrintHMod ( FILE *  fff)

Print the header in Column format.

Parameters
*fffdestination file number

Definition at line 790 of file Save.c.

References spectrumheader::altitude, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdmin, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::comment, ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, and spectrumheader::wavelen.

Referenced by WriteColumn(), and WriteSelColandSmoothed().

791 {
792 
793 // spectrumheader pe;
794 
795 /*
796  er = fscanf(fd, "%s%s%s%lf%s%lf%s%lf%s%lf", temp, BIL.SPH.location, temp, &BIL.SPH.latitude,
797  temp, &BIL.SPH.longitude, temp, &BIL.SPH.altitude, temp, &BIL.SPH.sza);
798 
799  er = fscanf(fd, "%i/%u/%u%u:%u:%u%s%s%d%s%lf%lf%lu%lu", &BIL.SPH.DATE.da_year,&BIL.SPH.DATE.da_mon,
800  &BIL.SPH.DATE.da_day, &BIL.SPH.TIME.ti_hour, &BIL.SPH.TIME.ti_min, &BIL.SPH.TIME.ti_sec, temp,
801  BIL.SPH.mirpos, &BIL.SPH.wavelen, BIL.SPH.filpos, &BIL.SPH.ccdtemp, &BIL.SPH.ccdtexp, &BIL.SPH.ccdmax,
802  &BIL.SPH.ccdmin);
803 
804  er = fscanf(fd, "%d%d%d%d%d%d%d%d%d%d%d", &BIL.SPH.imgtype, &BIL.SPH.ccdsx, &BIL.SPH.ccdsy, &BIL.SPH.ccdex,
805  &BIL.SPH.ccdey, &BIL.SPH.ccdvb, &BIL.SPH.ccdnr, &BIL.SPH.dummy1, &BIL.SPH.dummy2, &BIL.SPH.dummy3, &BIL.SPH.dummy4);
806 
807  er = fscanf(fd, "%s", BIL.SPH.comment);
808 */
809 
810 
811  fprintf(fff, "LOC: %s ", BIL.SPH.location); //Name of the station
812  fprintf(fff, "LAT: %.2lf ", BIL.SPH.latitude);//Station latitude
813  fprintf(fff, "LON: %.2lf ", BIL.SPH.longitude);//Station latitude
814  fprintf(fff, "ALT[m/asl]: %u ", BIL.SPH.altitude);//Station altitude
815  fprintf(fff, "SZA: %.2lf\n", BIL.SPH.sza);//SZA
816 
817  fprintf(fff, "%d/%02d/%02d ", BIL.SPH.DATE.da_year, BIL.SPH.DATE.da_mon, BIL.SPH.DATE.da_day);
818  fprintf(fff, "%02d:%02d:%02d LT ",BIL.SPH.TIME.ti_hour, BIL.SPH.TIME.ti_min,BIL.SPH.TIME.ti_sec);
819  fprintf(fff, "%s ", BIL.SPH.mirpos);
820  fprintf(fff, "%d ", BIL.SPH.wavelen);
821  fprintf(fff, "%s ", BIL.SPH.filpos);
822  fprintf(fff, "%.2lf ", BIL.SPH.ccdtemp);
823  fprintf(fff, "%.2lf ", BIL.SPH.ccdtexp);
824  fprintf(fff, "%5u ", BIL.SPH.ccdmax);
825  fprintf(fff, "%5u\n", BIL.SPH.ccdmin);
826 
827 
828  // Image format
829  fprintf(fff, "%d ", BIL.SPH.imgtype);
830 // BIL.SPH.imgtype =
831 // BIL.SPH.camtype =
832 // BIL.SPH.ccdtype =
833  fprintf(fff, "%d ", BIL.SPH.ccdsx);
834  fprintf(fff, "%d ", BIL.SPH.ccdsy);
835  fprintf(fff, "%d ", BIL.SPH.ccdex);
836  fprintf(fff, "%d ", BIL.SPH.ccdey);
837  fprintf(fff, "%d ", BIL.SPH.ccdvb);
838  fprintf(fff, "%d ", BIL.SPH.ccdnr);
839  fprintf(fff, "%d ", BIL.SPH.dummy1);
840  fprintf(fff, "%d ", BIL.SPH.dummy2);
841  fprintf(fff, "%d ", BIL.SPH.dummy3);
842  fprintf(fff, "%d\n", BIL.SPH.dummy4);
843  fprintf(fff, "%s\n", BIL.SPH.comment);
844 
845 
846 }
struct ddate DATE
Definition: bildef.h:134
char comment[255]
Definition: bildef.h:157
unsigned int ccdmax
Definition: bildef.h:142
unsigned int altitude
Altitude of the Station.
Definition: bildef.h:131
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
unsigned char ti_hour
Definition: bildef.h:79
unsigned char ti_sec
Definition: bildef.h:81
char filpos[5]
Definition: bildef.h:139
bil BIL
Definition: Save.c:26
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
float ccdtexp
Definition: bildef.h:140
unsigned char ti_min
Definition: bildef.h:78
float longitude
Longitude of the Station.
Definition: bildef.h:130
unsigned char da_mon
Definition: bildef.h:86
float latitude
Latitude of the Station.
Definition: bildef.h:129
unsigned char da_day
Definition: bildef.h:85
char location[4]
Name of the Station (BLQ, LPA, EVR, TNB, DMC.....)
Definition: bildef.h:128
short int da_year
Definition: bildef.h:84
float ccdtemp
Definition: bildef.h:141
unsigned int ccdmin
Definition: bildef.h:143
float sza
Solar Zenith Angle.
Definition: bildef.h:132
+ Here is the caller graph for this function:

§ D_PrintSpectrum()

void D_PrintSpectrum ( FILE *  fff)

Print Spectrum.

Parameters
*fffASCII file number

Definition at line 517 of file Utils.c.

References bil::DPLOT, IDX, IDY, and d_view::ImatGraf.

Referenced by DT_CorrFileEvora(), and DT_CorrHeader().

518 {
519 
520  int x, y;
521 
522  for(y = 0; y < IDY; y++)
523  {
524  for(x = 0; x < IDX; x++)
525  {
526  if((x % 10) == 0)
527  {
528  if(y == 0 && x == 0)
529  {
530  }
531  else
532  fprintf(fff, "\n", NULL);
533  }
534  fprintf(fff, "%5u ", BIL.DPLOT.ImatGraf[y * IDX + x]);
535  }
536  }
537  fprintf(fff, "\n", NULL);
538 
539 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
bil BIL
Definition: Utils.c:27
d_view DPLOT
Definition: bildef.h:254
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
unsigned short * ImatGraf
Definition: bildef.h:176
+ Here is the caller graph for this function:

§ D_rt()

void D_rt ( void  )

D_readtemp_int callback
.

Starting function that calls the driver functions used
.

Returns
er:
  • 0 = initialization succesfully concluded
  • 1 = problems in driver initialization
  • 2 = problems in hardware initialization

Definition at line 64 of file Dscad.c.

References D_readtemp_int().

Referenced by D_readtemp().

65 {
66 
68 
69 }
void D_readtemp_int(void)
Definition: Dscad.c:71
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_Saving()

void D_Saving ( void  )

Saving image.
Procedure for saving the CCD Image Used since version 2.1.0. The coiche between binary and ASCII saving mode is obtained with the mode Flag optionini.

Returns
void

Definition at line 1369 of file Procedures.c.

References _MAX_PATH, controlpanel::Albl_CS, gui::ContrPanel, d_fileman::DAILYDATADIRECTORY, d_fileman::DATADIRECTORY, DB_Save(), bil::DFILEM, das::DGeo, das::DOption, fftprh, das::Gui, MObjectSetText(), spectrumheader::newdate, spectrumheader::olddate, d_geo::s_name, SaveCnt, SAVECNT, optionini::savingmode, bil::SPH, and Total.

Referenced by D_Measure(), DB_HorComm_CB(), DB_KeyB_CB(), E_Meashor(), E_Meashor2(), E_Save(), GetDefPix(), and PerformMeas().

1370 {
1371 
1372  char tmpbuf[128] ;
1373  static char tit[_MAX_PATH];
1374  char tit1[80];
1375  time_t ltime;
1376  struct tm *today;
1377  int fd, er = 0;
1378 
1379 
1380 
1381 
1382  if(fftprh) //flag first time program run here
1383  {
1384  /* Get UNIX-style time */
1385  time( &ltime );
1386  /* Use time structure to build a customized time string. */
1387  today = localtime( &ltime );
1388  /* Use strftime to build a customized time string. */
1389  strftime( tmpbuf, 7,"%y%m%d", today );
1390 
1391  sprintf(BIL.DFILEM.DAILYDATADIRECTORY,"%s\\%s",BIL.DFILEM.DATADIRECTORY,tmpbuf);
1392 
1393  //_chdir( BIL.DFILEM.DATADIRECTORY );
1394 
1395  er = _mkdir( BIL.DFILEM.DAILYDATADIRECTORY );
1396 /*
1397  if ( er ) //error in creating dir
1398  {
1399  if(EEXIST)
1400  _chdir( BIL.DFILEM.DAILYDATADIRECTORY );
1401  else if (ENOENT)
1402 
1403 
1404  }
1405  else
1406  {
1407  _chdir( BIL.DFILEM.DAILYDATADIRECTORY );
1408  }
1409 */
1410  fftprh=0;
1411  if(DAS.DOption.savingmode) // Binary saving
1412  {
1413  do
1414  {
1415  Total++;
1416  //sprintf(tit, "DATA\\%s%s%03d.bif", DGEO.s_name, tmpbuf, Total);
1417  sprintf(tit, "%s\\%s%s%03d.bif",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf, Total);
1418  fd = access(tit, 0);
1419  }while(!fd);
1420  DB_Save(tit, 1);
1421  }
1422  else //ASCII saving
1423  {
1424  do
1425  {
1426  Total++;
1427  //sprintf(tit, "DATA\\%s%s%03d.dat", DGEO.s_name, tmpbuf, Total);
1428  sprintf(tit, "%s\\%s%s%03d.dat",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf, Total);
1429  sprintf(tit1, "%s", tit+5);
1430  fd = access(tit, 0);
1431  }while(!fd);
1432  DB_Save(tit, 0);
1433  }
1434  sprintf(BIL.SPH.olddate, "%s",tmpbuf);
1435 
1436  }
1437  else
1438  {
1439 
1440 
1441  /* Get UNIX-style time */
1442  time( &ltime );
1443  /* Use time structure to build a customized time string. */
1444  today = localtime( &ltime );
1445  /* Use strftime to build a customized time string. */
1446  strftime( BIL.SPH.newdate, 7,"%y%m%d", today );
1447  /* Use strftime to build a customized time string. */
1448  strftime( tmpbuf, 7,"%y%m%d", today );
1449 
1450 
1451 
1452 
1453  // Se e' cambiata la data rimette a 1 il contatore del numero dei files
1454  if(strcmp(BIL.SPH.newdate, BIL.SPH.olddate) != 0)
1455  {
1456  sprintf(BIL.SPH.olddate, "%s",BIL.SPH.newdate);
1457  Total = 0;
1458 
1459  sprintf(BIL.DFILEM.DAILYDATADIRECTORY,"%s\\%s",BIL.DFILEM.DATADIRECTORY,tmpbuf);
1460  er = _mkdir( BIL.DFILEM.DAILYDATADIRECTORY );
1461 
1462  /*****************************/
1463  if(DAS.DOption.savingmode) // Binary saving
1464  {
1465  do
1466  {
1467  Total++;
1468 // sprintf(tit, "DATA\\%s%s%03d.bif", DGEO.s_name, tmpbuf, Total);
1469  sprintf(tit, "%s\\%s%s%03d.bif",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf, Total);
1470  fd = access(tit, 0);
1471  }while(!fd);
1472  DB_Save(tit, 1);
1473  }
1474  else //ASCII saving
1475  {
1476  do
1477  {
1478  Total++;
1479 // sprintf(tit, "DATA\\%s%s%03d.dat", DGEO.s_name, tmpbuf, Total);
1480  sprintf(tit, "%s\\%s%s%03d.dat",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf, Total);
1481  sprintf(tit1, "%s", tit+5);
1482  fd = access(tit, 0);
1483  }while(!fd);
1484  DB_Save(tit, 0);
1485  }
1486 /*****************************/
1487  }
1488  //Se ha raggiunto il numero di acquisizioni SAVECNT=50
1489  if((SaveCnt % SAVECNT) == 0)
1490  {
1491  if(DAS.DOption.savingmode)
1492  {
1493 // sprintf(tit, "DATA\\%s%s%03d.bif", DGEO.s_name, tmpbuf, Total);
1494  sprintf(tit, "%s\\%s%s%03d.bif",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf, Total);
1495  Total++;
1496  DB_Save(tit, 1);
1497  }
1498  else
1499  {
1500  //sprintf(tit, "DATA\\%s%s%03d.dat", DGEO.s_name, tmpbuf, Total);
1501  sprintf(tit, "%s\\%s%s%03d.dat",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf, Total);
1502  Total++;
1503  DB_Save(tit, 0);
1504  }
1505  }
1506  else
1507  {
1508  if(DAS.DOption.savingmode)
1509  {
1510  //sprintf(tit, "DATA\\%s%s%03d.bif", DGEO.s_name, tmpbuf, Total);
1511  sprintf(tit, "%s\\%s%s%03d.bif",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf, Total);
1512  DB_Save(tit, 1);
1513  }
1514  else
1515  {
1516  //sprintf(tit, "DATA\\%s%s%03d.dat", DGEO.s_name, tmpbuf, Total);
1517  sprintf(tit, "%s\\%s%s%03d.dat",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf, Total);
1518  DB_Save(tit, 0);
1519  }
1520  }
1521  }
1522 
1523 
1524 
1525  sprintf(tit1, "%s%s%03d.bif",DAS.DGeo.s_name, tmpbuf, Total);
1527  sprintf(tit1, "%05d", SaveCnt);
1529 
1530  SaveCnt++;
1531 
1532 
1533 
1534 }
bil BIL
Definition: Procedures.c:42
gui Gui
Graphic User Interface Structure.
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
int Total
Progressive acquisition number for file (MAX defined = 50)
Definition: Exec.c:34
char DAILYDATADIRECTORY[_MAX_PATH]
Definition: bildef.h:203
char DATADIRECTORY[_MAX_PATH]
Definition: bildef.h:201
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
MOBJECT Albl_CS[4]
Active Control Panel Labels for Camera Status 4.
void DB_Save(char *tit, int mod)
Save the acquired spectrum. Procedure that Save the acquired spectrum.
Definition: Save.c:552
char olddate[8]
Definition: bildef.h:158
void MObjectSetText(MOBJECT obj, const char *text)
das DAS
DAS structure.
Definition: Procedures.c:47
d_geo DGeo
struct for Station location
char s_name[4]
Station name.
d_fileman DFILEM
Definition: bildef.h:257
#define SAVECNT
maximum number of spectra in one file
#define _MAX_PATH
Definition: Dildef.h:202
controlpanel ContrPanel
Control Panel Structure.
char newdate[8]
Definition: bildef.h:159
Definition: Dildef.h:234
int fftprh
Definition: Procedures.c:50
int SaveCnt
Definition: Procedures.c:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_SunCalc()

void D_SunCalc ( void  )

Sun Calculator Callback.

Definition at line 127 of file DOAS_FullProj.c.

References _MAX_PATH, bil::DFILEM, and d_fileman::HOMEDIRECTORY.

Referenced by MenuToolsOLP_CB(), and SunCalcCB().

128 {
129 
130  char buff[_MAX_PATH];
131 
132  sprintf(buff,"%s\\%s",BIL.DFILEM.HOMEDIRECTORY, "SolPosCalc");
133 
134  chdir(buff);
135 
136  sprintf(buff,"%s\\%s",BIL.DFILEM.HOMEDIRECTORY, "SolPosCalc\\D_solpos1.exe");
137 
138  WinExec(buff, 1);
139 
140 // sprintf(buff,"%ss",BIL.DFILEM.HOMEDIRECTORY, "SolPosCalc");
141 
142  chdir(BIL.DFILEM.HOMEDIRECTORY);
143 
144 
145 }
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
d_fileman DFILEM
Definition: bildef.h:257
#define _MAX_PATH
Definition: Dildef.h:202
bil BIL
Definition: DOAS_FullProj.c:42
+ Here is the caller graph for this function:

§ D_UndoCB()

void D_UndoCB ( MOBJECT  o,
void *  a,
void *  v 
)

Undo the previous color setting operation.

Definition at line 225 of file DAS_Spat_ConfCBs.c.

Referenced by MDCreateDASConfig().

226 {
227 // int i;
228  // Unselected Buttons
229 /*
230  if(FlgBG && (FlgOBJ==0))
231  {
232  DB_Undo2Do_Colors( DPAL.DB_UnSel, UDPAL.DB_UnSel);
233 
234  if(DAS.Flag.exemode == DOASMODE)
235  DB_ColorAssign(LISTF.pb, sizeof LISTF.pb / sizeof LISTF.pb[0], DPAL.DB_UnSel);
236  else
237  {
238  DB_ColorAssign(PBUTT.KeyB, sizeof PBUTT.KeyB / sizeof PBUTT.KeyB[0], DPAL.DB_UnSel);
239  DB_ColorAssign(DAS.Gui.ContrPanel.pblamps, sizeof DAS.Gui.ContrPanel.pblamps / sizeof DAS.Gui.ContrPanel.pblamps[0], DPAL.DB_UnSel);
240  }
241 
242 
243  }
244  if(FlgFG && (FlgOBJ==0))
245  {
246  DB_Undo2Do_Colors( DPAL.DB_UnSelFG, UDPAL.DB_UnSelFG);
247 
248  if(DAS.Flag.exemode == DOASMODE)
249  DB_ColorAssign(LISTF.pb, sizeof LISTF.pb / sizeof LISTF.pb[0], DPAL.DB_UnSelFG);
250  else
251  {
252  DB_ColorAssign(PBUTT.KeyB, sizeof PBUTT.KeyB / sizeof PBUTT.KeyB[0], DPAL.DB_UnSelFG);
253  DB_ColorAssign(DAS.Gui.ContrPanel.pblamps, sizeof DAS.Gui.ContrPanel.pblamps / sizeof DAS.Gui.ContrPanel.pblamps[0], DPAL.DB_UnSelFG);
254  }
255 
256  }
257  // Selected Buttons
258  if (FlgBG && (FlgOBJ==1))
259  {
260  DB_Undo2Do_Colors(DPAL.DB_Sel, UDPAL.DB_Sel);
261 
262  MSelectObject(PBUTT.KeyB[0]);
263  MObjectSetBackgroundRGB(PBUTT.KeyB[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
264  }
265  //Active Labels BG
266  if (FlgBG && (FlgOBJ==2))
267  {
268  DB_Undo2Do_Colors(DPAL.DB_BG_Albl, UDPAL.DB_BG_Albl);
269 
270  DB_ColorAssign(DAS.Gui.ContrPanel.lbl_Par, sizeof DAS.Gui.ContrPanel.lbl_Par / sizeof DAS.Gui.ContrPanel.lbl_Par[0], DPAL.DB_BG_Albl);
271  DB_ColorAssign(DAS.Gui.ContrPanel.Albl_CS, sizeof DAS.Gui.ContrPanel.Albl_CS / sizeof DAS.Gui.ContrPanel.Albl_CS[0], DPAL.DB_BG_Albl);
272  DB_ColorAssign(DAS.Gui.ContrPanel.Albl_IE, sizeof DAS.Gui.ContrPanel.Albl_IE / sizeof DAS.Gui.ContrPanel.Albl_IE[0], DPAL.DB_BG_Albl);
273  DB_ColorAssign(DAS.Gui.ContrPanel.Albl_LS, sizeof DAS.Gui.ContrPanel.Albl_LS / sizeof DAS.Gui.ContrPanel.Albl_LS[0], DPAL.DB_BG_Albl);
274  DB_ColorAssign(DAS.Gui.ContrPanel.Albl_LT, sizeof DAS.Gui.ContrPanel.Albl_LT / sizeof DAS.Gui.ContrPanel.Albl_LT[0], DPAL.DB_BG_Albl);
275  DB_ColorAssign(DAS.Gui.ContrPanel.cop, sizeof DAS.Gui.ContrPanel.cop / sizeof DAS.Gui.ContrPanel.cop[0] , DPAL.DB_BG_Albl);
276  DB_ColorAssign(DAS.Gui.ContrPanel.step, sizeof DAS.Gui.ContrPanel.step / sizeof DAS.Gui.ContrPanel.step[0] , DPAL.DB_BG_Albl);
277  DB_ColorAssign(DAS.Gui.ContrPanel.slope, sizeof DAS.Gui.ContrPanel.slope / sizeof DAS.Gui.ContrPanel.slope[0] , DPAL.DB_BG_Albl);
278  DB_ColorAssign(DAS.Gui.ContrPanel.speed, sizeof DAS.Gui.ContrPanel.speed / sizeof DAS.Gui.ContrPanel.speed[0] , DPAL.DB_BG_Albl);
279  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_Status, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
280  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_Script, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
281  }
282 
283  //Active Labels FG
284  if (FlgFG && (FlgOBJ==2))
285  {
286 
287  DB_Undo2Do_Colors(DPAL.DB_FG_Albl, UDPAL.DB_FG_Albl);
288 
289  DB_ColorAssign(DAS.Gui.ContrPanel.lbl_Par, sizeof DAS.Gui.ContrPanel.lbl_Par / sizeof DAS.Gui.ContrPanel.lbl_Par[0], DPAL.DB_FG_Albl);
290  DB_ColorAssign(DAS.Gui.ContrPanel.Albl_CS, sizeof DAS.Gui.ContrPanel.Albl_CS / sizeof DAS.Gui.ContrPanel.Albl_CS[0], DPAL.DB_FG_Albl);
291  DB_ColorAssign(DAS.Gui.ContrPanel.Albl_IE, sizeof DAS.Gui.ContrPanel.Albl_IE / sizeof DAS.Gui.ContrPanel.Albl_IE[0], DPAL.DB_FG_Albl);
292  DB_ColorAssign(DAS.Gui.ContrPanel.Albl_LS, sizeof DAS.Gui.ContrPanel.Albl_LS / sizeof DAS.Gui.ContrPanel.Albl_LS[0], DPAL.DB_FG_Albl);
293  DB_ColorAssign(DAS.Gui.ContrPanel.Albl_LT, sizeof DAS.Gui.ContrPanel.Albl_LT / sizeof DAS.Gui.ContrPanel.Albl_LT[0], DPAL.DB_FG_Albl);
294  DB_ColorAssign(DAS.Gui.ContrPanel.cop, sizeof DAS.Gui.ContrPanel.cop / sizeof DAS.Gui.ContrPanel.cop[0] , DPAL.DB_FG_Albl);
295  DB_ColorAssign(DAS.Gui.ContrPanel.step, sizeof DAS.Gui.ContrPanel.step / sizeof DAS.Gui.ContrPanel.step[0] , DPAL.DB_FG_Albl);
296  DB_ColorAssign(DAS.Gui.ContrPanel.slope, sizeof DAS.Gui.ContrPanel.slope / sizeof DAS.Gui.ContrPanel.slope[0] , DPAL.DB_FG_Albl);
297  DB_ColorAssign(DAS.Gui.ContrPanel.speed, sizeof DAS.Gui.ContrPanel.speed / sizeof DAS.Gui.ContrPanel.speed[0] , DPAL.DB_FG_Albl);
298 
299  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_Status, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
300  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_Script, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
301  }
302 
303  //Passive Labels BG
304  if (FlgBG && (FlgOBJ==3))
305  {
306  DB_Undo2Do_Colors(DPAL.DB_BG_Plbl, UDPAL.DB_BG_Plbl);
307 
308  DB_ColorAssign(DAS.Gui.ContrPanel.lbl_NP, sizeof DAS.Gui.ContrPanel.lbl_NP / sizeof DAS.Gui.ContrPanel.lbl_NP[0], DPAL.DB_BG_Plbl);
309  DB_ColorAssign(DAS.Gui.ContrPanel.Plbl_CS, sizeof DAS.Gui.ContrPanel.Plbl_CS / sizeof DAS.Gui.ContrPanel.Plbl_CS[0], DPAL.DB_BG_Plbl);
310  DB_ColorAssign(DAS.Gui.ContrPanel.Plbl_IE, sizeof DAS.Gui.ContrPanel.Plbl_IE / sizeof DAS.Gui.ContrPanel.Plbl_IE[0], DPAL.DB_BG_Plbl);
311  DB_ColorAssign(DAS.Gui.ContrPanel.Plbl_LS, sizeof DAS.Gui.ContrPanel.Plbl_LS / sizeof DAS.Gui.ContrPanel.Plbl_LS[0], DPAL.DB_BG_Plbl);
312  DB_ColorAssign(DAS.Gui.ContrPanel.Plbl_LT, sizeof DAS.Gui.ContrPanel.Plbl_LT / sizeof DAS.Gui.ContrPanel.Plbl_LT[0], DPAL.DB_BG_Plbl);
313 
314  DB_ColorAssign(DAS.Gui.ContrPanel.lbl_lamps, sizeof DAS.Gui.ContrPanel.lbl_lamps / sizeof DAS.Gui.ContrPanel.lbl_lamps[0], DPAL.DB_BG_Plbl);
315  DB_ColorAssign(DAS.Gui.ContrPanel.Plbl_SM, sizeof DAS.Gui.ContrPanel.Plbl_SM / sizeof DAS.Gui.ContrPanel.Plbl_SM[0], DPAL.DB_BG_Plbl);
316  DB_ColorAssign(DAS.Gui.ContrPanel.lbl, sizeof DAS.Gui.ContrPanel.lbl / sizeof DAS.Gui.ContrPanel.lbl[0] , DPAL.DB_BG_Plbl);
317 
318  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_Status, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
319  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_Script, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
320  }
321 
322  //Passive Labels FG
323  if (FlgFG && (FlgOBJ==3))
324  {
325  DB_Undo2Do_Colors(DPAL.DB_FG_Plbl, UDPAL.DB_FG_Plbl);
326 
327  DB_ColorAssign(DAS.Gui.ContrPanel.lbl_NP, sizeof DAS.Gui.ContrPanel.lbl_NP / sizeof DAS.Gui.ContrPanel.lbl_NP[0], DPAL.DB_FG_Plbl);
328  DB_ColorAssign(DAS.Gui.ContrPanel.Plbl_CS, sizeof DAS.Gui.ContrPanel.Plbl_CS / sizeof DAS.Gui.ContrPanel.Plbl_CS[0], DPAL.DB_FG_Plbl);
329  DB_ColorAssign(DAS.Gui.ContrPanel.Plbl_IE, sizeof DAS.Gui.ContrPanel.Plbl_IE / sizeof DAS.Gui.ContrPanel.Plbl_IE[0], DPAL.DB_FG_Plbl);
330  DB_ColorAssign(DAS.Gui.ContrPanel.Plbl_LS, sizeof DAS.Gui.ContrPanel.Plbl_LS / sizeof DAS.Gui.ContrPanel.Plbl_LS[0], DPAL.DB_FG_Plbl);
331  DB_ColorAssign(DAS.Gui.ContrPanel.Plbl_LT, sizeof DAS.Gui.ContrPanel.Plbl_LT / sizeof DAS.Gui.ContrPanel.Plbl_LT[0], DPAL.DB_FG_Plbl);
332 
333  DB_ColorAssign(DAS.Gui.ContrPanel.lbl_lamps, sizeof DAS.Gui.ContrPanel.lbl_lamps / sizeof DAS.Gui.ContrPanel.lbl_lamps[0], DPAL.DB_FG_Plbl);
334  DB_ColorAssign(DAS.Gui.ContrPanel.Plbl_SM, sizeof DAS.Gui.ContrPanel.Plbl_SM / sizeof DAS.Gui.ContrPanel.Plbl_SM[0], DPAL.DB_FG_Plbl);
335  DB_ColorAssign(DAS.Gui.ContrPanel.lbl, sizeof DAS.Gui.ContrPanel.lbl / sizeof DAS.Gui.ContrPanel.lbl[0] , DPAL.DB_FG_Plbl);
336 
337  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_Status, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
338  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_Script, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
339 
340  }
341 
342  //Forms BG
343  if (FlgBG && (FlgOBJ==4))
344  {
345  DB_Undo2Do_Colors(DPAL.DB_BG, UDPAL.DB_BG);
346  MObjectUnmap(CP_Sh);
347  MObjectMap(CP_Sh);
348 // MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.RwFrm0, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
349 // MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.TbFrm0, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
350 // MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.TbFrm1, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
351  }
352 
353  // Kapital Labels UP BG
354  if (FlgBG && (FlgOBJ==5))
355  {
356  DB_Undo2Do_Colors(DPAL.DB_BG_lblUP, UDPAL.DB_BG_lblUP);
357  DB_ColorAssign(DAS.Gui.ContrPanel.lblK, sizeof DAS.Gui.ContrPanel.lblK / sizeof DAS.Gui.ContrPanel.lblK[0] , DPAL.DB_BG_lblUP);
358  }
359 
360  // Kapital Labels UP FG
361  if (FlgFG && (FlgOBJ==5))
362  {
363  DB_Undo2Do_Colors(DPAL.DB_FG_lblUP, UDPAL.DB_FG_lblUP);
364  DB_ColorAssign(DAS.Gui.ContrPanel.lblK, sizeof DAS.Gui.ContrPanel.lblK / sizeof DAS.Gui.ContrPanel.lblK[0] , DPAL.DB_FG_lblUP);
365  }
366 
367  // Radio Button BG
368  if (FlgBG && (FlgOBJ==6))
369  {
370  DB_Undo2Do_Colors(DPAL.DB_BG_RButt, UDPAL.DB_BG_RButt);
371  DB_ColorAssign(LISTF.rb, sizeof LISTF.rb / sizeof LISTF.rb[0] , DPAL.DB_BG_RButt);
372  }
373 
374 
375  // Radio Button FG
376  if (FlgFG && (FlgOBJ==6))
377  {
378  DB_Undo2Do_Colors(DPAL.DB_FG_RButt, UDPAL.DB_FG_RButt);
379  DB_ColorAssign(LISTF.rb, sizeof LISTF.rb / sizeof LISTF.rb[0] , DPAL.DB_FG_RButt);
380  }
381 */
382 
383 }
+ Here is the caller graph for this function:

§ D_VRange()

void D_VRange ( char *  str,
int  val,
int  r,
int  g,
int  b 
)

Create and display the status bar.

Parameters
*strstring as title of the status bar
valvalue of the progressive index
rred color id (0-255)
ggreen color id (0-255)
bblu color id (0-255)

Definition at line 206 of file Utils.c.

References D_CloseVR(), D_VOpen, D_VRip, palette::DB_BG, HELV_SMALL, MCreateShell(), MCreateStatusBar(), MLoopWhileEvents(), MObjectResize(), MObjectSetBackgroundRGB(), MObjectSetCompositeHeight(), MObjectSetText(), MShellDestroy(), MShellRealize(), MShellSetWMCloseCallback(), MShellUnrealize(), MStatusBarSetPos(), MStatusBarSetSliderRGB(), SF_NO_MAXIMIZE, SF_NO_MINIMIZE, and SF_SAVEUNDER.

Referenced by DB_CalcFluxI(), DT_CorrFileEvora(), and DT_CorrHeader().

207 {
208  char msg[16];
209  static MOBJECT sts[16], shell[16];
210  if(D_VRip < 0 && val == 100)
211  return;
212  if(D_VRip < 0 && val > 0)
213  return;
214  if(val == 0)
215  {
216  if(D_VOpen) return;
217  D_VOpen = 1;
218  D_VRip++;
221  sts[D_VRip] = MCreateStatusBar(shell[D_VRip], " 0 %", 100, HELV_SMALL);
223  MStatusBarSetSliderRGB(sts[D_VRip], r, g, b);
225 
227  //MShellRealizeXY(shell[D_VRip], ShLoc[1][0], ShLoc[1][1]);
228  MShellRealize(shell[D_VRip]);
229  MObjectResize(shell[D_VRip], 300, 35);
230  // Chiama MGUI per modificare size shell
231  MLoopWhileEvents(0);
232 
233  }
234  else
235  {
236  if(val == 100)
237  {
238  MShellUnrealize(shell[D_VRip]);
239  MShellDestroy(shell[D_VRip]);
240  D_VRip--;
241  D_VOpen = 0;
242  }
243  else
244  {
245  sprintf(msg, "%d %%", val);
246  MObjectSetText(sts[D_VRip], msg);
247  MStatusBarSetPos(sts[D_VRip], val);
248 
249  }
250  MLoopWhileEvents(0);
251 
252  }
253 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
int D_VRip
Definition: Utils.c:148
palette DPAL
Definition: Utils.c:28
void MLoopWhileEvents(int discard)
void MShellRealize(MOBJECT obj)
#define SF_NO_MAXIMIZE
Definition: Mguidefs.h:1034
void MStatusBarSetPos(MOBJECT p, int pos)
int D_VOpen
Definition: Utils.c:148
#define SF_NO_MINIMIZE
Definition: Mguidefs.h:1036
void MShellUnrealize(MOBJECT obj)
void MObjectSetText(MOBJECT obj, const char *text)
void MShellDestroy(MOBJECT obj)
MOBJECT MCreateStatusBar(MOBJECT parent, const char *text, int max, MTFont font)
void MObjectSetCompositeHeight(MOBJECT obj, int h)
#define HELV_SMALL
Definition: Mguidefs.h:881
void MStatusBarSetSliderRGB(MOBJECT p, int r, int g, int b)
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
#define SF_SAVEUNDER
Definition: Mguidefs.h:1015
void * MOBJECT
Definition: Mguidefs.h:192
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void D_CloseVR(MOBJECT p, void *od, void *ad)
Callback closing the status bar.
Definition: Utils.c:140
void MObjectResize(MOBJECT obj, int w, int h)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_VRangeSim()

void D_VRangeSim ( int  id,
char *  str,
int  val,
int  r,
int  g,
int  b,
int  x,
int  y 
)

init progress bar during simultaneous positioning

Definition at line 258 of file Utils.c.

References D_CloseVR(), palette::DB_BG, DD_VOpen, DD_VRip, HELV_SMALL, MCreateShell(), MCreateStatusBar(), MLoopWhileEvents(), MObjectResize(), MObjectSetBackgroundRGB(), MObjectSetCompositeHeight(), MObjectSetText(), MShellDestroy(), MShellRealizeXY(), MShellSetWMCloseCallback(), MShellUnrealize(), MStatusBarSetPos(), MStatusBarSetSliderRGB(), SF_NO_MAXIMIZE, SF_NO_MINIMIZE, and SF_SAVEUNDER.

Referenced by SD_PosAADev(), SD_Position(), and SD_PosOMUDev().

259 {
260  char msg[16];
261  static MOBJECT sts[16][16], shell[16][16];
262  if(DD_VRip[id] < 0 && val == 100)
263  return;
264  if(DD_VRip[id] < 0 && val > 0)
265  return;
266  if(val == 0)
267  {
268  if(DD_VOpen[id]) return;
269  DD_VOpen[id] = 1;
270  DD_VRip[id]++;
272  MObjectSetBackgroundRGB(shell[id][DD_VRip[id]], DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
273  sts[id][DD_VRip[id]] = MCreateStatusBar(shell[id][DD_VRip[id]], " 0 %", 100, HELV_SMALL);
274  MObjectSetBackgroundRGB(sts[id][DD_VRip[id]], DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
275  MStatusBarSetSliderRGB(sts[id][DD_VRip[id]], r, g, b);
276  MObjectSetCompositeHeight(sts[id][DD_VRip[id]], 20);
277 
278  MShellSetWMCloseCallback(shell[id][DD_VRip[id]], D_CloseVR, 0L);
279  MShellRealizeXY(shell[id][DD_VRip[id]], x, y);
280  MObjectResize(shell[id][DD_VRip[id]], 300, 35);
281  // Chiama MGUI per modificare size shell
282  MLoopWhileEvents(0);
283 
284  }
285  else
286  {
287  if(val >= 100)
288  {
289  MShellUnrealize(shell[id][DD_VRip[id]]);
290  MShellDestroy(shell[id][DD_VRip[id]]);
291  DD_VRip[id]--;
292  DD_VOpen[id] = 0;
293  }
294  else
295  {
296  sprintf(msg, "%d %%", val);
297  MObjectSetText(sts[id][DD_VRip[id]], msg);
298  MStatusBarSetPos(sts[id][DD_VRip[id]], val);
299  }
300  }
301 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
palette DPAL
Definition: Utils.c:28
void MLoopWhileEvents(int discard)
#define SF_NO_MAXIMIZE
Definition: Mguidefs.h:1034
void MStatusBarSetPos(MOBJECT p, int pos)
#define SF_NO_MINIMIZE
Definition: Mguidefs.h:1036
void MShellUnrealize(MOBJECT obj)
void MObjectSetText(MOBJECT obj, const char *text)
void MShellDestroy(MOBJECT obj)
MOBJECT MCreateStatusBar(MOBJECT parent, const char *text, int max, MTFont font)
void MObjectSetCompositeHeight(MOBJECT obj, int h)
#define HELV_SMALL
Definition: Mguidefs.h:881
void MStatusBarSetSliderRGB(MOBJECT p, int r, int g, int b)
void MShellRealizeXY(MOBJECT obj, int x, int y)
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
#define SF_SAVEUNDER
Definition: Mguidefs.h:1015
void * MOBJECT
Definition: Mguidefs.h:192
int DD_VOpen[16]
Definition: Utils.c:151
int DD_VRip[16]
Definition: Utils.c:150
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void D_CloseVR(MOBJECT p, void *od, void *ad)
Callback closing the status bar.
Definition: Utils.c:140
void MObjectResize(MOBJECT obj, int w, int h)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_WriteInitLog()

int D_WriteInitLog ( char *  str)

writes devices errors(AMS, CCD...) on the Devices.log file.

Definition at line 144 of file Save.c.

Referenced by AMS_Error(), AMSINI_Err(), CCD_Error(), DAS_Error(), InitCCD_AMS(), InitTempAD(), Master_Error(), MGUIMain(), and WinRes().

145 {
146  FILE *fc;
147  char datebuf[9];
148  char timebuf[9];
149 
150  _strdate(datebuf);
151  _strtime(timebuf);
152 
153 
154  fc = fopen("LOG\\Devices.Log", "a");
155  if(fc < 0) return 1;
156 
157  fprintf(fc, " %s %s %s\n",datebuf, timebuf, str);
158 
159  fclose(fc);
160  return 0;
161 
162 }
+ Here is the caller graph for this function:

§ DAS_Error()

void DAS_Error ( int  c)

Definition at line 124 of file Errors.c.

References D_WriteInitLog(), DAS, DAS_Err, das::Gui, MGUITerm(), MMessageDialog(), MShellDestroy(), MShellUnrealize(), shells::Sh_Main, gui::Shells, and Status().

Referenced by SZA_FirstCalc().

125 {
126 
127  char buf[256];
128 
129  sprintf(buf,DAS_Err[c]);
130  D_WriteInitLog(buf);
131 
132  if(c > 1)
133  Status(buf);
134 
135 
136  switch (c)
137  {
138  case 2:
139  MMessageDialog ("DAS ERROR", "File '.\\Config\\Param.INI' not found,\n The program will be closed.\n You have to build the DAS.Paramini.INI and restart the Program ", "OK",NULL);
140  exit(0);
141  break;
142  case 3:
143  MMessageDialog ("DAS ERROR", "Init CCD and or AMS failed ", "OK",NULL);
146  MGUITerm();
147  exit(0);
148  break;
149 
150  }
151 /* if(c == 2)
152  {
153  MMessageDialog ("DAS ERROR", "File '.\\Config\\Param.INI' not found,\n The program will be closed.\n You have to build the DAS.Paramini.INI and restart the Program ", "OK",NULL);
154  exit(0);
155  }
156 
157 */
158 
159 
160 
161 
162 }
gui Gui
Graphic User Interface Structure.
shells Shells
Shells structure.
MOBJECT Sh_Main
Main shell for control panel.
das DAS
Definition: Chktemp.c:26
void MShellUnrealize(MOBJECT obj)
void MShellDestroy(MOBJECT obj)
void MGUITerm(void)
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
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
const char * DAS_Err[]
Definition: Errors.c:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DAS_Message()

void DAS_Message ( char *  str,
int  er 
)

Definition at line 74 of file Errors.c.

References palette::DB_BG_Plbl, palette::DB_FG_Plbl, DEFAULT_FONT, DPAL, lbl, LEFT_ALIGN, MCreateLabel(), MCreateShell(), MLabelSetAlignment(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), and MShellRealize().

Referenced by LoadSetDirs().

75 {
76  char buf[80];
77  MOBJECT sh, lbl;
78 
79  sprintf(buf, "DAS WARNING");
80 
81  sh = MCreateShell(buf, 0);
82  if ((DPAL.DB_BG_Plbl[0] != 0) & (DPAL.DB_BG_Plbl[1] != 0) & (DPAL.DB_BG_Plbl[2] != 0))
84  else
85  MObjectSetBackgroundRGB(sh, 220, 220, 220);
86 
87  lbl = MCreateLabel(sh, str, DEFAULT_FONT);
88  if ((DPAL.DB_FG_Plbl[0] != 0) & (DPAL.DB_FG_Plbl[1] != 0) & (DPAL.DB_FG_Plbl[2] != 0))
90  else
91  MObjectSetForegroundRGB(lbl, 0,0,0);
93 
94  MShellRealize(sh);
95 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lbl
Definition: DFileMan.c:42
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
void MShellRealize(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
palette DPAL
Definition: 2DPlot.c:27
#define DEFAULT_FONT
Definition: Mguidefs.h:877
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
MOBJECT MCreateShell(const char *title, int flags)
void MLabelSetAlignment(MOBJECT p, int align)
void * MOBJECT
Definition: Mguidefs.h:192
#define LEFT_ALIGN
Definition: Mguidefs.h:915
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_2DPlot()

void DB_2DPlot ( char *  title,
int  x,
int  y,
int  dx,
int  dy,
int  mode 
)

2D_Plot panel callback.

Definition at line 371 of file DAS_Spat_Conf.c.

References MDCreate2DPlot().

Referenced by BrowseLog(), and RunLogMode().

372 {
373 
374  MDCreate2DPlot(title, x, y, dx, dy, mode);
375 
376 }
MOBJECT MDCreate2DPlot(char *title, int x, int y, int dx, int dy, int mode)
create the 2D_Plot panel via the MDCreate_2DPlot.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_AMSposmode_CB()

void DB_AMSposmode_CB ( MOBJECT  o,
void *  a,
void *  v 
)

callback selecting the positioning mode for stepper motors ( sequential or simulaneaous)

Definition at line 1234 of file DAS_Spat_ConfCBs.c.

References das::DOption, MRButtonGetActivationStatus(), and optionini::smposmode.

Referenced by CONFP_opt_page5().

1235 {
1236 
1237  int er = 0;
1238  int c = (int) v;
1239 
1240 
1242 
1243  if(er)
1244  {
1245  switch (c)
1246  {
1247  case 0:
1248  DAS.DOption.smposmode = 1; //Simultaneous positioning
1249  break;
1250  case 1:
1251  DAS.DOption.smposmode = 0; //sequential positioning
1252  break;
1253  }
1254  }
1255 
1256 }
optionini DOption
Options for DAS execution.
int MRButtonGetActivationStatus(MOBJECT o)
das DAS
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_AMSProgBar_CB()

void DB_AMSProgBar_CB ( MOBJECT  o,
void *  a,
void *  v 
)

callback selecting if show or not the progress bar for motor positioning

Definition at line 1119 of file DAS_Spat_ConfCBs.c.

References optionini::amsprogbar, das::DOption, and MRButtonGetActivationStatus().

Referenced by CONFP_opt_page5().

1120 {
1121 
1122  int er = 0;
1123  int c = (int) v;
1124 
1125 
1127 
1128  if(er)
1129  {
1130  switch (c)
1131  {
1132  case 0:
1133  DAS.DOption.amsprogbar = 0; //hide prog bars
1134  break;
1135  case 1:
1136  DAS.DOption.amsprogbar = 1; //show prog bars
1137  break;
1138  }
1139  }
1140 
1141 }
optionini DOption
Options for DAS execution.
int MRButtonGetActivationStatus(MOBJECT o)
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
das DAS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_Ask()

int DB_Ask ( char *  tit,
char *  bmp,
char *  label,
char *  pre,
int  len,
char *  pbtype 
)

Input Shell Create an input box.

Returns
int

Definition at line 5373 of file CreateForms.c.

References AskBuff, AskFlg, CENTER_ALIGN, DB_AskCB(), palette::DB_BG, palette::DB_BG_Plbl, DB_CloseAsk(), palette::DB_FG_Plbl, palette::DB_UnSel, F_ATT_NONE, False, FIXED_SMALL, HELV_SMALL, lbl, MBottomAttach(), MCreateClippedEdit(), MCreateColForm(), MCreateEdit(), MCreateLabel(), MCreatePButton(), MCreatePixmapFromFile(), MCreateRowForm(), MCreateShell(), MCreateTableForm(), MEditSetActCallback(), MLabelSetAlignment(), MLoopWhileFlag(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MPButtonSetCallback(), MShellDestroy(), MShellRealizeXY(), MShellSetWMCloseCallback(), MShellUnrealize(), SF_MODAL, TOP_ALIGN, True, UNDEF_ALIGN, WS_ETCHED_OUT, and WS_NONE.

Referenced by DB_HorComm_CB(), and DB_KeyB_CB().

5374 {
5375 
5376  MOBJECT _shell005;
5377  MOBJECT _rowform005;
5378  MOBJECT _colform005;
5379  MOBJECT _tablefrm005;
5380  MOBJECT pbut;
5381  MOBJECT edt;
5382  MOBJECT pix;
5383  MOBJECT lbl;
5384 
5385  int er = 0;
5386 
5387  AskBuff = pre;
5388 
5389 
5390  _shell005 = MCreateShell(tit, SF_MODAL);
5391  MObjectSetBackgroundRGB(_shell005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
5392 
5393 
5394  _colform005 = MCreateColForm(_shell005);
5395  MObjectSetBackgroundRGB(_colform005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
5396  MObjectSetShadow(_colform005, WS_NONE, 0, 0);
5397 
5398  _rowform005 = MCreateRowForm(_colform005);
5399  MBottomAttach(_rowform005, F_ATT_NONE, 1, NULL);
5400  MObjectAlign(_rowform005, UNDEF_ALIGN, TOP_ALIGN);
5401  MObjectSetBackgroundRGB(_rowform005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
5402  MObjectSetShadow(_rowform005, WS_NONE, 0, 0);
5403  MObjectSetResize(_rowform005, True, True);
5404 
5405 
5406  _tablefrm005 = MCreateTableForm(_rowform005, 2);
5407  MObjectSetBackgroundRGB(_tablefrm005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
5408  MObjectSetResize(_tablefrm005, True, False);
5409 
5410  lbl = MCreateLabel(_tablefrm005, label, FIXED_SMALL);
5414 
5415  if(strlen(bmp) > 0)
5416  pix = MCreatePixmapFromFile(_tablefrm005, bmp);
5417 
5418  if(len < 16)
5419  {
5420  edt = MCreateEdit(_tablefrm005, pre, len, FIXED_SMALL);
5421  MObjectSetForegroundRGB(edt, 255, 255, 255);
5422  MObjectSetBackgroundRGB(edt, 0, 0, 0);
5423  MObjectSetShadow(edt, WS_ETCHED_OUT, 2, 1);
5424  //MObjectSetCompositeWidth(edt, 150);
5425 
5426 
5427  }
5428  else
5429  {
5430  edt = MCreateClippedEdit(_tablefrm005, pre, len, 18, FIXED_SMALL);
5431  MObjectSetForegroundRGB(edt, 255, 255, 255);
5432  MObjectSetBackgroundRGB(edt, 0, 0, 0);
5433  MObjectSetShadow(edt, WS_ETCHED_OUT, 2, 1);
5434  MObjectSetCompositeWidth(edt, 150);
5435  }
5436 
5438 // MObjectAddEventNotifyCallback(_shell005, (OBJ_EVENT_CB) DB_Ask_SheelESC, EM_KEY_PRESS, NULL);
5439 
5440 
5441  pbut = MCreatePButton(_colform005, pbtype, HELV_SMALL);
5442  MPButtonSetCallback(pbut, DB_AskCB, (void *) edt);
5444  MObjectSetCompositeWidth(pbut, 90);
5445 
5446 
5447 
5448  MShellSetWMCloseCallback(_shell005, DB_CloseAsk, NULL);
5449 
5450 
5451  MShellRealizeXY(_shell005, 0, 0);
5452 
5453  AskFlg = 0;
5454  MLoopWhileFlag(&AskFlg, 0);
5455  if(AskBuff[0] == 0) er = 1;
5456 
5457  MShellUnrealize(_shell005);
5458  MShellDestroy(_shell005);
5459 // MShellRaise(LIS.Sh_KeyB);
5460  return er;
5461 }
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 MObjectSetShadow(MOBJECT obj, int type, int in, int out)
MOBJECT MCreateEdit(MOBJECT parent, const char *text, int len, MTFont font)
void MBottomAttach(MOBJECT child, int att_type, int off, MOBJECT obj)
#define WS_ETCHED_OUT
Definition: Mguidefs.h:960
void DB_CloseAsk(MOBJECT p, void *od, void *ad)
Input Shell Callback Callback for the Input Shell destruction.
Definition: CreateForms.c:5483
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
void DB_AskCB(MOBJECT p, void *od, void *ad)
Input Shell Callback Callback for the Input Shell.
Definition: CreateForms.c:5462
MOBJECT MCreateClippedEdit(MOBJECT parent, const char *text, int len, int clip_len, MTFont font)
void MShellUnrealize(MOBJECT obj)
#define UNDEF_ALIGN
Definition: Mguidefs.h:920
void(* OBJ_STRING_CB)(MOBJECT obj, char *str, void *ad)
Definition: Mguidefs.h:1457
void MShellDestroy(MOBJECT obj)
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define CENTER_ALIGN
Definition: Mguidefs.h:917
#define HELV_SMALL
Definition: Mguidefs.h:881
char * AskBuff
Definition: CreateForms.c:5369
void MEditSetActCallback(MOBJECT edit, OBJ_STRING_CB cb, void *data)
#define FIXED_SMALL
Definition: Mguidefs.h:878
#define SF_MODAL
Definition: Mguidefs.h:1019
MOBJECT MCreateColForm(MOBJECT parent)
palette DPAL
Definition: CreateForms.c:88
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
void MShellRealizeXY(MOBJECT obj, int x, int y)
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
static int AskFlg
Definition: CreateForms.c:5370
void MLabelSetAlignment(MOBJECT p, int align)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
void MLoopWhileFlag(int *pflag, int value)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
MOBJECT MCreateRowForm(MOBJECT parent)
#define TOP_ALIGN
Definition: Mguidefs.h:918
#define F_ATT_NONE
Definition: Mguidefs.h:1106
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_Ask_SheelESC()

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

Input Shell Callback Callback for the Input Shell destruction at the pression of the ESC key.

Returns
int

Definition at line 5496 of file CreateForms.c.

References AskBuff, AskFlg, ESC, and MKeyEvent::keycode.

5497 {
5498 
5499  switch (pe->keycode)
5500  {
5501  case ESC:
5502  {
5503  AskBuff[0] = 0;
5504  AskFlg = 1;
5505  }
5506  }
5507 }
unsigned int keycode
Code for the pressed key.
Definition: Mguidefs.h:541
#define ESC
Definition: KEYCODES.H:265
char * AskBuff
Definition: CreateForms.c:5369
static int AskFlg
Definition: CreateForms.c:5370

§ DB_AskCB()

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

Input Shell Callback Callback for the Input Shell.

Returns
int

Definition at line 5462 of file CreateForms.c.

References AskBuff, AskFlg, DB_GetCCD(), MObjectGetText(), and TExp.

Referenced by DB_Ask().

5463 {
5464 
5465  char buff[32], tb[32];
5466 
5467  MOBJECT c = ad;
5468 
5469  MObjectGetText(c, buff);
5470 
5471  MObjectGetText(p, tb);
5472 
5473  AskBuff[0] = 0;
5474  AskFlg = 1;
5475 
5476 
5477  sscanf(buff, "%lf", &TExp);
5478  if(strcmp(tb, "Get Light") == 0)
5479  DB_GetCCD(1);
5480  else if(strcmp(tb, "Get Dark") == 0)
5481  DB_GetCCD(0);
5482 }
char * MObjectGetText(MOBJECT obj, char *text)
char * AskBuff
Definition: CreateForms.c:5369
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
static int AskFlg
Definition: CreateForms.c:5370
static double p
Definition: SOLPOS.C:131
void * MOBJECT
Definition: Mguidefs.h:192
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_CalcFluxI()

int DB_CalcFluxI ( char *  nomefile)

Definition at line 328 of file Utils.c.

References AllocUSMat(), CalcFluxIndex(), spectrumheader::ccdtexp, D_VRange(), ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, bil::DFILEM, bil::DPLOT, IDX, IDY, d_view::ImatGraf, spectrumheader::mirpos, MLoopWhileEvents(), O_BINARY, ReadHeader_BIN(), ReadIMG_BIN(), SAVECNT, bil::SPH, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, spectrumheader::wavelen, and d_fileman::WORKDIRECTORY.

Referenced by DT_FluxIndex(), and FluxIndexCB().

329 {
330 
331  FILE *fs;
332  FILE *fd;
333  char buf[512],str[512];
334  int er = 0, i, k;
335  char string[4] = ".FIN";
336  int fb;
337  double fluxindex;
338  char filedatan[256];
339  long numspettri;
340 
341 
342 // Lettura file elenco
343  i=0;
344  fs = fopen(nomefile, "r");
345  if(fs < 0) return 1;
346  while( !feof( fs ) )
347  {
348  fgets(str, 80, fs);
349  i++;
350  }
351  fclose(fs);
352 
353  numspettri = i * SAVECNT;
354 
355  D_VRange("Flux Index Calculation",0, 0, 222, 235);
356 
357 
358  fs = fopen(nomefile, "r");
359  if(fs < 0) return 2;
360 
361  //Read the file names
362  k = 0;
363  while( !feof( fs ) )
364  {
365  fscanf(fs, "%s", filedatan);
366  // build the complete file name
367 // strcpy(buf, BIL.DFILEM.WORKDIRECTORY);
368  strcat(buf, filedatan);
369 
370 
371  fb = open(filedatan, O_RDONLY | O_BINARY, S_IREAD );
372 
373  while( !eof( fb ) )
374  {
375 
376  MLoopWhileEvents(2);
377  k ++;
378  if((k % 10) == 0 && k > 0)
379  D_VRange(NULL, (long) k * 100 / numspettri, 0, 222, 235 );
380  er = ReadHeader_BIN(fb);
381 
382  if(BIL.DPLOT.ImatGraf == 0)
384 
386 
387  if( (strcmp(BIL.SPH.mirpos,"HorizDX") == 0) | (strcmp(BIL.SPH.mirpos,"Zenith") == 0) )
388  {
389  //Filter Data
390  //if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
391  // BlindPix_1 = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
392 
393  //FilterData(BIL.DPLOT.ImatGraf, IDX, IDY, 15, BlindPix_1);
394 
395 
396  fluxindex = CalcFluxIndex( BIL.DPLOT.ImatGraf, IDX , IDY/2, (float)BIL.SPH.ccdtexp);
397 
398  sprintf(buf,"%d.FIN", BIL.SPH.wavelen);
399  strcpy(str, BIL.DFILEM.WORKDIRECTORY);
400  strcat(str,buf);
401  //MMessageDialog("Full FileName:", str, "ok", NULL);
402 
403  fd = fopen(str, "a");
404  if(fd < 0) return 1;
405 
406  sprintf(str,"%d/%02d/%02d %02d:%02d:%02d %d %lf\n", BIL.SPH.DATE.da_year, BIL.SPH.DATE.da_mon, BIL.SPH.DATE.da_day, BIL.SPH.TIME.ti_hour, BIL.SPH.TIME.ti_min, BIL.SPH.TIME.ti_sec, BIL.SPH.wavelen, fluxindex);
407  fprintf(fd, "%s", str);
408 
409  fclose(fd);
410  }
411 
412 
413 
414  }
415 // D_VRange(NULL, 100, 128, 254, 128);
416  close (fb);
417 
418 
419 
420  }
421 
422  D_VRange(NULL, 100, 0,0,0);
423 
424  fclose(fs);
425 
426  return 0;
427 }
struct ddate DATE
Definition: bildef.h:134
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
void MLoopWhileEvents(int discard)
#define O_BINARY
Definition: Dildef.h:201
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
void D_VRange(char *str, int val, int r, int g, int b)
Create and display the status bar.
Definition: Utils.c:206
unsigned char ti_hour
Definition: bildef.h:79
bil BIL
Definition: Utils.c:27
d_fileman DFILEM
Definition: bildef.h:257
#define SAVECNT
maximum number of spectra in one file
unsigned char ti_sec
Definition: bildef.h:81
d_view DPLOT
Definition: bildef.h:254
int ReadHeader_BIN(int fd)
read the BINARY header of the stored spectrum
Definition: Spat_Plot.c:1798
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
void ReadIMG_BIN(int fd, unsigned short *mat, int hp, int vp)
read the BINARY stored spectrum
Definition: Spat_Plot.c:1166
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
double CalcFluxIndex(unsigned short mis[], int dx, int dy, float te)
calculates the Flux Index of a measurement
Definition: Utils.c:306
unsigned short * ImatGraf
Definition: bildef.h:176
float ccdtexp
Definition: bildef.h:140
unsigned char ti_min
Definition: bildef.h:78
unsigned char da_mon
Definition: bildef.h:86
char WORKDIRECTORY[_MAX_PATH]
Definition: bildef.h:202
unsigned char da_day
Definition: bildef.h:85
short int da_year
Definition: bildef.h:84
unsigned short * AllocUSMat(int hp, int vp)
Definition: Spat_Plot.c:1994
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_CellExposeCB()

void DB_CellExposeCB ( MOBJECT  obj,
MEvent pexp,
void *  a_data 
)

display selected Color

Definition at line 788 of file DAS_Spat_ConfCBs.c.

References cell_color, MDrawFilledBox(), MObjectGetHeight(), MObjectGetWidth(), and PaletteMode.

Referenced by MDCreateDASConfig().

789 {
790  int hsize, wsize;
791 
792  wsize = MObjectGetWidth(obj);
793  hsize = MObjectGetHeight(obj);
794  if (PaletteMode)
795  MDrawFilledBox(obj, 0, 0, wsize, hsize, cell_color);
796 }
int PaletteMode
Definition: DAS_Spat.c:158
void MDrawFilledBox(MOBJECT p, int x, int y, int w, int h, MTColor bgc)
int MObjectGetHeight(MOBJECT obj)
int MObjectGetWidth(MOBJECT obj)
MTColor cell_color
Definition: DAS_Spatram.h:3059
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_CellResizeCB()

void DB_CellResizeCB ( MOBJECT  obj,
DRAWAREA_PREF pref,
void *  a_data 
)

display selected Color

Definition at line 798 of file DAS_Spat_ConfCBs.c.

References DRAWAREA_PREF::new_h, and DRAWAREA_PREF::old_h.

Referenced by MDCreateDASConfig().

799 {
800  pref->new_h = pref->old_h;
801 }
+ Here is the caller graph for this function:

§ DB_ChangeColorCellCB()

void DB_ChangeColorCellCB ( MOBJECT  o,
MVALUE  o_data,
void *  a_data 
)

draw the object 'o' with the selected color

Definition at line 543 of file DAS_Spat_ConfCBs.c.

References b_c, b_label, cell_color, frm3_dr1, g_c, g_label, MObjectSetBackgroundRGB(), MObjectSetText(), MSetCellColor(), PaletteMode, r_c, and r_label.

Referenced by MDCreateDASConfig().

544 {
545  char str[16];
546 
547  switch ((int) a_data)
548  {
549  case 0:
550  r_c = (int) o_data;
551  sprintf(str, "%03d", r_c);
552  MObjectSetText(r_label, str);
553  break;
554  case 1:
555  g_c = (int) o_data;
556  sprintf(str, "%03d", g_c);
557  MObjectSetText(g_label, str);
558  break;
559  case 2:
560  b_c = (int) o_data;
561  sprintf(str, "%03d", b_c);
562  MObjectSetText(b_label, str);
563  break;
564  }
565  if (PaletteMode)
567  else
569 }
int PaletteMode
Definition: DAS_Spat.c:158
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT r_label
Definition: DAS_Spatram.h:3058
void MObjectSetText(MOBJECT obj, const char *text)
MOBJECT g_label
Definition: DAS_Spatram.h:3058
int b_c
Definition: DAS_Spatram.h:3060
int r_c
Definition: DAS_Spatram.h:3060
MTColor cell_color
Definition: DAS_Spatram.h:3059
MOBJECT frm3_dr1
Definition: DAS_Spatram.h:3058
int g_c
Definition: DAS_Spatram.h:3060
MOBJECT b_label
Definition: DAS_Spatram.h:3058
void MSetCellColor(MTColor c, int r, int g, int b)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_ChooseButtons()

void DB_ChooseButtons ( int  w)

Definition at line 2560 of file CreateForms.c.

References DB_KB_ButtonActive(), DBDEMO, HELP, MANUAL, OFFLINEPLOT, PRGFILE, TEMPORIZED, TESTAD, TESTAMS, and TESTCCD.

Referenced by SZA_FirstCalc().

2561 {
2562 
2563  int c = w;
2564 
2565  switch(c)
2566  {
2567  case TEMPORIZED :
2568  break;
2569  case PRGFILE:
2570  break;
2571  case TESTAMS:
2572  //DB_KB_ButtonActive(c);
2573  break;
2574  case OFFLINEPLOT:
2575  DB_KB_ButtonActive(c);
2576 
2577  break;
2578  case TESTCCD:
2579  break;
2580  case HELP:
2581  break;
2582  case DBDEMO :
2583  break;
2584  case MANUAL:
2585  break;
2586  case TESTAD:
2587  break;
2588 
2589  }
2590 
2591 
2592 
2593 }
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
#define TESTCCD
execution for testing CCD Camera
#define HELP
Help mode.
#define DBDEMO
execution in demo mode
#define TEMPORIZED
execution driven by MASTER file
#define OFFLINEPLOT
execution for archived data visualisation
#define PRGFILE
execution driven by *.prg file
#define TESTAD
execution for testing PC 104 AD converter
#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:

§ DB_CloseAsk()

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

Input Shell Callback Callback for the Input Shell destruction.

Returns
int

Definition at line 5483 of file CreateForms.c.

References AskFlg, MObjectGetText(), and TExp.

Referenced by DB_Ask().

5484 {
5485 
5486  char buff[80];
5487 
5488  MObjectGetText(p, buff);
5489  sscanf(buff, "%lf", &TExp);
5490 
5491 // AskBuff[0] = 0;
5492  AskFlg = 1;
5493 
5494 }
char * MObjectGetText(MOBJECT obj, char *text)
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
static int AskFlg
Definition: CreateForms.c:5370
static double p
Definition: SOLPOS.C:131
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_CloseCOM()

int DB_CloseCOM ( void  )

Close the previously opened COM port.

Definition at line 460 of file Init.c.

References DXL_Close().

461 {
462  int er;
463 
464  er = DXL_Close();
465  return er;
466 }
int DXL_Close(void)
Close COM.
Definition: Dxl.c:1258
+ Here is the call graph for this function:

§ DB_ColorAssign()

void DB_ColorAssign ( MOBJECT  a[],
int  numel,
short  tc[] 
)

Assign to the selected object the chosen color.

Definition at line 204 of file DAS_Spat_ConfCBs.c.

References CP_Sh, FlgBG, FlgFG, MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), and MObjectSetTransparency().

205 {
206  int i;
207 
208  for (i=0; i < numel; i++)
209  {
210  if(FlgBG)
211  {
212  MObjectSetBackgroundRGB(a[i], tc[0], tc[1], tc[2]);
213  MObjectSetTransparency(a[i],0);
214  }
215  if(FlgFG)
216  {
217  MObjectSetForegroundRGB(a[i], tc[0], tc[1], tc[2]);
218  MObjectSetTransparency(a[i],0);
219  }
220  }
221 
222 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
int FlgBG
Definition: DAS_Spat_Conf.c:91
int FlgFG
Definition: DAS_Spat_Conf.c:92
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
+ Here is the call graph for this function:

§ DB_ColorPick()

void DB_ColorPick ( MOBJECT  o)

Definition at line 397 of file DAS_Spat_ConfCBs.c.

References b_sbar, FlgBG, FlgFG, g_sbar, MObjectBackgroundColor(), MObjectForegroundColor(), MQueryColor(), MScrollBarSetPos(), and r_sbar.

Referenced by ColObjCB().

398 {
399 
400  int r, g, b;
401 
402  if(FlgBG)
403  MQueryColor(MObjectBackgroundColor(o), &r, &g, &b);
404  if(FlgFG)
405  MQueryColor(MObjectForegroundColor(o), &r, &g, &b);
406 
407  MScrollBarSetPos(r_sbar, (long) r);
408  MScrollBarSetPos(g_sbar, (long) g);
409  MScrollBarSetPos(b_sbar, (long) b);
410 }
void MQueryColor(MTColor col, int *pr, int *pg, int *pb)
MOBJECT b_sbar
Definition: DAS_Spatram.h:3057
MOBJECT r_sbar
Definition: DAS_Spatram.h:3057
MTColor MObjectBackgroundColor(MOBJECT obj)
int FlgBG
Definition: DAS_Spat_Conf.c:91
MTColor MObjectForegroundColor(MOBJECT obj)
void MScrollBarSetPos(MOBJECT p, long pos)
int FlgFG
Definition: DAS_Spat_Conf.c:92
MOBJECT g_sbar
Definition: DAS_Spatram.h:3057
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_Column()

int DB_Column ( char *  sourcefilename)

Column format.

Parameters
*sourcefilenamesource file name

Definition at line 1109 of file Save.c.

References AllocUSMat(), D_VRange(), DI_FindExtName(), bil::DPLOT, doas::FFTFilter, FilterData(), tools::FlagFilter, IDX, IDY, d_view::ImatGraf, O_BINARY, ReadHeader_ASCII(), ReadHeader_BIN(), ReadIMG(), ReadIMG_BIN(), SAVECNT, TOOLS, flag::Wl, and WriteColumn().

Referenced by D_PButt_CB(), and DT_ColFormat().

1110 {
1111 
1112 
1113  FILE *fs, *fd;
1114  char buf[256];
1115  int er = 0, k = 0;
1116  char string[4] = ".COL";
1117  int lunstr;
1118  char fext[4];
1119 
1120  int fb;
1121  fext[0] = '\0';
1122 
1123 // MMessageDialog("Full FileName:", nomefile, "ok", NULL);
1124 
1125  lunstr = strlen(sourcefilename);
1126  strcpy(buf,sourcefilename);
1127 
1128  strncpy( buf + (lunstr - 4), string, 4 );
1129 
1130  fd = fopen(buf, "a");
1131  if(fd < 0) return 1;
1132 
1133 
1134  DI_FindExtName(sourcefilename, fext);
1135 
1136  D_VRange("Column FORMAT processing", 0, 128, 254, 128);
1137 
1138 
1139  if( (strcmp(fext,".dat") == 0) |(strcmp(fext,".Dat") == 0) )
1140  {
1141  fs = fopen(sourcefilename, "r");
1142  if(fs < 0) return 1;
1143 
1144 
1145  while( !feof( fs ) )
1146  {
1147  /*
1148  mod = 1 --> Assign Header to plot labels
1149  mod = 0 --> Read header only
1150  */
1151  ReadHeader_ASCII(0, fs);
1152  if(BIL.DPLOT.ImatGraf == 0)
1154 
1155  ReadIMG(fs, BIL.DPLOT.ImatGraf, IDX, IDY);
1156 
1157  if(TOOLS.FlagFilter)
1159 
1160  WriteColumn( FLAG.Wl, fd);
1161  k++;
1162  if((k % 5) == 0 && k > 0)
1163  D_VRange(NULL, (long) k * 100 / SAVECNT , 128, 254, 128);
1164  }
1165 
1166 // D_VRange(NULL, 100, 128, 254, 128);
1167  fclose(fs);
1168  }
1169  else if( (strcmp(fext,".bif") == 0) | (strcmp(fext,".Bif") == 0) )
1170  {
1171  fb = open(sourcefilename, O_RDONLY | O_BINARY, S_IREAD );
1172 
1173  while( !eof( fb ) )
1174  {
1175 
1176  er = ReadHeader_BIN(fb);
1177 
1178  if(BIL.DPLOT.ImatGraf == 0)
1180 
1182 
1183  if(TOOLS.FlagFilter)
1185 
1186  WriteColumn( FLAG.Wl, fd);
1187  k++;
1188  if((k % 5) == 0 && k > 0)
1189  D_VRange(NULL, (long) k * 100 / SAVECNT , 128, 254, 128);
1190 
1191  }
1192 // D_VRange(NULL, 100, 128, 254, 128);
1193  close (fb);
1194 
1195  }
1196  D_VRange(NULL, 100, 128, 254, 128);
1197  fclose(fd);
1198 
1199  return 0;
1200 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
void WriteColumn(int mod, FILE *fd)
Definition: Save.c:850
void D_VRange(char *str, int val, int, int g, int b)
Create and display the status bar.
Definition: Utils.c:206
#define O_BINARY
Definition: Dildef.h:201
int Wl
Flag for the units on the X scale plot.
int FilterData(unsigned short *mat, int horpix, int verpix, int filw, int bp)
Definition: FFT.c:250
doas DOAS
Definition: Save.c:27
void ReadIMG(FILE *file, unsigned short *mat, int hp, int vp)
Read ASCII Image (Spectral Data only) .
Definition: Spat_Plot.c:1206
int ReadHeader_ASCII(int mod, FILE *fd)
Read ASCII Header of the measurement. .
Definition: Spat_Plot.c:1877
#define SAVECNT
maximum number of spectra in one file
d_view DPLOT
Definition: bildef.h:254
bil BIL
Definition: Save.c:26
int ReadHeader_BIN(int fd)
read the BINARY header of the stored spectrum
Definition: Spat_Plot.c:1798
void ReadIMG_BIN(int fd, unsigned short *mat, int hp, int vp)
read the BINARY stored spectrum
Definition: Spat_Plot.c:1166
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
int FFTFilter
Fast Fourier Trasform Filter windows.
Definition: DOASdef.h:25
int FlagFilter
flag for filterinf
unsigned short * ImatGraf
Definition: bildef.h:176
flag FLAG
flags structure
Definition: Save.c:25
C_DEF void DI_FindExtName(char *fullname, char *fext)
unsigned short * AllocUSMat(int hp, int vp)
Definition: Spat_Plot.c:1994
tools TOOLS
Definition: CreateForms.c:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_DefectPixCorr()

void DB_DefectPixCorr ( void  )

Apply thew pixel correction.
.

Choose the buttons to enable/disable. Repaced with DB_KB_ButtonActive();
.

Definition at line 1568 of file Procedures.c.

References CItem, MaskCol(), MaskedCol, MaskedPix, MaskedRow, MaskPix(), MaskRow(), PItem, and RItem.

Referenced by DB_GetCCD(), and E_Dark().

1569 {
1570  int i;
1571 
1572 
1573  for(i=0;i<PItem;i++)
1574  {
1575 
1576  MaskPix(MaskedPix[i][0], MaskedPix[i][1], MaskedPix[i][2], MaskedPix[i][3], MaskedPix[i][4], MaskedPix[i][5]);
1577 
1578  }
1579 
1580 
1581  for(i=0;i<CItem;i++)
1582  {
1583 
1584  MaskCol(MaskedCol[i][0], MaskedCol[i][1], MaskedCol[i][2], MaskedCol[i][3], MaskedCol[i][4]);
1585 
1586  }
1587 
1588 
1589  for(i=0;i<RItem;i++)
1590  {
1591 
1592  MaskRow(MaskedRow[i][0], MaskedRow[i][1], MaskedRow[i][2], MaskedRow[i][3], MaskedRow[i][4]);
1593 
1594 
1595  }
1596 
1597 }
void MaskPix(int a, int b, int c, int d, int e, int f)
Definition: Procedures.c:1538
void MaskRow(int a, int b, int c, int d, int e)
Definition: Procedures.c:1557
int MaskedPix[100][6]
Masked pixel&#39;s array.
Definition: Load.c:37
int RItem
number of Pixel, Column, Row Item
Definition: Load.c:40
int CItem
Definition: Load.c:40
int PItem
Definition: Load.c:40
void MaskCol(int a, int b, int c, int d, int e)
Definition: Procedures.c:1548
int MaskedRow[100][6]
Masked rows array.
Definition: Load.c:39
int MaskedCol[100][6]
Masked column array.
Definition: Load.c:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_DispBlindPixCB()

void DB_DispBlindPixCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Display Blind Pixel Callback
Set if the blind pixels will be displayed or not on the plot window.

Definition at line 3697 of file DAS_Spat_ConfCBs.c.

References flag::DispBlindPix.

Referenced by CONFP_opt_page3().

3698 {
3699  int c = (int) a_data;
3700 
3701  switch(c)
3702  {
3703  case 0 :
3704  FLAG.DispBlindPix = 0;
3705  break;
3706  case 1:
3707  FLAG.DispBlindPix = 1;
3708  break;
3709 
3710  }
3711 }
flag FLAG
int DispBlindPix
Display Blind Pix: 0 = NO, 1 = Yes.
+ Here is the caller graph for this function:

§ DB_Do2Undo_Colors()

void DB_Do2Undo_Colors ( short  docol[],
short  undocol[] 
)

Definition at line 578 of file DAS_Spat_ConfCBs.c.

References b_c, g_c, and r_c.

579 {
580 
581  int i;
582  for (i = 0; i < 3;i++)
583  {
584  undocol[i] = docol[i];
585  }
586 
587 
588  docol[0] = r_c;
589  docol[1] = g_c;
590  docol[2] = b_c;
591 
592 }
int b_c
Definition: DAS_Spatram.h:3060
int r_c
Definition: DAS_Spatram.h:3060
int g_c
Definition: DAS_Spatram.h:3060

§ DB_Do2Undo_Fonts()

void DB_Do2Undo_Fonts ( MTFont  dofont,
MTFont  undofont 
)

Definition at line 1358 of file DAS_Spat_ConfCBs.c.

1359 {
1360 
1361  undofont = dofont;
1362 
1363 }
int undofont

§ DB_EqTypeCB()

void DB_EqTypeCB ( MOBJECT  o,
void *  a,
void *  v 
)

Definition at line 584 of file DAS_Spat_Conf.c.

References d_fileman::CONFIGDIRCOMMON, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, paramini::EqType, LoadDB_DispCoeff(), MRButtonGetActivationStatus(), das::Paramini, and WriteEquipini().

Referenced by CONFP_param_page1().

585 {
586 
587  int er = 0;
588  int c = (int) v;
589 
590 
592 
593  if(er)
594  {
595  switch (c)
596  {
597  case 0:
598  DAS.Paramini.EqType = 0; //SPATRAM;
599  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAM",BIL.DFILEM.CONFIGDIRCOMMON);
600  break;
601  case 1:
602  DAS.Paramini.EqType = 1; //TROPOGAS;
603  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\TROPOGAS",BIL.DFILEM.CONFIGDIRCOMMON);
604  break;
605  case 2:
606  DAS.Paramini.EqType = 2; //LIS;
608  break;
609  case 3:
610  DAS.Paramini.EqType = 3; //SPATRAMPLUS;
611  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAMPLUS",BIL.DFILEM.CONFIGDIRCOMMON);
612  break;
613  case 4:
614  DAS.Paramini.EqType = 4; //GASCODNG1;
615  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG1",BIL.DFILEM.CONFIGDIRCOMMON);
616  break;
617  case 5:
618  DAS.Paramini.EqType = 5; //GASCODOffAxis;
619  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODOA",BIL.DFILEM.CONFIGDIRCOMMON);
620  break;
621  case 6:
622  DAS.Paramini.EqType = 6; //GASCODNG2;
623  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG2",BIL.DFILEM.CONFIGDIRCOMMON);
624  break;
625  case 7:
626  DAS.Paramini.EqType = 7; //GASCODNG3;
627  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG3",BIL.DFILEM.CONFIGDIRCOMMON);
628  break;
629  case 8:
630  DAS.Paramini.EqType = 8; //GASCODNG4;
631  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG4",BIL.DFILEM.CONFIGDIRCOMMON);
632  break;
633  case 9:
634  DAS.Paramini.EqType = 9; //SPATRAM2;
635  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAM2",BIL.DFILEM.CONFIGDIRCOMMON);
636  break;
637  case 10:
638  DAS.Paramini.EqType = 10; //SPATRAM3;
639  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAM3",BIL.DFILEM.CONFIGDIRCOMMON);
640  break;
641  }
642  }
643  WriteEquipini();
644 
645  er = LoadDB_DispCoeff();
646 
647 
648 
649 }
int WriteEquipini(void)
Write equipment.ini file .
int MRButtonGetActivationStatus(MOBJECT o)
d_fileman DFILEM
Definition: bildef.h:257
bil BIL
Definition: DAS_Spat_Conf.c:51
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
das DAS
Definition: DAS_Spat_Conf.c:56
int LoadDB_DispCoeff(void)
Load dispersion parameters. Procedure that load the dispersion parameters from file {homedir}/DOAS/Di...
Definition: Load.c:234
int EqType
Spectrometer Type.
char CONFIGDIRCOMMON[_MAX_PATH]
Definition: bildef.h:206
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:

§ DB_Fil_CB()

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

callback for filter wheel positioning in Filter shell

Parameters
pcalling push button MObject
*adcalling push button number

Definition at line 6120 of file CreateForms.c.

References paramini::EqType, Fil_Code, Fil_Code8H, Fil_CodeNG, Fil_CodeNG1, Fil_CodeTropo, FilBuff, FilFlg, FilSet, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, LIS_, das::Paramini, and TROPOGAS.

Referenced by MDCreateSh_Fil(), and MDCreateSh_NDFil().

6121 {
6122  int c = (int) ad;
6123 
6124  if(DAS.Paramini.EqType == LIS_)
6125  FilBuff = Fil_Code8H[c];
6126  else
6127  {
6128  if(DAS.Paramini.EqType == TROPOGAS)
6129  FilBuff = Fil_CodeTropo[c];
6131  FilBuff = Fil_CodeNG[c];
6132  else if (DAS.Paramini.EqType == GASCODNG1)
6133  FilBuff = Fil_CodeNG1[c];
6134  else
6135  FilBuff = Fil_Code[c];
6136  }
6137 
6138  FilSet = c;
6139  FilFlg = 1;
6140 }
static int FilFlg
Definition: CreateForms.c:50
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
#define LIS_
Lampedusa Island Spectrometer - ENEA.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
char * Fil_CodeNG1[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrum...
Definition: DAS_Spat.c:213
char * Fil_Code[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:207
das DAS
Definition: CreateForms.c:98
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
int FilSet
filter wheel position definition - for SD_FilterW
Definition: CreateForms.c:5992
int EqType
Spectrometer Type.
const char * FilBuff
Definition: CreateForms.c:51
paramini Paramini
structure for the parameters defined in param.ini configuration file
+ Here is the caller graph for this function:

§ DB_FilSelButtKB_CB()

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

callback for select a specified filter push button with the keyboard

Definition at line 6166 of file CreateForms.c.

References D_A, palette::DB_Sel, palette::DB_UnSel, pushbutt::Fil, das::Gui, MKeyEvent::keycode, L_A, MObjectSetBackgroundRGB(), gui::PushButt, R_A, and U_A.

Referenced by MDCreateSh_Fil(), and MDCreateSh_NDFil().

6167 {
6168 
6169  int c = (int) a_data;
6170 
6171  switch (pe->keycode)
6172  {
6173  case R_A:
6175  if (c == (sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]) - 1)
6176  {
6178  break;
6179  }
6180  else
6181  {
6183  break;
6184  }
6185  case D_A:
6187  if (c == (sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]) - 1)
6188  {
6190  break;
6191  }
6192  else
6193  {
6195  break;
6196  }
6197 
6198  case L_A:
6200  if (c == 0)
6201  {
6203  break;
6204  }
6205  else
6206  {
6208  break;
6209  }
6210  case U_A:
6212  if (c == 0)
6213  {
6215  break;
6216  }
6217  else
6218  {
6220  break;
6221  }
6222  }
6223 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
unsigned int keycode
Code for the pressed key.
Definition: Mguidefs.h:541
#define R_A
Definition: KEYCODES.H:280
short DB_Sel[3]
Selected Buttons Colors.
#define U_A
Definition: KEYCODES.H:278
MOBJECT Fil[6]
Filter Buttons.
#define L_A
Definition: KEYCODES.H:281
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
das DAS
Definition: CreateForms.c:98
#define D_A
Definition: KEYCODES.H:279
short DB_UnSel[3]
Unselected Buttons Colors.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_FilSelButtMouse_CB()

void DB_FilSelButtMouse_CB ( MOBJECT  obj,
MMouseEvent pe,
void *  a_data 
)

callback changing the bakground color of the push button passing the mouse over it

Definition at line 6144 of file CreateForms.c.

References MMouseEvent::button, palette::DB_Sel, palette::DB_UnSel, pushbutt::Fil, das::Gui, MObjectSetBackgroundRGB(), and gui::PushButt.

6145 {
6146 
6147  int c = (int) a_data, i;
6148 
6149  for (i=0; i<(sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]); i++)
6150  {
6152  }
6153 
6154  switch (pe->button)
6155  {
6156 
6157  case (Button1):
6158  {
6160  break;
6161  }
6162  }
6163 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
short DB_Sel[3]
Selected Buttons Colors.
MOBJECT Fil[6]
Filter Buttons.
unsigned int button
button pressed/released (Button1, Button2 or Button3), 0 if no button involved
Definition: Mguidefs.h:622
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
das DAS
Definition: CreateForms.c:98
short DB_UnSel[3]
Unselected Buttons Colors.
+ Here is the call graph for this function:

§ DB_FilterCB()

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

Filter positioning callback.

Definition at line 2593 of file Spat_Plot.c.

References tools::FlagFilter, GrafoIMG(), MRButtonGetActivationStatus(), ON_OFFLINEPLOT, and TOOLS.

Referenced by D_PlotTools().

2594 {
2595 
2596  int er = 0;
2597  int c = (int) ad;
2598 
2599 
2601 
2602  if(er)
2603  {
2604  switch (c)
2605  {
2606  case 0:
2607  TOOLS.FlagFilter = 0;
2608  break;
2609  case 1:
2610  TOOLS.FlagFilter = 1;
2611  break;
2612  }
2613  }
2614 
2616 
2617 
2618 }
int MRButtonGetActivationStatus(MOBJECT o)
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
int FlagFilter
flag for filterinf
static double p
Definition: SOLPOS.C:131
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
tools TOOLS
Definition: CreateForms.c:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_FilterType_CB()

void DB_FilterType_CB ( MOBJECT  o,
void *  a,
void *  v 
)

callback selecting the type of installed filter wheel module

Definition at line 1174 of file DAS_Spat_ConfCBs.c.

References das::DOption, FDOUBLE, optionini::filtertype, FPLUS, FSIMPLE, and MRButtonGetActivationStatus().

Referenced by CONFP_opt_page7().

1175 {
1176 
1177  int er = 0;
1178  int c = (int) v;
1179 
1180 
1182 
1183  if(er)
1184  {
1185  switch (c)
1186  {
1187  case FSIMPLE:
1189  break;
1190  case FDOUBLE:
1192  break;
1193  case FPLUS:
1195  break;
1196 
1197  }
1198  }
1199 
1200 }
optionini DOption
Options for DAS execution.
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
int MRButtonGetActivationStatus(MOBJECT o)
#define FDOUBLE
double filter wheel
#define FPLUS
Filter Wheel Torque Motor.
#define FSIMPLE
simple filter wheel
das DAS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_FontAssign()

void DB_FontAssign ( MOBJECT  a[],
int  numel,
MTFont  fnt 
)

This callback assign font to the selected object.

Definition at line 1374 of file DAS_Spat_ConfCBs.c.

References MObjectSetFont(), and True.

1375 {
1376  int i;
1377  for (i=0; i < numel; i++)
1378  {
1379  MObjectSetFont(a[i], fnt, True);
1380  }
1381 
1382 }
#define True
Definition: Mguidefs.h:235
void MObjectSetFont(MOBJECT obj, MTFont font, int resize)
+ Here is the call graph for this function:

§ DB_GetCCD()

int DB_GetCCD ( int  mod)

Get CCD Image.
.

Parameters
mod
  • 0 –> Dark measurement
  • 1 –> Light measurement
Returns
er = 0

Definition at line 1749 of file Procedures.c.

References img::BHigh, BlindPix, img::BLow, countsopsh, D_BuildH(), optionini::darkremove, optionini::darksource, img::DATE, DB_DefectPixCorr(), DB_MirrorX(), DB_ScanMaxMin(), DBDEMO, DC_GetCCD(), delay(), DI_Regen(), DI_ScanMaxMin(), DI_WriteDigit(), DIL, das::DOption, flag::exemode, das::Flag, GetDateTime(), img::GHigh, img::GLow, img::High, IDX, IDY, img::IHigh, img::ILow, img::Imat, ImatDark, dil::Img, optionini::imgtype, INTIMG, marconi::LblExpD, marconi::LblExpP, img::Low, das::Marconi, image::Mat, MDCreateExpo(), optionini::measmode, optionini::mirrorimg, MLoopWhileEvents(), MShellDestroy(), MShellUnrealize(), optionini::pixcorr, RemoveBlindPixels(), RGBIMG, img::RHigh, img::RLow, optionini::savingmode, Server, ShowDown(), ShuttDelay, st, TESTSZAMODE, TExp, img::TIME, img::type, and XAX.

Referenced by AutoR_No_Shutt(), AutoR_TestMeas(), AutoR_With_Shutt(), AutoRange(), D_Average(), D_AverageTFix(), D_Calibra(), D_Measure(), DB_AskCB(), DB_HorComm_CB(), DB_KeyB_CB(), E_GetCCD(), E_HgScan(), E_Meashor(), E_Meashor2(), E_QjScan(), GetDefPix(), and PerformMeas().

1750 {
1751 
1752  char buf[80];
1753  MOBJECT sh;
1754  int t, j;
1755  unsigned long st, et, x;
1756  struct tm today;
1757 
1758 
1759 
1760 if(DAS.DOption.measmode == 0) //Single
1761 {
1762  if(TExp > .5)
1763  {
1764  sh = MDCreateExpo("EXPOSURE");
1765  sprintf(buf, "%6.1lf", TExp);
1766 
1769 
1770 
1771  }
1772 
1773 }
1774 /*************************************************************************/
1775  // DEMO mode
1776  if((DAS.Flag.exemode == DBDEMO) | (DAS.Flag.exemode == TESTSZAMODE))
1777  {
1778 
1779 
1780  GetDateTime(&DIL.Img.Mat[Server].DATE, &DIL.Img.Mat[Server].TIME, &today);
1781  //gettime( &DIL.Img.Mat[Server].TIME );
1782 
1783  st = GetTickCount();
1784  do
1785  {
1786  et = GetTickCount();
1787  x = labs(et - st);
1788  MLoopWhileEvents(1);
1789  //if((x % 10) == 0 && x > 0)
1790  if(x > 0)
1791  {
1792  sprintf(buf, "%6.1lf", TExp - x / 1000.0 );
1793  //sprintf(TTot, "%6.1lf", TExp );
1794  //ShowDown(buf, TTot);
1795 
1796  ShowDown(buf, 0);
1797 
1798 
1799  }
1800  }while(labs(et - st) < (TExp * 1000));
1801 
1802  if(DAS.DOption.measmode == 0) //Single Measurement
1803  {
1804  if(TExp > .5)
1805  {
1806  MShellUnrealize(sh);
1807  MShellDestroy(sh);
1808  }
1809  }
1810 
1811  return 0;
1812  }
1813 
1814  /*************************************************************************/
1815 
1816 /*
1817 void DC_GetWinCCD(int mode, double expos, int sx, int sy, int, dx, int dy, Unsigned *mat, int camera);
1818 Descrizione:
1819 Procedura che permette di leggere un’immagine selezionando un’area definita del ccd.
1820 I parametri che devono essere specificati sono:
1821 1. mode, Impostandolo a 0 si effettua una dark, con 1 si riprende l’immagine.
1822 2. expos, Tempo di esposizione espresso in secondi.
1823 3. sx, sy, Coordinate di origine della finestra.
1824 4. dx, dy Dimensione in pixel della finestra.
1825 5. mat, Array lineare dove viene memorizzata l’immagine. L’array mat deve essere dimensionato secondo:
1826 dimx x dimy x 2.
1827 6. camera, specifica quale camera dell’array viene utilizzata (se questa modalita’ e’ attiva).
1828 */
1829 
1830 
1831 
1832  if(!DAS.DOption.imgtype) //Mono image
1833  /******* MONO IMAGE ***************/
1834  {
1835  DIL.Img.Mat[Server].type = INTIMG;
1836  if(mod) // Light Measurement
1837  {
1838 /*
1839  sx = DAS.Paramini.ccdXoff;
1840  sy = DAS.Paramini.ccdYoff;
1841  dx = DAS.Paramini.ccdWx - DAS.Paramini.ccdXoff;
1842  dy = DAS.Paramini.ccdWy - DAS.Paramini.ccdYoff;
1843  DC_StopNow;
1844  DC_FGetWinCCD(1, TExp, sx, sy, dx, dy, Mat[Server].Imat, 0);
1845 */
1846  if(DAS.DOption.darkremove) // Remove Dark from Measurements
1847  {
1848  if(DAS.DOption.darksource) // Dark Source = Full Frame
1849  {
1850  /*******************************/
1851  //Dark Measurement
1852  DC_GetCCD(0, TExp, DIL.Img.Mat[Server].Imat, 0);
1853  if (DAS.DOption.mirrorimg[XAX] == 1)
1854  DB_MirrorX(Server); //Mirror X axis
1855  if (DAS.DOption.pixcorr)
1856  DB_DefectPixCorr();
1857  for(t = 0; t < IDY; t++)
1858  {
1859  for(j = 0; j < IDX ; j++)
1860  {
1861  ImatDark[t * IDX + j] = (unsigned short) DIL.Img.Mat[Server].Imat[t * IDX + j];
1862  }
1863  }
1864  /********************************/
1865  // Light Measurement
1866  // count opening shutter
1867  countsopsh++;
1868  delay(ShuttDelay);
1869  DC_GetCCD(1, TExp, DIL.Img.Mat[Server].Imat, 0);
1870  //Image Rotation
1871  /* if (DAS.Paramini.EqType == SPATRAM2)
1872  {
1873  U16 sav[3];
1874  U32 len = (unsigned long) IDX * (unsigned long) IDY; //DC_CCD.dx * DC_CCD.dy; // dimX e dimY = dimensione immagine
1875 
1876  sav[0] = DIL.Img.Mat[Server].Imat[0];
1877  sav[1] = DIL.Img.Mat[Server].Imat[1];
1878  memcpy(&DIL.Img.Mat[Server].Imat[0], &DIL.Img.Mat[Server].Imat[2], (IDX << 1) );
1879 
1880  DIL.Img.Mat[Server].Imat[len - 1] = sav[1];
1881  DIL.Img.Mat[Server].Imat[len ] = sav[0];
1882 
1883  sav[0] = DIL.Img.Mat[Server].Imat[IDX-3];
1884  sav[1] = DIL.Img.Mat[Server].Imat[IDX-2];
1885 
1886  DIL.Img.Mat[Server].Imat[IDX-1] = sav[0];
1887  DIL.Img.Mat[Server].Imat[IDX-3] = sav[1];
1888  }
1889 
1890  */
1891 
1892  delay(ShuttDelay);
1893  if (DAS.DOption.mirrorimg[XAX] == 1)
1894  DB_MirrorX(Server); //Mirror X axis
1895  if (DAS.DOption.pixcorr)
1896  DB_DefectPixCorr();
1897  //sottrae la dark alla misura
1898  //ATTENZIONE quando la dark e' maggiore della misura
1899  //la sottrazione non funziona RIVEDERE
1900  //RIVISTO - si aggiunge 100 alla misura!!!! (Manuele Dixit)
1901  for(t = 0; t < IDY; t++)
1902  {
1903  for(j = 0; j < IDX ; j++)
1904  {
1905  DIL.Img.Mat[Server].Imat[t * IDX + j] = (unsigned short) (DIL.Img.Mat[Server].Imat[t * IDX + j] + 100) - ImatDark[t * IDX + j];
1906  }
1907  }
1908  }
1909  else // Dark Source = Blind Pixels
1910  {
1911  // Light Measurement
1912  // count opening shutter
1913  countsopsh++;
1914  delay(ShuttDelay);
1915  DC_GetCCD(1, TExp, DIL.Img.Mat[Server].Imat, 0);
1916  //Image Rotation
1917  /* if (DAS.Paramini.EqType == SPATRAM2)
1918  {
1919  U16 sav[3];
1920  U32 len = (unsigned long) IDX * (unsigned long) IDY; //DC_CCD.dx * DC_CCD.dy; // dimX e dimY = dimensione immagine
1921 
1922  sav[0] = DIL.Img.Mat[Server].Imat[0];
1923  sav[1] = DIL.Img.Mat[Server].Imat[1];
1924  memcpy(&DIL.Img.Mat[Server].Imat[0], &DIL.Img.Mat[Server].Imat[2], (IDX << 1) );
1925 
1926  DIL.Img.Mat[Server].Imat[len - 1] = sav[1];
1927  DIL.Img.Mat[Server].Imat[len ] = sav[0];
1928 
1929  sav[0] = DIL.Img.Mat[Server].Imat[IDX-3];
1930  sav[1] = DIL.Img.Mat[Server].Imat[IDX-2];
1931 
1932  DIL.Img.Mat[Server].Imat[IDX-1] = sav[0];
1933  DIL.Img.Mat[Server].Imat[IDX-3] = sav[1];
1934  }
1935 
1936  */
1937  delay(ShuttDelay);
1938  if (DAS.DOption.mirrorimg[XAX] == 1)
1939  DB_MirrorX(Server); //Mirror X axis
1940  if (DAS.DOption.pixcorr)
1941  DB_DefectPixCorr();
1943  }
1944  }
1945  else // NOT Remove Dark from Measurements
1946  {
1947  // count opening shutter
1948  countsopsh++;
1949  delay(ShuttDelay);
1950  DC_GetCCD(1, TExp, DIL.Img.Mat[Server].Imat, 0);
1951  //Image Rotation
1952  /*if (DAS.Paramini.EqType == SPATRAM2)
1953  {
1954  U16 sav[3];
1955  U32 len = (unsigned long) IDX * (unsigned long) IDY; //DC_CCD.dx * DC_CCD.dy; // dimX e dimY = dimensione immagine
1956 
1957  sav[0] = DIL.Img.Mat[Server].Imat[0];
1958  sav[1] = DIL.Img.Mat[Server].Imat[1];
1959  memcpy(&DIL.Img.Mat[Server].Imat[0], &DIL.Img.Mat[Server].Imat[2], (IDX << 1) );
1960 
1961  DIL.Img.Mat[Server].Imat[len - 1] = sav[1];
1962  DIL.Img.Mat[Server].Imat[len ] = sav[0];
1963 
1964  sav[0] = DIL.Img.Mat[Server].Imat[IDX-3];
1965  sav[1] = DIL.Img.Mat[Server].Imat[IDX-2];
1966 
1967  DIL.Img.Mat[Server].Imat[IDX-1] = sav[0];
1968  DIL.Img.Mat[Server].Imat[IDX-3] = sav[1];
1969  }
1970 
1971  */
1972  delay(ShuttDelay);
1973  if (DAS.DOption.mirrorimg[XAX] == 1)
1974  DB_MirrorX(Server); //Mirror X axis
1975  if (DAS.DOption.pixcorr)
1976  DB_DefectPixCorr();
1977  }
1978 
1979  }
1980  else // Make Dark Measurement
1981  {
1982 /*
1983  sx = DAS.Paramini.ccdXoff;
1984  sy = DAS.Paramini.ccdYoff;
1985  dx = DAS.Paramini.ccdWx - DAS.Paramini.ccdXoff;
1986  dy = DAS.Paramini.ccdWy - DAS.Paramini.ccdYoff;
1987  DC_StopNow;
1988  DC_FGetWinCCD(0, TExp, sx, sy, dx, dy, Mat[Server].Imat, 0);
1989 */
1990  DC_GetCCD(0, TExp, DIL.Img.Mat[Server].Imat, 0);
1991  //Image Rotation
1992  /*if (DAS.Paramini.EqType == SPATRAM2)
1993  {
1994  U16 sav[3];
1995  U32 len = (unsigned long) IDX * (unsigned long) IDY; //DC_CCD.dx * DC_CCD.dy; // dimX e dimY = dimensione immagine
1996 
1997  sav[0] = DIL.Img.Mat[Server].Imat[0];
1998  sav[1] = DIL.Img.Mat[Server].Imat[1];
1999  memcpy(&DIL.Img.Mat[Server].Imat[0], &DIL.Img.Mat[Server].Imat[2], (IDX << 1) );
2000  DIL.Img.Mat[Server].Imat[len - 1] = sav[1];
2001  DIL.Img.Mat[Server].Imat[len ] = sav[0];
2002 
2003  sav[0] = DIL.Img.Mat[Server].Imat[IDX-3];
2004  sav[1] = DIL.Img.Mat[Server].Imat[IDX-2];
2005 
2006  DIL.Img.Mat[Server].Imat[IDX-1] = sav[0];
2007  DIL.Img.Mat[Server].Imat[IDX-3] = sav[1];
2008  }
2009  */
2010  if (DAS.DOption.mirrorimg[XAX] == 1)
2011  DB_MirrorX(Server); //Mirror X axis
2012  if (DAS.DOption.pixcorr)
2013  DB_DefectPixCorr();
2014 
2015  }
2016 
2020  DI_Regen(Server);
2021 
2022  GetDateTime(&DIL.Img.Mat[Server].DATE, &DIL.Img.Mat[Server].TIME, &today);
2023  // gettime( &DIL.Img.Mat[Server].TIME );
2024  // getdate( &DIL.Img.Mat[Server].DATE );
2025 
2026  if(DAS.DOption.savingmode)
2027  D_BuildH(1, Server);
2028  else
2029  D_BuildH(0, Server);
2030  /******* END MONO IMAGE ***************/
2031  }
2032  if(DAS.DOption.imgtype) //RGB image
2033  {
2034  DIL.Img.Mat[Server].type = RGBIMG;
2035  if(mod)
2036  {
2037  if(DAS.DOption.darkremove)
2038  {
2039  /*******************************/
2040  //Dark Measurement
2041  DC_GetCCD(0, TExp, DIL.Img.Mat[Server].Imat, 0);
2042  if (DAS.DOption.mirrorimg[XAX] == 1)
2043  DB_MirrorX(Server); //Mirror X axis
2044  if (DAS.DOption.pixcorr)
2045  DB_DefectPixCorr();
2046 
2047  for(t = 0; t < IDY; t++)
2048  {
2049  for(j = 0; j < IDX ; j++)
2050  {
2051  ImatDark[t * IDX + j] = (unsigned short) DIL.Img.Mat[Server].Imat[t * IDX + j];
2052  }
2053  }
2054  /********************************/
2055  // Light Measurement
2056  // count opening shutter
2057  countsopsh++;
2058  delay(ShuttDelay);
2059  DC_GetCCD(1, TExp, DIL.Img.Mat[Server].Imat, 0);
2060  delay(ShuttDelay);
2061  if (DAS.DOption.mirrorimg[XAX] == 1)
2062  DB_MirrorX(Server); //Mirror X axis
2063  if (DAS.DOption.pixcorr)
2064  DB_DefectPixCorr();
2065  //sottrae la dark alla misura
2066  //ATTENZIONE quando la dark e' maggiore della misura
2067  //la sottrazione non funziona RIVEDERE
2068  //RIVISTO - si aggiunge 100 alla misura!!!! (Manuele Dixit)
2069  for(t = 0; t < IDY; t++)
2070  {
2071  for(j = 0; j < IDX ; j++)
2072  {
2073  DIL.Img.Mat[Server].Imat[t * IDX + j] = (unsigned short) (DIL.Img.Mat[Server].Imat[t * IDX + j] + 50) - ImatDark[t * IDX + j];
2074  }
2075  }
2076  }
2077  else
2078  {
2079  // count opening shutter
2080  countsopsh++;
2081  delay(ShuttDelay);
2082  DC_GetCCD(1, TExp, DIL.Img.Mat[Server].Imat, 0);
2083  delay(ShuttDelay);
2084  if (DAS.DOption.mirrorimg[XAX] == 1)
2085  DB_MirrorX(Server); //Mirror X axis
2086  if (DAS.DOption.pixcorr)
2087  DB_DefectPixCorr();
2088  }
2089  }
2090  else
2091  {
2092  DC_GetCCD(0, TExp,DIL.Img.Mat[Server].Imat, 0);
2093  if (DAS.DOption.mirrorimg[XAX] == 1)
2094  DB_MirrorX(Server); //Mirror X axis
2095  if (DAS.DOption.pixcorr)
2096  DB_DefectPixCorr();
2097  }
2098 
2099 
2100 
2104 
2105 
2106 
2107 // Mat[Server].ILow = Mat[Server].Low ;
2108 // Mat[Server].IHigh = Mat[Server].High ;
2109 
2110  DI_Regen(Server);
2111 
2112  }
2113 
2114 if(DAS.DOption.measmode == 0) //Single
2115 {
2116  if(TExp > .5)
2117  {
2118  MShellUnrealize(sh);
2119  MShellDestroy(sh);
2120  }
2121 }
2122  return 0;
2123 
2124 
2125 
2126 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int Server
Definition: DAS_Spat.c:253
dil DIL
Definition: 2DPlot.c:26
void MLoopWhileEvents(int discard)
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
float GHigh
Definition: Dildef.h:299
C_DEF void DI_Regen(int s)
C_DEF double DI_ScanMaxMin(int w, float *mx, float *mi)
#define TESTSZAMODE
execution driven by SZAPRG file
flag Flag
Structure for different flags.
int darkremove
Flag to set Dark Removal from measurements; motors0 = No Dark Removal, 1 = Dark Removal.
U16 * Imat
Definition: Dildef.h:286
#define DBDEMO
execution in demo mode
#define XAX
X Axis.
S16 type
Definition: Dildef.h:280
img Mat[MAXIMG]
Definition: Dildef.h:552
void MShellUnrealize(MOBJECT obj)
struct date DATE
Definition: Dildef.h:348
void D_BuildH(int mod, int s)
Build Header of the measurements . .
Definition: Procedures.c:63
image Img
Definition: Dildef.h:675
das DAS
DAS structure.
Definition: Procedures.c:47
void MShellDestroy(MOBJECT obj)
float BHigh
Definition: Dildef.h:301
double DB_ScanMaxMin(int w, float *mx, float *mi, int bp)
Find Max and Min values for the buffer of order w.
Definition: Procedures.c:1632
#define INTIMG
Definition: Dildef.h:10
MOBJECT LblExpP[7]
Label for presetted time exposure.
unsigned long countsopsh
counting the number of opening shutter
Definition: DAS_Spat.c:133
float RHigh
Definition: Dildef.h:297
void DB_DefectPixCorr()
Apply thew pixel correction. .
Definition: Procedures.c:1568
unsigned short * ImatDark
buffer for the dark image
Definition: DAS_Spatram.h:3045
#define RGBIMG
Definition: Dildef.h:11
void __stdcall ShowDown(const char *str, int port)
Shows the countdown. Procedure for the visualisation of the countdown.
Definition: Init.c:98
int ShuttDelay
Definition: Procedures.c:255
MOBJECT MDCreateExpo(char *tit)
Create Exposure/countdown shell. Procedure that build the Exposure/countdown shell during the calcula...
Definition: Init.c:55
float RLow
Definition: Dildef.h:296
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
float IHigh
Definition: Dildef.h:303
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
CTYPE void DLL DC_GetCCD(int Mode, double Exposure, U16 *mat, int Camera)
Get an image at full resolution. Procedure that allows you to read an image, given an exposure time e...
float ILow
Definition: Dildef.h:302
int mirrorimg[2]
Flag to set the mirroring of the CCD image: 0 = NO Mirroring, 1= YES Mirroring (element 0 for X axis;...
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
int pixcorr
Flag to set defective pixel correction: 0=NOT Corrected, 1=Corrected.
int imgtype
Flag to set Image type: 0=MONOINT, 1=RGB.
int measmode
measuring mode: 0 = Single; 1 = Averaged
void RemoveBlindPixels(void)
Definition: Procedures.c:1600
static double st
Definition: SOLPOS.C:142
void * MOBJECT
Definition: Mguidefs.h:192
C_DEF void DI_WriteDigit(MOBJECT *pix, char *fmt)
struct time TIME
Definition: Dildef.h:347
float GLow
Definition: Dildef.h:298
int BlindPix
Number of blind pixels (usefull for Dark Current)
Definition: DAS_Spat.c:120
int darksource
Flag to set Dark source: 0 = Blind Pixels, 1 = Full Frame.
float Low
Definition: Dildef.h:294
float High
Definition: Dildef.h:295
MOBJECT LblExpD[7]
Label for time exposure countdown.
int exemode
Set the Execution MODE (Execution modes)
void DB_MirrorX(int w)
Definition: Procedures.c:201
float BLow
Definition: Dildef.h:300
marconi Marconi
CCD Sensor struct.
+ 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_ImgTypeCB()

void DB_ImgTypeCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Set the Image type.

Parameters
*a_data
  • 0 = MONO
  • 1 = RGB

Definition at line 1314 of file DAS_Spat_ConfCBs.c.

References das::DOption, and optionini::imgtype.

Referenced by CONFP_opt_page1().

1315 {
1316 
1317  int c = (int) a_data;
1318 // char buf[80];
1319 
1320  switch(c)
1321  {
1322  case 0 :
1323  DAS.DOption.imgtype=0; //Mono
1324  break;
1325  case 1:
1326  DAS.DOption.imgtype=1; //RGB
1327  break;
1328 
1329  }
1330 
1331 
1332 
1333 
1334 }
optionini DOption
Options for DAS execution.
das DAS
int imgtype
Flag to set Image type: 0=MONOINT, 1=RGB.
+ 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_InitAMS()

int DB_InitAMS ( int  nid,
int  mod,
int  powera,
int  stepa,
int  slopea,
int  speeda,
int  powerb,
int  stepb,
int  slopeb,
int  speedb 
)

Init selected AMS.

Parameters
nid= AMS address:
  • 0 = AMS1
  • 1 = AMS2
  • 2 = AMS3
mod
  • 0 –> Init with home
  • 1 –> Init without home
  • 2 –> Home Input Mirror
  • 3 –> Home Grating
  • 4 –> Home Filter Wheel
  • 5 –> Home Zenith
  • 6 –> Home Azimuth
  • 7 –> Home ND Filter Wheel
powera–> Power assigned to motor A
stepa= 0, 1...13. steps assigned to motor A
slopea–> Slope assigned to motor A
speeda–> Speed assigned to motor A
powerb–> Power assigned to motor B
stepb= 0, 1...13. steps assigned to motor B
slopeb–> Slope assigned to motor B
speedb–> Speed assigned to motor B
Returns
er:
  • = 0 –> Init succesfully
  • = 1 –> Problems encountred

Definition at line 1391 of file Init.c.

References ACKLEN, DXL_par::add, AMS_Error(), AMS_firmrev(), AMS_Power(), AMS_Slope(), AMS_Speed(), AMS_Step(), DXL_par::bufrx, DXL_par::buftx, DXL_par::com, das::DOption, DXL_RxStr(), DXL_TxStr(), FDOUBLE, optionini::filtertype, stepm::firmrev, HomeAzimFast(), HomeFiltersFast(), HomeGratingFast(), HomeMirror(), HomeNDFiltersFast(), HomeZenithFast(), SioReset(), and das::StepM.

Referenced by DB_Home_CB(), DB_InitMotor(), E_Home_SM4(), E_Home_SM6(), HomeAzimFast(), HomeFiltersFast(), HomeGratingFast(), HomeMirror(), HomeNDFiltersFast(), and HomeZenithFast().

1392 {
1393 
1394  int er = 0, d;
1395  char buf[80];
1396  long l;
1397  char *stopstring;
1398 
1399 
1400  DXL.add = nid;
1401 // if (mod != 1)
1402 // {
1403  //****************************************************
1404  // Set final directions
1405  sprintf(DXL.buftx, "-0000");
1406  DXL_TxStr(DXL.buftx, strlen(DXL.buftx));
1407  d = ACKLEN;
1408  er = DXL_RxStr(buf, &d);
1409  // Set default values
1410  DXL_TxStr("A", 1);
1411  d = ACKLEN;
1412  er = DXL_RxStr(buf, &d);
1413  //*****************************************************
1414 // }
1415  // Firmware Revision
1416  er = AMS_firmrev(nid);
1417  d = atoi(DXL.bufrx);
1418  l = strtol( DXL.bufrx, &stopstring, 16 );
1419  DAS.StepM.firmrev[nid] = l/10;
1420 
1421 
1422  if(er == 0)
1423  {
1424  // Send power
1425  er = AMS_Power(nid, powera, powerb);
1426  if(er == 0)
1427  {
1428  // Send step
1429  er = AMS_Step(nid, stepa, stepb);
1430  if(er == 0)
1431  {
1432  // Send slope
1433  er = AMS_Slope(nid, slopea, slopeb);
1434  if(er == 0)
1435  {
1436  // Send speed
1437  er = AMS_Speed(nid, speeda, speedb);
1438  if(er == 0)
1439  {
1440  // Enable slope
1441 // sprintf(DXL.buftx, ";%02X%02X", 0, 0);
1442 // DXL_TxStr(DXL.buftx, 5);
1443 // d = ACKLEN;
1444 // er = DXL_RxStr(buf, &d);
1445  if(er == 0)
1446  {
1447  if(nid == 0 && mod == 0)
1448  {
1449  HomeMirror();
1450 // writelogmotor(1, 0, er, 0, 0, nid);
1451 
1452  HomeGratingFast(0);
1453 // writelogmotor(1, 1, er, 0, 0, nid);
1454  }
1455  if(nid == 1 && mod == 0)
1456  {
1457  HomeFiltersFast();
1458 
1459  if (DAS.DOption.filtertype == FDOUBLE)
1461  //HomeFilterWheel();
1462 // writelogmotor(1, 2, er, 0, 0, nid);
1463  }
1464  if(nid == 0 && mod == 2)
1465  {
1466  HomeMirror();
1467 // writelogmotor(1, 0, er, 0, 0, nid);
1468  }
1469  if(nid == 0 && mod == 3)
1470  {
1471  HomeGratingFast(0);
1472 // writelogmotor(1, 1, er, 0, 0, nid);
1473  }
1474  if(nid == 1 && mod == 4)
1475  {
1476  //HomeFilterWheel();
1477  HomeFiltersFast();
1478 // writelogmotor(1, 2, er, 0, 0, nid);
1479 
1480  }
1481  if(nid == 1 && mod == 7)
1482  {
1483  //HomeFilterWheel();
1485 // writelogmotor(1, 2, er, 0, 0, nid);
1486 
1487  }
1488  if(nid == 2 && mod == 0)
1489  {
1490 
1491  HomeZenithFast();
1492 // writelogmotor(1, 0, er, 0, 0, nid);
1493 
1494  HomeAzimFast();
1495 // writelogmotor(1, 1, er, 0, 0, nid);
1496  }
1497  if(nid == 2 && mod == 5)
1498  {
1499  HomeZenithFast();
1500 // writelogmotor(1, 0, er, 0, 0, nid);
1501  }
1502  if(nid == 2 && mod == 6)
1503  {
1504  HomeAzimFast();
1505 // writelogmotor(1, 1, er, 0, 0, nid);
1506  }
1507  }
1508  else
1509  {
1510  //Slope not enabled
1511  AMS_Error(6);
1512  }
1513  }
1514  else
1515  {
1516  //speed not sent
1517  AMS_Error(5);
1518  }
1519  }
1520  else
1521  {
1522  //Slope not sent
1523  AMS_Error(4);
1524  }
1525  }
1526  else
1527  {
1528  //step not sent
1529  AMS_Error(3);
1530  }
1531  }
1532  else
1533  {
1534  //Power not sent
1535  AMS_Error(2);
1536  }
1537  }
1538  else
1539  {
1540  if(nid == 0)
1541  {
1542  //AMS1 not found
1543  AMS_Error(0);
1544  return 1;
1545  }
1546  if(nid == 1)
1547  {
1548  //AMS2 not found
1549  AMS_Error(1);
1550  return 1;
1551  }
1552  if(nid == 2)
1553  {
1554  //AMS3 not found
1555  AMS_Error(7);
1556  return 1;
1557  }
1558 
1559  }
1560 
1561  if(er)
1562  er = SioReset(DXL.com, 1024, 1024);
1563 
1564  return 0;
1565 
1566 }
stepm StepM
Stepper motors parameters structure.
int HomeGratingFast(int mod)
(Fastest) Grating in the reference Position. The Grating reaches the reference Position. Similar to HomeGrating(void), but faster
Definition: Init.c:780
double firmrev[AMSMAX]
Firmware Revision.
int AMS_Slope(int id, int slopea, int slopeb)
Set slope to the Stepper motors Procedure for setting the slope fot the Stepper Motors.
Definition: Dxl.c:368
optionini DOption
Options for DAS execution.
char buftx[1024]
Tx buffer.
Definition: DXL.H:21
int HomeFiltersFast(void)
(Fastest) Fliter wheel in the reference Position. The Fliter wheel reaches the reference Position...
Definition: Init.c:853
#define ACKLEN
int HomeNDFiltersFast(void)
(Fastest) ND Fliter wheel in the reference Position. The ND Fliter wheel reaches the reference Positi...
Definition: Init.c:941
int DXL_RxStr(char *rx, int *len)
receive string from a serial port
Definition: Dxl.c:1187
DXL_par DXL
DXL structure.
Definition: Init.c:21
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
int AMS_firmrev(int id)
Firmware Revision Number .
Definition: Dxl.c:475
das DAS
DAS structure.
Definition: Init.c:34
int AMS_Step(int id, int stepa, int stepb)
Set stepping for the Stepper motors Procedure for setting steps for the Stepper Motors.
Definition: Dxl.c:349
int HomeZenithFast(void)
Home for Zenith Axis.
Definition: Init.c:1143
NoMangle int DLL_IMPORT_EXPORT SioReset(int, int, int)
int HomeAzimFast(void)
Home for Azimuth Axis.
Definition: Init.c:1229
char bufrx[1024]
Rx buffer.
Definition: DXL.H:20
int add
Peripheral address.
Definition: DXL.H:19
#define FDOUBLE
double filter wheel
int AMS_Power(int id, int powa, int powb)
Set Power for AMS Procedure for setting the user choosed power to the selected AMS adapter...
Definition: Dxl.c:326
int AMS_Speed(int id, int speeda, int speedb)
Set speed to the Stepper motors Procedure for setting speed for the Stepper Motors.
Definition: Dxl.c:386
void AMS_Error(int w)
Alerts for AMS errors Creates a message window reporting the number of the error. ...
Definition: Errors.c:254
int HomeMirror(void)
Input Mirror in the reference Position. The Input Mirror reaches the reference Position.
Definition: Init.c:685
int com
Comunication port.
Definition: DXL.H:17
void DXL_TxStr(char *tx, int len)
send string to a serial port
Definition: Dxl.c:1153
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_InitCamera()

int DB_InitCamera ( int  mod)

Initialize Camera Parameters.
Procedure that initialize the CCD Camera.

Parameters
mod
  • = 0 –> Init Camera
  • = 1 –> RE-Init Camera
Returns
0 = Operation done, NO Errors
Errors related to the file system
  • 1001 = Path "..\DASxxx\Config\'Equipment'\dcl" deos not exist
  • 1002 = File "..\DASxxx\Config\'Equipment'\dcl\camera.cfg" deos not exist
  • 1003 = Error in reading file "..\DASxxx\Config\'Equipment'\dcl\camera.cfg"
Errors related to the CCD Camera (returned by DC_Status())
  • 0 = Operation done.
  • 1 = Camera not found
  • 2 = Link failure
  • 3 = Unsupported platform
  • 4 = Interface locked
  • 5 = Platform definition not found
  • 6 = CCD definition not found
  • 7 = FW error, zero position not found
  • 8 = Pattern generator overflow
  • 9 = Memory allocation error in DMA
  • 10 = Serializer not linked
  • 11 = Invalid serial decoder identifier
  • 12 = Unsupported platform in array mode
  • 13 = Invalid handle in WD_Open()
  • 14 = Windriver license string not valid
  • 15 = FDL-PCI card not found
  • 16 = Memory (image) allocation error
  • 17 = No USB device
  • 18 = Can't open USB device
  • 19 = Can't load io.dll library
  • 20 = Can't load fdlusb.dll library
  • 21 = Can't load fdlusb license file
  • 22 = Memory allocation error while creating pattern generator data
  • 23 = Error to creating pattern generator file
  • 24 = CoProcessor communication error

Definition at line 170 of file Init.c.

References _MAX_PATH, AllocUSMat(), img::attrib, marconi::AVGmat, BIL, CCD_INFO, CCDHANDLE, config::CCDType, CELSIUS, CLEARCCD, CodeEq2Name(), d_fileman::CONFIGDIREQUIPMENT, gui::ContrPanel, paramini::CoolPw, DB_InitDil(), DBDEMO, DC_CCDtoName(), DC_Close(), DC_GetPower(), DC_LoadCameraConfig(), DC_OpenByConfig(), DC_OpenPar(), DC_PTFtoName(), DC_RWData(), DC_SetBinning(), DC_SetGain(), DC_SetPathName(), DC_SetPower(), DC_SetTemp(), DC_SetUsrGain(), DC_Status(), DD_VRange(), optionini::DEFPIXFILENAME, bil::DFILEM, DI_CloseImage(), DI_FileExist(), DI_ImageProperties(), DI_OpenImage(), DI_PathExist(), DI_Regen(), DI_RunHisto(), DIL, das::DOption, ccd::dx, ccd::dy, paramini::EqType, flag::exemode, config::FDL_PCI_Index, das::Flag, das::Gui, d_fileman::HOMEDIRECTORY, IDX, IDY, img::Imat, ImatDark, dil::Img, optionini::imgtype, paramini::ITemp, controlpanel::lbl_Par, LoadDB_DefectPixel(), MANUAL, das::Marconi, image::Mat, MMessageDialog(), MObjectSetText(), marconi::Offset, das::Paramini, optionini::pixcorr, config::Platform, PRGFILE, PTF_INFO, READ_DATA, Server, ShowDown(), Status(), SZAMASTERM, SZAMODE, TEMPHANDLE, TEMPORIZED, TESTCCD, TESTSZAMODE, paramini::VBin, and WhoSys().

Referenced by ApplyChCB(), E_SetCCDTemp(), E_SetCCDVBin(), InitCCD_AMS(), and Task_CCD_Temp().

171 {
172 
173  int er, os, c;
174  double PowTemp;
175  unsigned long mx;
176  char buf[_MAX_PATH];
177  char buff[_MAX_PATH];
178  char str[_MAX_PATH];
179  int StartMode;
180  long np;
181 
182 
183  if (mod)
184  DC_Close(0);
185 
186 
187 //************************** **********************
188 
189  //Set path for the DCL
190  //sprintf(buff, "%s\\dcl\\", BIL.DFILEM.CONFIGDIREQUIPMENT );
191  sprintf(buff, "%s\\dcl\\", BIL.DFILEM.HOMEDIRECTORY);
192  // Return: 1 if PATH exist, else return 0
193  er = DI_PathExist(buff);
194  if (er)
195  {
196  //Set path for the DCL
197  DC_SetPathName(buff);
198  }
199  else
200  {
201  sprintf(buf,"Path '%s' deos not exist,\nPlease create and fill ", buff);
202  MMessageDialog ("DAS ERROR ", buf, "OK",NULL);
203  return 1001;
204 
205  }
206 
207  sprintf(buff, "%s\\%s.cfg", BIL.DFILEM.CONFIGDIREQUIPMENT, CodeEq2Name(DAS.Paramini.EqType));
208 
209 // sprintf(buff, "%s\\camera.cfg", BIL.DFILEM.CONFIGDIREQUIPMENT );
210 // sprintf(buff, "%s\\dcl\\SPATRAM2.cfg", BIL.DFILEM.HOMEDIRECTORY );
211  //Return: 1 if file exist, else return 0
212  er = DI_FileExist(buff);
213  if (er)
214  {
215  er = DC_LoadCameraConfig(buff, &Cfg);
216  if (er)
217  {
218  //sprintf(buff,"Error in reading '%s\\dcl\\camera.cfg' file,\nUNKNOWN Reason. Please contact Danbo", BIL.DFILEM.CONFIGDIREQUIPMENT);
219  //sprintf(buff,"Error in reading '%s\\camera.cfg' file,\nUNKNOWN Reason. Please contact Danbo", BIL.DFILEM.CONFIGDIREQUIPMENT);
220  sprintf(buff,"Error in reading '%s\\%s.cfg' file,\nUNKNOWN Reason. Please contact Danbo", BIL.DFILEM.CONFIGDIREQUIPMENT,CodeEq2Name(DAS.Paramini.EqType));
221  MMessageDialog ("DAS ERROR ", buff, "OK",NULL);
222 
223  sprintf(buff,"Error in reading '%s.cfg' ", CodeEq2Name(DAS.Paramini.EqType));
224  Status(buff);
225  return 1003;
226  }
227 
228  }
229  else
230  {
231  sprintf(buff,"File'%s\\%s.cfg' not found,\n\
232 Now 'dcs.exe' will load the standard 'camera.cfg' configuration file\n\
233 Set the camera parameters, copy the '%s\\dcl\\camera.cfg' file in the %s folder\n\
234 and rename in '%s.cfg'", BIL.DFILEM.CONFIGDIREQUIPMENT, CodeEq2Name(DAS.Paramini.EqType),
236  MMessageDialog ("DAS ERROR ", buff, "OK",NULL);
237  sprintf(str, "%s//%s", BIL.DFILEM.HOMEDIRECTORY , "dcs.exe");
238 
239 
240 
241  er = WinExec(str, SW_SHOW);
242 
243  return 1002;
244 
245  }
246 
247 
248 
249 //************************************************************
251 
252  DC_RWData(CCD_INFO, READ_DATA, (void *) &DC_CCD, 0);
253  DC_RWData(PTF_INFO, READ_DATA, (void *) &DC_HP, 0);
254 
255 
256  sprintf(buf,"%d", DC_CCD.dx);
258 
259  sprintf(buf,"%d", DC_CCD.dy);
261 
264  {
265  os = WhoSys();
266  c = CCDHANDLE | CLEARCCD | TEMPHANDLE | os;
267  // c = CCDHANDLE | CLEARCCD | os;
268  // Init the camera
269 
270 
271  // Clear background task if setted
272  //Cfg.TaskSettings &= (~(CCDHANDLE + TEMPHANDLE + CLEARCCD + MUTE));
273 
274 
275 
276  StartMode = 0;
278  er = DC_Status(Cfg.FDL_PCI_Index);
279  if (er)
280  {
281 // sprintf(buf,DC_ErrorMessage(er));
282 // CCD_Error(buf);
283  return er;
284  }
285  else
286  {
289 
290  if(mod==0)
291  {
292  /*** Init Dil ***/
293  DB_InitDil();
294  /*******************/
295  // Y Zoom for high vertical binning
296  if((IDY) < 50)
297  DI_ImageProperties(Server, (U16)IDX, (U16)IDY, (U16)IDX, (U16)IDY, 0, 0, NULL, 1, 100 / IDY, 0);
298 // Image[Server].attrib = 1;
299  DI_Regen(Server);
300  }
301  else
302  {
303  IDX = DC_CCD.dx;
304  IDY = DC_CCD.dy/DAS.Paramini.VBin ;
305 
306  sprintf(buf, "E2V %s on %s",DC_CCDtoName(Cfg.CCDType, 0), DC_PTFtoName(Cfg.Platform, 0));
307  Server = DI_OpenImage((U16)IDX, (U16)IDY, (U16)DAS.DOption.imgtype, 1, buf);
308  DI_RunHisto();
309 
310  // Y Zoom for high vertical binning
311  if((IDY) < 50)
312  DI_ImageProperties(Server, (U16)IDX, (U16)IDY, (U16)IDX, (U16)IDY, 0, 0, NULL, 1, 100 / IDY, 0);
313 // Image[Server].attrib = 1;
314  DI_Regen(Server);
315 
316 
317  if(Server)
318  {
319  DIL.Img.Mat[Server - 1].attrib = 0;
320  DI_CloseImage(Server - 1);
321  }
322 
323  if(Server == 0)
324  {
325  DIL.Img.Mat[Server + 1].attrib = 0;
326  DI_CloseImage(Server + 1);
327  }
328 
329  }
330 
331  // Set Gain
332  DC_SetGain(0, 0);
333 
334 
335  if (Cfg.Platform == 28) // HIRES V
336  {
337  //DC_SetUsrGain(int Gain, int Range, int Offset, int Camera);
338  DC_SetUsrGain(0, 0 , DAS.Marconi.Offset , 0);
339  }
340  // Set CCD Temperature
342 
343  // Check CCD Cooler Power
344  PowTemp = DC_GetPower(0);
345 
346  // Set CCD Cooler Power
347  DC_SetPower((double) ((double)DAS.Paramini.CoolPw / 10),0);
348 
349  // Check CCD Cooler Power
350  PowTemp = DC_GetPower(0);
351 
352  // Check Binning
353  //DC_GetBinning(orizz, vertic,0);
354 
355  // Set Vertical binning DAS.Paramini.VBIN
357 
358  // Check Binning
359  //DC_GetBinning(orizz, vertic,0);
360 
361  /*********************
362  Load defect pixel
363  ********************/
364  if (DAS.DOption.pixcorr)
365  {
366  sprintf(buff, "%s\\%s",BIL.DFILEM.CONFIGDIREQUIPMENT, DAS.DOption.DEFPIXFILENAME);
367  er=LoadDB_DefectPixel(buff);
368  }
369  //buffer for dark matrix
370  if( ImatDark != NULL )
371  free(ImatDark);
372 
373  mx = (unsigned long) IDX * (unsigned long) IDY;
374  ImatDark = (unsigned short *) calloc( mx, sizeof(unsigned short));
375  //Average Matrix (buffer)
376  if (DAS.Marconi.AVGmat != NULL)
377  free(DAS.Marconi.AVGmat);
378 
379  DAS.Marconi.AVGmat = (unsigned long *) calloc( mx, sizeof(unsigned long));
380 
381  return 0;
382  }
383 
384  }
385  else if(DAS.Flag.exemode == DBDEMO || DAS.Flag.exemode == TESTSZAMODE)
386  {
387 
388  if(mod==0)
389  {
390  /*** Init Dil ***/
391  DB_InitDil();
392  DIL.Img.Mat[Server].Imat = AllocUSMat(IDX, IDY);
393  // Y Zoom for high vertical binning
394  if((IDY) < 50)
395  DI_ImageProperties(Server, (U16)IDX, (U16)IDY, (U16)IDX, (U16)IDY, 0, 0, (U16)NULL, 1, 100 / (U16)IDY, 0);
396  //Image[Server].attrib = 1;
397  DI_Regen(Server);
398 
399 
400 
401 
402  /*******************/
403  }
404  else
405  {
406  IDX = DC_CCD.dx;
407 
408  IDY = DC_CCD.dy/DAS.Paramini.VBin ;
409 
410 
411  sprintf(buf, "E2V %s on %s",DC_CCDtoName(Cfg.CCDType, 0), DC_PTFtoName(Cfg.Platform, 0));
412  Server = DI_OpenImage((U16)IDX, (U16)IDY, (U16)DAS.DOption.imgtype, 1, buf);
413  DI_RunHisto();
414  // Y Zoom for high vertical binning
415  if((IDY) < 50)
416  DI_ImageProperties(Server, (U16)IDX, (U16)IDY, (U16)IDX, (U16)IDY, 0, 0, NULL, 1, 100 / (U16)IDY, 0);
417  //Image[Server].attrib = 1;
418  DI_Regen(Server);
419 
420  if(Server)
421  {
422  DIL.Img.Mat[Server - 1].attrib = 0;
423  DI_CloseImage(Server - 1);
424  }
425 
426  if(Server == 0)
427  {
428  DIL.Img.Mat[Server + 1].attrib = 0;
429  DI_CloseImage(Server + 1);
430  }
431 
432  }
433  return 0;
434  }
435 
436 
437 
438 /**********************************************************************/
439 // Controlla il Param.log
440 // Apre e legge il Param.log per poi decidere cosa fare con il parametro MODE del sensore
441 // Mode = LoadParamLog();
442 // if(Mode == 2)
443 // {
444  // il file non e' stato trovato quindi si pone Mode=0 (reinizializza il tutto)
445 // Mode = 0;
446 // }
447 /**********************************************************************/
448  return 0;
449 
450 }
gui Gui
Graphic User Interface Structure.
U32 FDL_PCI_Index
(R/W) Index selector of all available FDL-PCI. 0 - 7 range.
Definition: dcldef.h:1070
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int Server
Definition: DAS_Spat.c:253
dil DIL
Definition: 2DPlot.c:26
optionini DOption
Options for DAS execution.
#define TESTCCD
execution for testing CCD Camera
void __stdcall DD_VRange(const char *str, int perc, int Port)
Definition: Utils.c:153
CTYPE const char DLL_P DC_CCDtoName(int CCDCode, int camera)
CTYPE int DLL DC_SetGain(int Gain, int Camera)
Change the ratio between ADU and electrons. Procedure that allows you to set ccd gains, according to preset values in four various values.
C_DEF void DI_Regen(int s)
U32 CCDType
(R/W) Used CCD CCD code definitions
Definition: dcldef.h:1066
#define TESTSZAMODE
execution driven by SZAPRG file
CTYPE void DLL DC_RWData(int LibraryVariable, int rw, void *data, int Camera)
Procedure that allows read/write operation on a variable used into the library.
flag Flag
Structure for different flags.
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
U16 * Imat
Definition: Dildef.h:286
#define DBDEMO
execution in demo mode
das DAS
DAS structure.
Definition: Init.c:34
#define READ_DATA
Read data.
Definition: dcldef.h:884
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
char * CodeEq2Name(int code)
code Equipment to Name
Definition: Load.c:371
C_DEF int DI_CloseImage(int s)
S16 dx
Num. of X pixels.
Definition: dcldef.h:1022
img Mat[MAXIMG]
Definition: Dildef.h:552
#define PTF_INFO
R/W ptf internal library structure.
Definition: dcldef.h:876
#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)
image Img
Definition: Dildef.h:675
#define CCDHANDLE
Enable background activity.
Definition: dcldef.h:396
short unsigned U16
2 byte without sign, range 0-65535
Definition: dcldef.h:375
#define CCD_INFO
R/W ccd internal library structure.
Definition: dcldef.h:875
CTYPE void DLL DC_SetTemp(double TargetTemperature, int Scale, int Camera)
Procedure that turns the camera cooler on and allows you to set an operative temperature of the CCD...
CTYPE void DLL DC_Close(int Camera)
Shuts down the control operations of the camera. Procedure that shuts down the control operations of ...
d_fileman DFILEM
Definition: bildef.h:257
unsigned short * ImatDark
buffer for the dark image
Definition: DAS_Spatram.h:3045
int WhoSys(void)
Definition: DFileMan.c:306
int VBin
CCD Vertical Binning.
int CoolPw
CCD Init Power.
CTYPE void DLL DC_SetBinning(int HorValue, int VerValue, int Camera)
Set the horizontal and vertical binning value. This procedure accepts arbitrary values in the range b...
int LoadDB_DefectPixel(char *buff)
Load Defective pixel mask. Procedure that load the Defective pixel mask in the file {homedir}/config/...
Definition: Load.c:182
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
CTYPE void DLL DC_OpenByConfig(config *CameraConfig, int StartMode, DTA1_CB CountDownCallBack, DTA2_CB StatusBarCallBack)
Open the camera. Open the camera using the settings specified in CameraConfig structure data (see con...
#define PRGFILE
execution driven by *.prg file
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
void __stdcall ShowDown(const char *str, int port)
Shows the countdown. Procedure for the visualisation of the countdown.
Definition: Init.c:98
#define _MAX_PATH
Definition: Dildef.h:202
ccd DC_CCD
CCD settings.
Definition: Init.c:30
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
S16 dy
Num. of Y pixels.
Definition: dcldef.h:1023
C_DEF void DI_RunHisto(void)
CTYPE int DLL DC_Status(int Camera)
Return the status of the last operations performed on the camera. This procedure allows you to check ...
#define SZAMODE
execution driven by SZAPRG file
bil BIL
Definition: 2DPlot.c:28
CTYPE void DLL DC_SetPathName(char *Path)
Set the pathname for all dcl files.
#define CELSIUS
Return CCD temperature in Celsius.
Definition: dcldef.h:449
CTYPE void DLL DC_SetPower(double CoolerPower, int Camera)
Procedure that allows you to set the cooler power. Procedure that allows you to set the power (%) of ...
config Cfg
Camera controls & Options.
Definition: Init.c:32
CTYPE int DLL DC_OpenPar(int Platform, int Sensor, int Camera)
Procedure that initializes dcl internal data structure. Procedure that initializes the DC_HP and DC_C...
int pixcorr
Flag to set defective pixel correction: 0=NOT Corrected, 1=Corrected.
#define CLEARCCD
Clear CCD before acquire.
Definition: dcldef.h:405
controlpanel ContrPanel
Control Panel Structure.
int imgtype
Flag to set Image type: 0=MONOINT, 1=RGB.
CTYPE const char DLL_P DC_PTFtoName(int PlatFormCode, int camera)
long * AVGmat
buffer for averaging measurements
ptf DC_HP
Platform settings.
Definition: Init.c:31
int DB_InitDil(void)
Initialize DIL. Procedure that initialize the DTA Imaging library.
Definition: Init.c:112
CTYPE void DLL DC_SetUsrGain(int Gain, int Range, int Offset, int Camera)
Procedure that allows you to set the ccd gain. Procedure that allows you to set the ccd gain...
C_DEF int DI_ImageProperties(int srv, U16 dx, U16 dy, U16 wx, U16 wy, U16 ifmt, U16 sts, char *tit, int pix, int pixy, int mode)
CTYPE int DLL DC_LoadCameraConfig(const char *PathName, config *CameraConfig)
Load camera configuration from a specified file.
C_DEF int DI_PathExist(char *path)
int EqType
Spectrometer Type.
unsigned short * AllocUSMat(int hp, int vp)
Definition: Spat_Plot.c:1994
CTYPE double DLL DC_GetPower(int Camera)
Return current cooler power. Procedure that allows you to read the power (%) of the cooler currently ...
U32 Platform
(R/W) Platform code Camera platform definitions
Definition: dcldef.h:1065
C_DEF int DI_FileExist(char *tit)
double ITemp
CCD Target Temperature.
int exemode
Set the Execution MODE (Execution modes)
#define TEMPHANDLE
Temperature control enabled.
Definition: dcldef.h:398
#define MANUAL
execution in manual mode (for lab use)
C_DEF int DI_OpenImage(U16 dx, U16 dy, U16 ifmt, U16 type, char *tit)
S16 attrib
Definition: Dildef.h:279
char DEFPIXFILENAME[_MAX_PATH]
defective pixel filename with path
marconi Marconi
CCD Sensor struct.
paramini Paramini
structure for the parameters defined in param.ini configuration file
+ Here is the caller graph for this function:

§ DB_InitCOM()

void DB_InitCOM ( int  comn)

Init selected COM port.

Parameters
comn
  • = 0 –> COM1
  • = 1 –> COM2
  • = i –> COM(i+1) .
Returns
er:
  • = 0 –> Init succesfully
  • = 1 –> Problems encountred

Definition at line 452 of file Init.c.

References Baud19200, and DXL_Open().

Referenced by DB_InitMotor().

453 {
454 
455  int er = 0;
456  er = DXL_Open(0, comn, Baud19200);
457  return er;
458 
459 }
#define Baud19200
Definition: WSC.H:120
int DXL_Open(int addr, int com, int baud)
Open COM.
Definition: Dxl.c:1243
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_InitDil()

int DB_InitDil ( void  )

Initialize DIL. Procedure that initialize the DTA Imaging library.

Returns
int

Definition at line 112 of file Init.c.

References BIL, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdsx, spectrumheader::ccdsy, config::CCDType, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, DC_CCDtoName(), DC_PTFtoName(), DI_Init(), DI_OpenDigit(), DI_OpenImage(), DI_RunHisto(), DOASMODE, das::DOption, ccd::dx, ccd::dy, flag::exemode, das::Flag, IDX, IDY, optionini::imgtype, OFFLINEPLOT, das::Paramini, config::Platform, Server, bil::SPH, and paramini::VBin.

Referenced by DB_InitCamera(), ViewNext(), ViewNext_BIN(), and Visualizza().

113 {
114 
115  char buf[80];
116 /*********************************************************************************
117  * dx = X image dimension
118  * dy = Y image dimension
119  * ifmt = image format
120  * 0 = 16 bit unsigned Monochrome or paletted
121  * 1 = 16 bit RGB
122  * 2 = float (4 bytes) Monochrome or paletted
123  * sts: 1 = Show image, 0 = Hidden, 2 = Can't close image via X on window
124  *
125  * tit = Image name (max 32 chars), if use "NONAME", will be initialized with shaded gray
126  * CBImage = Mouse Call Back on Image
127  * CBClose = Closing Cal back
128  *
129  * Return an image identifier (id) 0 to n
130  * A negative value indicate an error
131  * Errors:
132  * -1 = Memory allocation error
133  * -2 = Type inexistent/Format inexistent
134  * -3 = Too image open at the same time
135  *********************************************************************************/
136 
137  Server = DI_Init(0); //0=No Pop-Up Menu, 1=Yes Pop-Up Menu
138 
139  DI_OpenDigit();
140 
141 
143  {
144  IDX = BIL.SPH.ccdex - BIL.SPH.ccdsx + 1;
145  IDY = (BIL.SPH.ccdey - BIL.SPH.ccdsy + 1) / BIL.SPH.ccdvb ;
146  IDX = BIL.SPH.ccdwx;
147  IDY = BIL.SPH.ccdwy/BIL.SPH.ccdvb ;
148  }
149  else
150  {
151  IDX = DC_CCD.dx;
153  }
154 
155 
156  sprintf(buf, "E2V %s on %s",DC_CCDtoName(Cfg.CCDType, 0), DC_PTFtoName(Cfg.Platform, 0));
158  DI_RunHisto();
159 
160 
161 
162  return 0;
163 
164 
165 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int Server
Definition: DAS_Spat.c:253
optionini DOption
Options for DAS execution.
CTYPE const char DLL_P DC_CCDtoName(int CCDCode, int camera)
U32 CCDType
(R/W) Used CCD CCD code definitions
Definition: dcldef.h:1066
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
das DAS
DAS structure.
Definition: Init.c:34
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
S16 dx
Num. of X pixels.
Definition: dcldef.h:1022
short unsigned U16
2 byte without sign, range 0-65535
Definition: dcldef.h:375
C_DEF void DI_OpenDigit(void)
#define OFFLINEPLOT
execution for archived data visualisation
int VBin
CCD Vertical Binning.
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
ccd DC_CCD
CCD settings.
Definition: Init.c:30
S16 dy
Num. of Y pixels.
Definition: dcldef.h:1023
C_DEF void DI_RunHisto(void)
C_DEF int DI_Init(int mod)
bil BIL
Definition: 2DPlot.c:28
config Cfg
Camera controls & Options.
Definition: Init.c:32
int imgtype
Flag to set Image type: 0=MONOINT, 1=RGB.
CTYPE const char DLL_P DC_PTFtoName(int PlatFormCode, int camera)
U32 Platform
(R/W) Platform code Camera platform definitions
Definition: dcldef.h:1065
int exemode
Set the Execution MODE (Execution modes)
C_DEF int DI_OpenImage(U16 dx, U16 dy, U16 ifmt, U16 type, char *tit)
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:

§ DB_InitMotor()

int DB_InitMotor ( int  mod)

Initialize AMS. Procedure that initialize the parameters for the AMS's devices.

Parameters
mod;mod = 0–> do not init COM, mod = 1 –> init COM
Returns
int

Definition at line 1584 of file Init.c.

References AMS1, AMS2, AMS3, AMS_dirfin(), flag::AMSPres, COM1, COM2, ComErrors(), gui::ContrPanel, DB_InitAMS(), DB_InitCOM(), DBDEMO, paramini::EqType, flag::exemode, das::Flag, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, das::Gui, controlpanel::LedSM, mige::linked, LIS_, MANUAL, das::MIGE, MMessageDialog(), MPixmapSetImageFile(), das::Paramini, stepm::power, stepm::slope, stepm::SM_A, stepm::SM_B, SPATRAM, SPATRAM2, SPATRAM3, SPATRAMPLUS, stepm::speed, stepm::step, das::StepM, TESTAMS, and TROPOGAS.

Referenced by ApplyChCB(), and InitCCD_AMS().

1585 {
1586 
1587  char buf[80];
1588  int er = 0;
1589  int ans = 0;
1590  //int AMS1 = 0;
1591  //int AMS2 = 1;
1592 // ATTENZIONE - MOTORI:
1593 // SM1 = Stepper motor per specchio d'ingresso (MOTORE A di AMS1 (id=0)
1594 // SM2 = Stepper motor per reticolo (MOTORE B di AMS1 (id=0)
1595 // SM3 = Stepper motor per ruota filtri (MOTORE A di AMS2 (id=1)
1596 // SM4 = If CONNECTED Neutral density Filter Wheel (Motor B AMS2 (id=1)
1597 // SM5 = Stepper motor per reticolo (MOTORE A di AMS3 (id=2)
1598 // SM6 = Stepper motor per ruota filtri (MOTORE B di AMS3 (id=2)
1599 
1600 if(mod)
1601 {
1602 
1603  if((DAS.Paramini.EqType == LIS_) ||
1604  (DAS.Paramini.EqType == TROPOGAS))
1605  // init COM1
1606  er = DB_InitCOM(COM1 );
1607  else if (DAS.Paramini.EqType == SPATRAM ||
1609  er = DB_InitCOM(COM2);
1610  else if ((DAS.Paramini.EqType == GASCODNG1) ||
1611  (DAS.Paramini.EqType == GASCODNG2) ||
1612  (DAS.Paramini.EqType == GASCODNG3) ||
1613  (DAS.Paramini.EqType == GASCODNG4) ||
1614  (DAS.Paramini.EqType == SPATRAM3) ||
1615  (DAS.Paramini.EqType == SPATRAM2))
1616  {
1617  // init COM2
1618  er = DB_InitCOM(COM2);
1619  }
1620  else
1621  {
1622  sprintf(buf, "For this Equipment the COM Port is UNKNOWN\nPlease Contact DANBO!!!!");
1623  er = MMessageDialog("DAS information", buf, "Ok", NULL);
1624  if (!er)
1625  {
1626  return 1;
1627  }
1628 
1629  }
1630 
1631  if(er)
1632  ComErrors(er);
1633 }
1634  if (er == 0)
1635  {
1636  // Init AMS1
1637  er = DB_InitAMS(AMS1, 0, DAS.StepM.power[AMS1][DAS.StepM.SM_A],
1642 
1643  // Init AMS2
1644  er = DB_InitAMS(AMS2, 0, DAS.StepM.power[AMS2][DAS.StepM.SM_A],
1649 
1650  if( DAS.Paramini.EqType == TROPOGAS ||
1656  DAS.Paramini.EqType == SPATRAM2 ||
1658  {
1659  if(DAS.MIGE.linked)
1660  {
1661  // Init AMS3
1662  // for conditionate initializxation also for the PRGFILE execution mode
1663  //if(DAS.Flag.exemode == MANUAL || DAS.Flag.exemode == DBDEMO|| DAS.Flag.exemode == TESTAMS|| DAS.Flag.exemode == PRGFILE)
1665  ans = MMessageDialog("", "Do you want to ENABLE the ALTAZIMUTH Platform ?", "Yes", "No", NULL);
1666  if(!ans)
1667  {
1668  er = DB_InitAMS(AMS3, 0, DAS.StepM.power[AMS3][DAS.StepM.SM_A],
1673 
1674  if( DAS.Paramini.EqType == GASCODNG2 ||
1676  {
1677  //set final direction
1678  AMS_dirfin(AMS3, 0, 1);
1679 
1680 
1681  }
1682  }
1683  }
1684  else
1685  {
1686  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS3][DAS.StepM.SM_A], "SYS\\ledoffg.bmp");
1687  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS3][DAS.StepM.SM_B], "SYS\\ledoffg.bmp");
1688  // MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM5, "SYS\\ledoffg.bmp");
1689  // MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM6, "SYS\\ledoffg.bmp");
1690  }
1691  }
1692  }
1693  if (er)
1694  {
1695  FLAG.AMSPres = 1;
1696 
1697  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][DAS.StepM.SM_A], "SYS\\ledoffg.bmp");
1698  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][DAS.StepM.SM_B], "SYS\\ledoffg.bmp");
1699  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS2][DAS.StepM.SM_A], "SYS\\ledoffg.bmp");
1700  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS2][DAS.StepM.SM_B], "SYS\\ledoffg.bmp");
1701  if((DAS.Paramini.EqType == TROPOGAS))
1702  {
1703  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS3][DAS.StepM.SM_A], "SYS\\ledoffg.bmp");
1704  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS3][DAS.StepM.SM_B], "SYS\\ledoffg.bmp");
1705  }
1706 
1707  return 1;
1708  }
1709  else
1710  {
1711  FLAG.AMSPres = 0;
1712  return 0;
1713  }
1714 }
stepm StepM
Stepper motors parameters structure.
#define SPATRAM
SPectrometer for Atmospheric TRAcers Measurements - CGE-UE Portugal.
gui Gui
Graphic User Interface Structure.
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
#define AMS2
AMS2 address.
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
flag Flag
Structure for different flags.
#define DBDEMO
execution in demo mode
das DAS
DAS structure.
Definition: Init.c:34
int slope[AMSMAX][2]
Stepper Motors Slope.
int DB_InitAMS(int nid, int mod, int powera, int stepa, int slopea, int speeda, int powerb, int stepb, int slopeb, int speedb)
Init selected AMS.
Definition: Init.c:1391
int DB_InitCOM(int comn)
Init selected COM port.
Definition: Init.c:452
#define COM2
Definition: COMM.H:80
flag FLAG
flags structure
Definition: Init.c:22
#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.
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 MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int linked
void ComErrors(int w)
Alerts for COM errors Creates a message window reporting the number of the error. ...
Definition: Errors.c:164
#define SPATRAM3
SPATRAM3.
#define COM1
Definition: COMM.H:79
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
controlpanel ContrPanel
Control Panel Structure.
#define AMS1
AMS1 address.
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
int AMS_dirfin(int id, int dira, int dirb)
Set Final Directions .
Definition: Dxl.c:457
int EqType
Spectrometer Type.
int AMSPres
AMS Presence: 0 = AMS FOUND; 1 = AMS NOT FOUND.
int exemode
Set the Execution MODE (Execution modes)
#define AMS3
AMS3 address.
#define TESTAMS
execution for testing AMS&#39;s devices
#define MANUAL
execution in manual mode (for lab use)
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:

§ DB_KB_ButtonActive()

void DB_KB_ButtonActive ( int  mod)

Enable/Disable Push buttons on the Control Panel.

Parameters
mod
  • 0 –> Disable all buttons
  • 1 –> Enable all buttons
  • 2 –> Enable the buttons for the execution in TEST AMS Mode
  • 3 –> Enable the buttons for the execution in OFFLINEPLOT Mode

Definition at line 3810 of file CreateForms.c.

References paramini::EqType, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, das::Gui, pushbutt::KeyB, mige::linked, LIS_, das::MIGE, MObjectSetSensitive(), MObjectSetUnsensitive(), das::Paramini, gui::PushButt, SPATRAM, SPATRAM2, SPATRAM3, SPATRAMPLUS, and TROPOGAS.

Referenced by ApplyChCB(), DB_ChooseButtons(), DB_Home_CB(), DB_HorComm_CB(), DB_Pause(), E_Home_SM4(), E_Home_SM6(), InitCCD_AMS(), MDCreate_CP(), MDCreateHorMeas(), SD_Azimuth(), SD_FilterW(), SD_Grating(), SD_Mirror(), SD_NDFilterW(), SD_Zenith(), SD_Zenith_H(), and SZA_FirstCalc().

3811 {
3812  int i;
3813  int eqtype;
3814  eqtype = DAS.Paramini.EqType;
3815 
3816  if(mod == 1)
3817  {
3818  for (i=0; i < (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
3819  {
3820 
3821  MObjectSetSensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Sensitive
3822  if (eqtype == TROPOGAS)
3823  {
3824 
3825  }
3826  if (eqtype == SPATRAMPLUS ||
3827  eqtype == GASCODNG1 ||
3828  eqtype == GASCODNG2 ||
3829  eqtype == GASCODNG3 ||
3830  eqtype == GASCODNG4 ||
3831  eqtype == SPATRAM2 ||
3832  eqtype == SPATRAM3)
3833  if(i==11 )
3834  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]); // Horiz Measur
3835  if(i==8 || i==9)
3836  {
3837  if(DAS.MIGE.linked == 0)
3838  {
3840  //MObjectSetBackgroundRGB(optedit, 192, 192, 192);
3841 
3842  }
3843  }
3844 
3845 
3847  {
3848  if(i==3 || i==4 || i==8 || i==9 || i==10 || i== 11)
3850  }
3851  //if (DAS.Paramini.EqType == GASCODNG)
3852  // if(i==4 || i==5 || i==10 || i== 11)
3853  // MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]);
3854 
3855  }
3856  }
3857  else if(mod == 0)
3858  {
3859  for (i=0; i < (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) - 1; i++)
3860  {
3861 
3862  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Unsensitive
3863  }
3864 
3865  }
3866  else if(mod == 3) //Case off lineplot
3867  {
3868  for (i=0; i < (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
3869  {
3870 
3871  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Unsensitive
3872  }
3873 
3880 
3881  }
3882 
3883  else if(mod == 2) //Case TEST AMS
3884  {
3885  for (i=0; i < (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
3886  {
3887 
3888  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Unensitive
3889  }
3890 
3906 
3907  }
3908 
3909  else if(mod == 4) //Case Horizontal Measurements (Deactivation)
3910  {
3911 
3915  //MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[3]);
3916 
3917  for (i=14; i < 22; i++)
3918  {
3919 
3920  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Unensitive
3921  }
3922 
3923 
3924  }
3925 
3926  else if(mod == 5) //Case Horizontal Measurements (Activation)
3927  {
3928 
3933 
3934  for (i=14; i < 22; i++)
3935  {
3936 
3937  MObjectSetSensitive(DAS.Gui.PushButt.KeyB[i]); // Set all buttons as Unensitive
3938  }
3939 
3940 
3941  }
3942 
3943 
3944 }
#define SPATRAM
SPectrometer for Atmospheric TRAcers Measurements - CGE-UE Portugal.
gui Gui
Graphic User Interface Structure.
MOBJECT KeyB[28]
Keyboard Buttons.
void MObjectSetUnsensitive(MOBJECT obj)
#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.
mige MIGE
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
pushbutt PushButt
Push buttons.
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
int linked
#define SPATRAM3
SPATRAM3.
das DAS
Definition: CreateForms.c:98
int EqType
Spectrometer Type.
void MObjectSetSensitive(MOBJECT obj)
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:

§ DB_KeyB_CB()

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

Push buttons callback
.

Parameters
pcalling push button MObject
*adcalling push button number

Definition at line 4693 of file CreateForms.c.

References _MAX_PATH, AboutCB(), controlpanel::Albl_CS, FB_PREFS::allow_dir_create, FB_PREFS::allow_dir_delete, FB_PREFS::allow_dir_rename, AMS3, AutoRange(), FB_PREFS::bg_image_file, FB_PREFS::button_font, FB_PREFS::change_cwd, ChkDigIO(), ChkWinInstance(), gui::ContrPanel, D_Average(), D_Calibra(), D_Saving(), D_XProfile(), D_YProfile(), d_fileman::DATADIRECTORY, DB_Ask(), DB_GetCCD(), DB_PasWd(), DB_Pause(), DB_Save(), DB_Tools(), d_fileman::DBFILENAME, bil::DFILEM, DI_FindExtName(), DI_Lens(), das::DOption, False, FANECU(), FDOUBLE, optionini::filename, FilSet, optionini::filtertype, FB_PREFS::font, FPLUS, das::Gui, HELV_SMALL, HGFlg, HgLamp(), d_fileman::HOMEDIRECTORY, MDCreateHorMeas(), MDCreateMoveGrat(), MDCreateMoveZenAzimDeg(), MDCreateSh_Fil(), MDCreateSh_Home(), MDCreateSh_Mir(), MDCreateSh_NDFil(), MDCreateSh_SimPos(), MDCreateSh_Wl(), MFileBrowseExt(), MirSet, MMessageDialog(), MObjectSetText(), NDFilSet, NFileNameF, stepm::OOP, QJFlg, QjLamp(), SaveCnt, optionini::savingmode, SD_FilterW(), SD_FNTorqueM(), SD_Grating(), SD_Mirror(), SD_NDFilterW(), shells::Sh_Home, shells::Sh_mg, tools::Sh_Tools, gui::Shells, ShutDOWN(), das::StepM, TExp, TMFlg, FB_PREFS::transparent_tree, True, ViewPlot(), and WlSet.

Referenced by MDCreate_CP(), and MDCreateHorMeas().

4694 {
4695  int c = (int) ad;
4696  int er = 0;
4697  char buf[_MAX_PATH];
4698  char fext[4];
4699 
4700  FB_PREFS fbp;
4701 
4702  memset (&fbp, 0, sizeof (fbp));
4703 
4704  fbp.change_cwd = True;
4705  fbp.allow_dir_create = True;
4706  fbp.allow_dir_rename = True;
4707  fbp.allow_dir_delete = True;
4708  fbp.transparent_tree = False;
4709  fbp.font = HELV_SMALL;
4710  fbp.button_font = HELV_SMALL;
4711  //Set Img file
4712  sprintf(buf, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "sys\\Tile2.bmp" );
4713  fbp.bg_image_file =buf;
4714 
4715 
4716  switch(c)
4717  {
4718  //Mirror Shell
4719  case 0 :
4720  er = MDCreateSh_Mir();
4721  if(er == 0)
4722  {
4723  SD_Mirror(MirSet);
4724 // if(er) Status("Ready");
4725  }
4726  break;
4727  //Wavelwngth Shell
4728  case 1:
4729  er = MDCreateSh_Wl();
4730  if(er == 0)
4731  {
4732  er = SD_Grating(WlSet);
4733 // if(er) Status("Ready");
4734  }
4735  break;
4736  //Filter Shell
4737  case 2:
4738  er = MDCreateSh_Fil();
4739  if(er == 0)
4740  {
4741  SD_FilterW(FilSet);
4742 // if(er) Status("Ready");
4743  }
4744  break;
4745  // NDFilter shell
4746  case 3:
4747 
4748  if(DAS.DOption.filtertype == FPLUS )
4749  {
4750  if(TMFlg)
4751  SD_FNTorqueM(0);
4752  else
4753  SD_FNTorqueM(1);
4754  }
4755  if(DAS.DOption.filtertype == FDOUBLE)
4756  {
4757  er = MDCreateSh_NDFil();
4758  if(er == 0)
4759  {
4761 // if(er) Status("Ready");
4762  }
4763  }
4764 
4765  break;
4766 
4767  // Move Zenith Azimuth of a Free step number
4768  case 4:
4770  break;
4771  //Home Mirror
4772  case 5:
4773  // Reference position of All devices
4774  // er = MDCreateSh_Home();
4775  sprintf(buf, "%s", "SET HOME POSITION");
4776  er = ChkWinInstance(buf, DAS.Gui.Shells.Sh_Home);
4777  if (er==0)
4778  MDCreateSh_Home();
4779 /*
4780 
4781  //Disattiva i pulsanti sulla keyboard
4782  DB_KB_ButtonActive(0);
4783  er = DB_InitAMS(AMS1, 2, DAS.StepM.power[AMS1][DAS.StepM.SM_A],
4784  DAS.StepM.step[AMS1][DAS.StepM.SM_A], DAS.StepM.slope[AMS1][DAS.StepM.SM_A],
4785  DAS.StepM.speed[AMS1][DAS.StepM.SM_A], DAS.StepM.power[AMS1][DAS.StepM.SM_B],
4786  DAS.StepM.step[AMS1][DAS.StepM.SM_B], DAS.StepM.slope[AMS1][DAS.StepM.SM_B],
4787  DAS.StepM.speed[AMS1][DAS.StepM.SM_B]);
4788  //Attiva i pulsanti sulla keyboard
4789  DB_KB_ButtonActive(1);
4790 */
4791  break;
4792  //Home Grating
4793  case 6:
4794 
4795  er = ChkDigIO(DAS.StepM.OOP[AMS3], 1);
4796  if (er)
4797  {
4798  FANECU(0);
4799  }
4800  else
4801  {
4802  FANECU(1);
4803  }
4804  // Setto direzioni finali
4805  //AMS_dirfin(AMS1, 0, 0);
4806  // Set default values
4807  //Disattiva i pulsanti sulla keyboard
4808  /* DB_KB_ButtonActive(0);
4809  AMS_Default(AMS1);
4810  er = DB_InitAMS(AMS1, 3, DAS.StepM.power[AMS1][DAS.StepM.SM_A],
4811  DAS.StepM.step[AMS1][DAS.StepM.SM_A], DAS.StepM.slope[AMS1][DAS.StepM.SM_A],
4812  DAS.StepM.speed[AMS1][DAS.StepM.SM_A], DAS.StepM.power[AMS1][DAS.StepM.SM_B],
4813  DAS.StepM.step[AMS1][DAS.StepM.SM_B], DAS.StepM.slope[AMS1][DAS.StepM.SM_B],
4814  DAS.StepM.speed[AMS1][DAS.StepM.SM_B]);
4815  //Attiva i pulsanti sulla keyboard
4816  DB_KB_ButtonActive(1);
4817  */
4818  break;
4819 
4820  //Home Filter
4821  case 7:
4822  //Disattiva i pulsanti sulla keyboard
4823  /*
4824  DB_KB_ButtonActive(0);
4825  //HomeFiltersFast();
4826  AMS_Default(AMS2);
4827  er = DB_InitAMS(AMS2, 4, DAS.StepM.power[AMS2][DAS.StepM.SM_A],
4828  DAS.StepM.step[AMS2][DAS.StepM.SM_A], DAS.StepM.slope[AMS2][DAS.StepM.SM_A],
4829  DAS.StepM.speed[AMS2][DAS.StepM.SM_A], DAS.StepM.power[AMS2][DAS.StepM.SM_B],
4830  DAS.StepM.step[AMS2][DAS.StepM.SM_B], DAS.StepM.slope[AMS2][DAS.StepM.SM_B],
4831  DAS.StepM.speed[AMS2][DAS.StepM.SM_B]);
4832  //Attiva i pulsanti sulla keyboard
4833  DB_KB_ButtonActive(1);
4834  */
4835  break;
4836 
4837 
4838 
4839 
4840  //Home Zenith
4841  case 8:
4842  /*
4843  //Disattiva i pulsanti sulla keyboard
4844  DB_KB_ButtonActive(0);
4845  AMS_Default(AMS3);
4846  er = DB_InitAMS(AMS3, 5, DAS.StepM.power[AMS3][DAS.StepM.SM_A],
4847  DAS.StepM.step[AMS3][DAS.StepM.SM_A], DAS.StepM.slope[AMS3][DAS.StepM.SM_A],
4848  DAS.StepM.speed[AMS3][DAS.StepM.SM_A], DAS.StepM.power[AMS3][DAS.StepM.SM_B],
4849  DAS.StepM.step[AMS3][DAS.StepM.SM_B], DAS.StepM.slope[AMS3][DAS.StepM.SM_B],
4850  DAS.StepM.speed[AMS3][DAS.StepM.SM_B]);
4851  AMS_dirfin(AMS3, 0, 1);
4852  //Attiva i pulsanti sulla keyboard
4853  DB_KB_ButtonActive(1);
4854  */
4855  break;
4856 
4857  //Home Azimuth
4858  case 9:
4859  /*
4860  //Disattiva i pulsanti sulla keyboard
4861  DB_KB_ButtonActive(0);
4862  AMS_Default(AMS3);
4863  er = DB_InitAMS(AMS3, 6, DAS.StepM.power[AMS3][DAS.StepM.SM_A],
4864  DAS.StepM.step[AMS3][DAS.StepM.SM_A], DAS.StepM.slope[AMS3][DAS.StepM.SM_A],
4865  DAS.StepM.speed[AMS3][DAS.StepM.SM_A], DAS.StepM.power[AMS3][DAS.StepM.SM_B],
4866  DAS.StepM.step[AMS3][DAS.StepM.SM_B], DAS.StepM.slope[AMS3][DAS.StepM.SM_B],
4867  DAS.StepM.speed[AMS3][DAS.StepM.SM_B]);
4868  //Attiva i pulsanti sulla keyboard
4869  DB_KB_ButtonActive(1);
4870  */
4871  break;
4872 
4873  // Spectrometer Devices Simultaneous Positioning
4874  case 10:
4875  er = MDCreateSh_SimPos();
4876  break;
4877  //Horizontal Measurement shell
4878  case 11:
4879  MDCreateHorMeas();
4880  break;
4881 
4882  // Move Grating Free step number
4883  case 12:
4884  sprintf(buf, "%s", "MOVE GRATING");
4885  er = ChkWinInstance(buf, DAS.Gui.Shells.Sh_mg);
4886  if (er==0)
4887  MDCreateMoveGrat();
4888  break;
4889  //Configuration Shell
4890  case 13:
4891  DB_PasWd();
4892  break;
4893  //Calibration
4894  case 14:
4895  D_Calibra();
4896  break;
4897  //AutoRange
4898  case 15:
4899  AutoRange(0);
4900  break;
4901  //Get CCD
4902  case 16:
4903  sprintf(buf, "%.3lf", TExp);
4904  er = DB_Ask("DOWNLOAD IMAGE", "", "Time Exposure: ", buf, 6, "Get Light");
4905 
4906  if(er == 0)
4907  {
4908  // sscanf(buf, "%lf", &TExp);
4909  DB_GetCCD(1);
4910  // save_imgASCII(filedati, 1);
4911  }
4912  break;
4913  //Averaging
4914  case 17:
4915  D_Average(1);
4916  break;
4917  //Dark
4918  case 18:
4919  //strcpy(buf, "0.000");
4920  sprintf(buf, "%.3lf", TExp);
4921  er = DB_Ask("DOWNLOAD DARK", "", "Time Exposure: ", buf, 6, "Get Dark");
4922  if(er == 0)
4923  {
4924  // sscanf(buf, "%lf", &TExp);
4925  DB_GetCCD(0);
4926  }
4927  break;
4928  //Save CCD Data
4929  case 19:
4930 
4931  if(DAS.DOption.filename) // Automatic file Names
4932  {
4933  D_Saving();
4934  }
4935  else // free choice
4936  {
4937  if(DAS.DOption.savingmode)
4938  er = MFileBrowseExt ("Save File as...", "*.bif", NFileNameF, BIL.DFILEM.DATADIRECTORY, &fbp);
4939  else
4940  er = MFileBrowseExt ("Save File as...", "*.dat", NFileNameF, BIL.DFILEM.DATADIRECTORY, &fbp);
4941  if(er)
4942  {
4943  //check the presence of the extension
4944  DI_FindExtName(NFileNameF, fext);
4945  if( strcmp(fext,"") == 0 )
4946  {
4947  if(DAS.DOption.savingmode)
4948  strcat(NFileNameF, ".bif");
4949  else
4950  strcat(NFileNameF, ".dat");
4951  }
4952  //check the the extension
4953  DI_FindExtName(NFileNameF, fext);
4954  if( (strcmp(fext,".dat") == 0) | (strcmp(fext,".Dat") == 0) )
4955  {
4958  }
4959  else if( (strcmp(fext,".bif") == 0) | (strcmp(fext,".Bif") == 0) )
4960  {
4963  }
4964  else
4965  {
4966  sprintf(buf, "The extension is not recognaized! Please re-type",fext);
4967  MMessageDialog("DAS information", buf, " Ok ", NULL);
4968  break;
4969  }
4970  }
4971 
4972 
4973  sprintf(buf, "%s", NFileNameF );
4975  sprintf(buf, "%05d", SaveCnt);
4977  SaveCnt++;
4978 
4979  }
4980  break;
4981 
4982 
4983  case 20:
4984  //On line Plot
4985  ViewPlot(1);
4986  break;
4987 
4988 
4989  case 21:
4990  DI_Lens();
4991  break;
4992  //Profiling X Axis
4993  case 22:
4994  D_XProfile();
4995  break;
4996  //Profiling Y Axis
4997  case 23:
4998  D_YProfile();;
4999  break;
5000  //Configuration Shell
5001  //About Shell
5002  case 24:
5003  AboutCB(NULL, NULL, 0);
5004  break;
5005  //Pause shell
5006  case 25:
5007  DB_Pause();
5008  break;
5009  //Tools shell
5010  case 26:
5011  sprintf(buf, "%s", "DAS TOOLS");
5012  er = ChkWinInstance(buf, TOOLS.Sh_Tools);
5013  if (er==0)
5014  DB_Tools();
5015  break;
5016  //Quit shell
5017  case 27:
5018  ShutDOWN();
5019  break;
5020  //HG Lamp
5021  case 100:
5022  if(HGFlg)
5023  HgLamp(0);
5024  else
5025  HgLamp(1);
5026  break;
5027  //Qj Lamp
5028  case 111:
5029  if(QJFlg)
5030  QjLamp(0);
5031  else
5032  QjLamp(1);
5033  break;
5034 
5035 
5036 
5037  }
5038 }
MOBJECT Sh_Tools
Shell for tools.
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
shells Shells
Shells structure.
void MDCreateMoveZenAzimDeg(void)
Definition: CreateForms.c:3573
void HgLamp(int mod)
HG Lamp ON/OFF .
Definition: Spat_Device.c:2673
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
void SD_FNTorqueM(int mod)
Positioning NDFilter. .
Definition: Spat_Device.c:3066
CARD8 change_cwd
Definition: Mguidefs.h:1485
void D_XProfile(void)
Definition: CreateForms.c:2656
CARD8 allow_dir_create
Definition: Mguidefs.h:1487
int DB_Ask(char *tit, char *bmp, char *label, char *pre, int len, char *pbtype)
Input Shell Create an input box.
Definition: CreateForms.c:5373
int SaveCnt
Definition: Procedures.c:49
bil BIL
Definition: CreateForms.c:83
MTFont button_font
Definition: Mguidefs.h:1501
int QJFlg
Definition: DAS_Spatram.h:2969
CARD8 allow_dir_delete
Definition: Mguidefs.h:1493
int MDCreateSh_Mir(void)
Create the shell for the available Mirror Positions. Procedure that build the shell for the positioni...
Definition: CreateForms.c:5614
int MDCreateSh_Fil(void)
Create the shell for the available Filters. Procedure that build the shell for the positioning of the...
Definition: CreateForms.c:5994
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
MOBJECT Sh_Home
Home Shell.
MTFont font
Definition: Mguidefs.h:1499
MOBJECT MDCreateHorMeas(void)
Definition: CreateForms.c:681
#define False
Definition: Mguidefs.h:236
void D_Average(int mod)
Performs averaged measurements .
Definition: Procedures.c:2655
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
MOBJECT Sh_mg
Password Shell.
char DATADIRECTORY[_MAX_PATH]
Definition: bildef.h:201
int WlSet
Wavelength position definition - for SD_Grating.
Definition: DAS_Spat.c:135
MOBJECT Albl_CS[4]
Active Control Panel Labels for Camera Status 4.
void DB_Save(char *tit, int mod)
Save the acquired spectrum. Procedure that Save the acquired spectrum.
Definition: Save.c:552
void MObjectSetText(MOBJECT obj, const char *text)
int TMFlg
Definition: DAS_Spatram.h:2972
void QjLamp(int mod)
QJ Lamp ON/OFF .
Definition: Spat_Device.c:2724
int MDCreateSh_Home(void)
Definition: CreateForms.c:6662
void DB_PasWd(void)
Definition: CreateForms.c:2600
int ChkDigIO(unsigned char word, int bitn)
check for digital I/O Status
File Browser Preferences. Used by the Utility functions MFileBowserExt() and MDirBowserExt().
Definition: Mguidefs.h:1482
void D_Saving(void)
Saving image. Procedure for saving the CCD Image Used since version 2.1.0. The coiche between binary ...
Definition: Procedures.c:1369
void DB_Tools()
Definition: CreateForms.c:4158
#define FDOUBLE
double filter wheel
#define FPLUS
Filter Wheel Torque Motor.
CARD8 transparent_tree
Definition: Mguidefs.h:1495
d_fileman DFILEM
Definition: bildef.h:257
int MDCreateSh_Wl(void)
Create the shell for the available Wavelength. Procedure that build the shell for the availables wave...
Definition: CreateForms.c:5815
int D_Calibra(void)
Spectral Calibration Procedure for the spectral calibration with HG lamp. Shift of HG spectral line a...
Definition: Procedures.c:2313
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
#define HELV_SMALL
Definition: Mguidefs.h:881
void AboutCB(MOBJECT o, void *s, void *v)
Create the About information shell. .
Definition: About.c:39
char NFileNameF[_MAX_PATH]
Definition: CreateForms.c:71
int ViewPlot(int mod)
Create the plot shell. Procedure that build the plot shell for the data visualization.
Definition: Spat_Plot.c:3775
int ChkWinInstance(char *buff, MOBJECT obj)
Definition: DAS_Spat.c:2153
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
int MFileBrowseExt(const char *t, const char *ext, char *fname, char *dname, FB_PREFS *prefs)
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
Definition: Procedures.c:899
void DB_Pause(void)
Definition: CreateForms.c:3766
void MDCreateMoveGrat(void)
Free Grating positioning. Procedure that build the shell for Free Grating positioning.
Definition: CreateForms.c:2859
void ShutDOWN(void)
Creates shell for Shutting down the instrument .
Definition: CreateForms.c:6903
const char * bg_image_file
Definition: Mguidefs.h:1519
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int MDCreateSh_NDFil(void)
Definition: CreateForms.c:6233
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
int NDFilSet
ND filter wheel position definition - for SD_NDFilterW.
Definition: CreateForms.c:6231
controlpanel ContrPanel
Control Panel Structure.
void FANECU(int mod)
FAN ON/OFF .
Definition: Spat_Device.c:2619
das DAS
Definition: CreateForms.c:98
int MDCreateSh_SimPos(void)
Definition: CreateForms.c:4411
#define True
Definition: Mguidefs.h:235
C_DEF void DI_FindExtName(char *fullname, char *fext)
int FilSet
filter wheel position definition - for SD_FilterW
Definition: CreateForms.c:5992
int filename
Flag to set file name mode 0=Free choice, 1 = Automatic.
CARD8 allow_dir_rename
Definition: Mguidefs.h:1490
int HGFlg
Definition: DAS_Spatram.h:2968
int SD_NDFilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2354
void D_YProfile(void)
Definition: CreateForms.c:2638
tools TOOLS
Definition: CreateForms.c:81
#define AMS3
AMS3 address.
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
C_DEF void DI_Lens(void)
int MirSet
mirror position definition - for SD_Mirror
Definition: CreateForms.c:5612
+ Here is the caller graph for this function:

§ DB_KeyComSelButtKB_CB()

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

callback for selsct a specified push button with the keyboard

Definition at line 5152 of file CreateForms.c.

References gui::ContrPanel, D_A, palette::DB_Sel, palette::DB_UnSel, palette::DB_UnSelFG, ESC, F1, F10, F11, F12, F2, F3, F5, F6, F7, F8, F9, das::Gui, pushbutt::KeyB, MKeyEvent::keycode, L_A, MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MSelectObject(), controlpanel::pblamps, gui::PushButt, R_A, and U_A.

Referenced by MDCreate_CP().

5153 {
5154 
5155  int c = (int) a_data, i;
5156 
5157 
5158  switch (pe->keycode)
5159  {
5160  case R_A:
5163  if (c == (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) - 1)
5164  {
5167  break;
5168  }
5169  else
5170  {
5173  break;
5174  }
5175  case D_A:
5176 // MObjectSetBackgroundRGB(obj, DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5177 // MObjectSetForegroundRGB(obj, 255 ,0,0);
5178 
5179  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5180  {
5183  if (i == c + 1)
5184  {
5187  MSelectObject(obj);
5188  }
5189 
5190 
5191  }
5194  break;
5195 /* MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5196  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
5197  if (c == (sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) - 1)
5198  {
5199  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[0], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5200  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[0], ~DPAL.DB_Sel[0], ~DPAL.DB_Sel[1], ~DPAL.DB_Sel[2]);
5201  break;
5202  }
5203  else
5204  {
5205  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c + 1], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5206  MObjectSetForegroundRGB(DAS.Gui.PushButt.KeyB[c + 1], ~DPAL.DB_Sel[0], ~DPAL.DB_Sel[1], ~DPAL.DB_Sel[2]);
5207  break;
5208  }
5209 */
5210  case L_A:
5213  if (c == 0)
5214  {
5217  break;
5218  }
5219  else
5220  {
5223  break;
5224  }
5225  case U_A:
5228  if (c == 0)
5229  {
5232  break;
5233  }
5234  else
5235  {
5238  break;
5239  }
5240  case F1:
5241  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]) ; i++)
5242  {
5244  }
5247  break;
5248  case F2:
5249  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5250  {
5252  }
5255  break;
5256  case F3:
5257  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5258  {
5260  }
5263  break;
5264  case F5:
5265  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5266  {
5268  }
5271  break;
5272  case F6:
5273  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5274  {
5276  }
5279  break;
5280  case F7:
5281  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5282  {
5284  }
5287  break;
5288  case F8:
5289  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5290  {
5292  }
5295  break;
5296  case F9:
5297  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5298  {
5300  }
5303  break;
5304  case F10:
5305  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5306  {
5308  }
5311  break;
5312  case F11:
5313  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5314  {
5316  }
5319  break;
5320  case F12:
5321  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5322  {
5324  }
5327  break;
5328 /* case A_F1:
5329  for (i=0; i<21; i++)
5330  {
5331  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5332  }
5333  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5334  break;
5335  case A_F2:
5336  for (i=0; i<21; i++)
5337  {
5338  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5339  }
5340  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5341  break;
5342  case A_F3:
5343  for (i=0; i<21; i++)
5344  {
5345  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5346  }
5347  MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5348  break;
5349 */
5350  case ESC:
5351  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5352  {
5354  }
5357  break;
5358  }
5359 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
unsigned int keycode
Code for the pressed key.
Definition: Mguidefs.h:541
void MSelectObject(MOBJECT f)
MOBJECT KeyB[28]
Keyboard Buttons.
#define ESC
Definition: KEYCODES.H:265
#define F3
Definition: KEYCODES.H:339
#define F10
Definition: KEYCODES.H:346
#define F2
Definition: KEYCODES.H:338
MOBJECT pblamps[2]
Control Panel Push buttons for HG and QJ Lamps.
#define R_A
Definition: KEYCODES.H:280
short DB_Sel[3]
Selected Buttons Colors.
#define F9
Definition: KEYCODES.H:345
#define F7
Definition: KEYCODES.H:343
#define U_A
Definition: KEYCODES.H:278
#define L_A
Definition: KEYCODES.H:281
#define F12
Definition: KEYCODES.H:348
#define F11
Definition: KEYCODES.H:347
#define F5
Definition: KEYCODES.H:341
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
#define F8
Definition: KEYCODES.H:344
controlpanel ContrPanel
Control Panel Structure.
das DAS
Definition: CreateForms.c:98
#define D_A
Definition: KEYCODES.H:279
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
#define F6
Definition: KEYCODES.H:342
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
#define F1
Definition: KEYCODES.H:337
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_KeyComSelButtMouse_CB()

void DB_KeyComSelButtMouse_CB ( MOBJECT  obj,
MMouseEvent pe,
void *  a_data 
)

callback for selsct a specified push button with the keyboard

Definition at line 5072 of file CreateForms.c.

References optionini::aaopmode, MMouseEvent::button, gui::ContrPanel, palette::DB_Sel, palette::DB_UnSel, palette::DB_UnSelFG, das::DOption, E_MOTION, das::Gui, pushbutt::KeyB, MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MObjectSetUnsensitive(), MSelectObject(), controlpanel::pblamps, gui::PushButt, and MMouseEvent::type.

Referenced by MDCreate_CP().

5073 {
5074 
5075  int c = (int) a_data, i;
5076 
5077 /* for (i=0; i<(sizeof PBUTT.KeyB / sizeof PBUTT.KeyB[0]); i++)
5078  {
5079  MObjectSetBackgroundRGB(PBUTT.KeyB[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
5080 
5081  /**************************************
5082  SHAREWARE
5083  if (i==2 | i==9 |i==3 | i==4 |i==6 | i==11 |i==12 | i==13 |i==19 | i== 20| i==17 |i==10 | i== 21)
5084  {
5085  MObjectSetBackgroundRGB(PBUTT.KeyB[i], 150, 150, 150);
5086  }
5087  /***************************************/
5088 
5089 // }
5090 
5091 
5092 
5093  switch (pe->button)
5094  {
5095 
5096  case (Button1):
5097  {
5098  //MObjectSetBackgroundRGB(PBUTT.KeyB[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5100  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5101  if(i != c)
5102  {
5105  }
5106  /***************************************/
5107  /* SHAREWARE */
5108 // if (c==2 | c==9 |c==3 | c==4 |c==6 | c==11 |c==12 | c==13 |c==19 | c== 20| c==17 |c==10 | c== 21)
5109 // {
5110 // MObjectSetBackgroundRGB(DAS.Gui.PushButt.KeyB[c], 150, 150, 150);
5111 // }
5112  /***************************************/
5113 
5114 
5115  break;
5116  }
5117  }
5118  switch (pe->type)
5119  {
5120 
5121  case (E_MOTION):
5122  {
5124  MSelectObject(obj);
5125  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5126  {
5127  if(i != c)
5128  {
5131  }
5132  }
5135 
5138  if(DAS.DOption.aaopmode == 0)
5139  {
5142  //MObjectSetBackgroundRGB(optedit, 192, 192, 192);
5143  }
5144 
5145  break;
5146  }
5147  }
5148 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
optionini DOption
Options for DAS execution.
void MSelectObject(MOBJECT f)
MOBJECT KeyB[28]
Keyboard Buttons.
void MObjectSetUnsensitive(MOBJECT obj)
MOBJECT pblamps[2]
Control Panel Push buttons for HG and QJ Lamps.
short DB_Sel[3]
Selected Buttons Colors.
unsigned int button
button pressed/released (Button1, Button2 or Button3), 0 if no button involved
Definition: Mguidefs.h:622
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
controlpanel ContrPanel
Control Panel Structure.
das DAS
Definition: CreateForms.c:98
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
int aaopmode
operation mode for the Alt Az Platform, 0 = solar Traxker; 1 = Anti-Solar Tracker; 2 = Free Positioni...
int type
Event type (E_BUTTON_PRESS, E_BUTTON_RELEASE, E_MOTION, E_MOUSE_WHEEL)
Definition: Mguidefs.h:612
#define E_MOTION
Definition: Mguidefs.h:277
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_LampSelButtMouse_CB()

void DB_LampSelButtMouse_CB ( MOBJECT  obj,
MMouseEvent pe,
void *  a_data 
)

callback for selsct a specified push button with the keyboard

Definition at line 5041 of file CreateForms.c.

References gui::ContrPanel, palette::DB_Sel, palette::DB_UnSel, E_MOTION, das::Gui, pushbutt::KeyB, MObjectSetBackgroundRGB(), MSelectObject(), controlpanel::pblamps, gui::PushButt, and MMouseEvent::type.

Referenced by MDCreate_CP().

5042 {
5043  int c = (int) a_data, i;
5044 
5045 
5046  switch (pe->type)
5047  {
5048  case (E_MOTION):
5049  {
5050 
5052  MSelectObject(obj);
5053  switch (c)
5054  {
5055  case 0:
5057  break;
5058  case 1:
5060  break;
5061  }
5062  for (i=0; i<(sizeof DAS.Gui.PushButt.KeyB / sizeof DAS.Gui.PushButt.KeyB[0]); i++)
5064  }
5065  break;
5066  }
5067 
5068 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
void MSelectObject(MOBJECT f)
MOBJECT KeyB[28]
Keyboard Buttons.
MOBJECT pblamps[2]
Control Panel Push buttons for HG and QJ Lamps.
short DB_Sel[3]
Selected Buttons Colors.
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
controlpanel ContrPanel
Control Panel Structure.
das DAS
Definition: CreateForms.c:98
short DB_UnSel[3]
Unselected Buttons Colors.
int type
Event type (E_BUTTON_PRESS, E_BUTTON_RELEASE, E_MOTION, E_MOUSE_WHEEL)
Definition: Mguidefs.h:612
#define E_MOTION
Definition: Mguidefs.h:277
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_MIGE_CB()

void DB_MIGE_CB ( MOBJECT  o,
void *  a,
void *  v 
)

callback selecting the operation mode for the AltAzPlatform

Definition at line 1000 of file DAS_Spat_ConfCBs.c.

References gui::ConfigPanel, das::Gui, pushbutt::KeyB, mige::linked, das::MIGE, MObjectSetSensitive(), MObjectSetUnsensitive(), MRButtonGetActivationStatus(), gui::PushButt, configpanel::rbMIGEopmode, and configpanel::rbMIGEtype.

Referenced by CONFP_opt_page5().

1001 {
1002 
1003  int er = 0;
1004  int c = (int) v;
1005 
1006 
1008 
1009  if(er)
1010  {
1011  switch (c)
1012  {
1013  case 0:
1014  DAS.MIGE.linked = 0; //MIGE not Connected
1024 
1025  //MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[5]);
1026  break;
1027  case 1:
1028  DAS.MIGE.linked = 1; //
1038  break;
1039  }
1040  }
1041 }
gui Gui
Graphic User Interface Structure.
MOBJECT KeyB[28]
Keyboard Buttons.
void MObjectSetUnsensitive(MOBJECT obj)
int MRButtonGetActivationStatus(MOBJECT o)
mige MIGE
pushbutt PushButt
Push buttons.
int linked
das DAS
configpanel ConfigPanel
Configuration panel structure.
MOBJECT rbMIGEtype[5]
radio button for MIGE type
MOBJECT rbMIGEopmode[3]
radio button for MIGE operating mode
void MObjectSetSensitive(MOBJECT obj)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_MIGEopmode_CB()

void DB_MIGEopmode_CB ( MOBJECT  o,
void *  a,
void *  v 
)

callback selecting the operation mode for the AltAzPlatform

Definition at line 1071 of file DAS_Spat_ConfCBs.c.

References optionini::aaopmode, DOASMODE, das::DOption, flag::exemode, das::Flag, das::Gui, pushbutt::KeyB, MObjectSetSensitive(), MObjectSetUnsensitive(), MRButtonGetActivationStatus(), and gui::PushButt.

Referenced by CONFP_opt_page5().

1072 {
1073 
1074  int er = 0;
1075  int c = (int) v;
1076 
1077 
1079 
1080  if(er)
1081  {
1082  switch (c)
1083  {
1084  case 0:
1085  DAS.DOption.aaopmode = 0; //Solar Tracker
1086  if(DAS.Flag.exemode != DOASMODE)
1087  {
1091  //MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[4]);
1092  }
1093  break;
1094  case 1:
1095  DAS.DOption.aaopmode = 1; //Anti Solar Tracker
1096  if(DAS.Flag.exemode != DOASMODE)
1097  {
1101  //MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[4]);
1102  }
1103  break;
1104  case 2:
1105  DAS.DOption.aaopmode = 2; //Free Positioning
1106  if(DAS.Flag.exemode != DOASMODE)
1107  {
1111  //MObjectSetSensitive(DAS.Gui.PushButt.KeyB[4]);
1112  }
1113  break;
1114  }
1115  }
1116 }
gui Gui
Graphic User Interface Structure.
optionini DOption
Options for DAS execution.
MOBJECT KeyB[28]
Keyboard Buttons.
void MObjectSetUnsensitive(MOBJECT obj)
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
int MRButtonGetActivationStatus(MOBJECT o)
pushbutt PushButt
Push buttons.
das DAS
int aaopmode
operation mode for the Alt Az Platform, 0 = solar Traxker; 1 = Anti-Solar Tracker; 2 = Free Positioni...
void MObjectSetSensitive(MOBJECT obj)
int exemode
Set the Execution MODE (Execution modes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_MIGEType_CB()

void DB_MIGEType_CB ( MOBJECT  o,
void *  a,
void *  v 
)

Definition at line 1043 of file DAS_Spat_ConfCBs.c.

References das::MIGE, MRButtonGetActivationStatus(), and mige::type.

Referenced by CONFP_opt_page5().

1044 {
1045 
1046  int er = 0;
1047  int c = (int) v;
1048 
1049 
1051 
1052  if(er)
1053  {
1054  switch (c)
1055  {
1056  case 0:
1057  DAS.MIGE.type = 0; //Old and Big Platform (not used anymore)
1058  break;
1059  case 1:
1060  DAS.MIGE.type = 1; //ISAC Version
1061  break;
1062  case 2:
1063  DAS.MIGE.type = 2; //COM Version (with slip ring)
1064  break;
1065  }
1066  }
1067 }
int type
int MRButtonGetActivationStatus(MOBJECT o)
mige MIGE
das DAS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_Mir_CB()

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

callback for input mirror positioning in Mirror shell

Parameters
pcalling push button MObject
*adcalling push button number

Definition at line 5692 of file CreateForms.c.

References paramini::EqType, GASCODNG4, Mir_Code, Mir_CodeTropo, MirBuff, MirFlg, MirSet, das::Paramini, SPATRAM3, and TROPOGAS.

Referenced by MDCreateSh_Mir().

5693 {
5694  int c = (int) ad;
5695 
5696 
5698  MirBuff = Mir_CodeTropo[c];
5699  else
5700  MirBuff = Mir_Code[c];
5701 
5702 
5703  MirSet = c;
5704  MirFlg = 1;
5705 }
const char * Mir_Code[]
const char array for the realisation of the Mirrors buttons in the Mirror shell
Definition: DAS_Spat.c:231
static int MirFlg
Definition: CreateForms.c:47
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
#define GASCODNG4
GASCODNG 4.
#define SPATRAM3
SPATRAM3.
const char * MirBuff
Definition: CreateForms.c:48
das DAS
Definition: CreateForms.c:98
int EqType
Spectrometer Type.
int MirSet
mirror position definition - for SD_Mirror
Definition: CreateForms.c:5612
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 caller graph for this function:

§ DB_MirrorImg_CB()

void DB_MirrorImg_CB ( MOBJECT  o,
void *  a,
void *  v 
)

callback selecting the activation of the mirroring of the CCD image along the X or Y axis

Definition at line 1259 of file DAS_Spat_ConfCBs.c.

References das::DOption, optionini::mirrorimg, MRButtonGetActivationStatus(), XAX, and YAX.

Referenced by CONFP_opt_page5().

1260 {
1261 
1262  int er = 0;
1263  int c = (int) v;
1264 
1265 
1267 
1268  if(er)
1269  {
1270  switch (c)
1271  {
1272  case 0:
1273  DAS.DOption.mirrorimg[XAX] = 1; //Mirror image along X Axis
1274  break;
1275  case 1:
1276  DAS.DOption.mirrorimg[XAX] = 0; //Do NOT mirror image along X Axis ;
1277  break;
1278  case 2:
1279  DAS.DOption.mirrorimg[YAX] = 1; //Mirror image along Y Axis
1280  break;
1281  case 3:
1282  DAS.DOption.mirrorimg[YAX] = 0; //Do NOT mirror image along Y Axis ;
1283  break;
1284 
1285  }
1286  }
1287 
1288 }
optionini DOption
Options for DAS execution.
#define XAX
X Axis.
int MRButtonGetActivationStatus(MOBJECT o)
#define YAX
Y Axis.
das DAS
int mirrorimg[2]
Flag to set the mirroring of the CCD image: 0 = NO Mirroring, 1= YES Mirroring (element 0 for X axis;...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_MirSelButtKB_CB()

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

callback for selsct a specified mirror push button with the keyboard

Definition at line 5748 of file CreateForms.c.

References D_A, palette::DB_Sel, palette::DB_UnSel, das::Gui, MKeyEvent::keycode, L_A, pushbutt::Mir, MObjectSetBackgroundRGB(), gui::PushButt, R_A, and U_A.

Referenced by MDCreateSh_Mir().

5749 {
5750 
5751  int c = (int) a_data;
5752 
5753  switch (pe->keycode)
5754  {
5755  case R_A:
5757  if (c == (sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0])-1)
5758  {
5760  break;
5761  }
5762  else
5763  {
5765  break;
5766  }
5767  case D_A:
5769  if (c == (sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0])-1)
5770  {
5772  break;
5773  }
5774  else
5775  {
5777  break;
5778  }
5779 
5780  case L_A:
5782  if (c == 0)
5783  {
5785  break;
5786  }
5787  else
5788  {
5790  break;
5791  }
5792  case U_A:
5794  if (c == 0)
5795  {
5797  break;
5798  }
5799  else
5800  {
5802  break;
5803  }
5804  }
5805 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
unsigned int keycode
Code for the pressed key.
Definition: Mguidefs.h:541
#define R_A
Definition: KEYCODES.H:280
short DB_Sel[3]
Selected Buttons Colors.
#define U_A
Definition: KEYCODES.H:278
#define L_A
Definition: KEYCODES.H:281
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
das DAS
Definition: CreateForms.c:98
#define D_A
Definition: KEYCODES.H:279
short DB_UnSel[3]
Unselected Buttons Colors.
MOBJECT Mir[4]
Mirror Buttons.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_MirSelButtMouse_CB()

void DB_MirSelButtMouse_CB ( MOBJECT  obj,
MMouseEvent pe,
void *  a_data 
)

callback changing the bakground color of the push button passing the mouse over it

Definition at line 5708 of file CreateForms.c.

References MMouseEvent::button, palette::DB_Sel, palette::DB_UnSel, palette::DB_UnSelFG, E_MOTION, das::Gui, pushbutt::Mir, MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MSelectObject(), gui::PushButt, and MMouseEvent::type.

5709 {
5710 
5711  int c = (int) a_data, i;
5712 
5713  for (i=0; i<(sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0]); i++)
5714  {
5717  }
5718 
5719  switch (pe->button)
5720  {
5721  case (Button1):
5722  {
5724 // MObjectSetForegroundRGB(DAS.Gui.PushButt.Mir[c], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5725  break;
5726  }
5727  }
5728  switch (pe->type)
5729  {
5730 
5731  case (E_MOTION):
5732  {
5734  MSelectObject(obj);
5735  for (i=0; i<(sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0]); i++)
5736  {
5737  if(i != c)
5739 
5740  }
5741 
5742  break;
5743  }
5744  }
5745 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
void MSelectObject(MOBJECT f)
short DB_Sel[3]
Selected Buttons Colors.
unsigned int button
button pressed/released (Button1, Button2 or Button3), 0 if no button involved
Definition: Mguidefs.h:622
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
das DAS
Definition: CreateForms.c:98
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
int type
Event type (E_BUTTON_PRESS, E_BUTTON_RELEASE, E_MOTION, E_MOUSE_WHEEL)
Definition: Mguidefs.h:612
#define E_MOTION
Definition: Mguidefs.h:277
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT Mir[4]
Mirror Buttons.
+ Here is the call graph for this function:

§ DB_NDFil_CB()

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

callback for filter wheel positioning in Filter shell

Parameters
pcalling push button MObject
*adcalling push button number

Definition at line 6360 of file CreateForms.c.

References paramini::EqType, Fil_Code8H, Fil_CodeNG, Fil_CodeTropo, FilBuff, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, LIS_, NDFil_Code, NDFilBuff, NDFilFlg, NDFilSet, das::Paramini, and TROPOGAS.

Referenced by MDCreateSh_NDFil().

6361 {
6362  int c = (int) ad;
6363 
6364  if(DAS.Paramini.EqType == LIS_)
6365  FilBuff = Fil_Code8H[c];
6366  else
6367  {
6368  if(DAS.Paramini.EqType == TROPOGAS)
6369  FilBuff = Fil_CodeTropo[c];
6371  FilBuff = Fil_CodeNG[c];
6372  else
6373  NDFilBuff = NDFil_Code[c];
6374  }
6375 
6376  NDFilSet = c;
6377  NDFilFlg = 1;
6378 }
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
static int NDFilFlg
Definition: CreateForms.c:53
#define LIS_
Lampedusa Island Spectrometer - ENEA.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
int NDFilSet
ND filter wheel position definition - for SD_NDFilterW.
Definition: CreateForms.c:6231
const char * NDFilBuff
Definition: CreateForms.c:54
das DAS
Definition: CreateForms.c:98
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
char * NDFil_Code[]
const char array for the realisation of the Filters buttons in the ND Filter shell ...
Definition: DAS_Spat.c:219
int EqType
Spectrometer Type.
const char * FilBuff
Definition: CreateForms.c:51
paramini Paramini
structure for the parameters defined in param.ini configuration file
+ Here is the caller graph for this function:

§ DB_NDFilSelButtKB_CB()

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

callback for select a specified filter push button with the keyboard

Definition at line 6404 of file CreateForms.c.

References D_A, palette::DB_Sel, palette::DB_UnSel, das::Gui, MKeyEvent::keycode, L_A, MObjectSetBackgroundRGB(), pushbutt::NDFil, gui::PushButt, R_A, and U_A.

Referenced by MDCreateSh_NDFil().

6405 {
6406 
6407  int c = (int) a_data;
6408 
6409  switch (pe->keycode)
6410  {
6411  case R_A:
6413  if (c == (sizeof DAS.Gui.PushButt.NDFil / sizeof DAS.Gui.PushButt.NDFil[0]) - 1)
6414  {
6416  break;
6417  }
6418  else
6419  {
6421  break;
6422  }
6423  case D_A:
6425  if (c == (sizeof DAS.Gui.PushButt.NDFil / sizeof DAS.Gui.PushButt.NDFil[0]) - 1)
6426  {
6428  break;
6429  }
6430  else
6431  {
6433  break;
6434  }
6435 
6436  case L_A:
6438  if (c == 0)
6439  {
6441  break;
6442  }
6443  else
6444  {
6446  break;
6447  }
6448  case U_A:
6450  if (c == 0)
6451  {
6453  break;
6454  }
6455  else
6456  {
6458  break;
6459  }
6460  }
6461 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
unsigned int keycode
Code for the pressed key.
Definition: Mguidefs.h:541
#define R_A
Definition: KEYCODES.H:280
short DB_Sel[3]
Selected Buttons Colors.
#define U_A
Definition: KEYCODES.H:278
#define L_A
Definition: KEYCODES.H:281
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
das DAS
Definition: CreateForms.c:98
#define D_A
Definition: KEYCODES.H:279
short DB_UnSel[3]
Unselected Buttons Colors.
MOBJECT NDFil[6]
ND Filter Buttons.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_NDFilSelButtMouse_CB()

void DB_NDFilSelButtMouse_CB ( MOBJECT  obj,
MMouseEvent pe,
void *  a_data 
)

callback changing the bakground color of the push button passing the mouse over it

Definition at line 6382 of file CreateForms.c.

References MMouseEvent::button, palette::DB_Sel, palette::DB_UnSel, das::Gui, MObjectSetBackgroundRGB(), pushbutt::NDFil, and gui::PushButt.

6383 {
6384 
6385  int c = (int) a_data, i;
6386 
6387  for (i=0; i<(sizeof DAS.Gui.PushButt.NDFil / sizeof DAS.Gui.PushButt.NDFil[0]); i++)
6388  {
6390  }
6391 
6392  switch (pe->button)
6393  {
6394 
6395  case (Button1):
6396  {
6398  break;
6399  }
6400  }
6401 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
short DB_Sel[3]
Selected Buttons Colors.
unsigned int button
button pressed/released (Button1, Button2 or Button3), 0 if no button involved
Definition: Mguidefs.h:622
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
das DAS
Definition: CreateForms.c:98
short DB_UnSel[3]
Unselected Buttons Colors.
MOBJECT NDFil[6]
ND Filter Buttons.
+ Here is the call graph for this function:

§ DB_Pause()

void DB_Pause ( void  )

Definition at line 3766 of file CreateForms.c.

References D_FixSZA(), DB_KB_ButtonActive(), flag::DeltaSZA, flag::exec, flag::ExeDSZA, das::Flag, das::Gui, pushbutt::KeyB, dsza::LastMSZA, MObjectSetSensitive(), MObjectSetText(), gui::PushButt, S_zenetr, Status(), and SZADelta.

Referenced by DB_KeyB_CB(), InitTempAD(), and SetWindowsReset().

3767 {
3768 
3769  if(FLAG.exec)
3770  {
3771  FLAG.exec = 0;
3772  Status("Waiting for the end of current instruction");
3773  MObjectSetText(DAS.Gui.PushButt.KeyB[25],"Resume");
3774  DB_KB_ButtonActive(1);
3775 
3776  if(DAS.Flag.DeltaSZA == 1)
3777  {
3778  DAS.Flag.ExeDSZA = 0; //Stop PRG Execution
3779 
3780 // SZADelta.LastMSZA = S_zenetr;
3781 // D_FixSZA();
3782  }
3783 
3784 
3785  }
3786  else if(FLAG.exec == 0)
3787  {
3788  FLAG.exec = 1;
3789  Status("Execution Resumed");
3790  MObjectSetText(DAS.Gui.PushButt.KeyB[25],"Pause");
3791  DB_KB_ButtonActive(0);
3794  // If a SZAPRG or a *.PRG file is in execution with the DeltaSZA Mode activated
3795  // the next SZA has to be recalculated
3796 
3797 
3798  if(DAS.Flag.DeltaSZA == 1)
3799  {
3800  DAS.Flag.ExeDSZA = 1; //PRG Execution
3801 
3803  D_FixSZA();
3804 
3805  }
3806  }
3807 
3808 }
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
double S_zenetr
Definition: SOLPOS.C:92
dsza SZADelta
Definition: DAS_Spat.c:76
MOBJECT KeyB[28]
Keyboard Buttons.
double LastMSZA
SZA of the previous measurement.
flag Flag
Structure for different flags.
void MObjectSetText(MOBJECT obj, const char *text)
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
int DeltaSZA
= 1 Delta SZA measurements activated, = 0 Continous measurements
pushbutt PushButt
Push buttons.
void D_FixSZA(void)
Definition: RTC_Time.c:467
das DAS
Definition: CreateForms.c:98
int ExeDSZA
= 1 the measurements are performed, = 0 waiting for the next deltasza.
void MObjectSetSensitive(MOBJECT obj)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_PlotDisplayCB()

void DB_PlotDisplayCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Select if the PLOT will be displayed after the measurement
.

Parameters
adata
  • = 0 –> NO
  • = 1 –> Yes

Definition at line 3714 of file DAS_Spat_ConfCBs.c.

References das::Flag, and flag::plotW.

Referenced by CONFP_opt_page3().

3715 {
3716  int c = (int) a_data;
3717 
3718  switch(c)
3719  {
3720  case 0 :
3721  DAS.Flag.plotW = 0;
3722  break;
3723  case 1:
3724  DAS.Flag.plotW = 1;
3725  break;
3726 
3727  }
3728 }
int plotW
Flag for the plot display.
flag Flag
Structure for different flags.
das DAS
+ Here is the caller graph for this function:

§ DB_PlotYAxisCB()

void DB_PlotYAxisCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Select the Y axis Unit mode
.

Parameters
adata
  • = 0 –> Full Range
  • = 1 –> Min/Max

Definition at line 3678 of file DAS_Spat_ConfCBs.c.

References flag::plotYRange.

Referenced by CONFP_opt_page3().

3679 {
3680  int c = (int) a_data;
3681 
3682  switch(c)
3683  {
3684  case 0 :
3685  FLAG.plotYRange = 0;
3686  break;
3687  case 1:
3688  FLAG.plotYRange = 1;
3689  break;
3690 
3691  }
3692 
3693 
3694 
3695 }
int plotYRange
0 –> full range; 1 –> min/max
flag FLAG
+ Here is the caller graph for this function:

§ DB_RadDrkSourceCB()

void DB_RadDrkSourceCB ( MOBJECT  o,
void *  a,
void *  v 
)

Set the dark source.

Parameters
*a_data
  • 0 = Blind Pixels only
  • 1 = Full frame

Definition at line 1290 of file DAS_Spat_ConfCBs.c.

References optionini::darksource, das::DOption, and MRButtonGetActivationStatus().

Referenced by CONFP_opt_page2().

1291 {
1292  int er = 0;
1293  int c = (int) v;
1294 
1295 
1297 
1298  if(er)
1299  {
1300  switch (c)
1301  {
1302  case 0:
1303  DAS.DOption.darksource = 0;
1304  break;
1305  case 1:
1306  DAS.DOption.darksource = 1;
1307  break;
1308 
1309  }
1310  }
1311 
1312 }
optionini DOption
Options for DAS execution.
int MRButtonGetActivationStatus(MOBJECT o)
das DAS
int darksource
Flag to set Dark source: 0 = Blind Pixels, 1 = Full Frame.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_RadioAvgModeCB()

void DB_RadioAvgModeCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Set the Averaging mode flag.

Parameters
*a_data
  • 0 = Fixed number of measurements
  • 1 = Fixed tot exposure time

Definition at line 904 of file DAS_Spat_ConfCBs.c.

References optionini::avgmode, gui::ConfigPanel, das::DOption, das::Gui, configpanel::lblAvg, MObjectSetText(), N_AVG, configpanel::n_avg, and TOTTEXP.

Referenced by CONFP_opt_page1().

905 {
906  int c = (int) a_data;
907  char buf[80];
908 
909  switch(c)
910  {
911  case 0 :
912  DAS.DOption.avgmode=0;
913  sprintf(buf,"%d",N_AVG);
914  MObjectSetText(DAS.Gui.ConfigPanel.lblAvg, "Repeat measure for: ");
916 
917  break;
918  case 1:
919  DAS.DOption.avgmode=1;
920  sprintf(buf, "%d", TOTTEXP);
921  MObjectSetText(DAS.Gui.ConfigPanel.lblAvg, "TOT Exposure Time [s]:");
923 
924  break;
925 
926  }
927 }
gui Gui
Graphic User Interface Structure.
MOBJECT lblAvg
optionini DOption
Options for DAS execution.
void MObjectSetText(MOBJECT obj, const char *text)
int avgmode
Flag to set Averaging mode: 0 = Repeat measurements for fixed number, 1 = Repeat measurements for fix...
int TOTTEXP
Total Exposure time in Averaging mode.
Definition: DAS_Spat.c:115
das DAS
configpanel ConfigPanel
Configuration panel structure.
int N_AVG
Number of measurements for Averaging mode in fixed number of meas. mode.
Definition: DAS_Spat.c:113
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_RadioDarkCB()

void DB_RadioDarkCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Set the dark removing from the measurements.

Parameters
*a_data
  • 0 = DO NOT remove dark
  • 1 = Remove dark

Definition at line 972 of file DAS_Spat_ConfCBs.c.

References configpanel::BPDark, gui::ConfigPanel, optionini::darkremove, das::DOption, configpanel::FFDark, das::Gui, MObjectSetSensitive(), and MObjectSetUnsensitive().

Referenced by CONFP_opt_page2().

973 {
974  int c = (int) a_data;
975 // char buf[80];
976 
977  switch(c)
978  {
979  case 0 :
983 
984  break;
985  case 1:
989 
990 /* if (DAS.DOption.flgdarksource)
991  MRButtonActivate(DAS.Gui.ConfigPanel.FFDark);
992  else
993  MRButtonActivate(DAS.Gui.ConfigPanel.BPDark);
994 */ break;
995 
996  }
997 }
gui Gui
Graphic User Interface Structure.
optionini DOption
Options for DAS execution.
void MObjectSetUnsensitive(MOBJECT obj)
int darkremove
Flag to set Dark Removal from measurements; motors0 = No Dark Removal, 1 = Dark Removal.
das DAS
configpanel ConfigPanel
Configuration panel structure.
MOBJECT BPDark
void MObjectSetSensitive(MOBJECT obj)
MOBJECT FFDark
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_RadioFNSelCB()

void DB_RadioFNSelCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Set the file name mode.

Parameters
*a_data
  • 0 = Free choice
  • 1 = Automatic

Definition at line 1336 of file DAS_Spat_ConfCBs.c.

References das::DOption, and optionini::filename.

Referenced by CONFP_opt_page1().

1337 {
1338 
1339  int c = (int) a_data;
1340 // char buf[80];
1341 
1342  switch(c)
1343  {
1344  case 0 :
1345  DAS.DOption.filename=0; //free
1346  break;
1347  case 1:
1348  DAS.DOption.filename=1; //Automatico
1349  break;
1350 
1351  }
1352 
1353 }
optionini DOption
Options for DAS execution.
das DAS
int filename
Flag to set file name mode 0=Free choice, 1 = Automatic.
+ Here is the caller graph for this function:

§ DB_RadioModeSelCB()

void DB_RadioModeSelCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Set the saving mode.

Parameters
*a_data
  • 0 = ASCII data files
  • 1 = BINARY data file

Definition at line 955 of file DAS_Spat_ConfCBs.c.

References das::DOption, and optionini::savingmode.

Referenced by CONFP_opt_page1().

956 {
957  int c = (int) a_data;
958 // char buf[80];
959 
960  switch(c)
961  {
962  case 0 :
964  break;
965  case 1:
967  break;
968 
969  }
970 }
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
das DAS
+ Here is the caller graph for this function:

§ DB_RadioPixCorrCB()

void DB_RadioPixCorrCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Set the image Correction flag.

Parameters
*a_data
  • 0 = disable defective pixel correction
  • 1 = enable defective pixel correction

Definition at line 931 of file DAS_Spat_ConfCBs.c.

References gui::ConfigPanel, optionini::DEFPIXFILENAME, das::DOption, das::Gui, configpanel::lblCorrPixF, MObjectSetSensitive(), MObjectSetText(), MObjectSetUnsensitive(), configpanel::pbBrowseCorrPixF, and optionini::pixcorr.

Referenced by CONFP_opt_page1().

932 {
933  int c = (int) a_data;
934 // char buf[80];
935 
936  switch(c)
937  {
938  case 0 :
939  DAS.DOption.pixcorr=0; //Pixel correction disabled
942 
943  break;
944  case 1:
945  DAS.DOption.pixcorr=1; //Pixel correction ENABLED
949  break;
950 
951  }
952 }
gui Gui
Graphic User Interface Structure.
optionini DOption
Options for DAS execution.
void MObjectSetUnsensitive(MOBJECT obj)
void MObjectSetText(MOBJECT obj, const char *text)
das DAS
configpanel ConfigPanel
Configuration panel structure.
int pixcorr
Flag to set defective pixel correction: 0=NOT Corrected, 1=Corrected.
void MObjectSetSensitive(MOBJECT obj)
MOBJECT lblCorrPixF
label for name file used for defec pix correction
MOBJECT pbBrowseCorrPixF
Push button for file selection.
char DEFPIXFILENAME[_MAX_PATH]
defective pixel filename with path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_ReInitCamera()

int DB_ReInitCamera ( void  )

Re-Initialize Camera Parameters. Procedure that re-initialize the parameters for the CCD Camera.

Returns
int

§ DB_Save()

void DB_Save ( char *  tit,
int  mod 
)

Save the acquired spectrum. Procedure that Save the acquired spectrum.

Parameters
*titpointer to the char variable with the file name
mod
  • = 0 –> ASCII
  • = 1 –> Binary

Definition at line 552 of file Save.c.

References D_BuildH(), D_save_asc(), D_save_bif(), DAS, img::DATE, DIL, DOASMODE, flag::exemode, das::Flag, GetDateTime(), dil::Img, image::Mat, OFFLINEPLOT, SaveDataOffLine(), Server, and img::TIME.

Referenced by D_PButt_CB(), D_Saving(), DB_HorComm_CB(), DB_KeyB_CB(), PopUp_CB(), and SaveCalib().

553 {
554  int er;
555  struct tm today;
556 
558  {
559  SaveDataOffLine(tit, mod);
560  }
561  else
562  {
564  // gettime( &DIL.Img.Mat[Server].TIME );
565  // getdate( &DIL.Img.Mat[Server].DATE );
566 
567  D_BuildH(mod, Server);
568 
569  if(mod) //save in binary mode
570  er = D_save_bif(tit, Server);
571  else //save in ASCII mode
572  er = D_save_asc(tit, Server);
573  }
574 
575 
576 
577 }
int Server
Definition: DAS_Spat.c:253
dil DIL
Definition: 2DPlot.c:26
int D_save_asc(char *fname, int s)
Definition: Save.c:451
void D_BuildH(int mod, int s)
Build Header of the measurements . .
Definition: Procedures.c:63
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
das DAS
Definition: Chktemp.c:26
img Mat[MAXIMG]
Definition: Dildef.h:552
struct date DATE
Definition: Dildef.h:348
image Img
Definition: Dildef.h:675
#define OFFLINEPLOT
execution for archived data visualisation
int SaveDataOffLine(char *fname, int mod)
Definition: Save.c:493
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
int D_save_bif(char *f, int s)
Definition: Save.c:398
struct time TIME
Definition: Dildef.h:347
int exemode
Set the Execution MODE (Execution modes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_save_img()

void DB_save_img ( char *  tit,
int  mod 
)

Saving image. Procedure for saving the CCD Image Used until version 2.0.9, Since 2.1.0 D_Saving(void) is used.

Parameters
*tit–> file name where the image will be saved
mod
  • = 1 –> binary
  • = 0 –> ASCII.
Returns
void

Definition at line 580 of file Save.c.

References FWS, IDX, IDY, MIS, O_BINARY, FilterWheelSt::Pos, MirrorSt::Pos, Status(), TExp, wl, and GratingSt::Wl.

581 {
582  int n;
583  FILE *fd;
584  int fh;
585 // struct date d;
586 // struct time t;
587  unsigned int y;
588 
589 
590  char tit1[64];
591  char datebuf[9];
592  char timebuf[9];
593  int Lambda;
594  int riga;
595 // int Idx, Idy, x, k,t,j;
596  int wl[] = {2823, 3337, 3850, 4358, 4861, 5332, 5814, 6282, 6734, 7201, 7677, 8195, 8622, 9023, 9405, 9758, 10066, 10358};
597  // char *filt[] = {{"NULL"},{"UG11"}, {"UG5 "}, {"BG25"}, {"BG39"}, {"GG45"}, {"BG12"}, {"NULL"}};
598 
599 
600  // char *PMirror[] = {{"PHOTOMETRIC"}, {"RADIOM. DX"}, {"DIRECT DX"},
601  // {"DIRECT SX"}, {"RADIOM. SX"}};
602 
603  Lambda = wl[GRS.Wl];
604 // Mirror = MIS.MirPos;
605 
606  //data e ora di memorizzazione dello spettro
607  _strdate(datebuf);
608  _strtime(timebuf);
609 
610  Status("Save Image");
611 
612 
613  if(mod) //binary mode
614  {
615  fh = open(tit, O_WRONLY | O_BINARY | O_CREAT | O_APPEND, S_IWRITE);
616  if ( fh < 0) return;
617 
618  //Salva tutte le righe
619  riga = 1;
620  for(y = 0; y < (unsigned int)IDY; y++)
621  //Salva solo 5 righe centrali
622  //riga = 4;
623  //for(y = 3; y < (DAS.Paramini.ccdWy / DAS.Paramini.VBin) - 3; y++)
624 
625  {
626  write( fh, &datebuf, sizeof(datebuf));
627  write( fh, &timebuf, sizeof(timebuf));
628  write( fh, &MIS.Pos, sizeof(MIS.Pos));
629  write( fh, &Lambda, sizeof(Lambda));
630  write( fh, &FWS.Pos, sizeof(FWS.Pos));
631 
632  write( fh, &TExp, sizeof(TExp));
633  write( fh, &riga, sizeof(riga));
634  // fwrite( Temp, 1, sizeof(Temp), fd );
635  // Commento
636  sprintf(tit1, "%s", "Default comment");
637  write( fh, &tit1, sizeof(tit1));
638 
639 
640  for(n = 0; n < IDX; n++)
641  {
642 // Imat[y * DAS.Paramini.ccdWx + n] = n*2;
643 // write(fh, &Imat[y * DAS.Paramini.ccdWx + n], sizeof(Imat[y * DAS.Paramini.ccdWx + n]));
644  }
645  riga++;
646 
647 
648  }
649 
650  close(fh);
651  }
652  else
653  {
654  fd = fopen(tit, "a");
655  if(fd == NULL)
656  {
657  Status("Error opening file");
658  return;
659  }
660 
661  //Salva tutte le righe
662  riga = 1;
663  for(y = 0; y < (unsigned int)IDY; y++)
664  //Salva solo 5 righe centrali
665  //riga = 4;
666  //for(y = 3; y < (DAS.Paramini.ccdWy / DAS.Paramini.VBin) - 3; y++)
667 
668  {
669  fprintf(fd, "%s %s ", datebuf, timebuf);//data e ora //RTC
670  fprintf(fd, " %d ", MIS.Pos); //Posizione specchio
671  fprintf(fd, " %5d ", Lambda); //lunghezza d'onda
672  fprintf(fd, " %d ", FWS.Pos); //Posizione RUOTA FILTRI
673  fprintf(fd, " %.2lf ", TExp); //tempo di integrazione
674 // fprintf(fd, " %.1lf ", Temp); //Temperatura del CCD
675  fprintf(fd, " Riga:%d ", riga); //Numero riga
676 // fprintf(fd, " %d\n ", VAna[7]); // Pressione esterna
677  // Commento
678  sprintf(tit1, "%s", "Default comment");
679  fprintf(fd, " %s\n ", tit1 ); // Commento
680 
681  for(n = 0; n < IDX; n++)
682 
683  {
684 // Imat[y * DAS.Paramini.ccdWx + n]=n * 2;
685 // fprintf(fd, " %04u", Imat[y * DAS.Paramini.ccdWx + n]);
686  }
687  fprintf(fd,"\n");
688  riga++;
689 
690 
691  }
692  fclose(fd);
693 
694  }
695 
696 
697 
698 
699  return;
700 
701 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
#define O_BINARY
Definition: Dildef.h:201
int Pos
Mirror Current Position.
int Pos
Filter Wheel current Position.
int Wl
Grating Wavelength.
GratingSt GRS
Grating.
Definition: Save.c:24
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
MirrorSt MIS
Mirror.
Definition: DAS_Spat.c:61
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
+ Here is the call graph for this function:

§ DB_ScanMaxMin()

double DB_ScanMaxMin ( int  w,
float *  mx,
float *  mi,
int  bp 
)

Find Max and Min values for the buffer of order w.

Parameters
w= index of the image (0 or 1) .
bp= number of the CCD blind pixels .
Returns
l = sum of the image values

Definition at line 1632 of file Procedures.c.

References D_VRange(), DIL, das::DOption, FLTIMG, img::Fmat, image::Idx, image::Idy, img::Imat, dil::Img, INTIMG, image::Mat, img::MaxNumbers, optionini::measmode, RGBIMG, and img::type.

Referenced by AutoR_No_Shutt(), AutoR_TestMeas(), AutoR_With_Shutt(), D_Average(), and DB_GetCCD().

1633 {
1634  double l = 0;
1635  int x, y, xi = DIL.Img.Idx[w] - bp , yi = DIL.Img.Idy[w];
1636  U16 *m = DIL.Img.Mat[w].Imat;
1637  float *f = DIL.Img.Mat[w].Fmat;
1638 
1639 
1640  *mx = 0; *mi = DIL.Img.Mat[w].MaxNumbers;
1641  if(DAS.DOption.measmode == 0) //Single Measurement
1642  D_VRange("Find Max/Min..", 0, 192, 195, 192);
1643  //VRange("Find Max/Min", 0);
1644 
1645  if(DIL.Img.Mat[w].type == INTIMG || DIL.Img.Mat[w].type == RGBIMG)
1646  for(y = 0; y < yi-1; y++)
1647  {
1648  for(x = 2; x < xi; x++)
1649  {
1650  //l += (double) *m;
1651  *mi = min(*mi, m[y * DIL.Img.Idx[w] + x]);
1652  *mx = max(*mx, m[y * DIL.Img.Idx[w] + x]);
1653  //m++;
1654  }
1655  if(DAS.DOption.measmode == 0) //Single Measurement
1656  if((y % 32) == 0 && y > 0)
1657  D_VRange(NULL, (long) y * 100 / DIL.Img.Idy[w], 192, 195, 192);
1658  //VRange(NULL, (long) y * 100 / DIL.Img.Idy[w]);
1659  }
1660  if(DIL.Img.Mat[w].type == FLTIMG)
1661  for(y = 0; y < yi; y++)
1662  {
1663  for(x = 2; x < xi; x++)
1664  {
1665  l += (double) *f;
1666  *mi = min(*mi, *m);
1667  *mx = max(*mx, *m);
1668  f++;
1669  }
1670  if(DAS.DOption.measmode == 0) //Single Measurement
1671  if((y % 32) == 0 && y > 0)
1672  D_VRange(NULL, (long) y * 100 / DIL.Img.Idy[w], 192, 195, 192);
1673 
1674 // VRange(NULL, (long) y * 100 / DIL.Img.Idy[w]);
1675  }
1676  //VRange(NULL, 100);
1677  if(DAS.DOption.measmode == 0) //Single Measurement
1678  D_VRange(NULL, 100 , 192, 195, 192);
1679 
1680  return l;
1681 }
U16 Idx[MAXIMG]
Definition: Dildef.h:570
dil DIL
Definition: 2DPlot.c:26
optionini DOption
Options for DAS execution.
void D_VRange(char *str, int val, int, int g, int b)
Create and display the status bar.
Definition: Utils.c:206
float MaxNumbers
Definition: Dildef.h:309
#define FLTIMG
Definition: Dildef.h:12
U16 * Imat
Definition: Dildef.h:286
S16 type
Definition: Dildef.h:280
img Mat[MAXIMG]
Definition: Dildef.h:552
image Img
Definition: Dildef.h:675
das DAS
DAS structure.
Definition: Procedures.c:47
short unsigned U16
2 byte without sign, range 0-65535
Definition: dcldef.h:375
#define INTIMG
Definition: Dildef.h:10
U16 Idy[MAXIMG]
Definition: Dildef.h:571
#define RGBIMG
Definition: Dildef.h:11
float * Fmat
Definition: Dildef.h:287
int measmode
measuring mode: 0 = Single; 1 = Averaged
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_SelOutModeCB()

void DB_SelOutModeCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Select the Output for the Temperature AD Converter
.

Parameters
adata
  • = 0 –> Volts
  • = 1 –> Celsius degree

Definition at line 3622 of file DAS_Spat_ConfCBs.c.

References adtester::OutputMode.

Referenced by MDCreateDASConfig().

3623 {
3624  int c = (int) a_data;
3625 // char buf[80];
3626 
3627  switch(c)
3628  {
3629  case 0 :
3630  ADTESTER.OutputMode = 0;
3631  break;
3632  case 1:
3633  ADTESTER.OutputMode = 1;
3634  break;
3635 
3636  }
3637 }
adtester ADTESTER
+ Here is the caller graph for this function:

§ DB_SetCCDTargetTempCB()

void DB_SetCCDTargetTempCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Select the CCD temperature mode
.

Parameters
adata
  • = 0 –> FIXED Temperateure
  • = 1 –> SZA Driven Temperature

Definition at line 3642 of file DAS_Spat_ConfCBs.c.

References flag::settempvar.

Referenced by CONFP_opt_page2().

3643 {
3644  int c = (int) a_data;
3645 
3646  switch(c)
3647  {
3648  case 0 :
3649  FLAG.settempvar = 0;
3650  break;
3651  case 1:
3652  FLAG.settempvar = 1;
3653  break;
3654  }
3655 }
int settempvar
flag FLAG
+ Here is the caller graph for this function:

§ DB_SetXUnitsCB()

void DB_SetXUnitsCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Select the X axis Unit mode
.

Parameters
adata
  • = 0 –> Pixel
  • = 1 –> Wavelength (Angstrom)
  • = 2 –> Wavelength (nm)

Definition at line 3659 of file DAS_Spat_ConfCBs.c.

References flag::Wl.

Referenced by CONFP_opt_page3().

3660 {
3661  int c = (int) a_data;
3662 
3663  switch(c)
3664  {
3665  case 0 :
3666  FLAG.Wl = 0;
3667  break;
3668  case 1:
3669  FLAG.Wl = 1;
3670  break;
3671  case 2:
3672  FLAG.Wl = 2;
3673  break;
3674 
3675  }
3676 }
int Wl
Flag for the units on the X scale plot.
flag FLAG
+ Here is the caller graph for this function:

§ DB_Shutter_CB()

void DB_Shutter_CB ( MOBJECT  o,
void *  a,
void *  v 
)

callback selecting if the shutter is installed or not

Definition at line 1204 of file DAS_Spat_ConfCBs.c.

References gui::ConfigPanel, das::DOption, optionini::emshutter, das::Gui, MObjectSetSensitive(), MObjectSetUnsensitive(), MRButtonGetActivationStatus(), and configpanel::rbSHUTType.

Referenced by CONFP_opt_page7().

1205 {
1206 
1207  int er = 0;
1208  int c = (int) v;
1209 
1210 
1212 
1213  if(er)
1214  {
1215  switch (c)
1216  {
1217  case 0:
1218  DAS.DOption.emshutter = 0; //Shutter not Installed
1222  break;
1223  case 1:
1224  DAS.DOption.emshutter = 1; //Shutter installed
1228  break;
1229  }
1230  }
1231 
1232 }
gui Gui
Graphic User Interface Structure.
optionini DOption
Options for DAS execution.
void MObjectSetUnsensitive(MOBJECT obj)
int MRButtonGetActivationStatus(MOBJECT o)
int emshutter
Presence of the CCD Shutter, emshutter = 1 –> Shutter IS Installed, = 0 –> Shutter NOT Installed...
das DAS
configpanel ConfigPanel
Configuration panel structure.
MOBJECT rbSHUTType[3]
radio button for SHUTTER type
void MObjectSetSensitive(MOBJECT obj)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_ShutterType_CB()

void DB_ShutterType_CB ( MOBJECT  o,
void *  a,
void *  v 
)

callback selecting the type of installed shutter

Definition at line 1145 of file DAS_Spat_ConfCBs.c.

References das::DOption, MRButtonGetActivationStatus(), ROTSHUT, optionini::shuttertype, TORQUEM, and VS25.

Referenced by CONFP_opt_page7().

1146 {
1147 
1148  int er = 0;
1149  int c = (int) v;
1150 
1151 
1153 
1154  if(er)
1155  {
1156  switch (c)
1157  {
1158  case VS25:
1160  break;
1161  case ROTSHUT:
1163  break;
1164  case TORQUEM:
1166  break;
1167 
1168  }
1169  }
1170 
1171 }
optionini DOption
Options for DAS execution.
#define TORQUEM
Torque Motor.
#define ROTSHUT
Rotating Shutter.
int MRButtonGetActivationStatus(MOBJECT o)
#define VS25
Uniblitz Shutter VS25.
das DAS
int shuttertype
type of installed shutter: 0 = VS25, 1 = Rotating Shutter, 2 = TorqueMotor
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_StepMotor()

int DB_StepMotor ( int  id,
int  motor,
long  step,
int  dir 
)

Send steps to the selected stepper motor.
.

Parameters
id= AMS address:
  • 0 = AMS1
  • 1 = AMS2
  • 2 = AMS3
motor
  • = 0 –> Motor A
  • = 1 –> Motor B
step–> number of steps to be performed
dir= direction of the stepper rotation:
  • = 0 –> clockwise
  • = 1 –> counterclockwise)
Returns
er:
  • = 0 –> positioning successful
  • = 1 –> Problems encountred

Definition at line 816 of file Dxl.c.

References DXL_par::add, controlpanel::Albl_LS, AMS_DoPos(), gui::ContrPanel, DBDEMO, flag::exemode, das::Flag, das::Gui, controlpanel::LedSM, Message(), MObjectSetText(), and MPixmapSetImageFile().

Referenced by ActMvAzimCB(), ActMvGratCB(), ActMvZenCB(), D_Calibra(), SD_Azimuth(), SD_FilterW(), SD_Grating(), SD_Mirror(), SD_NDFilterW(), SD_Position(), SD_PosOMUDev(), SD_Zenith(), and SD_Zenith_H().

817 {
818 
819  char buf[80];
820 // char Dbuf[80];
821  int er = 0;
822  int c = motor, d = 0;
823 
824 
825 
826  switch(c)
827  {
828  //INPUT MIRROR
829  case 0: MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][0], "SYS\\ledoff.bmp");
830  sprintf(buf, "%s", "Positioning");
832  DXL.add = 0;
833  er = AMS_DoPos(id, dir, 0, step, 0);
834  if (DAS.Flag.exemode != DBDEMO)
835  if(er) { Message("n Step not sent! 1", er); break; }
836  break;
837 
838  //GRATING
839  case 1: MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][1], "SYS\\ledoff.bmp");
840  sprintf(buf, "%s", "Positioning");
842  DXL.add = 0;
843  er = AMS_DoPos(id, 0, dir, 0, step);
844  if (DAS.Flag.exemode != DBDEMO)
845  if(er) { Message("n Step not sent! 2", er); break; }
846  break;
847 
848  //FILTER WHEEL
849  case 2: MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][0], "SYS\\ledoff.bmp");
850  sprintf(buf, "%s", "Positioning");
852 
853  DXL.add = 1;
854  er = AMS_DoPos(id, dir, 0, step, 0);
855  if (DAS.Flag.exemode != DBDEMO)
856  if(er) { Message("n Step not sent! 2", er); break; }
857  DXL.add = 0;
858  break;
859 
860  // ND FILTER WHEEL
861  case 3: MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][1], "SYS\\ledoff.bmp");
862  sprintf(buf, "%s", "Positioning");
864 
865  DXL.add = 1;
866  er = AMS_DoPos(id, 0, dir, 0, step);
867  if (DAS.Flag.exemode != DBDEMO)
868  if(er) { Message("n Step not sent! 2", er); break; }
869  DXL.add = 0;
870  break;
871 
872 
873  //Zenith
874  case 4: MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][0], "SYS\\ledoff.bmp");
875  sprintf(buf, "%s", "Positioning");
877 
878  DXL.add = 2;
879  er = AMS_DoPos(id, dir, 0, step, 0);
880  if (DAS.Flag.exemode != DBDEMO)
881  if(er)
882  {
883  Message("n Step not sent! 3", er);
884  break;
885  }
886  DXL.add = 0;
887  break;
888  //Azimuth
889  case 5: MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[id][1], "SYS\\ledoff.bmp");
890  sprintf(buf, "%s", "Positioning");
892 
893  DXL.add = 2;
894  er = AMS_DoPos(id, 0, dir, 0, step);
895  if (DAS.Flag.exemode != DBDEMO)
896  if(er) { Message("n Step not sent! 4", er); break; }
897  DXL.add = 0;
898  break;
899 
900 
901  }
902 
903 
904  return 1;
905 }
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.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
flag Flag
Structure for different flags.
#define DBDEMO
execution in demo mode
void MObjectSetText(MOBJECT obj, const char *text)
int add
Peripheral address.
Definition: DXL.H:19
DXL_par DXL
Definition: Dxl.c:18
void Message(char *str, int er)
Create a message shell for the AMS errors (Debug Use). .
Definition: Dxl.c:1085
controlpanel ContrPanel
Control Panel Structure.
das DAS
Definition: Dxl.c:22
int AMS_DoPos(int id, int dira, int dirb, unsigned long stepa, unsigned long stepb)
Execute Positioning Execute Stepper positioning. Make all the control on the status of the selected m...
Definition: Dxl.c:644
int exemode
Set the Execution MODE (Execution modes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_Undo2Do_Colors()

void DB_Undo2Do_Colors ( short  undocol[],
short  docol[] 
)

Assign to the DO_Color structure the Color Values of the UNDO_Color Structure.

Assign to the UNDO_Color structure the Color Values of the DO_Color Structure.

Definition at line 189 of file DAS_Spat_ConfCBs.c.

References b_c, g_c, and r_c.

190 {
191  int i;
192  for (i = 0; i < 3;i++)
193  {
194  undocol[i] = docol[i];
195  }
196 
197 
198  docol[0] = r_c;
199  docol[1] = g_c;
200  docol[2] = b_c;
201 
202 }
int b_c
Definition: DAS_Spatram.h:3060
int r_c
Definition: DAS_Spatram.h:3060
int g_c
Definition: DAS_Spatram.h:3060

§ DB_Undo2Do_Fonts()

void DB_Undo2Do_Fonts ( MTFont  undofont,
MTFont  dofont 
)

Definition at line 1365 of file DAS_Spat_ConfCBs.c.

References undofont.

1366 {
1367 
1368  dofont = undofont;
1369 
1370 }
int undofont

§ DB_VMRsfCB()

void DB_VMRsfCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Set the flag for modification or reload of DAS configuration files
Set the VMRsf (View Modify Re-load system files) flag.

Parameters
*a_data
  • = 0 –> FLAG.VMRsf = 0 –> view/modify files
  • = 1 –> FLAG.VMRsf = 1 –> re-load files

Definition at line 4184 of file DAS_Spat_ConfCBs.c.

References flag::VMRsf.

Referenced by CONFP_opt_page2().

4185 {
4186 
4187  int c = (int) a_data;
4188  switch (c)
4189  {
4190  case 0:
4191  FLAG.VMRsf = 0;
4192  break;
4193  case 1:
4194  FLAG.VMRsf = 1;
4195  break;
4196 
4197  }
4198 
4199 }
int VMRsf
ViewModifyReloadsystemfile: 0 = ViewModify, 1 = Reload.
flag FLAG
+ Here is the caller graph for this function:

§ DB_Wl_CB()

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

callback for grating positioning in Wavelength shell

Parameters
pcalling push button MObject
*adcalling push button number

Definition at line 5891 of file CreateForms.c.

References WlFlg, and WlSet.

Referenced by MDCreateSh_Wl().

5892 {
5893  int c = (int) ad ;
5894 
5895  //WlBuff = Wl_Code[c];
5896  //itoa(wl[c], WlBuff, 10);
5897  WlSet = c;
5898  WlFlg = 1;
5899 
5900 }
int WlSet
Wavelength position definition - for SD_Grating.
Definition: DAS_Spat.c:135
static int WlFlg
Definition: CreateForms.c:44
+ Here is the caller graph for this function:

§ DB_WlSelButtKB_CB()

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

callback for selsct a specified wavelength push button with the keyboard

Definition at line 5927 of file CreateForms.c.

References D_A, palette::DB_Sel, palette::DB_UnSel, das::Gui, MKeyEvent::keycode, L_A, MObjectSetBackgroundRGB(), gui::PushButt, R_A, U_A, and pushbutt::Wl.

Referenced by MDCreateSh_Wl().

5928 {
5929 
5930  int c = (int) a_data;
5931 
5932  switch (pe->keycode)
5933  {
5934  case R_A:
5936  if (c == (sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0])-1)
5937  {
5939  break;
5940  }
5941  else
5942  {
5944  break;
5945  }
5946  case D_A:
5948  if (c == (sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0])-1)
5949  {
5951  break;
5952  }
5953  else
5954  {
5956  break;
5957  }
5958 
5959  case L_A:
5961  if (c == 0)
5962  {
5964  break;
5965  }
5966  else
5967  {
5969  break;
5970  }
5971  case U_A:
5973  if (c == 0)
5974  {
5976  break;
5977  }
5978  else
5979  {
5981  break;
5982  }
5983  }
5984 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
unsigned int keycode
Code for the pressed key.
Definition: Mguidefs.h:541
#define R_A
Definition: KEYCODES.H:280
short DB_Sel[3]
Selected Buttons Colors.
#define U_A
Definition: KEYCODES.H:278
#define L_A
Definition: KEYCODES.H:281
MOBJECT Wl[18]
Wavelength Buttons.
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
das DAS
Definition: CreateForms.c:98
#define D_A
Definition: KEYCODES.H:279
short DB_UnSel[3]
Unselected Buttons Colors.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_WlSelButtMouse_CB()

void DB_WlSelButtMouse_CB ( MOBJECT  obj,
MMouseEvent pe,
void *  a_data 
)

callback changing the bakground color of the push button passing the mouse over it

Definition at line 5905 of file CreateForms.c.

References MMouseEvent::button, palette::DB_Sel, palette::DB_UnSel, das::Gui, MObjectSetBackgroundRGB(), gui::PushButt, and pushbutt::Wl.

5906 {
5907 
5908  int c = (int) a_data, i;
5909 
5910  for (i=0; i<(sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0]); i++)
5911  {
5913  }
5914 
5915  switch (pe->button)
5916  {
5917 
5918  case (Button1):
5919  {
5921  break;
5922  }
5923  }
5924 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
short DB_Sel[3]
Selected Buttons Colors.
unsigned int button
button pressed/released (Button1, Button2 or Button3), 0 if no button involved
Definition: Mguidefs.h:622
MOBJECT Wl[18]
Wavelength Buttons.
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
das DAS
Definition: CreateForms.c:98
short DB_UnSel[3]
Unselected Buttons Colors.
+ Here is the call graph for this function:

§ DB_WriteMode()

void DB_WriteMode ( int  mod)

Definition at line 6722 of file CreateForms.c.

Referenced by ShutCB(), and WinRes().

6723 {
6724  FILE *fs;
6725 
6726  fs = fopen("LOG\\Paramini.LOG", "w");
6727 
6728  fprintf(fs, "%d %s", mod, "0 = reinizializza CCD, 1 = mantiene lo stato " );
6729 
6730  fclose(fs);
6731 
6732 }
+ Here is the caller graph for this function:

§ DD_VRange()

void __stdcall DD_VRange ( const char *  str,
int  perc,
int  Port 
)

Definition at line 153 of file Utils.c.

References D_CloseVR(), D_VOpen, D_VRip, palette::DB_BG, HELV_SMALL, MCreateShell(), MCreateStatusBar(), MLoopWhileEvents(), MObjectResize(), MObjectSetBackgroundRGB(), MObjectSetCompositeHeight(), MObjectSetText(), MShellDestroy(), MShellRealize(), MShellSetWMCloseCallback(), MShellUnrealize(), MStatusBarSetPos(), MStatusBarSetSliderRGB(), SF_NO_MAXIMIZE, SF_NO_MINIMIZE, and SF_SAVEUNDER.

Referenced by DB_InitCamera().

154 {
155 
156 
157  char msg[16];
158  static MOBJECT sts[16], shell[16];
159  if(D_VRip < 0 && val == 100)
160  return;
161  if(D_VRip < 0 && val > 0)
162  return;
163  if(val == 0)
164  {
165  if(D_VOpen) return;
166  D_VOpen = 1;
167  D_VRip++;
170  sts[D_VRip] = MCreateStatusBar(shell[D_VRip], " 0 %", 100, HELV_SMALL);
172  MStatusBarSetSliderRGB(sts[D_VRip], 0, 255, 0);
174 
176  //MShellRealizeXY(shell[D_VRip], ShLoc[1][0], ShLoc[1][1]);
177  MShellRealize(shell[D_VRip]);
178  MObjectResize(shell[D_VRip], 300, 35);
179  // Chiama MGUI per modificare size shell
180  MLoopWhileEvents(0);
181 
182  }
183  else
184  {
185  if(val == 100)
186  {
187  MShellUnrealize(shell[D_VRip]);
188  MShellDestroy(shell[D_VRip]);
189  D_VRip--;
190  D_VOpen = 0;
191  }
192  else
193  {
194  sprintf(msg, "%d %%", val);
195  MObjectSetText(sts[D_VRip], msg);
196  MStatusBarSetPos(sts[D_VRip], val);
197  }
198  }
199 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
int D_VRip
Definition: Utils.c:148
palette DPAL
Definition: Utils.c:28
void MLoopWhileEvents(int discard)
void MShellRealize(MOBJECT obj)
#define SF_NO_MAXIMIZE
Definition: Mguidefs.h:1034
void MStatusBarSetPos(MOBJECT p, int pos)
int D_VOpen
Definition: Utils.c:148
#define SF_NO_MINIMIZE
Definition: Mguidefs.h:1036
void MShellUnrealize(MOBJECT obj)
void MObjectSetText(MOBJECT obj, const char *text)
void MShellDestroy(MOBJECT obj)
MOBJECT MCreateStatusBar(MOBJECT parent, const char *text, int max, MTFont font)
void MObjectSetCompositeHeight(MOBJECT obj, int h)
#define HELV_SMALL
Definition: Mguidefs.h:881
void MStatusBarSetSliderRGB(MOBJECT p, int r, int g, int b)
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
#define SF_SAVEUNDER
Definition: Mguidefs.h:1015
void * MOBJECT
Definition: Mguidefs.h:192
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void D_CloseVR(MOBJECT p, void *od, void *ad)
Callback closing the status bar.
Definition: Utils.c:140
void MObjectResize(MOBJECT obj, int w, int h)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DDMessage()

void DDMessage ( char *  str)

Definition at line 13 of file REQ.C.

References CENTER_ALIGN, LARGE_FONT, lbl, MCreateLabel(), MCreateShell(), MLabelSetAlignment(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MShellRealize(), and SF_MODAL.

14 {
15  char buf[80];
16  MOBJECT sh, lbl;
17 
18  sprintf(buf, "AUTODISTRUZIONE");
19 
20  sh = MCreateShell(buf, SF_MODAL);
21 
22  lbl = MCreateLabel(sh, str, LARGE_FONT);
23  MObjectSetForegroundRGB(lbl, 255, 255, 255);
24  MObjectSetBackgroundRGB(lbl, 255, 0, 0);
25 
27 /*
28  sprintf(buf, "Txed: %s", DXL.buftx);
29  lbl = MCreateLabel(sh, buf, DEFAULT_FONT);
30  MLabelSetAlignment(lbl, LEFT_ALIGN);
31 
32  sprintf(buf, "Rxed: %s", DXL.bufrx);
33  lbl = MCreateLabel(sh, buf, DEFAULT_FONT);
34  MLabelSetAlignment(lbl, LEFT_ALIGN);
35 */
36  MShellRealize(sh);
37 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lbl
Definition: DFileMan.c:42
void MShellRealize(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
#define LARGE_FONT
Definition: Mguidefs.h:895
#define CENTER_ALIGN
Definition: Mguidefs.h:917
#define SF_MODAL
Definition: Mguidefs.h:1019
MOBJECT MCreateShell(const char *title, int flags)
void MLabelSetAlignment(MOBJECT p, int align)
void * MOBJECT
Definition: Mguidefs.h:192
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
+ Here is the call graph for this function:

§ delay()

void delay ( unsigned long  d)

Pauses for a specified number of milliseconds.
.

Definition at line 1113 of file Dxl.c.

References DWORD.

Referenced by AMS_Power(), AMS_PWM(), AMS_PWM_Zero(), AutoR_SetND_Filter(), AutoRange(), CreateList(), D_Average(), D_Calibra(), DB_GetCCD(), E_Almucantar(), E_DFMeasure(), E_DirectSun(), ExMaster(), ExtLamp(), ExtShutt(), FANECU(), FANPeltier(), FTP_Back_UP(), InitCCD_AMS(), MDQuitCB(), OOP_CB(), Peltier(), PRG_Check(), ShutCB(), and ViewPlot().

1114 {
1115  DWORD s, e;
1116  s = GetTickCount();
1117  do
1118  e = GetTickCount();
1119  while((unsigned long)labs(e - s) < d);
1120 }
#define DWORD
Definition: DSCUD.H:75
+ Here is the caller graph for this function:

§ DiffCB()

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

Definition at line 109 of file DOAS_FullProj.c.

References MDCreateDiff_Sh().

Referenced by MDCreateDOAS_MainSh().

110 {
111 
112  MDCreateDiff_Sh(0);
113 
114 }
MOBJECT MDCreateDiff_Sh(int mod)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DMessage()

void DMessage ( char *  str)

Definition at line 1099 of file DAS_Spat_Conf.c.

References MMessageDialog().

Referenced by MDQuitCB(), and PBH_CB().

1100 {
1101 
1102  MMessageDialog("AMS Informations", str, "OK", NULL);
1103 }
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:

§ DOASProcCB()

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

Definition at line 102 of file DOAS_FullProj.c.

References DOAS_ProcSh, MDCreateDOAS_ProcSh(), and MShellRealize().

Referenced by MDCreateDOAS_MainSh().

103 {
104 
107 
108 }
MOBJECT MDCreateDOAS_ProcSh(void)
void MShellRealize(MOBJECT obj)
MOBJECT DOAS_ProcSh
Definition: DOAS_FullProj.c:63
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DOASSetupCB()

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

Definition at line 94 of file DOAS_FullProj.c.

References DOAS_SetupSh, MDCreateDOAS_SetupSh(), and MShellRealize().

Referenced by MDCreateDOAS_MainSh().

95 {
96 
99 
100 
101 }
void MShellRealize(MOBJECT obj)
MOBJECT MDCreateDOAS_SetupSh(void)
MOBJECT DOAS_SetupSh
Definition: DOAS_FullProj.c:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DrawAreaExpFontCB()

void DrawAreaExpFontCB ( MOBJECT  obj,
MEvent pe,
void *  data 
)

This callback draws strings using the selected font.

Definition at line 1615 of file DAS_Spat_ConfCBs.c.

References mtcl::black, CENTER_ALIGN, font, MDrawText(), MObjectGetHeight(), and MObjectGetWidth().

Referenced by MDCreateDASConfig().

1616 {
1617  MDrawText(obj,
1618  0, 0, MObjectGetWidth(obj), MObjectGetHeight(obj)/2,
1619  "AaBbCcDdEeFfGgHhIiJjKkLl",
1621  MDrawText(obj,
1622  0, MObjectGetHeight(obj) / 2, MObjectGetWidth(obj), MObjectGetHeight(obj) / 2,
1623  "MmOoPpQqRrSsTtUuVvWwXxYyZz",
1625 }
MTColor black
int MObjectGetHeight(MOBJECT obj)
mtcl MTCL
MTColor.
int MObjectGetWidth(MOBJECT obj)
#define CENTER_ALIGN
Definition: Mguidefs.h:917
MTFont font
Definition: DAS_Spatram.h:3066
void MDrawText(MOBJECT p, int x, int y, int w, int h, const char *text, MTFont font, MTColor fgc, int align)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DT_ColFormat()

int DT_ColFormat ( void  )

Callback for Column format.

Definition at line 431 of file Utils.c.

References _MAX_PATH, FB_PREFS::allow_dir_create, FB_PREFS::allow_dir_delete, FB_PREFS::allow_dir_rename, FB_PREFS::bg_image_file, FB_PREFS::button_font, FB_PREFS::change_cwd, DAS, d_fileman::DATADIRECTORY, DB_Column(), d_fileman::DBFILENAME, bil::DFILEM, das::DOption, False, FB_PREFS::font, HELV_SMALL, d_fileman::HOMEDIRECTORY, MFileBrowseExt(), optionini::savingmode, FB_PREFS::transparent_tree, and True.

Referenced by ColumnFormatCB().

432 {
433 
434  int er =0;
435  char fname[128];
436  char buff[_MAX_PATH];
437 // int l;
438 
439 
440  FB_PREFS fbp;
441 
442  fname[0] = '\0';
443  buff[0] = '\0';
444 
445  memset (&fbp, 0, sizeof (fbp));
446 
447  fbp.change_cwd = True;
448  fbp.allow_dir_create = True;
449  fbp.allow_dir_rename = True;
450  fbp.allow_dir_delete = True;
451  fbp.transparent_tree = False;
452  fbp.font = HELV_SMALL;
453  fbp.button_font = HELV_SMALL;
454  //Set Img file
455  sprintf(buff, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "sys\\Tile2.bmp" );
456  fbp.bg_image_file =buff;
457 
458 /*
459  BIL.DFILEM.DBFILENAME[0] = 0;
460 
461  MDCreateFM_Shell(FOPEN, FDAT); //Open File, Dat ext.
462 
463  if(BIL.DFILEM.DBFILENAME[0] == 0)
464  return 1;
465 
466  DB_Column(BIL.DFILEM.DBFILENAME);
467 */
468 
470  er = MFileBrowseExt ("Select File for Column Format", "*.bif", fname, BIL.DFILEM.DATADIRECTORY, &fbp);
471  else
472  er = MFileBrowseExt ("Select File for column Format", "*.dat", fname, BIL.DFILEM.DATADIRECTORY, &fbp);
473  if(er)
474  {
475  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",BIL.DFILEM.DATADIRECTORY, fname);
476  //l = strlen(fname);
477  //strncpy(buff, fname+l-4, 4);
478 
479  //if( (strcmp(fname+l-4,".dat") == 0) |(strcmp(fname+l-4,".Dat") == 0) )
480  // BIL.DFILEM.FKIND = FDAT;
481  //else if( (strcmp(fname+l-4,".bif") == 0) | (strcmp(fname+l-4,".Bif") == 0) )
482  // BIL.DFILEM.FKIND = FBIF;
483  //else
484  //{
485  // MMessageDialog("DAS information", "Unsupported format!!", " Ok ", NULL);
486  // return 1;
487  //}
489  }
490  else
491  return 1;
492 
493 
494  return 0;
495 
496 }
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
CARD8 change_cwd
Definition: Mguidefs.h:1485
CARD8 allow_dir_create
Definition: Mguidefs.h:1487
MTFont button_font
Definition: Mguidefs.h:1501
CARD8 allow_dir_delete
Definition: Mguidefs.h:1493
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
MTFont font
Definition: Mguidefs.h:1499
#define False
Definition: Mguidefs.h:236
das DAS
Definition: Chktemp.c:26
char DATADIRECTORY[_MAX_PATH]
Definition: bildef.h:201
bil BIL
Definition: Utils.c:27
File Browser Preferences. Used by the Utility functions MFileBowserExt() and MDirBowserExt().
Definition: Mguidefs.h:1482
CARD8 transparent_tree
Definition: Mguidefs.h:1495
d_fileman DFILEM
Definition: bildef.h:257
#define HELV_SMALL
Definition: Mguidefs.h:881
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
int MFileBrowseExt(const char *t, const char *ext, char *fname, char *dname, FB_PREFS *prefs)
const char * bg_image_file
Definition: Mguidefs.h:1519
#define _MAX_PATH
Definition: Dildef.h:202
#define True
Definition: Mguidefs.h:235
CARD8 allow_dir_rename
Definition: Mguidefs.h:1490
int DB_Column(char *sourcefilename)
Column format.
Definition: Save.c:1109
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DT_CorrFileEvora()

int DT_CorrFileEvora ( void  )

Used to correct some data files.

Definition at line 786 of file Utils.c.

References AllocUSMat(), spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdwx, spectrumheader::ccdwy, D_PrintBILSPH(), D_PrintSpectrum(), D_VRange(), d_fileman::DBFILENAME, DeallocUSMat(), bil::DFILEM, bil::DPLOT, FELE, FOPEN, IDX, IDY, d_view::ImatGraf, d_view::ImatOrig, MDCreateFM_Shell(), MLoopWhileEvents(), ReadHeaderOnly(), ReadIMG(), SAVECNT, ShiftImg(), bil::SPH, and d_fileman::WORKDIRECTORY.

787 {
788 
789  FILE *fs, *fd, *fc;
790  char buf[256],str[256];
791  int er = 0, i, k;
792 
793  char filedatan[32];
794  long numspettri;
795 
796 
797  BIL.DFILEM.DBFILENAME[0] = 0;
798  MDCreateFM_Shell(FOPEN, FELE); //Open File, Ele ext.
799 
800  if(BIL.DFILEM.DBFILENAME[0] == 0)
801  return 0;
802 
803 // Lettura file elenco
804  i=0;
805  fs = fopen(BIL.DFILEM.DBFILENAME, "r");
806  if(fs < 0) return 1;
807  //Prima lettura file elenco per determinare approssimativamente in numero di spettri presenti
808  while( !feof( fs ) )
809  {
810  fgets(str, 80, fs);
811  i++;
812  }
813  fclose(fs);
814 
815  numspettri = i * SAVECNT;
816 
817  D_VRange("Header file correction",0, 0, 222, 235);
818 
819 
820  fs = fopen(BIL.DFILEM.DBFILENAME, "r");
821  if(fs < 0) return 1;
822 
823  //Read the file names
824  k = 0;
825  while( !feof( fs ) )
826  {
827  fscanf(fs, "%s", filedatan);
828  // build the complete file name
829  strcpy(buf, BIL.DFILEM.WORKDIRECTORY);
830  strcat(buf, filedatan);
831 
832  fc = fopen(buf, "r");
833  if(fc < 0) return 1;
834 
835  while( !feof( fc ) )
836  {
837  MLoopWhileEvents(0);
838  k ++;
839  if((k % 10) == 0 && k > 0)
840  D_VRange(NULL, (long) k * 100 / numspettri, 0, 222, 235 );
841  er = ReadHeaderOnly(fc);
842  //Modifica alcuni parametri del Header
843  BIL.SPH.ccdwx = 1024;
844  BIL.SPH.ccdwy = 254;
845  BIL.SPH.ccdsx = 0;
846  BIL.SPH.ccdsy = 0;
847  BIL.SPH.ccdex = 1023;
848  BIL.SPH.ccdey = 253;
849 
850 
851  if(BIL.DPLOT.ImatGraf == 0)
853 
854 
855 
856  ReadIMG(fc, BIL.DPLOT.ImatGraf, IDX, IDY);
857 
858 
859  ShiftImg(IDX, IDY);
860 
861 
862  sprintf(buf,"%s\\%s", "CORRECTED",filedatan);
863  strcpy(str, BIL.DFILEM.WORKDIRECTORY);
864  strcat(str,buf);
865  //MMessageDialog("Full FileName:", str, "ok", NULL);
866  fd = fopen(str, "a");
867  if(fd < 0) return 1;
868 
869  //Print
870  D_PrintBILSPH(fd);
871  D_PrintSpectrum(fd);
872 
873  fclose(fd);
874 
875 
876  }
877  fclose(fc);
878 
879  }
880 
881  D_VRange(NULL, 100, 0,0,0);
882 
883  fclose(fs);
884 
885  if(!BIL.DPLOT.ImatGraf == 0)
886  {
889  }
890  return 0;
891 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int ReadHeaderOnly(FILE *fd)
read the ASCII header of the stored spectrum
Definition: Save.c:704
void MLoopWhileEvents(int discard)
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
void ReadIMG(FILE *file, unsigned short *mat, int hp, int vp)
Read ASCII Image (Spectral Data only) .
Definition: Spat_Plot.c:1206
void D_VRange(char *str, int val, int r, int g, int b)
Create and display the status bar.
Definition: Utils.c:206
bil BIL
Definition: Utils.c:27
d_fileman DFILEM
Definition: bildef.h:257
void D_PrintSpectrum(FILE *fff)
Print Spectrum.
Definition: Utils.c:517
#define SAVECNT
maximum number of spectra in one file
unsigned short * ImatOrig
Definition: bildef.h:180
d_view DPLOT
Definition: bildef.h:254
unsigned short * DeallocUSMat(unsigned short *mat)
Definition: Spat_Plot.c:145
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
MOBJECT MDCreateFM_Shell(int mod, int fmt)
Definition: DFileMan.c:407
void D_PrintBILSPH(FILE *fff)
Print Header.
Definition: Utils.c:581
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
void ShiftImg(int hp, int vp)
Used to correct some data files.
Definition: Utils.c:765
unsigned short * ImatGraf
Definition: bildef.h:176
#define FOPEN
Definition: bildef.h:217
char WORKDIRECTORY[_MAX_PATH]
Definition: bildef.h:202
#define FELE
Definition: bildef.h:223
unsigned short * AllocUSMat(int hp, int vp)
Definition: Spat_Plot.c:1994
+ Here is the call graph for this function:

§ DT_CorrHeader()

int DT_CorrHeader ( )

Used to correct the header in some data files.

Definition at line 662 of file Utils.c.

References AllocUSMat(), spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdwx, spectrumheader::ccdwy, D_PrintBILSPH(), D_PrintSpectrum(), D_VRange(), d_fileman::DBFILENAME, DeallocUSMat(), bil::DFILEM, bil::DPLOT, FELE, FOPEN, IDX, IDY, d_view::ImatGraf, d_view::ImatOrig, MDCreateFM_Shell(), MLoopWhileEvents(), ReadHeaderOldF(), ReadIMG(), SAVECNT, bil::SPH, and d_fileman::WORKDIRECTORY.

663 {
664 
665  FILE *fs, *fd, *fc;
666  char buf[256],str[256];
667  int er = 0, i, k;
668 
669  char filedatan[32];
670  long numspettri;
671 
672 
673  BIL.DFILEM.DBFILENAME[0] = 0;
674  MDCreateFM_Shell(FOPEN, FELE); //Open File, Ele ext.
675 
676  if(BIL.DFILEM.DBFILENAME[0] == 0)
677  return 0;
678 
679 // Lettura file elenco
680  i=0;
681  fs = fopen(BIL.DFILEM.DBFILENAME, "r");
682  if(fs < 0) return 1;
683  //Prima lettura file elenco per determinare approssimativamente in numero di spettri presenti
684  while( !feof( fs ) )
685  {
686  fgets(str, 80, fs);
687  i++;
688  }
689  fclose(fs);
690 
691  numspettri = i * SAVECNT;
692 
693  D_VRange("Header file correction",0, 0, 222, 235);
694 
695 
696  fs = fopen(BIL.DFILEM.DBFILENAME, "r");
697  if(fs < 0) return 1;
698 
699  //Read the file names
700  k = 0;
701  while( !feof( fs ) )
702  {
703  fscanf(fs, "%s", filedatan);
704  // build the complete file name
705  strcpy(buf, BIL.DFILEM.WORKDIRECTORY);
706  strcat(buf, filedatan);
707 
708  fc = fopen(buf, "r");
709  if(fc < 0) return 1;
710 
711  while( !feof( fc ) )
712  {
713  MLoopWhileEvents(0);
714  k ++;
715  if((k % 10) == 0 && k > 0)
716  D_VRange(NULL, (long) k * 100 / numspettri, 0, 222, 235 );
717  er = ReadHeaderOldF(fc);
718  //Modifica alcuni parametri del Header
719  BIL.SPH.ccdwx = 1024;
720  BIL.SPH.ccdwy = 254;
721  BIL.SPH.ccdsx = 0;
722  BIL.SPH.ccdsy = 0;
723  BIL.SPH.ccdex = 1023;
724  BIL.SPH.ccdey = 253;
725 
726  if(BIL.DPLOT.ImatGraf == 0)
728 
729  ReadIMG(fc, BIL.DPLOT.ImatGraf, IDX, IDY);
730 
731 
732  sprintf(buf,"%s\\%s", "CORRECTED",filedatan);
733  strcpy(str, BIL.DFILEM.WORKDIRECTORY);
734  strcat(str,buf);
735  //MMessageDialog("Full FileName:", str, "ok", NULL);
736  fd = fopen(str, "a");
737  if(fd < 0) return 1;
738 
739  //Print
740  D_PrintBILSPH(fd);
741  D_PrintSpectrum(fd);
742 
743  fclose(fd);
744 
745 
746  }
747  fclose(fc);
748 
749  }
750 
751  D_VRange(NULL, 100, 0,0,0);
752 
753  fclose(fs);
754 
755  if(!BIL.DPLOT.ImatGraf == 0)
756  {
759 
760  }
761  return 0;
762 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
void MLoopWhileEvents(int discard)
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
void ReadIMG(FILE *file, unsigned short *mat, int hp, int vp)
Read ASCII Image (Spectral Data only) .
Definition: Spat_Plot.c:1206
void D_VRange(char *str, int val, int r, int g, int b)
Create and display the status bar.
Definition: Utils.c:206
bil BIL
Definition: Utils.c:27
d_fileman DFILEM
Definition: bildef.h:257
void D_PrintSpectrum(FILE *fff)
Print Spectrum.
Definition: Utils.c:517
#define SAVECNT
maximum number of spectra in one file
unsigned short * ImatOrig
Definition: bildef.h:180
d_view DPLOT
Definition: bildef.h:254
unsigned short * DeallocUSMat(unsigned short *mat)
Definition: Spat_Plot.c:145
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
MOBJECT MDCreateFM_Shell(int mod, int fmt)
Definition: DFileMan.c:407
void D_PrintBILSPH(FILE *fff)
Print Header.
Definition: Utils.c:581
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
unsigned short * ImatGraf
Definition: bildef.h:176
#define FOPEN
Definition: bildef.h:217
char WORKDIRECTORY[_MAX_PATH]
Definition: bildef.h:202
#define FELE
Definition: bildef.h:223
unsigned short * AllocUSMat(int hp, int vp)
Definition: Spat_Plot.c:1994
int ReadHeaderOldF(FILE *fd)
read the ASCII header of the stored spectrum (OLD FORMAT - replaced by ReadHeaderOnly(FILE *fd) ...
Definition: Save.c:751
+ Here is the call graph for this function:

§ DT_FluxIndex()

int DT_FluxIndex ( void  )

Callback for Flux Index Calculation.

Definition at line 499 of file Utils.c.

References DB_CalcFluxI(), d_fileman::DBFILENAME, bil::DFILEM, FELE, FOPEN, and MDCreateFM_Shell().

Referenced by DB_ToolsKeyB_CB().

500 {
501 
502 
503 
504  BIL.DFILEM.DBFILENAME[0] = 0;
505  MDCreateFM_Shell(FOPEN, FELE); //Open File, Ele ext.
506 
507  if(BIL.DFILEM.DBFILENAME[0] == 0)
508  return 1;
509 
511 
512 
513 
514  return 0;
515 }
int DB_CalcFluxI(char *nomefile)
Definition: Utils.c:328
bil BIL
Definition: Utils.c:27
d_fileman DFILEM
Definition: bildef.h:257
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
MOBJECT MDCreateFM_Shell(int mod, int fmt)
Definition: DFileMan.c:407
#define FOPEN
Definition: bildef.h:217
#define FELE
Definition: bildef.h:223
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DT_LinkSpectra()

int DT_LinkSpectra ( void  )

For the linked spectra (..on going!!!)

Definition at line 915 of file Utils.c.

References d_fileman::DBFILENAME, bil::DFILEM, FMOD, FOPEN, MDCreateFM_Shell(), and Model_read().

Referenced by DB_ToolsKeyB_CB().

916 {
917 
918  BIL.DFILEM.DBFILENAME[0] = 0;
919  MDCreateFM_Shell(FOPEN, FMOD); //Open File, mod ext.
920 
921  if(BIL.DFILEM.DBFILENAME[0] == 0)
922  return 1;
923 
925 
926  return 0;
927 
928 
929 }
#define FMOD
Definition: bildef.h:228
bil BIL
Definition: Utils.c:27
d_fileman DFILEM
Definition: bildef.h:257
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
MOBJECT MDCreateFM_Shell(int mod, int fmt)
Definition: DFileMan.c:407
#define FOPEN
Definition: bildef.h:217
int Model_read(char *buff)
Definition: Utils.c:893
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_AAMeasure()

void E_AAMeasure ( void  )

perform measurements with the Alt Azimuth Platform perform measurements with the Alt Azimuth Platform positioning all the spectrometer devices

Definition at line 997 of file Exec.c.

References optionini::avgautor, das::DOption, E_REM(), paramini::EqType, ExeREM, FDOUBLE, optionini::filtertype, FPLUS, LookforWl_X(), optionini::measmode, das::Paramini, PerformMeas(), PrgCnt, Program, S_zenetr, SD_Azimuth(), SD_FilterW(), SD_FNTorqueM(), SD_Grating(), SD_Mirror(), SD_NDFilterW(), SD_Position(), SD_Zenith(), optionini::smposmode, SPATRAM2, SPATRAM3, SPATRAMPLUS, and wl.

Referenced by D_AutoExecution().

998 {
999 
1000  int er=0;
1001  int l, f, m, a, d, s, g, wl;
1002  double z, az;
1003  double t;
1004 
1005  sscanf(&Program[PrgCnt], "%d%d%d%lf%lf%d%lf%d%d%d", &m, &wl, &f, &z, &az, &a, &t, &d, &s, &g);
1006 
1007  l= LookforWl_X(wl);
1008 
1009 
1010  if(z == 360)
1011  z = -S_zenetr; //per misure di Io nel piano azimuthale in cui ho fatto misure (da controllarese deve essere positivo negativo o 90-)
1012 
1013 
1014  if (DAS.DOption.smposmode)
1015  SD_Position(m, l, f, z, az);
1016  else
1017  {
1018  //mirror positioning
1019  SD_Mirror(m);
1020  //grating positioning
1021  SD_Grating(l);
1022  //filter wheel positioning
1023  SD_FilterW(f);
1024  //Zenith positioning
1025  SD_Zenith((float)z);
1026  //Azimuth positioning
1027  SD_Azimuth((float)az,0);
1028  }
1029 
1030  if(DAS.DOption.filtertype == FDOUBLE)
1031  {
1033  SD_NDFilterW(0); //Reset NDFilterWheel position
1034  }
1035 
1036  if(DAS.DOption.filtertype == FPLUS)
1037  {
1038  SD_FNTorqueM(0); //Reset NDFilterWheel position
1039  }
1040 
1041  ExeREM = 0;
1042 
1043 
1044  if(DAS.DOption.measmode == 0) //Single
1045  PerformMeas(0, a, t, d, s, g);
1046  if(DAS.DOption.measmode == 1) //AVG
1047  {
1048  if(DAS.DOption.avgautor)
1049  PerformMeas(1, a, t, d, s, g);
1050  else
1051  PerformMeas(2, a, t, d, s, g);
1052 
1053  }
1054 
1055  ExeREM = 1;
1056  E_REM();
1057 
1058 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
double S_zenetr
Definition: SOLPOS.C:92
optionini DOption
Options for DAS execution.
void SD_FNTorqueM(int mod)
Positioning NDFilter. .
Definition: Spat_Device.c:3066
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
int SD_Zenith(float ang)
Positioning Zenith. The Zenith reaches the position specified by ang.
Definition: Spat_Device.c:2916
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
int avgautor
autoranging for averaged measurement, 0 = NO AutoR before average; 1 = AutoR before average; ...
das DAS
Definition: Exec.c:30
char * Program
buffer for the PRG file
Definition: DAS_Spat.c:90
#define FDOUBLE
double filter wheel
#define FPLUS
Filter Wheel Torque Motor.
int SD_Azimuth(float ang, float raz)
Positioning Azimuth. The Zenith reaches the position specified by ang.
Definition: Spat_Device.c:3110
long PrgCnt
Counter for the position in the PRG file.
Definition: DAS_Spat.c:93
#define SPATRAM2
SPATRAM2 (with ATX power supply & HiresV)
#define SPATRAMPLUS
As SPATRAM plus AltAzimuth platform.
#define SPATRAM3
SPATRAM3.
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
int measmode
measuring mode: 0 = Single; 1 = Averaged
int SD_Position(int m, int w, int f, double z, double a)
perform the simoultaneous positioning of the Spectrometer Devices m = mirror w = wavelength (Grating)...
Definition: Spat_Device.c:1243
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
int EqType
Spectrometer Type.
void PerformMeas(int mod, int ar, double te, int mt, int sv, int pl)
Perform Averaged or single measurements.
Definition: Exec.c:463
int SD_NDFilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2354
int LookforWl_X(int x)
Definition: Procedures.c:2295
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:

§ E_AAPos()

void E_AAPos ( void  )

alt Az Positioning.
Available for SPATRAMPLUS and TROPOGAS (with the AltAzPlatform)

Definition at line 893 of file Exec.c.

References E_REM(), PrgCnt, Program, and SD_Position().

Referenced by D_AutoExecution().

894 {
895 
896  int er=0;
897 // int l, f, m, d, g;
898  double z, az;
899 // double t;
900 
901 
902  sscanf(&Program[PrgCnt], "%lf%lf", &z, &az);
903 
904 
905  SD_Position(-1, -1, -1, z, az);
906  E_REM();
907 }
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
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int SD_Position(int m, int w, int f, double z, double a)
perform the simoultaneous positioning of the Spectrometer Devices m = mirror w = wavelength (Grating)...
Definition: Spat_Device.c:1243
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Almucantar()

void E_Almucantar ( void  )

.
All the E_xxxxx() function are used during the execution in PRG mode

Definition at line 1680 of file Exec.c.

References delay(), das::DOption, E_REM(), elev, paramini::EqType, ExeREM, FDOUBLE, optionini::filtertype, FPLUS, LookforWl_X(), das::Paramini, PerformMeas(), PrgCnt, Program, S_azim, S_zenetr, SD_FilterW(), SD_FNTorqueM(), SD_Grating(), SD_Mirror(), SD_NDFilterW(), SD_Position(), optionini::smposmode, SPATRAM2, SPATRAM3, SPATRAMPLUS, and wl.

Referenced by D_AutoExecution().

1681 {
1682 
1683  char str[16];
1684  float azi, elev;
1685  int er=0;
1686  int l, f, m, a, d, s, g, wl, nf,k;
1687  double t;
1688 
1689  //sun Azimuth angle
1690  sprintf(str, "%.01lf", S_azim);
1691  azi = atof(str);
1692 
1693  //Elevation Angle
1694  sprintf(str, "%.01lf", (90 - S_zenetr));
1695  elev = atof(str);
1696 
1697 
1698 
1699  sscanf(&Program[PrgCnt], "%d%d%d%d%d%lf%d%d%d", &m, &wl, &f, &nf, &a, &t, &d, &s, &g);
1700 
1701  l= LookforWl_X(wl);
1702 
1703 for(k=0; k<=360; k+=10)
1704 {
1705 
1706 if (DAS.DOption.smposmode)
1707  {
1708  //SD_PosOMUDev(m, l, f);
1709  SD_Position(m, l, f, elev, k);
1710 
1711 
1712  if(DAS.DOption.filtertype == FDOUBLE)
1713  {
1715  SD_NDFilterW(nf); //ND1
1716  }
1717  if(DAS.DOption.filtertype == FPLUS)
1718  {
1719 // if(DAS.Paramini.EqType == GASCODNG1)
1720 // {
1721  SD_FNTorqueM(nf);//ND1
1722  delay(700);
1723 // }
1724  }
1725 
1726  }
1727  //SD_Position(m, l, f, 0, 0);
1728  else
1729  {
1730  //mirror positioning
1731  SD_Mirror(m);
1732  //grating positioning
1733  SD_Grating(l);
1734  //filter wheel positioning
1735  SD_FilterW(f);
1736  //Neutral filter wheel positioning
1737  SD_NDFilterW(nf);
1738  if(DAS.DOption.filtertype == FDOUBLE)
1739  {
1740  if(DAS.Paramini.EqType == SPATRAM2 ||
1743  SD_NDFilterW(nf); //ND1
1744  }
1745  if(DAS.DOption.filtertype == FPLUS)
1746  {
1747 // if(DAS.Paramini.EqType == GASCODNG1)
1748 // {
1749  SD_FNTorqueM(nf);//ND1
1750  delay(700);
1751 // }
1752  }
1753  //Zenith positioning
1754  //SD_Zenith(z);
1755  //Azimuth positioning
1756  //SD_Azimuth(az);
1757  }
1758 
1759 
1760  ExeREM = 0;
1761  PerformMeas(0, a, t, d, s, g);
1762 
1763  ExeREM = 1;
1764 }
1765  E_REM();
1766 
1767 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
double S_zenetr
Definition: SOLPOS.C:92
optionini DOption
Options for DAS execution.
void SD_FNTorqueM(int mod)
Positioning NDFilter. .
Definition: Spat_Device.c:3066
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
das DAS
Definition: Exec.c:30
char * Program
buffer for the PRG file
Definition: DAS_Spat.c:90
#define FDOUBLE
double filter wheel
#define FPLUS
Filter Wheel Torque Motor.
long PrgCnt
Counter for the position in the PRG file.
Definition: DAS_Spat.c:93
#define SPATRAM2
SPATRAM2 (with ATX power supply & HiresV)
#define SPATRAMPLUS
As SPATRAM plus AltAzimuth platform.
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
#define SPATRAM3
SPATRAM3.
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
int SD_Position(int m, int w, int f, double z, double a)
perform the simoultaneous positioning of the Spectrometer Devices m = mirror w = wavelength (Grating)...
Definition: Spat_Device.c:1243
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
static double elev
Definition: SOLPOS.C:130
int EqType
Spectrometer Type.
void PerformMeas(int mod, int ar, double te, int mt, int sv, int pl)
Perform Averaged or single measurements.
Definition: Exec.c:463
int SD_NDFilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2354
int LookforWl_X(int x)
Definition: Procedures.c:2295
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:

§ E_AutoRange()

void E_AutoRange ( void  )

Autoranging.
Procedure for Autoranging. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 342 of file Exec.c.

References AutoRange(), E_REM(), ExeREM, and Status().

Referenced by D_AutoExecution(), and Radio().

343 {
344 
345  ExeREM = 0;
346  Status("Autoranging...");
347  AutoRange(0);
348  ExeREM = 1;
349  E_REM();
350 
351 }
int ExeREM
Definition: DAS_Spat.c:143
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
Definition: Procedures.c:899
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Average()

void E_Average ( void  )

Averaged Measurements.
Procedure for Averaged Measurements. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 612 of file Exec.c.

References E_REM(), ExeREM, LookforWl_X(), PerformMeas(), PrgCnt, Program, SD_FilterW(), SD_Grating(), SD_Mirror(), and wl.

Referenced by D_AutoExecution().

613 {
614 
615  int er=0;
616  int l, f, m, a, d, s, g, wl;
617  double t;
618 
619 
620  extern struct date dok;
621  int StsTot = 0;
622  int StsMir = 0, StsGrat = 0, StsFW = 0;
623 
624  sscanf(&Program[PrgCnt], "%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
625 
626  l= LookforWl_X(wl);
627 
628 
629 
630  //Posiziona specchio
631  SD_Mirror(m);
632  //Posiziona reticolo
633  SD_Grating(l);
634  //Posiziona Ruota dei filtri
635  SD_FilterW(f);
636 
637  ExeREM = 0;
638 
639  PerformMeas(1, a, t, d, s, g); //Measuremet with TExp computed by Autoranging
640 
641 
642  ExeREM = 1;
643  E_REM();
644 
645 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
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
Definition: Dildef.h:240
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
void PerformMeas(int mod, int ar, double te, int mt, int sv, int pl)
Perform Averaged or single measurements.
Definition: Exec.c:463
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:

§ E_AvgCCDHor()

void E_AvgCCDHor ( void  )

Averaged Horizontal Measurements.
Procedure for Averaged Measurements with external lamp. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 538 of file Exec.c.

References das::DOption, E_REM(), ExeREM, ExtShutt(), flag::extshutter, LookforWl_X(), PerformMeas(), PrgCnt, Program, SD_FilterW(), SD_Grating(), SD_Mirror(), SD_PosOMUDev(), optionini::smposmode, and wl.

Referenced by D_AutoExecution().

539 {
540 
541  int er=0;
542  int l, f, m, a, d, s, g, wl;
543  double t;
544  extern struct date dok;
545 
546  int StsTot = 0;
547  int StsMir = 0, StsGrat = 0, StsFW = 0;
548 
549  // The progression of "PrgCnt" is now in the Fetch function
550  // PrgCnt += 7;
551 
552  sscanf(&Program[PrgCnt], "%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
553 
554  l= LookforWl_X(wl);
555 
556 
557  if (DAS.DOption.smposmode)
558  SD_PosOMUDev(m, l, f);
559  //SD_Position(m, l, f, 0, 0);
560  else
561  {
562  //mirror positioning
563  SD_Mirror(m);
564  //grating positioning
565  SD_Grating(l);
566  //filter wheel positioning
567  SD_FilterW(f);
568  //Zenith positioning
569 // SD_Zenith(z);
570  //Azimuth positioning
571 // SD_Azimuth(az);
572  }
573  ExeREM = 0;
574  /******************************************************************/
575 
576  //*********************** Start First Measurement ******************
577 
578  PerformMeas(1, a, t, d, s, g); //Measuremet with TExp computed by Autoranging with external lamp
579 
580  //*********************** End First Measurement ******************
581 
582  //*********************** Start Second Measurement ******************
583  //Close External Shutter
584  if (FLAG.extshutter == 0)
585  {
586  ExtShutt(0);
587  FLAG.extshutter = 1;
588 
589  }
590 
591  PerformMeas(2, a, t, d, s, g); //Measuremet with previous TExp (computed by Autoranging with external lamp)
592  //*********************** End Second Measurement ******************
593 
594  //*********************** Start Third Measurement ******************
595  PerformMeas(0, a, t, d, s, g); //Measurement with TExp computed by Autoranging without external lamp
596 
597  //Open External Shutter
598  if (FLAG.extshutter)
599  {
600  ExtShutt(0);
601  FLAG.extshutter = 0;
602  }
603 
604  //*********************** End Third Measurement ******************
605 
606  ExeREM = 1;
607  E_REM();
608 
609 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
optionini DOption
Options for DAS execution.
flag FLAG
Definition: Exec.c:28
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
das DAS
Definition: Exec.c:30
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 ExtShutt(int mod)
change the status of the external shutter change the status of the external shutter (OPEN or CLOSED) ...
Definition: Exec.c:1155
Definition: Dildef.h:240
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
int SD_PosOMUDev(int m, int w, int f)
perform the simoultaneous positioning of the Spectrometer Devices in the OMU Unit m = mirror w = wave...
Definition: Spat_Device.c:747
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
void PerformMeas(int mod, int ar, double te, int mt, int sv, int pl)
Perform Averaged or single measurements.
Definition: Exec.c:463
int extshutter
0 = external shutter open; 1 = external shutter closed
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:

§ E_Azimuth()

void E_Azimuth ( void  )

Position Azimuth Axis.

Definition at line 1473 of file Exec.c.

References E_REM(), ExeREM, PrgCnt, Program, and SD_Azimuth().

Referenced by D_AutoExecution().

1474 {
1475  double l;
1476  sscanf(&Program[PrgCnt], "%lf", &l);
1477  ExeREM = 0;
1478 
1479  l = (float) l;
1480 
1481  SD_Azimuth((float)l,0);
1482 
1483  ExeREM = 1;
1484  E_REM();
1485 }
int ExeREM
Definition: DAS_Spat.c:143
char * Program
buffer for the PRG file
Definition: DAS_Spat.c:90
int SD_Azimuth(float ang, float raz)
Positioning Azimuth. The Zenith reaches the position specified by ang.
Definition: Spat_Device.c:3110
long PrgCnt
Counter for the position in the PRG file.
Definition: DAS_Spat.c:93
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Calibra()

void E_Calibra ( void  )

Execute D_Calibra.
D_Calibra is a procedure for the spectral calibration with HG lamp. Shift of HG spectral line at 4358.4 on pixel 512 All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 330 of file Exec.c.

References D_Calibra(), E_REM(), and ExeREM.

Referenced by D_AutoExecution().

331 {
332  ExeREM = 0;
333  D_Calibra();
334  ExeREM = 1;
335  E_REM();
336 
337 }
int ExeREM
Definition: DAS_Spat.c:143
int D_Calibra(void)
Spectral Calibration Procedure for the spectral calibration with HG lamp. Shift of HG spectral line a...
Definition: Procedures.c:2313
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_ChkExLamp()

void E_ChkExLamp ( void  )

Definition at line 1225 of file Exec.c.

References AutoRange(), E_REM(), ExeREM, ExtShutt(), flag::extshutter, and TExp.

Referenced by D_AutoExecution().

1226 {
1227 
1228  int flagstatus = 1;
1229  int cont = 0;
1230  double Texp_temp = 0;
1231  double T1 = 0, T2 = 0;
1232  extern struct date dok;
1233 
1234  // Check if the shutter is open or closed
1235  // It has to be open (so the Exposure time has to be short...)
1236  ExeREM = 0;
1237  do
1238  {
1239  //the shutter is thinked to be open
1240  //first measurement with the shutter open
1241  AutoRange(0);
1242  T1 = TExp;
1243 
1244  //Close External Shutter
1245 
1246  ExtShutt(0);
1247 
1248  AutoRange(0);
1249  T2 = TExp;
1250  if( T1/T2 < 1) // the shutter was open at the first measurement and Now it has to be open again
1251  { //Open External Shutter
1252  ExtShutt(0);
1253  FLAG.extshutter = 0;
1254  flagstatus = 0;
1255  }
1256  else
1257  {
1258  //the shutter was closed at the first measurement so now is already open
1259  FLAG.extshutter = 0;
1260  flagstatus = 0;
1261  }
1262 // AutoRange(0);
1263 // if( (TExp <= T1 + 1) & (TExp >= T1 - 1))
1264 // flagstatus = 0;
1265 
1266  cont++;
1267 
1268  }while((flagstatus) | (cont == 5));
1269 
1270  ExeREM = 1;
1271  E_REM();
1272 
1273 }
int ExeREM
Definition: DAS_Spat.c:143
flag FLAG
Definition: Exec.c:28
int ExtShutt(int mod)
change the status of the external shutter change the status of the external shutter (OPEN or CLOSED) ...
Definition: Exec.c:1155
Definition: Dildef.h:240
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
Definition: Procedures.c:899
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int extshutter
0 = external shutter open; 1 = external shutter closed
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Dark()

void E_Dark ( void  )

Execute Dark Measurement.
Procedure for Dark Measurement. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 279 of file Exec.c.

References img::DATE, DB_DefectPixCorr(), DC_GetCCD(), DI_Regen(), DI_ScanMaxMin(), DIL, das::DOption, E_REM(), ExeREM, GetDateTime(), img::High, img::IHigh, img::ILow, img::Imat, dil::Img, img::Low, image::Mat, optionini::pixcorr, Server, TExp, and img::TIME.

Referenced by D_AutoExecution().

280 {
281 
282  struct tm today;
283  ExeREM = 0;
284 
285  DC_GetCCD(0, TExp, DIL.Img.Mat[Server].Imat, 0);
286  if (DAS.DOption.pixcorr)
288 
292 
293  DI_Regen(Server);
294 
296  // gettime( &DIL.Img.Mat[Server].TIME );
297  // getdate( &DIL.Img.Mat[Server].DATE );
298 
299  ExeREM = 1;
300  E_REM();
301 
302 }
int ExeREM
Definition: DAS_Spat.c:143
int Server
Definition: DAS_Spat.c:253
dil DIL
Definition: 2DPlot.c:26
optionini DOption
Options for DAS execution.
C_DEF void DI_Regen(int s)
C_DEF double DI_ScanMaxMin(int w, float *mx, float *mi)
U16 * Imat
Definition: Dildef.h:286
img Mat[MAXIMG]
Definition: Dildef.h:552
struct date DATE
Definition: Dildef.h:348
das DAS
Definition: Exec.c:30
image Img
Definition: Dildef.h:675
void DB_DefectPixCorr(void)
Apply thew pixel correction. .
Definition: Procedures.c:1568
float IHigh
Definition: Dildef.h:303
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
CTYPE void DLL DC_GetCCD(int Mode, double Exposure, U16 *mat, int Camera)
Get an image at full resolution. Procedure that allows you to read an image, given an exposure time e...
float ILow
Definition: Dildef.h:302
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
int pixcorr
Flag to set defective pixel correction: 0=NOT Corrected, 1=Corrected.
struct time TIME
Definition: Dildef.h:347
float Low
Definition: Dildef.h:294
float High
Definition: Dildef.h:295
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_DFMeasure()

void E_DFMeasure ( void  )

Perform Measurement setting the ND Filter Wheel also.
All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 911 of file Exec.c.

References optionini::avgautor, delay(), das::DOption, E_REM(), paramini::EqType, ExeREM, FDOUBLE, optionini::filtertype, FPLUS, LookforWl_X(), optionini::measmode, das::Paramini, PerformMeas(), PrgCnt, Program, SD_FilterW(), SD_FNTorqueM(), SD_Grating(), SD_Mirror(), SD_NDFilterW(), SD_PosOMUDev(), optionini::smposmode, SPATRAM2, SPATRAM3, SPATRAMPLUS, and wl.

Referenced by D_AutoExecution().

912 {
913  int er=0;
914  int l, f, m, a, d, s, g,nf;
915  int wl;
916  double t;
917  extern struct date dok;
918 
919 
920  int StsTot = 0;
921  int StsMir = 0, StsGrat = 0, StsFW = 0;
922 // The progression of "PrgCnt" is now in the Fetch function
923 // PrgCnt += 7;
924 
925 
926  sscanf(&Program[PrgCnt], "%d%d%d%d%d%lf%d%d%d", &m, &wl, &f, &nf, &a, &t, &d, &s, &g);
927 
928  l= LookforWl_X(wl);
929 
930 
931  if (DAS.DOption.smposmode)
932  {
933  SD_PosOMUDev(m, l, f);
935  {
937  SD_NDFilterW(nf); //ND1
938  }
939  if(DAS.DOption.filtertype == FPLUS)
940  {
941  //if(DAS.Paramini.EqType == GASCODNG1)
942  //{
943  SD_FNTorqueM(nf);//ND1
944  delay(700);
945  //}
946  }
947  }
948  //SD_Position(m, l, f, 0, 0);
949  else
950  {
951  //mirror positioning
952  SD_Mirror(m);
953  //grating positioning
954  SD_Grating(l);
955  //filter wheel positioning
956  SD_FilterW(f);
957  //Neutral filter wheel positioning
958  SD_NDFilterW(nf);
960  {
962  SD_NDFilterW(nf); //ND1
963  }
964  if(DAS.DOption.filtertype == FPLUS)
965  {
966  //if(DAS.Paramini.EqType == GASCODNG1)
967  //{
968  SD_FNTorqueM(nf);//ND1
969  delay(700);
970  //}
971  }
972  //Zenith positioning
973  //SD_Zenith(z);
974  //Azimuth positioning
975  //SD_Azimuth(az);
976  }
977 
978  ExeREM = 0;
979 
980  if(DAS.DOption.measmode == 0) //Single
981  PerformMeas(0, a, t, d, s, g);
982  if(DAS.DOption.measmode == 1) //AVG
983  {
984  if(DAS.DOption.avgautor)
985  PerformMeas(1, a, t, d, s, g);
986  else
987  PerformMeas(2, a, t, d, s, g);
988 
989  }
990 
991  ExeREM = 1;
992  E_REM();
993 
994 
995 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
optionini DOption
Options for DAS execution.
void SD_FNTorqueM(int mod)
Positioning NDFilter. .
Definition: Spat_Device.c:3066
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
int avgautor
autoranging for averaged measurement, 0 = NO AutoR before average; 1 = AutoR before average; ...
das DAS
Definition: Exec.c:30
char * Program
buffer for the PRG file
Definition: DAS_Spat.c:90
#define FDOUBLE
double filter wheel
#define FPLUS
Filter Wheel Torque Motor.
long PrgCnt
Counter for the position in the PRG file.
Definition: DAS_Spat.c:93
#define SPATRAM2
SPATRAM2 (with ATX power supply & HiresV)
#define SPATRAMPLUS
As SPATRAM plus AltAzimuth platform.
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
Definition: Dildef.h:240
#define SPATRAM3
SPATRAM3.
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
int SD_PosOMUDev(int m, int w, int f)
perform the simoultaneous positioning of the Spectrometer Devices in the OMU Unit m = mirror w = wave...
Definition: Spat_Device.c:747
int measmode
measuring mode: 0 = Single; 1 = Averaged
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
int EqType
Spectrometer Type.
void PerformMeas(int mod, int ar, double te, int mt, int sv, int pl)
Perform Averaged or single measurements.
Definition: Exec.c:463
int SD_NDFilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2354
int LookforWl_X(int x)
Definition: Procedures.c:2295
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:

§ E_DirectSun()

void E_DirectSun ( void  )

.
All the E_xxxxx() function are used during the execution in PRG mode

Definition at line 1596 of file Exec.c.

References delay(), das::DOption, E_REM(), elev, paramini::EqType, ExeREM, FDOUBLE, optionini::filtertype, FPLUS, LookforWl_X(), das::Paramini, PerformMeas(), PrgCnt, Program, S_azim, S_zenetr, SD_FilterW(), SD_FNTorqueM(), SD_Grating(), SD_Mirror(), SD_NDFilterW(), SD_Position(), optionini::smposmode, SPATRAM2, SPATRAM3, SPATRAMPLUS, and wl.

Referenced by D_AutoExecution().

1597 {
1598 
1599  char str[16];
1600  float azi, elev;
1601  int er=0;
1602  int l, f, m, a, d, s, g, wl, nf;
1603  double t;
1604 
1605  //sun Azimuth angle
1606  sprintf(str, "%.01lf", S_azim);
1607  azi = atof(str);
1608 
1609  //Elevation Angle
1610  sprintf(str, "%.01lf", (90 - S_zenetr));
1611  elev = atof(str);
1612 
1613 
1614 
1615  sscanf(&Program[PrgCnt], "%d%d%d%d%d%lf%d%d%d", &m, &wl, &f, &nf, &a, &t, &d, &s, &g);
1616 
1617  l= LookforWl_X(wl);
1618 
1619 
1620  if (DAS.DOption.smposmode)
1621  {
1622  //SD_PosOMUDev(m, l, f);
1623  SD_Position(m, l, f, elev, azi);
1624  if(DAS.DOption.filtertype == FDOUBLE)
1625  {
1627  SD_NDFilterW(nf); //ND1
1628  }
1629  if(DAS.DOption.filtertype == FPLUS)
1630  {
1631  // if(DAS.Paramini.EqType == GASCODNG1)
1632  // {
1633  SD_FNTorqueM(nf);//ND1
1634  delay(700);
1635  // }
1636  }
1637 
1638  }
1639  //SD_Position(m, l, f, 0, 0);
1640  else
1641  {
1642  //mirror positioning
1643  SD_Mirror(m);
1644  //grating positioning
1645  SD_Grating(l);
1646  //filter wheel positioning
1647  SD_FilterW(f);
1648  //Neutral filter wheel positioning
1649  SD_NDFilterW(nf);
1650  if(DAS.DOption.filtertype == FDOUBLE)
1651  {
1653  SD_NDFilterW(nf); //ND1
1654  }
1655  if(DAS.DOption.filtertype == FPLUS)
1656  {
1657 // if(DAS.Paramini.EqType == GASCODNG1)
1658 // {
1659  SD_FNTorqueM(nf);//ND1
1660  delay(700);
1661 // }
1662  }
1663  //Zenith positioning
1664  //SD_Zenith(z);
1665  //Azimuth positioning
1666  //SD_Azimuth(az);
1667  }
1668 
1669 
1670  ExeREM = 0;
1671  PerformMeas(0, a, t, d, s, g);
1672 
1673  ExeREM = 1;
1674  E_REM();
1675 
1676 
1677 
1678 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
double S_zenetr
Definition: SOLPOS.C:92
optionini DOption
Options for DAS execution.
void SD_FNTorqueM(int mod)
Positioning NDFilter. .
Definition: Spat_Device.c:3066
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
das DAS
Definition: Exec.c:30
char * Program
buffer for the PRG file
Definition: DAS_Spat.c:90
#define FDOUBLE
double filter wheel
#define FPLUS
Filter Wheel Torque Motor.
long PrgCnt
Counter for the position in the PRG file.
Definition: DAS_Spat.c:93
#define SPATRAM2
SPATRAM2 (with ATX power supply & HiresV)
#define SPATRAMPLUS
As SPATRAM plus AltAzimuth platform.
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
#define SPATRAM3
SPATRAM3.
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
int SD_Position(int m, int w, int f, double z, double a)
perform the simoultaneous positioning of the Spectrometer Devices m = mirror w = wavelength (Grating)...
Definition: Spat_Device.c:1243
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
static double elev
Definition: SOLPOS.C:130
int EqType
Spectrometer Type.
void PerformMeas(int mod, int ar, double te, int mt, int sv, int pl)
Perform Averaged or single measurements.
Definition: Exec.c:463
int SD_NDFilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2354
int LookforWl_X(int x)
Definition: Procedures.c:2295
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:

§ E_Expo()

void E_Expo ( void  )

Exposuring.
Read the Exposure time from PRG file. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 365 of file Exec.c.

References E_REM(), PrgCnt, Program, and Status().

Referenced by D_AutoExecution().

366 {
367  double l;
368 // PrgCnt += 4;
369  sscanf(&Program[PrgCnt], "%lf", &l);
370  Status("Exposure Time");
371 // TExp = l;
372  E_REM();
373 }
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
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_ExtLampOFF()

void E_ExtLampOFF ( void  )

External lamp OFF.

Definition at line 66 of file Exec.c.

References E_REM(), ExeREM, flag::extlamp, and ExtLamp().

Referenced by D_AutoExecution().

67 {
68  ExeREM = 0;
69 
70  if(FLAG.extlamp)
71  ExtLamp(0);
72 
73  ExeREM = 1;
74  E_REM();
75 
76 }
int ExeREM
Definition: DAS_Spat.c:143
int ExtLamp(int mod)
change the status of the external lamp change the status of the external lamp (ON or OFF) through a r...
Definition: Exec.c:1117
int extlamp
0 = external lamp OFF; 1 = external lamp ON
flag FLAG
Definition: Exec.c:28
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_ExtLampON()

void E_ExtLampON ( void  )

External lamp ON.

Definition at line 54 of file Exec.c.

References E_REM(), ExeREM, flag::extlamp, and ExtLamp().

Referenced by D_AutoExecution().

55 {
56  ExeREM = 0;
57 
58  if(FLAG.extlamp == 0)
59  ExtLamp(0);
60 
61  ExeREM = 1;
62  E_REM();
63 
64 }
int ExeREM
Definition: DAS_Spat.c:143
int ExtLamp(int mod)
change the status of the external lamp change the status of the external lamp (ON or OFF) through a r...
Definition: Exec.c:1117
int extlamp
0 = external lamp OFF; 1 = external lamp ON
flag FLAG
Definition: Exec.c:28
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_ExtShutClose()

void E_ExtShutClose ( void  )

Close External Shutter.

Definition at line 91 of file Exec.c.

References E_REM(), ExeREM, ExtShutt(), and flag::extshutter.

Referenced by D_AutoExecution().

92 {
93  ExeREM = 0;
94 
95  if(FLAG.extshutter == 0)
96  ExtShutt(0);
97 
98  ExeREM = 1;
99  E_REM();
100 }
int ExeREM
Definition: DAS_Spat.c:143
flag FLAG
Definition: Exec.c:28
int ExtShutt(int mod)
change the status of the external shutter change the status of the external shutter (OPEN or CLOSED) ...
Definition: Exec.c:1155
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int extshutter
0 = external shutter open; 1 = external shutter closed
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_ExtShutOpen()

void E_ExtShutOpen ( void  )

Open External Shutter.

Definition at line 79 of file Exec.c.

References E_REM(), ExeREM, ExtShutt(), and flag::extshutter.

Referenced by D_AutoExecution().

80 {
81  ExeREM = 0;
82 
83  if(FLAG.extshutter == 1)
84  ExtShutt(0);
85 
86  ExeREM = 1;
87  E_REM();
88 }
int ExeREM
Definition: DAS_Spat.c:143
flag FLAG
Definition: Exec.c:28
int ExtShutt(int mod)
change the status of the external shutter change the status of the external shutter (OPEN or CLOSED) ...
Definition: Exec.c:1155
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int extshutter
0 = external shutter open; 1 = external shutter closed
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Filter()

void E_Filter ( void  )

Filter Wheel positioning.
Procedure for Filter Wheel positioning. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 761 of file Exec.c.

References E_REM(), ExeREM, PrgCnt, Program, and SD_FilterW().

Referenced by D_AutoExecution().

762 {
763  int l;
764 // The progression of "PrgCnt" is now in the Fetch function
765 // PrgCnt += 6;
766  sscanf(&Program[PrgCnt], "%d", &l);
767  ExeREM = 0;
768  SD_FilterW(l);
769  ExeREM = 1;
770  E_REM();
771 }
int ExeREM
Definition: DAS_Spat.c:143
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
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
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_GetCCD()

int E_GetCCD ( void  )

Get CCD.
Execute DB_GetCCD. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 705 of file Exec.c.

References DB_GetCCD(), E_REM(), ExeREM, and Status().

Referenced by D_AutoExecution(), and Radio().

706 {
707 
708  ExeREM = 0;
709  Status("Getting CCD Image...");
710  DB_GetCCD(1);
711  ExeREM = 1;
712  E_REM();
713  return 0;
714 
715 
716 }
int ExeREM
Definition: DAS_Spat.c:143
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Hg_Off()

void E_Hg_Off ( void  )

HG OFF.
Hg lamp OFF. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 255 of file Exec.c.

References E_REM(), ExeREM, and HgLamp().

Referenced by D_AutoExecution(), and E_HgScan().

256 {
257  ExeREM = 0;
258  HgLamp(0);
259  ExeREM = 1;
260  E_REM();
261 }
int ExeREM
Definition: DAS_Spat.c:143
void HgLamp(int mod)
HG Lamp ON/OFF .
Definition: Spat_Device.c:2673
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Hg_On()

void E_Hg_On ( void  )

HG ON.
Hg lamp ON. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 246 of file Exec.c.

References E_REM(), ExeREM, and HgLamp().

Referenced by D_AutoExecution(), and E_HgScan().

247 {
248  ExeREM = 0;
249  HgLamp(1);
250  ExeREM = 1;
251  E_REM();
252 
253 }
int ExeREM
Definition: DAS_Spat.c:143
void HgLamp(int mod)
HG Lamp ON/OFF .
Definition: Spat_Device.c:2673
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_HGratCal()

void E_HGratCal ( void  )

Perform home grating and HG Calibration.
All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 1488 of file Exec.c.

References D_Calibra(), ExeREM, HomeGratingFast(), and Status().

Referenced by D_AutoExecution().

1489 {
1490  ExeREM = 0;
1491  Status("Home for Grating...");
1492 // AMS_MotorOn_Off(AMS1,0,1);
1493  HomeGratingFast(0);
1494 // AMS_MotorOn_Off(AMS1,0,0);
1495 
1496  D_Calibra();
1497 
1498  ExeREM = 1;
1499 // E_REM();
1500 
1501 
1502 }
int ExeREM
Definition: DAS_Spat.c:143
int HomeGratingFast(int mod)
(Fastest) Grating in the reference Position. The Grating reaches the reference Position. Similar to HomeGrating(void), but faster
Definition: Init.c:780
int D_Calibra(void)
Spectral Calibration Procedure for the spectral calibration with HG lamp. Shift of HG spectral line a...
Definition: Procedures.c:2313
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_HgScan()

void E_HgScan ( void  )

Check the full spectral range with HG ON.
All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 1504 of file Exec.c.

References AutoRange(), D_Plot(), DB_GetCCD(), das::DOption, E_Hg_Off(), E_Hg_On(), ExeREM, FDOUBLE, optionini::filtertype, das::Flag, FPLUS, flag::plotW, SaveCalib(), SD_FilterW(), SD_FNTorqueM(), SD_Grating(), SD_Mirror(), SD_NDFilterW(), and Status().

Referenced by D_AutoExecution().

1505 {
1506 
1507  int l;
1508 
1509  //Switch On QJ Lamp
1510  E_Hg_On();
1511  ExeREM = 0;
1512  //Position Mirror
1513  SD_Mirror(2);
1514 
1515  for (l=1; l<10; l++)
1516  {
1517  //position grating
1518  SD_Grating(l);
1519  // Position Filterwheel
1520  SD_FilterW(0);
1521  if(DAS.DOption.filtertype == FDOUBLE)
1522  SD_NDFilterW(0);
1523  else if(DAS.DOption.filtertype == FPLUS)
1524  SD_FNTorqueM(0);
1525  //autorange
1526  Status("Autoranging...");
1527  AutoRange(0);
1528  Status("Getting CCD Image...");
1529  DB_GetCCD(1);
1530  //Save the Spectrum
1531  SaveCalib(1);
1532 
1533  if(DAS.Flag.plotW)
1534  D_Plot();
1535 
1536 
1537 
1538 
1539  }
1540  E_Hg_Off();
1541 
1542  ExeREM = 1;
1543  //E_REM();
1544 
1545 
1546 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
optionini DOption
Options for DAS execution.
void SD_FNTorqueM(int mod)
Positioning NDFilter. .
Definition: Spat_Device.c:3066
void E_Hg_On(void)
HG ON. Hg lamp ON. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:246
int plotW
Flag for the plot display.
flag Flag
Structure for different flags.
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
void E_Hg_Off(void)
HG OFF. Hg lamp OFF. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:255
das DAS
Definition: Exec.c:30
#define FDOUBLE
double filter wheel
#define FPLUS
Filter Wheel Torque Motor.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void SaveCalib(int mod)
Definition: Procedures.c:2130
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
Definition: Procedures.c:899
void D_Plot(void)
ViewPlot callback .
Definition: Procedures.c:192
int SD_NDFilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2354
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Home_SM1()

int E_Home_SM1 ( void  )

Home for SM1.
Set the reference position for Stepper motor 1 (Input Mirror). All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 111 of file Exec.c.

References flag::ADPC104, flag::ADTempTest, E_REM(), ExeREM, GRAT_TASK_TIME, ids::GRATHOME, HomeMirror(), IDS, MRefreshTimeout(), MRemoveTimeout(), Status(), and Task_HomeGrat().

Referenced by D_AutoExecution().

112 {
113  ExeREM = 0;
114 
115  Status("Home for Mirror..");
116 // AMS_MotorOn_Off(AMS1,1,0);
117  //MClearTimeout(&IDS.GRATHOME);
119  //MClearTimeout(&IDS.REFRTEMP);
120  HomeMirror();
121 // AMS_MotorOn_Off(AMS1,0,0);
122  //Home Grating Task
123 
125  // PeltierTemp Task
126  if((FLAG.ADPC104 == 0) | (FLAG.ADTempTest == 1))
127  {
128  //MRefreshTimeout(&IDS.LISTEMP, LISTEMP_TASK_TIME, Task_LIS_Temp, NULL);
129  }
130 
131  ExeREM = 1;
132  E_REM();
133 
134  return 0;
135 
136 
137 }
void MRefreshTimeout(TIMEOUT_ID *pid, CARD32 msec, TIMEOUT_CB cb, void *ud)
int ExeREM
Definition: DAS_Spat.c:143
flag FLAG
Definition: Exec.c:28
int HomeMirror(void)
Input Mirror in the reference Position. The Input Mirror reaches the reference Position.
Definition: Init.c:685
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 MRemoveTimeout(TIMEOUT_ID id)
int ADTempTest
= 0 -> AD Converter results on the Control Panel; = 1 -> AD Converter Testing Phase(results on the co...
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
#define GRAT_TASK_TIME
Grating Home.
int ADPC104
0 –> Device PC104 exist, 1 –> PC104 DOESN&#39;T exist
ids IDS
ID tasks.
Definition: DAS_Spat.c:54
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Home_SM2()

int E_Home_SM2 ( void  )

Home for SM2.
Set the reference position for Stepper motor 2 (Grating). All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 139 of file Exec.c.

References E_REM(), ExeREM, HomeGratingFast(), and Status().

Referenced by D_AutoExecution().

140 {
141  ExeREM = 0;
142  Status("Home for Grating...");
143 // AMS_MotorOn_Off(AMS1,0,1);
144  HomeGratingFast(0);
145 // AMS_MotorOn_Off(AMS1,0,0);
146 
147  ExeREM = 1;
148  E_REM();
149 
150  return 0;
151 }
int ExeREM
Definition: DAS_Spat.c:143
int HomeGratingFast(int mod)
(Fastest) Grating in the reference Position. The Grating reaches the reference Position. Similar to HomeGrating(void), but faster
Definition: Init.c:780
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Home_SM3()

int E_Home_SM3 ( void  )

Home for SM3.
Set the reference position for Stepper motor 3 (Filter Wheel). All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 154 of file Exec.c.

References AMS2, AMS_MotorOn_Off(), E_REM(), ExeREM, HomeFiltersFast(), and Status().

Referenced by D_AutoExecution().

155 {
156  ExeREM = 0;
157  Status("Home for Filter Wheel...");
158  AMS_MotorOn_Off(AMS2,1,1);
159  HomeFiltersFast();
160 // AMS_MotorOn_Off(AMS2,0,0);
161 
162  ExeREM = 1;
163  E_REM();
164 
165  return 0;
166 }
int ExeREM
Definition: DAS_Spat.c:143
#define AMS2
AMS2 address.
int AMS_MotorOn_Off(int id, int mtr1, int mtr2)
Motor ON-OFF. Switch On-Off the selected motor of the selected AMS.
Definition: Dxl.c:930
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
int HomeFiltersFast(void)
(Fastest) Fliter wheel in the reference Position. The Fliter wheel reaches the reference Position...
Definition: Init.c:853
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Home_SM4()

int E_Home_SM4 ( void  )

Home for SM4.
Set the reference position for Stepper motor 4 (Neutral density filter wheel). All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 209 of file Exec.c.

References AMS2, AMS_Default(), DB_InitAMS(), DB_KB_ButtonActive(), E_REM(), ExeREM, stepm::power, stepm::slope, stepm::SM_A, stepm::SM_B, stepm::speed, Status(), stepm::step, and das::StepM.

Referenced by D_AutoExecution().

210 {
211  int er =0;
212 
213  ExeREM = 0;
214  Status("Home for NDFilter Wheel...");
215 
217  AMS_Default(AMS2);
223  //Attiva i pulsanti sulla keyboard
225 
226 
227 // HomeAzimFast();
228 
229  ExeREM = 1;
230  E_REM();
231 
232  return 0;
233 }
stepm StepM
Stepper motors parameters structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
int ExeREM
Definition: DAS_Spat.c:143
#define AMS2
AMS2 address.
int DB_InitAMS(int nid, int mod, int powera, int stepa, int slopea, int speeda, int powerb, int stepb, int slopeb, int speedb)
Init selected AMS.
Definition: Init.c:1391
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
int slope[AMSMAX][2]
Stepper Motors Slope.
void AMS_Default(int id)
Set default values to AMS parameters Procedure for setting the default values of power.speed, stepping and slope to the selected AMS adapter.
Definition: Dxl.c:174
das DAS
Definition: Exec.c:30
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
int power[AMSMAX][2]
Stepper Motors Power.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Home_SM5()

int E_Home_SM5 ( void  )

Home for SM5.
Set the reference position for Stepper motor 5 (MIGE Zenith). All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 168 of file Exec.c.

References E_REM(), ExeREM, HomeZenithFast(), and Status().

Referenced by D_AutoExecution().

169 {
170  ExeREM = 0;
171  Status("Home for Zenith...");
172 // AMS_MotorOn_Off(AMS3,1,0);
173  HomeZenithFast();
174 // AMS_MotorOn_Off(AMS3,0,0);
175 
176  ExeREM = 1;
177  E_REM();
178 
179  return 0;
180 }
int ExeREM
Definition: DAS_Spat.c:143
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int HomeZenithFast(void)
Home for Zenith Axis.
Definition: Init.c:1143
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Home_SM6()

int E_Home_SM6 ( void  )

Home for SM6.
Set the reference position for Stepper motor 6 (MIGE Azimuth). All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 182 of file Exec.c.

References AMS3, AMS_Default(), DB_InitAMS(), DB_KB_ButtonActive(), E_REM(), ExeREM, stepm::power, stepm::slope, stepm::SM_A, stepm::SM_B, stepm::speed, Status(), stepm::step, and das::StepM.

Referenced by D_AutoExecution().

183 {
184  int er =0;
185 
186  ExeREM = 0;
187  Status("Home for Azimuth...");
188 
190  AMS_Default(AMS3);
196  //Attiva i pulsanti sulla keyboard
198 
199 
200 // HomeAzimFast();
201 
202  ExeREM = 1;
203  E_REM();
204 
205  return 0;
206 }
stepm StepM
Stepper motors parameters structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
int ExeREM
Definition: DAS_Spat.c:143
int DB_InitAMS(int nid, int mod, int powera, int stepa, int slopea, int speeda, int powerb, int stepb, int slopeb, int speedb)
Init selected AMS.
Definition: Init.c:1391
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
int slope[AMSMAX][2]
Stepper Motors Slope.
void AMS_Default(int id)
Set default values to AMS parameters Procedure for setting the default values of power.speed, stepping and slope to the selected AMS adapter.
Definition: Dxl.c:174
das DAS
Definition: Exec.c:30
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
#define AMS3
AMS3 address.
int power[AMSMAX][2]
Stepper Motors Power.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_IRefSun()

void E_IRefSun ( void  )

Io Measured near the sun.
This procedure carries out a measurements for the reference spectrum used in DOAS analysis, with the alt Azimut platfor pointing the sun. Available for SPATRAMPLUS and TROPOGAS (with the AltAzPlatform)

Definition at line 845 of file Exec.c.

References das::DOption, E_REM(), elev, ExeREM, LookforWl_X(), PerformMeas(), PrgCnt, Program, S_azim, S_zenetr, SD_Azimuth(), SD_FilterW(), SD_Grating(), SD_Mirror(), SD_Position(), SD_Zenith(), optionini::smposmode, and wl.

Referenced by D_AutoExecution().

846 {
847 
848  char str[16];
849  float azi, elev;
850  int er=0;
851  int l, f, m, a, d, s, g, wl;
852  double t;
853 
854  //sun Azimuth angle
855  sprintf(str, "%.01lf", S_azim);
856  azi = (float)atof(str);
857 
858  //Elevation Angle
859  sprintf(str, "%.01lf", (90 - S_zenetr));
860  elev = (float)atof(str);
861 
862 
863  sscanf(&Program[PrgCnt], "%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
864 
865  l= LookforWl_X(wl);
866 
867 
868  if (DAS.DOption.smposmode)
869  SD_Position(m, l, f, elev, azi);
870  else
871  {
872  //mirror positioning
873  SD_Mirror(m);
874  //grating positioning
875  SD_Grating(l);
876  //filter wheel positioning
877  SD_FilterW(f);
878  //Zenith positioning
879  SD_Zenith(elev);
880  //Azimuth positioning
881  SD_Azimuth(azi,0);
882  }
883 
884 
885  ExeREM = 0;
886  PerformMeas(0, a, t, d, s, g);
887 
888  ExeREM = 1;
889  E_REM();
890 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
double S_zenetr
Definition: SOLPOS.C:92
optionini DOption
Options for DAS execution.
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
int SD_Zenith(float ang)
Positioning Zenith. The Zenith reaches the position specified by ang.
Definition: Spat_Device.c:2916
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
das DAS
Definition: Exec.c:30
char * Program
buffer for the PRG file
Definition: DAS_Spat.c:90
int SD_Azimuth(float ang, float raz)
Positioning Azimuth. The Zenith reaches the position specified by ang.
Definition: Spat_Device.c:3110
long PrgCnt
Counter for the position in the PRG file.
Definition: DAS_Spat.c:93
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
int SD_Position(int m, int w, int f, double z, double a)
perform the simoultaneous positioning of the Spectrometer Devices m = mirror w = wavelength (Grating)...
Definition: Spat_Device.c:1243
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
static double elev
Definition: SOLPOS.C:130
void PerformMeas(int mod, int ar, double te, int mt, int sv, int pl)
Perform Averaged or single measurements.
Definition: Exec.c:463
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:

§ E_Label()

void E_Label ( void  )

labeling.
The text after the key-word is a label. All the E_xxxxx() function are used during the execution in PRG mode

Definition at line 745 of file Exec.c.

References E_REM(), PrgCnt, and Program.

Referenced by D_AutoExecution().

746 {
747  char lab[255];
748  int c = 0;
749 // The progression of "PrgCnt" is now in the Fetch function
750 // PrgCnt += 5;
751 // while(Program[PrgCnt++] != 34);
752  PrgCnt =PrgCnt+2;
753  do
754  lab[c++] = Program[PrgCnt];
755  while(Program[PrgCnt++] != 34);
756  E_REM();
757 // lab[c] = 0;
758 // Status(lab);
759 }
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
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Lambda()

void E_Lambda ( void  )

Lambda Reading.
When the WAVELEN key-word is encountred in the PRG file, the Wavelength code from PRG file is read and the grating is positioned. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 718 of file Exec.c.

References E_REM(), ExeREM, LookforWl_X(), PrgCnt, Program, SD_Grating(), and wl.

Referenced by D_AutoExecution().

719 {
720  int wl, l;
721 // The progression of "PrgCnt" is now in the Fetch function
722 // PrgCnt += 7;
723  sscanf(&Program[PrgCnt], "%d", &wl);
724  l= LookforWl_X(wl);
725  ExeREM = 0;
726  SD_Grating(l);
727  ExeREM = 1;
728  E_REM();
729 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
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
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
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:

§ E_Meashor()

void E_Meashor ( void  )

perform horizontal measurements (3) 1) measurement with external lamp 2) measurement without the external lamp (same exposure time than 1) 3) measurement without the external lamp (exposure time recalculated)

Definition at line 1280 of file Exec.c.

References D_Plot(), D_Saving(), DB_GetCCD(), das::DOption, E_REM(), ExeREM, ExtShutt(), flag::extshutter, das::Flag, LookforWl_X(), PerformMeas(), flag::plotW, PrgCnt, Program, SD_FilterW(), SD_Grating(), SD_Mirror(), SD_PosOMUDev(), optionini::smposmode, and wl.

Referenced by D_AutoExecution().

1281 {
1282  int er=0;
1283  int l, f, m, a, d, s, g, wl;
1284  double t;
1285  extern struct date dok;
1286 
1287  int StsTot = 0;
1288  int StsMir = 0, StsGrat = 0, StsFW = 0;
1289 
1290  // The progression of "PrgCnt" is now in the Fetch function
1291  // PrgCnt += 7;
1292 
1293  sscanf(&Program[PrgCnt], "%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
1294 
1295  l= LookforWl_X(wl);
1296 
1297 
1298  if (DAS.DOption.smposmode)
1299  SD_PosOMUDev(m, l, f);
1300  //SD_Position(m, l, f, 0, 0);
1301  else
1302  {
1303  //mirror positioning
1304  SD_Mirror(m);
1305  //grating positioning
1306  SD_Grating(l);
1307  //filter wheel positioning
1308  SD_FilterW(f);
1309  //Zenith positioning
1310  //SD_Zenith(z);
1311  //Azimuth positioning
1312  //SD_Azimuth(az);
1313  }
1314  ExeREM = 0;
1315  /******************************************************************/
1316  /******************************************************************/
1317 
1318  //*********************** Start First Measurement ******************
1319  PerformMeas(0, a, t, d, s, g);
1320  //*********************** End First Measurement ******************
1321 
1322  //*********************** Start Second Measurement ******************
1323  //Close External Shutter
1324  if (FLAG.extshutter == 0)
1325  {
1326  ExtShutt(0);
1327  FLAG.extshutter = 1;
1328 
1329  }
1330 
1331  //Measure (d=1) or dark (d=0) -
1332  if(d)
1333  {
1334  DB_GetCCD(1);
1335  }
1336  else
1337  {
1338  DB_GetCCD(0);
1339  }
1340 
1341  //
1342  if(s)
1343  {
1344  D_Saving();
1345  }
1346  if(g)
1347  {
1348  if(DAS.Flag.plotW)
1349  D_Plot();
1350  }
1351  //*********************** End Second Measurement ******************
1352 
1353  //*********************** Start Third Measurement ******************
1354  PerformMeas(0, a, t, d, s, g);
1355 
1356 
1357  //Open External Shutter
1358  if (FLAG.extshutter)
1359  {
1360  ExtShutt(0);
1361  FLAG.extshutter = 0;
1362  }
1363  //*********************** End Third Measurement ******************
1364  ExeREM = 1;
1365  E_REM();
1366 
1367 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
optionini DOption
Options for DAS execution.
flag FLAG
Definition: Exec.c:28
int plotW
Flag for the plot display.
flag Flag
Structure for different flags.
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
das DAS
Definition: Exec.c:30
void D_Saving(void)
Saving image. Procedure for saving the CCD Image Used since version 2.1.0. The coiche between binary ...
Definition: Procedures.c:1369
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 ExtShutt(int mod)
change the status of the external shutter change the status of the external shutter (OPEN or CLOSED) ...
Definition: Exec.c:1155
Definition: Dildef.h:240
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
int SD_PosOMUDev(int m, int w, int f)
perform the simoultaneous positioning of the Spectrometer Devices in the OMU Unit m = mirror w = wave...
Definition: Spat_Device.c:747
void D_Plot(void)
ViewPlot callback .
Definition: Procedures.c:192
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
void PerformMeas(int mod, int ar, double te, int mt, int sv, int pl)
Perform Averaged or single measurements.
Definition: Exec.c:463
int extshutter
0 = external shutter open; 1 = external shutter closed
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
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:

§ E_Meashor2()

void E_Meashor2 ( void  )

perform horizontal measurements (2) 1) measurement with external lamp 2) measurement without the external lamp (same exposure time than 1)

Definition at line 1370 of file Exec.c.

References D_Plot(), D_Saving(), DB_GetCCD(), das::DOption, E_REM(), ExeREM, ExtShutt(), flag::extshutter, das::Flag, LookforWl_X(), PerformMeas(), flag::plotW, PrgCnt, Program, SD_FilterW(), SD_Grating(), SD_Mirror(), SD_PosOMUDev(), optionini::smposmode, and wl.

Referenced by D_AutoExecution().

1371 {
1372  int er=0;
1373  int l, f, m, a, d, s, g;
1374  double t;
1375  extern struct date dok;
1376  int wl;
1377 
1378  int StsTot = 0;
1379  int StsMir = 0, StsGrat = 0, StsFW = 0;
1380 
1381  // The progression of "PrgCnt" is now in the Fetch function
1382  // PrgCnt += 7;
1383 
1384  sscanf(&Program[PrgCnt], "%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
1385 
1386  l= LookforWl_X(wl);
1387 
1388 
1389  if (DAS.DOption.smposmode)
1390  SD_PosOMUDev(m, l, f);
1391  //SD_Position(m, l, f, 0, 0);
1392  else
1393  {
1394  //mirror positioning
1395  SD_Mirror(m);
1396  //grating positioning
1397  SD_Grating(l);
1398  //filter wheel positioning
1399  SD_FilterW(f);
1400  //Zenith positioning
1401  //SD_Zenith(z);
1402  //Azimuth positioning
1403  //SD_Azimuth(az);
1404  }
1405  ExeREM = 0;
1406  /******************************************************************/
1407  /******************************************************************/
1408 
1409  //*********************** Start First Measurement ******************
1410  PerformMeas(0, a, t, d, s, g);
1411  //*********************** End First Measurement ******************
1412 
1413  //*********************** Start Second Measurement ******************
1414  //Close External Shutter
1415  if (FLAG.extshutter == 0)
1416  {
1417  ExtShutt(0);
1418  FLAG.extshutter = 1;
1419 
1420  }
1421 
1422  //Measure (d=1) or dark (d=0) -
1423  if(d)
1424  {
1425  DB_GetCCD(1);
1426  }
1427  else
1428  {
1429  DB_GetCCD(0);
1430  }
1431 
1432  //
1433  if(s)
1434  {
1435  D_Saving();
1436  }
1437  if(g)
1438  {
1439  if(DAS.Flag.plotW)
1440  D_Plot();
1441  }
1442  //*********************** End Second Measurement ******************
1443 
1444  //*********************** Start Third Measurement ******************
1445 // PerformMeas(0, a, t, d, s, g);
1446 
1447 
1448  //Open External Shutter
1449  if (FLAG.extshutter)
1450  {
1451  ExtShutt(0);
1452  FLAG.extshutter = 0;
1453  }
1454  //*********************** End Third Measurement ******************
1455  ExeREM = 1;
1456  E_REM();
1457 
1458 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
optionini DOption
Options for DAS execution.
flag FLAG
Definition: Exec.c:28
int plotW
Flag for the plot display.
flag Flag
Structure for different flags.
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
das DAS
Definition: Exec.c:30
void D_Saving(void)
Saving image. Procedure for saving the CCD Image Used since version 2.1.0. The coiche between binary ...
Definition: Procedures.c:1369
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 ExtShutt(int mod)
change the status of the external shutter change the status of the external shutter (OPEN or CLOSED) ...
Definition: Exec.c:1155
Definition: Dildef.h:240
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
int SD_PosOMUDev(int m, int w, int f)
perform the simoultaneous positioning of the Spectrometer Devices in the OMU Unit m = mirror w = wave...
Definition: Spat_Device.c:747
void D_Plot(void)
ViewPlot callback .
Definition: Procedures.c:192
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
void PerformMeas(int mod, int ar, double te, int mt, int sv, int pl)
Perform Averaged or single measurements.
Definition: Exec.c:463
int extshutter
0 = external shutter open; 1 = external shutter closed
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
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:

§ E_Measure()

void E_Measure ( void  )

Perform Measurement.
All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 1060 of file Exec.c.

References optionini::avgautor, das::DOption, E_REM(), ExeREM, LookforWl_X(), optionini::measmode, PerformMeas(), PrgCnt, Program, SD_FilterW(), SD_Grating(), SD_Mirror(), SD_PosOMUDev(), optionini::smposmode, and wl.

Referenced by D_AutoExecution().

1061 {
1062  int er=0;
1063  int l, f, m, a, d, s, g;
1064  int wl;
1065  double t;
1066  extern struct date dok;
1067 
1068 
1069  int StsTot = 0;
1070  int StsMir = 0, StsGrat = 0, StsFW = 0;
1071 // The progression of "PrgCnt" is now in the Fetch function
1072 // PrgCnt += 7;
1073 
1074 
1075  sscanf(&Program[PrgCnt], "%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
1076 
1077  l= LookforWl_X(wl);
1078 
1079 
1080  if (DAS.DOption.smposmode)
1081  SD_PosOMUDev(m, l, f);
1082 
1083  //SD_Position(m, l, f, 0, 0);
1084  else
1085  {
1086  //mirror positioning
1087  SD_Mirror(m);
1088  //grating positioning
1089  SD_Grating(l);
1090  //filter wheel positioning
1091  SD_FilterW(f);
1092  //Zenith positioning
1093  //SD_Zenith(z);
1094  //Azimuth positioning
1095  //SD_Azimuth(az);
1096  }
1097 
1098  ExeREM = 0;
1099 
1100  if(DAS.DOption.measmode == 0) //Single
1101  PerformMeas(0, a, t, d, s, g);
1102  if(DAS.DOption.measmode == 1) //AVG
1103  {
1104  if(DAS.DOption.avgautor)
1105  PerformMeas(1, a, t, d, s, g);
1106  else
1107  PerformMeas(2, a, t, d, s, g);
1108 
1109  }
1110 
1111  ExeREM = 1;
1112  E_REM();
1113 
1114 
1115 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
optionini DOption
Options for DAS execution.
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
int avgautor
autoranging for averaged measurement, 0 = NO AutoR before average; 1 = AutoR before average; ...
das DAS
Definition: Exec.c:30
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
Definition: Dildef.h:240
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
int SD_PosOMUDev(int m, int w, int f)
perform the simoultaneous positioning of the Spectrometer Devices in the OMU Unit m = mirror w = wave...
Definition: Spat_Device.c:747
int measmode
measuring mode: 0 = Single; 1 = Averaged
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
void PerformMeas(int mod, int ar, double te, int mt, int sv, int pl)
Perform Averaged or single measurements.
Definition: Exec.c:463
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:

§ E_Mirror()

void E_Mirror ( void  )

Inpot Mirror positioning.
Procedure for Input mirror positioning. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 773 of file Exec.c.

References E_REM(), ExeREM, PrgCnt, Program, and SD_Mirror().

Referenced by D_AutoExecution().

774 {
775  int l;
776 // The progression of "PrgCnt" is now in the Fetch function
777 // PrgCnt += 6;
778  sscanf(&Program[PrgCnt], "%d", &l);
779  ExeREM = 0;
780  SD_Mirror(l);
781  ExeREM = 1;
782  E_REM();
783 }
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
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
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_NDFilter()

void E_NDFilter ( void  )

Set ND Filter.
Set ND Filter All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 429 of file Exec.c.

References E_REM(), ExeREM, PrgCnt, Program, and SD_NDFilterW().

Referenced by D_AutoExecution().

430 {
431 
432  int l;
433  int er=0;
434 // char str[80];
435  sscanf(&Program[PrgCnt], "%d", &l);
436  ExeREM = 0;
437  SD_NDFilterW(l);
438  ExeREM = 1;
439  E_REM();
440 
441 
442 
443 }
int ExeREM
Definition: DAS_Spat.c:143
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
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
int SD_NDFilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2354
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Plot()

void E_Plot ( void  )

Plot Spectrum.
Plot Spectrum. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 237 of file Exec.c.

References E_REM(), ExeREM, and ViewPlot().

Referenced by D_AutoExecution().

238 {
239  ExeREM = 0;
240  ViewPlot(1);
241  ExeREM = 1;
242  E_REM();
243 // delay(3000);
244 }
int ExeREM
Definition: DAS_Spat.c:143
int ViewPlot(int mod)
Create the plot shell. Procedure that build the plot shell for the data visualization.
Definition: Spat_Plot.c:3775
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Qj_Off()

void E_Qj_Off ( void  )

Qj OFF.
QJ - Halogen - lamp OFF. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 271 of file Exec.c.

References E_REM(), ExeREM, and QjLamp().

Referenced by D_AutoExecution(), and E_QjScan().

272 {
273  ExeREM = 0;
274  QjLamp(0);
275  ExeREM = 1;
276  E_REM();
277 
278 }
int ExeREM
Definition: DAS_Spat.c:143
void QjLamp(int mod)
QJ Lamp ON/OFF .
Definition: Spat_Device.c:2724
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Qj_On()

void E_Qj_On ( void  )

Qj ON.
QJ - Halogen - lamp ON. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 263 of file Exec.c.

References E_REM(), ExeREM, and QjLamp().

Referenced by D_AutoExecution(), and E_QjScan().

264 {
265  ExeREM = 0;
266  QjLamp(1);
267  ExeREM = 1;
268  E_REM();
269 
270 }
int ExeREM
Definition: DAS_Spat.c:143
void QjLamp(int mod)
QJ Lamp ON/OFF .
Definition: Spat_Device.c:2724
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_QjScan()

void E_QjScan ( void  )

Check the full spectral range with QJ ON.
All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 1548 of file Exec.c.

References AutoRange(), D_Plot(), DB_GetCCD(), das::DOption, E_Qj_Off(), E_Qj_On(), ExeREM, FDOUBLE, optionini::filtertype, das::Flag, FPLUS, flag::plotW, SaveCalib(), SaveCnt, SD_FilterW(), SD_FNTorqueM(), SD_Grating(), SD_Mirror(), SD_NDFilterW(), and Status().

Referenced by D_AutoExecution().

1549 {
1550  //perform a full scan set of measurement with the QJ lamp
1551 
1552  int l;
1553 
1554  //Switch On QJ Lamp
1555  E_Qj_On();
1556  ExeREM = 0;
1557  //Position Mirror
1558  SD_Mirror(2);
1559 
1560  for (l=1; l<10; l++)
1561  {
1562  //position grating
1563  SD_Grating(l);
1564  // Position Filterwheel
1565  SD_FilterW(0);
1566  if(DAS.DOption.filtertype == FDOUBLE)
1567  SD_NDFilterW(0);
1568  else if(DAS.DOption.filtertype == FPLUS)
1569  SD_FNTorqueM(0);
1570  //autorange
1571  Status("Autoranging...");
1572  AutoRange(0);
1573  Status("Getting CCD Image...");
1574  DB_GetCCD(1);
1575  //Save the Spectrum
1576  SaveCalib(1);
1577 
1578  if(DAS.Flag.plotW)
1579  D_Plot();
1580 
1581 
1582 
1583 
1584  }
1585  E_Qj_Off();
1586 
1587 
1588  SaveCnt++;
1589 
1590  ExeREM = 1;
1591  //E_REM();
1592 
1593 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
int ExeREM
Definition: DAS_Spat.c:143
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
optionini DOption
Options for DAS execution.
void SD_FNTorqueM(int mod)
Positioning NDFilter. .
Definition: Spat_Device.c:3066
int plotW
Flag for the plot display.
int SaveCnt
Definition: Procedures.c:49
flag Flag
Structure for different flags.
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2244
das DAS
Definition: Exec.c:30
void E_Qj_On(void)
Qj ON. QJ - Halogen - lamp ON. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:263
#define FDOUBLE
double filter wheel
#define FPLUS
Filter Wheel Torque Motor.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void SaveCalib(int mod)
Definition: Procedures.c:2130
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
Definition: Procedures.c:899
void D_Plot(void)
ViewPlot callback .
Definition: Procedures.c:192
int SD_NDFilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
Definition: Spat_Device.c:2354
void E_Qj_Off(void)
Qj OFF. QJ - Halogen - lamp OFF. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:271
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Radio()

void E_Radio ( void  )

Radiometric Measurements.
Procedure for Radiometric Measurements. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 684 of file Exec.c.

References E_REM(), ExeREM, p, PrgCnt, and Program.

Referenced by D_AutoExecution().

685 {
686  int l, f, p, m, a, d, s, g;
687  double t;
688 // PrgCnt += 7;
689 
690  sscanf(&Program[PrgCnt], "%d%d%d%d%d%lf%d%d%d", &l, &f, &p, &m, &a, &t, &d, &s, &g);
691 
692  E_REM();
693 
694 // Grating(l);
695 // FW(f);
696 // Polarizer(p);
697 
698  ExeREM = 0;
699 // Radio(g);
700  ExeREM = 1;
701 
702 }
int ExeREM
Definition: DAS_Spat.c:143
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
static double p
Definition: SOLPOS.C:131
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_REM()

void E_REM ( void  )

Flush string since the Carriege Return.
Procedure for flushing the readed string since the Carriege Return. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 47 of file Exec.c.

References ExeREM, PrgCnt, and Program.

Referenced by D_AutoExecution(), D_Measure(), E_AAMeasure(), E_AAPos(), E_Almucantar(), E_AutoRange(), E_Average(), E_AvgCCDHor(), E_Azimuth(), E_Calibra(), E_ChkExLamp(), E_Dark(), E_DFMeasure(), E_DirectSun(), E_Expo(), E_ExtLampOFF(), E_ExtLampON(), E_ExtShutClose(), E_ExtShutOpen(), E_Filter(), E_GetCCD(), E_Hg_Off(), E_Hg_On(), E_Home_SM1(), E_Home_SM2(), E_Home_SM3(), E_Home_SM4(), E_Home_SM5(), E_Home_SM6(), E_IRefSun(), E_Label(), E_Lambda(), E_Meashor(), E_Meashor2(), E_Measure(), E_Mirror(), E_NDFilter(), E_Plot(), E_Qj_Off(), E_Qj_On(), E_Radio(), E_Save(), E_SetCCDOffSet(), E_SetCCDPow(), E_SetCCDTemp(), E_SetCCDVBin(), E_WAIT(), and E_Zenith().

48 {
49  // Flush stringa
50  if(ExeREM)
51  while(Program[PrgCnt++] != 10);
52 }
int ExeREM
Definition: DAS_Spat.c:143
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

§ E_Save()

void E_Save ( void  )

Save Image.
Procedure for saving image or data. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 355 of file Exec.c.

References D_Saving(), E_REM(), and ExeREM.

Referenced by D_AutoExecution(), and Radio().

356 {
357 
358  ExeREM = 0;
359  D_Saving();
360  ExeREM = 1;
361  E_REM();
362 
363 }
int ExeREM
Definition: DAS_Spat.c:143
void D_Saving(void)
Saving image. Procedure for saving the CCD Image Used since version 2.1.0. The coiche between binary ...
Definition: Procedures.c:1369
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_SetCCDOffSet()

void E_SetCCDOffSet ( void  )

Set the CCD Offst (only for HIRES-V.
All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 394 of file Exec.c.

References DC_SetUsrGain(), E_REM(), das::Marconi, marconi::Offset, PrgCnt, Program, and Status().

Referenced by D_AutoExecution().

395 {
396 
397  int os;
398  int er=0;
399 // char str[80];
400  sscanf(&Program[PrgCnt], "%d", &os);
401  Status("CCD OffSet");
402  DAS.Marconi.Offset = os;
403  DC_SetUsrGain(0, 0 , DAS.Marconi.Offset , 0);
404 
405  E_REM();
406 
407 
408 }
das DAS
Definition: Exec.c:30
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
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
CTYPE void DLL DC_SetUsrGain(int Gain, int Range, int Offset, int Camera)
Procedure that allows you to set the ccd gain. Procedure that allows you to set the ccd gain...
marconi Marconi
CCD Sensor struct.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_SetCCDPow()

void E_SetCCDPow ( void  )

Set CCD Power.
Set CCD Power. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 411 of file Exec.c.

References gui::ContrPanel, paramini::CoolPw, E_REM(), das::Gui, controlpanel::lbl_Par, MObjectSetText(), das::Paramini, PrgCnt, Program, omuthr::ReachTemp, and Status().

Referenced by D_AutoExecution().

412 {
413 
414  int l;
415  int er=0;
416  char str[80];
417  sscanf(&Program[PrgCnt], "%d", &l);
418  Status("CCD Temperature");
419  DAS.Paramini.CoolPw = l;
420  OMUTHR.ReachTemp = 0;
421  sprintf(str,"%.1lf%%",(double)DAS.Paramini.CoolPw / 10);
423  E_REM();
424 
425 
426 }
gui Gui
Graphic User Interface Structure.
omuthr OMUTHR
Definition: Exec.c:29
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
void MObjectSetText(MOBJECT obj, const char *text)
das DAS
Definition: Exec.c:30
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 CoolPw
CCD Init Power.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
controlpanel ContrPanel
Control Panel Structure.
int ReachTemp
Target Temperature status.
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:

§ E_SetCCDTemp()

void E_SetCCDTemp ( void  )

Set CCD Temp.
Set CCD Temp. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 375 of file Exec.c.

References gui::ContrPanel, DB_InitCamera(), E_REM(), das::Gui, paramini::ITemp, controlpanel::lbl_Par, MObjectSetText(), das::Paramini, PrgCnt, Program, omuthr::ReachTemp, and Status().

Referenced by D_AutoExecution().

376 {
377 
378  double l;
379  int er=0;
380  char str[80];
381  sscanf(&Program[PrgCnt], "%lf", &l);
382  Status("CCD Temperature");
383  DAS.Paramini.ITemp = l;
384  OMUTHR.ReachTemp = 0;
385  sprintf(str, "%.1lf", DAS.Paramini.ITemp);
387 
388  er = DB_InitCamera(1);
389  E_REM();
390 
391 
392 }
gui Gui
Graphic User Interface Structure.
int DB_InitCamera(int mod)
Initialize Camera Parameters. Procedure that initialize the CCD Camera.
Definition: Init.c:170
omuthr OMUTHR
Definition: Exec.c:29
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
void MObjectSetText(MOBJECT obj, const char *text)
das DAS
Definition: Exec.c:30
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
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
controlpanel ContrPanel
Control Panel Structure.
double ITemp
CCD Target Temperature.
int ReachTemp
Target Temperature status.
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:

§ E_SetCCDVBin()

void E_SetCCDVBin ( void  )

Set CCD Vert Binn.
Set CCD Vert Binn. All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 446 of file Exec.c.

References DB_InitCamera(), E_REM(), das::Paramini, PrgCnt, Program, Status(), and paramini::VBin.

Referenced by D_AutoExecution().

447 {
448 
449  int d, er = 0;
450  sscanf(&Program[PrgCnt], "%d", &d);
451  Status("CCD Vertical Binning");
452  DAS.Paramini.VBin = d;
453  er = DB_InitCamera(1);
454  E_REM();
455 
456 
457 
458 }
int DB_InitCamera(int mod)
Initialize Camera Parameters. Procedure that initialize the CCD Camera.
Definition: Init.c:170
das DAS
Definition: Exec.c:30
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 VBin
CCD Vertical Binning.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
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:

§ E_WAIT()

void E_WAIT ( void  )

Delay Procedure.
sleep the program . All the E_xxxxx() function are used during the execution in PRG mode.

Definition at line 731 of file Exec.c.

References E_REM(), MLoopWhileEvents(), PrgCnt, and Program.

Referenced by D_AutoExecution().

732 {
733  unsigned l, c;
734 // The progression of "PrgCnt" is now in the Fetch function
735 // PrgCnt += 4;
736  sscanf(&Program[PrgCnt], "%u", &l);
737 
738  for(c = 0; c < l / 100; c++)
739  {
740  Sleep(100);
741  MLoopWhileEvents(0);
742  }
743  E_REM();
744 }
void MLoopWhileEvents(int discard)
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
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Zenith()

void E_Zenith ( void  )

Position Zenith Axis.

Definition at line 1461 of file Exec.c.

References E_REM(), ExeREM, PrgCnt, Program, and SD_Zenith().

Referenced by D_AutoExecution().

1462 {
1463  double l;
1464  sscanf(&Program[PrgCnt], "%lf", &l);
1465  ExeREM = 0;
1466  l = (float) l;
1467  SD_Zenith((float)l);
1468 
1469  ExeREM = 1;
1470  E_REM();
1471 }
int ExeREM
Definition: DAS_Spat.c:143
int SD_Zenith(float ang)
Positioning Zenith. The Zenith reaches the position specified by ang.
Definition: Spat_Device.c:2916
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
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
Definition: Exec.c:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ EquipCode2Name()

char* EquipCode2Name ( int  eqcode,
char *  src,
char *  dest 
)

translate the Equipment Code in the Equipment Name

Parameters
inteqcode = /ref eqtype
char*src = source string (buffer) (can be an empty string: "")
char*dest = destination string (buffer) defined in the calling code (i.e.: dest[32] = {'\0'})
Returns
dest

Definition at line 3163 of file DAS_Spat_ConfCBs.c.

References GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, LIS_, SPATRAM, SPATRAM2, SPATRAM3, SPATRAMPLUS, and TROPOGAS.

3164 {
3165 
3166  char str[32];
3167 
3168  switch (eqcode)
3169  {
3170  case TROPOGAS:
3171  sprintf(str,"TROPOGAS");
3172  break;
3173  case SPATRAM:
3174  sprintf(str,"SPATRAM");
3175  break;
3176  case LIS_:
3177  sprintf(str,"LIS");
3178  break;
3179  case SPATRAMPLUS:
3180  sprintf(str,"SPATRAMPLUS");
3181  break;
3182  case GASCODNG1:
3183  sprintf(str,"GASCODNG1");
3184  break;
3185  case GASCODNG2:
3186  sprintf(str,"GASCODNG2");
3187  break;
3188  case GASCODNG3:
3189  sprintf(str,"GASCODNG3");
3190  break;
3191  case GASCODNG4:
3192  sprintf(str,"GASCODNG4");
3193  break;
3194  case SPATRAM2:
3195  sprintf(str,"SPATRAM2");
3196  break;
3197  case SPATRAM3:
3198  sprintf(str,"SPATRAM3");
3199  break;
3200 
3201  default:
3202  sprintf(str,"UNKNOWN");
3203  break;
3204  }
3205 
3206  strcat(dest,str);
3207  return dest;
3208 
3209  }
#define SPATRAM
SPectrometer for Atmospheric TRAcers Measurements - CGE-UE Portugal.
#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.
#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.

§ ERR_Option()

char * ERR_Option ( int  ercode)

Alerts for OPTION.INI errors
Creates a message window reporting the reasons for the error.

Parameters
ercode= code of the error

Definition at line 325 of file Load.c.

Referenced by MGUIMain().

326 {
327  static char *erroption[] = {{"NULL"},
328  {"File OPTION.INI Not Found"},
329  {"Error in Saving Mode Option"},
330  {"Error in File Name Option"},
331  {"Error in Image Type Option"},
332  {"Error in Pixel Correction Option"},
333  {"Error in Averaging Mode Option"},
334  {"Error in Fixed Number of Measurement for Average Option"},
335  {"Error in Total Exposure Time for Average Option"},
336  {"Error in Dark Remove Option"},
337  {"Error in Dark Source Option"},
338  {"Error in Set CCD Temperature Flag"},
339  {"Error in Plot Scale Flag"},
340  {"Error in Plot Display Flag"},
341  {"Error in Plot Y Scale Flag"},
342  {"Error in SZAMax Parameter"},
343  {"Error in Hidden Lines in Plot Before the Central one Option"},
344  {"Error in Hidden Lines in Plot After the Central one Option"},
345  {"Error in Display Blind Pixel Flag"},
346  {"Error in Perform FTP Back-UP Option"},
347  {"Error in Reference temperature for OMU Thermo-Regulation Option"},
348  {"Error in OMU Thermo-Regulation mode"},
349  {"Error in Mirroring CCD Image along X axis Option"},
350  {"Error in Mirroring CCD Image along Y axis Option"},
351  {"Error in AMS Option - Stepper motor Positioning mode"},
352  {"Error in AMS Option - Display Progression Bars"},
353  {"Error in Autorange before Average Option"},
354  {"Error in MIGE Linked Parameter"},
355  {"Error in MIGE Type Parameter"},
356  {"Error in MIGE Operating mode Option"},
357  {"Error in Shutter Connection Option"},
358  {"Error in Shutter Type Option"},
359  {"Error in DeltaSZA Flag"},
360  {"Error in DeltaSZA Value"},
361  {"Error: MinSZA < 0"},
362  {"Error: MaxSZA < 0 "},
363  {"Error: MinSZA > MaxSZA Value"},
364  {"Error in the Defective pixel file"}};
365 
366  return erroption[ercode];
367 
368 }
+ Here is the caller graph for this function:

§ ExitCB()

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

Definition at line 80 of file DOAS_FullProj.c.

References MGUITerm().

Referenced by MDCreateDOAS_MainSh().

81 {
82 
83  MGUITerm();
84 
85 }
void MGUITerm(void)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ExtLamp()

int ExtLamp ( int  mod)

change the status of the external lamp change the status of the external lamp (ON or OFF) through a radio signal controlled by the AMS output port (bit 7) NOTE - This feature is not used!!!!!!

Definition at line 1117 of file Exec.c.

References AMS1, AMS_wopto(), delay(), stepm::OOP, and das::StepM.

Referenced by DB_HorComm_CB(), E_ExtLampOFF(), and E_ExtLampON().

1118 {
1119 
1120  unsigned long t = 1000;
1121 
1122  DAS.StepM.OOP[AMS1] |= 0x80; //bit 7, 10000000, dec = 128
1123 
1124 
1125  // 1's complement
1126  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
1127  //write on the optoinsulated port
1129  // again 1's complement for restoring the positive logic
1130  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
1131 
1132  delay(t);
1133 
1134  DAS.StepM.OOP[AMS1] &= 0x7F; // 01111111, dec = 127
1135 
1136  // 1's complement
1137  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
1138  //write on the optoinsulated port
1140  // again 1's complement for restoring the positive logic
1141  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
1142 
1143 
1144 
1145  delay(t);
1146 
1147 
1148  return 0;
1149 
1150 }
stepm StepM
Stepper motors parameters structure.
das DAS
Definition: Exec.c:30
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
int AMS_wopto(int id, unsigned int w)
write the value on the optoinsulated port write the value on the optoinsulated port.
Definition: Dxl.c:911
#define AMS1
AMS1 address.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ExtShutt()

int ExtShutt ( int  mod)

change the status of the external shutter change the status of the external shutter (OPEN or CLOSED) through a radio signal controlled by the AMS output port (bit 6)

Definition at line 1155 of file Exec.c.

References AMS1, AMS2, AMS_wopto(), delay(), paramini::EqType, MMessageDialog(), stepm::OOP, das::Paramini, SPATRAM2, das::StepM, and TROPOGAS.

Referenced by DB_HorComm_CB(), E_AvgCCDHor(), E_ChkExLamp(), E_ExtShutClose(), E_ExtShutOpen(), E_Meashor(), and E_Meashor2().

1156 {
1157 
1158  unsigned long t = 500;
1159  char buf[256];
1160  int er = 0;
1161 
1162  if(DAS.Paramini.EqType == TROPOGAS )
1163  {
1164  DAS.StepM.OOP[AMS2] |= 0x40; //bit 6, 01000000, dec = 64
1165 
1166  // 1's complement
1167  DAS.StepM.OOP[AMS2] = ~DAS.StepM.OOP[AMS2];
1168  //write on the optoinsulated port
1170  // again 1's complement for restoring the positive logic
1171  DAS.StepM.OOP[AMS2] = ~DAS.StepM.OOP[AMS2];
1172 
1173  delay(t);
1174 
1175  DAS.StepM.OOP[AMS2] &= 0xBF; // 10111111, dec = 191
1176 
1177  // 1's complement
1178  DAS.StepM.OOP[AMS2] = ~DAS.StepM.OOP[AMS2];
1179  //write on the optoinsulated port
1181  // again 1's complement for restoring the positive logic
1182  DAS.StepM.OOP[AMS2] = ~DAS.StepM.OOP[AMS2];
1183 
1184  //delay(t);
1185 
1186  }
1187  else if(DAS.Paramini.EqType == SPATRAM2)
1188  {
1189  DAS.StepM.OOP[AMS1] |= 0x40; //bit 6, 01000000, dec = 64
1190 
1191 
1192  // 1's complement
1193  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
1194  //write on the optoinsulated port
1196  // again 1's complement for restoring the positive logic
1197  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
1198 
1199  delay(t);
1200 
1201  DAS.StepM.OOP[AMS1] &= 0xBF; // 10111111, dec = 191
1202 
1203 
1204  // 1's complement
1205  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
1206  //write on the optoinsulated port
1208  // again 1's complement for restoring the positive logic
1209  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
1210 
1211  //delay(t);
1212  }
1213  else
1214  {
1215  sprintf(buf, "For this Equipment the AMS is UNKNOWN\nPlease Contact DANBO!!!!");
1216  er = MMessageDialog("DAS information", buf, "Ok", NULL);
1217  if (!er)
1218  return 1;
1219 
1220  }
1221  return 0;
1222 
1223 }
stepm StepM
Stepper motors parameters structure.
#define AMS2
AMS2 address.
das DAS
Definition: Exec.c:30
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
#define SPATRAM2
SPATRAM2 (with ATX power supply & HiresV)
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,...)
int AMS_wopto(int id, unsigned int w)
write the value on the optoinsulated port write the value on the optoinsulated port.
Definition: Dxl.c:911
#define AMS1
AMS1 address.
int EqType
Spectrometer Type.
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:

§ FANECU()

void FANECU ( int  mod)

FAN ON/OFF
.

Parameters
mod
  • = 0 –> FAN OFF
  • = 1 –> FAN ON

Definition at line 2619 of file Spat_Device.c.

References AMS3, AMS_wopto(), delay(), das::Gui, pushbutt::KeyB, MObjectSetText(), stepm::OOP, gui::PushButt, and das::StepM.

Referenced by DB_KeyB_CB(), and Task_LIS_Temp().

2620 {
2621 
2622  unsigned long t = 500;
2623 // char buf[256];
2624  int er = 0;
2625 
2626 
2627  if(mod)
2628  {
2629  DAS.StepM.OOP[AMS3] |= 0x02; //bit 1, 00000010
2630  MObjectSetText(DAS.Gui.PushButt.KeyB[6], "F ECU On");
2631  }
2632  else
2633  {
2634  DAS.StepM.OOP[AMS3] &= 0xFD; //11111101
2635  MObjectSetText(DAS.Gui.PushButt.KeyB[6], "F ECU Off");
2636  }
2637 
2638  // 1's complement
2639  DAS.StepM.OOP[AMS3] = ~DAS.StepM.OOP[AMS3];
2640  //write on the optoinsulated port
2642  delay(100);
2643  // again 1's complement for restoring the positive logic
2644  DAS.StepM.OOP[AMS3] = ~DAS.StepM.OOP[AMS3];
2645 
2646 
2647 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
MOBJECT KeyB[28]
Keyboard Buttons.
void MObjectSetText(MOBJECT obj, const char *text)
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
pushbutt PushButt
Push buttons.
int AMS_wopto(int id, unsigned int w)
write the value on the optoinsulated port write the value on the optoinsulated port.
Definition: Dxl.c:911
#define AMS3
AMS3 address.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ FANPeltier()

void FANPeltier ( int  mod)

FAN ON/OFF
.

Parameters
mod
  • = 0 –> FAN OFF
  • = 1 –> FAN ON

Definition at line 2652 of file Spat_Device.c.

References AMS1, AMS_wopto(), delay(), stepm::OOP, and das::StepM.

Referenced by ADTesterCB(), OMU_ChooseDir(), and ShutCB().

2653 {
2654 
2655  if(mod)
2656  DAS.StepM.OOP[AMS1] |= 0x02; //bit 1, 00000010
2657  else
2658  DAS.StepM.OOP[AMS1] &= 0xFD; //11111101
2659 
2660 
2661  // 1's complement
2662  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2663  //write on the optoinsulated port
2664  //delay(500);
2666  delay(750);
2667  // again 1's complement for restoring the positive logic
2668  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2669 
2670 
2671 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
int AMS_wopto(int id, unsigned int w)
write the value on the optoinsulated port write the value on the optoinsulated port.
Definition: Dxl.c:911
#define AMS1
AMS1 address.
+ 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:

§ FilterCB()

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

Definition at line 160 of file DOAS_FullProj.c.

References MDCreateFormat_Sh().

Referenced by MDCreateDOAS_MainSh().

161 {
163 }
MOBJECT MDCreateFormat_Sh(int mod)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ FixStepCB()

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

Definition at line 115 of file DOAS_FullProj.c.

References MDCreateFixed_Sh().

Referenced by MDCreateDOAS_MainSh().

116 {
117 
118  MDCreateFixed_Sh(0);
119 
120 }
MOBJECT MDCreateFixed_Sh(int mod)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ FlushLine()

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) =line feed =LF.

Definition at line 54 of file Load.c.

References ch.

Referenced by LoadAMS(), LoadDasSysCol(), LoadDB_DispCoeff(), LoadDB_Options(), LoadEquipment(), LoadFTPSetting(), LoadParam(), and LoadWlstep().

55 {
56  int t = 0;
57  unsigned char ch;
58  do
59  {
60  buf[t] = (unsigned char)ch;
61  ch = getc(f);
62  t++;
63  }while (ch != 10);
64 
65 }
static double ch
Definition: SOLPOS.C:120
+ Here is the caller graph for this function:

§ FontOBJSelCB()

void FontOBJSelCB ( MOBJECT  obj,
void *  a,
void *  v 
)

This callback select the object for applying font.

Definition at line 1385 of file DAS_Spat_ConfCBs.c.

References FlgOBJ.

Referenced by MDCreateDASConfig().

1386 {
1387 //sceglie l'oggetto da considerare label, buttons....
1388 
1389  switch ((int) v)
1390  {
1391  case 0:
1392  FlgOBJ=0; //Unselected KeyCom
1393  break;
1394  case 1:
1395  FlgOBJ=1; //Selected KeyCom
1396  break;
1397  case 2:
1398  FlgOBJ=2; //Active Labels
1399  break;
1400  case 3:
1401  FlgOBJ=3; //Passive Labels
1402  break;
1403  case 4:
1404  FlgOBJ=4; //Forms Background
1405  break;
1406  case 5:
1407  FlgOBJ=5; //Kapital Labels UP
1408  break;
1409  case 6:
1410  FlgOBJ=6; //Kapital Labels DW
1411  break;
1412  }
1413 }
int FlgOBJ
Definition: DAS_Spat_Conf.c:93
+ Here is the caller graph for this function:

§ FormatData()

void FormatData ( void  )

trasform mm/gg/aa in gg/mm/aa

Definition at line 45 of file RTC_Time.c.

References ddmmyy.

46 {
47  int k, x, i;
48  char datebuf[9];
49  char dday[2], dmonth[2], dyear[2];
50 
51 
52  _strdate(datebuf);
53  k = 0;
54  x = 0;
55  for(i = 0; i < 9; i++)
56  {
57  if(i<2)
58  {
59  dmonth[i] = datebuf[i];
60  }
61 
62  if(i > 2 && i < 5)
63  {
64  dday[k] = datebuf[i];
65  k++;
66  }
67  if(i > 5 && i < 8)
68  {
69  dyear[x] = datebuf[i];
70  x++;
71  }
72  }
73  sprintf(ddmmyy,"%c%c/%c%c/%c%c", dday[0],dday[1],dmonth[0],dmonth[1],dyear[0],dyear[1]);
74 }
char ddmmyy[8]
Definition: RTC_Time.c:38

§ fraz2val()

int fraz2val ( int  mod,
char *  val 
)

ratio value to decimal value
opposite than listval2fraz or val2fraz

Parameters
modNOT USED (0)
valsring indicating the ratio

Definition at line 2435 of file DAS_Spat_ConfCBs.c.

Referenced by ApplyChCB(), and WriteAMSCB().

2436 {
2437 
2438  int b = 0;
2439 
2440  if(strcmp( val, " 1/2") == 0)
2441  b = 0;
2442  if(strcmp( val, " 1/4") == 0)
2443  b = 1;
2444  if(strcmp( val, " 1/5") == 0)
2445  b = 2;
2446  if(strcmp( val, " 1/8") == 0)
2447  b = 3;
2448  if(strcmp( val, " 1/10") == 0)
2449  b = 4;
2450  if(strcmp( val, " 1/16") == 0)
2451  b = 5;
2452  if(strcmp( val, " 1/25") == 0)
2453  b = 6;
2454  if(strcmp( val, " 1/32") == 0)
2455  b = 7;
2456  if(strcmp( val, " 1/50") == 0)
2457  b = 8;
2458  if(strcmp( val, " 1/64") == 0)
2459  b = 9;
2460  if(strcmp( val, "1/125") == 0)
2461  b = 10;
2462  if(strcmp( val, "1/128") == 0)
2463  b = 11;
2464  if(strcmp( val, "1/250") == 0)
2465  b = 12;
2466  if(strcmp( val, "1/256") == 0)
2467  b = 13;
2468 
2469  return b;
2470 
2471 
2472 
2473 }
+ Here is the caller graph for this function:

§ getdate()

void getdate ( struct date tp)

get current date

Definition at line 131 of file Save.c.

References date::da_day, date::da_mon, and date::da_year.

132 {
133  time_t now;
134  struct tm w;
135 
136  time(&now);
137  w = *localtime(&now);
138  tp->da_day = w.tm_mday;
139  tp->da_mon = w.tm_mon + 1;
140  tp->da_year = w.tm_year + 1900;
141 }
U8 da_mon
Definition: Dildef.h:243
S16 da_year
Definition: Dildef.h:241
U8 da_day
Definition: Dildef.h:242
Definition: Dildef.h:234

§ GetDateTime()

void GetDateTime ( struct date dp,
struct time tp,
struct tm *  when 
)

Definition at line 43 of file Save.c.

References date::da_day, date::da_mon, date::da_year, time::ti_hour, time::ti_hund, time::ti_min, and time::ti_sec.

Referenced by AutoR_No_Shutt(), AutoR_With_Shutt(), ChkMaster(), D_AutoExecution(), DB_GetCCD(), DB_Save(), E_Dark(), GetDefPix(), MGUIMain(), SetWindowsReset(), SZA_FirstCalc(), Task_LOG(), Task_Timer(), WinRes(), WriteAMSCB(), WriteOptioniniCB(), WriteParaminiCB(), and WritewlstepiniCB().

44 {
45 
46  time_t now;
47  struct tm w;
48 
49  time(&now);
50 
51  //This code retrive the PC clock time as it is
52  //(with or without the daylight saving time setted)
53  w = *localtime(&now);
54 
55  //This code retrive the PC clock and check if the daylight
56  //saving time is setted or not
57  //the time stored in the Header of the measurement is always the LST (Local Solar Time)
58  /**************************************************************/
59  // Check if daylight saving time is in effect
60  // tm_isdst > 0 if daylight saving time is in effect
61  // tm_isdst = 0 if daylight saving time is not in effect
62  // tm_isdst < 0 if status of daylight saving time is unknown.
63  if (w.tm_isdst)
64  {
65  now = now - 3600; // 1 hour less
66  w = *localtime( &now );
67 
68  }
69  //Time for Header of Measurement (Local Solar Time)
70  tp->ti_sec = w.tm_sec;
71  tp->ti_min = w.tm_min;
72  tp->ti_hour = w.tm_hour;
73  tp->ti_hund = 0;
74 
75  //Date for Header of Measurement
76  dp->da_day = w.tm_mday;
77  dp->da_mon = w.tm_mon + 1;
78  dp->da_year = w.tm_year + 1900;
79 
80  when -> tm_sec = w.tm_sec; /* seconds after the minute - [0,59] */
81  when -> tm_min = w.tm_min; /* minutes after the hour - [0,59] */
82  when -> tm_hour = w.tm_hour; /* hours since midnight - [0,23] */
83  when -> tm_mday = w.tm_mday; /* day of the month - [1,31] */
84  when -> tm_mon = w.tm_mon; /* months since January - [0,11] */
85  when -> tm_year = w.tm_year; /* years since 1900 */
86  when -> tm_wday = w.tm_wday; /* days since Sunday - [0,6] */
87  when -> tm_yday = w.tm_yday; /* days since January 1 - [0,365] */
88  when -> tm_isdst = w.tm_isdst; /* daylight savings time flag */
89 
90 }
U8 da_mon
Definition: Dildef.h:243
U8 ti_sec
Definition: Dildef.h:238
S16 da_year
Definition: Dildef.h:241
U8 da_day
Definition: Dildef.h:242
U8 ti_hour
Definition: Dildef.h:236
U8 ti_hund
Definition: Dildef.h:237
U8 ti_min
Definition: Dildef.h:235
Definition: Dildef.h:234
+ Here is the caller graph for this function:

§ GetDefPix()

int GetDefPix ( int  mod)

Maps the defective pixel.

Parameters
mod
  • 0 –> UNDER exposed pixels
  • 1 –> OVER exposed pixels
Returns
0

Definition at line 3755 of file DAS_Spat_ConfCBs.c.

References _MAX_PATH, AutoRange(), d_fileman::CONFIGDIREQUIPMENT, D_Saving(), date::da_day, date::da_mon, date::da_year, DB_GetCCD(), bil::DFILEM, bil::DPLOT, GetDateTime(), IDX, IDY, img::Imat, d_view::ImatGraf, dil::Img, LevelDefPix, image::Mat, MMessageDialog(), print2file(), QjLamp(), SD_Mirror(), Server, TExp, time::ti_hour, and time::ti_min.

Referenced by MAPDefPixCB().

3756 {
3757 
3758 
3759  FILE *fs;
3760  char str[80];
3761  char buff[_MAX_PATH];
3762  int i, t, j;
3763  unsigned int mx;
3764  unsigned short temp, *matdefpix;
3765  struct time adesso;
3766  struct date oggi;
3767  struct tm today;
3768  int NumOverExP = 0;
3769  int NumUnderExP = 0;
3770 
3771 
3772  GetDateTime(&oggi, &adesso, &today);
3773  //gettime(&adesso);
3774  //getdate(&oggi);
3775 
3776 
3777  if (mod ==1)
3778  {
3779  sprintf(buff, "%s\\OverExpPix.dat", BIL.DFILEM.CONFIGDIREQUIPMENT);
3780 
3781  fs = fopen(buff, "w");
3782  if(fs == NULL) return 1;
3783 
3784  sprintf(str, "DREM #######################################################\n");
3785  fprintf(fs,str,NULL);
3786  sprintf(str, "DREM # OVER EXPOSED DEFECTIVE PIXELS: #\n");
3787  fprintf(fs,str);
3788  sprintf(str, "DREM # by DanBo %02u/%02u/%d at %02u:%02u:%02u #\n", oggi.da_day,oggi.da_mon,oggi.da_year, adesso.ti_hour, adesso.ti_min,adesso.ti_min);
3789  fprintf(fs,str);
3790  sprintf(str, "DREM #######################################################\n");
3791  fprintf(fs,str,NULL);
3792  fclose(fs);
3793 
3794 
3795  }
3796  if (mod == 0)
3797  {
3798  sprintf(buff, "%s\\UnderExpPix.dat", BIL.DFILEM.CONFIGDIREQUIPMENT);
3799 
3800  fs = fopen(buff, "w");
3801  if(fs == NULL) return 1;
3802 
3803  sprintf(str, "DREM #######################################################\n");
3804  fprintf(fs,str,NULL);
3805  sprintf(str, "DREM # UNDER EXPOSED DEFECTIVE PIXELS: #\n");
3806  fprintf(fs,str);
3807  sprintf(str, "DREM # by DanBo %02u/%02u/%d at %02u:%02u:%02u #\n", oggi.da_day,oggi.da_mon,oggi.da_year, adesso.ti_hour, adesso.ti_min,adesso.ti_min);
3808  fprintf(fs,str);
3809  sprintf(str, "DREM #######################################################\n");
3810  fprintf(fs,str,NULL);
3811 
3812  fclose(fs);
3813 
3814  }
3815  if (mod == 2)
3816  {
3817  sprintf(buff, "%s\\OverExpPix5.dat", BIL.DFILEM.CONFIGDIREQUIPMENT);
3818 
3819  fs = fopen(buff, "w");
3820  if(fs == NULL) return 1;
3821 
3822  sprintf(str, "DREM #######################################################\n");
3823  fprintf(fs,str,NULL);
3824  sprintf(str, "DREM # OVER EXPOSED DEFECTIVE PIXELS: #\n");
3825  fprintf(fs,str);
3826  sprintf(str, "DREM # by DanBo %02u/%02u/%d at %02u:%02u:%02u #\n", oggi.da_day,oggi.da_mon,oggi.da_year, adesso.ti_hour, adesso.ti_min,adesso.ti_min);
3827  fprintf(fs,str);
3828  sprintf(str, "DREM #######################################################\n");
3829  fprintf(fs,str,NULL);
3830  fclose(fs);
3831 
3832 
3833  }
3834 
3835 
3836  if (IDX != 0)
3837  {
3838  mx = (unsigned long) IDX * (unsigned long) IDY;
3839  BIL.DPLOT.ImatGraf = (unsigned short *) calloc( mx, sizeof(unsigned short));
3840 
3841  mx = (unsigned long) IDX * (unsigned long) IDY;
3842  matdefpix = (unsigned short *) calloc( mx, sizeof(unsigned short));
3843 
3844  }
3845  else
3846  {
3847  MMessageDialog("ALERT", "CCD Not Initialized" , "Ok", NULL);
3848  return 1;
3849 
3850  }
3851 
3852  if (mod == 1)
3853  {
3854  TExp = 0;
3855  for (i= 0; i<3; i++)
3856  DB_GetCCD(0);
3857  }
3858  if (mod == 0)
3859  {
3860  TExp = 0;
3861  DB_GetCCD(0);
3862  QjLamp(1);
3863  SD_Mirror(2);
3864  AutoRange(0);
3865  DB_GetCCD(1);
3866  }
3867 
3868  if (mod == 2)
3869  {
3870  TExp = 5;
3871  for (i= 0; i<3; i++)
3872  DB_GetCCD(0);
3873  }
3874 
3875 
3876  for(t = 0 ; t < IDY ; t++)
3877  {
3878  for(j = 0; j < IDX; j++)
3879  {
3880  if(DIL.Img.Mat[Server].Imat[t * IDX + j] > LevelDefPix)
3881  {
3882  NumOverExP++;
3883  //NumUnderExP++;
3884  }
3885  else
3886  {
3887  NumUnderExP++;
3888  //NumOverExP++;
3889  }
3890 
3891  }
3892  }
3893 
3894  fs = fopen(buff, "a");
3895  if(fs == NULL) return 1;
3896 
3897 
3898  if (mod==1 || mod==2)
3899  {
3900 
3901  sprintf(str, "DREM Start of pixel section\n");
3902  fprintf(fs,str);
3903  sprintf(str, "PIX\n");
3904  fprintf(fs,str);
3905  sprintf(str, "DREM Number of items of pixel correction\n");
3906  fprintf(fs,str);
3907  sprintf(str, "PITM %d\n", NumOverExP);
3908  fprintf(fs,str);
3909  }
3910 
3911  if (mod==0)
3912  {
3913 
3914  sprintf(str, "DREM Start of pixel section\n");
3915  fprintf(fs,str);
3916  sprintf(str, "PIX\n");
3917  fprintf(fs,str);
3918  sprintf(str, "DREM Number of items of pixel correction\n");
3919  fprintf(fs,str);
3920  sprintf(str, "PITM %d\n", NumUnderExP);
3921  fprintf(fs,str);
3922  }
3923 
3924  for(t = 0 ; t < IDY ; t++)
3925  {
3926  for(j = 0; j < IDX; j++)
3927  {
3928 
3929 
3930  if (mod==1 || mod==2)
3931  {
3932  if(DIL.Img.Mat[Server].Imat[t * IDX + j] >= LevelDefPix)
3933  {
3934  temp = 100;
3935  matdefpix[t * IDX + j] = temp;
3936  print2file(fs, j, t,DIL.Img.Mat[Server].Imat[t * IDX + j]);
3937  }
3938  }
3939 
3940  if (mod==0)
3941  {
3942  if(DIL.Img.Mat[Server].Imat[t * IDX + j] < LevelDefPix)
3943  {
3944  temp = 100;
3945  matdefpix[t * IDX + j] = temp;
3946  print2file(fs, j, t,DIL.Img.Mat[Server].Imat[t * IDX + j]);
3947  }
3948  }
3949  BIL.DPLOT.ImatGraf[t * IDX + j] = temp;
3950 
3951  }
3952  }
3953 /*
3954  if(DIL.Img.Mat[Server].Imat[t * IDX + j] < LevelDefPix)
3955  {
3956  temp = 100;
3957  matdefpix[t * IDX + j] = temp;
3958  if (mod==1 || mod==2)
3959  {
3960 
3961  }
3962  else
3963  {
3964  print2file(fs, j, t,DIL.Img.Mat[Server].Imat[t * IDX + j]);
3965  }
3966 
3967  }
3968  if(DIL.Img.Mat[Server].Imat[t * IDX + j] >= LevelDefPix)
3969  {
3970  temp =40000;
3971  matdefpix[t * IDX + j] = temp;
3972  if (mod==1 || mod==2)
3973  {
3974  print2file(fs, j, t,DIL.Img.Mat[Server].Imat[t * IDX + j]);
3975  }
3976  else
3977  {
3978 
3979  }
3980 
3981  }
3982  BIL.DPLOT.ImatGraf[t * IDX + j] = temp;
3983  }
3984  }
3985 */
3986  sprintf(str, "DEND\n");
3987  fprintf(fs,str);
3988 
3989  fclose(fs);
3990 
3991  D_Saving(); //Save the measured image
3992 
3993  for(t = 0 ; t < IDY ; t++)
3994  {
3995  for(j = 0; j < IDX; j++)
3996  {
3997  DIL.Img.Mat[Server].Imat[t * IDX + j] = matdefpix[t * IDX + j];
3998  }
3999  }
4000 
4001  D_Saving(); //Save the image of defective pixels
4002 
4003 
4004 
4005  free(matdefpix);
4006 
4007  return 0;
4008 }
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
Definition: Spat_Device.c:1898
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int Server
Definition: DAS_Spat.c:253
U16 * Imat
Definition: Dildef.h:286
img Mat[MAXIMG]
Definition: Dildef.h:552
void QjLamp(int mod)
QJ Lamp ON/OFF .
Definition: Spat_Device.c:2724
void print2file(FILE *ff, int x, int y, unsigned int m)
Print to file the defective pixel.
image Img
Definition: Dildef.h:675
void D_Saving(void)
Saving image. Procedure for saving the CCD Image Used since version 2.1.0. The coiche between binary ...
Definition: Procedures.c:1369
d_fileman DFILEM
Definition: bildef.h:257
d_view DPLOT
Definition: bildef.h:254
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
Definition: Dildef.h:240
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
Definition: Procedures.c:899
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
unsigned short * ImatGraf
Definition: bildef.h:176
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
Definition: Dildef.h:234
unsigned int LevelDefPix
Definition: DAS_Spat.c:126
dil DIL
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
bil BIL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ gettime()

void gettime ( struct time tp)

get current time

Definition at line 92 of file Save.c.

References time::ti_hour, time::ti_hund, time::ti_min, and time::ti_sec.

93 {
94  time_t now;
95  struct tm w;
96 
97  time(&now);
98 
99  //This code retrive the PC clock time as it is
100  //(with or without the daylight saving time setted)
101  w = *localtime(&now);
102  tp->ti_sec = w.tm_sec;
103  tp->ti_min = w.tm_min;
104  tp->ti_hour = w.tm_hour;
105  tp->ti_hund = 0;
106 
107  //This code retrive the PC clock and check if the daylight
108  //saving time is setted or not
109  //the time stored in the Header of the measurement is always the LST (Local Solar Time)
110  /**************************************************************/
111  // Check if daylight saving time is in effect
112  // tm_isdst > 0 if daylight saving time is in effect
113  // tm_isdst = 0 if daylight saving time is not in effect
114  // tm_isdst < 0 if status of daylight saving time is unknown.
115  if (w.tm_isdst)
116  {
117  tp->ti_hour = w.tm_hour - 1;
118  }
119  //NOTE - In Daylight saving period on midnight the hours became -1 so...
120  // if((newtime.tm_hour) == -1)
121  //{
122  // Necessary for measurements performed at high latitude in summer seasons
123  // newtime.tm_hour = 23;
124  // newtime.tm_yday = newtime.tm_yday - 1;
125  //}
126 
127  /**************************************************************/
128 
129 
130 }
U8 ti_sec
Definition: Dildef.h:238
U8 ti_hour
Definition: Dildef.h:236
U8 ti_hund
Definition: Dildef.h:237
U8 ti_min
Definition: Dildef.h:235
Definition: Dildef.h:234

§ HeaderInPlot()

int HeaderInPlot ( void  )

Shows the measurements parameters
.

Definition at line 1475 of file Spat_Plot.c.

References d_geo::alititude, optionini::avgmode, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, marconi::CCDTemp, spectrumheader::ccdvb, spectrumheader::ccdwx, paramini::ccdWx, spectrumheader::ccdwy, paramini::ccdWy, paramini::ccdXoff, paramini::ccdYoff, viewformobj::cmdpb, date::da_day, date::da_mon, date::da_year, img::DATE, das::DGeo, das::DOption, spectrumheader::dummy3, ccd::dx, ccd::dy, paramini::EqType, Fil_Code, Fil_Code8H, Fil_CodeNG, Fil_CodeNG1, Fil_CodeTropo, optionini::filtertype, FWS, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, GRS, img::High, dil::Img, d_geo::latitude, viewformobj::lblalt, viewformobj::lblccdex, viewformobj::lblccdey, viewformobj::lblccdsx, viewformobj::lblccdsy, viewformobj::lblccdtemp, viewformobj::lblccdtexp, viewformobj::lblccdwx, viewformobj::lblccdwy, viewformobj::lbldate, viewformobj::lblfilter, viewformobj::lbllat, viewformobj::lblloc, viewformobj::lbllong, viewformobj::lblmax, viewformobj::lblmin, viewformobj::lblmirpos, viewformobj::lblndfilter, viewformobj::lblnr, viewformobj::lblnummeas, viewformobj::lblsza, viewformobj::lbltime, viewformobj::lblvb, viewformobj::lblwaveleng, LIS_, d_geo::longitude, img::Low, das::Marconi, image::Mat, optionini::measmode, Mir_Code, Mir_CodeTropo, MIS, MObjectSetSensitive(), MObjectSetText(), N_AVG, N_RM, NDFil_Code, das::Paramini, FilterWheelSt::Pos, MirrorSt::Pos, d_geo::s_name, S_zenetr, Server, SPATRAM3, bil::SPH, TExp, time::ti_hour, time::ti_min, time::ti_sec, img::TIME, TROPOGAS, paramini::VBin, bil::VFO, spectrumheader::wavelen, wl, and GratingSt::Wl.

Referenced by DrawAreaPlotCB().

1476 {
1477 
1478  char str[64], buf[16];
1479 
1480 
1482 
1483  sprintf(str,"%.2lf", DAS.DGeo.latitude);
1484  MObjectSetText(BIL.VFO.lbllat, str);
1485 
1486  sprintf(str,"%.2lf", DAS.DGeo.longitude);
1487  MObjectSetText(BIL.VFO.lbllong, str);
1488 
1489  sprintf(str,"%.0lf", DAS.DGeo.alititude);
1490  MObjectSetText(BIL.VFO.lblalt, str);
1491 
1492  sprintf(str,"%.2lf", S_zenetr);
1493  MObjectSetText(BIL.VFO.lblsza, str);
1494 
1495  sprintf(str,"%d/%02d/%02d", DIL.Img.Mat[Server].DATE.da_year,DIL.Img.Mat[Server].DATE.da_mon, DIL.Img.Mat[Server].DATE.da_day);
1496  MObjectSetText(BIL.VFO.lbldate, str);
1497 
1498  sprintf(str,"%2d:%02d:%02d", DIL.Img.Mat[Server].TIME.ti_hour, DIL.Img.Mat[Server].TIME.ti_min, DIL.Img.Mat[Server].TIME.ti_sec);
1499  MObjectSetText(BIL.VFO.lbltime, str);
1500 
1501 
1502 
1504  sprintf(buf, "%s",Mir_CodeTropo[MIS.Pos]);
1505  else
1506  sprintf(buf, "%s",Mir_Code[MIS.Pos]);
1507 
1509 
1510  sprintf(str,"%d", wl[GRS.Wl]);
1512  /***********************************************************************/
1513  //Filter wheel section
1514  if ( DAS.Paramini.EqType == LIS_)
1516  else
1517  {
1518  if(DAS.Paramini.EqType == TROPOGAS)
1522  else if (DAS.Paramini.EqType == GASCODNG1)
1524 
1525  else
1527  }
1528  /***********************************************************************/
1529  //Neutral Density Filter section
1530  if(DAS.DOption.filtertype == 1) // Double filter wheel
1531  {
1532 
1534 
1535 
1536  }
1537  if(DAS.DOption.filtertype == 2) // Filter Wheel + Torque motor
1538  {
1539  if (BIL.SPH.dummy3)
1541  else
1543 
1544  }
1545 
1546 
1547 
1548  /***********************************************************************/
1549 
1550 
1551  sprintf(str,"%.2lf", DAS.Marconi.CCDTemp);
1553 
1554  sprintf(str,"%.3lf", TExp);
1556 
1557 
1558  if(DAS.DOption.measmode == 1) //measuring with average
1559  {
1560  if(DAS.DOption.avgmode == 0)
1561  sprintf(str,"%d", N_AVG); // number of measurements in fixed number of measurements
1562  else
1563  sprintf(str,"%d", N_RM); // number of measurements in fixed exposure time
1564  }
1565  else
1566  sprintf(str,"%d", "1");
1567 
1569 
1570  sprintf(str,"%u", (unsigned int)DIL.Img.Mat[Server].High);
1571  MObjectSetText(BIL.VFO.lblmax, str);
1572 
1573  sprintf(str,"%u", (unsigned int)DIL.Img.Mat[Server].Low);
1574  MObjectSetText(BIL.VFO.lblmin, str);
1575 
1576  sprintf(str,"%d", DC_CCD.dx);
1578 
1579  sprintf(str,"%d", DC_CCD.dy);
1581 
1582 
1583 
1584  sprintf(str,"%d", DAS.Paramini.ccdXoff);
1586 
1587  sprintf(str,"%d", DAS.Paramini.ccdYoff);
1589 
1590  sprintf(str,"%d", DAS.Paramini.ccdWx);
1592 
1593  sprintf(str,"%d", DAS.Paramini.ccdWy);
1595 
1596  sprintf(str,"%d", DAS.Paramini.VBin);
1597  MObjectSetText(BIL.VFO.lblvb, str);
1598 
1599  sprintf(str,"%d", DC_CCD.dy/DAS.Paramini.VBin);
1600  MObjectSetText(BIL.VFO.lblnr, str);
1601 
1602 
1603  BIL.SPH.ccdwx = DC_CCD.dx;
1604  BIL.SPH.ccdwy = DC_CCD.dy;
1606 
1607  BIL.SPH.ccdex = DAS.Paramini.ccdWx;//DC_CCD.dx;
1609  BIL.SPH.ccdey = DAS.Paramini.ccdWy; //DC_CCD.dy;
1612 
1613  BIL.SPH.wavelen = wl[GRS.Wl];
1614 
1615 
1616  MObjectSetSensitive(BIL.VFO.cmdpb[4]); // Set "Print" button as sensitive
1618 
1619  return 0;
1620 
1621 
1622 }
MOBJECT lblmin
Definition: bildef.h:54
double S_zenetr
Definition: SOLPOS.C:92
MOBJECT cmdpb[10]
Definition: bildef.h:69
int Server
Definition: DAS_Spat.c:253
optionini DOption
Options for DAS execution.
double alititude
Station altitude.
const char * Mir_Code[]
const char array for the realisation of the Mirrors buttons in the Mirror shell
Definition: DAS_Spat.c:231
MOBJECT lblccdwx
Definition: bildef.h:55
MOBJECT lblccdtexp
Definition: bildef.h:44
das DAS
DAS structure.
Definition: Spat_Plot.c:39
MOBJECT lblndfilter
Definition: bildef.h:42
U8 da_mon
Definition: Dildef.h:243
MOBJECT lblmax
Definition: bildef.h:53
U8 ti_sec
Definition: Dildef.h:238
int ccdWx
CCD X End.
MOBJECT lblfilter
Definition: bildef.h:41
double latitude
Station latitude.
int Pos
Mirror Current Position.
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
dil DIL
Definition: Spat_Plot.c:28
int ccdXoff
CCD X Start.
MOBJECT lblccdsx
Definition: bildef.h:57
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
S16 dx
Num. of X pixels.
Definition: dcldef.h:1022
img Mat[MAXIMG]
Definition: Dildef.h:552
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
MOBJECT lblccdey
Definition: bildef.h:60
struct date DATE
Definition: Dildef.h:348
void MObjectSetText(MOBJECT obj, const char *text)
MOBJECT lblnr
Definition: bildef.h:62
image Img
Definition: Dildef.h:675
int Pos
Filter Wheel current Position.
S16 da_year
Definition: Dildef.h:241
d_geo DGeo
struct for Station location
U8 da_day
Definition: Dildef.h:242
#define LIS_
Lampedusa Island Spectrometer - ENEA.
MOBJECT lblloc
Definition: bildef.h:48
MOBJECT lbllat
Definition: bildef.h:49
int ccdWy
CCD Y End.
U8 ti_hour
Definition: Dildef.h:236
int Wl
Grating Wavelength.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
MOBJECT lblccdtemp
Definition: bildef.h:43
char s_name[4]
Station name.
float CCDTemp
Actual CCD Temperature.
int avgmode
Flag to set Averaging mode: 0 = Repeat measurements for fixed number, 1 = Repeat measurements for fix...
MOBJECT lblalt
Definition: bildef.h:51
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
int VBin
CCD Vertical Binning.
MOBJECT lblsza
Definition: bildef.h:52
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
char * Fil_CodeNG1[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrum...
Definition: DAS_Spat.c:213
S16 dy
Num. of Y pixels.
Definition: dcldef.h:1023
MOBJECT lblccdwy
Definition: bildef.h:56
MOBJECT lbltime
Definition: bildef.h:38
#define SPATRAM3
SPATRAM3.
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
MirrorSt MIS
Mirror.
Definition: DAS_Spat.c:61
MOBJECT lblvb
Definition: bildef.h:61
char * Fil_Code[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:207
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
U8 ti_min
Definition: Dildef.h:235
MOBJECT lblccdsy
Definition: bildef.h:58
MOBJECT lbldate
Definition: bildef.h:37
double longitude
Station longitude.
int measmode
measuring mode: 0 = Single; 1 = Averaged
bil BIL
Definition: Spat_Plot.c:35
MOBJECT lbllong
Definition: bildef.h:50
viewformobj VFO
Definition: bildef.h:255
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
struct time TIME
Definition: Dildef.h:347
char * NDFil_Code[]
const char array for the realisation of the Filters buttons in the ND Filter shell ...
Definition: DAS_Spat.c:219
int EqType
Spectrometer Type.
int N_RM
Number of measurements for Averaging mode in fixed exposure time mode.
Definition: DAS_Spat.c:114
int N_AVG
Number of measurements for Averaging mode in fixed number of meas. mode.
Definition: DAS_Spat.c:113
float Low
Definition: Dildef.h:294
void MObjectSetSensitive(MOBJECT obj)
MOBJECT lblnummeas
Definition: bildef.h:45
int ccdYoff
CCD Y Start.
ccd DC_CCD
Definition: Spat_Plot.c:25
float High
Definition: Dildef.h:295
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
GratingSt GRS
Definition: CreateForms.c:82
MOBJECT lblwaveleng
Definition: bildef.h:40
MOBJECT lblccdex
Definition: bildef.h:59
marconi Marconi
CCD Sensor struct.
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
MOBJECT lblmirpos
Definition: bildef.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ hertz2int()

int hertz2int ( int  mod,
char *  string 
)

translate the Hertz speed in AMS digit unit.

Parameters
mod–> int not used (0)
*string–> char containing the Hertz speed
Returns
c –> digital unit

Definition at line 2226 of file DAS_Spat_ConfCBs.c.

Referenced by ApplyChCB(), and WriteAMSCB().

2227 {
2228  int c;
2229 
2230  c = (int) (((atof(string)*1000) - 125.0) / 125.0) ;
2231 
2232  return c;
2233 }
+ Here is the caller graph for this function:

§ HgLamp()

void HgLamp ( int  mod)

HG Lamp ON/OFF
.

Parameters
mod
  • = 0 –> Lamp OFF
  • = 1 –> Lamp ON

Definition at line 2673 of file Spat_Device.c.

References AMS1, AMS_wopto(), gui::ContrPanel, das::Gui, HGFlg, controlpanel::LedHG, MObjectSetText(), MPixmapSetImageFile(), stepm::OOP, controlpanel::pblamps, and das::StepM.

Referenced by D_Calibra(), DB_KeyB_CB(), E_Hg_Off(), E_Hg_On(), ShutCB(), and WinRes().

2674 {
2675 
2676  if(mod)
2677  {
2678 
2679  // Bitwise inclusive OR
2680  //The bitwise-inclusive-OR operator compares each bit of its first operand to
2681  //the corresponding bit of its second operand. If either bit is 1,
2682  //the corresponding result bit is set to 1. Otherwise, the corresponding
2683  //result bit is set to 0.
2684  //i.e if(DAS.StepM.OOP[AMS1] = 00000000) -->
2685  //DAS.StepM.OOP[AMS1] | 0x04 = 00000000 | 00000100 = 00000100
2686  DAS.StepM.OOP[AMS1] |= 0x04; //bit 2, 00000100
2687  HGFlg = 1;
2688  MObjectSetText(DAS.Gui.ContrPanel.pblamps[0], "Hg On");
2689  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedHG, "SYS\\ledonHG.bmp");
2690 
2691  }
2692  else
2693  {
2694  //The bitwise-AND operator compares each bit of its first operand to
2695  //the corresponding bit of its second operand. If both bits are 1,
2696  //the corresponding result bit is set to 1. Otherwise, the corresponding
2697  //result bit is set to 0.
2698  //i.e if(DAS.StepM.OOP[AMS1] = 00000100) -->
2699  //DAS.StepM.OOP[AMS1] | 0xFB = 00000100 | 11111011 = 00000000
2700  DAS.StepM.OOP[AMS1] &= 0xFB; //11111011
2701 
2702  HGFlg = 0;
2703  MObjectSetText(DAS.Gui.ContrPanel.pblamps[0], "Hg Off");
2704  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedHG, "SYS\\ledoff.bmp");
2705  }
2706 
2707  // 1's complement
2708  // 1) if mod and DAS.StepM.OOP[AMS1] = 00000100 then 11111011
2709  // 2) if !mod and DAS.StepM.OOP[AMS1] = 00000000 then 11111111
2710  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2711 
2712  //write on the optoinsulated port
2713  // 1) bit 2 set to 0 (we are in negative logic so 0 = ON, 1 = OFF)
2714  // 1) bit 2 set to 1 (we are in negative logic so 0 = ON, 1 = OFF)
2716 
2717  // again 1's complement for restoring the positive logic
2718  // 1) if mod and DAS.StepM.OOP[AMS1] = 11111011 then 00000100 (bit 2 on)
2719  // 2) if !mod and DAS.StepM.OOP[AMS1] = 11111111 then 00000000 (bit 2 off)
2720  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2721 
2722 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
MOBJECT pblamps[2]
Control Panel Push buttons for HG and QJ Lamps.
void MObjectSetText(MOBJECT obj, const char *text)
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
int AMS_wopto(int id, unsigned int w)
write the value on the optoinsulated port write the value on the optoinsulated port.
Definition: Dxl.c:911
controlpanel ContrPanel
Control Panel Structure.
#define AMS1
AMS1 address.
int HGFlg
Definition: DAS_Spatram.h:2968
MOBJECT LedHG
Control Panel Led for HG Lamp.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ HiresPS()

void HiresPS ( int  mod)

Hires Power Supply ON/OFF
.

Parameters
mod
  • = 0 –> Hires Power Supply OFF
  • = 1 –> Hires Power Supply ON

Definition at line 2532 of file Spat_Device.c.

References AMS1, AMS_wopto(), stepm::OOP, and das::StepM.

Referenced by InitCCD_AMS(), and ShutCB().

2533 {
2534  if(mod)
2535  DAS.StepM.OOP[AMS1] |= 0x20; //bit 5, 00100000, dec = 32
2536  else
2537  DAS.StepM.OOP[AMS1] &= 0xDF; // 11011111, dec = 223
2538 
2539 
2540  // 1's complement
2541  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2542  //write on the optoinsulated port
2544  // again 1's complement for restoring the positive logic
2545  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2546 
2547 
2548 
2549 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
int AMS_wopto(int id, unsigned int w)
write the value on the optoinsulated port write the value on the optoinsulated port.
Definition: Dxl.c:911
#define AMS1
AMS1 address.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ HomeAzimFast()

int HomeAzimFast ( void  )

Home for Azimuth Axis.

Definition at line 1229 of file Init.c.

References controlpanel::Albl_LS, AMS3, AMS_AzzeraCoord(), AMS_chkbitsts(), AMS_Default(), AMS_dirfin(), AMS_Divisore(), AMS_TrackOff(), AMS_TrackOn(), optionini::amsprogbar, gui::ContrPanel, D_VRange(), DB_InitAMS(), das::DOption, das::Gui, controlpanel::LedSM, Message(), das::MIGE, MLoopWhileEvents(), MObjectSetText(), MPixmapSetImageFile(), AzimuthSt::Pos, stepm::power, stepm::slope, stepm::SM_A, stepm::SM_B, stepm::speed, stepm::speed_Hz, st, Status(), stepm::step, das::StepM, and mige::type.

Referenced by DB_InitAMS(), and DB_TestHomeTypeCB().

1230 {
1231 
1232  int dir;
1233  long count;
1234  double t;
1235  int er, d, HomeOnGoing = 1;
1236  char buf[80];
1237  unsigned long st, et, x;
1238 
1239  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS3][DAS.StepM.SM_B], "SYS\\ledoff.bmp");
1240  sprintf(buf, "%s", "Homing");
1242  Status("Home for Azimuth...");
1243 
1244  st = GetTickCount();
1245 
1246  d = AMS_chkbitsts(AMS3, 1);
1247  if (DAS.MIGE.type == 2)
1248  d=!d;
1249 
1250  if(d)
1251  {
1252  dir = 0;
1253  }
1254  else
1255  {
1256  dir = 1;
1257  }
1258 
1259  /**********************************/
1260  // First attempt (fast)
1261  /*§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§*/
1262  t = 10E6 / (2 * DAS.StepM.speed_Hz[AMS3][DAS.StepM.SM_B] * 1000) - 1;
1263  count = (long) t;
1264  AMS_TrackOn(AMS3, 0, dir, 0, count);
1265  if(DAS.DOption.amsprogbar)
1266  D_VRange("Homing Azimuth with Track(1)",0, 255, 0, 0);
1267 
1268  do
1269  {
1270  MLoopWhileEvents(0);
1271 
1272  d = AMS_chkbitsts(AMS3, 1);
1273  if (DAS.MIGE.type == 2)
1274  d=!d;
1275 
1276  if(dir == 0)
1277  {
1278  if(d == 0)
1279  {
1280  er = AMS_TrackOff(AMS3, 1, 1);
1281  HomeOnGoing = 0;
1282  }
1283  }
1284  if(dir)
1285  {
1286  if(d)
1287  {
1288  er = AMS_TrackOff(AMS3, 1, 1);
1289  HomeOnGoing = 0;
1290  }
1291  }
1292  //For progress bar display
1293  et = GetTickCount();
1294  x = labs(et - st);
1295  //if((x % 10) == 0 && x > 0)
1296  if(x > 0)
1297  {
1298  if(DAS.DOption.amsprogbar)
1299  D_VRange(NULL, (long) x * 100 / 35000, 255, 0, 0 );
1300  sprintf(buf, "Max Time Left:%.1lf", (double)fabs(((double)(labs(et - st) - 35000))/1000.0 ));
1302  }
1303 
1304  }while (HomeOnGoing);
1305  /*§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§*/
1306 
1307  if(DAS.DOption.amsprogbar)
1308  D_VRange(NULL, 100, 0,0,0);
1309 
1310  // Second attempt (slow in opposite direction)
1311  /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
1312  HomeOnGoing = 1;
1313  dir = !dir;
1314  t = 10E6 / (2 * DAS.StepM.speed_Hz[AMS3][DAS.StepM.SM_B] * 1000 / 20) - 1;
1315  count = (long) t;
1316 
1317  AMS_TrackOn(AMS3, 0, dir, 0, count);
1318  if(DAS.DOption.amsprogbar)
1319  D_VRange("Homing with tracking (2)",0, 255, 255, 0);
1320  st = GetTickCount();
1321  do
1322  {
1323  d = AMS_chkbitsts(AMS3, 1);
1324  if (DAS.MIGE.type == 2)
1325  d = !d;
1326 
1327  if(dir == 0)
1328  {
1329  if(d == 0)
1330  {
1331  er = AMS_TrackOff(AMS3, 1, 1);
1332  HomeOnGoing = 0;
1333  }
1334  }
1335  if(dir)
1336  {
1337  if(d)
1338  {
1339  er = AMS_TrackOff(AMS3, 1, 1);
1340  HomeOnGoing = 0;
1341  }
1342  }
1343  //For progress bar display
1344  et = GetTickCount();
1345  x = labs(et - st);
1346  //if((x % 10) == 0 && x > 0)
1347  if(x > 0)
1348  {
1349  if(DAS.DOption.amsprogbar)
1350  D_VRange(NULL, (long) x * 100 / 35000, 255, 0, 0 );
1351  sprintf(buf, "Max Time Left:%.1lf", (double)fabs(((double)(labs(et - st) - 35000))/1000.0 ));
1353  }
1354  }while (HomeOnGoing);
1355 
1356  if(DAS.DOption.amsprogbar)
1357  D_VRange(NULL, 100, 0,0,0);
1358  /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
1359 
1360  //Reset the default values of the divider
1361  er = AMS_Divisore(AMS3, 40000,40000);
1362 
1363 
1364 
1365  AMS_Default(AMS3);
1366 
1367  // Re-Init AMS3 ( with no Home)
1368  er = DB_InitAMS(AMS3, 1, DAS.StepM.power[AMS3][DAS.StepM.SM_A],
1373 
1374  er = AMS_AzzeraCoord(AMS3, 1);
1375  if(er) { Message("No Zero Coord Azimuth", er); }
1376 
1377  AMS_dirfin(AMS3, 0, 1);
1378 
1379 
1380  AST.Pos = 0.0; //for solar tracker
1381  sprintf(buf, "%.1lf %s", AST.Pos, "°N");
1383  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS3][DAS.StepM.SM_B], "SYS\\ledGreen.bmp");
1384  Status("Home for Azimuth..DONE");
1385 
1386 
1387  return 0;
1388 }
int AMS_Divisore(int id, unsigned long par1, unsigned long par2)
Definition: Dxl.c:946
stepm StepM
Stepper motors parameters structure.
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.
AzimuthSt AST
Azimuth.
Definition: Init.c:27
void MLoopWhileEvents(int discard)
optionini DOption
Options for DAS execution.
void D_VRange(char *str, int val, int, int g, int b)
Create and display the status bar.
Definition: Utils.c:206
int AMS_TrackOn(int id, int adir, int bdir, unsigned long acount, unsigned long bcount)
Activate tracking Procedure for Stepper Motor tracking activation.
Definition: Dxl.c:404
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
das DAS
DAS structure.
Definition: Init.c:34
int slope[AMSMAX][2]
Stepper Motors Slope.
int DB_InitAMS(int nid, int mod, int powera, int stepa, int slopea, int speeda, int powerb, int stepb, int slopeb, int speedb)
Init selected AMS.
Definition: Init.c:1391
void AMS_Default(int id)
Set default values to AMS parameters Procedure for setting the default values of power.speed, stepping and slope to the selected AMS adapter.
Definition: Dxl.c:174
int type
void MObjectSetText(MOBJECT obj, const char *text)
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
mige MIGE
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
void Message(char *str, int er)
Create a message shell for the AMS errors (Debug Use). .
Definition: Dxl.c:1085
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
controlpanel ContrPanel
Control Panel Structure.
int AMS_TrackOff(int id, int amot, int bmot)
tracking off Procedure for Stepper Motor tracking de-activation
Definition: Dxl.c:422
int AMS_AzzeraCoord(int id, int mtr)
Set to zero the number of steps on the selected motor Set to zero the number of steps on the selecte...
Definition: Dxl.c:439
int AMS_chkbitsts(int id, int bitn)
check bit status Procedure for the determination of the bit number status.
Definition: Dxl.c:192
static double st
Definition: SOLPOS.C:142
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
int AMS_dirfin(int id, int dira, int dirb)
Set Final Directions .
Definition: Dxl.c:457
double Pos
Azimuth Current Position.
#define AMS3
AMS3 address.
int power[AMSMAX][2]
Stepper Motors Power.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ HomeFiltersFast()

int HomeFiltersFast ( void  )

(Fastest) Fliter wheel in the reference Position.
The Fliter wheel reaches the reference Position. Similar to HomeFilterWheel(void), but faster

Returns
er:
  • = 0 –> Operation concluded succesfully
  • = 1 –> Problems in positioning

Definition at line 853 of file Init.c.

References ACKLEN, controlpanel::Albl_LS, AMS2, AMS_AzzeraCoord(), AMS_chkbitsts(), AMS_Default(), AMS_dirfin(), AMS_TrackOff(), AMS_TrackOn(), optionini::amsprogbar, DXL_par::buftx, gui::ContrPanel, D_VRange(), DB_InitAMS(), das::DOption, DXL_RxStr(), DXL_TxStr(), FWS, das::Gui, controlpanel::LedSM, Message(), MLoopWhileEvents(), MObjectSetText(), MPixmapSetImageFile(), FilterWheelSt::Pos, stepm::power, stepm::slope, stepm::SM_A, stepm::SM_B, stepm::speed, stepm::speed_Hz, st, Status(), stepm::step, and das::StepM.

Referenced by DB_InitAMS(), DB_TestHomeTypeCB(), and E_Home_SM3().

854 {
855  int er, d;
856  char buf[40];
857  long count;
858  double t;
859  int FlgHomeFW = 1;
860  unsigned long st, et, x;
861 
862  sprintf(DXL.buftx, "*01000000"); //d = 12, buio --> senso orario
863  DXL_TxStr(DXL.buftx, strlen(DXL.buftx));
864  d = ACKLEN;
865  er = DXL_RxStr(buf, &d);
866 
867  st = GetTickCount();
868 
869  // Read input
870  d = AMS_chkbitsts(AMS2, 3);
871 
872  d = !d;
873 
874  if(d)
875  {
876  t = 10E6 / (DAS.StepM.speed_Hz[AMS2][DAS.StepM.SM_A] * 1000) ;
877  count = (long) t;
878  AMS_TrackOn(AMS2, 1, 0, count, 0);
879 
880 
882  D_VRange("Homing filter",0, 0, 0, 255);
883 
884  do
885  {
886  // Read input
887  d = AMS_chkbitsts(AMS2, 3);
888  MLoopWhileEvents(0);
889  if(d == 1)
890  {
891  er = AMS_TrackOff(AMS2, 1, 2);
892  FlgHomeFW = 0;
893  }
894 
895  /*************************************************************/
896  //For progress bar display
897  // D_Homing(DAS.Gui.ContrPanel.Albl_LS[0], 0, 2000, FlgHomeMir);
898  et = GetTickCount();
899  x = labs(et - st);
900 
901  //if((x % 10) == 0 && x > 0)
902  if(x > 0)
903  {
905  D_VRange(NULL, (long) x * 100 / 5000, 255, 0, 0 );
906  sprintf(buf, "%.1lf sec.", (double)fabs(((double)(labs(et - st) - 5000))/1000.0 ));
908  }
909  /***************************************************/
910  }while (FlgHomeFW);
911 
913  D_VRange(NULL, 100, 0,0,0);
914 
915  // Set final directions
916  AMS_dirfin(AMS2, 1, 0);
917  // Set default values
918  AMS_Default(AMS2);
919 
920  // Re-Init AMS2 ( with no Home)
926 
927  }
928 
929  er = AMS_AzzeraCoord(AMS2, 0);
930  if(er) { Message("No Zero Coord FW", er); }
931 
932  FWS.Pos = 0;
933  sprintf(buf, "%s", "NULL");
935  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS2][DAS.StepM.SM_A], "SYS\\ledGreen.bmp");
936  Status("Home for Filter Wheel...DONE !");
937 
938  return 0;
939 }
stepm StepM
Stepper motors parameters structure.
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.
void MLoopWhileEvents(int discard)
optionini DOption
Options for DAS execution.
#define AMS2
AMS2 address.
char buftx[1024]
Tx buffer.
Definition: DXL.H:21
void D_VRange(char *str, int val, int, int g, int b)
Create and display the status bar.
Definition: Utils.c:206
int AMS_TrackOn(int id, int adir, int bdir, unsigned long acount, unsigned long bcount)
Activate tracking Procedure for Stepper Motor tracking activation.
Definition: Dxl.c:404
#define ACKLEN
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
int DXL_RxStr(char *rx, int *len)
receive string from a serial port
Definition: Dxl.c:1187
DXL_par DXL
DXL structure.
Definition: Init.c:21
das DAS
DAS structure.
Definition: Init.c:34
int slope[AMSMAX][2]
Stepper Motors Slope.
int DB_InitAMS(int nid, int mod, int powera, int stepa, int slopea, int speeda, int powerb, int stepb, int slopeb, int speedb)
Init selected AMS.
Definition: Init.c:1391
void AMS_Default(int id)
Set default values to AMS parameters Procedure for setting the default values of power.speed, stepping and slope to the selected AMS adapter.
Definition: Dxl.c:174
void MObjectSetText(MOBJECT obj, const char *text)
int Pos
Filter Wheel current Position.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
void Message(char *str, int er)
Create a message shell for the AMS errors (Debug Use). .
Definition: Dxl.c:1085
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
controlpanel ContrPanel
Control Panel Structure.
int AMS_TrackOff(int id, int amot, int bmot)
tracking off Procedure for Stepper Motor tracking de-activation
Definition: Dxl.c:422
int AMS_AzzeraCoord(int id, int mtr)
Set to zero the number of steps on the selected motor Set to zero the number of steps on the selecte...
Definition: Dxl.c:439
int AMS_chkbitsts(int id, int bitn)
check bit status Procedure for the determination of the bit number status.
Definition: Dxl.c:192
static double st
Definition: SOLPOS.C:142
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
int AMS_dirfin(int id, int dira, int dirb)
Set Final Directions .
Definition: Dxl.c:457
void DXL_TxStr(char *tx, int len)
send string to a serial port
Definition: Dxl.c:1153
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
int power[AMSMAX][2]
Stepper Motors Power.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ HomeFilterWheel()

int HomeFilterWheel ( void  )

Fliter wheel in the reference Position.
The Fliter wheel reaches the reference Position.

Returns
er:
  • = 0 –> Operation concluded succesfully
  • = 1 –> Problems in positioning

§ HomeGrating()

int HomeGrating ( void  )

Grating in the reference Position.
The Grating reaches the reference Position.

Returns
er:
  • = 0 –> Operation concluded succesfully
  • = 1 –> Problems in positioning

§ HomeGratingFast()

int HomeGratingFast ( int  mod)

(Fastest) Grating in the reference Position.
The Grating reaches the reference Position. Similar to HomeGrating(void), but faster

Returns
er:
  • = 0 –> Operation concluded succesfully
  • = 1 –> Problems in positioning

Definition at line 780 of file Init.c.

References controlpanel::Albl_LS, AMS1, AMS_AzzeraCoord(), AMS_Default(), AMS_dirfin(), AMS_DoPos(), AMS_Home(), AMS_HomeDefault(), gui::ContrPanel, D_Homing(), DB_InitAMS(), GRS, das::Gui, HomeTrack(), stepm::hometype, controlpanel::LedSM, LookforWl_X(), Message(), MObjectSetText(), MPixmapSetImageFile(), paramini::Offset, das::Paramini, stepm::power, stepm::slope, stepm::SM_A, stepm::SM_B, stepm::speed, st, Status(), stepm::step, das::StepM, and GratingSt::Wl.

Referenced by DB_InitAMS(), DB_TestHomeTypeCB(), E_HGratCal(), E_Home_SM2(), and Task_HomeGrat().

781 {
782 
783  int DIR[] = { 0, 0 };
784 // long count;
785 // double t;
786  int er, FlgGratPos = 1;
787  char buf[80];
788  unsigned long st;
789 
790 
791  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][DAS.StepM.SM_B], "SYS\\ledoff.bmp");
792  sprintf(buf, "%s", "Homing");
794  Status("Home for Grating...");
795 
796  st = GetTickCount();
797 
798 
799 
800 
801  if(DAS.StepM.hometype[AMS1][DAS.StepM.SM_B] == 0) //Home Standard
802  {
803  er = AMS_Home(AMS1, 0, 1);
805  }
806  if(DAS.StepM.hometype[AMS1][DAS.StepM.SM_B] == 1) //Home with Default
807  {
808  er = AMS_HomeDefault(AMS1, 0, 1);
810  }
811  //Home with tracking with setted values of speed and step/round
812  if(DAS.StepM.hometype[AMS1][DAS.StepM.SM_B] == 2)
813  {
814  sprintf(buf, "Homing Grating");
815  er = HomeTrack(buf, AMS1, DAS.StepM.SM_B, mod);
816  }
817 
818 /**********************************/
819 
820 
821  AMS_dirfin(AMS1, 0, 1);
822 
823  AMS_Default(AMS1);
824 
825  // Re-Init AMS1 ( with no Home)
831 
832  // Send Offet for Grating
833  if(DAS.Paramini.Offset[6] > 0) DIR[0] = 0;
834  else DIR[0] = 1;
835 
836  if(DAS.Paramini.Offset[6] != 0)
837  {
838  er = AMS_DoPos(AMS1, 0, DIR[0], 0, labs(DAS.Paramini.Offset[6]));
839  }
840  er = AMS_AzzeraCoord(AMS1, 1);
841  if(er) { Message("No Zero Coord Grating", er); }
842 
843  GRS.Wl = LookforWl_X(4358);//Lookfor4358();
844  sprintf(buf, "%d", 4358);
846  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][DAS.StepM.SM_B], "SYS\\ledGreen.bmp");
847  Status("Home for Grating..DONE");
848 
849  return 0;
850 }
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
int hometype[AMSMAX][2]
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
int D_Homing(MOBJECT p, int id, int sm, int tout)
Definition: Init.c:470
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
int AMS_Home(int id, int mota, int motb)
Home position for the selected motor the home position is reached with the standard parameters (1KHz...
Definition: Dxl.c:549
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
int Offset[16]
Offset of the hardware devices (Input Mirror (5), Grating, Filter Wheel...)
das DAS
DAS structure.
Definition: Init.c:34
int slope[AMSMAX][2]
Stepper Motors Slope.
int DB_InitAMS(int nid, int mod, int powera, int stepa, int slopea, int speeda, int powerb, int stepb, int slopeb, int speedb)
Init selected AMS.
Definition: Init.c:1391
void AMS_Default(int id)
Set default values to AMS parameters Procedure for setting the default values of power.speed, stepping and slope to the selected AMS adapter.
Definition: Dxl.c:174
void MObjectSetText(MOBJECT obj, const char *text)
int Wl
Grating Wavelength.
int AMS_HomeDefault(int id, int mota, int motb)
Definition: Dxl.c:567
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void Message(char *str, int er)
Create a message shell for the AMS errors (Debug Use). .
Definition: Dxl.c:1085
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
controlpanel ContrPanel
Control Panel Structure.
int AMS_AzzeraCoord(int id, int mtr)
Set to zero the number of steps on the selected motor Set to zero the number of steps on the selecte...
Definition: Dxl.c:439
#define AMS1
AMS1 address.
static double st
Definition: SOLPOS.C:142
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
int AMS_dirfin(int id, int dira, int dirb)
Set Final Directions .
Definition: Dxl.c:457
int HomeTrack(char *buf, int id, int sm, int mode)
Definition: Init.c:518
int AMS_DoPos(int id, int dira, int dirb, unsigned long stepa, unsigned long stepb)
Execute Positioning Execute Stepper positioning. Make all the control on the status of the selected m...
Definition: Dxl.c:644
GratingSt GRS
Definition: CreateForms.c:82
int LookforWl_X(int x)
Definition: Procedures.c:2295
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:

§ HomeMirror()

int HomeMirror ( void  )

Input Mirror in the reference Position.
The Input Mirror reaches the reference Position.

Returns
er:
  • = 0 –> Operation concluded succesfully
  • = 1 –> Problems in positioning

Definition at line 685 of file Init.c.

References controlpanel::Albl_LS, AMS1, AMS_AzzeraCoord(), AMS_Default(), AMS_dirfin(), AMS_Divisore(), AMS_DoPos(), AMS_Home(), AMS_HomeDefault(), gui::ContrPanel, D_Homing(), DB_InitAMS(), stepm::divider, paramini::EqType, GASCODNG4, das::Gui, HomeTrack(), stepm::hometype, controlpanel::LedSM, Message(), Mir_Code, Mir_CodeTropo, MIS, MObjectSetText(), MPixmapSetImageFile(), stepm::multiplier, paramini::Offset, das::Paramini, MirrorSt::Pos, stepm::power, stepm::slope, stepm::SM_A, stepm::SM_B, SMfraz(), SPATRAM3, stepm::speed, stepm::speed_Hz, Status(), stepm::step, das::StepM, and TROPOGAS.

Referenced by DB_InitAMS(), DB_TestHomeTypeCB(), and E_Home_SM1().

686 {
687  int er, k;
688  char buf[40];
689 // int DIR[] = { 0, 0 };
690  int dir = 0;
691  long count;
692 // int FlgHomeMir = 1,
693  int sts = 0;
694  int HomeOnGoing = 1;
695 // double t;
696 // unsigned long st, et, x;
697  long tout = 3000;
698 
699  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][DAS.StepM.SM_A], "SYS\\ledoff.bmp");
700  sprintf(buf, "%s", "Homing");
702  Status("Home for Input Mirror...");
703 
704  //st = GetTickCount();
705 
706 
707  if(DAS.StepM.hometype[AMS1][DAS.StepM.SM_A] == 0) //Home Standard
708  {
709  er = AMS_Home(AMS1, 1, 0);
710  count = (long) (2000.0 * DAS.StepM.multiplier[AMS1][DAS.StepM.SM_A]);
712  }
713  if(DAS.StepM.hometype[AMS1][DAS.StepM.SM_A] == 1) //Home with Default
714  {
715 
716  //18/05/2007 NOT Tested
717  DAS.StepM.divider[AMS1][DAS.StepM.SM_A]= (unsigned long)(10E6/DAS.StepM.speed_Hz[AMS1][DAS.StepM.SM_A]/2);
719 
720  er = AMS_HomeDefault(AMS1, 1, 0);
722  AMS_Divisore(AMS1, 40000,40000);
723 
724  }
725  //Home with tracking with setted values of speed and step/round
726  if(DAS.StepM.hometype[AMS1][DAS.StepM.SM_A] == 2)
727  {
728  sprintf(buf, "Homing Mirror");
729  er = HomeTrack(buf, AMS1,DAS.StepM.SM_A, 0);
730  }
731 
732  // Set final directions
733 
734  AMS_dirfin(AMS1, 1, 0);
735  // Set default values
736  AMS_Default(AMS1);
737 
738  // Re-Init AMS1 ( with no Home)
744 
745  // Send Offet for Mirror
746  if(DAS.Paramini.Offset[0] > 0) dir = 0;
747  else dir = 1;
748 
749  if(DAS.Paramini.Offset[0] != 0)
750  {
751  k = (int)SMfraz(DAS.StepM.step[AMS1][DAS.StepM.SM_A]);
752  count = labs(DAS.Paramini.Offset[0] * k * DAS.StepM.multiplier[AMS1][DAS.StepM.SM_A]); //6 e' la riduzione
753  //er = AMS_DoPos(AMS1, DIR[0], 0, count, 0);
754  er = AMS_DoPos(AMS1, dir, 0, labs(count), 0);
755  if(er) { Message("n Step not sent! 2", er); }
756  }
757 
758 
759 
760 
761  er = AMS_AzzeraCoord(AMS1, 0);
762  if(er) { Message("No Zero Coord Mirror", er); }
763  MIS.Pos = 0;
765  sprintf(buf, "%s",Mir_CodeTropo[0]);
766  else
767  sprintf(buf, "%s",Mir_Code[0]);
768 
769 // sprintf(buf, "%s", " Zenith" );
771  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][DAS.StepM.SM_A], "SYS\\ledGreen.bmp");
772  Status("Home for Input Mirror..DONE");
773 
774  return 0;
775 
776 }
int AMS_Divisore(int id, unsigned long par1, unsigned long par2)
Definition: Dxl.c:946
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
int hometype[AMSMAX][2]
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
int D_Homing(MOBJECT p, int id, int sm, int tout)
Definition: Init.c:470
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
const char * Mir_Code[]
const char array for the realisation of the Mirrors buttons in the Mirror shell
Definition: DAS_Spat.c:231
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
int AMS_Home(int id, int mota, int motb)
Home position for the selected motor the home position is reached with the standard parameters (1KHz...
Definition: Dxl.c:549
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
int Pos
Mirror Current Position.
int Offset[16]
Offset of the hardware devices (Input Mirror (5), Grating, Filter Wheel...)
das DAS
DAS structure.
Definition: Init.c:34
int slope[AMSMAX][2]
Stepper Motors Slope.
int DB_InitAMS(int nid, int mod, int powera, int stepa, int slopea, int speeda, int powerb, int stepb, int slopeb, int speedb)
Init selected AMS.
Definition: Init.c:1391
void AMS_Default(int id)
Set default values to AMS parameters Procedure for setting the default values of power.speed, stepping and slope to the selected AMS adapter.
Definition: Dxl.c:174
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
void MObjectSetText(MOBJECT obj, const char *text)
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
int AMS_HomeDefault(int id, int mota, int motb)
Definition: Dxl.c:567
unsigned long divider[AMSMAX][2]
Divider for the frequency.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
#define GASCODNG4
GASCODNG 4.
void Message(char *str, int er)
Create a message shell for the AMS errors (Debug Use). .
Definition: Dxl.c:1085
#define SPATRAM3
SPATRAM3.
MirrorSt MIS
Mirror.
Definition: DAS_Spat.c:61
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
controlpanel ContrPanel
Control Panel Structure.
int AMS_AzzeraCoord(int id, int mtr)
Set to zero the number of steps on the selected motor Set to zero the number of steps on the selecte...
Definition: Dxl.c:439
#define AMS1
AMS1 address.
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
int AMS_dirfin(int id, int dira, int dirb)
Set Final Directions .
Definition: Dxl.c:457
int EqType
Spectrometer Type.
int HomeTrack(char *buf, int id, int sm, int mode)
Definition: Init.c:518
float SMfraz(int t)
denominator value of the stepping ratio
Definition: Spat_Device.c:129
int AMS_DoPos(int id, int dira, int dirb, unsigned long stepa, unsigned long stepb)
Execute Positioning Execute Stepper positioning. Make all the control on the status of the selected m...
Definition: Dxl.c:644
int power[AMSMAX][2]
Stepper Motors Power.
const char * Mir_CodeTropo[]
const char array for the realisation of the Mirrors buttons in the Mirror shell for TROPOGAS ...
Definition: DAS_Spat.c:234
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:

§ HomeMirrorFast()

int HomeMirrorFast ( void  )

(Fastest) Mirror in the reference Position.
The Mirror reaches the reference Position. Similar to HomeMirror(void), but faster

Returns
er:
  • = 0 –> Operation concluded succesfully
  • = 1 –> Problems in positioning

§ HomeNDFiltersFast()

int HomeNDFiltersFast ( void  )

(Fastest) ND Fliter wheel in the reference Position.
The ND Fliter wheel reaches the reference Position. Similar to HomeFilterWheel(void), but faster

Returns
er:
  • = 0 –> Operation concluded succesfully
  • = 1 –> Problems in positioning

Definition at line 941 of file Init.c.

References ACKLEN, controlpanel::Albl_LS, AMS2, AMS_AzzeraCoord(), AMS_chkbitsts(), AMS_Default(), AMS_dirfin(), AMS_TrackOff(), AMS_TrackOn(), optionini::amsprogbar, DXL_par::buftx, gui::ContrPanel, D_VRange(), DB_InitAMS(), das::DOption, DXL_RxStr(), DXL_TxStr(), FWS, das::Gui, controlpanel::LedSM, Message(), MLoopWhileEvents(), MObjectSetText(), MPixmapSetImageFile(), FilterWheelSt::Pos, stepm::power, stepm::slope, stepm::SM_A, stepm::SM_B, stepm::speed, stepm::speed_Hz, st, Status(), stepm::step, and das::StepM.

Referenced by DB_InitAMS().

942 {
943  int er, d;
944  char buf[40];
945  long count;
946  double t;
947  int FlgHomeFW = 1;
948  unsigned long st, et, x;
949 
950  sprintf(DXL.buftx, "*00000100"); //d = 12, buio --> senso orario
951  DXL_TxStr(DXL.buftx, strlen(DXL.buftx));
952  d = ACKLEN;
953  er = DXL_RxStr(buf, &d);
954 
955  st = GetTickCount();
956 
957  // Read input
958  d = AMS_chkbitsts(AMS2, 1);
959 
960  d = !d;
961 
962  if(d)
963  {
964  t = 10E6 / (DAS.StepM.speed_Hz[AMS2][DAS.StepM.SM_A] * 1000) ;
965  count = (long) t;
966  AMS_TrackOn(AMS2, 0, 1, 0, count);
967 
968 
970  D_VRange("Homing ND filter",0, 0, 192, 255);
971 
972  do
973  {
974  // Read input
975  d = AMS_chkbitsts(AMS2, 1);
976  MLoopWhileEvents(0);
977  if(d == 1)
978  {
979  er = AMS_TrackOff(AMS2, 1, 1);
980  FlgHomeFW = 0;
981  }
982 
983  /*************************************************************/
984  //For progress bar display
985  // D_Homing(DAS.Gui.ContrPanel.Albl_LS[0], 0, 2000, FlgHomeMir);
986  et = GetTickCount();
987  x = labs(et - st);
988 
989  //if((x % 10) == 0 && x > 0)
990  if(x > 0)
991  {
993  D_VRange(NULL, (long) x * 100 / 5000, 255, 0, 0 );
994  sprintf(buf, "%.1lf sec.", (double)fabs(((double)(labs(et - st) - 5000))/1000.0 ));
996  }
997  /***************************************************/
998  }while (FlgHomeFW);
999 
1000  if(DAS.DOption.amsprogbar)
1001  D_VRange(NULL, 100, 0,0,0);
1002 
1003  // Set final directions
1004  AMS_dirfin(AMS2, 1, 1);
1005  // Set default values
1006  AMS_Default(AMS2);
1007 
1008  // Re-Init AMS2 ( with no Home)
1009  er = DB_InitAMS(AMS2, 1, DAS.StepM.power[AMS2][DAS.StepM.SM_A],
1014 
1015  }
1016 
1017  er = AMS_AzzeraCoord(AMS2, 1);
1018  if(er) { Message("No Zero Coord ND FW", er); }
1019 
1020  FWS.Pos = 0;
1021  sprintf(buf, "%s", "NULL");
1023  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS2][DAS.StepM.SM_B], "SYS\\ledGreen.bmp");
1024  Status("Home for ND Filter Wheel...DONE !");
1025 
1026  return 0;
1027 }
stepm StepM
Stepper motors parameters structure.
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.
void MLoopWhileEvents(int discard)
optionini DOption
Options for DAS execution.
#define AMS2
AMS2 address.
char buftx[1024]
Tx buffer.
Definition: DXL.H:21
void D_VRange(char *str, int val, int, int g, int b)
Create and display the status bar.
Definition: Utils.c:206
int AMS_TrackOn(int id, int adir, int bdir, unsigned long acount, unsigned long bcount)
Activate tracking Procedure for Stepper Motor tracking activation.
Definition: Dxl.c:404
#define ACKLEN
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
int DXL_RxStr(char *rx, int *len)
receive string from a serial port
Definition: Dxl.c:1187
DXL_par DXL
DXL structure.
Definition: Init.c:21
das DAS
DAS structure.
Definition: Init.c:34
int slope[AMSMAX][2]
Stepper Motors Slope.
int DB_InitAMS(int nid, int mod, int powera, int stepa, int slopea, int speeda, int powerb, int stepb, int slopeb, int speedb)
Init selected AMS.
Definition: Init.c:1391
void AMS_Default(int id)
Set default values to AMS parameters Procedure for setting the default values of power.speed, stepping and slope to the selected AMS adapter.
Definition: Dxl.c:174
void MObjectSetText(MOBJECT obj, const char *text)
int Pos
Filter Wheel current Position.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
void Message(char *str, int er)
Create a message shell for the AMS errors (Debug Use). .
Definition: Dxl.c:1085
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
controlpanel ContrPanel
Control Panel Structure.
int AMS_TrackOff(int id, int amot, int bmot)
tracking off Procedure for Stepper Motor tracking de-activation
Definition: Dxl.c:422
int AMS_AzzeraCoord(int id, int mtr)
Set to zero the number of steps on the selected motor Set to zero the number of steps on the selecte...
Definition: Dxl.c:439
int AMS_chkbitsts(int id, int bitn)
check bit status Procedure for the determination of the bit number status.
Definition: Dxl.c:192
static double st
Definition: SOLPOS.C:142
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
int AMS_dirfin(int id, int dira, int dirb)
Set Final Directions .
Definition: Dxl.c:457
void DXL_TxStr(char *tx, int len)
send string to a serial port
Definition: Dxl.c:1153
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
int power[AMSMAX][2]
Stepper Motors Power.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ HomeZenithFast()

int HomeZenithFast ( void  )

Home for Zenith Axis.

Definition at line 1143 of file Init.c.

References controlpanel::Albl_LS, AMS3, AMS_AzzeraCoord(), AMS_chkbitsts(), AMS_Default(), AMS_dirfin(), AMS_Home(), AMS_HomeDefault(), gui::ContrPanel, D_Homing(), DB_InitAMS(), das::Gui, HomeTrack(), stepm::hometype, controlpanel::LedSM, Message(), MObjectSetText(), MPixmapSetImageFile(), ZenithSt::Pos, stepm::power, SD_Zenith_H(), stepm::slope, stepm::SM_A, stepm::SM_B, stepm::speed, st, Status(), stepm::step, and das::StepM.

Referenced by DB_InitAMS(), DB_TestHomeTypeCB(), and E_Home_SM5().

1144 {
1145 
1146  int DIR[] = { 0, 0 };
1147 // long count;
1148 // double t;
1149  int er, d, FlgZenPos = 1,h = 0,k = 0;
1150  char buf[80];
1151  unsigned long st;
1152 
1153 
1154 
1155 
1156 
1157  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS3][DAS.StepM.SM_A], "SYS\\ledoff.bmp");
1158  sprintf(buf, "%s", "Homing");
1160  Status("Home for Zenith...");
1161 
1162  st = GetTickCount();
1163 
1164  //Home bit
1165  d = AMS_chkbitsts(AMS3, 3);
1166  //EndRun 1 bit
1167  h = AMS_chkbitsts(AMS3, 6);
1168  //EndRun 2 bit
1169  k = AMS_chkbitsts(AMS3, 7);
1170 
1171  st = GetTickCount();
1172 
1173 
1174 
1175 
1176  if(DAS.StepM.hometype[AMS3][DAS.StepM.SM_A] == 0) //Home Standard
1177  {
1178  er = AMS_Home(AMS3, 1, 0);
1180  }
1181  if(DAS.StepM.hometype[AMS3][DAS.StepM.SM_B] == 1) //Home with Default
1182  {
1183  er = AMS_HomeDefault(AMS3, 1, 0);
1185  }
1186  //Home with tracking with setted values of speed and step/round
1187  if(DAS.StepM.hometype[AMS3][DAS.StepM.SM_A] == 2)
1188  {
1189  sprintf(buf, "Homing Zenith");
1190  er = HomeTrack(buf, AMS3, DAS.StepM.SM_A, 0);
1191  }
1192 
1193  AMS_dirfin(AMS3, 1, 0);
1194 
1195  AMS_Default(AMS3);
1196 
1197  // Re-Init AMS3 ( with no Home)
1198  er = DB_InitAMS(AMS3, 1, DAS.StepM.power[AMS3][DAS.StepM.SM_A],
1203 
1204 
1205  ZST.Pos = 0;
1206 
1207  //SD_Zenith_H(-3);
1208  //ZST.Pos = 0;
1209 
1210  er = AMS_AzzeraCoord(AMS3, 0);
1211  if(er) { Message("No Zero Coord Zenith", er); }
1212 
1213  SD_Zenith_H(-90);
1214 
1215  //ZST.Pos = -90;
1216  //sprintf(buf, "%s", "-90.0");
1217 
1218  ZST.Pos = 0;
1219  sprintf(buf, "%s", "0.0");
1221  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS3][DAS.StepM.SM_A], "SYS\\ledGreen.bmp");
1222  Status("Home for Zenith..DONE");
1223 
1224 
1225  return 0;
1226 }
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
int hometype[AMSMAX][2]
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
int D_Homing(MOBJECT p, int id, int sm, int tout)
Definition: Init.c:470
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
int AMS_Home(int id, int mota, int motb)
Home position for the selected motor the home position is reached with the standard parameters (1KHz...
Definition: Dxl.c:549
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
das DAS
DAS structure.
Definition: Init.c:34
int slope[AMSMAX][2]
Stepper Motors Slope.
int DB_InitAMS(int nid, int mod, int powera, int stepa, int slopea, int speeda, int powerb, int stepb, int slopeb, int speedb)
Init selected AMS.
Definition: Init.c:1391
void AMS_Default(int id)
Set default values to AMS parameters Procedure for setting the default values of power.speed, stepping and slope to the selected AMS adapter.
Definition: Dxl.c:174
void MObjectSetText(MOBJECT obj, const char *text)
int AMS_HomeDefault(int id, int mota, int motb)
Definition: Dxl.c:567
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
void Message(char *str, int er)
Create a message shell for the AMS errors (Debug Use). .
Definition: Dxl.c:1085
ZenithSt ZST
Zenith.
Definition: Init.c:26
int SD_Zenith_H(float ang)
Definition: Spat_Device.c:2816
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
controlpanel ContrPanel
Control Panel Structure.
int AMS_AzzeraCoord(int id, int mtr)
Set to zero the number of steps on the selected motor Set to zero the number of steps on the selecte...
Definition: Dxl.c:439
int AMS_chkbitsts(int id, int bitn)
check bit status Procedure for the determination of the bit number status.
Definition: Dxl.c:192
static double st
Definition: SOLPOS.C:142
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
int AMS_dirfin(int id, int dira, int dirb)
Set Final Directions .
Definition: Dxl.c:457
int HomeTrack(char *buf, int id, int sm, int mode)
Definition: Init.c:518
double Pos
Zenith Current Position.
#define AMS3
AMS3 address.
int power[AMSMAX][2]
Stepper Motors Power.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ int2hertz()

double int2hertz ( int  mod,
int  k 
)

Definition at line 2213 of file DAS_Spat_ConfCBs.c.

Referenced by AssignParam(), and CONFP_AMS_TabSingMotor().

2214 {
2215  double c;
2216 
2217  c = (125 * ((double) k + 1.0)) / 1000 ;
2218 
2219  return c;
2220 }
+ Here is the caller graph for this function:

§ int2perc()

double int2perc ( int  mod,
int  k 
)

translate the AMS digit unit in text.
The power assigned to the motor trough the AMS, is translated in text

Parameters
mod–> int not used (0)
k–> int containing the decimal value
Returns
c –> percentage

Definition at line 2202 of file DAS_Spat_ConfCBs.c.

Referenced by AssignParam(), and CONFP_AMS_TabSingMotor().

2203 {
2204  double c;
2205 
2206  c = (1.0 - (76.0 - (double) k ) / 76.0) * 100.0;
2207  return c;
2208 }
+ Here is the caller graph for this function:

§ IoCreateCB()

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

Definition at line 90 of file DOAS_FullProj.c.

Referenced by MDCreateDOAS_MainSh().

91 {
92 
93 }
+ Here is the caller graph for this function:

§ IoSetupCB()

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

Definition at line 86 of file DOAS_FullProj.c.

Referenced by MDCreateDOAS_MainSh().

87 {
88 
89 }
+ Here is the caller graph for this function:

§ LinkSpectraCB()

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

Definition at line 179 of file DOAS_FullProj.c.

References MMessageDialog().

Referenced by MDCreateDOAS_MainSh().

180 {
181 
182  MMessageDialog("DAS information", "The procedure is not yet implemented!!", " Ok ", NULL);
183 }
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:

§ listval2fraz()

void listval2fraz ( int  mod,
int  val 
)

Decimal value to ratio value
The decimal value indicating the fractioning of the step is translated in ratio (i.e. 0 –> 1/2 = 400 s/r, 1–> 1/4 =800 s/r)

Parameters
modNOT USED (0)
valsteps

Definition at line 2236 of file DAS_Spat_ConfCBs.c.

References lfraz.

Referenced by CONFP_AMS_TabSingMotor().

2237 {
2238 
2239 
2240  int c = (int) val;
2241 
2242  switch (c)
2243  {
2244  case 0:
2245  {
2246  sprintf(lfraz, " 1/2");
2247  break;
2248  }
2249  case 1:
2250  {
2251  sprintf(lfraz, " 1/4");
2252 
2253  break;
2254  }
2255  case 2:
2256  {
2257  sprintf(lfraz, " 1/5");
2258 
2259  break;
2260  }
2261  case 3:
2262  {
2263  sprintf(lfraz, " 1/8");
2264 
2265  break;
2266  }
2267  case 4:
2268  {
2269  sprintf(lfraz, " 1/10");
2270 
2271  break;
2272  }
2273  case 5:
2274  {
2275  sprintf(lfraz, " 1/16");
2276 
2277  break;
2278  }
2279  case 6:
2280  {
2281  sprintf(lfraz, " 1/25");
2282 
2283  break;
2284  }
2285  case 7:
2286  {
2287  sprintf(lfraz, " 1/32");
2288 
2289  break;
2290  }
2291  case 8:
2292  {
2293  sprintf(lfraz, " 1/50");
2294 
2295  break;
2296  }
2297  case 9:
2298  {
2299 
2300  sprintf(lfraz, " 1/64");
2301  break;
2302  }
2303  case 10:
2304  {
2305  sprintf(lfraz, "1/125");
2306 
2307  break;
2308  }
2309  case 11:
2310  {
2311  sprintf(lfraz, "1/128");
2312  ;
2313  break;
2314  }
2315  case 12:
2316  {
2317  sprintf(lfraz, "1/250");
2318 
2319  break;
2320  }
2321  case 13:
2322  {
2323  sprintf(lfraz, "1/256");
2324 
2325  break;
2326  }
2327 
2328  }
2329 
2330 }
char lfraz[6]
Definition: DAS_Spat_Conf.c:94
+ Here is the caller graph for this function:

§ LoadDasSysCol()

int LoadDasSysCol ( void  )

Load system colors. Procedure that load the DAS colors in the file {homedir}/config/DASSysColor.INI.

Returns
int

Definition at line 811 of file Load.c.

References _MAX_PATH, BIL, d_fileman::CONFIGDIREQUIPMENT, palette::DB_BG, palette::DB_BG_Albl, palette::DB_BG_lblUP, palette::DB_BG_Plbl, palette::DB_BG_RButt, palette::DB_FG_Albl, palette::DB_FG_lblUP, palette::DB_FG_Plbl, palette::DB_FG_RButt, palette::DB_Sel, palette::DB_UnSel, palette::DB_UnSelFG, bil::DFILEM, FIXED_SMALL, FlushLine(), HELV_SMALL, MSetInputPromptFgRGB(), MSetInputPromptFonts(), MSetInputPromptRGB(), MSetMessageDialogFgRGB(), MSetMessageDialogFonts(), MSetMessageDialogRGB(), and ReadLine().

Referenced by MGUIMain(), and ModifyConfFileCB().

812 {
813 
814  FILE *fs;
815  char str[80];
816  char buff[_MAX_PATH];
817 
818  sprintf(buff, "%s\\DASSysColor.INI", BIL.DFILEM.CONFIGDIREQUIPMENT);
819  fs = fopen(buff, "r");
820 
821  if(fs == NULL) return 1;
822 
823  ReadLine(str, 80, fs); //###########################################
824  ReadLine(str, 80, fs); //# DAS Default Color #
825  ReadLine(str, 80, fs); //# by DanBo #
826  ReadLine(str, 80, fs); //###########################################
827  ReadLine(str, 80, fs); //# All these values can be modified, but #
828  ReadLine(str, 80, fs); //# DO NOT Exchange the order #
829  ReadLine(str, 80, fs); //###########################################
830  ReadLine(str, 80, fs); //# Selected Buttons #
831 
832  fscanf(fs, "%d%d%d", &DPAL.DB_Sel[0], &DPAL.DB_Sel[1],&DPAL.DB_Sel[2]);
833 
834  FlushLine(str, 80, fs);
835  ReadLine(str, 80, fs);
836 
837 
838  fscanf(fs, "%d%d%d", &DPAL.DB_UnSel[0],&DPAL.DB_UnSel[1],&DPAL.DB_UnSel[2]);
839 
840  FlushLine(str, 80, fs);
841  ReadLine(str, 80, fs);
842  fscanf(fs, "%d%d%d", &DPAL.DB_UnSelFG[0], &DPAL.DB_UnSelFG[1],&DPAL.DB_UnSelFG[2]);
843 
844  FlushLine(str, 80, fs);
845  ReadLine(str, 80, fs);
846 
847  fscanf(fs, "%d%d%d", &DPAL.DB_BG[0], &DPAL.DB_BG[1], &DPAL.DB_BG[2]);
848 
849  FlushLine(str, 80, fs);
850  ReadLine(str, 80, fs);
851 
852  fscanf(fs, "%d%d%d", &DPAL.DB_BG_Albl[0],&DPAL.DB_BG_Albl[1],&DPAL.DB_BG_Albl[2]);
853 
854  FlushLine(str, 80, fs);
855  ReadLine(str, 80, fs);
856 
857  fscanf(fs, "%d%d%d", &DPAL.DB_FG_Albl[0],&DPAL.DB_FG_Albl[1],&DPAL.DB_FG_Albl[2]);
858 
859  FlushLine(str, 80, fs);
860  ReadLine(str, 80, fs);
861 
862  fscanf(fs, "%d%d%d", &DPAL.DB_BG_Plbl[0],&DPAL.DB_BG_Plbl[1],&DPAL.DB_BG_Plbl[2]);
863 
864  FlushLine(str, 80, fs);
865  ReadLine(str, 80, fs);
866 
867  fscanf(fs, "%d%d%d", &DPAL.DB_FG_Plbl[0],&DPAL.DB_FG_Plbl[1],&DPAL.DB_FG_Plbl[2]);
868 
869  FlushLine(str, 80, fs);
870  ReadLine(str, 80, fs);
871 
872  fscanf(fs, "%d%d%d", &DPAL.DB_BG_lblUP[0],&DPAL.DB_BG_lblUP[1],&DPAL.DB_BG_lblUP[2]);
873 
874  FlushLine(str, 80, fs);
875  ReadLine(str, 80, fs);
876 
877  fscanf(fs, "%d%d%d", &DPAL.DB_FG_lblUP[0],&DPAL.DB_FG_lblUP[1],&DPAL.DB_FG_lblUP[2]);
878 
879  FlushLine(str, 80, fs);
880  ReadLine(str, 80, fs);
881 
882  fscanf(fs, "%d%d%d", &DPAL.DB_BG_RButt[0],&DPAL.DB_BG_RButt[1],&DPAL.DB_BG_RButt[2]);
883 
884  FlushLine(str, 80, fs);
885  ReadLine(str, 80, fs);
886 
887  fscanf(fs, "%d%d%d", &DPAL.DB_FG_RButt[0],&DPAL.DB_FG_RButt[1],&DPAL.DB_FG_RButt[2]);
888 
889  FlushLine(str, 80, fs);
890  ReadLine(str, 80, fs);
891 
892 
893  fclose(fs);
894 
895  /**********************************************************************************/
896  // Set the message dialog color and font format
903  /**********************************************************************************/
904 
905 
906  return 0;
907 }
short DB_BG_lblUP[3]
Background Capital Letters Labels Color UP.
void MSetInputPromptRGB(int r, int g, int b)
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
void MSetMessageDialogFonts(MTFont text_font, MTFont buttons_font)
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
void MSetInputPromptFonts(MTFont text, MTFont edit, MTFont btn)
void MSetInputPromptFgRGB(int r, int g, int b)
short DB_Sel[3]
Selected Buttons Colors.
void MSetMessageDialogFgRGB(int r, int g, int b)
void MSetMessageDialogRGB(int r, int g, int b)
short DB_BG_RButt[3]
Background Radio Buttons.
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
d_fileman DFILEM
Definition: bildef.h:257
#define HELV_SMALL
Definition: Mguidefs.h:881
#define FIXED_SMALL
Definition: Mguidefs.h:878
palette DPAL
Definition: Load.c:27
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
#define _MAX_PATH
Definition: Dildef.h:202
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
short DB_BG[3]
Default Background Color.
short DB_FG_RButt[3]
Foreground Radio Buttons.
bil BIL
Definition: 2DPlot.c:28
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
short DB_FG_lblUP[3]
Foreground Capital Letters Labels Color UP.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadDB_DefectPixel()

int LoadDB_DefectPixel ( char *  buff)

Load Defective pixel mask. Procedure that load the Defective pixel mask in the file {homedir}/config/ccd_defect_Danbo.cor.

Returns
int

Definition at line 182 of file Load.c.

References CITM, COL, DEND, DFetch(), DREM, E_CItm(), E_Col(), E_DREM(), E_PItm(), E_Pix(), E_RItm(), E_Row(), IsCnt, IsSiz, Istruction, PITM, PIX, RITM, and ROW.

Referenced by DB_InitCamera(), and SelDefPixFileCB().

183 {
184 
185  int fs;
186  long siz;
187 // char str[80];
188  int exit = 1;
189  int ccdCommand =0;
190 
191  //fs = open("CONFIG\\CCD_DEFECT_DANBO.COR", O_RDONLY);
192  fs = open(buff, O_RDONLY);
193  if(fs < 0) return 1;
194  siz = filelength(fs);
195 
196  Istruction = malloc(siz);
197  read(fs, Istruction, siz);
198 
199  close(fs);
200 
201  IsCnt = 0;
202  IsSiz = siz;
203 
204 
205  do
206  {
207  ccdCommand = DFetch();
208  if(ccdCommand)
209  {
210  // Lista delle procedure attivabili
211  switch(ccdCommand)
212  {
213  case DREM: ccdCommand = 0; E_DREM(); break; // 1
214  case PIX: ccdCommand = 0; E_Pix(); break; // 2
215  case PITM: ccdCommand = 0; E_PItm(); break; // 3
216  case COL: ccdCommand = 0; E_Col(); break; // 4
217  case CITM: ccdCommand = 0; E_CItm(); break; // 5
218  case ROW: ccdCommand = 0; E_Row(); break; // 6
219  case RITM: ccdCommand = 0; E_RItm(); break; // 7
220  case DEND: ccdCommand = 0; exit=0; break; // 8
221 
222  }
223 
224  }
225 
226  }while(exit);
227 
228  free(Istruction);
229 
230 
231  return 0;
232 
233 }
long IsSiz
Definition: Load.c:51
#define PIX
Pixel identifier.
void E_Row()
Definition: Load.c:155
long IsCnt
Definition: Load.c:50
void E_DREM(void)
Definition: Load.c:79
#define COL
Column identifier.
char * Istruction
Definition: Load.c:48
#define PITM
Number of Pixel items identifier.
void E_CItm()
Definition: Load.c:135
#define ROW
Row identifier.
void E_Col()
Definition: Load.c:130
void E_RItm()
Definition: Load.c:159
int DFetch()
Definition: Load.c:87
#define DREM
text after this is a comment
#define RITM
Number of Rows items identifier.
void E_Pix()
Definition: Load.c:103
void E_PItm()
Definition: Load.c:108
#define CITM
Number of Columns items identifier.
#define DEND
End of File.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadDB_DispCoeff()

int LoadDB_DispCoeff ( void  )

Load dispersion parameters. Procedure that load the dispersion parameters from file {homedir}/DOAS/DispCoeff.ini.

Returns
int

Definition at line 234 of file Load.c.

References _MAX_PATH, BIL, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, FlushLine(), doas::k1, doas::k2, MMessageDialog(), doas::pixref, ReadLine(), doas::wlc, and doas::wlref.

Referenced by DB_EqTypeCB(), DB_EqTypePlotCB(), InitCCD_AMS(), MDCreateDOAS_MainSh(), MGUIMain(), and RunOLP().

235 {
236 
237  FILE *fs;
238  char str[80], dpath[_MAX_PATH], buff[255];
239  int i, ni;
240 // struct doas *pd;
241 // pd = &DOAS.wlc[0];
242 
243  //BIL.DFILEM.CONFIGDIREQUIPMENT
244  //Set Data Directory
245  //sprintf(dpath, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "DOAS\\Sys\\DispCoeff.INI" );
246  sprintf(dpath, "%s\\%s", BIL.DFILEM.CONFIGDIREQUIPMENT, "DispCoeff.INI" );
247 
248  fs = fopen(dpath, "r");
249 
250 
251  if(fs == NULL)
252  {
253  sprintf(buff,"File: %s\nNOT FOUND\nPlease check the existence of this file", dpath);
254  MMessageDialog("DAS Inf.", buff,"OK", NULL);
255  return 1;
256  }
257 
258  ReadLine(str, 80, fs); // ##############################################
259  ReadLine(str, 80, fs); // # Grating Dispersion Parameters #
260  ReadLine(str, 80, fs); // ##############################################
261  ReadLine(str, 80, fs); // #--------------------------------------------#
262  ReadLine(str, 80, fs); // # PLEASE DO NOT MODIFY #
263  ReadLine(str, 80, fs); // #--------------------------------------------#
264  ReadLine(str, 80, fs); // # Number of Item #
265 
266  fscanf(fs, "%d", &ni);
267 
268  FlushLine(str, 80, fs);
269  ReadLine(str, 80, fs); // # Wl K1 K2 #
270 
271  for (i=0;i<ni;i++)
272  {
273  fscanf(fs, "%d%lf%lf%lf%d", &DOAS.wlc[i], &DOAS.k1[i], &DOAS.k2[i], &DOAS.wlref[i], &DOAS.pixref[i]);
274 // fscanf(fs, "%d%lf%lf%lf%d", &pd->wlc[i], &pd->k1[i], &pd->k2[i], &pd->wlref[i], &pd->pixref[i]);
275  FlushLine(str, 80, fs);
276 
277  }
278 
279  ReadLine(str, 80, fs); // ##############################################
280 
281  fclose(fs);
282 
283  return 0;
284 }
double k2[20]
k2 dispersion parameter -slope (x stretch2
Definition: DOASdef.h:23
double wlref[20]
reference wavelength
Definition: DOASdef.h:20
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 pixref[20]
reference pixel
Definition: DOASdef.h:21
d_fileman DFILEM
Definition: bildef.h:257
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
double k1[20]
k1 dispersion parameter - intercept (x stretch1)
Definition: DOASdef.h:22
#define _MAX_PATH
Definition: Dildef.h:202
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
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
bil BIL
Definition: 2DPlot.c:28
int wlc[20]
Central wavelength.
Definition: DOASdef.h:19
doas DOAS
Definition: Load.c:30
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadDB_Options()

int LoadDB_Options ( void  )

Load Options. Procedure that load the Options in the file {homedir}/config/Options.INI.

Returns
int

Definition at line 390 of file Load.c.

References _MAX_PATH, optionini::aaopmode, optionini::amsprogbar, optionini::avgautor, optionini::avgmode, BIL, d_fileman::CONFIGDIREQUIPMENT, optionini::darkremove, optionini::darksource, optionini::DEFPIXFILENAME, flag::DeltaSZA, dsza::DeltaSZA, bil::DFILEM, DI_FileExist(), flag::DispBlindPix, das::DOption, optionini::emshutter, optionini::filename, optionini::filtertype, FLAG, das::Flag, FlushLine(), optionini::ftpbackup, optionini::hlineafter, optionini::hlinebefore, optionini::imgtype, mige::linked, optionini::maxlvlar, dsza::MaxSZA, optionini::measmode, das::MIGE, dsza::MinSZA, optionini::mirrorimg, N_AVG, omuthr::PID_kd, omuthr::PID_ki, omuthr::PID_kp, optionini::pixcorr, flag::plotW, flag::plotYRange, ReadLine(), optionini::refertemp, optionini::resetEnabled, optionini::resetFreq, optionini::resetType, optionini::savingmode, flag::settempvar, optionini::shuttertype, optionini::smposmode, SZADelta, SZAMax, TOTTEXP, omuthr::TRType, mige::type, flag::Wl, XAX, and YAX.

Referenced by MGUIMain(), and ModifyConfFileCB().

391 {
392  FILE *fs;
393  char str[80];
394  char buff[_MAX_PATH];
395  char CARAT[16];
396  int numlines = 0;
397  int NUMLINESGOOD = 107;
398 
399 
400  sprintf(buff, "%s\\OPTIONS.INI", BIL.DFILEM.CONFIGDIREQUIPMENT);
401  //Open file
402  fs = fopen(buff, "r");
403  // If file not found return 1
404  if(fs == NULL) return 1;
405  //Check the lenght of the Option.ini file (counts lines)
406  //**********************************************
407  while (!feof(fs))
408  {
409  numlines++;
410  ReadLine(str, 80, fs);
411 
412  }
413  //Close file
414  fclose(fs);
415 
416 
417  //*****************************************************
418  //check if the first character of the last line is "#"
419  sprintf(CARAT, "%c", str[0]);
420 
421  if ( (strcmp(CARAT, "#") == 0) && (numlines == NUMLINESGOOD) )
422  {
423  //Re-Open file
424  fs = fopen(buff, "r");
425  // If file not found return 1
426  if(fs == NULL) return 1;
427  //Read file and assign values to parameters
428  ReadLine(str, 80, fs); // ####################################################
429  ReadLine(str, 80, fs); // # Configuration file for OPTIONS Setting. #
430  ReadLine(str, 80, fs); // # By DanBo 10/12/2003 at 20.00.00 #
431  ReadLine(str, 80, fs); // ####################################################
432  ReadLine(str, 80, fs); // # All these flags can be modified on line #
433  ReadLine(str, 80, fs); // # in the CONFIG --> OPTION tabs #
434  ReadLine(str, 80, fs); // #--------------------------------------------------#
435  ReadLine(str, 80, fs); // # Please DO NOT Exange the order of the parameters #
436  ReadLine(str, 80, fs); // #--------------------------------------------------#
437  ReadLine(str, 80, fs); // # Saving Mode: 0 = ASCII, 1 = Binary #
438 
439  fscanf(fs, "%d", &DAS.DOption.savingmode);
440  // check option value
441  if (DAS.DOption.savingmode < 0 || DAS.DOption.savingmode > 1)
442  return 2; // Error in Saving Mode Option
443 
444  FlushLine(str, 80, fs);
445  ReadLine(str, 80, fs); // # File Names:0 = free, 1 = automatic file names #
446  fscanf(fs, "%d", &DAS.DOption.filename);
447  // check option value
448  if (DAS.DOption.filename < 0 || DAS.DOption.filename > 1)
449  return 3; // Error in File Name Option
450 
451  FlushLine(str, 80, fs);
452  ReadLine(str, 80, fs); // # Image Type:0=Mono, 1 = RGB #
453  fscanf(fs, "%d", &DAS.DOption.imgtype);
454  // check option value
455  if (DAS.DOption.imgtype < 0 || DAS.DOption.imgtype > 1)
456  return 4; // Error in Image Type Option
457 
458  FlushLine(str, 80, fs);
459  ReadLine(str, 80, fs); // # CCD Pix Correction: 0=NOT Corrected, 1=Corrected #
460  fscanf(fs, "%d", &DAS.DOption.pixcorr);
461  // check option value
462  if (DAS.DOption.pixcorr < 0 || DAS.DOption.pixcorr > 1)
463  return 5; // Error in Pixel Correction Option
464 
465 
466  FlushLine(str, 80, fs);
467  ReadLine(str, 80, fs); // # File Name for CCD Pix Correction #
468  fscanf(fs,"%s",&DAS.DOption.DEFPIXFILENAME);
469  sprintf(buff, "%s\\%s", BIL.DFILEM.CONFIGDIREQUIPMENT, DAS.DOption.DEFPIXFILENAME);
470  if(!DI_FileExist(buff)) // DI_FileExist --> Return: 1 if PATH exist, else return 0
471  return 37;
472 
473  FlushLine(str, 80, fs);
474  ReadLine(str, 80, fs); // # Measuring Mode:0 = Single, 1 = Averaged #
475  fscanf(fs, "%d", &DAS.DOption.measmode);
476  // check option value
477  if (DAS.DOption.measmode < 0 || DAS.DOption.measmode > 1)
478  return 39; // Error in Measuring Mode Option
479 
480 
481  FlushLine(str, 80, fs);
482  ReadLine(str, 80, fs); // # Averaging Mode:0 = fixed number, 1 = fixed time #
483  fscanf(fs, "%d", &DAS.DOption.avgmode);
484  // check option value
485  if (DAS.DOption.avgmode < 0 || DAS.DOption.avgmode > 1)
486  return 6; // Error in Averaging Mode Option
487 
488  FlushLine(str, 80, fs);
489  ReadLine(str, 80, fs); // # Avg Mode fixed Number of measurements #
490  fscanf(fs, "%d", &N_AVG);
491  // check option value
492  if (N_AVG < 1 || N_AVG > 200)
493  return 7; // Error in Fixed Number of Measurement for Average Option
494 
495  FlushLine(str, 80, fs);
496  ReadLine(str, 80, fs); // # Avg Mode fixed Time Exposure [sec] #
497  fscanf(fs, "%d", &TOTTEXP);
498  // check option value
499  if (TOTTEXP < 0 || TOTTEXP > 100)
500  return 8; // Error in Total Exposure Time for Average Option
501 
502  FlushLine(str, 80, fs);
503  ReadLine(str, 80, fs); // # Remove Dark?: 0 = No, 1 = Yes #
504  fscanf(fs, "%d", &DAS.DOption.darkremove);
505  // check option value
506  if (DAS.DOption.darkremove < 0 || DAS.DOption.darkremove > 1)
507  return 9; // Error in Dark Remove Option
508 
509  FlushLine(str, 80, fs);
510  ReadLine(str, 80, fs); // # Dark source: 0 = Blind Pixels, 1 = Full Frame #
511  fscanf(fs, "%d", &DAS.DOption.darksource);
512  // check option value
513  if (DAS.DOption.darksource < 0 || DAS.DOption.darksource > 1)
514  return 10; // Error in Dark Source Option
515 
516  FlushLine(str, 80, fs);
517  ReadLine(str, 80, fs); // # CCD Temp: 0 = Fixed, 1 = variation vs SZA #
518  fscanf(fs, "%d", &FLAG.settempvar);
519  // check option value
520  if (FLAG.settempvar < 0 || FLAG.settempvar > 1)
521  return 11; // Error in Set CCD Temperature Flag
522 
523  FlushLine(str, 80, fs);
524  ReadLine(str, 80, fs); // # Plot X Scale: 0 = Pixel #, 1 = Wl[A], 2 = wl[nm] #
525  fscanf(fs, "%d", &FLAG.Wl);
526  // check option value
527  if (FLAG.Wl < 0 || FLAG.Wl > 2)
528  return 12; // Error in Plot Scale Flag
529 
530  FlushLine(str, 80, fs);
531  ReadLine(str, 80, fs); // # Plot display: 0 = NO, 1 = Yes #
532  fscanf(fs, "%d", &DAS.Flag.plotW);
533  // check option value
534  if (DAS.Flag.plotW < 0 || DAS.Flag.plotW > 1)
535  return 13; // Error in Plot Display Flag
536 
537  FlushLine(str, 80, fs);
538  ReadLine(str, 80, fs); // # Plot Y Scale: 0 = FullRange(0-65535), 1 = min/max#
539  fscanf(fs, "%d", &FLAG.plotYRange);
540  // check option value
541  if (FLAG.plotYRange < 0 || FLAG.plotYRange > 1)
542  return 14; // Error in Plot Y Scale Flag
543 
544  FlushLine(str, 80, fs);
545  ReadLine(str, 80, fs); // # Measurements performed for SZA <= SZAMax #
546  fscanf(fs, "%d", &SZAMax);
547  // check option value
548  if (SZAMax < 0 || SZAMax > 180)
549  return 15; // Error in SZAMax Parameter
550 
551  FlushLine(str, 80, fs);
552  ReadLine(str, 80, fs); // # Hidden Lines in Plot - Before and After Cent.line#
553  fscanf(fs, "%d", &DAS.DOption.hlinebefore);
554  // check option value
555  if (DAS.DOption.hlinebefore < 0 || DAS.DOption.hlinebefore > 128)
556  return 16; // Error in Hidden Lines in Plot Before the Central one Option
557 
558  FlushLine(str, 80, fs);
559  fscanf(fs, "%d", &DAS.DOption.hlineafter);
560  // check option value
561  if (DAS.DOption.hlineafter < 0 || DAS.DOption.hlineafter > 128)
562  return 17; // Error in Hidden Lines in Plot After the Central one Option
563 
564  FlushLine(str, 80, fs);
565  ReadLine(str, 80, fs); // # Display Blind Pixel: 0 = NO, 1 = Yes #
566  fscanf(fs, "%d", &FLAG.DispBlindPix);
567  // check option value
568  if (FLAG.DispBlindPix < 0 || FLAG.DispBlindPix > 1)
569  return 18; // Error in Display Blind Pixel Flag
570 
571  FlushLine(str, 80, fs);
572  ReadLine(str, 80, fs); // # Perform FTP Back-UP: 0 = NO, 1 = Yes #
573  fscanf(fs, "%d", &DAS.DOption.ftpbackup);
574  // check option value
575  if (DAS.DOption.ftpbackup < 0 || DAS.DOption.ftpbackup > 1)
576  return 19; // Error in Perform FTP Back-UP Option
577 
578  FlushLine(str, 80, fs);
579  ReadLine(str, 80, fs); // # Reference temperature for OMU Thermo-Regulation: #
580  ReadLine(str, 80, fs);// # 0 = AVG Internal Peltier; 1 = Optic; 2 = Grating #
581  fscanf(fs, "%d", &DAS.DOption.refertemp);
582  // check option value
583  if (DAS.DOption.refertemp < 0 || DAS.DOption.refertemp > 2)
584  return 20; // Error in Reference temperature for OMU Thermo-Regulation Option
585 
586  FlushLine(str, 80, fs);
587  ReadLine(str, 80, fs); // # OMU Thermo-Regulation mode: #
588  ReadLine(str, 80, fs); // # 0 = Cold Only; 1 = Heat only; 2 = Cold/Heat #
589  fscanf(fs, "%d", &OMUTHR.TRType);
590  // check option value
591  if (OMUTHR.TRType < 0 || OMUTHR.TRType > 2)
592  return 21; // Error in OMU Thermo-Regulation mode
593 
594  FlushLine(str, 80, fs);
595  ReadLine(str, 80, fs); // # Mirroring CCD Image along X axis #
596  ReadLine(str, 80, fs); // # 0 = NO Mirroring; 1 = Mirror image #
597  fscanf(fs, "%d", &DAS.DOption.mirrorimg[XAX]);
598  // check option value
599  if (DAS.DOption.mirrorimg[XAX] < 0 || DAS.DOption.mirrorimg[XAX] > 1)
600  return 22; // Error in Mirroring CCD Image along X axis Option
601 
602  FlushLine(str, 80, fs);
603  ReadLine(str, 80, fs); // # Mirroring CCD Image long Y axis #
604  ReadLine(str, 80, fs); // # 0 = NO Mirroring; 1 = Mirror image #
605  fscanf(fs, "%d", &DAS.DOption.mirrorimg[YAX]);
606  // check option value
607  if (DAS.DOption.mirrorimg[YAX] < 0 || DAS.DOption.mirrorimg[YAX] > 1)
608  return 23; // Error in Mirroring CCD Image along Y axis Option
609 
610  FlushLine(str, 80, fs);
611  ReadLine(str, 80, fs); // # AMS Option - Stepper motor Positioning mode #
612  ReadLine(str, 80, fs); // # 0 = Sequential; 1 = Simultaneous #
613  fscanf(fs, "%d", &DAS.DOption.smposmode);
614  // check option value
615  if (DAS.DOption.smposmode < 0 || DAS.DOption.smposmode > 1)
616  return 24; // Error in AMS Option - Stepper motor Positioning mode
617 
618  FlushLine(str, 80, fs);
619  ReadLine(str, 80, fs); //"# AMS Option - Stepper motor Positioning mode #
620  ReadLine(str, 80, fs); //"# 0 = Sequential; 1 = Simultaneous #
621  fscanf(fs, "%d", &DAS.DOption.amsprogbar);
622  // check option value
623  if (DAS.DOption.amsprogbar < 0 || DAS.DOption.amsprogbar > 1)
624  return 25; // Error in AMS Option - Display Progression Bars
625 
626  FlushLine(str, 80, fs);
627  ReadLine(str, 80, fs); //# Autorange before Average #
628  ReadLine(str, 80, fs); //# 0 = NO Autoranging, 1 = Autoranging #
629  fscanf(fs, "%d", &DAS.DOption.avgautor);
630  // check option value
631  if (DAS.DOption.avgautor < 0 || DAS.DOption.avgautor > 1)
632  return 26; // Error in Autorange before Average Option
633 
634  FlushLine(str, 80, fs);
635  ReadLine(str, 80, fs); //# MIGE Platform connection #;
636  ReadLine(str, 80, fs); //# 0 = NOT Connected, 1 = Connected #;
637  fscanf(fs, "%d", &DAS.MIGE.linked);
638  // check option value
639  if (DAS.MIGE.linked < 0 || DAS.MIGE.linked > 1)
640  return 27; // Error in MIGE Linked Parameter
641 
642  FlushLine(str, 80, fs);
643  ReadLine(str, 80, fs); //# MIGE Platform Type #;
644  ReadLine(str, 80, fs); //# 0 = AltAz V 0.5, 1 = MIGE V. 3 #;
645  fscanf(fs, "%d", &DAS.MIGE.type);
646  // check option value
647  if (DAS.MIGE.type < 0 || DAS.MIGE.type > 2)
648  return 28; // Error in MIGE Type Parameter
649 
650  FlushLine(str, 80, fs);
651  ReadLine(str, 80, fs); //# Alt AzPlatfor operating mode #
652  ReadLine(str, 80, fs); // # 0 = Sun Track, 1 = AntiSunTrack, 2 = FreePos #
653  fscanf(fs, "%d", &DAS.DOption.aaopmode);
654  // check option value
655  if (DAS.DOption.aaopmode < 0 || DAS.DOption.aaopmode > 2)
656  return 29; // Error in MIGE Operating mode Option
657 
658  FlushLine(str, 80, fs);
659  ReadLine(str, 80, fs); //#EMShutter #
660  ReadLine(str, 80, fs); // #0 = NOT installed, 1 = Installed #
661  fscanf(fs, "%d", &DAS.DOption.emshutter);
662  // check option value
663  if (DAS.DOption.emshutter < 0 || DAS.DOption.emshutter > 1)
664  return 30; // Error in Shutter Connection Option
665 
666  FlushLine(str, 80, fs);
667  ReadLine(str, 80, fs); //# Shutter Type #
668  ReadLine(str, 80, fs); //# 0 = VS25, 1 = ROTSHUT, 2 = TORQUEM #
669  fscanf(fs, "%d", &DAS.DOption.shuttertype);
670  // check option value
671  if (DAS.DOption.shuttertype < 0 || DAS.DOption.shuttertype > 2)
672  return 31; // Error in Shutter Type Option
673 
674  FlushLine(str, 80, fs);
675  ReadLine(str, 80, fs); //# Measurements driven by SZA #
676  ReadLine(str, 80, fs); //# Format: a, b, c, d where: #
677  ReadLine(str, 80, fs); //# a = Flag; 0 = NOT Active, 1 = Active #
678  ReadLine(str, 80, fs); //# b = DeltaSZA, value of Delta SZA (x.x deg) #
679  ReadLine(str, 80, fs); //# c = MinSZA, value of Min SZA (xx deg) #
680  ReadLine(str, 80, fs); //# d = MaxSZA, value of Max SZA (xx deg) #
681  fscanf(fs, "%d %lf %lf %lf", &DAS.Flag.DeltaSZA, &SZADelta.DeltaSZA, &SZADelta.MinSZA, &SZADelta.MaxSZA);
682  // check option value
683  if (DAS.Flag.DeltaSZA < 0 || DAS.Flag.DeltaSZA > 1)
684  return 32; // Error DeltaSZA Flag
685  // check option value
686  if (SZADelta.DeltaSZA < 0 || SZADelta.DeltaSZA > 45)
687  return 33; // Error DeltaSZA Value
688  // check option value
689  if (SZADelta.MinSZA < 0)
690  return 34; // Error: MinSZA < 0
691  // check option value
692  if (SZADelta.MaxSZA < 0)
693  return 35; // Error: MaxSZA < 0
694  // check option value
696  return 36; // Error: MinSZA > MaxSZA Value
697 
698  FlushLine(str, 80, fs);
699 
700  ReadLine(str, 80, fs); //# Filter Wheel type
701  ReadLine(str, 80, fs); //# 0=simple, 1= double, 2= simple +TorqueM
702  fscanf(fs, "%d", &DAS.DOption.filtertype);
703  // check option value
704  if (DAS.DOption.filtertype < 0 || DAS.DOption.filtertype > 2)
705  return 32; // Error in Filter Wheel Type Option
706 
707  FlushLine(str, 80, fs);
708 
709  ReadLine(str, 80, fs); //#PID Parameters #
710  ReadLine(str, 80, fs); //#PID_kp PID_ki PID_kd #
711  fscanf(fs, "%f %f %f", &OMUTHR.PID_kp, &OMUTHR.PID_ki, &OMUTHR.PID_kd);
712 
713  FlushLine(str, 80, fs);
714 
715 
716  //RESET PARAMETERS
717  ReadLine(str, 80, fs); //#DAS/Windows Reset: Enabled = 1, Disabled = 0 #
718  fscanf(fs, "%d", &DAS.DOption.resetEnabled);
719  FlushLine(str, 80, fs);
720 
721  //RESET Type
722  ReadLine(str, 80, fs); //#Reset Type: Hourly = 0, Daily= 1 #
723  fscanf(fs, "%d", &DAS.DOption.resetType);;
724  FlushLine(str, 80, fs);
725  //RESET Frequency
726  ReadLine(str, 80, fs); //#Reset frequency: Hourly=1 to 23, Daily=1 to 365 #
727  fscanf(fs,"%d", &DAS.DOption.resetFreq);
728  FlushLine(str, 80, fs);
729 
730  //AUTORANGING MAX VALUE
731  ReadLine(str, 80, fs); //#AUTORANGING MAX VALUE ( < 63000) #
732  fscanf(fs,"%d", &DAS.DOption.maxlvlar);
733  FlushLine(str, 80, fs);
734 
735 
736 
737 
738  ReadLine(str, 80, fs); // ####################################################
739 
740 
741  fclose(fs);
742 
743  return 0;
744  }
745  else
746  return 999;
747 
748 }
flag FLAG
Definition: CreateForms.c:84
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
dsza SZADelta
Definition: DAS_Spat.c:76
int TRType
Type of thermo regulation (0=TRTCOOL, 1 = TRTHEAT, 2= TRTBOTH)
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 filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
#define XAX
X Axis.
int type
int avgautor
autoranging for averaged measurement, 0 = NO AutoR before average; 1 = AutoR before average; ...
int SZAMax
Maximum SZA for performing measurements.
Definition: DAS_Spat.c:116
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 hlinebefore
Number of HiddenLines before the central line in Plot.
float PID_ki
d_fileman DFILEM
Definition: bildef.h:257
int avgmode
Flag to set Averaging mode: 0 = Repeat measurements for fixed number, 1 = Repeat measurements for fix...
omuthr OMUTHR
Definition: Load.c:33
das DAS
DAS structure.
Definition: Load.c:32
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
double MaxSZA
Maximum SZA.
int emshutter
Presence of the CCD Shutter, emshutter = 1 –> Shutter IS Installed, = 0 –> Shutter NOT Installed...
mige MIGE
double DeltaSZA
DeltaSZA.
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 TOTTEXP
Total Exposure time in Averaging mode.
Definition: DAS_Spat.c:115
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
#define _MAX_PATH
Definition: Dildef.h:202
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
int hlineafter
Number of HiddenLines after the central line in Plot.
int linked
#define YAX
Y Axis.
bil BIL
Definition: 2DPlot.c:28
int mirrorimg[2]
Flag to set the mirroring of the CCD image: 0 = NO Mirroring, 1= YES Mirroring (element 0 for X axis;...
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 measmode
measuring mode: 0 = Single; 1 = Averaged
int settempvar
float PID_kp
int aaopmode
operation mode for the Alt Az Platform, 0 = solar Traxker; 1 = Anti-Solar Tracker; 2 = Free Positioni...
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
int filename
Flag to set file name mode 0=Free choice, 1 = Automatic.
int N_AVG
Number of measurements for Averaging mode in fixed number of meas. mode.
Definition: DAS_Spat.c:113
int darksource
Flag to set Dark source: 0 = Blind Pixels, 1 = Full Frame.
int resetEnabled
DAS/Windows reset option (1 = Enabled; 0 = disabled)
int refertemp
Flag to set the reference temp for thermo-regulation: 0 = AVGPINT; 1 = OPTIC; 2 = GRATING...
C_DEF int DI_FileExist(char *tit)
int resetType
type of period for DAS Reset: 0=Hours, 1=Days
int DispBlindPix
Display Blind Pix: 0 = NO, 1 = Yes.
int shuttertype
type of installed shutter: 0 = VS25, 1 = Rotating Shutter, 2 = TorqueMotor
unsigned int maxlvlar
maximum level of autoranging (max 65000)
double MinSZA
Minimum SZA.
char DEFPIXFILENAME[_MAX_PATH]
defective pixel filename with path
float PID_kd
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadDefaultDFONT()

int LoadDefaultDFONT ( void  )

Load Default Fonts. Procedure that load the DAS fonts if the file {homedir}/config/DASFonts.ini is not present.

Returns
int

Definition at line 757 of file Load.c.

758 {
759 
760 }

§ LoadDefaultDPAL()

int LoadDefaultDPAL ( void  )

Load Default system colors. Procedure that load the DAS colors if the file {homedir}/config/DASSysColor.INI is not present.

Returns
int

Definition at line 762 of file Load.c.

References palette::DB_BG, palette::DB_BG_Albl, palette::DB_BG_lblUP, palette::DB_BG_Plbl, palette::DB_BG_RButt, palette::DB_FG_Albl, palette::DB_FG_lblUP, palette::DB_FG_Plbl, palette::DB_FG_RButt, palette::DB_Sel, and palette::DB_UnSel.

Referenced by MGUIMain().

763 {
764 
765  DPAL.DB_Sel[0] = 190;
766  DPAL.DB_Sel[1] = 190;
767  DPAL.DB_Sel[2] = 190;
768 
769  DPAL.DB_UnSel[0] = 255;
770  DPAL.DB_UnSel[1] = 255;
771  DPAL.DB_UnSel[2] = 255;
772 
773  DPAL.DB_BG[0] = 0;
774  DPAL.DB_BG[1] = 0;
775  DPAL.DB_BG[2] = 0;
776 
777  DPAL.DB_BG_Albl[0] = 0;
778  DPAL.DB_BG_Albl[1] = 0;
779  DPAL.DB_BG_Albl[2] = 0;
780 
781  DPAL.DB_FG_Albl[0] = 255;
782  DPAL.DB_FG_Albl[1] = 255;
783  DPAL.DB_FG_Albl[2] = 255;
784 
785  DPAL.DB_BG_Plbl[0] = 0;
786  DPAL.DB_BG_Plbl[1] = 0;
787  DPAL.DB_BG_Plbl[2] = 0;
788 
789  DPAL.DB_FG_Plbl[0] = 255;
790  DPAL.DB_FG_Plbl[1] = 255;
791  DPAL.DB_FG_Plbl[2] = 255;
792 
793  DPAL.DB_BG_lblUP[0] = 255;
794  DPAL.DB_BG_lblUP[1] = 255;
795  DPAL.DB_BG_lblUP[2] = 255;
796 
797  DPAL.DB_FG_lblUP[0] = 0;
798  DPAL.DB_FG_lblUP[1] = 0;
799  DPAL.DB_FG_lblUP[2] = 0;
800 
801  DPAL.DB_BG_RButt[0] = 0;
802  DPAL.DB_BG_RButt[1] = 0;
803  DPAL.DB_BG_RButt[2] = 0;
804 
805  DPAL.DB_FG_RButt[0] = 255;
806  DPAL.DB_FG_RButt[1] = 255;
807  DPAL.DB_FG_RButt[2] = 255;
808 
809 }
short DB_BG_lblUP[3]
Background Capital Letters Labels Color UP.
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
short DB_Sel[3]
Selected Buttons Colors.
short DB_BG_RButt[3]
Background Radio Buttons.
palette DPAL
Definition: Load.c:27
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
short DB_BG[3]
Default Background Color.
short DB_FG_RButt[3]
Foreground Radio Buttons.
short DB_UnSel[3]
Unselected Buttons Colors.
short DB_FG_lblUP[3]
Foreground Capital Letters Labels Color UP.
+ Here is the caller graph for this function:

§ LoadDFONT()

int LoadDFONT ( void  )

Load Fonts. Procedure that load the DAS fonts from {homedir}/config/DASFonts.ini AVAILABLE for Releases > 2.5.5.

Returns
int

Definition at line 752 of file Load.c.

753 {
754  return 0;
755 }

§ LoadEquipment()

int LoadEquipment ( void  )

Load the type of Equipment. {homedir}/config/param.ini.

Returns
int

Definition at line 1089 of file Load.c.

References _MAX_PATH, BIL, d_fileman::CONFIGDIRCOMMON, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, paramini::EqType, FlushLine(), das::Paramini, and ReadLine().

Referenced by MGUIMain().

1090 {
1091  FILE *fs;
1092  char str[80];
1093  int c;
1094  char buff[_MAX_PATH];
1095 
1096  sprintf(buff, "%s\\Equipment.ini",BIL.DFILEM.CONFIGDIRCOMMON);
1097 
1098 
1099  fs = fopen(buff, "r");
1100  if(fs == NULL) return 1;
1101 
1102  ReadLine(str, 80, fs); //###############################################
1103  ReadLine(str, 80, fs); //# Equipment.INI #
1104  ReadLine(str, 80, fs); //# Configuration file setting equipment type #
1105  ReadLine(str, 80, fs); //###############################################
1106  ReadLine(str, 80, fs); //# 0 = SPATRAM, 1 = TROPOGAS, 2 = LIS #
1107  ReadLine(str, 80, fs); //# 3 = SPATRAMPLUS, 4 = GASCODNG1, 5=GASCOD/OA #
1108  ReadLine(str, 80, fs); //# 6 = GASCODNG2, 7 = GASCODNG3, 8 = GASCODNG4 #
1109  ReadLine(str, 80, fs); //# 9 = SPATRAM2 #
1110  ReadLine(str, 80, fs); //###############################################
1111 
1112  fscanf(fs, "%d", &DAS.Paramini.EqType); // Instrument Type(0 = SPATRAM, 1 = TROPOGAS, 2 = LIS, 3 = SPATRAMPLUS, 4 = GASCODNG1)
1113  FlushLine(str, 80, fs);
1114 
1115  c= DAS.Paramini.EqType;
1116  switch (c)
1117  {
1118  case 0:
1119 // DAS.Paramini.EqType = 0; //SPATRAM;
1120  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAM",BIL.DFILEM.CONFIGDIRCOMMON);
1121  break;
1122  case 1:
1123 // DAS.Paramini.EqType = 1; //TROPOGAS;
1124  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\TROPOGAS",BIL.DFILEM.CONFIGDIRCOMMON);
1125  break;
1126  case 2:
1127 // DAS.Paramini.EqType = 2; //LIS;
1128  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\LIS",BIL.DFILEM.CONFIGDIRCOMMON);
1129  break;
1130  case 3:
1131 // DAS.Paramini.EqType = 3; //SPATRAMPLUS;
1132  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAMPLUS",BIL.DFILEM.CONFIGDIRCOMMON);
1133  break;
1134  case 4:
1135 // DAS.Paramini.EqType = 4; //GASCODNG1;
1136  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG1",BIL.DFILEM.CONFIGDIRCOMMON);
1137  break;
1138  case 5:
1139 // DAS.Paramini.EqType = 5; //GASCODOffAxis;
1140  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODOA",BIL.DFILEM.CONFIGDIRCOMMON);
1141  break;
1142  case 6:
1143 // DAS.Paramini.EqType = 6; //GASCODNG2;
1144  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG2",BIL.DFILEM.CONFIGDIRCOMMON);
1145  break;
1146  case 7:
1147 // DAS.Paramini.EqType = 7; //GASCODNG3;
1148  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG3",BIL.DFILEM.CONFIGDIRCOMMON);
1149  break;
1150  case 8:
1151 // DAS.Paramini.EqType = 8; //GASCODNG4;
1152  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG4",BIL.DFILEM.CONFIGDIRCOMMON);
1153  break;
1154  case 9:
1155 // DAS.Paramini.EqType = 9; //SPATRAM2;
1156  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAM2",BIL.DFILEM.CONFIGDIRCOMMON);
1157  break;
1158  case 10:
1159 // DAS.Paramini.EqType = 10; //SPATRAM3;
1160  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAM3",BIL.DFILEM.CONFIGDIRCOMMON);
1161  break;
1162  default:
1163  return c;
1164  }
1165 
1166  return 0;
1167 
1168 }
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
d_fileman DFILEM
Definition: bildef.h:257
das DAS
DAS structure.
Definition: Load.c:32
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
#define _MAX_PATH
Definition: Dildef.h:202
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
bil BIL
Definition: 2DPlot.c:28
int EqType
Spectrometer Type.
char CONFIGDIRCOMMON[_MAX_PATH]
Definition: bildef.h:206
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:

§ LoadExec()

int LoadExec ( char *  fname)

Load file for automatic execution. Procedure that load the file for automatic execution.

Parameters
*fnamepointer to the char variable with the file name containing the keywords
Returns
int

Definition at line 1534 of file Load.c.

References PrgCnt, PrgSiz, and Program.

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

1535 {
1536  int fs;
1537  //unsigned int siz;
1538 // char buff[2048];
1539  long siz;
1540 
1541  fs = open(fname, O_RDONLY );
1542  if(fs < 0) return 0;
1543  siz = filelength(fs);
1544  if(Program)
1545  free(Program);
1546  Program = malloc(siz);
1547  read(fs, Program, siz);
1548  close(fs);
1549  PrgCnt = 0;
1550  PrgSiz = siz;
1551 
1552  return 1;
1553 }
long PrgSiz
Size of the PRG file.
Definition: DAS_Spat.c:94
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:

§ LoadFontCB()

void LoadFontCB ( MOBJECT  obj,
void *  a,
void *  data 
)

This callback tries to load the specified font.

Definition at line 1503 of file DAS_Spat_ConfCBs.c.

Referenced by MDCreateDASConfig().

1504 {
1505 /*
1506  MTFont newfont;
1507  int size;
1508 // int i;
1509  char family[32], buff[8];
1510 /*
1511  * Get user preferences from the EDIT Objects
1512  *
1513  MObjectGetText(e_fname, family);
1514  MObjectGetText(e_fsize, buff);
1515  size = atoi(buff);
1516  newfont = MLoadFont(family, size, bold, italic);
1517 /*
1518  * Apply the selected fonts to the selected object
1519  *
1520  // KeyCom Unselected
1521  if(FlgOBJ==0)
1522  {
1523  DB_Do2Undo_Fonts( newfont, undofont);
1524  DB_FontAssign(PBUTT.KeyB, sizeof PBUTT.KeyB / sizeof PBUTT.KeyB[0], newfont);
1525 
1526  }
1527  // KeyCom Selected
1528  if (FlgOBJ==1)
1529  {
1530  DB_Do2Undo_Fonts( newfont, undofont);
1531  MObjectSetFont(PBUTT.KeyB[0], newfont, True);
1532  }
1533  //Active Labels
1534  if (FlgOBJ==2)
1535  {
1536  DB_Do2Undo_Fonts( newfont, undofont);
1537  DB_FontAssign(DAS.Gui.ContrPanel.lbl_Par, sizeof DAS.Gui.ContrPanel.lbl_Par / sizeof DAS.Gui.ContrPanel.lbl_Par[0], newfont);
1538  DB_FontAssign(DAS.Gui.ContrPanel.Albl_CS, sizeof DAS.Gui.ContrPanel.Albl_CS / sizeof DAS.Gui.ContrPanel.Albl_CS[0], newfont);
1539  DB_FontAssign(DAS.Gui.ContrPanel.Albl_IE, sizeof DAS.Gui.ContrPanel.Albl_IE / sizeof DAS.Gui.ContrPanel.Albl_IE[0], newfont);
1540  DB_FontAssign(DAS.Gui.ContrPanel.Albl_LS, sizeof DAS.Gui.ContrPanel.Albl_LS / sizeof DAS.Gui.ContrPanel.Albl_LS[0], newfont);
1541  DB_FontAssign(DAS.Gui.ContrPanel.Albl_LT, sizeof DAS.Gui.ContrPanel.Albl_LT / sizeof DAS.Gui.ContrPanel.Albl_LT[0], newfont);
1542  DB_FontAssign(DAS.Gui.ContrPanel.cop, sizeof DAS.Gui.ContrPanel.cop / sizeof DAS.Gui.ContrPanel.cop[0] , newfont);
1543  DB_FontAssign(DAS.Gui.ContrPanel.step, sizeof DAS.Gui.ContrPanel.step / sizeof DAS.Gui.ContrPanel.step[0] , newfont);
1544  DB_FontAssign(DAS.Gui.ContrPanel.slope, sizeof DAS.Gui.ContrPanel.slope / sizeof DAS.Gui.ContrPanel.slope[0] , newfont);
1545  DB_FontAssign(DAS.Gui.ContrPanel.speed, sizeof DAS.Gui.ContrPanel.speed / sizeof DAS.Gui.ContrPanel.speed[0] , newfont);
1546  MObjectSetFont(DAS.Gui.ContrPanel.Albl_Status, newfont, True);
1547  MObjectSetFont(DAS.Gui.ContrPanel.Albl_Script, newfont, True);
1548 
1549  }
1550 
1551  //Passive Labels BG
1552  if (FlgOBJ==3)
1553  {
1554  DB_Do2Undo_Fonts( newfont, undofont);
1555  DB_FontAssign(DAS.Gui.ContrPanel.lbl_NP, sizeof DAS.Gui.ContrPanel.lbl_NP / sizeof DAS.Gui.ContrPanel.lbl_NP[0], newfont);
1556  DB_FontAssign(DAS.Gui.ContrPanel.Plbl_CS, sizeof DAS.Gui.ContrPanel.Plbl_CS / sizeof DAS.Gui.ContrPanel.Plbl_CS[0], newfont);
1557  DB_FontAssign(DAS.Gui.ContrPanel.Plbl_IE, sizeof DAS.Gui.ContrPanel.Plbl_IE / sizeof DAS.Gui.ContrPanel.Plbl_IE[0], newfont);
1558  DB_FontAssign(DAS.Gui.ContrPanel.Plbl_LS, sizeof DAS.Gui.ContrPanel.Plbl_LS / sizeof DAS.Gui.ContrPanel.Plbl_LS[0], newfont);
1559  DB_FontAssign(DAS.Gui.ContrPanel.Plbl_LT, sizeof DAS.Gui.ContrPanel.Plbl_LT / sizeof DAS.Gui.ContrPanel.Plbl_LT[0], newfont);
1560 
1561  DB_FontAssign(DAS.Gui.ContrPanel.lbl_lamps, sizeof DAS.Gui.ContrPanel.lbl_lamps / sizeof DAS.Gui.ContrPanel.lbl_lamps[0], newfont);
1562  DB_FontAssign(DAS.Gui.ContrPanel.Plbl_SM, sizeof DAS.Gui.ContrPanel.Plbl_SM / sizeof DAS.Gui.ContrPanel.Plbl_SM[0], newfont);
1563  DB_FontAssign(DAS.Gui.ContrPanel.lbl, sizeof DAS.Gui.ContrPanel.lbl / sizeof DAS.Gui.ContrPanel.lbl[0] , newfont);
1564 
1565  MObjectSetFont(DAS.Gui.ContrPanel.Plbl_Status, newfont, True);
1566  MObjectSetFont(DAS.Gui.ContrPanel.Plbl_Script, newfont, True);
1567 
1568 
1569  }
1570 
1571 
1572 
1573 
1574  // Kapital Labels UP BG
1575  if (FlgOBJ==4)
1576  {
1577  DB_Do2Undo_Fonts( newfont, undofont);
1578  DB_FontAssign(DAS.Gui.ContrPanel.lblK, sizeof DAS.Gui.ContrPanel.lblK / sizeof DAS.Gui.ContrPanel.lblK[0], newfont);
1579 
1580  }
1581 
1582 
1583  // Kapital Labels DW BG
1584  if (FlgOBJ==5)
1585  {
1586  DB_Do2Undo_Fonts( newfont, undofont);
1587  DB_FontAssign(DAS.Gui.ContrPanel.lblK_DW, sizeof DAS.Gui.ContrPanel.lblK_DW / sizeof DAS.Gui.ContrPanel.lblK_DW[0], newfont);
1588 
1589  }
1590 
1591 
1592 
1593 
1594 
1595 /**************************************************************/
1596 /*
1597  * The function returns FIXED_MEDIUM on failure
1598 
1599  if (newfont != FIXED_MEDIUM)
1600  {
1601 // if (font != FIXED_MEDIUM)
1602 // MUnloadFont(font);
1603 // font = newfont;
1604  MObjectRedraw(DAS.Gui.ConfigPanel.frm4_dr1);
1605  }
1606  else
1607  MBeep();
1608 
1609 */
1610 }
+ Here is the caller graph for this function:

§ LoadFTPSetting()

int LoadFTPSetting ( void  )

Load FTP Setting for daily back-up.

Definition at line 286 of file Load.c.

References _MAX_PATH, BIL, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, FlushLine(), dftp::ftppwd, dftp::ftpserver, dftp::ftpuser, and ReadLine().

Referenced by MGUIMain().

287 {
288 
289  FILE *fs;
290  char str[255];
291 
292  char buff[_MAX_PATH];
293 
294  sprintf(buff, "%s\\FTP.INI", BIL.DFILEM.CONFIGDIREQUIPMENT);
295 
296  fs = fopen(buff, "r");
297 
298  if(fs == NULL) return 1;
299 
300  ReadLine(str, 80, fs); // ####################################################
301  ReadLine(str, 80, fs); // # Configuration file for FTP Setting. #
302  ReadLine(str, 80, fs); // ####################################################
303  ReadLine(str, 80, fs); // # FTP Server Address #
304  fscanf(fs, "%s", DFTP.ftpserver);
305 
306  FlushLine(str, 80, fs);
307  ReadLine(str, 80, fs); // # FTP User Name #
308 
309  fscanf(fs, "%s", DFTP.ftpuser);
310 
311  FlushLine(str, 80, fs);
312  ReadLine(str, 80, fs); // # FTP pwd #
313 
314 
315  fscanf(fs, "%s", DFTP.ftppwd);
316  FlushLine(str, 80, fs);
317  ReadLine(str, 80, fs); // ####################################################
318 
319  fclose (fs);
320 
321  return 0;
322 }
dftp DFTP
Definition: Load.c:28
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
d_fileman DFILEM
Definition: bildef.h:257
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
char ftpuser[32]
FTP server users.
char ftpserver[32]
FTP server address.
#define _MAX_PATH
Definition: Dildef.h:202
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
bil BIL
Definition: 2DPlot.c:28
char ftppwd[32]
FTP server pwd.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadGeoCoord()

int LoadGeoCoord ( void  )

Load Geographic Coordinate of the station. Procedure that load the Geographic Coordinate of the station in the file {homedir}/config/GeoCoord.INI.

Returns
int

Definition at line 1477 of file Load.c.

References _MAX_PATH, d_geo::alititude, BIL, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, das::DGeo, d_geo::latitude, d_geo::longitude, d_geo::s_name, and d_geo::timezone.

Referenced by MGUIMain().

1478 {
1479  FILE *fd;
1480  char str[80];
1481  char buff[_MAX_PATH];
1482 
1483  sprintf(buff, "%s\\GeoCoord.INI", BIL.DFILEM.CONFIGDIREQUIPMENT);
1484  fd = fopen(buff, "r");
1485  if(fd == NULL) return 1;
1486 
1487  fgets(str, 80, fd); // Read Header
1488 
1489  fscanf(fd, "%hs", &DAS.DGeo.s_name);
1490  fgets(str, 80, fd);
1491 
1492  fscanf(fd, "%lf", &DAS.DGeo.latitude);
1493  fgets(str, 80, fd);
1494 // sprintf(str, "%.2lf", DGEO.latitude);
1495 // MObjectSetText(DAS.Gui.ContrPanel.lbl_Par[0], str);
1496 
1497  fscanf(fd, "%lf", &DAS.DGeo.longitude);
1498  fgets(str, 80, fd);
1499 // sprintf(str,"%.1lf%%",(double)DAS.Paramini.CoolPw / 10);
1500 // MObjectSetText(DAS.Gui.ContrPanel.lbl_Par[1], str);
1501 
1502 
1503  fscanf(fd, "%lf", &DAS.DGeo.alititude);
1504  fgets(str, 80, fd);
1505 // sprintf(str,"%.1lf", DAS.Paramini.TPelt);
1506 // MObjectSetText(DAS.Gui.ContrPanel.lbl_Par[2], str);
1507 
1508  fscanf(fd, "%d", &DAS.DGeo.timezone);
1509  fgets(str, 80, fd);
1510 
1511  fclose(fd);
1512 
1513  return 0;
1514 }
double alititude
Station altitude.
double latitude
Station latitude.
d_geo DGeo
struct for Station location
int timezone
Station timezone.
char s_name[4]
Station name.
d_fileman DFILEM
Definition: bildef.h:257
das DAS
DAS structure.
Definition: Load.c:32
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
#define _MAX_PATH
Definition: Dildef.h:202
bil BIL
Definition: 2DPlot.c:28
double longitude
Station longitude.
+ Here is the caller graph for this function:

§ LoadGeoDB()

int LoadGeoDB ( void  )

Definition at line 1432 of file Load.c.

References _MAX_PATH, BIL, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, das::DGeo, d_geo::newalititude, d_geo::newlatitude, d_geo::newlongitude, d_geo::news_name, d_geo::newtimezone, and d_geo::nitem.

Referenced by MDCreateDASConfig(), and MGUIMain().

1433 {
1434  FILE *fd;
1435  char str[80];
1436  char buff[_MAX_PATH];
1437 // int i;
1438 
1439  sprintf(buff, "%s\\GeoDB.ini", BIL.DFILEM.CONFIGDIREQUIPMENT);
1440  fd = fopen(buff, "r");
1441  if(fd == NULL) return 1;
1442 
1443  DAS.DGeo.nitem =0;
1444 
1445  fgets(str, 80, fd); // Read Header
1446  fgets(str, 80, fd); // Read Header
1447  fgets(str, 80, fd); // Read Header
1448  fgets(str, 80, fd); // Read Header
1449 
1450  //fscanf(fd, "%d", &DAS.DGeo.nitem);
1451  //fgets(str, 80, fd);
1452 
1453  //for (i=0; i<DAS.DGeo.nitem; i++)
1454  do
1455  {
1456 
1457 // fscanf(fd, "%hs",DAS.DGeo.news_name[i]);
1458 // fscanf(fd, "%lf %lf %lf %d", &DAS.DGeo.newlatitude[i],
1459 // &DAS.DGeo.newlongitude[i],&DAS.DGeo.newalititude[i],&DAS.DGeo.newtimezone[i]);
1460  fscanf(fd, "%hs",DAS.DGeo.news_name[DAS.DGeo.nitem]);
1461  fscanf(fd, "%lf %lf %lf %d", &DAS.DGeo.newlatitude[DAS.DGeo.nitem],
1463 
1464 
1465  DAS.DGeo.nitem++;
1466  }while (!feof(fd));
1467  DAS.DGeo.nitem--;
1468 
1469  fclose(fd);
1470 
1471  return 0;
1472 }
double newlatitude[20]
New Station latitude.
double newlongitude[20]
New Station longitude.
d_geo DGeo
struct for Station location
d_fileman DFILEM
Definition: bildef.h:257
das DAS
DAS structure.
Definition: Load.c:32
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
int newtimezone[20]
Station timezone.
char news_name[20][4]
New Station name.
double newalititude[20]
New Station altitude.
#define _MAX_PATH
Definition: Dildef.h:202
int nitem
Number of items of the GeoDB.ini.
bil BIL
Definition: 2DPlot.c:28
+ Here is the caller graph for this function:

§ LoadHardware()

int LoadHardware ( void  )

Definition at line 1170 of file Load.c.

References _MAX_PATH, BIL, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, nova::DigIn, nova::DigOut, das::Nova, ReadLine(), and nova::type.

Referenced by MGUIMain().

1171 {
1172  FILE *fs;
1173  char str[80];
1174  int c;
1175  char buff[_MAX_PATH];
1176 
1177  sprintf(buff, "%s\\Hardware.ini",BIL.DFILEM.CONFIGDIREQUIPMENT);
1178 
1179 
1180  fs = fopen(buff, "r");
1181  if(fs == NULL) return 1;
1182 
1183 
1184  ReadLine(str, 80, fs); //###############################################
1185  ReadLine(str, 80, fs); //# HARDWARE.INI #
1186  ReadLine(str, 80, fs); //###############################################
1187  ReadLine(str, 80, fs); //# Type of motherboard installed #
1188  ReadLine(str, 80, fs); //# 0 = NOVA7892; 1 = NOVA6612; 2 = NOVA945GSE #
1189  ReadLine(str, 80, fs); //###############################################
1190 
1191 
1192  fscanf(fs, "%d", &DAS.Nova.type);
1193 // FlushLine(str, 80, fs);
1194 
1195  c= DAS.Nova.type;
1196  switch (c)
1197  {
1198  case 0:
1199  DAS.Nova.DigOut = 0;
1200  DAS.Nova.DigIn = 0;
1201  break;
1202  case 1:
1203  DAS.Nova.DigOut = 0;
1204  break;
1205  case 2:
1206  DAS.Nova.DigOut = 15;
1207  DAS.Nova.DigIn = 15;
1208  break;
1209  }
1210 
1211  return 0;
1212 
1213 }
unsigned short DigOut
Digital Output.
d_fileman DFILEM
Definition: bildef.h:257
das DAS
DAS structure.
Definition: Load.c:32
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
#define _MAX_PATH
Definition: Dildef.h:202
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
nova Nova
NOVA structure.
bil BIL
Definition: 2DPlot.c:28
unsigned char DigIn
Digital Input.
int type
type of NOVA monoboard used (7892 or 945GSE)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadIo()

void LoadIo ( int  mod,
char *  fname 
)

Definition at line 2678 of file Spat_Plot.c.

References AllocUSMat(), mtcl::black, bil::BLENS, spectrumheader::ccdnr, spectrumheader::ccdwx, D_AssignOrigin(), D_PlotAxis(), D_PlotGrid(), bil::DPLOT, doas::drwa, d_view::eX, d_view::eY, IDX, IDY, blens::Imim, InitImage(), doas::IoMat, MAllocImage(), maxploth, maxplotw, MFreeImage(), MObjectGetHeight(), MObjectGetWidth(), MTCL, d_view::oX, d_view::oY, ReadHeader_ASCII(), ReadIMG(), and bil::SPH.

Referenced by LoadIoCB(), and PlotToolsPBs().

2679 {
2680 
2681  FILE *fs;
2682 // char temp[128];
2683 // int i, k,
2684  int er;
2685 
2686 /* fs = fopen(fname, "r");
2687 
2688  if(fs == NULL)
2689  {
2690  return 1;
2691  }
2692  ReadLine(str, 80, fs);
2693  ReadLine(str, 80, fs);
2694  ReadLine(str, 80, fs);
2695  ReadLine(str, 80, fs);
2696 
2697 
2698  k=0;
2699  do
2700  {
2701 
2702  k++;
2703  ReadLine(str, 80, fs);
2704 
2705 
2706  }while (!feof(fs));
2707 
2708  k--;
2709 
2710  fclose(fs);
2711 */
2712  fs = fopen(fname, "r");
2713 
2714  //ReadHeaderOnly(fs);
2715  //ReadHeader_Io(0, fs);
2716  er = ReadHeader_ASCII(0, fs);
2717 
2718 
2719 
2720  IDX = BIL.SPH.ccdwx;
2721  IDY = BIL.SPH.ccdnr;
2722 
2723  DOAS.IoMat = AllocUSMat(IDX, IDY);
2724 
2725  ReadIMG(fs, DOAS.IoMat, IDX, IDY + 1);
2726 
2727 /* for (i=0; i<IDX; i++)
2728  {
2729  for (i=0; i<IDY + 1; i++)
2730  fscanf(fs, "%lf%", &DOAS.wlc[i], &DOAS.k1[i], &DOAS.k2[i], &DOAS.wlref[i], &DOAS.pixref[i]);
2731 
2732  }
2733 
2734 */
2735  fclose(fs);
2736 
2737  if (mod)
2738  {
2741 
2744 
2745  InitImage(BIL.BLENS.Imim, maxplotw, maxploth, 192, 192, 192);
2746 
2747 
2748  //Assign limits to the Drawing coordinates
2749  D_AssignOrigin(DOAS.drwa[0]);
2750  //Plot the axes
2752  BIL.DPLOT.eY, MTCL.black);
2753  //Plot grid
2755  BIL.DPLOT.eY);
2756 
2757 
2758 
2759  }
2760 
2761 
2762 }
int ReadHeader_ASCII(int mod, FILE *fd)
Read ASCII Header of the measurement. .
Definition: Spat_Plot.c:1877
mtcl MTCL
Definition: 2DPlot.c:30
MIMAGE Imim
Definition: bildef.h:14
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
MTColor black
int MObjectGetHeight(MOBJECT obj)
unsigned short * AllocUSMat(int hp, int vp)
Definition: Spat_Plot.c:1994
int oY
Definition: bildef.h:183
void InitImage(MIMAGE img, int xd, int yd, int rb, int gb, int bb)
Definition: Spat_Plot.c:354
int oX
Definition: bildef.h:183
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
int MObjectGetWidth(MOBJECT obj)
d_view DPLOT
Definition: bildef.h:254
void MFreeImage(MIMAGE data)
void D_PlotAxis(MOBJECT ob, MIMAGE mim, int sx, int sy, int ex, int ey, MTColor col)
Definition: Spat_Plot.c:448
doas DOAS
Definition: Spat_Plot.c:37
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
int eX
Definition: bildef.h:183
void ReadIMG(FILE *file, unsigned short *mat, int hp, int vp)
Read ASCII Image (Spectral Data only) .
Definition: Spat_Plot.c:1206
int eY
Definition: bildef.h:183
unsigned short * IoMat
Reference spectrum.
Definition: DOASdef.h:27
int maxploth
Definition: Spat_Plot.c:51
int maxplotw
Definition: Spat_Plot.c:51
bil BIL
Definition: Spat_Plot.c:35
blens BLENS
Definition: bildef.h:252
void D_AssignOrigin(MOBJECT obj)
Definition: Spat_Plot.c:432
void D_PlotGrid(MOBJECT ob, MIMAGE mim, int sx, int sy, int ex, int ey)
Definition: Spat_Plot.c:476
MIMAGE MAllocImage(int img_w, int img_h, int nplanes)
MOBJECT drwa[8]
Definition: DOASdef.h:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadPaletteCB()

int LoadPaletteCB ( MOBJECT  o,
void *  o_data,
void *  a_data 
)

Callback for LoadTestPalette.

Definition at line 595 of file DAS_Spat_ConfCBs.c.

References _MAX_PATH, FB_PREFS::allow_dir_create, FB_PREFS::allow_dir_delete, FB_PREFS::allow_dir_rename, FB_PREFS::bg_image_file, FB_PREFS::button_font, FB_PREFS::change_cwd, d_fileman::DBFILENAME, bil::DFILEM, False, FB_PREFS::font, HELV_SMALL, d_fileman::HOMEDIRECTORY, LoadTestPalette(), MFileBrowseExt(), MGetCurrentDirectory(), FB_PREFS::transparent_tree, and True.

Referenced by MDCreateDASConfig().

596 {
597 
598  char str[_MAX_PATH] ;
599  char fname[128], dirname[128];
600  int er;
601 
602  FB_PREFS fbp;
603  strcpy (dirname, MGetCurrentDirectory ());
604  fname[0] = '\0';
605  memset (&fbp, 0, sizeof (fbp));
606 
607  fbp.change_cwd = True;
608  fbp.allow_dir_create = True;
609  fbp.allow_dir_rename = True;
610  fbp.allow_dir_delete = True;
611  fbp.transparent_tree = False;
612  fbp.font = HELV_SMALL;
613  fbp.button_font = HELV_SMALL;
614  //Set Img file
615  sprintf(str, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "sys\\Tile2.bmp" );
616  fbp.bg_image_file =str;
617 
618 
619  er = MFileBrowseExt ("Select File for Plotting", "*.MAP", fname, dirname, &fbp);
620  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",dirname, fname);
621 
622  //BIL.DFILEM.DBFILENAME[0] = 0;
623 
624  //MDCreateFM_Shell(FOPEN, FMAP); //Open File, MAP ext.
625 
626  if(BIL.DFILEM.DBFILENAME[0] == 0)
627  return 1;
628 
630  return 0;
631 }
CARD8 change_cwd
Definition: Mguidefs.h:1485
CARD8 allow_dir_create
Definition: Mguidefs.h:1487
MTFont button_font
Definition: Mguidefs.h:1501
CARD8 allow_dir_delete
Definition: Mguidefs.h:1493
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
MTFont font
Definition: Mguidefs.h:1499
#define False
Definition: Mguidefs.h:236
File Browser Preferences. Used by the Utility functions MFileBowserExt() and MDirBowserExt().
Definition: Mguidefs.h:1482
CARD8 transparent_tree
Definition: Mguidefs.h:1495
d_fileman DFILEM
Definition: bildef.h:257
#define HELV_SMALL
Definition: Mguidefs.h:881
const char * MGetCurrentDirectory(void)
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
int MFileBrowseExt(const char *t, const char *ext, char *fname, char *dname, FB_PREFS *prefs)
const char * bg_image_file
Definition: Mguidefs.h:1519
#define _MAX_PATH
Definition: Dildef.h:202
int LoadTestPalette(char *nf)
Load a test palette. Procedure that load a test palette.
Definition: Load.c:908
#define True
Definition: Mguidefs.h:235
CARD8 allow_dir_rename
Definition: Mguidefs.h:1490
bil BIL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadParam()

int LoadParam ( void  )

Load the exe parameters. Procedure that load the parameters for CCD, Stepper Motors and Peltier from file {homedir}/config/param.ini.

Returns
int

Definition at line 1215 of file Load.c.

References _MAX_PATH, BIL, paramini::ccdWx, paramini::ccdWy, paramini::ccdXoff, paramini::ccdYoff, d_fileman::CONFIGDIREQUIPMENT, paramini::CoolPw, bil::DFILEM, FlushLine(), paramini::ITemp, paramini::maxtexp, das::Paramini, omuthr::PCPower, ReadLine(), paramini::TPelt, and paramini::VBin.

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

1216 {
1217  FILE *fs;
1218  char str[80];
1219 // int c;
1220 
1221  char buff[_MAX_PATH];
1222 
1223  sprintf(buff, "%s\\PARAM.ini",BIL.DFILEM.CONFIGDIREQUIPMENT);
1224 
1225 
1226 
1227  fs = fopen(buff, "r");
1228  if(fs == NULL) return 1;
1229 
1230  // CCD and OMU Parameters
1231  ReadLine(str, 80, fs); //###############################################
1232  ReadLine(str, 80, fs); //# Param.INI #
1233  ReadLine(str, 80, fs); //# Main configuration file for SPATRAM #
1234  ReadLine(str, 80, fs); //# equipment #
1235  ReadLine(str, 80, fs); //###############################################
1236  ReadLine(str, 80, fs); //# ------------------------------------------- #
1237  ReadLine(str, 80, fs); //# by DanBo Date at Time #
1238  ReadLine(str, 80, fs); //# ------------------------------------------- #
1239 
1240 
1241 
1242 
1243  ReadLine(str, 80, fs); //# CCD Temp (°C) #
1244  fscanf(fs, "%lf", &DAS.Paramini.ITemp); //CCd Temp
1245  FlushLine(str, 80, fs);
1246 
1247  ReadLine(str, 80, fs); // # CCD Peltier Init Power (X 10-ie 15% --> 150) #
1248  fscanf(fs, "%d", &DAS.Paramini.CoolPw); //CCD Peltier initial Power
1249  FlushLine(str, 80, fs);
1250 
1251  ReadLine(str, 80, fs); // # Optical Unit Target Temperature #
1252  fscanf(fs, "%lf", &DAS.Paramini.TPelt);
1253  FlushLine(str, 80, fs);
1254 
1255 
1256  ReadLine(str, 80, fs); //# OMU Peltier Init Power X 10 (500 = 50.0%) #
1257  fscanf(fs, "%d", &OMUTHR.PCPower);
1258  FlushLine(str, 80, fs);
1259 
1260  ReadLine(str, 80, fs); // # CCD Window (xstart ys xend ye) #
1261  fscanf(fs,"%d%d%d%d" , &DAS.Paramini.ccdXoff, &DAS.Paramini.ccdYoff, &DAS.Paramini.ccdWx, &DAS.Paramini.ccdWy);
1262  FlushLine(str, 80, fs);
1263 
1264  ReadLine(str, 80, fs);// # Vertical Binning #
1265  fscanf(fs, "%d", &DAS.Paramini.VBin);
1266  FlushLine(str, 80, fs);
1267 
1268  ReadLine(str, 80, fs);//"# Max Exposure Time s (=0 --> free exposure) #
1269  fscanf(fs, "%lf", &DAS.Paramini.maxtexp);
1270  FlushLine(str, 80, fs);
1271 
1272 
1273 
1274 /*
1275  //Stepper motors Parameters
1276  //SM1
1277  ReadLine(str, 80, fs);//# Input Mirror Stepper Motor - SM1 #
1278  ReadLine(str, 80, fs);//# SM1 Power (0 = 0A - 76 = 1.52A) #
1279 
1280  fscanf(fs, "%d", &DAS.StepM.cop[0]);
1281 
1282  FlushLine(str, 80, fs);
1283  ReadLine(str, 80, fs);//# SM1 Step (0=400s/r, 1=800s/r,2=1000/sr) #
1284 
1285  fscanf(fs, "%d", &DAS.StepM.step[0]);
1286 
1287  FlushLine(str, 80, fs);
1288  ReadLine(str, 80, fs);//# SM1 Slope (0 - 255) #
1289 
1290  fscanf(fs, "%d", &DAS.StepM.slope[0]);
1291 
1292  FlushLine(str, 80, fs);
1293  ReadLine(str, 80, fs);//# SM1 Speed Hz (PS = 125*(n+1), n=0,1..255) #
1294 
1295  fscanf(fs, "%d", &DAS.StepM.speed[0]);
1296  FlushLine(str, 80, fs);
1297 
1298  //SM2
1299  ReadLine(str, 80, fs);//# Grating Stepper Motor - SM2 #
1300  ReadLine(str, 80, fs);//# SM2 Power (0 = 0A - 76 = 1.52A) #
1301 
1302  fscanf(fs, "%d", &DAS.StepM.cop[1]);
1303 
1304  FlushLine(str, 80, fs);
1305  ReadLine(str, 80, fs);//# SM2 Step (0=400s/r, 1=800s/r,2=1000/sr) #
1306 
1307  fscanf(fs, "%d", &DAS.StepM.step[1]);
1308 
1309  FlushLine(str, 80, fs);
1310  ReadLine(str, 80, fs);//# SM2 Slope (0 - 255) #
1311 
1312  fscanf(fs, "%d", &DAS.StepM.slope[1]);
1313 
1314  FlushLine(str, 80, fs);
1315  ReadLine(str, 80, fs);//# SM2 Speed Hz (PS = 125*(n+1), n=0,1..255) #
1316 
1317  fscanf(fs, "%d", &DAS.StepM.speed[1]);
1318  FlushLine(str, 80, fs);
1319 
1320  //SM3
1321  ReadLine(str, 80, fs);//# filter wheel Stepper Motor - SM3 #
1322  ReadLine(str, 80, fs);//# SM3 Power (0 = 0A - 76 = 1.52A) #
1323 
1324  fscanf(fs, "%d", &DAS.StepM.cop[2]);
1325 
1326  FlushLine(str, 80, fs);
1327  ReadLine(str, 80, fs);//# SM3 Step (0=400s/r, 1=800s/r,2=1000/sr) #
1328 
1329  fscanf(fs, "%d", &DAS.StepM.step[2]);
1330 
1331  FlushLine(str, 80, fs);
1332  ReadLine(str, 80, fs);//# SM3 Slope (0 - 255) #
1333 
1334  fscanf(fs, "%d", &DAS.StepM.slope[2]);
1335 
1336  FlushLine(str, 80, fs);
1337  ReadLine(str, 80, fs);//# SM3 Speed Hz (PS = 125*(n+1), n=0,1..255) #
1338 
1339  fscanf(fs, "%d", &DAS.StepM.speed[2]);
1340  FlushLine(str, 80, fs);
1341 
1342  //SM4
1343  ReadLine(str, 80, fs);//# filter wheel Stepper Motor - SM3 #
1344  ReadLine(str, 80, fs);//# SM3 Power (0 = 0A - 76 = 1.52A) #
1345 
1346  fscanf(fs, "%d", &DAS.StepM.cop[3]);
1347 
1348  FlushLine(str, 80, fs);
1349  ReadLine(str, 80, fs);//# SM3 Step (0=400s/r, 1=800s/r,2=1000/sr) #
1350 
1351  fscanf(fs, "%d", &DAS.StepM.step[3]);
1352 
1353  FlushLine(str, 80, fs);
1354  ReadLine(str, 80, fs);//# SM3 Slope (0 - 255) #
1355 
1356  fscanf(fs, "%d", &DAS.StepM.slope[3]);
1357 
1358  FlushLine(str, 80, fs);
1359  ReadLine(str, 80, fs);//# SM3 Speed Hz (PS = 125*(n+1), n=0,1..255) #
1360 
1361  fscanf(fs, "%d", &DAS.StepM.speed[3]);
1362  FlushLine(str, 80, fs);
1363 
1364  //SM5
1365  ReadLine(str, 80, fs);//# filter wheel Stepper Motor - SM3 #
1366  ReadLine(str, 80, fs);//# SM3 Power (0 = 0A - 76 = 1.52A) #
1367 
1368  fscanf(fs, "%d", &DAS.StepM.cop[4]);
1369 
1370  FlushLine(str, 80, fs);
1371  ReadLine(str, 80, fs);//# SM3 Step (0=400s/r, 1=800s/r,2=1000/sr) #
1372 
1373  fscanf(fs, "%d", &DAS.StepM.step[4]);
1374 
1375  FlushLine(str, 80, fs);
1376  ReadLine(str, 80, fs);//# SM3 Slope (0 - 255) #
1377 
1378  fscanf(fs, "%d", &DAS.StepM.slope[4]);
1379 
1380  FlushLine(str, 80, fs);
1381  ReadLine(str, 80, fs);//# SM3 Speed Hz (PS = 125*(n+1), n=0,1..255) #
1382 
1383  fscanf(fs, "%d", &DAS.StepM.speed[4]);
1384  FlushLine(str, 80, fs);
1385 
1386  //SM6
1387  ReadLine(str, 80, fs);//# filter wheel Stepper Motor - SM3 #
1388  ReadLine(str, 80, fs);//# SM3 Power (0 = 0A - 76 = 1.52A) #
1389 
1390  fscanf(fs, "%d", &DAS.StepM.cop[5]);
1391 
1392  FlushLine(str, 80, fs);
1393  ReadLine(str, 80, fs);//# SM3 Step (0=400s/r, 1=800s/r,2=1000/sr) #
1394 
1395  fscanf(fs, "%d", &DAS.StepM.step[5]);
1396 
1397  FlushLine(str, 80, fs);
1398  ReadLine(str, 80, fs);//# SM3 Slope (0 - 255) #
1399 
1400  fscanf(fs, "%d", &DAS.StepM.slope[5]);
1401 
1402  FlushLine(str, 80, fs);
1403  ReadLine(str, 80, fs);//# SM3 Speed Hz (PS = 125*(n+1), n=0,1..255) #
1404 
1405  fscanf(fs, "%d", &DAS.StepM.speed[5]);
1406  FlushLine(str, 80, fs);
1407 
1408  // Legge gli offset dei vari stepper
1409  // ad oggi 9 valori
1410 
1411  ReadLine(str, 80, fs);
1412  ReadLine(str, 80, fs);
1413  for(c = 0; c < 9; c++)
1414  fscanf(fs,"%d" , &DAS.Paramini.Offset[c]);
1415  FlushLine(str, 80, fs);
1416 
1417  ReadLine(str, 80, fs);
1418  ReadLine(str, 80, fs);
1419 
1420  for(c = 0; c < 6; c++)
1421  fscanf(fs,"%d" , &DAS.StepM.hometype[c]);
1422  FlushLine(str, 80, fs);
1423 
1424 */
1425  ReadLine(str, 80, fs);
1426  fclose(fs);
1427 
1428  return 0;
1429 }
int PCPower
Power to the Peltier for Cooling.
int ccdWx
CCD X End.
int ccdXoff
CCD X Start.
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 ccdWy
CCD Y End.
d_fileman DFILEM
Definition: bildef.h:257
omuthr OMUTHR
Definition: Load.c:33
das DAS
DAS structure.
Definition: Load.c:32
int VBin
CCD Vertical Binning.
int CoolPw
CCD Init Power.
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
#define _MAX_PATH
Definition: Dildef.h:202
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
bil BIL
Definition: 2DPlot.c:28
double maxtexp
Maximum exposure time (used in Autorange())
int ccdYoff
CCD Y Start.
double ITemp
CCD Target Temperature.
double TPelt
OMU Target Temperature.
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:

§ LoadParamLog()

int LoadParamLog ( void  )

Load file for CCD status. Procedure that load the file {homedir}/config/paramlog.ini, for the actual status of the CCD.

Returns
int

Definition at line 1517 of file Load.c.

1518 {
1519  FILE *fs;
1520  char str[80];
1521  int c;
1522  fs = fopen("LOG\\Paramini.LOG", "r");
1523  if(fs == NULL) return 2;
1524 
1525  fscanf(fs, "%d", &c);
1526  fgets(str, 80, fs);
1527 
1528  fclose(fs);
1529 
1530  return c;
1531 }

§ LoadTestPalette()

int LoadTestPalette ( char *  nf)

Load a test palette. Procedure that load a test palette.

Returns
int

Definition at line 908 of file Load.c.

References BIL, mtcl::black, mtcl::Color, mtcl::db, mtcl::dg, bil::DPLOT, mtcl::dr, d_view::DrawBG, IDY, MAllocColor(), MBlackColor(), MD_CreateBRowShell(), MTCL, MWhiteColor(), mtcl::PLColor, mtcl::white, and mtcl::yellow.

Referenced by LoadPaletteCB().

909 {
910 
911  FILE *fs;
912  char str[80];
913  int c, dr=0,dg=0,db=0;
914  fs = fopen(nf, "r");
915 
916  if(fs == NULL) return 1;
917 
918 
919 
920  for(c = 0; c < 256; c++)
921  {
922  fscanf(fs, "%d%d%d", &MTCL.dr[c],&MTCL.dg[c],&MTCL.db[c]);
923  fgets(str, 80, fs);
924 
925  MTCL.Color[c] = MAllocColor(MTCL.dr[c],MTCL.dg[c],MTCL.db[c]);
926  MTCL.PLColor[c] = MTCL.Color[c];
927  }
928 
929  fclose(fs);
930 
931  MTCL.black = MBlackColor();
932  MTCL.white = MWhiteColor();
933  MTCL.yellow = MAllocColor(255, 255, 0);
934 
935  BIL.DPLOT.DrawBG = MAllocColor(220, 220, 220);
936 
937  MTCL.PLColor[256] = MTCL.black;
938  MTCL.PLColor[257] = MTCL.white;
939  MTCL.PLColor[258] = MTCL.yellow;
940 
941  IDY = 256;
943 
944 
945  return 0;
946 }
mtcl MTCL
Definition: 2DPlot.c:30
MTColor MBlackColor(void)
MTColor DrawBG
Definition: bildef.h:184
MTColor black
MTColor yellow
MTColor white
int MD_CreateBRowShell(int nrows)
Create windows of buttons. During the plotting of the measurements, create a shell of buttons if the ...
Definition: Spat_Plot.c:1625
MTColor Color[264]
int dg[256]
d_view DPLOT
Definition: bildef.h:254
MTColor MAllocColor(int r, int g, int b)
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
bil BIL
Definition: 2DPlot.c:28
MTColor PLColor[264]
MTColor MWhiteColor(void)
int dr[256]
int db[256]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LoadTruePalette()

int LoadTruePalette ( void  )

Load the palette map. Procedure that load the palette map from file {homedir}/Palettes/Danbomap1.map.

Returns
int

Definition at line 948 of file Load.c.

References _MAX_PATH, BIL, mtcl::black, mtcl::Color, mtcl::db, bil::DFILEM, mtcl::dg, bil::DPLOT, mtcl::dr, d_view::DrawBG, d_fileman::HOMEDIRECTORY, MAllocColor(), MBlackColor(), MTCL, MWhiteColor(), mtcl::PLColor, mtcl::white, and mtcl::yellow.

Referenced by MGUIMain().

949 {
950 
951  FILE *fs;
952  char str[80];
953  int c, dr=0,dg=0,db=0;
954  char buff[_MAX_PATH];
955 
956  sprintf(buff, "%s\\PALETTES\\DANBOMAP1.MAP", BIL.DFILEM.HOMEDIRECTORY);
957  fs = fopen(buff, "r");
958 
959  if(fs == NULL) return 1;
960 
961 
962 
963  for(c = 0; c < 256; c++)
964  {
965  fscanf(fs, "%d%d%d", &MTCL.dr[c],&MTCL.dg[c],&MTCL.db[c]);
966  fgets(str, 80, fs);
967 
968  MTCL.Color[c] = MAllocColor(MTCL.dr[c],MTCL.dg[c],MTCL.db[c]);
969  MTCL.PLColor[c] = MTCL.Color[c];
970  }
971 
972  fclose(fs);
973 
974  MTCL.black = MBlackColor();
975  MTCL.white = MWhiteColor();
976  MTCL.yellow = MAllocColor(255, 255, 0);
977 
978  BIL.DPLOT.DrawBG = MAllocColor(220, 220, 220);
979 
980  MTCL.PLColor[256] = MTCL.black;
981  MTCL.PLColor[257] = MTCL.white;
982  MTCL.PLColor[258] = MTCL.yellow;
983 
984 
985 
986 
987  return 0;
988 }
mtcl MTCL
Definition: 2DPlot.c:30
MTColor MBlackColor(void)
MTColor DrawBG
Definition: bildef.h:184
MTColor black
MTColor yellow
MTColor white
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
MTColor Color[264]
int dg[256]
d_fileman DFILEM
Definition: bildef.h:257
d_view DPLOT
Definition: bildef.h:254
MTColor MAllocColor(int r, int g, int b)
#define _MAX_PATH
Definition: Dildef.h:202
bil BIL
Definition: 2DPlot.c:28
MTColor PLColor[264]
MTColor MWhiteColor(void)
int dr[256]
int db[256]
+ 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:

§ Lookfor4358()

int Lookfor4358 ( void  )

function to scan the wl() array in order to identify the position of the 4358 reference wavelength return value: er = -1 –> value 4358 not encountered er >= 0 –> value 4358 found at er position

Definition at line 2270 of file Procedures.c.

References wl.

2271 {
2272 
2273  int i, er = 0;
2274 
2275  for (i=0; i<17; i++)
2276  {
2277  if (wl[i] == 4358)
2278  {
2279  er = i;
2280  return er;
2281  }
2282  }
2283 
2284  return -1;
2285 }
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182

§ LookforWl_X()

int LookforWl_X ( int  x)

Definition at line 2295 of file Procedures.c.

References wl.

Referenced by D_Calibra(), DemoInitMotor(), E_AAMeasure(), E_Almucantar(), E_Average(), E_AvgCCDHor(), E_DFMeasure(), E_DirectSun(), E_IRefSun(), E_Lambda(), E_Meashor(), E_Meashor2(), E_Measure(), HomeGratingFast(), PRG_ChkGrating(), and WinRes().

2296 {
2297 
2298  int i, er = 0;
2299 
2300  for (i=0; i<18; i++)
2301  {
2302  if (wl[i] == x)
2303  {
2304  er = i;
2305  return er;
2306  }
2307  }
2308 
2309  return -10;
2310 }
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
+ Here is the caller graph for this function:

§ MAPDefPix()

void MAPDefPix ( int  mod)

create the Under/Over exposed pixels window
At the pression of the button in DAS_Config the appropriate shell (For the creation of the Under or Over exposed pixel map) will be created.

Parameters
mod
  • = 0 –> Under Exposed pixels
  • = 1 –> Over Exposed pixels

Definition at line 4036 of file DAS_Spat_ConfCBs.c.

References ActEditCB(), CENTER_ALIGN, False, FIXED_SMALL, lbl, LEFT_ALIGN, MAPDefPixCB(), MCreateClippedEdit(), MCreateLabel(), MCreatePButton(), MCreateRowForm(), MCreateShell(), MCreateTableForm(), MDQuitCB(), MEditSetActCallback(), MEditSetValCallback(), MLabelSetAlignment(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetTransparency(), MPButtonSetCallback(), MShellRealize(), MShellSetWMCloseCallback(), p, TOP_ALIGN, True, and ValidateCB().

Referenced by UnderOverPixCB().

4037 {
4038 
4039  MOBJECT sh, rowf, lbl,lbl1,lbl2, tb, level, pb;
4040  char str[80];
4041  int *p, k;
4042 
4043  sh = MCreateShell("MAP DEFECTIVE PIXELS", 0);
4044 // MObjectSetCompositeWidth(sh, 670);
4045 // MObjectSetCompositeHeight(sh, 483);
4046 
4047  rowf = MCreateRowForm(sh);
4048  MObjectSetBackgroundRGB(rowf, 112, 128, 112);
4049  MObjectSetResize(rowf, True, True);
4050 // MObjectSetCompositeWidth(rowf, 357);
4052 
4053  if(mod==1)
4054  sprintf(str, "This procedure allows for the mapping of the\n OVER exposed pixels of the CCD sensor");
4055 
4056  if(mod==0)
4057  sprintf(str, "This procedure allows for the mapping of the\n UNDER exposed pixels of the CCD sensor");
4058 
4059  if(mod==2)
4060  sprintf(str, "This procedure allows for the mapping of the\n OVER exposed pixels of the CCD sensor");
4061 
4062  lbl = MCreateLabel(rowf, str, FIXED_SMALL);
4063  MObjectSetResize(lbl, True, True);
4064  MObjectSetForegroundRGB(lbl, 255, 255, 255);
4065  MObjectSetBackgroundRGB(lbl, 96, 132, 152);
4066  MObjectSetTransparency(lbl, 0);
4067 
4068  if(mod==1)
4069  sprintf(str, "3 Flat Measurements (Texp = 0) will be porformed\n in order to identify the defective pixels");
4070 
4071  if(mod==0)
4072  sprintf(str, "3 Measurements of QJ lamp will be porformed\n in order to identify the defective pixels");
4073 
4074  if(mod==2)
4075  sprintf(str, "3 Flat Measurements (Texp = 5s) will be porformed\n in order to identify the defective pixels");
4076 
4077 
4078  lbl1 = MCreateLabel(rowf, str, FIXED_SMALL);
4079  MObjectSetResize(lbl1, True, True);
4080  MObjectSetForegroundRGB(lbl1, 255, 255, 255);
4081  MObjectSetBackgroundRGB(lbl1, 96, 132, 152);
4082  MObjectSetTransparency(lbl1, 0);
4083 
4084 
4085  if(mod==1)
4086  sprintf(str, " You have to set the maximum level in\norder to consider the pixel as good");
4087 
4088  if(mod==0)
4089  sprintf(str, " You have to set the minimum level in\norder to consider the pixel as good");
4090 
4091  if(mod==2)
4092  sprintf(str, " You have to set the maximum level in\norder to consider the pixel as good");
4093 
4094  lbl2 = MCreateLabel(rowf, str, FIXED_SMALL);
4095  MObjectSetForegroundRGB(lbl2, 255, 255, 255);
4096  MObjectSetBackgroundRGB(lbl2, 96, 132, 152);
4097  MObjectSetTransparency(lbl2, 0);
4098 
4099 
4100 
4101 /**************************************/
4102  tb = MCreateTableForm(rowf, 3);
4103  MObjectSetBackgroundRGB(tb, 56, 112, 112);
4105 // MObjectSetCompositeWidth(tb, 347);
4106 
4107  if(mod==1)
4108  sprintf(str, "Pix with values higher than");
4109 
4110  if(mod==0)
4111  sprintf(str, "Pix with values lower than");
4112 
4113  if(mod==2)
4114  sprintf(str, "Pix with values higher than");
4115 
4116  lbl = MCreateLabel(tb, str, FIXED_SMALL);
4118  MObjectSetForegroundRGB(lbl, 255, 255, 255);
4119  MObjectSetTransparency(lbl, 0);
4120  MObjectSetResize(lbl, False, False);
4122 
4123  level = MCreateClippedEdit(tb, " ", 10, 5, FIXED_SMALL);
4124  MObjectSetForegroundRGB(level, 255, 255, 255);
4125  MObjectSetBackgroundRGB(level, 40, 96, 72);
4126 // MObjectSetCompositeWidth(level, 35);
4128  k = 140;
4129  p = (void *) k;
4130  MEditSetValCallback(level, ValidateCB, p);
4131  MEditSetActCallback(level, ActEditCB, p);
4132 
4133  lbl1 = MCreateLabel(tb, "will be marked as defective", FIXED_SMALL);
4135  MObjectSetForegroundRGB(lbl1, 255, 255, 255);
4136  MObjectSetTransparency(lbl1, 0);
4137  MObjectSetResize(lbl1, False, False);
4139 
4140  tb = MCreateTableForm(rowf, 2);
4141  MObjectSetBackgroundRGB(tb, 56, 112, 112);
4143 
4144 
4145  pb = MCreatePButton(tb ,"Execute", FIXED_SMALL);
4146  MPButtonSetCallback(pb, MAPDefPixCB, (void *) mod);
4147  MObjectSetBackgroundRGB(pb, 224, 224, 176);
4148  MObjectSetCompositeWidth(pb, 100);
4149 /*
4150  pb = MCreatePButton(tb, "Close", FIXED_SMALL);
4151  MPButtonSetCallback(pb, MDQuitCB, (void *) 0);
4152  MObjectSetBackgroundRGB(pb, 224, 224, 176);
4153  MObjectSetCompositeWidth(pb, 100);
4154 */
4155 
4156 /************************************/
4157  MShellRealize(sh);
4159 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lbl
Definition: DFileMan.c:42
void MShellRealize(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
void ActEditCB(MOBJECT edit, char *text, void *ed)
Text Application callback Apply to the variables the text typed in various text box and validated by ...
MOBJECT MCreateClippedEdit(MOBJECT parent, const char *text, int len, int clip_len, MTFont font)
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
void MDQuitCB(MOBJECT shell, void *od, void *ad)
callback for closing a generic MGUI shell
Definition: REQ.C:40
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define CENTER_ALIGN
Definition: Mguidefs.h:917
void MEditSetActCallback(MOBJECT edit, OBJ_STRING_CB cb, void *data)
#define FIXED_SMALL
Definition: Mguidefs.h:878
void ValidateCB(MOBJECT edit, EDIT_VAL *ev, void *ii)
Text Validation callback Validation callback for the text typed in different text box...
void MEditSetValCallback(MOBJECT edit, EDIT_VAL_CB cb, void *data)
MOBJECT MCreateShell(const char *title, int flags)
static double p
Definition: SOLPOS.C:131
void MLabelSetAlignment(MOBJECT p, int align)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
void MAPDefPixCB(MOBJECT o, void *id, void *a_data)
GetDefPix(mod) Callback At the pression of the &#39;Execute&#39; button in the appropriate shell the GetDefPi...
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
MOBJECT MCreateRowForm(MOBJECT parent)
#define TOP_ALIGN
Definition: Mguidefs.h:918
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MAPDefPixCB()

void MAPDefPixCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

GetDefPix(mod) Callback At the pression of the 'Execute' button in the appropriate shell the GetDefPix procedure will be executed.

Parameters
a_data
  • = 0 –> Under Exposed pixels
  • = 1 –> Over Exposed pixels

Definition at line 4010 of file DAS_Spat_ConfCBs.c.

References GetDefPix().

Referenced by MAPDefPix().

4011 {
4012 
4013  int c = (int) a_data;
4014 
4015  GetDefPix(c);
4016 /* switch (c)
4017  {
4018  case 0:
4019  GetDefPix(0);
4020  break;
4021  case 1:
4022  GetDefPix(1);
4023  break;
4024  case 2:
4025  GetDefPix(2);
4026  break;
4027 
4028  }
4029 */
4030 }
int GetDefPix(int mod)
Maps the defective pixel.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Master_Error()

void Master_Error ( int  w)

Definition at line 98 of file Errors.c.

References D_WriteInitLog(), palette::DB_BG, palette::DB_BG_Albl, palette::DB_FG_Albl, DPAL, HELV_SMALL, lbl, Master_Err, MCreateLabel(), MCreateShell(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MObjectSetShadow(), MShellRealize(), SF_MODAL, and WS_SHADOW_OUT.

Referenced by SZA_FirstCalc().

99 {
100  MOBJECT sh, lbl;
101  char buf[80];
102 
103  if(w < -4 || w > -1) return;
104  sh = MCreateShell("Error in Master", SF_MODAL);
105  //sh = MCreateShell("AMS_Error", 0);
107 
108  lbl = MCreateLabel(sh, Master_Err[-w], HELV_SMALL);
111  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
112  MShellRealize(sh);
113 
114  sprintf(buf, Master_Err[-w]);
115  D_WriteInitLog(buf);
116 
117 
118 
119 
120 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lbl
Definition: DFileMan.c:42
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MShellRealize(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
palette DPAL
Definition: 2DPlot.c:27
const char * Master_Err[]
Definition: Errors.c:65
#define HELV_SMALL
Definition: Mguidefs.h:881
#define SF_MODAL
Definition: Mguidefs.h:1019
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
int D_WriteInitLog(char *str)
writes devices errors(AMS, CCD...) on the Devices.log file.
Definition: Save.c:144
void * MOBJECT
Definition: Mguidefs.h:192
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MD_CreateBRowShell()

int MD_CreateBRowShell ( int  nrows)

Create windows of buttons.
During the plotting of the measurements, create a shell of buttons if the raws of the CCD are more than 16.

Parameters
nrowsnumber of raws of the CCD sensor (CCDVPix/CCDVBin)
Returns
0

Definition at line 1625 of file Spat_Plot.c.

References D_pbr_CB(), das::DOption, bil::DPLOT, HELV_SMALL, optionini::hlineafter, optionini::hlinebefore, MCreatePButton(), MCreateShell(), MCreateTableForm(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetColor(), MObjectSetResize(), MObjectSetShadow(), MObjectSetTransparency(), MPButtonSetCallback(), MShellRealizeXY(), MTCL, d_view::pbr, mtcl::PLColor, d_view::RowShell, TOP_ALIGN, True, UNDEF_ALIGN, mtcl::white, and WS_ETCHED_IN.

Referenced by DrawButtons(), LoadTestPalette(), and ViewPlot().

1626 {
1627  int i, er = 0;
1628  MOBJECT _tablefrm000;
1629 // MOBJECT _shell001;
1630  char buf[64];
1631 // MOBJECT Esc_But;
1632 
1633  BIL.DPLOT.RowShell = MCreateShell("CCD ROWS", 0);
1634  MObjectSetBackgroundRGB(BIL.DPLOT.RowShell, 97, 105, 88);
1636 
1637  _tablefrm000 = MCreateTableForm(BIL.DPLOT.RowShell, 20);
1638  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
1639  MObjectSetResize(_tablefrm000, True, True);
1640 
1641 
1642  for (i=DAS.DOption.hlinebefore; i < nrows - DAS.DOption.hlineafter; i++)
1643  {
1644  sprintf(buf,"r. %3d", i+1);
1645  BIL.DPLOT.pbr[i] = MCreatePButton(_tablefrm000, buf, HELV_SMALL);
1648  MPButtonSetCallback(BIL.DPLOT.pbr[i], D_pbr_CB, (void *) i);
1649  //MObjectSetBackgroundRGB(pbr[i], 197, 197, 144);
1651  }
1652 
1654 
1655  return 0;
1656 
1657 }
void MObjectSetColor(MOBJECT obj, MTColor bgc, MTColor fgc)
mtcl MTCL
Definition: 2DPlot.c:30
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
optionini DOption
Options for DAS execution.
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
das DAS
DAS structure.
Definition: Spat_Plot.c:39
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
MTColor white
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
MOBJECT pbr[256]
Definition: bildef.h:170
#define UNDEF_ALIGN
Definition: Mguidefs.h:920
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
void D_pbr_CB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:717
int hlinebefore
Number of HiddenLines before the central line in Plot.
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
d_view DPLOT
Definition: bildef.h:254
#define HELV_SMALL
Definition: Mguidefs.h:881
void MShellRealizeXY(MOBJECT obj, int x, int y)
MOBJECT MCreateShell(const char *title, int flags)
int hlineafter
Number of HiddenLines after the central line in Plot.
MTColor PLColor[264]
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
bil BIL
Definition: Spat_Plot.c:35
MOBJECT RowShell
Definition: bildef.h:171
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
#define WS_ETCHED_IN
Definition: Mguidefs.h:959
#define TOP_ALIGN
Definition: Mguidefs.h:918
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreate2DPlot()

MOBJECT MDCreate2DPlot ( char *  title,
int  x,
int  y,
int  dx,
int  dy,
int  mode 
)

create the 2D_Plot panel via the MDCreate_2DPlot.

Definition at line 343 of file DAS_Spat_Conf.c.

References _MAX_PATH, CloseShTempCB(), bil::DFILEM, d_fileman::HOMEDIRECTORY, MDCreate_2DPlot(), MShellRealize(), MShellSetWMCloseCallback(), SetWorkDirMGUIenv(), and omutemp::sh.

Referenced by DB_2DPlot().

344 {
345 
346  char buf[_MAX_PATH];
347  int er = 0;
348 
349 
350  OMUTEMP.sh = MDCreate_2DPlot(title);
352  //Close shell CB
354 
355 
356  // DAS Working directory and MGUI Environment
357  sprintf(buf, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "DAS.exe");
358  er = SetWorkDirMGUIenv(buf);
359  if (er == -1)
360  {
361  //Unable to set the enviromental variable
362  }
363 
364 
365 
366 // DrawAreaTempCB(datatemp.drawarea000);
367  return 0;
368 
369 }
void MShellRealize(MOBJECT obj)
omutemp OMUTEMP
structure for OMU temperatures
Definition: DAS_Spat_Conf.c:50
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
d_fileman DFILEM
Definition: bildef.h:257
MOBJECT MDCreate_2DPlot(char *title)
2DPlot Panel. Procedure that build the shell for the plotting of the LOG files.
Definition: 2DPlot.c:473
bil BIL
Definition: DAS_Spat_Conf.c:51
#define _MAX_PATH
Definition: Dildef.h:202
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
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void CloseShTempCB(MOBJECT p, void *od, void *ad)
MOBJECT sh
Definition: bildef.h:108
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreate_2DPlot()

MOBJECT MDCreate_2DPlot ( char *  title)

2DPlot Panel. Procedure that build the shell for the plotting of the LOG files.

Returns
void

Definition at line 473 of file 2DPlot.c.

References _shell000, CENTER_ALIGN, D2D_AreaInputTemp(), palette::DB_BG, palette::DB_BG_Albl, palette::DB_BG_lblUP, palette::DB_BG_Plbl, palette::DB_BG_RButt, palette::DB_FG_Albl, palette::DB_FG_lblUP, palette::DB_FG_Plbl, palette::DB_FG_RButt, omutemp::drawarea000, DrawAreaTempCB(), F_ATT_FORM, False, HELV_SMALL, lbl, omutemp::LBL_X, omutemp::LBL_Y, omutemp::lblx, omutemp::lbly, LEFT_ALIGN, MCreateColForm(), MCreateDrawArea(), MCreateLabel(), MCreateRowForm(), MCreateScrollBar(), MCreateShell(), MCreateTableForm(), MCreateTButton(), MDrawAreaSetExposeCallback(), MDrawAreaSetInputCallback(), MFormSetSpacing(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetFGColorFromParent(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MObjectSetTransparency(), MObjectUnmap(), MScrollBarSetSliderColorShift(), MTableFormSetColAlign(), MTButtonSetCallback(), MTopAttach(), SBT_HOR, SBT_VERT, omutemp::tgb, ToggleButtCB(), TOP_ALIGN, True, WS_SHADOW_IN, and WS_SHADOW_OUT.

Referenced by MDCreate2DPlot().

474 {
476 
477  MOBJECT _rowform000;
478 // MOBJECT _tablefrm000;
479  MOBJECT _colform000;
480  MOBJECT _rowform001;
481 // MOBJECT _tablefrm001;
482  MOBJECT _rowform002;
483  MOBJECT _tablefrm002;
484  MOBJECT _colform001;
485  MOBJECT _scrollbar000;
486  MOBJECT _rowform004;
487  MOBJECT _rowform005;
488  MOBJECT _rowform006;
489  MOBJECT _rowform007;
490  MOBJECT _scrollbar001;
491 
492  MOBJECT lbl, tb;
493  MOBJECT rowfrm;
494 
495  int i;
496 
497  _shell000 = MCreateShell(title, 0);
498  MObjectSetBackgroundRGB(_shell000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
499  MObjectSetShadow(_shell000, WS_SHADOW_IN, 0, 0);
500 
501  _rowform000 = MCreateRowForm(_shell000);
502  MTopAttach(_rowform000, F_ATT_FORM, 1, NULL);
503  MObjectAlign(_rowform000, CENTER_ALIGN, TOP_ALIGN);
504  MObjectSetBackgroundRGB(_rowform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
505  MObjectSetResize(_rowform000, True, True);
506 
507  tb = MCreateTableForm(_rowform000, 7);
508  MFormSetSpacing(tb, 1);
510 
511 // _label000 = MCreateLabel(_tablefrm000, "Measurement Header", HELV_SMALL);
512 // MObjectSetForegroundRGB(_label000, 255, 255, 0);
513 
514  _colform000 = MCreateColForm(_rowform000);
515  MFormSetSpacing(_colform000, 1);
516  MObjectSetBackgroundRGB(_colform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
517  MObjectSetResize(_colform000, True, True);
518 
519  _rowform001 = MCreateRowForm(_colform000);
520  MFormSetSpacing(_rowform001, 1);
521  MObjectAlign(_rowform001, LEFT_ALIGN, TOP_ALIGN);
522  MObjectSetBackgroundRGB(_rowform001, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
523  MObjectSetResize(_rowform001, False, False);
524 
525  lbl = MCreateLabel(_rowform001, "Select Channel", HELV_SMALL);
529  MObjectSetTransparency(lbl, 0);
530  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
532 
533  tb = MCreateTableForm(_rowform001, 1);
534  MFormSetSpacing(tb, 1);
539 
540  OMUTEMP.tgb[0] = MCreateTButton(tb, " Optic ", HELV_SMALL);
545 
546  OMUTEMP.tgb[1] = MCreateTButton(tb, "Int SX ", HELV_SMALL);
551 
552  OMUTEMP.tgb[2] = MCreateTButton(tb, "Out SX ", HELV_SMALL);
557 
558  OMUTEMP.tgb[3] = MCreateTButton(tb, "Int DX ", HELV_SMALL);
563 
564  OMUTEMP.tgb[4] = MCreateTButton(tb, "Out DX ", HELV_SMALL);
569 
570  OMUTEMP.tgb[5] = MCreateTButton(tb, "Grating", HELV_SMALL);
575 
576  OMUTEMP.tgb[6] = MCreateTButton(tb, "Spare ", HELV_SMALL);
581 
582  OMUTEMP.tgb[7] = MCreateTButton(tb, "Elect. ", HELV_SMALL);
587 
588  OMUTEMP.tgb[8] = MCreateTButton(tb, "Spare ", HELV_SMALL);
593 
594  OMUTEMP.tgb[9] = MCreateTButton(tb, "Spare ", HELV_SMALL);
598 
599  OMUTEMP.tgb[10] = MCreateTButton(tb, "Spare ", HELV_SMALL);
603 
604  OMUTEMP.tgb[11] = MCreateTButton(tb, "Spare ", HELV_SMALL);
608 
609  OMUTEMP.tgb[12] = MCreateTButton(tb, "Spare ", HELV_SMALL);
613 
614  OMUTEMP.tgb[13] = MCreateTButton(tb, "Spare ", HELV_SMALL);
618 
619  OMUTEMP.tgb[14] = MCreateTButton(tb, "Spare ", HELV_SMALL);
623 
624  OMUTEMP.tgb[15] = MCreateTButton(tb, "Spare ", HELV_SMALL);
628 
629  OMUTEMP.tgb[16] = MCreateTButton(tb, "CCD ", HELV_SMALL);
633 
634 
635  lbl = MCreateLabel(_rowform001, "Percent", HELV_SMALL);
639  MObjectSetTransparency(lbl, 0);
640  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
642 
643  tb = MCreateTableForm(_rowform001, 1);
644  MFormSetSpacing(tb, 1);
649 
650  OMUTEMP.tgb[17] = MCreateTButton(tb, "Pwr CCD", HELV_SMALL);
654 
655  OMUTEMP.tgb[18] = MCreateTButton(tb, "Pwr Pelt", HELV_SMALL);
659 
660 
661 
662 
663  _rowform002 = MCreateRowForm(_colform000);
664  MObjectSetFGColorFromParent(_rowform002, False);
665  MObjectSetResize(_rowform002, True, True);
666 /*
667  _label002 = MCreateLabel(_rowform002, "VarY -> Blu Line", HELV_SMALL);
668  MObjectAlign(_label002, CENTER_ALIGN, TOP_ALIGN);
669  MObjectSetForegroundRGB(_label002, 255, 255, 0);
670  MObjectSetBackgroundRGB(_label002, 117, 117, 169);
671  MObjectSetTransparency(_label002, 0);
672  MObjectSetShadow(_label002, WS_SHADOW_IN, 1, 0);
673  MObjectSetResize(_label002, False, False);
674 */
675  _tablefrm002 = MCreateTableForm(_rowform002, 2);
676  MFormSetSpacing(_tablefrm002, 1);
677 // MTableFormShowGrid(_tablefrm002);
678  MObjectAlign(_tablefrm002, CENTER_ALIGN, TOP_ALIGN);
679  MObjectSetResize(_tablefrm002, True, True);
680 
681  _colform001 = MCreateColForm(_tablefrm002);
682 
683  _scrollbar000 = MCreateScrollBar(_colform001, SBT_VERT, 10, 110);
684  MScrollBarSetSliderColorShift(_scrollbar000, 50);
685 
686  rowfrm = MCreateRowForm(_colform001);
687  MFormSetSpacing(rowfrm, 1);
690  MObjectSetResize(rowfrm, False, True);
691 
692  for (i=0;i<11;i++)
693  {
694  OMUTEMP.lbly[i] = MCreateLabel(rowfrm, "-------", HELV_SMALL);
700  }
701 
702  _rowform004 = MCreateRowForm(_tablefrm002);
703 
704  OMUTEMP.drawarea000 = MCreateDrawArea(_rowform004, 763, 350);
708 
709  _rowform005 = MCreateRowForm(_tablefrm002);
710  MFormSetSpacing(_rowform005, 1);
711  MObjectSetResize(_rowform005, False, False);
712 
713  tb = MCreateTableForm(_rowform005, 2);
714  MFormSetSpacing(tb, 1);
715  // MTableFormShowGrid(_tablefrm002);
717  MObjectSetResize(tb, True, True);
718 
719  lbl = MCreateLabel(tb, "X:", HELV_SMALL);
723  MObjectSetTransparency(lbl, 0);
724  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
726 
727  OMUTEMP.LBL_X = MCreateLabel(tb, "xxxx", HELV_SMALL);
734 
735  lbl = MCreateLabel(tb, "Y:", HELV_SMALL);
739  MObjectSetTransparency(lbl, 0);
740  MObjectSetShadow(lbl, WS_SHADOW_OUT, 1, 0);
742 
743  OMUTEMP.LBL_Y = MCreateLabel(tb, "yyyy", HELV_SMALL);
750 
751 
752  _rowform006 = MCreateRowForm(_tablefrm002);
753  MFormSetSpacing(_rowform006, 1);
754  MObjectSetResize(_rowform006, True, True);
755 
756  tb = MCreateTableForm(_rowform006, (sizeof OMUTEMP.lblx / sizeof OMUTEMP.lblx[0]));
757  MFormSetSpacing(tb, 1);
758 // MTableFormShowGrid(_tablefrm003);
759  MObjectSetBackgroundRGB(tb, 120, 177, 218);
761 
762 
763  for (i=0;i<(sizeof OMUTEMP.lblx / sizeof OMUTEMP.lblx[0]);i++)
764  {
765  OMUTEMP.lblx[i] = MCreateLabel(tb, "-----", HELV_SMALL);
772  }
773 
774  _rowform007 = MCreateRowForm(_rowform006);
775 
776  _scrollbar001 = MCreateScrollBar(_rowform007, SBT_HOR, 10, 110);
777 
778 
779 // MShellRealize( _shell000);
780 
781  return _shell000;
782 }
short DB_BG_lblUP[3]
Background Capital Letters Labels Color UP.
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT MCreateTButton(MOBJECT parent, const char *text, MTFont font)
MOBJECT lbl
Definition: DFileMan.c:42
#define WS_SHADOW_IN
Definition: Mguidefs.h:958
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
MOBJECT LBL_X
Definition: bildef.h:115
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.
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
void MTableFormSetColAlign(MOBJECT form, int col, int al)
#define SBT_VERT
Definition: Mguidefs.h:1140
MOBJECT lblx[25]
Definition: bildef.h:106
MOBJECT tgb[20]
Definition: bildef.h:105
MOBJECT lbly[11]
Definition: bildef.h:107
short DB_BG_RButt[3]
Background Radio Buttons.
palette DPAL
Definition: 2DPlot.c:27
MOBJECT LBL_Y
Definition: bildef.h:115
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
void MTButtonSetCallback(MOBJECT button, OBJ_VALUE_CB cb, void *data)
#define CENTER_ALIGN
Definition: Mguidefs.h:917
void MObjectSetFGColorFromParent(MOBJECT obj, int true_false)
#define HELV_SMALL
Definition: Mguidefs.h:881
MOBJECT MCreateScrollBar(MOBJECT parent, int type, long n, long max)
#define SBT_HOR
Definition: Mguidefs.h:1139
MOBJECT _shell000
Definition: DAS_Spatram.h:3052
void MScrollBarSetSliderColorShift(MOBJECT p, int percentage)
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
omutemp OMUTEMP
Definition: 2DPlot.c:29
MOBJECT MCreateDrawArea(MOBJECT parent, int width, int height)
MOBJECT MCreateColForm(MOBJECT parent)
void ToggleButtCB(MOBJECT p, MVALUE od, void *ad)
Definition: 2DPlot.c:420
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
void MDrawAreaSetExposeCallback(MOBJECT obj, OBJ_EVENT_CB cb, void *ad)
void D2D_AreaInputTemp(MOBJECT obj, MEvent *pe, void *a_data)
Definition: 2DPlot.c:66
void MDrawAreaSetInputCallback(MOBJECT obj, OBJ_EVENT_CB cb, void *ad)
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
void MObjectUnmap(MOBJECT obj)
short DB_FG_RButt[3]
Foreground Radio Buttons.
#define F_ATT_FORM
Definition: Mguidefs.h:1107
int DrawAreaTempCB(MOBJECT obj, MEvent *pexp, void *a_data)
Definition: 2DPlot.c:462
void MFormSetSpacing(MOBJECT p, int offset)
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT drawarea000
Definition: bildef.h:109
MOBJECT MCreateRowForm(MOBJECT parent)
void MTopAttach(MOBJECT child, int att_type, int off, MOBJECT obj)
#define TOP_ALIGN
Definition: Mguidefs.h:918
short DB_FG_lblUP[3]
Foreground Capital Letters Labels Color UP.
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreate_CP()

MOBJECT MDCreate_CP ( void  )

Create Spectrometer Control Panel. Procedure that build the Control Panel for checking the spectrometer operations such as temperature monitoring, stepper motor positioning, data acquisition ...

Returns
void

Definition at line 1143 of file CreateForms.c.

References controlpanel::Albl_Azim, controlpanel::Albl_CS, controlpanel::Albl_Elev, controlpanel::Albl_IE, controlpanel::Albl_LS, controlpanel::Albl_Script, controlpanel::Albl_Status, controlpanel::Albl_sunr, controlpanel::Albl_suns, CENTER_ALIGN, gui::ContrPanel, CP_Sh, palette::DB_BG, palette::DB_BG_Albl, palette::DB_BG_lblUP, palette::DB_BG_Plbl, palette::DB_FG_Albl, palette::DB_FG_lblUP, palette::DB_FG_Plbl, DB_HelpCB(), DB_InfCB(), DB_KB_ButtonActive(), DB_KeyB_CB(), DB_KeyComSelButtKB_CB(), DB_KeyComSelButtMouse_CB(), DB_LampSelButtMouse_CB(), DB_Redraw_CB(), palette::DB_Sel, palette::DB_UnSel, palette::DB_UnSelFG, das::DOption, EM_BUTTON_PRESS, EM_KEY_PRESS, EM_MOTION, EM_WINDOW_ENTER, F_ATT_NONE, False, FDOUBLE, optionini::filtertype, FIXED_SMALL, FPLUS, FrmBuildTemperature(), FSIMPLE, das::Gui, HELV_MEDIUM, HELV_SMALL, item_advc, pushbutt::KeyB, lbl, controlpanel::lbl_Par, controlpanel::lbl_Time, controlpanel::lblK, controlpanel::LedHG, controlpanel::ledpelt, controlpanel::LedQJ, controlpanel::LedSM, LEFT_ALIGN, MBottomAttach(), MButtonSetOnMouseOverForegroundRGB(), MCreateColForm(), MCreateLabel(), MCreatePButton(), MCreatePixmapFromFile(), MCreatePopupMenu(), MCreateRowForm(), MCreateShell(), MCreateTabbedRowForm(), MCreateTableForm(), MLabelSetAlignment(), MMenuAddItemObsolete(), MObjectAddEventNotifyCallback(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetBGColorFromParent(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MObjectSetTransparency(), MPagedFormSetActivePage(), MPButtonSetCallback(), MSetInputPromptFgRGB(), MSetInputPromptFonts(), MSetInputPromptRGB(), MSetMessageDialogFgRGB(), MSetMessageDialogFonts(), MSetMessageDialogRGB(), stepm::NAMS, controlpanel::Pagedfrm_SM, controlpanel::pblamps, popup_advcalib, PopUpAdvCal_CB(), PupAdvCal_CB(), gui::PushButt, RIGHT_ALIGN, SF_NO_CLOSE, SF_NO_MAXIMIZE, SF_NO_RESIZE, das::StepM, StepperPagForm(), TOP_ALIGN, True, UNDEF_ALIGN, WS_ETCHED_IN, WS_NONE, WS_SHADOW_IN, and WS_SHADOW_OUT.

Referenced by BuildMainShell().

1144 {
1145 
1146  MOBJECT colfrm; //main Container
1147 
1148  MOBJECT rowfrm; //left buttons container (first column)
1149 
1150  MOBJECT tb, pb;
1151  MOBJECT lbl; //
1152 
1153  MOBJECT Pagedfrm_Temp;
1154 
1155  int i, k, c = 0;
1156  int d_events = 0;
1157  char buff[128];
1158 const char *KeyCom_Code[] = {{"&Mirror"}, //0 0
1159  {"&Grating"}, //1 1
1160  {"&Filter "}, //2 2
1161 
1162  {"&NDFilter"}, //5 4
1163  {"&MIGE Pos"}, //4 3
1164 
1165  {"&Ref. Pos."}, //6 5
1166  {"F ECU Off "}, //7 6
1167  {"SPARE "}, //8 7
1168 
1169  {"SPARE "}, //10 8
1170  {"SPARE "}, //11 9
1171  {"Sim.Pos."}, //9 10
1172  {"&Horiz M"}, //3 11
1173 
1174  {"M&vGrat."}, //12 12
1175  {"&Config"},//13 13
1176 
1177  {" Ca&lib "}, //14
1178  {"ARan&ge "}, //15
1179  {"Ge&tCCD "}, //16
1180  {"Average"}, //17
1181  {"Dark "}, //18
1182  {"Save "}, //19
1183  {" PLOT "}, //20
1184  {" ZOOM "},//21
1185  {"P &X Off"},//22
1186  {"P &Y Off"},//23
1187  {"A&bout "},//24
1188  {"&Pause "},//25
1189  {"&Tools "},//26
1190  {"&Quit "}};//27
1191 
1192 const char *KeyCom_CodePopUpHelp[]= {{"Set Input Mirror position"}, //0
1193  {"Set Grating Position"}, //1
1194  {"Set Filter wheel Position"}, //2
1195  {"Set Zenith and Azimuth Position"}, //4
1196  {"Set zimuth Position"}, //5
1197  {"Look for Input Mirror Ref. Pos."}, //6
1198  {"Look for Grating Ref. Pos."}, //7
1199  {"Look for Filter Wheel Ref. Pos."}, //8
1200  {"Look for Zenith Ref. Pos. "}, //10
1201  {"Look for Azimuth Ref. Pos."}, //11
1202  {"Create shell for Simultaneous Positioning"}, //9
1203  {"Create Shell for Horizontal Measurements"}, //3
1204  {"Create Shell for free Grating movements"}, //12
1205  {"Open DAS Configuration tool"},//13
1206 
1207  {"Automatic Calibration "}, //14
1208  {"Computation Optimum Exposure time "}, //15
1209  {"Carry out Light Measurement"}, //16
1210  {"Perform Averaged Measurement"}, //17
1211  {"Carry out Dark Measurement "}, //18
1212  {"Save current measurements "}, //19
1213  {"2D Plot of image"}, //20
1214  {"Image Zoom "},//21
1215  {"X Profile On/Off"},//22
1216  {"Y Profile On/Off"},//23
1217  {"Info & Help "},//24
1218  {"Pause/Resume Script Execution "},//25
1219  {"Open tools Shell "},//26
1220  {"Exit Program "}};//27
1221 
1222 
1223  /**********************************************************************************/
1224  // Set the message dialog color and font format
1231  /**********************************************************************************/
1232 
1235  //MObjectAddEventNotifyCallback(CP_Sh, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1237 
1238  // Come si mette un'icona nella shell?
1239  //pix = MCreatePixmapFromFile(CP_Sh, "SYS\\ledoff.bmp");
1240 
1241  colfrm = MCreateColForm(CP_Sh);
1242  MObjectSetShadow(colfrm, WS_NONE, 0, 0);
1243  //MObjectAddEventNotifyCallback(colfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1244  MObjectSetBGColorFromParent(colfrm, True, 100);
1245  // Row form for the command buttons
1246  rowfrm = MCreateRowForm(colfrm);
1247  MObjectSetShadow(rowfrm, WS_SHADOW_IN, 2, 0);
1249  //MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1250  MObjectSetBGColorFromParent(rowfrm, True, 100);
1251  c = EM_MOTION | EM_BUTTON_PRESS;
1252  for (i=0; i < 14; i++)
1253  {
1254  //PBUTT.KeyB[i] = MCreatePButton(tb, KeyCom_Code[i], HELV_SMALL);
1255  DAS.Gui.PushButt.KeyB[i] = MCreatePButton(rowfrm, KeyCom_Code[i], HELV_SMALL);
1258  //MObjectSetPopupHelp(DAS.Gui.PushButt.KeyB[i] ,KeyCom_CodePopUpHelp[i] , 200, 5000);
1259  if (i==0)
1263 
1267 /*
1268 
1269  This code is for activation\deacivation of some pushbuttons depending on
1270  instrument type\esecution mode\option flags
1271 
1272  these functions are collected in the
1273  "DB_KB_ButtonActive" procedure placed after the creation of the second column of buttons
1274 
1275  if (DAS.Paramini.EqType == TROPOGAS ||
1276  DAS.Paramini.EqType == SPATRAMPLUS ||
1277  DAS.Paramini.EqType == GASCODNG1 ||
1278  DAS.Paramini.EqType == GASCODNG2 ||
1279  DAS.Paramini.EqType == GASCODNG3 ||
1280  DAS.Paramini.EqType == SPATRAM2)
1281  {
1282  if(i==11)
1283  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]);
1284 
1285 
1286  if(i==3 || i==4 || i==8 || i==9)
1287  {
1288  if(DAS.MIGE.linked == 0)
1289  {
1290  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]);
1291  //MObjectSetBackgroundRGB(optedit, 192, 192, 192);
1292 
1293  }
1294  }
1295  }
1296  if (DAS.Paramini.EqType == SPATRAM || DAS.Paramini.EqType == LIS_)
1297  if(i==3 || i==4 || i==8 || i==9 || i==10 || i== 11)
1298  MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]);
1299 // if (DAS.Paramini.EqType == GASCODNG)
1300 // if(i==4 || i==5 || i==9 || i==10 || i== 11)
1301 // MObjectSetUnsensitive(DAS.Gui.PushButt.KeyB[i]);
1302 */
1303  }
1304 
1305 
1306 
1307 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1308 
1309  //Second column of labels and controls
1310  /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1311  rowfrm = MCreateRowForm(colfrm);
1312  MBottomAttach(rowfrm, F_ATT_NONE, 3, NULL);
1314 // MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1315  MObjectSetShadow(rowfrm, WS_NONE, 0, 0);
1316  MObjectSetResize(rowfrm, True, True);
1317 // MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1318  MObjectSetBGColorFromParent(rowfrm, True, 100);
1319 
1320  DAS.Gui.ContrPanel.lblK[0] = MCreateLabel(rowfrm, "CONTROL PARAMETERS", HELV_SMALL);
1325 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1326 
1327  tb = MCreateTableForm(rowfrm, 2);
1329  MObjectSetResize(tb, True, False);
1330  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1331 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1333 /*
1334  DAS.Gui.ContrPanel.lbl_NP[0] = MCreateLabel(tb, "CCD Target Temp.:", FIXED_SMALL);
1335  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[0], LEFT_ALIGN);
1336  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[0], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1337  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[0], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1338  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[0], 0);
1339 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1340 */
1341  d_events = EM_WINDOW_ENTER | EM_MOTION;
1342 
1343  lbl = MCreateLabel(tb, "CCD Target Temp.:", FIXED_SMALL);
1347  MObjectSetTransparency(lbl, 0);
1348 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, d_events , (void *) 1);
1349 
1350 
1351  DAS.Gui.ContrPanel.lbl_Par[0] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
1356 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1357 
1358 /* DAS.Gui.ContrPanel.lbl_NP[1] = MCreateLabel(tb, "CCD Pelt. Init Pwr:", FIXED_SMALL);
1359  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[1], LEFT_ALIGN);
1360  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[1], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1361  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[1], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1362  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[1], 0);
1363  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[1], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1364 */
1365  lbl = MCreateLabel(tb, "CCD Pelt. Init Pwr:", FIXED_SMALL);
1369  MObjectSetTransparency(lbl, 0);
1370 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1371 
1372  DAS.Gui.ContrPanel.lbl_Par[1] = MCreateLabel(tb, "100%", HELV_SMALL);
1377 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[1], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1378 /*
1379  DAS.Gui.ContrPanel.lbl_NP[2] = MCreateLabel(tb, "OMU Target Temp.:", FIXED_SMALL);
1380  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[2], LEFT_ALIGN);
1381  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[2], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1382  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[2], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1383  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[2], 0);
1384  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[2], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1385 */
1386 
1387  lbl = MCreateLabel(tb, "OMU Target Temp.:", FIXED_SMALL);
1391  MObjectSetTransparency(lbl, 0);
1392 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1393 
1394  DAS.Gui.ContrPanel.lbl_Par[2] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
1399 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[2], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1400 /*
1401  DAS.Gui.ContrPanel.lbl_NP[10] = MCreateLabel(tb, "OMU Pelt. Init Pwr:", FIXED_SMALL);
1402  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[10], LEFT_ALIGN);
1403  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[10], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1404  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[10], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1405  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[10], 0);
1406  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[10], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1407 */
1408  lbl = MCreateLabel(tb, "OMU Pelt. Init Pwr:", FIXED_SMALL);
1412  MObjectSetTransparency(lbl, 0);
1413 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1414 
1415  DAS.Gui.ContrPanel.lbl_Par[10] = MCreateLabel(tb, "100%", HELV_SMALL);
1420 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[10], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1421 
1422 /*******************************************************************************************************/
1423  DAS.Gui.ContrPanel.lblK[1] = MCreateLabel(rowfrm, "CCD PARAMETERS", HELV_SMALL);
1428 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[1], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1429 
1430  tb = MCreateTableForm(rowfrm, 4);
1432  MObjectSetResize(tb, True, False);
1433  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1434 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1436 /*
1437  DAS.Gui.ContrPanel.lbl_NP[3] = MCreateLabel(tb, "H. Pix.:", FIXED_SMALL);
1438  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[3], LEFT_ALIGN);
1439  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[3], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1440  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[3], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1441  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[3], 0);
1442 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[3], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1443 */
1444  lbl = MCreateLabel(tb, "H. Pix:", FIXED_SMALL);
1448  MObjectSetTransparency(lbl, 0);
1449 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1450 
1451  DAS.Gui.ContrPanel.lbl_Par[3] = MCreateLabel(tb, "0000", HELV_SMALL);
1456 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[3], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1457 /*
1458  DAS.Gui.ContrPanel.lbl_NP[4] = MCreateLabel(tb, "V. Pix:", FIXED_SMALL);
1459  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[4], LEFT_ALIGN);
1460  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[4], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1461  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[4], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1462  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[4], WS_SHADOW_IN, 2, 1);
1463  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[4], 0);
1464 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[4], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1465  */
1466  lbl = MCreateLabel(tb, "V. Pix:", FIXED_SMALL);
1470  MObjectSetTransparency(lbl, 0);
1471 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1472 
1473  DAS.Gui.ContrPanel.lbl_Par[4] = MCreateLabel(tb, " 0000", HELV_SMALL);
1478 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[4], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1479 
1480 /*******************************************************************************************************/
1481 
1482  DAS.Gui.ContrPanel.lblK[2] = MCreateLabel(rowfrm, "CCD WINDOW", HELV_SMALL);
1487 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[2], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1488 
1489  tb = MCreateTableForm(rowfrm, 4);
1491  MObjectSetResize(tb, True, False);
1492  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1493 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1495 /*
1496 
1497  DAS.Gui.ContrPanel.lbl_NP[5] = MCreateLabel(tb , "X Start:", FIXED_SMALL);
1498  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[5], LEFT_ALIGN);
1499  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[5], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1500  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[5], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1501  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[5], WS_SHADOW_IN, 2, 1);
1502  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[5], 0);
1503  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[5], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1504 */
1505  lbl = MCreateLabel(tb, "X Start:", FIXED_SMALL);
1509  MObjectSetTransparency(lbl, 0);
1510 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1511 
1517 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[5], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1518 /*
1519  DAS.Gui.ContrPanel.lbl_NP[6] = MCreateLabel(tb, "Y Start:", FIXED_SMALL);
1520  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[6], LEFT_ALIGN);
1521  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[6], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1522  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[6], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1523  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[6], WS_SHADOW_IN, 2, 1);
1524  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[6], 0);
1525  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[6], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1526 */
1527  lbl = MCreateLabel(tb, "Y Start:", FIXED_SMALL);
1531  MObjectSetTransparency(lbl, 0);
1532 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1533 
1539 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[6], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1540 /*
1541  DAS.Gui.ContrPanel.lbl_NP[7] = MCreateLabel(tb, "X End:", FIXED_SMALL);
1542  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[7], LEFT_ALIGN);
1543  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[7], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1544  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[7], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1545  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[7], WS_SHADOW_IN, 2, 1);
1546  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[7], 0);
1547  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[7], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1548 */
1549  lbl = MCreateLabel(tb, "X End:", FIXED_SMALL);
1553  MObjectSetTransparency(lbl, 0);
1554 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1555 
1561 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[7], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1562 /*
1563  DAS.Gui.ContrPanel.lbl_NP[8] = MCreateLabel(tb, "Y End:", FIXED_SMALL);
1564  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[8], LEFT_ALIGN);
1565  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[8], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1566  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[8], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1567  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[8], WS_SHADOW_IN, 2, 1);
1568  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[8], 0);
1569  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[8], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1570 */
1571  lbl = MCreateLabel(tb, "Y End:", FIXED_SMALL);
1575  MObjectSetTransparency(lbl, 0);
1576 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1577 
1583 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[8], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1584 
1585 /*******************************************************************************************************/
1586 
1587  tb = MCreateTableForm(rowfrm, 2);
1589  MObjectSetResize(tb, True, False);
1590  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1591 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1593 
1594 /*
1595  DAS.Gui.ContrPanel.lbl_NP[9] = MCreateLabel(tb, "Vert.Bin.", FIXED_SMALL);
1596  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_NP[9], LEFT_ALIGN);
1597  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_NP[9], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1598  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_NP[9], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1599  // MObjectSetShadow(DAS.Gui.ContrPanel.lbl_NP[9], WS_SHADOW_IN, 2, 1);
1600  MObjectSetTransparency(DAS.Gui.ContrPanel.lbl_NP[9], 0);
1601  MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_NP[9], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1602 */
1603  lbl = MCreateLabel(tb, "Vert.Bin:", FIXED_SMALL);
1607  MObjectSetTransparency(lbl, 0);
1608 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1609 
1610  DAS.Gui.ContrPanel.lbl_Par[9] = MCreateLabel(tb, "00", HELV_SMALL);
1615 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Par[9], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1616 
1617  /*********************** STEPPERS *************************/
1618 
1619  DAS.Gui.ContrPanel.lblK[3] = MCreateLabel(rowfrm, "STEPPER MOTORS", HELV_SMALL);
1624 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[3], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1625 
1626 
1630 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Pagedfrm_SM, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1632 
1633  for (i=0;i<DAS.StepM.NAMS;i++)
1634  {
1635  for(k=0;k<2;k++)
1636  {
1637  StepperPagForm(i, k);
1638  }
1639  }
1641 
1642  /*********************** STEPPERS END *************************/
1643 
1644 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1645 
1646 
1647  //Seconda colonna di labels e controlli
1648  rowfrm = MCreateRowForm(colfrm);
1649  MBottomAttach(rowfrm, F_ATT_NONE, 3, NULL);
1651  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1652  MObjectSetShadow(rowfrm, WS_NONE, 0, 0);
1653  MObjectSetResize(rowfrm, True, True);
1654 // MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1655  MObjectSetBGColorFromParent(rowfrm, True, 100);
1656 
1657  DAS.Gui.ContrPanel.lblK[4] = MCreateLabel(rowfrm, "CCD-OMU STATUS", HELV_SMALL);
1662 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[4], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1663 
1664  tb = MCreateTableForm(rowfrm, 2);
1667  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1668  MObjectSetResize(tb, True, False);
1669 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1671 
1672 /* DAS.Gui.ContrPanel.Plbl_CS[0] = MCreateLabel(tb, "CCD Actual Temp.:", FIXED_SMALL);
1673  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_CS[0], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1674  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_CS[0], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1675  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_CS[0], 0);
1676  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_CS[0], LEFT_ALIGN);
1677 */
1678  lbl = MCreateLabel(tb, "CCD Actual Temp.:", FIXED_SMALL);
1681  MObjectSetTransparency(lbl, 0);
1683 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1684 
1685 
1686  DAS.Gui.ContrPanel.Albl_CS[0] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
1691 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_CS[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1692 /*
1693  DAS.Gui.ContrPanel.Plbl_CS[1] = MCreateLabel(tb, "CCD Pelt. Act. Pwr.:", FIXED_SMALL);
1694  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_CS[1], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1695  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_CS[1], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1696  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_CS[1], 0);
1697  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_CS[1], LEFT_ALIGN);
1698 */
1699  lbl = MCreateLabel(tb, "CCD Pelt Act Pwr:", FIXED_SMALL);
1702  MObjectSetTransparency(lbl, 0);
1704 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1705 
1706  DAS.Gui.ContrPanel.Albl_CS[1] = MCreateLabel(tb, "100%", HELV_SMALL);
1711 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_CS[1], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1712  /*
1713  DAS.Gui.ContrPanel.Plbl_LS[6] = MCreateLabel(tb, "Delta Temp.", FIXED_SMALL);
1714  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[6], LEFT_ALIGN);
1715  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[6], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1716  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[6], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1717  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[6], 0);
1718 */
1719  lbl = MCreateLabel(tb, "Delta Temp.:", FIXED_SMALL);
1722  MObjectSetTransparency(lbl, 0);
1724 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1725 
1726  DAS.Gui.ContrPanel.Albl_LS[6] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
1731 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[6], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1732 /*
1733  DAS.Gui.ContrPanel.Plbl_LS[7] = MCreateLabel(tb, "OMU Pelt.Act.Pwr:", FIXED_SMALL);
1734  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[7], LEFT_ALIGN);
1735  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[7], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1736  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[7], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1737  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[7], 0);
1738 */
1739  lbl = MCreateLabel(tb, "OMU Pelt.Act.Pwr:", FIXED_SMALL);
1742  MObjectSetTransparency(lbl, 0);
1744 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1745 
1746  DAS.Gui.ContrPanel.Albl_LS[7] = MCreateLabel(tb, "100%", HELV_SMALL);
1751 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[7], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1752 
1753  DAS.Gui.ContrPanel.ledpelt[0] = MCreatePixmapFromFile(tb, "SYS\\pltoff.bmp");
1756 
1757  DAS.Gui.ContrPanel.ledpelt[1] = MCreatePixmapFromFile(tb, "SYS\\pltoff.bmp");
1760 
1761 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1762 
1763 
1764  DAS.Gui.ContrPanel.lblK[5] = MCreateLabel(rowfrm, "STEPPERS STATUS", HELV_SMALL);
1769 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[5], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1770 
1771  tb = MCreateTableForm(rowfrm, DAS.StepM.NAMS*2);
1774  MObjectSetResize(tb, True, False);
1775  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1776 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1778 
1779  for (i=0;i<DAS.StepM.NAMS;i++)
1780  {
1781  for(k=0;k<2;k++)
1782  {
1783  sprintf(buff,"SM%d", (2*i+k+1));
1784 /*
1785  DAS.Gui.ContrPanel.Plbl_SM[i][k] = MCreateLabel(tb, buff, FIXED_SMALL);
1786  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_SM[i][k], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1787  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_SM[i][k], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1788  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_SM[i][k], 0);
1789  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_SM[i][k], CENTER_ALIGN);
1790 */
1791  lbl = MCreateLabel(tb, buff, FIXED_SMALL);
1794  MObjectSetTransparency(lbl, 0);
1796 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1797 
1798 
1799  DAS.Gui.ContrPanel.LedSM[i][k] = MCreatePixmapFromFile(tb, "SYS\\ledoff.bmp");
1801  }
1802  }
1803 
1804 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1805 
1806  DAS.Gui.ContrPanel.lblK[6] = MCreateLabel(rowfrm, "ACTIVITY ", HELV_SMALL);
1811 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[6], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1812 
1813  tb = MCreateTableForm(rowfrm, 2);
1816  MObjectSetResize(tb, True, True);
1817  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1819 /*
1820  DAS.Gui.ContrPanel.Plbl_Script = MCreateLabel(tb, "Script-Use:", FIXED_SMALL);
1821  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_Script, LEFT_ALIGN);
1822  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_Script, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1823  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_Script, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1824  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_Script, 0);
1825 */
1826  lbl = MCreateLabel(tb, "Script-Use:", FIXED_SMALL);
1829  MObjectSetTransparency(lbl, 0);
1831 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1832 
1833  DAS.Gui.ContrPanel.Albl_Script = MCreateLabel(tb, "XXXXXXXX.PRG", HELV_SMALL);
1838 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_Script, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1839 
1840 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1841 /*
1842  DAS.Gui.ContrPanel.lblK[9] = MCreateLabel(_rowform002, "ACTIVITY ", HELV_SMALL);
1843  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lblK[9], DPAL.DB_BG_lblUP[0], DPAL.DB_BG_lblUP[1], DPAL.DB_BG_lblUP[2]);
1844  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lblK[9], DPAL.DB_FG_lblUP[0], DPAL.DB_FG_lblUP[1], DPAL.DB_FG_lblUP[2]);
1845  MObjectSetShadow(DAS.Gui.ContrPanel.lblK[9], WS_SHADOW_OUT, 1, 0);
1846  MObjectSetTransparency(DAS.Gui.ContrPanel.lblK[9], 0);
1847 */
1848  tb = MCreateTableForm(rowfrm, 2);
1851  MObjectSetResize(tb, True, True);
1852  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1853 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1855 /*
1856  DAS.Gui.ContrPanel.Plbl_CS[2] = MCreateLabel(tb, "Acq.#:", FIXED_SMALL);
1857  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_CS[2], LEFT_ALIGN);
1858  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_CS[2], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1859  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_CS[2], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1860  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_CS[2], 0);
1861 */
1862 
1863  lbl = MCreateLabel(tb, "Acq.#:", FIXED_SMALL);
1866  MObjectSetTransparency(lbl, 0);
1868 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1869 
1870  DAS.Gui.ContrPanel.Albl_CS[2] = MCreateLabel(tb, " 0", HELV_SMALL);
1875 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_CS[2], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1876 /*
1877  DAS.Gui.ContrPanel.Plbl_CS[3] = MCreateLabel(tb, "File:", FIXED_SMALL);
1878  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_CS[3], LEFT_ALIGN);
1879  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_CS[3], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1880  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_CS[3], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1881  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_CS[3], 0);
1882 */
1883 
1884  lbl = MCreateLabel(tb, "File:", FIXED_SMALL);
1887  MObjectSetTransparency(lbl, 0);
1889 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1890 
1891 
1897 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_CS[3], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1898 
1899 /*
1900  DAS.Gui.ContrPanel.Plbl_IE[0] = MCreateLabel(tb, "AutoR:", FIXED_SMALL);
1901  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_IE[0], LEFT_ALIGN);
1902  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_IE[0], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1903  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_IE[0], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1904  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_IE[0], 0);
1905 */
1906  lbl = MCreateLabel(tb, "AutoR:", FIXED_SMALL);
1909  MObjectSetTransparency(lbl, 0);
1911 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
1912 
1913 
1914  DAS.Gui.ContrPanel.Albl_IE[0] = MCreateLabel(tb, "0.002", HELV_SMALL);
1919 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_IE[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
1920  /*
1921  DAS.Gui.ContrPanel.Plbl_IE[1] = MCreateLabel(tb, "Dwnld:", FIXED_SMALL);
1922  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_IE[1], LEFT_ALIGN);
1923  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_IE[1], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
1924  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_IE[1], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
1925  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_IE[1], 0);
1926 
1927  DAS.Gui.ContrPanel.Albl_IE[1] = MCreateLabel(tb, "xxxxx", HELV_SMALL);
1928  MLabelSetAlignment(DAS.Gui.ContrPanel.Albl_IE[1], RIGHT_ALIGN);
1929  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Albl_IE[1], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
1930  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Albl_IE[1], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
1931  MObjectSetTransparency(DAS.Gui.ContrPanel.Albl_IE[1], 0);
1932  */
1933 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1934  DAS.Gui.ContrPanel.lblK[7] = MCreateLabel(rowfrm, "LAMPS STATUS", HELV_SMALL);
1939 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[7], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1940 
1941 
1942  tb = MCreateTableForm(rowfrm, 4);
1945  MObjectSetResize(tb, True, True);
1946  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
1947 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1949 
1950  DAS.Gui.ContrPanel.LedHG = MCreatePixmapFromFile(tb, "SYS\\ledoff.bmp");
1952 
1953  DAS.Gui.ContrPanel.pblamps[0] = MCreatePButton(tb, "Hg Off", HELV_SMALL);
1961 
1962 
1963  DAS.Gui.ContrPanel.LedQJ = MCreatePixmapFromFile(tb, "SYS\\ledoff.bmp");
1965 
1966  DAS.Gui.ContrPanel.pblamps[1] = MCreatePButton(tb, "Qj Off", HELV_SMALL);
1974 
1975 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1976 
1977  /*******************************************************************/
1978 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1979  rowfrm = MCreateRowForm(colfrm);
1980  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1981  MObjectSetShadow(rowfrm, WS_NONE, 0, 0);
1982  MObjectSetResize(rowfrm, True, False);
1984 // MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
1985  MObjectSetBGColorFromParent(rowfrm, True, 100);
1986 
1987  DAS.Gui.ContrPanel.lblK[8] = MCreateLabel(rowfrm, "DEVICES STATUS", HELV_SMALL);
1993 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[8], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
1994 
1995  tb = MCreateTableForm(rowfrm, 2);
1997  MObjectSetResize(tb, True, False);
1998  MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
2000 // MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2002 /*
2003  DAS.Gui.ContrPanel.Plbl_LS[0] = MCreateLabel(tb, "Source Mirror:", FIXED_SMALL);
2004  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[0], LEFT_ALIGN);
2005  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[0], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2006  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[0], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2007  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[0], 0);
2008  MObjectAlign(DAS.Gui.ContrPanel.Plbl_LS[0], CENTER_ALIGN, TOP_ALIGN);
2009 */
2010  lbl = MCreateLabel(tb, "Source Mirror", FIXED_SMALL);
2013  MObjectSetTransparency(lbl, 0);
2016 
2017  DAS.Gui.ContrPanel.Albl_LS[0] = MCreateLabel(tb, " ", HELV_SMALL);
2023 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[0], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2024 
2025 /* DAS.Gui.ContrPanel.Plbl_LS[1] = MCreateLabel(tb, "Grating:", FIXED_SMALL);
2026  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[1], LEFT_ALIGN);
2027  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[1], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2028  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[1], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2029  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[1], 0);
2030 */
2031  lbl = MCreateLabel(tb, "Grating:", FIXED_SMALL);
2034  MObjectSetTransparency(lbl, 0);
2036 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2037 
2043 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[1], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2044 
2045 /* DAS.Gui.ContrPanel.Plbl_LS[2] = MCreateLabel(tb, "Filter Wheel:", FIXED_SMALL);
2046  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[2], LEFT_ALIGN);
2047  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[2], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2048  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[2], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2049  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[2], 0);
2050 */
2051  lbl = MCreateLabel(tb, "Filter Wheel:", FIXED_SMALL);
2054  MObjectSetTransparency(lbl, 0);
2056 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2057 
2058 
2059  DAS.Gui.ContrPanel.Albl_LS[2] = MCreateLabel(tb, " ", HELV_SMALL);
2064 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[2], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2065 /*
2066  DAS.Gui.ContrPanel.Plbl_LS[3] = MCreateLabel(tb, "Unused", FIXED_SMALL);
2067  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[3], LEFT_ALIGN);
2068  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[3], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2069  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[3], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2070  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[3], 0);
2071  MObjectAlign(DAS.Gui.ContrPanel.Plbl_LS[3], CENTER_ALIGN, TOP_ALIGN);
2072 */
2073 
2074 
2076  lbl = MCreateLabel(tb, "NDFiter", FIXED_SMALL);
2077  if(DAS.DOption.filtertype == FSIMPLE)
2078  lbl = MCreateLabel(tb, "Not Used", FIXED_SMALL);
2079 
2082  MObjectSetTransparency(lbl, 0);
2084 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2085 
2087  DAS.Gui.ContrPanel.Albl_LS[3] = MCreateLabel(tb, " OFF", HELV_SMALL);
2088  if(DAS.DOption.filtertype == FSIMPLE)
2089  DAS.Gui.ContrPanel.Albl_LS[3] = MCreateLabel(tb, " ", HELV_SMALL);
2090 
2096 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[3], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2097 
2098 /* DAS.Gui.ContrPanel.Plbl_LS[4] = MCreateLabel(tb, "Zenith:", FIXED_SMALL);
2099  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[4], LEFT_ALIGN);
2100  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[4], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2101  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[4], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2102  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[4], 0);
2103 */
2104  lbl = MCreateLabel(tb, "Zenith:", FIXED_SMALL);
2107  MObjectSetTransparency(lbl, 0);
2109 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2110 
2111 
2117 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[4], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2118 
2119 /* DAS.Gui.ContrPanel.Plbl_LS[5] = MCreateLabel(tb, "Azimuth:", FIXED_SMALL);
2120  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_LS[5], LEFT_ALIGN);
2121  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_LS[5], DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2122  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_LS[5], DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2123  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_LS[5], 0);
2124 */
2125  lbl = MCreateLabel(tb, "Azimuth:", FIXED_SMALL);
2128  MObjectSetTransparency(lbl, 0);
2130 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2131 
2132 
2133  DAS.Gui.ContrPanel.Albl_LS[5] = MCreateLabel(tb, " ", HELV_SMALL);
2138 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_LS[5], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2139 
2140 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
2141 
2142  DAS.Gui.ContrPanel.lblK[9] = MCreateLabel(rowfrm, "TEMPERATURES", HELV_SMALL);
2148 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lblK[9], (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 3);
2149 
2150 
2151  Pagedfrm_Temp = MCreateTabbedRowForm(rowfrm, 2, FIXED_SMALL);
2153  MObjectSetBackgroundRGB(Pagedfrm_Temp, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2154  MObjectSetBGColorFromParent(Pagedfrm_Temp, True, 100);
2155 
2156  FrmBuildTemperature(Pagedfrm_Temp);
2157 
2158 /*************************** COMMANDS *********************************************/
2159 
2161  item_advc = MMenuAddItemObsolete(popup_advcalib, "Adv. Calib", PopUpAdvCal_CB, (void *) 0);
2164 
2165 
2166 
2167  rowfrm = MCreateRowForm(colfrm);
2168  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2169  MObjectSetShadow(rowfrm, WS_SHADOW_IN, 2, 0);
2171  MObjectSetResize(rowfrm, True, False);
2172 // MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2173  MObjectSetBGColorFromParent(rowfrm, True, 100);
2174 
2175  for (i=14; i < 28; i++)
2176  {
2177  DAS.Gui.PushButt.KeyB[i] = MCreatePButton(rowfrm, KeyCom_Code[i], HELV_SMALL);
2180  //MObjectSetPopupHelp(DAS.Gui.PushButt.KeyB[i] ,KeyCom_CodePopUpHelp[i] , 200, 5000);
2181  if (i==0)
2189  if (i==14)
2191 
2192  }
2193 
2194 
2195  DB_KB_ButtonActive(1);
2196 
2197 
2198 /**************************************************************************************/
2199  rowfrm = MCreateRowForm(CP_Sh);
2200  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2201  MObjectSetShadow(rowfrm, WS_SHADOW_OUT, 2, 2);
2202 // MObjectAddEventNotifyCallback(rowfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2203  MObjectSetBGColorFromParent(rowfrm, True, 100);
2204 
2205  tb = MCreateTableForm(rowfrm, 3);
2208  //MObjectSetShadow(tb, WS_SHADOW_IN, 2, 0);
2210  //MObjectAddEventNotifyCallback(tb, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2212 
2213  pb = MCreatePButton(tb, "Help ", HELV_MEDIUM);
2214  MPButtonSetCallback(pb, DB_HelpCB, (void *) 0);
2216  MObjectSetShadow(pb, WS_SHADOW_OUT, 3, 0);
2217 
2218  DAS.Gui.ContrPanel.lbl_Time = MCreateLabel(tb, "Station: XXX, Date: YYYY/MM/DD, Time: HH:MM:SS, SolarZenithAngle: xxx.xx", HELV_MEDIUM);
2224 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.lbl_Time, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2225 
2226  pb = MCreatePButton(tb, " Inf. ", HELV_MEDIUM);
2227  MPButtonSetCallback(pb, DB_InfCB, (void *) 0);
2229  MObjectSetShadow(pb, WS_SHADOW_OUT, 3, 0);
2230 
2231 
2232  colfrm = MCreateColForm(CP_Sh);
2233  MObjectSetBackgroundRGB(colfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2234  MObjectSetShadow(colfrm, WS_SHADOW_IN, 2, 2);
2235  MObjectSetBGColorFromParent(colfrm, True, 100);
2236 // MObjectAddEventNotifyCallback(colfrm, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2237 
2238 /* DAS.Gui.ContrPanel.Plbl_Elev = MCreateLabel(colfrm, "Sun Elev:", HELV_MEDIUM);
2239  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_Elev, LEFT_ALIGN);
2240  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_Elev, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2241  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_Elev, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2242  MObjectSetResize(DAS.Gui.ContrPanel.Plbl_Elev, False, True);
2243  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_Elev, 0);
2244 */
2245  lbl = MCreateLabel(colfrm, "Sun Elev:", HELV_MEDIUM);
2248  MObjectSetTransparency(lbl, 0);
2250  MObjectSetResize(lbl, False, True);
2251 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2252 
2253  DAS.Gui.ContrPanel.Albl_Elev = MCreateLabel(colfrm, "XX.X", HELV_MEDIUM);
2259 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_Elev, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2260 
2261 /* DAS.Gui.ContrPanel.Plbl_Azim = MCreateLabel(colfrm, "Sun Az.:", HELV_MEDIUM);
2262  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_Azim, LEFT_ALIGN);
2263  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_Azim, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2264  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.Plbl_Azim, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2265  MObjectSetResize(DAS.Gui.ContrPanel.Plbl_Azim, False, True);
2266  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_Azim, 0);
2267 */
2268  lbl = MCreateLabel(colfrm, "Sun Az.:", HELV_MEDIUM);
2271  MObjectSetTransparency(lbl, 0);
2273  MObjectSetResize(lbl, False, True);
2274 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2275 
2276  DAS.Gui.ContrPanel.Albl_Azim = MCreateLabel(colfrm, "XXX.XX", HELV_MEDIUM);
2282 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_Azim, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2283 
2284  lbl = MCreateLabel(colfrm, "SunR:", HELV_MEDIUM);
2287  MObjectSetTransparency(lbl, 0);
2289  MObjectSetResize(lbl, False, True);
2290 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2291 
2292  DAS.Gui.ContrPanel.Albl_sunr = MCreateLabel(colfrm, "XXXX.XX", HELV_MEDIUM);
2298 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_sunr, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2299 
2300  lbl = MCreateLabel(colfrm, "SunS:", HELV_MEDIUM);
2303  MObjectSetTransparency(lbl, 0);
2305  MObjectSetResize(lbl, False, True);
2306 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2307 
2308  DAS.Gui.ContrPanel.Albl_suns = MCreateLabel(colfrm, "XXXX.XX", HELV_MEDIUM);
2314 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_suns, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2315 
2316 /*
2317  DAS.Gui.ContrPanel.Plbl_Status = MCreateLabel(colfrm, "Status:", HELV_MEDIUM);
2318  MLabelSetAlignment(DAS.Gui.ContrPanel.Plbl_Status, LEFT_ALIGN);
2319  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.Plbl_Status, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2320  MObjectSetResize(DAS.Gui.ContrPanel.Plbl_Status, False, True);
2321  MObjectSetTransparency(DAS.Gui.ContrPanel.Plbl_Status, 0);
2322 */
2323  lbl = MCreateLabel(colfrm, "Status:", HELV_MEDIUM);
2326  MObjectSetTransparency(lbl, 0);
2328  MObjectSetResize(lbl, False, True);
2329 // MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 1);
2330 
2336 // MObjectAddEventNotifyCallback(DAS.Gui.ContrPanel.Albl_Status, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 2);
2337 
2338 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
2339 
2340  return CP_Sh;
2341 }
short DB_BG_lblUP[3]
Background Capital Letters Labels Color UP.
stepm StepM
Stepper motors parameters structure.
#define RIGHT_ALIGN
Definition: Mguidefs.h:916
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
#define WS_NONE
Definition: Mguidefs.h:956
#define SF_NO_RESIZE
Definition: Mguidefs.h:1038
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
MOBJECT CP_Sh
Definition: CreateForms.c:85
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
MOBJECT MCreatePixmapFromFile(MOBJECT parent, const char *fname)
MOBJECT lbl
Definition: DFileMan.c:42
#define WS_SHADOW_IN
Definition: Mguidefs.h:958
void MSetInputPromptRGB(int r, int g, int b)
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
optionini DOption
Options for DAS execution.
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void PopUpAdvCal_CB(MOBJECT obj, void *item, void *data)
Definition: CreateForms.c:1110
MOBJECT KeyB[28]
Keyboard Buttons.
int NAMS
Number of AMSs Devices.
MOBJECT Albl_sunr
Active Control Panel Labels for Sunrise.
#define SF_NO_MAXIMIZE
Definition: Mguidefs.h:1034
MOBJECT LedQJ
Control Panel Led for QJ Lamp.
void MBottomAttach(MOBJECT child, int att_type, int off, MOBJECT obj)
void DB_KeyComSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
callback for selsct a specified push button with the keyboard
Definition: CreateForms.c:5072
#define EM_WINDOW_ENTER
Definition: Mguidefs.h:320
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
void MSetMessageDialogFonts(MTFont text_font, MTFont buttons_font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
#define False
Definition: Mguidefs.h:236
MOBJECT pblamps[2]
Control Panel Push buttons for HG and QJ Lamps.
void MSetInputPromptFonts(MTFont text, MTFont edit, MTFont btn)
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
void MSetInputPromptFgRGB(int r, int g, int b)
MENU_ITEM item_advc
Definition: CreateForms.c:1139
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
short DB_Sel[3]
Selected Buttons Colors.
void MSetMessageDialogFgRGB(int r, int g, int b)
#define SF_NO_CLOSE
Definition: Mguidefs.h:1032
void MSetMessageDialogRGB(int r, int g, int b)
MOBJECT Albl_CS[4]
Active Control Panel Labels for Camera Status 4.
#define UNDEF_ALIGN
Definition: Mguidefs.h:920
void DB_KeyComSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
callback for selsct a specified push button with the keyboard
Definition: CreateForms.c:5152
MOBJECT Albl_suns
Active Control Panel Labels for Sunset.
MENU_ITEM MMenuAddItemObsolete(MOBJECT pd, const char *item, MGUI_CB cb, void *ad)
#define EM_MOTION
Definition: Mguidefs.h:319
MOBJECT Albl_Azim
Active Control Panel Labels for Sun Azimuth.
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
#define EM_KEY_PRESS
Definition: Mguidefs.h:316
MOBJECT lbl_Time
Control Panel Labels for Time.
void StepperPagForm(int p, int q)
Definition: CreateForms.c:259
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define FDOUBLE
double filter wheel
#define FPLUS
Filter Wheel Torque Motor.
MOBJECT popup_advcalib
Definition: CreateForms.c:1138
#define CENTER_ALIGN
Definition: Mguidefs.h:917
MOBJECT ledpelt[2]
Control Panel Leds for Peltier Activity.
#define EM_BUTTON_PRESS
Definition: Mguidefs.h:317
void DB_KeyB_CB(MOBJECT p, void *od, void *ad)
Push buttons callback .
Definition: CreateForms.c:4693
MOBJECT Albl_Script
Active Control Panel Labels for Script in execution.
#define HELV_SMALL
Definition: Mguidefs.h:881
#define FIXED_SMALL
Definition: Mguidefs.h:878
void DB_Redraw_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
Definition: CreateForms.c:102
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
void(* OBJ_EVENT_CB)(MOBJECT obj, MEvent *e, void *ad)
Definition: Mguidefs.h:1456
MOBJECT MCreateColForm(MOBJECT parent)
palette DPAL
Definition: CreateForms.c:88
void MObjectAddEventNotifyCallback(MOBJECT obj, OBJ_EVENT_CB cb, CARD32 event_mask, void *a_data)
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
pushbutt PushButt
Push buttons.
void DB_LampSelButtMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
callback for selsct a specified push button with the keyboard
Definition: CreateForms.c:5041
#define FSIMPLE
simple filter wheel
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
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 Albl_Status
Active Control Panel Labels for Status.
void MLabelSetAlignment(MOBJECT p, int align)
controlpanel ContrPanel
Control Panel Structure.
void MPagedFormSetActivePage(MOBJECT form, int page)
das DAS
Definition: CreateForms.c:98
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
short DB_UnSelFG[3]
Unselected Buttons Colors.
MOBJECT Albl_IE[1]
Active Control Panel Labels for In Execution status.
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
void FrmBuildTemperature(MOBJECT pf)
Definition: CreateForms.c:151
void MButtonSetOnMouseOverForegroundRGB(MOBJECT button, int r, int g, int b)
int DB_InfCB(MOBJECT o, void *od, void *ad)
Inf Callback Create the Inf shell.
Definition: DAS_Spat.c:915
MOBJECT Albl_Elev
Active Control Panel Labels for Sun Elevation.
#define HELV_MEDIUM
Definition: Mguidefs.h:882
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT LedHG
Control Panel Led for HG Lamp.
MOBJECT MCreateRowForm(MOBJECT parent)
#define WS_ETCHED_IN
Definition: Mguidefs.h:959
void PupAdvCal_CB(MOBJECT obj, MEvent *pe, void *pdown)
Definition: CreateForms.c:1126
MOBJECT Pagedfrm_SM
Pged form for Stepper Motors.
MOBJECT MCreatePopupMenu(MTFont font)
#define TOP_ALIGN
Definition: Mguidefs.h:918
MOBJECT MCreateTabbedRowForm(MOBJECT parent, int npage, MTFont f)
MOBJECT lblK[10]
Capital Labels Up.
#define F_ATT_NONE
Definition: Mguidefs.h:1106
void MObjectSetBGColorFromParent(MOBJECT obj, int true_false, int percentage)
short DB_FG_lblUP[3]
Foreground Capital Letters Labels Color UP.
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
+ Here is the caller graph for this function:

§ MDCreateDASConfig()

MOBJECT MDCreateDASConfig ( void  )

DAS Config shell. Procedure that build the shell for the DAS Config panels. The DAS Config allow for setting a lot of the application parameters.

Returns
void

Definition at line 7017 of file DAS_Spat_Conf.c.

References adtester::ADInflbl, adtester::ADpb, adtester::ADrb, ADTesterCB(), AMS_AdvancedCB(), ApplyChCB(), b_c, b_label, b_sbar, cell_color, CENTER_ALIGN, CloseConfigCB(), ColObjCB(), ColorAssignCB(), ColPickBackForeGCB(), gui::ConfigPanel, CONFP_AMS(), CONFP_AMS_NOVA(), CONFP_AMS_Utility(), CONFP_Options(), CONFP_Param(), D_UndoCB(), DB_CellExposeCB(), DB_CellResizeCB(), DB_ChangeColorCellCB(), DB_SelOutModeCB(), DOASMODE, drawarea_bgc, DrawAreaExpFontCB(), e_fname, e_fsize, flag::exemode, F_PREF_ATT_COL, False, FIXED_SMALL, das::Flag, FontOBJSelCB(), frm3_dr1, configpanel::frm4_dr1, g_c, g_label, g_sbar, das::Gui, lbl, adtester::lblADch, adtester::lblADsetup, adtester::lblADvalue, LEFT_ALIGN, LoadFontCB(), LoadGeoDB(), LoadPaletteCB(), MAllocCell(), MAllocColor(), MCreateDrawArea(), MCreateLabel(), MCreateOptionEdit(), MCreatePButton(), MCreateRButton(), MCreateRowForm(), MCreateScrollBar(), MCreateShell(), MCreateTabbedRowForm(), MCreateTableForm(), MCreateTButton(), MDrawAreaSetExposeCallback(), MDrawAreaSetResizeCallback(), MEditDisableEditing(), MFormSetFocusHighlight(), MFormSetPrefAtt(), MGetDefaultBackgroundRGB(), MGetFirstFontFamily(), MGetNextFontFamily(), MLabelSetAlignment(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetCompositeHeight(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MObjectSetText(), MObjectSetTransparency(), MOptionEditGetList(), MPagedFormSetActivePage(), MPButtonSetCallback(), MRButtonActivate(), MRButtonSetCallback(), MScrollBarSetPosCallback(), MShellRealize(), MSListAddItem(), MSListSetSortCallback(), MTableFormSetColAlign(), MTableFormSetRowAlign(), MTButtonSetCallback(), stepm::NAMS, adtester::OutputMode, PFAMS, r_c, r_label, r_sbar, configpanel::RBColObj, RIGHT_ALIGN, SBT_HOR, SetBoldCB(), SetItalicCB(), configpanel::ShellConfig, das::StepM, TestFontCB(), TOP_ALIGN, True, UNDEF_ALIGN, UndoFCB(), WriteAMSCB(), WriteColorsCB(), WriteFontCB(), and WS_ETCHED_OUT.

Referenced by ConfigCB(), D_PButt_CB(), and DB_PasWd().

7018 {
7019 
7020 // MOBJECT _shell000;
7021  MOBJECT POCF; //Paged form for configuration panel
7022 // MOBJECT POPT; //Paged form for options
7023  MOBJECT rowform; // generic row form
7024 
7025  MOBJECT rowform1; // generic row form
7026 // MOBJECT PFAMS; // paged form for AMS
7027 // MOBJECT edit; // generic edit object
7028 // MOBJECT radiobutt[2]; // generic radio button
7029 
7030  MOBJECT RColButt;
7031  MOBJECT pb; // generic push button
7032 // MOBJECT rb; // generic radio button
7033  MOBJECT list;
7034  MOBJECT _tbutton000;
7035  MOBJECT _tbutton001;
7036  MOBJECT form2;
7037  MOBJECT label, lbl;
7038  MOBJECT tb; // generic table object
7039 // MOBJECT frm2_tb4;
7040  int r, g, b;
7041  int i;
7042  char buf[64];
7043 // double percentuale,speedhz;
7044  const char *fontfamily;
7045 
7046 // struct confp *pconfp;
7047 
7048  LoadGeoDB();
7049 
7050  MGetDefaultBackgroundRGB(&r, &g, &b);
7051  drawarea_bgc = MAllocColor(r, g, b);
7052 /********************************************************/
7053 /************* MAIN SHELL *************************/
7054 /********************************************************/
7055  DAS.Gui.ConfigPanel.ShellConfig = MCreateShell("DAS Config", 0);
7061 // MObjectSetCompositeWidth(DAS.Gui.ConfigPanel.ShellConfig, 670);
7062 // MObjectSetCompositeHeight(DAS.Gui.ConfigPanel.ShellConfig, 483);
7063 
7064 
7065 /********************************************************/
7066 /************* CONFIG PAGED FORM **********************/
7067 /********************************************************/
7069  MObjectSetForegroundRGB(POCF, 255, 255, 255);
7070  MObjectSetBackgroundRGB(POCF, 96, 132, 152);
7071  MObjectSetResize(POCF, True, True);
7073 // MObjectSetCompositeWidth(POCF, 457); //457
7074 
7075 /* Activation of POCF page 0 - Parameters*/
7076 /* 00000000000000000000000000000000000000000000000000000000 */
7077  MPagedFormSetActivePage(POCF, 0);
7078 
7079  // Creation page 0 - Parameters
7080  CONFP_Param(0, POCF);
7081 
7082 /* End Activation and creation of page 0 */
7083 /* 0000000000000000000000000000000000000000000000000000000 */
7084 
7085 /* Activation of POCF page 1 - Option */
7086 /* 11111111111111111111111111111111111111111111111111111111 */
7087 
7088 /* Start Creation of page 1 111111111111111111111*/
7089 /* 11111111111111111111111111111111111111111111111111111111111111111*/
7090  MPagedFormSetActivePage(POCF, 1);
7091 
7092  // Creation Page 1 - Options
7093  CONFP_Options(0, POCF);
7094 
7095 /* End Activation and creation of page 1 11111111111111111111*/
7096 /* 11111111111111111111111111111111111111111111111111111111111111*/
7097 
7098 /****************************************************************************/
7099 
7100 /* Start Activation and creation of page 2 - Colors 2222222222*/
7101 /* 22222222222222222222222222222222222222222222222222222222222222*/
7102 
7103  MPagedFormSetActivePage(POCF, 2);
7104 
7105  MObjectSetText(POCF, "Colors");
7106  rowform = MCreateRowForm(POCF);
7107  MObjectSetBackgroundRGB(rowform, 112, 128, 112);
7108  MObjectSetResize(rowform, False, False);
7109  MObjectSetCompositeWidth(rowform, 357);
7110  MObjectAlign(rowform, CENTER_ALIGN, TOP_ALIGN);
7111 
7112  lbl = MCreateLabel(rowform, "SELECT OBJECT", FIXED_SMALL);
7114  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7115  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
7116  MObjectSetTransparency(lbl, 0);
7117 
7118  tb = MCreateTableForm(rowform, 2);
7120  MObjectSetBackgroundRGB(tb, 112, 68, 72);
7121  MObjectSetResize(tb, True, False);
7122 
7123 
7124  DAS.Gui.ConfigPanel.RBColObj[0] = MCreateRButton(tb, "Unsel. Push Button", FIXED_SMALL);
7127 
7128  DAS.Gui.ConfigPanel.RBColObj[1] = MCreateRButton(tb, "Sel. Push Button", FIXED_SMALL);
7131 
7132  DAS.Gui.ConfigPanel.RBColObj[2] = MCreateRButton(tb, "Active Labels", FIXED_SMALL);
7135 
7136  DAS.Gui.ConfigPanel.RBColObj[3] = MCreateRButton(tb, "Passive LAbels", FIXED_SMALL);
7139 
7143 
7144  DAS.Gui.ConfigPanel.RBColObj[5] = MCreateRButton(tb, "Capital Labels", FIXED_SMALL);
7147 
7148  if (DAS.Flag.exemode == DOASMODE )
7149  {
7150  DAS.Gui.ConfigPanel.RBColObj[6] = MCreateRButton(tb, "Radio Button", FIXED_SMALL);
7153  }
7154 /*
7155 
7156  RColButt = MCreateRButton(tb, "UnSel. Comm.", FIXED_SMALL);
7157  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7158  MPButtonSetCallback(RColButt, ColorOBJSelCB, (void *) 0);
7159 
7160  RColButt = MCreateRButton(tb, "Sel. Comm.", FIXED_SMALL);
7161  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7162  MPButtonSetCallback(RColButt, ColorOBJSelCB, (void *) 1);
7163 
7164  RColButt = MCreateRButton(tb, "Active labels", FIXED_SMALL);
7165  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7166  MPButtonSetCallback(RColButt, ColorOBJSelCB, (void *) 2);
7167 
7168  RColButt = MCreateRButton(tb, "Passive labels", FIXED_SMALL);
7169  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7170  MPButtonSetCallback(RColButt, ColorOBJSelCB, (void *) 3);
7171 
7172  RColButt = MCreateRButton(tb, "Forms", FIXED_SMALL);
7173  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7174  MPButtonSetCallback(RColButt, ColorOBJSelCB, (void *) 4);
7175 
7176  RColButt = MCreateRButton(tb, "K_labelsUP", FIXED_SMALL);
7177  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7178  MPButtonSetCallback(RColButt, ColorOBJSelCB, (void *) 5);
7179 
7180 if (DAS.Flag.exemode == DOASMODE )
7181 {
7182 
7183  RColButt = MCreateRButton(tb, "Radio Buttons", FIXED_SMALL);
7184  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7185  MPButtonSetCallback(RColButt, ColorOBJSelCB, (void *) 6);
7186 }
7187 */
7188  tb = MCreateTableForm(rowform, 2);
7190  MObjectSetBackgroundRGB(tb, 160, 112, 112);
7191  MObjectSetResize(tb, True, False);
7192 
7193  RColButt = MCreateRButton(tb, "Background", FIXED_SMALL);
7194  MRButtonSetCallback(RColButt, (OBJ_VALUE_CB) ColPickBackForeGCB, (void *) 0);
7195  MObjectAlign(RColButt, CENTER_ALIGN, TOP_ALIGN);
7196  MRButtonActivate(RColButt);
7197  MObjectSetForegroundRGB(RColButt, 255, 255, 0);
7198 
7199  RColButt = MCreateRButton(tb, "Foreground", FIXED_SMALL);
7200  MRButtonSetCallback(RColButt, (OBJ_VALUE_CB) ColPickBackForeGCB, (void *) 1);
7201  MObjectAlign(RColButt, LEFT_ALIGN, TOP_ALIGN);
7202  MObjectSetForegroundRGB(RColButt, 255, 255, 0);
7203 
7204  rowform1 = MCreateRowForm(rowform);
7205  MObjectSetBackgroundRGB(rowform1 , 80, 56, 56);
7206  MObjectSetResize(rowform1 , True, True);
7207 
7208  lbl = MCreateLabel(rowform1 , "COLORS", FIXED_SMALL);
7209  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7210  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
7211  MObjectSetTransparency(lbl, 0);
7212 
7213  tb = MCreateTableForm(rowform1 , 1);
7214  MObjectSetBackgroundRGB(tb, 112, 68, 72);
7215  MObjectSetResize(tb, True, False);
7216 
7217 /******************************************/
7218 
7219  form2 = MCreateRowForm(tb);
7221  label = MCreateLabel(form2, "Red: ", FIXED_SMALL);
7222  MObjectSetForegroundRGB(label, 255, 0, 0);
7223  r_label = MCreateLabel(form2, "000", FIXED_SMALL);
7224  MObjectSetForegroundRGB(r_label, 255, 0, 0);
7225  MObjectSetResize(label, False, False);
7227  r_sbar = MCreateScrollBar(form2, SBT_HOR, (long) 32, (long) 255 + 32);
7229 
7230  form2 = MCreateRowForm(tb);
7232  label = MCreateLabel(form2, "Green: ", FIXED_SMALL);
7233  MObjectSetForegroundRGB(label, 0, 105, 0);
7234  g_label = MCreateLabel(form2, "000", FIXED_SMALL);
7235  MObjectSetForegroundRGB(g_label, 0, 105, 0);
7236  MObjectSetResize(label, False, False);
7238  g_sbar = MCreateScrollBar(form2, SBT_HOR, (long) 32, (long) 255 + 32);
7240 
7241  form2 = MCreateRowForm(tb);
7243  label = MCreateLabel(form2, "Blue: ", FIXED_SMALL);
7244  MObjectSetForegroundRGB(label, 0, 0, 255);
7245  b_label = MCreateLabel(form2, "000", FIXED_SMALL);
7246  MObjectSetForegroundRGB(b_label, 0, 0, 255);
7247  MObjectSetResize(label, False, False);
7249  b_sbar = MCreateScrollBar(form2, SBT_HOR, (long) 32, (long) 255 + 32);
7251 /************************************/
7252 
7253 
7254 
7255 
7256 
7257  frm3_dr1 = MCreateDrawArea(rowform, 347, 30);
7262  r_c = g_c = b_c = 0;
7263  cell_color = MAllocCell(0, 0, 0);
7264 
7265  rowform1 = MCreateRowForm(rowform);
7266  MObjectAlign(rowform1, CENTER_ALIGN, TOP_ALIGN);
7267  MObjectSetForegroundRGB(rowform1, 56, 84, 128);
7268  MObjectSetBackgroundRGB(rowform1, 112, 68, 72);
7269  MObjectSetResize(rowform1, False, False);
7270  MObjectSetCompositeWidth(rowform1, 347);
7271 
7272  lbl = MCreateLabel(rowform1, "COMMANDS", FIXED_SMALL);
7273  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7274  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
7275  MObjectSetTransparency(lbl, 0);
7276 
7277  pb = MCreatePButton(rowform1, "Load Palette", FIXED_SMALL);
7279  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7280 
7281 
7282  tb = MCreateTableForm(rowform1, 4);
7284  MObjectSetBackgroundRGB(tb, 112, 68, 72);
7285  MObjectSetResize(tb, True, False);
7286 
7287  pb = MCreatePButton(tb, "Preview", FIXED_SMALL);
7289  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7290 
7291  pb = MCreatePButton(tb, "Undo", FIXED_SMALL);
7292  MPButtonSetCallback(pb, D_UndoCB, 0L);
7293  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7294  MObjectSetCompositeWidth(pb, 84);
7295 
7296  pb = MCreatePButton(tb, "Store", FIXED_SMALL);
7297  MPButtonSetCallback(pb, WriteColorsCB, (void *) 0);
7298  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7299  MObjectSetCompositeWidth(pb, 84);
7300 
7301  pb = MCreatePButton(tb, "Close", FIXED_SMALL);
7303  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7304  MObjectSetCompositeWidth(pb, 84);
7305 
7306 /* End Activation and creation of page 2 Colors 22222222222222222222*/
7307 /* 22222222222222222222222222222222222222222222222222222222222222*/
7308 
7309  /*********************** FONTS ***********************/
7310  MPagedFormSetActivePage(POCF, 3);
7311 
7312  MObjectSetText(POCF, "Fonts");
7313  rowform = MCreateRowForm(POCF);
7314  MObjectSetBackgroundRGB(rowform, 112, 128, 112);
7315  MObjectSetResize(rowform, False, False);
7316  MObjectSetCompositeWidth(rowform, 357);
7317  MObjectAlign(rowform, CENTER_ALIGN, TOP_ALIGN);
7318 
7319  lbl = MCreateLabel(rowform, "SELECT OBJECT", FIXED_SMALL);
7321  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7322  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
7323  MObjectSetTransparency(lbl, 0);
7324  MObjectSetCompositeWidth(lbl, 347);
7325 
7326  tb = MCreateTableForm(rowform, 2);
7329  MObjectSetBackgroundRGB(tb, 56, 84, 128);
7331  MObjectSetCompositeWidth(tb, 347);
7332 
7333  RColButt = MCreateRButton(tb, "UnSel. Comm.", FIXED_SMALL);
7334  MPButtonSetCallback(RColButt, FontOBJSelCB, (void *) 0);
7335  MObjectAlign(RColButt, LEFT_ALIGN, TOP_ALIGN);
7336  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7337  MObjectSetTransparency(RColButt, 0);
7338  MRButtonActivate(RColButt);
7339 
7340  RColButt = MCreateRButton(tb, "Sel. Comm.", FIXED_SMALL);
7341  MPButtonSetCallback(RColButt, FontOBJSelCB, (void *) 1);
7342  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7343  MObjectSetTransparency(RColButt, 0);
7344 
7345  RColButt = MCreateRButton(tb, "Active labels", FIXED_SMALL);
7346  MPButtonSetCallback(RColButt, FontOBJSelCB, (void *) 2);
7347  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7348  MObjectSetTransparency(RColButt, 0);
7349 
7350  RColButt = MCreateRButton(tb, "Passive labels", FIXED_SMALL);
7351  MPButtonSetCallback(RColButt, FontOBJSelCB, (void *) 3);
7352  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7353  MObjectSetTransparency(RColButt, 0);
7354 
7355  RColButt = MCreateRButton(tb, "K_labelsUP", FIXED_SMALL);
7356  MPButtonSetCallback(RColButt, FontOBJSelCB, (void *) 4);
7357  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7358  MObjectSetTransparency(RColButt, 0);
7359 
7360  RColButt = MCreateRButton(tb, "K_labelsDW", FIXED_SMALL);
7361  MPButtonSetCallback(RColButt, FontOBJSelCB, (void *) 5);
7362  MObjectSetForegroundRGB(RColButt, 255, 255, 255);
7363  MObjectSetTransparency(RColButt, 0);
7364 
7365  DAS.Gui.ConfigPanel.frm4_dr1 = MCreateDrawArea(rowform, 347, 62);
7370 
7371 
7372  rowform1 = MCreateRowForm(rowform);
7373  MObjectSetBackgroundRGB(rowform1, 56, 84, 128);
7374  MObjectSetResize(rowform1, False, False);
7375  MObjectSetCompositeWidth(rowform1, 347);
7376 
7377  lbl = MCreateLabel(rowform1, "FONTS", FIXED_SMALL);
7378  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7379  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
7380  MObjectSetTransparency(lbl, 0);
7381 
7382  tb = MCreateTableForm(rowform1, 2);
7384  MObjectSetBackgroundRGB(tb, 56, 84, 128);
7385  MObjectSetResize(tb, True, False);
7386 
7387  lbl = MCreateLabel(tb, "Type:", FIXED_SMALL);
7390  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7391  MObjectSetTransparency(lbl, 0);
7392 
7393  fontfamily = MGetFirstFontFamily ();
7394  e_fname = MCreateOptionEdit (tb, fontfamily, 22, 10, 6, FIXED_SMALL);
7395  MObjectSetForegroundRGB(e_fname, 255, 255, 255);
7396  MObjectSetBackgroundRGB(e_fname, 0, 24, 96);
7398  list = MOptionEditGetList (e_fname);
7399  MSListSetSortCallback (list, stricmp);
7400 
7401  while (fontfamily)
7402  {
7403  MSListAddItem (list, fontfamily, 0L);
7404  fontfamily = MGetNextFontFamily ();
7405  }
7406 
7407  lbl = MCreateLabel(tb, "Dim.:", FIXED_SMALL);
7409  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7410  MObjectSetTransparency(lbl, 0);
7411 
7412 
7413  e_fsize = MCreateOptionEdit(tb, "22", 22, 10, 6, FIXED_SMALL);
7414  MObjectSetForegroundRGB(e_fsize, 255, 255, 255);
7415  MObjectSetBackgroundRGB(e_fsize, 0, 24, 96);
7416  list = MOptionEditGetList(e_fsize);
7417  MSListAddItem(list, "12", 0L);
7418  MSListAddItem(list, "14", 0L);
7419  MSListAddItem(list, "16", 0L);
7420  MSListAddItem(list, "18", 0L);
7421  MSListAddItem(list, "20", 0L);
7422  MSListAddItem(list, "22", 0L);
7423  MSListAddItem(list, "24", 0L);
7424  MSListAddItem(list, "26", 0L);
7425  MSListAddItem(list, "28", 0L);
7426  MSListAddItem(list, "30", 0L);
7427  MSListAddItem(list, "32", 0L);
7428  MSListAddItem(list, "34", 0L);
7429  MSListAddItem(list, "36", 0L);
7430  MSListAddItem(list, "38", 0L);
7431  MSListAddItem(list, "40", 0L);
7432  MSListAddItem(list, "42", 0L);
7433 
7434 
7435  _tbutton000 = MCreateTButton(tb, "Bold", FIXED_SMALL);
7436  MTButtonSetCallback(_tbutton000, SetBoldCB, 0L);
7437  MObjectSetForegroundRGB(_tbutton000, 255, 255, 0);
7438 
7439  _tbutton001 = MCreateTButton(tb, "Italic", FIXED_SMALL);
7440  MTButtonSetCallback(_tbutton001, SetItalicCB, 0L);
7441  MObjectSetForegroundRGB(_tbutton001, 255, 255, 0);
7442 /*******************/
7443  rowform1 = MCreateRowForm(rowform);
7444  MObjectSetForegroundRGB(rowform1, 56, 84, 128);
7445  MObjectSetBackgroundRGB(rowform1, 56, 84, 128);
7446  MObjectSetResize(rowform1, False, False);
7447  MObjectSetCompositeWidth(rowform1, 347);
7448 
7449  lbl = MCreateLabel(rowform1, "COMMANDS", FIXED_SMALL);
7450  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7451  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
7452  MObjectSetTransparency(lbl, 0);
7453 
7454  tb = MCreateTableForm(rowform1, 5);
7455  MObjectSetBackgroundRGB(tb, 56, 84, 128);
7456  MObjectSetResize(tb, True, False);
7457 
7458 
7459 
7460  pb = MCreatePButton(tb, "Test", FIXED_SMALL);
7462  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7463 // MObjectSetCompositeWidth(pb, 84);
7464 
7465  pb = MCreatePButton(tb, "Preview", FIXED_SMALL);
7467  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7468 // MObjectSetCompositeWidth(pb, 84);
7469 
7470  pb = MCreatePButton(tb, "Undo", FIXED_SMALL);
7471  MPButtonSetCallback(pb, UndoFCB, 0L);
7472  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7473 // MObjectSetCompositeWidth(pb, 84);
7474 
7475  pb = MCreatePButton(tb, "Store", FIXED_SMALL);
7477  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7478 // MObjectSetCompositeWidth(pb, 84);
7479 
7480  pb = MCreatePButton(tb, "Close", FIXED_SMALL);
7482  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7483 // MObjectSetCompositeWidth(pb, 84);
7484 
7485 
7486 /******************* STEPPER MOTORS ***************************/
7487  MPagedFormSetActivePage(POCF, 4);
7488 
7489  MObjectSetText(POCF, "Motors");
7490  rowform = MCreateRowForm(POCF);
7491  MObjectSetBackgroundRGB(rowform, 112, 128, 112);
7492  MObjectSetResize(rowform, False, False);
7493  MObjectSetCompositeWidth(rowform, 457);
7494  MObjectAlign(rowform, CENTER_ALIGN, TOP_ALIGN);
7495 
7496 
7497 /***************************************************************************/
7498 /**************** STEPPER MOTORS SECTION ***********************************/
7499 
7500  lbl = MCreateLabel(rowform, "STEPPER MOTORS", FIXED_SMALL);
7501  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7502  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
7503  MObjectSetTransparency(lbl, 0);
7504 // MObjectSetCompositeWidth(lbl, 447);
7505 
7506  PFAMS = MCreateTabbedRowForm(rowform, (DAS.StepM.NAMS + 2), FIXED_SMALL);
7507  MObjectSetForegroundRGB(PFAMS, 255, 255, 255);
7508  MObjectSetBackgroundRGB(PFAMS, 80, 60, 0);
7511 
7512 // MObjectSetResize(PFAMS, True, True);
7513 
7514  for (i=0;i<DAS.StepM.NAMS; i++)
7515  {
7517  CONFP_AMS(PFAMS, i);
7518  //FrmStepperConfP(PFAMS, i);
7519  }
7520 
7523 
7526 
7528 
7529 /*
7530  if (DAS.Paramini.EqType == TROPOGAS)
7531  {
7532  PFAMS = MCreateTabbedRowForm(rowform, 4, FIXED_SMALL);
7533  MObjectSetForegroundRGB(PFAMS, 255, 255, 255);
7534  MObjectSetBackgroundRGB(PFAMS, 80, 60, 0);
7535  MObjectSetShadow(PFAMS, WS_ETCHED_OUT, 2, 2);
7536  }
7537  else
7538  {
7539  PFAMS = MCreateTabbedRowForm(rowform, 3, FIXED_SMALL);
7540  MObjectSetForegroundRGB(PFAMS, 255, 255, 255);
7541  MObjectSetBackgroundRGB(PFAMS, 80, 60, 0);
7542  MObjectSetShadow(PFAMS, WS_ETCHED_OUT, 2, 2);
7543  }
7544  MPagedFormSetActivePage(PFAMS, 0);
7545 
7546  FrmStepperConfP(PFAMS, AMS1, &STEPM, &CONFP, &CPL);
7547 
7548  MPagedFormSetActivePage(PFAMS, 1);
7549 
7550  FrmStepperConfP(PFAMS, AMS2, &STEPM, &CONFP, &CPL);
7551 
7552  if (DAS.Paramini.EqType == TROPOGAS)
7553  {
7554  MPagedFormSetActivePage(PFAMS, 2);
7555 
7556  FrmStepperConfP(PFAMS, AMS3, &STEPM, &CONFP, &CPL);
7557 
7558  MPagedFormSetActivePage(PFAMS, 3);
7559 
7560  FrmAMS_Utility(PFAMS, &STEPM, &CONFP, &CPL);
7561  }
7562  else
7563  {
7564  MPagedFormSetActivePage(PFAMS, 2);
7565 
7566  FrmAMS_Utility(PFAMS, &STEPM, &CONFP, &CPL);
7567  }
7568 */
7570 
7571  /*++++++++++++++++++++++++++++++++++++++++++++++++++++*/
7572 
7573  tb = MCreateTableForm(rowform, 4);
7574  MObjectSetBackgroundRGB(tb, 56, 112, 112);
7576  MObjectSetCompositeWidth(tb, 347);
7577 
7578 
7579  pb = MCreatePButton(tb, "Apply", FIXED_SMALL);
7580  MPButtonSetCallback(pb, ApplyChCB, (void *) 1);
7581  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7582  MObjectSetCompositeWidth(pb, 74);
7583 
7584  pb = MCreatePButton(tb, "Store", FIXED_SMALL);
7585  MPButtonSetCallback(pb, WriteAMSCB, (void *) 1);
7586  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7587  MObjectSetCompositeWidth(pb, 84);
7588 
7589  pb = MCreatePButton(tb, "Close", FIXED_SMALL);
7591  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7592  MObjectSetCompositeWidth(pb, 74);
7593 
7594  pb = MCreatePButton(tb, "ADVANCED", FIXED_SMALL);
7595  MPButtonSetCallback(pb, AMS_AdvancedCB, (void *) 0);
7596  MObjectSetBackgroundRGB(pb, 24, 24, 255);
7597  MObjectSetForegroundRGB(pb, 255, 245, 255);
7598  MObjectSetCompositeWidth(pb, 74);
7599 
7600 /*********************************************************/
7601 
7602 /*********************************************************/
7603 /*************** TEST AD Converter **************/
7604 /*********************************************************/
7605 
7606  MPagedFormSetActivePage(POCF, 5);
7607 
7608  MObjectSetText(POCF, "TEST AD Converter");
7609 
7610  rowform = MCreateRowForm(POCF);
7611  MObjectSetBackgroundRGB(rowform, 112, 128, 112);
7612  MObjectSetResize(rowform, False, False);
7613  MObjectSetCompositeWidth(rowform, 357);
7614  MObjectAlign(rowform, CENTER_ALIGN, TOP_ALIGN);
7615 
7616  /*+++++++++++++++++ START CURRENT SETUP ++++++++++*/
7617 
7618  lbl = MCreateLabel(rowform , "AD Converter Current Setup", FIXED_SMALL);
7619  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7620  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
7622  MObjectSetTransparency(lbl, 0);
7623 
7624  tb = MCreateTableForm(rowform, 4);
7627  MObjectSetBackgroundRGB(tb, 56, 112, 112);
7629  MObjectSetCompositeWidth(tb, 347);
7630 
7631  lbl = MCreateLabel(tb , "Board Type:", FIXED_SMALL);
7632  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7634 
7635 // sprintf(buf, "%s", DSCCB2STR());
7636  ADTESTER.lblADsetup[0] = MCreateLabel(tb , "DMM", FIXED_SMALL);
7637  MObjectSetForegroundRGB(ADTESTER.lblADsetup[0], 255, 255, 255);
7641 
7642  lbl = MCreateLabel(tb , "Base Addr:", FIXED_SMALL);
7643  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7645 
7646  ADTESTER.lblADsetup[1] = MCreateLabel(tb , "0x300", FIXED_SMALL);
7647  MObjectSetForegroundRGB(ADTESTER.lblADsetup[1], 255, 255, 255);
7651 
7652  lbl = MCreateLabel(tb , "Int.Lvl:", FIXED_SMALL);
7653  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7655 
7656  ADTESTER.lblADsetup[2] = MCreateLabel(tb , "3", FIXED_SMALL);
7657  MObjectSetForegroundRGB(ADTESTER.lblADsetup[2], 255, 255, 255);
7661 
7662  lbl = MCreateLabel(tb , "DMA Lvl:", FIXED_SMALL);
7663  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7665 
7666  ADTESTER.lblADsetup[3] = MCreateLabel(tb , "3", FIXED_SMALL);
7667  MObjectSetForegroundRGB(ADTESTER.lblADsetup[3], 255, 255, 255);
7671 
7672  lbl = MCreateLabel(tb , "ClockFreq:", FIXED_SMALL);
7673  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7675 
7676  ADTESTER.lblADsetup[4] = MCreateLabel(tb , "10MHz", FIXED_SMALL);
7677  MObjectSetForegroundRGB(ADTESTER.lblADsetup[4], 255, 255, 255);
7681 
7682  lbl = MCreateLabel(tb , "Range:", FIXED_SMALL);
7683  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7685 
7686  ADTESTER.lblADsetup[5] = MCreateLabel(tb , "5V", FIXED_SMALL);
7687  MObjectSetForegroundRGB(ADTESTER.lblADsetup[5], 255, 255, 255);
7691 
7692  lbl = MCreateLabel(tb , "Pol.:", FIXED_SMALL);
7693  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7695 
7696  ADTESTER.lblADsetup[6] = MCreateLabel(tb , "UNIPOL", FIXED_SMALL);
7697  MObjectSetForegroundRGB(ADTESTER.lblADsetup[6], 255, 255, 255);
7701 
7702  lbl = MCreateLabel(tb , "Gain:", FIXED_SMALL);
7703  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7705 
7706  ADTESTER.lblADsetup[7] = MCreateLabel(tb , "2", FIXED_SMALL);
7707  MObjectSetForegroundRGB(ADTESTER.lblADsetup[7], 255, 255, 255);
7711 
7712  lbl = MCreateLabel(tb , "LowCh:", FIXED_SMALL);
7713  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7715 
7716  ADTESTER.lblADsetup[8] = MCreateLabel(tb , "0", FIXED_SMALL);
7717  MObjectSetForegroundRGB(ADTESTER.lblADsetup[8], 255, 255, 255);
7721 
7722  lbl = MCreateLabel(tb , "HighCh:", FIXED_SMALL);
7723  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7725 
7726  ADTESTER.lblADsetup[9] = MCreateLabel(tb , "15", FIXED_SMALL);
7727  MObjectSetForegroundRGB(ADTESTER.lblADsetup[9], 255, 255, 255);
7731 
7732 
7733 // LoadDMMSetup();
7734 /*+++++++++++++++++ END CURRENT SETUP ++++++++++*/
7735 
7736  tb = MCreateTableForm(rowform, 2);
7739  MObjectSetBackgroundRGB(tb, 56, 112, 112);
7741  MObjectSetCompositeWidth(tb, 347);
7742 
7743 
7744  ADTESTER.ADrb[0]= MCreateRButton(tb, "Volts", FIXED_SMALL);
7747  MObjectSetForegroundRGB(ADTESTER.ADrb[0], 255, 255, 255);
7749 
7750  ADTESTER.ADrb[1] = MCreateRButton(tb, "Celsius", FIXED_SMALL);
7753  MObjectSetForegroundRGB(ADTESTER.ADrb[1], 255, 255, 255);
7755 
7756 
7757  if(ADTESTER.OutputMode == 0)
7759  else
7761 
7762 
7763 
7764  lbl = MCreateLabel(rowform , "Output", FIXED_SMALL);
7765  MObjectSetForegroundRGB(lbl, 255, 255, 255);
7767 
7768  tb = MCreateTableForm(rowform, 4);
7771  MObjectSetBackgroundRGB(tb, 56, 112, 112);
7773  MObjectSetCompositeWidth(tb, 347);
7774 
7775 
7776 
7777  for(i=0;i<16;i++)
7778  {
7779 
7780  sprintf(buf, "Ch.%d:", i);
7781  ADTESTER.lblADch[i] = MCreateLabel(tb, buf, FIXED_SMALL);
7783  MObjectSetForegroundRGB(ADTESTER.lblADch[i], 255, 255, 255);
7787 
7788 // MObjectSetBackgroundRGB(DAS.Gui.ConfigPanel.lblADch[i], 40, 96, 72);
7789 
7790  ADTESTER.lblADvalue[i] = MCreateLabel(tb, " 0.0", FIXED_SMALL);
7792  MObjectSetForegroundRGB(ADTESTER.lblADvalue[i], 255, 255, 255);
7797 
7798  }
7799 
7800 
7801  tb = MCreateTableForm(rowform, 3);
7804  MObjectSetBackgroundRGB(tb, 56, 112, 112);
7806  MObjectSetCompositeWidth(tb, 347);
7807 
7808 
7809  ADTESTER.ADpb = MCreatePButton(tb, "Start", FIXED_SMALL);
7811  MObjectSetBackgroundRGB(ADTESTER.ADpb, 224, 224, 176);
7812 // MObjectSetBackgroundRGB(ADTESTER.ADpb, 192, 192, 192);
7814 
7815  ADTESTER.ADInflbl = MCreateLabel(tb, "Click Start to test ", FIXED_SMALL);
7816 // MPButtonSetCallback(ADTESTER.ADpb, ADTesterCB, (void *) 0);
7817  MObjectSetForegroundRGB(ADTESTER.ADInflbl, 255, 255, 255);
7819 
7820 
7821  pb = MCreatePButton(tb, "Close", FIXED_SMALL);
7823  MObjectSetBackgroundRGB(pb, 224, 224, 176);
7824  MObjectSetCompositeWidth(pb, 84);
7825 
7826 
7827 /*********************************************************/
7828  MPagedFormSetActivePage(POCF, 0);
7830 // MShellRealizeXYWH(DAS.Gui.ConfigPanel.ShellConfig, 0,0,600,800);
7831 
7832  return 0;
7833 }
void MEditDisableEditing(MOBJECT edit)
stepm StepM
Stepper motors parameters structure.
#define RIGHT_ALIGN
Definition: Mguidefs.h:916
void ADTesterCB(MOBJECT shell, void *od, void *ad)
Test Temperature AD Converter callback.
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
void ColPickBackForeGCB(MOBJECT o, void *a, void *v)
select if the foreground or background color of the selected object will be picked ...
MOBJECT MCreateTButton(MOBJECT parent, const char *text, MTFont font)
void CONFP_Options(int mod, MOBJECT mo)
MOBJECT lbl
Definition: DFileMan.c:42
MTColor MAllocCell(int r, int g, int b)
int LoadPaletteCB(MOBJECT o, void *o_data, void *a_data)
Callback for LoadTestPalette.
MOBJECT r_label
Definition: DAS_Spatram.h:3058
void ColorAssignCB(MOBJECT o, void *o_data, void *a_data)
void DB_CellExposeCB(MOBJECT obj, MEvent *pexp, void *a_data)
display selected Color
MOBJECT MOptionEditGetList(MOBJECT ce)
void DB_ChangeColorCellCB(MOBJECT o, MVALUE o_data, void *a_data)
draw the object &#39;o&#39; with the selected color
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
MOBJECT b_sbar
Definition: DAS_Spatram.h:3057
void MShellRealize(MOBJECT obj)
void LoadFontCB(MOBJECT obj, void *a, void *data)
This callback tries to load the specified font.
int NAMS
Number of AMSs Devices.
void WriteFontCB(MOBJECT obj, void *a, void *v)
This callback write on file the selected font (Not implemented yet)
MOBJECT r_sbar
Definition: DAS_Spatram.h:3057
#define WS_ETCHED_OUT
Definition: Mguidefs.h:960
void MFormSetFocusHighlight(MOBJECT f, int true_false)
void D_UndoCB(MOBJECT o, void *a, void *v)
Undo the previous color setting operation.
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
void MTableFormSetColAlign(MOBJECT form, int col, int al)
MOBJECT frm4_dr1
adtester ADTESTER
Definition: DAS_Spat_Conf.c:48
int LoadGeoDB(void)
Definition: Load.c:1432
void SetItalicCB(MOBJECT obj, MVALUE a, void *data)
This callback toggles the Italic attribute.
void MDrawAreaSetResizeCallback(MOBJECT obj, DRAWAREA_PREF_CB cb, void *ad)
MOBJECT MCreateOptionEdit(MOBJECT parent, const char *text, int len, int clip_len, int nrow, MTFont font)
#define UNDEF_ALIGN
Definition: Mguidefs.h:920
void ApplyChCB(MOBJECT shell, void *od, void *ad)
Apply changes in DAS Config callback.
void MObjectSetText(MOBJECT obj, const char *text)
MOBJECT e_fsize
Definition: DAS_Spatram.h:3064
void DB_CellResizeCB(MOBJECT obj, DRAWAREA_PREF *pref, void *a_data)
display selected Color
MOBJECT g_label
Definition: DAS_Spatram.h:3058
MOBJECT lblADsetup[10]
void CONFP_Param(int mod, MOBJECT mo)
void UndoFCB(MOBJECT obj, void *a, void *v)
This callback UnDo the font choice (Not implemented yet)
MOBJECT RBColObj[7]
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
void DB_SelOutModeCB(MOBJECT o, void *id, void *a_data)
Select the Output for the Temperature AD Converter .
int WriteColorsCB(MOBJECT o, void *a, void *v)
Write selected color in DASSysColor.INI.
MOBJECT lblADvalue[16]
void MTButtonSetCallback(MOBJECT button, OBJ_VALUE_CB cb, void *data)
void MRButtonSetCallback(MOBJECT button, OBJ_VALUE_CB cb, void *data)
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
void FontOBJSelCB(MOBJECT obj, void *a, void *v)
This callback select the object for applying font.
#define CENTER_ALIGN
Definition: Mguidefs.h:917
const char * MGetNextFontFamily(void)
MOBJECT ADrb[3]
void MObjectSetCompositeHeight(MOBJECT obj, int h)
MOBJECT MCreateScrollBar(MOBJECT parent, int type, long n, long max)
void CONFP_AMS_NOVA(MOBJECT pf)
#define FIXED_SMALL
Definition: Mguidefs.h:878
MOBJECT ADInflbl
#define SBT_HOR
Definition: Mguidefs.h:1139
void SetBoldCB(MOBJECT obj, MVALUE a, void *data)
This callback toggles the Bold attribute.
void DrawAreaExpFontCB(MOBJECT obj, MEvent *pe, void *data)
This callback draws strings using the selected font.
int b_c
Definition: DAS_Spatram.h:3060
MTColor MAllocColor(int r, int g, int b)
void MRButtonActivate(MOBJECT o)
MOBJECT MCreateDrawArea(MOBJECT parent, int width, int height)
das DAS
Definition: DAS_Spat_Conf.c:56
int r_c
Definition: DAS_Spatram.h:3060
void MDrawAreaSetExposeCallback(MOBJECT obj, OBJ_EVENT_CB cb, void *ad)
MOBJECT g_sbar
Definition: DAS_Spatram.h:3057
MOBJECT MCreateShell(const char *title, int flags)
MTColor cell_color
Definition: DAS_Spatram.h:3059
MOBJECT frm3_dr1
Definition: DAS_Spatram.h:3058
MOBJECT MCreateRButton(MOBJECT parent, const char *text, MTFont font)
configpanel ConfigPanel
Configuration panel structure.
void AMS_AdvancedCB(MOBJECT o, void *od, void *ad)
void MSListSetSortCallback(MOBJECT obj, STRCMP_CB cb)
void ColObjCB(MOBJECT o, void *a, void *v)
select the object to consider for color picking
void MTableFormSetRowAlign(MOBJECT form, int row, int al)
void(* OBJ_VALUE_CB)(MOBJECT obj, MVALUE value, void *ad)
Definition: Mguidefs.h:1458
void CONFP_AMS(MOBJECT pf, int amsn)
void MGetDefaultBackgroundRGB(int *pr, int *pg, int *pb)
void MLabelSetAlignment(MOBJECT p, int align)
MOBJECT ShellConfig
Shell configuration panel.
void MPagedFormSetActivePage(MOBJECT form, int page)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
MOBJECT PFAMS
Definition: DAS_Spat_Conf.c:96
void TestFontCB(MOBJECT obj, void *a, void *data)
This callback tries to load the specified font.
void MObjectSetCompositeWidth(MOBJECT obj, int w)
int g_c
Definition: DAS_Spatram.h:3060
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
MOBJECT e_fname
Definition: DAS_Spatram.h:3064
#define LEFT_ALIGN
Definition: Mguidefs.h:915
MOBJECT b_label
Definition: DAS_Spatram.h:3058
MOBJECT ADpb
MOBJECT lblADch[16]
int MSListAddItem(MOBJECT p, const char *item, void *data)
#define F_PREF_ATT_COL
Definition: Mguidefs.h:1098
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT MCreateRowForm(MOBJECT parent)
#define TOP_ALIGN
Definition: Mguidefs.h:918
MOBJECT MCreateTabbedRowForm(MOBJECT parent, int npage, MTFont f)
void MScrollBarSetPosCallback(MOBJECT p, OBJ_VALUE_CB cb, void *data)
int exemode
Set the Execution MODE (Execution modes)
const char * MGetFirstFontFamily(void)
void CloseConfigCB(MOBJECT shell, void *od, void *ad)
Close DAS-Config callback close the DAS_Config window. If the testing of the ADConverter is running i...
MTColor drawarea_bgc
Definition: DAS_Spatram.h:3062
int WriteAMSCB(MOBJECT shell, void *od, void *ad)
Write AMS.ini file .
void CONFP_AMS_Utility(MOBJECT pf)
void MFormSetPrefAtt(MOBJECT p, int pref_att)
+ Here is the caller graph for this function:

§ MDCreateDOAS_MainSh()

MOBJECT MDCreateDOAS_MainSh ( struct doas pdoas)

DOAS shell. Procedure that build the shell for the DOAS main panels.

Returns
void

Definition at line 1859 of file DOAS_FullProj.c.

References BrowseCB(), BuildListCB(), C_A, C_B, C_C, C_D, C_E, C_H, C_L, C_P, C_R, C_S, C_T, C_U, C_W, C_X, ChooseFormatCB(), ColumnFCB(), palette::DB_BG, palette::DB_BG_Albl, palette::DB_BG_Plbl, palette::DB_FG_Albl, palette::DB_FG_Plbl, DiffCB(), DOAS_LoadConfig(), DOAS_MainSh, DOASConfigCB(), DOASProcCB(), DOASSetupCB(), EditorCB(), ExitCB(), F10, doas::family, doas::fbold, FilterCB(), doas::fitalic, FixStepCB(), FluxIndexCB(), doas::font, doas::fsize, HELV_SMALL, HlpTopCB(), id_item, id_menu, IoCreateCB(), IoSetupCB(), lblris, lblsys, LEFT_ALIGN, LinkSpectraCB(), LoadDB_DispCoeff(), LoadParam(), MCreateImagePButton(), MCreateLabel(), MCreateMenu(), MCreateMenuBar(), MCreateRowForm(), MCreateShell(), MCreateSubMenu(), MCreateTableForm(), menu, menubar, MGUIQuitCB(), MLabelSetAlignment(), MLoadFont(), MMainLoop(), MMenuAddItem(), MMenuAddSeparator(), MMenuBarSetAcc(), MMenuItemSetAccel(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MObjectSetPopupHelp(), MObjectSetShadow(), MObjectSetTransparency(), MPButtonSetAlignment(), MPButtonSetCallback(), MShellRealizeXY(), MShellSetWMCloseCallback(), PBTempHistoCB(), ResumeCB(), RIGHT_ALIGN, doas::RISDIR, ShStCB(), submenu, SunCalcCB(), doas::SYSDIR, TIMES_SMALL, ViewCB(), VitesaCB(), and WS_SHADOW_IN.

Referenced by BuildShell().

1860 {
1861  MOBJECT _rowform001;
1862  MOBJECT _tablefrm003;
1863  MOBJECT _label004;
1864  MOBJECT _label006;
1865  MOBJECT pb;
1866 
1867  MOBJECT menu;
1868 
1869  DOAS_LoadConfig(pdoas);
1870 
1871  // Load the dispersion coefficient for DOAS Use
1872  LoadDB_DispCoeff();
1873 
1874  LoadParam();
1875 
1876  sprintf(pdoas->family, "Arial");
1877  pdoas->fsize = 32;
1878  pdoas->fbold = 0;
1879  pdoas->fitalic = 0;
1880 
1881 
1882  pdoas->font = MLoadFont(pdoas->family, pdoas->fsize, pdoas->fbold, pdoas->fitalic);
1883 
1884 
1885  DOAS_MainSh = MCreateShell("DOAS Main Panel", 0);
1886 
1887  {
1888 /*
1889 
1890  */
1891 
1893 
1895 
1896 // menubar = MCreateMenuBar(DOAS_MainSh, pdoas->font);
1897 
1899 
1900  menu = MCreateMenu(menubar, "File");
1901  id_menu = MMenuAddItem(menu, "Load Img", (MENU_ITEM_CB) ExitCB, NULL);
1902  id_menu = MMenuAddItem(menu, "Load Ris", (MENU_ITEM_CB) ExitCB, NULL);
1903  id_menu = MMenuAddItem(menu, "Close", (MENU_ITEM_CB) ExitCB, NULL);
1904 
1905  MMenuAddSeparator(menu);
1906 
1907  id_menu = MMenuAddItem(menu, "Exit", (MENU_ITEM_CB) MGUIQuitCB, NULL);
1908  MMenuItemSetAccel(id_menu, C_X, "Ctrl+X");
1909 
1910  menu = MCreateMenu(menubar, "Analisys");
1911 
1912  id_menu = MMenuAddItem(menu, "Io", NULL, NULL);
1913  submenu = MCreateSubMenu(id_menu);
1914  id_menu = MMenuAddItem(submenu, "Setup", (MENU_ITEM_CB)IoSetupCB, 0);
1915  MMenuItemSetAccel(id_menu, C_S, "Ctrl+S");
1916  id_menu = MMenuAddItem(submenu, "Create", (MENU_ITEM_CB)IoCreateCB, 0);
1917  MMenuItemSetAccel(id_menu, C_C, "Ctrl+C");
1918 
1919  MMenuAddSeparator(menu);
1920 
1921  id_menu = MMenuAddItem(menu, "DOAS", NULL, NULL);
1922  submenu = MCreateSubMenu(id_menu);
1923  id_menu = MMenuAddItem(submenu, "Setup", (MENU_ITEM_CB)DOASSetupCB, 0);
1924  MMenuItemSetAccel(id_menu, C_S, "Ctrl+S");
1925  id_menu = MMenuAddItem(submenu, "Processing", (MENU_ITEM_CB)DOASProcCB, 0);
1926  MMenuItemSetAccel(id_menu, C_P, "Ctrl+P");
1927 
1928  menu = MCreateMenu(menubar, "Utility");
1929  id_item = MMenuAddItem(menu, "Differential", (MENU_ITEM_CB)DiffCB, 0);
1930  MMenuItemSetAccel(id_item, C_E, "Ctrl+E");
1931  id_item = MMenuAddItem(menu, "Fixed Step", (MENU_ITEM_CB)FixStepCB, 0);
1932  MMenuItemSetAccel(id_item, C_T, "Ctrl+T");
1933  id_item = MMenuAddItem(menu, "View Spectra", (MENU_ITEM_CB)ViewCB, 0);
1934  MMenuItemSetAccel(id_item, C_W, "Ctrl+W");
1935  id_item = MMenuAddItem(menu, "Sun Calculator", (MENU_ITEM_CB)SunCalcCB, 0);
1936  MMenuItemSetAccel(id_item, C_S, "Ctrl+S");
1937  id_item = MMenuAddItem(menu, "ShiftStretch", (MENU_ITEM_CB)ShStCB, 0);
1938  MMenuItemSetAccel(id_item, C_H, "Ctrl+H");
1939  id_item = MMenuAddItem(menu, "Filter Data", (MENU_ITEM_CB)FilterCB, 0);
1940  MMenuItemSetAccel(id_item, C_T, "Ctrl+T");
1941  id_item = MMenuAddItem(menu, "Column Format", (MENU_ITEM_CB)ColumnFCB, 0);
1942  MMenuItemSetAccel(id_item, C_C, "Ctrl+C");
1943  id_item = MMenuAddItem(menu, "Resume", (MENU_ITEM_CB)ResumeCB, 0);
1944  MMenuItemSetAccel(id_item, C_R, "Ctrl+R");
1945  id_item = MMenuAddItem(menu, "Link Spectra", (MENU_ITEM_CB)LinkSpectraCB, 0);
1946  MMenuItemSetAccel(id_item, C_L, "Ctrl+L");
1947 
1948  id_item = MMenuAddItem(menu, "Editor", (MENU_ITEM_CB)EditorCB, (void *) 0);
1949  MMenuItemSetAccel(id_item, C_D, "Ctrl+D");
1950 
1951  id_item = MMenuAddItem(menu, "Create List", (MENU_ITEM_CB)BuildListCB, (void *) 0);
1952  MMenuItemSetAccel(id_item, C_C, "Ctrl+C");
1953 
1954  id_item = MMenuAddItem(menu, "ASCII to Binary", (MENU_ITEM_CB)ChooseFormatCB, (void *) 1);
1955  MMenuItemSetAccel(id_item, C_A, "Ctrl+A");
1956 
1957  id_item = MMenuAddItem(menu, "Binary to ASCII ", (MENU_ITEM_CB)ChooseFormatCB, 0);
1958  MMenuItemSetAccel(id_item, C_B, "Ctrl+B");
1959 
1960  id_item = MMenuAddItem(menu, "Flux Index ", (MENU_ITEM_CB)FluxIndexCB, 0);
1961  MMenuItemSetAccel(id_item, C_U, "Ctrl+U");
1962 
1963  id_item = MMenuAddItem(menu, "Temp History ", (MENU_ITEM_CB)PBTempHistoCB, 0);
1964  MMenuItemSetAccel(id_item, C_H, "Ctrl+H");
1965 
1966  menu = MCreateMenu(menubar, "Tools");
1967  id_item = MMenuAddItem(menu, "Config", (MENU_ITEM_CB) DOASConfigCB, 0);
1968 
1969  id_item = MMenuAddItem(menu, "ViTESA", (MENU_ITEM_CB) VitesaCB, 0);
1970 
1971 
1972  menu = MCreateMenu(menubar, "Help");
1973  id_item = MMenuAddItem(menu, "Topics", (MENU_ITEM_CB) HlpTopCB, 0);
1974 
1975  id_item = MMenuAddItem(menu, "About", (MENU_ITEM_CB) HlpTopCB, (void *)1);
1976 
1977  }
1980 
1981  _rowform001 = MCreateRowForm(DOAS_MainSh);
1982  MObjectSetBackgroundRGB(_rowform001, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1983 
1984  _tablefrm003 = MCreateTableForm(_rowform001, 3);
1985  MObjectSetBackgroundRGB(_tablefrm003, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
1986 
1987  _label004 = MCreateLabel(_tablefrm003, "DOAS Sys Directory:", HELV_SMALL);
1988  MLabelSetAlignment(_label004, LEFT_ALIGN);
1991  MObjectSetTransparency(_label004, 0);
1992 
1993 
1994  //lblsys = MCreateLabel(_tablefrm003, "..\\DOAS\\Sys\\ ", TIMES_SMALL);
1995  lblsys = MCreateLabel(_tablefrm003, pdoas->SYSDIR, TIMES_SMALL);
2001 
2002  pb = MCreateImagePButton(_tablefrm003, "sys\\fbsfold.bmp", "", "");
2003  MPButtonSetCallback(pb, BrowseCB, (void *) 0);
2004  MObjectSetPopupHelp(pb, "Change DOAS\nSystem Directory", 20, 2000);
2006 
2007  _label006 = MCreateLabel(_tablefrm003, "DOAS Results Directory:", HELV_SMALL);
2008  MLabelSetAlignment(_label006, LEFT_ALIGN);
2011  MObjectSetTransparency(_label006, 0);
2012 
2013  lblris = MCreateLabel(_tablefrm003, pdoas->RISDIR, HELV_SMALL);
2019 
2020  pb = MCreateImagePButton(_tablefrm003, "sys\\fbsfold.bmp", "", "");
2021  MPButtonSetCallback(pb, BrowseCB, (void *) 1);
2022  MObjectSetPopupHelp(pb, "Change DOAS\nResults Directory", 20, 2000);
2024 
2026 
2027 
2028 
2030 
2031  MMainLoop();
2032 
2033 
2034  return 0;
2035 }
#define RIGHT_ALIGN
Definition: Mguidefs.h:916
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
char RISDIR[_MAX_PATH]
DOAS results directory.
Definition: DOASdef.h:34
MOBJECT menubar
Definition: DOAS_FullProj.c:59
void LinkSpectraCB(MOBJECT p, void *od, void *ad)
void HlpTopCB(MOBJECT p, void *od, void *ad)
#define WS_SHADOW_IN
Definition: Mguidefs.h:958
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
void MMenuBarSetAcc(MOBJECT menu, int acc)
#define C_A
Definition: KEYCODES.H:283
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
#define C_H
Definition: KEYCODES.H:290
char SYSDIR[_MAX_PATH]
DOAS system directory.
Definition: DOASdef.h:33
MTFont font
Definition: DOASdef.h:43
MOBJECT lblsys
Definition: DOAS_FullProj.c:66
void ViewCB(MOBJECT p, void *od, void *ad)
void(* MENU_ITEM_CB)(MENU_ITEM item, MVALUE status, void *ad)
Definition: Mguidefs.h:1468
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
MENU_ITEM MMenuAddItem(MOBJECT pd, const char *item, MENU_ITEM_CB cb, void *ad)
void SunCalcCB(MOBJECT p, void *od, void *ad)
#define F10
Definition: KEYCODES.H:346
void MMainLoop(void)
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
void * MENU_ITEM
Definition: Mguidefs.h:1418
MOBJECT MCreateSubMenu(MENU_ITEM item)
#define C_T
Definition: KEYCODES.H:302
#define C_X
Definition: KEYCODES.H:306
void ColumnFCB(MOBJECT p, void *od, void *ad)
void MObjectSetPopupHelp(MOBJECT obj, const char *str, int delay, int duration)
#define TIMES_SMALL
Definition: Mguidefs.h:883
MOBJECT lblris
Definition: DOAS_FullProj.c:66
MOBJECT menu
Definition: DOAS_FullProj.c:60
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
void IoCreateCB(MOBJECT p, void *od, void *ad)
Definition: DOAS_FullProj.c:90
int fbold
Definition: DOASdef.h:40
#define C_B
Definition: KEYCODES.H:284
int fsize
Definition: DOASdef.h:42
void ExitCB(MOBJECT p, void *od, void *ad)
Definition: DOAS_FullProj.c:80
#define C_S
Definition: KEYCODES.H:301
void FixStepCB(MOBJECT p, void *od, void *ad)
#define HELV_SMALL
Definition: Mguidefs.h:881
void DiffCB(MOBJECT p, void *od, void *ad)
MTFont MLoadFont(const char *family, int h, int bold, int italic)
MENU_ITEM id_menu
Definition: DOAS_FullProj.h:11
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
void MPButtonSetAlignment(MOBJECT p, int align)
#define C_E
Definition: KEYCODES.H:287
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
void MShellRealizeXY(MOBJECT obj, int x, int y)
#define C_L
Definition: KEYCODES.H:294
void VitesaCB(MOBJECT p, void *od, void *ad)
MOBJECT MCreateShell(const char *title, int flags)
void ShStCB(MOBJECT p, void *od, void *ad)
void ResumeCB(MOBJECT p, void *od, void *ad)
short DB_BG[3]
Default Background Color.
void BuildListCB(MOBJECT p, void *od, void *ad)
#define C_C
Definition: KEYCODES.H:285
void FluxIndexCB(MOBJECT p, void *od, void *ad)
MOBJECT submenu
Definition: DOAS_FullProj.c:61
void DOASSetupCB(MOBJECT p, void *od, void *ad)
Definition: DOAS_FullProj.c:94
void EditorCB(MOBJECT p, void *od, void *ad)
MOBJECT MCreateImagePButton(MOBJECT parent, const char *npf, const char *apf, const char *upf)
palette DPAL
Definition: DOAS_FullProj.c:36
int DOAS_LoadConfig(struct doas *pdoas)
MOBJECT DOAS_MainSh
Definition: DOAS_FullProj.c:58
#define C_R
Definition: KEYCODES.H:300
int LoadDB_DispCoeff(void)
Load dispersion parameters. Procedure that load the dispersion parameters from file {homedir}/DOAS/Di...
Definition: Load.c:234
void MLabelSetAlignment(MOBJECT p, int align)
int LoadParam(void)
Load the exe parameters. Procedure that load the parameters for CCD, Stepper Motors and Peltier from ...
Definition: Load.c:1215
#define C_U
Definition: KEYCODES.H:303
void DOASConfigCB(MOBJECT p, void *od, void *ad)
MENU_ITEM id_item
Definition: DOAS_FullProj.h:19
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void DOASProcCB(MOBJECT p, void *od, void *ad)
#define C_P
Definition: KEYCODES.H:298
void FilterCB(MOBJECT p, void *od, void *ad)
void * MOBJECT
Definition: Mguidefs.h:192
#define LEFT_ALIGN
Definition: Mguidefs.h:915
void ChooseFormatCB(MOBJECT p, void *od, void *ad)
int fitalic
Definition: DOASdef.h:41
#define C_D
Definition: KEYCODES.H:286
MOBJECT MCreateMenuBar(MOBJECT parent, MTFont font)
void BrowseCB(MOBJECT p, void *od, void *ad)
MENU_ITEM MMenuAddSeparator(MOBJECT pd)
void MGUIQuitCB(MOBJECT shell, void *od, void *ad)
Exit MGUI Library. Procedure that close MGUI .
Definition: DAS_Spat.c:728
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void MMenuItemSetAccel(MENU_ITEM item, int acc, const char *at)
MOBJECT MCreateRowForm(MOBJECT parent)
void PBTempHistoCB(MOBJECT o, void *a, void *v)
void IoSetupCB(MOBJECT p, void *od, void *ad)
Definition: DOAS_FullProj.c:86
char family[32]
Definition: DOASdef.h:39
#define C_W
Definition: KEYCODES.H:305
MOBJECT MCreateMenu(MOBJECT menu, const char *text)
+ Here is the caller graph for this function:

§ MDCreateExpo()

MOBJECT MDCreateExpo ( char *  tit)

Create Exposure/countdown shell. Procedure that build the Exposure/countdown shell during the calculated or "apriori" imposed integration time.

Create the Exposure shell.
Creation of the Exposure shell during an image acquisition.

Parameters
*titpointer to the char variable with the integration time
Returns
void
Parameters
titpointer to a char variable containing the title of the shell.
Returns
MOBJECT shell

Definition at line 55 of file Init.c.

References BI_TILED, CBExpo(), graph::digit, DIL, dil::Graph, marconi::LblExpD, marconi::LblExpP, das::Marconi, MCreateColForm(), MCreateImagePButtonExt(), MCreatePixmapFromData(), MCreatePixmapFromFile(), MCreateShell(), MFormSetSpacing(), MObjectSetBackgroundImageFile(), MObjectSetShadow(), MObjectSetTransparency(), MPButtonSetCallback(), MShellRealize(), SF_NO_CLOSE, SF_NO_MAXIMIZE, SF_NO_MINIMIZE, SF_NO_RESIZE, and WS_NONE.

Referenced by DB_GetCCD().

56 {
57  int c;
58  MOBJECT sh, a, pb, pix;
59 
61  MObjectSetBackgroundImageFile(sh, "dilsys/back.bmp", BI_TILED);
62  MFormSetSpacing(sh, 5);
63 
64  a = MCreateColForm(sh);
65  MObjectSetShadow(a, WS_NONE, 0, 0);
66  MFormSetSpacing(a, 0);
67  MObjectSetTransparency(a, 255);
68 
69  for(c = 0; c < 6; c++)
70  if(c == 4)
72  else
74 
75  pix = MCreatePixmapFromFile(sh, "dilsys/down.bmp");
76 
77  a = MCreateColForm(sh);
78  MObjectSetShadow(a, WS_NONE, 0, 0);
79  MFormSetSpacing(a, 0);
80  MObjectSetTransparency(a, 255);
81 
82  for(c = 0; c < 6; c++)
83  if(c == 4)
85  else
87 
88  pb = MCreateImagePButtonExt(sh, "vimg/stop.bmp", "vimg/stopon.bmp", "", "vimg/stoparm.bmp", "", "");
89  MObjectSetShadow(pb, WS_NONE, 0, 0);
90  MPButtonSetCallback(pb, CBExpo, NULL);
91 
92  MShellRealize(sh);
93 
94  return sh;
95 }
#define WS_NONE
Definition: Mguidefs.h:956
#define SF_NO_RESIZE
Definition: Mguidefs.h:1038
MOBJECT MCreatePixmapFromFile(MOBJECT parent, const char *fname)
#define BI_TILED
Definition: Mguidefs.h:945
dil DIL
Definition: 2DPlot.c:26
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MShellRealize(MOBJECT obj)
#define SF_NO_MAXIMIZE
Definition: Mguidefs.h:1034
das DAS
DAS structure.
Definition: Init.c:34
void CBExpo(MOBJECT p, void *od, void *ad)
Close the Exposure shell and stop the image acquisition.
Definition: Init.c:43
#define SF_NO_CLOSE
Definition: Mguidefs.h:1032
#define SF_NO_MINIMIZE
Definition: Mguidefs.h:1036
MOBJECT LblExpP[7]
Label for presetted time exposure.
void MObjectSetBackgroundImageFile(MOBJECT obj, const char *fname, int mode)
MOBJECT MCreateColForm(MOBJECT parent)
MOBJECT MCreateShell(const char *title, int flags)
void MFormSetSpacing(MOBJECT p, int offset)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
MIMAGE digit[13]
Definition: Dildef.h:624
graph Graph
Definition: Dildef.h:676
void * MOBJECT
Definition: Mguidefs.h:192
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
MOBJECT MCreatePixmapFromData(MOBJECT parent, MIMAGE data)
MOBJECT MCreateImagePButtonExt(MOBJECT parent, const char *npf, const char *apf, const char *upf, const char *non, const char *aon, const char *uon)
MOBJECT LblExpD[7]
Label for time exposure countdown.
marconi Marconi
CCD Sensor struct.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreateLISC()

int MDCreateLISC ( int  c,
int  e 
)

Command KEYBOARD. Procedure that build the shell for the Command KEYBOARD. Used in old versions.

Returns
void

§ MDCreateMoveGrat()

void MDCreateMoveGrat ( void  )

Free Grating positioning. Procedure that build the shell for Free Grating positioning.

Returns
void

Definition at line 2859 of file CreateForms.c.

References ActMvGratCB(), gui::ContrPanel, palette::DB_BG, palette::DB_BG_lblUP, palette::DB_BG_Plbl, DB_dirCB(), palette::DB_FG_lblUP, palette::DB_FG_Plbl, DB_GratPosMode_CB(), DB_RecGio_CB(), DB_StepGratEnc_CB(), False, FIXED_MEDIUM, FIXED_SMALL, das::Flag, GratFlg, flag::gratposmode, GrDIR, das::Gui, HELV_MEDIUM, HELV_SMALL, lbl, controlpanel::lbl_mvgratmode, LEFT_ALIGN, MCreateColForm(), MCreateEdit(), MCreateLabel(), MCreateRButton(), MCreateRowForm(), MCreateShell(), MCreateTableForm(), MEditSetActCallback(), MLoopWhileFlag(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MObjectSetTransparency(), MPButtonSetCallback(), MRButtonActivate(), MShellDestroy(), MShellRealizeXY(), MShellUnrealize(), controlpanel::rbStepGratEnc, shells::Sh_mg, gui::Shells, TIMES_SMALL, TOP_ALIGN, True, WS_ETCHED_OUT, and WS_SHADOW_IN.

Referenced by DB_KeyB_CB().

2860 {
2861 
2862 
2863  MOBJECT lbl;
2864  MOBJECT rb;
2865 
2866 // MOBJECT lbl1;
2867  MOBJECT edt;
2868 // MOBJECT pbut;
2869  MOBJECT rowfrm, rowfrm1, colfrm;
2870  MOBJECT tb;
2871  char buff[255];
2872  DAS.Gui.Shells.Sh_mg = MCreateShell("MOVE GRATING", 0);
2874 // MObjectAddEventNotifyCallback(DAS.Gui.Shells.Sh_mg, (OBJ_EVENT_CB) DB_Redraw_CB, EM_MOTION , (void *) 0);
2876 
2877  rowfrm = MCreateRowForm(DAS.Gui.Shells.Sh_mg);
2878  MObjectSetBackgroundRGB(rowfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2879 
2880 // MObjectSetBackgroundRGB(rowfrm, 96, 133, 149);
2881  MObjectSetResize(rowfrm, False, False);
2882 
2883 /*
2884  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
2885  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
2886  MObjectSetTransparency(lbl, 0);
2887  MObjectAddEventNotifyCallback(lbl, (OBJ_EVENT_CB) DB_Redraw_CB, d_events , (void *) 1);
2888 
2889 
2890  DAS.Gui.ContrPanel.lbl_Par[0] = MCreateLabel(tb, "+10.0C", HELV_SMALL);
2891  MLabelSetAlignment(DAS.Gui.ContrPanel.lbl_Par[0], RIGHT_ALIGN);
2892  MObjectSetForegroundRGB(DAS.Gui.ContrPanel.lbl_Par[0], DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
2893  MObjectSetBackgroundRGB(DAS.Gui.ContrPanel.lbl_Par[0], DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
2894 
2895 
2896 */
2897  sprintf(buff,"FREE GRATING POSITIONING");
2898  lbl = MCreateLabel(rowfrm, buff, HELV_MEDIUM);
2901  MObjectSetTransparency(lbl, 0);
2902 
2903  // MObjectSetForegroundRGB(lbl, 255, 255, 255);
2904 // MObjectSetBackgroundRGB(lbl, 53, 112, 112);
2905  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
2906 
2907  sprintf(buff," NOTE:\nThe Grating is moving, so if you want to shift\n \
2908 a spectral line towards the visible,\nyou have to move the grating in the UV direction.");
2909 
2910  lbl = MCreateLabel(rowfrm, buff, HELV_MEDIUM);
2913  MObjectSetResize(lbl, False, False);
2914 
2915 // MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
2916  MObjectSetTransparency(lbl, 0);
2917 
2918 
2919  rowfrm1 = MCreateRowForm(rowfrm);
2920  MObjectSetBackgroundRGB(rowfrm1, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2921  MObjectSetResize(rowfrm1, True, True);
2922  MObjectSetTransparency(rowfrm1, 0);
2923 
2924 /********************/
2925  tb = MCreateTableForm(rowfrm1, 2);
2926  MObjectSetBackgroundRGB(tb, 95, 3, 3);
2928 
2929  if(DAS.Flag.gratposmode == 0)
2930  sprintf(buff, "_ Steps:");
2931  if(DAS.Flag.gratposmode == 1)
2932  sprintf(buff, "Amstrongs:");
2937 
2938  edt = MCreateEdit(tb, "0", 12, FIXED_MEDIUM);
2939  //MEditSetFilter(edt, 4, "");
2940  MObjectSetForegroundRGB(edt, 255, 255, 255);
2941  MObjectSetBackgroundRGB(edt, 0, 0, 90);
2942  MObjectSetShadow(edt, WS_ETCHED_OUT, 2, 1);
2943  MEditSetActCallback(edt, ActMvGratCB, edt);
2944 
2945 /**************************************/
2946 
2947 
2948  lbl = MCreateLabel(rowfrm1, "The typed steps have to be directly sent to the Grating stepper? ", HELV_SMALL);
2949  MObjectSetTransparency(lbl, 0);
2952  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
2953 
2954  tb = MCreateTableForm(rowfrm1, 2);
2955  // MObjectSetBackgroundRGB(tb, 96, 133, 149);
2956  MObjectSetBackgroundRGB(tb, 129, 77, 77);
2957  MObjectSetResize(tb, True, False);
2958 
2959  DAS.Gui.ContrPanel.rbStepGratEnc[0] = MCreateRButton(tb, "Yes - Send direct", FIXED_SMALL);
2963 
2964  DAS.Gui.ContrPanel.rbStepGratEnc[1] = MCreateRButton(tb, "No - Use the DAS encoding", FIXED_SMALL);
2967 
2968 
2969 
2970  lbl = MCreateLabel(rowfrm1, "Do you want to perform the backlash recovery? ", HELV_SMALL);
2971  MObjectSetTransparency(lbl, 0);
2974  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
2975 
2976  tb = MCreateTableForm(rowfrm1, 2);
2977  // MObjectSetBackgroundRGB(tb, 96, 133, 149);
2978  MObjectSetBackgroundRGB(tb, 129, 77, 77);
2979  MObjectSetResize(tb, True, False);
2980 
2981  rb = MCreateRButton(tb, "Yes ", FIXED_SMALL);
2982  MObjectSetForegroundRGB(rb, 255, 255, 255);
2983  MPButtonSetCallback(rb, DB_RecGio_CB, (void *) 0);
2984  MRButtonActivate(rb);
2985 
2986  rb = MCreateRButton(tb, "No", FIXED_SMALL);
2987  MObjectSetForegroundRGB(rb, 255, 255, 255);
2988  MPButtonSetCallback(rb, DB_RecGio_CB, (void *) 1);
2989 
2990 
2991 
2992  colfrm = MCreateColForm(rowfrm1);
2993  MObjectSetBackgroundRGB(colfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
2994  MObjectSetResize(colfrm, False, True);
2995  MObjectSetTransparency(colfrm, 0);
2996 
2997 
2998  lbl = MCreateLabel(colfrm, "Select dir.", TIMES_SMALL);
2999  MObjectSetTransparency(lbl, 0);
3002  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3003 
3004  tb = MCreateTableForm(colfrm, 1);
3005  // MObjectSetBackgroundRGB(tb, 96, 133, 149);
3006  //MObjectSetBackgroundRGB(tb, 112, 128, 112);
3007  MObjectSetBackgroundRGB(tb, 129, 77, 77);
3008  MObjectSetResize(tb, False, True);
3009 
3010  rb = MCreateRButton(tb, "CW - UV", FIXED_SMALL);
3011  MObjectSetForegroundRGB(rb, 255, 255, 255);
3012  MPButtonSetCallback(rb, DB_dirCB, (void *) 0);
3013  MRButtonActivate(rb);
3014  GrDIR = 0;
3015 
3016  rb = MCreateRButton(tb, "CCW - Vis", FIXED_SMALL);
3017  MObjectSetForegroundRGB(rb, 255, 255, 255);
3018  MPButtonSetCallback(rb, DB_dirCB, (void *) 1);
3019 
3020 /* colfrm = MCreateColForm(rowfrm1);
3021  MObjectSetBackgroundRGB(colfrm, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
3022  MObjectSetResize(colfrm, True, True);
3023  MObjectSetTransparency(colfrm, 0);
3024 */
3025  lbl = MCreateLabel(colfrm, "Positioning with:", TIMES_SMALL);
3026  MObjectSetTransparency(lbl, 0);
3029  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3030 
3031  tb = MCreateTableForm(colfrm, 1);
3032  //MObjectSetBackgroundRGB(tb, 112, 128, 112);
3033  MObjectSetBackgroundRGB(tb, 129, 77, 77);
3034  MObjectSetResize(tb, False, True);
3035 
3036  rb = MCreateRButton(tb, "Step", FIXED_SMALL);
3037  MPButtonSetCallback(rb, DB_GratPosMode_CB, (void *) 0);
3039  MObjectSetForegroundRGB(rb, 255, 255, 255);
3040  MObjectSetCompositeWidth(rb, 100);
3041  if(DAS.Flag.gratposmode == 0)
3042  MRButtonActivate(rb);
3043 
3044  rb = MCreateRButton(tb, "Wavelength", FIXED_SMALL);
3045  MPButtonSetCallback(rb, DB_GratPosMode_CB, (void *) 1);
3047  MObjectSetForegroundRGB(rb, 255, 255, 255);
3048  MObjectSetCompositeWidth(rb, 100);
3049  if(DAS.Flag.gratposmode == 1)
3050  MRButtonActivate(rb);
3051 
3052 
3053 
3054 
3056 
3057  GratFlg = 0;
3058  MLoopWhileFlag(&GratFlg, 0);
3059 
3062 
3063 
3064 }
short DB_BG_lblUP[3]
Background Capital Letters Labels Color UP.
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
shells Shells
Shells structure.
void DB_GratPosMode_CB(MOBJECT o, void *a, void *v)
Definition: CreateForms.c:2778
MOBJECT lbl
Definition: DFileMan.c:42
MOBJECT rbStepGratEnc[2]
radio buttons for steps encoding (move Grating free positioning)
#define WS_SHADOW_IN
Definition: Mguidefs.h:958
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
MOBJECT MCreateEdit(MOBJECT parent, const char *text, int len, MTFont font)
int gratposmode
Grating position mode flag: = 0 step mode; = 1 Wl mode.
#define WS_ETCHED_OUT
Definition: Mguidefs.h:960
MOBJECT lbl_mvgratmode
Active Control Panel Labels for Sunset.
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.
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
MOBJECT Sh_mg
Password Shell.
void DB_RecGio_CB(MOBJECT o, void *a, void *v)
Definition: CreateForms.c:2835
void MShellUnrealize(MOBJECT obj)
#define TIMES_SMALL
Definition: Mguidefs.h:883
void MShellDestroy(MOBJECT obj)
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
#define FIXED_MEDIUM
Definition: Mguidefs.h:879
#define HELV_SMALL
Definition: Mguidefs.h:881
void DB_dirCB(MOBJECT o, void *id, void *a_data)
Definition: CreateForms.c:2673
void MEditSetActCallback(MOBJECT edit, OBJ_STRING_CB cb, void *data)
#define FIXED_SMALL
Definition: Mguidefs.h:878
void MRButtonActivate(MOBJECT o)
void ActMvGratCB(MOBJECT edit, char *text, void *ed)
Move Grating of a free steps number callback. .
Definition: CreateForms.c:2691
MOBJECT MCreateColForm(MOBJECT parent)
palette DPAL
Definition: CreateForms.c:88
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
void MShellRealizeXY(MOBJECT obj, int x, int y)
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
MOBJECT MCreateRButton(MOBJECT parent, const char *text, MTFont font)
controlpanel ContrPanel
Control Panel Structure.
das DAS
Definition: CreateForms.c:98
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
int GrDIR
Definition: CreateForms.c:64
static int GratFlg
Definition: CreateForms.c:60
void MLoopWhileFlag(int *pflag, int value)
void DB_StepGratEnc_CB(MOBJECT o, void *a, void *v)
Definition: CreateForms.c:2811
#define HELV_MEDIUM
Definition: Mguidefs.h:882
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT MCreateRowForm(MOBJECT parent)
#define TOP_ALIGN
Definition: Mguidefs.h:918
short DB_FG_lblUP[3]
Foreground Capital Letters Labels Color UP.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreateMoveZenAzimDeg()

void MDCreateMoveZenAzimDeg ( void  )

Definition at line 3573 of file CreateForms.c.

References palette::DB_UnSel, palette::DB_UnSelFG, mige::edtaz, mige::edtzen, FIXED_MEDIUM, FIXED_SMALL, GratFlg, das::Gui, lbl, MCreateEdit(), MCreateLabel(), MCreatePButton(), MCreateRowForm(), MCreateShell(), MCreateTableForm(), das::MIGE, MIGEZenAzPos_CB(), MLoopWhileFlag(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MPButtonSetCallback(), MShellDestroy(), MShellRealizeXY(), MShellUnrealize(), AzimuthSt::realazpos, ZenithSt::realzenpos, shells::Sh_mg, gui::Shells, TIMES_SMALL, True, WS_ETCHED_OUT, and WS_SHADOW_IN.

Referenced by DB_KeyB_CB().

3574 {
3575 
3576  MOBJECT lbl;
3577  MOBJECT pbut;
3578 // MOBJECT rbutt;
3579  MOBJECT lbl1;
3580 // MOBJECT edt;
3581 // MOBJECT pbut;
3582  MOBJECT _rowform000;
3583  MOBJECT _tablefrm000;
3584  char buff[255];
3585  DAS.Gui.Shells.Sh_mg = MCreateShell("MOVE Zenith and Azimuth Axis", 0);
3586  MObjectSetBackgroundRGB(DAS.Gui.Shells.Sh_mg, 96, 133, 149);
3587 
3588  _rowform000 = MCreateRowForm(DAS.Gui.Shells.Sh_mg);
3589  MObjectSetBackgroundRGB(_rowform000, 96, 133, 149);
3590  MObjectSetResize(_rowform000, True, True);
3591 
3592  sprintf(buff,"This tool allows for the positioning of the Zenith and Azimuth\n \
3593 Axes at the typed angles.");
3594 
3595  lbl = MCreateLabel(_rowform000, buff, TIMES_SMALL);
3596  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3597  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3598  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3599 
3600 
3601 
3602  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_mg, 3);
3603  MObjectSetBackgroundRGB(_tablefrm000, 96, 133, 149);
3604  MObjectSetResize(_tablefrm000, True, True);
3605 
3606  lbl1 = MCreateLabel(_tablefrm000, "Zenith (xxx.x):", FIXED_SMALL);
3607  MObjectSetForegroundRGB(lbl1, 255, 255, 255);
3608  MObjectSetShadow(lbl1, WS_SHADOW_IN, 1, 0);
3609 
3610  sprintf(buff, "%.1lf", ZST.realzenpos);
3611  DAS.MIGE.edtzen = MCreateEdit(_tablefrm000, buff, 6, FIXED_MEDIUM);
3612  //MEditSetFilter(edt, 4, "");
3613  MObjectSetForegroundRGB(DAS.MIGE.edtzen, 255, 255, 255);
3616  //MEditSetActCallback(edt, ActMvZenDegCB, edt);
3617 
3618  sprintf(buff," Allowed values: 0 <= x <= 180.");
3619  lbl = MCreateLabel(_tablefrm000, buff, TIMES_SMALL);
3620  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3621  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3622  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3623 
3624 
3625 
3626  lbl1 = MCreateLabel(_tablefrm000, "Azimuth (xxx.x):", FIXED_SMALL);
3627  MObjectSetForegroundRGB(lbl1, 255, 255, 255);
3628  MObjectSetShadow(lbl1, WS_SHADOW_IN, 1, 0);
3629 
3630  //sprintf(buff, "%.1lf", AST.Pos);
3631  sprintf(buff, "%.1lf", AST.realazpos);
3632  DAS.MIGE.edtaz = MCreateEdit(_tablefrm000, buff, 6, FIXED_MEDIUM);
3633  //MEditSetFilter(edt, 4, "");
3634  MObjectSetForegroundRGB(DAS.MIGE.edtaz, 255, 255, 255);
3637  //MEditSetActCallback(edt, ActMvAzimDegCB, edt);
3638 
3639 
3640  sprintf(buff," Allowed values: 0 <= x <= 360.");
3641  lbl = MCreateLabel(_tablefrm000, buff, TIMES_SMALL);
3642  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3643  MObjectSetBackgroundRGB(lbl, 53, 112, 112);
3644  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3645 
3646 
3647 
3648  _rowform000 = MCreateRowForm(DAS.Gui.Shells.Sh_mg);
3649  MObjectSetBackgroundRGB(_rowform000, 96, 133, 149);
3650  MObjectSetResize(_rowform000, True, True);
3651 
3652 
3653  pbut = MCreatePButton(_rowform000, "DO POSIT.", FIXED_SMALL);
3656  //MObjectSetForegroundRGB(pbut, 255, 255, 255);
3657  MPButtonSetCallback(pbut, MIGEZenAzPos_CB, (void *) 0);
3658 
3659 
3661 
3662  GratFlg = 0;
3663  MLoopWhileFlag(&GratFlg, 0);
3664 
3667 
3668 
3669 
3670 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
shells Shells
Shells structure.
MOBJECT lbl
Definition: DFileMan.c:42
#define WS_SHADOW_IN
Definition: Mguidefs.h:958
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
MOBJECT MCreateEdit(MOBJECT parent, const char *text, int len, MTFont font)
double realazpos
#define WS_ETCHED_OUT
Definition: Mguidefs.h:960
AzimuthSt AST
Definition: CreateForms.c:100
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
MOBJECT Sh_mg
Password Shell.
ZenithSt ZST
Definition: CreateForms.c:99
void MShellUnrealize(MOBJECT obj)
#define TIMES_SMALL
Definition: Mguidefs.h:883
void MShellDestroy(MOBJECT obj)
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
#define FIXED_MEDIUM
Definition: Mguidefs.h:879
MOBJECT edtaz
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define FIXED_SMALL
Definition: Mguidefs.h:878
mige MIGE
palette DPAL
Definition: CreateForms.c:88
void MShellRealizeXY(MOBJECT obj, int x, int y)
void MIGEZenAzPos_CB(MOBJECT o, void *a, void *v)
Definition: CreateForms.c:3554
MOBJECT MCreateShell(const char *title, int flags)
das DAS
Definition: CreateForms.c:98
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
static int GratFlg
Definition: CreateForms.c:60
void MLoopWhileFlag(int *pflag, int value)
double realzenpos
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT MCreateRowForm(MOBJECT parent)
MOBJECT edtzen
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreateSh_Fil()

int MDCreateSh_Fil ( void  )

Create the shell for the available Filters. Procedure that build the shell for the positioning of the filter wheel. They are installed during the instrument setup.

Returns
0

Definition at line 5994 of file CreateForms.c.

References DB_Close_Sh(), DB_Fil_CB(), DB_FilSelButtKB_CB(), DB_PushButtonMouse_CB(), DB_SheelESC(), palette::DB_UnSel, palette::DB_UnSelFG, EM_BUTTON_PRESS, EM_KEY_PRESS, EM_MOTION, paramini::EqType, pushbutt::Fil, Fil_Code, Fil_Code8H, Fil_CodeNG, Fil_CodeNG1, Fil_CodeTropo, FilBuff, FilFlg, FWS, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, das::Gui, HELV_SMALL, LIS_, MButtonSetOnMouseOverForegroundRGB(), MCreatePButton(), MCreateShell(), MCreateTableForm(), MLoopWhileFlag(), MObjectAddEventNotifyCallback(), MObjectSetBackgroundRGB(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MPButtonSetCallback(), MShellDestroy(), MShellRealizeXY(), MShellSetWMCloseCallback(), MShellUnrealize(), das::Paramini, FilterWheelSt::Pos, gui::PushButt, SF_MODAL, shells::Sh_Fil, gui::Shells, TROPOGAS, True, and WS_SHADOW_OUT.

Referenced by DB_KeyB_CB().

5995 {
5996  int i, er = 0;
5997  int bas = 0; //button array size
5998  MOBJECT _tablefrm000;
5999 // MOBJECT _tablefrm001;
6000 // MOBJECT Esc_But;
6001 
6002  DAS.Gui.Shells.Sh_Fil = MCreateShell("SET FILTER", SF_MODAL);
6003  MObjectSetForegroundRGB(DAS.Gui.Shells.Sh_Fil, 255, 255, 255);
6004 
6005 /*
6006  _tablefrm001 = MCreateTableForm(DAS.Gui.Shells.Sh_Fil, 1);
6007  MObjectSetBackgroundRGB(_tablefrm001, 91, 74, 74);
6008  MObjectSetResize(_tablefrm001, True, True);
6009 
6010  Esc_But = MCreatePButton(_tablefrm001, "ESC-Return", HELV_SMALL);
6011  MObjectSetBackgroundRGB(Esc_But, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
6012  MObjectSetShadow(Esc_But, WS_SHADOW_OUT, 3, 0);
6013  MObjectSetCompositeWidth(Esc_But, 180);
6014  MButtonSetAccelerator(Esc_But, ESC);
6015  MButtonSetOnMouseOverForegroundRGB(Esc_But, 255, 255, 255);
6016  MPButtonSetCallback(Esc_But, DB_Esc_CB, (void *) 2);
6017 */
6018  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_Fil, 1);
6019  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
6020  MObjectSetResize(_tablefrm000, True, True);
6021 
6022 
6023 
6024  if(DAS.Paramini.EqType == LIS_)
6025  {
6026  bas = 8;
6027  for (i=0; i<bas; i++)
6028  {
6029  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_Code8H[i], HELV_SMALL);
6032  if (i==FWS.Pos)
6033  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], 0, 0, 255);
6034 
6036  // MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6040  MPButtonSetCallback(DAS.Gui.PushButt.Fil[i], DB_Fil_CB, (void *) i);
6041  // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6043  }
6044 
6045  }
6046  else
6047  {
6048  bas = 6;
6049  for (i=0; i<bas; i++)
6050  {
6051  if(DAS.Paramini.EqType == TROPOGAS)
6052  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_CodeTropo[i], HELV_SMALL);
6054  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_CodeNG[i], HELV_SMALL);
6055  else if (DAS.Paramini.EqType == GASCODNG1)
6056  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_CodeNG1[i], HELV_SMALL);
6057  else
6058  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_Code[i], HELV_SMALL);
6059 
6062  if (i==FWS.Pos)
6063  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], 0, 0, 255);
6064 
6066  // MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6070  MPButtonSetCallback(DAS.Gui.PushButt.Fil[i], DB_Fil_CB, (void *) i);
6071  // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6073  }
6074 
6075  }
6076 /*
6077  for (i=0; i<(sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]); i++)
6078  {
6079  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_Code[i], HELV_SMALL);
6080  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6081  MObjectSetForegroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
6082  if (i==0)
6083  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6084 
6085  MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtKB_CB, EM_KEY_PRESS, (void *) i);
6086  MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6087  MObjectSetShadow(DAS.Gui.PushButt.Fil[i], WS_SHADOW_OUT, 4, 0);
6088  MObjectSetCompositeWidth(DAS.Gui.PushButt.Fil[i], 150);
6089  MPButtonSetCallback(DAS.Gui.PushButt.Fil[i], DB_Fil_CB, (void *) i);
6090  MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6091  }
6092 
6093 */
6094 
6097 
6099 
6100  FilFlg = 0;
6101  MLoopWhileFlag(&FilFlg, 0);
6102  if(FilBuff == "0")
6103  {
6104  FilFlg = 1;
6107 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
6108  return er;
6109  }
6110  else
6111  {
6114 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
6115  return er;
6116  }
6117 
6118 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
shells Shells
Shells structure.
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
static int FilFlg
Definition: CreateForms.c:50
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
void MShellUnrealize(MOBJECT obj)
int Pos
Filter Wheel current Position.
void DB_Fil_CB(MOBJECT p, void *od, void *ad)
callback for filter wheel positioning in Filter shell
Definition: CreateForms.c:6120
MOBJECT Fil[6]
Filter Buttons.
#define EM_MOTION
Definition: Mguidefs.h:319
void MShellDestroy(MOBJECT obj)
#define LIS_
Lampedusa Island Spectrometer - ENEA.
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
#define EM_KEY_PRESS
Definition: Mguidefs.h:316
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
#define EM_BUTTON_PRESS
Definition: Mguidefs.h:317
void DB_FilSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
callback for select a specified filter push button with the keyboard
Definition: CreateForms.c:6166
MOBJECT Sh_Fil
Filter Shell.
#define HELV_SMALL
Definition: Mguidefs.h:881
#define SF_MODAL
Definition: Mguidefs.h:1019
void(* OBJ_EVENT_CB)(MOBJECT obj, MEvent *e, void *ad)
Definition: Mguidefs.h:1456
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
palette DPAL
Definition: CreateForms.c:88
void MObjectAddEventNotifyCallback(MOBJECT obj, OBJ_EVENT_CB cb, CARD32 event_mask, void *a_data)
pushbutt PushButt
Push buttons.
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
void MShellRealizeXY(MOBJECT obj, int x, int y)
#define GASCODNG4
GASCODNG 4.
char * Fil_CodeNG1[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrum...
Definition: DAS_Spat.c:213
MOBJECT MCreateShell(const char *title, int flags)
char * Fil_Code[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:207
das DAS
Definition: CreateForms.c:98
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
void DB_Close_Sh(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:5511
#define True
Definition: Mguidefs.h:235
void DB_PushButtonMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
Definition: CreateForms.c:950
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
void MButtonSetOnMouseOverForegroundRGB(MOBJECT button, int r, int g, int b)
void MLoopWhileFlag(int *pflag, int value)
int EqType
Spectrometer Type.
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
void DB_SheelESC(MOBJECT obj, MKeyEvent *pe, void *a_data)
Definition: CreateForms.c:5569
const char * FilBuff
Definition: CreateForms.c:51
#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:

§ MDCreateSh_Home()

int MDCreateSh_Home ( void  )

Definition at line 6662 of file CreateForms.c.

References DB_Home_CB(), palette::DB_UnSel, palette::DB_UnSelFG, das::Gui, HELV_SMALL, pushbutt::HomePos, HomePosition, MCreatePButton(), MCreateShell(), MCreateTableForm(), MObjectSetBackgroundRGB(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MPButtonSetCallback(), MShellRealizeXY(), gui::PushButt, SF_NO_MAXIMIZE, shells::Sh_Home, gui::Shells, True, wl, and WS_SHADOW_OUT.

Referenced by DB_KeyB_CB().

6663 {
6664  int i, er = 0;
6665  MOBJECT _tablefrm000;
6666  char buff[16];
6667 
6668  DAS.Gui.Shells.Sh_Home = MCreateShell("SET HOME POSITION",SF_NO_MAXIMIZE);
6669  MObjectSetForegroundRGB(DAS.Gui.Shells.Sh_Home, 255, 255, 255);
6670 
6671  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_Home, 3);
6672  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
6673  MObjectSetResize(_tablefrm000, True, True);
6674 
6675  for (i=0; i<(sizeof DAS.Gui.PushButt.HomePos / sizeof DAS.Gui.PushButt.HomePos[0]); i++)
6676  {
6677  itoa(wl[i],buff,10);
6678  DAS.Gui.PushButt.HomePos[i] = MCreatePButton(_tablefrm000, HomePosition[i], HELV_SMALL);
6681  //MObjectAddEventNotifyCallback(DAS.Gui.PushButt.HomePos[i], (OBJ_EVENT_CB) DB_HomeSelButtKB_CB, EM_KEY_PRESS, (void *) i);
6682  //MObjectAddEventNotifyCallback(DAS.Gui.PushButt.HomePos[i], (OBJ_EVENT_CB) DB_PushButtonMouse_CB, EM_BUTTON_PRESS | EM_MOTION, (void *) 2);
6683 
6687  //MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.HomePos[i], 255, 0, 0);
6688  }
6689 
6690  //MShellSetWMCloseCallback(DAS.Gui.Shells.Sh_Home, DB_Close_Sh, (void *) 1);
6691  //MObjectAddEventNotifyCallback(DAS.Gui.Shells.Sh_Home, (OBJ_EVENT_CB) DB_SheelESC, EM_KEY_PRESS, (void *) 1);
6692 
6694 /*
6695  HomeFlg = 0;
6696  MLoopWhileFlag(&HomeFlg, 0);
6697  if(WlBuff == "0")
6698  {
6699  WlFlg = 1;
6700  MShellUnrealize(DAS.Gui.Shells.Sh_Wl);
6701  MShellDestroy(DAS.Gui.Shells.Sh_Wl);
6702  return er;
6703  }
6704  else
6705  {
6706  MShellUnrealize(DAS.Gui.Shells.Sh_Wl);
6707  MShellDestroy(DAS.Gui.Shells.Sh_Wl);
6708  return er;
6709  }
6710 */
6711 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
shells Shells
Shells structure.
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
#define SF_NO_MAXIMIZE
Definition: Mguidefs.h:1034
char * HomePosition[]
const char array for the realisation of the Filters buttons in the ND Filter shell ...
Definition: DAS_Spat.c:227
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
void DB_Home_CB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:6552
MOBJECT Sh_Home
Home Shell.
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define HELV_SMALL
Definition: Mguidefs.h:881
MOBJECT HomePos[7]
Reference Position Buttons.
palette DPAL
Definition: CreateForms.c:88
pushbutt PushButt
Push buttons.
void MShellRealizeXY(MOBJECT obj, int x, int y)
MOBJECT MCreateShell(const char *title, int flags)
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
das DAS
Definition: CreateForms.c:98
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreateSh_Mir()

int MDCreateSh_Mir ( void  )

Create the shell for the available Mirror Positions. Procedure that build the shell for the positioning of the Input Mirror.
They are: 1) Zenith 2) Horizontal Right 3) Calibra (Down for the calibration sphere) 4) Horizontal Left.

Returns
0

Definition at line 5614 of file CreateForms.c.

References DB_Close_Sh(), DB_Mir_CB(), DB_MirSelButtKB_CB(), DB_PushButtonMouse_CB(), DB_SheelESC(), palette::DB_UnSel, palette::DB_UnSelFG, EM_BUTTON_PRESS, EM_KEY_PRESS, EM_MOTION, paramini::EqType, GASCODNG4, das::Gui, HELV_SMALL, MButtonSetOnMouseOverForegroundRGB(), MCreatePButton(), MCreateShell(), MCreateTableForm(), pushbutt::Mir, Mir_Code, Mir_CodeTropo, MirBuff, MirFlg, MIS, MLoopWhileFlag(), MObjectAddEventNotifyCallback(), MObjectSetBackgroundRGB(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MPButtonSetCallback(), MShellDestroy(), MShellRealizeXY(), MShellSetWMCloseCallback(), MShellUnrealize(), das::Paramini, MirrorSt::Pos, gui::PushButt, SF_MODAL, shells::Sh_Mir, gui::Shells, SPATRAM3, TROPOGAS, True, and WS_SHADOW_OUT.

Referenced by DB_KeyB_CB().

5615 {
5616  int i, er = 0;
5617  MOBJECT _tablefrm000;
5618 // MOBJECT _tablefrm001;
5619 // MOBJECT Esc_But;
5620  char buf[16];
5621 
5622  DAS.Gui.Shells.Sh_Mir = MCreateShell("SET INPUT MIRROR POSITION", SF_MODAL);
5623  MObjectSetForegroundRGB(DAS.Gui.Shells.Sh_Mir, 255, 255, 255);
5624 
5625 /*
5626  _tablefrm001 = MCreateTableForm(DAS.Gui.Shells.Sh_Mir, 1);
5627  MObjectSetBackgroundRGB(_tablefrm001, 91, 74, 74);
5628  MObjectSetResize(_tablefrm001, True, True);
5629 
5630  Esc_But = MCreatePButton(_tablefrm001, "ESC-Return", HELV_SMALL);
5631  MObjectSetBackgroundRGB(Esc_But, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
5632  MObjectSetShadow(Esc_But, WS_SHADOW_OUT, 3, 0);
5633  MObjectSetCompositeWidth(Esc_But, 180);
5634  MButtonSetAccelerator(Esc_But, ESC);
5635  MButtonSetOnMouseOverForegroundRGB(Esc_But, 255, 255, 255);
5636  MPButtonSetCallback(Esc_But, DB_Esc_CB, (void *) 0);
5637 */
5638  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_Mir, 1);
5639  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
5640  MObjectSetResize(_tablefrm000, True, True);
5641 
5642  for (i=0; i < (sizeof DAS.Gui.PushButt.Mir / sizeof DAS.Gui.PushButt.Mir[0]); i++)
5643  {
5645  sprintf(buf, "%s",Mir_CodeTropo[i]);
5646  else
5647  sprintf(buf, "%s",Mir_Code[i]);
5648 
5649 
5650  DAS.Gui.PushButt.Mir[i] = MCreatePButton(_tablefrm000, buf, HELV_SMALL);
5653  if (i==MIS.Pos)
5654  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], 0, 0, 255);
5655  //MObjectSetBackgroundRGB(DAS.Gui.PushButt.Mir[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
5658  //MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Mir[i], (OBJ_EVENT_CB) DB_MirSelButtMouse_CB, EM_BUTTON_PRESS | EM_MOTION, (void *) 1);
5660 
5662  MPButtonSetCallback(DAS.Gui.PushButt.Mir[i], DB_Mir_CB, (void *) i);
5663 // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Mir[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
5665  }
5666 
5669 
5671 
5672  MirFlg = 0;
5673  MLoopWhileFlag(&MirFlg, 0);
5674  if(MirBuff == "0")
5675  {
5676  MirFlg = 1;
5679 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
5680  return er;
5681  }
5682  else
5683  {
5686 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
5687  return er;
5688  }
5689 
5690 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
shells Shells
Shells structure.
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
const char * Mir_Code[]
const char array for the realisation of the Mirrors buttons in the Mirror shell
Definition: DAS_Spat.c:231
void DB_Mir_CB(MOBJECT p, void *od, void *ad)
callback for input mirror positioning in Mirror shell
Definition: CreateForms.c:5692
MOBJECT Sh_Mir
Mirror Shell.
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
void DB_MirSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
callback for selsct a specified mirror push button with the keyboard
Definition: CreateForms.c:5748
int Pos
Mirror Current Position.
static int MirFlg
Definition: CreateForms.c:47
void MShellUnrealize(MOBJECT obj)
#define EM_MOTION
Definition: Mguidefs.h:319
void MShellDestroy(MOBJECT obj)
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
#define EM_KEY_PRESS
Definition: Mguidefs.h:316
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define EM_BUTTON_PRESS
Definition: Mguidefs.h:317
#define HELV_SMALL
Definition: Mguidefs.h:881
#define SF_MODAL
Definition: Mguidefs.h:1019
void(* OBJ_EVENT_CB)(MOBJECT obj, MEvent *e, void *ad)
Definition: Mguidefs.h:1456
palette DPAL
Definition: CreateForms.c:88
void MObjectAddEventNotifyCallback(MOBJECT obj, OBJ_EVENT_CB cb, CARD32 event_mask, void *a_data)
pushbutt PushButt
Push buttons.
void MShellRealizeXY(MOBJECT obj, int x, int y)
#define GASCODNG4
GASCODNG 4.
MOBJECT MCreateShell(const char *title, int flags)
#define SPATRAM3
SPATRAM3.
const char * MirBuff
Definition: CreateForms.c:48
MirrorSt MIS
Mirror.
Definition: DAS_Spat.c:61
das DAS
Definition: CreateForms.c:98
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
void DB_Close_Sh(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:5511
#define True
Definition: Mguidefs.h:235
void DB_PushButtonMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
Definition: CreateForms.c:950
void MButtonSetOnMouseOverForegroundRGB(MOBJECT button, int r, int g, int b)
void MLoopWhileFlag(int *pflag, int value)
int EqType
Spectrometer Type.
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void DB_SheelESC(MOBJECT obj, MKeyEvent *pe, void *a_data)
Definition: CreateForms.c:5569
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
MOBJECT Mir[4]
Mirror Buttons.
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:

§ MDCreateSh_NDFil()

int MDCreateSh_NDFil ( void  )

Definition at line 6233 of file CreateForms.c.

References DB_Close_Sh(), DB_Fil_CB(), DB_FilSelButtKB_CB(), DB_NDFil_CB(), DB_NDFilSelButtKB_CB(), DB_PushButtonMouse_CB(), DB_SheelESC(), palette::DB_UnSel, palette::DB_UnSelFG, EM_BUTTON_PRESS, EM_KEY_PRESS, EM_MOTION, paramini::EqType, pushbutt::Fil, Fil_Code8H, Fil_CodeNG, Fil_CodeTropo, FWS, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, das::Gui, HELV_SMALL, LIS_, MButtonSetOnMouseOverForegroundRGB(), MCreatePButton(), MCreateShell(), MCreateTableForm(), MLoopWhileFlag(), MObjectAddEventNotifyCallback(), MObjectSetBackgroundRGB(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MPButtonSetCallback(), MShellDestroy(), MShellRealizeXY(), MShellSetWMCloseCallback(), MShellUnrealize(), pushbutt::NDFil, NDFil_Code, NDFilBuff, NDFilFlg, NDFWS, das::Paramini, FilterWheelSt::Pos, NDFilterWheelSt::Pos, gui::PushButt, SF_MODAL, shells::Sh_NDFil, gui::Shells, TROPOGAS, True, and WS_SHADOW_OUT.

Referenced by DB_KeyB_CB().

6234 {
6235  int i, er = 0;
6236  int bas = 0; //button array size
6237  MOBJECT _tablefrm000;
6238 // MOBJECT _tablefrm001;
6239 // MOBJECT Esc_But;
6240 
6241  DAS.Gui.Shells.Sh_NDFil = MCreateShell("SET ND FILTER", SF_MODAL);
6242  MObjectSetForegroundRGB(DAS.Gui.Shells.Sh_NDFil, 255, 255, 255);
6243 
6244 /*
6245  _tablefrm001 = MCreateTableForm(DAS.Gui.Shells.Sh_Fil, 1);
6246  MObjectSetBackgroundRGB(_tablefrm001, 91, 74, 74);
6247  MObjectSetResize(_tablefrm001, True, True);
6248 
6249  Esc_But = MCreatePButton(_tablefrm001, "ESC-Return", HELV_SMALL);
6250  MObjectSetBackgroundRGB(Esc_But, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
6251  MObjectSetShadow(Esc_But, WS_SHADOW_OUT, 3, 0);
6252  MObjectSetCompositeWidth(Esc_But, 180);
6253  MButtonSetAccelerator(Esc_But, ESC);
6254  MButtonSetOnMouseOverForegroundRGB(Esc_But, 255, 255, 255);
6255  MPButtonSetCallback(Esc_But, DB_Esc_CB, (void *) 2);
6256 */
6257  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_NDFil, 1);
6258  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
6259  MObjectSetResize(_tablefrm000, True, True);
6260 
6261 
6262 
6263  if(DAS.Paramini.EqType == LIS_)
6264  {
6265  bas = 8;
6266  for (i=0; i<bas; i++)
6267  {
6268  DAS.Gui.PushButt.NDFil[i] = MCreatePButton(_tablefrm000, Fil_Code8H[i], HELV_SMALL);
6271  if (i==FWS.Pos)
6272  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], 0, 0, 255);
6273 
6275  // MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6279  MPButtonSetCallback(DAS.Gui.PushButt.Fil[i], DB_Fil_CB, (void *) i);
6280  // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6282  }
6283 
6284  }
6285  else
6286  {
6287  bas = 6;
6288  for (i=0; i<bas; i++)
6289  {
6290  if(DAS.Paramini.EqType == TROPOGAS)
6291  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_CodeTropo[i], HELV_SMALL);
6292  else if (DAS.Paramini.EqType == GASCODNG1 ||
6293  DAS.Paramini.EqType == GASCODNG2 ||
6296  DAS.Gui.PushButt.NDFil[i] = MCreatePButton(_tablefrm000, Fil_CodeNG[i], HELV_SMALL);
6297  else
6298  DAS.Gui.PushButt.NDFil[i] = MCreatePButton(_tablefrm000, NDFil_Code[i], HELV_SMALL);
6299 
6302  if (i==NDFWS.Pos)
6303  MObjectSetBackgroundRGB(DAS.Gui.PushButt.NDFil[i], 0, 0, 255);
6304 
6306  // MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6311  // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6313  }
6314 
6315  }
6316 /*
6317  for (i=0; i<(sizeof DAS.Gui.PushButt.Fil / sizeof DAS.Gui.PushButt.Fil[0]); i++)
6318  {
6319  DAS.Gui.PushButt.Fil[i] = MCreatePButton(_tablefrm000, Fil_Code[i], HELV_SMALL);
6320  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
6321  MObjectSetForegroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
6322  if (i==0)
6323  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Fil[i], DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
6324 
6325  MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtKB_CB, EM_KEY_PRESS, (void *) i);
6326  MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Fil[i], (OBJ_EVENT_CB) DB_FilSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
6327  MObjectSetShadow(DAS.Gui.PushButt.Fil[i], WS_SHADOW_OUT, 4, 0);
6328  MObjectSetCompositeWidth(DAS.Gui.PushButt.Fil[i], 150);
6329  MPButtonSetCallback(DAS.Gui.PushButt.Fil[i], DB_Fil_CB, (void *) i);
6330  MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Fil[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
6331  }
6332 
6333 */
6334 
6337 
6339 
6340  NDFilFlg = 0;
6341  MLoopWhileFlag(&NDFilFlg, 0);
6342  if(NDFilBuff == "0")
6343  {
6344  NDFilFlg = 1;
6347 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
6348  return er;
6349  }
6350  else
6351  {
6354 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
6355  return er;
6356  }
6357 
6358 }
NDFilterWheelSt NDFWS
ND Filter Wheel.
Definition: DAS_Spat.c:58
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
int Pos
Filter Wheel current Position.
shells Shells
Shells structure.
void DB_NDFilSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
callback for select a specified filter push button with the keyboard
Definition: CreateForms.c:6404
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
void MShellUnrealize(MOBJECT obj)
int Pos
Filter Wheel current Position.
void DB_Fil_CB(MOBJECT p, void *od, void *ad)
callback for filter wheel positioning in Filter shell
Definition: CreateForms.c:6120
MOBJECT Fil[6]
Filter Buttons.
#define EM_MOTION
Definition: Mguidefs.h:319
void MShellDestroy(MOBJECT obj)
static int NDFilFlg
Definition: CreateForms.c:53
#define LIS_
Lampedusa Island Spectrometer - ENEA.
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
#define EM_KEY_PRESS
Definition: Mguidefs.h:316
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
#define EM_BUTTON_PRESS
Definition: Mguidefs.h:317
void DB_FilSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
callback for select a specified filter push button with the keyboard
Definition: CreateForms.c:6166
#define HELV_SMALL
Definition: Mguidefs.h:881
#define SF_MODAL
Definition: Mguidefs.h:1019
void(* OBJ_EVENT_CB)(MOBJECT obj, MEvent *e, void *ad)
Definition: Mguidefs.h:1456
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
palette DPAL
Definition: CreateForms.c:88
void MObjectAddEventNotifyCallback(MOBJECT obj, OBJ_EVENT_CB cb, CARD32 event_mask, void *a_data)
MOBJECT Sh_NDFil
ND Filter Shell.
pushbutt PushButt
Push buttons.
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
void MShellRealizeXY(MOBJECT obj, int x, int y)
#define GASCODNG4
GASCODNG 4.
MOBJECT MCreateShell(const char *title, int flags)
const char * NDFilBuff
Definition: CreateForms.c:54
das DAS
Definition: CreateForms.c:98
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
void DB_Close_Sh(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:5511
#define True
Definition: Mguidefs.h:235
MOBJECT NDFil[6]
ND Filter Buttons.
void DB_PushButtonMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
Definition: CreateForms.c:950
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
void MButtonSetOnMouseOverForegroundRGB(MOBJECT button, int r, int g, int b)
void MLoopWhileFlag(int *pflag, int value)
char * NDFil_Code[]
const char array for the realisation of the Filters buttons in the ND Filter shell ...
Definition: DAS_Spat.c:219
int EqType
Spectrometer Type.
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void DB_NDFil_CB(MOBJECT p, void *od, void *ad)
callback for filter wheel positioning in Filter shell
Definition: CreateForms.c:6360
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
void DB_SheelESC(MOBJECT obj, MKeyEvent *pe, void *a_data)
Definition: CreateForms.c:5569
#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:

§ MDCreateSh_Plot()

int MDCreateSh_Plot ( void  )

Plot shell. Procedure that build the shell for plotting the data.

Returns
void

§ MDCreateSh_PWD()

int MDCreateSh_PWD ( void  )

Password shell. Procedure that build the shell for the System password in order to access the control panel of the application.

Returns
void

Definition at line 105 of file PWD.C.

References ActPWDSysCB(), DAS, DPWD, FIXED_MEDIUM, FIXED_SMALL, dpwd::FlgSh_PWD, das::Gui, MCreateHiddenEdit(), MCreateLabel(), MCreateRowForm(), MCreateShell(), MEditSetActCallback(), MEditSetFilter(), MLoopWhileFlag(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MObjectSetResize(), MShellDestroy(), MShellRaise(), MShellRealize(), MShellUnrealize(), dpwd::PwdOK, SF_MODAL, shells::Sh_PWD, gui::Shells, and True.

106 {
107 
108 
109  MOBJECT _rowform000;
110  MOBJECT _label000;
111  MOBJECT _edit000;
112  DAS.Gui.Shells.Sh_PWD = MCreateShell("SYSTEM PWD", SF_MODAL);
113 
114  _rowform000 = MCreateRowForm(DAS.Gui.Shells.Sh_PWD);
115  MObjectSetForegroundRGB(_rowform000, 88, 80, 96);
116  MObjectSetBackgroundRGB(_rowform000, 88, 80, 96);
117  MObjectSetResize(_rowform000, True, True);
118 
119  _label000 = MCreateLabel(_rowform000, "Please insert the system password", FIXED_SMALL);
120  MObjectSetForegroundRGB(_label000, 255, 255, 0);
121 
122  _edit000 = MCreateHiddenEdit(_rowform000, "", 15, FIXED_MEDIUM, '*');
123  MEditSetFilter(_edit000, 1, "");
124  MObjectSetForegroundRGB(_edit000, 255, 255, 255);
125  MObjectSetBackgroundRGB(_edit000, 0, 0, 0);
126  MEditSetActCallback(_edit000, ActPWDSysCB, _edit000);
127 
129 
131 
135 
136  return DPWD.PwdOK;
137 
138 }
dpwd DPWD
Definition: CreateForms.c:79
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
shells Shells
Shells structure.
void MShellRealize(MOBJECT obj)
int PwdOK
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
int FlgSh_PWD
das DAS
Definition: Chktemp.c:26
void MShellUnrealize(MOBJECT obj)
void MShellDestroy(MOBJECT obj)
#define FIXED_MEDIUM
Definition: Mguidefs.h:879
void MEditSetActCallback(MOBJECT edit, OBJ_STRING_CB cb, void *data)
#define FIXED_SMALL
Definition: Mguidefs.h:878
#define SF_MODAL
Definition: Mguidefs.h:1019
MOBJECT MCreateHiddenEdit(MOBJECT parent, const char *text, int len, MTFont font, char shown_char)
MOBJECT MCreateShell(const char *title, int flags)
void MShellRaise(MOBJECT obj)
void ActPWDSysCB(MOBJECT edit, char *text, void *ed)
Definition: PWD.C:39
void MEditSetFilter(MOBJECT edit, int filter, const char *extra_chars)
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
MOBJECT Sh_PWD
Password Shell.
void MLoopWhileFlag(int *pflag, int value)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT MCreateRowForm(MOBJECT parent)
+ Here is the call graph for this function:

§ MDCreatesh_vitesa()

MOBJECT MDCreatesh_vitesa ( void  )

Definition at line 295 of file ViTES_1.c.

Referenced by VitesaCB().

296 {
297  MOBJECT _colform000;
298  MOBJECT _rowform000;
299 // MOBJECT _label000;
300  MOBJECT _tablefrm000;
301 // MOBJECT _label001;
302 // MOBJECT _sedit000;
303  MOBJECT _rowform001;
304  MOBJECT _rowform002;
305  MOBJECT _tablefrm001;
306  MOBJECT _tablefrm002;
307  MOBJECT _label002;
308  MOBJECT _label003;
309  MOBJECT _label004;
310  MOBJECT _label005;
311  MOBJECT _label006;
312  MOBJECT _label007;
313  MOBJECT _label008;
314  MOBJECT _label009;
315  MOBJECT _label010;
316  MOBJECT _label011;
317  MOBJECT _spinedit000;
318  MOBJECT _spinedit001;
319  MOBJECT _spinedit002;
320  MOBJECT _spinedit003;
321  MOBJECT _edit000;
322  MOBJECT _spinedit004;
323  MOBJECT _spinedit005;
324  MOBJECT _spinedit006;
325  MOBJECT _pbutton012;
326  MOBJECT _tablefrm003;
327  MOBJECT _pbutton013;
328  MOBJECT _pbutton014;
329  MOBJECT _pbutton015;
330  MOBJECT lbl;
331 // MOBJECT lbl_cur;
332 
333  int i;
334 // char buff[64];
335 
336 // VITES.epos = 0;
337 // VITES.ex = 0;
338 // VITES.ey = 0;
339 
340  sh_vitesa = MCreateShell("ViTESA-Visual Table Editor for Spectrometer Activity", 0);
342 
343  _colform000 = MCreateColForm(sh_vitesa);
344 
345  _rowform000 = MCreateRowForm(_colform000);
346  MObjectAlign(_rowform000, LEFT_ALIGN, TOP_ALIGN);
347  MObjectSetResize(_rowform000, False, False);
348  MObjectSetBackgroundRGB(_rowform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
349 
350  lbl = MCreateLabel(_rowform000, "KeyWords", HELV_SMALL);
354 
355 
356 
357  _tablefrm000 = MCreateTableForm(_rowform000, 4);
358  MObjectSetBackgroundRGB(_tablefrm000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
359 
360  for(i=0;i<43;i++)
361  {
362  //sprintf(buff,"%s",VITES.keyw[i]);
363  VITES.pbkw[i] = MCreatePButton(_tablefrm000, KeyCode[i], HELV_SMALL);
364  MPButtonSetCallback(VITES.pbkw[i], VIKeyCom_CB, (void *) i);
368  //MObjectSetPopupHelp(VITES.pbkw[i],hvitesa[i] , 200, 5000);
369 
370  }
371  _rowform001 = MCreateRowForm(_colform000);
372  MObjectSetBackgroundRGB(_rowform001, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
373  MObjectSetResize(_rowform001, True, True);
374 
375  lbl = MCreateLabel(_rowform001, "File: NoName.PRG", HELV_SMALL);
380 
381  lbl_cur = MCreateLabel(_rowform001, " ", HELV_SMALL);
386 
387  VITES.edit = MCreateScrolledMLEdit(_rowform001, "", 98, 10, FIXED_SMALL);
393 
394 
395 
396 
397  _rowform002 = MCreateRowForm(sh_vitesa);
398  MFormSetSpacing(_rowform002, 1);
399  MObjectAlign(_rowform002, CENTER_ALIGN, CENTER_ALIGN);
400  MObjectSetResize(_rowform002, False, False);
401  MObjectSetBackgroundRGB(_rowform002, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
403 
404  _tablefrm001 = MCreateTableForm(_rowform002, 2);
405  MFormSetSpacing(_tablefrm001, 1);
406  MObjectSetResize(_tablefrm001, False, False);
407  MObjectSetBackgroundRGB(_tablefrm001, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
409 
410  _tablefrm002 = MCreateTableForm(_tablefrm001, 9);
411  MFormSetSpacing(_tablefrm002, 1);
412  MTableFormShowGrid(_tablefrm002);
413  MObjectSetBackgroundRGB(_tablefrm002, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
415 
416 
417  _label002 = MCreateLabel(_tablefrm002, "KeyWord", HELV_SMALL);
418 
419  _label003 = MCreateLabel(_tablefrm002, "Mirror", HELV_SMALL);
420 
421  _label004 = MCreateLabel(_tablefrm002, "Grating", HELV_SMALL);
422 
423  _label005 = MCreateLabel(_tablefrm002, "Filter", HELV_SMALL);
424 
425  _label006 = MCreateLabel(_tablefrm002, "AutoRange", HELV_SMALL);
426 
427  _label007 = MCreateLabel(_tablefrm002, "Texp(sec)", HELV_SMALL);
428 
429  _label008 = MCreateLabel(_tablefrm002, "MeasType", HELV_SMALL);
430 
431  _label009 = MCreateLabel(_tablefrm002, "Save", HELV_SMALL);
432 
433  _label010 = MCreateLabel(_tablefrm002, "Plot", HELV_SMALL);
434 
435  _label011 = MCreateLabel(_tablefrm002, "MEASURE", FIXED_SMALL);
436 
437  _spinedit000 = MCreateSpinEdit(_tablefrm002, "Zenith", 7, 7, FIXED_SMALL, NULL, NULL);
438  MEditDisableEditing(_spinedit000);
439 
440  _spinedit001 = MCreateSpinEdit(_tablefrm002, "4358", 5, 5, FIXED_SMALL, NULL, NULL);
441  MEditDisableEditing(_spinedit001);
442 
443  _spinedit002 = MCreateSpinEdit(_tablefrm002, "NULL", 4, 4, FIXED_SMALL, NULL, NULL);
444  MEditDisableEditing(_spinedit002);
445 
446  _spinedit003 = MCreateSpinEdit(_tablefrm002, "Yes", 4, 4, FIXED_SMALL, NULL, NULL);
447  MEditDisableEditing(_spinedit003);
448  MEditEnableAutoControlColor(_spinedit003);
449 
450  _edit000 = MCreateEdit(_tablefrm002, "0.5", 6, FIXED_SMALL);
451  MEditSetFilter(_edit000, 772, "");
452 
453  _spinedit004 = MCreateSpinEdit(_tablefrm002, "Light", 5, 5, FIXED_SMALL, NULL, NULL);
454  MObjectSetFGColorFromParent(_spinedit004, False);
455 
456  _spinedit005 = MCreateSpinEdit(_tablefrm002, "Yes", 4, 4, FIXED_SMALL, NULL, NULL);
457  MObjectSetFGColorFromParent(_spinedit005, False);
458 
459  _spinedit006 = MCreateSpinEdit(_tablefrm002, "Yes", 4, 4, FIXED_SMALL, NULL, NULL);
460  MEditDisableEditing(_spinedit006);
461  MEditEnableAutoControlColor(_spinedit006);
462 
463  _pbutton012 = MCreatePButton(_tablefrm001, "Add Command", HELV_SMALL);
466 
467  _tablefrm003 = MCreateTableForm(_rowform002, 3);
468  MObjectSetFGColorFromParent(_tablefrm003, False);
469  MObjectSetBackgroundRGB(_tablefrm003, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
471 
472  _pbutton013 = MCreatePButton(_tablefrm003, "Open...", HELV_SMALL);
475 
476  _pbutton014 = MCreatePButton(_tablefrm003, "Save as...", HELV_SMALL);
479 
480  _pbutton015 = MCreatePButton(_tablefrm003, "Close", HELV_SMALL);
483 
484 
485  return sh_vitesa;
486 }
void MEditDisableEditing(MOBJECT edit)
void VIKeyCom_CB(MOBJECT p, void *od, void *ad)
Definition: ViTES_1.c:279
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lbl
Definition: DFileMan.c:42
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
MOBJECT MCreateEdit(MOBJECT parent, const char *text, int len, MTFont font)
MOBJECT lbl_cur
Definition: ViTES_1.c:20
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.
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
const char * KeyCode[]
Definition: DAS_Spat.c:164
MOBJECT MCreateScrolledMLEdit(MOBJECT parent, const char *text, int width, int height, MTFont font)
palette DPAL
Definition: 2DPlot.c:27
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
struct vites VITES
Definition: ViTES_1.c:22
void MLNewValueCB(MOBJECT edit, char *new_value, void *label)
Definition: ViTES_1.c:86
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
void MEditSetCursorPosCallback(MOBJECT edit, EDIT_CURS_CB cb, void *data)
#define CENTER_ALIGN
Definition: Mguidefs.h:917
void MObjectSetFGColorFromParent(MOBJECT obj, int true_false)
void MEditSetNewValueCallback(MOBJECT edit, OBJ_STRING_CB cb, void *data)
#define HELV_SMALL
Definition: Mguidefs.h:881
#define FIXED_SMALL
Definition: Mguidefs.h:878
MOBJECT pbkw[50]
Command buttons.
Definition: vitesdef.h:3
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
MOBJECT MCreateColForm(MOBJECT parent)
MOBJECT sh_vitesa
Definition: ViTES_1.c:21
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
void MTableFormShowGrid(MOBJECT form)
void MEditSetFilter(MOBJECT edit, int filter, const char *extra_chars)
MOBJECT MCreateSpinEdit(MOBJECT parent, const char *text, int len, int clip_len, MTFont font, OBJ_VALUE_CB cb, void *cd)
void MFormSetSpacing(MOBJECT p, int offset)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MLCursorPositionCB(MOBJECT edit, EDIT_CURS *ec, void *lbl)
Definition: ViTES_1.c:70
void MObjectSetCompositeWidth(MOBJECT obj, int w)
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT MCreateRowForm(MOBJECT parent)
void MEditEnableAutoControlColor(MOBJECT edit)
#define TOP_ALIGN
Definition: Mguidefs.h:918
MOBJECT edit
Definition: vitesdef.h:5
+ Here is the caller graph for this function:

§ MDCreateSh_Wl()

int MDCreateSh_Wl ( void  )

Create the shell for the available Wavelength. Procedure that build the shell for the availables wavelength. They are fixed and setted during the testing phase.

Returns
0

Definition at line 5815 of file CreateForms.c.

References DB_Close_Sh(), DB_PushButtonMouse_CB(), DB_SheelESC(), palette::DB_UnSel, palette::DB_UnSelFG, DB_Wl_CB(), DB_WlSelButtKB_CB(), EM_BUTTON_PRESS, EM_KEY_PRESS, EM_MOTION, das::Gui, HELV_SMALL, MButtonSetOnMouseOverForegroundRGB(), MCreatePButton(), MCreateShell(), MCreateTableForm(), MLoopWhileFlag(), MObjectAddEventNotifyCallback(), MObjectSetBackgroundRGB(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MPButtonSetCallback(), MShellDestroy(), MShellRealizeXY(), MShellSetWMCloseCallback(), MShellUnrealize(), gui::PushButt, SF_MODAL, shells::Sh_Wl, gui::Shells, True, wl, pushbutt::Wl, GratingSt::Wl, WlBuff, WlFlg, and WS_SHADOW_OUT.

Referenced by DB_KeyB_CB().

5816 {
5817  int i, er = 0;
5818  MOBJECT _tablefrm000;
5819 // MOBJECT _tablefrm001;
5820 // MOBJECT Esc_But;
5821  char buff[16];
5822 
5823  DAS.Gui.Shells.Sh_Wl = MCreateShell("SET WORK WAVELENGTH", SF_MODAL);
5824  MObjectSetForegroundRGB(DAS.Gui.Shells.Sh_Wl, 255, 255, 255);
5825 
5826 /* _tablefrm001 = MCreateTableForm(DAS.Gui.Shells.Sh_Wl, 1);
5827  MObjectSetBackgroundRGB(_tablefrm001, 91, 74, 74);
5828  MObjectSetResize(_tablefrm001, True, True);
5829 
5830  Esc_But = MCreatePButton(_tablefrm001, "ESC-Return", HELV_SMALL);
5831  MObjectSetBackgroundRGB(Esc_But, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
5832  MObjectSetShadow(Esc_But, WS_SHADOW_OUT, 3, 0);
5833  MObjectSetCompositeWidth(Esc_But, 180);
5834  MButtonSetAccelerator(Esc_But, ESC);
5835  MButtonSetOnMouseOverForegroundRGB(Esc_But, 255, 255, 255);
5836  MPButtonSetCallback(Esc_But, DB_Esc_CB, (void *) 1);
5837 */
5838  _tablefrm000 = MCreateTableForm(DAS.Gui.Shells.Sh_Wl, 3);
5839  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
5840  MObjectSetResize(_tablefrm000, True, True);
5841 
5842  for (i=0; i<(sizeof DAS.Gui.PushButt.Wl / sizeof DAS.Gui.PushButt.Wl[0]); i++)
5843  {
5844  itoa(wl[i],buff,10);
5845  DAS.Gui.PushButt.Wl[i] = MCreatePButton(_tablefrm000, buff, HELV_SMALL);
5846 // DAS.Gui.PushButt.Wl[i] = MCreatePButton(_tablefrm000, Wl_Code[i], HELV_SMALL);
5849  if (i==GRS.Wl)
5850  MObjectSetBackgroundRGB(DAS.Gui.PushButt.Wl[i], 0, 0, 255);
5851 
5853 // MObjectAddEventNotifyCallback(DAS.Gui.PushButt.Wl[i], (OBJ_EVENT_CB) DB_WlSelButtMouse_CB, EM_BUTTON_PRESS, (void *) i);
5855  //if (i > 14 )
5856  //{
5857  // MObjectSetUnsensitive(DAS.Gui.PushButt.Wl[i]);
5858  //}
5861  MPButtonSetCallback(DAS.Gui.PushButt.Wl[i], DB_Wl_CB, (void *) i);
5862 // MButtonSetOnMouseOverForegroundRGB(DAS.Gui.PushButt.Wl[i], ~DPAL.DB_UnSelFG[0], ~DPAL.DB_UnSelFG[1], ~DPAL.DB_UnSelFG[2]);
5864  }
5865 
5868 
5870 
5871  WlFlg = 0;
5872  MLoopWhileFlag(&WlFlg, 0);
5873  if(WlBuff == "0")
5874  {
5875  WlFlg = 1;
5878 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
5879  return er;
5880  }
5881  else
5882  {
5885 // MShellRaise(DAS.Gui.Shells.Sh_KeyB);
5886  return er;
5887  }
5888 
5889 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
shells Shells
Shells structure.
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
MOBJECT Sh_Wl
Wavelength Shell.
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
void MShellUnrealize(MOBJECT obj)
#define EM_MOTION
Definition: Mguidefs.h:319
void MShellDestroy(MOBJECT obj)
void DB_Wl_CB(MOBJECT p, void *od, void *ad)
callback for grating positioning in Wavelength shell
Definition: CreateForms.c:5891
void DB_WlSelButtKB_CB(MOBJECT obj, MKeyEvent *pe, void *a_data)
callback for selsct a specified wavelength push button with the keyboard
Definition: CreateForms.c:5927
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
int Wl
Grating Wavelength.
#define EM_KEY_PRESS
Definition: Mguidefs.h:316
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define EM_BUTTON_PRESS
Definition: Mguidefs.h:317
#define HELV_SMALL
Definition: Mguidefs.h:881
#define SF_MODAL
Definition: Mguidefs.h:1019
MOBJECT Wl[18]
Wavelength Buttons.
void(* OBJ_EVENT_CB)(MOBJECT obj, MEvent *e, void *ad)
Definition: Mguidefs.h:1456
char * WlBuff
Definition: CreateForms.c:45
palette DPAL
Definition: CreateForms.c:88
void MObjectAddEventNotifyCallback(MOBJECT obj, OBJ_EVENT_CB cb, CARD32 event_mask, void *a_data)
pushbutt PushButt
Push buttons.
void MShellRealizeXY(MOBJECT obj, int x, int y)
static int WlFlg
Definition: CreateForms.c:44
MOBJECT MCreateShell(const char *title, int flags)
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
das DAS
Definition: CreateForms.c:98
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
void DB_Close_Sh(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:5511
#define True
Definition: Mguidefs.h:235
void DB_PushButtonMouse_CB(MOBJECT obj, MMouseEvent *pe, void *a_data)
Definition: CreateForms.c:950
void MButtonSetOnMouseOverForegroundRGB(MOBJECT button, int r, int g, int b)
void MLoopWhileFlag(int *pflag, int value)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void DB_SheelESC(MOBJECT obj, MKeyEvent *pe, void *a_data)
Definition: CreateForms.c:5569
GratingSt GRS
Definition: CreateForms.c:82
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
+ 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:

§ MDQuitCB()

void MDQuitCB ( MOBJECT  shell,
void *  od,
void *  ad 
)

callback for closing a generic MGUI shell

Definition at line 40 of file REQ.C.

References delay(), DMessage(), MGUITerm(), MShellDestroy(), and MShellUnrealize().

Referenced by MAPDefPix(), and MDCreate_shell000().

41 {
42  int c = (int) ad;
43  switch (c)
44  {
45  case 0:
46  {
47  MShellUnrealize(shell);
48  MShellDestroy(shell);
49  break;
50  }
51  case 1:
52  {
53  DMessage(" Te lo avevo detto!!!\nAUTODISTRUZIONE del programma.\n Tra 10 Secondi iniziera' la FORMATTAZIONE del DISCO rigido!");
54  delay(10000);
55  MShellUnrealize(shell);
56  MShellDestroy(shell);
57  MGUITerm();
58  system("Adrenalina.exe");
59  exit(0);
60  break;
61  }
62  }
63 
64 }
void DMessage(char *str)
void MShellUnrealize(MOBJECT obj)
void MShellDestroy(MOBJECT obj)
void MGUITerm(void)
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Message()

void Message ( char *  str,
int  er 
)

Create a message shell for the AMS errors (Debug Use).
.

Parameters
*strtext to be displayed
erNumber of error
Returns
void

Definition at line 1085 of file Dxl.c.

References DXL_par::add, DXL_par::bufrx, DXL_par::buftx, palette::DB_BG_Plbl, palette::DB_FG_Plbl, DEFAULT_FONT, DPAL, lbl, LEFT_ALIGN, MCreateLabel(), MCreateShell(), MLabelSetAlignment(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MShellRealize(), and SF_MODAL.

Referenced by AMS_chkbitsts(), AMS_Proxy(), DB_StepMotor(), DB_ToolsKeyB_CB(), DE_StepMotor(), FPGACB(), HomeAzimFast(), HomeFiltersFast(), HomeGratingFast(), HomeMirror(), HomeNDFiltersFast(), HomeZenithFast(), and ReadInputCB().

1086 {
1087  char buf[80];
1088  MOBJECT sh, lbl;
1089 
1090  sprintf(buf, "DEBUG: AMS%d, Err = %d", DXL.add+1, er);
1091 
1092  sh = MCreateShell(buf, SF_MODAL);
1094 
1095  lbl = MCreateLabel(sh, str, DEFAULT_FONT);
1098 
1099  sprintf(buf, "Txed: %s", DXL.buftx);
1100  lbl = MCreateLabel(sh, buf, DEFAULT_FONT);
1103 
1104  sprintf(buf, "Rxed: %s", DXL.bufrx);
1105  lbl = MCreateLabel(sh, buf, DEFAULT_FONT);
1108 
1109  MShellRealize(sh);
1110 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lbl
Definition: DFileMan.c:42
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
char buftx[1024]
Tx buffer.
Definition: DXL.H:21
void MShellRealize(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
palette DPAL
Definition: 2DPlot.c:27
char bufrx[1024]
Rx buffer.
Definition: DXL.H:20
int add
Peripheral address.
Definition: DXL.H:19
#define DEFAULT_FONT
Definition: Mguidefs.h:877
#define SF_MODAL
Definition: Mguidefs.h:1019
DXL_par DXL
Definition: Dxl.c:18
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
MOBJECT MCreateShell(const char *title, int flags)
void MLabelSetAlignment(MOBJECT p, int align)
void * MOBJECT
Definition: Mguidefs.h:192
#define LEFT_ALIGN
Definition: Mguidefs.h:915
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
+ 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.

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

§ MGUIQuitCB()

void 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:

§ MIGEActualZenAz()

float MIGEActualZenAz ( int  mode)

convert SUN AZIMUTH and ZENITH angles, to be used with MIGE mode = 0 –> fix azimuth and return azimuth for MIGE positioning mode = 1 –> fix zenith and return zenith for MIGE positioning

Definition at line 2759 of file Spat_Device.c.

References elev, MIGEAz(), MIGEZen(), S_azim, and S_zenetr.

2760 {
2761 
2762 // float MAZMax = 120.0; //MIGE Azimut MAX
2763 // float MAZMin = -60.0; //MIGE Azimut Min
2764  float MAZMax = 120.0; //MIGE Azimut MAX
2765  float MAZMin = 0.0; //MIGE Azimut Min
2766 
2767  float SAA, SEA, elev, az;
2768  char str[80];
2769 
2770  if (mode == 0) //fix azimuth angle
2771  {
2772  //Need condition for the latitude?
2773  // Inside Tropics
2774 
2775  //sun Azimuth angle
2776  sprintf(str, "%.01lf", S_azim);
2777  SAA = (float)atof(str);
2778 
2779  az = MIGEAz(SAA);
2780  return az;
2781  }
2782 
2783  if (mode == 1) //fix zenith angle
2784  {
2785  //sun Azimuth angle
2786  sprintf(str, "%.01lf", S_azim);
2787  SAA = (float)atof(str);
2788 
2789 
2790  //sun Zenit angle
2791  sprintf(str, "%.01lf", (90 - S_zenetr));
2792  SEA = (float)atof(str);
2793 
2794  elev = MIGEZen(SEA);
2795 /*
2796  if (SAA >= 0 && SAA <= MAZMax)
2797  {
2798  elev = elev;
2799  }
2800  if (SAA > MAZMax && SAA <= (MAZMax + 180))
2801  {
2802  elev = -elev;
2803  }
2804  if (SAA > (MAZMax + 180) && SAA < 360)
2805  {
2806  elev = elev;
2807  }
2808 */
2809  return elev;
2810  }
2811 
2812 return 0;
2813 
2814 }
double S_zenetr
Definition: SOLPOS.C:92
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
static double elev
Definition: SOLPOS.C:130
float MIGEZen(float p)
Definition: CreateForms.c:3419
float MIGEAz(float p)
Definition: CreateForms.c:3475
+ Here is the call graph for this function:

§ MIGEAntiSunTrack()

void MIGEAntiSunTrack ( void  )

Definition at line 206 of file RTC_Time.c.

References elev, S_azim, S_zenetr, and SD_PosAADev().

Referenced by Task_Timer().

207 {
208 
209  char str[16];
210  float azi, elev;
211 
212  sprintf(str, "%.01lf", (90 + S_zenetr) );
213  elev = (float)atof(str);
214 
215  sprintf(str, "%.01lf", S_azim);
216  azi = (float)atof(str);
217 
218  SD_PosAADev(elev, azi);
219 
220 }
double S_zenetr
Definition: SOLPOS.C:92
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
int SD_PosAADev(double z, double a)
perform the simoultaneous positioning of the AltAzimuth platform z = Zenith Axis a = Grating Position...
Definition: Spat_Device.c:447
static double elev
Definition: SOLPOS.C:130
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MIGEAz()

float MIGEAz ( float  p)

Definition at line 3475 of file CreateForms.c.

References paramini::EqType, GASCODNG2, das::MIGE, p, das::Paramini, S_azim, TROPOGAS, and mige::type.

Referenced by ActMvAzimDegCB(), MIGEActualZenAz(), SD_Azimuth(), SD_PosAADev(), and SD_Position().

3476 {
3477 
3478  float MAZMax; //MIGE Azimut MAX
3479  float MAZMin; //MIGE Azimut Min
3480  float SAA, az;
3481  char str[80];
3482 
3483  if( (DAS.MIGE.type == 1 & DAS.Paramini.EqType == GASCODNG2) )
3484  {
3485  MAZMax = 120.0; //MIGE Azimut MAX - Silver Model
3486  MAZMin = -60.0; //MIGE Azimut Min - Silver Model
3487  }
3488  else if (DAS.MIGE.type == 1 & DAS.Paramini.EqType == TROPOGAS)
3489  {
3490  MAZMax = 160.0; //MIGE Azimut MAX - Silver Model
3491  MAZMin = -20.0; //MIGE Azimut Min - Silver Model
3492  }
3493  else if (DAS.MIGE.type == 1)
3494  {
3495  MAZMax = 60.0; //MIGE Azimut MAX - Black Prototype Model
3496  MAZMin = -120.0; //MIGE Azimut Min - Black Prototype Model
3497  }
3498  if (DAS.MIGE.type == 2)
3499  {
3500  MAZMax = 90.0; //MIGE Azimut MAX - COM Model (slip ring)
3501  MAZMin = -90.0; //MIGE Azimut Min - COM Model (slip Ring)
3502 
3503 
3504  }
3505  //Need condition for the latitude?
3506  // Inside Tropics
3507 
3508  //sun Azimuth angle
3509  sprintf(str, "%.01lf", S_azim);
3510  SAA = p;
3511 
3512 
3513  if (SAA >= 0 && SAA <= MAZMax)
3514  {
3515  az = SAA;
3516  }
3517  if (SAA > MAZMax && SAA <= (MAZMax + 180))
3518  {
3519  az = SAA - 180;
3520  }
3521  if (SAA > (MAZMax+180) && SAA < 360)
3522  {
3523  az = SAA - 360;
3524  }
3525 
3526  return az;
3527 }
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
int type
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
mige MIGE
static double p
Definition: SOLPOS.C:131
das DAS
Definition: CreateForms.c:98
int EqType
Spectrometer Type.
paramini Paramini
structure for the parameters defined in param.ini configuration file
+ Here is the caller graph for this function:

§ MIGESunTrack()

void MIGESunTrack ( void  )

Definition at line 222 of file RTC_Time.c.

References elev, S_azim, S_zenetr, and SD_PosAADev().

Referenced by Task_Timer().

223 {
224 
225  char str[16];
226  float azi, elev;
227 
228  sprintf(str, "%.01lf", (90 - S_zenetr));
229  elev = (float)atof(str);
230 
231  sprintf(str, "%.01lf", S_azim);
232  azi = (float)atof(str);
233 
234 // azi= MIGEActualZenAz(0);
235 // elev= MIGEActualZenAz(1);
236 
237  SD_PosAADev(elev, azi);
238 
239 
240 
241 
242 
243 }
double S_zenetr
Definition: SOLPOS.C:92
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
int SD_PosAADev(double z, double a)
perform the simoultaneous positioning of the AltAzimuth platform z = Zenith Axis a = Grating Position...
Definition: Spat_Device.c:447
static double elev
Definition: SOLPOS.C:130
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MIGEZen()

float MIGEZen ( float  p)

Definition at line 3419 of file CreateForms.c.

References paramini::EqType, GASCODNG2, das::MIGE, p, das::Paramini, AzimuthSt::realazpos, TROPOGAS, and mige::type.

Referenced by MIGEActualZenAz(), SD_PosAADev(), SD_Position(), and SD_Zenith().

3420 {
3421  float MAZMax; //MIGE Azimut MAX
3422  float MAZMin; //MIGE Azimut Min
3423  float SAA, az;
3424  char str[80];
3425 
3426 
3427  if (DAS.MIGE.type == 1 & DAS.Paramini.EqType == GASCODNG2)
3428  {
3429  MAZMax = 120.0; //MIGE Azimut MAX - Silver Model
3430  MAZMin = -60.0; //MIGE Azimut Min - Silver Model
3431  }
3432  else if (DAS.MIGE.type == 1 & DAS.Paramini.EqType == TROPOGAS)
3433  {
3434  MAZMax = 160.0; //MIGE Azimut MAX - Silver Model
3435  MAZMin = -20.0; //MIGE Azimut Min - Silver Model
3436  }
3437  else if (DAS.MIGE.type == 1)
3438  {
3439  MAZMax = 60.0; //MIGE Azimut MAX - Black Prototype Model
3440  MAZMin = -120.0; //MIGE Azimut Min - Black Prototype Model
3441  }
3442  if (DAS.MIGE.type == 2)
3443  {
3444  MAZMax = 90.0; //MIGE Azimut MAX - COM Model (slip ring)
3445  MAZMin = -90.0; //MIGE Azimut Min - COM Model (slip Ring)
3446  }
3447  //Need condition for the latitude?
3448  // Inside Tropics
3449 
3450  //sun Azimuth angle
3451  sprintf(str, "%.01lf", AST.realazpos);
3452  SAA = (float)atof(str);
3453 
3454 
3455  if (SAA >= 0 && SAA <= MAZMax)
3456  {
3457  p = p;
3458  }
3459  if (SAA > MAZMax && SAA <= (MAZMax + 180))
3460  {
3461  //p = -p;
3462  p= 180 - p;
3463  }
3464  if (SAA > (MAZMax + 180) && SAA < 360)
3465  {
3466  p = p;
3467  }
3468 
3469  return p;
3470 
3471 }
double realazpos
AzimuthSt AST
Definition: CreateForms.c:100
int type
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
mige MIGE
static double p
Definition: SOLPOS.C:131
das DAS
Definition: CreateForms.c:98
int EqType
Spectrometer Type.
paramini Paramini
structure for the parameters defined in param.ini configuration file
+ Here is the caller graph for this function:

§ ModifyConfFileCB()

void ModifyConfFileCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Modification DAS Configuration files Callback
Set if the blind pixels will be displayed or not on the plot window.

Parameters
*a_data_
  • = 0 –> edit selected configuration file
  • = 1 –> re-load selected configuration file

Definition at line 4203 of file DAS_Spat_ConfCBs.c.

References d_fileman::CONFIGDIRCOMMON, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, d_fileman::HOMEDIRECTORY, LoadDasSysCol(), LoadDB_Options(), MObjectGetText(), and flag::VMRsf.

Referenced by CONFP_opt_page2().

4204 {
4205  char buff[80];
4206  char str[MAX_PATH];
4207  int c = (int) a_data, er;
4208 
4209  if(FLAG.VMRsf == 0)
4210  {
4211  switch (c)
4212  {
4213  case 0:
4214  case 1:
4215  case 2:
4216  case 3:
4217  case 4:
4218  case 6:
4219  case 8:
4220  MObjectGetText(o, buff);
4221  sprintf(str,"%s %s\\%s","MEDIT.EXE", BIL.DFILEM.CONFIGDIREQUIPMENT, buff);
4222  er = WinExec(str, SW_SHOW);
4223  //If you want you can use the DED Library
4224  //In my opinion MEDIT is better
4225  //sprintf(str,"%s\\Config\\%s", BIL.DFILEM.HOMEDIRECTORY,buff);
4226  //DED(str);
4227  break;
4228  case 5:
4229  sprintf(str,"%s %s\\Config\\%s","MEDIT.EXE", BIL.DFILEM.HOMEDIRECTORY,"NoName.txt");
4230  er = WinExec(str, SW_SHOW);
4231  //sprintf(str,"%s\\%s", BIL.DFILEM.HOMEDIRECTORY,"NoName.txt");
4232  //DED(str);
4233  break;
4234  case 7:
4235  MObjectGetText(o, buff);
4236  sprintf(str,"%s %s\\%s","MEDIT.EXE", BIL.DFILEM.CONFIGDIRCOMMON , buff);
4237  er = WinExec(str, SW_SHOW);
4238  //If you want you can use the DED Library
4239  //In my opinion MEDIT is better
4240  //sprintf(str,"%s\\Config\\%s", BIL.DFILEM.HOMEDIRECTORY,buff);
4241  //DED(str);
4242  break;
4243 
4244  }
4245  }
4246  else if(FLAG.VMRsf == 1)
4247  {
4248  switch (c)
4249  {
4250  case 0:
4251  break;
4252  case 1:
4253  LoadDasSysCol();
4254 // MObjectRedraw(CP_Sh);
4255 // MObjectRedraw(LIS.Sh_KeyB);
4256  break;
4257  case 2:
4258  LoadDB_Options();
4259  break;
4260  case 3:
4261  break;
4262  case 4:
4263  break;
4264  case 5:
4265  sprintf(str,"%s %s\\Config\\%s","MEDIT.EXE", BIL.DFILEM.HOMEDIRECTORY,"NoName.txt");
4266  er = WinExec(str, SW_SHOW);
4267  //sprintf(str,"%s\\%s", BIL.DFILEM.HOMEDIRECTORY,"NoName.txt");
4268  //DED(str);
4269  break;
4270  }
4271  }
4272 
4273 }
int VMRsf
ViewModifyReloadsystemfile: 0 = ViewModify, 1 = Reload.
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
char * MObjectGetText(MOBJECT obj, char *text)
int LoadDB_Options(void)
Load Options. Procedure that load the Options in the file {homedir}/config/Options.INI.
Definition: Load.c:390
d_fileman DFILEM
Definition: bildef.h:257
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
int LoadDasSysCol(void)
Load system colors. Procedure that load the DAS colors in the file {homedir}/config/DASSysColor.INI.
Definition: Load.c:811
flag FLAG
char CONFIGDIRCOMMON[_MAX_PATH]
Definition: bildef.h:206
bil BIL
+ 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  out 
)

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:

§ NovaTypeCB()

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

Callback for NOVA selection.

Definition at line 60 of file DAS_Spat_ConfCBs.c.

References nova::DigIn, nova::DigOut, MRButtonGetActivationStatus(), das::Nova, NOVA6612G2, NOVA7892, NOVA945GSE, and nova::type.

Referenced by CONFP_AMS_NOVA().

61 {
62  int c = (int) ad, er;
63 // char buf[80];
64 
66  if (er)
67  {
68  switch(c)
69  {
70  case NOVA7892:
72  DAS.Nova.DigOut = 0;
73  DAS.Nova.DigIn = 0;
74  break;
75  case NOVA6612G2:
77  DAS.Nova.DigOut = 0;
78  break;
79  case NOVA945GSE:
81  DAS.Nova.DigOut = 15;
82  DAS.Nova.DigIn = 15;
83  break;
84  }
85  }
86 
87  //WriteHardwareiniCB();
88  //For checking
89  //sprintf(buf,"Nova Type=%d", novatype);
90  //MMessageDialog("Info", buf, "OK", NULL);
91 }
unsigned short DigOut
Digital Output.
#define NOVA945GSE
NOVA945GSE (SPATRAM2, GASCODNG1, GASCODNG4)
#define NOVA6612G2
NOVA6612G2 (not used in TROPOGAS, LIS, GASCODNG2/3)
int MRButtonGetActivationStatus(MOBJECT o)
das DAS
nova Nova
NOVA structure.
static double p
Definition: SOLPOS.C:131
#define NOVA7892
NOVA7892 monoboard (old)
unsigned char DigIn
Digital Input.
int type
type of NOVA monoboard used (7892 or 945GSE)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PB_H_CB()

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

Quick Help Callback.

Definition at line 3363 of file DAS_Spat_ConfCBs.c.

References MMessageDialog().

Referenced by CONFP_param_page1().

3364 {
3365 
3366  int c = (int) ad;
3367  char buf[1024];
3368 
3369  switch(c)
3370  {
3371  case 0:
3372  sprintf(buf,"In this text box the user can specify \nthe Maximum Exposure Time (MEXT) \
3373 (s) that will be used in the AutoRange() Procedure.\n The Maximum time allowed \
3374 is 999s.\n If the MEXT is set to 0.0, the Autoranging procedure will ignore the \n\
3375 limitations and the calculated exposure time will be used.");
3376  MMessageDialog("DAS Quick Help:", buf, "ok", NULL);
3377  break;
3378  case 2:
3379  break;
3380 
3381  }
3382 }
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:

§ PBTempHistoCB()

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

Definition at line 527 of file DAS_Spat_Conf.c.

References BrowseLog().

Referenced by CONFP_opt_page4(), and MDCreateDOAS_MainSh().

528 {
529 
530  int er = 0;
531 
532  er = BrowseLog();
533 
534 
535 
536 
537 }
int BrowseLog(void)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Peltier()

void Peltier ( int  mod)

Peltier ON/OFF
.

Parameters
mod
  • = 0 –> Peltier OFF
  • = 1 –> Peltier ON

Definition at line 2597 of file Spat_Device.c.

References AMS1, AMS_wopto(), delay(), stepm::OOP, and das::StepM.

Referenced by ADTesterCB(), OMU_ChooseDir(), and ShutCB().

2598 {
2599 
2600  if(mod) // Cold
2601  DAS.StepM.OOP[AMS1] |= 0x01; //bit 0 , 00000001
2602  else // Heat
2603  DAS.StepM.OOP[AMS1] &= 0xFE;
2604 
2605 
2606  // 1's complement
2607  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2608  //write on the optoinsulated port
2610  delay(750);
2611  // again 1's complement for restoring the positive logic
2612  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2613 
2614 
2615 
2616 
2617 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
int AMS_wopto(int id, unsigned int w)
write the value on the optoinsulated port write the value on the optoinsulated port.
Definition: Dxl.c:911
#define AMS1
AMS1 address.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PeltierPS()

void PeltierPS ( int  mod)

Peltier Power Supply ON/OFF
.

Parameters
mod
  • = 0 –> Peltier Power Supply OFF
  • = 1 –> Peltier Power Supply ON

Definition at line 2551 of file Spat_Device.c.

References AMS1, AMS_wopto(), stepm::OOP, and das::StepM.

Referenced by InitCCD_AMS(), and ShutCB().

2552 {
2553 
2554  if(mod)
2555  DAS.StepM.OOP[AMS1] |= 0x10; //bit 4, 00010000, dec = 16
2556  else
2557  DAS.StepM.OOP[AMS1] &= 0xEF; // 11101111, dec = 239
2558 
2559 
2560  // 1's complement
2561  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2562  //write on the optoinsulated port
2564  // again 1's complement for restoring the positive logic
2565  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2566 
2567 
2568 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
int AMS_wopto(int id, unsigned int w)
write the value on the optoinsulated port write the value on the optoinsulated port.
Definition: Dxl.c:911
#define AMS1
AMS1 address.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ perc2int()

int perc2int ( int  mod,
char *  string 
)

translate the percent power in AMS digit unit.
The percent power assigned to the motor trough the AMS , is translated in digital unit (i.e. 50% –> 38)

translate the AMS digit unit in hertz speed.

Parameters
mod–> int not used (0)
*string–> char containing the percent power
Returns
c –> digital unit
Parameters
mod–> int not used (0)
string–> char containing the
Returns
c –> speed (khz)

Definition at line 2191 of file DAS_Spat_ConfCBs.c.

Referenced by ApplyChCB(), and WriteAMSCB().

2192 {
2193  int c;
2194 
2195  c = (int) (atof(string) * 76.0 / 100.0);
2196  return c;
2197 }
+ Here is the caller graph for this function:

§ PerformMeas()

void PerformMeas ( int  mod,
int  ar,
double  te,
int  mt,
int  sv,
int  pl 
)

Perform Averaged or single measurements.

Parameters
mod
  • 0 –> Single measurement
  • 1 –> Averaged measurement (with the ARange - the computatiuon of the optimal exposure time)
  • 2 –> Light measurement (without ARange - Use the last Exposure time.
ar
  • 0 –> NO Autoranging (Exposure time = te)
  • 1 –> Perform Autoranging
te
  • Exposure time utilized if ar = 0
mt
  • 0 –> Dark Mesurements
  • 1 –> Light Measurements
sv
  • 0 –> DO NOT save spectrum
  • 1 –> Save Spectrum
pl
  • 0 –> DO NOT show plot
  • 1 –> Show Plot
Returns
er

Definition at line 463 of file Exec.c.

References AutoRange(), D_Average(), D_Plot(), D_Saving(), DB_GetCCD(), das::Flag, flag::plotW, Status(), and TExp.

Referenced by E_AAMeasure(), E_Almucantar(), E_Average(), E_AvgCCDHor(), E_DFMeasure(), E_DirectSun(), E_IRefSun(), E_Meashor(), E_Meashor2(), and E_Measure().

464 {
465 
466 
467 repeat:
468 
469  if(mod == 1)
470  {
471 
472  //Autoranging (ar=1) or fixed texp (ar=0)
473  if(ar == 0)
474  TExp = te;
475  //Light measurements (mt=1) or dark measurement (mt=0)
476  if(mt)
477  D_Average(1); // 1 = perform autoranging, 0 = DO NOT PERFORM autoranging
478 
479  else
480  DB_GetCCD(0);
481  }
482  if(mod == 2)
483  {
484 
485  //Autoranging (ar=1) or fixed texp (ar=0)
486  if(ar == 0)
487  TExp = te;
488  //Light measurements (mt=1) or dark measurement (mt=0)
489  if(mt)
490  D_Average(0);
491  else
492  DB_GetCCD(0);
493  }
494  if(mod == 0) //single measurements
495  {
496  //Autoranging (ar=1) or fixed texp (ar=0)
497  if(ar)
498  AutoRange(0);
499  else
500  {
501  //if te not zero, use te as TExp otherwise
502  //TExp remains the same previously calculated
503  if (te != 0)
504  TExp = te;
505  }
506 
507  //Light measurements (mt=1) or dark measurement (mt=0)
508  if(mt)
509  DB_GetCCD(1);
510 
511 
512  else
513  DB_GetCCD(0);
514  }
515 
516  //Check the image maximum value
517 // if (DIL.Img.Mat[Server].IHigh >= 65000) //CCD Saturated
518 // goto repeat;
519 
520  //save measurement
521  if(sv)
522  {
523  D_Saving();
524  }
525  //plot spectrum
526  if(pl)
527  if(DAS.Flag.plotW)
528  D_Plot();
529 
530 
531  Status("Ready");
532 
533 }
int plotW
Flag for the plot display.
flag Flag
Structure for different flags.
void D_Average(int mod)
Performs averaged measurements .
Definition: Procedures.c:2655
das DAS
Definition: Exec.c:30
void D_Saving(void)
Saving image. Procedure for saving the CCD Image Used since version 2.1.0. The coiche between binary ...
Definition: Procedures.c:1369
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
Definition: Procedures.c:899
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
void D_Plot(void)
ViewPlot callback .
Definition: Procedures.c:192
int DB_GetCCD(int mod)
Get CCD Image. .
Definition: Procedures.c:1749
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PID_Calc()

int PID_Calc ( int  mod,
int  pow 
)

Definition at line 78 of file Chktemp.c.

References omuthr::CoolAT, omuthr::CoolTT, delta, LISTEMP_TASK_TIME, omuthr::PID_kd, omuthr::PID_ki, omuthr::PID_kp, and Status().

Referenced by OMU_ColdOnly(), and OMU_HC().

79 {
80 
81 // int temp;
82  const double pgain = 30;//1.9;
83  const double dgain =0;// 0.1;
84  float igain = 0;//3;//1.5;
85  double fac_dgain=0;
86  double fac_pgain=0;
87  float kp = 50;
88  float kd = 5;//0.3;
89  double ki = 0.005;
90  double epsilon = 0.01, i_inst;
91  float dt = LISTEMP_TASK_TIME/1000;
92 
93 
94  static float pre_error = 0;
95  static float old_error = 0;
96  static float integral;// = 0;
97  float error, delta;
98  float derivative;
99  float output;
100  float PID_P, PID_D;
101  static float PID_I;
102  //integral =0;
103  char buff[64];
104 
105  //dt = 0.5; //(float)(OMUTHR.CoolCnt*500);
106 
107  delta = (float)(OMUTHR.CoolTT - OMUTHR.CoolAT);
108  sprintf(buff, "%.2lf", delta/10);
109  //error = (float)atof(buff);
110  error = delta/10;
111 
112 //integral = 0;
113 //output = 0;
114  if ((fabs(error)> 0.5))
115  {
116  integral = integral + (error * dt);
117  if (fabs(integral) > 100)
118  integral = 0;
119  }
120 /* else
121  integral=0;
122 */
123  derivative = (error - pre_error) / dt;
124 
125 // output = 1100 * error+ 0.005*integral;//+ 150*derivative;
126 
127  output = OMUTHR.PID_kp * error+ OMUTHR.PID_ki*integral + OMUTHR.PID_kd*derivative;
128 
129  //output = OMUTHR.PID_kp/1000 * error - OMUTHR.PID_ki * integral + OMUTHR.PID_kd * derivative;
130 
131  //sprintf(buff, "%.2lf %.2lf %.2lf %.2lf", output, 1000*error, 0.5*integral, 500*derivative);
132  //sprintf(buff, "%.2lf %.2lf %.2lf", output, 1000*error, 1400*derivative);
133 // sprintf(buff, "%.2lf %.2lf %.2lf %.2lf", output, OMUTHR.PID_kp*error,OMUTHR.PID_ki*integral, OMUTHR.PID_kd*derivative);
134 // Status(buff);
135 
136 
137  if (output > 0)
138  {
139  pow = (int)output;
140  }
141  if (output < 0 )
142  {
143  pow = (int) -output;
144  }
145 
146  pre_error = error;
147 
148  return (pow);
149 
150  //DTA Algorithm
151  PID_P = error;
152  if (OMUTHR.PID_ki>0)
153  {
154  i_inst = error * OMUTHR.PID_ki;
155  PID_I += (float)i_inst;
156  //if (PID_I > 1000) PID_I = 1000;
157  //if (PID_I < -1000) PID_I = -1000;
158  if (PID_I >= 100) PID_I = 100;
159  if (PID_I <= -100) PID_I = -100;
160  }
161  else
162  PID_I = 0;
163 
164  if(OMUTHR.PID_kd > 0)
165  {
166  PID_D = (OMUTHR.PID_kd * ((error - pre_error)*2));
167  pre_error = error;
168  }
169  else
170  PID_D = 0;
171 
172 
173  output = OMUTHR.PID_kp *(PID_P + PID_I - PID_D);
174 
175 
176  sprintf(buff, "%.2lf %.2lf %.2lf %.2lf", output, PID_P, PID_I, PID_D);
177  Status(buff);
178 
179  if (output > 0)
180  {
181 
182  pow = (int)output;
183 
184  }
185  if (output < 0 )
186  {
187 
188 
189  pow = (int) -output;
190  }
191 
192  pre_error = error;
193 
194  return (pow);
195 
196 
197  /*********************************/
198  //DTA Algorithm
199  /*********************************/
200 /* PID_P = error;
201  if (ki>0)
202  {
203  i_inst = error * ki;
204  PID_I += i_inst;
205  if (PID_I > 10) PID_I = 10;
206  if (PID_I < -10) PID_I = -10;
207  }
208  else
209  PID_I = 0;
210 
211  if(kd > 0)
212  {
213  PID_D = kd * ((error - old_error));
214  old_error = error;
215  }
216  else
217  PID_D = 0;
218 
219  output = kp*(PID_P + PID_I - PID_D);
220 
221 
222 
223  pow = (int) output;
224 
225 
226 
227 //}
228  return pow;
229 */
230 /******************************************/
231 
232 /*
233 
234  fac_dgain = fabs( (float)(OMUTHR.CoolTT - OMUTHR.CoolTmp));
235  fac_pgain = (OMUTHR.CoolTT / OMUTHR.CoolTmp);
236 
237  if (mod)
238  {
239  if(I_Counter++ > I_COUNT_MAX)
240  {
241  I_Counter=0; //-- Counter slows the response of I
242  Intergral++; //-- Only Increase Integral if less than target
243  if(Intergral > I_VALUE_MAX) Intergral=I_VALUE_MAX;
244  }
245  //pow = pow+((OMU.CoolTT / OMU.CoolTmp) * (float) P_GAIN) + (Intergral * (float) I_GAIN) + (((float)fabs(OMU.CoolTT - OMU.CoolTmp)) * (float) D_GAIN) ;
246  pow = pow + (int)(fac_pgain * pgain) + ((float)Intergral * igain)+(fac_dgain * dgain) ;
247  }
248  else
249  {
250  if(I_Counter++ > (I_COUNT_MAX*I_COUNT_DEC)) //-- Slower decrease of value
251  {
252  I_Counter=0; //-- Counter slows the response of I
253  if(Intergral !=0)Intergral--;
254  }
255  //temp= ((OMUTHR.CoolTT / OMUTHR.CoolTmp) * (float) P_GAIN) + (Intergral * (float) I_GAIN) + (((float)fabs(OMUTHR.CoolTT - OMUTHR.CoolTmp)) * (float) D_GAIN) ;
256  temp = (int)(fac_pgain * pgain) + (Intergral * igain) + (fac_dgain * dgain);
257  pow = pow - temp;
258 
259  }
260 
261  return (pow);
262 */
263 }
float CoolTT
Target Temperature (DTA -> DC_CoolTT)
static double delta
Definition: SOLPOS.C:129
float PID_ki
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
#define LISTEMP_TASK_TIME
spectrometer termoregulation
omuthr OMUTHR
Definition: Chktemp.c:27
float CoolAT
Actual Temperature (DTA -> DC_Temp)
float PID_kp
float PID_kd
+ Here is the call graph for this function:
+ 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:

§ print2file()

void print2file ( FILE *  ff,
int  x,
int  y,
unsigned int  m 
)

Print to file the defective pixel.

Parameters
*ffPointer to the buffer file
xImage horizontal dimension
yImage vertical dimension
mimage buffer

Definition at line 3734 of file DAS_Spat_ConfCBs.c.

Referenced by GetDefPix().

3735 {
3736 
3737  char str[80];
3738 
3739 
3740  //sprintf(str, "x, y, val: %d %d %u\n", x, y, m);
3741  //sprintf(str, "%d %d %u 1 1 0 0\n", x, y, m);
3742  sprintf(str, "%d %d 1 1 0 0\n", x, y);
3743 
3744  fprintf(ff,str);
3745 
3746 
3747 
3748 }
+ Here is the caller graph for this function:

§ q_sort()

void q_sort ( float  numbers[],
int  left,
int  right 
)

quick sort of one array

§ QjLamp()

void QjLamp ( int  mod)

QJ Lamp ON/OFF
.

Parameters
mod
  • = 0 –> Lamp OFF
  • = 1 –> Lamp ON

Definition at line 2724 of file Spat_Device.c.

References AMS1, AMS_wopto(), gui::ContrPanel, das::Gui, controlpanel::LedQJ, MObjectSetText(), MPixmapSetImageFile(), stepm::OOP, controlpanel::pblamps, QJFlg, and das::StepM.

Referenced by DB_KeyB_CB(), E_Qj_Off(), E_Qj_On(), GetDefPix(), ShutCB(), and WinRes().

2725 {
2726 
2727  if(mod)
2728  {
2729  DAS.StepM.OOP[AMS1] |= 0x08; //bit 3, 00001000
2730  QJFlg = 1;
2731  MObjectSetText(DAS.Gui.ContrPanel.pblamps[1], "Qj On");
2732  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedQJ, "SYS\\ledonQJ.bmp");
2733 
2734  }
2735  else
2736  {
2737  DAS.StepM.OOP[AMS1] &= 0xF7; //11110111
2738  QJFlg = 0;
2739  MObjectSetText(DAS.Gui.ContrPanel.pblamps[1], "Qj Off");
2740  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedQJ, "SYS\\ledoff.bmp");
2741  }
2742 
2743  // 1's complement
2744  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2745  //write on the optoinsulated port
2747  // again 1's complement for restoring the positive logic
2748  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
2749 
2750 
2751 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
MOBJECT LedQJ
Control Panel Led for QJ Lamp.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
int QJFlg
Definition: DAS_Spatram.h:2969
MOBJECT pblamps[2]
Control Panel Push buttons for HG and QJ Lamps.
void MObjectSetText(MOBJECT obj, const char *text)
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
int AMS_wopto(int id, unsigned int w)
write the value on the optoinsulated port write the value on the optoinsulated port.
Definition: Dxl.c:911
controlpanel ContrPanel
Control Panel Structure.
#define AMS1
AMS1 address.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ quickSort()

void quickSort ( float  numbers[],
int  array_size 
)

callback for q_sort()

§ Radio()

void Radio ( int  g)

NOT Used
.

Definition at line 650 of file Exec.c.

References E_AutoRange(), E_GetCCD(), and E_Save().

651 {
652 // double tup, tdw;
653 // Mirror(1);
654  E_AutoRange();
655 // tdw = TExp;
656 
657 // Mirror(3);
658  E_AutoRange();
659 // tup = TExp;
660 
661 // if(tdw < tup) TExp = tdw;
662 // else TExp = tup;
663 
664 // Mirror(1);
665  E_GetCCD();
666  E_Save();
667  if(g)
668  {
669 // E_Grafo();
670  }
671 // Mirror(3);
672  E_GetCCD();
673  E_Save();
674  if(g)
675 // { E_Grafo(); }
676 
677 // Mirror(1);
678  E_GetCCD();
679  E_Save();
680 // if(g)
681 // { E_Grafo(); }
682 
683 }
int E_GetCCD(void)
Get CCD. Execute DB_GetCCD. All the E_xxxxx() function are used during the execution in PRG mode...
Definition: Exec.c:705
void E_Save(void)
Save Image. Procedure for saving image or data. All the E_xxxxx() function are used during the execut...
Definition: Exec.c:355
void E_AutoRange(void)
Autoranging. Procedure for Autoranging. All the E_xxxxx() function are used during the execution in P...
Definition: Exec.c:342
+ Here is the call graph for this function:

§ ReadHeader_ASCII()

int ReadHeader_ASCII ( int  mod,
FILE *  fd 
)

Read ASCII Header of the measurement.
.

Parameters
mod
  • = 0 –> Read header only
  • = 1 –> Assign Header to plot labels
Returns
int = 1 –> EOF reached

Definition at line 1877 of file Spat_Plot.c.

References spectrumheader::altitude, BlindPix, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdmin, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, ch, spectrumheader::comment, D_AssignLabelPlot(), ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, IDX, IDY, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::StrDate, spectrumheader::StrTime, spectrumheader::sza, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, and spectrumheader::wavelen.

Referenced by DatOrBinFormat(), DB_Column(), LoadIo(), ViewNext(), and Visualizza().

1878 {
1879 
1880 
1881  int er = 0;
1882  unsigned char str[128], temp[12], buf[64];
1883  unsigned char ribuf[255];
1884  int NewnR = 0, l = 0 ;
1885  unsigned int i, ch;
1886 // long llong= 0;
1887 
1888  if(feof( fd ))
1889  {
1890  return 1;
1891  }
1892  else
1893  {
1894 
1895  er = fscanf(fd, "%s%s%s%f%s%f%s%u%s%f", temp, BIL.SPH.location, temp, &BIL.SPH.latitude,
1896  temp, &BIL.SPH.longitude, temp, &BIL.SPH.altitude, temp, &BIL.SPH.sza);
1897 
1898  er = fscanf(fd, "%s %s %s %s %d %s %f %f %u %u", BIL.SPH.StrDate, BIL.SPH.StrTime, temp, BIL.SPH.mirpos, &BIL.SPH.wavelen,
1900  &BIL.SPH.ccdmin);
1901 
1902  /*********************************/
1903  // Build the Date
1904  strncpy(str,BIL.SPH.StrDate,4);
1905  BIL.SPH.DATE.da_year = atoi(str);
1906 
1907  strncpy(buf,BIL.SPH.StrDate + 5, 2);
1908  BIL.SPH.DATE.da_mon = atoi(buf);
1909 
1910  strncpy(buf, BIL.SPH.StrDate + 8, 2);
1911  BIL.SPH.DATE.da_day = atoi(buf);
1912  /*********************************/
1913  /*********************************/
1914  // Build the time
1915  strncpy(buf, BIL.SPH.StrTime,2);
1916  BIL.SPH.TIME.ti_hour = atoi(buf);
1917 
1918  strncpy(buf,BIL.SPH.StrTime + 3 ,2);
1919  BIL.SPH.TIME.ti_min = atoi(buf);
1920 
1921  strncpy(buf,BIL.SPH.StrTime + 6 ,2);
1922  BIL.SPH.TIME.ti_sec = atoi(buf);
1923  /*********************************/
1924 
1925  er = fscanf(fd, "%d%d%d%d%d%d%d%d%d%d%d%d%d", &BIL.SPH.imgtype, &BIL.SPH.ccdwx, &BIL.SPH.ccdwy,
1928 
1929  ch = getc(fd);
1930  ch = getc(fd);
1931  //er = fscanf(fd, "%s", BIL.SPH.comment);
1932  //fgets(str, 80, fd);
1933 
1934 
1935 
1936 //for( i = 0; (i < 255) && ((ch = getc(fd)) != EOF) && (ch != '\n'); i++ )
1937 // for( i = 0; i < 255; i++ )
1938  i=0;
1939  do
1940  {
1941 
1942  ribuf[i] = (unsigned char)ch;
1943  ch = getc(fd);
1944  i++;
1945  }while (ch != 10);
1946  /* Terminate string with null character: */
1947  ribuf[i] = '\0';
1948 
1949  sprintf(BIL.SPH.comment, "%s", ribuf);
1950 
1951  // MMessageDialog("DAS Alert", BIL.SPH.comment, "ok", NULL);
1952 
1953 
1954  if(mod)
1956 
1957  }
1958 
1959  IDX = BIL.SPH.ccdwx;
1960  IDY = BIL.SPH.ccdnr;
1961 
1962  if(BIL.SPH.ccdnr == 253)
1963  {
1964  IDY = IDY + 1;
1965  }
1966 
1967  if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
1968  {
1969 
1970  BlindPix = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
1971 
1972  }
1973 // llong = ftell( fd );
1974 
1975 
1976  return 0;
1977 }
struct ddate DATE
Definition: bildef.h:134
char comment[255]
Definition: bildef.h:157
unsigned int ccdmax
Definition: bildef.h:142
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
char StrTime[8]
Definition: bildef.h:136
unsigned int altitude
Altitude of the Station.
Definition: bildef.h:131
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
unsigned char ti_hour
Definition: bildef.h:79
static double ch
Definition: SOLPOS.C:120
unsigned char ti_sec
Definition: bildef.h:81
char filpos[5]
Definition: bildef.h:139
char StrDate[10]
Definition: bildef.h:135
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
float ccdtexp
Definition: bildef.h:140
void D_AssignLabelPlot(void)
Definition: Spat_Plot.c:1661
unsigned char ti_min
Definition: bildef.h:78
float longitude
Longitude of the Station.
Definition: bildef.h:130
unsigned char da_mon
Definition: bildef.h:86
bil BIL
Definition: Spat_Plot.c:35
float latitude
Latitude of the Station.
Definition: bildef.h:129
unsigned char da_day
Definition: bildef.h:85
char location[4]
Name of the Station (BLQ, LPA, EVR, TNB, DMC.....)
Definition: bildef.h:128
short int da_year
Definition: bildef.h:84
float ccdtemp
Definition: bildef.h:141
int BlindPix
Number of blind pixels (usefull for Dark Current)
Definition: DAS_Spat.c:120
unsigned int ccdmin
Definition: bildef.h:143
float sza
Solar Zenith Angle.
Definition: bildef.h:132
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ReadHeader_BIN()

int ReadHeader_BIN ( int  fd)

read the BINARY header of the stored spectrum

Parameters
fdnumber of source file

Definition at line 1798 of file Spat_Plot.c.

References spectrumheader::altitude, BlindPix, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, spectrumheader::comment, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, IDX, IDY, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, spectrumheader::TIME, and spectrumheader::wavelen.

Referenced by DatOrBinFormat(), DB_CalcFluxI(), DB_Column(), ViewNext_BIN(), and Visualizza().

1799 {
1800 
1801  unsigned long info = 0;
1802 
1803 
1804 
1805  if(eof( fd ))
1806  {
1807  return 1;
1808  }
1809  else
1810  {
1811 
1812  info =0;
1813 
1814  info += read(fd, BIL.SPH.location, sizeof(BIL.SPH.location));
1815  info += read(fd, &BIL.SPH.latitude, sizeof(BIL.SPH.latitude));
1816  info += read(fd, &BIL.SPH.longitude, sizeof(BIL.SPH.longitude));
1817  info += read(fd, &BIL.SPH.altitude, sizeof(BIL.SPH.altitude));
1818  info += read(fd, &BIL.SPH.sza, sizeof(BIL.SPH.sza));
1819  info += read(fd, &BIL.SPH.DATE, sizeof(struct ddate));
1820  info += read(fd, &BIL.SPH.TIME, sizeof(struct dtime));
1821 
1822  info += read(fd, BIL.SPH.mirpos, sizeof(BIL.SPH.mirpos));
1823  info += read(fd, &BIL.SPH.wavelen, sizeof(BIL.SPH.wavelen));
1824  info += read(fd, BIL.SPH.filpos, sizeof(BIL.SPH.filpos));
1825 
1826  info += read(fd, &BIL.SPH.ccdtemp, sizeof(BIL.SPH.ccdtemp));
1827  info += read(fd, &BIL.SPH.ccdtexp, sizeof(BIL.SPH.ccdtexp));
1828  info += read(fd, &BIL.SPH.ccdmax, sizeof(BIL.SPH.ccdmax));
1829  //Attenzione - manca il valore del minimo ( anche nella routine di scrittura)
1830  info += read(fd, &BIL.SPH.imgtype, sizeof(BIL.SPH.imgtype));
1831  info += read(fd, &BIL.SPH.ccdwx, sizeof(BIL.SPH.ccdwx));
1832  info += read(fd, &BIL.SPH.ccdwy, sizeof(BIL.SPH.ccdwy));
1833  info += read(fd, &BIL.SPH.ccdsx, sizeof(BIL.SPH.ccdsx));
1834  info += read(fd, &BIL.SPH.ccdsy, sizeof(BIL.SPH.ccdsy));
1835  info += read(fd, &BIL.SPH.ccdex, sizeof(BIL.SPH.ccdex));
1836  info += read(fd, &BIL.SPH.ccdey, sizeof(BIL.SPH.ccdey));
1837  info += read(fd, &BIL.SPH.ccdvb, sizeof(BIL.SPH.ccdvb));
1838  info += read(fd, &BIL.SPH.ccdnr, sizeof(BIL.SPH.ccdnr));
1839  info += read(fd, &BIL.SPH.dummy1, sizeof(BIL.SPH.dummy1));
1840  info += read(fd, &BIL.SPH.dummy2, sizeof(BIL.SPH.dummy2));
1841  info += read(fd, &BIL.SPH.dummy3, sizeof(BIL.SPH.dummy3));
1842  info += read(fd, &BIL.SPH.dummy4, sizeof(BIL.SPH.dummy4));
1843  info += read(fd, &BIL.SPH.comment, sizeof(BIL.SPH.comment));
1844 
1845 
1846  IDX = BIL.SPH.ccdwx;
1847 
1848  // !!!!ATTENTION!!!! This is only for the CCD30-11 OE FI- Please check where is defined
1849  // the IDY in the Main Program for the Data Acquisition
1850  //if (DAS.Paramini.EqType == SPATRAM2 || DAS.Paramini.EqType == GASCODNG3 || DAS.Paramini.EqType == GASCODNG4)
1851  if(BIL.SPH.ccdwy == 256)
1852  IDY = BIL.SPH.ccdnr+1;
1853  else
1854  IDY = BIL.SPH.ccdnr;
1855  if(BIL.SPH.ccdnr == 253)
1856  {
1857  IDY = IDY + 1;
1858  }
1859 
1860  if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
1861  {
1862 
1863  BlindPix = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
1864 
1865  }
1866 
1867 // D_AssignLabelPlot();
1868  }
1869  return 0;
1870 
1871 }
struct ddate DATE
Definition: bildef.h:134
char comment[255]
Definition: bildef.h:157
unsigned int ccdmax
Definition: bildef.h:142
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
Definition: bildef.h:83
unsigned int altitude
Altitude of the Station.
Definition: bildef.h:131
Definition: Dildef.h:423
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
char filpos[5]
Definition: bildef.h:139
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
Definition: bildef.h:77
float ccdtexp
Definition: bildef.h:140
float longitude
Longitude of the Station.
Definition: bildef.h:130
bil BIL
Definition: Spat_Plot.c:35
float latitude
Latitude of the Station.
Definition: bildef.h:129
char location[4]
Name of the Station (BLQ, LPA, EVR, TNB, DMC.....)
Definition: bildef.h:128
float ccdtemp
Definition: bildef.h:141
int BlindPix
Number of blind pixels (usefull for Dark Current)
Definition: DAS_Spat.c:120
float sza
Solar Zenith Angle.
Definition: bildef.h:132
+ Here is the caller graph for this function:

§ ReadHeaderOldF()

int ReadHeaderOldF ( FILE *  fd)

read the ASCII header of the stored spectrum (OLD FORMAT - replaced by ReadHeaderOnly(FILE *fd)

Parameters
fdnumber of source file

Definition at line 751 of file Save.c.

References spectrumheader::altitude, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdmin, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::comment, ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, and spectrumheader::wavelen.

Referenced by DT_CorrHeader().

752 {
753 
754  int er = 0;
755  char str[128], temp[4];
756 
757 
758 
759  if(feof( fd ))
760  {
761  return 1;
762  }
763  else
764  {
765  er = fscanf(fd, "%s%s%s%lf%s%lf%s%lf%s%lf", temp, BIL.SPH.location, temp, &BIL.SPH.latitude,
766  temp, &BIL.SPH.longitude, temp, &BIL.SPH.altitude, temp, &BIL.SPH.sza);
767 
768  er = fscanf(fd, "%i/%u/%u%u:%u:%u%s%s%d%s%lf%lf%lu%lu", &BIL.SPH.DATE.da_year,&BIL.SPH.DATE.da_mon,
771  &BIL.SPH.ccdmin);
772 
773  er = fscanf(fd, "%d%d%d%d%d%d%d%d%d%d%d", &BIL.SPH.imgtype,
774  &BIL.SPH.ccdsx, &BIL.SPH.ccdsy,
775  &BIL.SPH.ccdex, &BIL.SPH.ccdey,
776  &BIL.SPH.ccdvb, &BIL.SPH.ccdnr,
777  &BIL.SPH.dummy1,
778  &BIL.SPH.dummy2,
779  &BIL.SPH.dummy3,
780  &BIL.SPH.dummy4);
781 
782  er = fscanf(fd, "%s", BIL.SPH.comment);
783  fgets(str, 80, fd);
784 
785  }
786 
787  return 0;
788 }
struct ddate DATE
Definition: bildef.h:134
char comment[255]
Definition: bildef.h:157
unsigned int ccdmax
Definition: bildef.h:142
unsigned int altitude
Altitude of the Station.
Definition: bildef.h:131
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
unsigned char ti_hour
Definition: bildef.h:79
unsigned char ti_sec
Definition: bildef.h:81
char filpos[5]
Definition: bildef.h:139
bil BIL
Definition: Save.c:26
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
float ccdtexp
Definition: bildef.h:140
unsigned char ti_min
Definition: bildef.h:78
float longitude
Longitude of the Station.
Definition: bildef.h:130
unsigned char da_mon
Definition: bildef.h:86
float latitude
Latitude of the Station.
Definition: bildef.h:129
unsigned char da_day
Definition: bildef.h:85
char location[4]
Name of the Station (BLQ, LPA, EVR, TNB, DMC.....)
Definition: bildef.h:128
short int da_year
Definition: bildef.h:84
float ccdtemp
Definition: bildef.h:141
unsigned int ccdmin
Definition: bildef.h:143
float sza
Solar Zenith Angle.
Definition: bildef.h:132
+ Here is the caller graph for this function:

§ ReadHeaderOnly()

int ReadHeaderOnly ( FILE *  fd)

read the ASCII header of the stored spectrum

Parameters
fdnumber of source file

Definition at line 704 of file Save.c.

References spectrumheader::altitude, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdmin, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, spectrumheader::comment, ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, and spectrumheader::wavelen.

Referenced by DT_CorrFileEvora().

705 {
706 
707  int er = 0;
708  char str[128], temp[12];
709  int NewnR = 0;
710 
711  if(feof( fd ))
712  {
713  return 1;
714  }
715  else
716  {
717 /*
718  er = fscanf(fd, "%s%s%s%f%s%f%s%u%s%f", temp, BIL.SPH.location, temp, &BIL.SPH.latitude,
719  temp, &BIL.SPH.longitude, temp, &BIL.SPH.altitude, temp, &BIL.SPH.sza);
720 
721  er = fscanf(fd, "%s %s %s %s %d %s %f %f %u %u", BIL.SPH.StrDate, BIL.SPH.StrTime, temp, BIL.SPH.mirpos, &BIL.SPH.wavelen,
722  BIL.SPH.filpos, &BIL.SPH.ccdtemp, &BIL.SPH.ccdtexp, &BIL.SPH.ccdmax,
723  &BIL.SPH.ccdmin);
724 
725  er = fscanf(fd, "%d%d%d%d%d%d%d%d%d%d%d%d%d", &BIL.SPH.imgtype, &BIL.SPH.ccdwx, &BIL.SPH.ccdwy,
726  &BIL.SPH.ccdsx, &BIL.SPH.ccdsy, &BIL.SPH.ccdex, &BIL.SPH.ccdey, &BIL.SPH.ccdvb,
727  &BIL.SPH.ccdnr, &BIL.SPH.dummy1, &BIL.SPH.dummy2, &BIL.SPH.dummy3, &BIL.SPH.dummy4);
728 
729 
730  */
731 
732  er = fscanf(fd, "%s%s%s%lf%s%lf%s%lf%s%lf", temp, BIL.SPH.location, temp, &BIL.SPH.latitude,
733  temp, &BIL.SPH.longitude, temp, &BIL.SPH.altitude, temp, &BIL.SPH.sza);
734 
735  er = fscanf(fd, "%i/%2u/%2u%2u:%2u:%2u%s%s%d%s%lf%lf%lu%lu", &BIL.SPH.DATE.da_year,
739 
740  er = fscanf(fd, "%d%d%d%d%d%d%d%d%d%d%d%d%d", &BIL.SPH.imgtype, &BIL.SPH.ccdwx, &BIL.SPH.ccdwy,
743 
744  er = fscanf(fd, "%s", BIL.SPH.comment);
745  fgets(str, 80, fd);
746  }
747 
748  return 0;
749 }
struct ddate DATE
Definition: bildef.h:134
char comment[255]
Definition: bildef.h:157
unsigned int ccdmax
Definition: bildef.h:142
unsigned int altitude
Altitude of the Station.
Definition: bildef.h:131
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
unsigned char ti_hour
Definition: bildef.h:79
unsigned char ti_sec
Definition: bildef.h:81
char filpos[5]
Definition: bildef.h:139
bil BIL
Definition: Save.c:26
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
float ccdtexp
Definition: bildef.h:140
unsigned char ti_min
Definition: bildef.h:78
float longitude
Longitude of the Station.
Definition: bildef.h:130
unsigned char da_mon
Definition: bildef.h:86
float latitude
Latitude of the Station.
Definition: bildef.h:129
unsigned char da_day
Definition: bildef.h:85
char location[4]
Name of the Station (BLQ, LPA, EVR, TNB, DMC.....)
Definition: bildef.h:128
short int da_year
Definition: bildef.h:84
float ccdtemp
Definition: bildef.h:141
unsigned int ccdmin
Definition: bildef.h:143
float sza
Solar Zenith Angle.
Definition: bildef.h:132
+ Here is the caller graph for this function:

§ ReadIMG()

void ReadIMG ( FILE *  file,
unsigned short *  mat,
int  hp,
int  vp 
)

Read ASCII Image (Spectral Data only)
.

Parameters
*file= ASCII file number
*mat= image buffer
hp= horizontal pixels
vp= vertical pixels

Definition at line 1206 of file Spat_Plot.c.

Referenced by DatOrBinFormat(), DB_Column(), DT_CorrFileEvora(), DT_CorrHeader(), LoadIo(), ViewNext(), and Visualizza().

1207 {
1208 
1209 
1210  int x, y;
1211 
1212  for(y = 0; y < vp; y++)
1213  {
1214  for(x = 0; x < hp; x++)
1215  {
1216  fscanf(file, "%5u ", &mat[y * hp + x]);
1217  }
1218  }
1219 }
+ Here is the caller graph for this function:

§ ReadIMG_BIN()

void ReadIMG_BIN ( int  fd,
unsigned short *  mat,
int  hp,
int  vp 
)

read the BINARY stored spectrum

Parameters
fdnumber of source file
*matdestination buffer
hphorizontal pixels
vpvertical pixels

Definition at line 1166 of file Spat_Plot.c.

Referenced by DatOrBinFormat(), DB_CalcFluxI(), DB_Column(), ViewNext_BIN(), and Visualizza().

1167 {
1168  int x, y;
1169 
1170  for(x = 0; x < hp; x++)
1171  {
1172  for(y = 0; y < vp; y++)
1173  read(fd, &mat[y * hp + x], 2);
1174 
1175  }
1176 }
+ Here is the caller graph for this function:

§ ReadIMG_old()

void ReadIMG_old ( FILE *  file,
int  hp,
int  vp 
)

NOT Used
.

Definition at line 1136 of file Spat_Plot.c.

References bil::DPLOT, and d_view::ImatGraf.

1137 {
1138 
1139 
1140  int x, y;
1141 
1142  for(y = 0; y < vp; y++)
1143  {
1144  for(x = 0; x < hp; x++)
1145  {
1146  fscanf(file, "%5u ", &BIL.DPLOT.ImatGraf[y * hp + x]);
1147  }
1148  }
1149 }
d_view DPLOT
Definition: bildef.h:254
unsigned short * ImatGraf
Definition: bildef.h:176
bil BIL
Definition: Spat_Plot.c:35

§ ReadLine()

void ReadLine ( char *  buf,
int  nc,
FILE *  f 
)

Read Line on a file
Read one record of nc character on the file f.

Parameters
*bufpointer to a character buffer
ncnumber of char to be read
*fFILE to read in, prevously opened

Definition at line 72 of file Load.c.

Referenced by DOAS_LoadConfig(), ExMaster(), LoadAMS(), LoadDasSysCol(), LoadDB_DispCoeff(), LoadDB_Options(), LoadEquipment(), LoadFTPSetting(), LoadHardware(), LoadParam(), LoadWlstep(), and ReadLogFile().

73 {
74 
75  fgets(buf, nc, f);
76 }
+ Here is the caller graph for this function:

§ ReadLogFile()

int ReadLogFile ( int  mod,
char *  dir,
char *  filename,
int  nx,
int  ny,
struct omutemp  datatemp 
)

Read DAS LOG File.
.

Parameters
mod
  • = 0 –> Count number of items
  • = 1 –> Read and assign items to omutemp structure
*dir= pointer to directory name
*filename= pointer to filename
nx= number of items
ny= number of rows of temperature matrix
structomutemp datatemp = Temperature Structure for Optical Mechanical Unit
Returns
int = 0

Definition at line 379 of file DAS_Spat_Conf.c.

References _MAX_PATH, omutemp::CCDPwr, omutemp::CCDTemp, ch, omutemp::PltPwr, omutemp::pTempMat, omutemp::ptimeMat, ReadLine(), dtime::ti_hour, dtime::ti_min, and dtime::ti_sec.

Referenced by BrowseLog(), and RunLogMode().

380 {
381  FILE *fs;
382  char fileorigin[_MAX_PATH];
383 
384  char str[255], ch;
385  int k= 0, t=0;
386  int x, y, l;
387  char ttime[8], timetemp[2];
388 
389  timetemp[0] = '\0';
390 
391  sprintf(fileorigin,"%s%s", dir, filename);
392 
393  fs = fopen(fileorigin, "r");
394  if(fs < 0) return -1;
395  if(mod==0)
396  {
397  //Init the reading of the file
398  do
399  {
400  ReadLine(str, 255, fs);
401  k++;
402  }while(!feof(fs));
403 
404  fclose(fs);
405  return k - 2; //Number of data
406  }
407  if(mod)
408  {
409 
410 
411  //Init the reading of the file
412  //FlushLine (the first)
413  t=0;
414  do
415  {
416  str[t] = (unsigned char)ch;
417  ch = getc(fs);
418  t++;
419  }while (ch != 10);
420 
421  for (x = 0; x < nx; x++)
422  {
423  ReadLine(str, 32, fs);
424  sscanf(str, "%s %f %f% %f% ", &ttime, &datatemp.CCDTemp[x], &datatemp.CCDPwr[x], &datatemp.PltPwr[x]);
425  //if(str[0] != numero --> messAGGIO ED esci
426  l = strlen(ttime);
427  // Build time
428  strncpy(timetemp, ttime, 2);
429  datatemp.ptimeMat[x].ti_hour = (unsigned char) atoi(timetemp);
430  strncpy(timetemp, ttime + 3, 2);
431  datatemp.ptimeMat[x].ti_min = (unsigned char) atoi(timetemp);
432  strncpy(timetemp, ttime + 6, 2);
433  datatemp.ptimeMat[x].ti_sec = (unsigned char) atoi(timetemp);
434 
435  for(y = 0; y < ny; y++)
436  {
437 
438  fscanf(fs, "%f", &datatemp.pTempMat[x * ny + y] );
439 
440  }
441  //FlushLine
442  t=0;
443  do
444  {
445  str[t] = (unsigned char)ch;
446  ch = getc(fs);
447  t++;
448  }while (ch != 10);
449 
450  }
451 
452  fclose(fs);
453  }
454  return 0;
455 }
struct dtime * ptimeMat
Definition: bildef.h:101
unsigned char ti_hour
Definition: bildef.h:79
float * CCDPwr
Definition: bildef.h:103
static double ch
Definition: SOLPOS.C:120
void ReadLine(char *buf, int nc, FILE *f)
Read Line on a file Read one record of nc character on the file f.
Definition: Load.c:72
unsigned char ti_sec
Definition: bildef.h:81
#define _MAX_PATH
Definition: Dildef.h:202
unsigned char ti_min
Definition: bildef.h:78
float * PltPwr
Definition: bildef.h:104
float * CCDTemp
Definition: bildef.h:102
float * pTempMat
Definition: bildef.h:100
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ RefreshDrArea()

int RefreshDrArea ( MOBJECT  obj)

Redraw the draw arwa in a 2D Plot window.

Definition at line 428 of file 2DPlot.c.

References mtcl::black, bil::BLENS, omutemp::COSTX, omutemp::COSTY, D2D_AssignOrigin(), D2D_findmaxmin(), D2D_PlotAxis(), D2D_PlotGrid(), D2D_PlotSpectrum(), D2D_PoslblX(), D2D_PoslblY(), omutemp::dimx, omutemp::dimy, omutemp::eX, omutemp::eY, blens::Imim, omutemp::lblx, maxploth, maxplotw, MObjectGetHeight(), MObjectGetWidth(), omutemp::oX, omutemp::oY, mtcl::PLColor, omutemp::pTempMat, omutemp::ptimeMat, dtime::ti_hour, omutemp::tmax, and omutemp::tmin.

Referenced by DrawAreaTempCB(), and ToggleButtCB().

429 {
430  maxplotw = MObjectGetWidth(obj);
431  maxploth = MObjectGetHeight(obj);
432 
433  //Assign limits to the Drawing coordinates
434  D2D_AssignOrigin(obj);
435  //Plot the axes
437  //Plot grid
439 
441 
442 // OMUTEMP.tmin = 0;
443 // OMUTEMP.tmax = 50;
444 
446 
447 
449 
450 
451  //Calculation of the adaptive parameters
452  OMUTEMP.COSTY = (double)(OMUTEMP.tmax - OMUTEMP.tmin) / (double)(OMUTEMP.oY - OMUTEMP.eY);
453  OMUTEMP.COSTX = (double)(OMUTEMP.eX - OMUTEMP.oX) / (double) (OMUTEMP.dimx);
454 
457 
458 
459  return 0;
460 }
mtcl MTCL
Definition: 2DPlot.c:30
MIMAGE Imim
Definition: bildef.h:14
struct dtime * ptimeMat
Definition: bildef.h:101
MTColor black
int MObjectGetHeight(MOBJECT obj)
MOBJECT lblx[25]
Definition: bildef.h:106
unsigned char ti_hour
Definition: bildef.h:79
int maxplotw
Definition: Spat_Plot.c:51
int MObjectGetWidth(MOBJECT obj)
int D2D_findmaxmin(float plotmat[], int xinf, int xsup, int yinf, int ysup)
Definition: 2DPlot.c:245
int dimx
Definition: bildef.h:113
int eY
Definition: bildef.h:112
void D2D_AssignOrigin(MOBJECT obj)
Definition: 2DPlot.c:161
double COSTY
Definition: bildef.h:110
float tmax
Definition: bildef.h:114
omutemp OMUTEMP
Definition: 2DPlot.c:29
void D2D_PlotAxis(MOBJECT ob, int sx, int sy, int ex, int ey, MTColor col)
Definition: 2DPlot.c:177
int oY
Definition: bildef.h:112
void D2D_PlotSpectrum(MOBJECT obj, float plotmat[], int idx, int idy, unsigned long pe[], double costx, double costy, int min, int max, int ox, int oy)
Definition: 2DPlot.c:392
int maxploth
Definition: Spat_Plot.c:51
void D2D_PlotGrid(MOBJECT ob, MIMAGE mim, int sx, int sy, int ex, int ey, int nx, int ny)
Definition: 2DPlot.c:207
float tmin
Definition: bildef.h:114
int oX
Definition: bildef.h:112
bil BIL
Definition: 2DPlot.c:28
int eX
Definition: bildef.h:112
MTColor PLColor[264]
blens BLENS
Definition: bildef.h:252
int dimy
Definition: bildef.h:113
float * pTempMat
Definition: bildef.h:100
double COSTX
Definition: bildef.h:110
void D2D_PoslblY(float l, float h)
Definition: 2DPlot.c:371
void D2D_PoslblX(MOBJECT lbl, int xs, int xe, int xc)
Definition: 2DPlot.c:307
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ RemoveSpikes()

int RemoveSpikes ( int  mod,
unsigned short *  mat,
int  horpix,
int  verpix,
int  blindpix 
)

Removes Spikes on a measure.

Parameters
modNOT USED (=0)
*matsource buffer
horpixhorizontal pixels
verpixvertical pixels
blindpixblind pixels

Definition at line 369 of file FFT.c.

References CheckSpikes(), and IDX.

Referenced by DrawAreaPlotCB().

370 {
371 
372 
373  int x, y, n ;
374  double *avect;
375  unsigned long eln = (unsigned long)(2 * (horpix - blindpix + 1)) ;
376  FILE *fd;
377 
378  fd = fopen("Spikes.tmp", "w");
379  if(fd < 0) return 1;
380 // for(x = 0; x < horpix + 1; x++)
381  for(x = 0; x < horpix ; x++)
382  {
383  if ((x <= horpix - blindpix ) & (x > 1))
384  {
385  fprintf(fd, "%04u ", x);
386 
387  for(y = 0; y < verpix; y++)
388  {
389  fprintf(fd, "%05u ", mat[y * IDX + x]);
390  }
391  fprintf(fd, "\n", NULL);
392  }
393  }
394  fprintf(fd, "\n", NULL);
395  fclose(fd);
396 
397 
398 
399  avect = (double *) calloc( eln, sizeof(double));
400 
401 
402  if( avect == NULL )
403  return 1;
404 
405  for(y = 0; y < verpix; y++)
406  {
407  n=1;
408  for(x = 0; x < horpix; x++)
409  {
410  if ((x < horpix - blindpix) & (x > 1))
411  {
412  avect[n] = (double)mat[y * (horpix) + x];
413  n++;
414  }
415 
416  }
417 
418  CheckSpikes(0, avect, n - 1);
419 
420  for(x = 0; x < horpix; x++)
421  {
422  if ((x < horpix - blindpix) & (x > 1))
423  {
424  mat[y * horpix + x] = (unsigned int)avect[x - 1] ;
425  }
426 
427  }
428  }
429 
430  free(avect);
431 
432 
433 
434  fd = fopen("NoSpikes.tmp", "w");
435  if(fd < 0) return 1;
436 
437 // for(x = 0; x < horpix + 1; x++)
438  for(x = 0; x < horpix ; x++)
439  {
440  if ((x <= horpix - blindpix ) & (x > 1))
441  {
442  fprintf(fd, "%04u ", x);
443 
444  for(y = 0; y < verpix; y++)
445  {
446  fprintf(fd, "%05u ", mat[y * IDX + x]);
447  }
448  fprintf(fd, "\n", NULL);
449  }
450  }
451  fprintf(fd, "\n", NULL);
452  fclose(fd);
453 
454  return 0;
455 
456 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int CheckSpikes(int mod, double *tmp, int npix)
Definition: FFT.c:348
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ResumeCB()

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

Definition at line 174 of file DOAS_FullProj.c.

References MMessageDialog().

Referenced by MDCreateDOAS_MainSh().

175 {
176 
177  MMessageDialog("DAS information", "The procedure is not yet implemented!!", " Ok ", NULL);
178 }
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:

§ 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:

§ SaveCalib()

void SaveCalib ( int  mod)

Definition at line 2130 of file Procedures.c.

References _MAX_PATH, d_fileman::DAILYDATADIRECTORY, d_fileman::DATADIRECTORY, DB_Save(), bil::DFILEM, das::DGeo, das::DOption, fftsavecal, spectrumheader::newdate, spectrumheader::olddate, d_geo::s_name, optionini::savingmode, bil::SPH, and Total.

Referenced by D_Calibra(), E_HgScan(), and E_QjScan().

2131 {
2132 
2133 
2134  char tmpbuf[128] ;
2135  static char tit[_MAX_PATH];
2136  char tit1[80];
2137  time_t ltime;
2138  struct tm *today;
2139  int er = 0;
2140 
2141 
2142 
2143 
2144  if(fftsavecal) //flag first time program run here
2145  {
2146  /* Get UNIX-style time */
2147  time( &ltime );
2148  /* Use time structure to build a customized time string. */
2149  today = localtime( &ltime );
2150  /* Use strftime to build a customized time string. */
2151  strftime( tmpbuf, 7,"%y%m%d", today );
2152 
2153  //Build name of Daily data directory
2154  sprintf(BIL.DFILEM.DAILYDATADIRECTORY,"%s\\%s",BIL.DFILEM.DATADIRECTORY,tmpbuf);
2155  //Create Daily data dir
2156  er = _mkdir( BIL.DFILEM.DAILYDATADIRECTORY );
2157 
2158  fftsavecal=0;
2159  if(DAS.DOption.savingmode) // Binary saving
2160  {
2161 
2162  if (mod)
2163  sprintf(tit, "%s\\%s%s.bqj",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2164  else
2165  sprintf(tit, "%s\\%s%s.bhg",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2166  DB_Save(tit, 1);
2167  }
2168  else //ASCII saving
2169  {
2170  if (mod)
2171  sprintf(tit, "%s\\%s%s.aqj",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2172  else
2173  {
2174  sprintf(tit, "%s\\%s%s.ahg",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2175  sprintf(tit1, "%s", tit+5);
2176  }
2177  DB_Save(tit, 0);
2178  }
2179  sprintf(BIL.SPH.olddate, "%s",tmpbuf);
2180  }
2181  else
2182  {
2183 
2184  /* Get UNIX-style time */
2185  time( &ltime );
2186  /* Use time structure to build a customized time string. */
2187  today = localtime( &ltime );
2188  /* Use strftime to build a customized time string. */
2189  strftime( BIL.SPH.newdate, 7,"%y%m%d", today );
2190  /* Use strftime to build a customized time string. */
2191  strftime( tmpbuf, 7,"%y%m%d", today );
2192 
2193 
2194  // Se e' cambiata la data rimette a 1 il contatore del numero dei files
2195  if(strcmp(BIL.SPH.newdate, BIL.SPH.olddate) != 0)
2196  {
2197  sprintf(BIL.SPH.olddate, "%s",BIL.SPH.newdate);
2198  Total = 0;
2199 
2200  sprintf(BIL.DFILEM.DAILYDATADIRECTORY,"%s\\%s",BIL.DFILEM.DATADIRECTORY,tmpbuf);
2201  er = _mkdir( BIL.DFILEM.DAILYDATADIRECTORY );
2202 
2203  /*****************************/
2204  if(DAS.DOption.savingmode) // Binary saving
2205  {
2206  if (mod)
2207  sprintf(tit, "%s\\%s%s.bqj",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2208  else
2209  sprintf(tit, "%s\\%s%s.bhg",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2210  DB_Save(tit, 1);
2211  }
2212  else //ASCII saving
2213  {
2214  if (mod)
2215  sprintf(tit, "%s\\%s%s.aqj",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2216  else
2217  {
2218  sprintf(tit, "%s\\%s%s.ahg",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2219  sprintf(tit1, "%s", tit+5);
2220  }
2221 
2222  DB_Save(tit, 0);
2223  }
2224  }
2225 /*****************************/
2226 
2227 
2228  if(DAS.DOption.savingmode)
2229  {
2230  if (mod)
2231  sprintf(tit, "%s\\%s%s.bqj",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2232  else
2233  sprintf(tit, "%s\\%s%s.bhg",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2234 
2235  DB_Save(tit, 1);
2236  }
2237  else
2238  {
2239  if (mod)
2240  sprintf(tit, "%s\\%s%s.aqj",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2241  else
2242  {
2243  sprintf(tit, "%s\\%s%s.ahg",BIL.DFILEM.DAILYDATADIRECTORY, DAS.DGeo.s_name, tmpbuf);
2244  sprintf(tit1, "%s", tit+5);
2245  }
2246  DB_Save(tit, 0);
2247  }
2248 
2249  }
2250 
2251 
2252  //sprintf(tit1, "%s", tit+5);
2253  //MObjectSetText(DAS.Gui.ContrPanel.Albl_CS[3], tit1);
2254  //sprintf(tit1, "%05d", SaveCnt);
2255  //MObjectSetText(DAS.Gui.ContrPanel.Albl_CS[2], tit1);
2256 
2257  //SaveCnt++;
2258 
2259 
2260 }
bil BIL
Definition: Procedures.c:42
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
int Total
Progressive acquisition number for file (MAX defined = 50)
Definition: Exec.c:34
char DAILYDATADIRECTORY[_MAX_PATH]
Definition: bildef.h:203
char DATADIRECTORY[_MAX_PATH]
Definition: bildef.h:201
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
void DB_Save(char *tit, int mod)
Save the acquired spectrum. Procedure that Save the acquired spectrum.
Definition: Save.c:552
char olddate[8]
Definition: bildef.h:158
das DAS
DAS structure.
Definition: Procedures.c:47
d_geo DGeo
struct for Station location
char s_name[4]
Station name.
d_fileman DFILEM
Definition: bildef.h:257
#define _MAX_PATH
Definition: Dildef.h:202
char newdate[8]
Definition: bildef.h:159
Definition: Dildef.h:234
int fftsavecal
Definition: Procedures.c:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ScreenInfoCB()

void ScreenInfoCB ( MOBJECT  o,
void *  s,
void *  v 
)

Definition at line 886 of file DAS_Spat_ConfCBs.c.

References MGetNColors(), MGetNPlanes(), MGetScreenHeight(), MGetScreenWidth(), and MMessageDialog().

887 {
888  char buff[256];
889 
890  sprintf(buff, "Width: %d\nHeight: %d\nColors: %ld\nPlanes: %d",
891  MGetScreenWidth(),
893  MGetNColors(),
894  MGetNPlanes());
895  MMessageDialog("Screen Information", buff, " Ok ", NULL);
896 }
int MGetNPlanes(void)
long MGetNColors(void)
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int MGetScreenWidth(void)
int MGetScreenHeight(void)
+ Here is the call graph for this function:

§ SD_Azimuth()

int SD_Azimuth ( float  ang,
float  raz 
)

Positioning Azimuth.
The Zenith reaches the position specified by ang.

Parameters
ang=mechanical angle
raz=real azimuth angle
Returns
er:
  • = 0 –> Operation concluded succesfully
  • = 1 –> Problems in positioning

Definition at line 3110 of file Spat_Device.c.

References controlpanel::Albl_LS, AMS3, gui::ContrPanel, DB_KB_ButtonActive(), DB_StepMotor(), flag::exec, flag::fileprg, das::Gui, pushbutt::KeyB, controlpanel::LedSM, MIGEAz(), MObjectSetSensitive(), MObjectSetText(), MPixmapSetImageFile(), stepm::multiplier, stepm::nstep, AzimuthSt::Pos, gui::PushButt, AzimuthSt::realazpos, stepm::Revo, stepm::SM_B, SM_stepr(), stepm::step, and das::StepM.

Referenced by ActMvAzimDegCB(), E_AAMeasure(), E_Azimuth(), and E_IRefSun().

3111 {
3112  int er = 0;
3113  char buf[80];
3114  long n, dp = 500; // dp sono i dead pulse, vanno aggiunti all'inversione per il recupero del gioco
3115  int dir;
3116  int k = 0;
3117  float yy;
3118  double GRASTEP, STEPGRA;
3119  float razang;
3120 
3121 
3122  razang=MIGEAz((float)ang);
3123 
3124  k = SM_stepr(DAS.StepM.step[AMS3][DAS.StepM.SM_B]); // step/round
3125 
3126  GRASTEP = (float)360.0 / (float) k; // degree/step
3127 
3128  STEPGRA = (float) k / (float)360.0; // step/degree
3129 
3130  yy = (razang - (float)AST.Pos);
3131 
3132  n = (long) (yy * STEPGRA * DAS.StepM.multiplier[AMS3][1]);
3133 
3134  AST.Pos = razang;
3135  AST.realazpos = ang;
3136 
3137  // Select direction
3138  if(n < 0)
3139  dir = 1;
3140  else
3141  dir = 0;
3142 
3143  n = labs(n);
3144  DAS.StepM.Revo[AMS3][DAS.StepM.SM_B] = dir;
3145  DAS.StepM.nstep[AMS3][DAS.StepM.SM_B] = n;
3146 
3147 
3148 
3149 
3150  //Disattiva i pulsanti sulla keyboard
3151  DB_KB_ButtonActive(0);
3154 
3155 /*
3156  k = (float) SM_stepr(DAS.StepM.step[AMS3][1]); // step/round
3157 
3158  GRASTEP = (float)360.0 / (float) k; // degree/step
3159 
3160  STEPGRA = (float) k / (float)360.0; // step/degree
3161 
3162 
3163 
3164  x = (ang - AST.Pos); // (-35-0) = -35 //1
3165  //(55-(-35)) = -90 //2
3166  //(56-55) = 1 //3
3167  //(90-96) = 6 //4
3168 
3169 
3170  n = (long) (x * STEPGRA * DAS.StepM.multiplier[AMS3][1]); //4 e' la riduzione
3171 
3172  prepos = AST.Pos;
3173  AST.Pos = ang;
3174  AST.realazpos = raz;
3175 
3176  sprintf(buf, " %.1lf --> %.1lf", prepos, ang);
3177  Status(buf);
3178 
3179  // Select direction
3180  if(n < 0)
3181  dir = 1;
3182  else
3183  dir = 0;
3184 
3185  n = labs(n);
3186 
3187 
3188 
3189 
3190  if (n==0)
3191  {
3192  //Attiva i pulsanti sulla keyboard
3193  DB_KB_ButtonActive(1);
3194  return 1;
3195  }
3196 */
3197  // Eseguo n passi
3198  if(n)
3199  {
3200  er = DB_StepMotor(AMS3, 5, DAS.StepM.nstep[AMS3][DAS.StepM.SM_B], DAS.StepM.Revo[AMS3][DAS.StepM.SM_B]);
3201  if (er)
3202  {
3203  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS3][1], "SYS\\ledGreen.bmp");
3204  }
3205  }
3206 
3207 
3208  //sprintf(buf, "%.1lf%s %.1lf%s", ang, " °", raz, " °");
3209  sprintf(buf, "%.1lf", AST.realazpos );
3211  if(!FLAG.fileprg || !FLAG.exec )
3212  //Attiva i pulsanti sulla keyboard se non si sta eseguendo una tabella di misure
3213  //oppure se il programma e' stato sospeso (si e' premuto il tasto "pause")
3214  DB_KB_ButtonActive(1);
3215 
3216 
3217 
3218  if(er) return 1;
3219 
3220 
3221  return 0;
3222 
3223 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
MOBJECT KeyB[28]
Keyboard Buttons.
double realazpos
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
unsigned long nstep[AMSMAX][2]
Number of steps to be executed.
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
void MObjectSetText(MOBJECT obj, const char *text)
AzimuthSt AST
Definition: Spat_Device.c:25
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
pushbutt PushButt
Push buttons.
int Revo[AMSMAX][2]
Revolution Direction CW CCW.
flag FLAG
flags structure
Definition: Spat_Device.c:19
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
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 step[AMSMAX][2]
Stepper Motors Step.
double Pos
Azimuth Current Position.
void MObjectSetSensitive(MOBJECT obj)
float MIGEAz(float p)
Definition: CreateForms.c:3475
#define AMS3
AMS3 address.
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SD_FilterW()

int SD_FilterW ( int  filter)

Positioning Filter wheel.
The filter wheel move on the filter number specified by filter.
See also Filter Wheel page.

Parameters
filter
  • 0 = NULL
  • 1 = NULL
  • 2 = UG5
  • 3 = UG11
  • 4 = BG23
  • 5 = ND
    – For LIS Spectrometer the filter wheel is bigger so we have 2 filters more and the filter parameter renges since 0 to 7.
Returns
er:
  • 0 = Operation concluded succesfully
  • 1 = Problems in positioning

Definition at line 2244 of file Spat_Device.c.

References controlpanel::Albl_LS, AMS2, gui::ContrPanel, DB_KB_ButtonActive(), DB_StepMotor(), paramini::EqType, flag::exec, Fil_Code, Fil_Code8H, Fil_CodeNG, Fil_CodeNG1, Fil_CodeTropo, flag::fileprg, FWS, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, das::Gui, gui::HorizMeas, pushbutt::KeyB, horizmeas::lbl, controlpanel::LedSM, LIS_, flag::manhormeas, MMessageDialog(), MObjectSetSensitive(), MObjectSetText(), MPixmapSetImageFile(), das::Paramini, FilterWheelSt::Pos, gui::PushButt, SM_stepr(), SPATRAM, SPATRAM2, SPATRAM3, SPATRAMPLUS, Status(), stepm::step, das::StepM, and TROPOGAS.

Referenced by AutoR_SetND_Filter(), D_Calibra(), D_Measure(), DB_KeyB_CB(), E_AAMeasure(), E_Almucantar(), E_Average(), E_AvgCCDHor(), E_DFMeasure(), E_DirectSun(), E_Filter(), E_HgScan(), E_IRefSun(), E_Meashor(), E_Meashor2(), E_Measure(), and E_QjScan().

2245 {
2246 
2247  char buf[80];
2248  long n[3];
2249  long nx;
2250  int d, dir[3]; // 0 = CW, 1 = CCW
2251  int k , er;
2252 // char Filter[4];
2253 
2254  //Disattiva i pulsanti sulla keyboard
2255  DB_KB_ButtonActive(0);
2258 
2259  /************************************************************/
2260  //Sceglie quale ruota e' installata (a 8 fori....
2261  if(DAS.Paramini.EqType == LIS_)
2262  {
2263  k = SM_stepr(DAS.StepM.step[AMS2][0]) / 8;
2264 
2265  if(filter < 0 || filter > 7) return 0;
2266  }
2267  // ...oppure a 6 fori....
2268  else if (DAS.Paramini.EqType == SPATRAM ||
2269  DAS.Paramini.EqType == GASCODNG1 ||
2271  DAS.Paramini.EqType == TROPOGAS ||
2275  DAS.Paramini.EqType == SPATRAM3 ||
2277  {
2278  k = SM_stepr(DAS.StepM.step[AMS2][0]) / 6;
2279  if(filter < 0 || filter > 5) return 0;
2280  }
2281  else // ...oppure non lo sa)
2282  {
2283  sprintf(buf, "For this Equipment the Filter Wheel type is UNKNOWN\nPlease Contact DANBO!!!!");
2284  er = MMessageDialog("DAS information", buf, "Ok", NULL);
2285  if (!er)
2286  {
2287  return 0;
2288  }
2289 
2290  }
2291  /**************************************************************/
2292 
2293  n[2] = (long)(FWS.Pos - filter) * k;
2294 
2295  if(n[2] < 0) dir[2] = 1;
2296  else dir[2] = 0;
2297  n[2] = labs(n[2]);
2298 
2299  nx = n[2];
2300  d = dir[2];
2301 
2302  // Eseguo NStep
2303 
2304  Status("New Filter Wheel Position");
2305 
2306 
2307  if(nx)
2308  {
2309  er=DB_StepMotor(AMS2, 2, nx, d);
2310  if (er)
2311  {
2312  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS2][0], "SYS\\ledGreen.bmp");
2313  }
2314  }
2315 
2316 
2317  FWS.Pos = filter;
2318  if ( DAS.Paramini.EqType == LIS_)
2319  sprintf(buf, "%s", Fil_Code8H[filter]);
2320  else
2321  {
2322  if(DAS.Paramini.EqType == TROPOGAS)
2323  sprintf(buf, "%s",Fil_CodeTropo[filter]);
2325  sprintf(buf, "%s",Fil_CodeNG[filter]);
2326  else if (DAS.Paramini.EqType == GASCODNG1)
2327  sprintf(buf, "%s",Fil_CodeNG1[filter]);
2328  else
2329  sprintf(buf, "%s",Fil_Code[filter]);
2330  }
2331 
2333  if(FLAG.manhormeas)
2334  MObjectSetText(DAS.Gui.HorizMeas.lbl[2], buf);
2335  Status("Ready");
2336 
2337  if(!FLAG.fileprg || !FLAG.exec )
2338  //Attiva i pulsanti sulla keyboard se non si sta eseguendo una tabella di misure
2339  //oppure se il programma e' stato sospeso (si e' premuto il tasto "pause")
2340  DB_KB_ButtonActive(1);
2341 
2342 
2343  if(er) return 1;
2344 
2345  return 0;
2346 
2347 
2348 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
#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
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
#define AMS2
AMS2 address.
MOBJECT KeyB[28]
Keyboard Buttons.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
void MObjectSetText(MOBJECT obj, const char *text)
int Pos
Filter Wheel current Position.
#define LIS_
Lampedusa Island Spectrometer - ENEA.
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
horizmeas HorizMeas
Structure for Horizontal Measurements.
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
#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
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
pushbutt PushButt
Push buttons.
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
char * Fil_CodeNG1[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrum...
Definition: DAS_Spat.c:213
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
#define SPATRAM3
SPATRAM3.
flag FLAG
flags structure
Definition: Spat_Device.c:19
char * Fil_Code[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:207
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 manhormeas
1 = horizontal measurements in manual mode
int step[AMSMAX][2]
Stepper Motors Step.
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
int EqType
Spectrometer Type.
void MObjectSetSensitive(MOBJECT obj)
MOBJECT lbl[15]
generic labels for hor meas shell
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
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:

§ SD_FNTorqueM()

void SD_FNTorqueM ( int  mod)

Positioning NDFilter.
.

Definition at line 3066 of file Spat_Device.c.

References controlpanel::Albl_LS, AMS1, AMS_wopto(), gui::ContrPanel, das::Gui, controlpanel::LedSM, MObjectSetText(), MPixmapSetImageFile(), stepm::OOP, das::StepM, and TMFlg.

Referenced by AutoR_SetND_Filter(), DB_KeyB_CB(), E_AAMeasure(), E_Almucantar(), E_DFMeasure(), E_DirectSun(), E_HgScan(), and E_QjScan().

3067 {
3068 
3069  if(mod)
3070  {
3071 
3072  // Bitwise inclusive OR
3073  //The bitwise-inclusive-OR operator compares each bit of its first operand to
3074  //the corresponding bit of its second operand. If either bit is 1,
3075  //the corresponding result bit is set to 1. Otherwise, the corresponding
3076  //result bit is set to 0.
3077  //i.e if(DAS.StepM.OOP[AMS1] = 00000000) -->
3078  //DAS.StepM.OOP[AMS1] | 0x10 = 00000000 | 00010000 = 00010000
3079  DAS.StepM.OOP[AMS1] |= 0x10; //bit 4, 00010000
3080  TMFlg = 1;
3082  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[1][1], "SYS\\ledGreen.bmp");
3083 
3084  }
3085  else
3086  {
3087  //The bitwise-AND operator compares each bit of its first operand to
3088  //the corresponding bit of its second operand. If both bits are 1,
3089  //the corresponding result bit is set to 1. Otherwise, the corresponding
3090  //result bit is set to 0.
3091  //i.e if(DAS.StepM.OOP[AMS1] = 00010000) -->
3092  //DAS.StepM.OOP[AMS1] | 0xEF = 00010000 | 11101111 = 00000000
3093  DAS.StepM.OOP[AMS1] &= 0xEF; //11111011
3094 
3095  TMFlg = 0;
3096  MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[3], " OFF");
3097  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[1][1], "SYS\\ledoff.bmp");
3098  }
3099 
3100  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
3101 
3103 
3104  DAS.StepM.OOP[AMS1] = ~DAS.StepM.OOP[AMS1];
3105 
3106 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
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.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
void MObjectSetText(MOBJECT obj, const char *text)
int TMFlg
Definition: DAS_Spatram.h:2972
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
int AMS_wopto(int id, unsigned int w)
write the value on the optoinsulated port write the value on the optoinsulated port.
Definition: Dxl.c:911
controlpanel ContrPanel
Control Panel Structure.
#define AMS1
AMS1 address.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SD_Grating()

int SD_Grating ( int  ang)

Positioning Grating.
The Grating move to the position specified by ang (Wavelength)

Parameters
ang–> int from 0 to 14 –> grating position –> Wavelength
Returns
er:
  • = 0 –> Operation concluded succesfully
  • = 1 –> Problems in positioning

Definition at line 2108 of file Spat_Device.c.

References controlpanel::Albl_LS, AMS1, gui::ContrPanel, DB_KB_ButtonActive(), DB_StepMotor(), GratingSt::dp, flag::exec, flag::fileprg, das::Gui, gui::HorizMeas, pushbutt::KeyB, horizmeas::lbl, controlpanel::LedSM, flag::manhormeas, MObjectSetSensitive(), MObjectSetText(), MPixmapSetImageFile(), stepm::multiplier, stepm::nstep, GratingSt::Pos, gui::PushButt, SM_stepr(), Status(), stepm::step, das::StepM, wav, wl, and GratingSt::Wl.

Referenced by D_Calibra(), D_Measure(), DB_KeyB_CB(), E_AAMeasure(), E_Almucantar(), E_Average(), E_AvgCCDHor(), E_DFMeasure(), E_DirectSun(), E_HgScan(), E_IRefSun(), E_Lambda(), E_Meashor(), E_Meashor2(), E_Measure(), E_QjScan(), and WinRes().

2109 {
2110  int er = 0;
2111  char buf[80];
2112  long n, dp = 1500; // dp sono i dead pulse, vanno aggiunti all'inversione per il recupero del gioco
2113  int dir;
2114  float k = 0;
2115  long period = 5000;
2116  int prepos;
2117  long prestep;
2118  //se ang non e' compreso nei limiti esce dalla function
2119  if(ang < 0 || ang > 18) return 0;
2120 
2121  //Status("Set NEW Grating Position");
2122 
2123  //Disable the keyboard buttons
2124  DB_KB_ButtonActive(0);
2127 
2128 
2129  /******************************************
2130  //in SD_Position
2131  k = SM_stepr(DAS.StepM.step[AMS1][1])/3200;
2132  n = (long)(((float) (-wav[GRS.Wl] + wav[w]) ) * 4 * k);
2133 
2134  if(n < 0)
2135  dir = 1;
2136  else
2137  dir = 0;
2138 
2139  n = labs(n);
2140 
2141 
2142  /***********************************************/
2143 
2144  //Multiplier factor depending on the values of microsteps
2145  k = (float)SM_stepr(DAS.StepM.step[AMS1][1])/3200;
2146 
2147  //Actual steps sent to the grating motor
2148  n = (long)(((float) (-wav[GRS.Wl] + wav[ang]) ) * DAS.StepM.multiplier[AMS1][1] * k);
2149 
2150  prepos = wl[GRS.Wl];
2151  prestep = wav[GRS.Wl];
2152  GRS.Wl = ang;
2153 
2154  sprintf(buf, " %4d --> %4d", prepos, wl[ang]);
2155  Status(buf);
2156 
2157  //Select the direction (n < 0 --> Dir = 1 = UV; n > 0 --> Dir = 0 = Vis.)
2158  if(n < 0)
2159  dir = 1;
2160  else
2161  dir = 0;
2162 
2163  n = labs(n);
2164  DAS.StepM.nstep[AMS1][1]= n;
2165 
2166  if(n && dir == 0) //towards UV
2167  n += GRS.dp; // add fixed step number for backlash recovery (recupero del gioco)
2168 
2169 
2170  GRS.Pos = n;
2171 
2172  if (n==0)
2173  {
2174  //Attiva i pulsanti sulla keyboard
2175  DB_KB_ButtonActive(1);
2176  return 1;
2177  }
2178 
2179  // Eseguo n passi
2180  if(n)
2181  {
2182  er = DB_StepMotor(AMS1, 1, n, dir);
2183  if (er)
2184  {
2185  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][1], "SYS\\ledGreen.bmp");
2186  }
2187  }
2188 
2189  //Se ci si e' mossi verso l'UV si fa il recupero del gioco
2190 /* if(DAS.Paramini.EqType == LIS_)
2191  {
2192  if(dir == 1)
2193  {
2194  er=DB_StepMotor(AMS1, 1, GRS.dp, 1);
2195  if (er)
2196  {
2197  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM2, "SYS\\ledGreen.bmp");
2198  }
2199  }
2200 
2201  }
2202  else if (DAS.Paramini.EqType == SPATRAM || DAS.Paramini.EqType == GASCODNG || DAS.Paramini.EqType == SPATRAMPLUS || DAS.Paramini.EqType == TROPOGAS )
2203  {
2204 */
2205  if(n && dir == 0)
2206  {
2207  er=DB_StepMotor(AMS1, 1, GRS.dp, 1);
2208  if (er)
2209  {
2210  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][1], "SYS\\ledGreen.bmp");
2211  }
2212  }
2213 // }
2214 
2215 
2216  sprintf(buf, "%4d", wl[ang]);
2218 
2219  sprintf(buf, "Steps : %ld", (-prestep + wav[ang]) );
2220  Status(buf);
2221 
2222  if(FLAG.manhormeas)
2223  MObjectSetText(DAS.Gui.HorizMeas.lbl[1], buf);
2224  if(!FLAG.fileprg || !FLAG.exec )
2225  //Attiva i pulsanti sulla keyboard se non si sta eseguendo una tabella di misure
2226  //oppure se il programma e' stato sospeso (si e' premuto il tasto "pause")
2227  DB_KB_ButtonActive(1);
2228 
2229 
2230 
2231  if(er) return 1;
2232 
2233 
2234  return 0;
2235 
2236 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
MOBJECT KeyB[28]
Keyboard Buttons.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
unsigned long nstep[AMSMAX][2]
Number of steps to be executed.
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
void MObjectSetText(MOBJECT obj, const char *text)
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
int Wl
Grating Wavelength.
horizmeas HorizMeas
Structure for Horizontal Measurements.
long dp
Grating backslash recovery steps.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
pushbutt PushButt
Push buttons.
flag FLAG
flags structure
Definition: Spat_Device.c:19
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
int fileprg
Flag indicating the execution of a PRG file: = 0 –> No PRG File; = 1 –> PRG file in execution...
controlpanel ContrPanel
Control Panel Structure.
GratingSt GRS
Grating.
Definition: Spat_Device.c:22
#define AMS1
AMS1 address.
int manhormeas
1 = horizontal measurements in manual mode
int step[AMSMAX][2]
Stepper Motors Step.
long Pos
Grating Position.
long wav[]
Step Number definition - for SD_Grating.
Definition: DAS_Spat.c:195
void MObjectSetSensitive(MOBJECT obj)
MOBJECT lbl[15]
generic labels for hor meas shell
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SD_Mirror()

int SD_Mirror ( int  where)

Positioning Input Mirror.
The Input Mirror reaches the position specified by where.

Parameters
where–> int from 0 to 3 –> grating position –> Wavelength
Returns
er:
  • = 0 –> Operation concluded succesfully
  • = 1 –> Problems in positioning

Definition at line 1898 of file Spat_Device.c.

References controlpanel::Albl_LS, AMS1, gui::ContrPanel, DB_KB_ButtonActive(), DB_StepMotor(), paramini::EqType, flag::exec, flag::fileprg, GASCODNG4, das::Gui, gui::HorizMeas, pushbutt::KeyB, horizmeas::lbl, controlpanel::LedSM, flag::manhormeas, Mir_Code, Mir_CodeTropo, MIS, MObjectSetSensitive(), MObjectSetText(), MPixmapSetImageFile(), stepm::multiplier, paramini::Offset, das::Paramini, MirrorSt::Pos, gui::PushButt, SM_stepr(), SPATRAM3, Status(), stepm::step, das::StepM, and TROPOGAS.

Referenced by D_Calibra(), D_Measure(), DB_KeyB_CB(), E_AAMeasure(), E_Almucantar(), E_Average(), E_AvgCCDHor(), E_DFMeasure(), E_DirectSun(), E_HgScan(), E_IRefSun(), E_Meashor(), E_Meashor2(), E_Measure(), E_Mirror(), E_QjScan(), and GetDefPix().

1899 {
1900 
1901  char buf[80];
1902  long n[3];
1903  long nx;
1904  int d, dir[3]; // 0 = CW, 1 = CCW
1905  int k = 1500, er = 0;
1906 
1907  int StepWithOffset [4][4];
1908 
1909  //mtr1(or 2) = 0 --> motor off
1910  //mtr1(or 2) = 1 --> motor on
1911  /* 22 */
1912 // AMS_MotorOn_Off(AMS1, 1, 0);
1913 
1914 // k = SM_stepr(DAS.StepM.step[AMS1][0]) * 6 / 4;
1915 
1916  k = SM_stepr(DAS.StepM.step[AMS1][0]) * DAS.StepM.multiplier[AMS1][0] / 4; //4 is the number of positions
1917 
1918  StepWithOffset [0][0] = 0;
1919  StepWithOffset [0][1] = 3*k - DAS.Paramini.Offset[2];
1920  StepWithOffset [0][2] = 2*k - DAS.Paramini.Offset[3];
1921  StepWithOffset [0][3] = k - DAS.Paramini.Offset[4];
1922 
1923  StepWithOffset [1][0] = k + DAS.Paramini.Offset[2];
1924  StepWithOffset [1][1] = 0;
1925  StepWithOffset [1][2] = 3*k - DAS.Paramini.Offset[3] + DAS.Paramini.Offset[2];
1926  StepWithOffset [1][3] = 2*k - DAS.Paramini.Offset[4]+ DAS.Paramini.Offset[2];
1927 
1928  StepWithOffset [2][0] = 2*k + DAS.Paramini.Offset[3];
1929  StepWithOffset [2][1] = k - DAS.Paramini.Offset[2]+DAS.Paramini.Offset[3];
1930  StepWithOffset [2][2] = 0;
1931  StepWithOffset [2][3] = 3*k - DAS.Paramini.Offset[4]+DAS.Paramini.Offset[3];
1932 
1933  StepWithOffset [3][0] = 3*k + DAS.Paramini.Offset[4];
1934  StepWithOffset [3][1] = 2*k - DAS.Paramini.Offset[2]+ DAS.Paramini.Offset[4];
1935  StepWithOffset [3][2] = k - DAS.Paramini.Offset[3] + DAS.Paramini.Offset[4];
1936  StepWithOffset [3][3] = 0;
1937 
1938 
1939 
1940 
1941 
1942  if(where < 0 || where > 3) return 0;
1943 
1944  //Disattiva i pulsanti sulla keyboard
1945  DB_KB_ButtonActive(0);
1948 
1949  nx = StepWithOffset [where][MIS.Pos];
1950  d = 1;
1951 
1952 
1953 // Procedure by danbo (20/10/2005)
1954 /*
1955  er = (long)(MIS.Pos - where);
1956 
1957  switch (er)
1958  {
1959  case 0:
1960  n[2] = 0;
1961  break;
1962  case 1:
1963  n[2] = er * k * 3;
1964 
1965  break;
1966  case -3:
1967  case -1:
1968  case 2:
1969  case (-2):
1970  n[2] = er * k;
1971  break;
1972  case 3:
1973  n[2] = er * k / 3;
1974 
1975  break;
1976 
1977  }
1978 
1979 
1980  dir[2] = 1;
1981  n[2] = labs(n[2]);
1982 */
1983  /*
1984  if (er < 0)
1985  n[2] += DAS.Paramini.Offset[where + 1];
1986  if (er > 0)
1987  n[2] -= DAS.Paramini.Offset[MIS.Pos + 1];
1988 */
1989 /*
1990  if(DAS.Paramini.Offset[MIS.Pos + 1] != 0 || DAS.Paramini.Offset[where + 1] != 0)
1991  {
1992 
1993  n[2] += (DAS.Paramini.Offset[MIS.Pos + 1] + DAS.Paramini.Offset[where + 1]);
1994 
1995  }
1996 */
1997 /*
1998  switch (where)
1999  {
2000  case 0:
2001  switch (MIS.Pos)
2002  case 0:
2003  n[2] = 0;
2004  break;
2005  case 1;
2006 */
2007 
2008  // n[2] += DAS.Paramini.Offset[MIS.Pos + 1];
2009 
2010 
2011 // sprintf(buf," MISPos:%d, where:%d, numstep=%ld, dir=%d", MIS.Pos, where, n[2], dir[2]);
2012 // MMessageDialog("DAS Inf", buf, "ok", NULL);
2013 
2014 
2015 //Previous version
2016 /*
2017  n[0] = (long) (4 - where + MIS.Pos) * k;
2018  dir[0] = 1;
2019 
2020  n[1] = (long) (4 - MIS.Pos + where) * k;
2021  dir[1] = 0;
2022 */
2023 // n[2] = (long)(MIS.Pos - where) * k;
2024 
2025 
2026  // In order to move the mirror always in the same direction
2027 // dir[2] = 1;
2028  // the direction is chosen depending on the previous position
2029 /* if(n[2] < 0) dir[2] = 1;
2030  else dir[2] = 0;
2031 */
2032 
2033 // n[2] = labs(n[2]);
2034 
2035  // Cerca il valore minimo
2036 /* for(c = 0; c < 2; c++)
2037  if(n[c] < n[c + 1]) { d = dir[c]; nx = n[c]; }
2038  else { d = dir[c + 1]; nx = n[c + 1]; }
2039 
2040  if (nx==0) return 1;
2041 
2042 
2043  nx = n[2];
2044  d = dir[2];
2045 */
2046  // Eseguo NStep
2047 
2048  Status("New Input Mirror Position");
2049 
2050  if(nx)
2051  {
2052  er = DB_StepMotor(AMS1, 0, nx, d);
2053 
2054  if (er)
2055  {
2056  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][0], "SYS\\ledGreen.bmp");
2057  }
2058 
2059 
2060  }
2061 
2062 
2063 
2064  MIS.Pos = where;
2065  /*--------------------------------------------------------------------*/
2066  // Send OffSet for Mirror position
2067 
2068 /* if(DAS.Paramini.Offset[MIS.Pos + 1] != 0)
2069  {
2070  if(DAS.Paramini.Offset[MIS.Pos + 1] > 0) d = 0;
2071  else d = 1;
2072 
2073  er = AMS_DoPos(AMS1, d, 0, labs(DAS.Paramini.Offset[MIS.Pos + 1]), 0);
2074  if(er) { Message("n Step not sent! 2", er); }
2075  }
2076 */
2077  /*--------------------------------------------------------------------*/
2079  sprintf(buf, "%s",Mir_CodeTropo[where]);
2080  else
2081  sprintf(buf, "%s",Mir_Code[where]);
2082 
2084  if(FLAG.manhormeas)
2085  MObjectSetText(DAS.Gui.HorizMeas.lbl[0], buf);
2086 
2087 
2088 
2089 // Status("Ready");
2090  if(!FLAG.fileprg || !FLAG.exec )
2091  //Attiva i pulsanti sulla keyboard se non si sta eseguendo una tabella di misure
2092  //oppure se il programma e' stato sospeso (si e' premuto il tasto "pause")
2093  DB_KB_ButtonActive(1);
2094 
2095 // AMS_MotorOn_Off(AMS1, 0, 0);
2096 
2097  if(er) return 1;
2098 
2099  return 0;
2100 
2101 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
const char * Mir_Code[]
const char array for the realisation of the Mirrors buttons in the Mirror shell
Definition: DAS_Spat.c:231
MOBJECT KeyB[28]
Keyboard Buttons.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
int Pos
Mirror Current Position.
int Offset[16]
Offset of the hardware devices (Input Mirror (5), Grating, Filter Wheel...)
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
void MObjectSetText(MOBJECT obj, const char *text)
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
horizmeas HorizMeas
Structure for Horizontal Measurements.
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
pushbutt PushButt
Push buttons.
#define GASCODNG4
GASCODNG 4.
#define SPATRAM3
SPATRAM3.
MirrorSt MIS
Mirror.
Definition: DAS_Spat.c:61
flag FLAG
flags structure
Definition: Spat_Device.c:19
int fileprg
Flag indicating the execution of a PRG file: = 0 –> No PRG File; = 1 –> PRG file in execution...
controlpanel ContrPanel
Control Panel Structure.
#define AMS1
AMS1 address.
int manhormeas
1 = horizontal measurements in manual mode
int step[AMSMAX][2]
Stepper Motors Step.
int EqType
Spectrometer Type.
void MObjectSetSensitive(MOBJECT obj)
MOBJECT lbl[15]
generic labels for hor meas shell
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
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:

§ SD_NDFilterW()

int SD_NDFilterW ( int  filter)

Positioning Filter wheel.
The filter wheel move on the filter number specified by filter.
See also Filter Wheel page.

Parameters
filter
  • 0 = NULL
  • 1 = ND1
  • 2 = ND2
  • 3 =
  • 4 =
  • 5 =
    – For LIS Spectrometer the filter wheel is bigger so we have 2 filters more and the filter parameter renges since 0 to 7.
Returns
er:
  • 0 = Operation concluded succesfully
  • 1 = Problems in positioning

Definition at line 2354 of file Spat_Device.c.

References controlpanel::Albl_LS, AMS2, gui::ContrPanel, DB_KB_ButtonActive(), DB_StepMotor(), paramini::EqType, flag::exec, Fil_Code8H, Fil_CodeNG, Fil_CodeTropo, flag::fileprg, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, das::Gui, gui::HorizMeas, pushbutt::KeyB, horizmeas::lbl, controlpanel::LedSM, LIS_, flag::manhormeas, MMessageDialog(), MObjectSetSensitive(), MObjectSetText(), MPixmapSetImageFile(), NDFil_Code, NDFWS, das::Paramini, NDFilterWheelSt::Pos, gui::PushButt, SM_stepr(), SPATRAM, SPATRAM2, SPATRAM3, SPATRAMPLUS, Status(), stepm::step, das::StepM, and TROPOGAS.

Referenced by AutoR_SetND_Filter(), DB_KeyB_CB(), E_AAMeasure(), E_Almucantar(), E_DFMeasure(), E_DirectSun(), E_HgScan(), E_NDFilter(), and E_QjScan().

2355 {
2356 
2357  char buf[80];
2358  long n[3];
2359  long nx;
2360  int d, dir[3]; // 0 = CW, 1 = CCW
2361  int k , er;
2362 // char Filter[4];
2363 
2364  //Disattiva i pulsanti sulla keyboard
2365  DB_KB_ButtonActive(0);
2368 
2369  /************************************************************/
2370  if (DAS.Paramini.EqType == SPATRAM ||
2371  DAS.Paramini.EqType == GASCODNG1 ||
2373  DAS.Paramini.EqType == TROPOGAS ||
2377  DAS.Paramini.EqType == SPATRAM3 ||
2379  {
2380  k = SM_stepr(DAS.StepM.step[AMS2][1]) / 6;
2381  if(filter < 0 || filter > 5) return 0;
2382  }
2383  else // ...oppure non lo sa)
2384  {
2385  sprintf(buf, "For this Equipment the Filter Wheel type is UNKNOWN\nPlease Contact DANBO!!!!");
2386  er = MMessageDialog("DAS information", buf, "Ok", NULL);
2387  if (!er)
2388  {
2389  return 0;
2390  }
2391 
2392  }
2393  /**************************************************************/
2394 
2395  n[2] = (long)(NDFWS.Pos - filter) * k;
2396 
2397  if(n[2] < 0) dir[2] = 1;
2398  else dir[2] = 0;
2399  n[2] = labs(n[2]);
2400 
2401  nx = n[2];
2402  d = dir[2];
2403 
2404  // Eseguo NStep
2405 
2406  Status("New ND Filter Wheel Position");
2407 
2408 
2409  if(nx)
2410  {
2411  er=DB_StepMotor(AMS2, 3, nx, d);
2412  if (er)
2413  {
2414  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS2][1], "SYS\\ledGreen.bmp");
2415  }
2416  }
2417 
2418 
2419  NDFWS.Pos = filter;
2420  if ( DAS.Paramini.EqType == LIS_)
2421  sprintf(buf, "%s", Fil_Code8H[filter]);
2422  else
2423  {
2424  if(DAS.Paramini.EqType == TROPOGAS)
2425  sprintf(buf, "%s",Fil_CodeTropo[filter]);
2427  sprintf(buf, "%s",Fil_CodeNG[filter]);
2428  else
2429  sprintf(buf, "%s",NDFil_Code[filter]);
2430  }
2431 
2433  if(FLAG.manhormeas)
2434  MObjectSetText(DAS.Gui.HorizMeas.lbl[3], buf);
2435  Status("Ready");
2436 
2437  if(!FLAG.fileprg || !FLAG.exec )
2438  //Attiva i pulsanti sulla keyboard se non si sta eseguendo una tabella di misure
2439  //oppure se il programma e' stato sospeso (si e' premuto il tasto "pause")
2440  DB_KB_ButtonActive(1);
2441 
2442 
2443  if(er) return 1;
2444 
2445  return 0;
2446 
2447 
2448 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
#define SPATRAM
SPectrometer for Atmospheric TRAcers Measurements - CGE-UE Portugal.
NDFilterWheelSt NDFWS
ND Filter Wheel.
Definition: DAS_Spat.c:58
gui Gui
Graphic User Interface Structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
int Pos
Filter Wheel current Position.
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
#define AMS2
AMS2 address.
MOBJECT KeyB[28]
Keyboard Buttons.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
void MObjectSetText(MOBJECT obj, const char *text)
#define LIS_
Lampedusa Island Spectrometer - ENEA.
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
horizmeas HorizMeas
Structure for Horizontal Measurements.
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
#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
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
pushbutt PushButt
Push buttons.
#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.
flag FLAG
flags structure
Definition: Spat_Device.c:19
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 manhormeas
1 = horizontal measurements in manual mode
int step[AMSMAX][2]
Stepper Motors Step.
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
char * NDFil_Code[]
const char array for the realisation of the Filters buttons in the ND Filter shell ...
Definition: DAS_Spat.c:219
int EqType
Spectrometer Type.
void MObjectSetSensitive(MOBJECT obj)
MOBJECT lbl[15]
generic labels for hor meas shell
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
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:

§ SD_PosAADev()

int SD_PosAADev ( double  z,
double  a 
)

perform the simoultaneous positioning of the AltAzimuth platform z = Zenith Axis a = Grating Position

Definition at line 447 of file Spat_Device.c.

References optionini::aaopmode, controlpanel::Albl_LS, AMS3, AMS_sendstep(), optionini::amsprogbar, gui::ContrPanel, D_VRangeSim(), DBDEMO, DD_VOpen, das::DOption, flag::exemode, das::Flag, das::Gui, controlpanel::LedSM, MIGEAz(), MIGEZen(), MLoopWhileEvents(), MObjectSetText(), MPixmapSetImageFile(), stepm::multiplier, stepm::NAMS, stepm::nstep, ZenithSt::Pos, AzimuthSt::Pos, stepm::postime, AzimuthSt::realazpos, ZenithSt::realzenpos, stepm::Revo, S_azim, stepm::SM_A, stepm::SM_B, SM_stepr(), stepm::speed_Hz, st, stepm::step, das::StepM, and WriteLogAMS().

Referenced by MIGEAntiSunTrack(), and MIGESunTrack().

448 {
449 
450  int k, i, s, dir;
451  float GRASTEP, STEPGRA;
452  long minpostime = 2147483647, maxpostime = 0;
453  long st, et, tt, n;
454  double ttout = 0, yy;
455  char buf[80];
456  long dp = 500; // dp are the dead pulse, they have to be added for backlash recovery
457  //float MAZMax = 120.0; //MIGE Azimut MAX
458  //float MAZMin = -60.0; //MIGE Azimut Min
459  float rzenang, razang, az;
460 
461  float MAZMax = 90.0; //MIGE Azimut MAX
462  float MAZMin = -90.0; //MIGE Azimut Min
463 
464 
465  k=DAS.StepM.NAMS-1;
466  for (i=0;i<2;i++)
467  {
468  s = 2 * k + i;
469  DD_VOpen[s] = 0;
470  }
471 
472 
473  //a --> Azimuth
474 
475  //Azimuth positioning
476  razang=MIGEAz((float)a);
477 
478  k = SM_stepr(DAS.StepM.step[AMS3][DAS.StepM.SM_B]); // step/round
479 
480  GRASTEP = (float)360.0 / (float) k; // degree/step
481 
482  STEPGRA = (float) k / (float)360.0; // step/degree
483 
484  yy = (razang - AST.Pos);
485 
486  n = (long) (yy * STEPGRA * DAS.StepM.multiplier[AMS3][1]);
487 
488  AST.Pos = razang;
489  AST.realazpos = a;
490 
491  // Select direction
492  if(n < 0)
493  dir = 1;
494  else
495  dir = 0;
496 
497  n = labs(n);
498  DAS.StepM.Revo[AMS3][DAS.StepM.SM_B] = dir;
499  DAS.StepM.nstep[AMS3][DAS.StepM.SM_B] = n;
500 
501 /**************************************************************************/
502  /*******************************/
503  //z --> Zenith
504  //if(z >= -91 && z <= 45 )
505 // if(z >= -90 && z <= 90 )
506  //Zenith positioning
507  rzenang=MIGEZen((float)z);
508 
509  if(z >= 0 && z <= 180 )
510  {
511 
512  k = SM_stepr(DAS.StepM.step[AMS3][DAS.StepM.SM_A]); // step/round
513 
514  GRASTEP = (float) 360.0 / (float) k; // degree/step
515 
516  STEPGRA = (float) k / (float) 360.0; // step/degree
517 
518 // yy = -(z - ZST.Pos);
519  yy = -(rzenang - ZST.Pos);
520  n = (long)(yy * STEPGRA * (DAS.StepM.multiplier[AMS3][0]));
521 // ZST.Pos = z;
522  ZST.Pos = rzenang;
523  ZST.realzenpos = z;
524  // Select direction
525  if(n < 0)
526  dir = 1;
527  else
528  dir = 0;
529 
530  n = labs(n);
531  DAS.StepM.Revo[AMS3][DAS.StepM.SM_A] = dir;
532  DAS.StepM.nstep[AMS3][DAS.StepM.SM_A] = n;
533  }
534  else
535  {
536  DAS.StepM.Revo[AMS3][DAS.StepM.SM_A] = 0;
537  DAS.StepM.nstep[AMS3][DAS.StepM.SM_A] = 0;
538  sprintf(buf, "Not Allowed Zen.");
540 
541  }
542 
543 
544 /**************************************************************************/
545  // Tout computation and Max finding
546  k=DAS.StepM.NAMS-1;
547  for (i=0;i<2;i++)
548  {
549  DAS.StepM.postime[k][i] = (long) (DAS.StepM.nstep[k][i]/(float) DAS.StepM.speed_Hz[k][i]);
550  if (DAS.StepM.postime[k][i] >= maxpostime) maxpostime = DAS.StepM.postime[k][i];
551  if (DAS.StepM.postime[k][i] <= minpostime) minpostime = DAS.StepM.postime[k][i];
552  }
553 /*************************************************************************/
554 
555 /**************************************************************************/
556  // Init Progression bar
557  k=DAS.StepM.NAMS-1;
558  for (i=0;i<2;i++)
559  {
560  if (DAS.StepM.nstep[k][i] != 0)
561  {
562  s = 2*k+i;
563  switch (s)
564  {
565  case 0:
567  D_VRangeSim(0, "Positioning Mirror",0, 255, 0, 0, 50, 0);
568  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
569 
570  break;
571  case 1:
573  D_VRangeSim(1, "Positioning Grating",0, 255, 255, 0, 50, 100);
574  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
575  break;
576  case 2:
578  D_VRangeSim(2, "Positioning Filter Wheel",0, 0, 0, 255, 50, 200);
579  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
580  break;
581  case 3:
582  break;
583  case 4:
585  if(DAS.DOption.aaopmode == 2)
586  {
587  D_VRangeSim(4,"Positioning Zenith",0, 0, 255, 255, 50, 300);
588 
589  }
590  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
591  break;
592  case 5:
594  if(DAS.DOption.aaopmode == 2)
595  {
596  D_VRangeSim(5,"Positioning Azimuth",0, 0, 192, 255, 50, 400);
597 
598  }
599  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
600  break;
601 
602 
603  }
604  }
605  }
606 
607 /*************************************************************************/
608 
609 /**************************************************************************/
610  // Send step
611  if (DAS.Flag.exemode != DBDEMO)
612  {
613  k=DAS.StepM.NAMS-1;
616 
619 
620  }
621 
622  //Time Out loop
623  st = GetTickCount();
624  do
625  {
626  et = GetTickCount();
627  tt = labs(et - st);
628  MLoopWhileEvents(0);
629  if(tt > 0)
630  {
631  if(DD_VOpen[4])
632  {
634  D_VRangeSim(4, NULL,(unsigned long) tt * 100 / DAS.StepM.postime[AMS3][0], 0, 255, 255, 50, 300);
635  if (tt >= DAS.StepM.postime[AMS3][0])
636  {
637  sprintf(buf, "%.1lf", z);
639  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][0], "SYS\\ledGreen.bmp");
640  }
641  else
642  {
643  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS3][0]))/1000.0 ));
645  }
646  }
647  else
648  {
649  if (tt >= DAS.StepM.postime[AMS3][0])
650  {
651  sprintf(buf, "%.1lf", ZST.realzenpos);
652 
654  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][0], "SYS\\ledGreen.bmp");
655  }
656  else
657  {
658  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS3][0]))/1000.0 ));
660  }
661 
662  }
663 
664  if(DD_VOpen[5])
665  {
667  D_VRangeSim(5, NULL,(unsigned long) tt * 100 / DAS.StepM.postime[AMS3][1], 0, 192, 255, 50, 400);
668  if (labs(et - st) >= DAS.StepM.postime[AMS3][1])
669  {
670  az = (float)S_azim;
671  //sprintf(buf, "%.1lf %.1lf", az, a );
672  sprintf(buf, "%.1lf", AST.realazpos);
674  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][1], "SYS\\ledGreen.bmp");
675  }
676  else
677  {
678  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS3][1]))/1000.0 ));
680  }
681  }
682  else
683  {
684  if (labs(et - st) >= DAS.StepM.postime[AMS3][1])
685  {
686  az = (float)S_azim;
687  //sprintf(buf, "%.1lf %.1lf", az, a );
688  sprintf(buf, " %.1lf", AST.realazpos );
690  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][1], "SYS\\ledGreen.bmp");
691  }
692  else
693  {
694  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS3][1]))/1000.0 ));
696  }
697 
698  }
699 
700 
701  }
702  }while((tt < maxpostime));
703 /**************************************************************************/
704 
705 /**************************************************************************/
706 
707  // Check if all the progression bars have been destroyed.
708  // If not the active one is destroyed and the apprpriate label is written
709  k=DAS.StepM.NAMS-1;
710  for (i=0;i<2;i++)
711  {
712  s = 2*k+i;
713  if(DD_VOpen[s])
714  {
716  D_VRangeSim(s, NULL, 100, 0, 0, 0, 0, 0);
717  switch (s)
718  {
719  case 4:
720  sprintf(buf, "%.1lf", z);
722  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledGreen.bmp");
723  break;
724  case 5:
725  sprintf(buf, "%.1lf", (double) a);
727  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledGreen.bmp");
728  break;
729 
730 
731  }
732  }
733  }
734 
735 
736 
737 return 0;
738 
739 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
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.
void D_VRangeSim(int id, char *str, int val, int r, int g, int b, int x, int y)
init progress bar during simultaneous positioning
Definition: Utils.c:258
void MLoopWhileEvents(int discard)
optionini DOption
Options for DAS execution.
int NAMS
Number of AMSs Devices.
double realazpos
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
unsigned long nstep[AMSMAX][2]
Number of steps to be executed.
flag Flag
Structure for different flags.
#define DBDEMO
execution in demo mode
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
void MObjectSetText(MOBJECT obj, const char *text)
AzimuthSt AST
Definition: Spat_Device.c:25
long postime[AMSMAX][2]
time necessary for positioning
void WriteLogAMS(int id, int dira, int dirb, unsigned long stepa, unsigned long stepb)
Definition: Spat_Device.c:299
int Revo[AMSMAX][2]
Revolution Direction CW CCW.
ZenithSt ZST
Definition: Spat_Device.c:24
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
controlpanel ContrPanel
Control Panel Structure.
int DD_VOpen[16]
Definition: Utils.c:151
static double st
Definition: SOLPOS.C:142
int step[AMSMAX][2]
Stepper Motors Step.
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
int aaopmode
operation mode for the Alt Az Platform, 0 = solar Traxker; 1 = Anti-Solar Tracker; 2 = Free Positioni...
double realzenpos
double Pos
Azimuth Current Position.
int AMS_sendstep(int id, int dira, int dirb, unsigned long stepa, unsigned long stepb)
Send steps Procedure for sending steps to the Stepper Motor.
Definition: Dxl.c:513
float MIGEZen(float p)
Definition: CreateForms.c:3419
double Pos
Zenith Current Position.
float MIGEAz(float p)
Definition: CreateForms.c:3475
int exemode
Set the Execution MODE (Execution modes)
#define AMS3
AMS3 address.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SD_Position()

int SD_Position ( int  m,
int  w,
int  f,
double  z,
double  a 
)

perform the simoultaneous positioning of the Spectrometer Devices m = mirror w = wavelength (Grating) f = filter wheel z = zenith a = azimuth

Definition at line 1243 of file Spat_Device.c.

References optionini::aaopmode, controlpanel::Albl_LS, AMS1, AMS2, AMS3, AMS_sendstep(), optionini::amsprogbar, gui::ContrPanel, D_VRangeSim(), DB_StepMotor(), DBDEMO, DD_VOpen, das::DOption, GratingSt::dp, paramini::EqType, flag::exemode, Fil_Code, Fil_Code8H, Fil_CodeNG, Fil_CodeNG1, Fil_CodeTropo, das::Flag, FWS, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, das::Gui, controlpanel::LedSM, LIS_, MIGEAz(), MIGEZen(), Mir_Code, Mir_CodeTropo, MIS, MLoopWhileEvents(), MObjectSetText(), MPixmapSetImageFile(), stepm::multiplier, stepm::NAMS, stepm::nstep, paramini::Offset, das::Paramini, FilterWheelSt::Pos, MirrorSt::Pos, ZenithSt::Pos, AzimuthSt::Pos, stepm::postime, AzimuthSt::realazpos, ZenithSt::realzenpos, stepm::Revo, stepm::SM_A, stepm::SM_B, SM_stepr(), SPATRAM, SPATRAM2, SPATRAM3, SPATRAMPLUS, stepm::speed_Hz, st, stepm::step, das::StepM, TROPOGAS, wav, wl, GratingSt::Wl, and WriteLogAMS().

Referenced by E_AAMeasure(), E_AAPos(), E_Almucantar(), E_DirectSun(), E_IRefSun(), ExecSimPosCB(), and MIGEZenAzPos_CB().

1244 {
1245 
1246  int k, i, s, er, dir;
1247  float GRASTEP, STEPGRA;
1248  long minpostime = 2147483647, maxpostime = 0;
1249  long st, et, tt, n;
1250  double ttout = 0, yy;
1251  char buf[80], str[16];
1252  long dp = 500; // dp sono i dead pulse, vanno aggiunti all'inversione per il recupero del gioco
1253  float razang, rzenang;
1254  int StepWithOffset [4][4];
1255  float g;
1256 
1257 
1258  for(k=0;k<DAS.StepM.NAMS;k++)
1259  { for (i=0;i<2;i++)
1260  {
1261  s = 2 * k + i;
1262  DD_VOpen[s] = 0;
1263  }
1264  }
1265  /*******************************/
1266 
1267  if((m >= 0) && (m <= 3))
1268  {
1269  k = SM_stepr(DAS.StepM.step[AMS1][DAS.StepM.SM_A]) * 6 / 4;
1270 
1271 
1272 /* er = (long)(MIS.Pos - m);
1273  switch (er)
1274  {
1275  case 0:
1276  n = 0;
1277  break;
1278  case 1:
1279  n = er * k * 3;
1280  break;
1281  case -3:
1282  case -1:
1283  case 2:
1284  case (-2):
1285  n = er * k;
1286  break;
1287  case 3:
1288  n = er * k / 3;
1289  break;
1290 
1291  }
1292 */
1293  StepWithOffset [0][0] = 0;
1294  StepWithOffset [0][1] = 3*k - DAS.Paramini.Offset[2];
1295  StepWithOffset [0][2] = 2*k - DAS.Paramini.Offset[3];
1296  StepWithOffset [0][3] = k - DAS.Paramini.Offset[4];
1297 
1298  StepWithOffset [1][0] = k + DAS.Paramini.Offset[2];
1299  StepWithOffset [1][1] = 0;
1300  StepWithOffset [1][2] = 3*k - DAS.Paramini.Offset[3] + DAS.Paramini.Offset[2];
1301  StepWithOffset [1][3] = 2*k - DAS.Paramini.Offset[4]+ DAS.Paramini.Offset[2];
1302 
1303  StepWithOffset [2][0] = 2*k + DAS.Paramini.Offset[3];
1304  StepWithOffset [2][1] = k - DAS.Paramini.Offset[2]+DAS.Paramini.Offset[3];
1305  StepWithOffset [2][2] = 0;
1306  StepWithOffset [2][3] = 3*k - DAS.Paramini.Offset[4]+DAS.Paramini.Offset[3];
1307 
1308  StepWithOffset [3][0] = 3*k + DAS.Paramini.Offset[4];
1309  StepWithOffset [3][1] = 2*k - DAS.Paramini.Offset[2]+ DAS.Paramini.Offset[4];
1310  StepWithOffset [3][2] = k - DAS.Paramini.Offset[3] + DAS.Paramini.Offset[4];
1311  StepWithOffset [3][3] = 0;
1312 
1313 
1314  dir = 1;
1315  n = StepWithOffset [m][MIS.Pos];
1316  n = labs(n);
1317  DAS.StepM.Revo[AMS1][DAS.StepM.SM_A] = dir;
1318  DAS.StepM.nstep[AMS1][DAS.StepM.SM_A] = n;
1319  MIS.Pos = m;
1320  }
1321  else
1322  {
1323  DAS.StepM.Revo[AMS1][DAS.StepM.SM_A] = 0;
1324  DAS.StepM.nstep[AMS1][DAS.StepM.SM_A] = 0;
1325 
1326  }
1327 
1328  /******************************/
1329 
1330  /*******************************/
1331  //w
1332  if(w >= 0 && w <= 17)
1333  {
1334  g = (float) SM_stepr(DAS.StepM.step[AMS1][1])/3200;
1335  n = (long)(((float) (-wav[GRS.Wl] + wav[w]) ) * 4 * g);
1336 
1337  if(n < 0)
1338  dir = 1;
1339  else
1340  dir = 0;
1341 
1342  n = labs(n);
1343 
1344 
1345  if(n && dir == 0) //si va verso l'UV
1346  n += GRS.dp; // // add fixed step number for backlash recovery
1347 
1348  DAS.StepM.Revo[AMS1][DAS.StepM.SM_B] = dir;
1349  DAS.StepM.nstep[AMS1][DAS.StepM.SM_B] = n;
1350  GRS.Wl = w;
1351  }
1352  else
1353  {
1354  DAS.StepM.Revo[AMS1][DAS.StepM.SM_B] = 0;
1355  DAS.StepM.nstep[AMS1][DAS.StepM.SM_B] = 0;
1356 
1357  }
1358  /*******************************/
1359 
1360  /*******************************/
1361  //f
1362 
1363  //8 holes....
1364  if(DAS.Paramini.EqType == LIS_)
1365  {
1366  k = SM_stepr(DAS.StepM.step[AMS2][DAS.StepM.SM_A]) / 8;
1367  if(f >= 0 && f <= 8)
1368  {
1369  n= (long)(FWS.Pos - f) * k;
1370  if(n < 0)
1371  dir = 1;
1372  else
1373  dir = 0;
1374 
1375  n = labs(n);
1376  DAS.StepM.Revo[AMS2][DAS.StepM.SM_A] = dir;
1377  DAS.StepM.nstep[AMS2][DAS.StepM.SM_A] = n;
1378  FWS.Pos = f;
1379  }
1380  else
1381  {
1382  n = 0;
1383  DAS.StepM.Revo[AMS2][DAS.StepM.SM_A] = 0;
1384  DAS.StepM.nstep[AMS2][DAS.StepM.SM_A] = 0;
1385  }
1386 
1387 
1388  }
1389  // ...or 6 holes....
1390  if (DAS.Paramini.EqType == SPATRAM ||
1391  DAS.Paramini.EqType == GASCODNG1 ||
1393  DAS.Paramini.EqType == TROPOGAS ||
1394  DAS.Paramini.EqType == GASCODNG2 ||
1397  DAS.Paramini.EqType == SPATRAM3 ||
1399  {
1400  k = SM_stepr(DAS.StepM.step[AMS2][DAS.StepM.SM_A]) / 6;
1401  if(f >= 0 && f <= 5)
1402  {
1403  n= (long)(FWS.Pos - f) * k;
1404  if(n < 0)
1405  dir = 1;
1406  else
1407  dir = 0;
1408 
1409  n = labs(n);
1410  DAS.StepM.Revo[AMS2][DAS.StepM.SM_A] = dir;
1411  DAS.StepM.nstep[AMS2][DAS.StepM.SM_A] = n;
1412  FWS.Pos = f;
1413  }
1414  else
1415  {
1416  n = 0;
1417  DAS.StepM.Revo[AMS2][DAS.StepM.SM_A] = 0;
1418  DAS.StepM.nstep[AMS2][DAS.StepM.SM_A] = 0;
1419  }
1420  }
1421 
1422  /*******************************/
1423  //a --> Azimuth
1424 
1425  //Azimuth positioning
1426  razang=MIGEAz((float)a);
1427 
1428  k = SM_stepr(DAS.StepM.step[AMS3][DAS.StepM.SM_B]); // step/round
1429 
1430  GRASTEP = (float)360.0 / (float) k; // degree/step
1431 
1432  STEPGRA = (float) k / (float)360.0; // step/degree
1433 
1434  yy = (razang - AST.Pos);
1435 
1436  n = (long) (yy * STEPGRA * DAS.StepM.multiplier[AMS3][1]);
1437 
1438  AST.Pos = razang;
1439  AST.realazpos = a;
1440 
1441  // Select direction
1442  if(n < 0)
1443  dir = 1;
1444  else
1445  dir = 0;
1446 
1447  n = labs(n);
1448  DAS.StepM.Revo[AMS3][DAS.StepM.SM_B] = dir;
1449  DAS.StepM.nstep[AMS3][DAS.StepM.SM_B] = n;
1450 
1451 /**************************************************************************/
1452  /*******************************/
1453  //z --> Zenith
1454  //if(z >= -91 && z <= 45 )
1455 // if(z >= -90 && z <= 90 )
1456  //Zenith positioning
1457  rzenang=MIGEZen((float)z);
1458 
1459  if(z >= 0 && z <= 180 )
1460  {
1461 
1462 
1463 
1464 
1465 
1466  k = SM_stepr(DAS.StepM.step[AMS3][DAS.StepM.SM_A]); // step/round
1467 
1468  GRASTEP = (float) 360.0 / (float) k; // degree/step
1469 
1470  STEPGRA = (float) k / (float) 360.0; // step/degree
1471 
1472 // yy = -(z - ZST.Pos);
1473  yy = -(rzenang - ZST.Pos);
1474  n = (long)(yy * STEPGRA * (DAS.StepM.multiplier[AMS3][0]));
1475 // ZST.Pos = z;
1476  ZST.Pos = rzenang;
1477  ZST.realzenpos = z;
1478  // Select direction
1479  if(n < 0)
1480  dir = 1;
1481  else
1482  dir = 0;
1483 
1484  n = labs(n);
1485  DAS.StepM.Revo[AMS3][DAS.StepM.SM_A] = dir;
1486  DAS.StepM.nstep[AMS3][DAS.StepM.SM_A] = n;
1487  }
1488  else
1489  {
1490  DAS.StepM.Revo[AMS3][DAS.StepM.SM_A] = 0;
1491  DAS.StepM.nstep[AMS3][DAS.StepM.SM_A] = 0;
1492  sprintf(buf, "Not Allowed Zen.");
1494 
1495  }
1496  /*******************************/
1497 
1498 
1499 
1500 
1501 
1502  // Tout computation and Max finding
1503  for(k=0;k<DAS.StepM.NAMS;k++)
1504  {
1505  for (i=0;i<2;i++)
1506  {
1507  DAS.StepM.postime[k][i] = (long)( DAS.StepM.nstep[k][i]/(float) DAS.StepM.speed_Hz[k][i]);
1508  if (DAS.StepM.postime[k][i] >= maxpostime) maxpostime = DAS.StepM.postime[k][i];
1509  if (DAS.StepM.postime[k][i] <= minpostime) minpostime = DAS.StepM.postime[k][i];
1510  }
1511  }
1512 /*************************************************************************/
1513 
1514 /**************************************************************************/
1515  // Init Progression bar
1516  for(k=0;k<DAS.StepM.NAMS;k++)
1517  {
1518  for (i=0;i<2;i++)
1519  {
1520  if (DAS.StepM.nstep[k][i] != 0)
1521  {
1522  s = 2*k+i;
1523  switch (s)
1524  {
1525  case 0:
1526  if(DAS.DOption.amsprogbar)
1527  D_VRangeSim(0, "Positioning Mirror",0, 255, 0, 0, 50, 0);
1528  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
1529 
1530  break;
1531  case 1:
1532  if(DAS.DOption.amsprogbar)
1533  D_VRangeSim(1, "Positioning Grating",0, 255, 255, 0, 50, 100);
1534  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
1535  break;
1536  case 2:
1537  if(DAS.DOption.amsprogbar)
1538  D_VRangeSim(2, "Positioning Filter Wheel",0, 0, 0, 255, 50, 200);
1539  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
1540  break;
1541  case 3:
1542  break;
1543  case 4:
1544  if(DAS.DOption.amsprogbar)
1545  if(DAS.DOption.aaopmode == 2)
1546  {
1547  D_VRangeSim(4,"Positioning Zenith",0, 0, 255, 255, 50, 300);
1548 
1549  }
1550  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
1551  break;
1552  case 5:
1553  if(DAS.DOption.amsprogbar)
1554  if(DAS.DOption.aaopmode == 2)
1555  {
1556  D_VRangeSim(5,"Positioning Azimuth",0, 0, 192, 255, 50, 400);
1557 
1558  }
1559  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
1560  break;
1561 
1562 
1563  }
1564  }
1565  }
1566  }
1567 /*************************************************************************/
1568 
1569 /**************************************************************************/
1570  // Send step
1571 
1572  for(k=0;k<DAS.StepM.NAMS;k++)
1573  {
1574  if (DAS.Flag.exemode != DBDEMO)
1575  {
1578  }
1581 
1582  }
1583 
1584 
1585  //Time Out loop
1586  st = GetTickCount();
1587  do
1588  {
1589  et = GetTickCount();
1590  tt = labs(et - st);
1591  MLoopWhileEvents(0);
1592  if(tt > 0)
1593  {
1594 
1595  if(DD_VOpen[0])
1596  {
1597  if(DAS.DOption.amsprogbar)
1598  D_VRangeSim(0 ,NULL,(unsigned long) tt * 100 / DAS.StepM.postime[AMS1][0], 255, 0, 0, 50, 0);
1599  sprintf(buf, "%.1f sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS1][0]))/1000.0 ));
1601  if (tt >= DAS.StepM.postime[AMS1][0])
1602  {
1604  sprintf(str, "%s",Mir_CodeTropo[m]);
1605  else
1606  sprintf(str, "%s",Mir_Code[m]);
1607 
1608  sprintf(buf, "%s", str);
1610  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][0], "SYS\\ledGreen.bmp");
1611 
1612  }
1613  }
1614  else
1615  {
1616  sprintf(buf, "%.1f sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS1][0]))/1000.0 ));
1618  if (tt >= DAS.StepM.postime[AMS1][0])
1619  {
1620  if (m != -1)
1621  {
1623  sprintf(str, "%s",Mir_CodeTropo[m]);
1624  else
1625  sprintf(str, "%s",Mir_Code[m]);
1626 
1627  }
1628  else
1629  {
1631  sprintf(str, "%s",Mir_CodeTropo[MIS.Pos]);
1632  else
1633  sprintf(str, "%s",Mir_Code[MIS.Pos]);
1634 
1635  //sprintf(buf, "%s", str);
1636  //MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[0], buf);
1637  //MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][0], "SYS\\ledGreen.bmp");
1638 
1639  }
1640  sprintf(buf, "%s", str);
1642  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][0], "SYS\\ledGreen.bmp");
1643 
1644 
1645  }
1646 
1647  }
1648  if(DD_VOpen[1])
1649  {
1650  if(DAS.DOption.amsprogbar)
1651  D_VRangeSim(1, NULL,(unsigned long) tt * 100 / DAS.StepM.postime[AMS1][1], 255, 255, 0, 50, 100);
1652  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS1][1]))/1000.0 ));
1654  if (tt >= DAS.StepM.postime[AMS1][1])
1655  {
1656  sprintf(buf, "%4d", wl[w]);
1658  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][1], "SYS\\ledGreen.bmp");
1659  }
1660  }
1661  else
1662  {
1663  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS1][1]))/1000.0 ));
1665  if (tt >= DAS.StepM.postime[AMS1][1])
1666  {
1667  if(w != -1)
1668  sprintf(buf, "%4d", wl[w]);
1669  else
1670  sprintf(buf, "%4d", wl[GRS.Wl]);
1672  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][1], "SYS\\ledGreen.bmp");
1673  }
1674  }
1675  if(DD_VOpen[2])
1676  {
1677  if(DAS.DOption.amsprogbar)
1678  D_VRangeSim(2, NULL,(unsigned long) tt * 100 / DAS.StepM.postime[AMS2][0], 0, 0, 255, 50, 200);
1679  sprintf(buf, "%.1lf sec. left", (double)fabs(((double) (tt - DAS.StepM.postime[AMS2][0]) )/1000.0 ));
1681  if (tt >= DAS.StepM.postime[AMS2][0])
1682  {
1683  if ( DAS.Paramini.EqType == LIS_)
1684  sprintf(buf, "%s", Fil_Code8H[f]);
1685  else
1686  {
1687  if(DAS.Paramini.EqType == TROPOGAS)
1688  sprintf(buf, "%s",Fil_CodeTropo[f]);
1690  sprintf(buf, "%s",Fil_CodeNG[f]);
1691  else if (DAS.Paramini.EqType == GASCODNG1)
1692  sprintf(buf, "%s",Fil_CodeNG1[f]);
1693  else
1694  sprintf(buf, "%s",Fil_Code[f]);
1695  }
1697  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[1][0], "SYS\\ledGreen.bmp");
1698  }
1699  }
1700  else
1701  {
1702  sprintf(buf, "%.1lf sec. left", (double)fabs(((double) (tt - DAS.StepM.postime[AMS2][0]) )/1000.0 ));
1704  if (tt >= DAS.StepM.postime[AMS2][0])
1705  {
1706  if(f != -1)
1707  {
1708  if ( DAS.Paramini.EqType == LIS_)
1709  sprintf(buf, "%s", Fil_Code8H[f]);
1710  else
1711  {
1712  if(DAS.Paramini.EqType == TROPOGAS)
1713  sprintf(buf, "%s",Fil_CodeTropo[f]);
1715  sprintf(buf, "%s",Fil_CodeNG[f]);
1716  else if (DAS.Paramini.EqType == GASCODNG1)
1717  sprintf(buf, "%s",Fil_CodeNG1[f]);
1718  else
1719  sprintf(buf, "%s",Fil_Code[f]);
1720  }
1721  }
1722  else
1723  {
1724  if ( DAS.Paramini.EqType == LIS_)
1725  sprintf(buf, "%s", Fil_Code8H[FWS.Pos]);
1726  else
1727  {
1728  if(DAS.Paramini.EqType == TROPOGAS)
1729  sprintf(buf, "%s",Fil_CodeTropo[FWS.Pos]);
1731  sprintf(buf, "%s",Fil_CodeNG[FWS.Pos]);
1732  else
1733  sprintf(buf, "%s",Fil_Code[FWS.Pos]);
1734  }
1735  }
1736 
1738  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[1][0], "SYS\\ledGreen.bmp");
1739  }
1740  }
1741 
1742  if(DD_VOpen[4])
1743  {
1744  if(DAS.DOption.amsprogbar)
1745  D_VRangeSim(4, NULL,(unsigned long) tt * 100 / DAS.StepM.postime[AMS3][0], 0, 255, 255, 50, 300);
1746  if (tt >= DAS.StepM.postime[AMS3][0])
1747  {
1748  sprintf(buf, "%.1lf", z);
1750  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][0], "SYS\\ledGreen.bmp");
1751  }
1752  else
1753  {
1754  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS3][0]))/1000.0 ));
1756  }
1757  }
1758  else
1759  {
1760  if (tt >= DAS.StepM.postime[AMS3][0])
1761  {
1762  sprintf(buf, "%.1lf", z);
1764  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][0], "SYS\\ledGreen.bmp");
1765  }
1766  else
1767  {
1768  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS3][0]))/1000.0 ));
1770  }
1771 
1772  }
1773 
1774  if(DD_VOpen[5])
1775  {
1776  if(DAS.DOption.amsprogbar)
1777  D_VRangeSim(5, NULL,(unsigned long) tt * 100 / DAS.StepM.postime[AMS3][1], 0, 192, 255, 50, 400);
1778  if (labs(et - st) >= DAS.StepM.postime[AMS3][1])
1779  {
1780  sprintf(buf, "%.1lf", a);
1782  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][1], "SYS\\ledGreen.bmp");
1783  }
1784  else
1785  {
1786  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS3][1]))/1000.0 ));
1788  }
1789  }
1790  else
1791  {
1792  if (labs(et - st) >= DAS.StepM.postime[AMS3][1])
1793  {
1794  sprintf(buf, "%.1lf", a);
1796  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[2][1], "SYS\\ledGreen.bmp");
1797  }
1798  else
1799  {
1800  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS3][1]))/1000.0 ));
1802  }
1803 
1804  }
1805 
1806 
1807  }
1808  }while((tt < maxpostime));
1809 /**************************************************************************/
1810 /**************************************************************************/
1811 
1812  // Check if all the progression bars have been destroyed.
1813  // If not the active one is destroyed and the apprpriate label is written
1814  for(k=0;k<DAS.StepM.NAMS;k++)
1815  {
1816  for (i=0;i<2;i++)
1817  {
1818  s = 2*k+i;
1819  if(DD_VOpen[s])
1820  {
1821  if(DAS.DOption.amsprogbar)
1822  D_VRangeSim(s, NULL, 100, 0, 0, 0, 0, 0);
1823  switch (s)
1824  {
1825  case 0:
1826  if (m != -1)
1827  {
1829  sprintf(str, "%s",Mir_CodeTropo[m]);
1830  else
1831  sprintf(str, "%s",Mir_Code[m]);
1832  sprintf(buf, "%s", str);
1834  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledGreen.bmp");
1835  }
1836  break;
1837  case 1:
1838  sprintf(buf, "%4d", wl[w]);
1840  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledGreen.bmp");
1841  break;
1842  case 2:
1843  if ( DAS.Paramini.EqType == LIS_)
1844  sprintf(buf, "%s", Fil_Code8H[f]);
1845  else
1846  {
1847  if(DAS.Paramini.EqType == TROPOGAS)
1848  sprintf(buf, "%s",Fil_CodeTropo[f]);
1850  sprintf(buf, "%s",Fil_CodeNG[f]);
1851  else if (DAS.Paramini.EqType == GASCODNG1)
1852  sprintf(buf, "%s",Fil_CodeNG1[f]);
1853  else
1854  sprintf(buf, "%s",Fil_Code[f]);
1855  }
1857  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledGreen.bmp");
1858  break;
1859  case 3:
1860 
1861  break;
1862  case 4:
1863  sprintf(buf, "%.1lf", z);
1865  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledGreen.bmp");
1866  break;
1867  case 5:
1868  sprintf(buf, "%.1lf", (double) a);
1870  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledGreen.bmp");
1871  break;
1872 
1873 
1874  }
1875  }
1876  }
1877 
1878  }
1879 /**************************************************************************/
1880  //Recupero del gioco per grating
1881 
1882  if(DAS.StepM.nstep[AMS1][DAS.StepM.SM_B] && (DAS.StepM.Revo[AMS1][DAS.StepM.SM_B] == 0) )
1883  {
1884  er=DB_StepMotor(AMS1, 1, GRS.dp, 1);
1885  if (er)
1886  {
1887  sprintf(buf, "%4d", wl[w]);
1889  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][1], "SYS\\ledGreen.bmp");
1890  }
1891  }
1892 
1893 /**************************************************************************/
1894  return 0;
1895 
1896 
1897 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
#define SPATRAM
SPectrometer for Atmospheric TRAcers Measurements - CGE-UE Portugal.
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.
void D_VRangeSim(int id, char *str, int val, int r, int g, int b, int x, int y)
init progress bar during simultaneous positioning
Definition: Utils.c:258
void MLoopWhileEvents(int discard)
optionini DOption
Options for DAS execution.
#define AMS2
AMS2 address.
const char * Mir_Code[]
const char array for the realisation of the Mirrors buttons in the Mirror shell
Definition: DAS_Spat.c:231
int NAMS
Number of AMSs Devices.
double realazpos
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
unsigned long nstep[AMSMAX][2]
Number of steps to be executed.
int Pos
Mirror Current Position.
flag Flag
Structure for different flags.
#define DBDEMO
execution in demo mode
int Offset[16]
Offset of the hardware devices (Input Mirror (5), Grating, Filter Wheel...)
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
void MObjectSetText(MOBJECT obj, const char *text)
int Pos
Filter Wheel current Position.
AzimuthSt AST
Definition: Spat_Device.c:25
#define LIS_
Lampedusa Island Spectrometer - ENEA.
int Wl
Grating Wavelength.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
long dp
Grating backslash recovery steps.
long postime[AMSMAX][2]
time necessary for positioning
#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 WriteLogAMS(int id, int dira, int dirb, unsigned long stepa, unsigned long stepb)
Definition: Spat_Device.c:299
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
int Revo[AMSMAX][2]
Revolution Direction CW CCW.
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
ZenithSt ZST
Definition: Spat_Device.c:24
char * Fil_CodeNG1[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrum...
Definition: DAS_Spat.c:213
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
#define SPATRAM3
SPATRAM3.
MirrorSt MIS
Mirror.
Definition: DAS_Spat.c:61
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
char * Fil_Code[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:207
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
controlpanel ContrPanel
Control Panel Structure.
GratingSt GRS
Grating.
Definition: Spat_Device.c:22
#define AMS1
AMS1 address.
int DD_VOpen[16]
Definition: Utils.c:151
static double st
Definition: SOLPOS.C:142
int step[AMSMAX][2]
Stepper Motors Step.
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
int aaopmode
operation mode for the Alt Az Platform, 0 = solar Traxker; 1 = Anti-Solar Tracker; 2 = Free Positioni...
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
double realzenpos
int EqType
Spectrometer Type.
double Pos
Azimuth Current Position.
long wav[]
Step Number definition - for SD_Grating.
Definition: DAS_Spat.c:195
int AMS_sendstep(int id, int dira, int dirb, unsigned long stepa, unsigned long stepb)
Send steps Procedure for sending steps to the Stepper Motor.
Definition: Dxl.c:513
float MIGEZen(float p)
Definition: CreateForms.c:3419
double Pos
Zenith Current Position.
float MIGEAz(float p)
Definition: CreateForms.c:3475
int exemode
Set the Execution MODE (Execution modes)
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
#define AMS3
AMS3 address.
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
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:

§ SD_PosOMUDev()

int SD_PosOMUDev ( int  m,
int  w,
int  f 
)

perform the simoultaneous positioning of the Spectrometer Devices in the OMU Unit m = mirror w = wavelength (Grating) f = filter wheel

Definition at line 747 of file Spat_Device.c.

References controlpanel::Albl_LS, AMS1, AMS2, AMS_sendstep(), optionini::amsprogbar, gui::ContrPanel, D_VRangeSim(), DB_StepMotor(), DBDEMO, DD_VOpen, das::DOption, GratingSt::dp, paramini::EqType, flag::exemode, Fil_Code, Fil_Code8H, Fil_CodeNG, Fil_CodeNG1, Fil_CodeTropo, das::Flag, FWS, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, das::Gui, controlpanel::LedSM, LIS_, Mir_Code, Mir_CodeTropo, MIS, MLoopWhileEvents(), MObjectSetText(), MPixmapSetImageFile(), stepm::multiplier, stepm::NAMS, stepm::nstep, paramini::Offset, das::Paramini, FilterWheelSt::Pos, MirrorSt::Pos, stepm::postime, stepm::Revo, stepm::SM_A, stepm::SM_B, SM_stepr(), SPATRAM, SPATRAM2, SPATRAM3, SPATRAMPLUS, stepm::speed_Hz, st, stepm::step, das::StepM, TROPOGAS, wav, wl, GratingSt::Wl, and WriteLogAMS().

Referenced by E_AvgCCDHor(), E_DFMeasure(), E_Meashor(), E_Meashor2(), and E_Measure().

748 {
749 
750  int k, i, s, er, dir;
751  int backlash = 0;
752 // float GRASTEP, STEPGRA;
753  long minpostime = 2147483647, maxpostime = 0;
754  long st, et, tt, n;
755  double ttout = 0;
756  char buf[80], str[16];
757  long dp = 500; // dp sono i dead pulse, vanno aggiunti all'inversione per il recupero del gioco
758  int StepWithOffset [4][4];
759  float g = 0;
760 
761  for(k=0;k<DAS.StepM.NAMS;k++)
762  { for (i=0;i<2;i++)
763  {
764  s = 2 * k + i;
765  DD_VOpen[s] = 0;
766  }
767  }
768  /*******************************/
769 
770  if((m >= 0) && (m <= 3))
771  {
772  k = SM_stepr(DAS.StepM.step[AMS1][DAS.StepM.SM_A]) * 6 / 4;
773 /* er = (long)(MIS.Pos - m);
774  switch (er)
775  {
776  case 0:
777  n = 0;
778  break;
779  case 1:
780  n = er * k * 3;
781  break;
782  case -3:
783  case -1:
784  case 2:
785  case (-2):
786  n = er * k;
787  break;
788  case 3:
789  n = er * k / 3;
790  break;
791 
792  }
793 
794  */
795  k = SM_stepr(DAS.StepM.step[AMS1][0]) * DAS.StepM.multiplier[AMS1][0] / 4; //4 is the number of positions
796 
797  StepWithOffset [0][0] = 0;
798  StepWithOffset [0][1] = 3*k - DAS.Paramini.Offset[2];
799  StepWithOffset [0][2] = 2*k - DAS.Paramini.Offset[3];
800  StepWithOffset [0][3] = k - DAS.Paramini.Offset[4];
801 
802  StepWithOffset [1][0] = k + DAS.Paramini.Offset[2];
803  StepWithOffset [1][1] = 0;
804  StepWithOffset [1][2] = 3*k - DAS.Paramini.Offset[3] + DAS.Paramini.Offset[2];
805  StepWithOffset [1][3] = 2*k - DAS.Paramini.Offset[4]+ DAS.Paramini.Offset[2];
806 
807  StepWithOffset [2][0] = 2*k + DAS.Paramini.Offset[3];
808  StepWithOffset [2][1] = k - DAS.Paramini.Offset[2]+DAS.Paramini.Offset[3];
809  StepWithOffset [2][2] = 0;
810  StepWithOffset [2][3] = 3*k - DAS.Paramini.Offset[4]+DAS.Paramini.Offset[3];
811 
812  StepWithOffset [3][0] = 3*k + DAS.Paramini.Offset[4];
813  StepWithOffset [3][1] = 2*k - DAS.Paramini.Offset[2]+ DAS.Paramini.Offset[4];
814  StepWithOffset [3][2] = k - DAS.Paramini.Offset[3] + DAS.Paramini.Offset[4];
815  StepWithOffset [3][3] = 0;
816 
817  n = StepWithOffset [m][MIS.Pos];
818 
819 
820 
821  dir = 1;
822  //n = labs(n);
823  DAS.StepM.Revo[AMS1][DAS.StepM.SM_A] = dir;
824  DAS.StepM.nstep[AMS1][DAS.StepM.SM_A] = n;
825  MIS.Pos = m;
826  }
827  else
828  {
829  DAS.StepM.Revo[AMS1][DAS.StepM.SM_A] = 0;
830  DAS.StepM.nstep[AMS1][DAS.StepM.SM_A] = 0;
831 
832  }
833 
834  /******************************/
835  /******************************/
836  //w - Grating position section
837  if(w >= 0 && w <= 17)
838  {
839  g = (float) SM_stepr(DAS.StepM.step[AMS1][1])/3200;
840  n = (long)(((float) (-wav[GRS.Wl] + wav[w]) ) * 4 * g);
841 
842  if(n < 0)
843  dir = 1;
844  else
845  {
846  dir = 0;
847  backlash = 1; //for the backlash recovery
848  }
849  n = labs(n);
850 
851 
852  if(n && dir == 0) //si va verso l'UV
853  n += GRS.dp; // // add fixed step number for backlash recovery
854 
855  DAS.StepM.Revo[AMS1][DAS.StepM.SM_B] = dir;
856  DAS.StepM.nstep[AMS1][DAS.StepM.SM_B] = n;
857  GRS.Wl = w;
858  }
859  else
860  {
861  DAS.StepM.Revo[AMS1][DAS.StepM.SM_B] = 0;
862  DAS.StepM.nstep[AMS1][DAS.StepM.SM_B] = 0;
863 
864  }
865  /*******************************/
866  /*******************************/
867  // f - Filter wheel Section
868 
869  //8 holes....
870  if(DAS.Paramini.EqType == LIS_)
871  {
872  k = SM_stepr(DAS.StepM.step[AMS2][DAS.StepM.SM_A]) / 8;
873  if(f >= 0 && f <= 8)
874  {
875  n= (long)(FWS.Pos - f) * k;
876  if(n < 0)
877  dir = 1;
878  else
879  dir = 0;
880 
881  n = labs(n);
882  DAS.StepM.Revo[AMS2][DAS.StepM.SM_A] = dir;
883  DAS.StepM.nstep[AMS2][DAS.StepM.SM_A] = n;
884  FWS.Pos = f;
885  }
886  else
887  {
888  n = 0;
889  DAS.StepM.Revo[AMS2][DAS.StepM.SM_A] = 0;
890  DAS.StepM.nstep[AMS2][DAS.StepM.SM_A] = 0;
891  }
892 
893 
894  }
895  // ...or 6 holes....
896  if (DAS.Paramini.EqType == SPATRAM ||
899  DAS.Paramini.EqType == TROPOGAS ||
905  {
906  k = SM_stepr(DAS.StepM.step[AMS2][DAS.StepM.SM_A]) / 6;
907  if(f >= 0 && f <= 5)
908  {
909  n= (long)(FWS.Pos - f) * k;
910  if(n < 0)
911  dir = 1;
912  else
913  dir = 0;
914 
915  n = labs(n);
916  DAS.StepM.Revo[AMS2][DAS.StepM.SM_A] = dir;
917  DAS.StepM.nstep[AMS2][DAS.StepM.SM_A] = n;
918  FWS.Pos = f;
919  }
920  else
921  {
922  n = 0;
923  DAS.StepM.Revo[AMS2][DAS.StepM.SM_A] = 0;
924  DAS.StepM.nstep[AMS2][DAS.StepM.SM_A] = 0;
925  }
926  }
927 
928 /**************************************************************************/
929  // Tout computation and Max finding
930  for(k=0;k<2;k++)
931  {
932  for (i=0;i<2;i++)
933  {
934  DAS.StepM.postime[k][i] = (long)( DAS.StepM.nstep[k][i]/(float) DAS.StepM.speed_Hz[k][i]);
935  if (DAS.StepM.postime[k][i] >= maxpostime) maxpostime = DAS.StepM.postime[k][i];
936  if (DAS.StepM.postime[k][i] <= minpostime) minpostime = DAS.StepM.postime[k][i];
937  }
938  }
939 /*************************************************************************/
940 
941  // Init Progression bar
942  for(k=0;k<2;k++)
943  {
944  for (i=0;i<2;i++)
945  {
946  if (DAS.StepM.nstep[k][i] != 0)
947  {
948  s = 2*k+i;
949  switch (s)
950  {
951  case 0:
953  D_VRangeSim(0, "Positioning Mirror",0, 255, 0, 0, 50, 0);
954  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
955 
956  break;
957  case 1:
959  D_VRangeSim(1, "Positioning Grating",0, 255, 255, 0, 50, 100);
960  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
961  break;
962  case 2:
964  D_VRangeSim(2, "Positioning Filter Wheel",0, 0, 0, 255, 50, 200);
965  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledoff.bmp");
966  break;
967  case 3:
968  break;
969  }
970  }
971  }
972  }
973 
974 /*************************************************************************/
975 
976 /**************************************************************************/
977  // Send step
978  if (DAS.Flag.exemode != DBDEMO)
979  {
980 
981  for(k=0;k<2;k++)
982  {
985 
988 
989  }
990  }
991 /**************************************************************************/
992 
993  //Time Out loop
994  st = GetTickCount();
995  do
996  {
997  et = GetTickCount();
998  tt = labs(et - st);
999  MLoopWhileEvents(0);
1000  if(tt > 0)
1001  {
1002 
1003  if(DD_VOpen[0])
1004  {
1005  if(DAS.DOption.amsprogbar)
1006  D_VRangeSim(0 ,NULL,(unsigned long) tt * 100 / DAS.StepM.postime[AMS1][0], 255, 0, 0, 50, 0);
1007  sprintf(buf, "%.1f sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS1][0]))/1000.0 ));
1009  if (tt >= DAS.StepM.postime[AMS1][0])
1010  {
1012  sprintf(str, "%s",Mir_CodeTropo[m]);
1013  else
1014  sprintf(str, "%s",Mir_Code[m]);
1015 
1016  sprintf(buf, "%s", str);
1018  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][0], "SYS\\ledGreen.bmp");
1019 
1020  }
1021  }
1022  else
1023  {
1024  sprintf(buf, "%.1f sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS1][0]))/1000.0 ));
1026  if (tt >= DAS.StepM.postime[AMS1][0])
1027  {
1028  if (m != -1)
1029  {
1031  sprintf(str, "%s",Mir_CodeTropo[m]);
1032  else
1033  sprintf(str, "%s",Mir_Code[m]);
1034 
1035  }
1036  else
1037  {
1039  sprintf(str, "%s",Mir_CodeTropo[MIS.Pos]);
1040  else
1041  sprintf(str, "%s",Mir_Code[MIS.Pos]);
1042 
1043  //sprintf(buf, "%s", str);
1044  //MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[0], buf);
1045  //MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][0], "SYS\\ledGreen.bmp");
1046 
1047  }
1048  sprintf(buf, "%s", str);
1050  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][0], "SYS\\ledGreen.bmp");
1051 
1052 
1053  }
1054 
1055  }
1056  if(DD_VOpen[1])
1057  {
1058  if(DAS.DOption.amsprogbar)
1059  D_VRangeSim(1, NULL,(unsigned long) tt * 100 / DAS.StepM.postime[AMS1][1], 255, 255, 0, 50, 100);
1060  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS1][1]))/1000.0 ));
1062  if (tt >= DAS.StepM.postime[AMS1][1])
1063  {
1064  sprintf(buf, "%4d", wl[w]);
1066  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][1], "SYS\\ledGreen.bmp");
1067  }
1068  }
1069  else
1070  {
1071  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(tt - DAS.StepM.postime[AMS1][1]))/1000.0 ));
1073  if (tt >= DAS.StepM.postime[AMS1][1])
1074  {
1075  if(w != -1)
1076  sprintf(buf, "%4d", wl[w]);
1077  else
1078  sprintf(buf, "%4d", wl[GRS.Wl]);
1080  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[0][1], "SYS\\ledGreen.bmp");
1081  }
1082  }
1083  if(DD_VOpen[2])
1084  {
1085  if(DAS.DOption.amsprogbar)
1086  D_VRangeSim(2, NULL,(unsigned long) tt * 100 / DAS.StepM.postime[AMS2][0], 0, 0, 255, 50, 200);
1087  sprintf(buf, "%.1lf sec. left", (double)fabs(((double) (tt - DAS.StepM.postime[AMS2][0]) )/1000.0 ));
1089  if (tt >= DAS.StepM.postime[AMS2][0])
1090  {
1091  if ( DAS.Paramini.EqType == LIS_)
1092  sprintf(buf, "%s", Fil_Code8H[f]);
1093  else
1094  {
1095  if(DAS.Paramini.EqType == TROPOGAS)
1096  sprintf(buf, "%s",Fil_CodeTropo[f]);
1098  sprintf(buf, "%s",Fil_CodeNG[f]);
1099  else if (DAS.Paramini.EqType == GASCODNG1)
1100  sprintf(buf, "%s",Fil_CodeNG1[f]);
1101 
1102  else
1103  sprintf(buf, "%s",Fil_Code[f]);
1104  }
1106  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[1][0], "SYS\\ledGreen.bmp");
1107  }
1108  }
1109  else
1110  {
1111  sprintf(buf, "%.1lf sec. left", (double)fabs(((double) (tt - DAS.StepM.postime[AMS2][0]) )/1000.0 ));
1113  if (tt >= DAS.StepM.postime[AMS2][0])
1114  {
1115  if(f != -1)
1116  {
1117  if ( DAS.Paramini.EqType == LIS_)
1118  sprintf(buf, "%s", Fil_Code8H[f]);
1119  else
1120  {
1121  if(DAS.Paramini.EqType == TROPOGAS)
1122  sprintf(buf, "%s",Fil_CodeTropo[f]);
1124  sprintf(buf, "%s",Fil_CodeNG[f]);
1125  else if (DAS.Paramini.EqType == GASCODNG1)
1126  sprintf(buf, "%s",Fil_CodeNG1[f]);
1127 
1128  else
1129  sprintf(buf, "%s",Fil_Code[f]);
1130  }
1131  }
1132  else
1133  {
1134  if ( DAS.Paramini.EqType == LIS_)
1135  sprintf(buf, "%s", Fil_Code8H[FWS.Pos]);
1136  else
1137  {
1138  if(DAS.Paramini.EqType == TROPOGAS)
1139  sprintf(buf, "%s",Fil_CodeTropo[FWS.Pos]);
1141  sprintf(buf, "%s",Fil_CodeNG[FWS.Pos]);
1142  else
1143  sprintf(buf, "%s",Fil_Code[FWS.Pos]);
1144  }
1145  }
1146 
1148  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[1][0], "SYS\\ledGreen.bmp");
1149  }
1150  }
1151 
1152 
1153 
1154  }
1155  }while((tt < maxpostime));
1156 /**************************************************************************/
1157 /**************************************************************************/
1158 
1159  // Check if all the progression bars have been destroyed.
1160  // If not the active one is destroyed and the apprpriate label is written
1161  for(k=0;k<2;k++)
1162  {
1163  for (i=0;i<2;i++)
1164  {
1165  s = 2*k+i;
1166  if(DD_VOpen[s])
1167  {
1168  if(DAS.DOption.amsprogbar)
1169  D_VRangeSim(s, NULL, 100, 0, 0, 0, 0, 0);
1170  switch (s)
1171  {
1172  case 0:
1173  if (m != -1)
1174  {
1176  sprintf(str, "%s",Mir_CodeTropo[m]);
1177  else
1178  sprintf(str, "%s",Mir_Code[m]);
1179  sprintf(buf, "%s", str);
1181  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledGreen.bmp");
1182  }
1183  break;
1184  case 1:
1185  sprintf(buf, "%4d", wl[w]);
1187  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledGreen.bmp");
1188  break;
1189  case 2:
1190  if ( DAS.Paramini.EqType == LIS_)
1191  sprintf(buf, "%s", Fil_Code8H[f]);
1192  else
1193  {
1194  if(DAS.Paramini.EqType == TROPOGAS)
1195  sprintf(buf, "%s",Fil_CodeTropo[f]);
1197  sprintf(buf, "%s",Fil_CodeNG[f]);
1198  else if (DAS.Paramini.EqType == GASCODNG1)
1199  sprintf(buf, "%s",Fil_CodeNG1[f]);
1200  else
1201  sprintf(buf, "%s",Fil_Code[f]);
1202  }
1204  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[k][i], "SYS\\ledGreen.bmp");
1205  break;
1206  case 3:
1207 
1208  break;
1209 
1210  }
1211  }
1212  }
1213 
1214  }
1215 /**************************************************************************/
1216  //Recupero del gioco per grating
1217 
1218  if(DAS.StepM.nstep[AMS1][DAS.StepM.SM_B] && (DAS.StepM.Revo[AMS1][DAS.StepM.SM_B] == 0) )
1219  {
1220  er=DB_StepMotor(AMS1, 1, GRS.dp, 1);
1221  if (er)
1222  {
1223  sprintf(buf, "%4d", wl[w]);
1225  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS1][1], "SYS\\ledGreen.bmp");
1226  }
1227  }
1228 
1229 /**************************************************************************/
1230  return 0;
1231 
1232 
1233 
1234 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
#define SPATRAM
SPectrometer for Atmospheric TRAcers Measurements - CGE-UE Portugal.
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.
void D_VRangeSim(int id, char *str, int val, int r, int g, int b, int x, int y)
init progress bar during simultaneous positioning
Definition: Utils.c:258
void MLoopWhileEvents(int discard)
optionini DOption
Options for DAS execution.
#define AMS2
AMS2 address.
const char * Mir_Code[]
const char array for the realisation of the Mirrors buttons in the Mirror shell
Definition: DAS_Spat.c:231
int NAMS
Number of AMSs Devices.
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
unsigned long nstep[AMSMAX][2]
Number of steps to be executed.
int Pos
Mirror Current Position.
flag Flag
Structure for different flags.
#define DBDEMO
execution in demo mode
int Offset[16]
Offset of the hardware devices (Input Mirror (5), Grating, Filter Wheel...)
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
void MObjectSetText(MOBJECT obj, const char *text)
int Pos
Filter Wheel current Position.
#define LIS_
Lampedusa Island Spectrometer - ENEA.
int Wl
Grating Wavelength.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
long dp
Grating backslash recovery steps.
long postime[AMSMAX][2]
time necessary for positioning
#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 WriteLogAMS(int id, int dira, int dirb, unsigned long stepa, unsigned long stepb)
Definition: Spat_Device.c:299
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
int Revo[AMSMAX][2]
Revolution Direction CW CCW.
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
char * Fil_CodeNG1[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrum...
Definition: DAS_Spat.c:213
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
#define SPATRAM3
SPATRAM3.
MirrorSt MIS
Mirror.
Definition: DAS_Spat.c:61
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
char * Fil_Code[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:207
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
controlpanel ContrPanel
Control Panel Structure.
GratingSt GRS
Grating.
Definition: Spat_Device.c:22
#define AMS1
AMS1 address.
int DD_VOpen[16]
Definition: Utils.c:151
static double st
Definition: SOLPOS.C:142
int step[AMSMAX][2]
Stepper Motors Step.
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
int EqType
Spectrometer Type.
long wav[]
Step Number definition - for SD_Grating.
Definition: DAS_Spat.c:195
int AMS_sendstep(int id, int dira, int dirb, unsigned long stepa, unsigned long stepb)
Send steps Procedure for sending steps to the Stepper Motor.
Definition: Dxl.c:513
int exemode
Set the Execution MODE (Execution modes)
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
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:

§ SD_Zenith()

int SD_Zenith ( float  ang)

Positioning Zenith.
The Zenith reaches the position specified by ang.

Parameters
ang
Returns
er:
  • = 0 –> Operation concluded succesfully
  • = 1 –> Problems in positioning

Definition at line 2916 of file Spat_Device.c.

References controlpanel::Albl_LS, AMS3, gui::ContrPanel, DB_KB_ButtonActive(), DB_StepMotor(), flag::exec, flag::fileprg, das::Gui, pushbutt::KeyB, controlpanel::LedSM, MIGEZen(), MObjectSetSensitive(), MObjectSetText(), MPixmapSetImageFile(), stepm::multiplier, stepm::nstep, ZenithSt::Pos, gui::PushButt, ZenithSt::realzenpos, stepm::Revo, stepm::SM_A, SM_stepr(), stepm::step, and das::StepM.

Referenced by ActMvZenDegCB(), E_AAMeasure(), E_IRefSun(), and E_Zenith().

2917 {
2918  int er = 0;
2919  char buf[80];
2920  long n, dp = 500; // dp sono i dead pulse, vanno aggiunti all'inversione per il recupero del gioco
2921  int dir;
2922  int k = 0;
2923 // float x;
2924  double GRASTEP, STEPGRA;
2925 // float prepos;
2926  double yy;
2927  float rzenang;
2928 // if(DAS.MIGE.type)
2929 // {
2930  // +90 --> DX looking to the North
2931  // -90 --> SX looking to the North
2932 // if(ang < 0 || ang > 180 ) return 0;
2933 // }
2934 // else
2935 // {
2936  //if ang is not in the limits the DAS exit from the function
2937 // if(ang < -91 || ang > 45 ) return 0;
2938 // }
2939  //Status("Set NEW zenith Position");
2940 
2941  //Disattiva i pulsanti sulla keyboard
2942  DB_KB_ButtonActive(0);
2945 
2946 /*
2947  k = (float)SM_stepr(DAS.StepM.step[AMS3][0]); // step/round
2948 
2949  GRASTEP = 360/k; // º/step
2950 
2951  STEPGRA = k/360; // step/º
2952 
2953 
2954  yy = -(ang - ZST.Pos); // -(55-90) = 35 //1
2955  //-(56-55) = -1 //2
2956  //-(96-56) = -40 //3
2957  //-(90-96) = 6 //4
2958 
2959 
2960  n = (long)(yy * STEPGRA * (DAS.StepM.multiplier[AMS3][0])); //4 e' la riduzione
2961 
2962 
2963  prepos = ZST.Pos;
2964  ZST.Pos = ang;
2965 
2966  sprintf(buf, " %.1lf --> %.1lf", prepos, ang);
2967  Status(buf);
2968 
2969  // Select direction
2970  if(n < 0)
2971  dir = 1;
2972  else
2973  dir = 0;
2974 
2975  n = labs(n);
2976 
2977 // if(n && dir == 0) //si va verso l'UV
2978 // n += dp; // // add fixed step number for backlash recovery
2979 
2980 
2981 */
2982 
2983 
2984  //Zenith positioning
2985  rzenang=MIGEZen((float)ang);
2986 
2987  if(ang >= 0 && ang <= 180 )
2988  {
2989 
2990 
2991 
2992  k = SM_stepr(DAS.StepM.step[AMS3][DAS.StepM.SM_A]); // step/round
2993 
2994  GRASTEP = (float) 360.0 / (float) k; // degree/step
2995 
2996  STEPGRA = (float) k / (float) 360.0; // step/degree
2997 
2998 // yy = -(z - ZST.Pos);
2999  yy = -(rzenang - ZST.Pos);
3000  n = (long)(yy * STEPGRA * (DAS.StepM.multiplier[AMS3][0]));
3001 // ZST.Pos = z;
3002  ZST.Pos = rzenang;
3003  ZST.realzenpos = ang;
3004  // Select direction
3005  if(n < 0)
3006  dir = 1;
3007  else
3008  dir = 0;
3009 
3010  n = labs(n);
3011  DAS.StepM.Revo[AMS3][DAS.StepM.SM_A] = dir;
3012  DAS.StepM.nstep[AMS3][DAS.StepM.SM_A] = n;
3013  }
3014  else
3015  {
3016  DAS.StepM.Revo[AMS3][DAS.StepM.SM_A] = 0;
3017  DAS.StepM.nstep[AMS3][DAS.StepM.SM_A] = 0;
3018  sprintf(buf, "Not Allowed Zen.");
3020 
3021  }
3022 
3023  if (n==0)
3024  {
3025  //Attiva i pulsanti sulla keyboard
3026  DB_KB_ButtonActive(1);
3027  return 1;
3028  }
3029 
3030  // Eseguo n passi
3031  if(n)
3032  {
3034  if (er)
3035  {
3036  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS3][0], "SYS\\ledGreen.bmp");
3037  }
3038  }
3039 
3040 /* if(dir == 0)
3041  {
3042  er=DB_StepMotor(AMS3, DAS.StepM.SM5, dp, 1);
3043  if (er)
3044  {
3045  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM5, "SYS\\ledGreen.bmp");
3046  }
3047  }
3048 */
3049 
3050  sprintf(buf, "%.2lf", ang);
3052  if(!FLAG.fileprg || !FLAG.exec )
3053  //Attiva i pulsanti sulla keyboard se non si sta eseguendo una tabella di misure
3054  //oppure se il programma e' stato sospeso (si e' premuto il tasto "pause")
3055  DB_KB_ButtonActive(1);
3056 
3057 
3058 
3059  if(er) return 1;
3060 
3061 
3062  return 0;
3063 
3064 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
MOBJECT KeyB[28]
Keyboard Buttons.
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
unsigned long nstep[AMSMAX][2]
Number of steps to be executed.
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
void MObjectSetText(MOBJECT obj, const char *text)
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
pushbutt PushButt
Push buttons.
int Revo[AMSMAX][2]
Revolution Direction CW CCW.
ZenithSt ZST
Definition: Spat_Device.c:24
flag FLAG
flags structure
Definition: Spat_Device.c:19
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 step[AMSMAX][2]
Stepper Motors Step.
double realzenpos
void MObjectSetSensitive(MOBJECT obj)
float MIGEZen(float p)
Definition: CreateForms.c:3419
double Pos
Zenith Current Position.
#define AMS3
AMS3 address.
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SD_Zenith_H()

int SD_Zenith_H ( float  ang)

Definition at line 2816 of file Spat_Device.c.

References controlpanel::Albl_LS, AMS3, gui::ContrPanel, DB_KB_ButtonActive(), DB_StepMotor(), flag::exec, flag::fileprg, das::Gui, pushbutt::KeyB, controlpanel::LedSM, MObjectSetSensitive(), MObjectSetText(), MPixmapSetImageFile(), stepm::multiplier, ZenithSt::Pos, gui::PushButt, SM_stepr(), Status(), stepm::step, and das::StepM.

Referenced by HomeZenithFast().

2817 {
2818 
2819  int er = 0;
2820  char buf[80];
2821  long n, dp = 500; // dp sono i dead pulse, vanno aggiunti all'inversione per il recupero del gioco
2822  int dir;
2823  float k = 0;
2824 // float x;
2825  double GRASTEP, STEPGRA;
2826  float prepos;
2827  double yy;
2828 // float rzenang;
2829 // if(DAS.MIGE.type)
2830 // {
2831  // +90 --> DX looking to the North
2832  // -90 --> SX looking to the North
2833  if(ang < -91 || ang > 91 ) return 0;
2834 // }
2835 // else
2836 // {
2837  //if ang is not in the limits the DAS exit from the function
2838 // if(ang < -91 || ang > 45 ) return 0;
2839 // }
2840  //Status("Set NEW zenith Position");
2841 
2842  //Disattiva i pulsanti sulla keyboard
2843  DB_KB_ButtonActive(0);
2846 
2847 
2848  k = (float)SM_stepr(DAS.StepM.step[AMS3][0]); // step/round
2849 
2850  GRASTEP = 360/k; // º/step
2851 
2852  STEPGRA = k/360; // step/º
2853 
2854 
2855  yy = -(ang - ZST.Pos); // -(55-90) = 35 //1
2856  //-(56-55) = -1 //2
2857  //-(96-56) = -40 //3
2858  //-(90-96) = 6 //4
2859 
2860 
2861  n = (long)(yy * STEPGRA * (DAS.StepM.multiplier[AMS3][0])); //4 e' la riduzione
2862 
2863 
2864  prepos = (float)ZST.Pos;
2865  ZST.Pos = ang;
2866 
2867  sprintf(buf, " %.1lf --> %.1lf", prepos, ang);
2868  Status(buf);
2869 
2870  // Select direction
2871  if(n < 0)
2872  dir = 1;
2873  else
2874  dir = 0;
2875 
2876  n = labs(n);
2877 
2878 
2879  if (n==0)
2880  {
2881  //Attiva i pulsanti sulla keyboard
2882  DB_KB_ButtonActive(1);
2883  return 1;
2884  }
2885 
2886  // Eseguo n passi
2887  if(n)
2888  {
2889  er = DB_StepMotor(AMS3, 4, n, dir);
2890  if (er)
2891  {
2892  MPixmapSetImageFile(DAS.Gui.ContrPanel.LedSM[AMS3][0], "SYS\\ledGreen.bmp");
2893  }
2894  }
2895 
2896  sprintf(buf, "%.2lf", ang);
2898  if(!FLAG.fileprg || !FLAG.exec )
2899  //Attiva i pulsanti sulla keyboard se non si sta eseguendo una tabella di misure
2900  //oppure se il programma e' stato sospeso (si e' premuto il tasto "pause")
2901  DB_KB_ButtonActive(1);
2902 
2903 
2904 
2905  if(er) return 1;
2906 
2907 
2908  return 0;
2909 
2910 
2911 
2912 
2913 
2914 }
das DAS
DAS structure.
Definition: Spat_Device.c:27
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
void DB_KB_ButtonActive(int mod)
Enable/Disable Push buttons on the Control Panel.
Definition: CreateForms.c:3810
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
MOBJECT KeyB[28]
Keyboard Buttons.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
int SM_stepr(int t)
AMS &#39;steps/round&#39; value return the AMS &#39;steps/round&#39; value (microstepping) depending on the setted st...
Definition: Spat_Device.c:209
void MObjectSetText(MOBJECT obj, const char *text)
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
pushbutt PushButt
Push buttons.
ZenithSt ZST
Definition: Spat_Device.c:24
flag FLAG
flags structure
Definition: Spat_Device.c:19
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 step[AMSMAX][2]
Stepper Motors Step.
void MObjectSetSensitive(MOBJECT obj)
double Pos
Zenith Current Position.
#define AMS3
AMS3 address.
int DB_StepMotor(int id, int motor, long step, int dir)
Send steps to the selected stepper motor. .
Definition: Dxl.c:816
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SetBoldCB()

void SetBoldCB ( MOBJECT  obj,
MVALUE  a,
void *  data 
)

This callback toggles the Bold attribute.

Definition at line 1455 of file DAS_Spat_ConfCBs.c.

References bold, and DB_TestF().

Referenced by MDCreateDASConfig().

1456 {
1457  bold = (int) a;
1458  DB_TestF();
1459 }
int bold
Definition: DAS_Spat_Conf.c:88
void DB_TestF(void)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SetItalicCB()

void SetItalicCB ( MOBJECT  obj,
MVALUE  a,
void *  data 
)

This callback toggles the Italic attribute.

Definition at line 1464 of file DAS_Spat_ConfCBs.c.

References DB_TestF(), and italic.

Referenced by MDCreateDASConfig().

1465 {
1466  italic = (int) a;
1467  DB_TestF();
1468 }
void DB_TestF(void)
int italic
Definition: DAS_Spat_Conf.c:89
+ 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:

§ ShiftImg()

void ShiftImg ( int  hp,
int  vp 
)

Used to correct some data files.

Parameters
hphorizontal pixels
vpvertical pixels

Definition at line 765 of file Utils.c.

References bil::DPLOT, IDX, and d_view::ImatGraf.

Referenced by DT_CorrFileEvora().

766 {
767 
768  int x, y;
769 
770  for(y = 0; y < vp; y++)
771  {
772  for(x = 0; x < hp; x++)
773  {
774  if((x==0) & (y!=0))
775  BIL.DPLOT.ImatGraf[y * IDX + x] =BIL.DPLOT.ImatGraf[y * IDX + x+2]/2 + BIL.DPLOT.ImatGraf[y * IDX + x+3]/2;
776  else if((x==1) & (y!=0))
777  BIL.DPLOT.ImatGraf[y * IDX + x] =BIL.DPLOT.ImatGraf[y * IDX + x+1]/2 + BIL.DPLOT.ImatGraf[y * IDX + x+3]/2;
778  else
779  BIL.DPLOT.ImatGraf[y * IDX + x] =BIL.DPLOT.ImatGraf[y * IDX + x];
780  }
781  }
782 
783 
784 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
bil BIL
Definition: Utils.c:27
d_view DPLOT
Definition: bildef.h:254
unsigned short * ImatGraf
Definition: bildef.h:176
+ Here is the caller graph for this function:

§ ShowDown()

void __stdcall ShowDown ( const char *  str,
int  port 
)

Shows the countdown.
Procedure for the visualisation of the countdown.

Parameters
cdownpointer to a char variable containing the partial time.
Returns
void

Definition at line 98 of file Init.c.

References DI_WriteDigit(), marconi::LblExpD, das::Marconi, and MLoopWhileEvents().

Referenced by DB_GetCCD(), and DB_InitCamera().

99 {
100  char buff[16];
101  buff[0] = '\0';
102  strcpy(buff,str);
103 
104  if(DAS.Marconi.LblExpD[0] != NULL)
105  {
106  //DI_WriteDigit(DAS.Marconi.LblExpP, ttot);
108  MLoopWhileEvents(0);
109  }
110 }
void MLoopWhileEvents(int discard)
das DAS
DAS structure.
Definition: Init.c:34
C_DEF void DI_WriteDigit(MOBJECT *pix, char *fmt)
MOBJECT LblExpD[7]
Label for time exposure countdown.
marconi Marconi
CCD Sensor struct.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ShStCB()

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

Definition at line 154 of file DOAS_FullProj.c.

References MMessageDialog().

Referenced by MDCreateDOAS_MainSh().

155 {
156 
157  MMessageDialog("DAS information", "The procedure is not yet implemented!!", " Ok ", NULL);
158 
159 }
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:

§ ShutDOWN()

void ShutDOWN ( void  )

Creates shell for Shutting down the instrument
.

Definition at line 6903 of file CreateForms.c.

References CloseShCB(), palette::DB_BG, palette::DB_BG_Plbl, palette::DB_FG_Plbl, palette::DB_UnSel, palette::DB_UnSelFG, DBDEMO, ESC, flag::exemode, F1, F2, F3, F4, das::Flag, HELV_MEDIUM, HELV_SMALL, lbl, MButtonSetAccelerator(), MButtonSetOnMouseOverForegroundRGB(), MCreateLabel(), MCreatePButton(), MCreateRowForm(), MCreateShell(), MCreateTableForm(), MObjectSetBackgroundRGB(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetShadow(), MObjectSetText(), MObjectSetTransparency(), MObjectSetUnsensitive(), MPButtonSetCallback(), MShellRealize(), MShellRealizeXY(), MShellSetWMCloseCallback(), OFFLINEPLOT, sdsh, SF_MODAL, ShutCB(), True, WS_NONE, and WS_SHADOW_OUT.

Referenced by DB_KeyB_CB().

6904 {
6905 
6906  MOBJECT lbl, pb[4], a, b;
6907 
6908 
6909  const char *ShDwn_Code[] = {{"F1 - CCD ShutDown, Cooler On"},
6910  {"F2 - CCD ShutDown, Cooler Off"},
6911  {"F3 - No CCD ShutDown, Cooler On"},
6912  {"F4- No CCD ShutDown, Cooler Off"},
6913  {"ESC-Cancel"}};
6914 
6915  int ShDwn_StK[] = {F1,F2,F3,F4,ESC}, i;
6916 
6917 
6918  if(DAS.Flag.exemode == OFFLINEPLOT)
6919  {
6920  sdsh = MCreateShell("DAS CLOSE ", SF_MODAL);
6922 
6923  a = MCreateRowForm(sdsh);
6924 
6925  lbl = MCreateLabel(a, "Exit Program ?", HELV_MEDIUM);
6928  MObjectSetTransparency(lbl, 0);
6929 
6930  b = MCreateTableForm(sdsh, 1);
6932  MObjectSetShadow(b, WS_NONE, 0, 0);
6933  MObjectSetResize(b, True, True);
6934 
6935  pb[0] = MCreatePButton(b, "Yes - F1", HELV_SMALL);
6937  MObjectSetCompositeWidth(pb[0], 100);
6938  MObjectSetShadow(pb[0], WS_SHADOW_OUT, 3, 0);
6939  MButtonSetOnMouseOverForegroundRGB(pb[0], 255, 255, 255);
6940  MButtonSetAccelerator(pb[0], ShDwn_StK[0]);
6941  MPButtonSetCallback(pb[0], ShutCB, (void *) 2);
6942 
6943  pb[1] = MCreatePButton(b, "No - F2", HELV_SMALL);
6945  MObjectSetCompositeWidth(pb[1], 100);
6946  MObjectSetShadow(pb[1], WS_SHADOW_OUT, 3, 0);
6947  MButtonSetOnMouseOverForegroundRGB(pb[1], 255, 255, 255);
6948  MButtonSetAccelerator(pb[1], ShDwn_StK[1]);
6949  MPButtonSetCallback(pb[1], ShutCB, (void *) 4);
6950 
6952  MShellRealizeXY(sdsh, 0, 0);
6953  //MObjectSetPosition(sdsh, 500, 0);
6954 
6955  }
6956  else
6957  {
6958  sdsh = MCreateShell("EXIT AND/OR SHUTDOWN", SF_MODAL);
6960 
6961  //
6962 
6963  a = MCreateRowForm(sdsh);
6965 
6966  lbl = MCreateLabel(a, "Choose the exit mode", HELV_MEDIUM);
6969  MObjectSetTransparency(lbl, 0);
6970 
6971 
6972  b = MCreateTableForm(sdsh, 1);
6974  MObjectSetShadow(b, WS_NONE, 0, 0);
6975  MObjectSetResize(b, True, True);
6976 
6977  for (i=0; i<5; i++)
6978  {
6979  pb[i] = MCreatePButton(b, ShDwn_Code[i], HELV_SMALL);
6980 
6983  MObjectSetCompositeWidth(pb[i], 300);
6984  MObjectSetShadow(pb[i], WS_SHADOW_OUT, 3, 0);
6986  MButtonSetAccelerator(pb[i], ShDwn_StK[i]);
6987  MPButtonSetCallback(pb[i], ShutCB, (void *) i);
6988  if (DAS.Flag.exemode == DBDEMO )
6989  if(i==0 || i==1 || i==3 )
6990  MObjectSetUnsensitive(pb[i]);
6991  else if(i==2)
6992  MObjectSetText(pb[i],"Exit Program");
6993 
6994  }
6995 
6996 
6997 
6998 
6999 
7001 // MShellRealizeXY(sdsh, 0,0);
7003  }
7004 }
void CloseShCB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:4320
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
#define WS_NONE
Definition: Mguidefs.h:956
MOBJECT lbl
Definition: DFileMan.c:42
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MShellRealize(MOBJECT obj)
#define ESC
Definition: KEYCODES.H:265
void MObjectSetUnsensitive(MOBJECT obj)
MOBJECT sdsh
Definition: CreateForms.c:6734
#define F3
Definition: KEYCODES.H:339
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.
#define F2
Definition: KEYCODES.H:338
#define DBDEMO
execution in demo mode
#define F4
Definition: KEYCODES.H:340
void MObjectSetText(MOBJECT obj, const char *text)
void MButtonSetAccelerator(MOBJECT button, int key)
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
#define OFFLINEPLOT
execution for archived data visualisation
#define HELV_SMALL
Definition: Mguidefs.h:881
#define SF_MODAL
Definition: Mguidefs.h:1019
palette DPAL
Definition: CreateForms.c:88
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
void MShellRealizeXY(MOBJECT obj, int x, int y)
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
das DAS
Definition: CreateForms.c:98
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
short DB_UnSelFG[3]
Unselected Buttons Colors.
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
void MButtonSetOnMouseOverForegroundRGB(MOBJECT button, int r, int g, int b)
#define HELV_MEDIUM
Definition: Mguidefs.h:882
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
void ShutCB(MOBJECT p, void *od, void *ad)
Definition: CreateForms.c:6740
MOBJECT MCreateRowForm(MOBJECT parent)
int exemode
Set the Execution MODE (Execution modes)
#define WS_SHADOW_OUT
Definition: Mguidefs.h:957
#define F1
Definition: KEYCODES.H:337
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ShutterOpening()

void ShutterOpening ( int  mod)

Definition at line 1685 of file Procedures.c.

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

Referenced by InitCCD_AMS(), ShutCB(), Task_LOG(), and WinRes().

1686 {
1687 
1688  int fd, er;
1689  char buff[_MAX_PATH];
1690  FILE *fs;
1691 
1692 
1693  sprintf(buff,"%s\\Shutter.ini", BIL.DFILEM.CONFIGDIREQUIPMENT);
1694 
1695  if(mod == 0) //read or create file
1696  {
1697  fd = access(buff, 0);
1698  if (fd == 0) //file exist
1699  {
1700  fs = fopen(buff, "r");
1701  if(fs == NULL)
1702  {
1703  MMessageDialog("DAS information", "Problems in opening file", " Ok ", NULL);
1704  return ;
1705  }
1706  er = fscanf(fs, "%ul", &countsopsh);
1707 
1708  fclose(fs);
1709  }
1710  else
1711  {
1712  fs = fopen(buff, "w");
1713  if(fs == NULL)
1714  {
1715  MMessageDialog("DAS information", "Problems in opening file", " Ok ", NULL);
1716  return ;
1717  }
1718  fprintf(fs, "%u\n", 1);
1719  fclose(fs);
1720  }
1721 
1722  }
1723  else //mod == 1 write file
1724  {
1725  fs = fopen(buff, "w");
1726  if(fs == NULL)
1727  {
1728  MMessageDialog("DAS information", "Problems in opening file", " Ok ", NULL);
1729  return ;
1730  }
1731  fprintf(fs, "%u\n", countsopsh);
1732  fclose(fs);
1733  }
1734 
1735 
1736 
1737 
1738 
1739 }
bil BIL
Definition: Procedures.c:42
unsigned long countsopsh
counting the number of opening shutter
Definition: DAS_Spat.c:133
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,...)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ sleep()

void sleep ( clock_t  wait)

Pauses for a specified number of milliseconds.
.

Definition at line 1566 of file Load.c.

Referenced by DE_InitMotor().

1567 {
1568  clock_t goal;
1569  goal = wait + clock();
1570  while( goal > clock() )
1571  ;
1572 }
+ Here is the caller graph for this function:

§ SM_stepr()

int SM_stepr ( int  t)

AMS 'steps/round' value return the AMS 'steps/round' value (microstepping) depending on the setted step fractioning.

Parameters
t= fraction
Returns
er = steps/round
t | er
-—|-----—
0 | 400
1 | 800
2 | 1000
3 | 1600
4 | 2000
5 | 3200
6 | 5000
7 | 6400
8 | 10000
9 | 12800
10 | 25000
11 | 25600
12 | 50000
13 | 51200

Definition at line 209 of file Spat_Device.c.

Referenced by ActMvGratCB(), D_Calibra(), SD_Azimuth(), SD_FilterW(), SD_Grating(), SD_Mirror(), SD_NDFilterW(), SD_PosAADev(), SD_Position(), SD_PosOMUDev(), SD_Zenith(), and SD_Zenith_H().

210 {
211 
212 
213 
214 
215  int c = t;
216  int r;
217 
218  switch(c)
219  {
220  case 0:
221  r = 400;
222  break;
223  case 1:
224  r = 800;
225  break;
226  case 2 :
227  r = 1000;
228  break;
229  case 3:
230  r = 1600;
231  break;
232  case 4 :
233  r = 2000;
234  break;
235  case 5:
236  r = 3200;
237  break;
238  case 6 :
239  r = 5000;
240  break;
241  case 7:
242  r = 6400;
243  break;
244  case 8 :
245  r = 10000;
246  break;
247  case 9:
248  r = 12800;
249  break;
250  case 10 :
251  r = 25000;
252  break;
253  case 11:
254  r = 25600;
255  break;
256  case 12 :
257  r = 50000;
258  break;
259  case 13:
260  r = 51200;
261  break;
262 
263  }
264 
265  return r;
266 
267 
268 }
+ Here is the caller graph for this function:

§ SMfraz()

float SMfraz ( int  t)

denominator value of the stepping ratio

Parameters
tvalue of microstepping (0 to 13)

Definition at line 129 of file Spat_Device.c.

Referenced by ActMvAzimCB(), ActMvZenCB(), and HomeMirror().

130 {
131  int c = t;
132  float r;
133 
134  switch(c)
135  {
136  case 0:
137  r = 1;
138  break;
139  case 1:
140  r = 2;
141  break;
142  case 2 :
143  r = 2.5;
144  break;
145  case 3:
146  r = 4;
147  break;
148  case 4 :
149  r = 5;
150  break;
151  case 5:
152  r = 8;
153  break;
154  case 6 :
155  r = 12.5;
156  break;
157  case 7:
158  r = 16;
159  break;
160  case 8 :
161  r = 25;
162  break;
163  case 9:
164  r = 32;
165  break;
166  case 10 :
167  r = 62.5;
168  break;
169  case 11:
170  r = 64;
171  break;
172  case 12 :
173  r = 125;
174  break;
175  case 13:
176  r = 128;
177  break;
178 
179  }
180 
181  return r;
182 
183 
184 }
+ Here is the caller graph for this function:

§ SmoothData()

SmoothData ( unsigned short *  source,
float *  destination,
int  horpix,
int  verpix,
int  filw,
int  bp 
)

Calc. the smoothed matrix of an unsigned short one.
.

Parameters
*sourcesource data buffer
*destinationdestination data buffer
horpixhorizontal pixels
verpixvertical pixels
filwfilter windows for smoothing
bpblind pixels

Definition at line 973 of file Save.c.

References IDX, and SmoothingF().

Referenced by BuildLogRatio(), and WriteSelColandSmoothed().

975 {
976 
977  int x, y, n ;
978  double *avect;
979  unsigned long eln = (unsigned long)(2 * (horpix - bp + 1 )) ;
980  FILE *fd;
981 
982  avect = (double *) calloc( eln, sizeof(double));
983  if( avect == NULL )
984  return 1;
985 
986  for(y = 0; y < verpix; y++)
987  {
988  n=1;
989  for(x = 0; x < horpix; x++)
990  {
991  if ((x <= horpix - bp ) & (x > 1))
992  {
993  avect[n] = (double)source[y * (horpix) + x];
994  n++;
995  }
996  }
997 
998  SmoothingF(avect, n - 1, filw);
999 
1000  for(x = 0; x < horpix; x++)
1001  {
1002  if ((x <= horpix - bp ) & (x > 1))
1003  {
1004  destination[y * horpix + x] = (float) avect[x-1] ;
1005  }
1006 
1007  }
1008  }
1009 
1010  free(avect);
1011 
1012  fd = fopen("SmoothUS_In.tmp", "w");
1013  if(fd < 0) return 1;
1014 // for(x = 0; x < horpix + 1; x++)
1015  for(x = 0; x < horpix ; x++)
1016 
1017  {
1018  if ((x <= horpix - bp ) & (x > 1))
1019  {
1020  fprintf(fd, "%04u ", x);
1021 
1022  for(y = 0; y < verpix; y++)
1023  {
1024  fprintf(fd, "%05u ", source[y * IDX + x]);
1025  }
1026  fprintf(fd, "\n", NULL);
1027  }
1028  }
1029  fprintf(fd, "\n", NULL);
1030  fclose(fd);
1031 
1032 
1033  fd = fopen("SmoothUS_Out.tmp", "w");
1034  if(fd < 0) return 1;
1035 
1036 // for(x = 0; x < horpix + 1; x++)
1037  for(x = 0; x < horpix; x++)
1038 
1039  {
1040  if ((x <= horpix - bp ) & (x > 1))
1041  {
1042  fprintf(fd, "%04u ", x);
1043 
1044  for(y = 0; y < verpix; y++)
1045  {
1046  fprintf(fd, "%10.5lf ", destination[y * IDX + x]);
1047  }
1048  fprintf(fd, "\n", NULL);
1049  }
1050  }
1051  fprintf(fd, "\n", NULL);
1052  fclose(fd);
1053 
1054  return 0;
1055 
1056 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int SmoothingF(double *tmp, int npix, int pts)
Smoothing of 1D array.
Definition: FFT.c:151
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SmoothFloatData()

SmoothFloatData ( float *  source,
float *  destination,
int  horpix,
int  verpix,
int  filw,
int  bp 
)

Calc. the smoothed matrix of a float one.
.

Parameters
*sourcesource data buffer
*destinationdestination data buffer
horpixhorizontal pixels
verpixvertical pixels
filwfilter windows for smoothing
bpblind pixels

Definition at line 890 of file Save.c.

References IDX, and SmoothingF().

Referenced by BuildLogRatio().

892 {
893 
894  int x, y, n ;
895  FILE *fd;
896  double *avect;
897  unsigned long eln = (unsigned long)(2 * (horpix - bp + 1 )) ;
898 
899  avect = (double *) calloc( eln, sizeof(double));
900  if( avect == NULL )
901  return 1;
902 
903  for(y = 0; y < verpix; y++)
904  {
905  n=1;
906  for(x = 0; x < horpix; x++)
907  {
908  if ((x <= horpix - bp ) & (x > 1))
909  {
910  avect[n] = (double)source[y * (horpix) + x];
911  n++;
912  }
913  }
914 
915  SmoothingF(avect, n - 1, filw);
916 
917  for(x = 0; x < horpix; x++)
918  {
919  if ((x <= horpix - bp ) & (x > 1))
920  {
921  destination[y * horpix + x] = (float) avect[x-1] ;
922  }
923 
924  }
925  }
926 
927  free(avect);
928 
929  fd = fopen("SmoothFL_In.tmp", "w");
930  if(fd < 0) return 1;
931  for(x = 0; x < horpix + 1; x++)
932  {
933  if ((x <= horpix - bp ) & (x > 1))
934  {
935  fprintf(fd, "%04u ", x);
936 
937  for(y = 0; y < verpix; y++)
938  {
939  fprintf(fd, "%10.5lf ", source[y * IDX + x]);
940  }
941  fprintf(fd, "\n", NULL);
942  }
943  }
944  fprintf(fd, "\n", NULL);
945  fclose(fd);
946 
947 
948  fd = fopen("SmoothFL_Out.tmp", "w");
949  if(fd < 0) return 1;
950 
951  for(x = 0; x < horpix + 1; x++)
952  {
953  if ((x <= horpix - bp ) & (x > 1))
954  {
955  fprintf(fd, "%04u ", x);
956 
957  for(y = 0; y < verpix; y++)
958  {
959  fprintf(fd, "%10.5lf ", destination[y * IDX + x]);
960  }
961  fprintf(fd, "\n", NULL);
962  }
963  }
964  fprintf(fd, "\n", NULL);
965  fclose(fd);
966 
967  return 0;
968 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int SmoothingF(double *tmp, int npix, int pts)
Smoothing of 1D array.
Definition: FFT.c:151
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SmoothingF()

int SmoothingF ( double *  tmp,
int  npix,
int  pts 
)

Smoothing of 1D array.

Parameters
*tmpsource buffer
npixnumber of elements of the array
ptssmoothing window

Definition at line 151 of file FFT.c.

References MMessageDialog(), and realft().

Referenced by FilterData(), SmoothData(), and SmoothFloatData().

152 {
153  long double a, kost;
154  int NMin = 0;
155  //int mmax = 4096;
156  int mmax = 8192;
157  int M = 2, i, k;
158  unsigned long MO2;
159  long double y0, yn, FAC;
160  long double rn1, dummy, dummy1;
161 
162  NMin = npix + 2 * pts;
163  do
164  {
165  M = 2 * M; // find the next power of 2
166 
167  }while(M < NMin);
168 
169  if(M > mmax)
170  {
171  MMessageDialog("Smoothing Error", "MMax too small", "ok", NULL);
172  return 1;
173  }
174 
175  kost = pow( (double)pts / (double)M, (double)2.0); //useful constant
176 
177 
178  y0 = tmp[1];
179  yn = tmp[npix ];
180  rn1 = (double) (1.0 / (double)(npix - 1));
181 /*
182  //remove the linear trend
183  for(i = 0; i< npix;i++)
184  tmp[i] = tmp[i] - rn1 * (y0 * (double)(npix - i) + yn * (double)(i - 1));
185 */
186  //remove the linear trend
187  for(i = 1; i<= npix;i++)
188  tmp[i] = tmp[i ] - rn1 * (y0 * (double)(npix - i) + yn * (double)(i - 1));
189 
190  if(npix+1 <= M)
191  {
192  for(i = npix+1; i<M;i++)
193  tmp[i] = 0;
194  }
195 
196  MO2 = M / 2;
197  realft(tmp , MO2, 1); //fourier transform
198 
199  tmp[1] = tmp[1] / MO2;
200  FAC = 1; // square windows
201 
202  for (i=1; i <= (int) (MO2 - 1);i++)
203  {
204  k = 2 * i + 1;
205 
206  if ((FAC > 0) | (FAC <0))
207  FAC = 0;
208 
209  a = (1 - kost * pow((double)i, (double)2)) / MO2;
210  //a = (1 - kost * pow((0.25 * i),2)) / MO2;
211  //a = (1 - pow((0.25 * i),2)) / MO2;
212  //a = 1 - pow( (((double)i - MO2/2)/( MO2/2)),2 );
213 
214  if(a > FAC)
215  {
216  FAC = a;
217  tmp[k] = FAC * tmp[k];
218  tmp[k + 1] = FAC * tmp[k + 1];
219  }
220  else
221  {
222  tmp[k] = 0;
223  tmp[k + 1] = 0;
224  }
225  }
226  FAC = 0;
227  dummy = pow(((double)0.25 * (double)pts),(double)2);
228  dummy1= (0.25 * pts) * (0.25 * pts);
229  a = (1 - pow(((double)0.25 * (double)pts),(double)2)) / MO2;
230  if (a > 0)
231  FAC = a;
232 
233  tmp[2] = FAC * tmp[2];
234 
235  realft(tmp , MO2, -1); //inverse fourier transform
236  /*
237  for (i=0;i<npix;i++)
238  //Re-Insert the linear trend
239  tmp[i] = tmp[i] + rn1 * (y0 * (double)(npix - i) + yn * (double)(i - 1));
240 */
241  for (i=1;i<=npix;i++)
242  //Re-Insert the linear trend
243  tmp[i] = (tmp[i] + rn1 * (y0 * (double)(npix - i) + yn * (double)(i - 1)));
244 
245 
246  return 0;
247 }
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
void realft(double data[], unsigned long n, int isign)
Definition: FFT.c:95
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Status()

void Status ( char *  tit)

Writes information's on the Status label
.

Definition at line 1556 of file Load.c.

References controlpanel::Albl_Status, gui::ContrPanel, das::Gui, and MObjectSetText().

Referenced by AMS_DoPos(), AutoR_TestMeas(), AutoRange(), D_AutoExecution(), D_Average(), D_AverageTFix(), D_Calibra(), D_Homing(), D_WaitSZA(), DAS_Error(), DB_InitCamera(), DB_Pause(), DB_save_img(), DB_SelButt_CB(), DB_ToolsKeyB_CB(), DemoInitMotor(), E_AutoRange(), E_Expo(), E_GetCCD(), E_HGratCal(), E_HgScan(), E_Home_SM1(), E_Home_SM2(), E_Home_SM3(), E_Home_SM4(), E_Home_SM5(), E_Home_SM6(), E_QjScan(), E_SetCCDOffSet(), E_SetCCDPow(), E_SetCCDTemp(), E_SetCCDVBin(), ExMaster(), FTP_Back_UP(), HomeAzimFast(), HomeFiltersFast(), HomeGratingFast(), HomeMirror(), HomeNDFiltersFast(), HomeZenithFast(), InitCCD_AMS(), PerformMeas(), PID_Calc(), SD_FilterW(), SD_Grating(), SD_Mirror(), SD_NDFilterW(), SD_Zenith_H(), ShutCB(), Task_CCD_Temp(), and Task_HomeGrat().

1557 {
1558  char lb[1024];
1559 
1560  sprintf(lb, "%s", tit);
1562 }
gui Gui
Graphic User Interface Structure.
void MObjectSetText(MOBJECT obj, const char *text)
das DAS
DAS structure.
Definition: Load.c:32
MOBJECT Albl_Status
Active Control Panel Labels for Status.
controlpanel ContrPanel
Control Panel Structure.
+ Here is the call graph for this function:

§ SunCalcCB()

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

Definition at line 148 of file DOAS_FullProj.c.

References D_SunCalc().

Referenced by MDCreateDOAS_MainSh().

149 {
150 
151  D_SunCalc();
152 
153 }
void D_SunCalc(void)
Sun Calculator Callback.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SwapMatrix()

void SwapMatrix ( unsigned short *  source,
unsigned short *  dest,
int  hp,
int  vp 
)

Copy the source matrix in the Destination one
.

Parameters
*source= source matrix (buffer)
*dest= destination matrix (buffer)
hp= horizontal pixels
vp= vertical pixels

Definition at line 1979 of file Spat_Plot.c.

Referenced by DrawAreaPlotCB(), SaveIo(), ViewNext(), ViewNext_BIN(), and Visualizza().

1980 {
1981 
1982  int t, j;
1983 
1984  for(t = 0 ; t < vp ; t++)
1985  {
1986  for(j = 0; j < hp; j++)
1987  {
1988  dest[t * hp + j] = source[t * hp + j];
1989  }
1990  }
1991 
1992 }
+ 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:

§ SZACalc()

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.
.

Parameters
d_latstation latitude
d_longstation longitude
d_tzonestation time zone
d_yearyear
d_daynumday number
d_hourhour
d_minuteminute
d_secondseconds
d_temptemperature DEFAULT 10.0 (standard temperature)
d_presspressure DEFAULT 1013.0 (standard pressure)
d_tilttilted DEFAULT 0.0 (horizontal panel)
d_aspectaspect DEFAULT 180.0 (South-facing panel)
Returns
int

Definition at line 89 of file CalcSZA.c.

References S_aspect, S_date(), S_daynum, S_hour, S_latitude, S_longitude, S_minute, S_press, S_second, S_solpos(), S_temp, S_tilt, S_timezone, and S_year.

Referenced by D_AutoExecution(), SZA_FindMin(), SZA_FirstCalc(), and Task_Timer().

92 {
93  //Coordinate TNB
94  // S_longitude = 164.123; /* Note that latitude and longitude are */
95  // S_latitude = -74.695; /* in DECIMAL DEGREES, not Deg/Min/Sec */
96  // S_timezone = 11.0; /* Eastern time zone, even though longitude would
97  // suggest Central. We use what they use.
98  // DO NOT ADJUST FOR DAYLIGHT SAVINGS TIME. */
99  //Coordinate StaraZagora BG
100  // S_longitude = 25.633;
101  // S_latitude = 42.416;
102  // S_timezone = 2;
103 
104  //Coordinate Bologna
105  // S_longitude = 11.333;
106  // S_latitude = 44.483;
107  // S_timezone = 1;
108 
109  //Coordinate GreenWitch
110  // S_longitude = 0;
111  // S_latitude = 51.29;
112  // S_timezone = 0;
113 
114  //Coordinate 0,90,0
115  // S_longitude = 0;
116  // S_latitude = 90;
117  // S_timezone = 0;
118 
119  //Coordinate Mt Cimone
120  // S_longitude = 10.42;
121  // S_latitude = 44.11;
122  // S_timezone = 1;
123 
124  S_longitude = d_long;
125  S_latitude = d_lat;
126  S_timezone = d_tzone;
127  S_year = d_year;
128  S_daynum = d_daynum;
129 
130  S_date ( );
131 
132  S_hour = d_hour;
133  S_minute = d_minute;
134  S_second = d_second;
135 
136  S_temp = d_temp;
137  S_press = d_press;
138 
139  S_tilt = S_latitude; /* Tilted at latitude */
140  S_aspect = d_aspect; /* 135 deg. = SE */
141 
142  S_solpos ( );
143 
144  return 0;
145 }
double S_press
Definition: SOLPOS.C:75
int S_date(void)
Returns date. This function calculates the month and day of month, given the day number (number of d...
Definition: SOLPOS.C:166
int S_minute
I: Minute of hour, 0 - 59, DEFAULT = 0 I: Minute of hour, 0 - 59, DEFAULT = 0.
Definition: SOLPOS.C:36
*double S_latitude
I: Latitude, degrees north (south negative) */.
Definition: SOLPOS.C:69
double S_aspect
Definition: SOLPOS.C:43
*double S_tilt
I: Degrees tilt from horizontal of panel */.
Definition: SOLPOS.C:85
double S_longitude
I: Longitude, degrees east (west negative) */.
Definition: SOLPOS.C:70
int S_daynum
I/O: Day number (day of year; Feb 1 = 32 ) I/O: Day number (day of year; Feb 1 = 32 ) S_date needs th...
Definition: SOLPOS.C:34
*double S_temp
Definition: SOLPOS.C:84
int S_hour
I: Hour of day, 0 - 23, DEFAULT = 12 I: Hour of day, 0 - 23, DEFAULT = 12.
Definition: SOLPOS.C:35
int S_solpos(void)
Returns ..... This function calculates the apparent solar position and intensity (theoretical maximu...
Definition: SOLPOS.C:246
double S_timezone
Definition: SOLPOS.C:86
int S_year
I: 4-digit year (2-digit is assumed 19xx) I: 4-digit year (2-digit is assumed 19xx) DEFAULT = 2001...
Definition: SOLPOS.C:39
int S_second
I: Second of minute, 0 - 59, DEFAULT = 0 I: Second of minute, 0 - 59, DEFAULT = 0.
Definition: SOLPOS.C:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Task_AMSH()

void Task_AMSH ( TIMEOUT_ID  id,
void *  data 
)

AMS Home Task.
Refresh the temperatures during DAS execution.

Definition at line 1047 of file Chktemp.c.

References AMS1, AMS_chkbitsts(), flag::AMS_H, AMS_TrackOff(), AMSH_TASK_TIME, FLAG, MAddTimeout(), and Task_AMSH().

Referenced by Task_AMSH().

1048 {
1049 
1050  int d,er;
1051 
1052 
1053 
1054  // Read input
1055  d = AMS_chkbitsts(AMS1, 3);
1056  FLAG.AMS_H = 1;
1057  if (d==0)
1058  {
1059 
1060  er = AMS_TrackOff(AMS1, 1, 0);
1061  FLAG.AMS_H = 0;
1062  }
1063 
1064  if(FLAG.AMS_H)
1065  MAddTimeout(AMSH_TASK_TIME, Task_AMSH, data); // rilancia il task
1066 }
flag FLAG
Definition: CreateForms.c:84
void Task_AMSH(TIMEOUT_ID id, void *data)
AMS Home Task. Refresh the temperatures during DAS execution.
Definition: Chktemp.c:1047
#define AMSH_TASK_TIME
AMS Home.
unsigned int data[576]
Conversion data buffer 64 samples * 8 channels * 2 bytes.
int AMS_H
Home AMS.
int AMS_TrackOff(int id, int amot, int bmot)
tracking off Procedure for Stepper Motor tracking de-activation
Definition: Dxl.c:422
#define AMS1
AMS1 address.
int AMS_chkbitsts(int id, int bitn)
check bit status Procedure for the determination of the bit number status.
Definition: Dxl.c:192
TIMEOUT_ID MAddTimeout(CARD32 tmout, TIMEOUT_CB cb, void *ud)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Task_AutoEx()

void Task_AutoEx ( TIMEOUT_ID  id,
void *  data 
)

Automatic Execution Task.
.

Definition at line 963 of file RTC_Time.c.

References AUTOEX_TASK_TIME, D_AutoExecution(), and MAddTimeout().

Referenced by LaunchBackTask().

965 {
966  // Here it can be added a call to a function for the execution of the operations
967  // in the while(1) loop in the RunFULL function.
968  // This in order to remove the MLoopWhileEvents(0) in RunFULL for a low use of the CPU
969  // i.e. -->
970  D_AutoExecution();
971 
972 
973  id = MAddTimeout(AUTOEX_TASK_TIME, Task_AutoEx, data); // rilancia il task
974 
975 }
void Task_AutoEx(TIMEOUT_ID id, void *data)
Automatic Execution Task. .
Definition: RTC_Time.c:963
void D_AutoExecution(void)
*.PRG Automatic Execution in Automatic Mode
Definition: RTC_Time.c:560
#define AUTOEX_TASK_TIME
Autoexecution.
unsigned int data[576]
Conversion data buffer 64 samples * 8 channels * 2 bytes.
TIMEOUT_ID MAddTimeout(CARD32 tmout, TIMEOUT_CB cb, void *ud)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Task_CCD_Temp()

void Task_CCD_Temp ( TIMEOUT_ID  id,
void *  data 
)

CCD Temperature Task.
Provide the thermoregulation of the CCD sensor during DAS execution.

Definition at line 1068 of file Chktemp.c.

References controlpanel::Albl_CS, marconi::CCDTemp, CCDTEMP_TASK_TIME, CELSIUS, gui::ContrPanel, paramini::CoolPw, D_FixSZA(), DB_InitCamera(), DC_CoolerStatus(), DC_GetPower(), DC_GetTemp(), DC_SetPower(), DC_SetTemp(), flag::DeltaSZA, flag::exec, flag::ExeDSZA, FLAG, das::Flag, FlgSM_Stop, das::Gui, paramini::ITemp, dsza::LastMSZA, MAddTimeout(), das::Marconi, MObjectSetText(), das::Paramini, omuthr::ReachTemp, flag::REINITCCD, S_zenetr, Status(), SZADelta, Task_CCD_Temp(), and flag::UPS_Battery.

Referenced by LaunchBackTask(), and Task_CCD_Temp().

1069 {
1070  char ActTemp[16], buf[16];
1071  char buff[128];
1072  int er = 0;
1073  double CCD_Pwr;
1074  unsigned long et;
1075  static unsigned long starttime;
1076  double tout,x;
1077  SYSTEM_POWER_STATUS status;
1078 
1079  //Read the CCD Temperature
1080  DC_GetTemp(ActTemp, CELSIUS, 0);
1081 
1082  /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1083  /******************************************************************************************/
1084  /* These few line of code are necessary because for the period 00:00:00-01:00:00
1085  sometimes the DC_GetTemp procedure returns an empty string, so the code check if
1086  the second character of the returned string is not 0 (normally it has to be + or -)
1087  and in this case assign the temperature to the DAS.Marconi.CCDTemp variable, otherwhise
1088  it mantain the previous value
1089  */
1090  /******************************************************************************************/
1091  if (ActTemp[1] != 0)
1092  {
1093  DAS.Marconi.CCDTemp = (float) atof(ActTemp);
1094  sprintf(buf, "%0.1lf", DAS.Marconi.CCDTemp);
1096  }
1097  /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
1098 
1099  /* If the temperature is -273.15 the USB connection is lost and the camera have to be reinitializied */
1100  if (DAS.Marconi.CCDTemp < -250)
1101  {
1104  if(FLAG.exec)
1105  {
1106  FLAG.exec = 0;
1107  FLAG.REINITCCD = 0;
1108  starttime = GetTickCount()-1000;
1109 
1110  Status("Camera Re-Init in 60 sec");
1111 
1112  if(DAS.Flag.DeltaSZA == 1)
1113  {
1114  DAS.Flag.ExeDSZA = 0; //Stop PRG Execution
1115 
1116  // SZADelta.LastMSZA = S_zenetr;
1117  // D_FixSZA();
1118  }
1119 
1120  }
1121 
1122  if(FLAG.exec == 0 && FLAG.REINITCCD == 0)
1123  {
1124  et = GetTickCount();
1125  x = labs(et - starttime)/1000.0;
1126  if(x <60)
1127  {
1128 
1129  tout = 60.0 - x;
1130  sprintf (buff,"Camera Init in %.1lf sec", tout);
1131  Status(buff);
1132  }
1133  else
1134  FLAG.REINITCCD = 1;
1135 
1136  }
1137 
1138 
1139  if(FlgSM_Stop && FLAG.REINITCCD)
1140  {
1141  er = DB_InitCamera(1);
1142 
1143  FLAG.exec = 1;
1144  FLAG.REINITCCD = 0;
1145  Status("Ready");
1146  // If a SZAPRG or a *.PRG file is in execution with the DeltaSZA Mode activated
1147  // the next SZA has to be recalculated
1148 
1149 
1150  if(DAS.Flag.DeltaSZA == 1)
1151  {
1152  DAS.Flag.ExeDSZA = 1; //PRG Execution
1153 
1155  D_FixSZA();
1156 
1157  }
1158 
1159 
1160  }
1161 
1162 
1163 
1164  }
1165 
1166 
1167  /******************************************************************************************/
1168 
1170  //if( fabs(DAS.Marconi.CCDTemp - DAS.Paramini.ITemp) <= 1.00)
1171  {
1172  OMUTHR.ReachTemp = 1;
1173 // Status("CCD Temp Reached");
1174 
1175  }
1176 // else
1177 // {
1178 // OMUTHR.ReachTemp = 0;
1179 
1180 // }
1181 
1182  er = DC_CoolerStatus(0);
1183 
1184  switch (er)
1185  {
1186  case 0:
1187 // Status("Cooler Not Activated");
1188  break;
1189 // case 1:
1190 // Status("Cooler Active without temp. control");
1191 // break;
1192  case 1:
1193 // Status("Cooler Active, waiting for equilibrium");
1194  break;
1195  case 2:
1196 // Status("Equilibrium Reached");
1197 // LIS.ReachTemp = 1;
1198  break;
1199  case 3:
1200 // Status("Equilibrium Reached");
1201  // OMUTHR.ReachTemp = 1;
1202  break;
1203 
1204  case 4:
1205 // Status("ShutDown in Progress");
1206  break;
1207  case 5:
1208 // Status("ShutDown Done");
1209  break;
1210 
1211  }
1212 
1213  CCD_Pwr = DC_GetPower(0);
1214  sprintf(buf, "%.1lf%%", CCD_Pwr);
1216 
1217 /*******************************************************************************************/
1218  // These lines of code are related to the possibility of a UPS linked to the
1219  // instrument:
1220  // 1) The UPS is a serial one (recognized by the Operating System) therefore DAS
1221  // uses the windows API to be adviced about the battery utilization
1222  // 2) The UPS utilize a open collector/open emitter technology, so DAS knows about the
1223  // utilization of the battery with the inputs port of the mainboard I/O
1224 
1225  // 1)
1226  //Check the Supply status
1227  GetSystemPowerStatus( &status );
1228 
1229  switch (status.ACLineStatus)
1230  {
1231  case 1: // Power On Line
1232  if(DAS.Flag.UPS_Battery == 1)
1233  DAS.Flag.UPS_Battery = 2;
1234  else
1235  DAS.Flag.UPS_Battery = 0;
1236  break;
1237  case 0: //Battery on line
1238  DAS.Flag.UPS_Battery = 1;
1239  break;
1240  }
1241 
1242  // 2)
1243  //Check the Supply status
1244 /* er = NOVA_In(DAS.Nova.type, DAS.Nova.DigIn);
1245  er = ChkDigIO(DAS.Nova.DigIn, 0);
1246  if(er==1)
1247  DAS.Flag.UPS_Battery = 1;
1248  if (er == 0 & DAS.Flag.UPS_Battery == 1)
1249  DAS.Flag.UPS_Battery = 2;
1250 */
1251 
1252 
1253 
1254  // Common
1255  if (DAS.Flag.UPS_Battery == 1) // UPS battery ON
1256  {
1257  //Shutdown CCD sensor
1258  DC_SetTemp(25.0, CELSIUS, 0);
1259 
1260  //Switch off the Peltier
1261 
1262  }
1263  else if (DAS.Flag.UPS_Battery == 2)
1264  {
1265  DAS.Flag.UPS_Battery = 0;
1266  // Set CCD Temperature
1268  // Set CCD Cooler Power
1269  DC_SetPower((double) ((double)DAS.Paramini.CoolPw / 10),0);
1270 
1271  //Switch on the Peltier
1272 
1273 
1274  }
1275 /*******************************************************************************************/
1276 
1277  MAddTimeout(CCDTEMP_TASK_TIME, Task_CCD_Temp, data); // rilancia il task
1278 
1279 
1280 
1281 
1282 }
flag FLAG
Definition: CreateForms.c:84
gui Gui
Graphic User Interface Structure.
double S_zenetr
Definition: SOLPOS.C:92
int DB_InitCamera(int mod)
Initialize Camera Parameters. Procedure that initialize the CCD Camera.
Definition: Init.c:170
dsza SZADelta
Definition: DAS_Spat.c:76
double LastMSZA
SZA of the previous measurement.
int REINITCCD
Flag for CCD re-Initialization: =0 - wait for countdown, =1 - Ready for re-init camera.
flag Flag
Structure for different flags.
das DAS
Definition: Chktemp.c:26
MOBJECT Albl_CS[4]
Active Control Panel Labels for Camera Status 4.
void MObjectSetText(MOBJECT obj, const char *text)
int FlgSM_Stop
Steppers Motor Activity: 0 = Motors moving; 1 = Motors stopped.
Definition: DAS_Spat.c:140
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
CTYPE double DLL DC_GetTemp(char *CurrentTemperature, int Scale, int Camera)
Procedure that allows you to read the temperature of the sensor. Procedure that allows you to read th...
unsigned int data[576]
Conversion data buffer 64 samples * 8 channels * 2 bytes.
float CCDTemp
Actual CCD Temperature.
CTYPE void DLL DC_SetTemp(double TargetTemperature, int Scale, int Camera)
Procedure that turns the camera cooler on and allows you to set an operative temperature of the CCD...
int CoolPw
CCD Init Power.
int UPS_Battery
flag for UPS Battery: = 0 Normal Operation, 1 = working on UPS battery
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
int DeltaSZA
= 1 Delta SZA measurements activated, = 0 Continous measurements
#define CELSIUS
Return CCD temperature in Celsius.
Definition: dcldef.h:449
void D_FixSZA(void)
Definition: RTC_Time.c:467
CTYPE void DLL DC_SetPower(double CoolerPower, int Camera)
Procedure that allows you to set the cooler power. Procedure that allows you to set the power (%) of ...
omuthr OMUTHR
Definition: Chktemp.c:27
controlpanel ContrPanel
Control Panel Structure.
int ExeDSZA
= 1 the measurements are performed, = 0 waiting for the next deltasza.
#define CCDTEMP_TASK_TIME
CCD temperature.
CTYPE int DLL DC_CoolerStatus(int Camera)
Procedure that reports the activity status of the cooler.
CTYPE double DLL DC_GetPower(int Camera)
Return current cooler power. Procedure that allows you to read the power (%) of the cooler currently ...
TIMEOUT_ID MAddTimeout(CARD32 tmout, TIMEOUT_CB cb, void *ud)
double ITemp
CCD Target Temperature.
int ReachTemp
Target Temperature status.
marconi Marconi
CCD Sensor struct.
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
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:

§ Task_HomeGrat()

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 at line 980 of file RTC_Time.c.

References controlpanel::Albl_LS, AMS1, AMS_AzzeraCoord(), AMS_chkbitsts(), AMS_MotorOn_Off(), AMS_ReadStep(), flag::AMSPres, DXL_par::bufrx, gui::ContrPanel, flag::exemode, das::Flag, GRAT_TASK_TIME, ids::GRATHOME, das::Gui, HomeGratingFast(), IDS, MANUAL, MObjectSetText(), MRefreshTimeout(), stepm::postime, PRGFILE, stepm::SM_B, st, Status(), das::StepM, SZAMASTERM, SZAMODE, TEMPORIZED, and TESTAMS.

Referenced by E_Home_SM1(), HomeTrack(), and LaunchBackTask().

981 {
982  int cwer = 0, ccwer = 0; //Clock Wise, Counter Clock Wise er values
983  char buf[80];
984  int er = 0;
985  long ns, np;
986  int HomeGratActive = 0;
987  unsigned long st, et, x;
988  long tout;
989 
990  /**************************************************************/
991  // check for reached end-run of the stepper motor for the grating
992  if ((DAS.Flag.exemode == TEMPORIZED) |
993  (DAS.Flag.exemode == PRGFILE) |
994  (DAS.Flag.exemode == TESTAMS) |
995  (DAS.Flag.exemode == MANUAL) |
996  (DAS.Flag.exemode == SZAMASTERM) |
997  (DAS.Flag.exemode == SZAMODE))
998  {
999  if(FLAG.AMSPres == 0)
1000  {
1001 
1002  cwer = AMS_chkbitsts(AMS1, 6); //AMS1-IOP(6) = 1: end-run Vis.
1003  ccwer = AMS_chkbitsts(AMS1, 7);//AMS1-IOP(7) = 1: end-run UV
1004 
1005  if (cwer || ccwer)
1006  {
1007  //Flag to be passed to HomeGratingFast in order to refresh the task time
1008  HomeGratActive = 1;
1009  //Read steps
1010  np = AMS_ReadStep(0, 1);
1011  //Grating Motor OFF
1012  er = AMS_MotorOn_Off(0, 1, 0);
1013  //wait for remaining steps finalization
1014 
1015 
1016 //*********************************************
1017 
1018 
1019  tout = DAS.StepM.postime[AMS1][DAS.StepM.SM_B]+1000;
1020  st = GetTickCount();
1021  do
1022  {
1023  et = GetTickCount();
1024  x = labs(et - st);
1025  //MLoopWhileEvents(0);
1026  //if((x % 10 == 0) && (x > 0))
1027  if(x > 0)
1028  {
1029 
1030  sprintf(buf, "%.1lf sec. left", (double)fabs(((double)(labs(et - st) - tout))/1000.0 ));
1031  Status (buf);
1032 
1033  }
1034  }while(labs(et - st) < tout);
1035 
1036 
1037 
1039 
1040 
1041 
1042  //delay(30000);
1043 
1044  er = AMS_AzzeraCoord(0, 1);
1045  ns = AMS_ReadStep(0, 1);
1046  sprintf(buf, "%ld", ns);
1047 
1048  //Mirror and Grating Motor ON
1049  er = AMS_MotorOn_Off(0, 1, 1);
1050 
1051  DXL.bufrx[0] = '0';
1052  DXL.bufrx[1] = '0';
1053  MObjectSetText(DAS.Gui.ContrPanel.Albl_LS[1], "4358");
1054  HomeGratingFast(HomeGratActive);
1055 
1056  }
1057  else
1058  {
1059  //Home Grating Task
1061 
1062  }
1063  }
1064  }
1065 }
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
void MRefreshTimeout(TIMEOUT_ID *pid, CARD32 msec, TIMEOUT_CB cb, void *ud)
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
flag Flag
Structure for different flags.
int HomeGratingFast(int mod)
(Fastest) Grating in the reference Position. The Grating reaches the reference Position. Similar to HomeGrating(void), but faster
Definition: Init.c:780
#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 GRATHOME
Home for Grating ID.
char bufrx[1024]
Rx buffer.
Definition: DXL.H:20
long postime[AMSMAX][2]
time necessary for positioning
int AMS_MotorOn_Off(int id, int mtr1, int mtr2)
Motor ON-OFF. Switch On-Off the selected motor of the selected AMS.
Definition: Dxl.c:930
DXL_par DXL
Definition: RTC_Time.c:24
void Status(char *tit)
Writes information&#39;s on the Status label .
Definition: Load.c:1556
#define GRAT_TASK_TIME
Grating Home.
#define PRGFILE
execution driven by *.prg file
das DAS
DAS structure.
Definition: RTC_Time.c:34
unsigned long AMS_ReadStep(int id, int motor)
read performed steps Procedure for the determination of the number of steps executed.
Definition: Dxl.c:60
ids IDS
ID tasks.
Definition: DAS_Spat.c:54
flag FLAG
flags structure
Definition: RTC_Time.c:25
#define SZAMODE
execution driven by SZAPRG file
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
controlpanel ContrPanel
Control Panel Structure.
int AMS_AzzeraCoord(int id, int mtr)
Set to zero the number of steps on the selected motor Set to zero the number of steps on the selecte...
Definition: Dxl.c:439
#define AMS1
AMS1 address.
int AMS_chkbitsts(int id, int bitn)
check bit status Procedure for the determination of the bit number status.
Definition: Dxl.c:192
static double st
Definition: SOLPOS.C:142
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
int AMSPres
AMS Presence: 0 = AMS FOUND; 1 = AMS NOT FOUND.
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:

§ Task_LIS_Temp()

void Task_LIS_Temp ( TIMEOUT_ID  id,
void *  data 
)

OMU Thermoregulation Task.
Provide the thermoregulation of the Optical Mechanical Unit
In addition allows the CCD sensor temperature to be driven by the SZA
.

Definition at line 873 of file Chktemp.c.

References _MAX_PATH, flag::ADPC104, flag::ADTempTest, controlpanel::Albl_LS, CELSIUS, gui::ContrPanel, omuthr::CoolAT, omuthr::CoolCnt, paramini::CoolPw, omuthr::CoolTT, D_readtemp(), DC_SetPower(), DC_SetTemp(), DeltaTPrec, das::DOption, paramini::EqType, FANECU(), FirstTime, FirstTimeP, FLAG, FlgSM_Stop, das::Gui, Incr_Read_Temp, controlpanel::lbl_Par, LIS_, LISTEMP_TASK_TIME, MAddTimeout(), Master, MObjectSetText(), OMU_AssignPow(), OMU_ChooseDir(), OMU_TemperatureHandle(), das::Paramini, omuthr::PCPower, omuthr::PHPower, PrgFile, optionini::refertemp, S_zenetr, flag::settemp070, flag::settemp7080, flag::settemp8095, flag::settempvar, Task_LIS_Temp(), omuthr::Temperature, and paramini::TPelt.

Referenced by ADTesterCB(), CloseConfigCB(), LaunchBackTask(), and Task_LIS_Temp().

875 {
876  static float power;
877  double DeltaT;
878  extern int FirstTime;
879  extern int DeltaTPrec;
880  extern int Incr_Read_Temp;
881  char Label[30];
882  int DeltaTMax = 300;
883  int DeltaTMin = 0;
884  int stopplt = 0;
885  char str[64];
886 
887  extern char PrgFile[_MAX_PATH];// Nome della tabella da eseguire
888 
889  /**********************************************************************/
890  /********** for OMU Thermoregulation ****************************/
891  //Target temperature
892  OMUTHR.CoolTT = (float)DAS.Paramini.TPelt * 10;
893 
894  // Read Temperatures
895  D_readtemp();
896 
897  //Actual temperature (Reference)
898  switch (DAS.DOption.refertemp)
899  {
900  case 0:
901  if(DAS.Paramini.EqType == LIS_)
902  OMUTHR.CoolAT = (OMUTHR.Temperature[9] + OMUTHR.Temperature[13]) * 10 / 2; //Average internal Peltier
903  else
904  OMUTHR.CoolAT = (OMUTHR.Temperature[12] + OMUTHR.Temperature[14]) * 10 / 2; //Average internal Peltier
905  break;
906  case 1:
907  if(DAS.Paramini.EqType == LIS_)
908  OMUTHR.CoolAT = OMUTHR.Temperature[11] * 10; //Optic LIS
909  else
910  OMUTHR.CoolAT = OMUTHR.Temperature[15] * 10; //Optic
911  break;
912  case 2:
913  OMUTHR.CoolAT = OMUTHR.Temperature[10] * 10; //Grating
914  break;
915  }
916 
917 
918  DeltaT = OMUTHR.CoolAT - OMUTHR.CoolTT;
919 
920  if(FirstTimeP == 0)
921  {
922  FirstTimeP = 1;
923  //OMUTHR.PCPower = 550;
924  OMUTHR.PHPower = OMUTHR.PCPower;// / 3;
925  }
926 
927 
928  //Security control
929  //Ccontrollo sulle temperature esterne
930  //Se una o l'altra temperatura ext sono maggiori di 55 gradi
931  // bisogna spegnere le peltier!!!!!!
932  if(DAS.Paramini.EqType == LIS_)
933  {
934  if( (OMUTHR.Temperature[8] > 55) | (OMUTHR.Temperature[12] > 55) )
935  stopplt = 1;
936  }
937  else
938  {
939  if( (OMUTHR.Temperature[11] > 55) | (OMUTHR.Temperature[13] > 55) )
940  stopplt = 1;
941  }
942 
943  if(stopplt)
944  {
945  if(FlgSM_Stop)
946  {
947  OMU_ChooseDir(1);
948  OMU_AssignPow(0); //Peltier OFF
949  }
950  }
951  else
952  {
953  //OMU Thermo Regulation
954  if(OMUTHR.CoolCnt == 1)
956  else
957  OMUTHR.CoolCnt--;
958  }
959  //Label deltaT
960  sprintf(Label,"%.02lf", DeltaT/10);
962  /**********************************************************************/
963 /************************************************************************************/
964 // Procedura per scegliere la temperatura di esercizio del CCD a diversi SZA
965 // se si sta eseguendo una tabella di misure.
966 
967  if((PrgFile[0] != 0) | (Master == 1)) // Se si esegue una tabella
968  {
969  if(FLAG.settempvar) //Se il flag per la temperatura variabiele è attivo
970  {
971  if( (S_zenetr >= 80) & (S_zenetr <= 95))
972  {
973  if(FLAG.settemp8095)
974  {
975  // Imposta la temperatura di esercizio CCDTemp
976  DC_SetTemp( -15.0, CELSIUS, 0);
977  // Imposta la potenza del cooler del CCD
978  DC_SetPower((double)35.0, 0);
979  sprintf(str, "%.1lf", -15.00);
981  sprintf(str,"%.1lf%%",35.00);
983  FLAG.settemp8095 = 0;
984  FLAG.settemp7080 = 1;
985  FLAG.settemp070 = 1;
986  }
987  }
988  else if( (S_zenetr >= 70) & (S_zenetr < 80))
989  {
990  if(FLAG.settemp7080)
991  {
992  // Imposta la temperatura di esercizio CCDTemp
993  DC_SetTemp( -5.0, CELSIUS, 0);
994  // Imposta la potenza del cooler del CCD
995  DC_SetPower((double)35.0, 0);
996  sprintf(str, "%.1lf", -5.00);
998  sprintf(str,"%.1lf%%",35.00);
1000  FLAG.settemp8095 = 1;
1001  FLAG.settemp7080 = 0;
1002  FLAG.settemp070 = 1;
1003  }
1004  }
1005  else if( ((S_zenetr >= 0) & (S_zenetr < 70)) | (S_zenetr > 95))
1006  {
1007  if(FLAG.settemp070)
1008  {
1009  // Imposta la temperatura di esercizio CCDTemp
1010  DC_SetTemp( 5.0, CELSIUS, 0);
1011  // Imposta la potenza del cooler del CCD
1012  DC_SetPower(DAS.Paramini.CoolPw/10, 0);
1013  sprintf(str, "%.1lf", 5.00);
1015  sprintf(str,"%.1lf%%",DAS.Paramini.CoolPw/10.00);
1017  FLAG.settemp8095 = 1;
1018  FLAG.settemp7080 = 1;
1019  FLAG.settemp070 = 0;
1020  }
1021  }
1022 
1023  }
1024  }
1025 
1026  /******************************************************/
1027  //Fan ECU
1028 
1029  if (OMUTHR.Temperature[8] >= 22)
1030  FANECU(1);
1031  else
1032  FANECU(0);
1033 
1034 
1035 
1036 /************************************************************************************/
1037 
1038  if((FLAG.ADPC104 == 0) | (FLAG.ADTempTest == 0))
1039 // if(!FLAG.AMS_H)
1040  MAddTimeout(LISTEMP_TASK_TIME, Task_LIS_Temp, data); // rilancia il task
1041 
1042  DeltaTPrec = (int) DeltaT;
1043 
1044 }
int settemp070
char PrgFile[16]
Name of the PRG file.
Definition: DAS_Spat.c:91
flag FLAG
Definition: CreateForms.c:84
int D_readtemp(void)
Definition: Chktemp.c:1284
gui Gui
Graphic User Interface Structure.
int settemp7080
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
double S_zenetr
Definition: SOLPOS.C:92
unsigned int FirstTimeP
Definition: Chktemp.c:64
optionini DOption
Options for DAS execution.
int Master
Definition: DAS_Spat.c:100
int PCPower
Power to the Peltier for Cooling.
int FirstTime
Definition: DAS_Spat.c:110
das DAS
Definition: Chktemp.c:26
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
void OMU_ChooseDir(int mod)
Definition: Chktemp.c:328
float Temperature[16]
Temperatures.
void MObjectSetText(MOBJECT obj, const char *text)
int OMU_TemperatureHandle(void)
Definition: Chktemp.c:773
int FlgSM_Stop
Steppers Motor Activity: 0 = Motors moving; 1 = Motors stopped.
Definition: DAS_Spat.c:140
#define LIS_
Lampedusa Island Spectrometer - ENEA.
float CoolTT
Target Temperature (DTA -> DC_CoolTT)
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
unsigned int data[576]
Conversion data buffer 64 samples * 8 channels * 2 bytes.
int ADTempTest
= 0 -> AD Converter results on the Control Panel; = 1 -> AD Converter Testing Phase(results on the co...
CTYPE void DLL DC_SetTemp(double TargetTemperature, int Scale, int Camera)
Procedure that turns the camera cooler on and allows you to set an operative temperature of the CCD...
int CoolCnt
Time Counter.
int DeltaTPrec
Definition: DAS_Spat.c:111
int settemp8095
int PHPower
Power to the Peltier for Heating.
int CoolPw
CCD Init Power.
int Incr_Read_Temp
Definition: DAS_Spat.c:101
#define LISTEMP_TASK_TIME
spectrometer termoregulation
int ADPC104
0 –> Device PC104 exist, 1 –> PC104 DOESN&#39;T exist
#define _MAX_PATH
Definition: Dildef.h:202
#define CELSIUS
Return CCD temperature in Celsius.
Definition: dcldef.h:449
CTYPE void DLL DC_SetPower(double CoolerPower, int Camera)
Procedure that allows you to set the cooler power. Procedure that allows you to set the power (%) of ...
omuthr OMUTHR
Definition: Chktemp.c:27
controlpanel ContrPanel
Control Panel Structure.
float CoolAT
Actual Temperature (DTA -> DC_Temp)
void FANECU(int mod)
FAN ON/OFF .
Definition: Spat_Device.c:2619
int settempvar
void OMU_AssignPow(int pow)
Definition: Chktemp.c:425
int EqType
Spectrometer Type.
int refertemp
Flag to set the reference temp for thermo-regulation: 0 = AVGPINT; 1 = OPTIC; 2 = GRATING...
TIMEOUT_ID MAddTimeout(CARD32 tmout, TIMEOUT_CB cb, void *ud)
double TPelt
OMU Target Temperature.
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:

§ Task_LOG()

void Task_LOG ( TIMEOUT_ID  id,
void *  data 
)

LOG Task.
Write on the LOG file during DAS execution.

Definition at line 246 of file RTC_Time.c.

References controlpanel::Albl_CS, controlpanel::Albl_LS, flag::AMS_H, marconi::CCDTemp, gui::ContrPanel, bil::DFILEM, das::DGeo, dlog::flog, dlog::fsmlog, GetDateTime(), das::Gui, LOG_TASK_TIME, d_fileman::LOGDIR, MAddTimeout(), das::Marconi, MObjectGetText(), dlog::ndate, dlog::ntime, dlog::odate, d_geo::s_name, ShutterOpening(), SZA_FindMin(), and omuthr::Temperature.

Referenced by LaunchBackTask().

247 {
248  int fc;
249  int cont;
250  char str[80];
251  char tit1[256];
252 // time_t ltime;
253  struct tm today;
254  struct time RTime;
255  struct date RDate;
256 
257  GetDateTime(&RDate, &RTime, &today);
258  /* Get UNIX-style time */
259  //time( &ltime );
260  /* Use time structure to build a customized time string. */
261  //today = localtime( &ltime );
262  /* Use strftime to build a customized time string. */
263  strftime( DLOG.ndate, 7,"%y%m%d", &today );
264  strftime( DLOG.ntime, 9,"%H:%M:%S", &today );
265 
266  // If the date is changed, the log filename changes...
267  if(strcmp(DLOG.ndate, DLOG.odate) != 0)
268  {
269  sprintf(DLOG.odate, "%s",DLOG.ndate);
270  sprintf(DLOG.flog,"%s\\%s%s.log", BIL.DFILEM.LOGDIR, DAS.DGeo.s_name, DLOG.ndate);
271 
272  //for stepper motors log
273  sprintf(DLOG.fsmlog,"%s\\SM_%s.log", BIL.DFILEM.LOGDIR, DLOG.ndate);
274 
275  fc = open(DLOG.flog, O_WRONLY | O_APPEND | O_TEXT | O_CREAT, S_IWRITE);
276  if(fc < 0) return;
277 
278  // Write title for monitored values
279  sprintf(tit1,"Time TCCD PwCCD PwPlt T.Optic T.IntSX T.OutSX T.IntDX T.OutDX T.Grat SPARE T.Elec SPARE SPARE SPARE SPARE SPARE SPARE SPARE SPARE \n");
280  write(fc, tit1, strlen(tit1));
281  close(fc);
282 
283  SZA_FindMin(); //...and the minimum daily SZA is calculate...
284 
285  ShutterOpening(1);// ...and write on the Shutter.ini the number of shuts
286 
287  }
288 
289  fc = open(DLOG.flog, O_WRONLY | O_APPEND | O_TEXT| O_CREAT, S_IWRITE);
290  if(fc > 0)
291  {
292 
293  sprintf(str, "%s ",DLOG.ntime); //Time
294  write(fc, str, strlen(str));
295 
296  sprintf(str, "%5.1lf ", DAS.Marconi.CCDTemp); // Temperature CCD
297  //MObjectGetText(DAS.Gui.ContrPanel.Albl_CS[0], str);
298  //strcat(str," ");
299  write(fc, str, strlen(str));
300 
301  MObjectGetText(DAS.Gui.ContrPanel.Albl_CS[1], str); //Power CCD
302  strcat(str," ");
303  write(fc, str, strlen(str));
304 
305  MObjectGetText(DAS.Gui.ContrPanel.Albl_LS[7], str); //Power Peltier
306  strcat(str," ");
307  write(fc, str, strlen(str));
308 
309 
310 
311  for(cont = 15; cont >= 0; cont--)
312  {
313 
314  sprintf(str, "%5.1lf ", OMUTHR.Temperature[cont]);
315  write(fc, str, strlen(str));
316  }
317 
318  sprintf(str, "\n","");
319  write(fc, str, strlen(str));
320 
321  //sprintf(str, "%5.1lf %d %2d:%02d:%02d\n\r",Temp, CoolPw, t.ti_hour, t.ti_min, t.ti_sec);
322  //write(fc, str, strlen(str));
323 
324  }
325 
326  close(fc);
327 
328 
329 
330 
331 
332  if(!FLAG.AMS_H)
333  MAddTimeout(LOG_TASK_TIME, Task_LOG, data); // rilancia il task
334 }
gui Gui
Graphic User Interface Structure.
char odate[10]
Old Date.
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
char fsmlog[_MAX_PATH]
daily LOG file for stepper motor moovements
char LOGDIR[_MAX_PATH]
Definition: bildef.h:209
omuthr OMUTHR
Definition: RTC_Time.c:36
char * MObjectGetText(MOBJECT obj, char *text)
float Temperature[16]
Temperatures.
MOBJECT Albl_CS[4]
Active Control Panel Labels for Camera Status 4.
char ndate[10]
New Date.
d_geo DGeo
struct for Station location
char ntime[10]
New Time.
bil BIL
Definition: RTC_Time.c:30
char s_name[4]
Station name.
void Task_LOG(TIMEOUT_ID id, void *data)
LOG Task. Write on the LOG file during DAS execution.
Definition: RTC_Time.c:246
unsigned int data[576]
Conversion data buffer 64 samples * 8 channels * 2 bytes.
float CCDTemp
Actual CCD Temperature.
d_fileman DFILEM
Definition: bildef.h:257
Definition: Dildef.h:240
das DAS
DAS structure.
Definition: RTC_Time.c:34
void SZA_FindMin()
computation of daily minimum SZA
Definition: DAS_Spat.c:2808
flag FLAG
flags structure
Definition: RTC_Time.c:25
int AMS_H
Home AMS.
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
controlpanel ContrPanel
Control Panel Structure.
dlog DLOG
Definition: RTC_Time.c:29
char flog[_MAX_PATH]
daily LOG file
Definition: Dildef.h:234
#define LOG_TASK_TIME
LOG files.
TIMEOUT_ID MAddTimeout(CARD32 tmout, TIMEOUT_CB cb, void *ud)
void ShutterOpening(int mod)
Definition: Procedures.c:1685
marconi Marconi
CCD Sensor struct.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Task_REFRESH_Temp()

void Task_REFRESH_Temp ( TIMEOUT_ID  id,
void *  data 
)

Temperatures Task.
Refresh the temperatures during DAS execution.

Definition at line 1579 of file Chktemp.c.

References flag::AMS_H, D_readtemp(), FLAG, MAddTimeout(), REFRESHTEMP_TASK_TIME, and Task_REFRESH_Temp().

Referenced by LaunchBackTask(), and Task_REFRESH_Temp().

1580 {
1581 
1582  D_readtemp();
1583 // if (DAS.DOption.aaopmode == 0)
1584 // AASunTrack();
1585 
1586  if(!FLAG.AMS_H)
1587  //MRefreshTimeout(&IDS.REFRTEMP, REFRESHTEMP_TASK_TIME, Task_REFRESH_Temp, NULL);
1588 
1590 
1591 }
flag FLAG
Definition: CreateForms.c:84
int D_readtemp(void)
Definition: Chktemp.c:1284
void Task_REFRESH_Temp(TIMEOUT_ID id, void *data)
Temperatures Task. Refresh the temperatures during DAS execution.
Definition: Chktemp.c:1579
unsigned int data[576]
Conversion data buffer 64 samples * 8 channels * 2 bytes.
int AMS_H
Home AMS.
#define REFRESHTEMP_TASK_TIME
refresh of the spectrometer&#39;s temperatures.
TIMEOUT_ID MAddTimeout(CARD32 tmout, TIMEOUT_CB cb, void *ud)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Task_Timer()

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 saving time is in effect
3) Calculate the Solar Zenith Angle
4) Check the FLAG.sza in order to back-up the daily data via FTP and if all the condition are satisfied the back-up is performed
5) Check for reached end-run of the stepper motor for the grating
.

Definition at line 1184 of file RTC_Time.c.

References optionini::aaopmode, controlpanel::Albl_Azim, controlpanel::Albl_CS, controlpanel::Albl_Elev, controlpanel::Albl_sunr, controlpanel::Albl_suns, flag::AMS_H, gui::ContrPanel, d_fileman::DAILYDATADIRECTORY, bil::DFILEM, das::DGeo, das::DOption, das::Flag, FTP_Back_UP(), optionini::ftpbackup, flag::ftpstatus, GetDateTime(), das::Gui, d_fileman::HOMEDIRECTORY, d_geo::latitude, controlpanel::lbl_Time, d_geo::longitude, MAddTimeout(), MIGEAntiSunTrack(), MIGESunTrack(), MObjectGetText(), MObjectSetText(), optionini::resetEnabled, S_azim, d_geo::s_name, S_sunrise, S_sunset, S_zenetr, SetWindowsReset(), flag::sza, SZACalc(), SZAMax, TIMER_TASK_TIME, d_geo::timezone, flag::WindowsReboot, and WinRes().

Referenced by DB_ToolsKeyB_CB(), and LaunchBackTask().

1185 {
1186 
1187  char str[80];
1188  int er;
1189  char buff[32];
1190 // char datebuf[9];
1191 // long dp = 500;
1192  struct time RTime;
1193  struct date RDate;
1194 
1195  struct tm newtime;
1196 // long ltime;
1197  float t_acc = 0;
1198  int sunrh,sunrm,sunrs;
1199  int sunsh,sunsm,sunss;
1200  float CCD_Pwr;
1201 
1202 
1203  if (DAS.DOption.resetEnabled)
1204  {
1205  if(DAS.Flag.WindowsReboot == 0)
1206  SetWindowsReset();
1207 
1209  CCD_Pwr = (float)atof(buff);
1210 
1211  if (DAS.Flag.WindowsReboot ==1 && CCD_Pwr<=10.0)
1212  WinRes();
1213  }
1214 // _strdate(datebuf);
1215 
1216 // _strtime(timebuf);
1217 // time( &ltime );
1218 
1219 // newtime = localtime( &ltime );
1220 
1221  /**************************************************************/
1222  // Check if daylight saving time is in effect
1223  // tm_isdst > 0 if daylight saving time is in effect
1224  // tm_isdst = 0 if daylight saving time is not in effect
1225  // tm_isdst < 0 if status of daylight saving time is unknown.
1226 // if (newtime ->tm_isdst)
1227 // newtime ->tm_hour = newtime ->tm_hour - 1;
1228  //NOTE - In Daylight saving period on midnight the hours became -1 so...
1229 // if((newtime -> tm_hour) == -1)
1230 // {
1231  // Necessary for measurements performed at high latitude in summer seasons
1232 // newtime->tm_hour = 23;
1233 // newtime -> tm_yday = newtime -> tm_yday - 1;
1234 // }
1235 
1236  /**************************************************************/
1237  GetDateTime(&RDate, &RTime, &newtime);
1238 
1239  /**************************************************************/
1240  // Calc solar Zenith Angle (SZA)
1242  newtime.tm_year + 1900,
1243  newtime.tm_yday, newtime.tm_hour, newtime.tm_min, newtime.tm_sec,
1244  0, 1024, 0, 0);
1245  /**************************************************************/
1246  sprintf(str, "%.1lf", 90 - S_zenetr); //S_elevref = elevation refracted
1248 
1249  sprintf(str, "%.1lf", S_azim);
1251 
1252  // Sunrise and sunset times
1253  /*++++++++++++++++++++++++++++++++++++++*/
1254  sunrh = (int)floor(S_sunrise/60);
1255  sunrm = (int)floor( ((S_sunrise/60) - floor(S_sunrise/60))*60 );
1256  sunrs = (int)floor( ( (((S_sunrise/60) - floor(S_sunrise/60))*60) - floor((((S_sunrise/60) - floor(S_sunrise/60))*60)) )*60 );
1257 
1258  sprintf(str, "%02d:%02d:%02d", sunrh, sunrm, sunrs);
1259  //sprintf(str, "%.02lf", S_sunrise);
1261 
1262  sunsh = (int)floor(S_sunset/60);
1263  sunsm = (int)floor( ((S_sunset/60) - floor(S_sunset/60))*60 );
1264  sunss = (int)floor( ( (((S_sunset/60) - floor(S_sunset/60))*60) - floor((((S_sunset/60) - floor(S_sunset/60))*60)) )*60 );
1265 
1266  //sprintf(str, "%.02lf", S_sunset);
1267  sprintf(str, "%02d:%02d:%02d", sunsh, sunsm, sunss);
1269  /*++++++++++++++++++++++++++++++++++++++*/
1270 // S_sunrise = 720.0 - 4.0 * S_ssha - S_tstfix;
1271 // S_sunset = 720.0 + 4.0 * S_ssha - S_tstfix;
1272 
1273 
1274  /**************************************************************/
1275  // write on the STATUS label
1276  sprintf(str, "Loc.: %s, Date: %d/%02d/%02d, Local Solar Time: %02d:%02d:%02d, SZA:%.02lf",
1277  DAS.DGeo.s_name, newtime.tm_year + 1900, newtime.tm_mon + 1,newtime.tm_mday,
1278  newtime.tm_hour, newtime.tm_min, newtime.tm_sec, S_zenetr);
1279 
1281  /**************************************************************/
1282 
1283  /**************************************************************/
1284  // Set FLAG.sza
1285  // FLAG.sza = 1 --> perform measurements
1286  // FLAG.sza = 0 --> waiting mode
1287  if(S_zenetr < SZAMax)
1288  {
1289  FLAG.sza =1;
1290  FLAG.ftpstatus = 0; // back-up that will be performed when FLAG.sza = 0
1291  }
1292  else
1293  {
1294  FLAG.sza =0;
1295  if(FLAG.ftpstatus == 1) //Back-up performed
1296  FLAG.ftpstatus = 2; //Wait until the next sunset
1297 
1298  }
1299  /**************************************************************/
1300 
1301  /**************************************************************/
1302 
1303  /**************************************************************/
1304 
1305  //CHECK IF ALL THE CONDITION ARE SATISFIED
1306  //IN ORDER TO PERFORM BACKUP OF THE DATA VIA FTP
1307  /**************************************************************/
1308  if((FLAG.sza == 0) & (DAS.DOption.ftpbackup == 1) & (FLAG.ftpstatus == 0))
1310 
1311  // MIGE Sun tracker
1312  if (DAS.DOption.aaopmode == 0)
1313  MIGESunTrack();
1314 
1315  // MIGE ANTI Sun tracker
1316  if (DAS.DOption.aaopmode == 1)
1317  MIGEAntiSunTrack();
1318 
1319  /**************************************************************/
1320  if(!FLAG.AMS_H)
1321  //MRefreshTimeout(&IDS.TIMER, TIMER_TASK_TIME, Task_Timer, NULL);
1322  MAddTimeout(TIMER_TASK_TIME, Task_Timer, data); // rilancia il task
1323 
1324 
1325 }
gui Gui
Graphic User Interface Structure.
double S_zenetr
Definition: SOLPOS.C:92
optionini DOption
Options for DAS execution.
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
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
int sza
= 1 -> perform measurements; = 0 -> waiting mode
double latitude
Station latitude.
char DAILYDATADIRECTORY[_MAX_PATH]
Definition: bildef.h:203
void SetWindowsReset()
Definition: RTC_Time.c:1125
flag Flag
Structure for different flags.
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
char * MObjectGetText(MOBJECT obj, char *text)
MOBJECT Albl_CS[4]
Active Control Panel Labels for Camera Status 4.
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.
int FTP_Back_UP(char *dirhome, char *dirdata)
Definition: RTC_Time.c:336
MOBJECT lbl_Time
Control Panel Labels for Time.
bil BIL
Definition: RTC_Time.c:30
int timezone
Station timezone.
char s_name[4]
Station name.
unsigned int data[576]
Conversion data buffer 64 samples * 8 channels * 2 bytes.
d_fileman DFILEM
Definition: bildef.h:257
double S_sunrise
Definition: SOLPOS.C:80
Definition: Dildef.h:240
das DAS
DAS structure.
Definition: RTC_Time.c:34
void MIGEAntiSunTrack(void)
Definition: RTC_Time.c:206
int WindowsReboot
Flag that became 1 when Windows reboot is setted (SetWinowsReset)
flag FLAG
flags structure
Definition: RTC_Time.c:25
int ftpstatus
0 = FTP Back-UP Not executed; 1 = FTP Back-UP executed;
int AMS_H
Home AMS.
#define TIMER_TASK_TIME
timer
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
controlpanel ContrPanel
Control Panel Structure.
int ftpbackup
Flag to set back up: 0 = NO FTP Back-UP; 1 = Perform FTP Back-UP.
double longitude
Station longitude.
Definition: Dildef.h:234
int aaopmode
operation mode for the Alt Az Platform, 0 = solar Traxker; 1 = Anti-Solar Tracker; 2 = Free Positioni...
void MIGESunTrack(void)
Definition: RTC_Time.c:222
MOBJECT Albl_Elev
Active Control Panel Labels for Sun Elevation.
void WinRes(void)
Definition: RTC_Time.c:1067
int resetEnabled
DAS/Windows reset option (1 = Enabled; 0 = disabled)
TIMEOUT_ID MAddTimeout(CARD32 tmout, TIMEOUT_CB cb, void *ud)
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:

§ 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:

§ TestFontCB()

void TestFontCB ( MOBJECT  obj,
void *  a,
void *  data 
)

This callback tries to load the specified font.

Definition at line 1489 of file DAS_Spat_ConfCBs.c.

References DB_TestF().

Referenced by MDCreateDASConfig().

1490 {
1491 
1492  DB_TestF();
1493 
1494 
1495 }
void DB_TestF(void)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ TextColorAssignCB()

void TextColorAssignCB ( MOBJECT  o,
MVALUE  o_data,
void *  a_data 
)

Definition at line 744 of file DAS_Spat_ConfCBs.c.

References mtcl::black, cell_label, label_fgc, MObjectBackgroundColor(), MObjectSetColor(), and mtcl::white.

745 {
746  if (o_data)
747  {
748  label_fgc = (a_data ? MTCL.white : MTCL.black);
750  }
751 }
void MObjectSetColor(MOBJECT obj, MTColor bgc, MTColor fgc)
MOBJECT cell_label
Definition: DAS_Spatram.h:3057
MTColor black
mtcl MTCL
MTColor.
MTColor white
MTColor MObjectBackgroundColor(MOBJECT obj)
MTColor label_fgc
Definition: DAS_Spatram.h:3059
+ Here is the call graph for this function:

§ UnderOverPixCB()

void UnderOverPixCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Under/Over exposed pixels Callback
At the pression of the button in DAS_Config the appropriate shell (For the creation of the Under or Over exposed pixel map - with the MAPDefPix() function) will be created.

Parameters
a_data
  • = 0 –> Under Exposed pixels
  • = 1 –> Over Exposed pixels

Definition at line 4162 of file DAS_Spat_ConfCBs.c.

References MAPDefPix().

Referenced by CONFP_opt_page1().

4163 {
4164 
4165  int c = (int) a_data;
4166 
4167  MAPDefPix(c);
4168 /* switch (c)
4169  {
4170  case 0:
4171  MAPDefPix(0);
4172  break;
4173  case 1:
4174  MAPDefPix(1);
4175  break;
4176  case 2:
4177  MAPDefPix(2);
4178  break;
4179 
4180 
4181  }
4182 */
4183 }
void MAPDefPix(int mod)
create the Under/Over exposed pixels window At the pression of the button in DAS_Config the appropri...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ UndoFCB()

void UndoFCB ( MOBJECT  obj,
void *  a,
void *  v 
)

This callback UnDo the font choice (Not implemented yet)

Definition at line 1421 of file DAS_Spat_ConfCBs.c.

Referenced by MDCreateDASConfig().

1422 {
1423 
1424 }
+ Here is the caller graph for this function:

§ UPS_Status()

void UPS_Status ( void  )

Definition at line 32 of file Save.c.

Referenced by DB_ToolsKeyB_CB().

33 {
34 
35 
36  SYSTEM_POWER_STATUS status;
37 
38 
39  GetSystemPowerStatus( &status );
40 
41 }
+ Here is the caller graph for this function:

§ val2fraz()

void val2fraz ( int  id,
int  sn,
int  val 
)

Decimal value to ratio value
Similar to listval2fraz The decimal value indicating the fractioning of the step is translated in ratio (i.e. 0 –> 1/2 = 400 s/r, 1–> 1/4 =800 s/r)

Parameters
idNOT USED (0)
snNOT USED (0)
valsteps

Definition at line 2333 of file DAS_Spat_ConfCBs.c.

References stepm::step_fraz, and das::StepM.

Referenced by ApplyChCB(), AssignParam(), and WriteAMSCB().

2334 {
2335 
2336  char xx[10];
2337  int c = (int) val;
2338 
2339  switch (c)
2340  {
2341  case 0:
2342  {
2343  sprintf(xx, " 1/2");
2344  break;
2345  }
2346  case 1:
2347  {
2348  sprintf(xx, " 1/4");
2349 
2350  break;
2351  }
2352  case 2:
2353  {
2354  sprintf(xx, " 1/5");
2355 
2356  break;
2357  }
2358  case 3:
2359  {
2360  sprintf(xx, " 1/8");
2361 
2362  break;
2363  }
2364  case 4:
2365  {
2366  sprintf(xx, " 1/10");
2367 
2368  break;
2369  }
2370  case 5:
2371  {
2372  sprintf(xx, " 1/16");
2373 
2374  break;
2375  }
2376  case 6:
2377  {
2378  sprintf(xx, " 1/25");
2379 
2380  break;
2381  }
2382  case 7:
2383  {
2384  sprintf(xx, " 1/32");
2385 
2386  break;
2387  }
2388  case 8:
2389  {
2390  sprintf(xx, " 1/50");
2391 
2392  break;
2393  }
2394  case 9:
2395  {
2396 
2397  sprintf(xx, " 1/64");
2398  break;
2399  }
2400  case 10:
2401  {
2402  sprintf(xx, "1/125");
2403 
2404  break;
2405  }
2406  case 11:
2407  {
2408  sprintf(xx, "1/128");
2409  ;
2410  break;
2411  }
2412  case 12:
2413  {
2414  sprintf(xx, "1/250");
2415 
2416  break;
2417  }
2418  case 13:
2419  {
2420  sprintf(xx, "1/256");
2421 
2422  break;
2423  }
2424 
2425  }
2426 
2427 
2428  for(c = 0; c < (int) strlen(xx); c++)
2429  DAS.StepM.step_fraz[id][sn][c] = xx[c];
2430 
2431 
2432 
2433 }
stepm StepM
Stepper motors parameters structure.
das DAS
char step_fraz[AMSMAX][2][6]
Stepper Motors Step fraction.
+ Here is the caller graph for this function:

§ ValidateCB()

void ValidateCB ( MOBJECT  edit,
EDIT_VAL ev,
void *  ii 
)

Text Validation callback Validation callback for the text typed in different text box.

Definition at line 1632 of file DAS_Spat_ConfCBs.c.

References paramini::ccdWx, paramini::ccdWy, paramini::ccdXoff, paramini::ccdYoff, paramini::CoolPw, das::DOption, ccd::dx, ccd::dy, False, EDIT_VAL::focus_leave, paramini::ITemp, optionini::maxlvlar, paramini::maxtexp, MMessageDialog(), das::Paramini, omuthr::PCPower, EDIT_VAL::text, paramini::TPelt, and paramini::VBin.

Referenced by CONFP_AMS_SM_OFFSET(), CONFP_opt_page1(), CONFP_opt_page2(), CONFP_opt_page3(), CONFP_param_page1(), D_PlotTools(), MAPDefPix(), and MDCreateColFor_Sh().

1633 {
1634  int c = (int) ii;
1635 // int x,y;
1636 // div_t div_result;
1637 
1638  switch (c)
1639  {
1640  case 1:
1641  {
1642  DAS.Paramini.ITemp = strtod( ev->text, &ev->text );
1643  if (DAS.Paramini.ITemp < -40 || DAS.Paramini.ITemp > 30)
1644  {
1645  ev->focus_leave = False;
1646 
1647  }
1648  break;
1649  }
1650  case 2:
1651  {
1652  DAS.Paramini.CoolPw = (int) (strtod(ev->text, &ev->text ) * 10);
1653  if (DAS.Paramini.CoolPw < 0 || DAS.Paramini.CoolPw > 1000)
1654  {
1655  ev->focus_leave = False;
1656  }
1657  break;
1658  }
1659 
1660  case 3:
1661  {
1662  DAS.Paramini.TPelt = strtod( ev->text, &ev->text );
1663  if (DAS.Paramini.TPelt < 0 || DAS.Paramini.TPelt > 30)
1664  {
1665  ev->focus_leave = False;
1666  }
1667  break;
1668  }
1669  case 2000:
1670  {
1671  OMUTHR.PCPower = (int) (strtod(ev->text, &ev->text ) * 10);
1672  if (OMUTHR.PCPower < 0 || OMUTHR.PCPower > 1000)
1673  {
1674  ev->focus_leave = False;
1675  }
1676  break;
1677  }
1678 
1679  case 4:
1680  {
1681 
1682  DAS.Paramini.ccdXoff = (int) strtol( ev->text, &ev->text, 10 );
1684  {
1685  ev->focus_leave = False;
1686  }
1687  break;
1688  }
1689  case 5:
1690  {
1691  DAS.Paramini.ccdWx = (int) strtol( ev->text, &ev->text, 10 );
1692  if (DAS.Paramini.ccdWx < 0 || DAS.Paramini.ccdWx > DC_CCD.dx)
1693  {
1694  ev->focus_leave = False;
1695  }
1696  break;
1697  }
1698  case 6:
1699  {
1700 
1701  DAS.Paramini.ccdYoff = (int) strtol( ev->text, &ev->text, 10 );
1703  {
1704  ev->focus_leave = False;
1705  }
1706  break;
1707  }
1708  case 7:
1709  {
1710  DAS.Paramini.ccdWy = (int) strtol( ev->text, &ev->text, 10 );
1711  if (DAS.Paramini.ccdWy < 0 || DAS.Paramini.ccdWy > DC_CCD.dy)
1712  {
1713  ev->focus_leave = False;
1714  }
1715  break;
1716  }
1717 
1718  case 8:
1719  {
1720  DAS.Paramini.VBin = (int) strtol( ev->text, &ev->text, 10 );
1721 // x = DAS.Paramini.ccdWy - DAS.Paramini.ccdYoff;
1722 // y = DAS.Paramini.VBin;
1723 // div_result = div( x, y );
1724 // if (div_result.rem)
1725 // ev->focus_leave = False;
1726  break;
1727  }
1728 // SM1
1729 /* case 9:
1730  {
1731  DAS.StepM.cop[0] = (int) strtol( ev->text, &ev->text, 10 );
1732  if (DAS.StepM.cop[0] < 0 || DAS.StepM.cop[0] > 100)
1733  {
1734  ev->focus_leave = False;
1735  }
1736  break;
1737  }
1738  case 10:
1739  {
1740  DAS.StepM.step[0] = (int) strtol( ev->text, &ev->text, 10 );
1741  if (DAS.StepM.step[0] < 0 || DAS.StepM.step[0] > 13)
1742  {
1743  ev->focus_leave = False;
1744  }
1745  break;
1746  }
1747  case 11:
1748  {
1749  DAS.StepM.slope[0] = (int) strtol( ev->text, &ev->text, 10 );
1750  if (DAS.StepM.slope[0] < 0 || DAS.StepM.slope[0] > 255)
1751  {
1752  ev->focus_leave = False;
1753  }
1754  break;
1755  }
1756  case 12:
1757  {
1758  DAS.StepM.speed[0] = (int) strtol( ev->text, &ev->text, 10 );
1759  if (DAS.StepM.speed[0] < 1 || DAS.StepM.speed[0] > 50000)
1760  {
1761  ev->focus_leave = False;
1762  }
1763  break;
1764  }
1765 // SM2
1766  case 13:
1767  {
1768  DAS.StepM.cop[1] = (int) strtol( ev->text, &ev->text, 10 );
1769  if (DAS.StepM.cop[1] < 0 || DAS.StepM.cop[1] > 100)
1770  {
1771  ev->focus_leave = False;
1772  }
1773  break;
1774  }
1775  case 14:
1776  {
1777  DAS.StepM.step[1] = (int) strtol( ev->text, &ev->text, 10 );
1778  if (DAS.StepM.step[1] < 0 || DAS.StepM.step[1] > 13)
1779  {
1780  ev->focus_leave = False;
1781  }
1782  break;
1783  }
1784  case 15:
1785  {
1786  DAS.StepM.slope[1] = (int) strtol( ev->text, &ev->text, 10 );
1787  if (DAS.StepM.slope[1] < 0 || DAS.StepM.slope[1] > 255)
1788  {
1789  ev->focus_leave = False;
1790  }
1791  break;
1792  }
1793  case 16:
1794  {
1795  DAS.StepM.speed[1] = (int) strtol( ev->text, &ev->text, 10 );
1796  if (DAS.StepM.speed[1] < 1 || DAS.StepM.speed[1] > 50000)
1797  {
1798  ev->focus_leave = False;
1799  }
1800  break;
1801  }
1802 // SM3
1803  case 17:
1804  {
1805  DAS.StepM.cop[2] = (int) strtol( ev->text, &ev->text, 10 );
1806  if (DAS.StepM.cop[2] < 0 || DAS.StepM.cop[2] > 100)
1807  {
1808  ev->focus_leave = False;
1809  }
1810  break;
1811  }
1812  case 18:
1813  {
1814  DAS.StepM.step[2] = (int) strtol( ev->text, &ev->text, 10 );
1815  if (DAS.StepM.step[2] < 0 || DAS.StepM.step[2] > 13)
1816  {
1817  ev->focus_leave = False;
1818  }
1819  break;
1820  }
1821  case 19:
1822  {
1823  DAS.StepM.slope[2] = (int) strtol( ev->text, &ev->text, 10 );
1824  if (DAS.StepM.slope[2] < 0 || DAS.StepM.slope[2] > 255)
1825  {
1826  ev->focus_leave = False;
1827  }
1828  break;
1829  }
1830  case 20:
1831  {
1832  DAS.StepM.speed[2] = (int) strtol( ev->text, &ev->text, 10 );
1833  if (DAS.StepM.speed[2] < 1 || DAS.StepM.speed[2] > 50000)
1834  {
1835  ev->focus_leave = False;
1836  }
1837  break;
1838  }
1839 
1840 
1841  case 111:
1842  {
1843 
1844  break;
1845  }
1846 */
1847  case 123:
1848  {
1849  DAS.Paramini.maxtexp = strtod( ev->text, &ev->text );
1850  if (DAS.Paramini.maxtexp < 0 || DAS.Paramini.maxtexp > 1000)
1851  {
1852  ev->focus_leave = False;
1853  }
1854  break;
1855  }
1856 
1857  case 600:
1858  {
1859  DAS.DOption.maxlvlar = strtol( ev->text, &ev->text, 10 );
1860  if(DAS.DOption.maxlvlar < 5000 || DAS.DOption.maxlvlar > 63000)
1861  {
1862  ev->focus_leave = False;
1863  MMessageDialog("DAS information", "Value Outside Limits" , "OK", NULL);
1864 
1865  }
1866  break;
1867  }
1868 
1869 
1870  }
1871 
1872 
1873 
1874 }
ccd DC_CCD
optionini DOption
Options for DAS execution.
char * text
Definition: Mguidefs.h:1389
int PCPower
Power to the Peltier for Cooling.
int ccdWx
CCD X End.
#define False
Definition: Mguidefs.h:236
int ccdXoff
CCD X Start.
S16 dx
Num. of X pixels.
Definition: dcldef.h:1022
omuthr OMUTHR
int ccdWy
CCD Y End.
int VBin
CCD Vertical Binning.
int CoolPw
CCD Init Power.
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
S16 dy
Num. of Y pixels.
Definition: dcldef.h:1023
das DAS
double maxtexp
Maximum exposure time (used in Autorange())
unsigned focus_leave
Definition: Mguidefs.h:1397
int ccdYoff
CCD Y Start.
double ITemp
CCD Target Temperature.
unsigned int maxlvlar
maximum level of autoranging (max 65000)
double TPelt
OMU Target Temperature.
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:

§ ViewCB()

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

Definition at line 121 of file DOAS_FullProj.c.

References ViewPlot().

Referenced by MDCreateDOAS_MainSh().

122 {
123 
124  ViewPlot(0); //OffLine Plot
125 
126 }
int ViewPlot(int mod)
Create the plot shell. Procedure that build the plot shell for the data visualization.
Definition: Spat_Plot.c:3775
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ViewPlot()

int ViewPlot ( int  mod)

Create the plot shell. Procedure that build the plot shell for the data visualization.

Parameters
mod
  • = 0 –> Off Line Plot
  • = 1 –> On Line Plot
Returns
void

Definition at line 3775 of file Spat_Plot.c.

References _MAX_PATH, alfont, bil::BLENS, BOTTOM_ALIGN, CENTER_ALIGN, ClosePlotCB(), viewformobj::cmdpb, D_pbr_CB(), D_PButt_CB(), DB_AreaInput(), palette::DB_BG, palette::DB_BG_Albl, palette::DB_BG_Plbl, DB_EqTypePlotCB(), palette::DB_FG_Albl, palette::DB_FG_Plbl, palette::DB_UnSel, DB_XUnitsCB(), delay(), dmenu, DOASMODE, das::DOption, bil::DPLOT, d_view::drawapl, DrawAreaPlotCB(), EM_BUTTON_PRESS, paramini::EqType, flag::exec, flag::exemode, F10, False, ffilenames, Fitem, FIXED_SMALL, FLAG, das::Flag, Fmenu, viewformobj::formbutt, HELV_SMALL, optionini::hlineafter, optionini::hlinebefore, IDY, blens::Imim, InitImage(), item_pd, lbl, viewformobj::lblalt, viewformobj::lblAzimuth, viewformobj::lblccdex, viewformobj::lblccdey, viewformobj::lblccdsx, viewformobj::lblccdsy, viewformobj::lblccdtemp, viewformobj::lblccdtexp, viewformobj::lblccdwx, viewformobj::lblccdwy, viewformobj::lbldate, viewformobj::lblfilter, viewformobj::lbllat, viewformobj::lblloc, viewformobj::lbllong, viewformobj::lblmax, viewformobj::lblmin, viewformobj::lblmirpos, viewformobj::lblndfilter, viewformobj::lblnr, viewformobj::lblnummeas, viewformobj::lblsza, viewformobj::lbltime, viewformobj::lblvb, viewformobj::lblwaveleng, viewformobj::lblX, viewformobj::lblY, viewformobj::lblZenith, LEFT_ALIGN, MakeItemUnsensitiveCB(), MAllocImage(), Master, maxploth, maxplotw, MButtonSetOnMouseOverForegroundRGB(), MCreateColForm(), MCreateDrawArea(), MCreateLabel(), MCreateMenu(), MCreateMenuBar(), MCreatePButton(), MCreatePopupMenu(), MCreateRButton(), MCreateRowForm(), MCreateShell(), MCreateSubMenu(), MCreateTableForm(), MD_CreateBRowShell(), MDrawAreaSetExposeCallback(), MDrawAreaSetInputCallback(), menu, MenuFileOLP_CB(), MenuToolsOLP_CB(), MFormSetSpacing(), MGetScreenWidth(), MLabelSetAlignment(), MLabelSetMargin(), MMenuAddItem(), MMenuAddItemObsolete(), MMenuAddRadioItem(), MMenuBarSetAcc(), MMenuItemSetCheckStatus(), MObjectAddEventNotifyCallback(), MObjectAlign(), MObjectGetHeight(), MObjectGetWidth(), MObjectSetBackgroundRGB(), MObjectSetColor(), MObjectSetCompositeWidth(), MObjectSetFont(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetSensitive(), MObjectSetShadow(), MObjectSetTransparency(), MObjectSetUnsensitive(), MObjectUnmap(), MPButtonSetCallback(), MRButtonActivate(), MShellRealizeXY(), MTableFormSetColAlign(), MTableFormSetRowAlign(), MTCL, OFFLINEPLOT, d_view::OLDnR, ON_OFFLINEPLOT, Optmenu, das::Paramini, d_view::pbr, PButtSelAll_CB(), PBYScale_CB(), mtcl::PLColor, plfont, flag::plotYRange, PopUp_CB(), popup_pd, PopupMenuCB(), PrgFile, RIGHT_ALIGN, viewformobj::selallpb, submenu, Titem, Tmenu, TOP_ALIGN, True, UNDEF_ALIGN, bil::VFO, viewformobj::View_Sh, mtcl::white, flag::Wl, WS_ETCHED_IN, WS_NONE, WS_SHADOW_IN, viewformobj::XAxisU, viewformobj::xincr, viewformobj::xloc, viewformobj::yincr, viewformobj::yloc, and viewformobj::YScalePB.

Referenced by D_Plot(), DB_HorComm_CB(), DB_KeyB_CB(), E_Plot(), RunOLP(), and ViewCB().

3776 {
3777  int i;
3778  int rformw,scrw;
3779  char buff[8];
3780  extern char PrgFile[_MAX_PATH];
3781 
3782  MOBJECT _tablefrm000;
3783  MOBJECT _rowform000;
3784  MOBJECT _tablefrm001;
3785  MOBJECT _colform000;
3786  MOBJECT _tablefrm002;
3787  MOBJECT _rowform001;
3788  MOBJECT _rowform002;
3789  MOBJECT _colform001;
3790  MOBJECT _colform002;
3791 
3792  MOBJECT _rowform003;
3793  MOBJECT _tablefrm003;
3794  MOBJECT _rowform004;
3795  MOBJECT _tablefrm004;
3796  MOBJECT _rowform005;
3797  MOBJECT _tablefrm005;
3798  MOBJECT _rowform006;
3799  MOBJECT _tablefrm006;
3800  MOBJECT lbl;
3801  MOBJECT tb, rb;
3802 
3803 
3804  plfont = FIXED_SMALL;
3805  alfont = HELV_SMALL;
3806 
3807 // plfont = MLoadFont("Times", 16, False, False);
3808 // alfont = MLoadFont("Arial", 16, False, False);
3809 
3810  if (mod)
3811  ON_OFFLINEPLOT = 1;
3812  else
3813  ON_OFFLINEPLOT = 0;
3814 
3815 
3816 
3817 
3818  BIL.VFO.View_Sh = MCreateShell("PLOTTING File: None", 0);
3822 
3823 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
3824 //Menu
3825  if( (DAS.Flag.exemode == OFFLINEPLOT) | (DAS.Flag.exemode == DOASMODE))
3826  {
3827  MENU_ITEM item;
3829 
3831  MObjectSetBackgroundRGB(dmenu, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
3833  MObjectSetFont(dmenu, alfont, True);
3834 
3835  MMenuBarSetAcc(dmenu, F10);
3836  Fmenu = MCreateMenu(dmenu, "File");
3837  Fitem[0] = MMenuAddItem(Fmenu, "Open", (MENU_ITEM_CB) MenuFileOLP_CB, 0);
3838  Fitem[1] = MMenuAddItem(Fmenu, "Next", (MENU_ITEM_CB) MenuFileOLP_CB, (void *) 1);
3840  Fitem[2] = MMenuAddItem(Fmenu, "Previous", (MENU_ITEM_CB) MenuFileOLP_CB, (void *)2);
3842  Fitem[3] = MMenuAddItem(Fmenu, "Save As...", (MENU_ITEM_CB) MenuFileOLP_CB, (void *)3);
3844  Fitem[4] = MMenuAddItem(Fmenu, "Close", (MENU_ITEM_CB) MenuFileOLP_CB, (void *)4);
3846  Fitem[5] = MMenuAddItem(Fmenu, "Close Plot", (MENU_ITEM_CB) MenuFileOLP_CB, (void *)5);
3847  //MakeItemUnsensitiveCB (Fmenu, Fitem[5], 0);
3848  Tmenu = MCreateMenu(dmenu, "Tools");
3849  Titem[0] = MMenuAddItem(Tmenu, "Filter/Smooth", (MENU_ITEM_CB) MenuToolsOLP_CB, 0);
3850  Titem[1] = MMenuAddItem(Tmenu, "Zoom", (MENU_ITEM_CB) MenuToolsOLP_CB, (void *)1);
3851  Titem[2] = MMenuAddItem(Tmenu, "Sun calculator", (MENU_ITEM_CB) MenuToolsOLP_CB, (void *)2);
3852  Titem[3] = MMenuAddItem(Tmenu, "Print ", (MENU_ITEM_CB) MenuToolsOLP_CB, (void *)3);
3853 
3854  Optmenu = MCreateMenu(dmenu, "Options");
3855  item = MMenuAddItem(Optmenu, "X Units", (MENU_ITEM_CB) NULL, 0);
3856  submenu = MCreateSubMenu(item);
3857  item = MMenuAddRadioItem(submenu, "Pixel", (MENU_ITEM_CB)DB_XUnitsCB, 0);
3858  if(FLAG.Wl == 0)
3859  MMenuItemSetCheckStatus (item, True);
3860  item = MMenuAddRadioItem(submenu, "Wl[A]", (MENU_ITEM_CB)DB_XUnitsCB, (void *)1);
3861  if(FLAG.Wl == 1)
3862  MMenuItemSetCheckStatus (item, True);
3863  item = MMenuAddRadioItem(submenu, "Wl[nm]", (MENU_ITEM_CB)DB_XUnitsCB, (void *)2);
3864  if(FLAG.Wl == 2)
3865  MMenuItemSetCheckStatus (item, True);
3866 /* if(FLAG.Wl == 0)
3867  MRButtonActivate(BIL.VFO.XAxisU[0]);
3868  else if(FLAG.Wl == 1)
3869  MRButtonActivate(BIL.VFO.XAxisU[1]);
3870  else if(FLAG.Wl == 2)
3871  MRButtonActivate(BIL.VFO.XAxisU[2]);
3872 
3873 */
3874  item = MMenuAddItem(Optmenu, "Y Scale", (MENU_ITEM_CB) NULL, 0);
3875  submenu = MCreateSubMenu(item);
3876  item = MMenuAddRadioItem(submenu, "Min/Max", (MENU_ITEM_CB)PBYScale_CB, 0);
3877  if(FLAG.plotYRange == 1)
3878  MMenuItemSetCheckStatus (item, True);
3879  item = MMenuAddRadioItem(submenu, "Full Range", (MENU_ITEM_CB)PBYScale_CB, (void *)1);
3880  if(FLAG.plotYRange == 0)
3881  MMenuItemSetCheckStatus (item, True);
3882 
3883  item = MMenuAddItem(Optmenu, "Hidden Lines", (MENU_ITEM_CB) NULL, 0);
3884 
3885  menu = MCreateMenu(dmenu, "Help");
3886  item = MMenuAddItem(menu, "About", (MENU_ITEM_CB) NULL, 0);
3887 
3888 
3889 
3890  }
3891 
3892 
3893 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
3894 
3895  _tablefrm000 = MCreateTableForm(BIL.VFO.View_Sh, 2);
3896  MFormSetSpacing(_tablefrm000, 0);
3897 
3898  MTableFormSetColAlign(_tablefrm000, 1, CENTER_ALIGN);
3899  MObjectSetBackgroundRGB(_tablefrm000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
3900  MObjectSetResize(_tablefrm000, True, True);
3901 
3902  _rowform000 = MCreateRowForm(_tablefrm000);
3903  MFormSetSpacing(_rowform000, 1);
3904  MObjectSetBackgroundRGB(_rowform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
3905 
3906  MObjectSetResize(_rowform000, True, True);
3907 
3908  _tablefrm001 = MCreateTableForm(_rowform000, 12);
3909  MFormSetSpacing(_tablefrm001, 2);
3910  MTableFormSetColAlign(_tablefrm001, 0, LEFT_ALIGN);
3911  MObjectSetBackgroundRGB(_tablefrm001, 184, 132, 0);
3912  MObjectSetBackgroundRGB(_tablefrm001, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
3913  MObjectSetResize(_tablefrm001, True, False);
3914 
3915  lbl = MCreateLabel(_tablefrm001, "Station:", plfont);
3916  //MLabelSetAlignment(lbl, LEFT_ALIGN);
3917  //MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
3918  //MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3919  MObjectSetResize(lbl, True, True);
3922 
3923 
3924  lbl = MCreateLabel(_tablefrm001, "LAT:", plfont);
3925  //MLabelSetAlignment(lbl, LEFT_ALIGN);
3926  //MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
3927  //MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3928  //MObjectSetCompositeWidth(lbl, 48);
3929  MObjectSetResize(lbl, True, True);
3932 
3933 
3934  lbl = MCreateLabel(_tablefrm001, "LON:", plfont);
3935  //MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
3936  //MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3937  MObjectSetResize(lbl, True, True);
3940 
3941 
3942 
3943  lbl = MCreateLabel(_tablefrm001, "Date:", plfont);
3944  MObjectSetResize(lbl, True, True);
3947 
3948 
3949  lbl = MCreateLabel(_tablefrm001, "Time (LT):", plfont);
3950  MObjectSetResize(lbl, True, True);
3953 
3954  lbl = MCreateLabel(_tablefrm001, "Input Mirror:", plfont);
3955  MObjectSetResize(lbl, True, True);
3958 
3959  lbl = MCreateLabel(_tablefrm001, "Wavelength:", plfont);
3960  MObjectSetResize(lbl, True, True);
3963 
3964  lbl = MCreateLabel(_tablefrm001, "Filter:", plfont);
3965  MObjectSetResize(lbl, True, True);
3968 
3969  lbl = MCreateLabel(_tablefrm001, "NDFilter:", plfont);
3970  MObjectSetResize(lbl, True, True);
3973 
3974  lbl = MCreateLabel(_tablefrm001, "CCD Temp(ºC):", plfont);
3975  MObjectSetResize(lbl, True, True);
3978 
3979  lbl = MCreateLabel(_tablefrm001, "Exp.Time(sec):", plfont);
3980  MObjectSetResize(lbl, True, True);
3983 
3984  lbl = MCreateLabel(_tablefrm001, "Meas. N. :", plfont);
3985  MObjectSetResize(lbl, True, True);
3988 
3989  BIL.VFO.lblloc = MCreateLabel(_tablefrm001, "xxxxx", alfont);
3990  //MObjectSetShadow(BIL.VFO.lblloc, WS_SHADOW_IN, 1, 0);
3991  //MLabelSetAlignment(BIL.VFO.lblloc, RIGHT_ALIGN);
3996 
3997  BIL.VFO.lbllat = MCreateLabel(_tablefrm001, "xxx.xx", alfont);
3998  //MObjectSetShadow(BIL.VFO.lbllat, WS_SHADOW_IN, 1, 0);
3999  //MLabelSetAlignment(BIL.VFO.lbllat, RIGHT_ALIGN);
4004 
4005  BIL.VFO.lbllong = MCreateLabel(_tablefrm001, "xxx.xx", alfont);
4006  //MObjectSetShadow(BIL.VFO.lbllong, WS_SHADOW_IN, 1, 0);
4007  //MLabelSetAlignment(BIL.VFO.lbllong, RIGHT_ALIGN);
4012 
4013 
4014  BIL.VFO.lbldate = MCreateLabel(_tablefrm001, "yyyy/mm/dd", alfont);
4019 
4020  BIL.VFO.lbltime = MCreateLabel(_tablefrm001, "hh:mn:ss", alfont);
4025 
4026  BIL.VFO.lblmirpos = MCreateLabel(_tablefrm001, "NULL", alfont);
4031 
4032  BIL.VFO.lblwaveleng = MCreateLabel(_tablefrm001, "NULL", alfont);
4037 
4038  BIL.VFO.lblfilter = MCreateLabel(_tablefrm001, "NULL", alfont);
4043 
4044  BIL.VFO.lblndfilter = MCreateLabel(_tablefrm001, "NULL", alfont);
4049 
4050  BIL.VFO.lblccdtemp = MCreateLabel(_tablefrm001, "+/- xx.xx", alfont);
4055 
4056  BIL.VFO.lblccdtexp = MCreateLabel(_tablefrm001, "0.000", alfont);
4061 
4062  BIL.VFO.lblnummeas = MCreateLabel(_tablefrm001, "0", alfont);
4067 
4068 /****************/
4069 
4070  BIL.VFO.formbutt = MCreateColForm(_rowform000);
4072 // MObjectSetBackgroundRGB(BIL.VFO.formbutt, 64, 28, 128);
4074 
4075  if (mod)
4076  {
4077 
4078  if(IDY <= 16)
4079  {
4080  for (i=DAS.DOption.hlinebefore; i < IDY - DAS.DOption.hlineafter; i++)
4081  {
4082  sprintf(buff,"r. %d", i+1);
4086  MPButtonSetCallback(BIL.DPLOT.pbr[i], D_pbr_CB, (void *) i);
4087  //MObjectSetBackgroundRGB(pbr[i], 197, 197, 144);
4089  }
4090  }
4091  else
4093  }
4094  else
4095  {
4096  BIL.DPLOT.OLDnR = 0;
4097 
4098  for (i=0; i < 16; i++)
4099  {
4100  sprintf(buff,"r. %d", i+1);
4104  MPButtonSetCallback(BIL.DPLOT.pbr[i], D_pbr_CB, (void *) i);
4105  //MObjectSetBackgroundRGB(BIL.DPLOT.pbr[i], 197, 197, 144);
4107  MObjectUnmap(BIL.DPLOT.pbr[i]);
4108  }
4109 
4110 
4111  }
4112 
4113 //build the right column
4114 /************************************************/
4115 
4116  _rowform003 = MCreateRowForm(_tablefrm000);
4117  MFormSetSpacing(_rowform003, 0);
4118  MObjectAlign(_rowform003, LEFT_ALIGN, TOP_ALIGN);
4119 // MObjectSetBackgroundRGB(_rowform003, 175, 165, 75);
4120 // MObjectSetBackgroundRGB(_rowform003, 184, 132, 0);
4121  MObjectSetBackgroundRGB(_rowform003, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4122  MObjectSetResize(_rowform003, False, False);
4123 
4124  lbl = MCreateLabel(_rowform003, "Geo.Inf.", HELV_SMALL);
4126  MObjectSetBackgroundRGB(lbl, 144, 172, 184);
4127  MObjectSetTransparency(lbl, 0);
4128  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4129  MObjectSetResize(lbl, True, False);
4130 
4131  rformw = MObjectGetWidth(lbl);
4132 
4133  _tablefrm003 = MCreateTableForm(_rowform003, 2);
4134  MFormSetSpacing(_tablefrm003, 1);
4135  MTableFormSetColAlign(_tablefrm003, 0, LEFT_ALIGN);
4136 // MObjectAlign(_tablefrm003, LEFT_ALIGN, TOP_ALIGN);
4137 // MObjectSetForegroundRGB(_tablefrm003, 192, 192, 192);
4138 // MObjectSetBackgroundRGB(_tablefrm003, 184, 132, 0);
4139  MObjectSetBackgroundRGB(_tablefrm003, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4140  MObjectSetResize(_tablefrm003, False, False);
4141 /*
4142  lbl = MCreateLabel(_tablefrm003, "LOC: ", plfont);
4143  MLabelSetAlignment(lbl, LEFT_ALIGN);
4144  MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
4145  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4146  MObjectSetResize(lbl, True, True);
4147  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
4148  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
4149 
4150  BIL.VFO.lblloc = MCreateLabel(_tablefrm003, "xxxxx", alfont);
4151  MObjectSetShadow(BIL.VFO.lblloc, WS_SHADOW_IN, 1, 0);
4152  MLabelSetAlignment(BIL.VFO.lblloc, RIGHT_ALIGN);
4153  MObjectSetResize(BIL.VFO.lblloc, True, False);
4154  MObjectSetForegroundRGB(BIL.VFO.lblloc, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4155  MObjectSetBackgroundRGB(BIL.VFO.lblloc, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4156  MObjectSetTransparency(BIL.VFO.lblloc, 0);
4157 
4158  lbl = MCreateLabel(_tablefrm003, "LAT: ", plfont);
4159  MLabelSetAlignment(lbl, LEFT_ALIGN);
4160  MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
4161  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4162  MObjectSetCompositeWidth(lbl, 48);
4163  MObjectSetResize(lbl, True, True);
4164  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
4165  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
4166 
4167  BIL.VFO.lbllat = MCreateLabel(_tablefrm003, "xxx.xx", alfont);
4168  MObjectSetShadow(BIL.VFO.lbllat, WS_SHADOW_IN, 1, 0);
4169  MLabelSetAlignment(BIL.VFO.lbllat, RIGHT_ALIGN);
4170  MObjectSetResize(BIL.VFO.lbllat, True, False);
4171  MObjectSetForegroundRGB(BIL.VFO.lbllat, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4172  MObjectSetBackgroundRGB(BIL.VFO.lbllat, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4173  MObjectSetTransparency(BIL.VFO.lbllat, 0);
4174 
4175  lbl = MCreateLabel(_tablefrm003, "LON: ", plfont);
4176  MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
4177  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4178  MObjectSetResize(lbl, True, True);
4179  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
4180  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
4181 
4182  BIL.VFO.lbllong = MCreateLabel(_tablefrm003, "xxx.xx", alfont);
4183  MObjectSetShadow(BIL.VFO.lbllong, WS_SHADOW_IN, 1, 0);
4184  MLabelSetAlignment(BIL.VFO.lbllong, RIGHT_ALIGN);
4185  MObjectSetResize(BIL.VFO.lbllong, False, False);
4186  MObjectSetForegroundRGB(BIL.VFO.lbllong, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4187  MObjectSetBackgroundRGB(BIL.VFO.lbllong, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4188  MObjectSetTransparency(BIL.VFO.lbllong, 0);
4189 */
4190  lbl = MCreateLabel(_tablefrm003, "ALT: ", plfont);
4192  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4193  MObjectSetResize(lbl, True, True);
4196 
4197  BIL.VFO.lblalt = MCreateLabel(_tablefrm003, "xxx", alfont);
4205 
4206  lbl = MCreateLabel(_tablefrm003, "SZA: ", plfont);
4208  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4209  MObjectSetResize(lbl, True, True);
4212 
4213  BIL.VFO.lblsza = MCreateLabel(_tablefrm003, "xxx.xx", alfont);
4220 
4221  lbl = MCreateLabel(_tablefrm003, "Zenith: ", plfont);
4223  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4224  MObjectSetResize(lbl, True, True);
4227 
4228  BIL.VFO.lblZenith = MCreateLabel(_tablefrm003, "xxx.xx", alfont);
4235 
4236  lbl = MCreateLabel(_tablefrm003, "Azimuth: ", plfont);
4238  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4239  MObjectSetResize(lbl, True, True);
4242 
4243  BIL.VFO.lblAzimuth = MCreateLabel(_tablefrm003, "xxx.xx", alfont);
4250 
4251  _rowform004 = MCreateRowForm(_rowform003);
4252  MFormSetSpacing(_rowform004, 0);
4253  MObjectSetBackgroundRGB(_rowform004, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4254 // MObjectSetBackgroundRGB(_rowform004, 184, 132, 0);
4255  MObjectSetResize(_rowform004, False, False);
4256 
4257  lbl = MCreateLabel(_rowform004, "Meas.Inf.", HELV_SMALL);
4259  MObjectSetBackgroundRGB(lbl, 144, 172, 184);
4260  MObjectSetTransparency(lbl, 0);
4261  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4262  MObjectSetResize(lbl, True, False);
4263 
4264  _tablefrm004 = MCreateTableForm(_rowform004, 2);
4265  MFormSetSpacing(_tablefrm004, 1);
4266  MTableFormSetColAlign(_tablefrm004, 0, LEFT_ALIGN);
4267  MObjectAlign(_tablefrm004, LEFT_ALIGN, TOP_ALIGN);
4268 // MObjectSetForegroundRGB(_tablefrm004, 192, 192, 192);
4269 // MObjectSetBackgroundRGB(_tablefrm004, 184, 132, 0);
4270  MObjectSetBackgroundRGB(_tablefrm004, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4271  MObjectSetResize(_tablefrm004, True, False);
4272 
4273  lbl = MCreateLabel(_tablefrm004, "Max:", plfont);
4275  MLabelSetMargin(lbl, 2, 2);
4277  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4278  MObjectSetResize(lbl, True, True);
4281 
4282  BIL.VFO.lblmax = MCreateLabel(_tablefrm004, "xxxxx", alfont);
4289 
4290  lbl = MCreateLabel(_tablefrm004, "Min:", plfont);
4293  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4294  MObjectSetResize(lbl, True, True);
4297 
4298  BIL.VFO.lblmin = MCreateLabel(_tablefrm004, "xxxxx", alfont);
4305 
4306 /******************************************/
4307 
4308  lbl = MCreateLabel(_tablefrm004, "ccdWx:", plfont);
4310  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4311  MObjectSetResize(lbl, True, True);
4314 
4315  BIL.VFO.lblccdwx = MCreateLabel(_tablefrm004, "xxxx", alfont);
4322 
4323  lbl = MCreateLabel(_tablefrm004, "ccdWy:", plfont);
4325  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4326  MObjectSetResize(lbl, True, True);
4329 
4330  BIL.VFO.lblccdwy = MCreateLabel(_tablefrm004, "xxxx", alfont);
4337 
4338 
4339 /*********************************************/
4340 
4341  lbl = MCreateLabel(_tablefrm004, "ccdSx:", plfont);
4343  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4344  MObjectSetResize(lbl, True, True);
4347 
4348  BIL.VFO.lblccdsx = MCreateLabel(_tablefrm004, "xxxx", alfont);
4355 
4356  lbl = MCreateLabel(_tablefrm004, "ccdSy:", plfont);
4358  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4359  MObjectSetResize(lbl, True, True);
4362 
4363  BIL.VFO.lblccdsy = MCreateLabel(_tablefrm004, "xxxx", alfont);
4370 
4371  lbl = MCreateLabel(_tablefrm004, "ccdEx:", plfont);
4373  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4374  MObjectSetResize(lbl, True, True);
4377 
4378  BIL.VFO.lblccdex = MCreateLabel(_tablefrm004, "xxxx", alfont);
4385 
4386  lbl = MCreateLabel(_tablefrm004, "ccdEy:", plfont);
4387  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4388  MObjectSetResize(lbl, True, True);
4391 
4392  BIL.VFO.lblccdey = MCreateLabel(_tablefrm004, "xxxx", alfont);
4399 
4400  lbl = MCreateLabel(_tablefrm004, "ccdVB:", plfont);
4401  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4402  MObjectSetResize(lbl, True, True);
4405 
4406  BIL.VFO.lblvb = MCreateLabel(_tablefrm004, "xxx",alfont);
4413 
4414  lbl = MCreateLabel(_tablefrm004, "Rows#", plfont);
4415  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4416  MObjectSetResize(lbl, True, True);
4419 
4420  BIL.VFO.lblnr = MCreateLabel(_tablefrm004, "xxx", alfont);
4427 
4428  _rowform005 = MCreateRowForm(_rowform004);
4429  MFormSetSpacing(_rowform005, 0);
4430  MObjectSetBackgroundRGB(_rowform005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4431 // MObjectSetBackgroundRGB(_rowform005, 184, 132, 0);
4432  MObjectSetResize(_rowform005, True, False);
4433 
4434  lbl = MCreateLabel(_rowform005, "Command", HELV_SMALL);
4435  MObjectSetBackgroundRGB(lbl, 144, 172, 184);
4436  MObjectSetTransparency(lbl, 0);
4437  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4438  MObjectSetResize(lbl, True, False);
4439 
4440  _tablefrm005 = MCreateTableForm(_rowform005, 2);
4441  MFormSetSpacing(_tablefrm005, 0);
4442  MObjectSetBackgroundRGB(_tablefrm005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4443 // MObjectSetBackgroundRGB(_tablefrm005, 184, 132, 0);
4444  MObjectSetResize(_tablefrm005, True, False);
4445 
4446  _rowform006 = MCreateRowForm(_tablefrm005);
4447  MFormSetSpacing(_rowform006, 0);
4448  MObjectSetBackgroundRGB(_rowform006, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4449 // MObjectSetBackgroundRGB(_rowform006, 184, 132, 0);
4450  MObjectSetResize(_rowform006, False, False);
4451 
4453  for (i=0;i<7;i++)
4454  //item_pd = MMenuAddItem(popup_pd, "Empty", (MENU_ITEM_CB) PopUp_CB, (void *) i);
4456 
4457  BIL.VFO.cmdpb[0] = MCreatePButton(_rowform006, "Open", alfont);
4460  MPButtonSetCallback(BIL.VFO.cmdpb[0], D_PButt_CB, (void *) 0);
4463  if (mod)
4465 
4466 
4467  BIL.VFO.cmdpb[1] = MCreatePButton(_rowform006, "Next", alfont);
4469  MPButtonSetCallback(BIL.VFO.cmdpb[1], D_PButt_CB, (void *) 1);
4472 
4473  BIL.VFO.cmdpb[8] = MCreatePButton(_rowform006, "Previous", alfont);
4475  MPButtonSetCallback(BIL.VFO.cmdpb[8], D_PButt_CB, (void *) 8);
4478 
4479 
4480  BIL.VFO.cmdpb[2] = MCreatePButton(_rowform006, "Set as Io", alfont);
4482  MPButtonSetCallback(BIL.VFO.cmdpb[2], D_PButt_CB, (void *) 2);
4485 
4486  BIL.VFO.cmdpb[3] = MCreatePButton(_rowform006, "Close File", alfont);
4488  MPButtonSetCallback(BIL.VFO.cmdpb[3], D_PButt_CB, (void *) 3);
4490  MObjectSetUnsensitive(BIL.VFO.cmdpb[3]); // Set "CloseFile" button as Unsensitive
4491 
4492  BIL.VFO.cmdpb[4] = MCreatePButton(_rowform006, "Print", alfont);
4495  MPButtonSetCallback(BIL.VFO.cmdpb[4], D_PButt_CB, (void *) 4);
4496  MObjectSetUnsensitive(BIL.VFO.cmdpb[4]); // Set "Print" button as Unsensitive
4497 
4498  BIL.VFO.cmdpb[6] = MCreatePButton(_rowform006, "Zoom", alfont);
4500  MPButtonSetCallback(BIL.VFO.cmdpb[6], D_PButt_CB, (void *) 6);
4503 
4504  BIL.VFO.cmdpb[7] = MCreatePButton(_rowform006, "Tools", alfont);
4506  MPButtonSetCallback(BIL.VFO.cmdpb[7], D_PButt_CB, (void *) 7);
4509 
4510  if(DAS.Flag.exemode == OFFLINEPLOT)
4511  BIL.VFO.cmdpb[5] = MCreatePButton(_rowform006, "Quit", alfont);
4512  else
4513  BIL.VFO.cmdpb[5] = MCreatePButton(_rowform006, "Close Win", alfont);
4514 
4516  MPButtonSetCallback(BIL.VFO.cmdpb[5], D_PButt_CB, (void *) 5);
4518 
4519 
4520 /**********************************************/
4521 
4522 if( (!DAS.Flag.exemode == OFFLINEPLOT) | (!DAS.Flag.exemode == DOASMODE))
4523 {
4524 
4525 
4526  _colform002 = MCreateColForm(_rowform000);
4527  MFormSetSpacing(_colform002, 1);
4528 // MObjectSetBackgroundRGB(_colform002, 64, 28, 128);
4529  MObjectSetBackgroundRGB(_colform002, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4530 
4531  // MObjectSetResize(_colform002, True, True);
4532 
4533  _tablefrm006 = MCreateTableForm(_colform002, 7);
4534  MFormSetSpacing(_tablefrm006, 1);
4535 // MObjectSetBackgroundRGB(_tablefrm006, 64, 28, 128);
4536  MObjectSetBackgroundRGB(_tablefrm006, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4537  MObjectSetResize(_tablefrm006, False, False);
4538  MObjectAlign(_tablefrm006, CENTER_ALIGN, TOP_ALIGN);
4539 
4540  lbl = MCreateLabel(_tablefrm006, "X:", plfont);
4542  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4545  MObjectSetCompositeWidth(lbl, 30);
4546  //MObjectSetResize(lbl, True, True);
4547 
4548  BIL.VFO.xloc = MCreateLabel(_tablefrm006, "xxxxx", alfont);
4555  //MObjectSetResize(BIL.VFO.xloc, True, True);
4556 
4557  BIL.VFO.xincr = MCreateLabel(_tablefrm006, "Dx = xx", alfont);
4563  //MObjectSetResize(BIL.VFO.xincr, True, True);
4564 
4565 
4566  lbl = MCreateLabel(_tablefrm006, "Y:", plfont);
4568  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4571  MObjectSetCompositeWidth(lbl, 30);
4572 // MObjectSetResize(lbl, True, True);
4573 
4574 
4575  BIL.VFO.yloc = MCreateLabel(_tablefrm006, "xxxxx", alfont);
4582  // MObjectSetResize(BIL.VFO.yloc, True, True);
4583 
4584 
4585  BIL.VFO.yincr = MCreateLabel(_tablefrm006, "Dy = xx", alfont);
4590 // MObjectSetTransparency(BIL.VFO.yincr,0);
4592  // MObjectSetResize(BIL.VFO.xloc, True, True);
4593 
4594 
4595 
4596  BIL.VFO.selallpb = MCreatePButton(_tablefrm006, "Select All", alfont);
4600  if(mod) //Onlineplot
4602  else
4604 
4605 
4606 /*****************/
4607 
4608  _tablefrm006 = MCreateTableForm(_colform002, 6);
4609  MFormSetSpacing(_tablefrm006, 1);
4610  MObjectSetBackgroundRGB(_tablefrm006, 64, 28, 128);
4611  MObjectSetBackgroundRGB(_tablefrm006, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4612  MObjectSetResize(_tablefrm006, False, False);
4613  MObjectAlign(_tablefrm006, CENTER_ALIGN, TOP_ALIGN);
4614 
4615  lbl = MCreateLabel(_tablefrm006, "Y Scale:", plfont);
4617  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4620 // MObjectSetCompositeWidth(lbl, 30);
4621 
4622  if (FLAG.plotYRange == 0)
4623  sprintf(buff,"Full Range");
4624  else
4625  sprintf(buff,"Min/Max");
4626 
4627  BIL.VFO.YScalePB = MCreatePButton(_tablefrm006, buff, alfont);
4631  MPButtonSetCallback(BIL.VFO.YScalePB, PBYScale_CB, (void *) 0);
4632  if(mod) //Onlineplot
4634  else
4636 
4637 
4638  lbl = MCreateLabel(_tablefrm006, "X Units:", plfont);
4640  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4643 
4644 
4645  BIL.VFO.XAxisU[0] = MCreateRButton(_tablefrm006, "Pixel", alfont);
4646  MPButtonSetCallback(BIL.VFO.XAxisU[0], DB_XUnitsCB, (void *) 0);
4651 
4652  BIL.VFO.XAxisU[1] = MCreateRButton(_tablefrm006, "Wl [A]", alfont);
4653  MPButtonSetCallback(BIL.VFO.XAxisU[1], DB_XUnitsCB, (void *) 1);
4658 
4659  BIL.VFO.XAxisU[2] = MCreateRButton(_tablefrm006, "Wl [nm]", alfont);
4660  MPButtonSetCallback(BIL.VFO.XAxisU[2], DB_XUnitsCB, (void *) 2);
4665 
4666  if(FLAG.Wl == 0)
4668  else if(FLAG.Wl == 1)
4670  else if(FLAG.Wl == 2)
4672 }
4673 
4674 
4675 
4676 /*****************************/
4677 
4678  _colform000 = MCreateColForm(_rowform000);
4679  MFormSetSpacing(_colform000, 1);
4680  MObjectSetBackgroundRGB(_colform000, 64, 28, 128);
4681 
4682 
4683  _tablefrm002 = MCreateTableForm(_colform000, 2);
4684  MFormSetSpacing(_tablefrm002, 1);
4685  MTableFormSetColAlign(_tablefrm002, 0, LEFT_ALIGN);
4686  MTableFormSetColAlign(_tablefrm002, 1, LEFT_ALIGN);
4687  MTableFormSetRowAlign(_tablefrm002, 0, TOP_ALIGN);
4688  MObjectSetBackgroundRGB(_tablefrm002, 64, 28, 128);
4689  MObjectSetBackgroundRGB(_tablefrm002, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4690  MObjectSetResize(_tablefrm002, True, True);
4691 
4692  _rowform001 = MCreateRowForm(_tablefrm002);
4693  MFormSetSpacing(_rowform001, 1);
4694  MObjectSetBackgroundRGB(_rowform001, 184, 192, 240);
4695  MObjectSetResize(_rowform001, False, True);
4696 
4697 
4698  for (i=0; i<(sizeof(BIL.VFO.lblY)/sizeof(BIL.VFO.lblY[0])); i++)
4699  {
4700  BIL.VFO.lblY[i] = MCreateLabel(_rowform001, "-------", alfont);
4701  MObjectSetShadow(BIL.VFO.lblY[i], WS_NONE, 0, 0);
4702  if(i==0)
4704  if(i==sizeof(BIL.VFO.lblY)/sizeof(BIL.VFO.lblY[0])-1)
4707  }
4708 
4709 /********************************************************************/
4710 /* DRAW AREA */
4711 /********************************************************************/
4712 
4713  rformw = MObjectGetWidth(_rowform003);
4714  scrw = MGetScreenWidth();
4715  maxplotw = scrw - 200;
4716  if (mod) //On line Plot
4717  {
4718  BIL.DPLOT.drawapl = MCreateDrawArea(_tablefrm002, maxplotw, 480); //1044 580
4720  MObjectSetBackgroundRGB(BIL.DPLOT.drawapl, 220, 220, 220);
4724  }
4725 
4726  else
4727  {
4728  BIL.DPLOT.drawapl = MCreateDrawArea(_tablefrm002, maxplotw, 480);
4730  MObjectSetBackgroundRGB(BIL.DPLOT.drawapl, 220, 220, 220);
4733  }
4734 
4735 
4736 /********************************************************************/
4737 
4741 
4742  InitImage(BIL.BLENS.Imim, maxplotw, maxploth, 192, 192, 192);
4743 
4744 
4745 
4746 
4747 
4748  _rowform002 = MCreateRowForm(_tablefrm002);
4749  MFormSetSpacing(_rowform002, 1);
4750  MObjectAlign(_rowform002, LEFT_ALIGN, BOTTOM_ALIGN);
4751  MObjectSetShadow(_rowform002, WS_SHADOW_IN, 1, 0);
4752  MObjectSetResize(_rowform002, False, False);
4753 
4754  _colform001 = MCreateColForm(_tablefrm002);
4755  MFormSetSpacing(_colform001, 1);
4756  MObjectAlign(_colform001, LEFT_ALIGN, BOTTOM_ALIGN);
4757  MObjectSetBackgroundRGB(_colform001, 184, 192, 240);
4758  MObjectSetResize(_colform001, True, True);
4759 
4760  for (i=0; i<17; i++)
4761  {
4762  BIL.VFO.lblX[i] = MCreateLabel(_colform001, "-----", alfont);
4763 // MObjectSetShadow(BIL.VFO.lblX[i], WS_SHADOW_IN, 1, 0);
4764  MObjectSetShadow(BIL.VFO.lblX[i], WS_NONE, 0, 0);
4765 
4767  if(i==0)
4769  if(i==sizeof(BIL.VFO.lblX)/sizeof(BIL.VFO.lblX[0]) - 1)
4770  {
4772  //MLabelSetAlignment(BIL.VFO.lblX[i], RIGHT_ALIGN);
4773 
4774  }
4775  }
4776 
4777 
4778 
4779  tb = MCreateColForm(BIL.VFO.View_Sh);
4780  MFormSetSpacing(tb, 0);
4781  //MTableFormSetColAlign(tb, 0, LEFT_ALIGN);
4782  MObjectSetBackgroundRGB(tb, 184, 132, 0);
4784  MObjectSetResize(tb, True, False);
4785 
4786  lbl = MCreateLabel(tb, "Equipment:", plfont);
4787  MObjectSetResize(lbl, False, True);
4791 
4792  rb = MCreateRButton(tb, "SPATRAMPLUS", FIXED_SMALL);
4793  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 3);
4795  MObjectSetForegroundRGB(rb, 255, 255, 255);
4796  MObjectSetCompositeWidth(rb, 105);
4797  if(DAS.Paramini.EqType == 3)
4798  MRButtonActivate(rb);
4799 
4800  rb = MCreateRButton(tb, "SPATRAM2", FIXED_SMALL);
4801  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 9);
4803  MObjectSetForegroundRGB(rb, 255, 255, 255);
4804  MObjectSetCompositeWidth(rb, 105);
4805  if(DAS.Paramini.EqType == 9)
4806  MRButtonActivate(rb);
4807 
4808  rb = MCreateRButton(tb, "SPATRAM3", FIXED_SMALL);
4809  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 10);
4811  MObjectSetForegroundRGB(rb, 255, 255, 255);
4812  MObjectSetCompositeWidth(rb, 105);
4813  if(DAS.Paramini.EqType == 10)
4814  MRButtonActivate(rb);
4815 
4816  /* rb = MCreateRButton(tb, "SPATRAM", FIXED_SMALL);
4817  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 0);
4818  MObjectAlign(rb, LEFT_ALIGN, TOP_ALIGN);
4819  MObjectSetForegroundRGB(rb, 255, 255, 255);
4820  MObjectSetCompositeWidth(rb, 85);
4821  if( DAS.Paramini.EqType == 0)
4822  MRButtonActivate(rb);
4823  */
4824  rb = MCreateRButton(tb, "TROPOGAS", FIXED_SMALL);
4825  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 1);
4827  MObjectSetForegroundRGB(rb, 255, 255, 255);
4828  MObjectSetCompositeWidth(rb, 85);
4829  if(DAS.Paramini.EqType == 1)
4830  MRButtonActivate(rb);
4831 
4832  rb = MCreateRButton(tb, "LIS", FIXED_SMALL);
4833  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 2);
4835  MObjectSetForegroundRGB(rb, 255, 255, 255);
4836  MObjectSetCompositeWidth(rb, 85);
4837  if(DAS.Paramini.EqType == 2)
4838  MRButtonActivate(rb);
4839 
4840  rb = MCreateRButton(tb, "GASCODNG1", FIXED_SMALL);
4841  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 4);
4843  MObjectSetForegroundRGB(rb, 255, 255, 255);
4844  MObjectSetCompositeWidth(rb, 85);
4845  if(DAS.Paramini.EqType == 4)
4846  MRButtonActivate(rb);
4847 
4848  /* rb = MCreateRButton(tb, "GASCODOffAxis", FIXED_SMALL);
4849  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 5);
4850  MObjectAlign(rb, LEFT_ALIGN, UNDEF_ALIGN);
4851  MObjectSetForegroundRGB(rb, 255, 255, 255);
4852  MObjectSetCompositeWidth(rb, 105);
4853  if(DAS.Paramini.EqType == 5)
4854  MRButtonActivate(rb);
4855  */
4856 
4857 
4858  rb = MCreateRButton(tb, "GASCODNG2", FIXED_SMALL);
4859  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 6);
4861  MObjectSetForegroundRGB(rb, 255, 255, 255);
4862  MObjectSetCompositeWidth(rb, 105);
4863  if(DAS.Paramini.EqType == 6)
4864  MRButtonActivate(rb);
4865 
4866  rb = MCreateRButton(tb, "GASCODNG3", FIXED_SMALL);
4867  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 7);
4869  MObjectSetForegroundRGB(rb, 255, 255, 255);
4870  MObjectSetCompositeWidth(rb, 105);
4871  if(DAS.Paramini.EqType == 7)
4872  MRButtonActivate(rb);
4873 
4874  rb = MCreateRButton(tb, "GASCODNG4", FIXED_SMALL);
4875  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 8);
4877  MObjectSetForegroundRGB(rb, 255, 255, 255);
4878  MObjectSetCompositeWidth(rb, 105);
4879  if(DAS.Paramini.EqType == 8)
4880  MRButtonActivate(rb);
4881 
4882 
4883 
4884 
4885  MShellRealizeXY( BIL.VFO.View_Sh, 0, 0);
4886 
4887 // MUnloadFont(alfont);
4888 // MUnloadFont(plfont);
4889 
4890 
4891 // rformw = MObjectGetWidth(_rowform003);
4892 
4893 
4894  if( ((PrgFile[0] != 0) | (Master == 1)) & (FLAG.exec == 1) )
4895  {
4896  delay(4000);
4897  ClosePlotCB(BIL.VFO.View_Sh, 0, 0);
4898  }
4899 
4900 
4901 
4902  return 0;
4903 
4904 }
void MObjectSetColor(MOBJECT obj, MTColor bgc, MTColor fgc)
char PrgFile[16]
Name of the PRG file.
Definition: DAS_Spat.c:91
flag FLAG
Definition: CreateForms.c:84
#define RIGHT_ALIGN
Definition: Mguidefs.h:916
mtcl MTCL
Definition: 2DPlot.c:30
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
#define WS_NONE
Definition: Mguidefs.h:956
MIMAGE Imim
Definition: bildef.h:14
MOBJECT lblmin
Definition: bildef.h:54
MOBJECT selallpb
Definition: bildef.h:68
MOBJECT YScalePB
Definition: bildef.h:70
MOBJECT lbl
Definition: DFileMan.c:42
MOBJECT cmdpb[10]
Definition: bildef.h:69
MOBJECT yincr
Definition: bildef.h:67
#define WS_SHADOW_IN
Definition: Mguidefs.h:958
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
optionini DOption
Options for DAS execution.
void MMenuBarSetAcc(MOBJECT menu, int acc)
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
MOBJECT lblccdwx
Definition: bildef.h:55
MOBJECT lblccdtexp
Definition: bildef.h:44
int Master
Definition: DAS_Spat.c:100
palette DPAL
Definition: Spat_Plot.c:29
void MenuFileOLP_CB(MOBJECT o, void *id, void *a_data)
Definition: Spat_Plot.c:3209
MTFont plfont
Definition: Spat_Plot.c:41
void MObjectSetUnsensitive(MOBJECT obj)
void PBYScale_CB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:2441
das DAS
DAS structure.
Definition: Spat_Plot.c:39
int Wl
Flag for the units on the X scale plot.
MOBJECT lblndfilter
Definition: bildef.h:42
MOBJECT lblmax
Definition: bildef.h:53
void(* MENU_ITEM_CB)(MENU_ITEM item, MVALUE status, void *ad)
Definition: Mguidefs.h:1468
int MObjectGetHeight(MOBJECT obj)
MOBJECT popup_pd
Definition: Spat_Plot.c:3570
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
MENU_ITEM MMenuAddItem(MOBJECT pd, const char *item, MENU_ITEM_CB cb, void *ad)
MOBJECT lblfilter
Definition: bildef.h:41
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
MTColor white
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
#define F10
Definition: KEYCODES.H:346
int MD_CreateBRowShell(int nrows)
Create windows of buttons. During the plotting of the measurements, create a shell of buttons if the ...
Definition: Spat_Plot.c:1625
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 InitImage(MIMAGE img, int xd, int yd, int rb, int gb, int bb)
Definition: Spat_Plot.c:354
void * MENU_ITEM
Definition: Mguidefs.h:1418
MOBJECT MCreateSubMenu(MENU_ITEM item)
void MTableFormSetColAlign(MOBJECT form, int col, int al)
MOBJECT lblY[11]
Definition: bildef.h:46
MOBJECT lblccdsx
Definition: bildef.h:57
MOBJECT pbr[256]
Definition: bildef.h:170
MENU_ITEM MMenuAddRadioItem(MOBJECT pd, const char *item, MENU_ITEM_CB cb, void *ad)
MOBJECT lblccdey
Definition: bildef.h:60
int DrawAreaPlotCB(MOBJECT obj, MEvent *pexp, void *a_data)
Definition: Spat_Plot.c:876
void DB_AreaInput(MOBJECT obj, MEvent *pe, void *a_data)
Definition: Spat_Plot.c:203
#define UNDEF_ALIGN
Definition: Mguidefs.h:920
int OLDnR
Definition: bildef.h:185
void MenuToolsOLP_CB(MOBJECT o, void *id, void *a_data)
Definition: Spat_Plot.c:3179
MOBJECT lblnr
Definition: bildef.h:62
MENU_ITEM MMenuAddItemObsolete(MOBJECT pd, const char *item, MGUI_CB cb, void *ad)
int MObjectGetWidth(MOBJECT obj)
MOBJECT lblX[17]
Definition: bildef.h:47
char * ffilenames[]
Definition: Spat_Plot.c:3572
void ClosePlotCB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:2514
MOBJECT menu
Definition: DOAS_FullProj.c:60
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
MOBJECT lblloc
Definition: bildef.h:48
MOBJECT lbllat
Definition: bildef.h:49
void D_pbr_CB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:717
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
int hlinebefore
Number of HiddenLines before the central line in Plot.
MOBJECT lblccdtemp
Definition: bildef.h:43
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
void D_PButt_CB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:3320
MOBJECT lblZenith
Definition: bildef.h:72
#define OFFLINEPLOT
execution for archived data visualisation
MOBJECT lblalt
Definition: bildef.h:51
#define CENTER_ALIGN
Definition: Mguidefs.h:917
#define EM_BUTTON_PRESS
Definition: Mguidefs.h:317
MTFont alfont
Definition: Spat_Plot.c:41
MENU_ITEM item_pd
Definition: Spat_Plot.c:3571
d_view DPLOT
Definition: bildef.h:254
#define HELV_SMALL
Definition: Mguidefs.h:881
MOBJECT xloc
Definition: bildef.h:64
void DB_EqTypePlotCB(MOBJECT o, void *a, void *v)
Definition: Spat_Plot.c:3704
MOBJECT dmenu
void PopUp_CB(MOBJECT obj, void *item, void *data)
Definition: Spat_Plot.c:3584
#define FIXED_SMALL
Definition: Mguidefs.h:878
void PButtSelAll_CB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:2476
MOBJECT formbutt
Definition: bildef.h:65
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
MOBJECT yloc
Definition: bildef.h:63
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
void MLabelSetMargin(MOBJECT p, int wm, int hm)
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
void MRButtonActivate(MOBJECT o)
MENU_ITEM Titem[4]
Definition: Spat_Plot.c:46
MOBJECT lblsza
Definition: bildef.h:52
int plotYRange
0 –> full range; 1 –> min/max
MOBJECT MCreateDrawArea(MOBJECT parent, int width, int height)
MOBJECT MCreateColForm(MOBJECT parent)
void MObjectAddEventNotifyCallback(MOBJECT obj, OBJ_EVENT_CB cb, CARD32 event_mask, void *a_data)
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
MOBJECT Tmenu
Definition: Spat_Plot.c:47
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
void MDrawAreaSetExposeCallback(MOBJECT obj, OBJ_EVENT_CB cb, void *ad)
void MShellRealizeXY(MOBJECT obj, int x, int y)
MENU_ITEM Fitem[6]
Definition: Spat_Plot.c:46
void MDrawAreaSetInputCallback(MOBJECT obj, OBJ_EVENT_CB cb, void *ad)
MOBJECT View_Sh
Definition: bildef.h:35
#define _MAX_PATH
Definition: Dildef.h:202
MOBJECT MCreateShell(const char *title, int flags)
int hlineafter
Number of HiddenLines after the central line in Plot.
MOBJECT lblccdwy
Definition: bildef.h:56
MOBJECT lbltime
Definition: bildef.h:38
short DB_BG[3]
Default Background Color.
MOBJECT lblAzimuth
Definition: bildef.h:73
MOBJECT MCreateRButton(MOBJECT parent, const char *text, MTFont font)
void MObjectUnmap(MOBJECT obj)
MOBJECT lblvb
Definition: bildef.h:61
MOBJECT submenu
Definition: DOAS_FullProj.c:61
MOBJECT Optmenu
Definition: Spat_Plot.c:47
void MTableFormSetRowAlign(MOBJECT form, int row, int al)
void DB_XUnitsCB(MOBJECT o, void *id, void *a_data)
Definition: Spat_Plot.c:3547
void MLabelSetAlignment(MOBJECT p, int align)
int MGetScreenWidth(void)
MOBJECT lblccdsy
Definition: bildef.h:58
MTColor PLColor[264]
MOBJECT lbldate
Definition: bildef.h:37
int maxploth
Definition: Spat_Plot.c:51
int maxplotw
Definition: Spat_Plot.c:51
void MFormSetSpacing(MOBJECT p, int offset)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
bil BIL
Definition: Spat_Plot.c:35
int MMenuItemSetCheckStatus(MENU_ITEM item, int TrueFalse)
void PopupMenuCB(MOBJECT obj, MEvent *pe, void *pdown)
Definition: Spat_Plot.c:3688
void MObjectSetCompositeWidth(MOBJECT obj, int w)
MOBJECT lbllong
Definition: bildef.h:50
short DB_UnSel[3]
Unselected Buttons Colors.
void MakeItemUnsensitiveCB(MOBJECT obj, void *item, void *udata)
Definition: Spat_Plot.c:2044
void * MOBJECT
Definition: Mguidefs.h:192
blens BLENS
Definition: bildef.h:252
#define BOTTOM_ALIGN
Definition: Mguidefs.h:919
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
viewformobj VFO
Definition: bildef.h:255
void MObjectSetFont(MOBJECT obj, MTFont font, int resize)
void MButtonSetOnMouseOverForegroundRGB(MOBJECT button, int r, int g, int b)
MOBJECT MCreateMenuBar(MOBJECT parent, MTFont font)
MOBJECT xincr
Definition: bildef.h:66
int EqType
Spectrometer Type.
MIMAGE MAllocImage(int img_w, int img_h, int nplanes)
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT drawapl
Definition: bildef.h:172
void MObjectSetSensitive(MOBJECT obj)
MOBJECT Fmenu
Definition: Spat_Plot.c:47
MOBJECT lblnummeas
Definition: bildef.h:45
MOBJECT MCreateRowForm(MOBJECT parent)
#define WS_ETCHED_IN
Definition: Mguidefs.h:959
MOBJECT XAxisU[3]
Definition: bildef.h:71
MOBJECT MCreatePopupMenu(MTFont font)
#define TOP_ALIGN
Definition: Mguidefs.h:918
int exemode
Set the Execution MODE (Execution modes)
MOBJECT MCreateMenu(MOBJECT menu, const char *text)
MOBJECT lblwaveleng
Definition: bildef.h:40
MOBJECT lblccdex
Definition: bildef.h:59
paramini Paramini
structure for the parameters defined in param.ini configuration file
MOBJECT lblmirpos
Definition: bildef.h:39
+ 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:

§ WinRes()

void WinRes ( void  )

Definition at line 1067 of file RTC_Time.c.

References DXL_par::com, D_WriteInitLog(), DB_WriteMode(), DC_Close(), paramini::EqType, das::Flag, GASCODNG1, GetDateTime(), HGFlg, HgLamp(), LookforWl_X(), MGUITerm(), das::Nova, NOVA_Out(), das::Paramini, QJFlg, QjLamp(), SD_Grating(), ShutterOpening(), SioDone(), nova::type, WDT_func(), and flag::WindowsReboot.

Referenced by InitTempAD(), and Task_Timer().

1068 {
1069 
1070  int PosRefWl, er;
1071  struct time RTime;
1072  struct date RDate;
1073  struct tm today;
1074  char buff[10];
1075  char str[10];
1076  char buf[256];
1077 
1078 
1079 
1080 
1081  PosRefWl = LookforWl_X(4358);
1082 
1083  SD_Grating(PosRefWl); //Positioning at 4358 A
1084 
1085 
1086 
1087  GetDateTime(&RDate, &RTime, &today);
1088  strftime( buff, 7,"%y%m%d", &today );
1089  strftime( str, 9,"%H:%M:%S", &today );
1090  sprintf(buf, "*++++++++++++++++++++++++++++++++++++++++++++*");
1091  D_WriteInitLog(buf);
1092  sprintf(buf, "Windows reboot on %s at %s", buff, str );
1093  D_WriteInitLog(buf);
1094  sprintf(buf, "**********************************************");
1095  D_WriteInitLog(buf);
1096 
1097 
1098 
1099  DB_WriteMode(1);
1100  ShutterOpening(1);
1101  DC_Close(0); //DA RIMETTERE!!!!!!!!!!!!!!!!!1
1102  if (HGFlg)
1103  HgLamp(0);//HG Off
1104  if (QJFlg)
1105  QjLamp(0);//QJ Off
1106  //Switch off 12 V, Hires, 24V
1107  if(DAS.Paramini.EqType == GASCODNG1)
1108  er = NOVA_Out(DAS.Nova.type, 15); //1111 bin
1109 
1110 
1111  WDT_func(0); //Stop WDT
1112  SioDone(DXL.com);//Close Com connection
1113  DAS.Flag.WindowsReboot = 2;
1114 
1115 
1116  MGUITerm();
1117  //restart the instrument
1118  system("shutdown -r -t 10 -f");
1119 
1120 
1121 
1122 }
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
Definition: Spat_Device.c:2108
void HgLamp(int mod)
HG Lamp ON/OFF .
Definition: Spat_Device.c:2673
int QJFlg
Definition: DAS_Spatram.h:2969
flag Flag
Structure for different flags.
void WDT_func(int mod)
Definition: DAS_Spat.c:1572
NoMangle int DLL_IMPORT_EXPORT SioDone(int)
void QjLamp(int mod)
QJ Lamp ON/OFF .
Definition: Spat_Device.c:2724
CTYPE void DLL DC_Close(int Camera)
Shuts down the control operations of the camera. Procedure that shuts down the control operations of ...
void MGUITerm(void)
DXL_par DXL
Definition: RTC_Time.c:24
int NOVA_Out(int novatype, unsigned int out)
Write the NOVA Output port.
Definition: DAS_Spat.c:1375
Definition: Dildef.h:240
das DAS
DAS structure.
Definition: RTC_Time.c:34
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
int WindowsReboot
Flag that became 1 when Windows reboot is setted (SetWinowsReset)
nova Nova
NOVA structure.
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
int D_WriteInitLog(char *str)
writes devices errors(AMS, CCD...) on the Devices.log file.
Definition: Save.c:144
Definition: Dildef.h:234
void DB_WriteMode(int mod)
Definition: CreateForms.c:6722
int EqType
Spectrometer Type.
int HGFlg
Definition: DAS_Spatram.h:2968
int com
Comunication port.
Definition: DXL.H:17
int type
type of NOVA monoboard used (7892 or 945GSE)
void ShutterOpening(int mod)
Definition: Procedures.c:1685
int LookforWl_X(int x)
Definition: Procedures.c:2295
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:

§ WriteAMSCB()

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

Write AMS.ini file
.

Returns
0 –> operation succefully performed; 1 –>problems in writing file

Definition at line 2834 of file DAS_Spat_ConfCBs.c.

References _MAX_PATH, d_fileman::CONFIGDIREQUIPMENT, gui::ConfigPanel, gui::ContrPanel, stepm::cop_perc, date::da_day, date::da_mon, date::da_year, bil::DFILEM, fraz2val(), GetDateTime(), das::Gui, hertz2int(), stepm::hometype, MMessageDialog(), MObjectGetText(), MObjectSetText(), stepm::multiplier, stepm::NAMS, paramini::Offset, das::Paramini, perc2int(), controlpanel::power, stepm::power, controlpanel::slope, stepm::slope, configpanel::SM_multiplier, configpanel::SM_power, configpanel::SM_slope, configpanel::SM_speed, configpanel::SM_step, controlpanel::speed, stepm::speed, stepm::speed_Hz, controlpanel::step, stepm::step, stepm::step_fraz, das::StepM, time::ti_hour, time::ti_min, and val2fraz().

Referenced by MDCreateDASConfig().

2835 {
2836  FILE *fs;
2837  char str[80];
2838  char buf[16];
2839  struct time adesso;
2840  struct date oggi;
2841  struct tm today;
2842  int c,i, k, t;
2843  char buff[_MAX_PATH];
2844 
2845 
2846  sprintf(buff,"%s\\AMS.INI", BIL.DFILEM.CONFIGDIREQUIPMENT);
2847  fs = fopen(buff, "w");
2848 
2849  GetDateTime(&oggi, &adesso, &today);
2850  //gettime(&adesso);
2851  //getdate(&oggi);
2852 
2853 
2854  if(fs == NULL)
2855  {
2856  MMessageDialog("DAS information", "Problems in opening file", " Ok ", NULL);
2857  return 1;
2858  }
2859 
2860 
2861 
2862  sprintf(str, "###############################################\n");
2863  fprintf(fs,str);
2864  sprintf(str, "# AMS.INI #\n");
2865  fprintf(fs,str);
2866  sprintf(str, "# Main configuration file for AMS Devices #\n");
2867  fprintf(fs,str);
2868  sprintf(str, "###############################################\n");
2869  fprintf(fs,str);
2870  sprintf(str, "# ------------------------------------------- #\n");
2871  fprintf(fs,str);
2872  sprintf(str, "# by DanBo %02u/%02u/%d at %02u:%02u:%02u #\n", oggi.da_day,oggi.da_mon,oggi.da_year, adesso.ti_hour, adesso.ti_min,adesso.ti_min);
2873  fprintf(fs,str);
2874  sprintf(str, "# ------------------------------------------- #\n");
2875  fprintf(fs,str);
2876 
2877 
2878 
2879  for (i=0;i<DAS.StepM.NAMS;i++)
2880  {
2881  for(k=0;k<2;k++)
2882  {
2883  /*
2884  * Get user preferences from the EDIT Objects for Power SMx
2885  */
2886  //Power
2888  DAS.StepM.cop_perc[i][k] = atof(str);
2889  DAS.StepM.power[i][k] = perc2int(0, str);
2890  MObjectSetText(DAS.Gui.ContrPanel.power[i][k], str);
2891 
2892  /*
2893  * Get user preferences from the EDIT Objects for Step SMx
2894  */
2895  //Step
2897  DAS.StepM.step[i][k] = fraz2val(0, str);
2898  val2fraz(i, k, DAS.StepM.step[i][k]);
2899  sprintf(str, "%s", DAS.StepM.step_fraz[i][k]);
2900  MObjectSetText(DAS.Gui.ContrPanel.step[i][k], str);
2901 
2902  // Slope
2904  DAS.StepM.slope[i][k] = atoi(str);
2905  sprintf(str, "%d", DAS.StepM.slope[i][k]);
2906  MObjectSetText(DAS.Gui.ContrPanel.slope[i][k], str);
2907 
2908  //speed
2910  DAS.StepM.speed_Hz[i][k] = atof(str);
2911  DAS.StepM.speed[i][k] = hertz2int(0, str);
2912  MObjectSetText(DAS.Gui.ContrPanel.speed[i][k], str);
2913 
2914  //multiplier
2916  DAS.StepM.multiplier[i][k] = atof(str);
2917 
2918  }
2919  }
2920 
2921 
2922  sprintf(str, "# Number of AMS # \n");
2923  fprintf(fs,str);
2924 
2925  sprintf(str, "%d\n", DAS.StepM.NAMS);
2926  fprintf(fs,str);
2927 
2928 
2929 /*
2930  //SM
2931  for (i=0;i<(DAS.StepM.NAMS*2);i++)
2932  {
2933  sprintf(buf,"SM%d", i+1);
2934 
2935  switch (i)
2936  {
2937  case 0:
2938  sprintf(str, "# Input Mirror Stepper Motor - %s #\n", buf);
2939  break;
2940  case 1:
2941  sprintf(str, "# Grating Stepper Motor - %s #\n", buf);
2942  break;
2943  case 2:
2944  sprintf(str, "# Filter Wheel Stepper Motor - %s #\n", buf);
2945  break;
2946  case 3:
2947  sprintf(str, "# Not Connected Stepper Motor - %s #\n", buf);
2948  break;
2949  case 4:
2950  sprintf(str, "# Zenith Axis Stepper Motor - %s #\n", buf);
2951  break;
2952  case 5:
2953  sprintf(str, "# Azimuth Axis Stepper Motor - %s #\n", buf);
2954  break;
2955 
2956  }
2957 
2958  fprintf(fs,str);
2959  }
2960 */
2961  for (i=0;i<DAS.StepM.NAMS;i++)
2962  {
2963  for (k=0;k<2;k++)
2964  {
2965 
2966  t=2*i+k;
2967  sprintf(buf,"SM%d", t+1);
2968  switch (t)
2969  {
2970  case 0:
2971  sprintf(str, "# Input Mirror Stepper Motor - %s #\n", buf);
2972  fprintf(fs,str);
2973  break;
2974  case 1:
2975  sprintf(str, "# Grating Stepper Motor - %s #\n", buf);
2976  fprintf(fs,str);
2977  break;
2978  case 2:
2979  sprintf(str, "# Filter Wheel Stepper Motor - %s #\n", buf);
2980  fprintf(fs,str);
2981  break;
2982  case 3:
2983  sprintf(str, "# Not Connected Stepper Motor - %s #\n", buf);
2984  fprintf(fs,str);
2985  break;
2986  case 4:
2987  sprintf(str, "# Zenith Axis Stepper Motor - %s #\n", buf);
2988  fprintf(fs,str);
2989  break;
2990  case 5:
2991  sprintf(str, "# Azimuth Axis Stepper Motor - %s #\n", buf);
2992  fprintf(fs,str);
2993  break;
2994  }
2995 
2996  sprintf(str, "# %s Power (0 = 0A - 76 = 1.52A) #\n", buf);
2997  fprintf(fs,str);
2998  sprintf(str,"%d\n", DAS.StepM.power[i][k]);
2999  fprintf(fs,str);
3000  sprintf(str, "# %s Step (0=400s/r, 1=800s/r,2=1000/sr) #\n", buf);
3001  fprintf(fs,str);
3002  sprintf(str,"%d\n", DAS.StepM.step[i][k]);
3003  fprintf(fs,str);
3004  sprintf(str, "# %s Slope (0 - 255) #\n", buf);
3005  fprintf(fs,str);
3006  sprintf(str,"%d\n", DAS.StepM.slope[i][k]);
3007  fprintf(fs,str);
3008  sprintf(str, "# %s Speed Hz (PS = 125*(n+1), n=0,1..255) #\n", buf);
3009  fprintf(fs,str);
3010  sprintf(str,"%d\n", DAS.StepM.speed[i][k]);
3011  fprintf(fs,str);
3012  sprintf(str, "# %s Multiplier #\n", buf);
3013  fprintf(fs,str);
3014  sprintf(str,"%.1f\n", DAS.StepM.multiplier[i][k]);
3015  fprintf(fs,str);
3016 
3017 
3018  }
3019  }
3020 
3021 
3022  sprintf(str, "# OFFSETS #\n");
3023  fprintf(fs,str);
3024  sprintf(str, "# HMir, Mir0, Mir1, Mir2, Mir3, Mir4, Grat, FW#\n");
3025  fprintf(fs,str);
3026  for(c = 0; c < 9; c++)
3027  {
3028  sprintf(str,"%d ", DAS.Paramini.Offset[c]);
3029  fprintf(fs,str);
3030  }
3031 
3032  sprintf(str, "\nHome Type Mode for Steppers #\n");
3033  fprintf(fs,str);
3034 
3035  sprintf(str, "SM1 SM2 SM3 SM4 SM5 SM6 #\n");
3036  fprintf(fs,str);
3037 
3038  for(c = 0; c < DAS.StepM.NAMS; c++)
3039  {
3040  for(k = 0; k < 2; k++)
3041  {
3042  sprintf(str,"%d ", DAS.StepM.hometype[c][k]);
3043  //sprintf(str,"%d ", 2);
3044  fprintf(fs,str);
3045  }
3046 
3047  }
3048 
3049  sprintf(str, "\n###############################################\n");
3050  fprintf(fs,str);
3051 
3052  fclose(fs);
3053 
3054  sprintf(buff,"The current parameters has been saved in '%s\\AMS.INI' file", BIL.DFILEM.CONFIGDIREQUIPMENT);
3055  MMessageDialog("DAS information", buff, " Ok ", NULL);
3056 
3057  return 0;
3058 
3059 
3060 }
stepm StepM
Stepper motors parameters structure.
gui Gui
Graphic User Interface Structure.
int hometype[AMSMAX][2]
MOBJECT speed[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "speed".
int NAMS
Number of AMSs Devices.
MOBJECT SM_multiplier[AMSMAX][2]
int Offset[16]
Offset of the hardware devices (Input Mirror (5), Grating, Filter Wheel...)
int slope[AMSMAX][2]
Stepper Motors Slope.
MOBJECT step[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "step".
int perc2int(int mod, char *string)
translate the percent power in AMS digit unit. The percent power assigned to the motor trough the AMS...
char * MObjectGetText(MOBJECT obj, char *text)
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
void MObjectSetText(MOBJECT obj, const char *text)
MOBJECT slope[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "Slope".
MOBJECT SM_power[AMSMAX][2]
d_fileman DFILEM
Definition: bildef.h:257
MOBJECT SM_step[AMSMAX][2]
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
int hertz2int(int mod, char *string)
translate the Hertz speed in AMS digit unit.
Definition: Dildef.h:240
MOBJECT SM_slope[AMSMAX][2]
double cop_perc[AMSMAX][2]
Stepper Motors Power percent.
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int fraz2val(int mod, char *val)
ratio value to decimal value opposite than listval2fraz or val2fraz
das DAS
configpanel ConfigPanel
Configuration panel structure.
char step_fraz[AMSMAX][2][6]
Stepper Motors Step fraction.
void val2fraz(int id, int sn, int val)
Decimal value to ratio value Similar to listval2fraz The decimal value indicating the fractioning of ...
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
controlpanel ContrPanel
Control Panel Structure.
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
Definition: Dildef.h:234
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
MOBJECT SM_speed[AMSMAX][2]
MOBJECT power[AMSMAX][2]
active Control Panel Labels for Stepper Motors "power"
bil BIL
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:

§ WriteColorsCB()

int WriteColorsCB ( MOBJECT  o,
void *  a,
void *  v 
)

Write selected color in DASSysColor.INI.

Definition at line 98 of file DAS_Spat_ConfCBs.c.

References _MAX_PATH, d_fileman::CONFIGDIREQUIPMENT, palette::DB_BG, palette::DB_BG_Albl, palette::DB_BG_lblUP, palette::DB_BG_Plbl, palette::DB_BG_RButt, palette::DB_FG_Albl, palette::DB_FG_lblUP, palette::DB_FG_Plbl, palette::DB_FG_RButt, palette::DB_Sel, palette::DB_UnSel, palette::DB_UnSelFG, bil::DFILEM, and MMessageDialog().

Referenced by MDCreateDASConfig().

99 {
100  FILE *fs;
101  char str[80];
102  char buff[_MAX_PATH];
103 
104  sprintf(buff,"%s\\DASSysColor.INI", BIL.DFILEM.CONFIGDIREQUIPMENT);
105  fs = fopen(buff, "w");
106 
107  // if(fs == NULL) return 2;
108 
109  fprintf(fs, "%s\n", "###########################################");
110  fprintf(fs, "%s\n", "# DAS Default Color #");
111  fprintf(fs, "%s\n", "# by DanBo #");
112  fprintf(fs, "%s\n", "###########################################");
113  fprintf(fs, "%s\n", "# All these values can be modified, but #");
114  fprintf(fs, "%s\n", "# DO NOT Exchange the order #");
115  fprintf(fs, "%s\n", "###########################################");
116 
117 
118  fprintf(fs, "%s\n", "# Selected Buttons BG #");
119  fprintf(fs, "%d %d %d\n", DPAL.DB_Sel[0], DPAL.DB_Sel[1], DPAL.DB_Sel[2]);
120 
121  fprintf(fs, "%s\n", "# Unselected Buttons BG #");
122  fprintf(fs, "%d %d %d\n", DPAL.DB_UnSel[0], DPAL.DB_UnSel[1], DPAL.DB_UnSel[2]);
123 
124  fprintf(fs, "%s\n", "# UnSelected Buttons FG #");
125  fprintf(fs, "%d %d %d\n", DPAL.DB_UnSelFG[0], DPAL.DB_UnSelFG[1], DPAL.DB_UnSelFG[2]);
126 
127  fprintf(fs, "%s\n", "# Forms and shell Background #");
128  fprintf(fs, "%d %d %d\n", DPAL.DB_BG[0],DPAL.DB_BG[1],DPAL.DB_BG[2]);
129 
130  fprintf(fs, "%s\n", "# ACTIVE Labels Background #");
131  fprintf(fs, "%d %d %d\n", DPAL.DB_BG_Albl[0],DPAL.DB_BG_Albl[1],DPAL.DB_BG_Albl[2]);
132 
133  fprintf(fs, "%s\n", "# ACTIVE Labels Foreground #");
134  fprintf(fs, "%d %d %d\n", DPAL.DB_FG_Albl[0],DPAL.DB_FG_Albl[1],DPAL.DB_FG_Albl[2]);
135 
136  fprintf(fs, "%s\n", "# PASSIVE Labels Background #");
137  fprintf(fs, "%d %d %d\n", DPAL.DB_BG_Plbl[0],DPAL.DB_BG_Plbl[1],DPAL.DB_BG_Plbl[2]);
138 
139  fprintf(fs, "%s\n", "# PASSIVE Labels Foreground #");
140  fprintf(fs, "%d %d %d\n", DPAL.DB_FG_Plbl[0],DPAL.DB_FG_Plbl[1],DPAL.DB_FG_Plbl[2]);
141 
142  fprintf(fs, "%s\n", "# Capital Letters Labels Color UP BG #");
143  fprintf(fs, "%d %d %d\n", DPAL.DB_BG_lblUP[0],DPAL.DB_BG_lblUP[1],DPAL.DB_BG_lblUP[2]);
144 
145  fprintf(fs, "%s\n", "# Capital Letters Labels Color UP FG #");
146  fprintf(fs, "%d %d %d\n", DPAL.DB_FG_lblUP[0],DPAL.DB_FG_lblUP[1],DPAL.DB_FG_lblUP[2]);
147 
148  fprintf(fs, "%s\n", "# Radio Button BG #");
149  fprintf(fs, "%d %d %d\n", DPAL.DB_BG_RButt[0],DPAL.DB_BG_RButt[1],DPAL.DB_BG_RButt[2]);
150 
151  fprintf(fs, "%s\n", "# Radio Button FG #");
152  fprintf(fs, "%d %d %d\n", DPAL.DB_FG_RButt[0],DPAL.DB_FG_RButt[1],DPAL.DB_FG_RButt[2]);
153 
154  fprintf(fs, "%s\n", "###########################################");
155 
156  fclose(fs);
157 
158 
159  sprintf(str,"The colors have been saved in 'CONFIG\\DASSysColor.INI' file");
160  MMessageDialog("DAS information", str, " Ok ", NULL);
161 
162 
163  return 0;
164 
165 }
short DB_BG_lblUP[3]
Background Capital Letters Labels Color UP.
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
short DB_Sel[3]
Selected Buttons Colors.
short DB_BG_RButt[3]
Background Radio Buttons.
d_fileman DFILEM
Definition: bildef.h:257
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
short DB_BG[3]
Default Background Color.
short DB_FG_RButt[3]
Foreground Radio Buttons.
short DB_UnSelFG[3]
Unselected Buttons Colors.
palette DPAL
short DB_UnSel[3]
Unselected Buttons Colors.
bil BIL
short DB_FG_lblUP[3]
Foreground Capital Letters Labels Color UP.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ WriteEquipini()

int WriteEquipini ( void  )

Write equipment.ini file
.

Returns
0 –> operation succefully performed; 1 –>problems in writing file

Definition at line 3111 of file DAS_Spat_ConfCBs.c.

References _MAX_PATH, d_fileman::CONFIGDIRCOMMON, bil::DFILEM, paramini::EqType, MMessageDialog(), and das::Paramini.

Referenced by DB_EqTypeCB(), and DB_EqTypePlotCB().

3112 {
3113 
3114  FILE *fs;
3115  char str[80];
3116 // char buf[16];
3117  char buff[_MAX_PATH];
3118 // int c,i;
3119 
3120  sprintf(buff,"%s\\Equipment.ini", BIL.DFILEM.CONFIGDIRCOMMON);
3121  fs = fopen(buff, "w");
3122  if(fs == NULL)
3123  {
3124  MMessageDialog("DAS information", "Problems in opening file", " Ok ", NULL);
3125  return 1;
3126  }
3127 
3128 
3129  sprintf(str, "###############################################\n");
3130  fprintf(fs,str);
3131  sprintf(str, "# Equipment.INI #\n");
3132  fprintf(fs,str);
3133  sprintf(str, "# Configuration file setting equipment type #\n");
3134  fprintf(fs,str);
3135  sprintf(str, "###############################################\n");
3136  fprintf(fs,str);
3137  sprintf(str, "# 0 = SPATRAM, 1 = TROPOGAS, 2 = LIS #\n");
3138  fprintf(fs,str);
3139  sprintf(str, "# 3 = SPATRAMPLUS, 4 = GASCODNG1, 5=GASCOD/OA #\n");
3140  fprintf(fs,str);
3141  sprintf(str, "# 6 = GASCODNG2, 7 = GASCODNG3, 8 = GASCODNG4 #\n");
3142  fprintf(fs,str);
3143  sprintf(str, "# 9 = SPATRAM2, #\n");
3144  fprintf(fs,str);
3145  sprintf(str, "###############################################\n");
3146  fprintf(fs,str);
3147 
3148 
3149 
3150  sprintf(str, "%d\n", DAS.Paramini.EqType); // Instrument Type(0 = SPATRAM, 1 = TROPOGAS, 2 = LIS, 3 = SPATRAMPLUS, 4 = GASCODNG1)
3151  fprintf(fs,str);
3152 
3153  fclose(fs);
3154 
3155 // sprintf(buff,"The selected instrument has been saved in '%s\\Equipment.ini' file\n ", BIL.DFILEM.CONFIGDIRCOMMON);
3156 // MMessageDialog("DAS information", buff, " Ok ", NULL);
3157 
3158 
3159  return 0;
3160 
3161 }
d_fileman DFILEM
Definition: bildef.h:257
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
das DAS
int EqType
Spectrometer Type.
char CONFIGDIRCOMMON[_MAX_PATH]
Definition: bildef.h:206
bil BIL
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:

§ WriteFontCB()

void WriteFontCB ( MOBJECT  obj,
void *  a,
void *  v 
)

This callback write on file the selected font (Not implemented yet)

Definition at line 1416 of file DAS_Spat_ConfCBs.c.

References MMessageDialog().

Referenced by MDCreateDASConfig().

1417 {
1418  MMessageDialog("DAS information", "The procedure is not yet implemented!!", " Ok ", NULL);
1419 }
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:

§ WriteHardwareiniCB()

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

Write hardware.ini file
.

Returns
0 –> operation succefully performed; 1 –>problems in writing file

Definition at line 3064 of file DAS_Spat_ConfCBs.c.

References _MAX_PATH, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, MMessageDialog(), das::Nova, and nova::type.

Referenced by CONFP_AMS_NOVA().

3065 {
3066 
3067  FILE *fs;
3068  char str[80];
3069 // char buf[16];
3070  char buff[_MAX_PATH];
3071 // int c,i;
3072 
3073  sprintf(buff,"%s\\Hardware.ini", BIL.DFILEM.CONFIGDIREQUIPMENT );
3074  fs = fopen(buff, "w");
3075  if(fs == NULL)
3076  {
3077  MMessageDialog("DAS information", "Problems in opening file", " Ok ", NULL);
3078  return 1;
3079  }
3080 
3081 
3082  sprintf(str, "###############################################\n");
3083  fprintf(fs,str);
3084  sprintf(str, "# Hardware .INI #\n");
3085  fprintf(fs,str);
3086  sprintf(str, "###############################################\n");
3087  fprintf(fs,str);
3088  sprintf(str, "# Type of motherboard installed #\n");
3089  fprintf(fs,str);
3090  sprintf(str, "# 0 = NOVA7892; 1 = NOVA6612; 2 = NOVA945GSE #\n");
3091  fprintf(fs,str);
3092  sprintf(str, "###############################################\n");
3093  fprintf(fs,str);
3094 
3095 
3096 
3097  sprintf(str, "%d\n", DAS.Nova.type );
3098  fprintf(fs,str);
3099 
3100  fclose(fs);
3101 
3102  sprintf(buff,"The selected instrument has been saved in '%s\\Hardware.ini' file\n ", BIL.DFILEM.CONFIGDIREQUIPMENT);
3103  MMessageDialog("DAS information", buff, " Ok ", NULL);
3104 
3105 
3106  return 0;
3107 
3108 }
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,...)
das DAS
nova Nova
NOVA structure.
int type
type of NOVA monoboard used (7892 or 945GSE)
bil BIL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ WriteIMG()

void WriteIMG ( FILE *  file,
unsigned short *  mat,
int  hp,
int  vp 
)

Definition at line 1178 of file Spat_Plot.c.

Referenced by SaveDataOffLine().

1179 {
1180 
1181 
1182  int x, y;
1183 
1184  for(y = 0; y < vp; y++)
1185  {
1186  for(x = 0; x < hp; x++)
1187  {
1188  if((x % 10) == 0)
1189  {
1190  if(y == 0 && x == 0)
1191  {
1192  }
1193  else
1194  fprintf(file, "\n", NULL);
1195  }
1196  fprintf(file, "%5u ", mat[y * hp + x]);
1197 
1198  }
1199 
1200  }
1201  fprintf(file, "\n", NULL);
1202 
1203 
1204 }
+ Here is the caller graph for this function:

§ WriteIMG_BIN()

void WriteIMG_BIN ( int  fd,
unsigned short *  mat,
int  hp,
int  vp 
)

Definition at line 1153 of file Spat_Plot.c.

Referenced by SaveDataOffLine().

1154 {
1155  int x, y;
1156 
1157  for(x = 0; x < hp; x++)
1158  {
1159  for(y = 0; y < vp; y++)
1160  write(fd, &mat[y * hp + x], 2);
1161 
1162  }
1163 }
+ Here is the caller graph for this function:

§ WriteInit()

void WriteInit ( const char *  sname,
char *  dateffn,
char *  timebuff 
)

Init the daily LOG file
.

Parameters
*sname= Name of the station (3 char)
*dateffn= date
*timebuff= time

Definition at line 158 of file RTC_Time.c.

References bil::DFILEM, dlog::flog, dlog::fsmlog, and d_fileman::LOGDIR.

Referenced by MGUIMain().

159 {
160  int fc, er;
161  char tit1[256], datebuff[9];
162 
163 
164  //for stepper motors log
165  sprintf(DLOG.fsmlog,"%s\\SM_%s.log", BIL.DFILEM.LOGDIR, dateffn);
166 
167 
168 
169  sprintf(DLOG.flog,"%s\\%s%s.log",BIL.DFILEM.LOGDIR, sname, dateffn);
170 
171  fc = _open(DLOG.flog, O_WRONLY | O_APPEND | O_TEXT | O_CREAT, S_IWRITE);
172  //test for errno
173  //fc = _open(DLOG.flog, O_WRONLY | O_APPEND | O_TEXT | O_CREAT| O_EXCL, S_IWRITE);
174 
175 
176  if(fc < 0)
177  {
178  er = errno;
179  }return;
180 
181  sprintf(datebuff,"%c%c/%c%c/%c%c", dateffn[0],dateffn[1],dateffn[2],dateffn[3],dateffn[4],dateffn[5]);
182  sprintf(tit1,"DAS Started on: %s, at: %s\n",datebuff,timebuff);
183  write(fc, &tit1, strlen(tit1));
184  // Write title for monitored values
185  sprintf(tit1,"Time TCCD PwCCD PwPlt T.Optic T.IntSX T.OutSX T.IntDX T.OutDX T.Grat SPARE T.Elec SPARE SPARE SPARE SPARE SPARE SPARE SPARE SPARE \n");
186  write(fc, &tit1, strlen(tit1));
187 
188  close(fc);
189 }
char fsmlog[_MAX_PATH]
daily LOG file for stepper motor moovements
char LOGDIR[_MAX_PATH]
Definition: bildef.h:209
bil BIL
Definition: RTC_Time.c:30
d_fileman DFILEM
Definition: bildef.h:257
dlog DLOG
Definition: RTC_Time.c:29
char flog[_MAX_PATH]
daily LOG file
+ Here is the caller graph for this function:

§ writelogmotor()

void writelogmotor ( int  mod,
int  id_motore,
int  k,
int  d,
long  steps,
unsigned char  ams_id 
)

Write Motor Operations on Log File.
Write on the SM.LOG file the commands send to the motors.

Parameters
mod
  • = 0 write commands
  • = 1 AMS initialization
id_motore
  • = SMx, with X = 1, 2, 3. (5, 6 for TROPOGAS)
k= er
d= direction:
  • = 0
  • = 1
steps= number of steps
ams_id= AMS address:
  • 0 = AMS1
  • 1 = AMS2
  • 2 = AMS3

Definition at line 48 of file Spat_Device.c.

References DXL_par::bufrx, DXL_par::buftx, DLOG, and dlog::fsmlog.

Referenced by AMS_DoPos().

49 {
50  int fc;
51  char str[250];
52  char str1[30];
53  char timebuf[9];
54  char datebuf[9];
55 
56  if (mod==0)
57  {
58  if(id_motore==0)
59  sprintf(str1,"Input Mirror");
60  if(id_motore==1)
61  sprintf(str1,"Grating ");
62  if(id_motore==2)
63  sprintf(str1,"Filter Wheel");
64  if(id_motore==4)
65  sprintf(str1,"Zenith ");
66  if(id_motore==5)
67  sprintf(str1,"Azimuth ");
68 
69  fc = open(DLOG.fsmlog, O_WRONLY | O_APPEND | O_TEXT | O_CREAT, S_IWRITE);
70 
71  if(fc > 0)
72  {
73  _strtime(timebuf);
74  _strdate(datebuf);
75 
76 
77 // sprintf(str, "%s, err = %d, from AMS%u, dir=%d, Steps=%ld, Steps(esa)=%lX, DXL.buftx=%s, DXL.bufrx=%s\n",
78 // str1, k, ams_id, d, steps, steps, DXL.buftx, DXL.bufrx);
79 // write(fc, str, strlen(str));
80 
81  sprintf(str, "%s at %s: %s, from AMS%u, dir=%d, Steps=%ld, Steps(esa)=%lX, DXL.buftx=%s, DXL.bufrx=%s\n",
82  datebuf, timebuf, str1, ams_id, d, steps, steps, DXL.buftx, DXL.bufrx);
83  write(fc, str, strlen(str));
84 
85  }
86 
87  close(fc);
88  }
89  // For the AMS initialization
90  if (mod == 1)
91  {
92 
93  if(id_motore==0)
94  sprintf(str1,"Input Mirror");
95  if(id_motore==1)
96  sprintf(str1,"Grating ");
97  if(id_motore==2)
98  sprintf(str1,"Filter Wheel");
99 
100 
101 
102  fc = open("LOG\\logSM.log", O_WRONLY | O_APPEND | O_TEXT | O_CREAT, S_IWRITE);
103 
104  if(fc > 0)
105  {
106 
107  _strtime(timebuf);
108  _strdate(datebuf);
109 
110  sprintf(str, "%s at %s, AMSs Init with\n ", datebuf, timebuf);
111  write(fc, str, strlen(str));
112 
113 // sprintf(str, "%s :\n Power:%d (%.1lf%%), Step: %d (%s), Slope: %d, Speed: %d (%.3lf) \n",str1, DAS.StepM.cop[id_motore], DAS.StepM.cop_perc[id_motore], DAS.StepM.step[id_motore], DAS.StepM.step_fraz[id_motore], DAS.StepM.slope[id_motore], DAS.StepM.speed[id_motore], DAS.StepM.speed_Hz[id_motore]);
114  write(fc, str, strlen(str));
115 
116  }
117 
118  close(fc);
119  }
120 
121 
122 
123 }
char fsmlog[_MAX_PATH]
daily LOG file for stepper motor moovements
char buftx[1024]
Tx buffer.
Definition: DXL.H:21
dlog DLOG
Definition: DAS_Spat.c:52
DXL_par DXL
Definition: Spat_Device.c:17
char bufrx[1024]
Rx buffer.
Definition: DXL.H:20
+ Here is the caller graph for this function:

§ WriteOptioniniCB()

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

Write Options.ini file
.

Returns
0 –> operation succefully performed; 1 –>problems in writing file

Definition at line 2541 of file DAS_Spat_ConfCBs.c.

References _MAX_PATH, optionini::aaopmode, optionini::amsprogbar, optionini::avgautor, optionini::avgmode, d_fileman::CONFIGDIREQUIPMENT, date::da_day, date::da_mon, date::da_year, optionini::darkremove, optionini::darksource, optionini::DEFPIXFILENAME, flag::DeltaSZA, dsza::DeltaSZA, bil::DFILEM, flag::DispBlindPix, das::DOption, optionini::emshutter, optionini::filename, optionini::filtertype, das::Flag, optionini::ftpbackup, GetDateTime(), optionini::hlineafter, optionini::hlinebefore, optionini::imgtype, mige::linked, optionini::maxlvlar, dsza::MaxSZA, optionini::measmode, das::MIGE, dsza::MinSZA, optionini::mirrorimg, MMessageDialog(), N_AVG, omuthr::PID_kd, omuthr::PID_ki, omuthr::PID_kp, optionini::pixcorr, flag::plotW, flag::plotYRange, optionini::refertemp, optionini::resetEnabled, optionini::resetFreq, optionini::resetType, optionini::savingmode, flag::settempvar, optionini::shuttertype, optionini::smposmode, SZADelta, SZAMax, time::ti_hour, time::ti_min, TOTTEXP, omuthr::TRType, mige::type, flag::Wl, XAX, and YAX.

Referenced by CONFP_Options(), CONFP_param_page4(), and CONFP_param_page5().

2542 {
2543 
2544 
2545 
2546  FILE *fs;
2547  char str[_MAX_PATH];
2548  struct time adesso;
2549  struct date oggi;
2550  char buff[_MAX_PATH];
2551  struct tm today;
2552  sprintf(buff,"%s\\OPTIONS.INI", BIL.DFILEM.CONFIGDIREQUIPMENT);
2553  fs = fopen(buff, "w");
2554 
2555  GetDateTime(&oggi, &adesso, &today);
2556  //gettime(&adesso);
2557  //getdate(&oggi);
2558 
2559 /*********************************/
2560 
2561 
2562  if(fs == NULL)
2563  {
2564  MMessageDialog("DAS information", "Problems in opening file", " Ok ", NULL);
2565  return 1;
2566  }
2567 
2568  sprintf(str, "####################################################\n");
2569  fprintf(fs,str);
2570  sprintf(str, "# Configuration file for OPTIONS Setting. #\n");
2571  fprintf(fs,str);
2572  sprintf(str, "# by DanBo %02u/%02u/%d at %02u:%02u:%02u #\n", oggi.da_day,oggi.da_mon,oggi.da_year, adesso.ti_hour, adesso.ti_min,adesso.ti_min);
2573  fprintf(fs,str);
2574  sprintf(str, "####################################################\n");
2575  fprintf(fs,str);
2576  sprintf(str, "# All these flags can be modified on line #\n");
2577  fprintf(fs,str);
2578  sprintf(str, "# in the CONFIG --> OPTION tabs #\n");
2579  fprintf(fs,str);
2580  sprintf(str, "#--------------------------------------------------#\n");
2581  fprintf(fs,str);
2582  sprintf(str, "# Please DO NOT change the order of the parameters #\n");
2583  fprintf(fs,str);
2584  sprintf(str, "#--------------------------------------------------#\n");
2585  fprintf(fs,str);
2586  sprintf(str, "# Saving Mode: 0 = ASCII, 1 = Binary #\n");
2587  fprintf(fs,str);
2588  sprintf(str, "%d\n", DAS.DOption.savingmode);
2589  fprintf(fs,str);
2590  sprintf(str, "# File Names:0 = free, 1 = automatic file names #\n");
2591  fprintf(fs,str);
2592  sprintf(str, "%d\n", DAS.DOption.filename);
2593  fprintf(fs,str);
2594  sprintf(str, "# Image Type:0=Mono, 1 = RGB #\n");
2595  fprintf(fs,str);
2596  sprintf(str, "%d\n", DAS.DOption.imgtype);
2597  fprintf(fs,str);
2598 
2599  sprintf(str, "# CCD Pix Correction: 0=NOT Corrected, 1=Corrected #\n");
2600  fprintf(fs,str);
2601  sprintf(str, "%d\n", DAS.DOption.pixcorr);
2602  fprintf(fs,str);
2603 
2604  sprintf(str, "# File Name for CCD Pix Correction #\n");
2605  fprintf(fs,str);
2606  sprintf(str, "%s\n", DAS.DOption.DEFPIXFILENAME);
2607  fprintf(fs,str);
2608 
2609  sprintf(str, "# Measuring Mode:0 = Single, 1 = Averaged #\n");
2610  fprintf(fs,str);
2611  sprintf(str, "%d\n", DAS.DOption.measmode);
2612  fprintf(fs,str);
2613 
2614  sprintf(str, "# Averaging Mode:0 = fixed number, 1 = fixed time #\n");
2615  fprintf(fs,str);
2616  sprintf(str, "%d\n", DAS.DOption.avgmode);
2617  fprintf(fs,str);
2618 
2619  sprintf(str, "# Avg Mode fixed Number of measurements #\n");
2620  fprintf(fs,str);
2621  sprintf(str, "%d\n", N_AVG);
2622  fprintf(fs,str);
2623 
2624  sprintf(str, "# Avg Mode fixed Time Exposure [sec] #\n");
2625  fprintf(fs,str);
2626  sprintf(str, "%d\n", TOTTEXP);
2627  fprintf(fs,str);
2628  sprintf(str, "# Remove Dark?: 0 = No, 1 = Yes #\n");
2629  fprintf(fs,str);
2630  sprintf(str, "%d\n", DAS.DOption.darkremove);
2631  fprintf(fs,str);
2632  sprintf(str, "# Dark source: 0 = Blind Pixels, 1 = Full Frame #\n");
2633  fprintf(fs,str);
2634  sprintf(str, "%d\n", DAS.DOption.darksource);
2635  fprintf(fs,str);
2636  sprintf(str, "# CCD Temp: 0 = Fixed, 1 = variation vs SZA #\n");
2637  fprintf(fs,str);
2638  sprintf(str, "%d\n", FLAG.settempvar);
2639  fprintf(fs,str);
2640 
2641 
2642  sprintf(str, "# Plot X Scale: 0 = Pixel #, 1 = Wl[A], 2 = wl[nm] #\n");
2643  fprintf(fs,str);
2644  sprintf(str, "%d\n", FLAG.Wl);
2645  fprintf(fs,str);
2646  sprintf(str, "# Plot display: 0 = NO, 1 = Yes #\n");
2647  fprintf(fs,str);
2648  sprintf(str, "%d\n", DAS.Flag.plotW);
2649  fprintf(fs,str);
2650  sprintf(str, "# Plot Y Scale: 0 = FullRange(0-65535), 1 = min/max#\n");
2651  fprintf(fs,str);
2652  sprintf(str, "%d\n", FLAG.plotYRange);
2653  fprintf(fs,str);
2654  sprintf(str, "# Measurements performed for SZA <= SZAMax #\n");
2655  fprintf(fs,str);
2656  sprintf(str, "%d\n", SZAMax);
2657  fprintf(fs,str);
2658 
2659 
2660  sprintf(str, "# Hidden Lines in Plot-Before and after Cent. line #\n");
2661  fprintf(fs,str);
2662  sprintf(str, "%d\n", DAS.DOption.hlinebefore);
2663  fprintf(fs,str);
2664  sprintf(str, "%d\n", DAS.DOption.hlineafter);
2665  fprintf(fs,str);
2666 
2667  sprintf(str, "# Display Blind Pixel: 0 = NO, 1 = Yes #\n");
2668  fprintf(fs,str);
2669 
2670  sprintf(str, "%d\n", FLAG.DispBlindPix);
2671  fprintf(fs,str);
2672 
2673  sprintf(str, "# Perform FTP Back-UP: 0 = NO, 1 = Yes #\n");
2674  fprintf(fs,str);
2675 
2676  sprintf(str, "%d\n", DAS.DOption.ftpbackup);
2677  fprintf(fs,str);
2678 
2679  sprintf(str, "# Reference temperature for OMU Thermo-Regulation: #\n");
2680  fprintf(fs,str);
2681  sprintf(str, "# 0 = AVG Internal Peltier; 1 = Optic; 2 = Grating #\n");
2682  fprintf(fs,str);
2683 
2684  sprintf(str, "%d\n", DAS.DOption.refertemp);
2685  fprintf(fs,str);
2686 
2687  sprintf(str, "# OMU Thermo-Regulation mode: #\n");
2688  fprintf(fs,str);
2689  sprintf(str, "# 0 = Cold Only; 1 = Heat only; 2 = Cold/Heat #\n");
2690  fprintf(fs,str);
2691  sprintf(str, "%d\n", OMUTHR.TRType);
2692  fprintf(fs,str);
2693 
2694  sprintf(str, "# Mirroring CCD Image along X #\n");
2695  fprintf(fs,str);
2696  sprintf(str, "# 0 = NO Mirroring; 1 = Mirror image #\n");
2697  fprintf(fs,str);
2698  sprintf(str, "%d\n", DAS.DOption.mirrorimg[XAX]);
2699  fprintf(fs,str);
2700 
2701  sprintf(str, "# Mirroring CCD Image along Y #\n");
2702  fprintf(fs,str);
2703  sprintf(str, "# 0 = NO Mirroring; 1 = Mirror image #\n");
2704  fprintf(fs,str);
2705  sprintf(str, "%d\n", DAS.DOption.mirrorimg[YAX]);
2706  fprintf(fs,str);
2707 
2708  sprintf(str, "# AMS Option - Stepper motor Positioning mode #\n");
2709  fprintf(fs,str);
2710  sprintf(str, "# 0 = Sequential; 1 = Simultaneous #\n");
2711  fprintf(fs,str);
2712  sprintf(str, "%d\n", DAS.DOption.smposmode);
2713  fprintf(fs,str);
2714 
2715  sprintf(str, "# AMS Option - Progressive bar #\n");
2716  fprintf(fs,str);
2717  sprintf(str, "# 0 = DO NOT show ; 1 = Show #\n");
2718  fprintf(fs,str);
2719  sprintf(str, "%d\n", DAS.DOption.amsprogbar);
2720  fprintf(fs,str);
2721 
2722 
2723  sprintf(str,"# Autorange before Average #\n");
2724  fprintf(fs,str);
2725  sprintf(str,"# 0 = NO Autoranging, 1 = Autoranging #\n");
2726  fprintf(fs,str);
2727  sprintf(str, "%d\n", DAS.DOption.avgautor);
2728  fprintf(fs,str);
2729 
2730  sprintf(str,"# MIGE Platform connection #\n");
2731  fprintf(fs,str);
2732  sprintf(str,"# 0 = NOT Connected, 1 = Connected #\n");
2733  fprintf(fs,str);
2734  sprintf(str, "%d\n", DAS.MIGE.linked);
2735  fprintf(fs,str);
2736 
2737  sprintf(str,"# MIGE Platform Type #\n");
2738  fprintf(fs,str);
2739  sprintf(str,"# 0 = AltAz V 0.5, 1 = MIGE V. 3 #\n");
2740  fprintf(fs,str);
2741  sprintf(str, "%d\n", DAS.MIGE.type);
2742  fprintf(fs,str);
2743 
2744 
2745  sprintf(str,"# MIGE Platform operating mode #\n");
2746  fprintf(fs,str);
2747  sprintf(str,"# 0 = Sun Track, 1 = AntiSunTrack, 2 = FreePos #\n");
2748  fprintf(fs,str);
2749  sprintf(str, "%d\n", DAS.DOption.aaopmode);
2750  fprintf(fs,str);
2751 
2752  sprintf(str,"# EMShutter #\n");
2753  fprintf(fs,str);
2754  sprintf(str,"# 0 = NOT installed, 1 = Installed #\n");
2755  fprintf(fs,str);
2756  sprintf(str, "%d\n", DAS.DOption.emshutter);
2757  fprintf(fs,str);
2758 
2759  sprintf(str,"# Shutter Type #\n");
2760  fprintf(fs,str);
2761  sprintf(str,"# 0 = VS25, 1 = ROTSHUT, 2 = TORQUEM #\n");
2762  fprintf(fs,str);
2763  sprintf(str, "%d\n", DAS.DOption.shuttertype);
2764  fprintf(fs,str);
2765 
2766 
2767 
2768  sprintf(str,"# Measurements driven by SZA #\n");
2769  fprintf(fs,str);
2770  sprintf(str,"# Format: a, b, c, d where: #\n");
2771  fprintf(fs,str);
2772  sprintf(str,"# a = Flag; 0 = NOT Active, 1 = Active #\n");
2773  fprintf(fs,str);
2774  sprintf(str,"# b = DeltaSZA, value of Delta SZA (x.x deg) #\n");
2775  fprintf(fs,str);
2776  sprintf(str,"# c = MinSZA, value of Min SZA (xx deg) #\n");
2777  fprintf(fs,str);
2778  sprintf(str,"# d = MaxSZA, value of Max SZA (xx deg) #\n");
2779  fprintf(fs,str);
2780  sprintf(str, "%d %.2lf %.2lf %.2lf\n", DAS.Flag.DeltaSZA, SZADelta.DeltaSZA, SZADelta.MinSZA, SZADelta.MaxSZA);
2781  fprintf(fs,str);
2782 
2783 
2784  sprintf(str,"# Filter Wheel type #\n");
2785  fprintf(fs,str);
2786  sprintf(str,"# 0=simple, 1= double, 2= simple +TorqueM #\n");
2787  fprintf(fs,str);
2788  sprintf(str, "%d\n", DAS.DOption.filtertype);
2789  fprintf(fs,str);
2790 
2791  sprintf(str,"#PID Parameters #\n");
2792  fprintf(fs,str);
2793  sprintf(str,"#PID_kp PID_ki PID_kd #\n");
2794  fprintf(fs,str);
2795  sprintf(str, "%.3f %.3f %.3f\n", OMUTHR.PID_kp, OMUTHR.PID_ki, OMUTHR.PID_kd);
2796  fprintf(fs,str);
2797 
2798  //RESET PARAMETERS
2799  sprintf(str,"#DAS/Windows Reset: Enabled = 1, Disabled = 0 #\n");
2800  fprintf(fs,str);
2801  sprintf(str, "%d\n", DAS.DOption.resetEnabled);
2802  fprintf(fs,str);
2803  //RESET Type
2804  sprintf(str,"#Reset Type: Hourly = 0, Daily= 1 #\n");
2805  fprintf(fs,str);
2806  sprintf(str, "%d\n", DAS.DOption.resetType);
2807  fprintf(fs,str);
2808  //RESET Frequency
2809  sprintf(str,"#Reset frequency: Hourly=1 to 23, Daily=1 to 365 #\n");
2810  fprintf(fs,str);
2811  sprintf(str, "%d\n", DAS.DOption.resetFreq);
2812  fprintf(fs,str);
2813 
2814  //AUTORANGING MAX VALUE
2815  sprintf(str,"#AUTORANGING MAX VALUE ( < 63000 #\n");
2816  fprintf(fs,str);
2817  sprintf(str, "%d\n", DAS.DOption.maxlvlar);
2818  fprintf(fs,str);
2819 
2820 
2821  sprintf(str, "####################################################\n");
2822  fprintf(fs,str);
2823 
2824  fclose(fs);
2825 
2826  sprintf(str,"The current options has been saved in '%s\\OPTIONS.INI' file", BIL.DFILEM.CONFIGDIREQUIPMENT);
2827  MMessageDialog("DAS information", str, " Ok ", NULL);
2828 
2829  return 0;
2830 
2831 
2832 }
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
dsza SZADelta
Definition: DAS_Spat.c:76
int TRType
Type of thermo regulation (0=TRTCOOL, 1 = TRTHEAT, 2= TRTBOTH)
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 filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
#define XAX
X Axis.
int type
int avgautor
autoranging for averaged measurement, 0 = NO AutoR before average; 1 = AutoR before average; ...
omuthr OMUTHR
int SZAMax
Maximum SZA for performing measurements.
Definition: DAS_Spat.c:116
int hlinebefore
Number of HiddenLines before the central line in Plot.
float PID_ki
d_fileman DFILEM
Definition: bildef.h:257
int avgmode
Flag to set Averaging mode: 0 = Repeat measurements for fixed number, 1 = Repeat measurements for fix...
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
double MaxSZA
Maximum SZA.
int emshutter
Presence of the CCD Shutter, emshutter = 1 –> Shutter IS Installed, = 0 –> Shutter NOT Installed...
mige MIGE
double DeltaSZA
DeltaSZA.
int DeltaSZA
= 1 Delta SZA measurements activated, = 0 Continous measurements
Definition: Dildef.h:240
int plotYRange
0 –> full range; 1 –> min/max
int resetFreq
frequency of DAS/Windows Reset
int TOTTEXP
Total Exposure time in Averaging mode.
Definition: DAS_Spat.c:115
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
#define _MAX_PATH
Definition: Dildef.h:202
int hlineafter
Number of HiddenLines after the central line in Plot.
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int linked
#define YAX
Y Axis.
das DAS
int mirrorimg[2]
Flag to set the mirroring of the CCD image: 0 = NO Mirroring, 1= YES Mirroring (element 0 for X axis;...
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
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 measmode
measuring mode: 0 = Single; 1 = Averaged
int settempvar
float PID_kp
Definition: Dildef.h:234
int aaopmode
operation mode for the Alt Az Platform, 0 = solar Traxker; 1 = Anti-Solar Tracker; 2 = Free Positioni...
flag FLAG
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
int filename
Flag to set file name mode 0=Free choice, 1 = Automatic.
int N_AVG
Number of measurements for Averaging mode in fixed number of meas. mode.
Definition: DAS_Spat.c:113
int darksource
Flag to set Dark source: 0 = Blind Pixels, 1 = Full Frame.
int resetEnabled
DAS/Windows reset option (1 = Enabled; 0 = disabled)
int refertemp
Flag to set the reference temp for thermo-regulation: 0 = AVGPINT; 1 = OPTIC; 2 = GRATING...
int resetType
type of period for DAS Reset: 0=Hours, 1=Days
int DispBlindPix
Display Blind Pix: 0 = NO, 1 = Yes.
int shuttertype
type of installed shutter: 0 = VS25, 1 = Rotating Shutter, 2 = TorqueMotor
unsigned int maxlvlar
maximum level of autoranging (max 65000)
bil BIL
double MinSZA
Minimum SZA.
char DEFPIXFILENAME[_MAX_PATH]
defective pixel filename with path
float PID_kd
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ WriteParaminiCB()

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

Write Param.ini file
.

Returns
0 –> operation succefully performed; 1 –>problems in writing file

Definition at line 3212 of file DAS_Spat_ConfCBs.c.

References _MAX_PATH, CCD_SetupFlg, paramini::ccdWx, paramini::ccdWy, paramini::ccdXoff, paramini::ccdYoff, CodeEq2Name(), d_fileman::CONFIGDIREQUIPMENT, gui::ContrPanel, paramini::CoolPw, date::da_day, date::da_mon, date::da_year, bil::DFILEM, d_fileman::DIRDCL, DOASMODE, paramini::EqType, flag::exemode, das::Flag, GetDateTime(), das::Gui, paramini::ITemp, controlpanel::lbl_Par, paramini::maxtexp, MMessageDialog(), MObjectSetText(), das::Paramini, omuthr::PCPower, time::ti_hour, time::ti_min, paramini::TPelt, and paramini::VBin.

Referenced by CONFP_param_page1().

3213 {
3214 
3215  //MMessageDialog("DAS information", "The procedure is not yet implemented!!", " Ok ", NULL);
3216 
3217  FILE *fs;
3218  char str[_MAX_PATH];
3219  char buf[_MAX_PATH];
3220  struct time adesso;
3221  struct date oggi;
3222  struct tm today;
3223  int er;
3224  char buff[_MAX_PATH];
3225 
3226 // char streqtype[32]= {'\0'};
3227 
3228  GetDateTime(&oggi, &adesso, &today);
3229  //gettime(&adesso);
3230  //getdate(&oggi);
3231 
3232 
3233  sprintf(buff,"%s\\Param.ini", BIL.DFILEM.CONFIGDIREQUIPMENT);
3234 
3235 
3236  fs = fopen(buff, "w");
3237  if(fs == NULL)
3238  {
3239  MMessageDialog("DAS information", "Problems in opening file", " Ok ", NULL);
3240  return 1;
3241  }
3242 
3243 
3244  //sprintf(buff, "%s",EquipCode2Name(DAS.Paramini.EqType, "", streqtype ));
3245 
3246 
3247  sprintf(str, "###############################################\n");
3248  fprintf(fs,str);
3249  sprintf(str, "# Param.INI #\n");
3250  fprintf(fs,str);
3251 // sprintf(str, "# Main configuration file for %s #\n", EquipCode2Name(DAS.Paramini.EqType, "", streqtype ));
3252  sprintf(str, "# Main configuration file for %s #\n", CodeEq2Name(DAS.Paramini.EqType));
3253  fprintf(fs,str);
3254  sprintf(str, "# equipment #\n");
3255  fprintf(fs,str);
3256  sprintf(str, "###############################################\n");
3257  fprintf(fs,str);
3258  sprintf(str, "# ------------------------------------------- #\n");
3259  fprintf(fs,str);
3260  sprintf(str, "# by DanBo %02u/%02u/%d at %02u:%02u:%02u #\n", oggi.da_day,oggi.da_mon,oggi.da_year, adesso.ti_hour, adesso.ti_min,adesso.ti_min);
3261  fprintf(fs,str);
3262  sprintf(str, "# ------------------------------------------- #\n");
3263  fprintf(fs,str);
3264 
3265  sprintf(str, "# CCD Temp (°C) ----------------------------- #\n");
3266  fprintf(fs,str);
3267  sprintf(str, "%.1lf\n",DAS.Paramini.ITemp);
3268  fprintf(fs,str);
3269  sprintf(str, "# CCD Peltier Init Power X 10 (150 = %.1lf%%) #\n",(double) 15);
3270  fprintf(fs,str);
3271  sprintf(str, "%d\n",DAS.Paramini.CoolPw);
3272  fprintf(fs,str);
3273  sprintf(str, "# Optical Unit Target Temperature ------------#\n");
3274  fprintf(fs,str);
3275  sprintf(str, "%.1lf\n",DAS.Paramini.TPelt);
3276  fprintf(fs,str);
3277 
3278  sprintf(str, "# OMU Peltier Init Power X 10 (500 = %.1lf%%) #\n",(double) 50);
3279  fprintf(fs,str);
3280 
3281  sprintf(str, "%d\n", OMUTHR.PCPower);
3282  fprintf(fs,str);
3283 
3284  sprintf(str, "# CCD Window (xstart ys xend ye) -------------#\n");
3285  fprintf(fs,str);
3286  sprintf(str,"%d %d %d %d\n", DAS.Paramini.ccdXoff, DAS.Paramini.ccdYoff, DAS.Paramini.ccdWx, DAS.Paramini.ccdWy);
3287  fprintf(fs,str);
3288  sprintf(str, "# Vertical Binning ---------------------------#\n");
3289  fprintf(fs,str);
3290  sprintf(str,"%d\n", DAS.Paramini.VBin);
3291  fprintf(fs,str);
3292 
3293  sprintf(str, "# Max Exposure Time s (=0 --> free exposure) #\n");
3294  fprintf(fs,str);
3295  sprintf(str,"%.1lf\n", DAS.Paramini.maxtexp);
3296  fprintf(fs,str);
3297 
3298 
3299  sprintf(str, "###############################################\n");
3300  fprintf(fs,str);
3301 
3302  fclose(fs);
3303 
3304  if(CCD_SetupFlg)
3305  {
3306  CCD_SetupFlg = 0;
3307 
3308 
3309 // sprintf(buff, "%s\\%s.cfg", BIL.DFILEM.CONFIGDIREQUIPMENT, CodeEq2Name(DAS.Paramini.EqType));
3310 
3311  //Copy camera.cfg and rename in 'equipment'.cfg
3312  sprintf(buf, "copy %s\\camera.cfg %s", BIL.DFILEM.DIRDCL, BIL.DFILEM.CONFIGDIREQUIPMENT);
3313  er = system(buf);
3314  sprintf(buf, "ren %s\\camera.cfg %s.cfg", BIL.DFILEM.CONFIGDIREQUIPMENT, CodeEq2Name(DAS.Paramini.EqType));
3315  er = system(buf);
3316 
3317  sprintf(str,"The current parameters has been saved in '%s\\Param.ini' file\n The %s\\camera.cfg file was copied in %s folder and renamed as %s.cfg'.",
3318  BIL.DFILEM.DIRDCL,
3321  MMessageDialog("DAS information", str, " Ok ", NULL);
3322 
3323  }
3324  else
3325  {
3326  sprintf(str,"The current parameters has been saved in '%s\\Param.ini' file", BIL.DFILEM.CONFIGDIREQUIPMENT);
3327  MMessageDialog("DAS information", str, " Ok ", NULL);
3328 
3329  }
3330 
3331 
3332 
3334  //CCD and OMU Parameters
3335  if(DAS.Flag.exemode != DOASMODE )
3336  {
3337  sprintf(str, "%.1lf", DAS.Paramini.ITemp);
3339  sprintf(str,"%.1lf%%",(double)DAS.Paramini.CoolPw / 10);
3341  sprintf(str,"%.1lf", DAS.Paramini.TPelt);
3343  sprintf(str,"%d", DAS.Paramini.ccdXoff);
3345  sprintf(str,"%d", DAS.Paramini.ccdYoff);
3347  sprintf(str,"%d", DAS.Paramini.ccdWx);
3349  sprintf(str,"%d", DAS.Paramini.ccdWy);
3351  sprintf(str, "%d", DAS.Paramini.VBin);
3353  }
3354 
3355  return 0;
3356 
3357 
3358 
3359 }
gui Gui
Graphic User Interface Structure.
int PCPower
Power to the Peltier for Cooling.
int ccdWx
CCD X End.
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
int ccdXoff
CCD X Start.
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
char * CodeEq2Name(int code)
code Equipment to Name
Definition: Load.c:371
omuthr OMUTHR
void MObjectSetText(MOBJECT obj, const char *text)
int ccdWy
CCD Y End.
d_fileman DFILEM
Definition: bildef.h:257
char DIRDCL[_MAX_PATH]
Definition: bildef.h:210
int VBin
CCD Vertical Binning.
int CoolPw
CCD Init Power.
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
Definition: Dildef.h:240
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
das DAS
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
controlpanel ContrPanel
Control Panel Structure.
int CCD_SetupFlg
Definition: DAS_Spat.c:138
Definition: Dildef.h:234
double maxtexp
Maximum exposure time (used in Autorange())
int EqType
Spectrometer Type.
int ccdYoff
CCD Y Start.
double ITemp
CCD Target Temperature.
int exemode
Set the Execution MODE (Execution modes)
double TPelt
OMU Target Temperature.
bil BIL
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:

§ WriteSelColandSmoothed()

void WriteSelColandSmoothed ( int  mod,
FILE *  fd,
int  selcol 
)

write selected Column

Definition at line 1060 of file Save.c.

References AllocFloatMat(), bil::ANALYSIS, spectrumheader::ccdex, spectrumheader::ccdwx, D_PrintHMod(), DeallocFloatMat(), bil::DPLOT, doas::FFTFilter, IDX, IDY, d_view::ImatOrig, analize::ImatSmooth, doas::lambda, SmoothData(), and bil::SPH.

Referenced by SaveSpectrum().

1061 {
1062 
1063  int x, BlindPix_1;
1064 // FILE *fd;
1065 // fd = fopen(fname, "a");
1066 // if(fd < 0) return 1;
1067 // D_VRange("Column FORMAT processing", 0, 128, 254, 128);
1068 
1069  BlindPix_1 = 0;
1070  if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
1071  BlindPix_1 = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
1072 
1074 
1075 
1077 
1078  // Print on file the header
1079  D_PrintHMod(fd);
1080 
1081  for(x = 0; x < IDX - BlindPix_1 + 1; x++)
1082  {
1083 
1084  if(mod)
1085  fprintf(fd, " %9.4lf", DOAS.lambda[x]);
1086  else
1087  fprintf(fd, " %04u", x);
1088 // for(y = selcol; y < IDY; y++)
1089 // {
1090  fprintf(fd, " %05u %9.4lf", BIL.DPLOT.ImatOrig[selcol * IDX + x],BIL.ANALYSIS.ImatSmooth[selcol * IDX + x]);
1091 // }
1092  fprintf(fd, "\n", NULL);
1093 // if((x % 40) == 0 && x > 0)
1094 // D_VRange(NULL, (long) x * 100 / IDX, 128, 254, 128);
1095  }
1096  fprintf(fd, "\n", NULL);
1097 // fclose(fd);
1098 // D_VRange(NULL, 100, 128, 254, 128);
1099 // return 0;
1100 
1102 
1103 
1104 
1105 
1106 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int SmoothData(unsigned short *source, float *destination, int horpix, int verpix, int filw, int bp)
Calc. the smoothed matrix of an unsigned short one. .
Definition: Save.c:973
doas DOAS
Definition: Save.c:27
analize ANALYSIS
Definition: bildef.h:258
float * DeallocFloatMat(float *mat)
Definition: Spat_Plot.c:153
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
float * ImatSmooth
Definition: bildef.h:165
void D_PrintHMod(FILE *fff)
Print the header in Column format.
Definition: Save.c:790
unsigned short * ImatOrig
Definition: bildef.h:180
d_view DPLOT
Definition: bildef.h:254
double lambda[1055]
Wavelength series.
Definition: DOASdef.h:18
bil BIL
Definition: Save.c:26
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
int FFTFilter
Fast Fourier Trasform Filter windows.
Definition: DOASdef.h:25
float * AllocFloatMat(int hp, int vp)
Definition: Spat_Plot.c:2009
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ WriteStatusD()

void WriteStatusD ( int  w)

NOT Used
.

Definition at line 1331 of file RTC_Time.c.

1332 {
1333 /*
1334  int fc;
1335  char tit1[80];
1336 
1337  fc = open(flog, O_WRONLY | O_APPEND | O_TEXT, S_IWRITE);
1338  if(fc < 0) return;
1339 
1340  sprintf(tit1, CCD_Err[--w], w);
1341  write(fc, &tit1, strlen(tit1));
1342  close(fc);
1343 */
1344 }

§ WritewlstepiniCB()

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

Write wlstep.ini file
.

Returns
0 –> operation succefully performed; 1 –>problems in writing file

Definition at line 2476 of file DAS_Spat_ConfCBs.c.

References _MAX_PATH, d_fileman::CONFIGDIREQUIPMENT, date::da_day, date::da_mon, date::da_year, bil::DFILEM, GetDateTime(), MMessageDialog(), time::ti_hour, time::ti_min, wav, and wl.

Referenced by CONFP_param_page2().

2477 {
2478 
2479 
2480 
2481  FILE *fc;
2482  char str[160];
2483  struct time adesso;
2484  struct date oggi;
2485  char buff[_MAX_PATH];
2486  int i, nitem = 18;
2487  struct tm today;
2488 
2489  GetDateTime(&oggi, &adesso, &today);
2490  //gettime(&adesso);
2491  //getdate(&oggi);
2492 
2493 
2494  sprintf(buff,"%s\\WlStep.ini", BIL.DFILEM.CONFIGDIREQUIPMENT);
2495  fc = fopen(buff, "w");
2496 
2497 
2498  if(fc == NULL)
2499  {
2500  MMessageDialog("DAS information", "Problems in opening file", " Ok ", NULL);
2501  return 1;
2502  }
2503 
2504 
2505 
2506 
2507  sprintf(str, "####################################################\n");
2508  fprintf(fc,str);
2509  sprintf(str, "# WLSTEP.INI #\n");
2510  fprintf(fc,str);
2511  sprintf(str, "# Wavelengths <--> Steps #\n");
2512  fprintf(fc,str);
2513  sprintf(str, "####################################################\n");
2514  fprintf(fc,str);
2515  sprintf(str, "# ------------------------------------------------ #\n");
2516  fprintf(fc,str);
2517  sprintf(str, "# by DanBo %02u/%02u/%d at %02u:%02u:%02u #\n", oggi.da_day,oggi.da_mon,oggi.da_year, adesso.ti_hour, adesso.ti_min,adesso.ti_min);
2518  fprintf(fc,str);
2519  sprintf(str, "# ------------------------------------------------ #\n");
2520  fprintf(fc,str);
2521  sprintf(str, "%d\n", nitem);
2522  fprintf(fc,str);
2523  for (i=0;i<nitem;i++)
2524  {
2525  sprintf(str, "%d %d\n", wl[i], wav[i]);
2526  fprintf(fc,str);
2527  }
2528 
2529 
2530  fclose(fc);
2531 
2532  sprintf(str,"The current setting for Wavelength and stepper steps \n has been saved in '%s' file", buff);
2533  MMessageDialog("DAS information", str, " Ok ", NULL);
2534 
2535  return 0;
2536 
2537 
2538 
2539 }
d_fileman DFILEM
Definition: bildef.h:257
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
Definition: Dildef.h:240
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
Definition: Save.c:43
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
Definition: Dildef.h:234
long wav[]
Step Number definition - for SD_Grating.
Definition: DAS_Spat.c:195
bil BIL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

§ _shell000

MOBJECT _shell000

Definition at line 3052 of file DAS_Spatram.h.

Referenced by MDCreate_2DPlot().

§ AbsFilePos

long AbsFilePos

Absolute File position.

Definition at line 122 of file DAS_Spat.c.

Referenced by ViewNext(), and ViewNext_BIN().

§ ADTESTER

adtester ADTESTER

Definition at line 20 of file Chktemp.c.

Referenced by InitFlags().

§ b_c

§ b_label

MOBJECT b_label

Definition at line 3058 of file DAS_Spatram.h.

Referenced by DB_ChangeColorCellCB(), and MDCreateDASConfig().

§ b_sbar

MOBJECT b_sbar

§ BlindPix

int BlindPix

§ bold

int bold

Definition at line 88 of file DAS_Spat_Conf.c.

Referenced by DB_TestF(), and SetBoldCB().

§ CCD_SetupFlg

int CCD_SetupFlg

Definition at line 138 of file DAS_Spat.c.

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

§ cell_color

§ cell_drawa

MOBJECT cell_drawa

Definition at line 3058 of file DAS_Spatram.h.

§ cell_form

MOBJECT cell_form

Definition at line 3057 of file DAS_Spatram.h.

§ cell_label

MOBJECT cell_label

Definition at line 3057 of file DAS_Spatram.h.

Referenced by TextColorAssignCB().

§ CItem

int CItem

Definition at line 40 of file Load.c.

Referenced by DB_DefectPixCorr(), and E_CItm().

§ ContFP

int ContFP

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

DAS structure.

Definition at line 26 of file Chktemp.c.

Referenced by DAS_Error(), DB_Save(), DE_StepMotor(), DT_ColFormat(), MDCreateSh_PWD(), and WriteColumn().

§ 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().

§ data

unsigned int data[576]

Conversion data buffer 64 samples * 8 channels * 2 bytes.

§ DD_VOpen

int DD_VOpen[16]

Definition at line 151 of file Utils.c.

Referenced by D_VRangeSim(), SD_PosAADev(), SD_Position(), and SD_PosOMUDev().

§ DD_VRip

int DD_VRip[16]

Definition at line 150 of file Utils.c.

Referenced by D_VRangeSim().

§ ddmmyy

char ddmmyy[8]

Definition at line 38 of file RTC_Time.c.

Referenced by FormatData().

§ ddmmyyf

char ddmmyyf[6]

Definition at line 39 of file RTC_Time.c.

Referenced by FormatDataFile().

§ DeviceTypeInput

const char* DeviceTypeInput[]

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

Definition at line 247 of file DAS_Spat.c.

Referenced by CONFP_opt_page6().

§ DFONT

dfont DFONT

§ DFTP

dftp DFTP

Definition at line 49 of file DAS_Spat_Conf.c.

§ DGEO

d_geo DGEO

geographical coordinates structure

Definition at line 92 of file CreateForms.c.

§ DLOG

dlog DLOG

Definition at line 52 of file DAS_Spat.c.

Referenced by WriteLogAMS(), and writelogmotor().

§ DPAL

§ DPWD

dpwd DPWD

Danbo Passw.

Definition at line 79 of file CreateForms.c.

Referenced by ActPWDSysCB(), CloseConfigCB(), and MDCreateSh_PWD().

§ drawa

MOBJECT drawa

Definition at line 3053 of file DAS_Spatram.h.

§ drawarea_bgc

MTColor drawarea_bgc

Definition at line 3062 of file DAS_Spatram.h.

Referenced by CloseColPickCB(), ColorMapInputCB(), and MDCreateDASConfig().

§ dsave

dsave

§ e_fname

MOBJECT e_fname

Definition at line 3064 of file DAS_Spatram.h.

Referenced by DB_TestF(), and MDCreateDASConfig().

§ e_fsize

MOBJECT e_fsize

Definition at line 3064 of file DAS_Spatram.h.

Referenced by DB_TestF(), and MDCreateDASConfig().

§ env

char env[_MAX_PATH]

Environment path.

Definition at line 3075 of file DAS_Spatram.h.

Referenced by ChkExeMode().

§ ExMast

master ExMast[PRGMAXNUM]

Definition at line 55 of file DAS_Spat.c.

Referenced by D_AutoExecution().

§ FANFlg

int FANFlg

Definition at line 2970 of file DAS_Spatram.h.

Referenced by OMU_ChooseDir(), and ShutCB().

§ Fil_Code

char* Fil_Code[]

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[]

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[]

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[]

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[]

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().

§ FilSet

int FilSet

filter wheel position definition - for SD_FilterW

Definition at line 5992 of file CreateForms.c.

Referenced by DB_Fil_CB(), and DB_KeyB_CB().

§ FLAG

§ FlgBG

int FlgBG

§ FlgFG

int FlgFG

§ FlgOBJ

int FlgOBJ

Definition at line 93 of file DAS_Spat_Conf.c.

Referenced by ColObjCB(), ColorAssignCB(), and FontOBJSelCB().

§ FlgSM_Stop

int FlgSM_Stop

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().

§ font

MTFont font

Definition at line 3066 of file DAS_Spatram.h.

Referenced by CloseFontViewCB(), DB_TestF(), and DrawAreaExpFontCB().

§ frm3_dr1

MOBJECT frm3_dr1

Definition at line 3058 of file DAS_Spatram.h.

Referenced by ColorSaveCB(), DB_ChangeColorCellCB(), and MDCreateDASConfig().

§ FWS

§ g_c

§ g_label

MOBJECT g_label

Definition at line 3058 of file DAS_Spatram.h.

Referenced by DB_ChangeColorCellCB(), and MDCreateDASConfig().

§ g_sbar

MOBJECT g_sbar

§ GRS

GratingSt GRS

Grating.

Definition at line 82 of file CreateForms.c.

Referenced by HeaderInPlot(), and HomeGratingFast().

§ HGFlg

int HGFlg

Definition at line 2968 of file DAS_Spatram.h.

Referenced by D_Average(), D_AverageTFix(), DB_KeyB_CB(), HgLamp(), ShutCB(), and WinRes().

§ HomePosition

char* HomePosition[]

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

§ IDY

§ ImatDark

unsigned short* ImatDark

buffer for the dark image

Definition at line 3045 of file DAS_Spatram.h.

Referenced by DB_GetCCD(), and DB_InitCamera().

§ italic

int italic

Definition at line 89 of file DAS_Spat_Conf.c.

Referenced by DB_TestF(), and SetItalicCB().

§ KeyCode

const char* KeyCode[]

Definition at line 164 of file DAS_Spat.c.

Referenced by Fetch(), and MDCreatesh_vitesa().

§ label_fgc

MTColor label_fgc

Definition at line 3059 of file DAS_Spatram.h.

Referenced by TextColorAssignCB().

§ LevelDefPix

unsigned int LevelDefPix

Definition at line 126 of file DAS_Spat.c.

Referenced by ActEditCB(), and GetDefPix().

§ lfraz

char lfraz[6]

Definition at line 94 of file DAS_Spat_Conf.c.

Referenced by CONFP_AMS_TabSingMotor(), and listval2fraz().

§ MainCommand

int MainCommand

Command switch in main loop.

Definition at line 105 of file DAS_Spat.c.

Referenced by D_AutoExecution().

§ MaskedCol

int MaskedCol[100][6]

Masked column array.

Definition at line 38 of file Load.c.

Referenced by DB_DefectPixCorr(), and E_CItm().

§ MaskedPix

int MaskedPix[100][6]

Masked pixel's array.

Definition at line 37 of file Load.c.

Referenced by DB_DefectPixCorr(), and E_PItm().

§ MaskedRow

int MaskedRow[100][6]

Masked rows array.

Definition at line 39 of file Load.c.

Referenced by DB_DefectPixCorr(), and E_RItm().

§ Master

int Master

§ mattempbuff

unsigned int* mattempbuff

Definition at line 3009 of file DAS_Spatram.h.

§ Mige

mige Mige

§ Mir_Code

const char* Mir_Code[]

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[]

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().

§ MirSet

int MirSet

mirror position definition - for SD_Mirror

Definition at line 5612 of file CreateForms.c.

Referenced by DB_KeyB_CB(), and DB_Mir_CB().

§ MIS

§ MTCL

§ N_AVG

int N_AVG

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

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[]

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().

§ NDFilSet

int NDFilSet

ND filter wheel position definition - for SD_NDFilterW.

Definition at line 6231 of file CreateForms.c.

Referenced by DB_KeyB_CB(), and DB_NDFil_CB().

§ 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.

§ on

int on

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

§ PaletteMode

int PaletteMode

Definition at line 158 of file DAS_Spat.c.

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

§ PARAM

paramini PARAM

Param.ini.

Definition at line 90 of file CreateForms.c.

§ PeltFlg

int PeltFlg

Definition at line 2971 of file DAS_Spatram.h.

Referenced by OMU_AssignPow(), OMU_ChooseDir(), and ShutCB().

§ PItem

int PItem

Definition at line 40 of file Load.c.

Referenced by DB_DefectPixCorr(), and E_PItm().

§ PLColor

MTColor* PLColor[]

Definition at line 251 of file DAS_Spat.c.

§ PrgCnt

§ PrgNum

int PrgNum

Definition at line 96 of file DAS_Spat.c.

Referenced by SZA_FirstCalc().

§ PrgNumExe

int PrgNumExe

number of PRG file in execution

Definition at line 98 of file DAS_Spat.c.

Referenced by ChkMaster(), and D_AutoExecution().

§ PrgNumInM

int PrgNumInM

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

Length of PRG file (bytes)

Length of PRG file (bytes)

Definition at line 94 of file DAS_Spat.c.

Referenced by LoadExec(), and PRG_Check().

§ Program

§ QJFlg

int QJFlg

Definition at line 2969 of file DAS_Spatram.h.

Referenced by D_Average(), D_AverageTFix(), DB_KeyB_CB(), QjLamp(), ShutCB(), and WinRes().

§ r_c

§ r_label

MOBJECT r_label

Definition at line 3058 of file DAS_Spatram.h.

Referenced by DB_ChangeColorCellCB(), and MDCreateDASConfig().

§ r_sbar

MOBJECT r_sbar

§ 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().

§ RItem

int RItem

number of Pixel, Column, Row Item

Definition at line 40 of file Load.c.

Referenced by DB_DefectPixCorr(), and E_RItm().

§ SaveCnt

int SaveCnt

Definition at line 49 of file Procedures.c.

Referenced by D_Saving(), DB_HorComm_CB(), DB_KeyB_CB(), E_QjScan(), and ExMaster().

§ sel_cell

int sel_cell

Definition at line 3060 of file DAS_Spatram.h.

Referenced by ColorFreeCB(), and ColorMapInputCB().

§ sel_x

int sel_x

Definition at line 3060 of file DAS_Spatram.h.

Referenced by ColorMapExposeCB(), ColorMapInputCB(), and ColorMapResizeCB().

§ sel_y

int sel_y

Definition at line 3060 of file DAS_Spatram.h.

Referenced by ColorMapExposeCB(), ColorMapInputCB(), and ColorMapResizeCB().

§ Server

§ STEPM

stepm STEPM

Stepper Motors.

Definition at line 50 of file DAS_Spat.c.

§ SZADelta

§ SZAMax

int SZAMax

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

§ TMFlg

int TMFlg

Definition at line 2972 of file DAS_Spatram.h.

Referenced by D_BuildH(), DB_KeyB_CB(), and SD_FNTorqueM().

§ TOOLS

§ Total

int Total

Progressive acquisition number for file (MAX defined = 50)

Definition at line 34 of file Exec.c.

Referenced by D_Saving(), and SaveCalib().

§ TOTTEXP

int TOTTEXP

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().

§ TPelt

double TPelt

CCD Temperature.

§ UDPAL

undopal UDPAL

Definition at line 34 of file DAS_Spat_Conf.c.

§ wav

long wav[]

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().

§ wl

§ Wl_Code

const char* Wl_Code[]

const char array for the realisation of the wavelength buttons in the wavelength shell

§ 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().

______________________________________________________________________________________
Generated on Wed Sep 20 2017 10:32:20 for SPATRAM - Rel. 18/09/2017.