/******************************************************************************* * * * 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 #include #include "Externaliomodule.h" #include "LazerProbe.h" #include "LazerProbesMgr.h" #include typedef enum eZTConfigResult { ZT_CONFIG_OK, ZT_CONFIG_FILE_ERROR, ZT_CONFIG_PARAMETER_ERROR }ZTConfigResult; typedef enum eZTConfigModbusEnableMode { ZT_CONFIG_MODBUS_ENABLE_FORCE_ON, ZT_CONFIG_MODBUS_ENABLE_FORCE_OFF, ZT_CONFIG_MODBUS_ENABLE_AUTODETECT }ZTConfigModbusEnableMode; 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 *GetExtIOModulesConfigList(void); QList *GetLazerProbesConfigList(void); int GetEngLog(void); bool GetSimulatorEnabled(); ZTConfigModbusEnableMode GetModbusCCEnabled(); int GetModbusCCPort(); int GetModbusCCDevID(); QString GetModbusCCIFName(); // int GetLaserSensorCalib(){return mConfig_Station_LaserSensorCalib;} private: //configuration values //External IO Modules QString mConfig_ExtIO_MasterIPAddr; QString mDataQIPAddr; QList mConfig_ExtIOModulesConfigList; QList mConfig_LazerProbeModulesConfigList; QString mConfig_Station_StationName; QString mModbusCCIFName; // int mConfig_Station_LaserSensorCalib; int mEngLogVerbosity; bool mUseSimulator; ZTConfigModbusEnableMode mUseModbusCCMode; int mModbusCCDevID; int mModbusCCPort; }; #endif // ZTCONFIGMGR_H