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.

62 lines
1.2 KiB
C++

#pragma once
#include <string>
#include "sysapi.h"
using std::string;
class CSimTest
{
public:
CSimTest(int index, const char* ate);
virtual ~CSimTest(void);
int Init();
int Deinit();
protected:
void ChkTest();
void ChkHome();
void ChkConn();
void RecvMsg();
void Disconnect();
int FindEnd(char* pszmsg);
int ParseMsg(char* pszmsg); //解析并处理消息
int ParseStartParam(char* pszmsg);
void SendMsg(const char *pszFormat, ...); //发送消息
int Process(); //线程函数
static int WINAPI ThreadFun(void* param);
bool isRun() { return _bhome || _btest; }
private:
int _status; //连接状态
int _index;
char _ate[MAX_NAME_LEN];
bool m_brun; //线程运行标识
Handle m_hThread; //线程句柄
int _skt; //连接句柄
//模拟数据
bool _bsendgr; //是否发送GR
bool _btest; //是否测试中
bool _bhome; //是否回原中
ulong _start; //测试开始时间
char _res[MAX_BUF_LEN]; //测试结果
string SN;
string Machine;
string User;
string Config;
string Lot;
string Mode;
string SiteID;
string ProjectID;
string RetryMode;
};