41static std::unique_ptr<SkywatcherAPIMount> SkywatcherAPIMountPtr(
new SkywatcherAPIMount());
45static double SlewSpeeds[
SLEWMODES] = { 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 600.0, 800.0 };
64 m_LastCustomDirection[
AXIS1] = m_LastCustomDirection[
AXIS2] = 0;
83 DEBUGF(
DBG_SCOPE,
"SkywatcherAPIMount::Handshake - Result: %d", Result);
92 return "Skywatcher Alt-Az";
103 for (
size_t i = 0; i <
SlewRateSP.count(); ++i)
105 SlewRateSP[i].setLabel(std::to_string(
static_cast<int>(SlewSpeeds[i])) +
"x");
125 IUFillText(&BasicMountInfoT[MOTOR_CONTROL_FIRMWARE_VERSION],
"MOTOR_CONTROL_FIRMWARE_VERSION",
126 "Motor control firmware version",
"-");
127 IUFillText(&BasicMountInfoT[MOUNT_CODE],
"MOUNT_CODE",
"Mount code",
"-");
128 IUFillText(&BasicMountInfoT[MOUNT_NAME],
"MOUNT_NAME",
"Mount name",
"-");
129 IUFillText(&BasicMountInfoT[IS_DC_MOTOR],
"IS_DC_MOTOR",
"Is DC motor",
"-");
131 "Basic mount information", MountInfoTab,
IP_RO, 60,
IPS_IDLE);
133 IUFillNumber(&AxisOneInfoN[MICROSTEPS_PER_REVOLUTION],
"MICROSTEPS_PER_REVOLUTION",
"Microsteps per revolution",
134 "%.0f", 0, 0xFFFFFF, 1, 0);
135 IUFillNumber(&AxisOneInfoN[STEPPER_CLOCK_FREQUENCY],
"STEPPER_CLOCK_FREQUENCY",
"Stepper clock frequency",
"%.0f", 0,
137 IUFillNumber(&AxisOneInfoN[HIGH_SPEED_RATIO],
"HIGH_SPEED_RATIO",
"High speed ratio",
"%.0f", 0, 0xFFFFFF, 1, 0);
138 IUFillNumber(&AxisOneInfoN[MICROSTEPS_PER_WORM_REVOLUTION],
"MICROSTEPS_PER_WORM_REVOLUTION",
139 "Microsteps per worm revolution",
"%.0f", 0, 0xFFFFFF, 1, 0);
147 IUFillSwitch(&AxisOneStateS[SLEWING_FORWARD],
"SLEWING_FORWARD",
"SLEWING_FORWARD",
ISS_OFF);
149 IUFillSwitch(&AxisOneStateS[NOT_INITIALISED],
"NOT_INITIALISED",
"NOT_INITIALISED",
ISS_ON);
153 IUFillNumber(&AxisTwoInfoN[MICROSTEPS_PER_REVOLUTION],
"MICROSTEPS_PER_REVOLUTION",
"Microsteps per revolution",
154 "%.0f", 0, 0xFFFFFF, 1, 0);
155 IUFillNumber(&AxisTwoInfoN[STEPPER_CLOCK_FREQUENCY],
"STEPPER_CLOCK_FREQUENCY",
"Step timer frequency",
"%.0f", 0,
157 IUFillNumber(&AxisTwoInfoN[HIGH_SPEED_RATIO],
"HIGH_SPEED_RATIO",
"High speed ratio",
"%.0f", 0, 0xFFFFFF, 1, 0);
158 IUFillNumber(&AxisTwoInfoN[MICROSTEPS_PER_WORM_REVOLUTION],
"MICROSTEPS_PER_WORM_REVOLUTION",
159 "Microsteps per worm revolution",
"%.0f", 0, 0xFFFFFF, 1, 0);
167 IUFillSwitch(&AxisTwoStateS[SLEWING_FORWARD],
"SLEWING_FORWARD",
"SLEWING_FORWARD",
ISS_OFF);
169 IUFillSwitch(&AxisTwoStateS[NOT_INITIALISED],
"NOT_INITIALISED",
"NOT_INITIALISED",
ISS_ON);
173 IUFillNumber(&AxisOneEncoderValuesN[RAW_MICROSTEPS],
"RAW_MICROSTEPS",
"Raw Microsteps",
"%.0f", 0, 0xFFFFFF, 1, 0);
174 IUFillNumber(&AxisOneEncoderValuesN[MICROSTEPS_PER_ARCSEC],
"MICROSTEPS_PER_ARCSEC",
"Microsteps/arcsecond",
175 "%.4f", 0, 0xFFFFFF, 1, 0);
176 IUFillNumber(&AxisOneEncoderValuesN[OFFSET_FROM_INITIAL],
"OFFSET_FROM_INITIAL",
"Offset from initial",
"%.0f", 0,
178 IUFillNumber(&AxisOneEncoderValuesN[DEGREES_FROM_INITIAL],
"DEGREES_FROM_INITIAL",
"Degrees from initial",
"%.2f",
179 -1000.0, 1000.0, 1, 0);
184 IUFillNumber(&AxisTwoEncoderValuesN[RAW_MICROSTEPS],
"RAW_MICROSTEPS",
"Raw Microsteps",
"%.0f", 0, 0xFFFFFF, 1, 0);
185 IUFillNumber(&AxisTwoEncoderValuesN[MICROSTEPS_PER_ARCSEC],
"MICROSTEPS_PER_ARCSEC",
"Microsteps/arcsecond",
186 "%.4f", 0, 0xFFFFFF, 1, 0);
187 IUFillNumber(&AxisTwoEncoderValuesN[OFFSET_FROM_INITIAL],
"OFFSET_FROM_INITIAL",
"Offset from initial",
"%.0f", 0,
189 IUFillNumber(&AxisTwoEncoderValuesN[DEGREES_FROM_INITIAL],
"DEGREES_FROM_INITIAL",
"Degrees from initial",
"%.2f",
190 -1000.0, 1000.0, 1, 0);
203 IUFillSwitch(&SoftPECModesS[SOFTPEC_ENABLED],
"SOFTPEC_ENABLED",
"Enable for tracking",
ISS_OFF);
204 IUFillSwitch(&SoftPECModesS[SOFTPEC_DISABLED],
"SOFTPEC_DISABLED",
"Disabled",
ISS_ON);
209 IUFillNumber(&SoftPecN,
"SOFTPEC_VALUE",
"degree/minute (Alt)",
"%1.3f", 0.001, 1.0, 0.001, 0.009);
214 IUFillNumber(&GuidingRatesN[0],
"GUIDERA_RATE",
"arcsec/seconds (RA)",
"%1.3f", 1.0, 6000.0, 1.0, 120.0);
215 IUFillNumber(&GuidingRatesN[1],
"GUIDEDEC_RATE",
"arcsec/seconds (Dec)",
"%1.3f", 1.0, 6000.0, 1.0, 120.0);
231 Axis1PIDNP[Propotional].fill(
"Propotional",
"Propotional",
"%.2f", 0.1, 100, 1, 0.1);
232 Axis1PIDNP[Derivative].fill(
"Derivative",
"Derivative",
"%.2f", 0, 500, 10, 0.05);
233 Axis1PIDNP[Integral].fill(
"Integral",
"Integral",
"%.2f", 0, 500, 10, 0.05);
236 Axis2PIDNP[Propotional].fill(
"Propotional",
"Propotional",
"%.2f", 0.1, 100, 1, 0.2);
237 Axis2PIDNP[Derivative].fill(
"Derivative",
"Derivative",
"%.2f", 0, 100, 10, 0.1);
238 Axis2PIDNP[Integral].fill(
"Integral",
"Integral",
"%.2f", 0, 100, 10, 0.1);
242 AxisDeadZoneNP[
AXIS1].fill(
"AXIS1",
"AZ (steps)",
"%.f", 0, 100, 10, 10);
243 AxisDeadZoneNP[
AXIS2].fill(
"AXIS2",
"AL (steps)",
"%.f", 0, 100, 10, 10);
247 AxisClockNP[
AXIS1].fill(
"AXIS1",
"AZ %",
"%.f", 1, 200, 10, 100);
248 AxisClockNP[
AXIS2].fill(
"AXIS2",
"AL %",
"%.f", 1, 200, 10, 100);
252 AxisOffsetNP[RAOffset].fill(
"RAOffset",
"RA (deg)",
"%.2f", -1, 1, 0.05, 0);
253 AxisOffsetNP[DEOffset].fill(
"DEOffset",
"DE (deg)",
"%.2f", -1, 1, 0.05, 0);
254 AxisOffsetNP[AZSteps].fill(
"AZEncoder",
"AZ (steps)",
"%.f", -10000, 10000, 1000, 0);
255 AxisOffsetNP[ALSteps].fill(
"ALEncoder",
"AL (steps)",
"%.f", -10000, 10000, 1000, -100.0);
256 AxisOffsetNP[JulianOffset].fill(
"JulianOffset",
"JD (s)",
"%.f", -5, 5, 0.1, 0);
260 Axis1TrackRateNP[TrackDirection].fill(
"TrackDirection",
"West/East",
"%.f", 0, 1, 1, 0);
261 Axis1TrackRateNP[TrackClockRate].fill(
"TrackClockRate",
"Freq/Step (Hz/s)",
"%.f", 0, 16000000, 500000, 0);
264 Axis2TrackRateNP[TrackDirection].fill(
"TrackDirection",
"North/South",
"%.f", 0, 1, 1, 0);
265 Axis2TrackRateNP[TrackClockRate].fill(
"TrackClockRate",
"Freq/Stel (Hz/s)",
"%.f", 0, 16000000, 500000, 0);
298 char *formats[],
char *names[],
int n)
322 if (strcmp(name,
"SOFTPEC") == 0)
330 if (strcmp(name,
"GUIDE_RATES") == 0)
333 GuidingRatesNP.s =
IPS_OK;
340 if (AxisDeadZoneNP.isNameMatch(name))
342 AxisDeadZoneNP.update(values, names,
n);
343 AxisDeadZoneNP.setState(
IPS_OK);
344 AxisDeadZoneNP.apply();
350 if (AxisClockNP.isNameMatch(name))
352 AxisClockNP.update(values, names,
n);
353 AxisClockNP.setState(
IPS_OK);
360 if (AxisOffsetNP.isNameMatch(name))
362 AxisOffsetNP.update(values, names,
n);
363 AxisOffsetNP.setState(
IPS_OK);
364 AxisOffsetNP.apply();
370 if (Axis1TrackRateNP.isNameMatch(name))
372 Axis1TrackRateNP.update(values, names,
n);
373 Axis1TrackRateNP.setState(
IPS_OK);
374 Axis1TrackRateNP.apply();
380 if (Axis2TrackRateNP.isNameMatch(name))
382 Axis2TrackRateNP.update(values, names,
n);
383 Axis2TrackRateNP.setState(
IPS_OK);
384 Axis2TrackRateNP.apply();
390 if (Axis1PIDNP.isNameMatch(name))
392 Axis1PIDNP.update(values, names,
n);
393 Axis1PIDNP.setState(
IPS_OK);
398 Axis1PIDNP[Propotional].getValue(),
399 Axis1PIDNP[Derivative].getValue(),
400 Axis1PIDNP[Integral].getValue()));
405 if (Axis2PIDNP.isNameMatch(name))
407 Axis2PIDNP.update(values, names,
n);
408 Axis2PIDNP.setState(
IPS_OK);
413 Axis2PIDNP[Propotional].getValue(),
414 Axis2PIDNP[Derivative].getValue(),
415 Axis2PIDNP[Integral].getValue()));
421 if (strcmp(name,
"EQUATORIAL_EOD_COORD") == 0)
426 for (
int x = 0; x <
n; x++)
433 if ((
ra >= 0) && (
ra <= 24) && (
dec >= -90) && (
dec <= 90))
454 if (AUXEncoderSP.isNameMatch(name))
456 AUXEncoderSP.update(states, names,
n);
457 AUXEncoderSP.setState(
IPS_OK);
458 AUXEncoderSP.apply();
459 auto enabled = AUXEncoderSP.findOnSwitchIndex() ==
INDI_ENABLED;
467 if (SnapPortSP.isNameMatch(name))
469 SnapPortSP.update(states, names,
n);
470 auto enabled = SnapPortSP.findOnSwitchIndex() ==
INDI_ENABLED;
473 LOG_INFO(
"Toggling snap port on...");
475 LOG_INFO(
"Toggling snap port off...");
505 if (m_IterativeGOTOPending)
507 char RAStr[32], DecStr[32];
508 fs_sexa(RAStr, m_SkyCurrentRADE.rightascension, 2, 3600);
509 fs_sexa(DecStr, m_SkyCurrentRADE.declination, 2, 3600);
520 auto onSwitch =
CoordSP.findOnSwitch();
521 if (onSwitch && (onSwitch->isNameMatch(
"TRACK") || onSwitch->isNameMatch(
"SLEW")))
523 char RAStr[32], DecStr[32];
526 m_SkyTrackingTarget.rightascension =
ra;
527 m_SkyTrackingTarget.declination =
dec;
528 LOGF_INFO(
"Goto target RA %s DEC %s", RAStr, DecStr);
544 char RAStr[32], DecStr[32];
580 "Sky -> Mount AZ %lf° (%ld) AL %lf° (%ld)",
611 AzimuthOffsetMicrosteps, AltitudeOffsetMicrosteps);
620 AzimuthOffsetMicrosteps -= deltaAz;
621 AltitudeOffsetMicrosteps -= deltaAlt;
641 UpdateDetailedMountInformation(
false);
668 return *(
static_cast<double *
>(Switch->aux));
686 m_ManualMotionActive[
AXIS2] =
true;
713 m_ManualMotionActive[
AXIS1] =
true;
734 "Parking: Altitude offset %ld microsteps Azimuth offset %ld microsteps", AltitudeOffsetMicrosteps,
735 AzimuthOffsetMicrosteps);
770 m_SkyTrackingTarget.rightascension =
EqNP[
AXIS_RA].getValue();
771 m_SkyTrackingTarget.declination =
EqNP[
AXIS_DE].getValue();
779 m_ManualMotionActive[
AXIS1] = m_ManualMotionActive[
AXIS2] =
false;
814 UpdateDetailedMountInformation(
true);
816 bool resetTrackingTimers =
false;
830 m_MountAltAz = AltAz;
833 getCurrentRADE(AltAz, m_SkyCurrentRADE);
834 char RAStr[32], DecStr[32];
835 fs_sexa(RAStr, m_SkyCurrentRADE.rightascension, 2, 3600);
836 fs_sexa(DecStr, m_SkyCurrentRADE.declination, 2, 3600);
844 if (m_IterativeGOTOPending)
845 m_IterativeGOTOPending =
false;
849 m_IterativeGOTOPending =
true;
850 return Goto(m_SkyTrackingTarget.rightascension, m_SkyTrackingTarget.declination);
853 auto onSwitch =
CoordSP.findOnSwitch();
854 if (onSwitch && (onSwitch->isNameMatch(
"TRACK")))
858 resetTrackingTimers =
true;
877 if (resetTrackingTimers)
880 NewRaDec(m_SkyCurrentRADE.rightascension, m_SkyCurrentRADE.declination);
910 double RightAscension, Declination;
913 TelescopeDirectionVector RotatedTDV(TDV);
922 RotatedTDV.RotateAroundY(90.0 -
m_Location.latitude);
929 RotatedTDV.RotateAroundY(-90.0 -
m_Location.latitude);
934 INDI::IEquatorialCoordinates EquatorialCoordinates;
953 AxisDeadZoneNP.save(fp);
954 AxisClockNP.save(fp);
955 AxisOffsetNP.save(fp);
956 Axis1TrackRateNP.save(fp);
957 Axis2TrackRateNP.save(fp);
958 AUXEncoderSP.save(fp);
986 double OrigAlt = AltAz.altitude;
989 LOGF_INFO(
"Sync (Alt: %lf Az: %lf) in park position", OrigAlt, AltAz.azimuth);
996 UpdateDetailedMountInformation(
true);
1021 m_IterativeGOTOPending =
false;
1050 m_IterativeGOTOPending =
false;
1054 m_ManualMotionActive[
AXIS1] = m_ManualMotionActive[
AXIS2] =
false;
1089 GuidingPulses.clear();
1095 bool manualMotionStopped =
false;
1101 if (m_ManualMotionActive[axis] && !
IsInMotion(axis) && movementSP.getState() !=
IPS_BUSY)
1103 m_ManualMotionActive[axis] =
false;
1104 manualMotionStopped =
true;
1108 if (manualMotionStopped)
1111 m_SkyTrackingTarget.rightascension =
EqNP[
AXIS_RA].getValue();
1112 m_SkyTrackingTarget.declination =
EqNP[
AXIS_DE].getValue();
1115 if (m_ManualMotionActive[
AXIS1] || m_ManualMotionActive[
AXIS2])
1123 trackUsingPredictiveRates();
1133 GuidingPulses.clear();
1162 UpdateDetailedMountInformation(
false);
1193 LOGF_INFO(
"AUX encoders detected. Turning %s...", enabled ?
"on" :
"off");
1261 CalculateGuidePulses();
1262 Pulse.
DeltaAz = NorthPulse.DeltaAz;
1263 Pulse.
DeltaAlt = NorthPulse.DeltaAlt;
1266 GuidingPulses.push_back(Pulse);
1277 CalculateGuidePulses();
1278 Pulse.
DeltaAz = -NorthPulse.DeltaAz;
1279 Pulse.
DeltaAlt = -NorthPulse.DeltaAlt;
1282 GuidingPulses.push_back(Pulse);
1293 CalculateGuidePulses();
1294 Pulse.
DeltaAz = WestPulse.DeltaAz;
1295 Pulse.
DeltaAlt = WestPulse.DeltaAlt;
1298 GuidingPulses.push_back(Pulse);
1309 CalculateGuidePulses();
1310 Pulse.
DeltaAz = -WestPulse.DeltaAz;
1311 Pulse.
DeltaAlt = -WestPulse.DeltaAlt;
1314 GuidingPulses.push_back(Pulse);
1321void SkywatcherAPIMount::CalculateGuidePulses()
1328 const double WestRate =
IUFindNumber(&GuidingRatesNP,
"GUIDERA_RATE")->value / 10 * -1.0 / 60 / 60 * 3.75 / 100;
1330 ConvertGuideCorrection(WestRate, 0, WestPulse.
DeltaAlt, WestPulse.
DeltaAz);
1335 const double NorthRate =
IUFindNumber(&GuidingRatesNP,
"GUIDEDEC_RATE")->value / 10 * 1.0 / 60 / 60 * 100 / 100;
1337 ConvertGuideCorrection(0, NorthRate, NorthPulse.
DeltaAlt, NorthPulse.
DeltaAz);
1344void SkywatcherAPIMount::ResetGuidePulses()
1346 NorthPulse.Duration = 0;
1347 WestPulse.Duration = 0;
1353void SkywatcherAPIMount::ConvertGuideCorrection(
double delta_ra,
double delta_dec,
double &delta_alt,
double &delta_az)
1355 INDI::IHorizontalCoordinates OldAltAz { 0, 0 };
1356 INDI::IHorizontalCoordinates NewAltAz { 0, 0 };
1357 TelescopeDirectionVector OldTDV;
1358 TelescopeDirectionVector NewTDV;
1361 ln_get_julian_from_sys(), OldTDV);
1364 m_SkyTrackingTarget.declination + delta_dec, ln_get_julian_from_sys(), NewTDV);
1373void SkywatcherAPIMount::SkywatcherMicrostepsFromTelescopeDirectionVector(
1377 double Axis1Angle = 0;
1378 double Axis2Angle = 0;
1391SkywatcherAPIMount::TelescopeDirectionVectorFromSkywatcherMicrosteps(
long Axis1Microsteps,
long Axis2Microsteps)
1403void SkywatcherAPIMount::UpdateDetailedMountInformation(
bool InformClient)
1405 bool BasicMountInfoHasChanged =
false;
1407 if (std::string(BasicMountInfoT[MOTOR_CONTROL_FIRMWARE_VERSION].text) != std::to_string(
MCVersion))
1409 IUSaveText(&BasicMountInfoT[MOTOR_CONTROL_FIRMWARE_VERSION], std::to_string(
MCVersion).c_str());
1410 BasicMountInfoHasChanged =
true;
1412 if (std::string(BasicMountInfoT[MOUNT_CODE].text) != std::to_string(
MountCode))
1416 BasicMountInfoHasChanged =
true;
1418 if (std::string(BasicMountInfoT[IS_DC_MOTOR].text) != std::to_string(
IsDCMotor))
1421 BasicMountInfoHasChanged =
true;
1423 if (BasicMountInfoHasChanged && InformClient)
1428 bool AxisOneInfoHasChanged =
false;
1433 AxisOneInfoHasChanged =
true;
1438 AxisOneInfoHasChanged =
true;
1443 AxisOneInfoHasChanged =
true;
1448 AxisOneInfoHasChanged =
true;
1450 if (AxisOneInfoHasChanged && InformClient)
1453 bool AxisOneStateHasChanged =
false;
1457 AxisOneStateHasChanged =
true;
1462 AxisOneStateHasChanged =
true;
1467 AxisOneStateHasChanged =
true;
1472 AxisOneStateHasChanged =
true;
1477 AxisOneStateHasChanged =
true;
1482 AxisOneStateHasChanged =
true;
1484 if (AxisOneStateHasChanged && InformClient)
1487 bool AxisTwoInfoHasChanged =
false;
1491 AxisTwoInfoHasChanged =
true;
1496 AxisTwoInfoHasChanged =
true;
1501 AxisTwoInfoHasChanged =
true;
1506 AxisTwoInfoHasChanged =
true;
1508 if (AxisTwoInfoHasChanged && InformClient)
1511 bool AxisTwoStateHasChanged =
false;
1515 AxisTwoStateHasChanged =
true;
1520 AxisTwoStateHasChanged =
true;
1525 AxisTwoStateHasChanged =
true;
1530 AxisTwoStateHasChanged =
true;
1535 AxisTwoStateHasChanged =
true;
1540 AxisTwoStateHasChanged =
true;
1542 if (AxisTwoStateHasChanged && InformClient)
1545 bool AxisOneEncoderValuesHasChanged =
false;
1552 AxisOneEncoderValuesN[DEGREES_FROM_INITIAL].value =
1554 AxisOneEncoderValuesHasChanged =
true;
1556 if (AxisOneEncoderValuesHasChanged && InformClient)
1559 bool AxisTwoEncoderValuesHasChanged =
false;
1566 AxisTwoEncoderValuesN[DEGREES_FROM_INITIAL].value =
1568 AxisTwoEncoderValuesHasChanged =
true;
1570 if (AxisTwoEncoderValuesHasChanged && InformClient)
1598void SkywatcherAPIMount::resetTracking()
1600 m_TrackingRateTimer.
restart();
1604 Axis1PIDNP[Propotional].getValue(),
1605 Axis1PIDNP[Derivative].getValue(),
1606 Axis1PIDNP[Integral].getValue()));
1607 m_Controllers[
AXIS_AZ]->setIntegratorLimits(-1000, 1000);
1609 Axis2PIDNP[Propotional].getValue(),
1610 Axis2PIDNP[Derivative].getValue(),
1611 Axis2PIDNP[Integral].getValue()));
1612 m_Controllers[
AXIS_ALT]->setIntegratorLimits(-1000, 1000);
1619bool SkywatcherAPIMount::trackByRate(AXISID axis,
double rate)
1621 if (std::abs(rate) > 0 && rate == m_LastTrackRate[axis])
1624 m_LastTrackRate[axis] = rate;
1630 else if (!
AxesStatus[axis].FullStop && (rate == 0 || (
AxesStatus[axis].SlewingForward && rate < 0)
1631 || (!
AxesStatus[axis].SlewingForward && rate > 0)))
1634 LOGF_DEBUG(
"Tracking -> %s direction change.", (axis ==
AXIS1 ?
"Axis 1" :
"Axis 2"));
1639 auto stepsPerSecond =
static_cast<uint32_t
>(std::abs(rate * (axis ==
AXIS1 ?
1640 AxisOneEncoderValuesN[MICROSTEPS_PER_ARCSEC].value : AxisTwoEncoderValuesN[MICROSTEPS_PER_ARCSEC].value)));
1645 LOGF_DEBUG(
"Tracking -> %s restart.", (axis ==
AXIS1 ?
"Axis 1" :
"Axis 2"));
1661bool SkywatcherAPIMount::trackUsingPID()
1667 TelescopeDirectionVector TDV;
1668 INDI::IHorizontalCoordinates
AltAz { 0, 0 };
1679 m_SkyTrackingTarget.rightascension += dRA / (3600.0 * 15.0);
1680 m_TrackingRateTimer.restart();
1686 m_SkyTrackingTarget.rightascension += dRA / (3600.0 * 15.0);
1687 m_TrackingRateTimer.restart();
1690 auto ra = m_SkyTrackingTarget.rightascension + AxisOffsetNP[RAOffset].getValue() / 15.0;
1691 auto de = m_SkyTrackingTarget.declination + AxisOffsetNP[DEOffset].getValue();
1692 auto JDOffset = AxisOffsetNP[JulianOffset].getValue() / 86400.0;
1701 INDI::IEquatorialCoordinates EquatorialCoordinates {
ra, de };
1706 "New Tracking Target AZ %lf° (%ld microsteps) AL %lf° (%ld microsteps) ",
1713 double DeltaAlt = 0;
1716 getGuidePulses(DeltaAz, DeltaAlt);
1718 long SetPoint[2] = {0, 0}, Measurement[2] = {0, 0},
Error[2] = {0, 0};
1719 double TrackingRate[2] = {0, 0};
1737 auto Axis1CustomClockRate = Axis1TrackRateNP[TrackClockRate].getValue();
1740 (Axis1CustomClockRate == 0 && ((
AxesStatus[
AXIS1].SlewingForward && (Error[
AXIS1] < -AxisDeadZoneNP[
AXIS1].getValue())) ||
1742 (Axis1CustomClockRate > 0 && Axis1TrackRateNP[TrackDirection].getValue() != m_LastCustomDirection[
AXIS1])))
1744 m_LastCustomDirection[
AXIS1] = Axis1TrackRateNP[TrackDirection].getValue();
1747 LOG_DEBUG(
"Tracking -> AXIS1 direction change.");
1748 LOGF_DEBUG(
"AXIS1 Setpoint %d Measurement %d Error %d Rate %f",
1752 TrackingRate[
AXIS1]);
1759 TrackingRate[
AXIS1] = std::fabs(TrackingRate[
AXIS1]);
1760 if (TrackingRate[
AXIS1] != 0)
1764 if (Axis1CustomClockRate > 0)
1766 clockRate = Axis1CustomClockRate;
1767 Direction = Axis1TrackRateNP[TrackDirection].getValue() == 0 ?
'0' :
'1';
1770 LOGF_DEBUG(
"AXIS1 Setpoint %d Measurement %d Error %d Rate %f Freq %f Dir %s",
1774 TrackingRate[
AXIS1],
1776 Direction ==
'0' ?
"Forward" :
"Backward");
1779 m_Controllers[
AXIS1]->proportionalTerm(),
1780 m_Controllers[
AXIS1]->integralTerm(),
1781 m_Controllers[
AXIS1]->derivativeTerm());
1787 LOG_DEBUG(
"Tracking -> AXIS1 restart.");
1795 auto Axis2CustomClockRate = Axis2TrackRateNP[TrackClockRate].getValue();
1798 (Axis2CustomClockRate == 0 && ((
AxesStatus[
AXIS2].SlewingForward && (Error[
AXIS2] < -AxisDeadZoneNP[
AXIS2].getValue())) ||
1800 (Axis2CustomClockRate > 0 && Axis2TrackRateNP[TrackDirection].getValue() != m_LastCustomDirection[
AXIS2])))
1802 m_LastCustomDirection[
AXIS2] = Axis2TrackRateNP[TrackDirection].getValue();
1804 LOG_DEBUG(
"Tracking -> AXIS2 direction change.");
1805 LOGF_DEBUG(
"AXIS2 Setpoint %d Measurement %d Error %d Rate %f",
1809 TrackingRate[
AXIS2]);
1816 TrackingRate[
AXIS2] = std::fabs(TrackingRate[
AXIS2]);
1817 if (TrackingRate[
AXIS2] != 0)
1821 if (Axis2CustomClockRate > 0)
1823 clockRate = Axis2CustomClockRate;
1824 Direction = Axis2TrackRateNP[TrackDirection].getValue() == 0 ?
'0' :
'1';
1827 LOGF_DEBUG(
"AXIS2 Setpoint %d Measurement %d Error %d Rate %f Freq %f Dir %s",
1831 TrackingRate[
AXIS2],
1833 Error[
AXIS2] > 0 ?
"Forward" :
"Backward");
1836 m_Controllers[
AXIS2]->proportionalTerm(),
1837 m_Controllers[
AXIS2]->integralTerm(),
1838 m_Controllers[
AXIS2]->derivativeTerm());
1844 LOG_DEBUG(
"Tracking -> AXIS2 restart.");
1857bool SkywatcherAPIMount::trackUsingPredictiveRates()
1859 TelescopeDirectionVector TDV;
1860 TelescopeDirectionVector futureTDV;
1861 TelescopeDirectionVector pastTDV;
1862 INDI::IHorizontalCoordinates targetMountAxisCoordinates { 0, 0 };
1863 INDI::IHorizontalCoordinates pastMountAxisCoordinates { 0, 0 };
1864 INDI::IHorizontalCoordinates futureMountAxisCoordinates { 0, 0 };
1866 double timeStep { 5.0 };
1868 double JDoffset { timeStep / (60 * 60 * 24) } ;
1879 m_SkyTrackingTarget.rightascension += (dRA / 3600.0) / 15.0;
1880 m_TrackingRateTimer.restart();
1886 m_SkyTrackingTarget.rightascension += (dRA / 3600.0) / 15.0;
1887 m_TrackingRateTimer.restart();
1891 double JDnow {ln_get_julian_from_sys()};
1898 JDnow + JDoffset, futureTDV);
1901 JDnow - JDoffset, pastTDV);
1908 INDI::IEquatorialCoordinates EquatorialCoordinates { 0, 0 };
1909 EquatorialCoordinates.
rightascension = m_SkyTrackingTarget.rightascension;
1910 EquatorialCoordinates.
declination = m_SkyTrackingTarget.declination;
1916 double azGuideOffset = 0, altGuideOffset = 0;
1917 getGuidePulses(azGuideOffset, altGuideOffset);
1920 targetMountAxisCoordinates.
azimuth += azGuideOffset;
1921 pastMountAxisCoordinates.
azimuth += azGuideOffset;
1922 futureMountAxisCoordinates.
azimuth += azGuideOffset;
1924 targetMountAxisCoordinates.
altitude += altGuideOffset;
1925 pastMountAxisCoordinates.
altitude += altGuideOffset;
1926 futureMountAxisCoordinates.
altitude += altGuideOffset;
1929 double predRate[2] = {0, 0};
1940 LOGF_DEBUG(
"Predicted positions (AZ): %9.4f %9.4f (now, future, degs)",
1941 AzimuthToDegrees(targetMountAxisCoordinates.
azimuth),
1942 AzimuthToDegrees(futureMountAxisCoordinates.
azimuth)) ;
1943 LOGF_DEBUG(
"Predicted positions (AL): %9.4f %9.4f (now, future, degs)", targetMountAxisCoordinates.
altitude,
1944 futureMountAxisCoordinates.
altitude);
1954 INDI::IHorizontalCoordinates currentAltAz { 0, 0 };
1964 double offsetAngle[2] = {0, 0};
1968 int32_t targetSteps[2] = {0, 0};
1969 int32_t offsetSteps[2] = {0, 0};
1970 double trackRates[2] = {0, 0};
1973 offsetSteps[
AXIS_AZ] = offsetAngle[
AXIS_AZ] * AxisOneEncoderValuesN[MICROSTEPS_PER_ARCSEC].value;
1974 offsetSteps[
AXIS_ALT] = offsetAngle[
AXIS_ALT] * AxisTwoEncoderValuesN[MICROSTEPS_PER_ARCSEC].value;
1978 m_OffsetSwitchSettle[
AXIS_AZ] = 0;
1987 double minTrackRate = predRate[
AXIS_AZ] * MIN_TRACK_RATE_FACTOR;
1988 if(trackRates[
AXIS_AZ] * predRate[
AXIS_AZ] < 0 || std::abs(trackRates[
AXIS_AZ]) < std::abs(minTrackRate))
1989 trackRates[
AXIS_AZ] = minTrackRate;
1991 LOGF_DEBUG(
"Tracking AZ Now: %8.f Target: %8d Offset: %8d Rate: %8.2f", Axis1Steps, targetSteps[
AXIS_AZ],
1994 LOGF_DEBUG(
"Tracking AZ P: %8.1f I: %8.1f D: %8.1f O: %8.1f",
1995 m_Controllers[
AXIS_AZ]->proportionalTerm(),
1996 m_Controllers[
AXIS_AZ]->integralTerm(),
1997 m_Controllers[
AXIS_AZ]->derivativeTerm(),
2007 m_OffsetSwitchSettle[
AXIS_ALT] = 0;
2017 double minTrackRate = predRate[
AXIS_ALT] * MIN_TRACK_RATE_FACTOR;
2019 trackRates[
AXIS_ALT] = minTrackRate;
2021 LOGF_DEBUG(
"Tracking AL Now: %8.f Target: %8d Offset: %8d Rate: %8.2f", Axis2Steps,
2025 LOGF_DEBUG(
"Tracking AL P: %8.1f I: %8.1f D: %8.1f O: %8.1f",
2026 m_Controllers[
AXIS_ALT]->proportionalTerm(),
2027 m_Controllers[
AXIS_ALT]->integralTerm(),
2028 m_Controllers[
AXIS_ALT]->derivativeTerm(),
2040double SkywatcherAPIMount::AzimuthToDegrees(
double degree)
2042 if (isNorthHemisphere())
2051double SkywatcherAPIMount::DegreesToAzimuth(
double degree)
2053 if (isNorthHemisphere())
2059void SkywatcherAPIMount::getGuidePulses(
double &az,
double &alt)
2061 double DeltaAz = 0, DeltaAlt = 0;
2063 for (
auto Iter = GuidingPulses.begin(); Iter != GuidingPulses.end(); )
2066 if (Iter->OriginalDuration == 1000)
2068 DeltaAlt += Iter->DeltaAlt;
2069 DeltaAz += Iter->DeltaAz;
2073 DeltaAlt += Iter->DeltaAlt / 2;
2074 DeltaAz += Iter->DeltaAz / 2;
2080 Iter = GuidingPulses.erase(Iter);
2081 if (Iter == GuidingPulses.end())
void ProcessAlignmentNumberProperties(Telescope *pTelescope, const char *name, double values[], char *names[], int n)
Call this function from within the ISNewNumber processing path. The function will handle any alignmen...
void ProcessAlignmentSwitchProperties(Telescope *pTelescope, const char *name, ISState *states, char *names[], int n)
Call this function from within the ISNewSwitch processing path. The function will handle any alignmen...
void InitAlignmentProperties(Telescope *pTelescope)
Initialize alignment subsystem properties. It is recommended to call this function within initPropert...
void ProcessAlignmentBLOBProperties(Telescope *pTelescope, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
Call this function from within the ISNewBlob processing path. The function will handle any alignment ...
void SaveAlignmentConfigProperties(FILE *fp)
Call this function to save persistent alignment related properties. This function should be called fr...
void ProcessAlignmentTextProperties(Telescope *pTelescope, const char *name, char *texts[], char *names[], int n)
Call this function from within the ISNewText processing path. The function will handle any alignment ...
bool CheckForDuplicateSyncPoint(const AlignmentDatabaseEntry &CandidateEntry, double Tolerance=0.1) const
Check if a entry already exists in the database.
AlignmentDatabaseType & GetAlignmentDatabase()
Get a reference to the in memory database.
void UpdateLocation(double latitude, double longitude, double elevation)
Call this function from within the updateLocation processing path.
void UpdateSize()
Call this function when the number of entries in the database changes.
bool TransformTelescopeToCelestialJD(const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination, double JulianDate)
TransformTelescopeToCelestialJD Transforms Mount Coords to Celestial (Sky) Coordinates.
bool TransformCelestialToTelescopeJD(double RightAscension, double Declination, double JulianDate, TelescopeDirectionVector &ApparentTelescopeDirectionVector)
TransformCelestialToTelescopeJD Transforms Celestial (Sky) Coords to Mount Coordinates.
bool Initialise(InMemoryDatabase *pInMemoryDatabase)
Initialise or re-initialise the math plugin. Re-reading the in memory database as necessary.
MountAlignment_t GetApproximateMountAlignment()
Get the approximate alignment of the mount.
void SetApproximateMountAlignmentFromMountType(MountType_t Type)
Call this function to set the ApproximateMountAlignment property of the current Math Plugin....
const TelescopeDirectionVector TelescopeDirectionVectorFromSphericalCoordinate(const double AzimuthAngle, AzimuthAngleDirection_t AzimuthAngleDirection, const double PolarAngle, PolarAngleDirection_t PolarAngleDirection)
Calculates a telescope direction vector from the supplied spherical coordinate information.
void SphericalCoordinateFromTelescopeDirectionVector(const TelescopeDirectionVector TelescopeDirectionVector, double &AzimuthAngle, AzimuthAngleDirection_t AzimuthAngleDirection, double &PolarAngle, PolarAngleDirection_t PolarAngleDirection)
Calculates a spherical coordinate from the supplied telescope direction vector.
const TelescopeDirectionVector TelescopeDirectionVectorFromAltitudeAzimuth(INDI::IHorizontalCoordinates HorizontalCoordinates)
Calculates a normalised direction vector from the supplied altitude and azimuth.
void AltitudeAzimuthFromTelescopeDirectionVector(const TelescopeDirectionVector TelescopeDirectionVector, INDI::IHorizontalCoordinates &HorizontalCoordinates)
Calculates an altitude and azimuth from the supplied normalised direction vector and declination.
INDI::PropertySwitch getSwitch(const char *name) const
virtual bool saveConfig(bool silent=false, const char *property=nullptr)
Save the current properties in a configuration file.
void addConfigurationControl()
Add Configuration control to the driver.
void setActiveConnection(Connection::Interface *existingConnection)
setActiveConnection Switch the active connection to the passed connection plugin
void setDriverInterface(uint32_t value)
setInterface Set driver interface. By default the driver interface is set to GENERAL_DEVICE....
void setVersion(uint16_t vMajor, uint16_t vMinor)
Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
uint32_t getPollingPeriod() const
getPollingPeriod Return the polling period.
void defineProperty(INumberVectorProperty *property)
uint32_t getCurrentPollingPeriod() const
getCurrentPollingPeriod Return the current polling period.
uint32_t getDriverInterface() const
virtual bool ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
Process the client newBLOB command.
Connection::Interface * getActiveConnection()
void addDebugControl()
Add Debug control to the driver.
int64_t restart()
Restarts the timer and returns the number of milliseconds elapsed since the previous start.
INDI::PropertyNumber GuideNSNP
virtual void GuideComplete(INDI_EQ_AXIS axis)
Call GuideComplete once the guiding pulse is complete.
bool updateProperties()
updateProperties Define or Delete Rotator properties based on the connection status of the base devic...
INDI::PropertyNumber GuideWENP
void initProperties(const char *groupName)
Initialize guider properties. It is recommended to call this function within initProperties() of your...
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Call this function whenever client updates GuideNSNP or GuideWSP properties in the primary device....
void setState(IPState state)
TelescopeStatus TrackState
void SetAxis1Park(double value)
SetRAPark Set current RA/AZ parking position. The data park file (stored in ~/.indi/ParkData....
void SetAxis1ParkDefault(double steps)
SetRAPark Set default RA/AZ parking position.
void SetTelescopeCapability(uint32_t cap, uint8_t slewRateCount)
SetTelescopeCapability sets the Telescope capabilities. All capabilities must be initialized.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual void TimerHit() override
Called when setTimer() time is up.
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
double GetAxis1Park() const
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
double GetAxis2Park() const
bool isParked()
isParked is mount currently parked?
virtual int AddTrackMode(const char *name, const char *label, bool isDefault=false)
AddTrackMode.
Connection::Serial * serialConnection
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual void SetParked(bool isparked)
SetParked Change the mount parking status. The data park file (stored in ~/.indi/ParkData....
Connection::TCP * tcpConnection
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
IGeographicCoordinates m_Location
void NewRaDec(double ra, double dec)
The child class calls this function when it has updates.
bool InitPark()
InitPark Loads parking data (stored in ~/.indi/ParkData.xml) that contains parking status and parking...
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
void SetAxis2Park(double steps)
SetDEPark Set current DEC/ALT parking position. The data park file (stored in ~/.indi/ParkData....
void setMountType(TelescopeMountType type)
setMountType Report the mount type in TELESCOPE_MOUNT_TYPE. Drivers call it when the type is fixed by...
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
void SetParkDataType(TelescopeParkData type)
setParkDataType Sets the type of parking data stored in the park data file and presented to the user.
@ TELESCOPE_HAS_TRACK_MODE
@ TELESCOPE_CAN_CONTROL_TRACK
void SetAxis2ParkDefault(double steps)
SetDEParkDefault Set default DEC/ALT parking position.
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual IPState GuideEast(uint32_t ms) override
Guide east for ms milliseconds. East is defined as RA+.
virtual void TimerHit() override
Called when setTimer() time is up.
virtual bool ReadScopeStatus() override
Read telescope status.
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
virtual const char * getDefaultName() override
Misc.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool Handshake() override
Communication.
virtual IPState GuideWest(uint32_t ms) override
Guide west for ms milliseconds. West is defined as RA-.
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
virtual bool Park() override
Parking.
virtual bool Sync(double ra, double dec) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Motion.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual IPState GuideSouth(uint32_t ms) override
Guide south for ms milliseconds. South is defined as DEC-.
virtual bool Goto(double ra, double dec) override
Move the scope to the supplied RA and DEC coordinates.
virtual bool ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n) override
Process the client newBLOB command.
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual IPState GuideNorth(uint32_t ms) override
Guiding.
virtual bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
double MicrostepsToRadians(AXISID Axis, long Microsteps)
Convert microsteps to angle in radians.
void TurnRAEncoder(bool on)
void SetSerialPort(int port)
Set the serail port to be usb for mount communication.
static constexpr double SIDEREALRATE
double MicrostepsToDegrees(AXISID Axis, long Microsteps)
Convert microsteps to angle in degrees.
void SlewTo(AXISID Axis, long OffsetInMicrosteps, bool verbose=true)
Slew to the given offset and stop.
long ZeroPositionEncoders[2]
Zero position encoder values (microsteps).
long CurrentEncoders[2]
Current encoder values (microsteps).
bool GetStatus(AXISID Axis)
long RadiansToMicrosteps(AXISID Axis, double AngleInRadians)
Convert angle in radians to microsteps.
bool SetEncoder(AXISID Axis, long Microsteps)
Set axis encoder to the specified value.
void TurnDEEncoder(bool on)
long PolarisPositionEncoders[2]
Polaris position (initial) encoder values (microsteps).
bool GetEncoder(AXISID Axis)
Set the CurrentEncoders status variable to the current encoder value in microsteps for the specified ...
long MicrostepsPerWormRevolution[2]
double MicrostepsPerDegree[2]
long DegreesToMicrosteps(AXISID Axis, double AngleInDegrees)
Convert angle in degrees to microsteps.
bool SlowStop(AXISID Axis)
Bring the axis to slow stop in the distance specified by SetSlewModeDeccelerationRampLength.
bool StartAxisMotion(AXISID Axis)
Start the axis slewing in the previously selected mode.
bool InitMount()
Initialize the communication to the mount.
void Slew(AXISID Axis, double SpeedInRadiansPerSecond, bool IgnoreSilentMode=true)
Start the axis slewing at the given rate.
bool SetAxisMotionMode(AXISID Axis, char Func, char Direction)
Set the motion mode per the specified axis.
long MicrostepsPerRevolution[2]
bool IsInMotion(AXISID Axis)
Check if an axis is moving.
long StepperClockFrequency[2]
bool toggleSnapPort(bool enabled)
Toggle the snap port on or off.
bool SetClockTicksPerMicrostep(AXISID Axis, long ClockTicksPerMicrostep)
Set the PIC internal divider variable which determines how many clock interrupts have to occur betwee...
INDI::Telescope * pChildTelescope
static const char * mountTypeToString(uint8_t type)
const char * GUIDE_TAB
GUIDE_TAB Where all the properties for guiding are located.
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
const char * MOTION_TAB
MOTION_TAB Where all the motion control properties of the device are located.
INDI::PropertySwitch MovementNSSP
INDI::PropertyNumber EqNP
INDI::PropertySwitch SlewRateSP
INDI::PropertySwitch TrackModeSP
INDI::PropertySwitch MovementWESP
INDI::PropertySwitch CoordSP
void tty_set_generic_udp_format(int enabled)
void tty_set_auto_reset_udp_session(int flag)
automatically reset UDP session on write
double range180(double r)
range180 Limits an angle to be between -180 to +180 degrees
double range360(double r)
range360 Limits an angle to be between 0-360 degrees.
int fs_sexa(char *out, double a, int w, int fracbase)
Converts a sexagesimal number to a string. sprint the variable a in sexagesimal format into out[].
Implementations for common driver routines.
void IUFillNumberVector(INumberVectorProperty *nvp, INumber *np, int nnp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a number vector property. The vector's auxiliary elements will be set to NULL.
void IUFillTextVector(ITextVectorProperty *tvp, IText *tp, int ntp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a text vector property. The vector's auxiliary elements will be set to NULL.
INumber * IUFindNumber(const INumberVectorProperty *nvp, const char *name)
Find an INumber member in a number text property.
void IUSaveText(IText *tp, const char *newtext)
Function to reliably save new text in a IText.
ISwitch * IUFindSwitch(const ISwitchVectorProperty *svp, const char *name)
Find an ISwitch member in a vector switch property.
void IUFillSwitch(ISwitch *sp, const char *name, const char *label, ISState s)
Assign attributes for a switch property. The switch's auxiliary elements will be set to NULL.
void IUFillText(IText *tp, const char *name, const char *label, const char *initialText)
Assign attributes for a text property. The text's auxiliary elements will be set to NULL.
void IUFillNumber(INumber *np, const char *name, const char *label, const char *format, double min, double max, double step, double value)
Assign attributes for a number property. The number's auxiliary elements will be set to NULL.
void IUFillSwitchVector(ISwitchVectorProperty *svp, ISwitch *sp, int nsp, const char *dev, const char *name, const char *label, const char *group, IPerm p, ISRule r, double timeout, IPState s)
Assign attributes for a switch vector property. The vector's auxiliary elements will be set to NULL.
void IDSetNumber(const INumberVectorProperty *nvp, const char *fmt,...)
void IDSetSwitch(const ISwitchVectorProperty *svp, const char *fmt,...)
int IUUpdateNumber(INumberVectorProperty *nvp, double values[], char *names[], int n)
Update all numbers in a number vector property.
void IDSetText(const ITextVectorProperty *tvp, const char *fmt,...)
*brief user defined string literal for JSON values *sa std::size_t n
#define LOGF_INFO(fmt,...)
#define DEBUG(priority, msg)
Macro to print log messages. Example of usage of the Logger: DEBUG(DBG_DEBUG, "hello " << "world");.
#define LOGF_DEBUG(fmt,...)
#define DEBUGF(priority, msg,...)
#define TRACKRATE_SIDEREAL
Namespace to encapsulate the INDI Alignment Subsystem classes. For more information see "INDI Alignme...
void EquatorialToHorizontal(IEquatorialCoordinates *object, IGeographicCoordinates *observer, double JD, IHorizontalCoordinates *position)
EquatorialToHorizontal Calculate horizontal coordinates from equatorial coordinates.
void HorizontalToEquatorial(IHorizontalCoordinates *object, IGeographicCoordinates *observer, double JD, IEquatorialCoordinates *position)
HorizontalToEquatorial Calculate Equatorial EOD Coordinates from horizontal coordinates.
Entry in the in memory alignment database.
double RightAscension
Right ascension in decimal hours. N.B. libnova works in decimal degrees so conversion is always neede...
double ObservationJulianDate
TelescopeDirectionVector TelescopeDirection
Normalised vector giving telescope pointing direction. This is referred to elsewhere as the "apparent...
double Declination
Declination in decimal degrees.
int PrivateDataSize
This size in bytes of any private data.
Holds a normalised direction vector (direction cosines).
void RotateAroundY(double Angle)
Rotate the reference frame around the Y axis. This has the affect of rotating the vector itself in th...