File indexing completed on 2024-04-28 15:09:53

0001 /*
0002     SPDX-FileCopyrightText: 2012 Jasem Mutlaq <mutlaqja@ikarustech.com>
0003     SPDX-FileCopyrightText: 2021 Wolfgang Reissenberger <sterne-jaeger@openfuture.de>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include <QObject>
0011 #include <QWidget>
0012 
0013 #include "qcustomplot.h"
0014 #include "guideinterface.h"
0015 
0016 class GuideTargetPlot: public QCustomPlot
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     GuideTargetPlot(QWidget *parent = nullptr);
0022     void showPoint(double ra, double de);
0023     void setLatestGuidePoint(bool isChecked) {graphOnLatestPt = isChecked;}
0024     void connectGuider(Ekos::GuideInterface *guider);
0025     void resize(int w, int h);
0026 
0027 public slots:
0028     void handleVerticalPlotSizeChange();
0029     void handleHorizontalPlotSizeChange();
0030 
0031     void buildTarget(double accuracyRadius);
0032     void setupNSEWLabels();
0033     void autoScaleGraphs(double accuracyRadius);
0034     void clear();
0035 
0036 protected:
0037     // virtual void resizeEvent(QResizeEvent *resize) override;
0038 
0039 private slots:
0040     void setAxisDelta(double ra, double de);
0041 
0042 
0043 private:
0044     QCPCurve *centralTarget { nullptr };
0045     QCPCurve *yellowTarget { nullptr };
0046     QCPCurve *redTarget { nullptr };
0047     QCPCurve *concentricRings { nullptr };
0048 
0049     bool graphOnLatestPt = true;
0050 
0051 };