File indexing completed on 2024-05-12 15:28:03

0001 /***************************************************************************
0002     File             : XYCorrelationCurveDock.h
0003     Project          : LabPlot
0004     --------------------------------------------------------------------
0005     Copyright        : (C) 2018 Stefan Gerlach (stefan.gerlach@uni.kn)
0006     Description      : widget for editing properties of correlation curves
0007 
0008  ***************************************************************************/
0009 
0010 /***************************************************************************
0011  *                                                                         *
0012  *  This program is free software; you can redistribute it and/or modify   *
0013  *  it under the terms of the GNU General Public License as published by   *
0014  *  the Free Software Foundation; either version 2 of the License, or      *
0015  *  (at your option) any later version.                                    *
0016  *                                                                         *
0017  *  This program is distributed in the hope that it will be useful,        *
0018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
0019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
0020  *  GNU General Public License for more details.                           *
0021  *                                                                         *
0022  *   You should have received a copy of the GNU General Public License     *
0023  *   along with this program; if not, write to the Free Software           *
0024  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
0025  *   Boston, MA  02110-1301  USA                                           *
0026  *                                                                         *
0027  ***************************************************************************/
0028 
0029 #ifndef XYCORRELATIONCURVEDOCK_H
0030 #define XYCORRELATIONCURVEDOCK_H
0031 
0032 #include "kdefrontend/dockwidgets/XYCurveDock.h"
0033 #include "backend/worksheet/plots/cartesian/XYCorrelationCurve.h"
0034 #include "ui_xycorrelationcurvedockgeneraltab.h"
0035 
0036 class TreeViewComboBox;
0037 
0038 class XYCorrelationCurveDock: public XYCurveDock {
0039     Q_OBJECT
0040 
0041 public:
0042     explicit XYCorrelationCurveDock(QWidget*);
0043     void setCurves(QList<XYCurve*>);
0044     void setupGeneral() override;
0045 
0046 private:
0047     void initGeneralTab() override;
0048     void showCorrelationResult();
0049 
0050     Ui::XYCorrelationCurveDockGeneralTab uiGeneralTab;
0051     TreeViewComboBox* cbDataSourceCurve{nullptr};
0052     TreeViewComboBox* cbXDataColumn{nullptr};
0053     TreeViewComboBox* cbYDataColumn{nullptr};
0054     TreeViewComboBox* cbY2DataColumn{nullptr};
0055 
0056     XYCorrelationCurve* m_correlationCurve{nullptr};
0057     XYCorrelationCurve::CorrelationData m_correlationData;
0058 
0059 protected:
0060     void setModel() override;
0061 
0062 private slots:
0063     //SLOTs for changes triggered in XYCorrelationCurveDock
0064     //general tab
0065     void dataSourceTypeChanged(int);
0066     void dataSourceCurveChanged(const QModelIndex&);
0067     void xDataColumnChanged(const QModelIndex&);
0068     void yDataColumnChanged(const QModelIndex&);
0069     void y2DataColumnChanged(const QModelIndex&);
0070     void samplingIntervalChanged();
0071     void autoRangeChanged();
0072     void xRangeMinChanged();
0073     void xRangeMaxChanged();
0074     void typeChanged();
0075     void normChanged();
0076 
0077     void recalculateClicked();
0078     void enableRecalculate() const;
0079 
0080     //SLOTs for changes triggered in XYCurve
0081     //General-Tab
0082     void curveDescriptionChanged(const AbstractAspect*);
0083     void curveDataSourceTypeChanged(XYAnalysisCurve::DataSourceType);
0084     void curveDataSourceCurveChanged(const XYCurve*);
0085     void curveXDataColumnChanged(const AbstractColumn*);
0086     void curveYDataColumnChanged(const AbstractColumn*);
0087     void curveY2DataColumnChanged(const AbstractColumn*);
0088     void curveCorrelationDataChanged(const XYCorrelationCurve::CorrelationData&);
0089     void dataChanged();
0090     void curveVisibilityChanged(bool);
0091 };
0092 
0093 #endif