Instrument Neutral Distributed Interface INDI 2.2.5
iafscaa.h
Go to the documentation of this file.
1/*
2 iOptron iAFS Focuser Rotator INDI driver
3
4 Copyright (C) 2024 Jasem Mutlaq
5 Copyright (C) 2025 Joe Zhou
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21*/
22#pragma once
23
24#include "indicom.h"
25#include "indifocuser.h"
27
28#include <stdint.h>
29#include <map>
30
31
33{
34 public:
37
38 virtual bool Handshake() override;
39 const char * getDefaultName() override;
40 virtual bool initProperties() override;
41 virtual bool updateProperties() override;
42 virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) override;
43 virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
44 virtual IPState MoveAbsFocuser(uint32_t ticks) override;
45 virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override;
46 virtual bool AbortFocuser() override;
47 virtual void TimerHit() override;
48 virtual bool ReverseFocuser(bool enabled) override;
49 virtual bool SetFocuserMaxPosition(uint32_t ticks) override;
50 // Rotator Overrides
51 virtual IPState MoveRotator(double angle) override;
52 virtual bool ReverseRotator(bool enabled) override;
53 virtual bool SyncRotator(double angle) override;
54 virtual bool AbortRotator() override;
55
56
57 private:
58 bool m_isMoving {false};
59 bool m_Reversed {false};
60
61 void GetFocusParams();
62 void setZero();
63 bool updateInfo();
64 bool updateInforotator();
65 bool Ack();
66 bool MoveMyFocuser(uint32_t position);
67 bool MoveMyRotator(double angle);
68 bool mr_isMoving {false};
69 bool mr_Reversed {false};
70 INDI::PropertyNumber TemperatureNP {1};
71 INDI::PropertySwitch SetZeroSP {1};
72 // Rotator Functions
73 IPState MoveAbsRotatorAngle(double angle);
74 bool reverseRotator(bool enable);
75 bool getFirmware();
76 bool setCaaSize(double caasize);
77 // Rotator Properties
78
79 INDI::PropertyText FirmwareTP {1};
80 INDI::PropertyNumber RotatorSize {1};
81 INDI::PropertyText StatusTP {1};
82};
virtual bool SyncRotator(double angle) override
SyncRotator Set current angle as the supplied angle without moving the rotator.
Definition iafscaa.cpp:656
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...
Definition iafscaa.cpp:813
virtual bool Handshake() override
Performs a device-specific handshake after a connection is established. This method should be overrid...
Definition iafscaa.cpp:145
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Processes incoming new switch states from the client for this device. Handles updates to FocuserInter...
Definition iafscaa.cpp:512
virtual IPState MoveAbsFocuser(uint32_t ticks) override
MoveFocuser the focuser to an absolute position.
Definition iafscaa.cpp:561
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
Definition iafscaa.cpp:581
virtual bool AbortRotator() override
AbortRotator Abort all motion.
Definition iafscaa.cpp:637
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
Definition iafscaa.cpp:616
virtual bool ReverseFocuser(bool enabled) override
ReverseFocuser Reverse focuser motion direction.
Definition iafscaa.cpp:466
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
Definition iafscaa.cpp:602
virtual bool initProperties() override
Initializes the default properties for the focuser device. Sets up standard INDI properties,...
Definition iafscaa.cpp:64
const char * getDefaultName() override
Definition iafscaa.cpp:161
virtual bool ReverseRotator(bool enabled) override
ReverseRotator Reverse the direction of the rotator. CW is usually the normal direction,...
Definition iafscaa.cpp:682
virtual bool updateProperties() override
Updates the state and definition of properties based on the current connection status....
Definition iafscaa.cpp:112
virtual bool SetFocuserMaxPosition(uint32_t ticks) override
SetFocuserMaxPosition Update focuser maximum position. It only updates the PresetNP property limits.
Definition iafscaa.cpp:433
virtual IPState MoveRotator(double angle) override
MoveRotator Go to specific angle.
Definition iafscaa.cpp:750
ISState
Switch state.
Definition indiapi.h:148
IPState
Property state.
Definition indiapi.h:158
Implementations for common driver routines.