SEPIA
Software documentation for the APEX SEPIA receivers
scpirequest.h
Go to the documentation of this file.
1 /* Copyright 2017 Michael Olberg <michael.olberg@chalmers.se> */
2 #ifndef SCPIREQUEST_H
3 #define SCPIREQUEST_H
4 
5 #include <QHostAddress>
6 #include <QString>
7 #include <QList>
8 #include <QVariant>
9 #include <QRunnable>
10 
11 #include <time.h>
12 #include "../constants.h"
13 
18 class SEPIA;
19 class Controller;
20 
25 class ScpiRequest : public QObject, public QRunnable
26 {
27  Q_OBJECT
28 
29  public:
30  enum Method { Init, Shutdown, Enable, Disable, Reset, TuneSystem, ScanIV };
31  Q_ENUM(Method)
32 
33  explicit ScpiRequest(const QString &msg, QHostAddress host, quint16 port, SEPIA *parent = 0);
34 
35  protected:
36  void run();
37 
38  signals:
39  void propertyChanged(int key, const QVariant &value, int sub);
40  void responseReady(Sepia::Channel band, const QString &cmd, const QHostAddress host, const quint16 port);
41  void startExec(ScpiRequest::Method method, QList<QVariant> params);
42 
43  private:
44  void parse();
45  void exec();
46  void query();
47  void update();
48  void respond();
49  void error(const char *errmsg);
50  void respond(QString str);
51  void append(QString text);
52 
53  int m_channel;
54  Sepia::Channel m_band;
55  int m_subdev;
56  int m_method;
57  int m_property;
58  bool m_commanded;
59  QString msg;
60  const QHostAddress udphost;
61  const quint16 udpport;
62  SEPIA *sepia;
63  Controller *cartridge;
64  bool m_active;
65 };
66 
67 #endif // SCPIREQUEST_H
The main class of the GUI application.
Definition: sepia.h:60
Channel
An enumeration for the three SEPIA channels (cartridges).
Definition: constants.h:66
A class for storing data for a SCPI request coming from APECS.
Definition: scpirequest.h:25