OpenIndy-Core  0.2.0.43
sensorcontrol.h
Go to the documentation of this file.
1 #ifndef SENSORCONTROL_H
2 #define SENSORCONTROL_H
3 
4 #include <QObject>
5 #include <QPointer>
6 #include <QThread>
7 #include <QMutex>
8 #include <QTime>
9 
10 #include "sensor.h"
11 #include "measurementconfig.h"
12 
13 class ProjectExchanger;
14 
15 namespace oi{
16 
17 class Station;
18 class SensorListener;
19 
24 class OI_CORE_EXPORT SensorControl : public QObject
25 {
26  friend class ProjectExchanger;
27  Q_OBJECT
28 
29 public:
30  SensorControl(QPointer<Station> &station, QObject *parent = 0);
31 
32  ~SensorControl();
33 
34 public slots:
35 
36  //####################################
37  //get or set sensor control attributes
38  //####################################
39 
40  const QPointer<Sensor> &getSensor() const;
41  void setSensor(const QPointer<Sensor> &sensor);
42  void resetSensor();
43 
44  const QList<QPointer<Sensor> > &getUsedSensors() const;
45 
46  const QPointer<SensorListener> getSensorListener() const;
47 
48  void setStreamFormat(ReadingTypes streamFormat);
49 
50  //################################
51  //get information about the sensor
52  //################################
53 
54  bool getIsSensorConnected();
55  bool getIsReadyForMeasurement();
56  bool getIsBusy();
57 
58  QMap<QString, QString> getSensorStatus();
59 
60  //####################
61  //start sensor actions
62  //####################
63 
64  void connectSensor();
65  void disconnectSensor();
66 
67  void measure(const int &geomId, const MeasurementConfig &mConfig);
68 
69  void move(const double &azimuth, const double &zenith, const double &distance, const bool &isRelative,
70  const bool &measure, const int &geomId = -1, const MeasurementConfig &mConfig = MeasurementConfig());
71  void move(const double &x, const double &y, const double &z,
72  const bool &measure, const int &geomId = -1, const MeasurementConfig &mConfig = MeasurementConfig());
73  void initialize();
74  void motorState();
75  void home();
76  void toggleSight();
77  void compensation();
78  void selfDefinedAction(const QString &action);
79 
80 signals:
81 
82  //##############################################
83  //signals emitted after sensor actions were done
84  //##############################################
85 
86  void commandFinished(const bool &success, const QString &msg);
87  void measurementFinished(const int &geomId, const QList<QPointer<Reading> > &readings);
88 
89 private:
90 
91  //#################################
92  //general sensor control attributes
93  //#################################
94 
95  QPointer<Station> station;
96 
97  QPointer<Sensor> sensor;
98  QList<QPointer<Sensor> > usedSensors;
99 
100  QPointer<SensorListener> sensorListener;
101  QThread listenerThread;
102 
103  QMutex locker;
104 
105 };
106 
107 }
108 
109 #endif // SENSORCONTROL_H
ReadingTypes
Definition: types.h:203
Definition: coordinatesystem.h:15
The MeasurementConfig class Contains all the configuration parameters needed to start a measurement...
Definition: measurementconfig.h:15
The SensorControl class A sensor control object belongs to a station and executes all sensor actions ...
Definition: sensorcontrol.h:24
#define OI_CORE_EXPORT
Definition: types.h:11