SEPIA
Software documentation for the APEX SEPIA receivers
cryocon.h
Go to the documentation of this file.
1 /* Copyright 2017 Michael Olberg <michael.olberg@chalmers.se> */
2 #ifndef CRYOCONTROLLER_H
3 #define CRYOCONTROLLER_H
4 
5 #include <QObject>
6 #include <QUdpSocket>
7 #include <QMutex>
8 
19 class CryoController : public QObject
20 {
21  Q_OBJECT
22  public:
26  enum Channel {
27  A = 0,
28  B = 1,
29  C = 2,
30  D = 3
31  };
32  explicit CryoController(QObject *parent = 0);
33  ~CryoController();
34 
39  bool isConnected();
45  float readTemperature(Channel channel);
51  void configureLoop(Channel channel, float T);
55  void controlLoop();
59  void stopLoop();
60 
61  private:
62  void connectToServer();
63  void closeConnection();
64  int udpSendReceive(QString command, bool interactive = false);
65  void dumpBuffer(QByteArray ba) const;
66  void selectTemperatureUnit(Channel channel, char unit);
67 
68  /* these are private support functions for the public routines above */
69  void dumpBuffer(bool out, char* buf) const;
70 
71  QMutex mutex;
72  QByteArray sendBuffer;
73  QByteArray recvBuffer;
74  QUdpSocket socket;
75  bool _connected; /* flag holding status of communication */
76  int myTimerId;
77 };
78 
79 #endif // CRYOCONTROLLER_H
void configureLoop(Channel channel, float T)
Configure a control loop to keep constant temperature.
Definition: cryocon.cpp:149
110K plate
Definition: cryocon.h:28
bool isConnected()
Check connection.
Definition: cryocon.cpp:82
void controlLoop()
Start temperature control loops.
Definition: cryocon.cpp:191
float readTemperature(Channel channel)
Perform a temperature reading.
Definition: cryocon.cpp:104
4K plate
Definition: cryocon.h:27
15K plate
Definition: cryocon.h:30
void stopLoop()
Stop temperature control loops.
Definition: cryocon.cpp:200
A class to communicate with the Cryo controller.
Definition: cryocon.h:19
Channel
The different temperature channels.
Definition: cryocon.h:26
4K Head Cryocooler
Definition: cryocon.h:29