37 return "Rotator Simulator";
54 m_TargetAngle =
range360(360 - angle);
88 if (std::fabs(m_TargetAngle -
GotoRotatorNP[0].getValue()) <= ROTATION_RATE)
96 double a = m_TargetAngle;
98 int sign = (a - b >= 0 && a - b <= 180) || (a - b <= -180 && a - b >= -360) ? 1 : -1;
99 double diff = ROTATION_RATE * sign;
uint32_t getCurrentPollingPeriod() const
getCurrentPollingPeriod Return the current polling period.
int SetTimer(uint32_t ms)
Set a timer to call the function TimerHit after ms milliseconds.
void setState(IPState state)
void apply(const char *format,...) const ATTRIBUTE_FORMAT_PRINTF(2
void SetCapability(uint32_t cap)
SetRotatorCapability sets the Rotator capabilities. All capabilities must be initialized.
INDI::PropertySwitch ReverseRotatorSP
INDI::PropertyNumber GotoRotatorNP
virtual bool AbortRotator() override
AbortRotator Abort all motion.
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,...
double range360(double r)
range360 Limits an angle to be between 0-360 degrees.
Implementations for common driver routines.
std::unique_ptr< RotatorSimulator > rotatorSimulator(new RotatorSimulator())