34#define LIBRARY_TAB "Library"
35#define FIRMWARE_TAB "Firmware data"
36#define STATUS_TAB "ONStep Status"
38#define ALIGN_TAB "Align"
39#define OUTPUT_TAB "Outputs"
40#define ENVIRONMENT_TAB "Weather"
41#define ROTATOR_TAB "Rotator"
52 currentSubCatalog = 0;
89 return "LX200 OnStep";
223 TFCCoefficientNP[0].
fill(
"TFC Coefficient",
"TFC Coefficient µm/°C",
"%+03.5f", -999.99999, 999.99999, 1, 100);
335 OSNAlignTP[0].
fill(
"0",
"Align Process Status",
"Align not started");
336 OSNAlignTP[1].
fill(
"1",
"1. Manual Process",
"Point towards the NCP");
337 OSNAlignTP[2].
fill(
"2",
"2. Plate Solver Process",
"Point towards the NCP");
338 OSNAlignTP[3].
fill(
"3",
"Manual Action after 1",
"Press 'Start Align'");
363 IUFillSwitchVector(&OSOutput1SP, OSOutput1S, 2,
getDeviceName(),
"Output 1",
"Output 1",
OUTPUT_TAB,
IP_RW,
ISR_ATMOST1, 60,
368 IUFillSwitchVector(&OSOutput2SP, OSOutput2S, 2,
getDeviceName(),
"Output 2",
"Output 2",
OUTPUT_TAB,
IP_RW,
ISR_ATMOST1, 60,
375 snprintf(port_name,
sizeof(port_name),
"Output %d", i);
416 addParameter(
"WEATHER_TEMPERATURE",
"Temperature (C)", -40, 85, 15);
417 addParameter(
"WEATHER_HUMIDITY",
"Humidity %", 0, 100, 15);
418 addParameter(
"WEATHER_BAROMETER",
"Pressure (hPa)", 0, 1500, 15);
419 addParameter(
"WEATHER_DEWPOINT",
"Dew Point (C)", 0, 100, 15);
420 addParameter(
"WEATHER_CPU_TEMPERATURE",
"OnStep CPU Temperature", -274, 200, -274);
433 if (dev !=
nullptr && strcmp(dev,
getDeviceName()) != 0)
return;
446 if (!activeConnection->
name().compare(
"CONNECTION_TCP"))
448 LOG_INFO(
"Network based connection, detection timeouts set to 2 seconds");
454 LOG_INFO(
"Non-Network based connection, detection timeouts set to 0.1 seconds");
498 if (error_or_fail > 0 && response[0] ==
'1')
515 LOGF_DEBUG(
"error_or_fail = %u, response = %c", error_or_fail, response[0]);
538 LOG_INFO(
"Version unknown or OnStepX (Checking for OnStepX Focusers)");
539 for (
int i = 0; i < 9; i++)
543 snprintf(
cmd,
sizeof(
cmd),
":F%dA#", i + 1);
546 if (!fail_or_error && read_buffer[0] ==
'1')
553 if(fail_or_error < 0)
556 LOGF_INFO(
"Function call failed in a way that says OnStep doesn't have this setup, stopping Focuser probing, return: %i",
577 LOG_INFO(
"At least one focuser found, showing interface");
581 LOG_DEBUG(
"Focusers checked Variables:");
587 if (error_or_fail > 0)
589 if (rotator_response[0] ==
'D' || rotator_response[0] ==
'R')
597 if (rotator_response[0] ==
'D')
601 if (rotator_response[0] ==
'0')
609 LOG_WARN(
"Error on response to rotator check (:GX98#) CHECK CONNECTION");
671 double longitude = -1000, latitude = -1000;
770 LOG_INFO(
"Initialization Complete");
778 if (strstr(name,
"FOCUS_"))
780 if (strstr(name,
"ROTATOR_"))
792 for (
int x = 0; x < n; x++)
800 if ((
ra >= 0) && (
ra <= 24) && (
dec >= -90) && (
dec <= 90))
807 LOG_DEBUG(
"Please unpark the mount before issuing any motion/sync commands.");
815 if (Telescope::CanSync())
818 if (oneSwitch && oneSwitch->getState() ==
ISS_ON)
839 char object_name[256];
845 LOG_ERROR(
"Failed to select catalog object.");
870 snprintf(
cmd, 5,
":R%d#", (
int)values[0]);
877 LOGF_DEBUG(
"Setting Max Slew Rate to %f\n", values[0]);
880 LOG_ERROR(
"Setting Max Slew Rate Failed");
887 LOGF_INFO(
"Slewrate set to %04.1f", values[0]);
899 double bklshdec = 0, bklshra = 0;
901 for (nset = i = 0; i < n; i++)
905 bklshdec = values[i];
906 LOGF_DEBUG(
"===CMD==> Backlash DEC= %f", bklshdec);
907 nset += bklshdec >= 0 && bklshdec <= 999;
912 LOGF_DEBUG(
"===CMD==> Backlash RA= %f", bklshra);
913 nset += bklshra >= 0 && bklshra <= 999;
919 snprintf(
cmd, 9,
":$BD%d#", (
int)bklshdec);
926 const struct timespec timeout = {0, 100000000L};
927 nanosleep(&timeout,
nullptr);
928 snprintf(
cmd, 9,
":$BR%d#", (
int)bklshra);
954 double minAlt = 0, maxAlt = 0;
957 for (nset = i = 0; i < n; i++)
962 nset += minAlt >= -30.0 && minAlt <= 30.0;
967 nset += maxAlt >= 60.0 && maxAlt <= 90.0;
975 LOG_ERROR(
"Error setting min elevation limit.");
982 LOG_ERROR(
"Error setting max elevation limit.");
995 LOG_ERROR(
"elevation limit missing or invalid.");
1005 double minPMEast = 0, minPMWest = 0;
1007 for (nset = i = 0; i < n; i++)
1011 minPMEast = values[i];
1012 LOGF_DEBUG(
"===CMD==> minutesPastMeridianN[0]/East = %f", minPMEast);
1013 nset += minPMEast >= -180 && minPMEast <= 180;
1017 minPMWest = values[i];
1018 LOGF_DEBUG(
"===CMD==> minutesPastMeridianN[1]/West= %f", minPMWest);
1019 nset += minPMWest >= -180 && minPMWest <= 180;
1025 snprintf(
cmd, 20,
":SXE9,%d#", (
int) minPMEast);
1030 LOG_ERROR(
"Error minutesPastMeridian East.");
1032 const struct timespec timeout = {0, 100000000L};
1033 nanosleep(&timeout,
nullptr);
1034 snprintf(
cmd, 20,
":SXEA,%d#", (
int) minPMWest);
1039 LOG_ERROR(
"Error minutesPastMeridian West.");
1052 LOG_ERROR(
"minutesPastMeridian invalid.");
1064 if ((values[0] >= -25000) && (values[0] <= 25000))
1066 snprintf(
cmd, 15,
":fR%d#", (
int)values[0]);
1083 for(
int i = 0; i < n; i++)
1085 int value = (int)values[i];
1093 snprintf(
cmd,
sizeof(
cmd),
":SXX%d,V%d#", port, value);
1100 LOGF_ERROR(
"Set port %d to value =%d failed", port, value);
1118 if ((values[0] >= -100) && (values[0] <= 100))
1121 snprintf(
cmd, 15,
":SX9A,%d#", (
int)values[0]);
1139 if ((values[0] >= 0) && (values[0] <= 100))
1141 snprintf(
cmd, 15,
":SX9C,%d#", (
int)values[0]);
1159 if ((values[0] >= 500) && (values[0] <= 1100))
1161 snprintf(
cmd, 15,
":SX9B,%d#", (
int)values[0]);
1181 if (abs(values[0]) < 1000)
1183 snprintf(
cmd, 15,
":FC%+3.5f#", values[0]);
1201 if ((values[0] >= 1) && (values[0] <= 32768))
1203 snprintf(
cmd, 15,
":FD%d#", (
int)values[0]);
1220 if (strstr(name,
"WEATHER_"))
1250 LOG_WARN(
"Telescope is Parked, Unpark before tracking.");
1269 LOG_DEBUG(
"TrackStateSP intercept, OnStep driver, should never get here");
1307 snprintf(
cmd,
sizeof(
cmd),
":R%d#", index);
1314 LOGF_DEBUG(
"Setting Max Slew Rate to %u\n", index);
1316 LOG_ERROR(
"Setting Max Slew Rate Failed");
1553 snprintf(
cmd, 5,
":FZ#");
1561 snprintf(
cmd, 5,
":FH#");
1577 LOGF_INFO(
"Primary focuser set: Focuser 1 in INDI/Controllable Focuser = OnStep Focuser %d", index + 1);
1580 LOG_INFO(
"If using OnStep: Focuser 2 in INDI = OnStep Focuser 2");
1584 LOG_INFO(
"If using OnStep: Focuser 2 in INDI = OnStep Focuser 1");
1590 snprintf(
cmd, 7,
":FA%d#", index + 1 );
1612 snprintf(
cmd, 5,
":F%d#", index + 1);
1627 strncpy(
cmd,
":f+#",
sizeof(
cmd));
1631 strncpy(
cmd,
":f-#",
sizeof(
cmd));
1635 strncpy(
cmd,
":fQ#",
sizeof(
cmd));
1638 const struct timespec timeout = {0, 100000000L};
1639 nanosleep(&timeout,
nullptr);
1658 strncpy(
cmd,
":r-#",
sizeof(
cmd));
1662 strncpy(
cmd,
":r+#",
sizeof(
cmd));
1728 else if (index == 1)
1759 if ((index_stars <= 8) && (index_stars >= 0))
1761 int stars = index_stars + 1;
1763 LOGF_INFO(
"Align index: %d, stars: %d", index_stars, stars);
1802 LOG_INFO(
"Step 1: Goto a bright star between 50 and 80 degrees N/S from the pole. Preferably on the Meridian.");
1803 LOG_INFO(
"Step 2: Make sure it is centered.");
1804 LOG_INFO(
"Step 3: Press Refine Polar Alignment.");
1805 LOG_INFO(
"Step 4: Using the mount's Alt and Az screws manually recenter the star. (Video mode if your camera supports it will be helpful.)");
1806 LOG_INFO(
"Optional: Start a new alignment.");
1815 snprintf(
cmd, 5,
":MP#");
1829 if(res > 0 && response[0] ==
'0')
1831 LOG_INFO(
"Command for Refine Polar Alignment Successful");
1839 LOGF_ERROR(
"Command for Refine Polar Alignment Failed, error=%s", response[0]);
1862 snprintf(
cmd,
sizeof(
cmd),
":Fc0#");
1869 snprintf(
cmd,
sizeof(
cmd),
":Fc1#");
1882#ifdef ONSTEP_NOTDONE
1883 if (OSOutput1SP.isNameMatch(name))
1885 OSOutput1SP.update(states, names, n);
1886 if (OSOutput1SP[0].getState() ==
ISS_ON)
1891 else if (OSOutput1SP[1].getState() ==
ISS_ON)
1896 OSOutput1SP.apply();
1899 if (OSOutput2SP.isNameMatch(name))
1901 OSOutput2SP.update(states, names, n);
1902 if (OSOutput2SP[0].getState() ==
ISS_ON)
1907 else if (OSOutput2SP[1].getState() ==
ISS_ON)
1912 OSOutput2SP.apply();
1918 if (strstr(name,
"FOCUS"))
1923 if (strstr(name,
"ROTATOR"))
1939 char buffer[128] = {0};
1953 LOG_INFO(
"Old OnStep (V1/V2 depreciated) detected, setting some defaults");
1954 LOG_INFO(
"Note: Everything should work, but it may have timeouts in places, as it's not tested against.");
1961 LOG_INFO(
"V3 OnStep detected, setting some defaults");
1968 LOG_INFO(
"V4 OnStep detected, setting some defaults");
1975 LOG_INFO(
"V5 OnStep detected, setting some defaults");
1982 LOG_INFO(
"OnStepX detected, setting some defaults");
1988 LOG_INFO(
"OnStep/OnStepX version could not be detected");
2001 switch (mountTypeResponse[0])
2006 LOG_INFO(
"Mount type detected: AltAz");
2011 LOG_INFO(
"Mount type detected: Fork (Equatorial)");
2016 LOG_INFO(
"Mount type detected: Fork Alt (AltAz)");
2022 LOG_INFO(
"Mount type detected: GEM");
2030 LOGF_WARN(
"Could not query mount type via :GXEM# (error %d), defaulting to GEM", gxem_error);
2036 LOG_INFO(
"=============== Parkdata loaded");
2041 LOG_INFO(
"=============== Parkdata Load Failed");
2052 if(error_or_fail != 1 || response[0] !=
'1')
2054 LOGF_WARN(
"===CMD==> Set Park Pos %s", response);
2059 LOG_WARN(
"Park Value set to current position");
2068 LOG_WARN(
"Park Position set to Default value, 20/80");
2080 if ((response[0] !=
'1') || (failure_or_error < 0))
2099 Telescope::AbortSP.apply();
2102 Telescope::AbortSP.setState(
IPS_OK);
2105 Telescope::AbortSP.apply();
2139 bool pier_not_set =
true;
2149 tcflush(
PortFD, TCIOFLUSH);
2163 if (error_or_fail > 1)
2170 if (sscanf(
OSStat,
"%s%[pIPF]%s%[0-9]%[0-9]%[0-9]", check_GU_valid1, &check_GU_valid2[0], check_GU_valid3,
2171 &check_GU_valid2[1], &check_GU_valid2[2], &check_GU_valid2[3]) != 1)
2173 LOG_WARN(
":GU# returned something that can not be right, this update aborted, will try again...");
2174 LOGF_DEBUG(
"Parameters matched: %u from %s", sscanf(
OSStat,
"%s%[pIPF]%s%[0-9]%[0-9]%[0-9]", check_GU_valid1,
2175 &check_GU_valid2[0], check_GU_valid3, &check_GU_valid2[1], &check_GU_valid2[2], &check_GU_valid2[3]),
OSStat);
2184 LOG_INFO(
"RA/DEC could not be read, possible solution if using (wireless) ethernet: Use port 9998");
2185 LOG_WARN(
"This update aborted, will try again...");
2194#ifdef DEBUG_TRACKSTATE
2273#ifdef DEBUG_TRACKSTATE
2277 LOG_DEBUG(
"EqNP is IPS_BUSY (Goto/slew or Parking)");
2285 LOG_DEBUG(
"EqNP is IPS_IDLE (Not Tracking or Parked)");
2289 LOG_DEBUG(
"EqNP is IPS_ALERT (Something wrong)");
2294 bool trackStateUpdateNeded =
false;
2300 trackStateUpdateNeded =
true;
2306 trackStateUpdateNeded =
true;
2314 trackStateUpdateNeded =
true;
2320 trackStateUpdateNeded =
true;
2323 if (trackStateUpdateNeded)
2325#ifdef DEBUG_TRACKSTATE
2332#ifdef DEBUG_TRACKSTATE
2337 bool update_needed =
false;
2345 update_needed =
true;
2346#ifdef DEBUG_TRACKSTATE
2357 update_needed =
true;
2358#ifdef DEBUG_TRACKSTATE
2368 update_needed =
true;
2369#ifdef DEBUG_TRACKSTATE
2377#ifdef DEBUG_TRACKSTATE
2380 update_needed =
true;
2384#ifdef DEBUG_TRACKSTATE
2390#ifdef DEBUG_TRACKSTATE
2393 LOG_DEBUG(
"EqNP is IPS_BUSY (Goto/slew or Parking)");
2401 LOG_DEBUG(
"EqNP is IPS_IDLE (Not Tracking or Parked)");
2405 LOG_DEBUG(
"EqNP is IPS_ALERT (Something wrong)");
2411#ifdef DEBUG_TRACKSTATE
2499 OnstepStatTP[4].setText(
"AutoRecord (waiting on index)");
2507 OnstepStatTP[4].setText(
"AutoPlaying (waiting on index)");
2538 LOG_INFO(
"Telescope detected having PEC, setting that capability");
2539 LOGF_DEBUG(
"capabilities = %x", capabilities);
2554 if (!strstr(
OSStat,
"S"))
2596 LOG_INFO(
"Telescope detected having Pier Side, adding that capability (many messages duplicated)");
2597 LOGF_DEBUG(
"capabilities = %x", capabilities);
2607 pier_not_set =
false;
2612 pier_not_set =
false;
2617 pier_not_set =
false;
2663 if (
OSStat[0] & 0b10000001 == 0b10000001)
2667 if (
OSStat[0] & 0b10000010 == 0b10000010)
2671 if (
OSStat[0] & 0b10000100 == 0b10000100)
2680 if (
OSStat[0] & 0b10001000 == 0b10001000)
2689 if ((
OSStat[0] & 0b10010000 == 0b10010000
2690 ||
OSStat[0] & 0b10100000 == 0b10100000))
2692 if (
OSStat[0] & 0b10100000 == 0b10100000)
2696 if (
OSStat[0] & 0b10010000 == 0b10010000)
2700 if (
OSStat[0] & 0b11000000 == 0b11000000)
2715 if (
OSStat[1] & 0b10000001 == 0b10000001)
2719 if (
OSStat[1] & 0b10000010 == 0b10000010)
2723 if (
OSStat[1] & 0b10000011 == 0b10000011)
2728 if (
OSStat[2] & 0b10000001 == 0b10000001)
2732 if (
OSStat[2] & 0b10000010 == 0b10000010)
2737 if (
OSStat[2] & 0b10000100 == 0b10000100)
2751 if (
OSStat[2] & 0b10001000 == 0b10001000)
2755 if (
OSStat[2] & 0b10010000 == 0b10010000)
2770 if (
OSStat[2] & 0b10100000 == 0b10100000)
2779 if (
OSStat[3] & 0b10000001 == 0b10000001)
2785 if (
OSStat[3] & 0b10000010 == 0b10000010)
2791 if (
OSStat[3] & 0b10000100 == 0b10000100)
2797 if (
OSStat[3] & 0b10001000 == 0b10001000)
2806 if (
OSStat[3] & 0b10010000 == 0b10010000)
2812 if (
OSStat[3] & 0b10100000 == 0b10100000)
2817 if (
OSStat[3] & 0b11000000 == 0b11000000)
2836 PulseGuideGU =
OSStat[6] & 0b01111111;
2837 GuideRateGU =
OSStat[7] & 0b01111111;
2838 LastError =
OSStat[8] & 0b01111111;
2867 OnstepStatTP[7].setText(
"Meridian Limit (W) Exceeded");
2930 if (error_or_fail > 1)
2954 LOG_WARN(
"Communication error on Pier Side (:Gm#), this update aborted, will try again...");
2968 double backlash_DEC, backlash_RA;
2971 if (BD_error > 1 && BR_error > 1)
2979 LOG_WARN(
"Communication error on backlash (:%BD#/:%BR#), this update aborted, will try again...");
2983 double pulseguiderate = 0.0;
2986 LOGF_DEBUG(
"Guide Rate String: %s", GuideValue);
2987 pulseguiderate = atof(GuideValue);
2988 LOGF_DEBUG(
"Guide Rate: %f", pulseguiderate);
2995 LOGF_DEBUG(
"Guide Rate String: %s", GuideValue);
2996 LOG_DEBUG(
"Guide rate error response, Not setting guide rate from :GX90# response, falling back to :GU#, which may not be accurate, if custom settings are used");
2998 switch(pulseguiderateint)
3001 pulseguiderate = (double)0.25;
3004 pulseguiderate = (double)0.5;
3007 pulseguiderate = (double)1.0;
3010 pulseguiderate = 0.0;
3011 LOG_DEBUG(
"Could not get guide rate from :GU# response, not setting");
3012 LOG_WARN(
"Communication error on Guide Rate (:GX90#/:GU#), this update aborted, will try again...");
3015 if (pulseguiderate != 0.0)
3017 LOGF_DEBUG(
"Guide Rate: %f", pulseguiderate);
3028 char merdidianflipauto_response[
RB_MAX_LEN] = {0};
3032 if (merdidianflipauto_response[0] ==
'1')
3039 else if (merdidianflipauto_response[0] ==
'0')
3049 LOG_WARN(
"Communication error on meridianAutoFlip (:GX95#), this update aborted, will try again...");
3058 char preferredpierside_response[
RB_MAX_LEN] = {0};
3062 if (strstr(preferredpierside_response,
"W"))
3068 else if (strstr(preferredpierside_response,
"E"))
3074 else if (strstr(preferredpierside_response,
"B"))
3099 LOG_WARN(
"Communication error on Preferred Pier Side (:GX96#), this update aborted, will try again...");
3107 int gxea_error, gxe9_error;
3108 double minutes_past_Meridian_East, minutes_past_Meridian_West;
3122 LOG_WARN(
"Communication error on Degrees past Meridian West (:GXEA#), this update aborted, will try again...");
3128 LOG_WARN(
"Communication error on Degrees past Meridian East (:GXE9#), this update aborted, will try again...");
3144 LOGF_DEBUG(
"Elevation Limit Min: %s, %i Go_nbcar: %i", Go, Go_int, Go_error);
3148 LOG_WARN(
"Communication :Go# error, check connection.");
3161 LOGF_DEBUG(
"Elevation Limit Min: %s, %i Gh_nbcar: %i", Gh, Gh_int, Gh_error);
3165 LOG_WARN(
"Communication :Gh# error, check connection.");
3173 LOG_WARN(
"Communication error on Rotator Update, this update aborted, will try again...");
3179 double temperature_value;
3187 LOG_WARN(
"Communication error on Temperature (:GX9A#), this update aborted, will try again...");
3192 double humidity_value;
3200 LOG_WARN(
"Communication error on Humidity (:GX9C#), this update aborted, will try again...");
3206 double barometer_value;
3214 LOG_WARN(
"Communication error on Barometer (:GX9B#), this update aborted, will try again...");
3219 double dewpoint_value;
3227 LOG_WARN(
"Communication error on Dewpoint (:GX9E#), this update aborted, will try again...");
3234 double cputemp_value;
3236 if ( error_return >= 0)
3242 LOGF_DEBUG(
"CPU Temp not responded to, disabling further checks, return values: error_return: %i, cputemp_reponse: %s",
3243 error_return, cputemp_reponse);
3261 for (
int driver_number = 1; driver_number < 3; driver_number++)
3265 snprintf(TMCDriverCMD,
sizeof(TMCDriverCMD),
":GXU%i#", driver_number);
3269 if (i == -4 && TMCDriverTempValue[0] ==
'0' )
3272 snprintf(ResponseText,
sizeof(ResponseText),
"TMC Reporting not detected, Axis %i", driver_number);
3274 LOG_DEBUG(
"TMC Drivers responding as if not there, disabling further checks");
3281 if (TMCDriverTempValue[0] == 0)
3283 OnstepStatTP[8 + driver_number].setText(
"No Condition");
3288 char StepperState[1024] = {0};
3289 bool unknown_value =
false;
3290 int current_position = 0;
3291 while (TMCDriverTempValue[current_position] != 0 && unknown_value ==
false)
3293 if (TMCDriverTempValue[current_position] ==
',')
3299 if (TMCDriverTempValue[current_position] ==
'S' && TMCDriverTempValue[current_position + 1] ==
'T')
3301 strcat(StepperState,
"Standstill,");
3303 else if (TMCDriverTempValue[current_position] ==
'O' && TMCDriverTempValue[current_position + 1] ==
'A')
3305 strcat(StepperState,
"Open Load A Pair,");
3307 else if (TMCDriverTempValue[current_position] ==
'O' && TMCDriverTempValue[current_position + 1] ==
'B')
3309 strcat(StepperState,
"Open Load B Pair,");
3311 else if (TMCDriverTempValue[current_position] ==
'G' && TMCDriverTempValue[current_position + 1] ==
'A')
3313 strcat(StepperState,
"Short to Ground A Pair,");
3315 else if (TMCDriverTempValue[current_position] ==
'G' && TMCDriverTempValue[current_position + 1] ==
'B')
3317 strcat(StepperState,
"Short to Ground B Pair,");
3319 else if (TMCDriverTempValue[current_position] ==
'O' && TMCDriverTempValue[current_position + 1] ==
'T')
3321 strcat(StepperState,
"Over Temp (>150C),");
3323 else if (TMCDriverTempValue[current_position] ==
'P' && TMCDriverTempValue[current_position + 1] ==
'W')
3325 strcat(StepperState,
"Pre-Warning: Over Temp (>120C),");
3327 else if (TMCDriverTempValue[current_position] ==
'G' && TMCDriverTempValue[current_position + 1] ==
'F')
3329 strcat(StepperState,
"General Fault,");
3333 unknown_value =
true;
3336 current_position = current_position + 3;
3341 OnstepStatTP[8 + driver_number].setText(TMCDriverTempValue);
3351 OnstepStatTP[8 + driver_number].setText(
"Unknown read error");
3365 LOG_WARN(
"Communication error on Align Status Update, this update aborted, will try again...");
3373 LOG_WARN(
"Communication error on Focuser Update, this update aborted, will try again...");
3397 if(res < 0 || response[0] ==
'0')
3399 LOGF_ERROR(
"===CMD==> Track On %s", response);
3406 if(res < 0 || response[0] ==
'0')
3408 LOGF_ERROR(
"===CMD==> Track Off %s", response);
3417 years = years % 100;
3420 snprintf(
cmd,
CMD_MAX_LEN,
":SC%02d/%02d/%02d#", months, days, years);
3429 int nbytes_write = 0;
3436 tcflush(
PortFD, TCIFLUSH);
3441 LOGF_ERROR(
"CHECK CONNECTION: Error sending command %s",
cmd);
3451 char response[1] = {0};
3453 int nbytes_write = 0, nbytes_read = 0;
3460 tcflush(
PortFD, TCIFLUSH);
3467 tcflush(
PortFD, TCIFLUSH);
3470 if (nbytes_read < 1)
3472 LOG_WARN(
"Timeout/Error on response. Check connection.");
3476 return (response[0] ==
'0');
3483 int nbytes_write = 0, nbytes_read = 0;
3495 tcflush(
fd, TCIFLUSH);
3497 if (error_type !=
TTY_OK)
3500 term = strchr(data,
'#');
3505 data[nbytes_read] =
'\0';
3509 LOG_DEBUG(
"got RB_MAX_LEN bytes back (which should never happen), last byte set to null and possible overflow");
3521 tcflush(
fd, TCIOFLUSH);
3525 tcflush(
fd, TCIOFLUSH);
3530 if (error_type >= 0)
3532 LOGF_DEBUG(
"flushIO: Information in buffer: Bytes: %u, string: %s", nbytes_read, discard_data);
3536 while (error_type > 0);
3544 int nbytes_write = 0, nbytes_read = 0;
3551 tcflush(
fd, TCIFLUSH);
3557 tcflush(
fd, TCIFLUSH);
3559 term = strchr(data,
'#');
3564 data[nbytes_read] =
'\0';
3568 LOG_DEBUG(
"got RB_MAX_LEN bytes back, last byte set to null and possible overflow");
3574 if (error_type !=
TTY_OK)
3578 tcflush(
fd, TCIOFLUSH);
3582 if (sscanf(data,
"%lf", value) != 1)
3584 LOG_WARN(
"Invalid response, check connection");
3586 tcflush(
fd, TCIOFLUSH);
3599 int nbytes_write = 0, nbytes_read = 0;
3606 tcflush(
fd, TCIFLUSH);
3612 tcflush(
fd, TCIFLUSH);
3614 term = strchr(data,
'#');
3619 data[nbytes_read] =
'\0';
3623 LOG_DEBUG(
"got RB_MAX_LEN bytes back, last byte set to null and possible overflow");
3627 if (error_type !=
TTY_OK)
3631 tcflush(
fd, TCIOFLUSH);
3634 if (sscanf(data,
"%i", value) != 1)
3636 LOG_WARN(
"Invalid response, check connection");
3638 tcflush(
fd, TCIOFLUSH);
3648 int nbytes_write = 0, nbytes_read = 0;
3655 tcflush(
fd, TCIFLUSH);
3661 tcflush(
fd, TCIFLUSH);
3663 term = strchr(data,
'#');
3668 data[nbytes_read] =
'\0';
3672 LOG_DEBUG(
"got RB_MAX_LEN bytes back, last byte set to null and possible overflow");
3678 if (error_type !=
TTY_OK)
3696 double onstep_long = 360 - longitude ;
3697 while (onstep_long < 0)
3699 while (onstep_long > 360)
3704 LOG_ERROR(
"Error setting site longitude coordinates");
3710 LOG_ERROR(
"Error setting site latitude coordinates");
3714 char l[32] = {0}, L[32] = {0};
3715 fs_sexa(l, latitude, 3, 360000);
3716 fs_sexa(L, longitude, 4, 360000);
3718 LOGF_INFO(
"Site location updated to Lat %.32s - Long %.32s", l, L);
3729 snprintf(read_buffer,
sizeof(read_buffer),
":So%02d#",
max);
3738 char read_buffer[32];
3743 snprintf(read_buffer,
sizeof(read_buffer),
":Sg%.03d:%02d:%.02f#", d, m, s);
3751 snprintf(read_buffer,
sizeof(read_buffer),
":Sg%03d:%02d#", d, m);
3755 snprintf(read_buffer,
sizeof(read_buffer),
":Sg%03d:%02d#", d, m);
3763 char read_buffer[32];
3769 snprintf(read_buffer,
sizeof(read_buffer),
":St%+.02d:%02d:%.02f#", d, m, s);
3777 snprintf(read_buffer,
sizeof(read_buffer),
":St%+03d:%02d#", d, m);
3781 snprintf(read_buffer,
sizeof(read_buffer),
":St%+03d:%02d#", d, m);
3819 char read_buffer[32];
3822 snprintf(read_buffer,
sizeof(read_buffer),
":FR%5f#", output);
3833 char read_buffer[32];
3834 snprintf(read_buffer,
sizeof(read_buffer),
":FS%06d#",
int(targetTicks));
3840 LOG_INFO(
"Unable to move focuser, out of range");
3850 char read_buffer[32];
3853 snprintf(read_buffer,
sizeof(read_buffer),
":FR%04d#", output);
3863 strncpy(
cmd,
":FQ#",
sizeof(
cmd));
3880 if (error_or_fail > 1)
3892 if (error_or_fail > 0 )
3894 if (valueStatus[0] ==
'S')
3901 else if (valueStatus[0] ==
'M')
3910 LOG_WARN(
"Communication :FT# error, check connection.");
3921 LOG_WARN(
"Communication :FT# error, check connection.");
3938 LOGF_DEBUG(
"focus_max: %s, %i, fm_nbchar: %i", focus_max, focus_max_int, fm_error);
3942 LOG_WARN(
"Communication :FM# error, check connection.");
3943 LOGF_WARN(
"focus_max: %s, %u, fm_error: %i", focus_max, focus_max[0], fm_error);
3957 LOGF_DEBUG(
"focus_min: %s, %i fi_nbchar: %i", focus_min, focus_min_int, fi_error);
3961 LOG_WARN(
"Communication :FI# error, check connection.");
3968 double focus_T_double ;
3974 LOGF_DEBUG(
"focus T°: %s, focus_T_double %i ft_nbcar: %i", focus_T, focus_T_double, ft_error);
3978 LOG_WARN(
"Communication :Ft# error, check connection.");
3979 LOGF_DEBUG(
"focus T°: %s, focus_T_double %i ft_nbcar: %i", focus_T, focus_T_double, ft_error);
3992 LOGF_DEBUG(
"focus Differential T°: %s, %i fi_nbchar: %i", focus_TD, focus_TD_int, fe_error);
3996 LOG_WARN(
"Communication :Fe# error, check connection.");
4003 int focus_Coefficient_int ;
4009 LOGF_DEBUG(
"TFC Coefficient: %s, %i fC_nbchar: %i", focus_Coeficient, focus_Coefficient_int, fC_error);
4013 LOG_WARN(
"Communication :FC# error, check connection.");
4020 int focus_Deadband_int ;
4026 LOGF_DEBUG(
"TFC Deadband: %s, %i fD_nbchar: %i", focus_Deadband, focus_Deadband_int, fD_error);
4030 LOG_WARN(
"Communication :FD# error, check connection.");
4040 if (strcmp(response,
"0"))
4046 else if (strcmp(response,
"1"))
4053 LOGF_DEBUG(
"TFC Enable: fc_nbchar:%d Fc_response: %s", res, response);
4058 LOG_WARN(
"Communication :Fc# error, check connection.");
4072 if (error_return >= 0)
4074 if ( strcmp(value,
"0") )
4076 LOG_INFO(
"Focuser 2 called, but not present, disabling polling");
4088 LOGF_INFO(
"Focuser 2 called, but returned error %i on read, disabling further polling", error_return);
4098 if (error_or_fail > 0 && value[0] >
'0' && value[0] <
'9')
4100 int temp_value = (
unsigned int)(value[0]) -
'0';
4103 if (temp_value == 0)
4107 else if (temp_value > 9 || temp_value < 0)
4111 LOGF_WARN(
"Active focuser returned out of range: %d, should be 0-9", temp_value);
4124 LOGF_DEBUG(
":Fa# returned outside values: %c, %u", value[0], value[0]);
4188 double double_value;
4192 if (error_or_fail == 1 && value[0] ==
'0')
4194 LOG_INFO(
"Detected Response that Rotator is not present, disabling further checks");
4198 if (error_or_fail < 1)
4200 LOG_WARN(
"Error talking to rotator, might be timeout (especially on network)");
4211 double min_rotator, max_rotator;
4214 bool changed_minmax =
false;
4219 if (error_or_fail > 1)
4221 changed_minmax =
true;
4226 if (error_or_fail > 1)
4228 changed_minmax =
true;
4239 if (error_or_fail > 1)
4241 if (value[0] ==
'S')
4247 else if (value[0] ==
'M')
4262 if (error_or_fail > 1)
4279 snprintf(
cmd,
sizeof(
cmd),
":rS%.03d:%02d:%02d#", d, m, s);
4303 LOG_INFO(
"Moving Rotator to Home");
4314 LOG_INFO(
"Aborting Rotation, de-rotation in same state");
4323 snprintf(
cmd,
sizeof(
cmd),
":rb%d#", steps);
4368 LOG_INFO(
"Sending Command to Start PEC Playback");
4369 strncpy(
cmd,
":$QZ+#",
sizeof(
cmd));
4375 LOG_DEBUG(
"Command to Playback PEC called when Controller does not support PEC");
4382 LOG_INFO(
"Command to Start Playback PEC called when Controller does not support PEC due to being Alt-Az, PEC Ignored going forward");
4396 LOG_INFO(
"Sending Command to Stop PEC Playback");
4397 strncpy(
cmd,
":$QZ-#",
sizeof(
cmd));
4403 LOG_DEBUG(
"Command to Stop Playing PEC called when Controller does not support PEC");
4416 LOG_INFO(
"Sending Command to Start PEC record");
4423 LOG_DEBUG(
"Command to Record PEC called when Controller does not support PEC");
4436 LOG_INFO(
"Sending Command to Clear PEC record");
4443 LOG_DEBUG(
"Command to clear PEC called when Controller does not support PEC");
4457 LOG_INFO(
"Sending Command to Save PEC to EEPROM");
4464 LOG_DEBUG(
"Command to save PEC called when Controller does not support PEC");
4479 LOG_INFO(
"Command to give PEC called when Controller does not support PEC due to being Alt-Az Disabled");
4494 if (error_or_fail > 1)
4497 if (value[0] ==
'I')
4503 LOG_INFO(
"Controller reports PEC Ignored and not supported");
4504 LOG_INFO(
"No Further PEC Commands will be processed, unless status changed");
4506 else if (value[0] ==
'R')
4512 else if (value[0] ==
'r')
4518 else if (value[0] ==
'P')
4524 else if (value[0] ==
'p')
4535 if (value[1] ==
'.')
4553 LOG_DEBUG(
"Timeout or other error on :$QZ?#");
4569 LOG_WARN(
"PEC Reading NOT Implemented");
4574 LOG_DEBUG(
"Command to Read PEC called when Controller does not support PEC");
4585 LOG_WARN(
"PEC Writing NOT Implemented");
4590 LOG_DEBUG(
"Command to Read PEC called when Controller does not support PEC");
4602 LOG_INFO(
"Sending Command to Start Alignment");
4604 OSNAlignTP[1].setText(
"GOTO a star, center it");
4605 OSNAlignTP[2].setText(
"GOTO a star, Solve and Sync");
4606 OSNAlignTP[3].setText(
"Press 'Issue Align' if not solving");
4611 if(error_or_fail != 4 || read_buffer[0] <
'0' || read_buffer[0] >
'9' || read_buffer[1] <
'0' || read_buffer[1] >
':'
4612 || read_buffer[2] <
'0' || read_buffer[2] >
'9')
4614 LOGF_INFO(
"Getting Alignment Status: response Error, response = %s>", read_buffer);
4619 int max_stars = read_buffer[0] -
'0';
4620 if (stars > max_stars)
4622 LOG_INFO(
"Tried to start Align with too many stars.");
4623 LOGF_INFO(
"Starting Align with %d stars", max_stars);
4626 snprintf(
cmd,
sizeof(
cmd),
":A%.1d#", stars);
4627 LOGF_INFO(
"Started Align with %s, max possible stars: %d",
cmd, max_stars);
4642 LOG_INFO(
"Sending Command to Record Star");
4643 strncpy(
cmd,
":A+#",
sizeof(
cmd));
4661 char stars[5] = {0};
4662 int max_stars, current_star, align_stars;
4666 if(error_or_fail != 4 || read_buffer[0] <
'0' || read_buffer[0] >
'9' || read_buffer[1] <
'0' || read_buffer[1] >
':'
4667 || read_buffer[2] <
'0' || read_buffer[2] >
'9')
4669 LOGF_INFO(
"Getting Alignment Status: response Error, response = %s>", read_buffer);
4672 max_stars = read_buffer[0] -
'0';
4673 current_star = read_buffer[1] -
'0';
4674 align_stars = read_buffer[2] -
'0';
4675 snprintf(stars,
sizeof(stars),
"%d", max_stars);
4677 snprintf(stars,
sizeof(stars),
"%d", current_star);
4678 if (read_buffer[1] >
'9')
4686 snprintf(stars,
sizeof(stars),
"%d", align_stars);
4688 LOGF_DEBUG(
"Align: max_stars: %i current star: %u, align_stars %u", max_stars, current_star, align_stars);
4690 if (current_star <= align_stars)
4692 snprintf(msg,
sizeof(msg),
"%s Alignment: Star %d/%d", read_buffer, current_star, align_stars );
4695 if (current_star > align_stars && max_stars > 1)
4697 LOGF_DEBUG(
"Align: current star: %u, align_stars %u",
int(current_star),
int(align_stars));
4698 snprintf(msg,
sizeof(msg),
"Align: Completed");
4736 double altCor, azmCor;
4738 if (error_or_fail < 2)
4740 LOGF_INFO(
"Polar Align Error Status response Error, response = %s>", read_buffer);
4744 if (error_or_fail < 2)
4746 LOGF_INFO(
"Polar Align Error Status response Error, response = %s>", read_buffer);
4749 fs_sexa(sexabuf, (
double)azmCor / 3600, 4, 3600);
4750 snprintf(polar_error,
sizeof(polar_error),
"%f'' /%s", azmCor, sexabuf);
4752 fs_sexa(sexabuf, (
double)altCor / 3600, 4, 3600);
4753 snprintf(polar_error,
sizeof(polar_error),
"%f'' /%s", altCor, sexabuf);
4767 LOG_INFO(
"Alignment Done - May still be calculating");
4771 OSNAlignTP[3].setText(
"Write Align to NVRAM/Flash ");
4784 LOG_INFO(
"Sending Command to Finish Alignment and write");
4785 strncpy(
cmd,
":AW#",
sizeof(
cmd));
4787 if(res > 0 && response[0] ==
'1')
4789 LOG_INFO(
"Align Write Successful");
4793 OSNAlignTP[2].setText(
"And Written to EEPROM");
4800 LOGF_ERROR(
"Align Write Failed: error=%s", response);
4808#ifdef ONSTEP_NOTDONE
4887 command[5] = char(output);
4891 if (error_or_fail > 0)
4914 snprintf(read_buffer,
sizeof(read_buffer),
":RA%04f#", raRate);
4915 LOGF_INFO(
"Setting: Custom RA Rate to %04f", raRate);
4920 snprintf(read_buffer,
sizeof(read_buffer),
":RE%04f#", deRate);
4921 LOGF_INFO(
"Setting: Custom DE Rate to %04f", deRate);
4926 LOG_INFO(
"Custom RA and DE Rates successfully set");
4945 LOG_ERROR(
"OnStep slew/syncError called with value 0-goto possible, this is normal operation");
4948 LOG_ERROR(
"OnStep slew/syncError: Below the horizon limit");
4951 LOG_ERROR(
"OnStep slew/syncError: Above Overhead limit");
4954 LOG_ERROR(
"OnStep slew/syncError: Controller in standby, Usual issue fix: Turn tracking on");
4957 LOG_ERROR(
"OnStep slew/syncError: Mount is Parked");
4960 LOG_ERROR(
"OnStep slew/syncError: Goto in progress");
4963 LOG_ERROR(
"OnStep slew/syncError: Outside limits: Max/Min Dec, Under Pole Limit, Meridian Limit, Sync attempted to wrong pier side");
4966 LOG_ERROR(
"OnStep slew/syncError: Hardware Fault");
4969 LOG_ERROR(
"OnStep slew/syncError: Already in motion");
4972 LOG_ERROR(
"OnStep slew/syncError: Unspecified Error");
4975 LOG_ERROR(
"OnStep slew/syncError: Not in range of values that should be returned! INVALID, Something went wrong!");
4994 LOG_ERROR(
"Error setting RA/DEC. Unable to Sync.");
5001 if (error_or_fail > 1)
5003 if (strcmp(read_buffer,
"N/A"))
5005 if (read_buffer[0] ==
'E' && read_buffer[1] >=
'0'
5006 && read_buffer[1] <=
'9')
5008 int error_code = read_buffer[1] -
'0';
5009 LOGF_DEBUG(
"Sync failed with response: %s, Error code: %i", read_buffer, error_code);
5018 LOG_ERROR(
"Unexpected return on sync call!");
5019 LOG_ERROR(
"Check system & Align if doing align to see if it went through!");
5026 LOG_ERROR(
"Communication error on sync! Re-issue sync!");
5037 LOG_INFO(
"OnStep: Synchronization successful.");
5061 if (error_or_fail == -4 && configured[0] ==
'0')
5064 LOG_INFO(
"Outputs not detected, disabling further checks");
5070 if(configured[i - 1] ==
'1')
5072 snprintf(getoutp,
sizeof(getoutp),
":GXY%d#", i);
5074 if (error_or_fail > 0)
5076 for(k = 0; k < strlen(port_name); k++)
5078 if(port_name[k] ==
',') port_name[k] =
'_';
5079 p_name[k] = port_name[k];
5086 LOGF_ERROR(
"Communication error on %s, ignoring, disconnect and reconnect to clear", getoutp);
5107 memset(<m, 0,
sizeof(ltm));
5108 memset(&utm, 0,
sizeof(utm));
5113 char utcStr[8] = {0};
5114 snprintf(utcStr, 8,
"%.2f", offset);
5119 LOG_WARN(
"Could not obtain UTC offset from mount!");
5125 LOG_WARN(
"Could not obtain local time from mount!");
5131 LOG_WARN(
"Could not obtain local date from mount!");
5137 snprintf(datetime,
MAXINDINAME,
"%sT%s", cdate, ctime);
5140 if (strptime(datetime,
"%FT%T", <m) ==
nullptr)
5142 LOGF_WARN(
"Could not process mount date and time: %s", datetime);
5148 time_epoch = mktime(<m);
5151 time_epoch -=
static_cast<int>(offset * 3600.0);
5154 localtime_r(&time_epoch, &utm);
5157 strftime(cdate,
MAXINDINAME,
"%Y-%m-%dT%H:%M:%S", &utm);
5172 int lat_dd = 0, lat_mm = 0, long_dd = 0, long_mm = 0;
5173 double lat_ssf = 0.0, long_ssf = 0.0;
5194 LOG_WARN(
"Failed to get site latitude from device.");
5201 snprintf(lat_sexagesimal,
MAXINDIFORMAT,
"%02d:%02d:%02.1lf", lat_dd, lat_mm, lat_ssf);
5210 snprintf(lat_sexagesimal,
MAXINDIFORMAT,
"%02d:%02d:%02.1lf", lat_dd, lat_mm, lat_ssf);
5219 LOG_WARN(
"Failed to get site latitude from device.");
5225 snprintf(lat_sexagesimal,
MAXINDIFORMAT,
"%02d:%02d:%02.1lf", lat_dd, lat_mm, lat_ssf);
5239 LOG_WARN(
"Failed to get site longitude from device.");
5246 snprintf(lng_sexagesimal,
MAXINDIFORMAT,
"%02d:%02d:%02.1lf", long_dd, long_mm, long_ssf);
5255 snprintf(lng_sexagesimal,
MAXINDIFORMAT,
"%02d:%02d:%02.1lf", long_dd, long_mm, long_ssf);
5264 LOG_WARN(
"Failed to get site longitude from device.");
5270 snprintf(lng_sexagesimal,
MAXINDIFORMAT,
"%02d:%02d:%02.1lf", long_dd, long_mm, long_ssf);
5277 LOGF_INFO(
"Mount has Latitude %s (%g) Longitude %s (%g) (Longitude sign in carthography format)",
5293 const struct timespec timeout = {0, 100000000L};
5297 char RAStr[64] = {0}, DecStr[64] = {0};
5322 Telescope::AbortSP.apply();
5344 nanosleep(&timeout,
nullptr);
5362 LOGF_ERROR(
"Error Slewing to JNow RA %s - DEC %s", RAStr, DecStr);
5372 LOGF_INFO(
"Slewing to RA: %s - DEC: %s", RAStr, DecStr);
5381 LOG_DEBUG(
"OnStep SyncParkStatus called");
5414#ifdef DEBUG_TRACKSTATE
5424 LOG_DEBUG(
"TrackState: SCOPE_TRACKING");
5441 int utc_hour, utc_min;
5443 utc_hour = int(offset) * -1;
5444 utc_min = abs((offset -
int(offset)) * 60);
5445 if (utc_min > 30) utc_min = 45;
5446 snprintf(temp_string,
sizeof(temp_string),
":SG%03d:%02d#", utc_hour, utc_min);
The Interface class is the base class for all INDI connection plugins.
virtual std::string name()=0
INDI::PropertyText getText(const char *name) const
virtual bool saveConfig(bool silent=false, const char *property=nullptr)
Save the current properties in a configuration file.
void setCurrentPollingPeriod(uint32_t msec)
setCurrentPollingPeriod Change the current polling period to call TimerHit() function in the driver.
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.
void defineProperty(INumberVectorProperty *property)
uint32_t getCurrentPollingPeriod() const
getCurrentPollingPeriod Return the current polling period.
bool isSimulation() const
void syncDriverInfo()
syncDriverInfo sends the current driver information to the client.
void addAuxControls()
Add Debug, Simulation, and Configuration options to the driver.
uint32_t getDriverInterface() const
Connection::Interface * getActiveConnection()
INDI::PropertyNumber FocusRelPosNP
bool updateProperties()
updateProperties Define or Delete Rotator properties based on the connection status of the base devic...
void SetCapability(uint32_t cap)
FI::SetCapability sets the focuser capabilities. All capabilities must be initialized.
void initProperties(const char *groupName)
Initialize focuser properties. It is recommended to call this function within initProperties() of you...
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process focus number properties.
bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process focus switch properties.
INDI::PropertyNumber FocusAbsPosNP
void setState(IPState state)
WidgetView< T > * findWidgetByName(const char *name) const
void apply(const char *format,...) const ATTRIBUTE_FORMAT_PRINTF(2
bool isNameMatch(const char *otherName) const
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, double timeout, IPState state)
bool update(const ISState states[], const char *const names[], int n)
int findOnSwitchIndex() const
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, ISRule rule, double timeout, IPState state)
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, double timeout, IPState state)
bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process Rotator switch properties.
void initProperties(const char *groupName)
Initialize Rotator properties. It is recommended to call this function within initProperties() of you...
bool updateProperties()
updateProperties Define or Delete Rotator properties based on the connection status of the base devic...
void SetCapability(uint32_t cap)
SetRotatorCapability sets the Rotator capabilities. All capabilities must be initialized.
INDI::PropertyNumber RotatorBacklashNP
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process Rotator number properties.
INDI::PropertyNumber GotoRotatorNP
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.
TelescopeParkData parkDataType
bool isParked()
isParked is mount currently parked?
@ TELESCOPE_HAS_TRACK_RATE
@ TELESCOPE_HAS_PIER_SIDE
@ TELESCOPE_CAN_CONTROL_TRACK
uint32_t GetTelescopeCapability() const
GetTelescopeCapability returns the capability of the Telescope.
void NewRaDec(double ra, double dec)
The child class calls this function when it has updates.
void setPierSide(TelescopePierSide side)
bool InitPark()
InitPark Loads parking data (stored in ~/.indi/ParkData.xml) that contains parking status and parking...
void SetAxis2Park(double steps)
SetDEPark Set current DEC/ALT parking position. The data park file (stored in ~/.indi/ParkData....
void SetParkDataType(TelescopeParkData type)
setParkDataType Sets the type of parking data stored in the park data file and presented to the user.
void SetAxis2ParkDefault(double steps)
SetDEParkDefault Set default DEC/ALT parking position.
Provides interface to implement weather reporting and safety monitoring functionality.
void addParameter(std::string name, std::string label, double numMinOk, double numMaxOk, double percWarning, bool flipWarning=false)
Add a physical weather measurable parameter to the weather driver.
bool setCriticalParameter(std::string name)
setCriticalParameter Set parameter that is considered critical to the operation of the observatory....
bool syncCriticalParameters()
Synchronize and update the state of all critical parameters.
void setParameterValue(std::string name, double value)
setParameterValue Update weather parameter value
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process weather number properties.
virtual bool saveConfigItems(FILE *fp)
saveConfigItems Save parameters ranges in the config file.
INDI::PropertyNumber ParametersNP
void initProperties(const char *statusGroup, const char *paramsGroup)
Initialize focuser properties. It is recommended to call this function within initProperties() of you...
bool updateProperties()
updateProperties Define or Delete Rotator properties based on the connection status of the base devic...
INDI::PropertyLight critialParametersLP
virtual bool initProperties() override
Called to initialize basic properties required all the time.
@ LX200_HAS_PULSE_GUIDING
@ LX200_HAS_PRECISE_TRACKING_FREQ
@ LX200_HAS_ALIGNMENT_TYPE
@ LX200_HAS_TRACKING_FREQ
virtual bool getLocalDate(char *dateString)
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Start or Stop the telescope motion in the direction dir.
virtual bool getUTFOffset(double *offset)
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool getLocalTime(char *timeString)
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
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 checkConnection()
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual void getBasicData()
void setLX200Capability(uint32_t cap)
bool AbortRotator() override
AbortRotator Abort all motion.
char OldOSStat[RB_MAX_LEN]
IPState ClearPECBuffer(int axis)
virtual bool Goto(double ra, double dec) override
Move the scope to the supplied RA and DEC coordinates.
INDI::PropertyNumber OSSetTemperatureNP
IPState PECStatus(int axis)
virtual void Init_Outputs()
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Start or Stop the telescope motion in the direction dir.
int getCommandSingleCharResponse(int fd, char *data, const char *cmd)
IPState MoveFocuser(FocusDirection dir, int speed, uint16_t duration) override
MoveFocuser the focuser in a particular direction with a specific speed for a finite duration.
int getCommandDoubleResponse(int fd, double *value, char *data, const char *cmd)
INDI::PropertySwitch TFCCompensationSP
virtual IPState ExecuteHomeAction(TelescopeHomeAction action) override
Execute a homing action.
INDI::PropertyNumber OutputPorts_NP
int getCommandIntResponse(int fd, int *value, char *data, const char *cmd)
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
OnStepVersion OnStepMountVersion
virtual bool setLocalDate(uint8_t days, uint8_t months, uint16_t years) override
INDI::PropertyNumber MaxSlewRateNP
IPState OSDisableOutput(int output)
INDI::PropertySwitch HomePauseSP
INDI::PropertyNumber GuideRateNP
virtual bool setUTCOffset(double offset) override
INDI::PropertyNumber TFCDeadbandNP
INDI::PropertyNumber ElevationLimitNP
INDI::PropertyText VersionTP
INDI::PropertySwitch OSRotatorDerotateSP
IPState OSEnableOutput(int output)
INDI::PropertyNumber ObjectNoNP
INDI::PropertySwitch OSPECStatusSP
IPState AlignStartGeometric(int stars)
IPState StartPECPlayback(int axis)
bool SetRotatorBacklash(int32_t steps) override
SetRotatorBacklash Set the Rotatorer backlash compensation value.
uint32_t m_RememberPollingPeriod
virtual bool UnPark() override
Unpark the telescope if already parked.
IPState StopPECPlayback(int axis)
IPState SavePECBuffer(int axis)
INDI::PropertySwitch OSNAlignWriteSP
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
INDI::PropertyNumber minutesPastMeridianNP
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
virtual bool Sync(double ra, double dec) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
INDI::PropertyText OnstepStatTP
virtual void getBasicData() override
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
bool sendOnStepCommand(const char *cmd)
INDI::PropertySwitch OSFocus2RateSP
INDI::PropertySwitch OSNAlignSP
virtual int setSiteLongitude(int fd, double Long)
long int OSTimeoutMicroSeconds
IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
IPState AlignAddStar()
AlignStartGeometric starts the OnStep Multistar align process.
INDI::PropertyNumber TFCCoefficientNP
virtual bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
INDI::PropertySwitch OSFocus1InitializeSP
virtual bool initProperties() override
Called to initialize basic properties required all the time.
INDI::PropertySwitch TrackAxisSP
bool sendOnStepCommandBlind(const char *cmd)
IPState StartPECRecord(int axis)
bool OSSupports_bitfield_Gu
virtual int setSiteLatitude(int fd, double Long)
long int OSTimeoutSeconds
virtual void SyncParkStatus(bool isparked) override
SyncParkStatus Update the state and switches for parking.
virtual bool sendScopeLocation() override
INDI::PropertyNumber BacklashNP
int setMinElevationLimit(int fd, int min)
IPState ReadPECBuffer(int axis)
IPState WritePECBuffer(int axis)
INDI::PropertyText OSNAlignErrTP
char OldOSPier[RB_MAX_LEN]
IPState HomeRotator() override
HomeRotator Go to home position.
INDI::PropertyNumber OSSetHumidityNP
virtual bool Park() override
Park the telescope to its home position.
virtual void slewError(int slewCode) override
INDI::PropertyNumber OSSetAltitudeNP
bool SetRotatorBacklashEnabled(bool enabled) override
SetRotatorBacklashEnabled Enables or disables the Rotator backlash compensation.
INDI::PropertyText ObjectInfoTP
INDI::PropertySwitch ReticSP
int getCommandSingleCharErrorOrLongResponse(int fd, char *data, const char *cmd)
virtual bool UpdateAlignErr()
INDI::PropertySwitch OSPECRecordSP
virtual bool SetTrackRate(double raRate, double deRate) override
SetTrackRate Set custom tracking rates.
INDI::PropertyNumber FocusTemperatureNP
INDI::PropertyNumber OSFocus2TargNP
INDI::PropertySwitch OSPECReadSP
INDI::PropertySwitch OSFocus2MotionSP
virtual bool sendScopeTime() override
bool OSGetOutputState(int output)
virtual bool UpdateAlignStatus()
INDI::PropertySwitch OSFocusSelectSP
IPState MoveRotator(double angle) override
MoveRotator Go to specific angle.
void PrintTrackState()
PrintTrackState will print to the debug log the status of TrackState if DEBUG_TRACKSTATE is defined o...
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
INDI::PropertyText OSNAlignTP
virtual const char * getDefaultName() override
INDI::PropertySwitch OSPECIndexSP
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...
INDI::PropertySwitch FrequencyAdjustSP
virtual void SetParked(bool isparked) override
SetParked Change the mount parking status. The data park file (stored in ~/.indi/ParkData....
INDI::PropertySwitch OSNAlignPolarRealignSP
INDI::PropertySwitch OSNAlignStarsSP
INDI::PropertySwitch PreferredPierSideSP
virtual bool Handshake() override
perform handshake with device to check communication
INDI::PropertyNumber OSSetPressureNP
INDI::PropertySwitch TrackCompSP
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool ReadScopeStatus() override
Read telescope status.
bool AbortFocuser() override
AbortFocuser all focus motion.
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
INDI::PropertySwitch AutoFlipSP
Provides interface to implement Rotator functionality.
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.
const char * FOCUS_TAB
FOCUS_TAB Where all the properties for focuser are located.
INDI::PropertySwitch ParkSP
INDI::PropertySwitch AbortSP
INDI::PropertySwitch MovementNSSP
INDI::PropertyNumber EqNP
INDI::PropertySwitch TrackStateSP
INDI::PropertySwitch PECStateSP
INDI::PropertySwitch SlewRateSP
INDI::PropertyText TimeTP
INDI::PropertySwitch MountTypeSP
INDI::PropertySwitch MovementWESP
INDI::PropertySwitch ParkOptionSP
INDI::PropertySwitch CoordSP
INDI::PropertyNumber LocationNP
INDI::PropertyNumber TargetNP
void getSexComponentsIID(double value, int *d, int *m, double *s)
int f_scansexa(const char *str0, double *dp)
convert sexagesimal string str AxBxC to double. x can be anything non-numeric. Any missing A,...
void getSexComponents(double value, int *d, int *m, int *s)
int tty_write_string(int fd, const char *buf, int *nbytes_written)
Writes a null terminated string to fd.
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[].
int tty_read_expanded(int fd, char *buf, int nbytes, long timeout_seconds, long timeout_microseconds, int *nbytes_read)
read buffer from terminal with a delimiter
int tty_nread_section_expanded(int fd, char *buf, int nsize, char stop_char, long timeout_seconds, long timeout_microseconds, int *nbytes_read)
read buffer from terminal with a delimiter
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 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.
int IUGetConfigNumber(const char *dev, const char *property, const char *member, double *value)
IUGetConfigNumber Opens configuration file and reads single number property.
void IDMessage(const char *dev, const char *fmt,...)
#define LOGF_INFO(fmt,...)
#define LOGF_WARN(fmt,...)
#define LOGF_DEBUG(fmt,...)
#define LOG_ERROR(txt)
Shorter logging macros. In order to use these macros, the function (or method) "getDeviceName()" must...
#define LOGF_ERROR(fmt,...)
#define DEBUGF(priority, msg,...)
std::mutex lx200CommsLock
@ ERR_GOTO_ERR_ABOVE_OVERHEAD
@ ERR_GOTO_ERR_OUTSIDE_LIMITS
@ ERR_GOTO_ERR_BELOW_HORIZON
@ ERR_GOTO_ERR_UNSPECIFIED
@ ERR_GOTO_ERR_HARDWARE_FAULT
std::mutex lx200CommsLock
int getSiteLongitude(int fd, int *ddd, int *mm, double *ssf)
int getSiteLatitudeAlt(int fd, int *dd, int *mm, double *ssf, const char *cmd)
int setMaxElevationLimit(int fd, int max)
int setObjectRA(int fd, double ra, bool addSpace)
int getLX200EquatorialFormat()
int setStandardProcedure(int fd, const char *data)
int setObjectDEC(int fd, double dec, bool addSpace)
int getSiteLongitudeAlt(int fd, int *ddd, int *mm, double *ssf, const char *cmd)
int getSiteLatitude(int fd, int *dd, int *mm, double *ssf)
int selectCatalogObject(int fd, int catalog, int NNNN)
#define getVersionDate(fd, x)
#define increaseReticleBrightness(fd)
#define getObjectInfo(fd, x)
#define getVersionTime(fd, x)
#define getLX200DEC(fd, x)
#define getVersionNumber(fd, x)
#define getLX200RA(fd, x)
#define decreaseReticleBrightness(fd)
#define getProductName(fd, x)