Instrument Neutral Distributed Interface INDI  1.9.5
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 };
lacerta_mfoc
Definition: lacerta_mfoc.h:24
lacerta_mfoc::MoveAbsFocuser
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
Definition: lacerta_mfoc.cpp:413
IPState
IPState
Property state.
Definition: indiapi.h:158
ISwitch
One switch descriptor.
lacerta_mfoc::initProperties
bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: lacerta_mfoc.cpp:74
INumber
One number descriptor.
lacerta_mfoc::ISNewSwitch
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Definition: lacerta_mfoc.cpp:176
lacerta_mfoc::updateProperties
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition: lacerta_mfoc.cpp:117
indifocuser.h
lacerta_mfoc::MoveRelFocuser
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
Definition: lacerta_mfoc.cpp:443
_INumberVectorProperty
Number vector property descriptor.
Definition: indiapi.h:317
lacerta_mfoc::saveConfigItems
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the Device Port and Focuser Presets in the configuration file
Definition: lacerta_mfoc.cpp:454
lacerta_mfoc::lacerta_mfoc
lacerta_mfoc()
Definition: lacerta_mfoc.cpp:41
lacerta_mfoc::Handshake
virtual bool Handshake() override
perform handshake with device to check communication
Definition: lacerta_mfoc.cpp:146
name
const char * name
Definition: indiserver.c:116
INDI::FocuserInterface::FocusDirection
FocusDirection
Definition: indifocuserinterface.h:66
lacerta_mfoc::getDefaultName
const char * getDefaultName() override
Definition: lacerta_mfoc.cpp:49
ISState
ISState
Switch state.
Definition: indiapi.h:148
lacerta_mfoc::SetFocuserBacklash
virtual bool SetFocuserBacklash(int32_t steps) override
SetFocuserBacklash Set the focuser backlash compensation value.
Definition: lacerta_mfoc.cpp:318
INDI::Focuser
Definition: indifocuser.h:43
lacerta_mfoc::ISNewNumber
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
Definition: lacerta_mfoc.cpp:294
lacerta_mfoc::ISGetProperties
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
Definition: lacerta_mfoc.cpp:57
_ISwitchVectorProperty
Switch vector property descriptor.
Definition: indiapi.h:365
lacerta_mfoc::SetFocuserMaxPosition
virtual bool SetFocuserMaxPosition(uint32_t ticks) override
SetFocuserMaxPosition Update focuser maximum position. It only updates the PresetNP property limits.
Definition: lacerta_mfoc.cpp:384