1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #ifndef __MACHINEMGRBASE_H_
- #define __MACHINEMGRBASE_H_
- #include "Global.h"
- //=============== Error code ===============//
- // ************************************************ 错误码 ************************************************************ //
- const int RUN_SUCCESS = 1; // 表示指令成功;
- const int RUNERR_NOSUPPORT = 0; // 表示机器不支持对应指令的错误代码;
- const int RUNERR_UNKNOWERROR = -1; // 表示不明错误代码;
- const int RUNERR_NO_OPEN_COMM = -2; // 表示机器没有连接的错误代码;
- const int RUNERR_WRITE_FAIL = -3; // 表示机器上不能传送数据的错误代码;
- const int RUNERR_READ_FAIL = -4; // 表示从机器上不能读数据;
- const int RUNERR_INVALID_PARAM = -5; // 表示读的参数不正确;
- const int RUNERR_NON_CARRYOUT = -6; // 表示指令失败;
- const int RUNERR_DATAARRAY_END = -7; // 表示读完数据的通知;
- const int RUNERR_DATAARRAY_NONE = -8; // 表示数据不存在;
- const int RUNERR_MEMORY = -9; // 表示PC的内存不足;
- const int RUNERR_MIS_PASSWORD = -10; // 表示连接机器许可号码是不正确;
- const int RUNERR_MEMORYOVER = -11; // 表示指纹机内存不足;
- const int RUNERR_DATADOUBLE = -12; // 表示要登记的号码已经在机器数据里存在;
- const int RUNERR_MANAGEROVER = -14; // 表示机器里没有内存空间,未能登记管理者数据;
- const int RUNERR_FPDATAVERSION = -15; // 表示要用的指纹数据的版本不正确;
- // ************************************************ 错误码 ************************************************************ //
- //设备配置数据
- typedef struct DeviceCfg
- {
- int nMachineType;
- int nType; //通信类型
- long lMachineNumber; //指纹机ID
- long lLicense;
- long lComPort; //通讯串口号
- long lBaudRate; //波特率
- WCHAR szTelNumber[MAX_PATH];
- long lWaitDialTime;
- WCHAR szIpAddress[MAX_PATH];
- long lPort;
- long lTimeOut;
- long lProtocolType;
- long lNetPassword;
- }DEVICECFG,*LPDEVICECFG;
- class CMachineMgrBase
- {
- public:
- CMachineMgrBase();
- CMachineMgrBase(CWnd* pOcx);
- virtual ~CMachineMgrBase();
- virtual int InitMgrCfg(LPDEVICECFG lpCfg);
- //打开终端
- virtual int OpenDevice();
- virtual int CloseDevice();
- virtual void SetReadMark(BOOL propVal);
- virtual int IsOpenDevice(){return m_bOpenDevice;}
- //读取数据
- virtual int ReadGeneralLogData(std::vector<STGeneralLogData>* pVData);
- virtual int ReadAllGlLogData(std::vector<STGeneralLogData>* pVData);
- virtual int USBReadSuperLogData(LPWSTR LPSZFileName);
- //错误输出
- virtual BOOL SolveError(CONST LONG& nErroCode);
- //设置指纹机可用/不可用
- virtual BOOL SetMachineEnable(BOOL bEnable = TRUE);
- virtual BOOL DelLogData();
- virtual int BenumbAllManager();
- virtual LPDEVICECFG GetDeviceData(){return m_lpCfg;}
-
- protected:
- CWnd* m_pOcxCtrl; //ocx控件
- int m_bOpenDevice;
- LPDEVICECFG m_lpCfg;
- };
- #endif //#ifndef __MACHINEMGRBASE_H_
- extern CMachineMgrBase* g_pCMachineMgrBase;
|