DAS  3.1.6 - 18/09/2017
Functions | Variables
Bil.h File Reference
#include "bildef.h"
+ Include dependency graph for Bil.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

float * AllocFloatMat (int hp, int vp)
 
unsigned short * AllocUSMat (int hp, int vp)
 
void CloseFile (FILE *fd, int hp, int vp)
 
void D_DoLens (MIMAGE lensmim, MOBJECT lensdraw, int lenswx, int lenswy, int lenspix, int sx, int sy)
 
void D_Lens (void)
 
void D_pbr_CB (MOBJECT p, void *od, void *ad)
 
void D_VRange (char *str, int val, int, int g, int b)
 Create and display the status bar. More...
 
void DB_AreaInput (MOBJECT obj, MEvent *pe, void *a_data)
 
float * DeallocFloatMat (float *mat)
 
unsigned short * DeallocUSMat (unsigned short *mat)
 
int DrawAreaExposeCB (MOBJECT obj, MEvent *pexp, void *a_data)
 
int FilterData (unsigned short *mat, int horpix, int verpix, int filw, int bp)
 
void GrafoIMG (int mode)
 
void InitImage (MIMAGE img, int xd, int yd, int rb, int gb, int bb)
 
MOBJECT MDCreateFM_Shell (int mod, int fmt)
 
int PrintObject (MOBJECT obj, int mode, int x, int y)
 
void SetupPrinter (void)
 
int ViewNext (FILE *nf)
 
int ViewNext_BIN (int nf)
 
int Visualizza (int mod, char *nomefile)
 
int WhoSys (void)
 

Variables

bil BIL
 
int maxploth
 
int maxplotw
 
double NColors
 
MTFont newfont
 
int NFDATI
 
FILE * NUMFDATI
 
omutemp OMUTEMP
 structure for OMU temperatures More...
 
viewformobj VFO
 

Function Documentation

§ AllocFloatMat()

float* AllocFloatMat ( int  hp,
int  vp 
)

Definition at line 2009 of file Spat_Plot.c.

Referenced by BrowseLog(), BuildLogRatio(), InitTempAD(), RunLogMode(), and WriteSelColandSmoothed().

2010 {
2011 
2012  unsigned long mx;
2013  float *mat;
2014  mx = (unsigned long) hp * (unsigned long) vp;
2015  mat = (float *) calloc( mx, sizeof(float));
2016 // if(mat == NULL ) //Only for malloc
2017 // return 1;
2018 
2019  return mat;
2020 
2021 }
+ Here is the caller graph for this function:

§ AllocUSMat()

unsigned short* AllocUSMat ( int  hp,
int  vp 
)

Definition at line 1994 of file Spat_Plot.c.

Referenced by DatOrBinFormat(), DB_CalcFluxI(), DB_Column(), DB_InitCamera(), DrawAreaPlotCB(), DT_CorrFileEvora(), DT_CorrHeader(), LoadIo(), SaveIo(), and Visualizza().

1995 {
1996 
1997  unsigned long mx;
1998  unsigned short *mat;
1999  mx = (unsigned long) hp * (unsigned long) vp;
2000  mat = (unsigned short *) calloc( mx, sizeof(unsigned short));
2001 // if(mat == NULL ) //Only for malloc
2002 // return 1;
2003 
2004  return mat;
2005 
2006 }
+ Here is the caller graph for this function:

§ CloseFile()

void CloseFile ( FILE *  fd,
int  hp,
int  vp 
)

Definition at line 1304 of file Spat_Plot.c.

References spectrumheader::ccdnr, viewformobj::cmdpb, ContFP, DB_CloseImage(), DeallocUSMat(), DOASMODE, das::DOption, bil::DPLOT, flag::exemode, Fitem, das::Flag, optionini::hlineafter, optionini::hlinebefore, d_view::ImatGraf, d_view::ImatOrig, MMenuItemSetSensitive(), MMenuItemSetUnsensitive(), MObjectSetSensitive(), MObjectSetText(), MObjectSetUnsensitive(), MObjectUnmap(), MShellDestroy(), MShellSetTitle(), MShellUnrealize(), OFFLINEPLOT, d_view::pbr, d_view::RowShell, viewformobj::selallpb, Server, bil::SPH, bil::VFO, viewformobj::View_Sh, and viewformobj::YScalePB.

Referenced by D_PButt_CB(), MenuFileOLP_CB(), and ViewNext().

