SEPIA
Software documentation for the APEX SEPIA receivers
anritsu.h
Go to the documentation of this file.
1 /* Copyright 2017 Michael Olberg <michael.olberg@chalmers.se> */
2 #ifndef ANRITSU_H
3 #define ANRITSU_H
4 
5 #include <QTcpSocket>
6 #include <QByteArray>
7 #include <QString>
8 
18 class Synthesizer : public QTcpSocket {
19  Q_OBJECT
20 
21  public:
26  {
27  if (syn_instance == 0) syn_instance = new Synthesizer();
28  return syn_instance;
29  }
30 
31  ~Synthesizer();
32  double frequency();
33  double powerLevel();
34  bool isOn() const { return m_on; }
35  void connectToServer();
36  void switchOff();
37 
38  public slots:
39  void restart();
40  void setFrequency(double GHz);
41  void setPowerLevel(double dBm);
42  void powerOn(bool flag);
43 
44  private:
45  static Synthesizer *syn_instance;
46  Synthesizer();
47 
48  QString getResponse();
49  void sendCmd(const QString &command);
50  void dumpBuffer(QByteArray ba) const;
51  bool completed();
52 
53  bool m_on;
54  double m_ghz;
55  double m_dbm;
56 };
57 
58 #endif // ANRITSU_H
double powerLevel()
Read the current power level.
Definition: anritsu.cpp:56
A class to control the Anritsu synthesizer.
Definition: anritsu.h:18
static Synthesizer * instance()
Get a pointer to a class Synthesizer instance.
Definition: anritsu.h:25
double frequency()
Read the current frequency.
Definition: anritsu.cpp:51
void powerOn(bool flag)
Enable/disable signal power.
Definition: anritsu.cpp:83