Instrument Neutral Distributed Interface INDI  2.0.2
lacerta_mfoc.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright(c) 2018 Franck Le Rhun. All rights reserved.
3  Copyright(c) 2018 Christian Liska. All rights reserved.
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
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  Library General Public License for more details.
13  .
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 *******************************************************************************/
19 
20 #pragma once
21 
22 #include "indifocuser.h"
23 
25 {
26  public:
27  lacerta_mfoc();
28 
29  bool initProperties() override;
30  void ISGetProperties(const char *dev) override;
31  bool updateProperties() override;
32 
33  const char *getDefaultName() override;
34 
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 
38  protected:
39  virtual bool Handshake() override;
40  virtual IPState MoveAbsFocuser(uint32_t targetTicks) override;
41  virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override;
42  virtual bool SetFocuserMaxPosition(uint32_t ticks) override;
43  virtual bool SetFocuserBacklash(int32_t steps) override;
44  virtual bool saveConfigItems(FILE *fp) override;
45 
46  private:
47  //virtual bool SetBacklash(double values[], char *names[], int n);
48  virtual bool SetTempComp(double values[], char *names[], int n);
49  virtual uint32_t GetAbsFocuserPosition();
50 
51  // Backlash
52  // INumberVectorProperty BacklashNP;
53  // INumber BacklashN[1];
54 
55  // Temperature Compensation
56  INumberVectorProperty TempCompNP;
57  INumber TempCompN[1];
58 
59  enum
60  {
61  MODE_TDIR_BOTH,
62  MODE_TDIR_IN,
63  MODE_TDIR_OUT,
64  MODE_COUNT_TEMP_DIR
65  };
66  ISwitchVectorProperty TempTrackDirSP;
67  ISwitch TempTrackDirS[MODE_COUNT_TEMP_DIR];
68 
69  enum
70  {
71  MODE_SAVED_ON,
72  MODE_SAVED_OFF,
73  MODE_COUNT_SAVED
74  };
75  ISwitchVectorProperty StartSavedPositionSP;
76  ISwitch StartSavedPositionS[MODE_COUNT_SAVED];
77 
78 };
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool SetFocuserMaxPosition(uint32_t ticks) override
SetFocuserMaxPosition Update focuser maximum position. It only updates the PresetNP property limits.
bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
virtual bool Handshake() override
perform handshake with device to check communication
const char * getDefaultName() override
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual bool SetFocuserBacklash(int32_t steps) override
SetFocuserBacklash Set the focuser backlash compensation value.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the Device Port and Focuser Presets in the configuration file
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
ISState
Switch state.
Definition: indiapi.h:150
IPState
Property state.
Definition: indiapi.h:160
One number descriptor.
One switch descriptor.
Number vector property descriptor.
Definition: indiapi.h:319
Switch vector property descriptor.
Definition: indiapi.h:367