1305 {
1306 
1307  int i;
1308 
1309 
1310  fclose(fd); //Close Data file
1311 
1312 
1313 // MObjectSetBackgroundRGB(BIL.DPLOT.drawapl, 0, 0, 0);
1314 
1315  if(BIL.DPLOT.RowShell != 0)
1316  {
1319  BIL.DPLOT.RowShell = 0;
1322 
1323  }
1324  else
1325  {
1326  for (i=DAS.DOption.hlinebefore; i < BIL.SPH.ccdnr - DAS.DOption.hlineafter; i++)
1327  MObjectUnmap(BIL.DPLOT.pbr[i]);
1330 
1331 
1332  }
1333 
1334  MShellSetTitle(BIL.VFO.View_Sh,"PLOTTING File: None");
1335 
1336 
1337  MObjectSetText(BIL.VFO.cmdpb[0], "Open");
1338  MObjectSetSensitive(BIL.VFO.cmdpb[0]); //Set Button "Open" Sensitive
1339  MObjectSetUnsensitive(BIL.VFO.cmdpb[1]); //Set button "Next" Unsensitive
1340  MObjectSetUnsensitive(BIL.VFO.cmdpb[8]); //Set button "Previuos" Unsensitive
1341  MObjectSetUnsensitive(BIL.VFO.cmdpb[3]); // Set "CloseFile" button as Unsensitive
1342  MObjectSetUnsensitive(BIL.VFO.cmdpb[4]); // Set "Print" button as Unsensitive
1345  MObjectSetSensitive(BIL.VFO.cmdpb[5]); //Set Button "CloseWin" Sensitive
1346  MObjectSetUnsensitive(BIL.VFO.cmdpb[2]); // Set "Set as Io" button as Unsensitive
1347 
1348  if( (!DAS.Flag.exemode == OFFLINEPLOT) | (!DAS.Flag.exemode == DOASMODE))
1349  {
1352  }
1353 
1354  if (ContFP)
1355  ContFP = 0;
1356 
1357 
1358  if(DAS.Flag.exemode == OFFLINEPLOT )
1359  {
1367  }
1368  else if(DAS.Flag.exemode == DOASMODE)
1369  {
1376 
1377  }
1378 
1379 
1380 }
MOBJECT selallpb
Definition: bildef.h:68
MOBJECT YScalePB
Definition: bildef.h:70
MOBJECT cmdpb[10]
Definition: bildef.h:69
int Server
Definition: DAS_Spat.c:253
optionini DOption
Options for DAS execution.
void MObjectSetUnsensitive(MOBJECT obj)
int ContFP
Counter for File position.
Definition: DAS_Spat.c:123
das DAS
DAS structure.
Definition: Spat_Plot.c:39
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
MOBJECT pbr[256]
Definition: bildef.h:170
void MShellUnrealize(MOBJECT obj)
int DB_CloseImage(int s)
Definition: Spat_Plot.c:1257
void MObjectSetText(MOBJECT obj, const char *text)
void MShellDestroy(MOBJECT obj)
int hlinebefore
Number of HiddenLines before the central line in Plot.
#define OFFLINEPLOT
execution for archived data visualisation
unsigned short * ImatOrig
Definition: bildef.h:180
d_view DPLOT
Definition: bildef.h:254
unsigned short * DeallocUSMat(unsigned short *mat)
Definition: Spat_Plot.c:145
void MMenuItemSetSensitive(MENU_ITEM item)
MENU_ITEM Fitem[6]
Definition: Spat_Plot.c:46
MOBJECT View_Sh
Definition: bildef.h:35
int hlineafter
Number of HiddenLines after the central line in Plot.
void MMenuItemSetUnsensitive(MENU_ITEM item)
unsigned short * ImatGraf
Definition: bildef.h:176
void MObjectUnmap(MOBJECT obj)
bil BIL
Definition: Spat_Plot.c:35
MOBJECT RowShell
Definition: bildef.h:171
void MShellSetTitle(MOBJECT obj, const char *title)
viewformobj VFO
Definition: bildef.h:255
void MObjectSetSensitive(MOBJECT obj)
int exemode
Set the Execution MODE (Execution modes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_DoLens()

void D_DoLens ( MIMAGE  lensmim,
MOBJECT  lensdraw,
int  lenswx,
int  lenswy,
int  lenspix,
int  sx,
int  sy 
)

Definition at line 29 of file D_Zoom.c.

References BIL, bil::BLENS, mtcl::blue, bil::DPLOT, d_view::Imax, blens::Imim, d_view::Imin, maxploth, MDrawBox(), MDrawImage(), MDrawLine(), MImageGetPixelRGB(), MImageSetPixelRGB(), MInstallImage(), MTCL, MUninstallImage(), and p.

Referenced by D_LensResizeCB(), D_LensZoom(), D_To_DoLens(), and DB_AreaInput().

30 {
31 
32  int l, h, p, d, md, x, y, wx, wy, ox, oy, px, py;
33  double dd;
34  int dred, dgreen, dblu;
35  sx++; sy++;
36  wx = lenswx / lenspix;
37  wy = lenswy / lenspix;
38  h= BIL.DPLOT.Imax;
39  l= BIL.DPLOT.Imin;
40 
41  p = lenspix;
42  d = h - l;
43  dd = d /= 256;
44  // If less then 256 levels
45  // inc range
46  if(d == 0)
47  {
48  md = 1;
49  dd = (double) (h - l) / 256.0;
50  if(dd == 0)
51  {
52  md = 0;
53  dd = d = 1;
54  }
55  }
56  for(y = sy - wy / 2; y < sy + wy / 2; y++)
57  {
58 
59 
60 // ma = &DPLOT.Graf[(long) y * maxplotw];
61 
62  for(x = sx - wx / 2; x < sx + wx / 2; x++)
63  {
64  if(x >= 0 && x < maxplotw && y >= 0 && y < maxploth)
65  {
66  MImageGetPixelRGB(BIL.BLENS.Imim, x, y, &dred, &dgreen, &dblu);
67  }
68  ox = (long) (x - (sx - wx / 2)) * p;
69  oy = (long) (y - (sy - wy / 2)) * p;
70  for(py = 0; py < p; py++)
71  for(px = 0; px < p; px++)
72  MImageSetPixelRGB(lensmim, ox + px, oy + py, dred, dgreen, dblu);
73  }
74  }
75 
76  MInstallImage(lensmim);
77  MDrawImage(lensdraw, lensmim, 0, 0, wx * p, wy * p, 0, 0);
78  MUninstallImage(lensmim);
79 
80  sx = wx / 2 * p - p;
81  sy = wy / 2 * p - p;
82  MDrawBox(lensdraw, wx / 2 * p - p, wy / 2 * p - p, p, p, MTCL.blue);
83 
84  // Y line
85  MDrawLine(lensdraw, sx + p / 2, sy - 30, sx + p / 2, sy, MTCL.blue);
86  MDrawLine(lensdraw, sx + p / 2, sy + p, sx + p / 2, sy + 30 + p, MTCL.blue);
87 
88  // X Line
89  MDrawLine(lensdraw, sx - 30, sy + p / 2, sx, sy + p / 2, MTCL.blue);
90  MDrawLine(lensdraw, sx + p + 30, sy + p / 2, sx + p, sy + p / 2, MTCL.blue);
91 
92 }
mtcl MTCL
Definition: 2DPlot.c:30
MIMAGE Imim
Definition: bildef.h:14
MTColor blue
void MDrawLine(MOBJECT p, int x1, int y1, int x2, int y2, MTColor col)
unsigned int Imax
Definition: bildef.h:177
unsigned int Imin
Definition: bildef.h:178
d_view DPLOT
Definition: bildef.h:254
void MImageSetPixelRGB(MIMAGE pmi, int x, int y, int r, int g, int b)
void MDrawBox(MOBJECT p, int x, int y, int w, int h, MTColor bgc)
int maxploth
Definition: Spat_Plot.c:51
void MInstallImage(MIMAGE data)
bil BIL
Definition: 2DPlot.c:28
static double p
Definition: SOLPOS.C:131
void MDrawImage(MOBJECT p, MIMAGE gi, int pm_x, int pm_y, int w, int h, int x, int y)
blens BLENS
Definition: bildef.h:252
void MUninstallImage(MIMAGE data)
void MImageGetPixelRGB(MIMAGE pmi, int x, int y, int *pr, int *pg, int *pb)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_Lens()

void D_Lens ( void  )

Definition at line 138 of file D_Zoom.c.

References BIL, bil::BLENS, D_LensCloseCB(), D_LensResizeCB(), D_LensZoom(), D_To_DoLens(), False, HELV_SMALL, lbl, blens::LensDraw, blens::LensLbl, blens::LensLblX, blens::LensLblY, blens::LensMim, blens::LensON, blens::LensPix, LensShell, blens::LensWx, blens::LensWy, MAllocImage(), Maxx, MAXZOOM, MCreateColForm(), MCreateDrawArea(), MCreateLabel(), MCreateRowForm(), MCreateScrollBar(), MCreateShell(), MDrawAreaSetExposeCallback(), MDrawAreaSetResizeCallback(), MGetScreenWidth(), MObjectSetBackgroundRGB(), MObjectSetResize(), MObjectSetShadow(), MScrollBarSetPos(), MScrollBarSetPosCallback(), MShellRaise(), MShellRealize(), MShellSetWMCloseCallback(), newfont, SBT_HOR, SF_NO_MAXIMIZE, SF_NO_MINIMIZE, True, and WS_NONE.

Referenced by D_PButt_CB(), and MenuToolsOLP_CB().

139 {
140  MOBJECT a, b, lbl, sb;
141  MTFont newfont;
142 
143  newfont = HELV_SMALL; //MLoadFont("Times", 16, False, False);
144 
145  if(BIL.BLENS.LensON)
146  {
148  return;
149  }
150 
152  MObjectSetBackgroundRGB(LensShell, 64, 68, 72);
153 
155  MObjectSetShadow(a, WS_NONE, 0, 0);
156  MObjectSetBackgroundRGB(a, 128, 128, 128);
157 
158  Maxx = MGetScreenWidth();
159  BIL.BLENS.LensWx = Maxx / 4;
160 
161  BIL.BLENS.LensPix = 2;
162 
164 
167 
171 
172  b = MCreateColForm(a);
173  MObjectSetBackgroundRGB(b, 184, 132, 0);
174 
175  lbl = MCreateLabel(b, "X:", newfont);
176  MObjectSetBackgroundRGB(lbl, 255,255,255);
177  MObjectSetResize(lbl, False, True);
178 // MObjectSetForegroundRGB(lbl, );
179 
180  BIL.BLENS.LensLblX = MCreateLabel(b, " 0000 ", newfont);
183 // MObjectSetForegroundRGB(LensLblX, );
184 
185  lbl = MCreateLabel(b, "Y:", newfont);
186  MObjectSetBackgroundRGB(lbl, 255,255,255);
187 // MObjectSetForegroundRGB(lbl, );
188  BIL.BLENS.LensLblY = MCreateLabel(b, "0000", newfont);
190 // MObjectSetForegroundRGB(LensLblY, );
191 
192  BIL.BLENS.LensLbl = MCreateLabel(b, "ZOOM = 2", newfont);
195 
196 
197  b = MCreateColForm(a);
198 // MObjectSetBackgroundRGB(b, );
199 
200  sb = MCreateScrollBar(a, SBT_HOR, 0, MAXZOOM);
201  MScrollBarSetPos(sb, 0);
202  MScrollBarSetPosCallback(sb, D_LensZoom, (void *) 0);
203  MObjectSetBackgroundRGB(sb, 184, 132, 0);
204 // MObjectSetForegroundRGB(sb, );
205 
208  BIL.BLENS.LensON = 1;
209 }
MTFont newfont
Definition: CreateForms.c:95
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
#define WS_NONE
Definition: Mguidefs.h:956
unsigned int Maxx
Definition: D_Zoom.c:18
MOBJECT lbl
Definition: DFileMan.c:42
MIMAGE LensMim
Definition: bildef.h:12
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
void MShellRealize(MOBJECT obj)
#define SF_NO_MAXIMIZE
Definition: Mguidefs.h:1034
MOBJECT LensLblY
Definition: bildef.h:11
int LensPix
Definition: bildef.h:9
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
#define False
Definition: Mguidefs.h:236
void D_LensZoom(MOBJECT o, MVALUE o_data, void *a_data)
Definition: D_Zoom.c:94
#define SF_NO_MINIMIZE
Definition: Mguidefs.h:1036
void MDrawAreaSetResizeCallback(MOBJECT obj, DRAWAREA_PREF_CB cb, void *ad)
MOBJECT LensShell
Definition: D_Zoom.c:16
void D_LensResizeCB(MOBJECT obj, DRAWAREA_PREF *pref, void *ad)
Definition: D_Zoom.c:115
void D_LensCloseCB(MOBJECT p, void *od, void *ad)
Definition: D_Zoom.c:129
#define HELV_SMALL
Definition: Mguidefs.h:881
unsigned char LensON
Definition: bildef.h:8
MOBJECT MCreateScrollBar(MOBJECT parent, int type, long n, long max)
int MTFont
Definition: Mguidefs.h:175
void MScrollBarSetPos(MOBJECT p, long pos)
#define SBT_HOR
Definition: Mguidefs.h:1139
void(* OBJ_EVENT_CB)(MOBJECT obj, MEvent *e, void *ad)
Definition: Mguidefs.h:1456
MOBJECT MCreateDrawArea(MOBJECT parent, int width, int height)
MOBJECT MCreateColForm(MOBJECT parent)
void MDrawAreaSetExposeCallback(MOBJECT obj, OBJ_EVENT_CB cb, void *ad)
MOBJECT MCreateShell(const char *title, int flags)
void D_To_DoLens(void)
Definition: D_Zoom.c:111
void MShellRaise(MOBJECT obj)
bil BIL
Definition: 2DPlot.c:28
int MGetScreenWidth(void)
void * MOBJECT
Definition: Mguidefs.h:192
blens BLENS
Definition: bildef.h:252
#define True
Definition: Mguidefs.h:235
MOBJECT LensDraw
Definition: bildef.h:11
MIMAGE MAllocImage(int img_w, int img_h, int nplanes)
int LensWx
Definition: bildef.h:10
MOBJECT LensLblX
Definition: bildef.h:11
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
MOBJECT MCreateRowForm(MOBJECT parent)
#define MAXZOOM
Definition: bildef.h:20
int LensWy
Definition: bildef.h:10
void MScrollBarSetPosCallback(MOBJECT p, OBJ_VALUE_CB cb, void *data)
MOBJECT LensLbl
Definition: bildef.h:11
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_pbr_CB()

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

Definition at line 717 of file Spat_Plot.c.

References d_view::actimg, mtcl::black, bil::BLENS, BlindPix, paramini::ccdWx, paramini::ccdXoff, d_view::COSTX, d_view::COSTY, D_AssignOrigin(), D_findmaxmin(), D_PlotAxis(), D_PlotGrid(), D_PlotOneLine(), das::DOption, bil::DPLOT, d_view::drawapl, d_view::eX, d_view::eY, FLAG, tools::FlagFilter, optionini::hlineafter, optionini::hlinebefore, IDX, IDY, d_view::ImatGraf, d_view::ImatOrig, d_view::Imax, blens::Imim, d_view::Imin, doas::lambda, viewformobj::lblX, MTCL, d_view::oX, d_view::oY, das::Paramini, d_view::pbr, Pix2Wl(), mtcl::PLColor, flag::plotYRange, PoslblX(), PoslblY(), bil::SPH, TOOLS, bil::VFO, spectrumheader::wavelen, and flag::Wl.

Referenced by MD_CreateBRowShell(), PButtSelAll_CB(), and ViewPlot().

718 {
719  int q = (int) ad;
720 // int t;
721 
722  //Assign limits to the Drawing coordinates
724  //Plot the axes
726  //Plot grid
728 
729 
730  if(FLAG.plotYRange)
731  {
732  if(TOOLS.FlagFilter)
733  {
734  //Find Max & Min of the spectrum (BIL.DPLOT.Imax & BIL.DPLOT.Imin)
736  }
737  else
738  {
739  //Find Max & Min of the spectrum (BIL.DPLOT.Imax & BIL.DPLOT.Imin)
741  }
742  }
743  else
744  {
745  BIL.DPLOT.Imax = 65535;
746  BIL.DPLOT.Imin = 0;
747  }
748 
749 
750  if(FLAG.Wl == 0) //Pixel X Scale
751  {
752  //Positioning of X labels
753  PoslblX(BIL.VFO.lblX, 1, IDX, 0);
754  }
755  else if(FLAG.Wl == 1) //Wavelength X scale [A]
756  {
757  //CalcSpectrumLimits(0, BIL.SPH.wavelen, DAS.Paramini.ccdXoff, DAS.Paramini.ccdWx + 1, 512);
759 
760  //Positioning of X labels
761  PoslblX(BIL.VFO.lblX, (int)DOAS.lambda[0], (int)DOAS.lambda[IDX - 1], BIL.SPH.wavelen);
762  }
763  else if(FLAG.Wl == 2) //Pixel X Scale [nm]
764  {
765  //CalcSpectrumLimits(0, BIL.SPH.wavelen, DAS.Paramini.ccdXoff, DAS.Paramini.ccdWx + 1, 512);
767  //Positioning of X labels
768  PoslblX(BIL.VFO.lblX, (int)(DOAS.lambda[0]/10), (int)(DOAS.lambda[IDX - 1]/10), BIL.SPH.wavelen/10);
769  }
770  //Positioning of Y labels
772 
773 /**********************/
774 /* Costruzione grafico dei dati ********************/
775  if(BIL.DPLOT.actimg[q])
776  {
780  BIL.DPLOT.oY, BlindPix);
781  BIL.DPLOT.actimg[q] = 0;
782  }
783  else
784  {
788  BIL.DPLOT.oY, BlindPix);
789  BIL.DPLOT.actimg[q] = 1;
790  }
791 
792 }
flag FLAG
Definition: CreateForms.c:84
mtcl MTCL
Definition: 2DPlot.c:30
MIMAGE Imim
Definition: bildef.h:14
double COSTX
Definition: bildef.h:181
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
optionini DOption
Options for DAS execution.
double COSTY
Definition: bildef.h:181
das DAS
DAS structure.
Definition: Spat_Plot.c:39
int Wl
Flag for the units on the X scale plot.
unsigned int Imax
Definition: bildef.h:177
MTColor black
int ccdWx
CCD X End.
int oY
Definition: bildef.h:183
int ccdXoff
CCD X Start.
void PoslblY(unsigned int l, unsigned int h)
Definition: Spat_Plot.c:575
int oX
Definition: bildef.h:183
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
MOBJECT pbr[256]
Definition: bildef.h:170
unsigned int Imin
Definition: bildef.h:178
MOBJECT lblX[17]
Definition: bildef.h:47
int hlinebefore
Number of HiddenLines before the central line in Plot.
unsigned short * ImatOrig
Definition: bildef.h:180
d_view DPLOT
Definition: bildef.h:254
double lambda[1055]
Wavelength series.
Definition: DOASdef.h:18
void PoslblX(MOBJECT lbl, int xs, int xe, int xc)
Definition: Spat_Plot.c:516
void D_PlotAxis(MOBJECT ob, MIMAGE mim, int sx, int sy, int ex, int ey, MTColor col)
Definition: Spat_Plot.c:448
int plotYRange
0 –> full range; 1 –> min/max
doas DOAS
Definition: Spat_Plot.c:37
int actimg[256]
Definition: bildef.h:175
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
int Pix2Wl(int mod, int pos, int spix, int epix, struct doas *pd)
Definition: DOAS.c:26
int eX
Definition: bildef.h:183
int FlagFilter
flag for filterinf
int hlineafter
Number of HiddenLines after the central line in Plot.
void D_PlotOneLine(int n, int sel, MOBJECT obj, MOBJECT pb[], MIMAGE mim, unsigned short plotmat[], int idx, int idy, unsigned long pe[], double costx, double costy, int min, int max, int ox, int oy, int bp)
Definition: Spat_Plot.c:669
unsigned short * ImatGraf
Definition: bildef.h:176
int eY
Definition: bildef.h:183
MTColor PLColor[264]
int D_findmaxmin(unsigned short plotmat[], int xinf, int xsup, int yinf, int ysup, int bp)
Definition: Spat_Plot.c:635
bil BIL
Definition: Spat_Plot.c:35
blens BLENS
Definition: bildef.h:252
viewformobj VFO
Definition: bildef.h:255
void D_AssignOrigin(MOBJECT obj)
Definition: Spat_Plot.c:432
void D_PlotGrid(MOBJECT ob, MIMAGE mim, int sx, int sy, int ex, int ey)
Definition: Spat_Plot.c:476
int BlindPix
Number of blind pixels (usefull for Dark Current)
Definition: DAS_Spat.c:120
MOBJECT drawapl
Definition: bildef.h:172
tools TOOLS
Definition: CreateForms.c:81
paramini Paramini
structure for the parameters defined in param.ini configuration file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_VRange()

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

