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.
97 lines
2.0 KiB
C++
97 lines
2.0 KiB
C++
// Input.h: interface for the CInput class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
#pragma once
|
|
|
|
#include "hardwareini.h"
|
|
#include "InputBase.h"
|
|
|
|
#ifdef BUILD_IODLL
|
|
#define IODLLCLASS __declspec(dllexport)
|
|
#else
|
|
#define IODLLCLASS __declspec(dllimport)
|
|
#endif
|
|
|
|
class IODLLCLASS CInputSetting
|
|
{
|
|
public:
|
|
// configuration
|
|
// CInputSetting() :
|
|
// m_szName(nullptr),
|
|
// m_szModuleName(nullptr),
|
|
// m_bLogic(FALSE),
|
|
// m_nPointNo(0),
|
|
// m_nSlaveID(0),
|
|
// m_nPtrNo(0),
|
|
// m_nBoardType(0),
|
|
// m_nCardNo(0)
|
|
//{
|
|
//}
|
|
|
|
std::string m_strName;
|
|
std::string m_strModuleName;
|
|
BOOL m_bLogic;
|
|
int m_nPointNo;
|
|
int m_nSlaveID;
|
|
int m_nPtrNo;
|
|
int m_nBoardType;
|
|
int m_nCardNo;
|
|
};
|
|
|
|
class IODLLCLASS CInput : public CCard
|
|
{
|
|
public:
|
|
CInput(const CInputSetting& Setting);
|
|
virtual ~CInput();
|
|
|
|
BOOL SetLastAICh(int nLastChannel);
|
|
BOOL SetAIConfig(int nSignalRange);
|
|
|
|
BOOL GetVoltage(double& dVoltage, int nRange);
|
|
|
|
// method to start read
|
|
BOOL StartRead();
|
|
|
|
// method to get voltage only
|
|
BOOL GetVoltageOnly(double& dVoltage, int nRange);
|
|
|
|
// method to stop read
|
|
BOOL StopRead();
|
|
|
|
void AbortCheck(void);
|
|
|
|
HANDLE GetEvt(BOOL bState);
|
|
|
|
void StartWait(BOOL bState, DWORD dwDebounce, DWORD dwTimeout);
|
|
|
|
BOOL Wait(BOOL bState, DWORD dwDebounce, DWORD dwTimeout);
|
|
|
|
BOOL IsOff(void);
|
|
|
|
BOOL IsOn(void);
|
|
|
|
BOOL operator==(const BOOL bState);
|
|
BOOL operator!=(const BOOL bState);
|
|
|
|
/***********************************************************************/
|
|
/*********************currently for 9222 ONLY***************************/
|
|
|
|
// method to setup general counter
|
|
BOOL SetupCounter(int nMode);
|
|
|
|
// method to clear counter
|
|
BOOL ClearCounter();
|
|
|
|
// method to enable counter counting
|
|
BOOL EnableCounter();
|
|
|
|
// method to disable counter counting
|
|
BOOL DisableCounter();
|
|
|
|
// method read the counter
|
|
unsigned long ReadCounter();
|
|
|
|
private:
|
|
CInputBase* m_inputBase;
|
|
};
|