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

functions for DAS loading files . More...

#include <windows.h>
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "mgui.h"
#include "bil.h"
#include "DAS_Spatram.h"
#include "DOAS.h"
#include "dil.h"
+ Include dependency graph for Load.c:

Go to the source code of this file.

Functions

int AssignParam (int mod)
 Assign parameters to the CP labels.
. More...
 
char * CodeEq2Name (int code)
 code Equipment to Name
More...
 
int DFetch ()
 
void E_CItm ()
 
void E_Col ()
 
void E_DREM (void)
 
void E_PItm ()
 
void E_Pix ()
 
void E_RItm ()
 
void E_Row ()
 
char * ERR_Option (int ercode)
 Alerts for OPTION.INI errors
Creates a message window reporting the reasons for the error. More...
 
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...
 
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...
 
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)
 
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...
 
void ReadLine (char *buf, int nc, FILE *f)
 Read Line on a file
Read one record of nc character on the file f. More...
 
void sleep (clock_t wait)
 Pauses for a specified number of milliseconds.
. More...
 
void Status (char *tit)
 Writes information's on the Status label
. More...
 

Variables

char * ccdCorrKC [] = {{"DREM"}, {"PIX"}, {"PITM"}, {"COL"}, {"CITM"}, {"ROW"}, {"RITM"}, {"DEND"}}
 
int CItem
 
das DAS
 DAS structure. More...
 
dftp DFTP
 
d_geo DGEO
 geographical coordinates structure More...
 
doas DOAS
 
palette DPAL
 
long IsCnt
 
char IsFile [16]
 
long IsSiz
 
char * Istruction
 
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...
 
omuthr OMUTHR
 
paramini PARAM
 Param.ini. More...
 
int PItem
 
int RItem
 number of Pixel, Column, Row Item More...
 

Detailed Description

functions for DAS loading files .

Author
Daniele Bortoli

Definition in file Load.c.

Function Documentation

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

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

§ DFetch()

int DFetch ( )

Definition at line 87 of file Load.c.

References ccdCorrKC, CLEN, IsCnt, and Istruction.

Referenced by LoadDB_DefectPixel().

88 {
89  //Legge le parole chiave
90  char cmd[10];
91  int c;
92  sscanf(&Istruction[IsCnt], "%s", cmd);
93  for(c = 0; c < CLEN; c++)
94  if(strcmp(cmd, ccdCorrKC[c]) == 0)
95  break;
96 
97  if(c == CLEN)
98  return 0;
99  return(c + 1);
100 }
long IsCnt
Definition: Load.c:50
char * Istruction
Definition: Load.c:48
#define CLEN
char * ccdCorrKC[]
Definition: Load.c:44
+ Here is the caller graph for this function:

§ E_CItm()

void E_CItm ( )

Definition at line 135 of file Load.c.

References CItem, E_DREM(), IsCnt, Istruction, MaskedCol, das::Paramini, and paramini::VBin.

Referenced by LoadDB_DefectPixel().

136 {
137  int i, a, b, c, d, e;
138 
139  IsCnt += 4;
140  sscanf(&Istruction[IsCnt], "%d", &CItem);
141  E_DREM();
142  for (i=0; i<CItem;i++)
143  {
144 
145  sscanf(&Istruction[IsCnt], "%d%d%d%d%d", &a, &b, &c, &d, &e);
146  MaskedCol[i][0] = a;
147  MaskedCol[i][1] = (int) (b / DAS.Paramini.VBin);
148  MaskedCol[i][2] = (int) (c / DAS.Paramini.VBin);
149  MaskedCol[i][3] = d;
150  MaskedCol[i][4] = e;
151  E_DREM();
152  }
153 
154 }
int MaskedCol[100][6]
Masked column array.
Definition: Load.c:38
long IsCnt
Definition: Load.c:50
void E_DREM(void)
Definition: Load.c:79
char * Istruction
Definition: Load.c:48
das DAS
DAS structure.
Definition: Load.c:32
int VBin
CCD Vertical Binning.
int CItem
Definition: Load.c:40
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_Col()

void E_Col ( )

Definition at line 130 of file Load.c.

References E_DREM().

Referenced by LoadDB_DefectPixel().

131 {
132  E_DREM();
133 }
void E_DREM(void)
Definition: Load.c:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_DREM()

void E_DREM ( void  )

Definition at line 79 of file Load.c.

References IsCnt, and Istruction.

Referenced by E_CItm(), E_Col(), E_PItm(), E_Pix(), E_RItm(), E_Row(), and LoadDB_DefectPixel().

80 {
81  // Flush stringa
82 // if(ExeREM)
83  while(Istruction[IsCnt++] != 10);
84 }
long IsCnt
Definition: Load.c:50
char * Istruction
Definition: Load.c:48
+ Here is the caller graph for this function:

§ E_PItm()

void E_PItm ( )

Definition at line 108 of file Load.c.

References E_DREM(), IsCnt, Istruction, MaskedPix, and PItem.

