xml_configuration_parsing.cpp
Go to the documentation of this file.
1 // Copyright (c) 2021 Pilz GmbH & Co. KG
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU Lesser General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public License
14 // along with this program. If not, see <https://www.gnu.org/licenses/>.
15 
16 #include <tinyxml2.h>
17 #include <fmt/format.h>
18 
21 
23 {
24 namespace configuration
25 {
26 namespace xml_config_parsing
27 {
28 inline const tinyxml2::XMLElement* getFirstChildElement(const tinyxml2::XMLElement* parent, const char* name)
29 {
30  const tinyxml2::XMLElement* child = parent->FirstChildElement(name);
31  if (!child)
32  {
34  fmt::format("Could not parse. Element <{}> is missing a child <{}>.", parent->Name(), name));
35  }
36 
37  return child;
38 }
39 
40 const char* getText(const tinyxml2::XMLElement* element)
41 {
42  const char* element_str = element->GetText();
43  if (element_str == nullptr || strlen(element_str) == 0)
44  {
45  throw XMLConfigurationParserException(fmt::format("Could not parse. <{}> element is empty.", element->Name()));
46  }
47 
48  return element_str;
49 }
50 
51 inline bool textIsEqual(const tinyxml2::XMLElement* element, const char* str)
52 {
53  return strcmp(getText(element), str) == 0;
54 }
55 
56 ZoneSet parseZoneSetMaster(const tinyxml2::XMLElement* xml_set_element)
57 {
58  ZoneSet set;
59 
60  const tinyxml2::XMLElement* xml_set_detail_element = getFirstChildElement(xml_set_element, "zoneSetDetail");
61 
62  while (xml_set_detail_element)
63  {
64  const tinyxml2::XMLElement* xml_set_detail_type_element = getFirstChildElement(xml_set_detail_element, "type");
65  const tinyxml2::XMLElement* xml_set_detail_ro_element = getFirstChildElement(xml_set_detail_element, "ro");
66 
67  if (textIsEqual(xml_set_detail_type_element, "roOSSD1"))
68  {
69  set.safety1_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
70  }
71  else if (textIsEqual(xml_set_detail_type_element, "roOSSD2"))
72  {
73  set.safety2_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
74  }
75  else if (textIsEqual(xml_set_detail_type_element, "roOSSD3"))
76  {
77  set.safety3_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
78  }
79  else if (textIsEqual(xml_set_detail_type_element, "warn1"))
80  {
81  set.warn1_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
82  }
83  else if (textIsEqual(xml_set_detail_type_element, "warn2"))
84  {
85  set.warn2_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
86  }
87  else if (textIsEqual(xml_set_detail_type_element, "muting1"))
88  {
89  set.muting1_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
90  }
91  else if (textIsEqual(xml_set_detail_type_element, "muting2"))
92  {
93  set.muting2_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
94  }
95  else
96  {
97  throw XMLConfigurationParserException("Could not parse. Invalid <type> must be \"roOSSD1\", \"roOSSD2\", "
98  "\"roOSSD3\", \"warn1\", \"warn2\", \"muting1\" or \"muting2\".");
99  }
100  // Move to next <zoneSetDetail>
101  xml_set_detail_element = xml_set_detail_element->NextSiblingElement("zoneSetDetail");
102  }
103 
104  // Set default resolution for now this is only known implicitly
105  set.resolution_ = DEFAULT_ZONESET_ANGLE_STEP;
106 
107  return set;
108 }
109 
110 ZoneSet parseZoneSetSub0(const tinyxml2::XMLElement* xml_set_element, ZoneSet set)
111 {
112  const tinyxml2::XMLElement* xml_set_detail_element = getFirstChildElement(xml_set_element, "zoneSetDetail");
113 
114  while (xml_set_detail_element)
115  {
116  const tinyxml2::XMLElement* xml_set_detail_type_element = getFirstChildElement(xml_set_detail_element, "type");
117  const tinyxml2::XMLElement* xml_set_detail_ro_element = getFirstChildElement(xml_set_detail_element, "ro");
118 
119  if (textIsEqual(xml_set_detail_type_element, "roOSSD1"))
120  {
121  set.safety1_Sub0_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
122  }
123  else if (textIsEqual(xml_set_detail_type_element, "roOSSD2"))
124  {
125  set.safety2_Sub0_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
126  }
127  else if (textIsEqual(xml_set_detail_type_element, "roOSSD3"))
128  {
129  set.safety3_Sub0_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
130  }
131  else if (textIsEqual(xml_set_detail_type_element, "warn1"))
132  {
133  set.warn1_Sub0_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
134  }
135  else if (textIsEqual(xml_set_detail_type_element, "warn2"))
136  {
137  set.warn2_Sub0_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
138  }
139  else if (textIsEqual(xml_set_detail_type_element, "muting1"))
140  {
141  set.muting1_Sub0_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
142  }
143  else if (textIsEqual(xml_set_detail_type_element, "muting2"))
144  {
145  set.muting2_Sub0_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
146  }
147  else
148  {
149  throw XMLConfigurationParserException("Could not parse. Invalid <type> must be \"roOSSD1\", \"roOSSD2\", "
150  "\"roOSSD3\", \"warn1\", \"warn2\", \"muting1\" or \"muting2\".");
151  }
152  // Move to next <zoneSetDetail>
153  xml_set_detail_element = xml_set_detail_element->NextSiblingElement("zoneSetDetail");
154  }
155 
156  // Set default resolution for now this is only known implicitly
157  set.resolution_ = DEFAULT_ZONESET_ANGLE_STEP;
158 
159  return set;
160 }
161 
162 ZoneSet parseZoneSetSub1(const tinyxml2::XMLElement* xml_set_element, ZoneSet set)
163 {
164  const tinyxml2::XMLElement* xml_set_detail_element = getFirstChildElement(xml_set_element, "zoneSetDetail");
165 
166  while (xml_set_detail_element)
167  {
168  const tinyxml2::XMLElement* xml_set_detail_type_element = getFirstChildElement(xml_set_detail_element, "type");
169  const tinyxml2::XMLElement* xml_set_detail_ro_element = getFirstChildElement(xml_set_detail_element, "ro");
170 
171  if (textIsEqual(xml_set_detail_type_element, "roOSSD1"))
172  {
173  set.safety1_Sub1_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
174  }
175  else if (textIsEqual(xml_set_detail_type_element, "roOSSD2"))
176  {
177  set.safety2_Sub1_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
178  }
179  else if (textIsEqual(xml_set_detail_type_element, "roOSSD3"))
180  {
181  set.safety3_Sub1_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
182  }
183  else if (textIsEqual(xml_set_detail_type_element, "warn1"))
184  {
185  set.warn1_Sub1_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
186  }
187  else if (textIsEqual(xml_set_detail_type_element, "warn2"))
188  {
189  set.warn2_Sub1_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
190  }
191  else if (textIsEqual(xml_set_detail_type_element, "muting1"))
192  {
193  set.muting1_Sub1_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
194  }
195  else if (textIsEqual(xml_set_detail_type_element, "muting2"))
196  {
197  set.muting2_Sub1_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
198  }
199  else
200  {
201  throw XMLConfigurationParserException("Could not parse. Invalid <type> must be \"roOSSD1\", \"roOSSD2\", "
202  "\"roOSSD3\", \"warn1\", \"warn2\", \"muting1\" or \"muting2\".");
203  }
204  // Move to next <zoneSetDetail>
205  xml_set_detail_element = xml_set_detail_element->NextSiblingElement("zoneSetDetail");
206  }
207 
208  // Set default resolution for now this is only known implicitly
209  set.resolution_ = DEFAULT_ZONESET_ANGLE_STEP;
210 
211  return set;
212 }
213 
214 ZoneSet parseZoneSetSub2(const tinyxml2::XMLElement* xml_set_element, ZoneSet set)
215 {
216  const tinyxml2::XMLElement* xml_set_detail_element = getFirstChildElement(xml_set_element, "zoneSetDetail");
217 
218  while (xml_set_detail_element)
219  {
220  const tinyxml2::XMLElement* xml_set_detail_type_element = getFirstChildElement(xml_set_detail_element, "type");
221  const tinyxml2::XMLElement* xml_set_detail_ro_element = getFirstChildElement(xml_set_detail_element, "ro");
222 
223  if (textIsEqual(xml_set_detail_type_element, "roOSSD1"))
224  {
225  set.safety1_Sub2_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
226  }
227  else if (textIsEqual(xml_set_detail_type_element, "roOSSD2"))
228  {
229  set.safety2_Sub2_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
230  }
231  else if (textIsEqual(xml_set_detail_type_element, "roOSSD3"))
232  {
233  set.safety3_Sub2_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
234  }
235  else if (textIsEqual(xml_set_detail_type_element, "warn1"))
236  {
237  set.warn1_Sub2_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
238  }
239  else if (textIsEqual(xml_set_detail_type_element, "warn2"))
240  {
241  set.warn2_Sub2_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
242  }
243  else if (textIsEqual(xml_set_detail_type_element, "muting1"))
244  {
245  set.muting1_Sub2_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
246  }
247  else if (textIsEqual(xml_set_detail_type_element, "muting2"))
248  {
249  set.muting2_Sub2_ = ro_string_to_vec(getText(xml_set_detail_ro_element));
250  }
251  else
252  {
253  throw XMLConfigurationParserException("Could not parse. Invalid <type> must be \"roOSSD1\", \"roOSSD2\", "
254  "\"roOSSD3\", \"warn1\", \"warn2\", \"muting1\" or \"muting2\".");
255  }
256  // Move to next <zoneSetDetail>
257  xml_set_detail_element = xml_set_detail_element->NextSiblingElement("zoneSetDetail");
258  }
259 
260  // Set default resolution for now this is only known implicitly
261  set.resolution_ = DEFAULT_ZONESET_ANGLE_STEP;
262 
263  return set;
264 }
265 
266 ZoneSetSpeedRange parseZoneSetSpeedRange(const tinyxml2::XMLElement* xml_zone_set_select_element)
267 {
268  const tinyxml2::XMLElement* xml_zone_set_speed_range_element =
269  getFirstChildElement(xml_zone_set_select_element, "zoneSetSpeedRange");
270 
271  const tinyxml2::XMLElement* xml_zone_set_select_element_min =
272  getFirstChildElement(xml_zone_set_speed_range_element, "minSpeed");
273 
274  const tinyxml2::XMLElement* xml_zone_set_select_element_max =
275  getFirstChildElement(xml_zone_set_speed_range_element, "maxSpeed");
276 
277  unsigned int min_speed, max_speed;
278  if (xml_zone_set_select_element_min->QueryUnsignedText(&min_speed) != tinyxml2::XML_SUCCESS)
279  {
280  throw XMLConfigurationParserException("Could not parse. Value <minSpeed> invalid.");
281  }
282 
283  if (xml_zone_set_select_element_max->QueryUnsignedText(&max_speed) != tinyxml2::XML_SUCCESS)
284  {
285  throw XMLConfigurationParserException("Could not parse. Value <maxSpeed> invalid.");
286  }
287 
288  return ZoneSetSpeedRange(min_speed, max_speed);
289 }
290 
291 bool isEncoderEnabled(const tinyxml2::XMLConstHandle& doc_handle)
292 {
293  const tinyxml2::XMLElement* enc_enabled_element = doc_handle.FirstChildElement("MIB")
294  .FirstChildElement("clusterDescr")
295  .FirstChildElement("zoneSetConfiguration")
296  .FirstChildElement("encEnable")
297  .ToElement();
298  if (!enc_enabled_element)
299  {
301  "Could not parse. Chain MIB->clusterDescr->zoneSetConfiguration->encEnabled is broken.");
302  }
303 
304  bool enc_enabled;
305  if (enc_enabled_element->QueryBoolText(&enc_enabled) != tinyxml2::XML_SUCCESS)
306  {
308  "Could not parse. Value inside <encEnable> could not be evaluated to true or false");
309  }
310 
311  return enc_enabled;
312 }
313 
314 std::vector<ZoneSet> parseZoneSets(const tinyxml2::XMLConstHandle& doc_handle)
315 {
316  std::vector<ZoneSet> zonesets;
317  int nr_subcribers = 0;
318 
319  for (tinyxml2::XMLConstHandle scanner_handle = doc_handle.FirstChildElement("MIB").FirstChildElement("scannerDescr");
320  scanner_handle.ToElement();
321  scanner_handle = scanner_handle.NextSiblingElement("scannerDescr"))
322  {
323  nr_subcribers += 1;
324  }
325 
326  tinyxml2::XMLConstHandle xml_set_info_handle = doc_handle.FirstChildElement("MIB").FirstChildElement("scannerDescr");
327 
328  const tinyxml2::XMLElement* scanner_descr_element_master = xml_set_info_handle.ToElement();
329  const tinyxml2::XMLElement* zone_set_definition_element_master =
330  getFirstChildElement(scanner_descr_element_master, "zoneSetDefinition");
331  const tinyxml2::XMLElement* zone_set_info_element_master =
332  getFirstChildElement(zone_set_definition_element_master, "zoneSetInfo");
333 
334  if (nr_subcribers == 1)
335  {
336  while (zone_set_info_element_master)
337  {
338  ZoneSet set_master = parseZoneSetMaster(zone_set_info_element_master);
339  zonesets.push_back(set_master);
340  zone_set_info_element_master = zone_set_info_element_master->NextSiblingElement("zoneSetInfo");
341  }
342  }
343 
344  else if (nr_subcribers == 2)
345  {
346  const tinyxml2::XMLElement* scanner_descr_element_sub0 =
347  scanner_descr_element_master->NextSiblingElement("scannerDescr");
348  const tinyxml2::XMLElement* zone_set_definition_element_sub0 =
349  getFirstChildElement(scanner_descr_element_sub0, "zoneSetDefinition");
350  const tinyxml2::XMLElement* zone_set_info_element_sub0 =
351  getFirstChildElement(zone_set_definition_element_sub0, "zoneSetInfo");
352  while (zone_set_info_element_master && zone_set_info_element_sub0)
353  {
354  ZoneSet set_master = parseZoneSetMaster(zone_set_info_element_master);
355  ZoneSet set_sub0 = parseZoneSetSub0(zone_set_info_element_sub0, set_master);
356  zonesets.push_back(set_sub0);
357  zone_set_info_element_master = zone_set_info_element_master->NextSiblingElement("zoneSetInfo");
358  zone_set_info_element_sub0 = zone_set_info_element_sub0->NextSiblingElement("zoneSetInfo");
359  }
360  }
361 
362  else if (nr_subcribers == 3)
363  {
364  const tinyxml2::XMLElement* scanner_descr_element_sub0 =
365  scanner_descr_element_master->NextSiblingElement("scannerDescr");
366  const tinyxml2::XMLElement* zone_set_definition_element_sub0 =
367  getFirstChildElement(scanner_descr_element_sub0, "zoneSetDefinition");
368  const tinyxml2::XMLElement* zone_set_info_element_sub0 =
369  getFirstChildElement(zone_set_definition_element_sub0, "zoneSetInfo");
370  const tinyxml2::XMLElement* scanner_descr_element_sub1 =
371  scanner_descr_element_sub0->NextSiblingElement("scannerDescr");
372  const tinyxml2::XMLElement* zone_set_definition_element_sub1 =
373  getFirstChildElement(scanner_descr_element_sub1, "zoneSetDefinition");
374  const tinyxml2::XMLElement* zone_set_info_element_sub1 =
375  getFirstChildElement(zone_set_definition_element_sub1, "zoneSetInfo");
376  while (zone_set_info_element_master && zone_set_info_element_sub0 && zone_set_info_element_sub1)
377  {
378  ZoneSet set_master = parseZoneSetMaster(zone_set_info_element_master);
379  ZoneSet set_sub0 = parseZoneSetSub0(zone_set_info_element_sub0, set_master);
380  ZoneSet set_sub1 = parseZoneSetSub1(zone_set_info_element_sub0, set_sub0);
381  zonesets.push_back(set_sub1);
382  zone_set_info_element_master = zone_set_info_element_master->NextSiblingElement("zoneSetInfo");
383  zone_set_info_element_sub0 = zone_set_info_element_sub0->NextSiblingElement("zoneSetInfo");
384  zone_set_info_element_sub1 = zone_set_info_element_sub1->NextSiblingElement("zoneSetInfo");
385  }
386  }
387  else if (nr_subcribers == 4)
388  {
389  const tinyxml2::XMLElement* scanner_descr_element_sub0 =
390  scanner_descr_element_master->NextSiblingElement("scannerDescr");
391  const tinyxml2::XMLElement* zone_set_definition_element_sub0 =
392  getFirstChildElement(scanner_descr_element_sub0, "zoneSetDefinition");
393  const tinyxml2::XMLElement* zone_set_info_element_sub0 =
394  getFirstChildElement(zone_set_definition_element_sub0, "zoneSetInfo");
395  const tinyxml2::XMLElement* scanner_descr_element_sub1 =
396  scanner_descr_element_sub0->NextSiblingElement("scannerDescr");
397  const tinyxml2::XMLElement* zone_set_definition_element_sub1 =
398  getFirstChildElement(scanner_descr_element_sub1, "zoneSetDefinition");
399  const tinyxml2::XMLElement* zone_set_info_element_sub1 =
400  getFirstChildElement(zone_set_definition_element_sub1, "zoneSetInfo");
401  const tinyxml2::XMLElement* scanner_descr_element_sub2 =
402  scanner_descr_element_sub1->NextSiblingElement("scannerDescr");
403  const tinyxml2::XMLElement* zone_set_definition_element_sub2 =
404  getFirstChildElement(scanner_descr_element_sub2, "zoneSetDefinition");
405  const tinyxml2::XMLElement* zone_set_info_element_sub2 =
406  getFirstChildElement(zone_set_definition_element_sub2, "zoneSetInfo");
407  while (zone_set_info_element_master && zone_set_info_element_sub0 && zone_set_info_element_sub1 &&
408  zone_set_info_element_sub2)
409  {
410  ZoneSet set_master = parseZoneSetMaster(zone_set_info_element_master);
411  ZoneSet set_sub0 = parseZoneSetSub0(zone_set_info_element_sub0, set_master);
412  ZoneSet set_sub1 = parseZoneSetSub1(zone_set_info_element_sub1, set_sub0);
413  ZoneSet set_sub2 = parseZoneSetSub2(zone_set_info_element_sub2, set_sub1);
414  zonesets.push_back(set_sub2);
415  zone_set_info_element_master = zone_set_info_element_master->NextSiblingElement("zoneSetInfo");
416  zone_set_info_element_sub0 = zone_set_info_element_sub0->NextSiblingElement("zoneSetInfo");
417  zone_set_info_element_sub1 = zone_set_info_element_sub1->NextSiblingElement("zoneSetInfo");
418  zone_set_info_element_sub2 = zone_set_info_element_sub2->NextSiblingElement("zoneSetInfo");
419  }
420  }
421  return zonesets;
422 }
423 
424 std::vector<ZoneSetSpeedRange> parseSpeedRanges(const tinyxml2::XMLConstHandle& doc_handle)
425 {
426  const tinyxml2::XMLElement* xml_zone_set_select_element = doc_handle.FirstChildElement("MIB")
427  .FirstChildElement("clusterDescr")
428  .FirstChildElement("zoneSetConfiguration")
429  .FirstChildElement("zoneSetSelCode")
430  .FirstChildElement("zoneSetSelector")
431  .ToElement();
432 
433  if (!xml_zone_set_select_element)
434  {
436  "Could not parse. Chain MIB->clusterDescr->zoneSetConfiguration->zoneSetSelCode->zoneSetSelector is "
437  "broken.");
438  }
439 
440  std::vector<ZoneSetSpeedRange> speed_ranges;
441 
442  while (xml_zone_set_select_element)
443  {
444  ZoneSetSpeedRange speed_range = parseZoneSetSpeedRange(xml_zone_set_select_element);
445  speed_ranges.push_back(speed_range);
446 
447  xml_zone_set_select_element = xml_zone_set_select_element->NextSiblingElement("zoneSetSelector");
448  }
449 
450  return speed_ranges;
451 }
452 
453 ZoneSetConfiguration parseTinyXML(const tinyxml2::XMLDocument& doc)
454 {
455  tinyxml2::XMLConstHandle doc_handle(&doc);
456 
457  std::vector<ZoneSet> zonesets = parseZoneSets(doc_handle);
458 
459  if (isEncoderEnabled(doc_handle))
460  {
461  std::vector<ZoneSetSpeedRange> speed_ranges = parseSpeedRanges(doc_handle);
462 
463  if (zonesets.size() == speed_ranges.size())
464  {
465  for (size_t i = 0; i < zonesets.size(); i++)
466  {
467  zonesets.at(i).speed_range_ = speed_ranges.at(i);
468  }
469  }
470  else
471  {
473  fmt::format("Parsing failed. SpeedRanges are enabled by <encEnable>true</Enable>"
474  "but there are {} speedRanges and {} defined zones.",
475  speed_ranges.size(),
476  zonesets.size()));
477  }
478  }
479 
480  ZoneSetConfiguration zoneset_config;
481 
482  zoneset_config.zonesets_ = zonesets;
483 
484  return zoneset_config;
485 }
486 
487 ZoneSetConfiguration parseFile(const char* filename)
488 {
489  tinyxml2::XMLDocument doc;
490  auto parse_result = doc.LoadFile(filename);
491  if (parse_result != tinyxml2::XML_SUCCESS)
492  {
493  throw XMLConfigurationParserException(fmt::format("Could not parse {}.", filename));
494  }
495 
496  return parseTinyXML(doc);
497 }
498 
500 {
501  tinyxml2::XMLDocument doc;
502  auto parse_result = doc.Parse(xml);
503  if (parse_result != tinyxml2::XML_SUCCESS)
504  {
505  throw XMLConfigurationParserException("Could not parse content.");
506  }
507 
508  return parseTinyXML(doc);
509 }
510 
511 } // namespace xml_config_parsing
512 } // namespace configuration
513 } // namespace psen_scan_v2_standalone
psen_scan_v2_standalone::configuration::xml_config_parsing::parseZoneSets
std::vector< ZoneSet > parseZoneSets(const tinyxml2::XMLConstHandle &doc_handle)
Definition: xml_configuration_parsing.cpp:314
psen_scan_v2_standalone::configuration::ZoneSetConfiguration::zonesets_
std::vector< ZoneSet > zonesets_
Definition: zoneset_configuration.h:29
psen_scan_v2_standalone::configuration::xml_config_parsing::getText
const char * getText(const tinyxml2::XMLElement *element)
Definition: xml_configuration_parsing.cpp:40
psen_scan_v2_standalone::configuration::ZoneSetConfiguration
Definition: zoneset_configuration.h:26
psen_scan_v2_standalone::configuration::xml_config_parsing::XMLConfigurationParserException
Definition: xml_configuration_parsing.h:36
psen_scan_v2_standalone::configuration::xml_config_parsing::parseSpeedRanges
std::vector< ZoneSetSpeedRange > parseSpeedRanges(const tinyxml2::XMLConstHandle &doc_handle)
Definition: xml_configuration_parsing.cpp:424
zoneset_configuration.h
psen_scan_v2_standalone::configuration::xml_config_parsing::parseTinyXML
ZoneSetConfiguration parseTinyXML(const tinyxml2::XMLDocument &doc)
Definition: xml_configuration_parsing.cpp:453
psen_scan_v2_standalone::configuration::xml_config_parsing::parseZoneSetSpeedRange
ZoneSetSpeedRange parseZoneSetSpeedRange(const tinyxml2::XMLElement *xml_zone_set_select_element)
Definition: xml_configuration_parsing.cpp:266
psen_scan_v2_standalone::configuration::xml_config_parsing::parseZoneSetSub2
ZoneSet parseZoneSetSub2(const tinyxml2::XMLElement *xml_set_element, ZoneSet set)
Definition: xml_configuration_parsing.cpp:214
psen_scan_v2_standalone::configuration::xml_config_parsing::isEncoderEnabled
bool isEncoderEnabled(const tinyxml2::XMLConstHandle &doc_handle)
Definition: xml_configuration_parsing.cpp:291
psen_scan_v2_standalone::configuration::xml_config_parsing::textIsEqual
bool textIsEqual(const tinyxml2::XMLElement *element, const char *str)
Definition: xml_configuration_parsing.cpp:51
psen_scan_v2_standalone::configuration::xml_config_parsing::parseFile
ZoneSetConfiguration parseFile(const char *filename)
Definition: xml_configuration_parsing.cpp:487
xml_configuration_parsing.h
set
ROSCPP_DECL void set(const std::string &key, bool b)
psen_scan_v2_standalone::configuration::xml_config_parsing::parseString
ZoneSetConfiguration parseString(const char *xml)
Definition: xml_configuration_parsing.cpp:499
psen_scan_v2_standalone::configuration::xml_config_parsing::parseZoneSetMaster
ZoneSet parseZoneSetMaster(const tinyxml2::XMLElement *xml_set_element)
Definition: xml_configuration_parsing.cpp:56
psen_scan_v2_standalone::configuration::xml_config_parsing::parseZoneSetSub1
ZoneSet parseZoneSetSub1(const tinyxml2::XMLElement *xml_set_element, ZoneSet set)
Definition: xml_configuration_parsing.cpp:162
psen_scan_v2_standalone
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
Definition: udp_client.h:41
psen_scan_v2_standalone::configuration::DEFAULT_ZONESET_ANGLE_STEP
static const util::TenthOfDegree DEFAULT_ZONESET_ANGLE_STEP(5)
psen_scan_v2_standalone::configuration::ZoneSet
A set of simultanously active zones.
Definition: zoneset.h:71
psen_scan_v2_standalone::configuration::xml_config_parsing::getFirstChildElement
const tinyxml2::XMLElement * getFirstChildElement(const tinyxml2::XMLElement *parent, const char *name)
Definition: xml_configuration_parsing.cpp:28
psen_scan_v2_standalone::configuration::xml_config_parsing::parseZoneSetSub0
ZoneSet parseZoneSetSub0(const tinyxml2::XMLElement *xml_set_element, ZoneSet set)
Definition: xml_configuration_parsing.cpp:110
psen_scan_v2_standalone::configuration::ZoneSetSpeedRange
The speedrange at which a ZoneSet is active.
Definition: zoneset.h:44
psen_scan_v2_standalone::configuration::xml_config_parsing::ro_string_to_vec
std::vector< unsigned long > ro_string_to_vec(const std::string &ro_string)
Convert string from a <ro> element to values.
Definition: xml_configuration_parsing.h:74


psen_scan_v2
Author(s): Pilz GmbH + Co. KG
autogenerated on Sat Jun 22 2024 02:46:12