AwCore
AnyWave core library
AwSensor.h
1 //
3 // Université d’Aix Marseille (AMU) -
4 // Institut National de la Santé et de la Recherche Médicale (INSERM)
5 // Copyright © 2013 AMU, INSERM
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 3 of the License, or (at your option) any later version.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Lesser General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 //
21 //
22 //
23 // Author: Bruno Colombet – Laboratoire UMR INS INSERM 1106 - Bruno.Colombet@univ-amu.fr
24 //
26 #ifndef AW_SENSOR_H
27 #define AW_SENSOR_H
28 
29 class AwChannel;
30 #include <QString>
31 #include <QMetaType>
32 
47 class AwSensor
48 {
49 public:
50  AwSensor();
52  AwSensor(int type);
54  AwSensor(AwSensor *s);
56  AwSensor(AwChannel *channel);
58  inline int type() { return m_type; }
60  inline const QString& label() { return m_label; }
62  inline double *coordinates() { return m_coordinates; }
64  inline double *orientation() { return m_orientation; }
66  inline float value() { return m_scalarValue; }
68  inline bool isBad() { return m_isBad; }
70  inline bool isAlwaysBad() { return m_isAlwaysBad; }
71 
73  void setType(int type) { m_type = type; }
75  void setLabel(const QString& label) { m_label = label; }
77  void setCoordinates(double x, double y, double z);
79  void setCoordinates(double *point);
81  void setOrientation(double ox, double oy, double oz);
83  void setOrientation(double *orientation);
85  void setValue(float value) { m_scalarValue = value; }
87  void setBad(bool bad = true) { m_isBad = bad; }
88  void setAlwaysBad(bool flag = true) { m_isAlwaysBad = true; m_isBad = true; }
89 protected:
90  int m_type;
91  QString m_label;
92  double m_coordinates[3];
93  double m_orientation[3];
94  bool m_isBad;
95  bool m_isAlwaysBad;
96  float m_scalarValue;
97 };
98 Q_DECLARE_METATYPE(AwSensor *);
99 typedef QList<AwSensor *> AwSensorList;
100 
101 #endif
void setLabel(const QString &label)
Definition: AwSensor.h:75
const QString & label()
Definition: AwSensor.h:60
bool isAlwaysBad()
Definition: AwSensor.h:70
float value()
Definition: AwSensor.h:66
AwSensor describes physical properties for a sensor.
Definition: AwSensor.h:47
double * orientation()
Definition: AwSensor.h:64
void setOrientation(double ox, double oy, double oz)
Definition: AwSensor.cpp:94
void setBad(bool bad=true)
Definition: AwSensor.h:87
int type()
Definition: AwSensor.h:58
bool isBad()
Definition: AwSensor.h:68
void setValue(float value)
Definition: AwSensor.h:85
This class defines the AwChannel object.
Definition: AwChannel.h:50
void setType(int type)
Definition: AwSensor.h:73
void setCoordinates(double x, double y, double z)
Definition: AwSensor.cpp:80
double * coordinates()
Definition: AwSensor.h:62