// CheckSwitch.h: interface for the CCheckSwitch class. // ////////////////////////////////////////////////////////////////////// #pragma once #include #include "cmnhdr.h" #include "RunTask.h" #include "Input.h" #include "Output.h" #include "commondef.h" #include "DllDefines.h" class CRunCtrl; struct stMSG_SEND { bool bOnSend{ false }; bool bOffSend{ false }; }; class MCCTRDLLCLASS CCheckSwitch : public CRunTask { public: // ctor CCheckSwitch(CRunCtrl* pRunCtrl); virtual ~CCheckSwitch(); // bool SetOuputState(int nOutput, bool bState); void DoorLock(bool bLock = true); bool IsEngineeringBypass(); bool IsCurtainBypass(); bool IsDoorBypass(); bool IsDoorOpen(); bool IsHardwareBypass(); bool IsStopButtonActivated(); void InitParameters(); void BypassEngineering(bool bBypass = true); void BypassCurtain(bool bBypass = true); void BypassDoor(bool bBypass = true); void SetSystemOutput(int nOutput, COutput* copOutputPt); UINT RunThread(void); void SetSwitch(int nSwitch, CInput* cipInputpt); // Set door switch, curtain and engineering switch warn to not send before void ResetSwitchWarning(); void SetGuiWindow(HWND hwnd); // void SetSafetySwitch(int nSwitch, bool bSafety); bool IsSafetySwitch(int nSwitch); private: bool CheckSwitch(int nSwitchNo, CInput* cipSwitch, stMSG_SEND* pMsgSend, bool* pIsSendBefore); void GetMainApp(); void CheckSwitch(int nSwitchNo, CInput* cipSwitch, stMSG_SEND* pMsgSend); std::array m_bSafetySwitch{}; std::array m_cipSwitch{}; std::array m_stMsgSend{}; COutput* m_copSystemDoor{ nullptr }; COutput* m_copCurtainSensorReset{ nullptr }; HWND hwndMainApp{ nullptr }; bool m_bBypassDoor{ false }; bool m_bBypassCurtain{ false }; bool m_bBypassEngineering{ false }; bool m_bHardwareBypass{ false }; bool m_bWrnOnEnggSwitch{ true }; // for ui-control decoupling CRunCtrl* m_pRunCtrl; };