Instrument Neutral Distributed Interface INDI  1.9.5
rotator_simulator.h
Go to the documentation of this file.
1 /*
2  INDI Rotator Simulator
3  Copyright (C) 2020 Jasem Mutlaq (mutlaqja@ikarustech.com)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 */
20 
21 #pragma once
22 
23 #include "indirotator.h"
24 
26 {
27  public:
28 
30  virtual ~RotatorSimulator() = default;
31  const char * getDefaultName() override;
32 
33  protected:
34  // Device Override
35  virtual bool Connect() override;
36  virtual bool Disconnect() override;
37  // Rotator Overrides
38  virtual IPState MoveRotator(double angle) override;
39  virtual bool SyncRotator(double angle) override;
40  virtual bool AbortRotator() override;
41 
42  // Misc.
43  virtual void TimerHit() override;
44 
45  private:
46  double m_TargetAngle {-1};
47  // 10 degrees per second
48  static const uint8_t ROTATION_RATE {10};
49 };
RotatorSimulator
Definition: rotator_simulator.h:25
IPState
IPState
Property state.
Definition: indiapi.h:158
RotatorSimulator::AbortRotator
virtual bool AbortRotator() override
AbortRotator Abort all motion.
Definition: rotator_simulator.cpp:64
INDI::Rotator
Definition: indirotator.h:45
RotatorSimulator::RotatorSimulator
RotatorSimulator()
Definition: rotator_simulator.cpp:30
RotatorSimulator::Connect
virtual bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
Definition: rotator_simulator.cpp:41
RotatorSimulator::Disconnect
virtual bool Disconnect() override
Disconnect from device.
Definition: rotator_simulator.cpp:47
indirotator.h
RotatorSimulator::MoveRotator
virtual IPState MoveRotator(double angle) override
MoveRotator Go to specific angle.
Definition: rotator_simulator.cpp:52
RotatorSimulator::~RotatorSimulator
virtual ~RotatorSimulator()=default
RotatorSimulator::getDefaultName
const char * getDefaultName() override
Definition: rotator_simulator.cpp:36
RotatorSimulator::SyncRotator
virtual bool SyncRotator(double angle) override
SyncRotator Set current angle as the supplied angle without moving the rotator.
Definition: rotator_simulator.cpp:58
RotatorSimulator::TimerHit
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
Definition: rotator_simulator.cpp:69