10 #include <sys/timeb.h> 115 Status(
"Home for Mirror..");
142 Status(
"Home for Grating...");
157 Status(
"Home for Filter Wheel...");
171 Status(
"Home for Zenith...");
187 Status(
"Home for Azimuth...");
214 Status(
"Home for NDFilter Wheel...");
305 void quick(
unsigned *elemento,
int conta)
382 Status(
"CCD Temperature");
418 Status(
"CCD Temperature");
451 Status(
"CCD Vertical Binning");
463 void PerformMeas(
int mod,
int ar,
double te,
int mt,
int sv,
int pl)
542 int l, f, m, a, d, s, g,
wl;
544 extern struct date dok;
547 int StsMir = 0, StsGrat = 0, StsFW = 0;
552 sscanf(&
Program[
PrgCnt],
"%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
616 int l, f, m, a, d, s, g,
wl;
620 extern struct date dok;
622 int StsMir = 0, StsGrat = 0, StsFW = 0;
624 sscanf(&
Program[
PrgCnt],
"%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
686 int l, f,
p, m, a, d, s, g;
690 sscanf(&
Program[
PrgCnt],
"%d%d%d%d%d%lf%d%d%d", &l, &f, &p, &m, &a, &t, &d, &s, &g);
709 Status(
"Getting CCD Image...");
738 for(c = 0; c < l / 100; c++)
787 int sts = 0, d, er = 0;
800 }
while(DXL.
bufrx[0] ==
'0' && DXL.
bufrx[1] ==
'0' && er == 0);
815 }
while(DXL.
bufrx[0] ==
'0' && DXL.
bufrx[1] ==
'0' && er == 0);
829 }
while(DXL.
bufrx[0] ==
'0' && DXL.
bufrx[1] ==
'0' && er == 0);
851 int l, f, m, a, d, s, g,
wl;
855 sprintf(str,
"%.01lf",
S_azim);
856 azi = (float)atof(str);
859 sprintf(str,
"%.01lf", (90 -
S_zenetr));
860 elev = (float)atof(str);
863 sscanf(&
Program[
PrgCnt],
"%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
914 int l, f, m, a, d, s, g,nf;
917 extern struct date dok;
921 int StsMir = 0, StsGrat = 0, StsFW = 0;
926 sscanf(&
Program[
PrgCnt],
"%d%d%d%d%d%lf%d%d%d", &m, &wl, &f, &nf, &a, &t, &d, &s, &g);
1001 int l, f, m, a, d, s, g,
wl;
1005 sscanf(&
Program[
PrgCnt],
"%d%d%d%lf%lf%d%lf%d%d%d", &m, &wl, &f, &z, &az, &a, &t, &d, &s, &g);
1063 int l, f, m, a, d, s, g;
1066 extern struct date dok;
1070 int StsMir = 0, StsGrat = 0, StsFW = 0;
1075 sscanf(&
Program[
PrgCnt],
"%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
1120 unsigned long t = 1000;
1158 unsigned long t = 500;
1215 sprintf(buf,
"For this Equipment the AMS is UNKNOWN\nPlease Contact DANBO!!!!");
1230 double Texp_temp = 0;
1231 double T1 = 0, T2 = 0;
1232 extern struct date dok;
1268 }
while((flagstatus) | (cont == 5));
1283 int l, f, m, a, d, s, g,
wl;
1285 extern struct date dok;
1288 int StsMir = 0, StsGrat = 0, StsFW = 0;
1293 sscanf(&
Program[
PrgCnt],
"%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
1373 int l, f, m, a, d, s, g;
1375 extern struct date dok;
1379 int StsMir = 0, StsGrat = 0, StsFW = 0;
1384 sscanf(&
Program[
PrgCnt],
"%d%d%d%d%lf%d%d%d", &m, &wl, &f, &a, &t, &d, &s, &g);
1491 Status(
"Home for Grating...");
1515 for (l=1; l<10; l++)
1526 Status(
"Autoranging...");
1528 Status(
"Getting CCD Image...");
1560 for (l=1; l<10; l++)
1571 Status(
"Autoranging...");
1573 Status(
"Getting CCD Image...");
1602 int l, f, m, a, d, s, g,
wl, nf;
1606 sprintf(str,
"%.01lf",
S_azim);
1610 sprintf(str,
"%.01lf", (90 -
S_zenetr));
1615 sscanf(&
Program[
PrgCnt],
"%d%d%d%d%d%lf%d%d%d", &m, &wl, &f, &nf, &a, &t, &d, &s, &g);
1686 int l, f, m, a, d, s, g,
wl, nf,k;
1690 sprintf(str,
"%.01lf",
S_azim);
1694 sprintf(str,
"%.01lf", (90 -
S_zenetr));
1699 sscanf(&
Program[
PrgCnt],
"%d%d%d%d%d%lf%d%d%d", &m, &wl, &f, &nf, &a, &t, &d, &s, &g);
1703 for(k=0; k<=360; k+=10)
stepm StepM
Stepper motors parameters structure.
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...
void MRefreshTimeout(TIMEOUT_ID *pid, CARD32 msec, TIMEOUT_CB cb, void *ud)
int SD_Grating(int ang)
Positioning Grating. The Grating move to the position specified by ang (Wavelength) ...
int SD_Mirror(int where)
Positioning Input Mirror. The Input Mirror reaches the position specified by where.
int ExtLamp(int mod)
change the status of the external lamp change the status of the external lamp (ON or OFF) through a r...
void HgLamp(int mod)
HG Lamp ON/OFF .
void E_Meashor2(void)
perform horizontal measurements (2) 1) measurement with external lamp 2) measurement without the exte...
int DB_InitCamera(int mod)
Initialize Camera Parameters. Procedure that initialize the CCD Camera.
void MLoopWhileEvents(int discard)
optionini DOption
Options for DAS execution.
int extlamp
0 = external lamp OFF; 1 = external lamp ON
#define AMS2
AMS2 address.
void E_Filter(void)
Filter Wheel positioning. Procedure for Filter Wheel positioning. All the E_xxxxx() function are used...
void SD_FNTorqueM(int mod)
Positioning NDFilter. .
void E_Hg_On(void)
HG ON. Hg lamp ON. All the E_xxxxx() function are used during the execution in PRG mode...
void E_Lambda(void)
Lambda Reading. When the WAVELEN key-word is encountred in the PRG file, the Wavelength code from PRG...
void E_IRefSun(void)
Io Measured near the sun. This procedure carries out a measurements for the reference spectrum used i...
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.
void E_DirectSun(void)
. All the E_xxxxx() function are used during the execution in PRG mode
int E_Home_SM4(void)
Home for SM4. Set the reference position for Stepper motor 4 (Neutral density filter wheel)...
void E_WAIT(void)
Delay Procedure. sleep the program . All the E_xxxxx() function are used during the execution in PRG ...
int HomeMirror(void)
Input Mirror in the reference Position. The Input Mirror reaches the reference Position.
C_DEF void DI_Regen(int s)
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
C_DEF double DI_ScanMaxMin(int w, float *mx, float *mi)
int Total
Progressive acquisition number for file (MAX defined = 50)
DXL structure. Structure for the serial communication with the AMS adapter.
int plotW
Flag for the plot display.
das structure (contain all the previous structures) .
int DXL_RxStr(char *rx, int *len)
receive string from a serial port
void E_Radio(void)
Radiometric Measurements. Procedure for Radiometric Measurements. All the E_xxxxx() function are used...
flag Flag
Structure for different flags.
void E_Meashor(void)
perform horizontal measurements (3) 1) measurement with external lamp 2) measurement without the exte...
void E_Label(void)
labeling. The text after the key-word is a label. All the E_xxxxx() function are used during the exec...
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
void D_Average(int mod)
Performs averaged measurements .
int SD_Zenith(float ang)
Positioning Zenith. The Zenith reaches the position specified by ang.
int slope[AMSMAX][2]
Stepper Motors Slope.
int SD_FilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
void quick(unsigned *elemento, int conta)
void E_Hg_Off(void)
HG OFF. Hg lamp OFF. All the E_xxxxx() function are used during the execution in PRG mode...
void E_AAPos(void)
alt Az Positioning. Available for SPATRAMPLUS and TROPOGAS (with the AltAzPlatform) ...
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
int HomeGratingFast(int mod)
(Fastest) Grating in the reference Position. The Grating reaches the reference Position. Similar to HomeGrating(void), but faster
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.
int E_Home_SM6(void)
Home for SM6. Set the reference position for Stepper motor 6 (MIGE Azimuth). All the E_xxxxx() functi...
int avgautor
autoranging for averaged measurement, 0 = NO AutoR before average; 1 = AutoR before average; ...
int E_Home_SM5(void)
Home for SM5. Set the reference position for Stepper motor 5 (MIGE Zenith). All the E_xxxxx() functio...
void MObjectSetText(MOBJECT obj, const char *text)
void QjLamp(int mod)
QJ Lamp ON/OFF .
void E_ExtLampON(void)
External lamp ON.
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.
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 ...
void MRemoveTimeout(TIMEOUT_ID id)
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
void D_Saving(void)
Saving image. Procedure for saving the CCD Image Used since version 2.1.0. The coiche between binary ...
void E_Azimuth(void)
Position Azimuth Axis.
char * Program
buffer for the PRG file
char bufrx[1024]
Rx buffer.
int add
Peripheral address.
void E_HgScan(void)
Check the full spectral range with HG ON. All the E_xxxxx() function are used during the execution in...
void E_Dark(void)
Execute Dark Measurement. Procedure for Dark Measurement. All the E_xxxxx() function are used during ...
void E_Qj_On(void)
Qj ON. QJ - Halogen - lamp ON. All the E_xxxxx() function are used during the execution in PRG mode...
int ADTempTest
= 0 -> AD Converter results on the Control Panel; = 1 -> AD Converter Testing Phase(results on the co...
#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.
int E_GetCCD(void)
Get CCD. Execute DB_GetCCD. All the E_xxxxx() function are used during the execution in PRG mode...
int AMS_MotorOn_Off(int id, int mtr1, int mtr2)
Motor ON-OFF. Switch On-Off the selected motor of the selected AMS.
void E_ExtLampOFF(void)
External lamp OFF.
long PrgCnt
Counter for the position in the PRG file.
int D_Calibra(void)
Spectral Calibration Procedure for the spectral calibration with HG lamp. Shift of HG spectral line a...
void E_DFMeasure(void)
Perform Measurement setting the ND Filter Wheel also. All the E_xxxxx() function are used during the ...
unsigned char OOP[AMSMAX]
2 byte Word for AMS Opto insulated Output Port Status
void E_SetCCDPow(void)
Set CCD Power. Set CCD Power. All the E_xxxxx() function are used during the execution in PRG mode...
void DB_DefectPixCorr(void)
Apply thew pixel correction. .
int VBin
CCD Vertical Binning.
paramini structure . It contains some of the parameters defined in the file PARAM.INI .
#define SPATRAM2
SPATRAM2 (with ATX power supply & HiresV)
int CoolPw
CCD Init Power.
int ViewPlot(int mod)
Create the plot shell. Procedure that build the plot shell for the data visualization.
#define SPATRAMPLUS
As SPATRAM plus AltAzimuth platform.
void Status(char *tit)
Writes information's on the Status label .
int ExtShutt(int mod)
change the status of the external shutter change the status of the external shutter (OPEN or CLOSED) ...
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
void E_Mirror(void)
Inpot Mirror positioning. Procedure for Input mirror positioning. All the E_xxxxx() function are used...
void E_SetCCDTemp(void)
Set CCD Temp. Set CCD Temp. All the E_xxxxx() function are used during the execution in PRG mode...
#define GRAT_TASK_TIME
Grating Home.
double AutoRange(int mod)
Calculate the exposure time The optimum exposure time (TExp) is calculated with an initial TExpAR=0...
int ADPC104
0 –> Device PC104 exist, 1 –> PC104 DOESN'T exist
void E_Average(void)
Averaged Measurements. Procedure for Averaged Measurements. All the E_xxxxx() function are used durin...
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
void E_Measure(void)
Perform Measurement. All the E_xxxxx() function are used during the execution in PRG mode...
int HomeFiltersFast(void)
(Fastest) Fliter wheel in the reference Position. The Fliter wheel reaches the reference Position...
#define SPATRAM3
SPATRAM3.
double TExp
CCD Exposure time.
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...
int E_Home_SM2(void)
Home for SM2. Set the reference position for Stepper motor 2 (Grating). All the E_xxxxx() function ar...
int AMS_wopto(int id, unsigned int w)
write the value on the optoinsulated port write the value on the optoinsulated port.
int E_Home_SM3(void)
Home for SM3. Set the reference position for Stepper motor 3 (Filter Wheel). All the E_xxxxx() functi...
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
void Radio(int g)
NOT Used .
void E_REM(void)
Flush string since the Carriege Return. Procedure for flushing the readed string since the Carriege R...
void GetDateTime(struct date *dp, struct time *tp, struct tm *when)
int wl[]
WaveLength definition - for SD_Grating.
int pixcorr
Flag to set defective pixel correction: 0=NOT Corrected, 1=Corrected.
void E_Expo(void)
Exposuring. Read the Exposure time from PRG file. All the E_xxxxx() function are used during the exec...
controlpanel ContrPanel
Control Panel Structure.
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...
void E_QjScan(void)
Check the full spectral range with QJ ON. All the E_xxxxx() function are used during the execution in...
void E_HGratCal(void)
Perform home grating and HG Calibration. All the E_xxxxx() function are used during the execution in ...
void E_Save(void)
Save Image. Procedure for saving image or data. All the E_xxxxx() function are used during the execut...
#define AMS1
AMS1 address.
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)...
void E_Almucantar(void)
. All the E_xxxxx() function are used during the execution in PRG mode
int speed[AMSMAX][2]
Stepper Motors Speed.
void E_Zenith(void)
Position Zenith Axis.
int step[AMSMAX][2]
Stepper Motors Step.
void E_SetCCDVBin(void)
Set CCD Vert Binn. Set CCD Vert Binn. All the E_xxxxx() function are used during the execution in PRG...
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...
void D_Plot(void)
ViewPlot callback .
void E_AutoRange(void)
Autoranging. Procedure for Autoranging. All the E_xxxxx() function are used during the execution in P...
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
void E_AAMeasure(void)
perform measurements with the Alt Azimuth Platform perform measurements with the Alt Azimuth Platform...
void E_SetCCDOffSet(void)
Set the CCD Offst (only for HIRES-V. All the E_xxxxx() function are used during the execution in PRG ...
int EqType
Spectrometer Type.
int HomeZenithFast(void)
Home for Zenith Axis.
void E_ExtShutClose(void)
Close External Shutter.
void E_AvgCCDHor(void)
Averaged Horizontal Measurements. Procedure for Averaged Measurements with external lamp...
void PerformMeas(int mod, int ar, double te, int mt, int sv, int pl)
Perform Averaged or single measurements.
int SD_NDFilterW(int filter)
Positioning Filter wheel. The filter wheel move on the filter number specified by filter...
void DXL_TxStr(char *tx, int len)
send string to a serial port
int extshutter
0 = external shutter open; 1 = external shutter closed
double ITemp
CCD Target Temperature.
void E_Qj_Off(void)
Qj OFF. QJ - Halogen - lamp OFF. All the E_xxxxx() function are used during the execution in PRG mode...
#define AMS3
AMS3 address.
OMU Thermoregulation structure .
int DB_GetCCD(int mod)
Get CCD Image. .
void E_Plot(void)
Plot Spectrum. Plot Spectrum. All the E_xxxxx() function are used during the execution in PRG mode...
int E_Home_SM1(void)
Home for SM1. Set the reference position for Stepper motor 1 (Input Mirror). All the E_xxxxx() functi...
int ReachTemp
Target Temperature status.
int power[AMSMAX][2]
Stepper Motors Power.
marconi Marconi
CCD Sensor struct.
paramini Paramini
structure for the parameters defined in param.ini configuration file
void E_ExtShutOpen(void)
Open External Shutter.