Kstars

hysteresisguider.h
1/*
2 SPDX-FileCopyrightText: 2025 Hy Murveit <hy@murveit.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QDateTime>
10
11class HysteresisGuider
12{
13 public:
14 HysteresisGuider(const QString &id);
15 ~HysteresisGuider() {}
16
17 void setGain(double gain)
18 {
19 if (gain >= 0 && gain <= 1.0)
20 m_Gain = gain;
21 }
22 void setHysteresis(double hysteresis)
23 {
24 if (hysteresis >= 0 && hysteresis <= 1.0)
25 m_Hysteresis = hysteresis;
26 }
27 void setMinMove(double minMove)
28 {
29 if (minMove >= 0)
30 m_MinMove = minMove;
31 }
32
33 // Input is time in seconds and offset in arc-seconds.
34 // Returns an arc-second correction
35 // (i.e. guide pulse should correct that many arcseconds)
36 double guide(double offset);
37
38 void reset();
39
40 private:
41 double m_Gain { 0.6 };
42 double m_Hysteresis { 0.1 };
43 double m_MinMove { 0.0 };
44
45 QString m_ID;
46 QDateTime m_LastGuideTime;
47 int m_GuiderIteration { 0 };
48 double m_LastOutput { 0 };
49};
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 25 2025 11:58:35 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.