mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
WIP. removed qServer
This commit is contained in:
@ -12,7 +12,6 @@ class qTabSettings;
|
||||
class qTabDebugging;
|
||||
class qTabDeveloper;
|
||||
class qTabMessages;
|
||||
class qServer;
|
||||
|
||||
class multiSlsDetector;
|
||||
|
||||
@ -35,15 +34,6 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
||||
QWidget *parent = 0);
|
||||
~qDetectorMain();
|
||||
|
||||
/**
|
||||
* Starts or stops Acquisition From gui client
|
||||
* @param start 1 for start and 0 to stop
|
||||
* @returns success or fail
|
||||
*/
|
||||
int StartStopAcquisitionFromClient(bool start);
|
||||
bool isPlotRunning();
|
||||
int GetProgress();
|
||||
|
||||
private slots:
|
||||
void EnableModes(QAction *action);
|
||||
void ExecuteUtilities(QAction *action);
|
||||
@ -57,7 +47,6 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
||||
void ResizeMainWindow(bool b);
|
||||
void EnableTabs();
|
||||
void SetZoomToolTip(bool disable);
|
||||
void UncheckServer();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
@ -92,7 +81,6 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
||||
qTabDebugging* tabDebugging;
|
||||
qTabDeveloper* tabDeveloper;
|
||||
qTabMessages* tabMessages;
|
||||
qServer* myServer;
|
||||
int isDeveloper;
|
||||
int heightPlotWindow;
|
||||
int heightCentralWidget;
|
||||
|
@ -32,14 +32,11 @@ class qDrawPlot : public QWidget {
|
||||
/** Destructor */
|
||||
~qDrawPlot();
|
||||
|
||||
// measurement tab
|
||||
void SetClientInitiated();
|
||||
bool GetClientInitiated();
|
||||
// main
|
||||
bool isRunning();
|
||||
// from measurement tabs
|
||||
int GetProgress();
|
||||
int GetCurrentFrameIndex();
|
||||
int64_t GetCurrentFrameIndex();
|
||||
int64_t GetCurrentMeasurementIndex();
|
||||
// from plot tab
|
||||
void Select1dPlot(bool enable);
|
||||
void SetPlotTitlePrefix(QString title);
|
||||
@ -57,14 +54,7 @@ class qDrawPlot : public QWidget {
|
||||
void SetZRange(bool isZmin, bool isZmax, double zmin, double zmax);
|
||||
void SetDataCallBack(bool enable);
|
||||
void SetBinary(bool enable, int from = 0, int to = 0);
|
||||
|
||||
|
||||
/** Starts or stop acquisition
|
||||
* Calls startDaq() function
|
||||
* @param stop_if_running is 0 to stop acquisition and 1 to start
|
||||
* acquisition
|
||||
*/
|
||||
void StartStopDaqToggle(bool stop_if_running = 0);
|
||||
void StartAcquisition();
|
||||
|
||||
public slots:
|
||||
void SetPersistency(int val);
|
||||
@ -92,13 +82,9 @@ class qDrawPlot : public QWidget {
|
||||
|
||||
|
||||
void UpdatePlot();
|
||||
void StartDaq(bool start);
|
||||
void ShowAcquisitionErrorMessage(QString status);
|
||||
|
||||
signals:
|
||||
void UpdatingPlotFinished();
|
||||
void SetCurrentMeasurementSignal(int);
|
||||
void AcquisitionErrorSignal(QString);
|
||||
void UpdatePlotSignal();
|
||||
|
||||
private:
|
||||
@ -116,11 +102,9 @@ class qDrawPlot : public QWidget {
|
||||
|
||||
|
||||
|
||||
int StartDaqForGui();
|
||||
int StopDaqForGui();
|
||||
|
||||
bool StartOrStopThread(bool start);
|
||||
void SetupMeasurement();
|
||||
int ResetDaqForGui();
|
||||
static void *DataStartAcquireThread(void *this_pointer);
|
||||
static int GetDataCallBack(detectorData *data, int fIndex, int subIndex, void *this_pointer);
|
||||
int GetData(detectorData *data, int fIndex, int subIndex);
|
||||
@ -146,11 +130,8 @@ class qDrawPlot : public QWidget {
|
||||
QGridLayout *plotLayout{nullptr};
|
||||
|
||||
bool is1d{true};
|
||||
bool plotEnable{true};
|
||||
bool plotRequired{false};/**?? */
|
||||
bool running{false};
|
||||
bool isRunning{false};
|
||||
int progress{0};
|
||||
bool clientInitiated{false};
|
||||
|
||||
// titles
|
||||
QString plotTitle{""};
|
||||
@ -210,19 +191,10 @@ class qDrawPlot : public QWidget {
|
||||
double endPixel{0};
|
||||
double pixelWidth{0};
|
||||
|
||||
int currentMeasurement{0};
|
||||
int currentFrame{0};
|
||||
int currentFileIndex{0};
|
||||
int currentFrameIndex{0};
|
||||
pthread_mutex_t lastImageCompleteMutex;
|
||||
unsigned int lastImageNumber{0};
|
||||
int numberofFrames{0};
|
||||
double acquisitionPeriod{0};
|
||||
double exposureTime{0};
|
||||
|
||||
/** prevents err msg displaying twice when detector stopped, "transmitting"
|
||||
*/
|
||||
bool alreadyDisplayed{false};
|
||||
int64_t currentMeasurement{0};
|
||||
int64_t currentFrame{0};
|
||||
int64_t lastImageNumber{0};
|
||||
pthread_mutex_t lastImageCompleteMutex;
|
||||
|
||||
const static int npixelsx_jctb = 400;
|
||||
int npixelsy_jctb{0};
|
||||
|
@ -1,47 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "qDefs.h"
|
||||
#include "ServerSocket.h"
|
||||
class qDetectorMain;
|
||||
class ServerInterface2;
|
||||
|
||||
#include <vector>
|
||||
#include <future>
|
||||
|
||||
class qServer : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
qServer(qDetectorMain *t);
|
||||
~qServer();
|
||||
void CreateServers();
|
||||
void DestroyServers();
|
||||
|
||||
private:
|
||||
void FunctionTable();
|
||||
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);
|
||||
|
||||
signals:
|
||||
// to update the Listening to Gui check box
|
||||
void ServerStoppedSignal();
|
||||
|
||||
private:
|
||||
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;
|
||||
std::unique_ptr<sls::ServerSocket> controlSocket{nullptr};
|
||||
std::unique_ptr<sls::ServerSocket> stopSocket{nullptr};
|
||||
|
||||
|
||||
};
|
@ -15,14 +15,9 @@ public:
|
||||
qTabMeasurement(QWidget *parent, multiSlsDetector* detector, qDrawPlot* plot);
|
||||
~qTabMeasurement();
|
||||
|
||||
bool GetStartStatus();
|
||||
void ClentStartAcquisition();
|
||||
int GetProgress();
|
||||
void Refresh();
|
||||
|
||||
public slots:
|
||||
void SetCurrentMeasurement(int val);
|
||||
void StopAcquisition();
|
||||
void UpdateFinished();
|
||||
|
||||
private slots:
|
||||
@ -39,6 +34,7 @@ private slots:
|
||||
void SetRunIndex(int val);
|
||||
void UpdateProgress();
|
||||
void StartAcquisition();
|
||||
void StopAcquisition();
|
||||
|
||||
private:
|
||||
void SetupWidgetWindow();
|
||||
|
Reference in New Issue
Block a user