SEPIA
Software documentation for the APEX SEPIA receivers
calunit.h
Go to the documentation of this file.
1 /* Copyright 2017 Michael Olberg <michael.olberg@chalmers.se> */
2 #ifndef CALUNIT_H
3 #define CALUNIT_H
4 
5 #include <QWidget>
6 #include <QSize>
7 #include <qwt_compass.h>
8 
9 #include "statusled.h"
10 #include "../property.h"
11 #include "../constants.h"
12 
21 class CalUnit : public QwtCompass
22 {
23  Q_OBJECT
24  Q_PROPERTY(bool moving READ isMoving WRITE setMoving)
25  Q_PROPERTY(int position READ position)
26 
27  public:
32  MOVING = -1,
33  UNDEFINED = 0,
34  SKYB9 = 1,
35  SKYB7 = 2,
36  SKYB5 = 3,
38  };
39  Q_ENUM(MirrorPosition)
40 
41 
44  static const double mirrorPositions[4];
45 
46  explicit CalUnit(QWidget *parent = 0);
47 
53 
58  bool isMoving() const { return m_moving; }
59 
60  protected:
61  QSize sizeHint() const;
62 
63  public slots:
69 
74  void showMirrorMoved(float pos);
75 
79  void connected() { centerLED->setOn(); }
80 
84  void disconnected() { centerLED->setOff(); }
85 
89  void error() { centerLED->setError(); }
90 
95  void setMoving(bool flag);
96 
100  void positionReached();
101 
102  signals:
108 
109  private:
110  int position() const { return static_cast<int>(chopMode.actual()); }
111 
112  StatusLED *centerLED;
113  bool m_moving;
114 };
115 
116 #endif
the selection mirror allows injection of a test signal (not used).
Definition: calunit.h:37
MirrorPosition
Possible positions for the selection mirror on the calibration unit.
Definition: calunit.h:31
void moveTo(CalUnit::MirrorPosition pos)
Move to a predefined CalUnit::MirrorPosition.
Definition: calunit.cpp:94
the selection mirror couples B5 to sky.
Definition: calunit.h:36
static const double mirrorPositions[4]
known positions in decimal degress: HOME, SKYB9, SKYB7, SKYB5.
Definition: calunit.h:44
the selection mirror is in an undefined position.
Definition: calunit.h:33
the selection mirror couples B7 to sky.
Definition: calunit.h:35
void setMoving(bool flag)
Set internal state to moving/not moving.
Definition: calunit.cpp:76
the selection mirror couples B9 to sky.
Definition: calunit.h:34
void connected()
Indicate that connection is on.
Definition: calunit.h:79
bool isMoving() const
Check if the mirror is moving.
Definition: calunit.h:58
void newCmdPosition(CalUnit::MirrorPosition pos)
Signal the value of the new position.
A class for representing the state of the selection mirror via the GUI.
Definition: calunit.h:21
void error()
Indicate connection error.
Definition: calunit.h:89
A template class representing a device property.
Definition: property.h:20
the selection mirror is moving.
Definition: calunit.h:32
T actual() const
Read the actual value.
Definition: property.h:62
void positionReached()
Set actual position to commanded position.
Definition: calunit.cpp:83
void disconnected()
Indicate that connection is off.
Definition: calunit.h:84
void showMirrorMoved(float pos)
Show the new position of the selection mirror.
Definition: calunit.cpp:54
Property< CalUnit::MirrorPosition > chopMode
The position of the selection mirror.
Definition: calunit.h:52