mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
WIP
This commit is contained in:
@ -20,6 +20,28 @@ class qDefs : public QWidget {
|
||||
|
||||
#define GOODBYE -200
|
||||
|
||||
/** function enums */
|
||||
enum qFuncNames {
|
||||
QF_GET_DETECTOR_STATUS,
|
||||
QF_START_ACQUISITION,
|
||||
QF_STOP_ACQUISITION,
|
||||
QF_START_AND_READ_ALL,
|
||||
QF_EXIT_SERVER,
|
||||
QF_NUM_FUNCTIONS
|
||||
};
|
||||
|
||||
const char* getQFunctionNameFromEnum(enum qFuncNames func) {
|
||||
switch (func) {
|
||||
case QF_GET_DETECTOR_STATUS: return "QF_GET_DETECTOR_STATUS";
|
||||
case QF_START_ACQUISITION: return "QF_START_ACQUISITION";
|
||||
case QF_STOP_ACQUISITION: return "QF_STOP_ACQUISITION";
|
||||
case QF_START_AND_READ_ALL: return "QF_START_AND_READ_ALL";
|
||||
case QF_EXIT_SERVER: return "QF_EXIT_SERVER";
|
||||
case QF_NUM_FUNCTIONS: return "QF_NUM_FUNCTIONS";
|
||||
default: return "Unknown Function";
|
||||
}
|
||||
};
|
||||
|
||||
/** Success or FAIL */
|
||||
enum { OK, FAIL };
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "qDefs.h"
|
||||
#include "ServerSocket.h"
|
||||
class qDetectorMain;
|
||||
|
||||
class multiSlsDetector;
|
||||
class ServerSocket;
|
||||
class ServerInterface;
|
||||
class ServerInterface2;
|
||||
|
||||
#include <vector>
|
||||
#include <future>
|
||||
|
||||
class qServer : public QWidget, public virtual slsDetectorDefs {
|
||||
class qServer : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@ -19,26 +19,24 @@ class qServer : public QWidget, public virtual slsDetectorDefs {
|
||||
|
||||
private:
|
||||
void FunctionTable();
|
||||
void DecodeFunction(ServerSocket *sock);
|
||||
void ShutDownSockets();
|
||||
void ServerThread(ServerSocket* sock);
|
||||
void GetStatus(ServerSocket* sock);
|
||||
void StartAcquisition(ServerSocket* sock);
|
||||
void StopsAcquisition(ServerSocket* sock);
|
||||
void Acquire(ServerSocket* sock);
|
||||
void ExitServer(ServerSocket* sock);
|
||||
|
||||
/** function list */
|
||||
typedef int (qServer::*some_func_t)(ServerSocket*);
|
||||
typedef std::vector<some_func_t> sflist;
|
||||
bool guiServerRunning;
|
||||
bool threadStarted;
|
||||
void DecodeFunction(sls::ServerInterface2 *socket);
|
||||
void ServerThread(bool isControlServer);
|
||||
void GetStatus(sls::ServerInterface2* socket);
|
||||
void StartAcquisition(sls::ServerInterface2* socket);
|
||||
void StopsAcquisition(sls::ServerInterface2* socket);
|
||||
void Acquire(sls::ServerInterface2* socket);
|
||||
void ExitServer(sls::ServerInterface2* socket);
|
||||
|
||||
void (qServer::*flist[qDefs::QF_NUM_FUNCTIONS])(sls::ServerInterface2 &socket);
|
||||
qDetectorMain *mainTab;
|
||||
bool tcpThreadCreated{false};
|
||||
bool killTCPServerThread{false};
|
||||
std::future<void> controlStatus;
|
||||
std::future<void> stopStatus;
|
||||
int controlPort;
|
||||
int stopPort;
|
||||
ServerSocket *controlSocket;
|
||||
ServerSocket *stopSocket;
|
||||
std::unique_ptr<sls::ServerSocket> controlSocket{nullptr};
|
||||
std::unique_ptr<sls::ServerSocket> stopSocket{nullptr};
|
||||
|
||||
signals:
|
||||
// to update the Listening to Gui check box
|
||||
|
Reference in New Issue
Block a user