File indexing completed on 2025-10-12 03:31:20

0001 /*
0002     File             : XYDataReductionCurveDock.h
0003     Project          : LabPlot
0004     Description      : widget for editing properties of data reduction curves
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2016-2021 Stefan Gerlach <stefan.gerlach@uni.kn>
0007     SPDX-FileCopyrightText: 2017 Alexander Semke <alexander.semke@web.de>
0008 
0009     SPDX-License-Identifier: GPL-2.0-or-later
0010 */
0011 
0012 #ifndef XYDATAREDUCTIONCURVEDOCK_H
0013 #define XYDATAREDUCTIONCURVEDOCK_H
0014 
0015 #include "backend/worksheet/plots/cartesian/XYDataReductionCurve.h"
0016 #include "kdefrontend/dockwidgets/XYAnalysisCurveDock.h"
0017 #include "ui_xydatareductioncurvedockgeneraltab.h"
0018 
0019 class XYAnalysisCurve;
0020 class TreeViewComboBox;
0021 class QStatusBar;
0022 
0023 class XYDataReductionCurveDock : public XYAnalysisCurveDock {
0024     Q_OBJECT
0025 
0026 public:
0027     explicit XYDataReductionCurveDock(QWidget* parent, QStatusBar* sb);
0028     void setCurves(QList<XYCurve*>);
0029     void setupGeneral() override;
0030 
0031 private:
0032     void initGeneralTab() override;
0033     void updateSettings(const AbstractColumn*) override;
0034     void updateTolerance();
0035     void updateTolerance2();
0036     void showDataReductionResult();
0037     virtual QString customText() const override;
0038 
0039     Ui::XYDataReductionCurveDockGeneralTab uiGeneralTab;
0040     QStatusBar* statusBar; // main status bar to display progress
0041 
0042     XYDataReductionCurve* m_dataReductionCurve{nullptr};
0043     XYDataReductionCurve::DataReductionData m_dataReductionData;
0044     bool m_dateTimeRange{false};
0045 
0046 protected:
0047     void setModel();
0048 
0049 private Q_SLOTS:
0050     // SLOTs for changes triggered in XYDataReductionCurveDock
0051     // general tab
0052     void dataSourceTypeChanged(int);
0053     void xDataColumnChanged(const QModelIndex&);
0054     void autoRangeChanged();
0055     void xRangeMinChanged();
0056     void xRangeMaxChanged();
0057     void xRangeMinDateTimeChanged(qint64);
0058     void xRangeMaxDateTimeChanged(qint64);
0059     void typeChanged(int);
0060     void autoToleranceChanged();
0061     void toleranceChanged(double);
0062     void autoTolerance2Changed();
0063     void tolerance2Changed(double);
0064 
0065     void recalculateClicked();
0066 
0067     // SLOTs for changes triggered in XYCurve
0068     // General-Tab
0069     void curveDataReductionDataChanged(const XYDataReductionCurve::DataReductionData&);
0070 };
0071 
0072 #endif