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

GUI and Callbacks for Plotting spectra. More...

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#include <io.h>
#include <direct.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "mgui.h"
#include "DAS_Spatram.h"
#include "dcl.h"
#include "dil.h"
#include "bil.h"
#include "DOAS.h"
+ Include dependency graph for Spat_Plot.c:

Go to the source code of this file.

Functions

float * AllocFloatMat (int hp, int vp)
 
long * AllocLongMat (int hp, int vp)
 
void AllocMat ()
 
unsigned short * AllocUSMat (int hp, int vp)
 
void AssZeroMat (int hp, int vp)
 
void CloseFile (FILE *fd, int hp, int vp)
 
void CloseFile_BIN (int fd, int hp, int vp)
 
void ClosePlotCB (MOBJECT p, void *od, void *ad)
 
void D_AssignLabelPlot (void)
 
void D_AssignOrigin (MOBJECT obj)
 
int D_findmaxmin (unsigned short plotmat[], int xinf, int xsup, int yinf, int ysup, int bp)
 
void D_pbr_CB (MOBJECT p, void *od, void *ad)
 
void D_PButt_CB (MOBJECT p, void *od, void *ad)
 
void D_PlotAxis (MOBJECT ob, MIMAGE mim, int sx, int sy, int ex, int ey, MTColor col)
 
void D_PlotGrid (MOBJECT ob, MIMAGE mim, int sx, int sy, int ex, int ey)
 
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)
 
void D_PlotTools (void)
 
void DB_AreaInput (MOBJECT obj, MEvent *pe, void *a_data)
 
int DB_CloseImage (int s)
 
void DB_DisplayCB (MOBJECT p, void *od, void *ad)
 
void DB_EqTypePlotCB (MOBJECT o, void *a, void *v)
 
void DB_FilterCB (MOBJECT p, void *od, void *ad)
 Filter positioning callback. More...
 
double DB_FindMaxMin (int idx, int idy, unsigned int *mx, unsigned int *mi, int bp)
 
void DB_SpikesCB (MOBJECT p, void *od, void *ad)
 
void DB_XUnitsCB (MOBJECT o, void *id, void *a_data)
 
void deallocamat ()
 
float * DeallocFloatMat (float *mat)
 
unsigned short * DeallocUSMat (unsigned short *mat)
 
void DestroyArrayObj (MOBJECT obj[], int n)
 
int DrawAreaPlotCB (MOBJECT obj, MEvent *pexp, void *a_data)
 
void DrawButtons (int nhidlbef, int nhidlaft, int nr)
 
void DrawImg (MIMAGE img, int a, int c, int x, int y)
 
void DrawXLine (MIMAGE img, int yfix, int xs, int xe, int r, int g, int b)
 
void DrawYLine (MIMAGE img, int xfix, int ys, int ye, int r, int g, int b)
 
void GrafoIMG (int mode)
 
int HeaderInPlot (void)
 Shows the measurements parameters
. More...
 
void ImatGrafInImat (void)
 
void ImatInImatGraf (void)
 
void InitImage (MIMAGE img, int xd, int yd, int rb, int gb, int bb)
 
void LoadIo (int mod, char *fname)
 
void LogRatioSpectrum (void)
 
void MakeItemSensitiveCB (MOBJECT obj, void *item, void *udata)
 
void MakeItemUnsensitiveCB (MOBJECT obj, void *item, void *udata)
 
int MD_CreateBRowShell (int nrows)
 Create windows of buttons.
During the plotting of the measurements, create a shell of buttons if the raws of the CCD are more than 16. More...
 
void MenuFileOLP_CB (MOBJECT o, void *id, void *a_data)
 
void MenuToolsOLP_CB (MOBJECT o, void *id, void *a_data)
 
void PButtSelAll_CB (MOBJECT p, void *od, void *ad)
 
void PBYScale_CB (MOBJECT p, void *od, void *ad)
 
void PlotSpectrum (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, int hlb, int hla)
 
void PlotToolsPBs (MOBJECT o, void *id, void *a_data)
 
void PopUp_CB (MOBJECT obj, void *item, void *data)
 
void PopupMenuCB (MOBJECT obj, MEvent *pe, void *pdown)
 
void PoslblX (MOBJECT lbl, int xs, int xe, int xc)
 
void PoslblY (unsigned int l, unsigned int h)
 
int ReadHeader_ASCII (int mod, FILE *fd)
 Read ASCII Header of the measurement.
. More...
 
int ReadHeader_BIN (int fd)
 read the BINARY header of the stored spectrum More...
 
void ReadIMG (FILE *file, unsigned short *mat, int hp, int vp)
 Read ASCII Image (Spectral Data only)
. More...
 
void ReadIMG_BIN (int fd, unsigned short *mat, int hp, int vp)
 read the BINARY stored spectrum More...
 
void ReadIMG_old (FILE *file, int hp, int vp)
 NOT Used
. More...
 
int SaveImage (int fmt, int imgw, int imgh, int np)
 
int SaveIo (char *buff)
 
int SaveSpectrum (char *buff)
 
int SetAsIo (void)
 
void SwapMatrix (unsigned short *source, unsigned short *dest, int hp, int vp)
 Copy the source matrix in the Destination one
. More...
 
int ViewNext (FILE *nf)
 
int ViewNext_BIN (int nf)
 
int ViewPlot (int mod)
 Create the plot shell. Procedure that build the plot shell for the data visualization. More...
 
int ViewPre (FILE *nf, long position)
 
int ViewPre_BIN (int nf, long position)
 
int Visualizza (int mod, char *nomefile)
 
void WriteIMG (FILE *file, unsigned short *mat, int hp, int vp)
 
void WriteIMG_BIN (int fd, unsigned short *mat, int hp, int vp)
 
int X2Counts (int x)
 
unsigned int Y2Counts (int y)
 

Variables

MTFont alfont
 
bil BIL
 
config Cfg
 
das DAS
 DAS structure. More...
 
ccd DC_CCD
 
ptf DC_HP
 
dil DIL
 
doas DOAS
 
palette DPAL
 
char * ffilenames []
 
MENU_ITEM Fitem [6]
 
int flagclear = 0
 
MOBJECT Fmenu
 
MENU_ITEM item_pd
 
unsigned int * mattempbuff
 
int maxploth
 
int maxplotw
 
MTFont newfont
 
char NFileNameF [32]
 
MOBJECT Optmenu
 
MTFont plfont
 
MOBJECT popup_pd
 
MENU_ITEM Titem [4]
 
MOBJECT Tmenu
 

Detailed Description

GUI and Callbacks for Plotting spectra.

Author
Daniele Bortoli

Definition in file Spat_Plot.c.

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:

§ AllocLongMat()

long* AllocLongMat ( int  hp,
int  vp 
)

Definition at line 2024 of file Spat_Plot.c.

2025 {
2026 
2027  unsigned long mx;
2028  long *mat;
2029  mx = (unsigned long) hp * (unsigned long) vp;
2030  mat = (long *) calloc( mx, sizeof(long));
2031 // if(mat == NULL ) //Only for malloc
2032 // return 1;
2033 
2034  return mat;
2035 
2036 }

§ AllocMat()

void AllocMat ( )

Definition at line 124 of file Spat_Plot.c.

References spectrumheader::ccdnr, spectrumheader::ccdwx, bil::DPLOT, IDX, IDY, d_view::ImatGraf, d_view::ImatOrig, and bil::SPH.

