Instrument Neutral Distributed Interface INDI
2.0.2
|
#include <skywatcherAPI.h>
Classes | |
struct | SkyWatcherFeatures |
Public Member Functions | |
SkywatcherAPI () | |
virtual | ~SkywatcherAPI ()=default |
unsigned long | BCDstr2long (std::string &String) |
unsigned long | Highstr2long (std::string &String) |
bool | CheckIfDCMotor () |
bool | IsMerlinMount () const |
Check if the current mount is a Virtuoso (AltAz) More... | |
long | DegreesPerSecondToClocksTicksPerMicrostep (AXISID Axis, double DegreesPerSecond) |
Check if the current mount is AZ GTi. More... | |
long | DegreesToMicrosteps (AXISID Axis, double AngleInDegrees) |
Convert angle in degrees to microsteps. More... | |
bool | GetEncoder (AXISID Axis) |
Set the CurrentEncoders status variable to the current encoder value in microsteps for the specified axis. More... | |
bool | GetHighSpeedRatio (AXISID Axis) |
Set the HighSpeedRatio status variable to the ratio between high and low speed stepping modes. More... | |
bool | GetMicrostepsPerRevolution (AXISID Axis) |
Set the MicrostepsPerRevolution status variable to the number of microsteps for a 360 degree revolution of the axis. More... | |
bool | GetMicrostepsPerWormRevolution (AXISID Axis) |
Set the MicrostepsPermWormRevolution status variable to the number of microsteps for a 360 degree revolution of the worm gear. More... | |
bool | GetMotorBoardVersion (AXISID Axis) |
PositiveRotationSense_t | GetPositiveRotationDirection (AXISID Axis) |
Returns the rotation direction for a positive step on the designated axis. More... | |
bool | GetStatus (AXISID Axis) |
bool | GetStepperClockFrequency (AXISID Axis) |
Set the StepperClockFrequency status variable to fixed PIC timer interrupt frequency (ticks per second). More... | |
bool | InquireFeatures () |
bool | InitializeMC () |
bool | InitMount () |
Initialize the communication to the mount. More... | |
bool | HasHomeIndexers () |
bool | HasAuxEncoders () |
bool | HasPPEC () |
bool | HasSnapPort1 () |
bool | HasSnapPort2 () |
bool | HasPolarLed () |
void | TurnEncoder (AXISID axis, bool on) |
void | TurnRAEncoder (bool on) |
void | TurnDEEncoder (bool on) |
void | SetFeature (AXISID axis, uint32_t command) |
bool | InstantStop (AXISID Axis) |
Bring the axis to an immediate halt. N.B. This command could cause damage to the mount or telescope and should not normally be used except for emergency stops. More... | |
void | Long2BCDstr (long Number, std::string &String) |
double | MicrostepsToDegrees (AXISID Axis, long Microsteps) |
Convert microsteps to angle in degrees. More... | |
double | MicrostepsToRadians (AXISID Axis, long Microsteps) |
Convert microsteps to angle in radians. More... | |
void | PrepareForSlewing (AXISID Axis, double Speed) |
long | RadiansPerSecondToClocksTicksPerMicrostep (AXISID Axis, double RadiansPerSecond) |
Convert a slewing rate in radians per second into the required clock ticks per microstep setting. More... | |
long | RadiansToMicrosteps (AXISID Axis, double AngleInRadians) |
Convert angle in radians to microsteps. More... | |
bool | SetEncoder (AXISID Axis, long Microsteps) |
Set axis encoder to the specified value. More... | |
bool | SetGotoTargetOffset (AXISID Axis, long OffsetInMicrosteps) |
Set the goto target offset per the specified axis. More... | |
bool | SetAxisMotionMode (AXISID Axis, char Func, char Direction) |
Set the motion mode per the specified axis. More... | |
void | SetSerialPort (int port) |
Set the serail port to be usb for mount communication. More... | |
bool | SetClockTicksPerMicrostep (AXISID Axis, long ClockTicksPerMicrostep) |
Set the PIC internal divider variable which determines how many clock interrupts have to occur between each microstep. More... | |
bool | SetSlewModeDeccelerationRampLength (AXISID Axis, long Microsteps) |
Set the length of the deccelaration ramp for Slew mode. More... | |
bool | SetSlewToModeDeccelerationRampLength (AXISID Axis, long Microsteps) |
Set the length of the deccelaration ramp for SlewTo mode. More... | |
bool | toggleSnapPort (bool enabled) |
Toggle the snap port on or off. More... | |
void | Slew (AXISID Axis, double SpeedInRadiansPerSecond, bool IgnoreSilentMode=true) |
Start the axis slewing at the given rate. More... | |
void | SlewTo (AXISID Axis, long OffsetInMicrosteps, bool verbose=true) |
Slew to the given offset and stop. More... | |
bool | SlowStop (AXISID Axis) |
Bring the axis to slow stop in the distance specified by SetSlewModeDeccelerationRampLength. More... | |
bool | StartAxisMotion (AXISID Axis) |
Start the axis slewing in the prevously selected mode. More... | |
bool | TalkWithAxis (AXISID Axis, SkywatcherCommand Command, std::string &cmdDataStr, std::string &responseStr) |
bool | IsInMotion (AXISID Axis) |
Check if an axis is moving. More... | |
Static Public Member Functions | |
static const char * | mountTypeToString (uint8_t type) |
Public Attributes | |
unsigned long | MCVersion { 0 } |
unsigned long | MountCode { 0 } |
bool | IsDCMotor { false } |
bool | SilentSlewMode { true } |
long | MicrostepsPerRevolution [2] |
long | StepperClockFrequency [2] |
long | HighSpeedRatio [2] |
long | MicrostepsPerWormRevolution [2] |
SkyWatcherFeatures | AxisFeatures [2] |
double | RadiansPerMicrostep [2] |
double | MicrostepsPerRadian [2] |
double | DegreesPerMicrostep [2] |
double | MicrostepsPerDegree [2] |
long | LowSpeedGotoMargin [2] |
long | LastSlewToTarget [2] |
long | CurrentEncoders [2] |
Current encoder values (microsteps). More... | |
long | PolarisPositionEncoders [2] |
Polaris position (initial) encoder values (microsteps). More... | |
long | ZeroPositionEncoders [2] |
Zero position encoder values (microsteps). More... | |
AXISSTATUS | AxesStatus [2] |
double | SlewingSpeed [2] |
INDI::Telescope * | pChildTelescope { nullptr } |
Static Public Attributes | |
static constexpr double | SIDEREALRATE { (2 * M_PI / 86164.09065) } |
static constexpr double | MAX_SPEED { 500.0 } |
static constexpr double | LOW_SPEED_MARGIN { 128.0 * SIDEREALRATE } |
Protected Attributes | |
unsigned int | DBG_SCOPE { 0 } |
Definition at line 53 of file skywatcherAPI.h.
Enumerator | |
---|---|
AXIS1 | |
AXIS2 |
Definition at line 56 of file skywatcherAPI.h.
Enumerator | |
---|---|
EQ6 | |
HEQ5 | |
EQ5 | |
EQ3 | |
EQ8 | |
AZEQ6 | |
AZEQ5 | |
STAR_ADVENTURER | |
EQ8R_PRO | |
AZEQ6_PRO | |
EQ6_PRO | |
EQ5_PRO | |
GT | |
MF | |
_114GT | |
DOB | |
AZGTE | |
AZGTI |
Definition at line 338 of file skywatcherAPI.h.
Enumerator | |
---|---|
CLOCKWISE | |
ANTICLOCKWISE |
Definition at line 174 of file skywatcherAPI.h.
Definition at line 63 of file skywatcherAPI.h.
Enumerator | |
---|---|
GET_INDEXER_CMD | |
GET_FEATURES_CMD |
Definition at line 94 of file skywatcherAPI.h.
Definition at line 100 of file skywatcherAPI.h.
SkywatcherAPI::SkywatcherAPI | ( | ) |
Definition at line 112 of file skywatcherAPI.cpp.
|
virtualdefault |
unsigned long SkywatcherAPI::BCDstr2long | ( | std::string & | String | ) |
Definition at line 127 of file skywatcherAPI.cpp.
bool SkywatcherAPI::CheckIfDCMotor | ( | ) |
Definition at line 173 of file skywatcherAPI.cpp.
long SkywatcherAPI::DegreesPerSecondToClocksTicksPerMicrostep | ( | AXISID | Axis, |
double | DegreesPerSecond | ||
) |
Check if the current mount is AZ GTi.
Convert a slewing rate in degrees per second into the required clock ticks per microstep setting.
[in] | Axis | - The axis to use. |
[in] | DegreesPerSecond | - Slewing rate in degrees per second |
Definition at line 214 of file skywatcherAPI.cpp.
long SkywatcherAPI::DegreesToMicrosteps | ( | AXISID | Axis, |
double | AngleInDegrees | ||
) |
Convert angle in degrees to microsteps.
[in] | Axis | - The axis to use. |
[in] | AngleInRadians | - the angle in degrees. |
Definition at line 221 of file skywatcherAPI.cpp.
bool SkywatcherAPI::GetEncoder | ( | AXISID | Axis | ) |
Set the CurrentEncoders status variable to the current encoder value in microsteps for the specified axis.
Definition at line 226 of file skywatcherAPI.cpp.
bool SkywatcherAPI::GetHighSpeedRatio | ( | AXISID | Axis | ) |
Set the HighSpeedRatio status variable to the ratio between high and low speed stepping modes.
Definition at line 240 of file skywatcherAPI.cpp.
bool SkywatcherAPI::GetMicrostepsPerRevolution | ( | AXISID | Axis | ) |
Set the MicrostepsPerRevolution status variable to the number of microsteps for a 360 degree revolution of the axis.
[in] | Axis | - The axis to use. |
Definition at line 261 of file skywatcherAPI.cpp.
bool SkywatcherAPI::GetMicrostepsPerWormRevolution | ( | AXISID | Axis | ) |
Set the MicrostepsPermWormRevolution status variable to the number of microsteps for a 360 degree revolution of the worm gear.
[in] | Axis | - The axis to use. |
Definition at line 296 of file skywatcherAPI.cpp.
bool SkywatcherAPI::GetMotorBoardVersion | ( | AXISID | Axis | ) |
Definition at line 313 of file skywatcherAPI.cpp.
SkywatcherAPI::PositiveRotationSense_t SkywatcherAPI::GetPositiveRotationDirection | ( | AXISID | Axis | ) |
Returns the rotation direction for a positive step on the designated axis.
[in] | Axis | - The axis to use. |
Rotation directions are given looking down the axis towards the motorised pier for an altitude or declination axis. Or down the pier towards the mount base for an azimuth or right ascension axis
Definition at line 330 of file skywatcherAPI.cpp.
bool SkywatcherAPI::GetStatus | ( | AXISID | Axis | ) |
Definition at line 361 of file skywatcherAPI.cpp.
bool SkywatcherAPI::GetStepperClockFrequency | ( | AXISID | Axis | ) |
Set the StepperClockFrequency status variable to fixed PIC timer interrupt frequency (ticks per second).
Definition at line 339 of file skywatcherAPI.cpp.
bool SkywatcherAPI::HasAuxEncoders | ( | ) |
Definition at line 986 of file skywatcherAPI.cpp.
bool SkywatcherAPI::HasHomeIndexers | ( | ) |
Definition at line 981 of file skywatcherAPI.cpp.
bool SkywatcherAPI::HasPolarLed | ( | ) |
Definition at line 1007 of file skywatcherAPI.cpp.
bool SkywatcherAPI::HasPPEC | ( | ) |
Definition at line 991 of file skywatcherAPI.cpp.
bool SkywatcherAPI::HasSnapPort1 | ( | ) |
Definition at line 996 of file skywatcherAPI.cpp.
bool SkywatcherAPI::HasSnapPort2 | ( | ) |
Definition at line 1002 of file skywatcherAPI.cpp.
unsigned long SkywatcherAPI::Highstr2long | ( | std::string & | String | ) |
Definition at line 154 of file skywatcherAPI.cpp.
bool SkywatcherAPI::InitializeMC | ( | ) |
Definition at line 423 of file skywatcherAPI.cpp.
bool SkywatcherAPI::InitMount | ( | ) |
Initialize the communication to the mount.
Definition at line 493 of file skywatcherAPI.cpp.
bool SkywatcherAPI::InquireFeatures | ( | ) |
Definition at line 435 of file skywatcherAPI.cpp.
bool SkywatcherAPI::InstantStop | ( | AXISID | Axis | ) |
Bring the axis to an immediate halt. N.B. This command could cause damage to the mount or telescope and should not normally be used except for emergency stops.
[in] | Axis | - The axis to use. |
Definition at line 582 of file skywatcherAPI.cpp.
bool SkywatcherAPI::IsInMotion | ( | AXISID | Axis | ) |
Check if an axis is moving.
[in] | Axis | - The axis to check. |
Definition at line 974 of file skywatcherAPI.cpp.
bool SkywatcherAPI::IsMerlinMount | ( | ) | const |
Check if the current mount is a Virtuoso (AltAz)
Check if the current mount is a Merlin (AltAz)
Definition at line 209 of file skywatcherAPI.cpp.
void SkywatcherAPI::Long2BCDstr | ( | long | Number, |
std::string & | String | ||
) |
Definition at line 593 of file skywatcherAPI.cpp.
double SkywatcherAPI::MicrostepsToDegrees | ( | AXISID | Axis, |
long | Microsteps | ||
) |
Convert microsteps to angle in degrees.
[in] | Axis | - The axis to use. |
[in] | Microsteps |
Definition at line 601 of file skywatcherAPI.cpp.
double SkywatcherAPI::MicrostepsToRadians | ( | AXISID | Axis, |
long | Microsteps | ||
) |
Convert microsteps to angle in radians.
[in] | Axis | - The axis to use. |
[in] | Microsteps |
Definition at line 606 of file skywatcherAPI.cpp.
|
static |
Definition at line 67 of file skywatcherAPI.cpp.
void SkywatcherAPI::PrepareForSlewing | ( | AXISID | Axis, |
double | Speed | ||
) |
Definition at line 611 of file skywatcherAPI.cpp.
long SkywatcherAPI::RadiansPerSecondToClocksTicksPerMicrostep | ( | AXISID | Axis, |
double | RadiansPerSecond | ||
) |
Convert a slewing rate in radians per second into the required clock ticks per microstep setting.
[in] | Axis | - The axis to use. |
[in] | DegreesPerSecond | - Slewing rate in degrees per second |
Definition at line 660 of file skywatcherAPI.cpp.
long SkywatcherAPI::RadiansToMicrosteps | ( | AXISID | Axis, |
double | AngleInRadians | ||
) |
Convert angle in radians to microsteps.
[in] | Axis | - The axis to use. |
[in] | AngleInRadians | - the angle in radians. |
Definition at line 667 of file skywatcherAPI.cpp.
bool SkywatcherAPI::SetAxisMotionMode | ( | AXISID | Axis, |
char | Func, | ||
char | Direction | ||
) |
Set the motion mode per the specified axis.
[in] | Axis | - The axis to use. |
[in] | Func | - the slewing mode
|
[in] | Direction | - the direction to slew in
|
Func - 0 High speed slew to mode (goto) Func - 1 Low speed slew mode Func - 2 Low speed slew to mode (goto) Func - 3 High speed slew mode
Definition at line 696 of file skywatcherAPI.cpp.
bool SkywatcherAPI::SetClockTicksPerMicrostep | ( | AXISID | Axis, |
long | ClockTicksPerMicrostep | ||
) |
Set the PIC internal divider variable which determines how many clock interrupts have to occur between each microstep.
Definition at line 707 of file skywatcherAPI.cpp.
bool SkywatcherAPI::SetEncoder | ( | AXISID | Axis, |
long | Microsteps | ||
) |
Set axis encoder to the specified value.
[in] | Axis | - The axis to use. |
[in] | Microsteps | - the value in microsteps. |
Definition at line 672 of file skywatcherAPI.cpp.
void SkywatcherAPI::SetFeature | ( | AXISID | axis, |
uint32_t | command | ||
) |
Definition at line 1032 of file skywatcherAPI.cpp.
bool SkywatcherAPI::SetGotoTargetOffset | ( | AXISID | Axis, |
long | OffsetInMicrosteps | ||
) |
Set the goto target offset per the specified axis.
[in] | Axis | - The axis to use. |
[in] | OffsetInMicrosteps | - the value to use |
Definition at line 682 of file skywatcherAPI.cpp.
|
inline |
Set the serail port to be usb for mount communication.
[in] | port | - an open file descriptor for the port to use. |
Definition at line 277 of file skywatcherAPI.h.
bool SkywatcherAPI::SetSlewModeDeccelerationRampLength | ( | AXISID | Axis, |
long | Microsteps | ||
) |
Set the length of the deccelaration ramp for Slew mode.
[in] | Axis | - The axis to use. |
[in] | Microsteps | - the length of the decceleration ramp in microsteps. |
Definition at line 717 of file skywatcherAPI.cpp.
bool SkywatcherAPI::SetSlewToModeDeccelerationRampLength | ( | AXISID | Axis, |
long | Microsteps | ||
) |
Set the length of the deccelaration ramp for SlewTo mode.
[in] | Axis | - The axis to use. |
[in] | Microsteps | - the length of the decceleration ramp in microsteps. |
Definition at line 727 of file skywatcherAPI.cpp.
void SkywatcherAPI::Slew | ( | AXISID | Axis, |
double | SpeedInRadiansPerSecond, | ||
bool | IgnoreSilentMode = true |
||
) |
Start the axis slewing at the given rate.
[in] | Axis | - The axis to use. |
[in] | SpeedInRadiansPerSecond | - the slewing speed |
[in] | IgnoreSilentMode | - ignore the silent mode even if set |
Definition at line 744 of file skywatcherAPI.cpp.
void SkywatcherAPI::SlewTo | ( | AXISID | Axis, |
long | OffsetInMicrosteps, | ||
bool | verbose = true |
||
) |
Slew to the given offset and stop.
[in] | Axis | - The axis to use. |
[in] | OffsetInMicrosteps | - The number of microsteps to |
[in] | verbose | - Verbose mode slew from the current axis position. |
Definition at line 793 of file skywatcherAPI.cpp.
bool SkywatcherAPI::SlowStop | ( | AXISID | Axis | ) |
Bring the axis to slow stop in the distance specified by SetSlewModeDeccelerationRampLength.
[in] | Axis | - The axis to use. |
Definition at line 864 of file skywatcherAPI.cpp.
bool SkywatcherAPI::StartAxisMotion | ( | AXISID | Axis | ) |
Start the axis slewing in the prevously selected mode.
[in] | Axis | - The axis to use. |
Definition at line 872 of file skywatcherAPI.cpp.
bool SkywatcherAPI::TalkWithAxis | ( | AXISID | Axis, |
SkywatcherCommand | Command, | ||
std::string & | cmdDataStr, | ||
std::string & | responseStr | ||
) |
Definition at line 879 of file skywatcherAPI.cpp.
bool SkywatcherAPI::toggleSnapPort | ( | bool | enabled | ) |
Toggle the snap port on or off.
[in] | enabled | - the state requested. |
Definition at line 737 of file skywatcherAPI.cpp.
void SkywatcherAPI::TurnDEEncoder | ( | bool | on | ) |
Definition at line 1027 of file skywatcherAPI.cpp.
void SkywatcherAPI::TurnEncoder | ( | AXISID | axis, |
bool | on | ||
) |
Definition at line 1012 of file skywatcherAPI.cpp.
void SkywatcherAPI::TurnRAEncoder | ( | bool | on | ) |
Definition at line 1022 of file skywatcherAPI.cpp.
AXISSTATUS SkywatcherAPI::AxesStatus[2] |
Definition at line 403 of file skywatcherAPI.h.
SkyWatcherFeatures SkywatcherAPI::AxisFeatures[2] |
Definition at line 384 of file skywatcherAPI.h.
long SkywatcherAPI::CurrentEncoders[2] |
Current encoder values (microsteps).
Definition at line 397 of file skywatcherAPI.h.
|
protected |
Definition at line 408 of file skywatcherAPI.h.
double SkywatcherAPI::DegreesPerMicrostep[2] |
Definition at line 389 of file skywatcherAPI.h.
long SkywatcherAPI::HighSpeedRatio[2] |
Definition at line 382 of file skywatcherAPI.h.
bool SkywatcherAPI::IsDCMotor { false } |
Definition at line 376 of file skywatcherAPI.h.
long SkywatcherAPI::LastSlewToTarget[2] |
Definition at line 394 of file skywatcherAPI.h.
|
staticconstexpr |
Definition at line 117 of file skywatcherAPI.h.
long SkywatcherAPI::LowSpeedGotoMargin[2] |
Definition at line 391 of file skywatcherAPI.h.
|
staticconstexpr |
Definition at line 116 of file skywatcherAPI.h.
unsigned long SkywatcherAPI::MCVersion { 0 } |
Definition at line 334 of file skywatcherAPI.h.
double SkywatcherAPI::MicrostepsPerDegree[2] |
Definition at line 390 of file skywatcherAPI.h.
double SkywatcherAPI::MicrostepsPerRadian[2] |
Definition at line 388 of file skywatcherAPI.h.
long SkywatcherAPI::MicrostepsPerRevolution[2] |
Definition at line 380 of file skywatcherAPI.h.
long SkywatcherAPI::MicrostepsPerWormRevolution[2] |
Definition at line 383 of file skywatcherAPI.h.
unsigned long SkywatcherAPI::MountCode { 0 } |
Definition at line 375 of file skywatcherAPI.h.
INDI::Telescope* SkywatcherAPI::pChildTelescope { nullptr } |
Definition at line 421 of file skywatcherAPI.h.
long SkywatcherAPI::PolarisPositionEncoders[2] |
Polaris position (initial) encoder values (microsteps).
Definition at line 399 of file skywatcherAPI.h.
double SkywatcherAPI::RadiansPerMicrostep[2] |
Definition at line 387 of file skywatcherAPI.h.
|
staticconstexpr |
Definition at line 115 of file skywatcherAPI.h.
bool SkywatcherAPI::SilentSlewMode { true } |
Definition at line 377 of file skywatcherAPI.h.
double SkywatcherAPI::SlewingSpeed[2] |
Definition at line 404 of file skywatcherAPI.h.
long SkywatcherAPI::StepperClockFrequency[2] |
Definition at line 381 of file skywatcherAPI.h.
long SkywatcherAPI::ZeroPositionEncoders[2] |
Zero position encoder values (microsteps).
Definition at line 401 of file skywatcherAPI.h.