Kstars
7#include "indirotator.h"
12bool Rotator::setAbsoluteAngle(
double angle)
14 auto nvp = getNumber(
"ABS_ROTATOR_ANGLE");
19 if (std::abs(angle -
nvp->at(0)->getValue()) < 0.01)
22 nvp->at(0)->setValue(angle);
28bool Rotator::setAbsoluteSteps(uint32_t
steps)
30 auto nvp = getNumber(
"ABS_ROTATOR_POSITION");
35 if (
steps ==
static_cast<uint32_t
>(
nvp->at(0)->getValue()))
44bool Rotator::setReversed(
bool enabled)
51 if ( (enabled &&
svp->sp[0].s ==
ISS_ON) ||
63void Rotator::registerProperty(INDI::Property
prop)
65 if (
prop.isNameMatch(
"ABS_ROTATOR_ANGLE"))
67 else if (
prop.isNameMatch(
"ROTATOR_REVERSE"))
71void Rotator::processNumber(INDI::Property
prop)
74 if (
nvp->isNameMatch(
"ABS_ROTATOR_ANGLE"))
76 if (std::abs(
nvp->at(0)->getValue() - m_AbsoluteAngle) > 0 ||
nvp->getState() != m_AbsoluteAngleState)
78 m_AbsoluteAngle =
nvp->at(0)->getValue();
79 m_AbsoluteAngleState =
nvp->getState();
80 emit newAbsoluteAngle(m_AbsoluteAngle, m_AbsoluteAngleState);
85void Rotator::processSwitch(INDI::Property
prop)
88 if (
svp->isNameMatch(
"ROTATOR_REVERSE"))
90 auto reverse =
svp->findOnSwitchIndex() == 0;
91 if (m_Reversed != reverse)
94 emit reverseToggled(m_Reversed);
void sendNewProperty(INDI::Property prop)
Send new property command to server.
INDI::PropertyView< ISwitch > * getSwitch(const QString &name) const
ISD is a collection of INDI Standard Devices.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:03 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.