|
|
|
|
// InputController.h: interface for the CInputController class.
|
|
|
|
|
//
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#if !defined(AFX_INPUTCONTROLLER_H__65E8EEA3_D76F_11D7_89B3_000629A6E157__INCLUDED_)
|
|
|
|
|
#define AFX_INPUTCONTROLLER_H__65E8EEA3_D76F_11D7_89B3_000629A6E157__INCLUDED_
|
|
|
|
|
|
|
|
|
|
#if _MSC_VER > 1000
|
|
|
|
|
#pragma once
|
|
|
|
|
#endif // _MSC_VER > 1000
|
|
|
|
|
|
|
|
|
|
#include "hardwareini.h"
|
|
|
|
|
#include "InputControllerBase.h"
|
|
|
|
|
|
|
|
|
|
#ifdef BUILD_IODLL
|
|
|
|
|
#define IODLLCLASS __declspec(dllexport)
|
|
|
|
|
#else
|
|
|
|
|
#define IODLLCLASS __declspec(dllimport)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
class CInputSetting;
|
|
|
|
|
|
|
|
|
|
class IODLLCLASS CIpStatus
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
char m_cPtName[100];
|
|
|
|
|
bool m_bOn;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class IODLLCLASS CInputController : public CCard
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
friend UINT InputControllerThreadFn(LPVOID pParam);
|
|
|
|
|
|
|
|
|
|
CInputController();
|
|
|
|
|
virtual ~CInputController();
|
|
|
|
|
|
|
|
|
|
BOOL GetVoltage(const CInputSetting &InputSetting, double &dVoltage, int nRange);
|
|
|
|
|
|
|
|
|
|
BOOL InitController();
|
|
|
|
|
|
|
|
|
|
BOOL IsOff(const CInputSetting &InputSetting);
|
|
|
|
|
|
|
|
|
|
BOOL IsOn(const CInputSetting &InputSetting);
|
|
|
|
|
|
|
|
|
|
/***********************************************************************/
|
|
|
|
|
/*********************currently for 9222 ONLY***************************/
|
|
|
|
|
|
|
|
|
|
// method to setup general counter
|
|
|
|
|
BOOL SetupCounter(const CInputSetting &InputSetting, int nMode);
|
|
|
|
|
|
|
|
|
|
// method to clear counter
|
|
|
|
|
BOOL ClearCounter(const CInputSetting &InputSetting);
|
|
|
|
|
|
|
|
|
|
// method to enable counter counting
|
|
|
|
|
BOOL EnableCounter(const CInputSetting &InputSetting);
|
|
|
|
|
|
|
|
|
|
// method to disable counter counting
|
|
|
|
|
BOOL DisableCounter(const CInputSetting &InputSetting);
|
|
|
|
|
|
|
|
|
|
// method read the counter
|
|
|
|
|
unsigned long ReadCounter(const CInputSetting &InputSetting);
|
|
|
|
|
|
|
|
|
|
static CInputController* GetInstance();
|
|
|
|
|
CInputControllerBase * GetController(int nCardType);
|
|
|
|
|
|
|
|
|
|
void StartUpdateThread();
|
|
|
|
|
|
|
|
|
|
void TerminateThread();
|
|
|
|
|
|
|
|
|
|
void StartUpdate(bool bStartUpdate);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
CInputControllerBase* m_inputControllerBase[MAX_INPUT_CARD_TYPE];
|
|
|
|
|
|
|
|
|
|
int m_nNoOfCardType;
|
|
|
|
|
CHardwareIni m_iniHardware;
|
|
|
|
|
CArray<stCard, stCard> m_astCard;
|
|
|
|
|
|
|
|
|
|
static CInputController* instance;
|
|
|
|
|
|
|
|
|
|
CWinThread *m_pThread;
|
|
|
|
|
|
|
|
|
|
CEvt m_evtTerminate;
|
|
|
|
|
CEvt m_evtStartUpdate;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // !defined(AFX_INPUTCONTROLLER_H__65E8EEA3_D76F_11D7_89B3_000629A6E157__INCLUDED_)
|