Instrument Neutral Distributed Interface INDI  2.0.2
lacerta_mfoc_fmc.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:
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  virtual bool SyncFocuser(uint32_t ticks) override;
46  virtual bool AbortFocuser() override;
47 
48  private:
49  virtual bool SetTempComp(double values[], char *names[], int n);
50  virtual uint32_t GetAbsFocuserPosition();
51  virtual void IgnoreResponse();
52  virtual void IgnoreButLogResponse();
53  virtual bool SetCurrHold(int currHoldValue);
54  virtual bool SetCurrMove(int currMoveValue);
55 
56  // Temperature Compensation
57  INumberVectorProperty TempCompNP;
58  INumber TempCompN[1];
59 
60  // current holding
61  INumberVectorProperty CurrentHoldingNP;
62  INumber CurrentHoldingN[1];
63 
64  // current moving
65  INumberVectorProperty CurrentMovingNP;
66  INumber CurrentMovingN[1];
67 
68  enum
69  {
70  MODE_TDIR_BOTH,
71  MODE_TDIR_IN,
72  MODE_TDIR_OUT,
73  MODE_COUNT_TEMP_DIR
74  };
75  ISwitchVectorProperty TempTrackDirSP;
76  ISwitch TempTrackDirS[MODE_COUNT_TEMP_DIR];
77 
78  enum
79  {
80  MODE_SAVED_ON,
81  MODE_SAVED_OFF,
82  MODE_COUNT_SAVED
83  };
84  ISwitchVectorProperty StartSavedPositionSP;
85  ISwitch StartSavedPositionS[MODE_COUNT_SAVED];
86 };
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool SyncFocuser(uint32_t ticks) override
SyncFocuser Set current position to ticks without moving the focuser.
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
virtual bool SetFocuserBacklash(int32_t steps) override
SetFocuserBacklash Set the focuser backlash compensation value.
bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
virtual bool SetFocuserMaxPosition(uint32_t ticks) override
SetFocuserMaxPosition Update focuser maximum position. It only updates the PresetNP property limits.
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 IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the Device Port and Focuser Presets in the configuration file
const char * getDefaultName() override
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
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