Measurement.hpp
Go to the documentation of this file.
00001 //
00002 // Measurement.hpp
00003 //
00004 // Defines a very basic measurement structure
00005 // Copyright (c) Sick AG
00006 // created: 31.05.2010
00007 //
00008 // HISTORY
00009 //
00010 // 1.0.0        31.05.2010, VWi
00011 //                      Initial version.
00012 
00013 
00014 #ifndef MEASUREMENT_HPP
00015 #define MEASUREMENT_HPP
00016 
00017 #include <string>       // for std::string
00018 #include <vector>       // for std::vector
00019 #include "../BasicDatatypes.hpp"
00020 
00021 //
00022 // Advanced types
00023 //
00024 enum MeasurementType
00025 {
00026         Meastype_Unknown                                = 0x0000,
00027         
00028         Meastype_Voltage_Supply_Panel   = 0x0001,
00029         Meastype_Temperature_Panel              = 0x0002,
00030         Meastype_Brightness                             = 0x0003,
00031         Meastype_Voltage_Supply_Video   = 0x0004,
00032         Meastype_Sniffpad_Panel                 = 0x0005,
00033         
00034         Meastype_DeviceName                             = 0x0006,
00035         Meastype_DeviceVersion                  = 0x0007,
00036         Meastype_ScanFreq                               = 0x0008,
00037         Meastype_ScanStartAngle                 = 0x0009,
00038         Meastype_ScanStopAngle                  = 0x000A,
00039         Meastype_ScanResolution                 = 0x000B
00040 };
00041 
00042 namespace datatypes
00043 {
00044 
00045 class Measurement
00046 {
00047 public:
00048         Measurement() {m_measType = Meastype_Unknown;};
00049         virtual ~Measurement() {};
00050 
00051         // Estimate the memory usage of this object
00052         inline virtual const UINT32 getUsedMemory() const {return ((sizeof(*this)) + m_textValue.length());};
00053 
00054         std::string getName() const;            // Returns the type as a readable string
00055         std::string valueToString() const;      // Returns the value as a readable string
00056         
00057         MeasurementType m_measType;
00058         
00059 
00060         
00061         double m_doubleValue;
00062         INT32 m_intValue;
00063         std::string m_textValue;
00064 };
00065 
00066 
00067 // -----------------------------------------------
00068 
00069 
00070 class MeasurementList : public BasicData
00071 {
00072 public:
00073 //      MeasurementList():  m_datatype(Datatype_MeasurementList) {}     //  {m_datatype = Datatype_MeasurementList;};
00074         MeasurementList() {m_datatype = Datatype_MeasurementList;};
00075         virtual ~MeasurementList() {};
00076 
00077         // Estimate the memory usage of this object
00078         inline virtual const UINT32 getUsedMemory() const
00079         {
00080                 UINT32 sum = sizeof(*this);
00081                 std::vector<Measurement>::const_iterator iter;
00082                 for (iter = m_list.begin(); iter != m_list.end(); iter++)
00083                 {
00084                         sum += iter->getUsedMemory();
00085                 }
00086                 return sum;
00087         }
00088         
00089         std::vector<Measurement> m_list;
00090 };
00091 
00092 }       // namespace datatypes
00093 
00094 #endif // MEASUREMENT_HPP


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Wed Jun 14 2017 04:04:50