Instrument Neutral Distributed Interface INDI 2.2.5
wanderer_rotator_base.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2025 Frank Wang & Jérémie Klein. All rights reserved.
3
4 WandererRotator Base
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
25#pragma once
26
27#include "defaultdevice.h"
28#include "indirotator.h"
30#include "indipropertyswitch.h"
31
33{
34public:
36
37 bool initProperties() override;
38 bool updateProperties() override;
39 bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
40 bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
41 bool saveConfigItems(FILE *fp) override;
42
43protected:
44 virtual const char * getDefaultName() override = 0;
45 virtual const char * getRotatorHandshakeName() = 0;
47 virtual int getStepsPerDegree() = 0;
48
49 IPState MoveRotator(double angle) override;
50 IPState HomeRotator() override;
51 bool ReverseRotator(bool enabled) override;
52 bool AbortRotator() override;
53 void TimerHit() override;
54
55 bool Handshake() override;
56 bool sendCommand(std::string command);
57 bool Move(const char *cmd);
58
62
63 int firmware = 0;
64 double M_angleread = 0;
65 double M_backlashread = 0;
66 double M_reverseread = 0;
67 double initangle = 0;
68 bool haltcommand = false;
69 bool ReverseState = false;
70 double backlash = 0.5;
71 double accuracy = 0.0;
72 double positionhistory = 0;
73 int estime = 0;
74 int nowtime = 0;
75
76 enum
77 {
79 };
80};
INDI::PropertyNumber BacklashNP
bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the reverse direction property in the configuration file
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
bool Handshake() override
perform handshake with device to check communication
bool ReverseRotator(bool enabled) override
ReverseRotator Reverse the direction of the rotator. CW is usually the normal direction,...
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual const char * getRotatorHandshakeName()=0
bool AbortRotator() override
AbortRotator Abort all motion.
bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
IPState MoveRotator(double angle) override
MoveRotator Go to specific angle.
INDI::PropertyNumber AccuracyNP
IPState HomeRotator() override
WandererRotatorBase::HomeRotator.
bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual const char * getDefaultName() override=0
virtual int getMinimumCompatibleFirmwareVersion()=0
virtual int getStepsPerDegree()=0
bool Move(const char *cmd)
bool sendCommand(std::string command)
INDI::PropertySwitch SetZeroSP
ISState
Switch state.
Definition indiapi.h:148
IPState
Property state.
Definition indiapi.h:158
uint8_t cmd[4]
Definition pwc-ioctl.h:2