// SystemConfig.h: interface for the CSystemConfig class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SYSTEMCONFIG_H__BA529CDD_9DA8_4A9A_8E8A_7BAA50377136__INCLUDED_)
#define AFX_SYSTEMCONFIG_H__BA529CDD_9DA8_4A9A_8E8A_7BAA50377136__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#pragma pack( push, SYSTEMCONFIG_H_PACK, 1 )

typedef struct tagSYSTEMCONFIG
{
	/////////////////////////////
	//DRY END VARIABLES TO RELOAD
	/////////////////////////////
	
	//Main Dlg
	UINT		dSysMode;	//collect/playback
	
	BOOL		bShowHFSS;
	BOOL		bShowLFSS;
	BOOL		bShowSBP;
	BOOL		bShowAttitude;
	BOOL		bShowDepth;
	BOOL		bShowHeading;
	BOOL		bShowNav;
	BOOL		bShowASCII;
	BOOL		bShowBathy;
	BOOL		bShowImagery;

	UINT		MAINWindowX;
	UINT		MAINWindowY;
	UINT		MAINToggleState;
	
	//Waterfalls
	CRect		HFSSWindowRect;
	UINT		HFSSWindowPalette;
	UINT		HFSSBrightness;
	UINT		HFSSContrast;
	UINT		HFSSScaling;
	
	CRect		LFSSWindowRect;
	UINT		LFSSWindowPalette;
	UINT		LFSSBrightness;
	UINT		LFSSContrast;
	UINT		LFSSScaling;

	CRect		SBPWindowRect;
	UINT		SBPWindowPalette;
	UINT		SBPBrightness;
	UINT		SBPContrast;
	UINT		SBPScaling;

	//BATHY DISPLAY
	COLORREF	bathyPoints;
	CRect		BATHYWindowRect;

	//Wedge (IMAGERY)
	CRect		IMAGERYWindowRect;

	//TIME SERIES STUFF
	BOOL		bShowRoll;
	BOOL		bShowRollRate;
	BOOL		bShowPitch;
	BOOL		bShowPitchRate;
	BOOL		bShowEastRate;
	BOOL		bShowNorthRate;
	BOOL		bShowDepthRate;

	COLORREF	clrTS1_Line1;
	COLORREF	clrTS1_Line2;
	COLORREF	clrTS1_Line3;
	COLORREF	clrTS1_Line4;
	COLORREF	clrTS2_Line1;
	COLORREF	clrTS2_Line2;
	COLORREF	clrTS2_Line3;
	COLORREF	clrTS1_BK;
	COLORREF	clrTS1_AXIS;
	COLORREF	clrTS1_PLANE;
	COLORREF	clrTS1_FONT;
	COLORREF	clrTS2_BK;
	COLORREF	clrTS2_AXIS;
	COLORREF	clrTS2_PLANE;
	COLORREF	clrTS2_FONT;

	UINT		uiTS1_Scale;
	UINT		uiTS2_Scale;

	UINT		TSWindowX;
	UINT		TSWindowY;
	UINT		TSWindowCX;
	UINT		TSWindowCY;
	
	UINT		TSWindowUpdateRate;

	//Depth Display
	UINT		DEPWindowX;
	UINT		DEPWindowY;
	COLORREF	DEPWndWater;
	COLORREF	DEPWndShip;
	COLORREF	DEPWndAxis;
	COLORREF	DEPWndText;
	COLORREF	DEPWndLines;
	COLORREF	DEPWndHistory;
	
	//Compass/Yaw Display
	UINT		HEDWindowX;
	UINT		HEDWindowY;

	//Navigation Display
	UINT		NAVWindowX;
	UINT		NAVWindowY;

	//ASCII-Only Display
	UINT		ASCIWindowX;
	UINT		ASCIWindowY;

	//Dlg Popup Report Options
	BOOL		bQueryOnConnect;
	bool		bAutoHealth;
	UINT		uiLabels;
	ULONG		ulHealthInterval;


	//Dlg TCP & GENERAL
	DWORD		dRemoteAddress;
	UINT		dRemotePort;
	BOOL		bSync6046Time;
	BOOL		bAutoSyncStartup;
	BOOL		bSyncInterval;
	UINT		uiSyncIntervalTime;
	UINT		uiMaxFileSize;
	UINT		uiMaxFileOverlap;
	char		targetDir[MAX_PATH];

	//Dlg Sensor Setup

	//Dlg params - HFSS
	UINT		dHFSSRange;
	UINT		dHFSSPower;

	//Dlg params2 - LFSS
	UINT		dLFSSRange;
	UINT		dLFSSPower;

	//Dlg SBP params
	float		fSBPDuration;
	UINT		dSBPPower;
	UINT		dSBPGain;
	UINT		pad;

	//7k stuff
	BOOL		bPingActive;
	BOOL		bFlip;
	UINT		uiSystemID;
	float		fMinRange;	
	float		fMaxRange;	
	float		fMinDepth;	
	float		fMaxDepth;
	//last known good settings go here
	float		range;
	float		power;
	float		rate;
	float		pulse;
	float		gain;

	//Dlg playback
	DWORD		Padding1;
	DWORD		Padding2;
   
               tagSYSTEMCONFIG  ( void );
              ~tagSYSTEMCONFIG  ( void );

    void            Reset               ( void );
    void            SetDefault          ( void );

    static size_t   Size                ( void );
}
SYSTEMCONFIG;

#pragma pack( pop, SYSTEMCONFIG_H_PACK )


class CSystemConfig  : public tagSYSTEMCONFIG
{
public:
	CSystemConfig();
	virtual ~CSystemConfig();

	typedef enum tagEACCESS
    {
        accessWrite     = 0,
        accessRead
    }
    EACCESS;
               
    // Disk i/o support members.

    bool                Open                        (   const EACCESS           &reAccess );

    bool                Close                       (   void );

    bool                IsOpen                      (   void )  const;

    bool                Save                        (   void );
    bool                Read                        (   void );

                        operator SYSTEMCONFIG *  (   void );

private:

    ///////////////
    // Attrubtues.

    FILE               *m_fpFile;

    ///////////////
    // Services.

    CSystemConfig								 (   const CSystemConfig &rRhs );
    CSystemConfig &  operator =                  (   const CSystemConfig &rRhs );

    static CString      GetAppPath                  (   void );

};

#endif // !defined(AFX_SYSTEMCONFIG_H__BA529CDD_9DA8_4A9A_8E8A_7BAA50377136__INCLUDED_)
