Instrument Neutral Distributed Interface INDI  1.9.5
pegasus_scopsoag.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright(c) 2021 Chrysikos Efstathios. All rights reserved.
3 
4  Pegasus ScopsOAG
5 
6  This program is free software; you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by the Free
8  Software Foundation; either version 2 of the License, or (at your option)
9  any later version.
10 
11  This program is distributed in the hope that it will be useful, but WITHOUT
12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 
21  The full GNU General Public License is included in this distribution in the
22  file called LICENSE.
23 *******************************************************************************/
24 
25 #pragma once
26 
27 #include "indifocuser.h"
28 
30 {
31  public:
33  virtual ~PegasusScopsOAG() override = default;
34 
35  virtual bool Handshake() override;
36  const char *getDefaultName() override;
37  virtual bool initProperties() override;
38  virtual bool updateProperties() override;
39  virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
40 
41  protected:
42  virtual IPState MoveAbsFocuser(uint32_t targetTicks) override;
43  virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override;
44  virtual bool AbortFocuser() override;
45  virtual void TimerHit() override;
46 
47  virtual bool SyncFocuser(uint32_t ticks) override;
48  virtual bool saveConfigItems(FILE *fp) override;
49 
50  private:
51  bool updateFocusParams();
52  bool move(uint32_t newPosition);
53  bool setLedEnabled(bool enable);
54  bool ack();
55  void ignoreResponse();
56 
57 
58  uint32_t currentPosition { 0 };
59  uint32_t targetPosition { 0 };
60  bool isMoving = false;
61 
62  // LED
63  ISwitch LEDS[2];
65  enum { LED_OFF, LED_ON };
66 
67  // Firmware Version
68  IText FirmwareVersionT[1] {};
69  ITextVectorProperty FirmwareVersionTP;
70 };
PegasusScopsOAG::AbortFocuser
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
Definition: pegasus_scopsoag.cpp:506
PegasusScopsOAG::PegasusScopsOAG
PegasusScopsOAG()
Definition: pegasus_scopsoag.cpp:43
PegasusScopsOAG::initProperties
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: pegasus_scopsoag.cpp:54
IPState
IPState
Property state.
Definition: indiapi.h:158
PegasusScopsOAG::SyncFocuser
virtual bool SyncFocuser(uint32_t ticks) override
SyncFocuser Set current position to ticks without moving the focuser.
Definition: pegasus_scopsoag.cpp:184
ISwitch
One switch descriptor.
PegasusScopsOAG::Handshake
virtual bool Handshake() override
perform handshake with device to check communication
Definition: pegasus_scopsoag.cpp:118
PegasusScopsOAG::MoveAbsFocuser
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
Definition: pegasus_scopsoag.cpp:443
PegasusScopsOAG::updateProperties
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition: pegasus_scopsoag.cpp:96
indifocuser.h
_ITextVectorProperty
Text vector property descriptor.
Definition: indiapi.h:244
PegasusScopsOAG::MoveRelFocuser
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
Definition: pegasus_scopsoag.cpp:457
IText
One text descriptor.
PegasusScopsOAG::saveConfigItems
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the Device Port and Focuser Presets in the configuration file
Definition: pegasus_scopsoag.cpp:524
PegasusScopsOAG::getDefaultName
const char * getDefaultName() override
Definition: pegasus_scopsoag.cpp:132
PegasusScopsOAG::~PegasusScopsOAG
virtual ~PegasusScopsOAG() override=default
name
const char * name
Definition: indiserver.c:116
INDI::FocuserInterface::FocusDirection
FocusDirection
Definition: indifocuserinterface.h:66
PegasusScopsOAG
Definition: pegasus_scopsoag.h:29
PegasusScopsOAG::ISNewSwitch
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Definition: pegasus_scopsoag.cpp:232
ISState
ISState
Switch state.
Definition: indiapi.h:148
INDI::Focuser
Definition: indifocuser.h:43
PegasusScopsOAG::TimerHit
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
Definition: pegasus_scopsoag.cpp:478
_ISwitchVectorProperty
Switch vector property descriptor.
Definition: indiapi.h:365