File indexing completed on 2025-01-05 03:35:33

0001 #ifndef XYANALYSISCURVEDOCK_H
0002 #define XYANALYSISCURVEDOCK_H
0003 
0004 #include "XYCurveDock.h"
0005 #include "backend/worksheet/plots/cartesian/XYAnalysisCurve.h"
0006 
0007 class TreeViewComboBox;
0008 
0009 class XYAnalysisCurveDock : public XYCurveDock {
0010 public:
0011     enum class RequiredDataSource { XY, Y, YY2 };
0012 
0013     explicit XYAnalysisCurveDock(QWidget* parent, RequiredDataSource required = RequiredDataSource::XY);
0014 
0015 protected:
0016     void showResult(const XYAnalysisCurve* curve, QTextEdit* teResult);
0017     virtual QString customText() const;
0018 
0019     void setAnalysisCurves(QList<XYCurve*>);
0020     void setModel(const QList<AspectType>& list);
0021     void setBaseWidgets(TimedLineEdit* nameLabel, ResizableTextEdit* commentLabel, QPushButton* recalculate, QComboBox* cbDataSourceType = nullptr);
0022     void enableRecalculate() const;
0023     virtual void updateSettings(const AbstractColumn*){};
0024 
0025     QVector<XYAnalysisCurve*> m_analysisCurves;
0026     XYAnalysisCurve* m_analysisCurve{nullptr};
0027     RequiredDataSource m_requiredDataSource{RequiredDataSource::XY};
0028     QPushButton* m_recalculateButton{nullptr};
0029     QComboBox* cbDataSourceType{nullptr};
0030     TreeViewComboBox* cbDataSourceCurve{nullptr};
0031     TreeViewComboBox* cbXDataColumn{nullptr};
0032     TreeViewComboBox* cbYDataColumn{nullptr};
0033     TreeViewComboBox* cbY2DataColumn{nullptr};
0034 
0035 protected Q_SLOTS:
0036     // SLOTs for changes triggered in the dock
0037     void dataSourceCurveChanged(const QModelIndex&);
0038     void xDataColumnChanged(const QModelIndex&);
0039     void yDataColumnChanged(const QModelIndex&);
0040     void y2DataColumnChanged(const QModelIndex&);
0041 
0042     // SLOTs for changes triggered in the analysis curve
0043     void curveDataSourceTypeChanged(XYAnalysisCurve::DataSourceType);
0044     void curveDataSourceCurveChanged(const XYCurve*);
0045     void curveXDataColumnChanged(const AbstractColumn*);
0046     void curveYDataColumnChanged(const AbstractColumn*);
0047 };
0048 
0049 #endif // XYANALYSISCURVEDOCK_H