-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathScriptUser.h
More file actions
44 lines (36 loc) · 951 Bytes
/
Copy pathScriptUser.h
File metadata and controls
44 lines (36 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __SCRIPT_USER_H__
#define __SCRIPT_USER_H__
#include "HubUser.h"
#include "SPtrArray.h"
class ScriptUser:public HubUser
{
int mStatus;
CSPtrArray mCmds;
const char * mFileName;
char mWaitKey[64];
char mRemain[128];
int mStep;
DECLARE_TIME_INTERVAL(mTimeWait);
public:
ScriptUser(const char * file,HubCmd * cm);
virtual ~ScriptUser();
public:
virtual BOOL canShow(CSerial * src);
virtual void Close();
virtual void onConnected();
virtual void Cls(){};
void Start();
void Stop();
void RmCmd();
void AddCmd(char * cm);
virtual void Dump(int index,char * buffer);
int GetSize(){ return mCmds.GetSize(); }
const char * GetAt(int index){ return (const char *)mCmds.GetAt(index); }
const char * operator[](int index){ return (const char *)mCmds.GetAt(index); }
protected:
virtual void Show(CSerial * src,const char * msg);
virtual char * ReadData();
BOOL LoadCommand(const char * file);
void FreeCommand();
};
#endif