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.
93 lines
2.3 KiB
C++
93 lines
2.3 KiB
C++
// InputController.h: interface for the CInputController class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
#pragma once
|
|
|
|
#include <array>
|
|
#include <vector>
|
|
|
|
#include "InputControllerBase.h"
|
|
|
|
#include "DllDefines.h"
|
|
#include "HardwareCfgFactory.h"
|
|
|
|
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);
|
|
|
|
// for bench debug testing
|
|
void SetSimulationIO(const std::vector<std::string>& vecSimulationIO)
|
|
{
|
|
m_vecSimulationIO = vecSimulationIO;
|
|
}
|
|
|
|
const std::vector<std::string>& GetSimulationIO()
|
|
{
|
|
return m_vecSimulationIO;
|
|
}
|
|
|
|
private:
|
|
std::array<CInputControllerBase*, MAX_INPUT_CARD_TYPE> m_inputControllerBase{};
|
|
|
|
int m_nNoOfCardType{ 0 };
|
|
CHardwareCfgFactory m_cfgHardwareFty;
|
|
std::vector<stCard> m_vecCard;
|
|
|
|
std::vector<std::string> m_vecSimulationIO;
|
|
|
|
static CInputController* instance;
|
|
|
|
CWinThread* m_pThread{ nullptr };
|
|
|
|
CEvt m_evtTerminate;
|
|
CEvt m_evtStartUpdate{ "INPUT CONTROLLER START UPDATE" };
|
|
};
|