32 : m_DefaultDevice(defaultDevice)
43 ManualAdjustmentNP.fill(m_DefaultDevice->getDeviceName(),
"PAC_MANUAL_ADJUSTMENT",
"Manual Adjustment",
48 AbortSP.fill(m_DefaultDevice->getDeviceName(),
"PAC_ABORT_MOTION",
"Abort Motion",
54 PositionNP.fill(m_DefaultDevice->getDeviceName(),
"PAC_POSITION",
"Position",
58 SpeedNP[0].fill(
"PAC_SPEED_VALUE",
"Speed",
"%.0f", 1, 10, 1, 1);
59 SpeedNP.fill(m_DefaultDevice->getDeviceName(),
"PAC_SPEED",
"Speed", group,
IP_RW, 60,
IPS_OK);
64 AZReverseSP.fill(m_DefaultDevice->getDeviceName(),
"PAC_AZ_REVERSE",
"Azimuth Reverse", group,
IP_RW,
70 ALTReverseSP.fill(m_DefaultDevice->getDeviceName(),
"PAC_ALT_REVERSE",
"Altitude Reverse", group,
IP_RW,
77 HomeSP.fill(m_DefaultDevice->getDeviceName(),
"PAC_HOME",
"Home", group,
IP_RW,
81 SyncNP[
SYNC_AZ].fill(
"SYNC_AZ",
"Azimuth (deg)",
"%.4f", -360, 360, 0, 0);
82 SyncNP[
SYNC_ALT].fill(
"SYNC_ALT",
"Altitude (deg)",
"%.4f", -90, 90, 0, 0);
83 SyncNP.fill(m_DefaultDevice->getDeviceName(),
"PAC_SYNC",
"Sync Position",
89 BacklashSP.fill(m_DefaultDevice->getDeviceName(),
"PAC_BACKLASH_ENABLED",
"Backlash", group,
IP_RW,
95 BacklashNP.fill(m_DefaultDevice->getDeviceName(),
"PAC_BACKLASH_STEPS",
"Backlash Steps",
101 if (m_DefaultDevice->isConnected())
104 m_DefaultDevice->defineProperty(
AbortSP);
108 m_DefaultDevice->defineProperty(
SpeedNP);
115 m_DefaultDevice->defineProperty(
HomeSP);
117 m_DefaultDevice->defineProperty(
SyncNP);
127 m_DefaultDevice->deleteProperty(
AbortSP);
131 m_DefaultDevice->deleteProperty(
SpeedNP);
138 m_DefaultDevice->deleteProperty(
HomeSP);
140 m_DefaultDevice->deleteProperty(
SyncNP);
152 ISState *states,
char *names[],
int n)
183 m_DefaultDevice->updateProperty(
AZReverseSP, states, names,
n, [
this, states, names,
n]()
194 m_DefaultDevice->updateProperty(
ALTReverseSP, states, names,
n, [
this, states, names,
n]()
205 HomeSP.update(states, names,
n);
253 m_DefaultDevice->updateProperty(
BacklashSP, states, names,
n, [
this, states, names,
n]()
266 double values[],
char *names[],
int n)
272 m_DefaultDevice->updateProperty(
SpeedNP, values, names,
n, [
this, values]()
274 return SetPACSpeed(
static_cast<uint16_t
>(values[0]));
289 if (azStep != 0.0 && altStep != 0.0)
293 azState = altState = state;
297 if (azStep != 0.0) azState =
MoveAZ(azStep);
298 if (altStep != 0.0) altState =
MoveALT(altStep);
315 m_DefaultDevice->updateProperty(
SyncNP, values, names,
n, [
this, values, names,
n]()
317 SyncNP.update(values, names,
n);
320 return (azOk && altOk);
327 m_DefaultDevice->updateProperty(
BacklashNP, values, names,
n, [
this, values, names,
n]()
332 return (azOk && altOk);
391 "PAC device does not support aborting motion.");
399 "PAC device does not support variable speed.");
407 "PAC device does not support reversing azimuth direction.");
415 "PAC device does not support reversing altitude direction.");
422 "PAC device does not support setting home.");
429 "PAC device does not support returning to home.");
436 "PAC device does not support resetting home.");
444 "PAC device does not support syncing azimuth position.");
452 "PAC device does not support syncing altitude position.");
460 "PAC device does not support backlash compensation.");
468 "PAC device does not support setting azimuth backlash.");
476 "PAC device does not support setting altitude backlash.");
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
virtual bool SetPACSpeed(uint16_t speed)
SetPACSpeed Set the motor speed used for axis movements.
INDI::PropertyNumber SyncNP
virtual bool ReverseALT(bool enabled)
ReverseALT Reverse the direction of altitude axis movement.
virtual bool ResetHome()
ResetHome Clear the stored home reference without moving.
virtual bool SetBacklashEnabled(bool enabled)
SetBacklashEnabled Enable or disable hardware backlash compensation.
INDI::PropertySwitch BacklashSP
virtual IPState GoHome()
GoHome Slew both axes back to the home (0, 0) position.
PACInterface(DefaultDevice *device)
@ MANUAL_AZ
Azimuth step in degrees: positive = East, negative = West.
@ MANUAL_ALT
Altitude step in degrees: positive = North, negative = South.
bool saveConfigItems(FILE *fp)
saveConfigItems Save PAC interface properties to config file. Call this from your driver's saveConfig...
virtual bool SetHome()
SetHome Mark the current position as the home (zero) reference.
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process PAC number properties.
INDI::PropertyNumber SpeedNP
@ POSITION_ALT
Current altitude position in degrees.
@ POSITION_AZ
Current azimuth position in degrees.
void initProperties(const char *group)
initProperties Initialize PAC properties. Call this from your driver's initProperties().
virtual bool SetBacklashALT(int32_t steps)
SetBacklashALT Set the altitude axis backlash compensation value in steps.
virtual bool SetBacklashAZ(int32_t steps)
SetBacklashAZ Set the azimuth axis backlash compensation value in steps.
virtual bool AbortMotion()
AbortMotion Abort all axis motion immediately.
virtual bool ReverseAZ(bool enabled)
ReverseAZ Reverse the direction of azimuth axis movement.
INDI::PropertyNumber PositionNP
INDI::PropertyNumber ManualAdjustmentNP
virtual IPState MoveAZ(double degrees)
Move the azimuth axis by the given number of degrees.
bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process PAC switch properties.
bool updateProperties()
updateProperties Define or delete properties based on connection state. Call this from your driver's ...
virtual bool SyncALT(double degrees)
SyncALT Sync the altitude position reference to the given value without moving.
INDI::PropertySwitch ALTReverseSP
virtual bool SyncAZ(double degrees)
SyncAZ Sync the azimuth position reference to the given value without moving.
virtual IPState MoveBoth(double azDegrees, double altDegrees)
MoveBoth Move both axes in a single coordinated operation.
virtual IPState MoveALT(double degrees)
MoveALT Move the altitude axis by the given number of degrees.
INDI::PropertySwitch HomeSP
INDI::PropertySwitch AZReverseSP
INDI::PropertySwitch AbortSP
INDI::PropertyNumber BacklashNP
const char * IUFindOnSwitchName(ISState *states, char *names[], int n)
Returns the name of the first ON switch it finds in the supplied arguments.
*brief user defined string literal for JSON values *sa std::size_t n
#define DEBUGDEVICE(device, priority, msg)
Namespace to encapsulate INDI client, drivers, and mediator classes.