|
Instrument Neutral Distributed Interface INDI 2.2.5
|
#include <indipacinterface.h>
Public Types | |
| enum | { MANUAL_AZ , MANUAL_ALT } |
| enum | { POSITION_AZ , POSITION_ALT } |
| enum | { PAC_HAS_SPEED = 1 << 0 , PAC_CAN_REVERSE = 1 << 1 , PAC_HAS_POSITION = 1 << 2 , PAC_CAN_HOME = 1 << 3 , PAC_HAS_BACKLASH = 1 << 4 , PAC_CAN_SYNC = 1 << 5 } |
| PAC capability flags passed to SetCapability(). More... | |
Public Member Functions | |
| uint32_t | GetCapability () const |
| void | SetCapability (uint32_t cap) |
| SetCapability sets the PAC device capabilities. Call this in the driver constructor. | |
| bool | HasSpeed () |
| bool | CanReverse () |
| bool | HasPosition () |
| bool | CanHome () |
| bool | HasBacklash () |
| bool | CanSync () |
Public Attributes | |
| enum INDI::PACInterface:: { ... } | PACCapability |
| PAC capability flags passed to SetCapability(). | |
Protected Types | |
| enum | { HOME_SET , HOME_GO , HOME_RESET } |
| enum | { SYNC_AZ , SYNC_ALT } |
| enum | { BACKLASH_AZ , BACKLASH_ALT } |
Protected Member Functions | |
| PACInterface (DefaultDevice *device) | |
| virtual | ~PACInterface ()=default |
| virtual IPState | MoveAZ (double degrees) |
| Move the azimuth axis by the given number of degrees. | |
| virtual IPState | MoveALT (double degrees) |
| MoveALT Move the altitude axis by the given number of degrees. | |
| virtual IPState | MoveBoth (double azDegrees, double altDegrees) |
| MoveBoth Move both axes in a single coordinated operation. | |
| virtual bool | AbortMotion () |
| AbortMotion Abort all axis motion immediately. | |
| virtual bool | SetPACSpeed (uint16_t speed) |
| SetPACSpeed Set the motor speed used for axis movements. | |
| virtual bool | ReverseAZ (bool enabled) |
| ReverseAZ Reverse the direction of azimuth axis movement. | |
| virtual bool | ReverseALT (bool enabled) |
| ReverseALT Reverse the direction of altitude axis movement. | |
| virtual bool | SetHome () |
| SetHome Mark the current position as the home (zero) reference. | |
| virtual IPState | GoHome () |
| GoHome Slew both axes back to the home (0, 0) position. | |
| virtual bool | ResetHome () |
| ResetHome Clear the stored home reference without moving. | |
| virtual bool | SyncAZ (double degrees) |
| SyncAZ Sync the azimuth position reference to the given value without moving. | |
| virtual bool | SyncALT (double degrees) |
| SyncALT Sync the altitude position reference to the given value without moving. | |
| virtual bool | SetBacklashEnabled (bool enabled) |
| SetBacklashEnabled Enable or disable hardware backlash compensation. | |
| virtual bool | SetBacklashAZ (int32_t steps) |
| SetBacklashAZ Set the azimuth axis backlash compensation value in steps. | |
| virtual bool | SetBacklashALT (int32_t steps) |
| SetBacklashALT Set the altitude axis backlash compensation value in steps. | |
| void | initProperties (const char *group) |
| initProperties Initialize PAC properties. Call this from your driver's initProperties(). | |
| bool | updateProperties () |
| updateProperties Define or delete properties based on connection state. Call this from your driver's updateProperties(). | |
| bool | processSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) |
| Process PAC switch properties. | |
| bool | processNumber (const char *dev, const char *name, double values[], char *names[], int n) |
| Process PAC number properties. | |
| bool | saveConfigItems (FILE *fp) |
| saveConfigItems Save PAC interface properties to config file. Call this from your driver's saveConfigItems(). | |
Protected Attributes | |
| INDI::PropertyNumber | ManualAdjustmentNP {2} |
| INDI::PropertySwitch | AbortSP {1} |
| INDI::PropertyNumber | PositionNP {2} |
| INDI::PropertyNumber | SpeedNP {1} |
| INDI::PropertySwitch | AZReverseSP {2} |
| INDI::PropertySwitch | ALTReverseSP {2} |
| INDI::PropertySwitch | HomeSP {3} |
| INDI::PropertyNumber | SyncNP {2} |
| INDI::PropertySwitch | BacklashSP {2} |
| INDI::PropertyNumber | BacklashNP {2} |
Definition at line 62 of file indipacinterface.h.
| anonymous enum |
Indices for the ManualAdjustmentNP number property.
| Enumerator | |
|---|---|
| MANUAL_AZ | Azimuth step in degrees: positive = East, negative = West. |
| MANUAL_ALT | Altitude step in degrees: positive = North, negative = South. |
Definition at line 66 of file indipacinterface.h.
| anonymous enum |
Indices for the PositionNP number property.
| Enumerator | |
|---|---|
| POSITION_AZ | Current azimuth position in degrees. |
| POSITION_ALT | Current altitude position in degrees. |
Definition at line 73 of file indipacinterface.h.
| anonymous enum |
PAC capability flags passed to SetCapability().
Definition at line 82 of file indipacinterface.h.
|
protected |
| Enumerator | |
|---|---|
| HOME_SET | |
| HOME_GO | |
| HOME_RESET | |
Definition at line 399 of file indipacinterface.h.
|
protected |
| Enumerator | |
|---|---|
| SYNC_AZ | |
| SYNC_ALT | |
Definition at line 408 of file indipacinterface.h.
|
protected |
| Enumerator | |
|---|---|
| BACKLASH_AZ | |
| BACKLASH_ALT | |
Definition at line 421 of file indipacinterface.h.
|
explicitprotected |
Definition at line 31 of file indipacinterface.cpp.
|
protectedvirtualdefault |
|
protectedvirtual |
AbortMotion Abort all axis motion immediately.
The default implementation logs an error and returns false. Drivers that support hardware abort should override this method.
Reimplemented in AvalonUPAS, MLAstroRPA, OAPA, and PACSimulator.
Definition at line 385 of file indipacinterface.cpp.
|
inline |
Definition at line 126 of file indipacinterface.h.
|
inline |
Definition at line 114 of file indipacinterface.h.
|
inline |
Definition at line 138 of file indipacinterface.h.
|
inline |
Definition at line 93 of file indipacinterface.h.
|
protectedvirtual |
GoHome Slew both axes back to the home (0, 0) position.
Only called when PAC_CAN_HOME is set. Default returns IPS_ALERT.
Reimplemented in MLAstroRPA.
Definition at line 423 of file indipacinterface.cpp.
|
inline |
Definition at line 132 of file indipacinterface.h.
|
inline |
Definition at line 120 of file indipacinterface.h.
|
inline |
Definition at line 108 of file indipacinterface.h.
|
protected |
initProperties Initialize PAC properties. Call this from your driver's initProperties().
| group | Group or tab name for the properties. |
Definition at line 36 of file indipacinterface.cpp.
|
protectedvirtual |
MoveALT Move the altitude axis by the given number of degrees.
Sign convention: positive = North (increase altitude), negative = South.
The default implementation returns IPS_ALERT. Drivers with motorised altitude adjustment must override this method.
| degrees | Signed step size in degrees. |
Reimplemented in AvalonUPAS, MLAstroRPA, OAPA, and PACSimulator.
Definition at line 368 of file indipacinterface.cpp.
|
protectedvirtual |
Move the azimuth axis by the given number of degrees.
Sign convention: positive = East, negative = West.
The default implementation returns IPS_ALERT. Drivers with motorised azimuth adjustment must override this method.
| degrees | Signed step size in degrees. |
Reimplemented in AvalonUPAS, MLAstroRPA, OAPA, and PACSimulator.
Definition at line 362 of file indipacinterface.cpp.
|
protectedvirtual |
MoveBoth Move both axes in a single coordinated operation.
Called by processNumber() when both azStep and altStep are non-zero. The default implementation calls MoveAZ() followed by MoveALT(), preserving backward-compatible behaviour for any driver that does not override this method.
Drivers that can do better should override this:
| azDegrees | Signed azimuth step in degrees (+East / −West). |
| altDegrees | Signed altitude step in degrees (+North / −South). |
Reimplemented in AvalonUPAS, MLAstroRPA, and OAPA.
Definition at line 374 of file indipacinterface.cpp.
|
protected |
Process PAC number properties.
Definition at line 262 of file indipacinterface.cpp.
|
protected |
Process PAC switch properties.
Definition at line 151 of file indipacinterface.cpp.
|
protectedvirtual |
ResetHome Clear the stored home reference without moving.
Only called when PAC_CAN_HOME is set. Default implementation returns false.
Reimplemented in MLAstroRPA.
Definition at line 430 of file indipacinterface.cpp.
|
protectedvirtual |
ReverseALT Reverse the direction of altitude axis movement.
Only called when PAC_CAN_REVERSE capability is set.
| enabled | True to reverse, false to restore normal direction. |
Reimplemented in AvalonUPAS, MLAstroRPA, OAPA, and PACSimulator.
Definition at line 408 of file indipacinterface.cpp.
|
protectedvirtual |
ReverseAZ Reverse the direction of azimuth axis movement.
Only called when PAC_CAN_REVERSE capability is set.
| enabled | True to reverse, false to restore normal direction. |
Reimplemented in AvalonUPAS, MLAstroRPA, OAPA, and PACSimulator.
Definition at line 400 of file indipacinterface.cpp.
|
protected |
saveConfigItems Save PAC interface properties to config file. Call this from your driver's saveConfigItems().
| fp | Pointer to the open config file. |
Definition at line 337 of file indipacinterface.cpp.
|
protectedvirtual |
SetBacklashALT Set the altitude axis backlash compensation value in steps.
Only called when PAC_HAS_BACKLASH is set. Default returns false.
| steps | Number of motor steps used to compensate altitude backlash. |
Reimplemented in MLAstroRPA.
Definition at line 469 of file indipacinterface.cpp.
|
protectedvirtual |
SetBacklashAZ Set the azimuth axis backlash compensation value in steps.
Only called when PAC_HAS_BACKLASH is set. Default returns false.
| steps | Number of motor steps used to compensate azimuth backlash. |
Reimplemented in MLAstroRPA.
Definition at line 461 of file indipacinterface.cpp.
|
protectedvirtual |
SetBacklashEnabled Enable or disable hardware backlash compensation.
Only called when PAC_HAS_BACKLASH is set. Default returns false.
| enabled | True to enable backlash compensation, false to disable. |
Reimplemented in MLAstroRPA.
Definition at line 453 of file indipacinterface.cpp.
|
inline |
SetCapability sets the PAC device capabilities. Call this in the driver constructor.
| cap | Bitmask of PAC_HAS_SPEED, PAC_CAN_REVERSE, and/or PAC_HAS_POSITION. |
Definition at line 102 of file indipacinterface.h.
|
protectedvirtual |
SetHome Mark the current position as the home (zero) reference.
Only called when PAC_CAN_HOME is set. Default implementation returns false.
Reimplemented in MLAstroRPA.
Definition at line 416 of file indipacinterface.cpp.
|
protectedvirtual |
SetPACSpeed Set the motor speed used for axis movements.
Only called when PAC_HAS_SPEED capability is set. The default implementation logs an error and returns false; drivers with variable-speed hardware must override.
| speed | Speed value (range defined by the driver, default 1–10). |
Reimplemented in AvalonUPAS, MLAstroRPA, and PACSimulator.
Definition at line 392 of file indipacinterface.cpp.
|
protectedvirtual |
SyncALT Sync the altitude position reference to the given value without moving.
Only called when PAC_CAN_SYNC is set. Default returns false.
| degrees | Desired current altitude reading in degrees. |
Reimplemented in MLAstroRPA.
Definition at line 445 of file indipacinterface.cpp.
|
protectedvirtual |
SyncAZ Sync the azimuth position reference to the given value without moving.
Only called when PAC_CAN_SYNC is set. Default returns false.
| degrees | Desired current azimuth reading in degrees. |
Reimplemented in MLAstroRPA.
Definition at line 437 of file indipacinterface.cpp.
|
protected |
updateProperties Define or delete properties based on connection state. Call this from your driver's updateProperties().
Definition at line 99 of file indipacinterface.cpp.
|
protected |
Abort motion property. Pressing Abort calls AbortMotion() and resets ManualAdjustmentNP and PositionNP to IPS_IDLE.
Definition at line 369 of file indipacinterface.h.
|
protected |
Altitude axis reverse switch. Only defined when PAC_CAN_REVERSE is set.
Definition at line 392 of file indipacinterface.h.
|
protected |
Azimuth axis reverse switch. Only defined when PAC_CAN_REVERSE is set.
Definition at line 387 of file indipacinterface.h.
|
protected |
Backlash compensation steps per axis. Only defined when PAC_HAS_BACKLASH is set. Element [BACKLASH_AZ] : azimuth backlash in motor steps. Element [BACKLASH_ALT]: altitude backlash in motor steps.
Definition at line 420 of file indipacinterface.h.
|
protected |
Backlash enable/disable switch. Only defined when PAC_HAS_BACKLASH is set.
Definition at line 413 of file indipacinterface.h.
|
protected |
Home management switch. Only defined when PAC_CAN_HOME is set. Elements: [HOME_SET] Set home, [HOME_GO] Return to home, [HOME_RESET] Reset home.
Definition at line 398 of file indipacinterface.h.
|
protected |
Manual adjustment property. Element [MANUAL_AZ] : azimuth step in degrees (+East / −West). Element [MANUAL_ALT] : altitude step in degrees (+North / −South). Writing a non-zero value to either element immediately triggers the corresponding move.
State reflects overall motion: IPS_BUSY – one or both axes still moving IPS_ALERT – one or both axes encountered an error IPS_OK – both axes completed successfully
Definition at line 363 of file indipacinterface.h.
| enum { ... } INDI::PACInterface::PACCapability |
PAC capability flags passed to SetCapability().
|
protected |
Current axis position in degrees. Only defined when PAC_HAS_POSITION is set. Drivers should update this property periodically (e.g. from TimerHit).
Definition at line 375 of file indipacinterface.h.
|
protected |
Motor speed. Only defined when PAC_HAS_SPEED capability is set. Default range 1–10; drivers may adjust min/max/step in their initProperties() after calling PACI::initProperties().
Definition at line 382 of file indipacinterface.h.
|
protected |
Sync position numbers. Only defined when PAC_CAN_SYNC is set. Writing a value syncs that axis position reference without moving. Element [SYNC_AZ] : new azimuth reference in degrees. Element [SYNC_ALT]: new altitude reference in degrees.
Definition at line 407 of file indipacinterface.h.