37 return "Rotator Simulator";
54 m_TargetAngle =
range360(360 - angle);
87 if (std::fabs(m_TargetAngle -
GotoRotatorN[0].value) <= ROTATION_RATE)
95 double a = m_TargetAngle;
97 int sign = (a - b >= 0 && a - b <= 180) || (a - b <= -180 && a - b >= -360) ? 1 : -1;
98 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.
INumberVectorProperty GotoRotatorNP
void SetCapability(uint32_t cap)
SetRotatorCapability sets the Rotator capabilities. All capabilities must be initialized.
ISwitch ReverseRotatorS[2]
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.
void IDSetNumber(const INumberVectorProperty *nvp, const char *fmt,...)
std::unique_ptr< RotatorSimulator > rotatorSimulator(new RotatorSimulator())