48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
|
#pragma once
|
|||
|
#include <string>
|
|||
|
#include "StreamClient.h"
|
|||
|
#include <map>
|
|||
|
|
|||
|
using namespace std;
|
|||
|
|
|||
|
|
|||
|
class DataHandle{
|
|||
|
typedef void (*DataCallBack)(void* pthis, const ReadData& msg);
|
|||
|
public:
|
|||
|
DataHandle();
|
|||
|
virtual ~DataHandle();
|
|||
|
DataHandle(const DataHandle& d) = delete;
|
|||
|
DataHandle& operator = (const DataHandle& d) = delete;
|
|||
|
|
|||
|
void Init();
|
|||
|
void Stop();
|
|||
|
|
|||
|
static void DataCallBackProc(void* pthis, const ReadData& msg);
|
|||
|
|
|||
|
void SetPushMsg(WRITETYPE dataType, const string& nameKey = "", const string& strValue = "", DATATYPE valueType = UNKNOW);
|
|||
|
|
|||
|
string GetVersion()const {return m_version;}
|
|||
|
|
|||
|
void Request(int index);
|
|||
|
void AllTest();
|
|||
|
void AxisMoveTest(); //轴运动测试
|
|||
|
void ScanCtrlTest(); //扫描控制测试
|
|||
|
|
|||
|
void Usage();
|
|||
|
void ParamReadUsage();
|
|||
|
|
|||
|
int GetPrintParam() const {return m_printIndex;}
|
|||
|
|
|||
|
private:
|
|||
|
void DataCallBackHandle(const ReadData& msg);
|
|||
|
void PrintValue(const ReadData& msg);
|
|||
|
|
|||
|
private:
|
|||
|
DataCallBack m_dataCallBack;
|
|||
|
StreamClient* m_streamClient;
|
|||
|
string m_version; //软件版本
|
|||
|
|
|||
|
int m_printIndex; //命令编号
|
|||
|
|
|||
|
map<int, string> m_dataTypeMp;
|
|||
|
};
|