// ******************************************************************************** 
// ** GlobalDefs.h
// **
// ** Copyright (C) 2012-2017 3D at Depth Inc. All Rights Reserved
// ** www.3DatDepth.com  This software can not be copied and/or distributed without 
// ** the express permission of 3D at Depth Inc.
// ******************************************************************************** 
#pragma once

#include "Utils.h"
#include "WSstruct.h"
#include <ctime>
#include <string>

using namespace std;


#define SW_VERSION				1
#define SW_SUB_VERSION			0
#define SW_RELEASE_CANDIDATE  1

enum 
{  
   MIN_COLOR = 0, MAX_COLOR = 255,
   BLACK = MIN_COLOR, WHITE = MAX_COLOR,                                         // black pixel
   STATUS = 0, LIDAR1 = 1, LIDAR2 = 2, ARCHIVE, L1PPS, L1ZDA, L2PPS, L2ZDA,      // connection LEDs
   OP_MODE_LIVE = 0, OP_MODE_REPLAY_STOP, OP_MODE_REPLAY_START, OP_MODE_REPLAY_RESUME, OP_MODE_REPLAY_POSITION,      // operation mode - live or data replay
   INVALID_DISPLAY = -1, RANGE_DISPLAY, INTENSITY_DISPLAY, WEDGE_DISPLAY,        // display graph types
   INVALID_CANVAS = -1, HORIZONTAL_CANVAS, VERTICAL_CANVAS,                      // display graph window orientation
   INVALID_SCALE = -1, GRAY_SCALE, COLOR_SCALE,
   //MIN_INTENSITY = 0, MAX_INTENSITY = 65535,                                     // intensity data range
   MIN_INTENSITY = 0, MAX_INTENSITY = 1024,                                     // intensity data range
   MAX_MSG_LENGTH = 500,                                                         // max list box message length
   MAX_CONFIG_STRING_LENGTH = 256,                                               // control dialog max string length
   INVALID_RANGE_DATA = -999,                                                    // indicator for invalid data value
   INVALID_INTENSITY_DATA = 0,
   MIN_WINDOW_SIZE = 400,
   MIN_DISK_SPACE_GB = 20                                                        // 2500 LOS/SL, 5 Pts/LOS --> 11 GB                             
};

const BOOL INITIALIZE = FALSE;                                                   // pass to CDialog::UpdateData to init control settings
const BOOL RETRIEVE = TRUE;                                                      // pass to CDialog::UpdateData to retrieve control settings
const string CONFIG_FILE = "C:\\3D\\CFG\\MultiSensorLidarGui.cfg";               // full config file name
const string LOG_FILE = "C:\\3D\\LOG\\MultiSensorLidarGui";                      // base log file name (timestamp will be appended)

// control dialog configuration settings
typedef struct
{
   //UINT32   nPositionLeft;                                                       // x-axis position of main dialog
   //UINT32   nPositionTop;                                                        // y-axis position of main dialog
   //UINT32   nPositionRight;                                                      // width of main dialog
   //UINT32   nPositionBottom;                                                     // height of main dialog
   float    fSensorScanWidth;
   float    fSensorMaxRange;
   UINT16   nSensorLaserPower;
   UINT16   nSensorLosPerScanLine;
   UINT8    nSensorPointsPerLos;
   int      nOperationMode;                                                      // live or replay operation mode
   int      nDisplayType;                                                        // range/intensity/wedge graphs for lidar displays
   int      nDisplayOrientation;                                                 // horizontal/vertical window orientation for lidar displays
   int      nColorScale;
   UINT8    nProfilePointSize;
   float    fMinRange;                                                           // min display range for lidar displays
   float    fMaxRange;                                                           // max display range for lidar displays
   int      nMinIntensity;                                                       // min intensity for lidar displays
   int      nMaxIntensity;                                                       // max intensity for lidar displays
   float    fScanWidthLeft1;
   float    fScanWidthRight1;
   float    fScanWidthLeft2;
   float    fScanWidthRight2;
   bool     bEnableIntensityFilter;
   UINT16   nIntensityFilter;
   UINT8    nPtsPerLos;
   char     pchEcIpAddress1[MAX_CONFIG_STRING_LENGTH];
   char     pchEcIpAddress2[MAX_CONFIG_STRING_LENGTH];
   char     pchArchiveDataFolder[MAX_CONFIG_STRING_LENGTH];                             // archive data folder
   char     pchArchiveJobFolder[MAX_CONFIG_STRING_LENGTH];
   char     pchArchiveFileTag[MAX_CONFIG_STRING_LENGTH];
   char     pchReplayFile[MAX_CONFIG_STRING_LENGTH];                             // replay file name
   UINT16   nArchiveFileTime;
   bool     bPixelFill;                                                          // display pixel fill enabled
   bool     bGraphXY;
   bool     bAutoConnect;
   bool     bAutoArchive;
   bool     bDebugMsg;
   bool     bTopToBottom;
   bool     bLeftToRight;
}  
GuiConfig;
