ZT/sources/ZTconfigmgr.h

113 lines
2.9 KiB
C++

/*******************************************************************************
* *
* Société de Transports de Montréal. *
* 2012 *
* *
* Projet Zones Tests *
* *
* *
* *
*******************************************************************************/
/*
Description:
Description du fichier si nécessaire.
*/
/* ************************************************************************** */
/* Revision:
### 20121210 JFM
Verision d'origine.
### YYYYMMDD Description du besoin ou du bug
Description du changement.
*/
/* ************************************************************************** */
#ifndef ZTCONFIGMGR_H
#define ZTCONFIGMGR_H
#include "GlobalDefine.h"
#include <QFile>
#include <QList>
#include "Externaliomodule.h"
#include "LazerProbe.h"
#include "LazerProbesMgr.h"
#include <QString>
typedef enum eZTConfigResult
{
ZT_CONFIG_OK,
ZT_CONFIG_FILE_ERROR,
ZT_CONFIG_PARAMETER_ERROR
}ZTConfigResult;
typedef struct stExtModulesConfig
{
eExternalModuleType_t ModuleType;
unsigned int ModuleSlaveAddress;
unsigned int ModuleID;
}stExtModulesConfig_t;
typedef struct stLazerProbesConfig
{
unsigned int ProbeType;
unsigned int ProbeID;
QString SerialPort;
}stLazerProbesConfig_t;
class CZTConfigMgr
{
public:
static CZTConfigMgr* instance(){return &mSingleton;}
static CZTConfigMgr mSingleton;
ZTConfigResult LoadZTConfig(void);
QFile *mZTConfigFile;
CZTConfigMgr();
QString GetStationName(void);
QString GetExtIOIPAddress(void);
QString GetDataQIPAddress();
QList<stExtModulesConfig_t> *GetExtIOModulesConfigList(void);
QList<stLazerProbesConfig_t> *GetLazerProbesConfigList(void);
int GetEngLog(void);
bool GetSimulatorEnabled();
bool GetModbusCCEnabled();
int GetModbusCCPort();
int GetModbusCCDevID();
// int GetLaserSensorCalib(){return mConfig_Station_LaserSensorCalib;}
private:
//configuration values
//External IO Modules
QString mConfig_ExtIO_MasterIPAddr;
QString mDataQIPAddr;
QList<stExtModulesConfig_t> mConfig_ExtIOModulesConfigList;
QList<stLazerProbesConfig_t> mConfig_LazerProbeModulesConfigList;
QString mConfig_Station_StationName;
// int mConfig_Station_LaserSensorCalib;
int mEngLogVerbosity;
bool mUseSimulator;
bool mUseModbusCC;
int mModbusCCDevID;
int mModbusCCPort;
};
#endif // ZTCONFIGMGR_H