DAS
3.1.6 - 18/09/2017
|
module to handle spectrometer DEVICES. More...
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <io.h>
#include <math.h>
#include <sys\stat.h>
#include <time.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include "mgui.h"
#include "DAS_Spatram.h"
#include "dcl.h"
#include "dxl.h"
Go to the source code of this file.
Functions | |
void | AMS_PWM_Zero (int mod) |
void | FANECU (int mod) |
FAN ON/OFF . More... | |
void | FANPeltier (int mod) |
FAN ON/OFF . More... | |
void | HgLamp (int mod) |
HG Lamp ON/OFF . More... | |
void | HiresPS (int mod) |
Hires Power Supply ON/OFF . 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 | Peltier (int mod) |
Peltier ON/OFF . More... | |
void | PeltierPS (int mod) |
Peltier Power Supply ON/OFF . More... | |
void | QjLamp (int mod) |
QJ Lamp ON/OFF . More... | |
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) |
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... | |
void | WriteLogAMS (int id, int dira, int dirb, unsigned long stepa, unsigned long stepb) |
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... | |
Variables | |
AzimuthSt | AST |
das | DAS |
DAS structure. More... | |
DXL_par | DXL |
flag | FLAG |
flags structure More... | |
GratingSt | GRS |
Grating. More... | |
ZenithSt | ZST |
module to handle spectrometer DEVICES.
Definition in file Spat_Device.c.
void AMS_PWM_Zero | ( | int | mod | ) |
Definition at line 2570 of file Spat_Device.c.
References AMS2, AMS_wopto(), ChkDigIO(), delay(), stepm::OOP, and das::StepM.
Referenced by OMU_DoPeltPow().
void FANECU | ( | int | mod | ) |
FAN ON/OFF
.
mod |
|
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().
void FANPeltier | ( | int | mod | ) |
FAN ON/OFF
.
mod |
|
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().
void HgLamp | ( | int | mod | ) |
HG Lamp ON/OFF
.
mod |
|
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().
void HiresPS | ( | int | mod | ) |
Hires Power Supply ON/OFF
.
mod |
|
Definition at line 2532 of file Spat_Device.c.
References AMS1, AMS_wopto(), stepm::OOP, and das::StepM.
Referenced by InitCCD_AMS(), and ShutCB().
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.
void Peltier | ( | int | mod | ) |
Peltier ON/OFF
.
mod |
|
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().
void PeltierPS | ( | int | mod | ) |
Peltier Power Supply ON/OFF
.
mod |
|
Definition at line 2551 of file Spat_Device.c.
References AMS1, AMS_wopto(), stepm::OOP, and das::StepM.
Referenced by InitCCD_AMS(), and ShutCB().
void QjLamp | ( | int | mod | ) |
QJ Lamp ON/OFF
.
mod |
|
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().
int SD_Azimuth | ( | float | ang, |
float | raz | ||
) |
Positioning Azimuth.
The Zenith reaches the position specified by ang.
ang= | mechanical angle |
raz= | real azimuth angle |
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().
int SD_FilterW | ( | int | filter | ) |
Positioning Filter wheel.
The filter wheel move on the filter number specified by filter.
See also Filter Wheel page.
filter |
|
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().
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().
int SD_Grating | ( | int | ang | ) |
Positioning Grating.
The Grating move to the position specified by ang (Wavelength)
ang | –> int from 0 to 14 –> grating position –> Wavelength |
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().
int SD_Mirror | ( | int | where | ) |
Positioning Input Mirror.
The Input Mirror reaches the position specified by where.
where | –> int from 0 to 3 –> grating position –> Wavelength |
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().
int SD_NDFilterW | ( | int | filter | ) |
Positioning Filter wheel.
The filter wheel move on the filter number specified by filter.
See also Filter Wheel page.
filter |
|
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().
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().
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().
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().
int SD_Zenith | ( | float | ang | ) |
Positioning Zenith.
The Zenith reaches the position specified by ang.
ang |
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().
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().
int SM_stepr | ( | int | t | ) |
AMS 'steps/round' value return the AMS 'steps/round' value (microstepping) depending on the setted step fractioning.
t | = fraction |
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().
float SMfraz | ( | int | t | ) |
denominator value of the stepping ratio
t | value of microstepping (0 to 13) |
Definition at line 129 of file Spat_Device.c.
Referenced by ActMvAzimCB(), ActMvZenCB(), and HomeMirror().
void WriteLogAMS | ( | int | id, |
int | dira, | ||
int | dirb, | ||
unsigned long | stepa, | ||
unsigned long | stepb | ||
) |
Definition at line 299 of file Spat_Device.c.
References DXL_par::bufrx, DXL_par::buftx, DLOG, and dlog::fsmlog.
Referenced by SD_PosAADev(), SD_Position(), and SD_PosOMUDev().
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.
mod |
|
id_motore |
|
k | = er |
d | = direction:
|
steps | = number of steps |
ams_id | = AMS address:
|
Definition at line 48 of file Spat_Device.c.
References DXL_par::bufrx, DXL_par::buftx, DLOG, and dlog::fsmlog.
Referenced by AMS_DoPos().
AzimuthSt AST |
Definition at line 25 of file Spat_Device.c.
das DAS |
DAS structure.
Definition at line 27 of file Spat_Device.c.
DXL_par DXL |
Definition at line 17 of file Spat_Device.c.
flag FLAG |
flags structure
Definition at line 19 of file Spat_Device.c.
GratingSt GRS |
Grating.
Definition at line 22 of file Spat_Device.c.
ZenithSt ZST |
Definition at line 24 of file Spat_Device.c.