OpenIndy-Core  0.2.0.43
lasertracker.h
Go to the documentation of this file.
1 #ifndef LASERTRACKER_H
2 #define LASERTRACKER_H
3 
4 #include "sensor.h"
5 
6 namespace oi{
7 
12 {
13  Q_OBJECT
14 
15 public:
16  explicit LaserTracker(QObject *parent = 0) : Sensor(parent){}
17 
18  virtual ~LaserTracker(){}
19 
20  //##########################################
21  //calls the appropriate laser tracker method
22  //##########################################
23 
24  bool accept(const SensorFunctions &method, const SensorAttributes &sAttr){
25 
26  switch(method){
27  case(eMoveAngle):
28  return this->move(sAttr.moveAzimuth, sAttr.moveZenith, sAttr.moveDistance, sAttr.moveIsRelative);
29  case(eMoveXYZ):
30  return this->move(sAttr.moveX, sAttr.moveY, sAttr.moveZ);
31  case(eInitialize):
32  return this->initialize();
33  case(eHome):
34  return this->home();
35  case(eToggleSight):
36  return this->toggleSightOrientation();
37  case(eMotorState):
38  return this->changeMotorState();
39  case(eCompensation):
40  return this->compensation();
41  }
42  return false;
43 
44  }
45 
46 protected:
47 
48  //#####################
49  //laser tracker methods
50  //#####################
51 
56  virtual bool initialize(){
57  emit this->sensorMessage(QString("Laser Tracker not implemented correctly: initialization method missing"), eCriticalMessage, eMessageBoxMessage);
58  return false;
59  }
60 
69  virtual bool move(const double &azimuth, const double &zenith, const double &distance, const bool &isRelative){
70  emit this->sensorMessage(QString("Laser Tracker not implemented correctly: move method missing"), eCriticalMessage, eMessageBoxMessage);
71  return false;
72  }
73 
81  virtual bool move(const double &x, const double &y, const double &z){
82  emit this->sensorMessage(QString("Laser Tracker not implemented correctly: move method missing"), eCriticalMessage, eMessageBoxMessage);
83  return false;
84  }
85 
90  virtual bool home(){
91  emit this->sensorMessage(QString("Laser Tracker not implemented correctly: home method missing"), eCriticalMessage, eMessageBoxMessage);
92  return false;
93  }
94 
99  virtual bool changeMotorState(){
100  emit this->sensorMessage(QString("Laser Tracker not implemented correctly: motor state method missing"), eCriticalMessage, eMessageBoxMessage);
101  return false;
102  }
103 
108  virtual bool toggleSightOrientation(){
109  emit this->sensorMessage(QString("Laser Tracker not implemented correctly: toggle sight method missing"), eCriticalMessage, eMessageBoxMessage);
110  return false;
111  }
112 
117  virtual bool compensation(){
118  emit this->sensorMessage(QString("Laser Tracker not implemented correctly: compensation method missing"), eCriticalMessage, eMessageBoxMessage);
119  return false;
120  }
121 
122 };
123 
124 }
125 
126 #ifndef STR
127 #define STR(x) #x
128 #endif
129 #ifndef STR2
130 #define STR2(x) STR(x)
131 #endif
132 
133 #ifndef CONCAT
134 #define CONCAT(a, b) a ## b
135 #endif
136 #ifndef CONCAT2
137 #define CONCAT2(a, b) CONCAT(a, b)
138 #endif
139 
140 #define LASERTRACKER_PREFIX de.openIndy.plugin.sensor.laserTracker.v
141 #define LaserTracker_iidd STR2(CONCAT2(LASERTRACKER_PREFIX, PLUGIN_INTERFACE_VERSION))
142 
143 #endif // LASERTRACKER_H
double moveY
Definition: sensor.h:31
virtual bool changeMotorState()
changeMotorState
Definition: lasertracker.h:99
virtual bool toggleSightOrientation()
toggleSightOrientation
Definition: lasertracker.h:108
The LaserTracker class.
Definition: lasertracker.h:11
double moveX
Definition: sensor.h:30
bool accept(const SensorFunctions &method, const SensorAttributes &sAttr)
Sensor::accept Calls the appropriate internal sensor method.
Definition: lasertracker.h:24
Definition: types.h:415
Definition: coordinatesystem.h:15
double moveZ
Definition: sensor.h:32
virtual ~LaserTracker()
Definition: lasertracker.h:18
The SensorAttributes class.
Definition: sensor.h:24
Definition: types.h:418
Definition: types.h:419
bool moveIsRelative
Definition: sensor.h:29
double moveAzimuth
Definition: sensor.h:26
Definition: types.h:33
virtual bool initialize()
initialize
Definition: lasertracker.h:56
Definition: types.h:414
The Sensor class.
Definition: sensor.h:43
virtual bool move(const double &azimuth, const double &zenith, const double &distance, const bool &isRelative)
move
Definition: lasertracker.h:69
Definition: types.h:416
virtual bool move(const double &x, const double &y, const double &z)
move
Definition: lasertracker.h:81
virtual bool home()
home
Definition: lasertracker.h:90
double moveDistance
Definition: sensor.h:28
Definition: types.h:420
virtual bool compensation()
compensation
Definition: lasertracker.h:117
LaserTracker(QObject *parent=0)
Definition: lasertracker.h:16
SensorFunctions
Definition: types.h:412
Definition: types.h:417
#define OI_CORE_EXPORT
Definition: types.h:11
double moveZenith
Definition: sensor.h:27
Definition: types.h:39