OpenIndy-Core  0.2.0.43
measurementconfig.h
Go to the documentation of this file.
1 #ifndef MEASUREMENTCONFIG_H
2 #define MEASUREMENTCONFIG_H
3 
4 #include <QString>
5 #include <QtXml>
6 
7 #include "types.h"
8 
9 namespace oi{
10 
16 {
17 
18 public:
20 
22 
23  MeasurementConfig &operator=(const MeasurementConfig &copy);
24 
25  friend bool operator==(const MeasurementConfig &left, const MeasurementConfig &right){
26 
27  if(left.getName().compare(right.getName()) == 0){
28  return true;
29  }
30  return false;
31 
32  }
33 
34  //########################################
35  //get or set measurement config attributes
36  //########################################
37 
38  const QString &getName() const;
39  void setName(const QString &name);
40 
41  const bool &getIsSaved() const;
42  void setIsSaved(const bool &isSaved);
43 
44  bool getIsValid() const;
45 
46  const int &getCount() const;
47  void setCount(const int &count);
48 
49  const int &getIterations() const;
50  void setIterations(const int &iterations);
51 
52  const bool &getMeasureTwoSides() const;
53  void setMeasureTwoSides(const bool &measureTwoSides);
54 
55  const bool &getTimeDependent() const;
56  void setTimeDependent(const bool &timeDependent);
57 
58  const bool &getDistanceDependent() const;
59  void setDistanceDependent(const bool &distanceDependent);
60 
61  const long &getTimeInterval() const;
62  void setTimeInterval(const long &interval);
63 
64  const double &getDistanceInterval() const;
65  void setDistanceInterval(const double &interval);
66 
67  const ReadingTypes &getTypeOfReading() const;
68  void setTypeOfReading(const ReadingTypes &type);
69 
70  //#################
71  //save and load XML
72  //#################
73 
74  QDomElement toOpenIndyXML(QDomDocument &xmlDoc) const;
75  bool fromOpenIndyXML(QDomElement &xmlElem);
76 
77 private:
78 
79  //#############################
80  //measurement config attributes
81  //#############################
82 
83  QString name;
84  bool isSaved;
85 
86  int count; //the number of measurements that the sensor shall bring together to a single reading
87  int iterations; //the number of readings the sensor shall return
88  bool measureTwoSides; //true if the sensor shall measure in both faces (false if not)
89  bool timeDependent; //true if the sensor shall measure in a special timeInterval (false if not)
90  bool distanceDependent; //true if the sensor shall measure in a special distanceInterval (false if not)
91  long timeInterval; //time interval in which the sensor shall measure
92  double distanceInterval; //distance interval in which the sensor shall measure
93  ReadingTypes typeOfReading; //the type of reading which the sensor shall return
94 
95 };
96 
97 }
98 
99 Q_DECLARE_METATYPE( oi::MeasurementConfig )
100 Q_DECLARE_METATYPE( oi::MeasurementConfig* )
101 
102 #endif // MEASUREMENTCONFIG_H
ReadingTypes
Definition: types.h:203
Definition: coordinatesystem.h:15
const QString & getName() const
MeasurementConfig::getName.
Definition: measurementconfig.cpp:69
The MeasurementConfig class Contains all the configuration parameters needed to start a measurement...
Definition: measurementconfig.h:15
friend bool operator==(const MeasurementConfig &left, const MeasurementConfig &right)
Definition: measurementconfig.h:25
#define OI_CORE_EXPORT
Definition: types.h:11