Instrument Neutral Distributed Interface INDI 2.2.5
hitecastrodcfocuser.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2016 Andy Kirkham. All rights reserved.
3
4 HitecAstroDCFocuser Focuser
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
9 .
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14 .
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*******************************************************************************/
20
21#pragma once
22
23#ifdef _USE_SYSTEM_HIDAPILIB
24#include <hidapi/hidapi.h>
25#else
26#include <indi_hidapi.h>
27#endif
28
29#include "indifocuser.h"
30#include "indiusbdevice.h"
31
33{
34 public:
35 typedef enum { IDLE, SLEWING } STATE;
36
38 virtual ~HitecAstroDCFocuser() override;
39
40 virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
41
42 protected:
43 const char *getDefaultName() override;
44 virtual bool initProperties() override;
45 virtual bool updateProperties() override;
46 virtual bool saveConfigItems(FILE *fp) override;
47
48 bool Connect() override;
49 bool Disconnect() override;
50
51 void TimerHit() override;
52
53 virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override;
54 virtual IPState MoveFocuser(FocusDirection dir, int speed, uint16_t duration) override;
55 virtual bool ReverseFocuser(bool enabled) override
56 {
57 INDI_UNUSED(enabled);
58 return true;
59 }
60
61 private:
62 hid_device *m_HIDHandle;
63 char m_StopChar;
64 STATE m_State;
65 uint16_t m_Duration;
66
67 // INumber MaxPositionN[1];
68 // INumberVectorProperty MaxPositionNP;
69
70 INDI::PropertyNumber SlewSpeedNP {1};
71
72 // ISwitch ReverseDirectionS[1];
73 // ISwitchVectorProperty ReverseDirectionSP;
74};
virtual ~HitecAstroDCFocuser() override
virtual bool ReverseFocuser(bool enabled) override
ReverseFocuser Reverse focuser motion direction.
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
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...
bool Disconnect() override
Disconnect from device.
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
virtual bool initProperties() override
Initializes the default properties for the focuser device. Sets up standard INDI properties,...
virtual bool updateProperties() override
Updates the state and definition of properties based on the current connection status....
const char * getDefaultName() override
virtual IPState MoveFocuser(FocusDirection dir, int speed, uint16_t duration) override
MoveFocuser the focuser in a particular direction with a specific speed for a finite duration.
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
virtual bool saveConfigItems(FILE *fp) override
libusb_device * dev
IPState
Property state.
Definition indiapi.h:158
#define INDI_UNUSED(x)
Definition indidevapi.h:132