diff --git a/slsDetectorGui/forms/form_tab_plot.ui b/slsDetectorGui/forms/form_tab_plot.ui
index ae3259e73..ebec9595c 100755
--- a/slsDetectorGui/forms/form_tab_plot.ui
+++ b/slsDetectorGui/forms/form_tab_plot.ui
@@ -99,7 +99,7 @@
- 3
+ 0
@@ -610,167 +610,6 @@ Displays minimum, maximum and sum of values for each plot.
-
-
- true
-
-
-
-
- 9
- 0
- 315
- 35
-
-
-
-
- 1
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- from
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 16777215
-
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
- -16777215
-
-
- 16777215
-
-
- 0
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- to
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 16777215
-
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
- -16777215
-
-
- 16777215
-
-
- 10000
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- size
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 16777215
-
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
- -16777215
-
-
- 16777215
-
-
- 1000
-
-
-
-
-
-
@@ -871,7 +710,7 @@ Displays minimum, maximum and sum of values for each plot.
- 4
+ 0
@@ -1468,167 +1307,6 @@ Displays minimum, maximum and sum of values for each plot.
-
-
- true
-
-
-
-
- 5
- 0
- 331
- 36
-
-
-
-
- 1
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- from
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 16777215
-
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
- 0
-
-
- 16777215
-
-
- 0
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- to
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 16777215
-
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
- -16777215
-
-
- 16777215
-
-
- 10000
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- size
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 16777215
-
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
- -16777215
-
-
- 16777215
-
-
- 1000
-
-
-
-
-
-
@@ -2233,7 +1911,7 @@ Displays minimum, maximum and sum of values for each plot.
10
20
- 355
+ 345
27
@@ -2251,7 +1929,7 @@ Displays minimum, maximum and sum of values for each plot.
- -
+
-
@@ -2267,49 +1945,33 @@ Displays minimum, maximum and sum of values for each plot.
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- Histogram
-
-
-
-
Qt::Horizontal
- QSizePolicy::Preferred
+ QSizePolicy::Fixed
- 40
+ 20
10
- -
+
-
Qt::Horizontal
- QSizePolicy::Preferred
+ QSizePolicy::Fixed
- 40
+ 120
10
@@ -2751,7 +2413,6 @@ Streaming Interval between 2 plots. Default is time interval with 200 ms.
radioNoPlot
- radioHistogram
radioDataGraph
chkInterpolate
chkContour
diff --git a/slsDetectorGui/include/qDefs.h b/slsDetectorGui/include/qDefs.h
index 1e7084ea0..6633de9f7 100755
--- a/slsDetectorGui/include/qDefs.h
+++ b/slsDetectorGui/include/qDefs.h
@@ -30,7 +30,7 @@ class qDefs : public QWidget {
QF_NUM_FUNCTIONS
};
- const char* getQFunctionNameFromEnum(enum qFuncNames func) {
+ static 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";
@@ -142,7 +142,7 @@ class qDefs : public QWidget {
valueMS /= 1000;
case MICROSECONDS:
valueMS /= 1000;
- return valueMs;
+ return valueMS;
case HOURS:
valueMS *= 60;
diff --git a/slsDetectorGui/include/qServer.h b/slsDetectorGui/include/qServer.h
index 416b889d6..c6f4e8c71 100755
--- a/slsDetectorGui/include/qServer.h
+++ b/slsDetectorGui/include/qServer.h
@@ -19,13 +19,13 @@ class qServer : public QWidget {
private:
void FunctionTable();
- void DecodeFunction(sls::ServerInterface2 *socket);
+ 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 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
diff --git a/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlotLayout.h b/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlotLayout.h
index 0aa786dcd..5e06901c2 100755
--- a/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlotLayout.h
+++ b/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlotLayout.h
@@ -22,7 +22,7 @@ public:
void SetXTitle(QString st);
void SetYTitle(QString st);
void SetZTitle(QString st);
- void KeepZRangeIfSet();
+ void KeepZRangeIfSet();
private:
diff --git a/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlotLayout.cxx b/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlotLayout.cxx
index 14ef9d685..6389d2b26 100755
--- a/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlotLayout.cxx
+++ b/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlotLayout.cxx
@@ -1,3 +1,6 @@
+#include "SlsQt2DPlotLayout.h"
+#include "logger.h"
+
#include
#include
@@ -6,10 +9,6 @@
#include
#include
-#include "SlsQt2DPlotLayout.h"
-
-
-
SlsQt2DPlotLayout::SlsQt2DPlotLayout(QWidget *parent):QGroupBox(parent){
the_layout=0;
the_plot = new SlsQt2DPlot(this);
@@ -39,8 +38,12 @@ void SlsQt2DPlotLayout::ConnectSignalsAndSlots(){
connect(this, SIGNAL(LogzSignal(bool)), this, SLOT(SetZScaleToLog(bool)));
}
+void SlsQt2DPlotLayout::KeepZRangeIfSet() {
+ UpdateZRange(zmin, zmax);
+}
+
void SlsQt2DPlotLayout::SetZRange(bool isMin, bool isMax, double min, double max){
- isZMin = isMin;
+ isZmin = isMin;
isZmax = isMax;
// reset zmin and zmax first (recalculate from plot)
@@ -73,7 +76,7 @@ void SlsQt2DPlotLayout::SetZScaleToLog(bool enable) {
FILE_LOG(logINFO) << (enable ? "Enabling" : "Disabling") << " Z Scale to log";
isLog = enable;
the_plot->LogZ(enable);
- SetZRange(isZMin, isZmax, zmin, zmax);
+ SetZRange(isZmin, isZmax, zmin, zmax);
}
diff --git a/slsDetectorGui/src/qCloneWidget.cpp b/slsDetectorGui/src/qCloneWidget.cpp
index 98333a53b..a948ff89b 100755
--- a/slsDetectorGui/src/qCloneWidget.cpp
+++ b/slsDetectorGui/src/qCloneWidget.cpp
@@ -187,7 +187,7 @@ void qCloneWidget::SetCloneHists(int nHists, int histNBins, double *histXAxis, d
void qCloneWidget::SetCloneHists2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, double *d) {
cloneplot2D->GetPlot()->SetData(nbinsx, xmin, xmax, nbinsy, ymin, ymax, d);
- cloneplot2D->UpdateNKeepSetRangeIfSet();
+ cloneplot2D->KeepZRangeIfSet();
}
void qCloneWidget::SetRange(bool IsXYRange[], double XYRangeValues[]) {
diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp
index c27902c7d..c4a879b94 100755
--- a/slsDetectorGui/src/qDrawPlot.cpp
+++ b/slsDetectorGui/src/qDrawPlot.cpp
@@ -1433,7 +1433,7 @@ void qDrawPlot::UpdatePlot() {
plot2D->SetYTitle(imageYAxisTitle);
plot2D->SetZTitle(imageZAxisTitle);
//zmin and zmax of plot already calculated using SetData, now recalculate if z is set
- plot2D->UpdateZRange();
+ plot2D->KeepZRangeIfSet();
if (gainPlotEnable) {
gainplot2D->GetPlot()->SetData(nPixelsX, -0.5, nPixelsX - 0.5, nPixelsY, startPixel, endPixel, gainImageArray);
gainplot2D->setTitle(GetImageTitle());
@@ -1743,7 +1743,7 @@ void qDrawPlot::DisableZoom(bool disable) {
plot2D->SetYTitle("Pixel");
plot2D->SetZTitle("Trimbits");
//zmin and zmax of plot already calculated using SetData, now recalculate if z is set
- plot2D->UpdateZRange();
+ plot2D->KeepZRangeIfSet();
#ifdef VERBOSE
std::cout << "Trimbits Plot updated" <<'\n';
#endif
diff --git a/slsDetectorGui/src/qServer.cpp b/slsDetectorGui/src/qServer.cpp
index 387050e49..55771cd0d 100755
--- a/slsDetectorGui/src/qServer.cpp
+++ b/slsDetectorGui/src/qServer.cpp
@@ -24,18 +24,18 @@ void qServer::FunctionTable() {
flist[qDefs::QF_EXIT_SERVER] = &qServer::ExitServer;
}
-void qServer::DecodeFunction(sls::ServerInterface2 *socket) {
- qFuncNames fnum;
+void qServer::DecodeFunction(sls::ServerInterface2 &socket) {
+ qDefs::qFuncNames fnum;
socket.Receive(fnum);
- if (fnum < 0 || fnum >= QF_NUM_FUNCTIONS) {
- throw RuntimeError("Unrecognized Function enum " + std::to_string(fnum) + "\n");
+ if (fnum < 0 || fnum >= qDefs::QF_NUM_FUNCTIONS) {
+ throw sls::RuntimeError("Unrecognized Function enum " + std::to_string(fnum) + "\n");
}
FILE_LOG(logDEBUG1) << "calling function fnum: " << fnum << " ("
- << slsDetectorDefs::getQFunctionNameFromEnum(fnum) << ")";
- (this->*flist[fnum])(socket);
- FILE_LOG(logDEBUG1) << "Function " << getQFunctionNameFromEnum(fnum) << " finished";
+ << qDefs::getQFunctionNameFromEnum(fnum) << ")";
+ (this->*flist[static_cast(fnum)])(socket);
+ FILE_LOG(logDEBUG1) << "Function " << qDefs::getQFunctionNameFromEnum(fnum) << " finished";
}
void qServer::CreateServers() {
@@ -44,16 +44,16 @@ void qServer::CreateServers() {
tcpThreadCreated = true;
try {
// start control server
- controlStatus = std::async(std::launch::async, ServerThread, true);
+ controlStatus = std::async(std::launch::async, &qServer::ServerThread, this, true);
FILE_LOG(logDEBUG) << "Gui control server thread created successfully.";
// start stop server
- stopStatus = std::async(std::launch::async, ServerThread, false);
+ stopStatus = std::async(std::launch::async, &qServer::ServerThread, this, false);
FILE_LOG(logDEBUG) << "Gui stop server thread created successfully.";
} catch (...) {
std::string mess = "Could not create Gui TCP servers";
FILE_LOG(logERROR) << mess;
- qDefs::Message(qDefs::WARNING, message, "qServer::CreateServers");
+ qDefs::Message(qDefs::WARNING, mess, "qServer::CreateServers");
DestroyServers();
}
}
@@ -75,21 +75,18 @@ void qServer::DestroyServers() {
}
}
-void qServer::ServerThread(isControlServer) {
- sls::ServerSocket* sock = nullptr;
- if (isControl) {
+void qServer::ServerThread(bool isControlServer) {
+ if (isControlServer) {
FILE_LOG(logDEBUG) << "Starting Gui Server (Control port: " << controlPort << ")";
controlSocket = sls::make_unique(controlPort);
- sock = controlSocket;
} else {
FILE_LOG(logDEBUG) << "Starting Gui Server (Stop port: " << stopPort << ")";
stopSocket = sls::make_unique(stopPort);
- sock = stopSocket;
}
while (true) {
try{
- auto socket = sock->accept();
+ auto socket = (isControlServer ? controlSocket->accept() : stopSocket->accept());
try{
decode_function(socket);
} catch(const sls::NonCriticalError &e) {
@@ -116,46 +113,46 @@ void qServer::ServerThread(isControlServer) {
FILE_LOG(logDEBUG) << "Stopped gui server thread";
}
-void qServer::GetStatus(sls::ServerInterface2* socket) {
+void qServer::GetStatus(sls::ServerInterface2 &socket) {
slsDetectorDefs::runStatus status = slsDetectorDefs::ERROR;
int progress = 0;
- if (myMainTab->isPlotRunning())
+ if (mainTab->isPlotRunning())
status = slsDetectorDefs::RUNNING;
else
status = slsDetectorDefs::IDLE;
- progress = myMainTab->GetProgress();
+ progress = mainTab->GetProgress();
int retvals[2] = {static_cast(status), progress};
socket.SendResult(retvals);
}
-void qServer::StartAcquisition(sls::ServerInterface2* socket) {
- if (myMainTab->StartStopAcquisitionFromClient(true) == slsDetectorDefs::FAIL) {
+void qServer::StartAcquisition(sls::ServerInterface2 &socket) {
+ if (mainTab->StartStopAcquisitionFromClient(true) == slsDetectorDefs::FAIL) {
throw sls::NonCriticalError("Could not start acquistion in Gui");
}
socket.Send(slsDetectorDefs::OK);
}
-void qServer::StopsAcquisition(sls::ServerInterface2* socket) {
- if (myMainTab->StartStopAcquisitionFromClient(false) == slsDetectorDefs::FAIL) {
+void qServer::StopsAcquisition(sls::ServerInterface2 &socket) {
+ if (mainTab->StartStopAcquisitionFromClient(false) == slsDetectorDefs::FAIL) {
throw sls::NonCriticalError("Could not stop acquistion in Gui");
}
socket.Send(slsDetectorDefs::OK);
}
-void qServer::Acquire(sls::ServerInterface2* socket) {
- if (myMainTab->StartStopAcquisitionFromClient(true) == slsDetectorDefs::FAIL) {
+void qServer::Acquire(sls::ServerInterface2 &socket) {
+ if (mainTab->StartStopAcquisitionFromClient(true) == slsDetectorDefs::FAIL) {
throw sls::NonCriticalError("Could not start blocking acquistion in Gui");
}
// blocking
usleep(5000);
- while (myMainTab->isPlotRunning()) {
+ while (mainTab->isPlotRunning()) {
usleep(5000);
}
socket.Send(slsDetectorDefs::OK);
}
-void qServer::ExitServer(sls::ServerInterface2* socket) {
+void qServer::ExitServer(sls::ServerInterface2 &socket) {
throw sls::NonCriticalError("Server exited");
}
\ No newline at end of file
diff --git a/slsDetectorGui/src/qTabPlot.cpp b/slsDetectorGui/src/qTabPlot.cpp
index e102427b2..76a4df8dd 100755
--- a/slsDetectorGui/src/qTabPlot.cpp
+++ b/slsDetectorGui/src/qTabPlot.cpp
@@ -21,8 +21,7 @@ QString qTabPlot::defaultImageZAxisTitle("Intensity");
qTabPlot::qTabPlot(QWidget *parent, multiSlsDetector *detector, qDrawPlot *plot) :
QWidget(parent), myDet(detector), myPlot(plot), isOneD(false),
- stackedLayout(nullptr), spinNthFrame(nullptr), spinTimeGap(nullptr), comboTimeGapUnit(nullptr),
- btnGroupPlotType(0) {
+ btnGroupPlotType(0), stackedLayout(nullptr), spinNthFrame(nullptr), spinTimeGap(nullptr), comboTimeGapUnit(nullptr) {
setupUi(this);
SetupWidgetWindow();
FILE_LOG(logDEBUG) << "Plot ready";
@@ -75,17 +74,11 @@ void qTabPlot::SetupWidgetWindow() {
dispZMax->setValidator(new QDoubleValidator(dispZMax));
// Plot titles
dispTitle->setText("");
- myPlot->SetPlotTitlePrefix("");
dispXAxis->setText(defaultHistXAxisTitle);
dispYAxis->setText(defaultHistYAxisTitle);
- myPlot->SetHistXAxisTitle(defaultHistXAxisTitle);
- myPlot->SetHistYAxisTitle(defaultHistYAxisTitle);
dispXAxis->setText(defaultImageXAxisTitle);
dispYAxis->setText(defaultImageYAxisTitle);
dispZAxis->setText(defaultImageZAxisTitle);
- myPlot->SetImageXAxisTitle(defaultImageXAxisTitle);
- myPlot->SetImageYAxisTitle(defaultImageYAxisTitle);
- myPlot->SetImageZAxisTitle(defaultImageZAxisTitle);
// enabling according to det type
isOneD = false;
@@ -202,7 +195,7 @@ void qTabPlot::Select1DPlot(bool enable) {
FILE_LOG(logDEBUG) << "Selecting " << (enable ? "1" : "2") << "D Plot";
isOneD = enable;
box1D->setEnabled(enable);
- box2D->setEnabled(!benable);
+ box2D->setEnabled(!enable);
chkZAxis->setEnabled(!enable);
dispZAxis->setEnabled(!enable);
chkZMin->setEnabled(!enable);
@@ -247,48 +240,48 @@ void qTabPlot::SetPlot() {
void qTabPlot::Set1DPlotOptionsRight() {
FILE_LOG(logDEBUG) << "1D Options Right";
- int i = stackedWidget->currentIndex();
- if (i == (stackedWidget->count() - 1))
- stackedWidget->setCurrentIndex(0);
+ int i = stackedWidget1D->currentIndex();
+ if (i == (stackedWidget1D->count() - 1))
+ stackedWidget1D->setCurrentIndex(0);
else
- stackedWidget->setCurrentIndex(i + 1);
- box1D->setTitle(QString("1D Plot Options %1").arg(stackedWidget->currentIndex() + 1));
+ stackedWidget1D->setCurrentIndex(i + 1);
+ box1D->setTitle(QString("1D Plot Options %1").arg(stackedWidget1D->currentIndex() + 1));
}
void qTabPlot::Set1DPlotOptionsLeft() {
FILE_LOG(logDEBUG) << "1D Options Left";
- int i = stackedWidget->currentIndex();
+ int i = stackedWidget1D->currentIndex();
if (i == 0)
- stackedWidget->setCurrentIndex(stackedWidget->count() - 1);
+ stackedWidget1D->setCurrentIndex(stackedWidget1D->count() - 1);
else
- stackedWidget->setCurrentIndex(i - 1);
- box1D->setTitle(QString("1D Plot Options %1").arg(stackedWidget->currentIndex() + 1));
+ stackedWidget1D->setCurrentIndex(i - 1);
+ box1D->setTitle(QString("1D Plot Options %1").arg(stackedWidget1D->currentIndex() + 1));
}
void qTabPlot::Set2DPlotOptionsRight() {
FILE_LOG(logDEBUG) << "2D Options Right";
- int i = stackedWidget_2->currentIndex();
- if (i == (stackedWidget_2->count() - 1))
- stackedWidget_2->setCurrentIndex(0);
+ int i = stackedWidget2D->currentIndex();
+ if (i == (stackedWidget2D->count() - 1))
+ stackedWidget2D->setCurrentIndex(0);
else
- stackedWidget_2->setCurrentIndex(i + 1);
- box2D->setTitle(QString("2D Plot Options %1").arg(stackedWidget_2->currentIndex() + 1));
+ stackedWidget2D->setCurrentIndex(i + 1);
+ box2D->setTitle(QString("2D Plot Options %1").arg(stackedWidget2D->currentIndex() + 1));
}
void qTabPlot::Set2DPlotOptionsLeft() {
FILE_LOG(logDEBUG) << "2D Options Left";
- int i = stackedWidget_2->currentIndex();
+ int i = stackedWidget2D->currentIndex();
if (i == 0)
- stackedWidget_2->setCurrentIndex(stackedWidget_2->count() - 1);
+ stackedWidget2D->setCurrentIndex(stackedWidget2D->count() - 1);
else
- stackedWidget_2->setCurrentIndex(i - 1);
- box2D->setTitle(QString("2D Plot Options %1").arg(stackedWidget_2->currentIndex() + 1));
+ stackedWidget2D->setCurrentIndex(i - 1);
+ box2D->setTitle(QString("2D Plot Options %1").arg(stackedWidget2D->currentIndex() + 1));
}
void qTabPlot::EnablePersistency(bool enable) {
FILE_LOG(logINFO) << "Superimpose " << (enable ? "enabled" : "disabled");
- lblPersistency->setEnabled(val);
- spinPersistency->setEnabled(val);
+ lblPersistency->setEnabled(enable);
+ spinPersistency->setEnabled(enable);
if (enable)
myPlot->SetPersistency(spinPersistency->value());
else
@@ -423,7 +416,7 @@ void qTabPlot::CheckAspectRatio() {
}
void qTabPlot::SetXYRange() {
- FILE_LOG(LOGDEBUG) << "Set XY Range";
+ FILE_LOG(logDEBUG) << "Set XY Range";
disconnect(dispXMin, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
disconnect(dispXMax, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
disconnect(dispYMin, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
@@ -528,7 +521,7 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
ranges[qDefs::YMINIMUM] = myPlot->GetYMinimum();
ranges[qDefs::YMAXIMUM] = myPlot->GetYMaximum();
double idealAspectratio = (ranges[qDefs::XMAXIMUM] - ranges[qDefs::XMINIMUM]) / (ranges[qDefs::YMAXIMUM] - ranges[qDefs::YMINIMUM]);
- FILE_LOG(logDEBUG) << "Ideal Aspect ratio: %f for x(%f - %f), y(%f - %f)\n", idealAspectratio, ranges[qDefs::XMINIMUM], ranges[qDefs::XMAXIMUM], ranges[qDefs::YMINIMUM], ranges[qDefs::YMAXIMUM]);
+ FILE_LOG(logDEBUG) << "Ideal Aspect ratio: " << idealAspectratio << " for x(" << ranges[qDefs::XMINIMUM] << " - " << ranges[qDefs::XMAXIMUM] << "), y(" << ranges[qDefs::YMINIMUM] << " - " << ranges[qDefs::YMAXIMUM] << ")";
// calculate current aspect ratio
ranges[qDefs::XMINIMUM] = dispXMin->text().toDouble();
@@ -536,9 +529,9 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
ranges[qDefs::YMINIMUM] = dispYMin->text().toDouble();
ranges[qDefs::YMAXIMUM] = dispYMax->text().toDouble();
double currentAspectRatio = (ranges[qDefs::XMAXIMUM] - ranges[qDefs::XMINIMUM]) / (ranges[qDefs::YMAXIMUM] - ranges[qDefs::YMINIMUM]);
- FILE_LOG(logDEBUG) << "Current Aspect ratio: %f for x(%f - %f), y(%f - %f)\n", currentAspectRatio, ranges[qDefs::XMINIMUM], ranges[qDefs::XMAXIMUM], ranges[qDefs::YMINIMUM], ranges[qDefs::YMAXIMUM]);
-
- if (newAspectRatio != idealAspectratio) {
+ FILE_LOG(logDEBUG) << "Current Aspect ratio: " << currentAspectRatio << " for x(" << ranges[qDefs::XMINIMUM] << " - " << ranges[qDefs::XMAXIMUM] << "), y(" << ranges[qDefs::YMINIMUM] << " - " << ranges[qDefs::YMAXIMUM] << ")";
+
+ if (currentAspectRatio != idealAspectratio) {
// dimension: 1(x changed: y adjusted), 0(y changed: x adjusted), -1(aspect ratio clicked: larger one adjusted)
if (dimension == -1) {
dimension = ((ranges[qDefs::XMAXIMUM] - ranges[qDefs::XMINIMUM]) > (ranges[qDefs::YMAXIMUM] - ranges[qDefs::YMINIMUM]))
@@ -603,10 +596,10 @@ void qTabPlot::SetZRange() {
bool isZmin = chkZMin->isChecked();
bool isZmax = chkZMax->isChecked();
double zmin = 0, zmax = 1;
- if (!dispZMin->text().empty()) {
+ if (!dispZMin->text().isEmpty()) {
zmin = dispZMin->text().toDouble();
}
- if (!dispZMax->text().empty()) {
+ if (!dispZMax->text().isEmpty()) {
zmax = dispZMax->text().toDouble();
}
emit ResetZMinZMaxSignal(isZmin, isZmax, zmin, zmax);
@@ -636,7 +629,7 @@ void qTabPlot::GetStreamingFrequency() {
double timeS = static_cast(timeMs) / 1000.00;
auto time = qDefs::getCorrectTime(timeS);
spinTimeGap->setValue(time.first);
- comboTimeGapUnit->setcurrentIndex(static_cast(time.second));
+ comboTimeGapUnit->setCurrentIndex(static_cast(time.second));
}
} catch(const sls::NonCriticalError &e) {
qDefs::ExceptionMessage("Could not get streaming timer.", e.what(), "qTabPlot::GetStreamingFrequency");