Instrument Neutral Distributed Interface INDI 2.2.5
onfocus.h
Go to the documentation of this file.
1/*
2 OnFocus Focuser
3 Copyright (C) 2018 Paul de Backer ([email protected])
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
18*/
19
20#ifndef ONFOCUS_H
21#define ONFOCUS_H
22
23#include "indifocuser.h"
24
25class OnFocus : public INDI::Focuser
26{
27 public:
28 OnFocus();
29 ~OnFocus();
30
31 virtual bool Handshake() override;
32 const char * getDefaultName() override;
33 virtual bool initProperties() override;
34 virtual bool updateProperties() override;
35 virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n) override;
36 virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) override;
37 virtual IPState MoveAbsFocuser(uint32_t ticks) override;
38 virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override;
39 virtual bool AbortFocuser() override;
40 virtual void TimerHit() override;
41
42 private:
43
44 double targetPos, lastPos;
45
46 void GetFocusParams();
47 void setZero();
48 bool updateMaxPos();
49 bool updateTemperature();
50 bool updatePosition();
51 bool isMoving();
52 bool Ack();
53
54 bool MoveMyFocuser(uint32_t position);
55 bool setMaxPos(uint32_t maxPos);
56
57 INumber MaxPosN[1];
58 INumberVectorProperty MaxPosNP;
59 ISwitch SetZeroS[1];
60 ISwitchVectorProperty SetZeroSP;
61};
62
63#endif // ONFOCUS_H
OnFocus()
Definition onfocus.cpp:38
virtual bool updateProperties() override
Updates the state and definition of properties based on the current connection status....
Definition onfocus.cpp:77
virtual IPState MoveAbsFocuser(uint32_t ticks) override
MoveFocuser the focuser to an absolute position.
Definition onfocus.cpp:373
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
Definition onfocus.cpp:445
virtual bool initProperties() override
Initializes the default properties for the focuser device. Sets up standard INDI properties,...
Definition onfocus.cpp:48
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 onfocus.cpp:342
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
Definition onfocus.cpp:389
~OnFocus()
Definition onfocus.cpp:44
virtual bool Handshake() override
Performs a device-specific handshake after a connection is established. This method should be overrid...
Definition onfocus.cpp:99
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 onfocus.cpp:324
const char * getDefaultName() override
Definition onfocus.cpp:109
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
Definition onfocus.cpp:410
ISState
Switch state.
Definition indiapi.h:148
IPState
Property state.
Definition indiapi.h:158
One number descriptor.
One switch descriptor.
Number vector property descriptor.
Definition indiapi.h:317
Switch vector property descriptor.
Definition indiapi.h:365