Instrument Neutral Distributed Interface INDI 2.2.5
pegasus_prodigyMF.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2021 Chrysikos Efstathios. All rights reserved.
3
4 Pegasus ProdigyMF
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2 of the License, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20
21 The full GNU General Public License is included in this distribution in the
22 file called LICENSE.
23*******************************************************************************/
24#pragma once
25
26#include "indifocuser.h"
27
29{
30 public:
32 virtual ~PegasusProdigyMF() override = default;
33
34 virtual bool Handshake() override;
35 const char *getDefaultName() override;
36 virtual bool initProperties() override;
37 virtual bool updateProperties() override;
38 virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
39
40 protected:
41 virtual IPState MoveAbsFocuser(uint32_t targetTicks) override;
42 virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override;
43 virtual bool AbortFocuser() override;
44 virtual void TimerHit() override;
45
46 virtual bool SyncFocuser(uint32_t ticks) override;
47 virtual bool ReverseFocuser(bool enabled) override;
48 virtual bool saveConfigItems(FILE *fp) override;
49
50 private:
51 bool updateFocusParams();
52 bool move(uint32_t newPosition);
53 bool setMaxSpeed(uint16_t speed);
54 bool ack();
55 void ignoreResponse();
56
57 uint32_t currentPosition { 0 };
58 uint32_t targetPosition { 0 };
59 bool isMoving = false;
60
61 // Temperature probe
62 INumber TemperatureN[1];
63 INumberVectorProperty TemperatureNP;
64
65
66 // Maximum Speed
67 INumber MaxSpeedN[1];
68 INumberVectorProperty MaxSpeedNP;
69
70 // Firmware Version
71 IText FirmwareVersionT[1] {};
72 ITextVectorProperty FirmwareVersionTP;
73};
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
virtual ~PegasusProdigyMF() override=default
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
const char * getDefaultName() override
virtual bool Handshake() override
Performs a device-specific handshake after a connection is established. This method should be overrid...
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Processes incoming new number values from the client for this device. Handles updates to FocuserInter...
virtual bool updateProperties() override
Updates the state and definition of properties based on the current connection status....
virtual bool SyncFocuser(uint32_t ticks) override
SyncFocuser Set current position to ticks without moving the focuser.
virtual bool initProperties() override
Initializes the default properties for the focuser device. Sets up standard INDI properties,...
virtual bool ReverseFocuser(bool enabled) override
ReverseFocuser Reverse focuser motion direction.
virtual bool saveConfigItems(FILE *fp) override
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
IPState
Property state.
Definition indiapi.h:158
One number descriptor.
One text descriptor.
Number vector property descriptor.
Definition indiapi.h:317
Text vector property descriptor.
Definition indiapi.h:244