|
|
|
|
// InputControllerBase.h: interface for the CInputControllerBase class.
|
|
|
|
|
//
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#if !defined(AFX_INPUTCONTROLLERBASE_H__4788ABC5_CF6C_4489_BFBE_9BEA820B592E__INCLUDED_)
|
|
|
|
|
#define AFX_INPUTCONTROLLERBASE_H__4788ABC5_CF6C_4489_BFBE_9BEA820B592E__INCLUDED_
|
|
|
|
|
|
|
|
|
|
#include "hardwareini.h"
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
|
|
#if _MSC_VER > 1000
|
|
|
|
|
#pragma once
|
|
|
|
|
#endif // _MSC_VER > 1000
|
|
|
|
|
|
|
|
|
|
class CInputSetting;
|
|
|
|
|
class CInputBase;
|
|
|
|
|
|
|
|
|
|
class CInputControllerBase : public CCard
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
CInputControllerBase(CString csMutexName);
|
|
|
|
|
virtual ~CInputControllerBase();
|
|
|
|
|
|
|
|
|
|
void RegisterInput(const CInputSetting &inputSetting, CInputBase *pInput);
|
|
|
|
|
|
|
|
|
|
void DeRegisterInput(const CInputSetting &inputSetting);
|
|
|
|
|
|
|
|
|
|
BOOL Init(int nHardwareIniTypeID);
|
|
|
|
|
|
|
|
|
|
// virtual method to initialise the input controller card
|
|
|
|
|
virtual int InitCard(int nHardwareIniTypeID, int nHardwareIniTypeCardNo, int *pPhysicalCardID) = 0;
|
|
|
|
|
|
|
|
|
|
// virtual method to close the input controller card
|
|
|
|
|
void Close(int nHardwareIniTypeID);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
// Gary 5Mar12, V1.29.05,
|
|
|
|
|
// 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;
|
|
|
|
|
|
|
|
|
|
CHardwareIni m_iniHardware;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // !defined(AFX_INPUTCONTROLLERBASE_H__4788ABC5_CF6C_4489_BFBE_9BEA820B592E__INCLUDED_)
|