This commit is contained in:
2019-06-18 17:51:28 +02:00
parent 7b456cb9c6
commit e4190285be
9 changed files with 84 additions and 430 deletions

View File

@ -22,7 +22,7 @@ public:
void SetXTitle(QString st);
void SetYTitle(QString st);
void SetZTitle(QString st);
void KeepZRangeIfSet();
void KeepZRangeIfSet();
private:

View File

@ -1,3 +1,6 @@
#include "SlsQt2DPlotLayout.h"
#include "logger.h"
#include <iostream>
#include <qtoolbutton.h>
@ -6,10 +9,6 @@
#include <qlabel.h>
#include <QString>
#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);
}