Instrument Neutral Distributed Interface INDI  2.0.2
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 #include "hidapi.h"
24 #include "indifocuser.h"
25 #include "indiusbdevice.h"
26 
28 {
29  public:
30  typedef enum { IDLE, SLEWING } STATE;
31 
33  virtual ~HitecAstroDCFocuser() override;
34 
35  virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
36 
37  protected:
38  const char *getDefaultName() override;
39  virtual bool initProperties() override;
40  virtual bool updateProperties() override;
41  virtual bool saveConfigItems(FILE *fp) override;
42 
43  bool Connect() override;
44  bool Disconnect() override;
45 
46  void TimerHit() override;
47 
48  virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override;
49  virtual IPState MoveFocuser(FocusDirection dir, int speed, uint16_t duration) override;
50  virtual bool ReverseFocuser(bool enabled) override
51  {
52  INDI_UNUSED(enabled);
53  return true;
54  }
55 
56  private:
57  hid_device *m_HIDHandle;
58  char m_StopChar;
59  STATE m_State;
60  uint16_t m_Duration;
61 
62  // INumber MaxPositionN[1];
63  // INumberVectorProperty MaxPositionNP;
64 
65  INumber SlewSpeedN[1];
66  INumberVectorProperty SlewSpeedNP;
67 
68  // ISwitch ReverseDirectionS[1];
69  // ISwitchVectorProperty ReverseDirectionSP;
70 };
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
Process the client newNumber command.
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
Initilize properties initial state and value. The child class must implement this function.
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
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
saveConfigItems Saves the Device Port and Focuser Presets in the configuration file
libusb_device * dev
Definition: indiusbdevice.h:40
IPState
Property state.
Definition: indiapi.h:160
#define INDI_UNUSED(x)
Definition: indidevapi.h:131
One number descriptor.
Number vector property descriptor.
Definition: indiapi.h:319