author | Florian Pose <fp@igh-essen.com> |
Mon, 29 Dec 2008 13:10:53 +0000 | |
branch | stable-1.4 |
changeset 1684 | adf0b6f46ecd |
parent 1629 | 70040a399528 |
child 1335 | 09c6fce1ae45 |
permissions | -rw-r--r-- |
1142 | 1 |
/***************************************************************************** |
2 |
* |
|
3 |
* $Id$ |
|
4 |
* |
|
5 |
****************************************************************************/ |
|
6 |
||
7 |
#include "Command.h" |
|
8 |
||
9 |
/*****************************************************************************/ |
|
10 |
||
11 |
Command::Command(const string &name, const string &briefDesc): |
|
12 |
name(name), |
|
13 |
briefDesc(briefDesc), |
|
14 |
verbosity(Normal) |
|
15 |
{ |
|
16 |
} |
|
17 |
||
18 |
/*****************************************************************************/ |
|
19 |
||
20 |
Command::~Command() |
|
21 |
{ |
|
22 |
} |
|
23 |
||
24 |
/*****************************************************************************/ |
|
25 |
||
26 |
void Command::setVerbosity(Verbosity v) |
|
27 |
{ |
|
28 |
verbosity = v; |
|
29 |
}; |
|
30 |
||
1151 | 31 |
/*****************************************************************************/ |
32 |
||
33 |
void Command::setAlias(int a) |
|
34 |
{ |
|
35 |
alias = a; |
|
36 |
}; |
|
37 |
||
38 |
/*****************************************************************************/ |
|
39 |
||
40 |
void Command::setPosition(int p) |
|
41 |
{ |
|
42 |
position = p; |
|
43 |
}; |
|
44 |
||
1166 | 45 |
/*****************************************************************************/ |
46 |
||
47 |
void Command::setDomain(int d) |
|
48 |
{ |
|
49 |
domain = d; |
|
50 |
}; |
|
51 |
||
52 |
/*****************************************************************************/ |
|
53 |
||
54 |
void Command::setDataType(const string &t) |
|
55 |
{ |
|
56 |
dataType = t; |
|
57 |
}; |
|
58 |
||
59 |
/*****************************************************************************/ |
|
60 |
||
61 |
void Command::setForce(bool f) |
|
62 |
{ |
|
63 |
force = f; |
|
64 |
}; |
|
65 |
||
1142 | 66 |
/****************************************************************************/ |
67 |
||
68 |
bool Command::matchesSubstr(const string &cmd) const |
|
69 |
{ |
|
70 |
return name.substr(0, cmd.length()) == cmd; |
|
71 |
} |
|
72 |
||
73 |
/****************************************************************************/ |
|
74 |
||
75 |
bool Command::matchesAbbrev(const string &abb) const |
|
76 |
{ |
|
77 |
unsigned int i; |
|
78 |
size_t pos = 0; |
|
79 |
||
80 |
for (i = 0; i < abb.length(); i++) { |
|
81 |
pos = name.find(abb[i], pos); |
|
82 |
if (pos == string::npos) |
|
83 |
return false; |
|
84 |
} |
|
85 |
||
86 |
return true; |
|
87 |
} |
|
88 |
||
89 |
/*****************************************************************************/ |
|
90 |
||
1144
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
91 |
string Command::numericInfo() |
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
92 |
{ |
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
93 |
stringstream str; |
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
94 |
|
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
95 |
str << "Numerical values can be specified either with decimal (no" << endl |
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
96 |
<< "prefix), octal (prefix '0') or hexadecimal (prefix '0x') base." |
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
97 |
<< endl; |
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
98 |
|
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
99 |
return str.str(); |
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
100 |
} |
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
101 |
|
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
102 |
/*****************************************************************************/ |
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
103 |
|
1155
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
104 |
void Command::throwInvalidUsageException(const stringstream &s) const |
1142 | 105 |
{ |
106 |
throw InvalidUsageException(s); |
|
107 |
} |
|
108 |
||
109 |
/*****************************************************************************/ |
|
110 |
||
1155
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
111 |
void Command::throwCommandException(const stringstream &s) const |
1142 | 112 |
{ |
113 |
throw CommandException(s); |
|
114 |
} |
|
115 |
||
1151 | 116 |
/*****************************************************************************/ |
117 |
||
1155
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
118 |
void Command::throwSingleSlaveRequired(unsigned int size) const |
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
119 |
{ |
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
120 |
stringstream err; |
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
121 |
|
1629
70040a399528
merge -c1422 trunk: Fixed output spacing.
Florian Pose <fp@igh-essen.com>
parents:
1166
diff
changeset
|
122 |
err << "The slave selection matches " << size << " slaves. '" |
1155
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
123 |
<< name << "' requires a single slave."; |
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
124 |
|
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
125 |
throwInvalidUsageException(err); |
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
126 |
} |
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
127 |
|
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
128 |
/*****************************************************************************/ |
bd4e5b544473
Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents:
1151
diff
changeset
|
129 |
|
1151 | 130 |
Command::SlaveList Command::selectedSlaves(MasterDevice &m) |
131 |
{ |
|
1160
f02ff486b313
Removed MasterDevice::slaveCount().
Florian Pose <fp@igh-essen.com>
parents:
1159
diff
changeset
|
132 |
ec_ioctl_master_t master; |
f02ff486b313
Removed MasterDevice::slaveCount().
Florian Pose <fp@igh-essen.com>
parents:
1159
diff
changeset
|
133 |
unsigned int i, aliasIndex; |
1151 | 134 |
uint16_t lastAlias; |
135 |
ec_ioctl_slave_t slave; |
|
136 |
SlaveList list; |
|
137 |
||
1160
f02ff486b313
Removed MasterDevice::slaveCount().
Florian Pose <fp@igh-essen.com>
parents:
1159
diff
changeset
|
138 |
m.getMaster(&master); |
f02ff486b313
Removed MasterDevice::slaveCount().
Florian Pose <fp@igh-essen.com>
parents:
1159
diff
changeset
|
139 |
|
1151 | 140 |
if (alias == -1) { // no alias given |
141 |
if (position == -1) { // no alias and position given |
|
142 |
// all items |
|
1160
f02ff486b313
Removed MasterDevice::slaveCount().
Florian Pose <fp@igh-essen.com>
parents:
1159
diff
changeset
|
143 |
for (i = 0; i < master.slave_count; i++) { |
1151 | 144 |
m.getSlave(&slave, i); |
145 |
list.push_back(slave); |
|
146 |
} |
|
147 |
} else { // no alias, but position given |
|
148 |
// one item by position |
|
149 |
m.getSlave(&slave, position); |
|
150 |
list.push_back(slave); |
|
151 |
} |
|
152 |
} else { // alias given |
|
153 |
if (position == -1) { // alias, but no position given |
|
154 |
// take all items with a given alias |
|
155 |
lastAlias = 0; |
|
1160
f02ff486b313
Removed MasterDevice::slaveCount().
Florian Pose <fp@igh-essen.com>
parents:
1159
diff
changeset
|
156 |
for (i = 0; i < master.slave_count; i++) { |
1151 | 157 |
m.getSlave(&slave, i); |
158 |
if (slave.alias) { |
|
159 |
lastAlias = slave.alias; |
|
160 |
} |
|
161 |
if (lastAlias == (uint16_t) alias) { |
|
162 |
list.push_back(slave); |
|
163 |
} |
|
164 |
} |
|
165 |
} else { // alias and position given |
|
166 |
lastAlias = 0; |
|
167 |
aliasIndex = 0; |
|
1160
f02ff486b313
Removed MasterDevice::slaveCount().
Florian Pose <fp@igh-essen.com>
parents:
1159
diff
changeset
|
168 |
for (i = 0; i < master.slave_count; i++) { |
1151 | 169 |
m.getSlave(&slave, i); |
1159
25cc77cf3993
Improved alias/position addressing in case od duplicated aliases.
Florian Pose <fp@igh-essen.com>
parents:
1157
diff
changeset
|
170 |
if (slave.alias && slave.alias == (uint16_t) alias) { |
1151 | 171 |
lastAlias = slave.alias; |
172 |
aliasIndex = 0; |
|
173 |
} |
|
1159
25cc77cf3993
Improved alias/position addressing in case od duplicated aliases.
Florian Pose <fp@igh-essen.com>
parents:
1157
diff
changeset
|
174 |
if (lastAlias && aliasIndex == (unsigned int) position) { |
1151 | 175 |
list.push_back(slave); |
176 |
} |
|
177 |
aliasIndex++; |
|
178 |
} |
|
179 |
} |
|
180 |
} |
|
181 |
||
182 |
return list; |
|
183 |
} |
|
184 |
||
1156
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
185 |
/*****************************************************************************/ |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
186 |
|
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
187 |
bool operator<( |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
188 |
const ec_ioctl_config_t &a, |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
189 |
const ec_ioctl_config_t &b |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
190 |
) |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
191 |
{ |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
192 |
return a.alias < b.alias |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
193 |
|| (a.alias == b.alias && a.position < b.position); |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
194 |
} |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
195 |
|
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
196 |
/*****************************************************************************/ |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
197 |
|
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
198 |
Command::ConfigList Command::selectedConfigs(MasterDevice &m) |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
199 |
{ |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
200 |
unsigned int i; |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
201 |
ec_ioctl_master_t master; |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
202 |
ec_ioctl_config_t config; |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
203 |
ConfigList list; |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
204 |
stringstream err; |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
205 |
|
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
206 |
m.getMaster(&master); |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
207 |
|
1157
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
208 |
if (alias == -1) { // no alias given |
1156
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
209 |
if (position == -1) { // no alias and position given |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
210 |
// all items |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
211 |
for (i = 0; i < master.config_count; i++) { |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
212 |
m.getConfig(&config, i); |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
213 |
list.push_back(config); |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
214 |
} |
1157
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
215 |
} else { // no alias, but position given |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
216 |
for (i = 0; i < master.config_count; i++) { |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
217 |
m.getConfig(&config, i); |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
218 |
if (!config.alias && config.position == position) { |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
219 |
list.push_back(config); |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
220 |
break; // there can be at most one matching |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
221 |
} |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
222 |
} |
1156
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
223 |
} |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
224 |
} else { // alias given |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
225 |
if (position == -1) { // alias, but no position given |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
226 |
// take all items with a given alias |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
227 |
for (i = 0; i < master.config_count; i++) { |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
228 |
m.getConfig(&config, i); |
1157
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
229 |
if (config.alias == alias) { |
1156
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
230 |
list.push_back(config); |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
231 |
} |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
232 |
} |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
233 |
} else { // alias and position given |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
234 |
for (i = 0; i < master.config_count; i++) { |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
235 |
m.getConfig(&config, i); |
1157
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
236 |
if (config.alias == alias && config.position == position) { |
1156
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
237 |
list.push_back(config); |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
238 |
break; // there can be at most one matching |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
239 |
} |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
240 |
} |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
241 |
} |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
242 |
} |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
243 |
|
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
244 |
list.sort(); |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
245 |
return list; |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
246 |
} |
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1155
diff
changeset
|
247 |
|
1142 | 248 |
/****************************************************************************/ |
1146
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
249 |
|
1166 | 250 |
Command::DomainList Command::selectedDomains(MasterDevice &m) |
251 |
{ |
|
252 |
ec_ioctl_domain_t d; |
|
253 |
DomainList list; |
|
254 |
||
255 |
if (domain == -1) { |
|
256 |
ec_ioctl_master_t master; |
|
257 |
unsigned int i; |
|
258 |
||
259 |
m.getMaster(&master); |
|
260 |
||
261 |
for (i = 0; i < master.domain_count; i++) { |
|
262 |
m.getDomain(&d, i); |
|
263 |
list.push_back(d); |
|
264 |
} |
|
265 |
} else { |
|
266 |
m.getDomain(&d, domain); |
|
267 |
list.push_back(d); |
|
268 |
} |
|
269 |
||
270 |
return list; |
|
271 |
} |
|
272 |
||
273 |
/****************************************************************************/ |
|
274 |
||
1146
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
275 |
string Command::alStateString(uint8_t state) |
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
276 |
{ |
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
277 |
switch (state) { |
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
278 |
case 1: return "INIT"; |
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
279 |
case 2: return "PREOP"; |
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
280 |
case 4: return "SAFEOP"; |
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
281 |
case 8: return "OP"; |
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
282 |
default: return "???"; |
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
283 |
} |
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
284 |
} |
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
285 |
|
f18d124d7fbc
Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
286 |
/****************************************************************************/ |