Instrument Neutral Distributed Interface INDI  2.0.2
dome_simulator.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright(c) 2014 Jasem Mutlaq. All rights reserved.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7  .
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12  .
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 *******************************************************************************/
18 
19 #pragma once
20 
21 #include "indidome.h"
22 
33 class DomeSim : public INDI::Dome
34 {
35  public:
36  DomeSim();
37  virtual ~DomeSim() = default;
38 
39  virtual bool initProperties() override;
40  const char *getDefaultName() override;
41  bool updateProperties() override;
42 
43  protected:
44  bool Connect() override;
45  bool Disconnect() override;
46 
47  void TimerHit() override;
48 
49  virtual IPState Move(DomeDirection dir, DomeMotionCommand operation) override;
50  virtual IPState MoveRel(double azDiff) override;
51  virtual IPState MoveAbs(double az) override;
52  virtual IPState Park() override;
53  virtual IPState UnPark() override;
54  virtual IPState ControlShutter(ShutterOperation operation) override;
55  virtual bool Abort() override;
56 
57  // Parking
58  virtual bool SetCurrentPark() override;
59  virtual bool SetDefaultPark() override;
60 
61  private:
62  double targetAz;
63  double shutterTimer;
64  bool SetupParms();
65 };
The DomeSim class provides an absolute position dome that supports parking, unparking,...
virtual bool Abort() override
Abort all dome motion.
virtual ~DomeSim()=default
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
virtual IPState Park() override
Goto Park Position. The park position is an absolute azimuth value.
const char * getDefaultName() override
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
bool Disconnect() override
Disconnect from device.
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
virtual IPState UnPark() override
UnPark dome. The action of the Unpark command is dome specific, but it may include opening the shutte...
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual IPState MoveAbs(double az) override
Move the Dome to an absolute azimuth.
virtual IPState MoveRel(double azDiff) override
Move the Dome to an relative position.
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual IPState ControlShutter(ShutterOperation operation) override
Open or Close shutter.
virtual IPState Move(DomeDirection dir, DomeMotionCommand operation) override
Move the Dome in a particular direction.
Class to provide general functionality of a Dome device.
Definition: indidome.h:75
ShutterOperation
Shutter operation command.
Definition: indidome.h:114
DomeMotionCommand
Definition: indidome.h:97
IPState
Property state.
Definition: indiapi.h:160