Create and display the status bar.

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

Definition at line 206 of file Utils.c.

Referenced by AMS_DoPos(), D_Homing(), D_Positioning(), DB_Column(), DB_MirrorX(), DB_ScanMaxMin(), DemoInitMotor(), EleDatOrBinFormat(), HomeAzimFast(), HomeFiltersFast(), HomeNDFiltersFast(), and HomeTrack().

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

§ DB_AreaInput()

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

Definition at line 203 of file Spat_Plot.c.

References bil::BLENS, d_view::COSTX, d_view::COSTY, D_DoLens(), DOASMODE, bil::DPLOT, E_BUTTON_PRESS, E_BUTTON_RELEASE, E_MOTION, E_SELECT, E_WINDOW_ENTER, E_WINDOW_EXIT, flag::exemode, FLAG, das::Flag, d_view::ImatGraf, doas::lambda, blens::LensDraw, blens::LensLbl, blens::LensLblX, blens::LensLblY, blens::LensMim, blens::LensON, blens::LensPix, blens::LensWx, blens::LensWy, blens::LocX, blens::LocY, MDrawXorBox(), MDrawXorLine(), MObjectGetHeight(), MObjectGetWidth(), MObjectSetText(), MObjectShell(), MEvent::mouse, OFFLINEPLOT, p, blens::Pix, blens::S_LocX, blens::S_LocY, MMouseEvent::state, MEvent::type, bil::VFO, flag::Wl, MMouseEvent::x, X2Counts(), viewformobj::xincr, viewformobj::xloc, MMouseEvent::y, Y2Counts(), viewformobj::yincr, and viewformobj::yloc.

Referenced by ViewPlot().

204 {
205  static int x1, y1, x2, y2, dx, dy;
206  static int xp1, xp2, xp3, yp1, yp2, yp3, p, pol;
207  char buff[128];
208  static int s, f;
209 // int c;
210  MOBJECT shell;
211 
212  switch (pe->type)
213  {
214 
215  case E_SELECT:
216 
217  break;
218  case E_WINDOW_EXIT:
219 
220  break;
221  case E_BUTTON_PRESS:
222  break;
223  case E_WINDOW_ENTER:
224  case E_MOTION:
225  shell = MObjectShell(obj);
226  // Drag di un vertice del poligono
227  if((pe->mouse.state & Button1Mask) && pol)
228  {
229  if(pol == 2)
230  {
231  MDrawXorLine(obj, xp1, yp1, xp2, yp2);
232  MDrawXorLine(obj, xp1, yp1, xp3, yp3);
233  }
234  pol = 2;
235  xp1 = pe->mouse.x;
236  yp1 = pe->mouse.y;
237 
238  }
239  else
240  {
241  if((pe->mouse.state & Button1Mask) && x1 > 0 && f)
242  {
243  /*
244  * Erase the old line and draw the new one
245  * while dragging the mouse (draw in Xor mode)
246  */
247  if(f == 2)
248  MDrawXorBox(obj, x1, y1, (x2 - x1), (y2 - y1));
249  f = 2;
250  MDrawXorBox(obj, x1, y1, (pe->mouse.x - x1), (pe->mouse.y - y1));
251  }
252  // Drag the box
253  if((pe->mouse.state & Button3Mask) && f == 4)
254  {
255  // Clear previous box
256  MDrawXorBox(obj, x1, y1, (x2 - x1), (y2 - y1));
257  x1 += (pe->mouse.x - dx); x2 += (pe->mouse.x - dx);
258  y1 += (pe->mouse.y - dy); y2 += (pe->mouse.y - dy);
259  MDrawXorBox(obj, x1, y1, (x2 - x1), (y2 - y1));
260  dx = pe->mouse.x;
261  dy = pe->mouse.y;
262  }
263  else
264  {
265 // MDrawXorBox(obj, x2 - 25, y2 - 25, 50, 50);
266 
267  x2 = pe->mouse.x;
268  BIL.BLENS.LocX = x2 / (int) BIL.BLENS.Pix;
269  y2 = pe->mouse.y;
270  BIL.BLENS.LocY = y2 / (int) BIL.BLENS.Pix;
271 
272 // MDrawXorBox(obj, LocX[s] - 25, LocY[s] - 25, 50, 50);
273  if(BIL.BLENS.LocX >= 0 && BIL.BLENS.LocX < (unsigned int) MObjectGetWidth(obj) &&
274  BIL.BLENS.LocY >= 0 && BIL.BLENS.LocY < (unsigned int) MObjectGetHeight(obj) )
275  {
276  if( (!DAS.Flag.exemode == OFFLINEPLOT) | (!DAS.Flag.exemode == DOASMODE))
277  {
278 
279  if(BIL.DPLOT.ImatGraf != 0)
280  {
281 
282  if(FLAG.Wl == 0)
283  {
285  sprintf(buff, "%5d", BIL.BLENS.S_LocX);
286  MObjectSetText(BIL.VFO.xloc, buff);
287 
288  sprintf(buff, "Dx = %.2lf", BIL.DPLOT.COSTX);
289  MObjectSetText(BIL.VFO.xincr, buff);
290  }
291  else if(FLAG.Wl == 1)
292  {
293  BIL.BLENS.S_LocX = (unsigned int)DOAS.lambda[X2Counts(BIL.BLENS.LocX)];
294  sprintf(buff, "%.1lf",DOAS.lambda[X2Counts(BIL.BLENS.LocX)] );
295  MObjectSetText(BIL.VFO.xloc, buff);
296 
297  sprintf(buff, "Dx = %.2lf", BIL.DPLOT.COSTX);
298  MObjectSetText(BIL.VFO.xincr, buff);
299  }
300  else if(FLAG.Wl == 2)
301  {
302  BIL.BLENS.S_LocX = (unsigned int)DOAS.lambda[X2Counts(BIL.BLENS.LocX)];
303  sprintf(buff, "%.2lf",DOAS.lambda[X2Counts(BIL.BLENS.LocX)]/10 );
304  MObjectSetText(BIL.VFO.xloc, buff);
305 
306  sprintf(buff, "Dx = %.2lf", BIL.DPLOT.COSTX);
307  MObjectSetText(BIL.VFO.xincr, buff);
308  }
309 
310 
312  sprintf(buff, "%5u", BIL.BLENS.S_LocY);
313  MObjectSetText(BIL.VFO.yloc, buff);
314 
315  sprintf(buff, "Dy = %.2lf", BIL.DPLOT.COSTY);
316  MObjectSetText(BIL.VFO.yincr, buff);
317 
318  }
319  }
320 
321  if(BIL.BLENS.LensON)
322  {
324  sprintf(buff, "%5d, Wl: %.2lf", BIL.BLENS.S_LocX, DOAS.lambda[BIL.BLENS.S_LocX]);
326 
327  //Wavelength
328  //sprintf(buff, "%5d", DOAS.lambda[BIL.BLENS.S_LocX]);
329  //MObjectSetText(BIL.BLENS.LensLblWl, buff);
330 
332  sprintf(buff, "%5u", BIL.BLENS.S_LocY);
334 
335  sprintf(buff, "DY=%5u", (int) BIL.DPLOT.COSTY);
337 
339 
340  }
341 
342  }
343  }
344  }
345 
346  break;
347  case E_BUTTON_RELEASE:
348  break;
349  }
350 }
flag FLAG
Definition: CreateForms.c:84
#define E_BUTTON_RELEASE
Definition: Mguidefs.h:276
unsigned int LocX
Definition: bildef.h:15
double COSTX
Definition: bildef.h:181
MOBJECT yincr
Definition: bildef.h:67
MIMAGE LensMim
Definition: bildef.h:12
void MDrawXorLine(MOBJECT p, int x1, int y1, int x2, int y2)
double COSTY
Definition: bildef.h:181
MOBJECT LensLblY
Definition: bildef.h:11
das DAS
DAS structure.
Definition: Spat_Plot.c:39
int Wl
Flag for the units on the X scale plot.
int LensPix
Definition: bildef.h:9
int MObjectGetHeight(MOBJECT obj)
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
void MObjectSetText(MOBJECT obj, const char *text)
unsigned int S_LocX
Definition: bildef.h:15
MMouseEvent mouse
Definition: Mguidefs.h:832
int MObjectGetWidth(MOBJECT obj)
MOBJECT MObjectShell(MOBJECT obj)
#define E_BUTTON_PRESS
Definition: Mguidefs.h:275
void D_DoLens(MIMAGE lensmim, MOBJECT lensdraw, int lenswx, int lenswy, int lenspix, int sx, int sy)
Definition: D_Zoom.c:29
#define OFFLINEPLOT
execution for archived data visualisation
d_view DPLOT
Definition: bildef.h:254
unsigned char LensON
Definition: bildef.h:8
MOBJECT xloc
Definition: bildef.h:64
double lambda[1055]
Wavelength series.
Definition: DOASdef.h:18
MOBJECT yloc
Definition: bildef.h:63
doas DOAS
Definition: Spat_Plot.c:37
unsigned int S_LocY
Definition: bildef.h:15
unsigned short * ImatGraf
Definition: bildef.h:176
void MDrawXorBox(MOBJECT p, int x, int y, int w, int h)
static double p
Definition: SOLPOS.C:131
unsigned int LocY
Definition: bildef.h:15
bil BIL
Definition: Spat_Plot.c:35
void * MOBJECT
Definition: Mguidefs.h:192
blens BLENS
Definition: bildef.h:252
viewformobj VFO
Definition: bildef.h:255
double Pix
Definition: bildef.h:16
#define E_SELECT
Definition: Mguidefs.h:287
MOBJECT LensDraw
Definition: bildef.h:11
unsigned int state
buttons and key modifiers mask
Definition: Mguidefs.h:620
MOBJECT xincr
Definition: bildef.h:66
#define E_MOTION
Definition: Mguidefs.h:277
int LensWx
Definition: bildef.h:10
MOBJECT LensLblX
Definition: bildef.h:11
#define E_WINDOW_ENTER
Definition: Mguidefs.h:278
int type
Definition: Mguidefs.h:829
int x
pointer x, y coordinates in event window
Definition: Mguidefs.h:616
int LensWy
Definition: bildef.h:10
int exemode
Set the Execution MODE (Execution modes)
MOBJECT LensLbl
Definition: bildef.h:11
#define E_WINDOW_EXIT
Definition: Mguidefs.h:279
int X2Counts(int x)
Definition: Spat_Plot.c:178
unsigned int Y2Counts(int y)
Definition: Spat_Plot.c:190
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DeallocFloatMat()

