// CheckSwitch.h: interface for the CCheckSwitch class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_CHECKSWITCH_H__C85A84B3_B27C_11D7_8989_000629A6E157__INCLUDED_) #define AFX_CHECKSWITCH_H__C85A84B3_B27C_11D7_8989_000629A6E157__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "cmnhdr.h" #include "RunTask.h" #include "Input.h" #include "Output.h" #include "commondef.h" class CRunCtrl; #ifdef BUILD_MCCTRDLL #define MCCTRDLLCLASS __declspec(dllexport) #else #define MCCTRDLLCLASS __declspec(dllimport) #endif struct stMSG_SEND { bool bOnSend; bool bOffSend; }; class MCCTRDLLCLASS CCheckSwitch : public CRunTask { public: 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); CCheckSwitch(CRunCtrl *pRunCtrl); virtual ~CCheckSwitch(); 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); bool m_bSafetySwitch[SWITCH_SYSTEM]; CInput *m_cipSwitch[SWITCH_SYSTEM]; stMSG_SEND m_stMsgSend[SWITCH_SYSTEM]; COutput *m_copSystemDoor; COutput *m_copCurtainSensorReset; HWND hwndMainApp; bool m_bBypassDoor; bool m_bBypassCurtain; bool m_bBypassEngineering; bool m_bHardwareBypass; bool m_bWrnOnEnggSwitch; // for ui-control decoupling CRunCtrl *m_pRunCtrl; }; #endif // !defined(AFX_CHECKSWITCH_H__C85A84B3_B27C_11D7_8989_000629A6E157__INCLUDED_)