Kstars

linguider.h
1/*
2 SPDX-FileCopyrightText: 2016 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "../guideinterface.h"
10
11#include <QAbstractSocket>
12#include <QTimer>
13
14class QTcpSocket;
15
16namespace Ekos
17{
18/**
19 * @class LinGuider
20 * Uses external LinGuider for guiding.
21 *
22 * @author Jasem Mutlaq
23 * @version 1.0
24 */
26{
28
29 public:
30 typedef enum {
31 GET_VER = 1,
32 SET_GUIDER_SQUARE_POS,
33 SAVE_FRAME,
34 DITHER,
35 DITHER_NO_WAIT_XY,
36 GET_DISTANCE,
37 SAVE_FRAME_DECORATED,
38 GUIDER,
39 GET_GUIDER_STATE,
40 SET_GUIDER_OVLS_POS,
41 SET_GUIDER_RETICLE_POS,
42 FIND_STAR,
43 SET_DITHERING_RANGE,
44 GET_RA_DEC_DRIFT
45 } LinGuiderCommand;
46 typedef enum { IDLE, GUIDING } LinGuiderState;
47 typedef enum { DISCONNECTED, CONNECTING, CONNECTED } LinGuiderConnection;
48
49 LinGuider();
50 virtual ~LinGuider() override = default;
51
52 bool Connect() override;
53 bool Disconnect() override;
54 bool isConnected() override { return (connection == CONNECTED); }
55
56 bool calibrate() override;
57 bool guide() override;
58 bool abort() override;
59 bool suspend() override;
60 bool resume() override;
61 bool dither(double pixels) override;
62 bool clearCalibration() override { return true;}
63
64 private slots:
65
66 void readLinGuider();
67 void onConnected();
68 void displayError(QAbstractSocket::SocketError socketError);
69
70 private:
71 void sendCommand(LinGuiderCommand command, const QString &args = QString());
72 void processResponse(LinGuiderCommand command, const QString &reply);
73
74 QTcpSocket *tcpSocket { nullptr };
75 QByteArray rawBuffer;
76
77 LinGuiderState state { IDLE };
78 LinGuiderConnection connection { DISCONNECTED };
79
80 QTimer deviationTimer;
81 QString starCenter;
82};
83}
Interface skeleton for implementation of different guiding applications and/or routines.
Uses external LinGuider for guiding.
Definition linguider.h:26
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.