Referenced by LoadDB_DefectPixel().

109 {
110  int i, a, b, c, d, e, f;
111 
112  IsCnt += 4;
113  sscanf(&Istruction[IsCnt], "%d", &PItem);
114  E_DREM();
115  for (i=0; i<PItem;i++)
116  {
117 
118  sscanf(&Istruction[IsCnt], "%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f);
119  MaskedPix[i][0] = a;
120  MaskedPix[i][1] = b; //(int) (b / DAS.Paramini.VBin);
121  MaskedPix[i][2] = c;
122  MaskedPix[i][3] = d;
123  MaskedPix[i][4] = e;
124  MaskedPix[i][5] = f;
125  E_DREM();
126  }
127 
128 }
long IsCnt
Definition: Load.c:50
void E_DREM(void)
Definition: Load.c:79
char * Istruction
Definition: Load.c:48
int PItem
Definition: Load.c:40
int MaskedPix[100][6]
Masked pixel&#39;s array.
Definition: Load.c:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_Pix()

void E_Pix ( )

Definition at line 103 of file Load.c.

References E_DREM().

Referenced by LoadDB_DefectPixel().

104 {
105  E_DREM();
106 }
void E_DREM(void)
Definition: Load.c:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ E_RItm()

void E_RItm ( )

Definition at line 159 of file Load.c.

References E_DREM(), IsCnt, Istruction, MaskedRow, das::Paramini, RItem, and paramini::VBin.

Referenced by LoadDB_DefectPixel().

160 {
161  int i, a, b, c, d, e;
162 
163  IsCnt += 4;
164  sscanf(&Istruction[IsCnt], "%d", &RItem);
165  E_DREM();
166  for (i=0; i<RItem;i++)
167  {
168 
169  sscanf(&Istruction[IsCnt], "%d%d%d%d%d", &a, &b, &c, &d, &e);
170  MaskedRow[i][0] = a;
171  MaskedRow[i][1] = b;
172  MaskedRow[i][2] = (int) (c / DAS.Paramini.VBin);
173  MaskedRow[i][3] = d; //(int) (d / DAS.Paramini.VBin);
174  MaskedRow[i][4] = e; //(int) (e / DAS.Paramini.VBin);
175  E_DREM();
176  }
177 }
int MaskedRow[100][6]
Masked rows array.
Definition: Load.c:39
long IsCnt
Definition: Load.c:50
void E_DREM(void)
Definition: Load.c:79
int RItem
number of Pixel, Column, Row Item
Definition: Load.c:40
char * Istruction
Definition: Load.c:48
das DAS
DAS structure.
Definition: Load.c:32
int VBin
CCD Vertical Binning.
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_Row()

void E_Row ( )

Definition at line 155 of file Load.c.

References E_DREM().

Referenced by LoadDB_DefectPixel().

156 {
157  E_DREM();
158 }
void E_DREM(void)
Definition: Load.c:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

§ 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()

void 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()

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

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

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

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

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

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

Variable Documentation

§ ccdCorrKC

char* ccdCorrKC[] = {{"DREM"}, {"PIX"}, {"PITM"}, {"COL"}, {"CITM"}, {"ROW"}, {"RITM"}, {"DEND"}}

Definition at line 44 of file Load.c.

Referenced by DFetch().

§ CItem

int CItem

Definition at line 40 of file Load.c.

Referenced by DB_DefectPixCorr(), and E_CItm().

§ DAS

das DAS

DAS structure.

Definition at line 32 of file Load.c.

§ DFTP

dftp DFTP

Definition at line 28 of file Load.c.

§ DGEO

d_geo DGEO

geographical coordinates structure

Definition at line 26 of file Load.c.

§ DOAS

doas DOAS

Definition at line 30 of file Load.c.

§ DPAL

palette DPAL

Definition at line 27 of file Load.c.

§ IsCnt

long IsCnt

Definition at line 50 of file Load.c.

Referenced by DFetch(), E_CItm(), E_DREM(), E_PItm(), E_RItm(), and LoadDB_DefectPixel().

§ IsFile

char IsFile[16]

Definition at line 49 of file Load.c.

§ IsSiz

long IsSiz

Definition at line 51 of file Load.c.

Referenced by LoadDB_DefectPixel().

§ Istruction

char* Istruction

Definition at line 48 of file Load.c.

Referenced by DFetch(), E_CItm(), E_DREM(), E_PItm(), E_RItm(), and LoadDB_DefectPixel().

§ 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().

§ OMUTHR

omuthr OMUTHR

Definition at line 33 of file Load.c.

§ PARAM

paramini PARAM

Param.ini.

Definition at line 24 of file Load.c.

§ PItem

int PItem

Definition at line 40 of file Load.c.

Referenced by DB_DefectPixCorr(), and E_PItm().

§ RItem

int RItem

number of Pixel, Column, Row Item

Definition at line 40 of file Load.c.

Referenced by DB_DefectPixCorr(), and E_RItm().

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