gui shows roi now

This commit is contained in:
2025-06-30 12:03:39 +02:00
parent b775dd0efa
commit cbd0aed8e5
10 changed files with 92 additions and 85 deletions

View File

@@ -5,6 +5,8 @@
#include "SlsQt1DZoomer.h"
#include "sls/ansi.h"
#include "sls/sls_detector_defs.h"
#include <array>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
@@ -141,8 +143,9 @@ class SlsQt1DPlot : public QwtPlot {
void SetLogX(bool yes = 1);
void SetLogY(bool yes = 1);
void EnableRoiBox(std::array<int, 4> roi);
void DisableRoiBox();
void EnableRoiBoxes(std::vector<slsDetectorDefs::ROI> roi, int ymin,
int ymax);
void DisableRoiBoxes();
private:
bool gainPlot{false};
@@ -169,6 +172,7 @@ class SlsQt1DPlot : public QwtPlot {
friend void SlsQtH1D::Attach(SlsQt1DPlot *p);
friend void SlsQtH1D::Detach(SlsQt1DPlot *p);
std::vector<std::unique_ptr<QwtPlotShapeItem>> roiBoxes{};
QwtPlotShapeItem *roiBox{nullptr};
signals:

View File

@@ -3,6 +3,8 @@
#pragma once
#include "SlsQt2DHist.h"
#include "SlsQt2DZoomer.h"
#include "sls/sls_detector_defs.h"
#include <array>
#include <qlist.h>
#include <qwt_plot.h>
@@ -71,8 +73,8 @@ class SlsQt2DPlot : public QwtPlot {
void SetLogz(bool enable, bool isMin, bool isMax, double min, double max);
void SetZRange(bool isMin, bool isMax, double min, double max);
void LogZ(bool on = 1);
void EnableRoiBox(std::array<int, 4> roi);
void DisableRoiBox();
void EnableRoiBoxes(std::vector<slsDetectorDefs::ROI> roi);
void DisableRoiBoxes();
public slots:
void showSpectrogram(bool on);
@@ -101,7 +103,7 @@ class SlsQt2DPlot : public QwtPlot {
QList<double> contourLevelsLog;
bool disableZoom{false};
int isLog;
QwtPlotShapeItem *roiBox{nullptr};
std::vector<std::unique_ptr<QwtPlotShapeItem>> roiBoxes{};
};
} // namespace sls