125 {
126 
127  unsigned long mx;
128 
129 
130 // IDX = (BIL.SPH.ccdex - BIL.SPH.ccdsx);
131 // IDY = (BIL.SPH.ccdey - BIL.SPH.ccdsy) / BIL.SPH.ccdvb;
132 
133  IDX = BIL.SPH.ccdwx ;
134  IDY = BIL.SPH.ccdnr +1;
135 
136 
137  mx = (unsigned long) IDX * (unsigned long) IDY;
138  BIL.DPLOT.ImatGraf = (unsigned short *) calloc( mx, sizeof(unsigned short));
139 
140  BIL.DPLOT.ImatOrig = (unsigned short *) calloc( mx, sizeof(unsigned short));
141 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
unsigned short * ImatOrig
Definition: bildef.h:180
d_view DPLOT
Definition: bildef.h:254
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
unsigned short * ImatGraf
Definition: bildef.h:176
bil BIL
Definition: Spat_Plot.c:35

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

§ AssZeroMat()

void AssZeroMat ( int  hp,
int  vp 
)

Definition at line 1223 of file Spat_Plot.c.

References bil::DPLOT, and d_view::ImatGraf.

1224 {
1225 
1226 
1227  int x, y;
1228 
1229  for(y = 0; y < vp; y++)
1230  {
1231  for(x = 0; x < hp; x++)
1232  {
1233  BIL.DPLOT.ImatGraf[y * hp + x] = x+y;
1234  }
1235  }
1236 }
d_view DPLOT
Definition: bildef.h:254
unsigned short * ImatGraf
Definition: bildef.h:176
bil BIL
Definition: Spat_Plot.c:35

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

§ CloseFile_BIN()

void CloseFile_BIN ( int  fd,
int  hp,
int  vp 
)

Definition at line 1382 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_BIN().

1383 {
1384 
1385  int i;
1386 
1387 
1388  close(fd); //Close Data file
1389 
1390 
1391 // MObjectSetBackgroundRGB(BIL.DPLOT.drawapl, 0, 0, 0);
1392 
1393  if(BIL.DPLOT.RowShell != 0)
1394  {
1397  BIL.DPLOT.RowShell = 0;
1400 
1401  }
1402  else
1403  {
1404  for (i=DAS.DOption.hlinebefore; i < BIL.SPH.ccdnr - DAS.DOption.hlineafter; i++)
1405  MObjectUnmap(BIL.DPLOT.pbr[i]);
1408 
1409 
1410  }
1411 
1412  MShellSetTitle(BIL.VFO.View_Sh,"PLOTTING File: None");
1413 
1414 
1415  MObjectSetText(BIL.VFO.cmdpb[0], "Open");
1416  MObjectSetSensitive(BIL.VFO.cmdpb[0]); //Set Button "Open" Sensitive
1417  MObjectSetUnsensitive(BIL.VFO.cmdpb[1]); //Set button "Next" Unsensitive
1418  MObjectSetUnsensitive(BIL.VFO.cmdpb[8]); //Set button "Previuos" Unsensitive
1419  MObjectSetUnsensitive(BIL.VFO.cmdpb[3]); // Set "CloseFile" button as Unsensitive
1420  MObjectSetUnsensitive(BIL.VFO.cmdpb[4]); // Set "Print" button as Unsensitive
1423  MObjectSetSensitive(BIL.VFO.cmdpb[5]); //Set Button "CloseWin" Sensitive
1424  MObjectSetUnsensitive(BIL.VFO.cmdpb[2]); // Set "Set as Io" button as Unsensitive
1425 
1426  if( (!DAS.Flag.exemode == OFFLINEPLOT) | (!DAS.Flag.exemode == DOASMODE))
1427  {
1430  }
1431 
1432 
1433  if (ContFP)
1434  ContFP = 0;
1435 
1436 
1437 
1438  if(DAS.Flag.exemode == OFFLINEPLOT )
1439  {
1447  }
1448  else if(DAS.Flag.exemode == DOASMODE)
1449  {
1456  }
1457 
1458 
1459 }
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:

§ ClosePlotCB()

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

Definition at line 2514 of file Spat_Plot.c.

References bil::BLENS, ContFP, DeallocUSMat(), bil::DPLOT, flag::exemode, das::Flag, d_view::ImatGraf, d_view::ImatOrig, blens::Imim, MFreeImage(), MGUITerm(), MShellDestroy(), MShellUnrealize(), OFFLINEPLOT, and d_view::RowShell.

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

2515 {
2516 
2517  if(BIL.DPLOT.RowShell != 0)
2518  {
2521  BIL.DPLOT.RowShell = 0;
2522  }
2523 
2524  MShellUnrealize(p);
2525  MShellDestroy(p);
2526 
2530 
2531  if (ContFP)
2532  ContFP = 0;
2533 
2534  if(DAS.Flag.exemode == OFFLINEPLOT)
2535  {
2536 
2537  MGUITerm();
2538  exit(0);
2539  }
2540 
2541 }
MIMAGE Imim
Definition: bildef.h:14
int ContFP
Counter for File position.
Definition: DAS_Spat.c:123
das DAS
DAS structure.
Definition: Spat_Plot.c:39
flag Flag
Structure for different flags.
void MShellUnrealize(MOBJECT obj)
void MShellDestroy(MOBJECT obj)
#define OFFLINEPLOT
execution for archived data visualisation
void MGUITerm(void)
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 MFreeImage(MIMAGE data)
unsigned short * ImatGraf
Definition: bildef.h:176
static double p
Definition: SOLPOS.C:131
bil BIL
Definition: Spat_Plot.c:35
MOBJECT RowShell
Definition: bildef.h:171
blens BLENS
Definition: bildef.h:252
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_AssignLabelPlot()

void D_AssignLabelPlot ( void  )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!ATTENZIONE|||

Definition at line 1661 of file Spat_Plot.c.

References spectrumheader::altitude, BlindPix, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdmin, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, das::DOption, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, optionini::filtertype, IDX, IDY, spectrumheader::latitude, viewformobj::lblalt, viewformobj::lblAzimuth, viewformobj::lblccdex, viewformobj::lblccdey, viewformobj::lblccdsx, viewformobj::lblccdsy, viewformobj::lblccdtemp, viewformobj::lblccdtexp, viewformobj::lblccdwx, viewformobj::lblccdwy, viewformobj::lbldate, viewformobj::lblfilter, viewformobj::lbllat, viewformobj::lblloc, viewformobj::lbllong, viewformobj::lblmax, viewformobj::lblmin, viewformobj::lblmirpos, viewformobj::lblndfilter, viewformobj::lblnr, viewformobj::lblnummeas, viewformobj::lblsza, viewformobj::lbltime, viewformobj::lblvb, viewformobj::lblwaveleng, viewformobj::lblZenith, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, MObjectSetText(), NDFil_Code, bil::SPH, spectrumheader::sza, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, bil::VFO, and spectrumheader::wavelen.

Referenced by ReadHeader_ASCII(), ViewNext_BIN(), and Visualizza().

1662 {
1663 
1664  unsigned char str[128];
1665 
1666 
1667  sprintf(str,"%s",BIL.SPH.location);
1668  MObjectSetText(BIL.VFO.lblloc, str);
1669 
1670  sprintf(str,"%.2lf", BIL.SPH.latitude);
1671  MObjectSetText(BIL.VFO.lbllat, str);
1672 
1673  sprintf(str,"%.2lf", BIL.SPH.longitude);
1674  MObjectSetText(BIL.VFO.lbllong, str);
1675 
1676  sprintf(str,"%u", BIL.SPH.altitude);
1677  MObjectSetText(BIL.VFO.lblalt, str);
1678 
1679  sprintf(str,"%.2lf", BIL.SPH.sza);
1680  MObjectSetText(BIL.VFO.lblsza, str);
1681 
1682  sprintf(str,"%.2lf", (float)BIL.SPH.dummy1/100);
1684 
1685  sprintf(str,"%.2lf", (float)BIL.SPH.dummy2/100);
1687 
1688 
1689 
1690  sprintf(str,"%d/%02d/%02d", BIL.SPH.DATE.da_year,BIL.SPH.DATE.da_mon, BIL.SPH.DATE.da_day);
1691  MObjectSetText(BIL.VFO.lbldate, str);
1692 
1693  sprintf(str,"%02d:%02d:%02d", BIL.SPH.TIME.ti_hour, BIL.SPH.TIME.ti_min, BIL.SPH.TIME.ti_sec);
1694  MObjectSetText(BIL.VFO.lbltime, str);
1695 
1697 
1698  sprintf(str,"%d", BIL.SPH.wavelen);
1700 
1702 
1703 
1704  /***********************************************************************/
1705  //Neutral Density Filter section
1706  if(DAS.DOption.filtertype == 1) // Double filter wheel
1707  {
1708 
1710 
1711 
1712  }
1713  if(DAS.DOption.filtertype == 2) // Filter Wheel + Torque motor
1714  {
1715  if (BIL.SPH.dummy3)
1717  else
1719 
1720  }
1721 
1722 
1723 
1724  /***********************************************************************/
1725 
1726 
1727 
1728 
1729  sprintf(str,"%.2lf", BIL.SPH.ccdtemp);
1731 
1732  sprintf(str,"%.3lf", BIL.SPH.ccdtexp);
1734 
1735  sprintf(str,"%d", BIL.SPH.dummy4);
1737 
1738  sprintf(str,"%u", BIL.SPH.ccdmax);
1739  MObjectSetText(BIL.VFO.lblmax, str);
1740 
1741  sprintf(str,"%u", BIL.SPH.ccdmin);
1742  MObjectSetText(BIL.VFO.lblmin, str);
1743 
1744 
1745  sprintf(str,"%d", BIL.SPH.ccdwx);
1747 
1748  sprintf(str,"%d", BIL.SPH.ccdwy);
1750 
1751 
1752 
1753  sprintf(str,"%d", BIL.SPH.ccdsx);
1755 
1756  sprintf(str,"%d", BIL.SPH.ccdsy);
1758 
1759  sprintf(str,"%d", BIL.SPH.ccdex);
1761 
1762  sprintf(str,"%d", BIL.SPH.ccdey);
1764 
1765  sprintf(str,"%d", BIL.SPH.ccdvb);
1766  MObjectSetText(BIL.VFO.lblvb, str);
1767 
1768  sprintf(str,"%d", BIL.SPH.ccdnr);
1769  MObjectSetText(BIL.VFO.lblnr, str);
1770 
1771  //IDX = BIL.SPH.ccdex - BIL.SPH.ccdsx + 1;
1772 
1773  IDX = BIL.SPH.ccdwx;
1775 
1776  //if (DAS.Paramini.EqType == SPATRAM2 || DAS.Paramini.EqType == GASCODNG3 || DAS.Paramini.EqType == GASCODNG4)
1777  if(BIL.SPH.ccdwy == 256)
1778  IDY = BIL.SPH.ccdnr + 1;
1779  else
1780  IDY = BIL.SPH.ccdnr;
1781 
1782  if(BIL.SPH.ccdnr == 253)
1783  {
1784  IDY = IDY + 1;
1785  }
1786 
1787  if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
1788  {
1789 
1790  BlindPix = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
1791 
1792  }
1793 
1794 
1795 
1796 }
struct ddate DATE
Definition: bildef.h:134
MOBJECT lblmin
Definition: bildef.h:54
unsigned int ccdmax
Definition: bildef.h:142
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
optionini DOption
Options for DAS execution.
MOBJECT lblccdwx
Definition: bildef.h:55
MOBJECT lblccdtexp
Definition: bildef.h:44
das DAS
DAS structure.
Definition: Spat_Plot.c:39
MOBJECT lblndfilter
Definition: bildef.h:42
MOBJECT lblmax
Definition: bildef.h:53
MOBJECT lblfilter
Definition: bildef.h:41
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
unsigned int altitude
Altitude of the Station.
Definition: bildef.h:131
MOBJECT lblccdsx
Definition: bildef.h:57
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
MOBJECT lblccdey
Definition: bildef.h:60
unsigned char ti_hour
Definition: bildef.h:79
void MObjectSetText(MOBJECT obj, const char *text)
MOBJECT lblnr
Definition: bildef.h:62
MOBJECT lblloc
Definition: bildef.h:48
MOBJECT lbllat
Definition: bildef.h:49
MOBJECT lblccdtemp
Definition: bildef.h:43
MOBJECT lblZenith
Definition: bildef.h:72
MOBJECT lblalt
Definition: bildef.h:51
unsigned char ti_sec
Definition: bildef.h:81
char filpos[5]
Definition: bildef.h:139
MOBJECT lblsza
Definition: bildef.h:52
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
MOBJECT lblccdwy
Definition: bildef.h:56
MOBJECT lbltime
Definition: bildef.h:38
MOBJECT lblAzimuth
Definition: bildef.h:73
MOBJECT lblvb
Definition: bildef.h:61
float ccdtexp
Definition: bildef.h:140
MOBJECT lblccdsy
Definition: bildef.h:58
unsigned char ti_min
Definition: bildef.h:78
MOBJECT lbldate
Definition: bildef.h:37
float longitude
Longitude of the Station.
Definition: bildef.h:130
unsigned char da_mon
Definition: bildef.h:86
bil BIL
Definition: Spat_Plot.c:35
MOBJECT lbllong
Definition: bildef.h:50
float latitude
Latitude of the Station.
Definition: bildef.h:129
unsigned char da_day
Definition: bildef.h:85
char location[4]
Name of the Station (BLQ, LPA, EVR, TNB, DMC.....)
Definition: bildef.h:128
viewformobj VFO
Definition: bildef.h:255
short int da_year
Definition: bildef.h:84
float ccdtemp
Definition: bildef.h:141
char * NDFil_Code[]
const char array for the realisation of the Filters buttons in the ND Filter shell ...
Definition: DAS_Spat.c:219
int BlindPix
Number of blind pixels (usefull for Dark Current)
Definition: DAS_Spat.c:120
unsigned int ccdmin
Definition: bildef.h:143
MOBJECT lblnummeas
Definition: bildef.h:45
MOBJECT lblwaveleng
Definition: bildef.h:40
float sza
Solar Zenith Angle.
Definition: bildef.h:132
MOBJECT lblccdex
Definition: bildef.h:59
MOBJECT lblmirpos
Definition: bildef.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_AssignOrigin()

void D_AssignOrigin ( MOBJECT  obj)

Definition at line 432 of file Spat_Plot.c.

References bil::DPLOT, d_view::eX, d_view::eY, d_view::hsize, MObjectGetHeight(), MObjectGetWidth(), d_view::oX, d_view::oY, and d_view::wsize.

Referenced by D_pbr_CB(), DrawAreaPlotCB(), and LoadIo().

433 {
434 
437 
438  BIL.DPLOT.oX = 10; //Origine asse X
439  BIL.DPLOT.oY = BIL.DPLOT.hsize - 10; //Origine asse Y
440  BIL.DPLOT.eX = BIL.DPLOT.wsize - 10; //Fine asse X
441  BIL.DPLOT.eY = 10; //Fine asse Y
442 
443 
444 }
int MObjectGetHeight(MOBJECT obj)
int oY
Definition: bildef.h:183
int oX
Definition: bildef.h:183
int MObjectGetWidth(MOBJECT obj)
d_view DPLOT
Definition: bildef.h:254
int wsize
Definition: bildef.h:182
int eX
Definition: bildef.h:183
int eY
Definition: bildef.h:183
bil BIL
Definition: Spat_Plot.c:35
int hsize
Definition: bildef.h:182
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_findmaxmin()

int D_findmaxmin ( unsigned short  plotmat[],
int  xinf,
int  xsup,
int  yinf,
int  ysup,
int  bp 
)

Definition at line 635 of file Spat_Plot.c.

References bil::DPLOT, d_view::Imax, and d_view::Imin.

Referenced by D_pbr_CB(), and DrawAreaPlotCB().

636 {
637 
638  int t, j;
639 
640  unsigned int low = 65535;
641  unsigned int high= 0;
642 
643  for(t = yinf; t < ysup; t++)
644  {
645  for(j = xinf; j < xsup; j++)
646  {
647  if (bp != 0)
648  {
649  if (j < xsup - bp)
650  {
651  if(plotmat[t * xsup + j] < low) low = plotmat[t * xsup + j];
652  if(plotmat[t * xsup + j] > high) high = plotmat[t * xsup + j];
653  }
654  }
655  else
656  {
657  if(plotmat[t * xsup + j] < low) low = plotmat[t * xsup + j];
658  if(plotmat[t * xsup + j] > high) high = plotmat[t * xsup + j];
659  }
660  }
661  }
662  BIL.DPLOT.Imin = low;
663  BIL.DPLOT.Imax = high;
664  return 0;
665 }
unsigned int Imax
Definition: bildef.h:177
unsigned int Imin
Definition: bildef.h:178
d_view DPLOT
Definition: bildef.h:254
bil BIL
Definition: Spat_Plot.c:35
+ 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_PButt_CB()

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

Definition at line 3320 of file Spat_Plot.c.

References _MAX_PATH, FB_PREFS::allow_dir_create, FB_PREFS::allow_dir_delete, FB_PREFS::allow_dir_rename, FB_PREFS::bg_image_file, FB_PREFS::button_font, FB_PREFS::change_cwd, CloseFile(), CloseFile_BIN(), ClosePlotCB(), ContFP, D_Lens(), D_PlotTools(), d_fileman::DATADIRECTORY, DB_Column(), DB_Save(), d_fileman::DBFILENAME, bil::DFILEM, DI_FileExist(), DI_FindExtName(), das::DOption, bil::DPLOT, d_view::drawapl, False, FBIF, FDAT, optionini::filename, d_fileman::FKIND, FB_PREFS::font, HELV_SMALL, d_fileman::HOMEDIRECTORY, IDX, IDY, MDCreateDASConfig(), MFileBrowseExt(), MMessageDialog(), MObjectGetText(), MObjectSetBackgroundRGB(), NFDATI, NFileNameF, NUMFDATI, PrintObject(), REL_FILE_POS, optionini::savingmode, SetAsIo(), SetupPrinter(), FB_PREFS::transparent_tree, True, bil::VFO, viewformobj::View_Sh, ViewNext(), ViewNext_BIN(), ViewPre(), ViewPre_BIN(), and Visualizza().

Referenced by ViewPlot().

3321 {
3322 
3323  int c = (int) ad, er = 0;
3324  unsigned int *KDAT = 0;
3325  char buff[_MAX_PATH];
3326  char NFileNameF[_MAX_PATH];
3327  char str[_MAX_PATH];
3328  char fext[5];
3329  int l;
3330  char fname[128];
3331 
3332  FB_PREFS fbp;
3333 // strcpy (dirname, MGetCurrentDirectory ());
3334  fname[0] = '\0';
3335  NFileNameF[0]= '\0';
3336  memset (&fbp, 0, sizeof (fbp));
3337 
3338  fbp.change_cwd = True;
3339  fbp.allow_dir_create = True;
3340  fbp.allow_dir_rename = True;
3341  fbp.allow_dir_delete = True;
3342  fbp.transparent_tree = False;
3343  fbp.font = HELV_SMALL;
3344  fbp.button_font = HELV_SMALL;
3345  //Set Img file
3346  sprintf(str, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "sys\\Tile2.bmp" );
3347  fbp.bg_image_file =str;
3348 
3349  switch (c)
3350  {
3351  case 0:
3352  MObjectGetText(p, buff);
3353  if(strcmp(buff,"Open")== 0)
3354  {
3355  //Open File For Plotting
3356  if(DAS.DOption.savingmode)
3357  er = MFileBrowseExt ("Select File for Plotting", "*.bif", fname, BIL.DFILEM.DATADIRECTORY, &fbp);
3358  else
3359  er = MFileBrowseExt ("Select File for Plotting", "*.dat", fname, BIL.DFILEM.DATADIRECTORY, &fbp);
3360  if(er)
3361  {
3362  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",BIL.DFILEM.DATADIRECTORY, fname);
3363  l = strlen(fname);
3364  strncpy(buff, fname+l-4, 4);
3365 
3366  if( (strcmp(buff,".dat") == 0) |(strcmp(buff,".Dat") == 0) )
3367  BIL.DFILEM.FKIND = FDAT;
3368  else if( (strcmp(buff,".bif") == 0) | (strcmp(buff,".Bif") == 0) )
3369  BIL.DFILEM.FKIND = FBIF;
3370  else if( (strcmp(buff,".bhg") == 0) | (strcmp(buff,".Bhg") == 0) )
3371  BIL.DFILEM.FKIND = FBIF;
3372  else
3373  {
3374  MMessageDialog("DAS information", "Unsupported format!!", " Ok ", NULL);
3375  break;
3376  }
3378  }
3379  else
3380  break;
3381  }
3382  else //Saving Image
3383  {
3384  //DB_SavingFile(.....)
3385  //NON PUO' SALVARE CON IL NOME AUTOMATICO
3386  if(DAS.DOption.filename) // Automatic file Names
3387  {
3388  er = MMessageDialog("DAS Information", "You can NOT save this spectrum with the Automatic File names mode.\nTo set the FREE FILE's NAME, please open DAS CONFIG-->\nOptions Tab-->Page1-->Saving File Names = FREE\n\nDO you want to Open the Config Panel? ", "Yes", "No", NULL);
3389  if (er == 0)
3390  //Open the Config
3391  MDCreateDASConfig();
3392  else if (er == 1)
3393  break;
3394 
3395  //D_Saving();
3396  }
3397  else // free choice
3398  {
3399  if(DAS.DOption.savingmode)
3400  er = MFileBrowseExt ("Save File as...", "*.bif", NFileNameF, BIL.DFILEM.DATADIRECTORY, &fbp);
3401  else
3402  er = MFileBrowseExt ("Save File as...", "*.dat", NFileNameF, BIL.DFILEM.DATADIRECTORY, &fbp);
3403  if(er)
3404  {
3405  //check the presence of the extension
3406  DI_FindExtName(NFileNameF, fext);
3407  if( strcmp(fext,"") == 0 )
3408  {
3409  if(DAS.DOption.savingmode)
3410  strcat(NFileNameF, ".bif");
3411  else
3412  strcat(NFileNameF, ".dat");
3413  }
3414  //check the the extension
3415  DI_FindExtName(NFileNameF, fext);
3416  if( (strcmp(fext,".dat") == 0) | (strcmp(fext,".Dat") == 0) )
3417  {
3418  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",BIL.DFILEM.DATADIRECTORY, NFileNameF);
3419  //Check the existence of the typed file
3420  if(DI_FileExist(BIL.DFILEM.DBFILENAME)) // DI_FileExist --> Return: 1 if PATH exist, else return 0
3421  {
3422  er = MMessageDialog("DAS Information", "The selected file already exists\nDo you want to ", "Overwrite", "Append", "Cancel", NULL);
3423  if (er == 0)
3424  {
3425 
3426  }
3427  else if (er == 1)
3428  {
3429  er = MMessageDialog("DAS Information", "In wich format do you want to save this file? ", "DAS Format", "Column Format" , NULL);
3430  if (er == 0)
3432  else
3434 
3435  }
3436  else if (er == 2)
3437  break;
3438  }
3439  else
3440  {
3441  er = MMessageDialog("DAS Information", "In wich format do you want to save this file? ", "DAS Format", "Column Format" , NULL);
3442  if (er == 0)
3444  else
3446 
3447 
3448 
3449  }
3450  }
3451  else if( (strcmp(fext,".bif") == 0) | (strcmp(fext,".Bif") == 0) )
3452  {
3453  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",BIL.DFILEM.DATADIRECTORY, NFileNameF);
3454  //Check the existence of the typed file
3455  if(DI_FileExist(BIL.DFILEM.DBFILENAME)) // DI_FileExist --> Return: 1 if PATH exist, else return 0
3456  {
3457  er = MMessageDialog("DAS Information", "The selected file already exists\nDo you want to ", "Overwrite", "Append", "Cancel", NULL);
3458  if (er == 0)
3459  {
3460 
3461  }
3462  else if (er == 1)
3464  else if (er == 2)
3465  break;
3466 
3467 
3468  }
3469  else
3471  }
3472  else
3473  {
3474  sprintf(buff, "The extension is not recognaized! Please re-type",fext);
3475  MMessageDialog("DAS information", buff, " Ok ", NULL);
3476  break;
3477  }
3478  }
3479  }
3480  }
3481  break;
3482  case 1:
3483  switch (BIL.DFILEM.FKIND)
3484  {
3485  case FDAT:
3486  ViewNext(NUMFDATI);
3487  break;
3488  case FBIF:
3490  break;
3491  }
3492  break;
3493  case 8:
3494  switch (BIL.DFILEM.FKIND)
3495  {
3496  case FDAT:
3498  break;
3499  case FBIF:
3501  break;
3502  }
3503  break;
3504 
3505  case 2:
3506  SetAsIo();
3507  break;
3508  case 3:
3509  switch (BIL.DFILEM.FKIND)
3510  {
3511  case FDAT:
3513  break;
3514  case FBIF:
3516  break;
3517  }
3518  MObjectSetBackgroundRGB(BIL.DPLOT.drawapl, 220, 220, 220);
3519  break;
3520  case 4:
3521  SetupPrinter();
3522 
3523  er = PrintObject(BIL.VFO.View_Sh, PM_FULL, -1, -1 );
3524  if (er)
3525  MMessageDialog("ALERT", "Print Problems", "Ok", NULL);
3526  break;
3527  case 5:
3528  ClosePlotCB(BIL.VFO.View_Sh, 0, 0);
3529  break;
3530  case 6:
3531 
3532  D_Lens();
3533  break;
3534  case 7:
3535  //SaveImage(DJPEG,0,0,0); //Save JPEG image
3536  D_PlotTools();
3537  break;
3538 // case 8:
3539 // break;
3540 
3541  }
3542 
3543 // return 0;
3544 
3545 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
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
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
CARD8 change_cwd
Definition: Mguidefs.h:1485
int ViewPre(FILE *nf, long position)
Definition: Spat_Plot.c:2241
int ContFP
Counter for File position.
Definition: DAS_Spat.c:123
das DAS
DAS structure.
Definition: Spat_Plot.c:39
int ViewPre_BIN(int nf, long position)
Definition: Spat_Plot.c:2263
CARD8 allow_dir_create
Definition: Mguidefs.h:1487
MOBJECT MDCreateDASConfig(void)
DAS Config shell. Procedure that build the shell for the DAS Config panels. The DAS Config allow for ...
void D_PlotTools(void)
Definition: Spat_Plot.c:2818
MTFont button_font
Definition: Mguidefs.h:1501
CARD8 allow_dir_delete
Definition: Mguidefs.h:1493
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
MTFont font
Definition: Mguidefs.h:1499
#define False
Definition: Mguidefs.h:236
void SetupPrinter(void)
Definition: D_print.c:14
char DATADIRECTORY[_MAX_PATH]
Definition: bildef.h:201
char * MObjectGetText(MOBJECT obj, char *text)
FILE * NUMFDATI
Definition: Bil.h:26
void DB_Save(char *tit, int mod)
Save the acquired spectrum. Procedure that Save the acquired spectrum.
Definition: Save.c:552
int PrintObject(MOBJECT obj, int mode, int x, int y)
Definition: D_print.c:37
long REL_FILE_POS[51]
relative File position
Definition: DAS_Spat.c:124
#define FDAT
Definition: bildef.h:221
int FKIND
Definition: bildef.h:211
void ClosePlotCB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:2514
File Browser Preferences. Used by the Utility functions MFileBowserExt() and MDirBowserExt().
Definition: Mguidefs.h:1482
CARD8 transparent_tree
Definition: Mguidefs.h:1495
d_fileman DFILEM
Definition: bildef.h:257
d_view DPLOT
Definition: bildef.h:254
#define HELV_SMALL
Definition: Mguidefs.h:881
char NFileNameF[32]
Definition: CreateForms.c:71
int NFDATI
Definition: Bil.h:27
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
void CloseFile(FILE *fd, int hp, int vp)
Definition: Spat_Plot.c:1304
int MFileBrowseExt(const char *t, const char *ext, char *fname, char *dname, FB_PREFS *prefs)
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
int ViewNext_BIN(int nf)
Definition: Spat_Plot.c:2284
const char * bg_image_file
Definition: Mguidefs.h:1519
MOBJECT View_Sh
Definition: bildef.h:35
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
static double p
Definition: SOLPOS.C:131
bil BIL
Definition: Spat_Plot.c:35
int Visualizza(int mod, char *nomefile)
Definition: Spat_Plot.c:2069
#define True
Definition: Mguidefs.h:235
viewformobj VFO
Definition: bildef.h:255
C_DEF void DI_FindExtName(char *fullname, char *fext)
int SetAsIo(void)
Definition: Spat_Plot.c:3126
void D_Lens(void)
Definition: D_Zoom.c:138
int filename
Flag to set file name mode 0=Free choice, 1 = Automatic.
CARD8 allow_dir_rename
Definition: Mguidefs.h:1490
MOBJECT drawapl
Definition: bildef.h:172
C_DEF int DI_FileExist(char *tit)
int DB_Column(char *sourcefilename)
Column format.
Definition: Save.c:1109
int ViewNext(FILE *nf)
Definition: Spat_Plot.c:2365
#define FBIF
Definition: bildef.h:229
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_PlotAxis()

void D_PlotAxis ( MOBJECT  ob,
MIMAGE  mim,
int  sx,
int  sy,
int  ex,
int  ey,
MTColor  col 
)

Definition at line 448 of file Spat_Plot.c.

References DrawXLine(), DrawYLine(), and MDrawLine().

Referenced by D_pbr_CB(), DrawAreaPlotCB(), and LoadIo().

449 {
450 
451  //Axis Y Left
452  //DrawArea
453  MDrawLine(ob, sx, sy, sx, ey, col);
454  //Image
455  DrawYLine(mim, sx, ey, sy, 0,0,0);
456 
457  //Axis X Down
458  //DrawArea
459  MDrawLine(ob, sx, sy, ex, sy, col);
460  DrawXLine(mim, sy, sx, ex + 1, 0,0,0);
461 
462  //Axis X Up
463  //DrawArea
464  MDrawLine(ob, sx, ey, ex, ey, col);
465  DrawXLine(mim, sx, sx, ex, 0,0,0);
466 
467  //Axis Y Right
468  //DrawArea
469  MDrawLine(ob, ex, sy, ex, ey, col);
470  DrawYLine(mim, ex, ey, sy, 0,0,0);
471 
472 }
void DrawXLine(MIMAGE img, int yfix, int xs, int xe, int r, int g, int b)
Definition: Spat_Plot.c:423
void MDrawLine(MOBJECT p, int x1, int y1, int x2, int y2, MTColor col)
Definition: Dildef.h:392
void DrawYLine(MIMAGE img, int xfix, int ys, int ye, int r, int g, int b)
Definition: Spat_Plot.c:404
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_PlotGrid()

void D_PlotGrid ( MOBJECT  ob,
MIMAGE  mim,
int  sx,
int  sy,
int  ex,
int  ey 
)

Definition at line 476 of file Spat_Plot.c.

References DrawXLine(), DrawYLine(), mtcl::green, MDrawLine(), MTCL, and mtcl::white.

Referenced by D_pbr_CB(), DrawAreaPlotCB(), and LoadIo().

477 {
478  int X1, X, Y1, Y;
479  int j;
480  double incry, incrx;
481  // Y Grid
482  incry = (sy - ey) / 10;
483  for(j = 1; j < 10; j++)
484  {
485  X = sx +1 ;
486  Y = sy - ((int)incry * j);
487  X1 = ex;
488  Y1 = sy - ((int)incry * j);
489  MDrawLine(ob, X, Y, X1, Y1, MTCL.white);
490  DrawXLine(mim, Y, X, X1, 255,255,255);
491 
492  }
493  //X Grid
494  incrx = (double)(ex - sx) / 16.0;
495  for(j = 1; j < 16; j++)
496  {
497  X = sx + 1 + ((int)incrx * j);
498  Y = sy;
499  X1 = sx + 1 + ((int)incrx * j);
500  Y1 = ey + 1;
501  if(j == 8)
502  {
503  MDrawLine(ob, X, Y, X1, Y1, MTCL.green);
504  DrawYLine(mim, X, Y1, Y, 0, 255, 0);
505  }
506  else
507  {
508  MDrawLine(ob, X, Y, X1, Y1, MTCL.white);
509  DrawYLine(mim, X, Y1, Y, 255,255,255);
510  }
511  }
512 }
mtcl MTCL
Definition: 2DPlot.c:30
void DrawXLine(MIMAGE img, int yfix, int xs, int xe, int r, int g, int b)
Definition: Spat_Plot.c:423
void MDrawLine(MOBJECT p, int x1, int y1, int x2, int y2, MTColor col)
MTColor white
MTColor green
void DrawYLine(MIMAGE img, int xfix, int ys, int ye, int r, int g, int b)
Definition: Spat_Plot.c:404
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_PlotOneLine()

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 at line 669 of file Spat_Plot.c.

References mtcl::black, DrawImg(), MIMAGE_DESCR::img_h, MDrawLine(), MObjectSetColor(), MTCL, mtcl::white, and mtcl::yellow.

Referenced by D_pbr_CB().

672 {
673 
674  int X1, X, Y1, Y, j;
675  if (sel)
677  else
678  MObjectSetColor(pb[n], pe[n], MTCL.white);
679 
680  for(j = 0; j < idx; j++)
681  {
682  if (bp != 0)
683  {
684  if (j < idx - bp)
685  {
686  X = (int) (ox + (j * costx));
687  Y = (int) (oy - abs((int)((double)(plotmat[n * idx + j] - min) / costy)));
688  X1 = (int) (ox + (j + 1) * costx);
689  Y1 = (int) (oy - abs((int)((double)(plotmat[n * idx + j + 1] - min) / costy)));
690  }
691  }
692  else
693  {
694  X = (int) (ox + (j * costx));
695  Y = (int) (oy - abs((int)((double)(plotmat[n * idx + j] - min) / costy)));
696  X1 = (int) (ox + (j + 1) * costx);
697  Y1 = (int) (oy - abs((int)((double)(plotmat[n * idx + j + 1] - min) / costy)));
698  }
699 
700  if (sel)
701  {
702  MDrawLine(obj, X, Y, X1, Y1, MTCL.yellow);
703  if (Y <= (int) mim->img_h)
704  DrawImg(mim, 10 , j, X, Y);
705 
706  }
707  else
708  {
709  MDrawLine(obj, X, Y, X1, Y1, pe[n]);
710 // DrawImg(mim, n + 2 , j, X, Y);
711  }
712  }
713 }
void MObjectSetColor(MOBJECT obj, MTColor bgc, MTColor fgc)
mtcl MTCL
Definition: 2DPlot.c:30
unsigned int img_h
Definition: Mguidefs.h:447
void MDrawLine(MOBJECT p, int x1, int y1, int x2, int y2, MTColor col)
MTColor black
MTColor yellow
MTColor white
void DrawImg(MIMAGE img, int a, int c, int x, int y)
Definition: Spat_Plot.c:370
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_PlotTools()

void D_PlotTools ( void  )

Definition at line 2818 of file Spat_Plot.c.

References ActEditCB(), palette::DB_BG, DB_DisplayCB(), DB_FilterCB(), DB_SpikesCB(), False, doas::FFTFilter, FIXED_SMALL, tools::FlagDisplay, tools::FlagFilter, tools::FlagSpikes, lbl, LEFT_ALIGN, MCreateClippedEdit(), MCreateLabel(), MCreatePButton(), MCreateRButton(), MCreateRowForm(), MCreateShell(), MCreateTableForm(), MEditSetActCallback(), MEditSetValCallback(), MFormSetSpacing(), MLabelSetAlignment(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetCompositeWidth(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetTransparency(), MPButtonSetCallback(), MRButtonActivate(), MShellRealizeXY(), p, PlotToolsPBs(), tools::Sh_PlotTools, TOOLS, TOP_ALIGN, True, and ValidateCB().

Referenced by D_PButt_CB(), and MenuToolsOLP_CB().

2819 {
2820 
2821  MOBJECT tb, rowf, lbl, lbl1, wfedt, rb, pb;
2822  char str[32];
2823  int k,*p;
2824 
2825  TOOLS.Sh_PlotTools = MCreateShell("PLOT TOOLS", 0);
2829 
2830 
2832  MFormSetSpacing(rowf, 1);
2834 
2835  lbl = MCreateLabel(rowf, "FILTER", FIXED_SMALL);
2837  MObjectSetForegroundRGB(lbl, 255, 255, 255);
2838  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
2839  MObjectSetTransparency(lbl, 0);
2840 
2841 
2842  tb = MCreateTableForm(rowf, 2);
2843  MObjectSetBackgroundRGB(tb, 112, 128, 112);
2844  MObjectSetResize(tb, True, False);
2846 
2847  rb = MCreateRButton(tb, "Disabled", FIXED_SMALL);
2848  MPButtonSetCallback(rb, DB_FilterCB, (void *) 0);
2850  MObjectSetForegroundRGB(rb, 255, 255, 255);
2851  MObjectSetCompositeWidth(rb, 85);
2852  if(TOOLS.FlagFilter == 0)
2853  MRButtonActivate(rb);
2854 
2855  rb= MCreateRButton(tb, "Enabled", FIXED_SMALL);
2856  MPButtonSetCallback(rb, DB_FilterCB, (void *) 1);
2858  MObjectSetForegroundRGB(rb, 255, 255, 255);
2859  MObjectSetCompositeWidth(rb, 123);
2860  if(TOOLS.FlagFilter == 1)
2861  MRButtonActivate(rb);
2862 
2863 
2864 
2865  lbl1 = MCreateLabel(tb, "Window Filter:", FIXED_SMALL);
2867  MObjectSetForegroundRGB(lbl1, 255, 255, 255);
2868  MObjectSetTransparency(lbl1, 0);
2869  MObjectSetResize(lbl1, False, False);
2871 
2872 
2873  sprintf(str,"%d",DOAS.FFTFilter);
2874  wfedt = MCreateClippedEdit(tb, str, 10, 5, FIXED_SMALL);
2875  MObjectSetForegroundRGB(wfedt, 255, 255, 255);
2876  MObjectSetBackgroundRGB(wfedt, 40, 96, 72);
2877 // MObjectSetCompositeWidth(level, 35);
2879  k = 150;
2880  p = (void *) k;
2881  MEditSetValCallback(wfedt, ValidateCB, p);
2882  MEditSetActCallback(wfedt, ActEditCB, p);
2883 
2884 
2885 
2886  lbl = MCreateLabel(rowf, "REMOVE SPIKES", FIXED_SMALL);
2888  MObjectSetForegroundRGB(lbl, 255, 255, 255);
2889  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
2890  MObjectSetTransparency(lbl, 0);
2891 
2892 
2893  tb = MCreateTableForm(rowf, 2);
2894  MObjectSetBackgroundRGB(tb, 112, 128, 112);
2895  MObjectSetResize(tb, True, False);
2897 
2898  rb = MCreateRButton(tb, "No", FIXED_SMALL);
2899  MPButtonSetCallback(rb, DB_SpikesCB, (void *) 0);
2901  MObjectSetForegroundRGB(rb, 255, 255, 255);
2902  MObjectSetCompositeWidth(rb, 85);
2903  if(TOOLS.FlagSpikes == 0)
2904  MRButtonActivate(rb);
2905 
2906  rb= MCreateRButton(tb, "Yes", FIXED_SMALL);
2907  MPButtonSetCallback(rb, DB_SpikesCB, (void *) 1);
2909  MObjectSetForegroundRGB(rb, 255, 255, 255);
2910  MObjectSetCompositeWidth(rb, 123);
2911  if(TOOLS.FlagSpikes == 1)
2912  MRButtonActivate(rb);
2913 
2914  /*
2915  TOOLS.Spikes[0] = MCreateRButton(tb, "No", FIXED_SMALL);
2916  MPButtonSetCallback(TOOLS.Spikes[0], DB_SpikesCB, (void *) 0);
2917  MObjectAlign(TOOLS.Spikes[0], LEFT_ALIGN, TOP_ALIGN);
2918  MObjectSetForegroundRGB(TOOLS.Spikes[0], 255, 255, 255);
2919  MObjectSetCompositeWidth(TOOLS.Spikes[0], 85);
2920 
2921  TOOLS.Spikes[1]= MCreateRButton(tb, "Yes", FIXED_SMALL);
2922  MPButtonSetCallback(TOOLS.Spikes[1], DB_SpikesCB, (void *) 1);
2923  MObjectAlign(TOOLS.Spikes[1], LEFT_ALIGN, TOP_ALIGN);
2924  MObjectSetForegroundRGB(TOOLS.Spikes[1], 255, 255, 255);
2925  MObjectSetCompositeWidth(TOOLS.Spikes[1], 123);
2926 
2927  if(TOOLS.FlagSpikes)
2928  MRButtonActivate(TOOLS.Spikes[1]);
2929  else
2930  MRButtonActivate(TOOLS.Spikes[0]);
2931 
2932 */
2933  lbl = MCreateLabel(rowf, "Display Spectrum", FIXED_SMALL);
2935  MObjectSetForegroundRGB(lbl, 255, 255, 255);
2936  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
2937  MObjectSetTransparency(lbl, 0);
2938 
2939 
2940  tb = MCreateTableForm(rowf, 1);
2941  MObjectSetBackgroundRGB(tb, 112, 128, 112);
2942  MObjectSetResize(tb, True, False);
2944 
2945  rb = MCreateRButton(tb, "Original", FIXED_SMALL);
2946  MPButtonSetCallback(rb, DB_DisplayCB, (void *) 0);
2948  MObjectSetForegroundRGB(rb, 255, 255, 255);
2949  MObjectSetCompositeWidth(rb, 85);
2950  if(TOOLS.FlagDisplay == 0)
2951  MRButtonActivate(rb);
2952 
2953  rb= MCreateRButton(tb, "Corrected", FIXED_SMALL);
2954  MPButtonSetCallback(rb, DB_DisplayCB, (void *) 1);
2956  MObjectSetForegroundRGB(rb, 255, 255, 255);
2957  MObjectSetCompositeWidth(rb, 123);
2958  if(TOOLS.FlagDisplay == 1)
2959  MRButtonActivate(rb);
2960 
2961  rb= MCreateRButton(tb, "Both", FIXED_SMALL);
2962  MPButtonSetCallback(rb, DB_DisplayCB, (void *) 2);
2964  MObjectSetForegroundRGB(rb, 255, 255, 255);
2965  MObjectSetCompositeWidth(rb, 123);
2966  if(TOOLS.FlagDisplay == 2)
2967  MRButtonActivate(rb);
2968 
2969 
2970  tb = MCreateTableForm(rowf, 1);
2971  MObjectSetBackgroundRGB(tb, 112, 128, 112);
2972  MObjectSetResize(tb, True, False);
2974 
2975  lbl = MCreateLabel(tb, "DOAS", FIXED_SMALL);
2977  MObjectSetForegroundRGB(lbl, 255, 255, 255);
2978  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
2979  MObjectSetTransparency(lbl, 0);
2980 
2981  pb= MCreatePButton(tb, "Load Io", FIXED_SMALL);
2982  MPButtonSetCallback(pb, PlotToolsPBs, (void *) 0);
2984  MObjectSetForegroundRGB(pb, 255, 255, 255);
2985  MObjectSetCompositeWidth(pb, 123);
2986 
2987  pb= MCreatePButton(tb, "Load ACS Matrix", FIXED_SMALL);
2988  MPButtonSetCallback(pb, PlotToolsPBs, (void *) 1);
2990  MObjectSetForegroundRGB(pb, 255, 255, 255);
2991 // MObjectSetCompositeWidth(pb, 123);
2992 
2993  pb= MCreatePButton(tb, "LogRatio (LR) Spectrum", FIXED_SMALL);
2994  MPButtonSetCallback(pb, PlotToolsPBs, (void *) 2);
2996  MObjectSetForegroundRGB(pb, 255, 255, 255);
2997 // MObjectSetCompositeWidth(pb, 123);
2998 
2999  pb= MCreatePButton(tb, "VarY(LR/smooth(LR))", FIXED_SMALL);
3000  MPButtonSetCallback(pb, PlotToolsPBs, (void *) 3);
3002  MObjectSetForegroundRGB(pb, 255, 255, 255);
3003 // MObjectSetCompositeWidth(pb, 123);
3004 
3005  pb= MCreatePButton(tb, "Results", FIXED_SMALL);
3006  MPButtonSetCallback(pb, PlotToolsPBs, (void *) 4);
3008  MObjectSetForegroundRGB(pb, 255, 255, 255);
3009  MObjectSetCompositeWidth(pb, 123);
3010 
3011 
3012  tb = MCreateTableForm(rowf, 3);
3013  MObjectSetBackgroundRGB(tb, 112, 128, 112);
3014  MObjectSetResize(tb, True, False);
3016 
3017  lbl = MCreateLabel(tb, "Shift", FIXED_SMALL);
3019  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3020  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
3021  MObjectSetTransparency(lbl, 0);
3022 
3023  lbl = MCreateLabel(tb, "K1", FIXED_SMALL);
3025  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3026  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
3027  MObjectSetTransparency(lbl, 0);
3028 
3029  lbl = MCreateLabel(tb, "K2", FIXED_SMALL);
3031  MObjectSetForegroundRGB(lbl, 255, 255, 255);
3032  MObjectSetBackgroundRGB(lbl, 48, 20, 255);
3033  MObjectSetTransparency(lbl, 0);
3034 
3035 
3036 /*
3037  TOOLS.Display[0] = MCreateRButton(tb, "Original", FIXED_SMALL);
3038  MPButtonSetCallback(TOOLS.Display[0], DB_DisplayCB, (void *) 0);
3039  MObjectAlign(TOOLS.Display[0], LEFT_ALIGN, TOP_ALIGN);
3040  MObjectSetForegroundRGB(TOOLS.Display[0], 255, 255, 255);
3041  MObjectSetCompositeWidth(TOOLS.Display[0], 85);
3042 
3043  TOOLS.Display[1]= MCreateRButton(tb, "Corrected", FIXED_SMALL);
3044  MPButtonSetCallback(TOOLS.Display[1], DB_DisplayCB, (void *) 1);
3045  MObjectAlign(TOOLS.Display[1], LEFT_ALIGN, TOP_ALIGN);
3046  MObjectSetForegroundRGB(TOOLS.Display[1], 255, 255, 255);
3047  MObjectSetCompositeWidth(TOOLS.Display[1], 123);
3048 
3049  TOOLS.Display[2]= MCreateRButton(tb, "Both", FIXED_SMALL);
3050  MPButtonSetCallback(TOOLS.Display[2], DB_DisplayCB, (void *) 2);
3051  MObjectAlign(TOOLS.Display[2], LEFT_ALIGN, TOP_ALIGN);
3052  MObjectSetForegroundRGB(TOOLS.Display[2], 255, 255, 255);
3053  MObjectSetCompositeWidth(TOOLS.Display[2], 123);
3054 
3055  if(TOOLS.FlagDisplay == 1)
3056  MRButtonActivate(TOOLS.Display[1]);
3057  else if(TOOLS.FlagDisplay == 2)
3058  MRButtonActivate(TOOLS.Display[2]);
3059  else if(TOOLS.FlagDisplay == 0)
3060  MRButtonActivate(TOOLS.Display[0]);
3061 */
3062 
3064 
3065 
3066 
3067 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lbl
Definition: DFileMan.c:42
palette DPAL
Definition: Spat_Plot.c:29
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 MObjectAlign(MOBJECT obj, int h_align, int v_align)
void ActEditCB(MOBJECT edit, char *text, void *ed)
Text Application callback Apply to the variables the text typed in various text box and validated by ...
void PlotToolsPBs(MOBJECT o, void *id, void *a_data)
Definition: Spat_Plot.c:2772
MOBJECT MCreateClippedEdit(MOBJECT parent, const char *text, int len, int clip_len, MTFont font)
MOBJECT Sh_PlotTools
Shell for plot tools.
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
void DB_FilterCB(MOBJECT p, void *od, void *ad)
Filter positioning callback.
Definition: Spat_Plot.c:2593
void MEditSetActCallback(MOBJECT edit, OBJ_STRING_CB cb, void *data)
#define FIXED_SMALL
Definition: Mguidefs.h:878
void ValidateCB(MOBJECT edit, EDIT_VAL *ev, void *ii)
Text Validation callback Validation callback for the text typed in different text box...
void MEditSetValCallback(MOBJECT edit, EDIT_VAL_CB cb, void *data)
void MRButtonActivate(MOBJECT o)
doas DOAS
Definition: Spat_Plot.c:37
void DB_DisplayCB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:2646
void MShellRealizeXY(MOBJECT obj, int x, int y)
int FFTFilter
Fast Fourier Trasform Filter windows.
Definition: DOASdef.h:25
MOBJECT MCreateShell(const char *title, int flags)
int FlagFilter
flag for filterinf
void DB_SpikesCB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:2620
short DB_BG[3]
Default Background Color.
MOBJECT MCreateRButton(MOBJECT parent, const char *text, MTFont font)
static double p
Definition: SOLPOS.C:131
int FlagDisplay
void MLabelSetAlignment(MOBJECT p, int align)
void MFormSetSpacing(MOBJECT p, int offset)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void MObjectSetCompositeWidth(MOBJECT obj, int w)
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT MCreateRowForm(MOBJECT parent)
tools TOOLS
Definition: CreateForms.c:81
#define TOP_ALIGN
Definition: Mguidefs.h:918
int FlagSpikes
+ Here is the call graph for this function:
+ 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:

§ DB_CloseImage()

int DB_CloseImage ( int  s)

Definition at line 1257 of file Spat_Plot.c.

References img::Bmat, image::BPAL, img::col, image::DimX, image::DimY, FLTIMG, img::Fmat, img::Gmat, image::GPAL, image::H, histogram::Histo, histogram::HistoShell, image::Iacc, img::Imat, dil::Img, image::Imim, INTIMG, image::iPAL, image::Isrv, image::LshX, image::LshY, image::Mat, MFreeColor(), MFreeImage(), MObjectGetHeight(), MObjectGetWidth(), MObjectGetX(), MObjectGetY(), MShellDestroy(), MShellUnrealize(), img::Rmat, image::RPAL, and img::type.

Referenced by CloseFile(), CloseFile_BIN(), ViewNext(), and ViewNext_BIN().

1258 {
1259  int c;
1260 
1261 
1262  DIL.Img.Iacc[s] = 0;
1263  DIL.Img.LshX[s] = MObjectGetX(DIL.Img.Isrv[s]);
1264  DIL.Img.LshY[s] = MObjectGetY(DIL.Img.Isrv[s]);
1265  DIL.Img.DimX[s] = MObjectGetWidth(DIL.Img.Isrv[s]);
1266  DIL.Img.DimY[s] = MObjectGetHeight(DIL.Img.Isrv[s]);
1267 
1269  MShellDestroy(DIL.Img.Isrv[s]);
1270  MFreeImage(DIL.Img.Imim[s]);
1273 
1274 
1275  if(DIL.Img.Mat[s].col)
1276  {
1277  free(DIL.Img.Mat[s].Rmat);
1278  free(DIL.Img.Mat[s].Gmat);
1279  free(DIL.Img.Mat[s].Bmat);
1280  }
1281  if(DIL.Img.Mat[s].type == INTIMG)
1282  free(DIL.Img.Mat[s].Imat);
1283  if(DIL.Img.Mat[s].type == FLTIMG)
1284  free(DIL.Img.Mat[s].Fmat);
1285  free(DIL.Img.H.Histo[s]);
1286 
1287  // DeAlloc palette
1288  if(DIL.Img.Mat[s].col)
1289  for(c = 0; c < 256; c++)
1290  {
1291  MFreeColor(DIL.Img.RPAL[s][c]);
1292  MFreeColor(DIL.Img.GPAL[s][c]);
1293  MFreeColor(DIL.Img.BPAL[s][c]);
1294  }
1295  else
1296  for(c = 0; c < 256; c++)
1297  MFreeColor(DIL.Img.iPAL[s][c]);
1298 
1299  return 0;
1300 }
U16 DimY[MAXIMG]
Definition: Dildef.h:577
U8 Iacc[MAXIMG]
Definition: Dildef.h:567
MTColor GPAL[MAXIMG][256]
Definition: Dildef.h:582
MTColor BPAL[MAXIMG][256]
Definition: Dildef.h:583
int MObjectGetX(MOBJECT obj)
int MObjectGetHeight(MOBJECT obj)
float * Histo[MAXIMG]
Definition: Dildef.h:545
#define FLTIMG
Definition: Dildef.h:12
U16 * Imat
Definition: Dildef.h:286
U16 LshY[MAXIMG]
Definition: Dildef.h:578
S16 type
Definition: Dildef.h:280
dil DIL
Definition: Spat_Plot.c:28
U16 * Gmat
Definition: Dildef.h:289
U16 DimX[MAXIMG]
Definition: Dildef.h:577
img Mat[MAXIMG]
Definition: Dildef.h:552
void MShellUnrealize(MOBJECT obj)
U16 * Rmat
Definition: Dildef.h:288
MIMAGE Imim[MAXIMG]
Definition: Dildef.h:563
image Img
Definition: Dildef.h:675
int MObjectGetWidth(MOBJECT obj)
void MShellDestroy(MOBJECT obj)
#define INTIMG
Definition: Dildef.h:10
MOBJECT HistoShell
Definition: Dildef.h:542
U16 LshX[MAXIMG]
Definition: Dildef.h:578
histogram H
Definition: Dildef.h:559
void MFreeImage(MIMAGE data)
S16 col
Definition: Dildef.h:284
int MObjectGetY(MOBJECT obj)
float * Fmat
Definition: Dildef.h:287
MTColor iPAL[MAXIMG][256]
Definition: Dildef.h:580
MTColor RPAL[MAXIMG][256]
Definition: Dildef.h:581
void MFreeColor(MTColor col)
MOBJECT Isrv[MAXIMG]
Definition: Dildef.h:565
U16 * Bmat
Definition: Dildef.h:290
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_DisplayCB()

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

Definition at line 2646 of file Spat_Plot.c.

References tools::FlagDisplay, GrafoIMG(), MRButtonGetActivationStatus(), ON_OFFLINEPLOT, and TOOLS.

Referenced by D_PlotTools().

2647 {
2648 
2649  int er = 0;
2650  int c = (int) ad;
2651 
2652 
2654 
2655  if(er)
2656  {
2657  switch (c)
2658  {
2659  case 0 :
2660  TOOLS.FlagDisplay = 0;
2661  break;
2662  case 1:
2663  TOOLS.FlagDisplay = 1;
2664  break;
2665  case 2:
2666  TOOLS.FlagDisplay = 2;
2667  break;
2668  }
2669  }
2670 
2672 
2673 }
int MRButtonGetActivationStatus(MOBJECT o)
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
static double p
Definition: SOLPOS.C:131
int FlagDisplay
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
tools TOOLS
Definition: CreateForms.c:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_EqTypePlotCB()

void DB_EqTypePlotCB ( MOBJECT  o,
void *  a,
void *  v 
)

Definition at line 3704 of file Spat_Plot.c.

References d_fileman::CONFIGDIRCOMMON, d_fileman::CONFIGDIREQUIPMENT, bil::DFILEM, paramini::EqType, GrafoIMG(), LoadDB_DispCoeff(), MRButtonGetActivationStatus(), ON_OFFLINEPLOT, das::Paramini, and WriteEquipini().

Referenced by ViewPlot().

3705 {
3706 
3707  int er = 0;
3708  int c = (int) v;
3709 
3710 
3712 
3713  if(er)
3714  {
3715  switch (c)
3716  {
3717  case 0:
3718  DAS.Paramini.EqType = 0; //SPATRAM;
3719  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAM",BIL.DFILEM.CONFIGDIRCOMMON);
3720  break;
3721  case 1:
3722  DAS.Paramini.EqType = 1; //TROPOGAS;
3723  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\TROPOGAS",BIL.DFILEM.CONFIGDIRCOMMON);
3724  break;
3725  case 2:
3726  DAS.Paramini.EqType = 2; //LIS;
3727  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\LIS",BIL.DFILEM.CONFIGDIRCOMMON);
3728  break;
3729  case 3:
3730  DAS.Paramini.EqType = 3; //SPATRAMPLUS;
3731  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAMPLUS",BIL.DFILEM.CONFIGDIRCOMMON);
3732  break;
3733  case 4:
3734  DAS.Paramini.EqType = 4; //GASCODNG1;
3735  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG1",BIL.DFILEM.CONFIGDIRCOMMON);
3736  break;
3737  case 5:
3738  DAS.Paramini.EqType = 5; //GASCODOffAxis;
3739  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODOA",BIL.DFILEM.CONFIGDIRCOMMON);
3740  break;
3741  case 6:
3742  DAS.Paramini.EqType = 6; //GASCODNG2;
3743  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG2",BIL.DFILEM.CONFIGDIRCOMMON);
3744  break;
3745  case 7:
3746  DAS.Paramini.EqType = 7; //GASCODNG3;
3747  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG3",BIL.DFILEM.CONFIGDIRCOMMON);
3748  break;
3749  case 8:
3750  DAS.Paramini.EqType = 8; //GASCODNG4;
3751  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\GASCODNG4",BIL.DFILEM.CONFIGDIRCOMMON);
3752  break;
3753  case 9:
3754  DAS.Paramini.EqType = 9; //SPATRAM2;
3755  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAM2",BIL.DFILEM.CONFIGDIRCOMMON);
3756  break;
3757  case 10:
3758  DAS.Paramini.EqType = 10; //SPATRAM3;
3759  sprintf(BIL.DFILEM.CONFIGDIREQUIPMENT, "%s\\SPATRAM3",BIL.DFILEM.CONFIGDIRCOMMON);
3760  break;
3761  }
3762  }
3763  //write on equipment.ini the new setting
3764  WriteEquipini();
3765  //Load dispersion coefficients for the selected instrument
3766  er = LoadDB_DispCoeff();
3767  //refresh plot
3769 
3770 }
int WriteEquipini(void)
Write equipment.ini file .
das DAS
DAS structure.
Definition: Spat_Plot.c:39
int MRButtonGetActivationStatus(MOBJECT o)
d_fileman DFILEM
Definition: bildef.h:257
char CONFIGDIREQUIPMENT[_MAX_PATH]
Definition: bildef.h:208
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
int LoadDB_DispCoeff(void)
Load dispersion parameters. Procedure that load the dispersion parameters from file {homedir}/DOAS/Di...
Definition: Load.c:234
bil BIL
Definition: Spat_Plot.c:35
int EqType
Spectrometer Type.
char CONFIGDIRCOMMON[_MAX_PATH]
Definition: bildef.h:206
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
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:

§ DB_FilterCB()

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

Filter positioning callback.

Definition at line 2593 of file Spat_Plot.c.

References tools::FlagFilter, GrafoIMG(), MRButtonGetActivationStatus(), ON_OFFLINEPLOT, and TOOLS.

Referenced by D_PlotTools().

2594 {
2595 
2596  int er = 0;
2597  int c = (int) ad;
2598 
2599 
2601 
2602  if(er)
2603  {
2604  switch (c)
2605  {
2606  case 0:
2607  TOOLS.FlagFilter = 0;
2608  break;
2609  case 1:
2610  TOOLS.FlagFilter = 1;
2611  break;
2612  }
2613  }
2614 
2616 
2617 
2618 }
int MRButtonGetActivationStatus(MOBJECT o)
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
int FlagFilter
flag for filterinf
static double p
Definition: SOLPOS.C:131
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
tools TOOLS
Definition: CreateForms.c:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_FindMaxMin()

double DB_FindMaxMin ( int  idx,
int  idy,
unsigned int *  mx,
unsigned int *  mi,
int  bp 
)

Definition at line 595 of file Spat_Plot.c.

References bil::DPLOT, and d_view::ImatGraf.

596 {
597  double l = 0;
598  int x, y, xi = idx , yi = idy;
599  U16 *m = BIL.DPLOT.ImatGraf;
600 // float *f = DIL.Img.Mat[w].Fmat;
601 
602 
603  *mx = 0; *mi = 65535;
604 // VRange("Find Max/Min", 0);
605  for(y = 0; y < yi; y++)
606  {
607  for(x = 3; x < xi; x++)
608  {
609  if (bp != 0)
610  {
611  if (x < xi - bp)
612  {
613  l += (double) *m;
614  *mi = min(*mi, *m);
615  *mx = max(*mx, *m);
616  m++;
617  }
618  }
619  else
620  {
621  l += (double) *m;
622  *mi = min(*mi, *m);
623  *mx = max(*mx, *m);
624  m++;
625  }
626  }
627 // if((y % 32) == 0 && y > 0)
628 // VRange(NULL, (long) y * 100 / idy);
629  }
630 // VRange(NULL, 100);
631  return l;
632 }
short unsigned U16
2 byte without sign, range 0-65535
Definition: dcldef.h:375
d_view DPLOT
Definition: bildef.h:254
unsigned short * ImatGraf
Definition: bildef.h:176
bil BIL
Definition: Spat_Plot.c:35

§ DB_SpikesCB()

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

Definition at line 2620 of file Spat_Plot.c.

References tools::FlagSpikes, GrafoIMG(), MRButtonGetActivationStatus(), ON_OFFLINEPLOT, and TOOLS.

Referenced by D_PlotTools().

2621 {
2622  int er = 0;
2623  int c = (int) ad;
2624 
2625 
2627 
2628  if(er)
2629  {
2630  switch (c)
2631  {
2632  case 0:
2633  TOOLS.FlagSpikes = 0;
2634  break;
2635  case 1:
2636  TOOLS.FlagSpikes = 1;
2637  break;
2638  }
2639  }
2640 
2642 
2643 }
int MRButtonGetActivationStatus(MOBJECT o)
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
static double p
Definition: SOLPOS.C:131
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
tools TOOLS
Definition: CreateForms.c:81
int FlagSpikes
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DB_XUnitsCB()

void DB_XUnitsCB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Definition at line 3547 of file Spat_Plot.c.

References bil::DPLOT, FLAG, GrafoIMG(), d_view::ImatGraf, ON_OFFLINEPLOT, and flag::Wl.

Referenced by ViewPlot().

3548 {
3549  int c = (int) a_data;
3550 
3551  switch(c)
3552  {
3553  case 0 :
3554  FLAG.Wl = 0;
3555  break;
3556  case 1:
3557  FLAG.Wl = 1;
3558  break;
3559  case 2:
3560  FLAG.Wl = 2;
3561  break;
3562 
3563  }
3564 
3565  if (BIL.DPLOT.ImatGraf)
3567 
3568 }
flag FLAG
Definition: CreateForms.c:84
int Wl
Flag for the units on the X scale plot.
d_view DPLOT
Definition: bildef.h:254
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
unsigned short * ImatGraf
Definition: bildef.h:176
bil BIL
Definition: Spat_Plot.c:35
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ deallocamat()

void deallocamat ( )

Definition at line 161 of file Spat_Plot.c.

References bil::DPLOT, d_view::ImatGraf, and d_view::ImatOrig.

162 {
163 
164 // unsigned long mx;
165 
166  free(BIL.DPLOT.ImatGraf);
167  BIL.DPLOT.ImatGraf = 0;
168  free(BIL.DPLOT.ImatOrig);
169 }
unsigned short * ImatOrig
Definition: bildef.h:180
d_view DPLOT
Definition: bildef.h:254
unsigned short * ImatGraf
Definition: bildef.h:176
bil BIL
Definition: Spat_Plot.c:35

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

§ DestroyArrayObj()

void DestroyArrayObj ( MOBJECT  obj[],
int  n 
)

Definition at line 1463 of file Spat_Plot.c.

References MObjectDestroy().

1464 {
1465  int i;
1466  for (i=0; i < n ; i++)
1467  {
1468 
1469  MObjectDestroy(obj[i]);
1470  }
1471 }
void MObjectDestroy(MOBJECT obj)
+ Here is the call graph for this function:

§ DrawAreaPlotCB()

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

Definition at line 876 of file Spat_Plot.c.

References d_view::actimg, AllocUSMat(), mtcl::black, bil::BLENS, BlindPix, CalcSpectrumLimits(), spectrumheader::ccdex, spectrumheader::ccdwx, paramini::ccdWx, paramini::ccdXoff, viewformobj::cmdpb, d_view::COSTX, d_view::COSTY, D_AssignOrigin(), D_findmaxmin(), D_PlotAxis(), D_PlotGrid(), DBDEMO, flag::DispBlindPix, das::DOption, bil::DPLOT, ccd::dx, d_view::eX, flag::exemode, d_view::eY, doas::FFTFilter, FilterData(), FLAG, das::Flag, tools::FlagDisplay, tools::FlagFilter, tools::FlagSpikes, HeaderInPlot(), optionini::hlineafter, optionini::hlinebefore, IDX, IDY, img::Imat, d_view::ImatGraf, d_view::ImatOrig, d_view::Imax, dil::Img, blens::Imim, d_view::Imin, InitImage(), doas::lambda, viewformobj::lblX, MAllocImage(), image::Mat, maxploth, maxplotw, MFreeImage(), MMessageDialog(), MObjectGetHeight(), MObjectGetWidth(), MObjectSetSensitive(), MObjectSetText(), MTCL, ON_OFFLINEPLOT, d_view::oX, d_view::oY, das::Paramini, d_view::pbr, Pix2Wl(), mtcl::PLColor, PlotSpectrum(), flag::plotYRange, PoslblX(), PoslblY(), RemoveSpikes(), Server, bil::SPH, SwapMatrix(), TOOLS, bil::VFO, spectrumheader::wavelen, and flag::Wl.

Referenced by GrafoIMG(), and ViewPlot().

877 {
878 
879  int i, BlindPix_1;
880  int t, j;
881  static int done = 0;
882 
883  if (DAS.Flag.exemode == DBDEMO)
884  for(t = 0; t < IDY; t++)
885  {
886  for(j = 0; j < IDX ; j++)
887  {
888  DIL.Img.Mat[Server].Imat[t * IDX + j] = (unsigned short) t+j*2;
889  }
890  }
891 
892  if (ON_OFFLINEPLOT) // If On LinePLOT
893  {
894  if(!DIL.Img.Mat[Server].Imat) //Se la matrice e' vuota o non e' inizializzata ESCE
895  {
896  //MObjectSetUnsensitive(BIL.VFO.selallpb);
897  //MObjectSetUnsensitive(BIL.VFO.YScalePB);
898  /*DIL.Img.Mat[Server].Imat = AllocUSMat(IDX, IDY); //Alloc the graph matrix
899  for(t = 0; t < IDY; t++)
900  {
901  for(j = 0; j < IDX ; j++)
902  {
903  DIL.Img.Mat[Server].Imat[t * IDX + j] = (unsigned short) t+j*2;
904  }
905  }
906  */
907  if(done == 0)
908  {
909  done = 1;
910  MMessageDialog("DAS Inf.", "CCD Array not allocated or empty", "OK", NULL);
911  }
912  return 1;
913  }
914  else
915  {
916  MObjectSetSensitive(BIL.VFO.cmdpb[0]); //Set Button "Open" Sensitive
917  MObjectSetText(BIL.VFO.cmdpb[0], "Save As");
918 
920 
921  HeaderInPlot(); // it Shows the measurements parameters
922  BIL.DPLOT.ImatGraf = AllocUSMat(IDX, IDY); //Alloc the graph matrix
923  }
924 
925  }
926  else // If OFF LinePLOT
927  {
928  if(BIL.DPLOT.ImatGraf == 0)
929  return 1;
930  }
931 
932  maxplotw = MObjectGetWidth(obj);
933  maxploth = MObjectGetHeight(obj);
934 
937 
938  InitImage(BIL.BLENS.Imim, maxplotw, maxploth, 192, 192, 192);
939 
940  for(i=DAS.DOption.hlinebefore ; i < IDY - DAS.DOption.hlineafter ; i++)
941  BIL.DPLOT.actimg[i] = 1;
942 
943  //Assign limits to the Drawing coordinates
944  D_AssignOrigin(obj);
945  //Plot the axes
947  BIL.DPLOT.eY, MTCL.black);
948  //Plot grid
950  BIL.DPLOT.eY);
951 
952  //Filter section
953  if (ON_OFFLINEPLOT) //On LinePLOT
954  {
955 
956  if(FLAG.DispBlindPix)
957  BlindPix = 0;
958  else
959  {
960  if (DC_CCD.dx - (DAS.Paramini.ccdWx +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
962  }
963 
964  if(TOOLS.FlagFilter)
965  {
967  if (DC_CCD.dx - (DAS.Paramini.ccdWx +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
968  BlindPix_1 = DC_CCD.dx - DAS.Paramini.ccdWx-1 ;
969  FilterData(BIL.DPLOT.ImatGraf, IDX, IDY, DOAS.FFTFilter, BlindPix_1);
970  }
971  else
973 
974  }
975  else
976  {
977  //Display Blind pixel
978  if(FLAG.DispBlindPix)
979  BlindPix = 0;
980  else
981  {
982  if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
983  BlindPix = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
984  }
985 
986 
987  //Remove Spikes and Filter data
989  {
990 
992 
993  BlindPix_1 = 0;
994  if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
995  BlindPix_1 = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
996 
997  RemoveSpikes(0, BIL.DPLOT.ImatGraf, IDX, IDY, BlindPix_1);
998  FilterData(BIL.DPLOT.ImatGraf, IDX, IDY, DOAS.FFTFilter, BlindPix_1);
999  }
1000  //Remove Spikes Only
1001  else if(!TOOLS.FlagFilter & TOOLS.FlagSpikes)
1002  {
1003 
1005 
1006  BlindPix_1 = 0;
1007  if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
1008  BlindPix_1 = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
1009 
1010  RemoveSpikes(0, BIL.DPLOT.ImatGraf, IDX, IDY, BlindPix_1);
1011  }
1012  //Filter Only
1013  else if(TOOLS.FlagFilter & !TOOLS.FlagSpikes)
1014  {
1015 
1017 
1018  BlindPix_1 = 0;
1019  if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
1020  BlindPix_1 = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
1021 
1022  FilterData(BIL.DPLOT.ImatGraf, IDX, IDY, DOAS.FFTFilter, BlindPix_1);
1023  }
1024  else
1026 
1027 
1028  }
1029  // Y Axis Range Section
1030  if(FLAG.plotYRange)
1031  {
1032  if(TOOLS.FlagFilter)
1033  {
1034  //Find Max & Min of the spectrum (BIL.DPLOT.Imax & BIL.DPLOT.Imin)
1036  IDY - DAS.DOption.hlineafter, BlindPix );
1037  }
1038  else
1039  {
1040  //Find Max & Min of the spectrum (BIL.DPLOT.Imax & BIL.DPLOT.Imin)
1042  IDY - DAS.DOption.hlineafter, BlindPix );
1043  }
1044  }
1045  else
1046  {
1047  BIL.DPLOT.Imax = 65535;
1048  BIL.DPLOT.Imin = 0;
1049  }
1050 
1051  // X Axis Mode visualization
1052  if(FLAG.Wl == 0) //Pixel X Scale
1053  {
1054  //Positioning of X labels
1055  PoslblX(BIL.VFO.lblX, 1, IDX - BlindPix, (IDX - BlindPix)/2);
1056  }
1057  else if(FLAG.Wl == 1) //Wavelength X scale [A]
1058  {
1059  //CalcSpectrumLimits(0, BIL.SPH.wavelen, DAS.Paramini.ccdXoff, DAS.Paramini.ccdWx + 1, 424 );
1061  //Positioning of X labels
1062  PoslblX(BIL.VFO.lblX, (int)DOAS.lambda[0],
1063  (int)DOAS.lambda[IDX - 1 - BlindPix],BIL.SPH.wavelen);
1064  }
1065  else if(FLAG.Wl == 2) //Pixel X Scale [nm]
1066  {
1069  //Positioning of X labels
1070  PoslblX(BIL.VFO.lblX, (int)(DOAS.lambda[0]/10),
1071  (int)(DOAS.lambda[IDX - 1 - BlindPix]/10), BIL.SPH.wavelen/10);
1072  }
1073 
1074  if(BIL.DPLOT.Imax - BIL.DPLOT.Imin <100)
1075  {
1076 // MShellSetTitle(BIL.VFO.View_Sh,"Min Max too close, Plotting is not possible");
1077  return 2;
1078  }
1079  else
1080  //Positioning of Y labels
1082 
1083  //Calculation of the adaptive parameters
1084  BIL.DPLOT.COSTY = (double)(BIL.DPLOT.Imax - BIL.DPLOT.Imin) / (double)(BIL.DPLOT.oY - BIL.DPLOT.eY);
1085  BIL.DPLOT.COSTX = (double)(BIL.DPLOT.eX - BIL.DPLOT.oX) / (double) (IDX - BlindPix);
1086 
1087  if (ON_OFFLINEPLOT) // If On LinePLOT
1088  {
1089  //Plot of the spectrum
1094  }
1095  else
1096  {
1097  if(TOOLS.FlagDisplay == 2)
1098  {
1099  //Plot of the spectrum
1104 
1109  }
1110  else if(TOOLS.FlagDisplay == 1)
1111  {
1116 
1117  }
1118  else if(TOOLS.FlagDisplay == 0)
1119  {
1124 
1125  }
1126 
1127  }
1128 
1129  return 0;
1130 
1131 
1132 
1133 }
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
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.
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 MObjectGetHeight(MOBJECT obj)
int ccdWx
CCD X End.
unsigned short * AllocUSMat(int hp, int vp)
Definition: Spat_Plot.c:1994
int oY
Definition: bildef.h:183
int FilterData(unsigned short *mat, int horpix, int verpix, int filw, int bp)
Definition: FFT.c:250
flag Flag
Structure for different flags.
U16 * Imat
Definition: Dildef.h:286
#define DBDEMO
execution in demo mode
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
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
S16 dx
Num. of X pixels.
Definition: dcldef.h:1022
img Mat[MAXIMG]
Definition: Dildef.h:552
unsigned int Imin
Definition: bildef.h:178
void MObjectSetText(MOBJECT obj, const char *text)
image Img
Definition: Dildef.h:675
int MObjectGetWidth(MOBJECT obj)
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
int HeaderInPlot(void)
Shows the measurements parameters .
Definition: Spat_Plot.c:1475
d_view DPLOT
Definition: bildef.h:254
double lambda[1055]
Wavelength series.
Definition: DOASdef.h:18
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
void PoslblX(MOBJECT lbl, int xs, int xe, int xc)
Definition: Spat_Plot.c:516
void MFreeImage(MIMAGE data)
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 FFTFilter
Fast Fourier Trasform Filter windows.
Definition: DOASdef.h:25
int FlagFilter
flag for filterinf
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
int eY
Definition: bildef.h:183
int FlagDisplay
MTColor PLColor[264]
int D_findmaxmin(unsigned short plotmat[], int xinf, int xsup, int yinf, int ysup, int bp)
Definition: Spat_Plot.c:635
int maxploth
Definition: Spat_Plot.c:51
void PlotSpectrum(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, int hlb, int hla)
Definition: Spat_Plot.c:796
int maxplotw
Definition: Spat_Plot.c:51
bil BIL
Definition: Spat_Plot.c:35
void CalcSpectrumLimits(int mod, int pos, int spix, int epix, int refpix)
Definition: DOAS.c:67
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
MIMAGE MAllocImage(int img_w, int img_h, int nplanes)
int BlindPix
Number of blind pixels (usefull for Dark Current)
Definition: DAS_Spat.c:120
void MObjectSetSensitive(MOBJECT obj)
int DispBlindPix
Display Blind Pix: 0 = NO, 1 = Yes.
tools TOOLS
Definition: CreateForms.c:81
ccd DC_CCD
Definition: Spat_Plot.c:25
int exemode
Set the Execution MODE (Execution modes)
int FlagSpikes
paramini Paramini
structure for the parameters defined in param.ini configuration file
int RemoveSpikes(int mod, unsigned short *mat, int horpix, int verpix, int blindpix)
Removes Spikes on a measure.
Definition: FFT.c:369
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DrawButtons()

void DrawButtons ( int  nhidlbef,
int  nhidlaft,
int  nr 
)

Definition at line 56 of file Spat_Plot.c.

References bil::DPLOT, MD_CreateBRowShell(), MObjectMap(), MObjectUnmap(), MShellDestroy(), MShellUnrealize(), d_view::OLDnR, d_view::pbr, and d_view::RowShell.

Referenced by ViewNext(), ViewNext_BIN(), and Visualizza().

57 {
58 
59 
60  int i;
61  static int NewnR;
62  static x = 0;
63 
64  if(BIL.DPLOT.RowShell != 0)
65  {
68  BIL.DPLOT.RowShell = 0;
69  }
70 
71 
72 
73 /*
74  if(BIL.SPH.ccdnr != BIL.DPLOT.OLDnR + 1)
75  {
76  deallocamat();
77  allocamat();
78  }
79 */
80  if(nr != BIL.DPLOT.OLDnR + 1)
81  {
82 
83  if(nr < 16)
84  {
85 
86  //ButtFrmWidth = MObjectGetWidth(BIL.VFO.formbutt);
87  //ButtSpace = ButtFrmWidth/BIL.SPH.ccdnr;
88  //ButtWidth = 70;
89 
90 
91  for (i=nhidlbef; i < nr - nhidlaft; i++)
92  {
93  MObjectMap(BIL.DPLOT.pbr[i]);
94 // NewnR ++;
95  }
96 
97  if(nhidlaft > NewnR)
98  {
99  for (i= nr - nhidlaft; i<nr;i++)
101  }
102 
103 
104 
105  NewnR = nr - nhidlaft - nhidlbef;
106 
107 // BIL.SPH.ccdnr;
108  }
109  else
110  {
111 // if(x == 0)
112 // {
113 // x=1;
114  MD_CreateBRowShell(nr);
115 // }
116  }
117  BIL.DPLOT.OLDnR= nr;
118  }
119 
120 }
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
MOBJECT pbr[256]
Definition: bildef.h:170
void MShellUnrealize(MOBJECT obj)
int OLDnR
Definition: bildef.h:185
void MShellDestroy(MOBJECT obj)
d_view DPLOT
Definition: bildef.h:254
void MObjectUnmap(MOBJECT obj)
bil BIL
Definition: Spat_Plot.c:35
MOBJECT RowShell
Definition: bildef.h:171
void MObjectMap(MOBJECT obj)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DrawImg()

void DrawImg ( MIMAGE  img,
int  a,
int  c,
int  x,
int  y 
)

Definition at line 370 of file Spat_Plot.c.

References mtcl::db, mtcl::dg, mtcl::dr, MImageSetPixelRGB(), and MTCL.

Referenced by D_PlotOneLine(), and PlotSpectrum().

371 {
372 
373  int r, g, b;
374 
375  switch(a)
376  {
377  //Gray
378  case 259:
379  r = 192;
380  g = 192;
381  b = 192;
382  break;
383  //colors
384  default:
385  r = MTCL.dr[a];
386  g = MTCL.dg[a];
387  b = MTCL.db[a];
388  break;
389  }
390 
391  MImageSetPixelRGB(img, x , y, r, g, b);
392 
393 }
mtcl MTCL
Definition: 2DPlot.c:30
int dg[256]
void MImageSetPixelRGB(MIMAGE pmi, int x, int y, int r, int g, int b)
int dr[256]
int db[256]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DrawXLine()

void DrawXLine ( MIMAGE  img,
int  yfix,
int  xs,
int  xe,
int  r,
int  g,
int  b 
)

Definition at line 423 of file Spat_Plot.c.

References MImageSetPixelRGB().

Referenced by D_PlotAxis(), and D_PlotGrid().

424 {
425  int x;
426 
427  for(x = xs; x < xe; x++)
428  MImageSetPixelRGB(img, x , yfix, r, g, b);
429 
430 }
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:

§ DrawYLine()

void DrawYLine ( MIMAGE  img,
int  xfix,
int  ys,
int  ye,
int  r,
int  g,
int  b 
)

Definition at line 404 of file Spat_Plot.c.

References MImageSetPixelRGB().

Referenced by D_PlotAxis(), and D_PlotGrid().

405 {
406  int y;
407 
408  for(y = ys; y<ye; y++)
409  MImageSetPixelRGB(img, xfix , y, r, g, b);
410 
411 }
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:

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

§ HeaderInPlot()

int HeaderInPlot ( void  )

Shows the measurements parameters
.

Definition at line 1475 of file Spat_Plot.c.

References d_geo::alititude, optionini::avgmode, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, marconi::CCDTemp, spectrumheader::ccdvb, spectrumheader::ccdwx, paramini::ccdWx, spectrumheader::ccdwy, paramini::ccdWy, paramini::ccdXoff, paramini::ccdYoff, viewformobj::cmdpb, date::da_day, date::da_mon, date::da_year, img::DATE, das::DGeo, das::DOption, spectrumheader::dummy3, ccd::dx, ccd::dy, paramini::EqType, Fil_Code, Fil_Code8H, Fil_CodeNG, Fil_CodeNG1, Fil_CodeTropo, optionini::filtertype, FWS, GASCODNG1, GASCODNG2, GASCODNG3, GASCODNG4, GRS, img::High, dil::Img, d_geo::latitude, viewformobj::lblalt, viewformobj::lblccdex, viewformobj::lblccdey, viewformobj::lblccdsx, viewformobj::lblccdsy, viewformobj::lblccdtemp, viewformobj::lblccdtexp, viewformobj::lblccdwx, viewformobj::lblccdwy, viewformobj::lbldate, viewformobj::lblfilter, viewformobj::lbllat, viewformobj::lblloc, viewformobj::lbllong, viewformobj::lblmax, viewformobj::lblmin, viewformobj::lblmirpos, viewformobj::lblndfilter, viewformobj::lblnr, viewformobj::lblnummeas, viewformobj::lblsza, viewformobj::lbltime, viewformobj::lblvb, viewformobj::lblwaveleng, LIS_, d_geo::longitude, img::Low, das::Marconi, image::Mat, optionini::measmode, Mir_Code, Mir_CodeTropo, MIS, MObjectSetSensitive(), MObjectSetText(), N_AVG, N_RM, NDFil_Code, das::Paramini, FilterWheelSt::Pos, MirrorSt::Pos, d_geo::s_name, S_zenetr, Server, SPATRAM3, bil::SPH, TExp, time::ti_hour, time::ti_min, time::ti_sec, img::TIME, TROPOGAS, paramini::VBin, bil::VFO, spectrumheader::wavelen, wl, and GratingSt::Wl.

Referenced by DrawAreaPlotCB().

1476 {
1477 
1478  char str[64], buf[16];
1479 
1480 
1482 
1483  sprintf(str,"%.2lf", DAS.DGeo.latitude);
1484  MObjectSetText(BIL.VFO.lbllat, str);
1485 
1486  sprintf(str,"%.2lf", DAS.DGeo.longitude);
1487  MObjectSetText(BIL.VFO.lbllong, str);
1488 
1489  sprintf(str,"%.0lf", DAS.DGeo.alititude);
1490  MObjectSetText(BIL.VFO.lblalt, str);
1491 
1492  sprintf(str,"%.2lf", S_zenetr);
1493  MObjectSetText(BIL.VFO.lblsza, str);
1494 
1495  sprintf(str,"%d/%02d/%02d", DIL.Img.Mat[Server].DATE.da_year,DIL.Img.Mat[Server].DATE.da_mon, DIL.Img.Mat[Server].DATE.da_day);
1496  MObjectSetText(BIL.VFO.lbldate, str);
1497 
1498  sprintf(str,"%2d:%02d:%02d", DIL.Img.Mat[Server].TIME.ti_hour, DIL.Img.Mat[Server].TIME.ti_min, DIL.Img.Mat[Server].TIME.ti_sec);
1499  MObjectSetText(BIL.VFO.lbltime, str);
1500 
1501 
1502 
1504  sprintf(buf, "%s",Mir_CodeTropo[MIS.Pos]);
1505  else
1506  sprintf(buf, "%s",Mir_Code[MIS.Pos]);
1507 
1509 
1510  sprintf(str,"%d", wl[GRS.Wl]);
1512  /***********************************************************************/
1513  //Filter wheel section
1514  if ( DAS.Paramini.EqType == LIS_)
1516  else
1517  {
1518  if(DAS.Paramini.EqType == TROPOGAS)
1522  else if (DAS.Paramini.EqType == GASCODNG1)
1524 
1525  else
1527  }
1528  /***********************************************************************/
1529  //Neutral Density Filter section
1530  if(DAS.DOption.filtertype == 1) // Double filter wheel
1531  {
1532 
1534 
1535 
1536  }
1537  if(DAS.DOption.filtertype == 2) // Filter Wheel + Torque motor
1538  {
1539  if (BIL.SPH.dummy3)
1541  else
1543 
1544  }
1545 
1546 
1547 
1548  /***********************************************************************/
1549 
1550 
1551  sprintf(str,"%.2lf", DAS.Marconi.CCDTemp);
1553 
1554  sprintf(str,"%.3lf", TExp);
1556 
1557 
1558  if(DAS.DOption.measmode == 1) //measuring with average
1559  {
1560  if(DAS.DOption.avgmode == 0)
1561  sprintf(str,"%d", N_AVG); // number of measurements in fixed number of measurements
1562  else
1563  sprintf(str,"%d", N_RM); // number of measurements in fixed exposure time
1564  }
1565  else
1566  sprintf(str,"%d", "1");
1567 
1569 
1570  sprintf(str,"%u", (unsigned int)DIL.Img.Mat[Server].High);
1571  MObjectSetText(BIL.VFO.lblmax, str);
1572 
1573  sprintf(str,"%u", (unsigned int)DIL.Img.Mat[Server].Low);
1574  MObjectSetText(BIL.VFO.lblmin, str);
1575 
1576  sprintf(str,"%d", DC_CCD.dx);
1578 
1579  sprintf(str,"%d", DC_CCD.dy);
1581 
1582 
1583 
1584  sprintf(str,"%d", DAS.Paramini.ccdXoff);
1586 
1587  sprintf(str,"%d", DAS.Paramini.ccdYoff);
1589 
1590  sprintf(str,"%d", DAS.Paramini.ccdWx);
1592 
1593  sprintf(str,"%d", DAS.Paramini.ccdWy);
1595 
1596  sprintf(str,"%d", DAS.Paramini.VBin);
1597  MObjectSetText(BIL.VFO.lblvb, str);
1598 
1599  sprintf(str,"%d", DC_CCD.dy/DAS.Paramini.VBin);
1600  MObjectSetText(BIL.VFO.lblnr, str);
1601 
1602 
1603  BIL.SPH.ccdwx = DC_CCD.dx;
1604  BIL.SPH.ccdwy = DC_CCD.dy;
1606 
1607  BIL.SPH.ccdex = DAS.Paramini.ccdWx;//DC_CCD.dx;
1609  BIL.SPH.ccdey = DAS.Paramini.ccdWy; //DC_CCD.dy;
1612 
1613  BIL.SPH.wavelen = wl[GRS.Wl];
1614 
1615 
1616  MObjectSetSensitive(BIL.VFO.cmdpb[4]); // Set "Print" button as sensitive
1618 
1619  return 0;
1620 
1621 
1622 }
MOBJECT lblmin
Definition: bildef.h:54
double S_zenetr
Definition: SOLPOS.C:92
MOBJECT cmdpb[10]
Definition: bildef.h:69
int Server
Definition: DAS_Spat.c:253
optionini DOption
Options for DAS execution.
double alititude
Station altitude.
const char * Mir_Code[]
const char array for the realisation of the Mirrors buttons in the Mirror shell
Definition: DAS_Spat.c:231
MOBJECT lblccdwx
Definition: bildef.h:55
MOBJECT lblccdtexp
Definition: bildef.h:44
das DAS
DAS structure.
Definition: Spat_Plot.c:39
MOBJECT lblndfilter
Definition: bildef.h:42
U8 da_mon
Definition: Dildef.h:243
MOBJECT lblmax
Definition: bildef.h:53
U8 ti_sec
Definition: Dildef.h:238
int ccdWx
CCD X End.
MOBJECT lblfilter
Definition: bildef.h:41
double latitude
Station latitude.
int Pos
Mirror Current Position.
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
dil DIL
Definition: Spat_Plot.c:28
int ccdXoff
CCD X Start.
MOBJECT lblccdsx
Definition: bildef.h:57
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
S16 dx
Num. of X pixels.
Definition: dcldef.h:1022
img Mat[MAXIMG]
Definition: Dildef.h:552
char * Fil_Code8H[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:204
MOBJECT lblccdey
Definition: bildef.h:60
struct date DATE
Definition: Dildef.h:348
void MObjectSetText(MOBJECT obj, const char *text)
MOBJECT lblnr
Definition: bildef.h:62
image Img
Definition: Dildef.h:675
int Pos
Filter Wheel current Position.
S16 da_year
Definition: Dildef.h:241
d_geo DGeo
struct for Station location
U8 da_day
Definition: Dildef.h:242
#define LIS_
Lampedusa Island Spectrometer - ENEA.
MOBJECT lblloc
Definition: bildef.h:48
MOBJECT lbllat
Definition: bildef.h:49
int ccdWy
CCD Y End.
U8 ti_hour
Definition: Dildef.h:236
int Wl
Grating Wavelength.
#define TROPOGAS
TROPOspheric Gas Analyzer Spectrometer.
char * Fil_CodeNG[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG2 and NG3...
Definition: DAS_Spat.c:216
MOBJECT lblccdtemp
Definition: bildef.h:43
char s_name[4]
Station name.
float CCDTemp
Actual CCD Temperature.
int avgmode
Flag to set Averaging mode: 0 = Repeat measurements for fixed number, 1 = Repeat measurements for fix...
MOBJECT lblalt
Definition: bildef.h:51
#define GASCODNG2
GASCODNG 2 (with ATX power supply & HiresIV)
int VBin
CCD Vertical Binning.
MOBJECT lblsza
Definition: bildef.h:52
#define GASCODNG3
GASCODNG 3 (with ATX power supply & HiresIV)
#define GASCODNG1
GASCODNG 1 (with ATX power supply & HiresIV)
#define GASCODNG4
GASCODNG 4.
char * Fil_CodeNG1[]
const char array for the realisation of the Filters buttons in the Filter shell for GASCODNG1 instrum...
Definition: DAS_Spat.c:213
S16 dy
Num. of Y pixels.
Definition: dcldef.h:1023
MOBJECT lblccdwy
Definition: bildef.h:56
MOBJECT lbltime
Definition: bildef.h:38
#define SPATRAM3
SPATRAM3.
double TExp
CCD Exposure time.
Definition: DAS_Spat.c:130
MirrorSt MIS
Mirror.
Definition: DAS_Spat.c:61
MOBJECT lblvb
Definition: bildef.h:61
char * Fil_Code[]
const char array for the realisation of the Filters buttons in the Filter shell
Definition: DAS_Spat.c:207
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
U8 ti_min
Definition: Dildef.h:235
MOBJECT lblccdsy
Definition: bildef.h:58
MOBJECT lbldate
Definition: bildef.h:37
double longitude
Station longitude.
int measmode
measuring mode: 0 = Single; 1 = Averaged
bil BIL
Definition: Spat_Plot.c:35
MOBJECT lbllong
Definition: bildef.h:50
viewformobj VFO
Definition: bildef.h:255
char * Fil_CodeTropo[]
const char array for the realisation of the Filters buttons in the Filter shell for TROPOGAS instrume...
Definition: DAS_Spat.c:210
struct time TIME
Definition: Dildef.h:347
char * NDFil_Code[]
const char array for the realisation of the Filters buttons in the ND Filter shell ...
Definition: DAS_Spat.c:219
int EqType
Spectrometer Type.
int N_RM
Number of measurements for Averaging mode in fixed exposure time mode.
Definition: DAS_Spat.c:114
int N_AVG
Number of measurements for Averaging mode in fixed number of meas. mode.
Definition: DAS_Spat.c:113
float Low
Definition: Dildef.h:294
void MObjectSetSensitive(MOBJECT obj)
MOBJECT lblnummeas
Definition: bildef.h:45
int ccdYoff
CCD Y Start.
ccd DC_CCD
Definition: Spat_Plot.c:25
float High
Definition: Dildef.h:295
FilterWheelSt FWS
Filter Wheel.
Definition: DAS_Spat.c:57
GratingSt GRS
Definition: CreateForms.c:82
MOBJECT lblwaveleng
Definition: bildef.h:40
MOBJECT lblccdex
Definition: bildef.h:59
marconi Marconi
CCD Sensor struct.
const char * Mir_CodeTropo[]
const char array for the realisation of the Mirrors buttons in the Mirror shell for TROPOGAS ...
Definition: DAS_Spat.c:234
paramini Paramini
structure for the parameters defined in param.ini configuration file
MOBJECT lblmirpos
Definition: bildef.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ImatGrafInImat()

void ImatGrafInImat ( void  )

Definition at line 861 of file Spat_Plot.c.

References bil::DPLOT, IDX, IDY, img::Imat, d_view::ImatGraf, dil::Img, image::Mat, and Server.

862 {
863  int t, j;
864 
865  for(t = 0 ; t < IDY ; t++)
866  {
867  for(j = 0; j < IDX; j++)
868  {
869  DIL.Img.Mat[Server].Imat[t * IDX + j] = BIL.DPLOT.ImatGraf[t * IDX + j];
870  }
871  }
872 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int Server
Definition: DAS_Spat.c:253
U16 * Imat
Definition: Dildef.h:286
dil DIL
Definition: Spat_Plot.c:28
img Mat[MAXIMG]
Definition: Dildef.h:552
image Img
Definition: Dildef.h:675
d_view DPLOT
Definition: bildef.h:254
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
unsigned short * ImatGraf
Definition: bildef.h:176
bil BIL
Definition: Spat_Plot.c:35

§ ImatInImatGraf()

void ImatInImatGraf ( void  )

Definition at line 847 of file Spat_Plot.c.

References bil::DPLOT, IDX, IDY, img::Imat, d_view::ImatGraf, dil::Img, image::Mat, and Server.

848 {
849  int t, j;
850 
851  for(t = 0 ; t < IDY ; t++)
852  {
853  for(j = 0; j < IDX; j++)
854  {
855  BIL.DPLOT.ImatGraf[t * IDX + j] = (unsigned short) DIL.Img.Mat[Server].Imat[t * IDX + j];
856  }
857  }
858 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
int Server
Definition: DAS_Spat.c:253
U16 * Imat
Definition: Dildef.h:286
dil DIL
Definition: Spat_Plot.c:28
img Mat[MAXIMG]
Definition: Dildef.h:552
image Img
Definition: Dildef.h:675
d_view DPLOT
Definition: bildef.h:254
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
unsigned short * ImatGraf
Definition: bildef.h:176
bil BIL
Definition: Spat_Plot.c:35

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

§ LoadIo()

void LoadIo ( int  mod,
char *  fname 
)

Definition at line 2678 of file Spat_Plot.c.

References AllocUSMat(), mtcl::black, bil::BLENS, spectrumheader::ccdnr, spectrumheader::ccdwx, D_AssignOrigin(), D_PlotAxis(), D_PlotGrid(), bil::DPLOT, doas::drwa, d_view::eX, d_view::eY, IDX, IDY, blens::Imim, InitImage(), doas::IoMat, MAllocImage(), maxploth, maxplotw, MFreeImage(), MObjectGetHeight(), MObjectGetWidth(), MTCL, d_view::oX, d_view::oY, ReadHeader_ASCII(), ReadIMG(), and bil::SPH.

Referenced by LoadIoCB(), and PlotToolsPBs().

2679 {
2680 
2681  FILE *fs;
2682 // char temp[128];
2683 // int i, k,
2684  int er;
2685 
2686 /* fs = fopen(fname, "r");
2687 
2688  if(fs == NULL)
2689  {
2690  return 1;
2691  }
2692  ReadLine(str, 80, fs);
2693  ReadLine(str, 80, fs);
2694  ReadLine(str, 80, fs);
2695  ReadLine(str, 80, fs);
2696 
2697 
2698  k=0;
2699  do
2700  {
2701 
2702  k++;
2703  ReadLine(str, 80, fs);
2704 
2705 
2706  }while (!feof(fs));
2707 
2708  k--;
2709 
2710  fclose(fs);
2711 */
2712  fs = fopen(fname, "r");
2713 
2714  //ReadHeaderOnly(fs);
2715  //ReadHeader_Io(0, fs);
2716  er = ReadHeader_ASCII(0, fs);
2717 
2718 
2719 
2720  IDX = BIL.SPH.ccdwx;
2721  IDY = BIL.SPH.ccdnr;
2722 
2723  DOAS.IoMat = AllocUSMat(IDX, IDY);
2724 
2725  ReadIMG(fs, DOAS.IoMat, IDX, IDY + 1);
2726 
2727 /* for (i=0; i<IDX; i++)
2728  {
2729  for (i=0; i<IDY + 1; i++)
2730  fscanf(fs, "%lf%", &DOAS.wlc[i], &DOAS.k1[i], &DOAS.k2[i], &DOAS.wlref[i], &DOAS.pixref[i]);
2731 
2732  }
2733 
2734 */
2735  fclose(fs);
2736 
2737  if (mod)
2738  {
2741 
2744 
2745  InitImage(BIL.BLENS.Imim, maxplotw, maxploth, 192, 192, 192);
2746 
2747 
2748  //Assign limits to the Drawing coordinates
2749  D_AssignOrigin(DOAS.drwa[0]);
2750  //Plot the axes
2752  BIL.DPLOT.eY, MTCL.black);
2753  //Plot grid
2755  BIL.DPLOT.eY);
2756 
2757 
2758 
2759  }
2760 
2761 
2762 }
int ReadHeader_ASCII(int mod, FILE *fd)
Read ASCII Header of the measurement. .
Definition: Spat_Plot.c:1877
mtcl MTCL
Definition: 2DPlot.c:30
MIMAGE Imim
Definition: bildef.h:14
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
MTColor black
int MObjectGetHeight(MOBJECT obj)
unsigned short * AllocUSMat(int hp, int vp)
Definition: Spat_Plot.c:1994
int oY
Definition: bildef.h:183
void InitImage(MIMAGE img, int xd, int yd, int rb, int gb, int bb)
Definition: Spat_Plot.c:354
int oX
Definition: bildef.h:183
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
int MObjectGetWidth(MOBJECT obj)
d_view DPLOT
Definition: bildef.h:254
void MFreeImage(MIMAGE data)
void D_PlotAxis(MOBJECT ob, MIMAGE mim, int sx, int sy, int ex, int ey, MTColor col)
Definition: Spat_Plot.c:448
doas DOAS
Definition: Spat_Plot.c:37
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
int eX
Definition: bildef.h:183
void ReadIMG(FILE *file, unsigned short *mat, int hp, int vp)
Read ASCII Image (Spectral Data only) .
Definition: Spat_Plot.c:1206
int eY
Definition: bildef.h:183
unsigned short * IoMat
Reference spectrum.
Definition: DOASdef.h:27
int maxploth
Definition: Spat_Plot.c:51
int maxplotw
Definition: Spat_Plot.c:51
bil BIL
Definition: Spat_Plot.c:35
blens BLENS
Definition: bildef.h:252
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
MIMAGE MAllocImage(int img_w, int img_h, int nplanes)
MOBJECT drwa[8]
Definition: DOASdef.h:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LogRatioSpectrum()

void LogRatioSpectrum ( void  )

Definition at line 2764 of file Spat_Plot.c.

2765 {
2766 
2767 
2768 
2769 
2770 }

§ MakeItemSensitiveCB()

void MakeItemSensitiveCB ( MOBJECT  obj,
void *  item,
void *  udata 
)

Definition at line 2054 of file Spat_Plot.c.

References MMenuItemSetSensitive().

Referenced by Visualizza().

2055 {
2056  MMenuItemSetSensitive (item);
2057 
2058 
2059 }
void MMenuItemSetSensitive(MENU_ITEM item)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MakeItemUnsensitiveCB()

void MakeItemUnsensitiveCB ( MOBJECT  obj,
void *  item,
void *  udata 
)

Definition at line 2044 of file Spat_Plot.c.

References MMenuItemSetUnsensitive().

Referenced by ViewPlot(), and Visualizza().

2045 {
2046  MMenuItemSetUnsensitive (item);
2047 
2048 
2049 }
void MMenuItemSetUnsensitive(MENU_ITEM item)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MD_CreateBRowShell()

int MD_CreateBRowShell ( int  nrows)

Create windows of buttons.
During the plotting of the measurements, create a shell of buttons if the raws of the CCD are more than 16.

Parameters
nrowsnumber of raws of the CCD sensor (CCDVPix/CCDVBin)
Returns
0

Definition at line 1625 of file Spat_Plot.c.

References D_pbr_CB(), das::DOption, bil::DPLOT, HELV_SMALL, optionini::hlineafter, optionini::hlinebefore, MCreatePButton(), MCreateShell(), MCreateTableForm(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetColor(), MObjectSetResize(), MObjectSetShadow(), MObjectSetTransparency(), MPButtonSetCallback(), MShellRealizeXY(), MTCL, d_view::pbr, mtcl::PLColor, d_view::RowShell, TOP_ALIGN, True, UNDEF_ALIGN, mtcl::white, and WS_ETCHED_IN.

Referenced by DrawButtons(), LoadTestPalette(), and ViewPlot().

1626 {
1627  int i, er = 0;
1628  MOBJECT _tablefrm000;
1629 // MOBJECT _shell001;
1630  char buf[64];
1631 // MOBJECT Esc_But;
1632 
1633  BIL.DPLOT.RowShell = MCreateShell("CCD ROWS", 0);
1634  MObjectSetBackgroundRGB(BIL.DPLOT.RowShell, 97, 105, 88);
1636 
1637  _tablefrm000 = MCreateTableForm(BIL.DPLOT.RowShell, 20);
1638  MObjectSetBackgroundRGB(_tablefrm000, 91, 74, 74);
1639  MObjectSetResize(_tablefrm000, True, True);
1640 
1641 
1642  for (i=DAS.DOption.hlinebefore; i < nrows - DAS.DOption.hlineafter; i++)
1643  {
1644  sprintf(buf,"r. %3d", i+1);
1645  BIL.DPLOT.pbr[i] = MCreatePButton(_tablefrm000, buf, HELV_SMALL);
1648  MPButtonSetCallback(BIL.DPLOT.pbr[i], D_pbr_CB, (void *) i);
1649  //MObjectSetBackgroundRGB(pbr[i], 197, 197, 144);
1651  }
1652 
1654 
1655  return 0;
1656 
1657 }
void MObjectSetColor(MOBJECT obj, MTColor bgc, MTColor fgc)
mtcl MTCL
Definition: 2DPlot.c:30
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
optionini DOption
Options for DAS execution.
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
das DAS
DAS structure.
Definition: Spat_Plot.c:39
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
MTColor white
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
MOBJECT pbr[256]
Definition: bildef.h:170
#define UNDEF_ALIGN
Definition: Mguidefs.h:920
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
void D_pbr_CB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:717
int hlinebefore
Number of HiddenLines before the central line in Plot.
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
d_view DPLOT
Definition: bildef.h:254
#define HELV_SMALL
Definition: Mguidefs.h:881
void MShellRealizeXY(MOBJECT obj, int x, int y)
MOBJECT MCreateShell(const char *title, int flags)
int hlineafter
Number of HiddenLines after the central line in Plot.
MTColor PLColor[264]
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
bil BIL
Definition: Spat_Plot.c:35
MOBJECT RowShell
Definition: bildef.h:171
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
#define WS_ETCHED_IN
Definition: Mguidefs.h:959
#define TOP_ALIGN
Definition: Mguidefs.h:918
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MenuFileOLP_CB()

void MenuFileOLP_CB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Definition at line 3209 of file Spat_Plot.c.

References _MAX_PATH, FB_PREFS::allow_dir_create, FB_PREFS::allow_dir_delete, FB_PREFS::allow_dir_rename, FB_PREFS::bg_image_file, FB_PREFS::button_font, FB_PREFS::change_cwd, CloseFile(), CloseFile_BIN(), ClosePlotCB(), ContFP, d_fileman::DBFILENAME, bil::DFILEM, das::DOption, bil::DPLOT, d_view::drawapl, False, FBIF, FDAT, d_fileman::FKIND, FB_PREFS::font, FSAVE, HELV_SMALL, d_fileman::HOMEDIRECTORY, IDX, IDY, d_view::ImatGraf, MDCreateFM_Shell(), MFileBrowseExt(), MGetCurrentDirectory(), MMessageDialog(), MObjectSetBackgroundRGB(), NFDATI, NUMFDATI, REL_FILE_POS, SaveSpectrum(), optionini::savingmode, FB_PREFS::transparent_tree, True, bil::VFO, viewformobj::View_Sh, ViewNext(), ViewNext_BIN(), ViewPre(), ViewPre_BIN(), and Visualizza().

Referenced by ViewPlot().

3210 {
3211  int c = (int) a_data, er =0;
3212  int l;
3213  char buff[32],str[_MAX_PATH] ;
3214  char fname[128], dirname[128];
3215 
3216  FB_PREFS fbp;
3217  strcpy (dirname, MGetCurrentDirectory ());
3218  fname[0] = '\0';
3219  memset (&fbp, 0, sizeof (fbp));
3220 
3221  fbp.change_cwd = True;
3222  fbp.allow_dir_create = True;
3223  fbp.allow_dir_rename = True;
3224  fbp.allow_dir_delete = True;
3225  fbp.transparent_tree = False;
3226  fbp.font = HELV_SMALL;
3227  fbp.button_font = HELV_SMALL;
3228  //Set Img file
3229  sprintf(str, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "sys\\Tile2.bmp" );
3230  fbp.bg_image_file =str;
3231 
3232 
3233  switch (c)
3234  {
3235  case 0:
3236  sprintf(buff,"1234");
3237  if(DAS.DOption.savingmode)
3238  er = MFileBrowseExt ("Select File for Plotting", "*.bif", fname, dirname, &fbp);
3239  else
3240  er = MFileBrowseExt ("Select File for Plotting", "*.dat", fname, dirname, &fbp);
3241  if(er)
3242  {
3243  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",dirname, fname);
3244  l = strlen(fname);
3245  strncpy(buff, fname+l-4, 4);
3246  if( (strcmp(buff,".dat") == 0) |(strcmp(buff,".Dat") == 0) )
3247  BIL.DFILEM.FKIND = FDAT;
3248  else if( (strcmp(buff,".bif") == 0) | (strcmp(buff,".Bif") == 0) )
3249  BIL.DFILEM.FKIND = FBIF;
3250  else if( (strcmp(buff,".bhg") == 0) | (strcmp(buff,".Bhg") == 0) )
3251  BIL.DFILEM.FKIND = FBIF;
3252  else
3253  {
3254  MMessageDialog("DAS information", "Unsupported format!!", " Ok ", NULL);
3255  break;
3256  }
3258  }
3259  else
3260  break;
3261  break;
3262 
3263  case 1:
3264  switch (BIL.DFILEM.FKIND)
3265  {
3266  case FDAT:
3267  ViewNext(NUMFDATI);
3268  break;
3269  case FBIF:
3271  break;
3272  }
3273  break;
3274 
3275  case 2:
3276  switch (BIL.DFILEM.FKIND)
3277  {
3278  case FDAT:
3280  break;
3281  case FBIF:
3283  break;
3284  }
3285  break;
3286 
3287  case 3:
3288  BIL.DFILEM.DBFILENAME[0] = 0;
3289  MDCreateFM_Shell(FSAVE, FDAT); //Save File as, Dat ext.
3290  if(BIL.DFILEM.DBFILENAME[0] == 0)
3291  {
3292  if (BIL.DPLOT.ImatGraf == 0)
3293  break;
3294  }
3295  else
3296  {
3298  }
3299  break;
3300 
3301  case 4:
3302  switch (BIL.DFILEM.FKIND)
3303  {
3304  case FDAT:
3306  break;
3307  case FBIF:
3309  break;
3310  }
3311  MObjectSetBackgroundRGB(BIL.DPLOT.drawapl, 220, 220, 220);
3312  break;
3313  case 5:
3314  ClosePlotCB(BIL.VFO.View_Sh, 0, 0);
3315  break;
3316 
3317  }
3318 }
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
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
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
CARD8 change_cwd
Definition: Mguidefs.h:1485
int ViewPre(FILE *nf, long position)
Definition: Spat_Plot.c:2241
int ContFP
Counter for File position.
Definition: DAS_Spat.c:123
das DAS
DAS structure.
Definition: Spat_Plot.c:39
#define FSAVE
Definition: bildef.h:218
int ViewPre_BIN(int nf, long position)
Definition: Spat_Plot.c:2263
CARD8 allow_dir_create
Definition: Mguidefs.h:1487
MTFont button_font
Definition: Mguidefs.h:1501
CARD8 allow_dir_delete
Definition: Mguidefs.h:1493
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
MTFont font
Definition: Mguidefs.h:1499
#define False
Definition: Mguidefs.h:236
FILE * NUMFDATI
Definition: Bil.h:26
long REL_FILE_POS[51]
relative File position
Definition: DAS_Spat.c:124
#define FDAT
Definition: bildef.h:221
int FKIND
Definition: bildef.h:211
void ClosePlotCB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:2514
File Browser Preferences. Used by the Utility functions MFileBowserExt() and MDirBowserExt().
Definition: Mguidefs.h:1482
CARD8 transparent_tree
Definition: Mguidefs.h:1495
d_fileman DFILEM
Definition: bildef.h:257
d_view DPLOT
Definition: bildef.h:254
#define HELV_SMALL
Definition: Mguidefs.h:881
const char * MGetCurrentDirectory(void)
int NFDATI
Definition: Bil.h:27
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
void CloseFile(FILE *fd, int hp, int vp)
Definition: Spat_Plot.c:1304
MOBJECT MDCreateFM_Shell(int mod, int fmt)
Definition: DFileMan.c:407
int MFileBrowseExt(const char *t, const char *ext, char *fname, char *dname, FB_PREFS *prefs)
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
int ViewNext_BIN(int nf)
Definition: Spat_Plot.c:2284
const char * bg_image_file
Definition: Mguidefs.h:1519
MOBJECT View_Sh
Definition: bildef.h:35
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
unsigned short * ImatGraf
Definition: bildef.h:176
bil BIL
Definition: Spat_Plot.c:35
int Visualizza(int mod, char *nomefile)
Definition: Spat_Plot.c:2069
#define True
Definition: Mguidefs.h:235
viewformobj VFO
Definition: bildef.h:255
CARD8 allow_dir_rename
Definition: Mguidefs.h:1490
MOBJECT drawapl
Definition: bildef.h:172
int ViewNext(FILE *nf)
Definition: Spat_Plot.c:2365
int SaveSpectrum(char *buff)
Definition: Spat_Plot.c:3162
#define FBIF
Definition: bildef.h:229
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MenuToolsOLP_CB()

void MenuToolsOLP_CB ( MOBJECT  o,
void *  id,
void *  a_data 
)

Definition at line 3179 of file Spat_Plot.c.

References D_Lens(), D_PlotTools(), D_SunCalc(), MMessageDialog(), PrintObject(), SetupPrinter(), bil::VFO, and viewformobj::View_Sh.

Referenced by ViewPlot().

3180 {
3181  int c = (int) a_data, er = 0;
3182 
3183  switch (c)
3184  {
3185  case 0:
3186  D_PlotTools();
3187  break;
3188  case 1:
3189  D_Lens();
3190  break;
3191  case 2:
3192  D_SunCalc();
3193  break;
3194 
3195  case 3:
3196  SetupPrinter();
3197 
3198  er = PrintObject(BIL.VFO.View_Sh, PM_FULL, -1, -1 );
3199  if (er)
3200  MMessageDialog("ALERT", "Print Problems", "Ok", NULL);
3201  break;
3202 
3203 
3204 
3205  }
3206 }
void D_PlotTools(void)
Definition: Spat_Plot.c:2818
void SetupPrinter(void)
Definition: D_print.c:14
int PrintObject(MOBJECT obj, int mode, int x, int y)
Definition: D_print.c:37
MOBJECT View_Sh
Definition: bildef.h:35
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
bil BIL
Definition: Spat_Plot.c:35
viewformobj VFO
Definition: bildef.h:255
void D_Lens(void)
Definition: D_Zoom.c:138
void D_SunCalc(void)
Sun Calculator Callback.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PButtSelAll_CB()

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

Definition at line 2476 of file Spat_Plot.c.

References D_pbr_CB(), das::DOption, bil::DPLOT, optionini::hlineafter, optionini::hlinebefore, IDY, and d_view::pbr.

Referenced by ViewPlot().

2477 {
2478  int i;
2479  int c = (int) ad;
2480  for (i =DAS.DOption.hlinebefore; i < IDY - DAS.DOption.hlineafter ; i++)
2481  D_pbr_CB(BIL.DPLOT.pbr, NULL, (void *) i);
2482 
2483 }
optionini DOption
Options for DAS execution.
das DAS
DAS structure.
Definition: Spat_Plot.c:39
MOBJECT pbr[256]
Definition: bildef.h:170
void D_pbr_CB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:717
int hlinebefore
Number of HiddenLines before the central line in Plot.
d_view DPLOT
Definition: bildef.h:254
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
int hlineafter
Number of HiddenLines after the central line in Plot.
bil BIL
Definition: Spat_Plot.c:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PBYScale_CB()

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

Definition at line 2441 of file Spat_Plot.c.

References bil::DPLOT, FLAG, GrafoIMG(), d_view::ImatGraf, ON_OFFLINEPLOT, and flag::plotYRange.

Referenced by ViewPlot().

2442 {
2443 
2444  int c = (int) ad;
2445 
2446  switch (c)
2447  {
2448  case 0:
2449  FLAG.plotYRange = 1;
2450  break;
2451  case 1:
2452  FLAG.plotYRange = 0;
2453  break;
2454 
2455 
2456 
2457  }
2458 /*
2459  if (FLAG.plotYRange == 0)
2460  {
2461  FLAG.plotYRange = 1;
2462  if( (!DAS.Flag.exemode == OFFLINEPLOT) | (!DAS.Flag.exemode == DOASMODE))
2463  MObjectSetText(BIL.VFO.YScalePB, "Min/Max");
2464  }
2465  else
2466  {
2467  FLAG.plotYRange = 0;
2468  if( (!DAS.Flag.exemode == OFFLINEPLOT) | (!DAS.Flag.exemode == DOASMODE))
2469  MObjectSetText(BIL.VFO.YScalePB, "Full Range");
2470  }
2471 */
2472  if (BIL.DPLOT.ImatGraf)
2474 
2475 }
flag FLAG
Definition: CreateForms.c:84
d_view DPLOT
Definition: bildef.h:254
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
int plotYRange
0 –> full range; 1 –> min/max
unsigned short * ImatGraf
Definition: bildef.h:176
bil BIL
Definition: Spat_Plot.c:35
void GrafoIMG(int mode)
Definition: Spat_Plot.c:1242
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PlotSpectrum()

void PlotSpectrum ( 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,
int  hlb,
int  hla 
)

Definition at line 796 of file Spat_Plot.c.

References DrawImg(), MIMAGE_DESCR::img_h, MDrawLine(), MObjectBackgroundColor(), MObjectSetColor(), MTCL, mtcl::white, and mtcl::yellow.

Referenced by DrawAreaPlotCB().

799 {
800  int t, j;
801  int X1, X, Y1, Y;
802  MTColor temp;
803  for(t = hlb ; t < idy - hla ; t++)
804  {
805  temp = MObjectBackgroundColor(pb[t]);
806  if (temp != MTCL.yellow)
807  {
808  MObjectSetColor(pb[t], pe[t], MTCL.white);
809  for(j = 5; j < idx ; j++)
810  {
811  if (bp != 0)
812  {
813  if (j < idx - bp)
814  {
815  X = (int) (ox + (j * costx));
816  Y = (int) (oy - abs((int)((double)(plotmat[t * idx + j] - min) / costy)));
817  //Y = (int) (oy - ((plotmat[t * idx + j] - min) / costy));
818  X1 = (int) (ox + (j + 1) * costx);
819  Y1 = (int) (oy - abs((int)((double)(plotmat[t * idx + j + 1] - min) / costy)));
820  //Y1 = (int) (oy - ((plotmat[t * idx + j + 1] - min) / costy));
821  MDrawLine(obj, X, Y, X1, Y1, pe[t]);
822  if ((Y <= (int)mim->img_h) & (Y > 0))
823  DrawImg(mim, t , j, X, Y);
824 
825  }
826  }
827  else
828  {
829  X = (int) (ox + (j * costx));
830  Y = (int) (oy - abs((int)((double)(plotmat[t * idx + j] - min) / costy)));
831  //Y = (int) (oy - ((plotmat[t * idx + j] - min) / costy));
832  X1 = (int) (ox + (j + 1) * costx);
833  Y1 = (int) (oy - abs((int)((double)(plotmat[t * idx + j + 1] - min) / costy)));
834  //Y1 = (int) (oy - ((plotmat[t * idx + j + 1] - min) / costy));
835  MDrawLine(obj, X, Y, X1, Y1, pe[t]);
836  if ((Y <= (int)mim->img_h) & (Y > 0))
837  DrawImg(mim, t , j, X, Y);
838 
839  }
840  }
841  }
842  }
843 
844 }
void MObjectSetColor(MOBJECT obj, MTColor bgc, MTColor fgc)
mtcl MTCL
Definition: 2DPlot.c:30
unsigned int img_h
Definition: Mguidefs.h:447
void MDrawLine(MOBJECT p, int x1, int y1, int x2, int y2, MTColor col)
MTColor yellow
MTColor white
MTColor MObjectBackgroundColor(MOBJECT obj)
CARD32 MTColor
Definition: Mguidefs.h:183
void DrawImg(MIMAGE img, int a, int c, int x, int y)
Definition: Spat_Plot.c:370
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PlotToolsPBs()

void PlotToolsPBs ( MOBJECT  o,
void *  id,
void *  a_data 
)

Definition at line 2772 of file Spat_Plot.c.

References _MAX_PATH, FB_PREFS::allow_dir_create, FB_PREFS::allow_dir_delete, FB_PREFS::allow_dir_rename, FB_PREFS::bg_image_file, BuildLogRatio(), FB_PREFS::button_font, FB_PREFS::change_cwd, d_fileman::DBFILENAME, bil::DFILEM, False, FB_PREFS::font, HELV_SMALL, d_fileman::HOMEDIRECTORY, LoadIo(), MFileBrowseExt(), MGetCurrentDirectory(), FB_PREFS::transparent_tree, and True.

Referenced by D_PlotTools().

2773 {
2774  int c = (int) a_data, er =0;
2775 // int l;
2776  char buff[32],str[_MAX_PATH] ;
2777  char fname[128], dirname[128];
2778 
2779  FB_PREFS fbp;
2780  strcpy (dirname, MGetCurrentDirectory ());
2781  fname[0] = '\0';
2782  memset (&fbp, 0, sizeof (fbp));
2783 
2784  fbp.change_cwd = True;
2785  fbp.allow_dir_create = True;
2786  fbp.allow_dir_rename = True;
2787  fbp.allow_dir_delete = True;
2788  fbp.transparent_tree = False;
2789  fbp.font = HELV_SMALL;
2790  fbp.button_font = HELV_SMALL;
2791  //Set Img file
2792  sprintf(str, "%s\\%s", BIL.DFILEM.HOMEDIRECTORY, "sys\\Tile2.bmp" );
2793  fbp.bg_image_file =str;
2794 
2795 
2796  switch (c)
2797  {
2798  case 0:
2799  sprintf(buff,"1234");
2800  er = MFileBrowseExt ("Select Io File", "*.*", fname, dirname, &fbp);
2801  if(er)
2802  {
2803  sprintf(BIL.DFILEM.DBFILENAME,"%s%s",dirname, fname);
2805  }
2806  break;
2807  case 1:
2808  break;
2809  case 2:
2810  BuildLogRatio();
2811  break;
2812  }
2813 
2814 }
CARD8 change_cwd
Definition: Mguidefs.h:1485
CARD8 allow_dir_create
Definition: Mguidefs.h:1487
MTFont button_font
Definition: Mguidefs.h:1501
CARD8 allow_dir_delete
Definition: Mguidefs.h:1493
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
MTFont font
Definition: Mguidefs.h:1499
#define False
Definition: Mguidefs.h:236
File Browser Preferences. Used by the Utility functions MFileBowserExt() and MDirBowserExt().
Definition: Mguidefs.h:1482
void LoadIo(int mod, char *fname)
Definition: Spat_Plot.c:2678
CARD8 transparent_tree
Definition: Mguidefs.h:1495
d_fileman DFILEM
Definition: bildef.h:257
#define HELV_SMALL
Definition: Mguidefs.h:881
const char * MGetCurrentDirectory(void)
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
int MFileBrowseExt(const char *t, const char *ext, char *fname, char *dname, FB_PREFS *prefs)
const char * bg_image_file
Definition: Mguidefs.h:1519
#define _MAX_PATH
Definition: Dildef.h:202
int BuildLogRatio(void)
first attempt to apply the DOAS algorithm (..on going!!!)
Definition: DOAS.c:178
bil BIL
Definition: Spat_Plot.c:35
#define True
Definition: Mguidefs.h:235
CARD8 allow_dir_rename
Definition: Mguidefs.h:1490
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PopUp_CB()

void PopUp_CB ( MOBJECT  obj,
void *  item,
void *  data 
)

Definition at line 3584 of file Spat_Plot.c.

References _MAX_PATH, d_fileman::DATADIRECTORY, DB_Save(), d_fileman::DBFILENAME, bil::DFILEM, DI_FindExtName(), das::DOption, flagclear, MInputPrompt(), MMenuItemGetText(), MMenuItemSetText(), MMessageDialog(), MObjectMap(), MObjectRedraw(), MObjectUnmap(), NFileNameF, and optionini::savingmode.

Referenced by ViewPlot().

3585 {
3586  int c = (int) data;
3587  char buf[32], str[_MAX_PATH];
3588  char fext[4];
3589 
3590  switch (c)
3591  {
3592  case 0:
3593  case 1:
3594  case 2:
3595  case 3:
3596  case 4:
3597  case 5:
3598 
3599  strcpy (buf, MMenuItemGetText (item));
3600  if(strcmp(buf, "Empty")==0)
3601  {
3602  if(MInputPrompt("Set File Name", "Type the new file name (with or without extension!)", buf, 31, "Exec", "Cancel"))
3603  {
3604  if(strcmp(buf, "Empty") != 0)
3605  {
3606  MMenuItemSetText (item, buf);
3607  MMessageDialog("DAS information", "Now you can save the spectrum.", " Ok ", NULL);
3608  }
3609  }
3610  }
3611  else
3612  {
3613  if (flagclear == 1)
3614  {
3615  flagclear = 0;
3616  MMenuItemSetText (item, "Empty" );
3617  }
3618  else
3619  {
3620  sprintf(NFileNameF,buf);
3621  //check the presence of the extension
3622  DI_FindExtName(NFileNameF, fext);
3623  if( strcmp(fext,"") == 0 )
3624  {
3625  if(DAS.DOption.savingmode)
3626  strcat(NFileNameF, ".bif");
3627  else
3628  strcat(NFileNameF, ".dat");
3629  }
3630  //check the the extension
3631  DI_FindExtName(NFileNameF, fext);
3632  if( (strcmp(fext,".dat") == 0) | (strcmp(fext,".Dat") == 0) | (strcmp(fext,".DAT") == 0) )
3633  {
3634  sprintf(BIL.DFILEM.DBFILENAME,"%s\\%s",BIL.DFILEM.DATADIRECTORY, NFileNameF);
3636  sprintf(str, "Spectrum Saved on file %s", BIL.DFILEM.DBFILENAME);
3637  MMessageDialog("DAS Inf.", str, "OK", NULL);
3638 
3639  }
3640  else if( (strcmp(fext,".bif") == 0) | (strcmp(fext,".Bif") == 0)| (strcmp(fext,".BIF") == 0) )
3641  {
3642  sprintf(BIL.DFILEM.DBFILENAME,"%s\\%s",BIL.DFILEM.DATADIRECTORY, NFileNameF);
3644  sprintf(str, "Spectrum Saved on file %s", BIL.DFILEM.DBFILENAME);
3645  MMessageDialog("DAS Inf.", str, "OK", NULL);
3646 
3647  }
3648  else
3649  {
3650  sprintf(buf, "The extension is not recognaized ",fext);
3651  MMessageDialog("DAS information", buf, " Ok ", NULL);
3652  break;
3653  }
3654  }
3655  }
3656  break;
3657  case 6:
3658  MObjectUnmap(obj);
3659  flagclear = 1;
3660 
3661 // for (i=0;i<6;i++)
3662 // MMenuItemSetText (item, );
3663  //item_pd = MMenuAddItemObsolete(popup_pd, ffilenames[i], PopUp_CB, (void *) i);
3664 
3665  MObjectRedraw(obj);
3666  MObjectMap(obj);
3667 /* MObjectUnmap(MOBJECT obj);
3668  void MObjectResize(MOBJECT obj, int w, int h);
3669  void MObjectDestroy(MOBJECT obj);
3670  MMenuItemSetText (item , "Empty");
3671 */
3672  break;
3673 
3674 
3675  }
3676 
3677 
3678 }
void MMenuItemSetText(MENU_ITEM item, const char *text)
optionini DOption
Options for DAS execution.
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
das DAS
DAS structure.
Definition: Spat_Plot.c:39
const char * MMenuItemGetText(MENU_ITEM item)
int flagclear
Definition: Spat_Plot.c:3581
char DATADIRECTORY[_MAX_PATH]
Definition: bildef.h:201
void DB_Save(char *tit, int mod)
Save the acquired spectrum. Procedure that Save the acquired spectrum.
Definition: Save.c:552
unsigned int data[576]
Conversion data buffer 64 samples * 8 channels * 2 bytes.
d_fileman DFILEM
Definition: bildef.h:257
char NFileNameF[32]
Definition: CreateForms.c:71
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
void MObjectRedraw(MOBJECT obj)
#define _MAX_PATH
Definition: Dildef.h:202
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
void MObjectUnmap(MOBJECT obj)
bil BIL
Definition: Spat_Plot.c:35
C_DEF void DI_FindExtName(char *fullname, char *fext)
void MObjectMap(MOBJECT obj)
int MInputPrompt(const char *t, const char *msg, char *text, int len, const char *ok_btn, const char *canc_btn)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PopupMenuCB()

void PopupMenuCB ( MOBJECT  obj,
MEvent pe,
void *  pdown 
)

Definition at line 3688 of file Spat_Plot.c.

References MMouseEvent::button, MObjectGetText(), MEvent::mouse, MPopupMenu(), MMouseEvent::x_root, and MMouseEvent::y_root.

Referenced by ViewPlot().

3689 {
3690 
3691  char buf[16];
3692 
3693  MObjectGetText(obj, buf);
3694  if(strcmp(buf,"Save As")== 0)
3695  {
3696  if (pe->mouse.button == Button3)
3697  MPopupMenu ((MOBJECT) pdown, pe->mouse.x_root, pe->mouse.y_root);
3698  }
3699 }
char * MObjectGetText(MOBJECT obj, char *text)
int y_root
Definition: Mguidefs.h:618
MMouseEvent mouse
Definition: Mguidefs.h:832
unsigned int button
button pressed/released (Button1, Button2 or Button3), 0 if no button involved
Definition: Mguidefs.h:622
void MPopupMenu(MOBJECT pm, int x, int y)
void * MOBJECT
Definition: Mguidefs.h:192
int x_root
coordinates relative to root
Definition: Mguidefs.h:618
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PoslblX()

void PoslblX ( MOBJECT  lbl,
int  xs,
int  xe,
int  xc 
)

Definition at line 516 of file Spat_Plot.c.

References viewformobj::lblX, MObjectSetText(), and bil::VFO.

Referenced by D_pbr_CB(), and DrawAreaPlotCB().

517 {
518  int xd, i,k, xinf,xsup;
519  char buf[16];
520  int linter;
521  double linterinf, lintersup;
522 
523 
524 
525  if (xc)
526  {
527  k = (sizeof BIL.VFO.lblX / sizeof BIL.VFO.lblX[0] ); // number of labels
528 
529  sprintf(buf,"%d", xs);
530  MObjectSetText(BIL.VFO.lblX[0], buf);
531 
532  sprintf(buf,"%d", xc);
533  MObjectSetText(BIL.VFO.lblX[k/2], buf);
534 
535  sprintf(buf,"%d", xe);
536  MObjectSetText(BIL.VFO.lblX[k -1], buf);
537 
538 
539  xinf = xc - xs;
540  xsup = xe - xc;
541 
542  linterinf = (double)xinf / (k/2);
543  lintersup = (double)xsup / (k/2);
544 
545  for (i = k/2 - 1 ;i> 0; i--)
546  {
547  sprintf(buf,"%.0lf", xc - ((k/2 - i) * linterinf) );
548 
549  MObjectSetText(BIL.VFO.lblX[i], buf);
550  }
551  for (i = k/2 + 1 ;i< k - 1; i++)
552  {
553  sprintf(buf,"%.0lf", xc + ((i - k/2) * lintersup) );
554 
555  MObjectSetText(BIL.VFO.lblX[i], buf);
556  }
557 
558  }
559  else
560  {
561  xd = xe - xs + 1;
562  linter = xd / (sizeof BIL.VFO.lblX / sizeof BIL.VFO.lblX[0] - 1);
563  k = (sizeof BIL.VFO.lblX / sizeof BIL.VFO.lblX[0] );
564 
565  xc = xd / 2;
566  sprintf(buf,"%d", xc);
567  MObjectSetText(BIL.VFO.lblX[k/2], buf);
568  }
569 
570 }
void MObjectSetText(MOBJECT obj, const char *text)
MOBJECT lblX[17]
Definition: bildef.h:47
bil BIL
Definition: Spat_Plot.c:35
viewformobj VFO
Definition: bildef.h:255
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ PoslblY()

void PoslblY ( unsigned int  l,
unsigned int  h 
)

Definition at line 575 of file Spat_Plot.c.

References viewformobj::lblY, MObjectSetText(), and bil::VFO.

Referenced by D_pbr_CB(), and DrawAreaPlotCB().

576 {
577 
578  unsigned int yd, i,k;
579  char buf[16];
580  unsigned int lintery;
581  yd = h - l;
582  lintery = yd / (sizeof BIL.VFO.lblY / sizeof BIL.VFO.lblY[0] - 1);
583 
584  k=sizeof BIL.VFO.lblY / sizeof BIL.VFO.lblY[0];
585  for (i =l;i<= h;i+=lintery)
586  {
587  sprintf(buf,"%u", i);
588  if(k==1)
589  sprintf(buf,"%u", h);
590  MObjectSetText(BIL.VFO.lblY[k-1], buf);
591  k--;
592  }
593 }
MOBJECT lblY[11]
Definition: bildef.h:46
void MObjectSetText(MOBJECT obj, const char *text)
bil BIL
Definition: Spat_Plot.c:35
viewformobj VFO
Definition: bildef.h:255
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ReadHeader_ASCII()

int ReadHeader_ASCII ( int  mod,
FILE *  fd 
)

Read ASCII Header of the measurement.
.

Parameters
mod
  • = 0 –> Read header only
  • = 1 –> Assign Header to plot labels
Returns
int = 1 –> EOF reached

Definition at line 1877 of file Spat_Plot.c.

References spectrumheader::altitude, BlindPix, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdmin, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, ch, spectrumheader::comment, D_AssignLabelPlot(), ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, IDX, IDY, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::StrDate, spectrumheader::StrTime, spectrumheader::sza, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, and spectrumheader::wavelen.

Referenced by DatOrBinFormat(), DB_Column(), LoadIo(), ViewNext(), and Visualizza().

1878 {
1879 
1880 
1881  int er = 0;
1882  unsigned char str[128], temp[12], buf[64];
1883  unsigned char ribuf[255];
1884  int NewnR = 0, l = 0 ;
1885  unsigned int i, ch;
1886 // long llong= 0;
1887 
1888  if(feof( fd ))
1889  {
1890  return 1;
1891  }
1892  else
1893  {
1894 
1895  er = fscanf(fd, "%s%s%s%f%s%f%s%u%s%f", temp, BIL.SPH.location, temp, &BIL.SPH.latitude,
1896  temp, &BIL.SPH.longitude, temp, &BIL.SPH.altitude, temp, &BIL.SPH.sza);
1897 
1898  er = fscanf(fd, "%s %s %s %s %d %s %f %f %u %u", BIL.SPH.StrDate, BIL.SPH.StrTime, temp, BIL.SPH.mirpos, &BIL.SPH.wavelen,
1900  &BIL.SPH.ccdmin);
1901 
1902  /*********************************/
1903  // Build the Date
1904  strncpy(str,BIL.SPH.StrDate,4);
1905  BIL.SPH.DATE.da_year = atoi(str);
1906 
1907  strncpy(buf,BIL.SPH.StrDate + 5, 2);
1908  BIL.SPH.DATE.da_mon = atoi(buf);
1909 
1910  strncpy(buf, BIL.SPH.StrDate + 8, 2);
1911  BIL.SPH.DATE.da_day = atoi(buf);
1912  /*********************************/
1913  /*********************************/
1914  // Build the time
1915  strncpy(buf, BIL.SPH.StrTime,2);
1916  BIL.SPH.TIME.ti_hour = atoi(buf);
1917 
1918  strncpy(buf,BIL.SPH.StrTime + 3 ,2);
1919  BIL.SPH.TIME.ti_min = atoi(buf);
1920 
1921  strncpy(buf,BIL.SPH.StrTime + 6 ,2);
1922  BIL.SPH.TIME.ti_sec = atoi(buf);
1923  /*********************************/
1924 
1925  er = fscanf(fd, "%d%d%d%d%d%d%d%d%d%d%d%d%d", &BIL.SPH.imgtype, &BIL.SPH.ccdwx, &BIL.SPH.ccdwy,
1928 
1929  ch = getc(fd);
1930  ch = getc(fd);
1931  //er = fscanf(fd, "%s", BIL.SPH.comment);
1932  //fgets(str, 80, fd);
1933 
1934 
1935 
1936 //for( i = 0; (i < 255) && ((ch = getc(fd)) != EOF) && (ch != '\n'); i++ )
1937 // for( i = 0; i < 255; i++ )
1938  i=0;
1939  do
1940  {
1941 
1942  ribuf[i] = (unsigned char)ch;
1943  ch = getc(fd);
1944  i++;
1945  }while (ch != 10);
1946  /* Terminate string with null character: */
1947  ribuf[i] = '\0';
1948 
1949  sprintf(BIL.SPH.comment, "%s", ribuf);
1950 
1951  // MMessageDialog("DAS Alert", BIL.SPH.comment, "ok", NULL);
1952 
1953 
1954  if(mod)
1956 
1957  }
1958 
1959  IDX = BIL.SPH.ccdwx;
1960  IDY = BIL.SPH.ccdnr;
1961 
1962  if(BIL.SPH.ccdnr == 253)
1963  {
1964  IDY = IDY + 1;
1965  }
1966 
1967  if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
1968  {
1969 
1970  BlindPix = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
1971 
1972  }
1973 // llong = ftell( fd );
1974 
1975 
1976  return 0;
1977 }
struct ddate DATE
Definition: bildef.h:134
char comment[255]
Definition: bildef.h:157
unsigned int ccdmax
Definition: bildef.h:142
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
char StrTime[8]
Definition: bildef.h:136
unsigned int altitude
Altitude of the Station.
Definition: bildef.h:131
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
unsigned char ti_hour
Definition: bildef.h:79
static double ch
Definition: SOLPOS.C:120
unsigned char ti_sec
Definition: bildef.h:81
char filpos[5]
Definition: bildef.h:139
char StrDate[10]
Definition: bildef.h:135
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
float ccdtexp
Definition: bildef.h:140
void D_AssignLabelPlot(void)
Definition: Spat_Plot.c:1661
unsigned char ti_min
Definition: bildef.h:78
float longitude
Longitude of the Station.
Definition: bildef.h:130
unsigned char da_mon
Definition: bildef.h:86
bil BIL
Definition: Spat_Plot.c:35
float latitude
Latitude of the Station.
Definition: bildef.h:129
unsigned char da_day
Definition: bildef.h:85
char location[4]
Name of the Station (BLQ, LPA, EVR, TNB, DMC.....)
Definition: bildef.h:128
short int da_year
Definition: bildef.h:84
float ccdtemp
Definition: bildef.h:141
int BlindPix
Number of blind pixels (usefull for Dark Current)
Definition: DAS_Spat.c:120
unsigned int ccdmin
Definition: bildef.h:143
float sza
Solar Zenith Angle.
Definition: bildef.h:132
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ReadHeader_BIN()

int ReadHeader_BIN ( int  fd)

read the BINARY header of the stored spectrum

Parameters
fdnumber of source file

Definition at line 1798 of file Spat_Plot.c.

References spectrumheader::altitude, BlindPix, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, spectrumheader::comment, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, IDX, IDY, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, spectrumheader::TIME, and spectrumheader::wavelen.

Referenced by DatOrBinFormat(), DB_CalcFluxI(), DB_Column(), ViewNext_BIN(), and Visualizza().

1799 {
1800 
1801  unsigned long info = 0;
1802 
1803 
1804 
1805  if(eof( fd ))
1806  {
1807  return 1;
1808  }
1809  else
1810  {
1811 
1812  info =0;
1813 
1814  info += read(fd, BIL.SPH.location, sizeof(BIL.SPH.location));
1815  info += read(fd, &BIL.SPH.latitude, sizeof(BIL.SPH.latitude));
1816  info += read(fd, &BIL.SPH.longitude, sizeof(BIL.SPH.longitude));
1817  info += read(fd, &BIL.SPH.altitude, sizeof(BIL.SPH.altitude));
1818  info += read(fd, &BIL.SPH.sza, sizeof(BIL.SPH.sza));
1819  info += read(fd, &BIL.SPH.DATE, sizeof(struct ddate));
1820  info += read(fd, &BIL.SPH.TIME, sizeof(struct dtime));
1821 
1822  info += read(fd, BIL.SPH.mirpos, sizeof(BIL.SPH.mirpos));
1823  info += read(fd, &BIL.SPH.wavelen, sizeof(BIL.SPH.wavelen));
1824  info += read(fd, BIL.SPH.filpos, sizeof(BIL.SPH.filpos));
1825 
1826  info += read(fd, &BIL.SPH.ccdtemp, sizeof(BIL.SPH.ccdtemp));
1827  info += read(fd, &BIL.SPH.ccdtexp, sizeof(BIL.SPH.ccdtexp));
1828  info += read(fd, &BIL.SPH.ccdmax, sizeof(BIL.SPH.ccdmax));
1829  //Attenzione - manca il valore del minimo ( anche nella routine di scrittura)
1830  info += read(fd, &BIL.SPH.imgtype, sizeof(BIL.SPH.imgtype));
1831  info += read(fd, &BIL.SPH.ccdwx, sizeof(BIL.SPH.ccdwx));
1832  info += read(fd, &BIL.SPH.ccdwy, sizeof(BIL.SPH.ccdwy));
1833  info += read(fd, &BIL.SPH.ccdsx, sizeof(BIL.SPH.ccdsx));
1834  info += read(fd, &BIL.SPH.ccdsy, sizeof(BIL.SPH.ccdsy));
1835  info += read(fd, &BIL.SPH.ccdex, sizeof(BIL.SPH.ccdex));
1836  info += read(fd, &BIL.SPH.ccdey, sizeof(BIL.SPH.ccdey));
1837  info += read(fd, &BIL.SPH.ccdvb, sizeof(BIL.SPH.ccdvb));
1838  info += read(fd, &BIL.SPH.ccdnr, sizeof(BIL.SPH.ccdnr));
1839  info += read(fd, &BIL.SPH.dummy1, sizeof(BIL.SPH.dummy1));
1840  info += read(fd, &BIL.SPH.dummy2, sizeof(BIL.SPH.dummy2));
1841  info += read(fd, &BIL.SPH.dummy3, sizeof(BIL.SPH.dummy3));
1842  info += read(fd, &BIL.SPH.dummy4, sizeof(BIL.SPH.dummy4));
1843  info += read(fd, &BIL.SPH.comment, sizeof(BIL.SPH.comment));
1844 
1845 
1846  IDX = BIL.SPH.ccdwx;
1847 
1848  // !!!!ATTENTION!!!! This is only for the CCD30-11 OE FI- Please check where is defined
1849  // the IDY in the Main Program for the Data Acquisition
1850  //if (DAS.Paramini.EqType == SPATRAM2 || DAS.Paramini.EqType == GASCODNG3 || DAS.Paramini.EqType == GASCODNG4)
1851  if(BIL.SPH.ccdwy == 256)
1852  IDY = BIL.SPH.ccdnr+1;
1853  else
1854  IDY = BIL.SPH.ccdnr;
1855  if(BIL.SPH.ccdnr == 253)
1856  {
1857  IDY = IDY + 1;
1858  }
1859 
1860  if (BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) != 0) // se i pixel del sensore sono piu' di quelli in param.ini
1861  {
1862 
1863  BlindPix = BIL.SPH.ccdwx - (BIL.SPH.ccdex +1) ;
1864 
1865  }
1866 
1867 // D_AssignLabelPlot();
1868  }
1869  return 0;
1870 
1871 }
struct ddate DATE
Definition: bildef.h:134
char comment[255]
Definition: bildef.h:157
unsigned int ccdmax
Definition: bildef.h:142
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
Definition: bildef.h:83
unsigned int altitude
Altitude of the Station.
Definition: bildef.h:131
Definition: Dildef.h:423
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
char filpos[5]
Definition: bildef.h:139
char mirpos[8]
Definition: bildef.h:137
struct dtime TIME
Definition: bildef.h:133
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
Definition: bildef.h:77
float ccdtexp
Definition: bildef.h:140
float longitude
Longitude of the Station.
Definition: bildef.h:130
bil BIL
Definition: Spat_Plot.c:35
float latitude
Latitude of the Station.
Definition: bildef.h:129
char location[4]
Name of the Station (BLQ, LPA, EVR, TNB, DMC.....)
Definition: bildef.h:128
float ccdtemp
Definition: bildef.h:141
int BlindPix
Number of blind pixels (usefull for Dark Current)
Definition: DAS_Spat.c:120
float sza
Solar Zenith Angle.
Definition: bildef.h:132
+ Here is the caller graph for this function:

§ ReadIMG()

void ReadIMG ( FILE *  file,
unsigned short *  mat,
int  hp,
int  vp 
)

Read ASCII Image (Spectral Data only)
.

Parameters
*file= ASCII file number
*mat= image buffer
hp= horizontal pixels
vp= vertical pixels

Definition at line 1206 of file Spat_Plot.c.

Referenced by DatOrBinFormat(), DB_Column(), DT_CorrFileEvora(), DT_CorrHeader(), LoadIo(), ViewNext(), and Visualizza().

1207 {
1208 
1209 
1210  int x, y;
1211 
1212  for(y = 0; y < vp; y++)
1213  {
1214  for(x = 0; x < hp; x++)
1215  {
1216  fscanf(file, "%5u ", &mat[y * hp + x]);
1217  }
1218  }
1219 }
+ Here is the caller graph for this function:

§ ReadIMG_BIN()

void ReadIMG_BIN ( int  fd,
unsigned short *  mat,
int  hp,
int  vp 
)

read the BINARY stored spectrum

Parameters
fdnumber of source file
*matdestination buffer
hphorizontal pixels
vpvertical pixels

Definition at line 1166 of file Spat_Plot.c.

Referenced by DatOrBinFormat(), DB_CalcFluxI(), DB_Column(), ViewNext_BIN(), and Visualizza().

1167 {
1168  int x, y;
1169 
1170  for(x = 0; x < hp; x++)
1171  {
1172  for(y = 0; y < vp; y++)
1173  read(fd, &mat[y * hp + x], 2);
1174 
1175  }
1176 }
+ Here is the caller graph for this function:

§ ReadIMG_old()

void ReadIMG_old ( FILE *  file,
int  hp,
int  vp 
)

NOT Used
.

Definition at line 1136 of file Spat_Plot.c.

References bil::DPLOT, and d_view::ImatGraf.

1137 {
1138 
1139 
1140  int x, y;
1141 
1142  for(y = 0; y < vp; y++)
1143  {
1144  for(x = 0; x < hp; x++)
1145  {
1146  fscanf(file, "%5u ", &BIL.DPLOT.ImatGraf[y * hp + x]);
1147  }
1148  }
1149 }
d_view DPLOT
Definition: bildef.h:254
unsigned short * ImatGraf
Definition: bildef.h:176
bil BIL
Definition: Spat_Plot.c:35

§ SaveImage()

int SaveImage ( int  fmt,
int  imgw,
int  imgh,
int  np 
)

Definition at line 2485 of file Spat_Plot.c.

2486 {
2487 
2488 /*
2489 
2490  maxplotw = MObjectGetWidth(BIL.VFO.View_Sh);
2491  maxploth = MObjectGetHeight(BIL.VFO.View_Sh);
2492  BIL.VFO.dimg = MAllocImage(maxplotw, maxploth, 24);
2493 
2494  InitImage(BIL.VFO.dimg, maxplotw, maxploth, 192, 192, 192);
2495 
2496  for(x = 0; x < maxplotw ; maxplotw++)
2497  for(y = 0; y < maxploth ; maxploth++)
2498  {
2499  MObjectGetPixelRGB(BIL.VFO.View_Sh, r, g, b);
2500  MImageSetPixelRGB(BIL.VFO.dimg, x , y, r, g, b);
2501  }
2502  }
2503 
2504  MInstallImage(BIL.VFO.dimg);
2505  MDrawImage(lensdraw, lensmim, 0, 0, wx * p, wy * p, 0, 0);
2506  MUninstallImage(lensmim);
2507 
2508 
2509 */
2510 
2511  return 0;
2512 }

§ SaveIo()

int SaveIo ( char *  buff)

Definition at line 3069 of file Spat_Plot.c.

References AllocUSMat(), D_Print_BIL_H_ASCII(), bil::DPLOT, IDX, IDY, d_view::ImatGraf, doas::IoMat, and SwapMatrix().

Referenced by SetAsIo().

3070 {
3071  FILE *fs;
3072  int x, y;
3073 
3074  DOAS.IoMat = AllocUSMat(IDX, IDY);
3075 
3076  fs = fopen(buff, "w");
3077  if(fs < 0) return 1;
3078 
3079  // Print on file the header
3080  D_Print_BIL_H_ASCII(0, fs);
3081 
3082 
3083  for(y = 0; y < IDY; y++)
3084  {
3085  for(x = 0; x < IDX; x++)
3086  {
3087  if((x % 10) == 0)
3088  {
3089  if(y == 0 && x == 0)
3090  {
3091  }
3092  else
3093  fprintf(fs, "\n", NULL);
3094  }
3095  fprintf(fs, " %5u", BIL.DPLOT.ImatGraf[y * IDX + x]);
3096  }
3097 
3098  }
3099  fprintf(fs, "\n", NULL);
3100 
3101 /*
3102  for(x = 0; x < IDX ; x++)
3103  {
3104 
3105  fprintf(fs, " %7.3f", DOAS.lambda[x]);
3106  for(y = 0; y < IDY; y++)
3107  {
3108  fprintf(fs, " %5u", BIL.DPLOT.ImatGraf[y * IDX + x]);
3109 
3110  }
3111  fprintf(fs, "\n", NULL);
3112  }
3113 */
3114  fclose(fs);
3115 
3116 
3117  SwapMatrix(BIL.DPLOT.ImatGraf, DOAS.IoMat, IDX, IDY);
3118 // MMessageDialog("DAS information", buff, "ok", NULL);
3119  return 0;
3120 }
int IDX
Number of sensible horizontal pixels.
Definition: DAS_Spat.c:118
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
unsigned short * AllocUSMat(int hp, int vp)
Definition: Spat_Plot.c:1994
d_view DPLOT
Definition: bildef.h:254
doas DOAS
Definition: Spat_Plot.c:37
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
unsigned short * ImatGraf
Definition: bildef.h:176
unsigned short * IoMat
Reference spectrum.
Definition: DOASdef.h:27
bil BIL
Definition: Spat_Plot.c:35
void D_Print_BIL_H_ASCII(int mod, FILE *fff)
Definition: Utils.c:621
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SaveSpectrum()

int SaveSpectrum ( char *  buff)

Definition at line 3162 of file Spat_Plot.c.

References FLAG, IDY, MMessageDialog(), flag::Wl, and WriteSelColandSmoothed().

Referenced by MenuFileOLP_CB().

3163 {
3164  FILE *fs;
3165  char str[128];
3166 // int x, y;
3167  fs = fopen(buff, "a");
3168  if(fs < 0) return 1;
3169 
3170  //WriteColumn( FLAG.Wl ,fs);
3172  fclose(fs);
3173 
3174  sprintf(str, " Line # %d, saved on file %s .",IDY/2, buff);
3175  MMessageDialog ("DAS Info", str, "OK",NULL);
3176  return 0;
3177 }
flag FLAG
Definition: CreateForms.c:84
int Wl
Flag for the units on the X scale plot.
void WriteSelColandSmoothed(int mod, FILE *fd, int selcol)
write selected Column
Definition: Save.c:1060
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
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:

§ SetAsIo()

int SetAsIo ( void  )

Definition at line 3126 of file Spat_Plot.c.

References d_fileman::DBFILENAME, bil::DFILEM, FDAT, FSAVE, d_fileman::HOMEDIRECTORY, doas::IoFileNeme, MDCreateFM_Shell(), MMessageDialog(), SaveIo(), bil::SPH, and spectrumheader::wavelen.

Referenced by D_PButt_CB().

3127 {
3128 
3129  char buf[MAX_PATH],str[MAX_PATH];
3130  char filedatan[32];
3131  int er;
3132 
3133  sprintf(filedatan, "Io_%d.ref",BIL.SPH.wavelen);
3134 
3135  sprintf(buf,"\\%s\\%s\\%s", "DOAS", "Io",filedatan);
3136  strcpy(str, BIL.DFILEM.HOMEDIRECTORY);
3137  strcat(str,buf);
3138 
3139  sprintf(buf, "Do you want to save the Io file as:\n%s ?", str);
3140  er = MMessageDialog("DAS information", buf, "Yes", "No", "Cancel",NULL);
3141  if (er == 0)
3142  {
3143  SaveIo(str);
3144  sprintf(DOAS.IoFileNeme, "%s", str);
3145  return 2;
3146  }
3147  else if (er==1)
3148  {
3149  BIL.DFILEM.DBFILENAME[0] = 0;
3150  MDCreateFM_Shell(FSAVE, FDAT); //Save File as, Dat ext.
3152  sprintf(DOAS.IoFileNeme, "%s", BIL.DFILEM.DBFILENAME);
3153  return 1;
3154  }
3155  else
3156  return 0;
3157 
3158 
3159 }
#define FSAVE
Definition: bildef.h:218
char HOMEDIRECTORY[_MAX_PATH]
Definition: bildef.h:200
spectrumheader SPH
Spectrum Header Structure.
Definition: bildef.h:256
#define FDAT
Definition: bildef.h:221
d_fileman DFILEM
Definition: bildef.h:257
char IoFileNeme[_MAX_PATH]
File name for Reference spectrum (Io)
Definition: DOASdef.h:26
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
MOBJECT MDCreateFM_Shell(int mod, int fmt)
Definition: DFileMan.c:407
doas DOAS
Definition: Spat_Plot.c:37
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int SaveIo(char *buff)
Definition: Spat_Plot.c:3069
bil BIL
Definition: Spat_Plot.c:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SwapMatrix()

void SwapMatrix ( unsigned short *  source,
unsigned short *  dest,
int  hp,
int  vp 
)

Copy the source matrix in the Destination one
.

Parameters
*source= source matrix (buffer)
*dest= destination matrix (buffer)
hp= horizontal pixels
vp= vertical pixels

Definition at line 1979 of file Spat_Plot.c.

Referenced by DrawAreaPlotCB(), SaveIo(), ViewNext(), ViewNext_BIN(), and Visualizza().

1980 {
1981 
1982  int t, j;
1983 
1984  for(t = 0 ; t < vp ; t++)
1985  {
1986  for(j = 0; j < hp; j++)
1987  {
1988  dest[t * hp + j] = source[t * hp + j];
1989  }
1990  }
1991 
1992 }
+ 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:

§ ViewPlot()

int ViewPlot ( int  mod)

Create the plot shell. Procedure that build the plot shell for the data visualization.

Parameters
mod
  • = 0 –> Off Line Plot
  • = 1 –> On Line Plot
Returns
void

Definition at line 3775 of file Spat_Plot.c.

References _MAX_PATH, alfont, bil::BLENS, BOTTOM_ALIGN, CENTER_ALIGN, ClosePlotCB(), viewformobj::cmdpb, D_pbr_CB(), D_PButt_CB(), DB_AreaInput(), palette::DB_BG, palette::DB_BG_Albl, palette::DB_BG_Plbl, DB_EqTypePlotCB(), palette::DB_FG_Albl, palette::DB_FG_Plbl, palette::DB_UnSel, DB_XUnitsCB(), delay(), dmenu, DOASMODE, das::DOption, bil::DPLOT, d_view::drawapl, DrawAreaPlotCB(), EM_BUTTON_PRESS, paramini::EqType, flag::exec, flag::exemode, F10, False, ffilenames, Fitem, FIXED_SMALL, FLAG, das::Flag, Fmenu, viewformobj::formbutt, HELV_SMALL, optionini::hlineafter, optionini::hlinebefore, IDY, blens::Imim, InitImage(), item_pd, lbl, viewformobj::lblalt, viewformobj::lblAzimuth, viewformobj::lblccdex, viewformobj::lblccdey, viewformobj::lblccdsx, viewformobj::lblccdsy, viewformobj::lblccdtemp, viewformobj::lblccdtexp, viewformobj::lblccdwx, viewformobj::lblccdwy, viewformobj::lbldate, viewformobj::lblfilter, viewformobj::lbllat, viewformobj::lblloc, viewformobj::lbllong, viewformobj::lblmax, viewformobj::lblmin, viewformobj::lblmirpos, viewformobj::lblndfilter, viewformobj::lblnr, viewformobj::lblnummeas, viewformobj::lblsza, viewformobj::lbltime, viewformobj::lblvb, viewformobj::lblwaveleng, viewformobj::lblX, viewformobj::lblY, viewformobj::lblZenith, LEFT_ALIGN, MakeItemUnsensitiveCB(), MAllocImage(), Master, maxploth, maxplotw, MButtonSetOnMouseOverForegroundRGB(), MCreateColForm(), MCreateDrawArea(), MCreateLabel(), MCreateMenu(), MCreateMenuBar(), MCreatePButton(), MCreatePopupMenu(), MCreateRButton(), MCreateRowForm(), MCreateShell(), MCreateSubMenu(), MCreateTableForm(), MD_CreateBRowShell(), MDrawAreaSetExposeCallback(), MDrawAreaSetInputCallback(), menu, MenuFileOLP_CB(), MenuToolsOLP_CB(), MFormSetSpacing(), MGetScreenWidth(), MLabelSetAlignment(), MLabelSetMargin(), MMenuAddItem(), MMenuAddItemObsolete(), MMenuAddRadioItem(), MMenuBarSetAcc(), MMenuItemSetCheckStatus(), MObjectAddEventNotifyCallback(), MObjectAlign(), MObjectGetHeight(), MObjectGetWidth(), MObjectSetBackgroundRGB(), MObjectSetColor(), MObjectSetCompositeWidth(), MObjectSetFont(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetSensitive(), MObjectSetShadow(), MObjectSetTransparency(), MObjectSetUnsensitive(), MObjectUnmap(), MPButtonSetCallback(), MRButtonActivate(), MShellRealizeXY(), MTableFormSetColAlign(), MTableFormSetRowAlign(), MTCL, OFFLINEPLOT, d_view::OLDnR, ON_OFFLINEPLOT, Optmenu, das::Paramini, d_view::pbr, PButtSelAll_CB(), PBYScale_CB(), mtcl::PLColor, plfont, flag::plotYRange, PopUp_CB(), popup_pd, PopupMenuCB(), PrgFile, RIGHT_ALIGN, viewformobj::selallpb, submenu, Titem, Tmenu, TOP_ALIGN, True, UNDEF_ALIGN, bil::VFO, viewformobj::View_Sh, mtcl::white, flag::Wl, WS_ETCHED_IN, WS_NONE, WS_SHADOW_IN, viewformobj::XAxisU, viewformobj::xincr, viewformobj::xloc, viewformobj::yincr, viewformobj::yloc, and viewformobj::YScalePB.

Referenced by D_Plot(), DB_HorComm_CB(), DB_KeyB_CB(), E_Plot(), RunOLP(), and ViewCB().

3776 {
3777  int i;
3778  int rformw,scrw;
3779  char buff[8];
3780  extern char PrgFile[_MAX_PATH];
3781 
3782  MOBJECT _tablefrm000;
3783  MOBJECT _rowform000;
3784  MOBJECT _tablefrm001;
3785  MOBJECT _colform000;
3786  MOBJECT _tablefrm002;
3787  MOBJECT _rowform001;
3788  MOBJECT _rowform002;
3789  MOBJECT _colform001;
3790  MOBJECT _colform002;
3791 
3792  MOBJECT _rowform003;
3793  MOBJECT _tablefrm003;
3794  MOBJECT _rowform004;
3795  MOBJECT _tablefrm004;
3796  MOBJECT _rowform005;
3797  MOBJECT _tablefrm005;
3798  MOBJECT _rowform006;
3799  MOBJECT _tablefrm006;
3800  MOBJECT lbl;
3801  MOBJECT tb, rb;
3802 
3803 
3804  plfont = FIXED_SMALL;
3805  alfont = HELV_SMALL;
3806 
3807 // plfont = MLoadFont("Times", 16, False, False);
3808 // alfont = MLoadFont("Arial", 16, False, False);
3809 
3810  if (mod)
3811  ON_OFFLINEPLOT = 1;
3812  else
3813  ON_OFFLINEPLOT = 0;
3814 
3815 
3816 
3817 
3818  BIL.VFO.View_Sh = MCreateShell("PLOTTING File: None", 0);
3822 
3823 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
3824 //Menu
3825  if( (DAS.Flag.exemode == OFFLINEPLOT) | (DAS.Flag.exemode == DOASMODE))
3826  {
3827  MENU_ITEM item;
3829 
3831  MObjectSetBackgroundRGB(dmenu, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
3833  MObjectSetFont(dmenu, alfont, True);
3834 
3835  MMenuBarSetAcc(dmenu, F10);
3836  Fmenu = MCreateMenu(dmenu, "File");
3837  Fitem[0] = MMenuAddItem(Fmenu, "Open", (MENU_ITEM_CB) MenuFileOLP_CB, 0);
3838  Fitem[1] = MMenuAddItem(Fmenu, "Next", (MENU_ITEM_CB) MenuFileOLP_CB, (void *) 1);
3840  Fitem[2] = MMenuAddItem(Fmenu, "Previous", (MENU_ITEM_CB) MenuFileOLP_CB, (void *)2);
3842  Fitem[3] = MMenuAddItem(Fmenu, "Save As...", (MENU_ITEM_CB) MenuFileOLP_CB, (void *)3);
3844  Fitem[4] = MMenuAddItem(Fmenu, "Close", (MENU_ITEM_CB) MenuFileOLP_CB, (void *)4);
3846  Fitem[5] = MMenuAddItem(Fmenu, "Close Plot", (MENU_ITEM_CB) MenuFileOLP_CB, (void *)5);
3847  //MakeItemUnsensitiveCB (Fmenu, Fitem[5], 0);
3848  Tmenu = MCreateMenu(dmenu, "Tools");
3849  Titem[0] = MMenuAddItem(Tmenu, "Filter/Smooth", (MENU_ITEM_CB) MenuToolsOLP_CB, 0);
3850  Titem[1] = MMenuAddItem(Tmenu, "Zoom", (MENU_ITEM_CB) MenuToolsOLP_CB, (void *)1);
3851  Titem[2] = MMenuAddItem(Tmenu, "Sun calculator", (MENU_ITEM_CB) MenuToolsOLP_CB, (void *)2);
3852  Titem[3] = MMenuAddItem(Tmenu, "Print ", (MENU_ITEM_CB) MenuToolsOLP_CB, (void *)3);
3853 
3854  Optmenu = MCreateMenu(dmenu, "Options");
3855  item = MMenuAddItem(Optmenu, "X Units", (MENU_ITEM_CB) NULL, 0);
3856  submenu = MCreateSubMenu(item);
3857  item = MMenuAddRadioItem(submenu, "Pixel", (MENU_ITEM_CB)DB_XUnitsCB, 0);
3858  if(FLAG.Wl == 0)
3859  MMenuItemSetCheckStatus (item, True);
3860  item = MMenuAddRadioItem(submenu, "Wl[A]", (MENU_ITEM_CB)DB_XUnitsCB, (void *)1);
3861  if(FLAG.Wl == 1)
3862  MMenuItemSetCheckStatus (item, True);
3863  item = MMenuAddRadioItem(submenu, "Wl[nm]", (MENU_ITEM_CB)DB_XUnitsCB, (void *)2);
3864  if(FLAG.Wl == 2)
3865  MMenuItemSetCheckStatus (item, True);
3866 /* if(FLAG.Wl == 0)
3867  MRButtonActivate(BIL.VFO.XAxisU[0]);
3868  else if(FLAG.Wl == 1)
3869  MRButtonActivate(BIL.VFO.XAxisU[1]);
3870  else if(FLAG.Wl == 2)
3871  MRButtonActivate(BIL.VFO.XAxisU[2]);
3872 
3873 */
3874  item = MMenuAddItem(Optmenu, "Y Scale", (MENU_ITEM_CB) NULL, 0);
3875  submenu = MCreateSubMenu(item);
3876  item = MMenuAddRadioItem(submenu, "Min/Max", (MENU_ITEM_CB)PBYScale_CB, 0);
3877  if(FLAG.plotYRange == 1)
3878  MMenuItemSetCheckStatus (item, True);
3879  item = MMenuAddRadioItem(submenu, "Full Range", (MENU_ITEM_CB)PBYScale_CB, (void *)1);
3880  if(FLAG.plotYRange == 0)
3881  MMenuItemSetCheckStatus (item, True);
3882 
3883  item = MMenuAddItem(Optmenu, "Hidden Lines", (MENU_ITEM_CB) NULL, 0);
3884 
3885  menu = MCreateMenu(dmenu, "Help");
3886  item = MMenuAddItem(menu, "About", (MENU_ITEM_CB) NULL, 0);
3887 
3888 
3889 
3890  }
3891 
3892 
3893 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
3894 
3895  _tablefrm000 = MCreateTableForm(BIL.VFO.View_Sh, 2);
3896  MFormSetSpacing(_tablefrm000, 0);
3897 
3898  MTableFormSetColAlign(_tablefrm000, 1, CENTER_ALIGN);
3899  MObjectSetBackgroundRGB(_tablefrm000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
3900  MObjectSetResize(_tablefrm000, True, True);
3901 
3902  _rowform000 = MCreateRowForm(_tablefrm000);
3903  MFormSetSpacing(_rowform000, 1);
3904  MObjectSetBackgroundRGB(_rowform000, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
3905 
3906  MObjectSetResize(_rowform000, True, True);
3907 
3908  _tablefrm001 = MCreateTableForm(_rowform000, 12);
3909  MFormSetSpacing(_tablefrm001, 2);
3910  MTableFormSetColAlign(_tablefrm001, 0, LEFT_ALIGN);
3911  MObjectSetBackgroundRGB(_tablefrm001, 184, 132, 0);
3912  MObjectSetBackgroundRGB(_tablefrm001, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
3913  MObjectSetResize(_tablefrm001, True, False);
3914 
3915  lbl = MCreateLabel(_tablefrm001, "Station:", plfont);
3916  //MLabelSetAlignment(lbl, LEFT_ALIGN);
3917  //MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
3918  //MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3919  MObjectSetResize(lbl, True, True);
3922 
3923 
3924  lbl = MCreateLabel(_tablefrm001, "LAT:", plfont);
3925  //MLabelSetAlignment(lbl, LEFT_ALIGN);
3926  //MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
3927  //MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3928  //MObjectSetCompositeWidth(lbl, 48);
3929  MObjectSetResize(lbl, True, True);
3932 
3933 
3934  lbl = MCreateLabel(_tablefrm001, "LON:", plfont);
3935  //MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
3936  //MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
3937  MObjectSetResize(lbl, True, True);
3940 
3941 
3942 
3943  lbl = MCreateLabel(_tablefrm001, "Date:", plfont);
3944  MObjectSetResize(lbl, True, True);
3947 
3948 
3949  lbl = MCreateLabel(_tablefrm001, "Time (LT):", plfont);
3950  MObjectSetResize(lbl, True, True);
3953 
3954  lbl = MCreateLabel(_tablefrm001, "Input Mirror:", plfont);
3955  MObjectSetResize(lbl, True, True);
3958 
3959  lbl = MCreateLabel(_tablefrm001, "Wavelength:", plfont);
3960  MObjectSetResize(lbl, True, True);
3963 
3964  lbl = MCreateLabel(_tablefrm001, "Filter:", plfont);
3965  MObjectSetResize(lbl, True, True);
3968 
3969  lbl = MCreateLabel(_tablefrm001, "NDFilter:", plfont);
3970  MObjectSetResize(lbl, True, True);
3973 
3974  lbl = MCreateLabel(_tablefrm001, "CCD Temp(ºC):", plfont);
3975  MObjectSetResize(lbl, True, True);
3978 
3979  lbl = MCreateLabel(_tablefrm001, "Exp.Time(sec):", plfont);
3980  MObjectSetResize(lbl, True, True);
3983 
3984  lbl = MCreateLabel(_tablefrm001, "Meas. N. :", plfont);
3985  MObjectSetResize(lbl, True, True);
3988 
3989  BIL.VFO.lblloc = MCreateLabel(_tablefrm001, "xxxxx", alfont);
3990  //MObjectSetShadow(BIL.VFO.lblloc, WS_SHADOW_IN, 1, 0);
3991  //MLabelSetAlignment(BIL.VFO.lblloc, RIGHT_ALIGN);
3996 
3997  BIL.VFO.lbllat = MCreateLabel(_tablefrm001, "xxx.xx", alfont);
3998  //MObjectSetShadow(BIL.VFO.lbllat, WS_SHADOW_IN, 1, 0);
3999  //MLabelSetAlignment(BIL.VFO.lbllat, RIGHT_ALIGN);
4004 
4005  BIL.VFO.lbllong = MCreateLabel(_tablefrm001, "xxx.xx", alfont);
4006  //MObjectSetShadow(BIL.VFO.lbllong, WS_SHADOW_IN, 1, 0);
4007  //MLabelSetAlignment(BIL.VFO.lbllong, RIGHT_ALIGN);
4012 
4013 
4014  BIL.VFO.lbldate = MCreateLabel(_tablefrm001, "yyyy/mm/dd", alfont);
4019 
4020  BIL.VFO.lbltime = MCreateLabel(_tablefrm001, "hh:mn:ss", alfont);
4025 
4026  BIL.VFO.lblmirpos = MCreateLabel(_tablefrm001, "NULL", alfont);
4031 
4032  BIL.VFO.lblwaveleng = MCreateLabel(_tablefrm001, "NULL", alfont);
4037 
4038  BIL.VFO.lblfilter = MCreateLabel(_tablefrm001, "NULL", alfont);
4043 
4044  BIL.VFO.lblndfilter = MCreateLabel(_tablefrm001, "NULL", alfont);
4049 
4050  BIL.VFO.lblccdtemp = MCreateLabel(_tablefrm001, "+/- xx.xx", alfont);
4055 
4056  BIL.VFO.lblccdtexp = MCreateLabel(_tablefrm001, "0.000", alfont);
4061 
4062  BIL.VFO.lblnummeas = MCreateLabel(_tablefrm001, "0", alfont);
4067 
4068 /****************/
4069 
4070  BIL.VFO.formbutt = MCreateColForm(_rowform000);
4072 // MObjectSetBackgroundRGB(BIL.VFO.formbutt, 64, 28, 128);
4074 
4075  if (mod)
4076  {
4077 
4078  if(IDY <= 16)
4079  {
4080  for (i=DAS.DOption.hlinebefore; i < IDY - DAS.DOption.hlineafter; i++)
4081  {
4082  sprintf(buff,"r. %d", i+1);
4086  MPButtonSetCallback(BIL.DPLOT.pbr[i], D_pbr_CB, (void *) i);
4087  //MObjectSetBackgroundRGB(pbr[i], 197, 197, 144);
4089  }
4090  }
4091  else
4093  }
4094  else
4095  {
4096  BIL.DPLOT.OLDnR = 0;
4097 
4098  for (i=0; i < 16; i++)
4099  {
4100  sprintf(buff,"r. %d", i+1);
4104  MPButtonSetCallback(BIL.DPLOT.pbr[i], D_pbr_CB, (void *) i);
4105  //MObjectSetBackgroundRGB(BIL.DPLOT.pbr[i], 197, 197, 144);
4107  MObjectUnmap(BIL.DPLOT.pbr[i]);
4108  }
4109 
4110 
4111  }
4112 
4113 //build the right column
4114 /************************************************/
4115 
4116  _rowform003 = MCreateRowForm(_tablefrm000);
4117  MFormSetSpacing(_rowform003, 0);
4118  MObjectAlign(_rowform003, LEFT_ALIGN, TOP_ALIGN);
4119 // MObjectSetBackgroundRGB(_rowform003, 175, 165, 75);
4120 // MObjectSetBackgroundRGB(_rowform003, 184, 132, 0);
4121  MObjectSetBackgroundRGB(_rowform003, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4122  MObjectSetResize(_rowform003, False, False);
4123 
4124  lbl = MCreateLabel(_rowform003, "Geo.Inf.", HELV_SMALL);
4126  MObjectSetBackgroundRGB(lbl, 144, 172, 184);
4127  MObjectSetTransparency(lbl, 0);
4128  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4129  MObjectSetResize(lbl, True, False);
4130 
4131  rformw = MObjectGetWidth(lbl);
4132 
4133  _tablefrm003 = MCreateTableForm(_rowform003, 2);
4134  MFormSetSpacing(_tablefrm003, 1);
4135  MTableFormSetColAlign(_tablefrm003, 0, LEFT_ALIGN);
4136 // MObjectAlign(_tablefrm003, LEFT_ALIGN, TOP_ALIGN);
4137 // MObjectSetForegroundRGB(_tablefrm003, 192, 192, 192);
4138 // MObjectSetBackgroundRGB(_tablefrm003, 184, 132, 0);
4139  MObjectSetBackgroundRGB(_tablefrm003, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4140  MObjectSetResize(_tablefrm003, False, False);
4141 /*
4142  lbl = MCreateLabel(_tablefrm003, "LOC: ", plfont);
4143  MLabelSetAlignment(lbl, LEFT_ALIGN);
4144  MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
4145  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4146  MObjectSetResize(lbl, True, True);
4147  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
4148  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
4149 
4150  BIL.VFO.lblloc = MCreateLabel(_tablefrm003, "xxxxx", alfont);
4151  MObjectSetShadow(BIL.VFO.lblloc, WS_SHADOW_IN, 1, 0);
4152  MLabelSetAlignment(BIL.VFO.lblloc, RIGHT_ALIGN);
4153  MObjectSetResize(BIL.VFO.lblloc, True, False);
4154  MObjectSetForegroundRGB(BIL.VFO.lblloc, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4155  MObjectSetBackgroundRGB(BIL.VFO.lblloc, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4156  MObjectSetTransparency(BIL.VFO.lblloc, 0);
4157 
4158  lbl = MCreateLabel(_tablefrm003, "LAT: ", plfont);
4159  MLabelSetAlignment(lbl, LEFT_ALIGN);
4160  MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
4161  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4162  MObjectSetCompositeWidth(lbl, 48);
4163  MObjectSetResize(lbl, True, True);
4164  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
4165  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
4166 
4167  BIL.VFO.lbllat = MCreateLabel(_tablefrm003, "xxx.xx", alfont);
4168  MObjectSetShadow(BIL.VFO.lbllat, WS_SHADOW_IN, 1, 0);
4169  MLabelSetAlignment(BIL.VFO.lbllat, RIGHT_ALIGN);
4170  MObjectSetResize(BIL.VFO.lbllat, True, False);
4171  MObjectSetForegroundRGB(BIL.VFO.lbllat, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4172  MObjectSetBackgroundRGB(BIL.VFO.lbllat, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4173  MObjectSetTransparency(BIL.VFO.lbllat, 0);
4174 
4175  lbl = MCreateLabel(_tablefrm003, "LON: ", plfont);
4176  MObjectAlign(lbl, LEFT_ALIGN, TOP_ALIGN);
4177  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4178  MObjectSetResize(lbl, True, True);
4179  MObjectSetForegroundRGB(lbl, DPAL.DB_FG_Plbl[0], DPAL.DB_FG_Plbl[1], DPAL.DB_FG_Plbl[2]);
4180  MObjectSetBackgroundRGB(lbl, DPAL.DB_BG_Plbl[0], DPAL.DB_BG_Plbl[1], DPAL.DB_BG_Plbl[2]);
4181 
4182  BIL.VFO.lbllong = MCreateLabel(_tablefrm003, "xxx.xx", alfont);
4183  MObjectSetShadow(BIL.VFO.lbllong, WS_SHADOW_IN, 1, 0);
4184  MLabelSetAlignment(BIL.VFO.lbllong, RIGHT_ALIGN);
4185  MObjectSetResize(BIL.VFO.lbllong, False, False);
4186  MObjectSetForegroundRGB(BIL.VFO.lbllong, DPAL.DB_FG_Albl[0], DPAL.DB_FG_Albl[1], DPAL.DB_FG_Albl[2]);
4187  MObjectSetBackgroundRGB(BIL.VFO.lbllong, DPAL.DB_BG_Albl[0], DPAL.DB_BG_Albl[1], DPAL.DB_BG_Albl[2]);
4188  MObjectSetTransparency(BIL.VFO.lbllong, 0);
4189 */
4190  lbl = MCreateLabel(_tablefrm003, "ALT: ", plfont);
4192  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4193  MObjectSetResize(lbl, True, True);
4196 
4197  BIL.VFO.lblalt = MCreateLabel(_tablefrm003, "xxx", alfont);
4205 
4206  lbl = MCreateLabel(_tablefrm003, "SZA: ", plfont);
4208  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4209  MObjectSetResize(lbl, True, True);
4212 
4213  BIL.VFO.lblsza = MCreateLabel(_tablefrm003, "xxx.xx", alfont);
4220 
4221  lbl = MCreateLabel(_tablefrm003, "Zenith: ", plfont);
4223  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4224  MObjectSetResize(lbl, True, True);
4227 
4228  BIL.VFO.lblZenith = MCreateLabel(_tablefrm003, "xxx.xx", alfont);
4235 
4236  lbl = MCreateLabel(_tablefrm003, "Azimuth: ", plfont);
4238  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4239  MObjectSetResize(lbl, True, True);
4242 
4243  BIL.VFO.lblAzimuth = MCreateLabel(_tablefrm003, "xxx.xx", alfont);
4250 
4251  _rowform004 = MCreateRowForm(_rowform003);
4252  MFormSetSpacing(_rowform004, 0);
4253  MObjectSetBackgroundRGB(_rowform004, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4254 // MObjectSetBackgroundRGB(_rowform004, 184, 132, 0);
4255  MObjectSetResize(_rowform004, False, False);
4256 
4257  lbl = MCreateLabel(_rowform004, "Meas.Inf.", HELV_SMALL);
4259  MObjectSetBackgroundRGB(lbl, 144, 172, 184);
4260  MObjectSetTransparency(lbl, 0);
4261  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4262  MObjectSetResize(lbl, True, False);
4263 
4264  _tablefrm004 = MCreateTableForm(_rowform004, 2);
4265  MFormSetSpacing(_tablefrm004, 1);
4266  MTableFormSetColAlign(_tablefrm004, 0, LEFT_ALIGN);
4267  MObjectAlign(_tablefrm004, LEFT_ALIGN, TOP_ALIGN);
4268 // MObjectSetForegroundRGB(_tablefrm004, 192, 192, 192);
4269 // MObjectSetBackgroundRGB(_tablefrm004, 184, 132, 0);
4270  MObjectSetBackgroundRGB(_tablefrm004, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4271  MObjectSetResize(_tablefrm004, True, False);
4272 
4273  lbl = MCreateLabel(_tablefrm004, "Max:", plfont);
4275  MLabelSetMargin(lbl, 2, 2);
4277  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4278  MObjectSetResize(lbl, True, True);
4281 
4282  BIL.VFO.lblmax = MCreateLabel(_tablefrm004, "xxxxx", alfont);
4289 
4290  lbl = MCreateLabel(_tablefrm004, "Min:", plfont);
4293  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4294  MObjectSetResize(lbl, True, True);
4297 
4298  BIL.VFO.lblmin = MCreateLabel(_tablefrm004, "xxxxx", alfont);
4305 
4306 /******************************************/
4307 
4308  lbl = MCreateLabel(_tablefrm004, "ccdWx:", plfont);
4310  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4311  MObjectSetResize(lbl, True, True);
4314 
4315  BIL.VFO.lblccdwx = MCreateLabel(_tablefrm004, "xxxx", alfont);
4322 
4323  lbl = MCreateLabel(_tablefrm004, "ccdWy:", plfont);
4325  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4326  MObjectSetResize(lbl, True, True);
4329 
4330  BIL.VFO.lblccdwy = MCreateLabel(_tablefrm004, "xxxx", alfont);
4337 
4338 
4339 /*********************************************/
4340 
4341  lbl = MCreateLabel(_tablefrm004, "ccdSx:", plfont);
4343  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4344  MObjectSetResize(lbl, True, True);
4347 
4348  BIL.VFO.lblccdsx = MCreateLabel(_tablefrm004, "xxxx", alfont);
4355 
4356  lbl = MCreateLabel(_tablefrm004, "ccdSy:", plfont);
4358  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4359  MObjectSetResize(lbl, True, True);
4362 
4363  BIL.VFO.lblccdsy = MCreateLabel(_tablefrm004, "xxxx", alfont);
4370 
4371  lbl = MCreateLabel(_tablefrm004, "ccdEx:", plfont);
4373  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4374  MObjectSetResize(lbl, True, True);
4377 
4378  BIL.VFO.lblccdex = MCreateLabel(_tablefrm004, "xxxx", alfont);
4385 
4386  lbl = MCreateLabel(_tablefrm004, "ccdEy:", plfont);
4387  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4388  MObjectSetResize(lbl, True, True);
4391 
4392  BIL.VFO.lblccdey = MCreateLabel(_tablefrm004, "xxxx", alfont);
4399 
4400  lbl = MCreateLabel(_tablefrm004, "ccdVB:", plfont);
4401  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4402  MObjectSetResize(lbl, True, True);
4405 
4406  BIL.VFO.lblvb = MCreateLabel(_tablefrm004, "xxx",alfont);
4413 
4414  lbl = MCreateLabel(_tablefrm004, "Rows#", plfont);
4415  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4416  MObjectSetResize(lbl, True, True);
4419 
4420  BIL.VFO.lblnr = MCreateLabel(_tablefrm004, "xxx", alfont);
4427 
4428  _rowform005 = MCreateRowForm(_rowform004);
4429  MFormSetSpacing(_rowform005, 0);
4430  MObjectSetBackgroundRGB(_rowform005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4431 // MObjectSetBackgroundRGB(_rowform005, 184, 132, 0);
4432  MObjectSetResize(_rowform005, True, False);
4433 
4434  lbl = MCreateLabel(_rowform005, "Command", HELV_SMALL);
4435  MObjectSetBackgroundRGB(lbl, 144, 172, 184);
4436  MObjectSetTransparency(lbl, 0);
4437  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4438  MObjectSetResize(lbl, True, False);
4439 
4440  _tablefrm005 = MCreateTableForm(_rowform005, 2);
4441  MFormSetSpacing(_tablefrm005, 0);
4442  MObjectSetBackgroundRGB(_tablefrm005, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4443 // MObjectSetBackgroundRGB(_tablefrm005, 184, 132, 0);
4444  MObjectSetResize(_tablefrm005, True, False);
4445 
4446  _rowform006 = MCreateRowForm(_tablefrm005);
4447  MFormSetSpacing(_rowform006, 0);
4448  MObjectSetBackgroundRGB(_rowform006, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4449 // MObjectSetBackgroundRGB(_rowform006, 184, 132, 0);
4450  MObjectSetResize(_rowform006, False, False);
4451 
4453  for (i=0;i<7;i++)
4454  //item_pd = MMenuAddItem(popup_pd, "Empty", (MENU_ITEM_CB) PopUp_CB, (void *) i);
4456 
4457  BIL.VFO.cmdpb[0] = MCreatePButton(_rowform006, "Open", alfont);
4460  MPButtonSetCallback(BIL.VFO.cmdpb[0], D_PButt_CB, (void *) 0);
4463  if (mod)
4465 
4466 
4467  BIL.VFO.cmdpb[1] = MCreatePButton(_rowform006, "Next", alfont);
4469  MPButtonSetCallback(BIL.VFO.cmdpb[1], D_PButt_CB, (void *) 1);
4472 
4473  BIL.VFO.cmdpb[8] = MCreatePButton(_rowform006, "Previous", alfont);
4475  MPButtonSetCallback(BIL.VFO.cmdpb[8], D_PButt_CB, (void *) 8);
4478 
4479 
4480  BIL.VFO.cmdpb[2] = MCreatePButton(_rowform006, "Set as Io", alfont);
4482  MPButtonSetCallback(BIL.VFO.cmdpb[2], D_PButt_CB, (void *) 2);
4485 
4486  BIL.VFO.cmdpb[3] = MCreatePButton(_rowform006, "Close File", alfont);
4488  MPButtonSetCallback(BIL.VFO.cmdpb[3], D_PButt_CB, (void *) 3);
4490  MObjectSetUnsensitive(BIL.VFO.cmdpb[3]); // Set "CloseFile" button as Unsensitive
4491 
4492  BIL.VFO.cmdpb[4] = MCreatePButton(_rowform006, "Print", alfont);
4495  MPButtonSetCallback(BIL.VFO.cmdpb[4], D_PButt_CB, (void *) 4);
4496  MObjectSetUnsensitive(BIL.VFO.cmdpb[4]); // Set "Print" button as Unsensitive
4497 
4498  BIL.VFO.cmdpb[6] = MCreatePButton(_rowform006, "Zoom", alfont);
4500  MPButtonSetCallback(BIL.VFO.cmdpb[6], D_PButt_CB, (void *) 6);
4503 
4504  BIL.VFO.cmdpb[7] = MCreatePButton(_rowform006, "Tools", alfont);
4506  MPButtonSetCallback(BIL.VFO.cmdpb[7], D_PButt_CB, (void *) 7);
4509 
4510  if(DAS.Flag.exemode == OFFLINEPLOT)
4511  BIL.VFO.cmdpb[5] = MCreatePButton(_rowform006, "Quit", alfont);
4512  else
4513  BIL.VFO.cmdpb[5] = MCreatePButton(_rowform006, "Close Win", alfont);
4514 
4516  MPButtonSetCallback(BIL.VFO.cmdpb[5], D_PButt_CB, (void *) 5);
4518 
4519 
4520 /**********************************************/
4521 
4522 if( (!DAS.Flag.exemode == OFFLINEPLOT) | (!DAS.Flag.exemode == DOASMODE))
4523 {
4524 
4525 
4526  _colform002 = MCreateColForm(_rowform000);
4527  MFormSetSpacing(_colform002, 1);
4528 // MObjectSetBackgroundRGB(_colform002, 64, 28, 128);
4529  MObjectSetBackgroundRGB(_colform002, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4530 
4531  // MObjectSetResize(_colform002, True, True);
4532 
4533  _tablefrm006 = MCreateTableForm(_colform002, 7);
4534  MFormSetSpacing(_tablefrm006, 1);
4535 // MObjectSetBackgroundRGB(_tablefrm006, 64, 28, 128);
4536  MObjectSetBackgroundRGB(_tablefrm006, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4537  MObjectSetResize(_tablefrm006, False, False);
4538  MObjectAlign(_tablefrm006, CENTER_ALIGN, TOP_ALIGN);
4539 
4540  lbl = MCreateLabel(_tablefrm006, "X:", plfont);
4542  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4545  MObjectSetCompositeWidth(lbl, 30);
4546  //MObjectSetResize(lbl, True, True);
4547 
4548  BIL.VFO.xloc = MCreateLabel(_tablefrm006, "xxxxx", alfont);
4555  //MObjectSetResize(BIL.VFO.xloc, True, True);
4556 
4557  BIL.VFO.xincr = MCreateLabel(_tablefrm006, "Dx = xx", alfont);
4563  //MObjectSetResize(BIL.VFO.xincr, True, True);
4564 
4565 
4566  lbl = MCreateLabel(_tablefrm006, "Y:", plfont);
4568  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4571  MObjectSetCompositeWidth(lbl, 30);
4572 // MObjectSetResize(lbl, True, True);
4573 
4574 
4575  BIL.VFO.yloc = MCreateLabel(_tablefrm006, "xxxxx", alfont);
4582  // MObjectSetResize(BIL.VFO.yloc, True, True);
4583 
4584 
4585  BIL.VFO.yincr = MCreateLabel(_tablefrm006, "Dy = xx", alfont);
4590 // MObjectSetTransparency(BIL.VFO.yincr,0);
4592  // MObjectSetResize(BIL.VFO.xloc, True, True);
4593 
4594 
4595 
4596  BIL.VFO.selallpb = MCreatePButton(_tablefrm006, "Select All", alfont);
4600  if(mod) //Onlineplot
4602  else
4604 
4605 
4606 /*****************/
4607 
4608  _tablefrm006 = MCreateTableForm(_colform002, 6);
4609  MFormSetSpacing(_tablefrm006, 1);
4610  MObjectSetBackgroundRGB(_tablefrm006, 64, 28, 128);
4611  MObjectSetBackgroundRGB(_tablefrm006, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4612  MObjectSetResize(_tablefrm006, False, False);
4613  MObjectAlign(_tablefrm006, CENTER_ALIGN, TOP_ALIGN);
4614 
4615  lbl = MCreateLabel(_tablefrm006, "Y Scale:", plfont);
4617  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4620 // MObjectSetCompositeWidth(lbl, 30);
4621 
4622  if (FLAG.plotYRange == 0)
4623  sprintf(buff,"Full Range");
4624  else
4625  sprintf(buff,"Min/Max");
4626 
4627  BIL.VFO.YScalePB = MCreatePButton(_tablefrm006, buff, alfont);
4631  MPButtonSetCallback(BIL.VFO.YScalePB, PBYScale_CB, (void *) 0);
4632  if(mod) //Onlineplot
4634  else
4636 
4637 
4638  lbl = MCreateLabel(_tablefrm006, "X Units:", plfont);
4640  MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0);
4643 
4644 
4645  BIL.VFO.XAxisU[0] = MCreateRButton(_tablefrm006, "Pixel", alfont);
4646  MPButtonSetCallback(BIL.VFO.XAxisU[0], DB_XUnitsCB, (void *) 0);
4651 
4652  BIL.VFO.XAxisU[1] = MCreateRButton(_tablefrm006, "Wl [A]", alfont);
4653  MPButtonSetCallback(BIL.VFO.XAxisU[1], DB_XUnitsCB, (void *) 1);
4658 
4659  BIL.VFO.XAxisU[2] = MCreateRButton(_tablefrm006, "Wl [nm]", alfont);
4660  MPButtonSetCallback(BIL.VFO.XAxisU[2], DB_XUnitsCB, (void *) 2);
4665 
4666  if(FLAG.Wl == 0)
4668  else if(FLAG.Wl == 1)
4670  else if(FLAG.Wl == 2)
4672 }
4673 
4674 
4675 
4676 /*****************************/
4677 
4678  _colform000 = MCreateColForm(_rowform000);
4679  MFormSetSpacing(_colform000, 1);
4680  MObjectSetBackgroundRGB(_colform000, 64, 28, 128);
4681 
4682 
4683  _tablefrm002 = MCreateTableForm(_colform000, 2);
4684  MFormSetSpacing(_tablefrm002, 1);
4685  MTableFormSetColAlign(_tablefrm002, 0, LEFT_ALIGN);
4686  MTableFormSetColAlign(_tablefrm002, 1, LEFT_ALIGN);
4687  MTableFormSetRowAlign(_tablefrm002, 0, TOP_ALIGN);
4688  MObjectSetBackgroundRGB(_tablefrm002, 64, 28, 128);
4689  MObjectSetBackgroundRGB(_tablefrm002, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
4690  MObjectSetResize(_tablefrm002, True, True);
4691 
4692  _rowform001 = MCreateRowForm(_tablefrm002);
4693  MFormSetSpacing(_rowform001, 1);
4694  MObjectSetBackgroundRGB(_rowform001, 184, 192, 240);
4695  MObjectSetResize(_rowform001, False, True);
4696 
4697 
4698  for (i=0; i<(sizeof(BIL.VFO.lblY)/sizeof(BIL.VFO.lblY[0])); i++)
4699  {
4700  BIL.VFO.lblY[i] = MCreateLabel(_rowform001, "-------", alfont);
4701  MObjectSetShadow(BIL.VFO.lblY[i], WS_NONE, 0, 0);
4702  if(i==0)
4704  if(i==sizeof(BIL.VFO.lblY)/sizeof(BIL.VFO.lblY[0])-1)
4707  }
4708 
4709 /********************************************************************/
4710 /* DRAW AREA */
4711 /********************************************************************/
4712 
4713  rformw = MObjectGetWidth(_rowform003);
4714  scrw = MGetScreenWidth();
4715  maxplotw = scrw - 200;
4716  if (mod) //On line Plot
4717  {
4718  BIL.DPLOT.drawapl = MCreateDrawArea(_tablefrm002, maxplotw, 480); //1044 580
4720  MObjectSetBackgroundRGB(BIL.DPLOT.drawapl, 220, 220, 220);
4724  }
4725 
4726  else
4727  {
4728  BIL.DPLOT.drawapl = MCreateDrawArea(_tablefrm002, maxplotw, 480);
4730  MObjectSetBackgroundRGB(BIL.DPLOT.drawapl, 220, 220, 220);
4733  }
4734 
4735 
4736 /********************************************************************/
4737 
4741 
4742  InitImage(BIL.BLENS.Imim, maxplotw, maxploth, 192, 192, 192);
4743 
4744 
4745 
4746 
4747 
4748  _rowform002 = MCreateRowForm(_tablefrm002);
4749  MFormSetSpacing(_rowform002, 1);
4750  MObjectAlign(_rowform002, LEFT_ALIGN, BOTTOM_ALIGN);
4751  MObjectSetShadow(_rowform002, WS_SHADOW_IN, 1, 0);
4752  MObjectSetResize(_rowform002, False, False);
4753 
4754  _colform001 = MCreateColForm(_tablefrm002);
4755  MFormSetSpacing(_colform001, 1);
4756  MObjectAlign(_colform001, LEFT_ALIGN, BOTTOM_ALIGN);
4757  MObjectSetBackgroundRGB(_colform001, 184, 192, 240);
4758  MObjectSetResize(_colform001, True, True);
4759 
4760  for (i=0; i<17; i++)
4761  {
4762  BIL.VFO.lblX[i] = MCreateLabel(_colform001, "-----", alfont);
4763 // MObjectSetShadow(BIL.VFO.lblX[i], WS_SHADOW_IN, 1, 0);
4764  MObjectSetShadow(BIL.VFO.lblX[i], WS_NONE, 0, 0);
4765 
4767  if(i==0)
4769  if(i==sizeof(BIL.VFO.lblX)/sizeof(BIL.VFO.lblX[0]) - 1)
4770  {
4772  //MLabelSetAlignment(BIL.VFO.lblX[i], RIGHT_ALIGN);
4773 
4774  }
4775  }
4776 
4777 
4778 
4779  tb = MCreateColForm(BIL.VFO.View_Sh);
4780  MFormSetSpacing(tb, 0);
4781  //MTableFormSetColAlign(tb, 0, LEFT_ALIGN);
4782  MObjectSetBackgroundRGB(tb, 184, 132, 0);
4784  MObjectSetResize(tb, True, False);
4785 
4786  lbl = MCreateLabel(tb, "Equipment:", plfont);
4787  MObjectSetResize(lbl, False, True);
4791 
4792  rb = MCreateRButton(tb, "SPATRAMPLUS", FIXED_SMALL);
4793  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 3);
4795  MObjectSetForegroundRGB(rb, 255, 255, 255);
4796  MObjectSetCompositeWidth(rb, 105);
4797  if(DAS.Paramini.EqType == 3)
4798  MRButtonActivate(rb);
4799 
4800  rb = MCreateRButton(tb, "SPATRAM2", FIXED_SMALL);
4801  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 9);
4803  MObjectSetForegroundRGB(rb, 255, 255, 255);
4804  MObjectSetCompositeWidth(rb, 105);
4805  if(DAS.Paramini.EqType == 9)
4806  MRButtonActivate(rb);
4807 
4808  rb = MCreateRButton(tb, "SPATRAM3", FIXED_SMALL);
4809  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 10);
4811  MObjectSetForegroundRGB(rb, 255, 255, 255);
4812  MObjectSetCompositeWidth(rb, 105);
4813  if(DAS.Paramini.EqType == 10)
4814  MRButtonActivate(rb);
4815 
4816  /* rb = MCreateRButton(tb, "SPATRAM", FIXED_SMALL);
4817  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 0);
4818  MObjectAlign(rb, LEFT_ALIGN, TOP_ALIGN);
4819  MObjectSetForegroundRGB(rb, 255, 255, 255);
4820  MObjectSetCompositeWidth(rb, 85);
4821  if( DAS.Paramini.EqType == 0)
4822  MRButtonActivate(rb);
4823  */
4824  rb = MCreateRButton(tb, "TROPOGAS", FIXED_SMALL);
4825  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 1);
4827  MObjectSetForegroundRGB(rb, 255, 255, 255);
4828  MObjectSetCompositeWidth(rb, 85);
4829  if(DAS.Paramini.EqType == 1)
4830  MRButtonActivate(rb);
4831 
4832  rb = MCreateRButton(tb, "LIS", FIXED_SMALL);
4833  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 2);
4835  MObjectSetForegroundRGB(rb, 255, 255, 255);
4836  MObjectSetCompositeWidth(rb, 85);
4837  if(DAS.Paramini.EqType == 2)
4838  MRButtonActivate(rb);
4839 
4840  rb = MCreateRButton(tb, "GASCODNG1", FIXED_SMALL);
4841  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 4);
4843  MObjectSetForegroundRGB(rb, 255, 255, 255);
4844  MObjectSetCompositeWidth(rb, 85);
4845  if(DAS.Paramini.EqType == 4)
4846  MRButtonActivate(rb);
4847 
4848  /* rb = MCreateRButton(tb, "GASCODOffAxis", FIXED_SMALL);
4849  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 5);
4850  MObjectAlign(rb, LEFT_ALIGN, UNDEF_ALIGN);
4851  MObjectSetForegroundRGB(rb, 255, 255, 255);
4852  MObjectSetCompositeWidth(rb, 105);
4853  if(DAS.Paramini.EqType == 5)
4854  MRButtonActivate(rb);
4855  */
4856 
4857 
4858  rb = MCreateRButton(tb, "GASCODNG2", FIXED_SMALL);
4859  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 6);
4861  MObjectSetForegroundRGB(rb, 255, 255, 255);
4862  MObjectSetCompositeWidth(rb, 105);
4863  if(DAS.Paramini.EqType == 6)
4864  MRButtonActivate(rb);
4865 
4866  rb = MCreateRButton(tb, "GASCODNG3", FIXED_SMALL);
4867  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 7);
4869  MObjectSetForegroundRGB(rb, 255, 255, 255);
4870  MObjectSetCompositeWidth(rb, 105);
4871  if(DAS.Paramini.EqType == 7)
4872  MRButtonActivate(rb);
4873 
4874  rb = MCreateRButton(tb, "GASCODNG4", FIXED_SMALL);
4875  MPButtonSetCallback(rb, DB_EqTypePlotCB, (void *) 8);
4877  MObjectSetForegroundRGB(rb, 255, 255, 255);
4878  MObjectSetCompositeWidth(rb, 105);
4879  if(DAS.Paramini.EqType == 8)
4880  MRButtonActivate(rb);
4881 
4882 
4883 
4884 
4885  MShellRealizeXY( BIL.VFO.View_Sh, 0, 0);
4886 
4887 // MUnloadFont(alfont);
4888 // MUnloadFont(plfont);
4889 
4890 
4891 // rformw = MObjectGetWidth(_rowform003);
4892 
4893 
4894  if( ((PrgFile[0] != 0) | (Master == 1)) & (FLAG.exec == 1) )
4895  {
4896  delay(4000);
4897  ClosePlotCB(BIL.VFO.View_Sh, 0, 0);
4898  }
4899 
4900 
4901 
4902  return 0;
4903 
4904 }
void MObjectSetColor(MOBJECT obj, MTColor bgc, MTColor fgc)
char PrgFile[16]
Name of the PRG file.
Definition: DAS_Spat.c:91
flag FLAG
Definition: CreateForms.c:84
#define RIGHT_ALIGN
Definition: Mguidefs.h:916
mtcl MTCL
Definition: 2DPlot.c:30
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
#define WS_NONE
Definition: Mguidefs.h:956
MIMAGE Imim
Definition: bildef.h:14
MOBJECT lblmin
Definition: bildef.h:54
MOBJECT selallpb
Definition: bildef.h:68
MOBJECT YScalePB
Definition: bildef.h:70
MOBJECT lbl
Definition: DFileMan.c:42
MOBJECT cmdpb[10]
Definition: bildef.h:69
MOBJECT yincr
Definition: bildef.h:67
#define WS_SHADOW_IN
Definition: Mguidefs.h:958
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
optionini DOption
Options for DAS execution.
void MMenuBarSetAcc(MOBJECT menu, int acc)
void MObjectSetShadow(MOBJECT obj, int type, int in, int out)
MOBJECT lblccdwx
Definition: bildef.h:55
MOBJECT lblccdtexp
Definition: bildef.h:44
int Master
Definition: DAS_Spat.c:100
palette DPAL
Definition: Spat_Plot.c:29
void MenuFileOLP_CB(MOBJECT o, void *id, void *a_data)
Definition: Spat_Plot.c:3209
MTFont plfont
Definition: Spat_Plot.c:41
void MObjectSetUnsensitive(MOBJECT obj)
void PBYScale_CB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:2441
das DAS
DAS structure.
Definition: Spat_Plot.c:39
int Wl
Flag for the units on the X scale plot.
MOBJECT lblndfilter
Definition: bildef.h:42
MOBJECT lblmax
Definition: bildef.h:53
void(* MENU_ITEM_CB)(MENU_ITEM item, MVALUE status, void *ad)
Definition: Mguidefs.h:1468
int MObjectGetHeight(MOBJECT obj)
MOBJECT popup_pd
Definition: Spat_Plot.c:3570
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
MENU_ITEM MMenuAddItem(MOBJECT pd, const char *item, MENU_ITEM_CB cb, void *ad)
MOBJECT lblfilter
Definition: bildef.h:41
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
MTColor white
#define DOASMODE
execution for DOAS Processing
flag Flag
Structure for different flags.
#define F10
Definition: KEYCODES.H:346
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
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)
void InitImage(MIMAGE img, int xd, int yd, int rb, int gb, int bb)
Definition: Spat_Plot.c:354
void * MENU_ITEM
Definition: Mguidefs.h:1418
MOBJECT MCreateSubMenu(MENU_ITEM item)
void MTableFormSetColAlign(MOBJECT form, int col, int al)
MOBJECT lblY[11]
Definition: bildef.h:46
MOBJECT lblccdsx
Definition: bildef.h:57
MOBJECT pbr[256]
Definition: bildef.h:170
MENU_ITEM MMenuAddRadioItem(MOBJECT pd, const char *item, MENU_ITEM_CB cb, void *ad)
MOBJECT lblccdey
Definition: bildef.h:60
int DrawAreaPlotCB(MOBJECT obj, MEvent *pexp, void *a_data)
Definition: Spat_Plot.c:876
void DB_AreaInput(MOBJECT obj, MEvent *pe, void *a_data)
Definition: Spat_Plot.c:203
#define UNDEF_ALIGN
Definition: Mguidefs.h:920
int OLDnR
Definition: bildef.h:185
void MenuToolsOLP_CB(MOBJECT o, void *id, void *a_data)
Definition: Spat_Plot.c:3179
MOBJECT lblnr
Definition: bildef.h:62
MENU_ITEM MMenuAddItemObsolete(MOBJECT pd, const char *item, MGUI_CB cb, void *ad)
int MObjectGetWidth(MOBJECT obj)
MOBJECT lblX[17]
Definition: bildef.h:47
char * ffilenames[]
Definition: Spat_Plot.c:3572
void ClosePlotCB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:2514
MOBJECT menu
Definition: DOAS_FullProj.c:60
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
MOBJECT lblloc
Definition: bildef.h:48
MOBJECT lbllat
Definition: bildef.h:49
void D_pbr_CB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:717
int exec
= 0 -> PRG Execution Paused; = 1 -> PRG Execution Resumed
int hlinebefore
Number of HiddenLines before the central line in Plot.
MOBJECT lblccdtemp
Definition: bildef.h:43
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
void D_PButt_CB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:3320
MOBJECT lblZenith
Definition: bildef.h:72
#define OFFLINEPLOT
execution for archived data visualisation
MOBJECT lblalt
Definition: bildef.h:51
#define CENTER_ALIGN
Definition: Mguidefs.h:917
#define EM_BUTTON_PRESS
Definition: Mguidefs.h:317
MTFont alfont
Definition: Spat_Plot.c:41
MENU_ITEM item_pd
Definition: Spat_Plot.c:3571
d_view DPLOT
Definition: bildef.h:254
#define HELV_SMALL
Definition: Mguidefs.h:881
MOBJECT xloc
Definition: bildef.h:64
void DB_EqTypePlotCB(MOBJECT o, void *a, void *v)
Definition: Spat_Plot.c:3704
MOBJECT dmenu
void PopUp_CB(MOBJECT obj, void *item, void *data)
Definition: Spat_Plot.c:3584
#define FIXED_SMALL
Definition: Mguidefs.h:878
void PButtSelAll_CB(MOBJECT p, void *od, void *ad)
Definition: Spat_Plot.c:2476
MOBJECT formbutt
Definition: bildef.h:65
int ON_OFFLINEPLOT
Definition: DAS_Spat.c:117
MOBJECT yloc
Definition: bildef.h:63
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
void MLabelSetMargin(MOBJECT p, int wm, int hm)
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
void MRButtonActivate(MOBJECT o)
MENU_ITEM Titem[4]
Definition: Spat_Plot.c:46
MOBJECT lblsza
Definition: bildef.h:52
int plotYRange
0 –> full range; 1 –> min/max
MOBJECT MCreateDrawArea(MOBJECT parent, int width, int height)
MOBJECT MCreateColForm(MOBJECT parent)
void MObjectAddEventNotifyCallback(MOBJECT obj, OBJ_EVENT_CB cb, CARD32 event_mask, void *a_data)
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
MOBJECT Tmenu
Definition: Spat_Plot.c:47
int IDY
Number of sensible vertical pixels.
Definition: DAS_Spat.c:119
void MDrawAreaSetExposeCallback(MOBJECT obj, OBJ_EVENT_CB cb, void *ad)
void MShellRealizeXY(MOBJECT obj, int x, int y)
MENU_ITEM Fitem[6]
Definition: Spat_Plot.c:46
void MDrawAreaSetInputCallback(MOBJECT obj, OBJ_EVENT_CB cb, void *ad)
MOBJECT View_Sh
Definition: bildef.h:35
#define _MAX_PATH
Definition: Dildef.h:202
MOBJECT MCreateShell(const char *title, int flags)
int hlineafter
Number of HiddenLines after the central line in Plot.
MOBJECT lblccdwy
Definition: bildef.h:56
MOBJECT lbltime
Definition: bildef.h:38
short DB_BG[3]
Default Background Color.
MOBJECT lblAzimuth
Definition: bildef.h:73
MOBJECT MCreateRButton(MOBJECT parent, const char *text, MTFont font)
void MObjectUnmap(MOBJECT obj)
MOBJECT lblvb
Definition: bildef.h:61
MOBJECT submenu
Definition: DOAS_FullProj.c:61
MOBJECT Optmenu
Definition: Spat_Plot.c:47
void MTableFormSetRowAlign(MOBJECT form, int row, int al)
void DB_XUnitsCB(MOBJECT o, void *id, void *a_data)
Definition: Spat_Plot.c:3547
void MLabelSetAlignment(MOBJECT p, int align)
int MGetScreenWidth(void)
MOBJECT lblccdsy
Definition: bildef.h:58
MTColor PLColor[264]
MOBJECT lbldate
Definition: bildef.h:37
int maxploth
Definition: Spat_Plot.c:51
int maxplotw
Definition: Spat_Plot.c:51
void MFormSetSpacing(MOBJECT p, int offset)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
bil BIL
Definition: Spat_Plot.c:35
int MMenuItemSetCheckStatus(MENU_ITEM item, int TrueFalse)
void PopupMenuCB(MOBJECT obj, MEvent *pe, void *pdown)
Definition: Spat_Plot.c:3688
void MObjectSetCompositeWidth(MOBJECT obj, int w)
MOBJECT lbllong
Definition: bildef.h:50
short DB_UnSel[3]
Unselected Buttons Colors.
void MakeItemUnsensitiveCB(MOBJECT obj, void *item, void *udata)
Definition: Spat_Plot.c:2044
void * MOBJECT
Definition: Mguidefs.h:192
blens BLENS
Definition: bildef.h:252
#define BOTTOM_ALIGN
Definition: Mguidefs.h:919
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
viewformobj VFO
Definition: bildef.h:255
void MObjectSetFont(MOBJECT obj, MTFont font, int resize)
void MButtonSetOnMouseOverForegroundRGB(MOBJECT button, int r, int g, int b)
MOBJECT MCreateMenuBar(MOBJECT parent, MTFont font)
MOBJECT xincr
Definition: bildef.h:66
int EqType
Spectrometer Type.
MIMAGE MAllocImage(int img_w, int img_h, int nplanes)
void MObjectSetTransparency(MOBJECT obj, CARD8 level)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT drawapl
Definition: bildef.h:172
void MObjectSetSensitive(MOBJECT obj)
MOBJECT Fmenu
Definition: Spat_Plot.c:47
MOBJECT lblnummeas
Definition: bildef.h:45
MOBJECT MCreateRowForm(MOBJECT parent)
#define WS_ETCHED_IN
Definition: Mguidefs.h:959
MOBJECT XAxisU[3]
Definition: bildef.h:71
MOBJECT MCreatePopupMenu(MTFont font)
#define TOP_ALIGN
Definition: Mguidefs.h:918
int exemode
Set the Execution MODE (Execution modes)
MOBJECT MCreateMenu(MOBJECT menu, const char *text)
MOBJECT lblwaveleng
Definition: bildef.h:40
MOBJECT lblccdex
Definition: bildef.h:59
paramini Paramini
structure for the parameters defined in param.ini configuration file
MOBJECT lblmirpos
Definition: bildef.h:39
+ Here is the caller graph for this function:

§ ViewPre()

int ViewPre ( FILE *  nf,
long  position 
)

Definition at line 2241 of file Spat_Plot.c.

References ContFP, MMessageDialog(), and ViewNext().

Referenced by D_PButt_CB(), and MenuFileOLP_CB().

2242 {
2243  int er = 0;
2244 
2245  er = fseek(nf, position, SEEK_SET);
2246  if (ContFP == 0)
2247  {
2248  er = MMessageDialog("DAS information", "Already at the beginning Of File.\n Please use the 'Next' Button ?" , "OK", NULL);
2249  return 1;
2250  }
2251  else
2252  {
2253  ContFP--;
2254  ContFP--;
2255  ViewNext(nf);
2256  return 0;
2257  }
2258  return 0;
2259 
2260 }
int ContFP
Counter for File position.
Definition: DAS_Spat.c:123
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int ViewNext(FILE *nf)
Definition: Spat_Plot.c:2365
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ ViewPre_BIN()

int ViewPre_BIN ( int  nf,
long  position 
)

Definition at line 2263 of file Spat_Plot.c.

References ContFP, MMessageDialog(), and ViewNext_BIN().

Referenced by D_PButt_CB(), and MenuFileOLP_CB().

2264 {
2265  int er = 0;
2266 
2267  er = lseek(nf, position, SEEK_SET);
2268  if (ContFP == 0)
2269  {
2270  er = MMessageDialog("DAS information", "Already at the beginning Of File.\n Please use the 'Next' Button ?" , "OK", NULL);
2271  return 1;
2272  }
2273  else
2274  {
2275  ContFP--;
2276  ContFP--;
2277  ViewNext_BIN(nf);
2278  return 0;
2279  }
2280  return 0;
2281 
2282 }
int ContFP
Counter for File position.
Definition: DAS_Spat.c:123
int ViewNext_BIN(int nf)
Definition: Spat_Plot.c:2284
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:

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

§ WriteIMG()

void WriteIMG ( FILE *  file,
unsigned short *  mat,
int  hp,
int  vp 
)

Definition at line 1178 of file Spat_Plot.c.

Referenced by SaveDataOffLine().

1179 {
1180 
1181 
1182  int x, y;
1183 
1184  for(y = 0; y < vp; y++)
1185  {
1186  for(x = 0; x < hp; x++)
1187  {
1188  if((x % 10) == 0)
1189  {
1190  if(y == 0 && x == 0)
1191  {
1192  }
1193  else
1194  fprintf(file, "\n", NULL);
1195  }
1196  fprintf(file, "%5u ", mat[y * hp + x]);
1197 
1198  }
1199 
1200  }
1201  fprintf(file, "\n", NULL);
1202 
1203 
1204 }
+ Here is the caller graph for this function:

§ WriteIMG_BIN()

void WriteIMG_BIN ( int  fd,
unsigned short *  mat,
int  hp,
int  vp 
)

Definition at line 1153 of file Spat_Plot.c.

Referenced by SaveDataOffLine().

1154 {
1155  int x, y;
1156 
1157  for(x = 0; x < hp; x++)
1158  {
1159  for(y = 0; y < vp; y++)
1160  write(fd, &mat[y * hp + x], 2);
1161 
1162  }
1163 }
+ Here is the caller graph for this function:

§ X2Counts()

int X2Counts ( int  x)

Definition at line 178 of file Spat_Plot.c.

References d_view::COSTX, bil::DPLOT, and d_view::oX.

Referenced by DB_AreaInput().

179 {
180 
181  return (int)((x - BIL.DPLOT.oX) / BIL.DPLOT.COSTX);
182 
183 }
double COSTX
Definition: bildef.h:181
int oX
Definition: bildef.h:183
d_view DPLOT
Definition: bildef.h:254
bil BIL
Definition: Spat_Plot.c:35
+ Here is the caller graph for this function:

§ Y2Counts()

unsigned int Y2Counts ( int  y)

Definition at line 190 of file Spat_Plot.c.

References d_view::COSTY, bil::DPLOT, d_view::Imin, and d_view::oY.

Referenced by DB_AreaInput().

191 {
192 
193  return - (int)BIL.DPLOT.COSTY * (y - BIL.DPLOT.oY) + BIL.DPLOT.Imin;
194 
195 }
double COSTY
Definition: bildef.h:181
int oY
Definition: bildef.h:183
unsigned int Imin
Definition: bildef.h:178
d_view DPLOT
Definition: bildef.h:254
bil BIL
Definition: Spat_Plot.c:35
+ Here is the caller graph for this function:

Variable Documentation

§ alfont

MTFont alfont

Definition at line 41 of file Spat_Plot.c.

Referenced by ViewPlot().

§ BIL

bil BIL

Definition at line 35 of file Spat_Plot.c.

§ Cfg

config Cfg

Definition at line 27 of file Spat_Plot.c.

§ DAS

das DAS

DAS structure.

Definition at line 39 of file Spat_Plot.c.

§ DC_CCD

ccd DC_CCD

Definition at line 25 of file Spat_Plot.c.

§ DC_HP

ptf DC_HP

Definition at line 26 of file Spat_Plot.c.

§ DIL

dil DIL

Definition at line 28 of file Spat_Plot.c.

§ DOAS

doas DOAS

Definition at line 37 of file Spat_Plot.c.

§ DPAL

palette DPAL

Definition at line 29 of file Spat_Plot.c.

§ ffilenames

char* ffilenames[]
Initial value:
={{"Empty"},
{"Empty"},
{"Empty"},
{"Empty"},
{"Empty"},
{"Empty"},
{"Clear List "}}

Definition at line 3572 of file Spat_Plot.c.

Referenced by ViewPlot().

§ Fitem

MENU_ITEM Fitem[6]

Definition at line 46 of file Spat_Plot.c.

Referenced by CloseFile(), CloseFile_BIN(), ViewNext(), ViewNext_BIN(), ViewPlot(), and Visualizza().

§ flagclear

int flagclear = 0

Definition at line 3581 of file Spat_Plot.c.

Referenced by PopUp_CB().

§ Fmenu

MOBJECT Fmenu

Definition at line 47 of file Spat_Plot.c.

Referenced by ViewPlot(), and Visualizza().

§ item_pd

MENU_ITEM item_pd

Definition at line 3571 of file Spat_Plot.c.

Referenced by ViewPlot().

§ mattempbuff

unsigned int* mattempbuff

Definition at line 2064 of file Spat_Plot.c.

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

§ newfont

MTFont newfont

Definition at line 41 of file Spat_Plot.c.

§ NFileNameF

char NFileNameF[32]

Definition at line 71 of file CreateForms.c.

Referenced by D_PButt_CB(), DB_HorComm_CB(), DB_KeyB_CB(), and PopUp_CB().

§ Optmenu

MOBJECT Optmenu

Definition at line 47 of file Spat_Plot.c.

Referenced by ViewPlot().

§ plfont

MTFont plfont

Definition at line 41 of file Spat_Plot.c.

Referenced by ViewPlot().

§ popup_pd

MOBJECT popup_pd

Definition at line 3570 of file Spat_Plot.c.

Referenced by ViewPlot().

§ Titem

MENU_ITEM Titem[4]

Definition at line 46 of file Spat_Plot.c.

Referenced by ViewPlot().

§ Tmenu

MOBJECT Tmenu

Definition at line 47 of file Spat_Plot.c.

Referenced by ViewPlot().

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