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.
74 lines
2.3 KiB
C++
74 lines
2.3 KiB
C++
// InputControllerBase.h: interface for the CInputControllerBase class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
#pragma once
|
|
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
#include "hardwareCfgFactory.h"
|
|
|
|
class CInputSetting;
|
|
class CInputBase;
|
|
|
|
class CInputControllerBase : public CCard
|
|
{
|
|
public:
|
|
CInputControllerBase(std::string csMutexName);
|
|
virtual ~CInputControllerBase();
|
|
|
|
void RegisterInput(const CInputSetting& inputSetting, CInputBase* pInput);
|
|
|
|
void DeRegisterInput(const CInputSetting& inputSetting);
|
|
|
|
BOOL Init(int nTypeID);
|
|
|
|
// virtual method to initialise the input controller card
|
|
virtual int InitCard(int nTypeID, int nTypeCardNo, int* pPhysicalCardID) = 0;
|
|
|
|
// virtual method to close the input controller card
|
|
void Close(int nTypeID);
|
|
|
|
virtual int CloseCard(int nPhysicalCardID) = 0;
|
|
|
|
// virtual method to query if the input is OFF
|
|
virtual BOOL IsOff(const CInputSetting& InputSetting);
|
|
|
|
// virtual method to query if the input is ON
|
|
virtual BOOL IsOn(const CInputSetting& InputSetting);
|
|
|
|
// virtual method to query for current analog voltage of analog output
|
|
virtual BOOL GetVoltage(const CInputSetting& InputSetting, double& dVoltage, int nRange);
|
|
|
|
/***********************************************************************/
|
|
/*********************currently for 9222 ONLY***************************/
|
|
|
|
// virtual method to setup general counter
|
|
virtual BOOL SetupCounter(const CInputSetting& InputSetting, int nMode);
|
|
|
|
// new virtual method to cater for auto reset counter using Org Signal
|
|
virtual BOOL SetupCounter(const CInputSetting& InputSetting, int nMode, unsigned int LReg1_Val, unsigned int LReg2_Val);
|
|
|
|
// virtual method to clear counter
|
|
virtual BOOL ClearCounter(const CInputSetting& InputSetting);
|
|
|
|
// virtual method to enable counter counting
|
|
virtual BOOL EnableCounter(const CInputSetting& InputSetting);
|
|
|
|
// virtual method to disable counter counting
|
|
virtual BOOL DisableCounter(const CInputSetting& InputSetting);
|
|
|
|
// virtual method read the counter
|
|
virtual unsigned long ReadCounter(const CInputSetting& InputSetting);
|
|
|
|
std::map<std::string, CInputBase*>& GetIpMap();
|
|
|
|
//
|
|
virtual bool ReadInputs(std::vector<unsigned short>& vecInData);
|
|
|
|
protected:
|
|
CMutex m_mutexInput;
|
|
|
|
CHardwareCfgFactory m_cfgHardwareFty;
|
|
};
|