mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
WIP
This commit is contained in:
@ -133,6 +133,9 @@ class SlsQt1DPlot:public QwtPlot{
|
||||
void SetZoomBase(double xmin,double ymin,double x_width, double y_width){ zoomer->SetZoomBase(xmin,ymin,x_width,y_width);}
|
||||
|
||||
void alignScales();
|
||||
|
||||
void SetLogX(bool yes=1);
|
||||
void SetLogY(bool yes=1);
|
||||
private:
|
||||
|
||||
SlsQtH1DList* hist_list;
|
||||
@ -160,11 +163,6 @@ class SlsQt1DPlot:public QwtPlot{
|
||||
void UnZoom();
|
||||
void Update();
|
||||
|
||||
void SetLogX(bool yes=1);
|
||||
void SetLogY(bool yes=1);
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -101,10 +101,10 @@ public:
|
||||
void FillTestPlot(int i=0);
|
||||
void Update();
|
||||
|
||||
public slots:
|
||||
void LogZ(bool on=1);
|
||||
void InterpolatedPlot(bool on);
|
||||
void showContour(bool on);
|
||||
public slots:
|
||||
void showSpectrogram(bool on);
|
||||
// void printPlot();
|
||||
|
||||
|
@ -23,7 +23,11 @@ public:
|
||||
void SetYTitle(QString st);
|
||||
void SetZTitle(QString st);
|
||||
void KeepZRangeIfSet();
|
||||
|
||||
// recalculate zmin and zmax from plot and update z range
|
||||
void SetZRange(bool isMin, bool isMax, double min, double max);
|
||||
void SetInterpolate(bool enable);
|
||||
void SetContour(bool enable);
|
||||
void SetLogz(bool enable);
|
||||
|
||||
private:
|
||||
QGridLayout* the_layout;
|
||||
@ -32,7 +36,6 @@ private:
|
||||
QToolButton* btnLogz;
|
||||
SlsQt2DPlot* the_plot;
|
||||
|
||||
void ConnectSignalsAndSlots();
|
||||
void Layout();
|
||||
bool isLog;
|
||||
double zmin;
|
||||
@ -43,14 +46,8 @@ private:
|
||||
public slots:
|
||||
void SetZScaleToLog(bool enable);
|
||||
void ResetRange();
|
||||
// recalculate zmin and zmax from plot and update z range
|
||||
void SetZRange(bool isMin, bool isMax, double min, double max);
|
||||
|
||||
// update z range
|
||||
void UpdateZRange(double min, double max) ;
|
||||
|
||||
signals:
|
||||
void InterpolateSignal(bool);
|
||||
void ContourSignal(bool);
|
||||
void LogzSignal(bool);
|
||||
|
||||
};
|
||||
|
@ -18,7 +18,6 @@ SlsQt2DPlotLayout::SlsQt2DPlotLayout(QWidget *parent):QGroupBox(parent){
|
||||
isZmin = false;
|
||||
isZmax = false;
|
||||
Layout();
|
||||
ConnectSignalsAndSlots();
|
||||
}
|
||||
|
||||
SlsQt2DPlotLayout::~SlsQt2DPlotLayout(){
|
||||
@ -32,11 +31,7 @@ void SlsQt2DPlotLayout::Layout(){
|
||||
the_layout->addWidget(the_plot,2,0,3,3);
|
||||
}
|
||||
|
||||
void SlsQt2DPlotLayout::ConnectSignalsAndSlots(){
|
||||
connect(this, SIGNAL(InterpolateSignal(bool)), the_plot, SLOT(InterpolatedPlot(bool)));
|
||||
connect(this, SIGNAL(ContourSignal(bool)), the_plot, SLOT(showContour(bool)));
|
||||
connect(this, SIGNAL(LogzSignal(bool)), this, SLOT(SetZScaleToLog(bool)));
|
||||
}
|
||||
|
||||
|
||||
void SlsQt2DPlotLayout::KeepZRangeIfSet() {
|
||||
UpdateZRange(zmin, zmax);
|
||||
@ -52,6 +47,7 @@ void SlsQt2DPlotLayout::SetZRange(bool isMin, bool isMax, double min, double max
|
||||
UpdateZRange(min, max);
|
||||
}
|
||||
|
||||
|
||||
void SlsQt2DPlotLayout::UpdateZRange(double min, double max) {
|
||||
if(isLog) {
|
||||
the_plot->SetZMinimumToFirstGreaterThanZero();
|
||||
@ -72,8 +68,15 @@ void SlsQt2DPlotLayout::UpdateZRange(double min, double max) {
|
||||
the_plot->Update();
|
||||
}
|
||||
|
||||
void SlsQt2DPlotLayout::SetZScaleToLog(bool enable) {
|
||||
FILE_LOG(logINFO) << (enable ? "Enabling" : "Disabling") << " Z Scale to log";
|
||||
void SlsQt2DPlotLayout::SetInterpolate(bool enable) {
|
||||
the_plot->InterpolatedPlot(enable);
|
||||
}
|
||||
|
||||
void SlsQt2DPlotLayout::SetContour(bool enable) {
|
||||
the_plot->showContour(enable);
|
||||
}
|
||||
|
||||
void SlsQt2DPlotLayout::SetLogz(bool enable) {
|
||||
isLog = enable;
|
||||
the_plot->LogZ(enable);
|
||||
SetZRange(isZmin, isZmax, zmin, zmax);
|
||||
|
Reference in New Issue
Block a user