Measurement.cpp
Go to the documentation of this file.
1 //
2 // Measurement.cpp
3 //
4 // Defines a very basic measurement and its list
5 //
6 // Copyright (c) Sick AG
7 // created: 31.05.2010
8 //
9 // HISTORY
10 //
11 // 1.0.0 31.05.2010, VWi
12 // Initial version.
13 
14 
15 #include <string> // for std::string
16 #include <vector> // for std::vector
17 #include "Measurement.hpp"
18 #include "../tools/toolbox.hpp"
19 
20 namespace datatypes
21 {
22 
23 //
24 // Returns the type as a readable string.
25 //
26 std::string Measurement::getName() const
27 {
28  std::string name;
29 
30  switch (m_measType)
31  {
32  case Meastype_Unknown:
33  name = "Unknown";
34  break;
36  name = "Brightness";
37  break;
39  name = "DeviceName";
40  break;
42  name = "DeviceVersion";
43  break;
44  case Meastype_ScanFreq:
45  name = "ScanFreq";
46  break;
48  name = "ScanResolution";
49  break;
51  name = "ScanStartAngle";
52  break;
54  name = "ScanStopAngle";
55  break;
56  default:
57  name = "(uninitialized)";
58  }
59 
60  return name;
61 }
62 
63 //
64 // Returns the value as a readable string.
65 //
66 std::string Measurement::valueToString() const
67 {
68  std::string value;
69 
70  switch (m_measType)
71  {
72  case Meastype_Unknown:
73  value = "Unknown";
74  break;
77  value = m_textValue;
78  break;
79  case Meastype_ScanFreq:
83  value = ::toString(m_doubleValue, 8);
84  break;
85  default:
86  value = "(uninitialized)";
87  }
88 
89  return value;
90 }
91 
92 
93 } // namespace datatypes
std::string valueToString() const
Definition: Measurement.cpp:66
std::string toString(const PositionWGS84::PositionWGS84SourceType &type)
MeasurementType m_measType
Definition: Measurement.hpp:57
std::string getName() const
Definition: Measurement.cpp:26


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Mon Oct 26 2020 03:27:30