SEPIA
Software documentation for the APEX SEPIA receivers
mixer.h
1 /* Copyright 2017 Michael Olberg <michael.olberg@chalmers.se> */
2 #ifndef MIXER_H
3 #define MIXER_H
4 
5 #include <QWidget>
6 // #include <QGroupBox>
7 #include <QString>
8 #include <QLabel>
9 #include <QDoubleSpinBox>
10 #include <QVariantList>
11 
12 #include "../units.h"
13 #include "../constants.h"
14 #include "../property.h"
15 #include "propertycontrol.h"
16 
17 class MixerElement : public QWidget
18 {
19  Q_OBJECT
20  Q_PROPERTY(double bias READ bias WRITE setCmdBias)
21  Q_PROPERTY(double current READ current)
22  Q_PROPERTY(double coil READ coilCurrent WRITE setCmdCoil)
23  Q_PROPERTY(bool tuned READ isTuned)
24  Q_PROPERTY(bool expertMode READ expertMode WRITE setExpertMode)
25 
26 public:
27  explicit MixerElement(Mixer::Polarization pol, Mixer::Element sis, QWidget *parent = 0);
28 
29  double bias() const { return biasCtrl->actualValue()*Units::mV; }
30  double current() const { return m_current; }
31  double coilCurrent() const { return coilCtrl->actualValue()*Units::mA; }
32  bool isTuned() const { return m_tuned; }
33  bool expertMode() const { return m_expert; }
34 
35  public slots:
36  void updateBias(double V);
37  void setCmdBias(double mV);
38  void updateCoil(double mA);
39  void setCmdCoil(double mA);
40  void updateCurrent(double I);
41  void updatePower(double mW);
42  void setExpertMode(bool flag);
43 
44  signals:
45  void demagnetizeMixer(Mixer::Polarization pol, Mixer::Element sis);
46 
47  private:
48  PropertyControl *biasCtrl;
49  PropertyControl *coilCtrl;
50  QLabel *currentLabel;
51  QLabel *powerLabel;
52 
53  const Mixer::Polarization m_pol;
54  const Mixer::Element m_sis;
55  double m_current;
56  double m_power;
57  bool m_tuned;
58  bool m_expert;
59 };
60 
61 #endif // MIXER_H
Polarization
An enumeration for the two polarizations.
Definition: constants.h:9
Element
An enumeration for the two mixer elements in each polarization.
Definition: constants.h:17
static const double mV
Definition: units.h:12
static const double mA
Definition: units.h:13