Instrument Neutral Distributed Interface INDI  2.0.2
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  virtual bool ReverseRotator(bool enabled) override;
45 
46  private:
47  double m_TargetAngle {-1};
48  // 10 degrees per second
49  static const uint8_t ROTATION_RATE {10};
50 };
virtual bool AbortRotator() override
AbortRotator Abort all motion.
virtual ~RotatorSimulator()=default
virtual IPState MoveRotator(double angle) override
MoveRotator Go to specific angle.
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
const char * getDefaultName() override
virtual bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual bool Disconnect() override
Disconnect from device.
virtual bool SyncRotator(double angle) override
SyncRotator Set current angle as the supplied angle without moving the rotator.
virtual bool ReverseRotator(bool enabled) override
ReverseRotator Reverse the direction of the rotator. CW is usually the normal direction,...
IPState
Property state.
Definition: indiapi.h:160