#pragma once namespace DIOS::Dev::Detail::MachineryECOM { class ConfigurationManager { public: ConfigurationManager(); ~ConfigurationManager(); public: void Initialize(const std::string &workpath); ResDataObject &GetPositionNumberConfig(const std::string &key); ResDataObject &GetCalibrationConfig(const std::string &key); std::string GetControllerClassID(const std::string &key); BOOL GetAllMachineryConfigs(ResDataObject &out); BOOL GetAllTomoConfigs(ResDataObject &out); ResDataObject &GetTomoConfig(const std::string &key); ResDataObject &GetMachineryConfig(const std::string &key); ResDataObject &GetServoDriveConfig(const std::string &key); ResDataObject &GetExpousreDelayTimeConfig(); BOOL UpdateCalibrationConfig(const std::string &key, ResDataObject ¶ms); ResDataObject& GetWSConfig(const std::string& key); ResDataObject& GetConfigTubeVertical(const std::string& key); ResDataObject& GetConfigTubeHorizontal(const std::string& key); ResDataObject& GetConfigTubeRotation(const std::string& key); ResDataObject& GetConfigTomoMotionLimitation(const std::string& key); BOOL UpdateMotionConfigTubeAngle(const std::string& key, ResDataObject& params); BOOL UpdateMotionConfigTubeHeight(const std::string& key, ResDataObject& params); BOOL UpdateMotionConfigTubeHorizontal(const std::string& key, ResDataObject& params); public: static ConfigurationManager *Instance(); private: static ConfigurationManager *m_instance; std::string GetConfigPath(const std::string &workpath); void LoadComponentControllerConfig(); void LoadPositionNumberConfig(); void LoadCalibrationConfig(); void LoadMachineryConfig(); void LoadTomoConfig(); void LoadServoDriveConfig(); void LoadExposureDelayTimeConfig(); void LoadWorkstationConfig(); void LoadMotionConfigVertical(); void LoadMotionConfigHorizontal(); void LoadMotionConfigRotation(); void LoadConfigTomoMotionLimitation(); private: std::string m_workPath; std::string m_configPath; ResDataObject m_componentController; ResDataObject m_positionNumber; ResDataObject m_machineryConfig; ResDataObject m_tomoConfig; ResDataObject m_servoDrive; ResDataObject m_motionParamCalRoot; ResDataObject m_exposureDelayTime; ResDataObject m_wsConfig; ResDataObject m_TomoMotionConfig; ResDataObject m_motionConfigVerticalRoot; ResDataObject m_motionConfigVertical; ResDataObject m_motionConfigHorizontalRoot; ResDataObject m_motionConfigHorizontal; ResDataObject m_motionConfigRotationRoot; ResDataObject m_motionConfigRotation; }; }