Files
Erik Fröjdh 7b7d2e49bd Port qwt-free GUI plotting from 1010/qt6-port-ai-experimental
Straight port of the GUI work on 1010/qt6-port-ai-experimental
(91497579a..fdc457fee) onto dev/mac-build, without further changes:

- Qt-only plotting stack replacing qwt: SlsQtPlotCommon, SlsQtFastImage,
  SlsQtScalePanel and rewritten SlsQt1DPlot / SlsQt2DPlot / SlsQt2DHist.
  The 2D view zooms with the wheel, pans by dragging and shows pixel
  outlines and values when zoomed in.
- slsDetectorPlotting static library, QtTest suite and plot_demo.
- Detachable Plot settings dock.
- Bundled qwt removed, SLS_GUI_QT_MAJOR and cmk.sh -g/-G added.

Not ported: this_build_bin_path.sh, CI workflows, conda recipe, README,
installation.rst and dependencies.rst.

The conflict in qDrawPlot::StartAcquisition keeps the developer
behaviour of not resetting the zoom at the start of an acquisition.
2026-11-13 09:41:02 +01:00

87 lines
2.2 KiB
C++

// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once
#include "qDefs.h"
#include "sls/Detector.h"
#include "ui_form_detectormain.h"
class QResizeEvent;
class QAction;
class QDockWidget;
class QScrollArea;
namespace sls {
class qDrawPlot;
class qTabMeasurement;
class qTabDataOutput;
class qTabPlot;
class qTabAdvanced;
class qTabSettings;
class qTabDebugging;
class qTabDeveloper;
class qTabMessages;
class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
Q_OBJECT
public:
qDetectorMain(int multiId, const std::string &fname, bool isDevel);
~qDetectorMain();
private slots:
void EnableModes(QAction *action);
void ExecuteUtilities(QAction *action);
void ExecuteHelp(QAction *action);
void Refresh(int index);
/**
* Resizes the main window if the plot is docked/undocked
* @param b bool TRUE if undocked(outside main window), FALSE docked
*/
void ResizeMainWindow(bool b);
void EnableTabs(bool enable);
void SetZoomToolTip(bool disable);
void SetPlotSettingsDetached(bool detached);
protected:
void resizeEvent(QResizeEvent *event);
private:
void SetUpWidgetWindow();
void SetUpDetector(const std::string &config_file, int multiID);
void Initialization();
void LoadConfigFile(const std::string &config_file);
/** enumeration of the tabs */
enum {
MEASUREMENT,
SETTINGS,
DATAOUTPUT,
PLOT,
ADVANCED,
DEBUGGING,
DEVELOPER,
MESSAGES,
NumberOfTabs
};
slsDetectorDefs::detectorType detType;
std::unique_ptr<Detector> det;
qDrawPlot *plot;
qTabMeasurement *tabMeasurement;
qTabDataOutput *tabDataOutput;
qTabPlot *tabPlot;
qTabSettings *tabSettings;
qTabAdvanced *tabAdvanced;
qTabDebugging *tabDebugging;
qTabDeveloper *tabDeveloper;
qTabMessages *tabMessages;
QDockWidget *dockWidgetPlotSettings{nullptr};
QScrollArea *dockScrollPlotSettings{nullptr};
QAction *actionDetachPlotSettings{nullptr};
int isDeveloper{false};
QString zoomToolTip;
QColor defaultTabColor;
};
} // namespace sls