You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitlib.pub/MITLIB/mcctrdll/CheckSwitch.h

117 lines
3.1 KiB
C++

// 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"
#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 IsHardwareBypass();
void InitParameters();
void BypassEngineering(bool bBypass=TRUE);
void BypassCurtain(bool bBypass=TRUE);
void BypassDoor(bool bBypass=TRUE);
void SetSystemOutput(int nOutput, COutput *copOutputPt);
CCheckSwitch();
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();
private:
void CheckSwitch(int nSwitchNo, CInput *cipSwitch, stMSG_SEND &stMsgSend/*BOOL &bSwitchCurrentState*/, BOOL &bSendBefore);
void GetMainApp();
void CheckSwitch(int nSwitchNo, CInput *cipSwitch, stMSG_SEND &stMsgSend);//BOOL &bSwitchCurrentState);
// BOOL Debounce(CInput *ipInputPt, BOOL bState, DWORD dwTimeout);
CInput *m_cipSwitch[SWITCH_SYSTEM];
/*
CInput *m_cipSwitchStart;
CInput *m_cipSwitchStop;
CInput *m_cipSwitchReset;
CInput *m_cipSwitchEStop;
CInput *m_cipSwitchDoor;
CInput *m_cipSwitchVacuum;
CInput *m_cipSwitchAir;
CInput *m_cipSwitchCurtain;
CInput *m_cipSwitchEngineering;
*/
/*
BOOL m_bSwitchStartCurrentState;
BOOL m_bSwitchStopCurrentState;
BOOL m_bSwitchResetCurrentState;
BOOL m_bSwitchEStopCurrentState;
BOOL m_bSwitchDoorCurrentState;
BOOL m_bSwitchVacuumCurrentState;
BOOL m_bSwitchAirCurrentState;
BOOL m_bSwitchCurtainCurrentState;
BOOL m_bSwitchEngineeringCurrentState;
BOOL m_bSwitchStartOffSend;
BOOL m_bSwitchStopOffSend;
BOOL m_bSwitchResetOffSend;
BOOL m_bSwitchEStopOffSend;
BOOL m_bSwitchDoorOffSend;
BOOL m_bSwitchVacuumOffSend;
BOOL m_bSwitchAirOffSend;
BOOL m_bSwitchCurtainOffSend;
BOOL m_bSwitchEngineeringOffSend;
*/
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;
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CCheckSwitch)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif // !defined(AFX_CHECKSWITCH_H__C85A84B3_B27C_11D7_8989_000629A6E157__INCLUDED_)