-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.h
More file actions
138 lines (123 loc) · 3.15 KB
/
command.h
File metadata and controls
138 lines (123 loc) · 3.15 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#pragma once
#include <string>
enum Axis {
AXIS_ALL = 0,
AXIS_X = 1,
AXIS_Y = 2,
AXIS_Z = 3,
};
enum RCmdId {
HOME = 0, //origin (0,0,0)
PICKUP = 1,
EJECT = 2, //note: set (offs_um < 0) to eject to chute
SAMPLE = 3, //plate#1
SAMPLE_LAST = 4, //plate#1 last column
SAMPLE2 = 5, //second plate (if supported)
SAMPLE2_LAST = 6, //last column of 2nd plate
WARMUP = 7, //plate warmup location
CHUTE = 8,
PARK = 9,
SHIP = 10,
PRESENT = 11, //robot present position
UPGRADE = 12, //Octet-R O-box upgrade location
};
enum ShakerId {
//target shaker id
ALL = 0, //all shakers
SH1 = 1, //shaker #1
SH2 = 2, //shaker #2
};
enum ShakerMode {
STOP = 0,
SHAKE = 1,
ShakerHOME = 2,
ShakerPARK = 3,
};
struct Command {
std::string cmd;
int para1;
int para2;
int para3;
int para4;
int para5;
int para6;
};
struct ENGN_Info
{
bool bCanAutoGain; // Spectrometer has adjustable integration time
bool bHasVariableSpeed; // Has more than one speed setting
bool bHasDark; // Dark spectra has been saved
bool bHasRef; // Reference spectra has been saved
bool bMapOK; // Spectrometers map status
};
enum CmdType{
Scan,
Stop,
Snap,
SaveRef,
SaveDark,
AutoGain,
LampOn,
LampOff,
Park,
HomeXYZ,
Eject,
PickSensor,
Sample,
Shaker,
SetSampleTemp,
SetSpectTemp,
RobotCmd,
Unknown
};
static const CmdType AllCmdTypes[] =
{
Scan,
Stop,
Snap,
SaveRef,
SaveDark,
AutoGain,
LampOn,
LampOff,
Park,
HomeXYZ,
Eject,
PickSensor,
Sample,
Shaker,
SetSampleTemp,
SetSpectTemp,
RobotCmd,
Unknown
};
//==============================================================================================
// FUNCTION: cmdTypeToStr
// PURPOSE: Maps a command enum value to a string.
//
inline std::string cmdTypeToStr( CmdType cmdType )
{
switch (cmdType)
{
case Scan: return "scan";
case Stop: return "stop";
case Snap: return "snap";
case SaveRef: return "saveRef";
case SaveDark: return "saveDark";
case AutoGain: return "autoGain";
case LampOn: return "lampOn";
case LampOff: return "lampOff";
case Park: return "park";
case HomeXYZ: return "homeXYZ";
case Eject: return "eject";
case PickSensor: return "pickSensor";
case Sample: return "sample";
case Shaker: return "shaker";
case SetSampleTemp: return "setSampleTemp";
case SetSpectTemp: return "setSpectTemp";
case RobotCmd: return "robotCmd";
case Unknown: return "unknown";
default: return "unknown";
}
}
//std::map<std::string, CmdType> nodeMap;