69 for(c = 0; c < 6; c++)
82 for(c = 0; c < 6; c++)
98 void __stdcall
ShowDown(
const char *str,
int port)
201 sprintf(buf,
"Path '%s' deos not exist,\nPlease create and fill ", buff);
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\ 241 er = WinExec(str, SW_SHOW);
256 sprintf(buf,
"%d", DC_CCD.
dx);
259 sprintf(buf,
"%d", DC_CCD.
dy);
297 DI_ImageProperties(
Server, (
U16)
IDX, (
U16)
IDY, (
U16)IDX, (
U16)IDY, 0, 0, NULL, 1, 100 / IDY, 0);
312 DI_ImageProperties(
Server, (
U16)IDX, (
U16)IDY, (
U16)IDX, (
U16)IDY, 0, 0, NULL, 1, 100 / IDY, 0);
373 mx = (
unsigned long)
IDX * (
unsigned long)
IDY;
374 ImatDark = (
unsigned short *) calloc( mx,
sizeof(
unsigned short));
379 DAS.
Marconi.
AVGmat = (
unsigned long *) calloc( mx,
sizeof(
unsigned long));
395 DI_ImageProperties(
Server, (
U16)
IDX, (
U16)
IDY, (
U16)IDX, (
U16)IDY, 0, 0, (
U16)NULL, 1, 100 / (
U16)IDY, 0);
416 DI_ImageProperties(
Server, (
U16)IDX, (
U16)IDY, (
U16)IDX, (
U16)IDY, 0, 0, NULL, 1, 100 / (
U16)IDY, 0);
472 unsigned long st, et, x;
481 sprintf(buf,
"%d", er);
486 sprintf(buf,
"%d", er);
497 D_VRange(NULL, (
long) x * 100 / tout, 255, 0, 0 );
498 sprintf(buf,
"%.1lf sec.", (
double)((
double)(labs(et - st) - tout)/1000.0 ));
501 }
while((labs(et - st) < tout));
505 sprintf(buf,
"%d", er);
525 unsigned long st, et, x;
602 D_VRange(NULL, (
long) x * 100 / tout, 255, 0, 0 );
659 D_VRange(NULL, (
long) x * 100 / tout, 255, 0, 0 );
700 sprintf(buf,
"%s",
"Homing");
702 Status(
"Home for Input Mirror...");
728 sprintf(buf,
"Homing Mirror");
754 er =
AMS_DoPos(AMS1, dir, 0, labs(count), 0);
755 if(er) {
Message(
"n Step not sent! 2", er); }
762 if(er) {
Message(
"No Zero Coord Mirror", er); }
772 Status(
"Home for Input Mirror..DONE");
783 int DIR[] = { 0, 0 };
786 int er, FlgGratPos = 1;
792 sprintf(buf,
"%s",
"Homing");
794 Status(
"Home for Grating...");
814 sprintf(buf,
"Homing Grating");
841 if(er) {
Message(
"No Zero Coord Grating", er); }
844 sprintf(buf,
"%d", 4358);
847 Status(
"Home for Grating..DONE");
860 unsigned long st, et, x;
862 sprintf(DXL.
buftx,
"*01000000");
882 D_VRange(
"Homing filter",0, 0, 0, 255);
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 ));
930 if(er) {
Message(
"No Zero Coord FW", er); }
933 sprintf(buf,
"%s",
"NULL");
936 Status(
"Home for Filter Wheel...DONE !");
948 unsigned long st, et, x;
950 sprintf(DXL.
buftx,
"*00000100");
970 D_VRange(
"Homing ND filter",0, 0, 192, 255);
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 ));
1018 if(er) {
Message(
"No Zero Coord ND FW", er); }
1021 sprintf(buf,
"%s",
"NULL");
1024 Status(
"Home for ND Filter Wheel...DONE !");
1146 int DIR[] = { 0, 0 };
1149 int er, d, FlgZenPos = 1,h = 0,k = 0;
1158 sprintf(buf,
"%s",
"Homing");
1160 Status(
"Home for Zenith...");
1162 st = GetTickCount();
1171 st = GetTickCount();
1189 sprintf(buf,
"Homing Zenith");
1211 if(er) {
Message(
"No Zero Coord Zenith", er); }
1219 sprintf(buf,
"%s",
"0.0");
1222 Status(
"Home for Zenith..DONE");
1235 int er, d, HomeOnGoing = 1;
1237 unsigned long st, et, x;
1240 sprintf(buf,
"%s",
"Homing");
1242 Status(
"Home for Azimuth...");
1244 st = GetTickCount();
1266 D_VRange(
"Homing Azimuth with Track(1)",0, 255, 0, 0);
1293 et = GetTickCount();
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 ));
1304 }
while (HomeOnGoing);
1319 D_VRange(
"Homing with tracking (2)",0, 255, 255, 0);
1320 st = GetTickCount();
1344 et = GetTickCount();
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 ));
1354 }
while (HomeOnGoing);
1375 if(er) {
Message(
"No Zero Coord Azimuth", er); }
1381 sprintf(buf,
"%.1lf %s", AST.
Pos,
"°N");
1384 Status(
"Home for Azimuth..DONE");
1391 int DB_InitAMS(
int nid,
int mod,
int powera,
int stepa,
int slopea,
int speeda,
int powerb,
int stepb,
int slopeb,
int speedb)
1405 sprintf(DXL.
buftx,
"-0000");
1417 d = atoi(DXL.
bufrx);
1418 l = strtol( DXL.
bufrx, &stopstring, 16 );
1447 if(nid == 0 && mod == 0)
1455 if(nid == 1 && mod == 0)
1464 if(nid == 0 && mod == 2)
1469 if(nid == 0 && mod == 3)
1474 if(nid == 1 && mod == 4)
1481 if(nid == 1 && mod == 7)
1488 if(nid == 2 && mod == 0)
1497 if(nid == 2 && mod == 5)
1502 if(nid == 2 && mod == 6)
1577 sprintf(buf,
"FPGA ID: %s", DXL.
bufrx);
1622 sprintf(buf,
"For this Equipment the COM Port is UNKNOWN\nPlease Contact DANBO!!!!");
1665 ans =
MMessageDialog(
"",
"Do you want to ENABLE the ALTAZIMUTH Platform ?",
"Yes",
"No", NULL);
int AMS_Divisore(int id, unsigned long par1, unsigned long par2)
stepm StepM
Stepper motors parameters structure.
#define SPATRAM
SPectrometer for Atmospheric TRAcers Measurements - CGE-UE Portugal.
gui Gui
Graphic User Interface Structure.
U32 FDL_PCI_Index
(R/W) Index selector of all available FDL-PCI. 0 - 7 range.
MOBJECT LedSM[AMSMAX][2]
Leds for stepper motors status.
int HomeGratingFast(int mod)
(Fastest) Grating in the reference Position. The Grating reaches the reference Position. Similar to HomeGrating(void), but faster
void MRefreshTimeout(TIMEOUT_ID *pid, CARD32 msec, TIMEOUT_CB cb, void *ud)
double firmrev[AMSMAX]
Firmware Revision.
int D_Homing(MOBJECT p, int id, int sm, int tout)
int IDX
Number of sensible horizontal pixels.
MOBJECT Albl_LS[8]
Active Control Panel Labels for LIS status.
MOBJECT MCreatePixmapFromFile(MOBJECT parent, const char *fname)
int AMS_Slope(int id, int slopea, int slopeb)
Set slope to the Stepper motors Procedure for setting the slope fot the Stepper Motors.
void MLoopWhileEvents(int discard)
optionini DOption
Options for DAS execution.
#define AMS2
AMS2 address.
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
char buftx[1024]
Tx buffer.
#define TESTCCD
execution for testing CCD Camera
void MShellRealize(MOBJECT obj)
void D_VRange(char *str, int val, int, int g, int b)
Create and display the status bar.
void __stdcall DD_VRange(const char *str, int perc, int Port)
int HomeFiltersFast(void)
(Fastest) Fliter wheel in the reference Position. The Fliter wheel reaches the reference Position...
int AMS_TrackOn(int id, int adir, int bdir, unsigned long acount, unsigned long bcount)
Activate tracking Procedure for Stepper Motor tracking activation.
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.
Stepper motors parameters structure .
C_DEF void DI_Regen(int s)
int SM_A
Motor A (su Y11) respectively: ID=0->InputMirror,ID=1->FilterWheel,ID=2->Zenith.
int HomeNDFiltersFast(void)
(Fastest) ND Fliter wheel in the reference Position. The ND Fliter wheel reaches the reference Positi...
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...
DXL structure. Structure for the serial communication with the AMS adapter.
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
das structure (contain all the previous structures) .
int DXL_RxStr(char *rx, int *len)
receive string from a serial port
U32 CCDType
(R/W) Used CCD CCD code definitions
#define TESTSZAMODE
execution driven by SZAPRG file
DXL_par DXL
DXL structure.
#define DOASMODE
execution for DOAS Processing
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.
int Pos
Mirror Current Position.
flag Flag
Structure for different flags.
char HOMEDIRECTORY[_MAX_PATH]
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 .
#define DBDEMO
execution in demo mode
int Offset[16]
Offset of the hardware devices (Input Mirror (5), Grating, Filter Wheel...)
void CBExpo(MOBJECT p, void *od, void *ad)
Close the Exposure shell and stop the image acquisition.
int slope[AMSMAX][2]
Stepper Motors Slope.
#define READ_DATA
Read data.
int AMS_Step(int id, int stepa, int stepb)
Set stepping for the Stepper motors Procedure for setting steps for the Stepper Motors.
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
char * CodeEq2Name(int code)
code Equipment to Name
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.
C_DEF int DI_CloseImage(int s)
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.
spectrumheader SPH
Spectrum Header Structure.
#define PTF_INFO
R/W ptf internal library structure.
#define TEMPORIZED
execution driven by MASTER file
int DB_InitCOM(int comn)
Init selected COM port.
float multiplier[AMSMAX][2]
multiplier, > 0 multiplier, < 0 demultiplier
#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 HomeZenithFast(void)
Home for Zenith Axis.
int Pos
Filter Wheel current Position.
int GRATHOME
Home for Grating ID.
#define CCDHANDLE
Enable background activity.
void Task_HomeGrat(TIMEOUT_ID id, void *data)
Home grating Task. 5) Check for reached end-run of the stepper motor for the grating ...
NoMangle int DLL_IMPORT_EXPORT SioReset(int, int, int)
#define LIS_
Lampedusa Island Spectrometer - ENEA.
short unsigned U16
2 byte without sign, range 0-65535
C_DEF void DI_OpenDigit(void)
int Wl
Grating Wavelength.
int AMS_TestHome(int id, int par1)
verify if the home position has been reached
#define CCD_INFO
R/W ccd internal library structure.
int HomeAzimFast(void)
Home for Azimuth Axis.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
MOBJECT LblExpP[7]
Label for presetted time exposure.
char bufrx[1024]
Rx buffer.
MOBJECT MDCreateExpo(char *tit)
Create Exposure/countdown shell. Procedure that build the Exposure/countdown shell during the calcula...
int add
Peripheral address.
#define FDOUBLE
double filter wheel
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 ...
int AMS_HomeDefault(int id, int mota, int motb)
int DB_InitMotor(int mod)
Initialize AMS. Procedure that initialize the parameters for the AMS's devices.
#define OFFLINEPLOT
execution for archived data visualisation
unsigned short * ImatDark
buffer for the dark image
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
void MObjectSetBackgroundImageFile(MOBJECT obj, const char *fname, int mode)
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.
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/...
int DXL_Close(void)
Close COM.
CTYPE void DLL DC_BrkFlg(int camera)
#define SPATRAMPLUS
As SPATRAM plus AltAzimuth platform.
unsigned long divider[AMSMAX][2]
Divider for the frequency.
char CONFIGDIREQUIPMENT[_MAX_PATH]
void Status(char *tit)
Writes information's on the Status label .
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 GRAT_TASK_TIME
Grating Home.
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
stepm STEPM
Stepper Motors.
#define PRGFILE
execution driven by *.prg file
MOBJECT MCreateColForm(MOBJECT parent)
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...
int IDY
Number of sensible vertical pixels.
void __stdcall ShowDown(const char *str, int port)
Shows the countdown. Procedure for the visualisation of the countdown.
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
MOBJECT MCreateShell(const char *title, int flags)
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
void ComErrors(int w)
Alerts for COM errors Creates a message window reporting the number of the error. ...
int DXL_Open(int addr, int com, int baud)
Open COM.
C_DEF void DI_RunHisto(void)
void Message(char *str, int er)
Create a message shell for the AMS errors (Debug Use). .
#define SPATRAM3
SPATRAM3.
CTYPE int DLL DC_Status(int Camera)
Return the status of the last operations performed on the camera. This procedure allows you to check ...
int AMS_Speed(int id, int speeda, int speedb)
Set speed to the Stepper motors Procedure for setting speed for the Stepper Motors.
C_DEF int DI_Init(int mod)
int DB_InitCamera(int mod)
Initialize Camera Parameters. Procedure that initialize the CCD Camera.
#define SZAMODE
execution driven by SZAPRG file
int SD_Zenith_H(float ang)
int SM_B
Motor B (su Y12) respectively: ID=0->Grating,ID=1->Not Connected,ID=2->Azimuth.
CTYPE void DLL DC_SetPathName(char *Path)
Set the pathname for all dcl files.
#define CELSIUS
Return CCD temperature in Celsius.
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.
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.
controlpanel ContrPanel
Control Panel Structure.
int AMS_TrackOff(int id, int amot, int bmot)
tracking off Procedure for Stepper Motor tracking de-activation
void AMS_Error(int w)
Alerts for AMS errors Creates a message window reporting the number of the error. ...
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...
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
int HomeMirror(void)
Input Mirror in the reference Position. The Input Mirror reaches the reference Position.
void MFormSetSpacing(MOBJECT p, int offset)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
#define AMS1
AMS1 address.
int AMS_chkbitsts(int id, int bitn)
check bit status Procedure for the determination of the bit number status.
int speed[AMSMAX][2]
Stepper Motors Speed.
ptf DC_HP
Platform settings.
int step[AMSMAX][2]
Stepper Motors Step.
C_DEF void DI_WriteDigit(MOBJECT *pix, char *fmt)
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
int DB_InitDil(void)
Initialize DIL. Procedure that initialize the DTA Imaging library.
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...
int AMS_dirfin(int id, int dira, int dirb)
Set Final Directions .
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.
int com
Comunication port.
unsigned short * AllocUSMat(int hp, int vp)
CTYPE double DLL DC_GetPower(int Camera)
Return current cooler power. Procedure that allows you to read the power (%) of the cooler currently ...
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
double Pos
Azimuth Current Position.
U32 Platform
(R/W) Platform code Camera platform definitions
int HomeTrack(char *buf, int id, int sm, int mode)
int DB_CloseCOM(void)
Close the previously opened COM port.
C_DEF int DI_FileExist(char *tit)
double Pos
Zenith Current Position.
MOBJECT MCreatePixmapFromData(MOBJECT parent, MIMAGE data)
float SMfraz(int t)
denominator value of the stepping ratio
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...
void DXL_TxStr(char *tx, int len)
send string to a serial port
MOBJECT MCreateImagePButtonExt(MOBJECT parent, const char *npf, const char *apf, const char *upf, const char *non, const char *aon, const char *uon)
double ITemp
CCD Target Temperature.
MOBJECT LblExpD[7]
Label for time exposure countdown.
int AMSPres
AMS Presence: 0 = AMS FOUND; 1 = AMS NOT FOUND.
int exemode
Set the Execution MODE (Execution modes)
FilterWheelSt FWS
Filter Wheel.
#define AMS3
AMS3 address.
#define TESTAMS
execution for testing AMS's devices
#define TEMPHANDLE
Temperature control enabled.
#define MANUAL
execution in manual mode (for lab use)
C_DEF int DI_OpenImage(U16 dx, U16 dy, U16 ifmt, U16 type, char *tit)
char DEFPIXFILENAME[_MAX_PATH]
defective pixel filename with path
int power[AMSMAX][2]
Stepper Motors Power.
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 ...
paramini Paramini
structure for the parameters defined in param.ini configuration file