float* DeallocFloatMat ( float *  mat)

Definition at line 153 of file Spat_Plot.c.

Referenced by WriteSelColandSmoothed().

154 {
155  free(mat);
156  mat = 0;
157  return mat;
158 
159 }
+ Here is the caller graph for this function:

§ DeallocUSMat()

unsigned short* DeallocUSMat ( unsigned short *  mat)

Definition at line 145 of file Spat_Plot.c.

Referenced by CloseFile(), CloseFile_BIN(), ClosePlotCB(), DatOrBinFormat(), DT_CorrFileEvora(), and DT_CorrHeader().

146 {
147  free(mat);
148  mat = 0;
149  return mat;
150 
151 }
+ Here is the caller graph for this function:

§ DrawAreaExposeCB()

int DrawAreaExposeCB ( MOBJECT  obj,
MEvent pexp,
void *  a_data 
)

§ FilterData()

int FilterData ( unsigned short *  mat,
int  horpix,
int  verpix,
int  filw,
int  bp 
)

Definition at line 250 of file FFT.c.

References IDX, and SmoothingF().

Referenced by BuildLogRatio(), DB_Column(), and DrawAreaPlotCB().

251 {
252 
253 
254  int x, y, n ;
255  FILE *fd;
256  double *avect;
257  unsigned long eln = (unsigned long)(2 * (horpix - bp + 1)) ;
258 
259 
260  fd = fopen("FilterUS_In.tmp", "w");
261  if(fd < 0) return 1;
262 // for(x = 0; x < horpix + 1; x++)
263  for(x = 0; x < horpix ; x++)
264  {
265  if ((x <= horpix - bp ) & (x > 1))
266  {
267  fprintf(fd, "%04u ", x);
268 
269  for(y = 0; y < verpix; y++)
270  {
271  fprintf(fd, "%05u ", mat[y * IDX + x]);
272  }
273  fprintf(fd, "\n", NULL);
274  }
275  }
276  fprintf(fd, "\n", NULL);
277  fclose(fd);
278 
279 
280 
281  if(filw <= 512)
282  avect = (double *) calloc( eln, sizeof(double));
283  else if((filw > 512) & (filw <1024))
284  avect = (double *) calloc( 2*eln, sizeof(double));
285  else if((filw >= 1024) & (filw <2048))
286  avect = (double *) calloc( 4*eln, sizeof(double));
287 
288 
289  if( avect == NULL )
290  return 1;
291 
292  for(y = 0; y < verpix; y++)
293  {
294  n=1;
295  for(x = 0; x < horpix; x++)
296  {
297  if ((x < horpix - bp) & (x > 1))
298  {
299  avect[n] = (double)mat[y * (horpix) + x];
300  n++;
301  }
302 
303  }
304 
305  SmoothingF(avect, n - 1 , filw);
306 
307  for(x = 0; x < horpix; x++)
308  {
309  if ((x < horpix - bp) & (x > 1))
310  {
311  mat[y * horpix + x] = (unsigned int)avect[x - 1] ;
312  }
313 
314  }
315  }
316 
317  free(avect);
318 
319 
320 
321  fd = fopen("FilterUS_Out.tmp", "w");
322  if(fd < 0) return 1;
323 
324 // for(x = 0; x < horpix + 1; x++)
325  for(x = 0; x < horpix ; x++)
326  {
327  if ((x <= horpix - bp ) & (x > 1))
328  {
329  fprintf(fd, "%04u ", x);
330 
331  for(y = 0; y < verpix; y++)
332  {
333  fprintf(fd, "%05u ", mat[y * IDX + x]);
334  }
335  fprintf(fd, "\n", NULL);
336  }
337  }
338  fprintf(fd, "\n", NULL);
339  fclose(fd);
340 
341  return 0;
342 
343 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int SmoothingF(double *tmp, int npix, int pts)
Smoothing of 1D array.
Definition: FFT.c:151
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ GrafoIMG()

void GrafoIMG ( int  mode)

Definition at line 1242 of file Spat_Plot.c.

References bil::DPLOT, d_view::drawapl, DrawAreaPlotCB(), MDrawAreaSetExposeCallback(), and MObjectRedraw().

Referenced by ActEditCB(), BuildLogRatio(), DB_DisplayCB(), DB_EqTypePlotCB(), DB_FilterCB(), DB_SpikesCB(), DB_XUnitsCB(), PBYScale_CB(), ViewNext(), ViewNext_BIN(), and Visualizza().

1243 {
1244 
1246 /* if (mode)
1247  MDrawAreaSetExposeCallback(BIL.DPLOT.drawapl, DAExOnLineCB, NULL);
1248  else
1249  MDrawAreaSetExposeCallback(BIL.DPLOT.drawapl, DrawAreaExposeCB, NULL);
1250 */
1253 
1254 }
int DrawAreaPlotCB(MOBJECT obj, MEvent *pexp, void *a_data)
Definition: Spat_Plot.c:876
d_view DPLOT
Definition: bildef.h:254
void MObjectRedraw(MOBJECT obj)
void MDrawAreaSetExposeCallback(MOBJECT obj, OBJ_EVENT_CB cb, void *ad)
bil BIL
Definition: Spat_Plot.c:35
MOBJECT drawapl
Definition: bildef.h:172
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ InitImage()

void InitImage ( MIMAGE  img,
int  xd,
int  yd,
int  rb,
int  gb,
int  bb 
)

Definition at line 354 of file Spat_Plot.c.

References MImageSetPixelRGB().

Referenced by DrawAreaPlotCB(), LoadIo(), ViewNext(), ViewNext_BIN(), and ViewPlot().

355 {
356  int i, k;
357 
358  for (i=0;i<xd;i++)
359  {
360  for (k=0;k<yd;k++)
361  {
362  MImageSetPixelRGB(img, i , k, rb, gb, bb);
363  }
364  }
365 
366 }
void MImageSetPixelRGB(MIMAGE pmi, int x, int y, int r, int g, int b)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreateFM_Shell()

MOBJECT MDCreateFM_Shell ( int  mod,
int  fmt 
)

Definition at line 407 of file DFileMan.c.

References _MAX_PATH, CENTER_ALIGN, ChDriveCB(), D_FInpFDCB(), D_FMDoneCB(), palette::DB_BG, palette::DB_BG_Albl, palette::DB_FG_Plbl, palette::DB_UnSel, bil::DFILEM, DFileType(), DFMSelListCB(), DFMT, DPAL, DRV, False, FList, FMDONE, fmfont, FMINIT, lbl, LEFT_ALIGN, MCreateClippedEdit(), MCreateColForm(), MCreateLabel(), MCreatePButton(), MCreateRButton(), MCreateRowForm(), MCreateShell(), MCreateSList(), MCreateTableForm(), MEditSetActCallback(), MFormSetSpacing(), MLabelSetAlignment(), MLoopWhileFlag(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetText(), MObjectSetUnsensitive(), MPButtonSetCallback(), MRButtonActivate(), MRButtonSetCallback(), MShellDestroy(), MShellRealizeXY(), MShellUnrealize(), MSListSetSelectionCallback(), MSListSetSortCallback(), MTableFormSetColAlign(), MTableFormSetRowAlign(), Row1, Row2, SELDRV, SF_MODAL, ShowFileDrive(), tb1, TOP_ALIGN, True, txtfile, txtpath, WhoSys(), and d_fileman::WORKDIRECTORY.

Referenced by DT_CorrFileEvora(), DT_CorrHeader(), DT_FluxIndex(), DT_LinkSpectra(), MenuFileOLP_CB(), and SetAsIo().

408 {
409  MOBJECT _colform000;
410  MOBJECT _colform001;
411 // MOBJECT _label000;
412  MOBJECT tb2;
413  MOBJECT FM_Shell;
414  MOBJECT pb;
415  char buf[256];
416  int drive, curdrive = 0, sysop;
417  char curdir[_MAX_PATH];
418 
419  DFileType(fmt);
420 
421  _getcwd( BIL.DFILEM.WORKDIRECTORY, _MAX_PATH );
422  curdrive = _getdrive();
423 
424  sysop = WhoSys();
425 
426 
427 
428  FM_Shell = MCreateShell("File Manager", SF_MODAL);//0); //SF_NO_RESIZE|SF_NO_MAXIMIZE|SF_NO_MINIMIZE);
429  MObjectSetBackgroundRGB(FM_Shell, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
430 
431  _colform000 = MCreateColForm(FM_Shell);
432  MObjectAlign(_colform000, LEFT_ALIGN, TOP_ALIGN);
433  MObjectSetResize(_colform000, True, True);
434 
435  Row1 = MCreateRowForm(_colform000);
437  //MObjectSetBackgroundRGB(Row1, 149, 145, 153);
440 
441 
442 
443 /*
444  Row1 = MCreateRowForm(_colform000);
445  MObjectAlign(Row1, LEFT_ALIGN, TOP_ALIGN);
446  MObjectSetBackgroundRGB(Row1, 149, 145, 153);
447  MObjectSetResize(Row1, True, True);
448  MObjectSetCompositeWidth(Row1, 80);
449 
450  tb2 = MCreateTableForm(Row1, 2);
451  MFormSetSpacing(tb2, 1);
452  MTableFormSetColAlign(tb2, 0, LEFT_ALIGN);
453  MTableFormSetRowAlign(tb2, 1, TOP_ALIGN);
454  MObjectAlign(tb2, LEFT_ALIGN, TOP_ALIGN);
455  MObjectSetForegroundRGB(tb2, 149, 145, 153);
456  MObjectSetBackgroundRGB(tb2, 149, 145, 153);
457  MObjectSetResize(tb2, True, False);
458 */
459 
460  tb2 = MCreateTableForm(Row1, 2);
462  MObjectSetResize(tb2, True, True);
463 
464 
465 
466  for(drive = 1; drive <= 26; drive++)
467  {
468  sprintf( buf, "%c:", drive + 'A' - 1 );
469  DRV[drive] = MCreateRButton(tb2, buf, fmfont);
471 // MObjectSetCompositeWidth(DRV[drive], 150);
472  MRButtonSetCallback(DRV[drive], (OBJ_VALUE_CB) ChDriveCB, (void *) drive);
473  //controlla quali dischi sono presenti
474  if(_chdrive(drive))
475  MObjectSetUnsensitive(DRV[drive]);
476  }
477 
478  Row2 = MCreateRowForm(_colform000);
480  MObjectSetBackgroundRGB(Row2, 149, 145, 153);
482 
483 
484  FList = MCreateSList(Row2, fmfont, 255, 14, 37);
485 // MSListSetSortCallback(FList, strcmp);
486  MSListSetSortCallback(FList, stricmp);
491 // MSBLSetHead(FList, "Name " "Date " "Size");
492 
493 
494 /*
495  FList = MCreateSList(Row2, FIXED_SMALL, 256, 14, 37);
496  MObjectAlign(FList, LEFT_ALIGN, TOP_ALIGN);
497  MObjectSetForegroundRGB(FList, 255, 255, 255);
498  MObjectSetBackgroundRGB(FList, 0, 0, 0);
499  MObjectSetResize(FList, True, True);
500 */
501  _colform001 = MCreateColForm(FM_Shell);
502  MFormSetSpacing(_colform001, 1);
503  MObjectAlign(_colform001, LEFT_ALIGN, TOP_ALIGN);
504  MObjectSetResize(_colform001, True, False);
505 
506  tb1 = MCreateTableForm(_colform001, 3);
507  MFormSetSpacing(tb1, 1);
512 // MObjectSetForegroundRGB(tb1, 149, 145, 153);
515 
516  lbl = MCreateLabel(tb1, "Path:", fmfont);
519 // MObjectSetShadow(lbl, WS_SHADOW_IN, 2, 0);
521 
522  txtpath = MCreateClippedEdit(tb1, "", 255, 32, fmfont);
525  MEditSetActCallback(txtpath, D_FInpFDCB, (void *) 0);
528 
529  if(mod) // Open
530  {
531  pb = MCreatePButton(tb1, "Open", fmfont);
532  MPButtonSetCallback(pb, D_FMDoneCB, (void *) 0);
533  MObjectSetResize(pb, True, True);
535  }
536  else //Save as
537  {
538  pb = MCreatePButton(tb1, "Save As", fmfont);
539  MPButtonSetCallback(pb, D_FMDoneCB, (void *) 2);
540  MObjectSetResize(pb, True, True);
542 
543  }
544  lbl = MCreateLabel(tb1, "File:", fmfont);
549 
550  txtfile = MCreateClippedEdit(tb1, "", 255, 32, fmfont);
555  MEditSetActCallback(txtfile, D_FInpFDCB, (void *) 1);
556 
557 
558 
559  pb = MCreatePButton(tb1, "Cancel", fmfont);
560  MPButtonSetCallback(pb, D_FMDoneCB, (void *) 1);
562  MObjectSetResize(pb, True, True);
563 
564 
565 
566  MShellRealizeXY(FM_Shell, 0,0);
567 
568 
569  /* Restore original drive.*/
570  _chdrive( curdrive );
571  SELDRV = curdrive ;
572  if (sysop)
574  else
576 
577 // sprintf(curdir,"%s%s",BIL.DFILEM.WORKDIRECTORY,"\\");
578  sprintf(curdir,"%s",BIL.DFILEM.WORKDIRECTORY);
579 
580  ShowFileDrive(curdir, DFMT);
581 
582  strcat(curdir,"\\");
583  MObjectSetText(txtpath, curdir);
584 
585 
586 // MEditSetActCallback(txtfile, txtfileEditCB, curdir);
587 
588 
590 
591 
592  FMINIT = 0;
593  MLoopWhileFlag(&FMINIT, 0);
594 
595  if(FMDONE)
596  {
597  FMINIT = 0;
598  MShellUnrealize(FM_Shell);
599  MShellDestroy(FM_Shell);
600 
601  }
602 
603 
604 
605  return FM_Shell;
606 
607 }
int FMDONE
Definition: DFileMan.c:35
void ChDriveCB(MOBJECT rb, MVALUE s, void *ad)
Definition: DFileMan.c:126
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
void DFMSelListCB(MOBJECT p, LIST_ACT *la, void *v)
Definition: DFileMan.c:175
MOBJECT lbl
Definition: DFileMan.c:42
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
void MObjectSetUnsensitive(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
MOBJECT FList
Definition: DFileMan.c:40
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
MTFont fmfont
Definition: DFileMan.c:46
void MTableFormSetColAlign(MOBJECT form, int col, int al)
MOBJECT MCreateClippedEdit(MOBJECT parent, const char *text, int len, int clip_len, MTFont font)
char DFMT[8]
Definition: DFileMan.c:30
void MShellUnrealize(MOBJECT obj)
void MObjectSetText(MOBJECT obj, const char *text)
palette DPAL
Definition: 2DPlot.c:27
void MShellDestroy(MOBJECT obj)
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
int FMINIT
Definition: DFileMan.c:34
MOBJECT Row1
Definition: DFileMan.c:37
void MRButtonSetCallback(MOBJECT button, OBJ_VALUE_CB cb, void *data)
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
d_fileman DFILEM
Definition: bildef.h:257
MOBJECT DRV[26]
Definition: DFileMan.c:38
void ShowFileDrive(char *idir, char *ext)
Definition: DFileMan.c:62
#define CENTER_ALIGN
Definition: Mguidefs.h:917
int WhoSys(void)
Definition: DFileMan.c:306
MOBJECT Row2
Definition: DFileMan.c:39
void MEditSetActCallback(MOBJECT edit, OBJ_STRING_CB cb, void *data)
MOBJECT MCreateSList(MOBJECT parent, MTFont font, int row_len, int nrow, int ncol)
#define SF_MODAL
Definition: Mguidefs.h:1019
void(* LIST_SEL_CB)(MOBJECT list, LIST_SEL *la, void *ad)
Definition: Mguidefs.h:1466
void MRButtonActivate(MOBJECT o)
MOBJECT MCreateColForm(MOBJECT parent)
int SELDRV
Definition: DFileMan.c:33
void MShellRealizeXY(MOBJECT obj, int x, int y)
void MSListSetSelectionCallback(MOBJECT obj, LIST_SEL_CB cb, void *data)
#define _MAX_PATH
Definition: Dildef.h:202
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
MOBJECT MCreateRButton(MOBJECT parent, const char *text, MTFont font)
void MSListSetSortCallback(MOBJECT obj, STRCMP_CB cb)
void DFileType(int i)
Definition: DFileMan.c:152
void MTableFormSetRowAlign(MOBJECT form, int row, int al)
void(* OBJ_VALUE_CB)(MOBJECT obj, MVALUE value, void *ad)
Definition: Mguidefs.h:1458
void MLabelSetAlignment(MOBJECT p, int align)
MOBJECT tb1
Definition: DFileMan.c:41
void MFormSetSpacing(MOBJECT p, int offset)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
char WORKDIRECTORY[_MAX_PATH]
Definition: bildef.h:202
void D_FInpFDCB(MOBJECT edit, char *buff, void *a)
Definition: DFileMan.c:382
MOBJECT txtpath
Definition: DFileMan.c:43
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
void D_FMDoneCB(MOBJECT shell, void *od, void *ad)
Definition: DFileMan.c:274
MOBJECT txtfile
Definition: DFileMan.c:44
void MLoopWhileFlag(int *pflag, int value)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT MCreateRowForm(MOBJECT parent)
#define TOP_ALIGN
Definition: Mguidefs.h:918
bil BIL
Definition: DFileMan.c:27
+ Here is the caller graph for this function:

§ PrintObject()

int PrintObject ( MOBJECT  obj,
int  mode,
int  x,
int  y 
)

Definition at line 37 of file D_print.c.

References False, MMessageDialog(), MObjectGetHeight(), MObjectGetWidth(), MObjectRedraw(), and MShellRaise().

Referenced by D_PButt_CB(), and MenuToolsOLP_CB().

38 {
39 
40  MPRINT_OPTIONS pe ;
41  DOC_ID did;
42  MPAGE_OPTIONS pages;
43 
44 
45  pages.startPage = pages.minPage = 1;
46  pages.endPage = pages.maxPage = 1;
47  did = MOpenPrintDoc("Print Test", False, PO_PORTRAIT, &pages);
48  if (did == NULL)
49  {
50  MMessageDialog("", "Print aborted", "Ok", NULL);
51  return 1;
52  }
53 
54  pe.mode = mode;
55  pe.x = x;
56  pe.y = y;
57  pe.w = MObjectGetWidth(obj);
58  pe.h = MObjectGetHeight(obj);
59 
60  MObjectRedraw(obj);
61  MPrintObject(obj, did, &pe);
62  MClosePrintDoc(did);
63 
64  MShellRaise(obj);
65 
66  return 0;
67 }
int MObjectGetHeight(MOBJECT obj)
#define False
Definition: Mguidefs.h:236
int MObjectGetWidth(MOBJECT obj)
void MObjectRedraw(MOBJECT obj)
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
void MShellRaise(MOBJECT obj)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SetupPrinter()

void SetupPrinter ( void  )

Definition at line 14 of file D_print.c.

References MMessageDialog().

Referenced by D_PButt_CB(), and MenuToolsOLP_CB().

15 {
16  int MPrintSetup(int po, int *xres, int *yres, int *pwidth, int *pheight, int *nplanes);
17  int xres, yres, pwidth, plength, nplanes;
18 
19  if (MPrintSetup(PO_DEFAULT, &xres, &yres, &pwidth, &plength, &nplanes))
20  {
21  char buf[128];
22 
23  sprintf(buf,
24  "Setup options:\n\
25  Paper width: %d (mm)\n\
26  Paper length: %d (mm)\n\
27  X res: %d (pixels)\n\
28  Y res: %d (pixels)\n\
29  Planes: %d",
30  pwidth, plength, xres, yres, nplanes);
31 
32  MMessageDialog("", buf, "Ok", NULL);
33  }
34 }
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ViewNext()

int ViewNext ( FILE *  nf)

Definition at line 2365 of file Spat_Plot.c.

References AbsFilePos, bil::BLENS, CloseFile(), viewformobj::cmdpb, ContFP, DB_CloseImage(), DB_InitDil(), bil::DFILEM, DI_ImageProperties(), DI_Regen(), DI_ScanMaxMin(), DOASMODE, das::DOption, bil::DPLOT, d_view::drawapl, DrawButtons(), flag::exemode, Fitem, das::Flag, GrafoIMG(), img::High, optionini::hlineafter, optionini::hlinebefore, d_fileman::HOMEDIRECTORY, IDX, IDY, img::IHigh, img::ILow, img::Imat, d_view::ImatGraf, d_view::ImatOrig, dil::Img, blens::Imim, InitImage(), img::Low, image::Mat, maxploth, maxplotw, MMenuItemSetSensitive(), MMessageDialog(), MObjectSetBackgroundRGB(), MObjectSetSensitive(), MShellRaise(), OFFLINEPLOT, ON_OFFLINEPLOT, ReadHeader_ASCII(), ReadIMG(), REL_FILE_POS, Server, SwapMatrix(), bil::VFO, viewformobj::View_Sh, and d_fileman::WORKDIRECTORY.

Referenced by D_PButt_CB(), MenuFileOLP_CB(), and ViewPre().

2366 {
2367 
2368  int er = 0, i;
2369  long XXX = 0;
2370 
2371  MObjectSetSensitive(BIL.VFO.cmdpb[8]); //Set button "Previuos" Sensitive
2373  {
2375  }
2376 
2377  /********************************/
2378  AbsFilePos = ftell( nf );
2379 
2380  for (i = ContFP; i>0; i--)
2381  {
2382  XXX = XXX + REL_FILE_POS[i];
2383  }
2384 
2385  ContFP++;
2387  /***************************************/
2388 
2389  er = ReadHeader_ASCII(1, nf);
2390  if (er)
2391  {
2392  er = MMessageDialog("DAS information", "End Of File reached.\n Do you want to close the file ?" , "Yes", "No", NULL);
2393  if (er)
2394  return 1;
2395  else
2396  CloseFile(nf, IDX, IDY); //Raggiunta fine del file
2397  MObjectSetBackgroundRGB(BIL.DPLOT.drawapl, 220, 220, 220);
2398  }
2399  else
2400  {
2402 
2403  InitImage(BIL.BLENS.Imim, maxplotw, maxploth, 192, 192, 192);
2404 
2405 
2406 
2407  ReadIMG(nf, BIL.DPLOT.ImatOrig, IDX, IDY);
2408 
2409 
2411 
2413  {
2415 
2416  _chdir(BIL.DFILEM.HOMEDIRECTORY);
2417  DB_InitDil();
2418  _chdir(BIL.DFILEM.WORKDIRECTORY);
2419 
2421 
2422  // Y Zoom for high vertical binning
2423  if((IDY) < 50)
2424  DI_ImageProperties(Server, (U16)IDX, (U16)IDY, (U16)IDX, (U16)IDY, 0, 0, NULL, 1, 100 / IDY, 0);
2425 // Image[Server].attrib = 1;
2426  DI_Regen(Server);
2427 
2428 
2432  DI_Regen(Server);
2433  }
2434  }
2435  //The focus taken by the Plot shell
2437 
2438  return 0;
2439 }
int ReadHeader_ASCII(int mod, FILE *fd)
Read ASCII Header of the measurement. .
Definition: Spat_Plot.c:1877
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MIMAGE Imim
Definition: bildef.h:14
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
MOBJECT cmdpb[10]
Definition: bildef.h:69
int Server
Definition: DAS_Spat.c:253
void SwapMatrix(unsigned short *source, unsigned short *dest, int hp, int vp)
Copy the source matrix in the Destination one .
Definition: Spat_Plot.c:1979
optionini DOption
Options for DAS execution.
C_DEF void DI_Regen(int s)
int ContFP
Counter for File position.
Definition: DAS_Spat.c:123
das DAS
DAS structure.
Definition: Spat_Plot.c:39
C_DEF double DI_ScanMaxMin(int w, float *mx, float *mi)
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
U16 * Imat
Definition: Dildef.h:286
void InitImage(MIMAGE img, int xd, int yd, int rb, int gb, int bb)
Definition: Spat_Plot.c:354
dil DIL
Definition: Spat_Plot.c:28
img Mat[MAXIMG]
Definition: Dildef.h:552
long REL_FILE_POS[51]
relative File position
Definition: DAS_Spat.c:124
int DB_CloseImage(int s)
Definition: Spat_Plot.c:1257
image Img
Definition: Dildef.h:675
short unsigned U16
2 byte without sign, range 0-65535
Definition: dcldef.h:375
long AbsFilePos
Absolute File position.
Definition: DAS_Spat.c:122
int hlinebefore
Number of HiddenLines before the central line in Plot.
d_fileman DFILEM
Definition: bildef.h:257
#define OFFLINEPLOT
execution for archived data visualisation
unsigned short * ImatOrig
Definition: bildef.h:180
d_view DPLOT
Definition: bildef.h:254
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
void MMenuItemSetSensitive(MENU_ITEM item)
void CloseFile(FILE *fd, int hp, int vp)
Definition: Spat_Plot.c:1304
float IHigh
Definition: Dildef.h:303
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
MENU_ITEM Fitem[6]
Definition: Spat_Plot.c:46
MOBJECT View_Sh
Definition: bildef.h:35
int hlineafter
Number of HiddenLines after the central line in Plot.
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
void ReadIMG(FILE *file, unsigned short *mat, int hp, int vp)
Read ASCII Image (Spectral Data only) .
Definition: Spat_Plot.c:1206
unsigned short * ImatGraf
Definition: bildef.h:176
void MShellRaise(MOBJECT obj)
float ILow
Definition: Dildef.h:302
int maxploth
Definition: Spat_Plot.c:51
int maxplotw
Definition: Spat_Plot.c:51
bil BIL
Definition: Spat_Plot.c:35
char WORKDIRECTORY[_MAX_PATH]
Definition: bildef.h:202
int DB_InitDil(void)
Initialize DIL. Procedure that initialize the DTA Imaging library.
Definition: Init.c:112
blens BLENS
Definition: bildef.h:252
viewformobj VFO
Definition: bildef.h:255
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)
void DrawButtons(int nhidlbef, int nhidlaft, int nr)
Definition: Spat_Plot.c:56
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
MOBJECT drawapl
Definition: bildef.h:172
float Low
Definition: Dildef.h:294
void MObjectSetSensitive(MOBJECT obj)
float High
Definition: Dildef.h:295
int exemode
Set the Execution MODE (Execution modes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ViewNext_BIN()

int ViewNext_BIN ( int  nf)

Definition at line 2284 of file Spat_Plot.c.

References AbsFilePos, bil::BLENS, CloseFile_BIN(), viewformobj::cmdpb, ContFP, D_AssignLabelPlot(), DB_CloseImage(), DB_InitDil(), bil::DFILEM, DI_ImageProperties(), DI_Regen(), DI_ScanMaxMin(), DOASMODE, das::DOption, bil::DPLOT, d_view::drawapl, DrawButtons(), flag::exemode, Fitem, das::Flag, GrafoIMG(), img::High, optionini::hlineafter, optionini::hlinebefore, d_fileman::HOMEDIRECTORY, IDX, IDY, img::IHigh, img::ILow, img::Imat, d_view::ImatGraf, d_view::ImatOrig, dil::Img, blens::Imim, d_view::Imin, InitImage(), viewformobj::lblmin, img::Low, image::Mat, maxploth, maxplotw, MMenuItemSetSensitive(), MMessageDialog(), MObjectSetBackgroundRGB(), MObjectSetSensitive(), MObjectSetText(), MShellRaise(), OFFLINEPLOT, ON_OFFLINEPLOT, ReadHeader_BIN(), ReadIMG_BIN(), REL_FILE_POS, Server, SwapMatrix(), bil::VFO, viewformobj::View_Sh, and d_fileman::WORKDIRECTORY.

Referenced by D_PButt_CB(), MenuFileOLP_CB(), and ViewPre_BIN().

2285 {
2286 
2287  int er = 0, i;
2288  long XXX = 0;
2289  char str[32];
2290 
2291  MObjectSetSensitive(BIL.VFO.cmdpb[8]); //Set button "Previuos" Sensitive
2293  {
2295  }
2296 
2297  /********************************/
2298  AbsFilePos = tell( nf );
2299 
2300  for (i = ContFP; i>0; i--)
2301  {
2302  XXX = XXX + REL_FILE_POS[i];
2303  }
2304 
2305  ContFP++;
2307  /***************************************/
2308 
2309  er = ReadHeader_BIN(nf);
2311  if (er)
2312  {
2313  er = MMessageDialog("DAS information", "End Of File reached.\n Do you want to close the file ?" , "Yes", "No", NULL);
2314  if (er)
2315  return 1;
2316  else
2317  CloseFile_BIN(nf, IDX, IDY); //Raggiunta fine del file
2318  MObjectSetBackgroundRGB(BIL.DPLOT.drawapl, 220, 220, 220);
2319  }
2320  else
2321  {
2323 
2324  InitImage(BIL.BLENS.Imim, maxplotw, maxploth, 192, 192, 192);
2325 
2326 
2327 
2329 
2330 
2332 
2333  sprintf(str,"%u", BIL.DPLOT.Imin);
2334  MObjectSetText(BIL.VFO.lblmin, str);
2335 
2336  if(DAS.Flag.exemode == OFFLINEPLOT)
2337  {
2339 
2340  _chdir(BIL.DFILEM.HOMEDIRECTORY);
2341  DB_InitDil();
2342  _chdir(BIL.DFILEM.WORKDIRECTORY);
2343 
2345 
2346  // Y Zoom for high vertical binning
2347  if((IDY) < 50)
2348  DI_ImageProperties(Server, (U16)IDX, (U16)IDY, (U16)IDX, (U16)IDY, 0, 0, NULL, 1, 100 / IDY, 0);
2349 // Image[Server].attrib = 1;
2350  DI_Regen(Server);
2351 
2355  DI_Regen(Server);
2356  }
2357  }
2358 
2359  //The focus taken by the Plot shell
2361 
2362  return 0;
2363 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lblmin
Definition: bildef.h:54
MIMAGE Imim
Definition: bildef.h:14
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
void CloseFile_BIN(int fd, int hp, int vp)
Definition: Spat_Plot.c:1382
MOBJECT cmdpb[10]
Definition: bildef.h:69
int Server
Definition: DAS_Spat.c:253
void SwapMatrix(unsigned short *source, unsigned short *dest, int hp, int vp)
Copy the source matrix in the Destination one .
Definition: Spat_Plot.c:1979
optionini DOption
Options for DAS execution.
C_DEF void DI_Regen(int s)
int ContFP
Counter for File position.
Definition: DAS_Spat.c:123
das DAS
DAS structure.
Definition: Spat_Plot.c:39
C_DEF double DI_ScanMaxMin(int w, float *mx, float *mi)
void ReadIMG_BIN(int fd, unsigned short *mat, int hp, int vp)
read the BINARY stored spectrum
Definition: Spat_Plot.c:1166
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
U16 * Imat
Definition: Dildef.h:286
void InitImage(MIMAGE img, int xd, int yd, int rb, int gb, int bb)
Definition: Spat_Plot.c:354
dil DIL
Definition: Spat_Plot.c:28
img Mat[MAXIMG]
Definition: Dildef.h:552
unsigned int Imin
Definition: bildef.h:178
long REL_FILE_POS[51]
relative File position
Definition: DAS_Spat.c:124
int DB_CloseImage(int s)
Definition: Spat_Plot.c:1257
void MObjectSetText(MOBJECT obj, const char *text)
image Img
Definition: Dildef.h:675
short unsigned U16
2 byte without sign, range 0-65535
Definition: dcldef.h:375
long AbsFilePos
Absolute File position.
Definition: DAS_Spat.c:122
int hlinebefore
Number of HiddenLines before the central line in Plot.
d_fileman DFILEM
Definition: bildef.h:257
#define OFFLINEPLOT
execution for archived data visualisation
unsigned short * ImatOrig
Definition: bildef.h:180
d_view DPLOT
Definition: bildef.h:254
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
void MMenuItemSetSensitive(MENU_ITEM item)
float IHigh
Definition: Dildef.h:303
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
MENU_ITEM Fitem[6]
Definition: Spat_Plot.c:46
MOBJECT View_Sh
Definition: bildef.h:35
int hlineafter
Number of HiddenLines after the central line in Plot.
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
unsigned short * ImatGraf
Definition: bildef.h:176
void MShellRaise(MOBJECT obj)
float ILow
Definition: Dildef.h:302
void D_AssignLabelPlot(void)
Definition: Spat_Plot.c:1661
int maxploth
Definition: Spat_Plot.c:51
int maxplotw
Definition: Spat_Plot.c:51
bil BIL
Definition: Spat_Plot.c:35
char WORKDIRECTORY[_MAX_PATH]
Definition: bildef.h:202
int DB_InitDil(void)
Initialize DIL. Procedure that initialize the DTA Imaging library.
Definition: Init.c:112
int ReadHeader_BIN(int fd)
read the BINARY header of the stored spectrum
Definition: Spat_Plot.c:1798
blens BLENS
Definition: bildef.h:252
viewformobj VFO
Definition: bildef.h:255
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)
void DrawButtons(int nhidlbef, int nhidlaft, int nr)
Definition: Spat_Plot.c:56
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
MOBJECT drawapl
Definition: bildef.h:172
float Low
Definition: Dildef.h:294
void MObjectSetSensitive(MOBJECT obj)
float High
Definition: Dildef.h:295
int exemode
Set the Execution MODE (Execution modes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Visualizza()

int Visualizza ( int  mod,
char *  nomefile 
)

Definition at line 2069 of file Spat_Plot.c.

References AllocUSMat(), CCD_INFO, config::CCDType, viewformobj::cmdpb, D_AssignLabelPlot(), DB_InitDil(), DC_LoadCameraConfig(), DC_OpenPar(), DC_RWData(), bil::DFILEM, DI_ImageProperties(), DI_Regen(), DI_ScanMaxMin(), DOASMODE, das::DOption, bil::DPLOT, DrawButtons(), flag::exemode, FBIF, FDAT, Fitem, das::Flag, Fmenu, GrafoIMG(), img::High, optionini::hlineafter, optionini::hlinebefore, d_fileman::HOMEDIRECTORY, IDX, IDY, img::IHigh, img::ILow, img::Imat, d_view::ImatGraf, d_view::ImatOrig, dil::Img, d_view::Imin, viewformobj::lblmin, img::Low, MakeItemSensitiveCB(), MakeItemUnsensitiveCB(), image::Mat, MMenuItemSetSensitive(), MMenuItemSetUnsensitive(), MMessageDialog(), MObjectSetSensitive(), MObjectSetText(), MObjectSetUnsensitive(), MShellRaise(), MShellSetTitle(), NFDATI, NUMFDATI, O_BINARY, OFFLINEPLOT, ON_OFFLINEPLOT, config::Platform, PTF_INFO, READ_DATA, ReadHeader_ASCII(), ReadHeader_BIN(), ReadIMG(), ReadIMG_BIN(), REL_FILE_POS, viewformobj::selallpb, Server, SwapMatrix(), bil::VFO, viewformobj::View_Sh, d_fileman::WORKDIRECTORY, and viewformobj::YScalePB.

Referenced by D_PButt_CB(), MenuFileOLP_CB(), and RunOLP().

2070 {
2071 
2072  FILE *fd;
2073  int fn;
2074  char buf[128];
2075  int er=0;
2076 
2077  switch (mod)
2078  {
2079  case FBIF: //Bif Ext
2080  fn = open(nomefile, O_RDONLY | O_BINARY, S_IREAD );
2081  if(fn < 0) return(-1);
2082  break;
2083  case FDAT: //Dat Ext
2084  fd = fopen(nomefile, "r");
2085  if(fd < 0) return 1;
2086  break;
2087  }
2088 
2089 
2090 
2091  sprintf(buf,"PLOTTING File: %s", nomefile);
2092  MShellSetTitle(BIL.VFO.View_Sh, buf);
2093 
2094 // MObjectSetUnsensitive(BIL.VFO.cmdpb[0]); //Set Button "Open" Unsensitive
2095  MObjectSetText(BIL.VFO.cmdpb[0], "Save As");
2096 
2097 
2098 
2099 
2100  MObjectSetSensitive(BIL.VFO.cmdpb[1]); //Set Button "Next" Sensitive
2101  MObjectSetSensitive(BIL.VFO.cmdpb[2]); // Set "Set as Io" button as sensitive
2102  MObjectSetSensitive(BIL.VFO.cmdpb[3]); // Set "CloseFile" button as sensitive
2103  MObjectSetSensitive(BIL.VFO.cmdpb[4]); // Set "Print" button as sensitive
2106  MObjectSetUnsensitive(BIL.VFO.cmdpb[5]); //Set Button "CloseWin" Unsensitive
2107 
2108  if( (!DAS.Flag.exemode == OFFLINEPLOT) | (!DAS.Flag.exemode == DOASMODE))
2109  {
2112  }
2113 
2114 
2115  if( (DAS.Flag.exemode == OFFLINEPLOT) | (DAS.Flag.exemode == DOASMODE))
2116  {
2117  MakeItemUnsensitiveCB (Fmenu, Fitem[0], 0); //Open Unsensitive
2118  MakeItemSensitiveCB (Fmenu, Fitem[1], 0); //Next Sensitive
2119 // Fitem[2] = MMenuAddItem(Fmenu, "Previous", (MENU_ITEM_CB) MenuFileOLP_CB, (void *)2);
2121  MakeItemSensitiveCB (Fmenu, Fitem[3], 0); //Save as.. Sensitive
2122  MakeItemSensitiveCB (Fmenu, Fitem[4], 0); // Close Sensitive
2123  MakeItemUnsensitiveCB (Fmenu, Fitem[5], 0);// Close Plot Sensitive
2124 /*
2125  Tmenu = MCreateMenu(dmenu, "Tools");
2126  Titem[0] = MMenuAddItem(Tmenu, "Filter/Smooth", (MENU_ITEM_CB) MenuToolsOLP_CB, 0);
2127  Titem[1] = MMenuAddItem(Tmenu, "Zoom", (MENU_ITEM_CB) MenuToolsOLP_CB, (void *)1);
2128  Titem[2] = MMenuAddItem(Tmenu, "Sun calculator", (MENU_ITEM_CB) MenuToolsOLP_CB, (void *)2);
2129  Titem[3] = MMenuAddItem(Tmenu, "Print ", (MENU_ITEM_CB) MenuToolsOLP_CB, (void *)3);
2130 
2131  Optmenu = MCreateMenu(dmenu, "Options");
2132  item = MMenuAddItem(Optmenu, "X Units", (MENU_ITEM_CB) NULL, 0);
2133  item = MMenuAddItem(Optmenu, "Y Scale", (MENU_ITEM_CB) NULL, 0);
2134  item = MMenuAddItem(Optmenu, "Hidden Lines", (MENU_ITEM_CB) NULL, 0);
2135 
2136  menu = MCreateMenu(dmenu, "Help");
2137  item = MMenuAddItem(menu, "About", (MENU_ITEM_CB) NULL, 0);
2138 */
2139  }
2140 
2141 
2142 
2143 
2144  //MObjectSetBackgroundRGB(BIL.DPLOT.drawapl, 220, 220, 220);
2145  if(DAS.Flag.exemode == OFFLINEPLOT)
2146  {
2147 
2153  }
2154 
2155  switch (mod)
2156  {
2157  case FBIF: //Bif Ext
2158  NFDATI = fn;
2159  er = ReadHeader_BIN(fn);
2161  break;
2162 
2163  case FDAT: //dat Ext
2164  NUMFDATI = fd;
2165  er = ReadHeader_ASCII(1, fd); //New Format (data after 10/12/03)
2166  break;
2167  }
2168 
2170 
2171 
2174  if (er)
2175  MMessageDialog("DAS PLOT Inf.", "Unable to allocate memory ...", "OK", NULL);
2176 
2177  REL_FILE_POS[0] = 0;
2178 
2179  switch (mod)
2180  {
2181  case FBIF: //Bif Ext
2183  break;
2184 
2185  case FDAT: //Dat Ext
2187  break;
2188  }
2189 
2190 
2192 
2193  sprintf(buf,"%u", BIL.DPLOT.Imin);
2194  MObjectSetText(BIL.VFO.lblmin, buf);
2195 
2196 
2198  {
2199  _chdir(BIL.DFILEM.HOMEDIRECTORY);
2200 
2201  DC_LoadCameraConfig("config\\camera.cfg", &Cfg);
2205 // strcpy(Cfg.PtfName, DC_PtfName(0));
2206 // DC_LoadPlatform(Cfg.PtfName);
2207 
2208 
2209 /*******************/
2210 /*** Init Dil ***/
2211  DB_InitDil();
2212 /*******************/
2213 
2214  _chdir(BIL.DFILEM.WORKDIRECTORY);
2215 
2217 
2218  // Y Zoom for high vertical binning
2219  if((IDY) < 50)
2220  DI_ImageProperties(Server, (U16)IDX, (U16)IDY, (U16)IDX, (U16)IDY, 0, 0, NULL, 1, 100 / IDY, 0);
2221 // Image[Server].attrib = 1;
2222  DI_Regen(Server);
2223 
2224 
2225 
2229  DI_Regen(Server);
2230  }
2231  //The focus taken by the Plot shell
2233 
2234  return 0;
2235 
2236 }
int ReadHeader_ASCII(int mod, FILE *fd)
Read ASCII Header of the measurement. .
Definition: Spat_Plot.c:1877
MOBJECT lblmin
Definition: bildef.h:54
MOBJECT selallpb
Definition: bildef.h:68
MOBJECT YScalePB
Definition: bildef.h:70
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
MOBJECT cmdpb[10]
Definition: bildef.h:69
int Server
Definition: DAS_Spat.c:253
void SwapMatrix(unsigned short *source, unsigned short *dest, int hp, int vp)
Copy the source matrix in the Destination one .
Definition: Spat_Plot.c:1979
optionini DOption
Options for DAS execution.
#define O_BINARY
Definition: Dildef.h:201
void MObjectSetUnsensitive(MOBJECT obj)
C_DEF void DI_Regen(int s)
das DAS
DAS structure.
Definition: Spat_Plot.c:39
C_DEF double DI_ScanMaxMin(int w, float *mx, float *mi)
U32 CCDType
(R/W) Used CCD CCD code definitions
Definition: dcldef.h:1066
void ReadIMG_BIN(int fd, unsigned short *mat, int hp, int vp)
read the BINARY stored spectrum
Definition: Spat_Plot.c:1166
unsigned short * AllocUSMat(int hp, int vp)
Definition: Spat_Plot.c:1994
#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.
flag Flag
Structure for different flags.
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
U16 * Imat
Definition: Dildef.h:286
#define READ_DATA
Read data.
Definition: dcldef.h:884
dil DIL
Definition: Spat_Plot.c:28
FILE * NUMFDATI
Definition: Bil.h:26
img Mat[MAXIMG]
Definition: Dildef.h:552
#define PTF_INFO
R/W ptf internal library structure.
Definition: dcldef.h:876
unsigned int Imin
Definition: bildef.h:178
long REL_FILE_POS[51]
relative File position
Definition: DAS_Spat.c:124
void MObjectSetText(MOBJECT obj, const char *text)
#define FDAT
Definition: bildef.h:221
image Img
Definition: Dildef.h:675
short unsigned U16
2 byte without sign, range 0-65535
Definition: dcldef.h:375
ptf DC_HP
Definition: Spat_Plot.c:26
#define CCD_INFO
R/W ccd internal library structure.
Definition: dcldef.h:875
int hlinebefore
Number of HiddenLines before the central line in Plot.
d_fileman DFILEM
Definition: bildef.h:257
#define OFFLINEPLOT
execution for archived data visualisation
unsigned short * ImatOrig
Definition: bildef.h:180
config Cfg
Definition: Spat_Plot.c:27
d_view DPLOT
Definition: bildef.h:254
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
int NFDATI
Definition: Bil.h:27
void MMenuItemSetSensitive(MENU_ITEM item)
float IHigh
Definition: Dildef.h:303
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
MENU_ITEM Fitem[6]
Definition: Spat_Plot.c:46
MOBJECT View_Sh
Definition: bildef.h:35
int hlineafter
Number of HiddenLines after the central line in Plot.
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
void MMenuItemSetUnsensitive(MENU_ITEM item)
void ReadIMG(FILE *file, unsigned short *mat, int hp, int vp)
Read ASCII Image (Spectral Data only) .
Definition: Spat_Plot.c:1206
unsigned short * ImatGraf
Definition: bildef.h:176
void MShellRaise(MOBJECT obj)
float ILow
Definition: Dildef.h:302
void D_AssignLabelPlot(void)
Definition: Spat_Plot.c:1661
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...
bil BIL
Definition: Spat_Plot.c:35
char WORKDIRECTORY[_MAX_PATH]
Definition: bildef.h:202
int DB_InitDil(void)
Initialize DIL. Procedure that initialize the DTA Imaging library.
Definition: Init.c:112
int ReadHeader_BIN(int fd)
read the BINARY header of the stored spectrum
Definition: Spat_Plot.c:1798
void MShellSetTitle(MOBJECT obj, const char *title)
void MakeItemUnsensitiveCB(MOBJECT obj, void *item, void *udata)
Definition: Spat_Plot.c:2044
viewformobj VFO
Definition: bildef.h:255
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.
void DrawButtons(int nhidlbef, int nhidlaft, int nr)
Definition: Spat_Plot.c:56
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
U32 Platform
(R/W) Platform code Camera platform definitions
Definition: dcldef.h:1065
float Low
Definition: Dildef.h:294
void MObjectSetSensitive(MOBJECT obj)
MOBJECT Fmenu
Definition: Spat_Plot.c:47
ccd DC_CCD
Definition: Spat_Plot.c:25
float High
Definition: Dildef.h:295
int exemode
Set the Execution MODE (Execution modes)
void MakeItemSensitiveCB(MOBJECT obj, void *item, void *udata)
Definition: Spat_Plot.c:2054
#define FBIF
Definition: bildef.h:229
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ WhoSys()

int WhoSys ( void  )

Definition at line 306 of file DFileMan.c.

References BOOL, and WIN_NT.

Referenced by DB_InitCamera(), and MDCreateFM_Shell().

307 {
308 #ifdef _WIN32
309  int so;
310  OSVERSIONINFOEX osvi;
311  BOOL bOsVersionInfoEx;
312 
313  ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
314  osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
315 
316  if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
317  {
318  // If OSVERSIONINFOEX doesn't work, try OSVERSIONINFO.
319  osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
320  if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) )
321  return 0;
322  }
323 
324  switch (osvi.dwPlatformId)
325  {
326  // NT, 2000
327  case VER_PLATFORM_WIN32_NT:
328  so = WIN_NT;
329  break;
330  // 95, 98, Me
331  case VER_PLATFORM_WIN32_WINDOWS:
332  so = 0;
333  break;
334  // Win 32
335  case VER_PLATFORM_WIN32s:
336  so = 0;
337  break;
338  }
339  return so;
340 #else
341  return 0;
342 #endif
343 }
#define BOOL
Definition: DSCUD.H:100
#define WIN_NT
Define NT/XP/2000 and LINUX operating system (Realtime not possible).
Definition: dcldef.h:422
+ Here is the caller graph for this function:

Variable Documentation

§ BIL

bil BIL

§ maxploth

int maxploth

§ maxplotw

int maxplotw

Definition at line 51 of file Spat_Plot.c.

Referenced by DrawAreaPlotCB(), LoadIo(), RefreshDrArea(), ViewNext(), ViewNext_BIN(), and ViewPlot().

§ NColors

double NColors

§ newfont

MTFont newfont

Definition at line 95 of file CreateForms.c.

Referenced by D_Lens(), and DB_TestF().

§ NFDATI

int NFDATI

Definition at line 27 of file Bil.h.

Referenced by D_PButt_CB(), MenuFileOLP_CB(), and Visualizza().

§ NUMFDATI

FILE* NUMFDATI

Definition at line 26 of file Bil.h.

Referenced by D_PButt_CB(), MenuFileOLP_CB(), and Visualizza().

§ OMUTEMP

omutemp OMUTEMP

structure for OMU temperatures

Definition at line 29 of file 2DPlot.c.

§ VFO

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