| | |
| | | #include "Configuration.h" |
| | | #include "HsmsPassive.h" |
| | | #include "CMaster.h" |
| | | #include "CGlassPool.h" |
| | | #include "ProcessJob.h" |
| | | #include <cstdint> |
| | | #include <map> |
| | | #include <string> |
| | | |
| | | enum class ControlState : uint8_t { |
| | | OfflineEquipment = 0, |
| | | OfflineAttempt = 1, |
| | | Online = 2, |
| | | OfflineHost = 3, |
| | | OnlineLocal = 4, |
| | | OnlineRemote = 5, |
| | | }; |
| | | |
| | | class CModel |
| | | { |
| | |
| | | |
| | | public: |
| | | IObservable* getObservable(); |
| | | SERVO::CMaster& getMaster(); |
| | | void setWorkDir(const char* pszWorkDir); |
| | | void loadPortParams(); |
| | | void setPortType(unsigned int index, SERVO::PortType type);; |
| | | void setPortCassetteType(unsigned int index, SERVO::CassetteType type); |
| | | void setPortEnable(unsigned int index, BOOL bEnable); |
| | | int init(); |
| | | int term(); |
| | | bool isAlarmStep(SERVO::CStep* pStep); |
| | | |
| | | ControlState getControlState() const noexcept { return m_currentControlState; } |
| | | void setControlState(ControlState newState); |
| | | bool raiseSoftAlarm(int alarmId, |
| | | const std::string& desc = "", |
| | | int level = -1, |
| | | int deviceId = 0, |
| | | int unitId = 0, |
| | | const char* deviceName = "Software", |
| | | const char* unitName = "App"); |
| | | void clearSoftAlarm(int alarmId, int deviceId = 0, int unitId = 0); |
| | | |
| | | private: |
| | | void refreshDerivedSVs(); |
| | | void notifyControlJobChanged(); |
| | | void emitPjStateEvents(); |
| | | |
| | | public: |
| | | int notify(int code); |
| | |
| | | public: |
| | | CConfiguration m_configuration; |
| | | CHsmsPassive m_hsmsPassive; |
| | | SERVO::CGlassPool m_glassPool; |
| | | SERVO::CMaster m_master; |
| | | |
| | | private: |
| | |
| | | IObservableEmitter* m_pObservableEmitter; |
| | | CString m_strWorkDir; |
| | | CString m_strDataDir; |
| | | }; |
| | | |
| | | private: |
| | | ControlState m_currentControlState{ ControlState::OfflineEquipment }; |
| | | std::map<std::string, SERVO::PJState> m_prevPjStates; |
| | | }; |