author | Florian Pose <fp@igh-essen.com> |
Wed, 05 Nov 2008 13:41:56 +0000 | |
branch | stable-1.4 |
changeset 1669 | 9edbe472941d |
parent 1188 | 3b4e82d9904b |
child 1254 | c19d273a9e76 |
child 1686 | e206f4485f60 |
permissions | -rw-r--r-- |
1142 | 1 |
/***************************************************************************** |
2 |
* |
|
3 |
* $Id$ |
|
4 |
* |
|
5 |
****************************************************************************/ |
|
6 |
||
7 |
#include <list> |
|
8 |
#include <iostream> |
|
9 |
#include <iomanip> |
|
10 |
#include <sstream> |
|
11 |
using namespace std; |
|
12 |
||
13 |
#include "CommandConfig.h" |
|
14 |
#include "byteorder.h" |
|
15 |
||
16 |
/*****************************************************************************/ |
|
17 |
||
18 |
CommandConfig::CommandConfig(): |
|
19 |
Command("config", "Show slave configurations.") |
|
20 |
{ |
|
21 |
} |
|
22 |
||
23 |
/*****************************************************************************/ |
|
24 |
||
25 |
string CommandConfig::helpString() const |
|
26 |
{ |
|
27 |
stringstream str; |
|
28 |
||
1144
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
29 |
str << getName() << " [OPTIONS]" << endl |
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
30 |
<< endl |
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
31 |
<< getBriefDescription() << endl |
1142 | 32 |
<< endl |
33 |
<< "Without the --verbose option, slave configurations are" << endl |
|
34 |
<< "output one-per-line. Example:" << endl |
|
35 |
<< endl |
|
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
36 |
<< "1001:0 0x0000003b/0x02010000 3 OP" << endl |
1142 | 37 |
<< "| | | |" << endl |
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
38 |
<< "| | | \\- Application-layer" << endl |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
39 |
<< "| | | state of the attached" << endl |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
40 |
<< "| | | slave, or '-', if no" << endl |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
41 |
<< "| | | slave is attached." << endl |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
42 |
<< "| | \\- Absolute decimal ring" << endl |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
43 |
<< "| | position of the attached" << endl |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
44 |
<< "| | slave, or '-' if none" << endl |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
45 |
<< "| | attached." << endl |
1157
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
46 |
<< "| \\- Expected vendor ID and product code (both" << endl |
1144
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
47 |
<< "| hexadecimal)." << endl |
1157
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
48 |
<< "\\- Alias address and relative position (both decimal)." << endl |
1142 | 49 |
<< endl |
50 |
<< "With the --verbose option given, the configured Pdos and" << endl |
|
1144
7dbfdd61812c
Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents:
1142
diff
changeset
|
51 |
<< "Sdos are output in addition." << endl |
1157
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
52 |
<< endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
53 |
<< "Configuration selection:" << endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
54 |
<< " Slave configurations can be selected with" << endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
55 |
<< " the --alias and --position parameters as follows:" << endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
56 |
<< endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
57 |
<< " 1) If neither the --alias nor the --position option" << endl |
1167 | 58 |
<< " is given, all slave configurations are displayed." << endl |
1157
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
59 |
<< " 2) If only the --position option is given, an alias" << endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
60 |
<< " of zero is assumed (see 4))." << endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
61 |
<< " 3) If only the --alias option is given, all slave" << endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
62 |
<< " configurations with the given alias address" << endl |
1167 | 63 |
<< " are displayed." << endl |
1157
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
64 |
<< " 4) If both the --alias and the --position option are" << endl |
1167 | 65 |
<< " given, the selection can match a single" << endl |
66 |
<< " configuration, that is displayed, if it exists." << endl |
|
1142 | 67 |
<< endl |
68 |
<< "Command-specific options:" << endl |
|
1157
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
69 |
<< " --alias -a <alias> Configuration alias (see above)." << endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
70 |
<< " --position -p <pos> Relative position (see above)." << endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
71 |
<< " --verbose -v Show detailed configurations." << endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
72 |
<< endl |
04d1c950cf9d
Added --help for alias and position parameters.
Florian Pose <fp@igh-essen.com>
parents:
1156
diff
changeset
|
73 |
<< numericInfo(); |
1142 | 74 |
|
75 |
return str.str(); |
|
76 |
} |
|
77 |
||
78 |
/*****************************************************************************/ |
|
79 |
||
80 |
/** Lists the bus configuration. |
|
81 |
*/ |
|
82 |
void CommandConfig::execute(MasterDevice &m, const StringVector &args) |
|
83 |
{ |
|
1156
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1148
diff
changeset
|
84 |
ConfigList configs; |
1142 | 85 |
|
86 |
m.open(MasterDevice::Read); |
|
1156
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1148
diff
changeset
|
87 |
configs = selectedConfigs(m); |
1142 | 88 |
|
89 |
if (getVerbosity() == Verbose) { |
|
1156
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1148
diff
changeset
|
90 |
showDetailedConfigs(m, configs); |
1142 | 91 |
} else { |
1156
ecaf2a896ea3
Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents:
1148
diff
changeset
|
92 |
listConfigs(m, configs); |
1142 | 93 |
} |
94 |
} |
|
95 |
||
96 |
/*****************************************************************************/ |
|
97 |
||
98 |
/** Lists the complete bus configuration. |
|
99 |
*/ |
|
100 |
void CommandConfig::showDetailedConfigs( |
|
101 |
MasterDevice &m, |
|
102 |
const ConfigList &configList |
|
103 |
) |
|
104 |
{ |
|
105 |
ConfigList::const_iterator configIter; |
|
106 |
unsigned int j, k, l; |
|
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
107 |
ec_ioctl_slave_t slave; |
1142 | 108 |
ec_ioctl_config_pdo_t pdo; |
109 |
ec_ioctl_config_pdo_entry_t entry; |
|
110 |
ec_ioctl_config_sdo_t sdo; |
|
111 |
||
112 |
for (configIter = configList.begin(); |
|
113 |
configIter != configList.end(); |
|
114 |
configIter++) { |
|
115 |
||
116 |
cout << "Alias: " |
|
117 |
<< dec << configIter->alias << endl |
|
118 |
<< "Position: " << configIter->position << endl |
|
119 |
<< "Vendor Id: 0x" |
|
120 |
<< hex << setfill('0') |
|
121 |
<< setw(8) << configIter->vendor_id << endl |
|
122 |
<< "Product code: 0x" |
|
123 |
<< setw(8) << configIter->product_code << endl |
|
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
124 |
<< "Attached slave: "; |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
125 |
|
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
126 |
if (configIter->slave_position != -1) { |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
127 |
m.getSlave(&slave, configIter->slave_position); |
1172
74ee632c3b5e
Fixed attached slave position in 'ethercat config' -> decimal.
Florian Pose <fp@igh-essen.com>
parents:
1167
diff
changeset
|
128 |
cout << dec << configIter->slave_position |
1148
1762296870bd
Renamed state field to al_state.
Florian Pose <fp@igh-essen.com>
parents:
1147
diff
changeset
|
129 |
<< " (" << alStateString(slave.al_state) << ")" << endl; |
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
130 |
} else { |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
131 |
cout << "none" << endl; |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
132 |
} |
1142 | 133 |
|
134 |
for (j = 0; j < EC_MAX_SYNC_MANAGERS; j++) { |
|
135 |
if (configIter->syncs[j].pdo_count) { |
|
136 |
cout << "SM" << dec << j << " (" |
|
137 |
<< (configIter->syncs[j].dir == EC_DIR_INPUT |
|
138 |
? "Input" : "Output") << ")" << endl; |
|
139 |
for (k = 0; k < configIter->syncs[j].pdo_count; k++) { |
|
140 |
m.getConfigPdo(&pdo, configIter->config_index, j, k); |
|
141 |
||
1188
3b4e82d9904b
Don't show Pdo (entry) names in configuration output.
Florian Pose <fp@igh-essen.com>
parents:
1172
diff
changeset
|
142 |
cout << " Pdo 0x" << hex << setw(4) << pdo.index << endl; |
1142 | 143 |
|
144 |
for (l = 0; l < pdo.entry_count; l++) { |
|
145 |
m.getConfigPdoEntry(&entry, |
|
146 |
configIter->config_index, j, k, l); |
|
147 |
||
1188
3b4e82d9904b
Don't show Pdo (entry) names in configuration output.
Florian Pose <fp@igh-essen.com>
parents:
1172
diff
changeset
|
148 |
cout << " Pdo entry 0x" << hex << setfill('0') |
1142 | 149 |
<< setw(4) << entry.index << ":" |
150 |
<< setw(2) << (unsigned int) entry.subindex |
|
1188
3b4e82d9904b
Don't show Pdo (entry) names in configuration output.
Florian Pose <fp@igh-essen.com>
parents:
1172
diff
changeset
|
151 |
<< ", " << dec << setfill(' ') |
3b4e82d9904b
Don't show Pdo (entry) names in configuration output.
Florian Pose <fp@igh-essen.com>
parents:
1172
diff
changeset
|
152 |
<< setw(2) << (unsigned int) entry.bit_length |
3b4e82d9904b
Don't show Pdo (entry) names in configuration output.
Florian Pose <fp@igh-essen.com>
parents:
1172
diff
changeset
|
153 |
<< " bit" << endl; |
1142 | 154 |
} |
155 |
} |
|
156 |
} |
|
157 |
} |
|
158 |
||
159 |
cout << "Sdo configuration:" << endl; |
|
160 |
if (configIter->sdo_count) { |
|
161 |
for (j = 0; j < configIter->sdo_count; j++) { |
|
162 |
m.getConfigSdo(&sdo, configIter->config_index, j); |
|
163 |
||
164 |
cout << " 0x" |
|
165 |
<< hex << setfill('0') |
|
166 |
<< setw(4) << sdo.index << ":" |
|
167 |
<< setw(2) << (unsigned int) sdo.subindex |
|
168 |
<< ", " << dec << sdo.size << " byte: " << hex; |
|
169 |
||
170 |
switch (sdo.size) { |
|
171 |
case 1: |
|
172 |
cout << "0x" << setw(2) |
|
173 |
<< (unsigned int) *(uint8_t *) &sdo.data; |
|
174 |
break; |
|
175 |
case 2: |
|
176 |
cout << "0x" << setw(4) |
|
177 |
<< le16tocpu(*(uint16_t *) &sdo.data); |
|
178 |
break; |
|
179 |
case 4: |
|
180 |
cout << "0x" << setw(8) |
|
181 |
<< le32tocpu(*(uint32_t *) &sdo.data); |
|
182 |
break; |
|
183 |
default: |
|
184 |
cout << "???"; |
|
185 |
} |
|
186 |
||
187 |
cout << endl; |
|
188 |
} |
|
189 |
} else { |
|
190 |
cout << " None." << endl; |
|
191 |
} |
|
192 |
||
193 |
cout << endl; |
|
194 |
} |
|
195 |
} |
|
196 |
||
197 |
/*****************************************************************************/ |
|
198 |
||
199 |
/** Lists the bus configuration. |
|
200 |
*/ |
|
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
201 |
void CommandConfig::listConfigs( |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
202 |
MasterDevice &m, |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
203 |
const ConfigList &configList |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
204 |
) |
1142 | 205 |
{ |
206 |
ConfigList::const_iterator configIter; |
|
207 |
stringstream str; |
|
208 |
Info info; |
|
209 |
typedef list<Info> InfoList; |
|
210 |
InfoList list; |
|
211 |
InfoList::const_iterator iter; |
|
212 |
unsigned int maxAliasWidth = 0, maxPosWidth = 0, |
|
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
213 |
maxSlavePosWidth = 0, maxStateWidth = 0; |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
214 |
ec_ioctl_slave_t slave; |
1142 | 215 |
|
216 |
for (configIter = configList.begin(); |
|
217 |
configIter != configList.end(); |
|
218 |
configIter++) { |
|
219 |
||
220 |
str << dec << configIter->alias; |
|
221 |
info.alias = str.str(); |
|
222 |
str.clear(); |
|
223 |
str.str(""); |
|
224 |
||
225 |
str << configIter->position; |
|
226 |
info.pos = str.str(); |
|
227 |
str.clear(); |
|
228 |
str.str(""); |
|
229 |
||
230 |
str << hex << setfill('0') |
|
231 |
<< "0x" << setw(8) << configIter->vendor_id |
|
232 |
<< "/0x" << setw(8) << configIter->product_code; |
|
233 |
info.ident = str.str(); |
|
234 |
str.clear(); |
|
235 |
str.str(""); |
|
236 |
||
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
237 |
if (configIter->slave_position != -1) { |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
238 |
m.getSlave(&slave, configIter->slave_position); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
239 |
|
1172
74ee632c3b5e
Fixed attached slave position in 'ethercat config' -> decimal.
Florian Pose <fp@igh-essen.com>
parents:
1167
diff
changeset
|
240 |
str << dec << configIter->slave_position; |
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
241 |
info.slavePos = str.str(); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
242 |
str.clear(); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
243 |
str.str(""); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
244 |
|
1148
1762296870bd
Renamed state field to al_state.
Florian Pose <fp@igh-essen.com>
parents:
1147
diff
changeset
|
245 |
str << alStateString(slave.al_state); |
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
246 |
info.state = str.str(); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
247 |
str.clear(); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
248 |
str.str(""); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
249 |
} else { |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
250 |
str << "-"; |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
251 |
info.slavePos = str.str(); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
252 |
str.clear(); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
253 |
str.str(""); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
254 |
|
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
255 |
str << "-"; |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
256 |
info.state = str.str(); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
257 |
str.clear(); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
258 |
str.str(""); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
259 |
} |
1142 | 260 |
|
261 |
list.push_back(info); |
|
262 |
||
263 |
if (info.alias.length() > maxAliasWidth) |
|
264 |
maxAliasWidth = info.alias.length(); |
|
265 |
if (info.pos.length() > maxPosWidth) |
|
266 |
maxPosWidth = info.pos.length(); |
|
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
267 |
if (info.slavePos.length() > maxSlavePosWidth) |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
268 |
maxSlavePosWidth = info.slavePos.length(); |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
269 |
if (info.state.length() > maxStateWidth) |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
270 |
maxStateWidth = info.state.length(); |
1142 | 271 |
} |
272 |
||
273 |
for (iter = list.begin(); iter != list.end(); iter++) { |
|
274 |
cout << setfill(' ') << right |
|
275 |
<< setw(maxAliasWidth) << iter->alias |
|
276 |
<< ":" << left |
|
277 |
<< setw(maxPosWidth) << iter->pos |
|
278 |
<< " " |
|
279 |
<< iter->ident |
|
280 |
<< " " |
|
1147
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
281 |
<< setw(maxSlavePosWidth) << iter->slavePos << " " |
0eac1ee8512a
Show attached slave position and state in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents:
1144
diff
changeset
|
282 |
<< setw(maxStateWidth) << iter->state << " " |
1142 | 283 |
<< endl; |
284 |
} |
|
285 |
} |
|
286 |
||
287 |
/*****************************************************************************/ |