Kstars

guidedriftgraph.h
1 /*
2  SPDX-FileCopyrightText: 2012 Jasem Mutlaq <[email protected]>
3  SPDX-FileCopyrightText: 2021 Wolfgang Reissenberger <[email protected]>
4 
5  SPDX-License-Identifier: GPL-2.0-or-later
6 */
7 
8 #pragma once
9 
10 
11 #include <QObject>
12 #include <QWidget>
13 
14 #include "qcustomplot.h"
15 #include "guidegraph.h"
16 #include "guideinterface.h"
17 
18 class GuideDriftGraph : public QCustomPlot
19 {
20  Q_OBJECT
21 
22 public:
23  GuideDriftGraph(QWidget *parent = nullptr);
24  void guideHistory(int sliderValue, bool graphOnLatestPt);
25  /**
26  * @brief setRMSVisibility Decides which RMS plot is visible.
27  */
28  void setRMSVisibility();
29  void exportGuideData();
30  void resetTimer();
31  void connectGuider(Ekos::GuideInterface *guider);
32 
33 public slots:
34  void handleVerticalPlotSizeChange();
35  void handleHorizontalPlotSizeChange();
36 
37  void setupNSEWLabels();
38  void autoScaleGraphs();
39  void zoomX(int zoomLevel);
40  void zoomInX();
41  void zoomOutX();
42  void setCorrectionGraphScale(int value);
43  void setLatestGuidePoint(bool isChecked) {graphOnLatestPt = isChecked;}
44  void clear();
45 
46  void toggleShowPlot(GuideGraph::DRIFT_GRAPH_INDICES plot, bool isChecked);
47  void setAxisDelta(double ra, double de);
48  void setAxisSigma(double ra, double de);
49  void setAxisPulse(double ra, double de);
50  void setSNR(double snr);
51  void updateCorrectionsScaleVisibility();
52 
53  // Display guide information when hovering over the drift graph
54  void mouseOverLine(QMouseEvent *event);
55 
56  // Reset graph if right clicked
57  void mouseClicked(QMouseEvent *event);
58 
59  /** @brief Update colors following a color scheme update notification.
60  */
61  void refreshColorScheme();
62 
63 private:
64  // The scales of these zoom levels are defined in Guide::zoomX().
65  static constexpr int defaultXZoomLevel = 3;
66  int driftGraphZoomLevel {defaultXZoomLevel};
67  bool graphOnLatestPt = true;
68 
69  // Axis for the SNR part of the driftGraph. Qt owns this pointer's memory.
70  QCPAxis *snrAxis;
71 
72  // Guide timer
73  QTime guideTimer;
74  QElapsedTimer guideElapsedTimer;
75 
76  QUrl guideURLPath;
77 };
Q_OBJECTQ_OBJECT
Manages a single axis inside a QCustomPlot.
Definition: qcustomplot.h:2067
KGuiItem clear()
Interface skeleton for implementation of different guiding applications and/or routines.
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: qcustomplot.h:3735
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 11 2022 03:59:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.