From 80aef2510d67ecb703fc230e4f1919644dc696e9 Mon Sep 17 00:00:00 2001 From: Christian Kardach Date: Sat, 12 Jun 2021 19:35:24 +0200 Subject: [PATCH] Meade Command Wiki Parser (#116) * Updated meade header parser for wiki * Added Example as new sub header, swapped place on command and info --- .gitignore | 1 + scripts/MeadeCommandParser.py | 320 +++++++--- src/MeadeCommandProcessor.cpp | 1036 ++++++++++++++++++++++----------- 3 files changed, 957 insertions(+), 400 deletions(-) diff --git a/.gitignore b/.gitignore index c5199d6f..b980b4e2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ CMakeLists.txt CMakeListsPrivate.txt Configuration_local* +MeadeToWikiOutput.txt diff --git a/scripts/MeadeCommandParser.py b/scripts/MeadeCommandParser.py index df4a49d1..58c66ca7 100644 --- a/scripts/MeadeCommandParser.py +++ b/scripts/MeadeCommandParser.py @@ -1,13 +1,22 @@ -# Helper script for parsingt the header file of MEADE -# Can be used to populate WIKI +""" +Helper script for parsingt the header file of MEADE + +USAGE: + - Ensure you have a Python interperter working for VSCode + - Execute this file by pressing the little green "Play" button in the top-right corner + - Output will be written to "./scripts/MeadeToWikiOutput.txt" directory + - Copy entire content of the file and paste it on the wiki page +""" import os +import re MEADE_HPP = "..\\src\\MeadeCommandProcessor.cpp" MODULE_PATH = os.path.dirname(os.path.realpath(__file__)) START_LINE = 0 END_LINE = 0 + class Family: def __init__(self): self.name = None @@ -16,15 +25,104 @@ def __init__(self): class Command: def __init__(self): - self.command = None - self.short = str() - self.long = str() - self.returns = str() + self.__command = None + self.__description = str() + self.__information = list() + self.__returns = list() + self.__parameters = list() + self.__remarks = list() + self.__example = list() + + def set_data(self, attribute, data): + setattr(self, attribute, data) + + @property + def command(self): + return self.__command + + @command.setter + def command(self, val): + self.__command = val + + @property + def description(self): + return self.__description + + @description.setter + def description(self, val): + self.__description = val + + @property + def information(self): + return self.__information + + @information.setter + def information(self, val): + if val not in self.__information: + self.__information.append(val) + + @property + def returns(self): + return self.__returns + + @returns.setter + def returns(self, val): + if val not in self.__returns: + self.__returns.append(val) + + @property + def parameters(self): + return self.__parameters + + @parameters.setter + def parameters(self, val): + if val not in self.__parameters: + self.__parameters.append(val) + + @property + def remarks(self): + return self.__remarks + + @remarks.setter + def remarks(self, val): + if val not in self.__remarks: + self.__remarks.append(val) + + @property + def example(self): + return self.__example + + @example.setter + def example(self, val): + if val not in self.__example: + self.__example.append(val) + + +command_sepparators = ["Description::", + "Information:", + "Returns:", + "Parameters:", + "Remarks:", + "Remarks:", + "Example:", + "//"] + + +def remove_line_prefix(line): + striped_line = line.replace("//", "").lstrip() + striped_line = striped_line.replace("\"", "`") + return striped_line -def removeLinePrefix(line): - return line.replace("// ", "").strip() +def check_command_sepparator(line): + striped_line = line.replace("//", "").lstrip() + if line in command_sepparators: + return True + elif line.startswith("//") and striped_line in command_sepparators: + return True + else: + return False -#Meade hpp File +# Meade hpp File with open(os.path.join(MODULE_PATH, MEADE_HPP)) as f: content = f.readlines() content = [x.strip() for x in content] @@ -40,75 +138,165 @@ def removeLinePrefix(line): raise Exception("Could not locate start and stop of comment block.") START_LINE = startStop[0] -END_LINE = startStop[1] +END_LINE = startStop[1] print(("Start and end of block: {0}, {1} ".format(START_LINE, END_LINE))) -familyDividers = [] +family_dividers = [] for i in range(START_LINE, END_LINE): for div in ["//------------------------------------------------------------------", "// --"]: if div in content[i]: - familyDividers.append(i) + family_dividers.append(i) -print(("Found {0} family groups ".format(len(familyDividers)))) +print(("Found {0} family groups ".format(len(family_dividers)))) -allCommands = [] -for i in range(len(familyDividers) - 1): - start = familyDividers[i] - end = familyDividers[i + 1] +all_commands = [] +for i in range(len(family_dividers) - 1): +#for i in range(0, 6): + start = family_dividers[i] + 1 + end = family_dividers[i + 1] + + new_family = Family() + new_family.name = remove_line_prefix(content[start]) + + # Find command groups + sub_offsets = list() + sub_offsets.append(start+2) + for j in range(start+2, end): + if content[j] == "//": + sub_offsets.append(j) - newFamily = Family() - if "//------------------------------------------------------------------" in content[start]: - newFamily.name = removeLinePrefix(content[start + 1]) - elif "// --" in content[start]: - nameCleanup = content[start].replace("// -- ", "") - nameCleanup = nameCleanup.replace(" --", "") - newFamily.name = nameCleanup - - for y in range(start + 1, end - 1): - newCommand = Command() - - # Command - if content[y].startswith("// :"): - newCommand.command = removeLinePrefix(content[y]) - - # Short Description - newCommand.short = removeLinePrefix(content[y + 1]) - y+=2 - - k = y - while not content[k].startswith("// Returns:"): - newCommand.long += removeLinePrefix(content[k]) - k += 1 - y = k + for k in range(0, len(sub_offsets)-1): + command = Command() + sub_start = sub_offsets[k] + sub_end = sub_offsets[k+1] + for l in range(sub_start, sub_end): + if content[l] == "//": + continue + + # Command + if content[l].startswith("// :"): + command.command = remove_line_prefix(content[l]) + + # Description + if content[l].startswith("//") and "Description:" in content[l]: + command.description = remove_line_prefix(content[l+1]) + + # Information + if content[l].startswith("//") and "Information:" in content[l]: + m = l+1 + while not check_command_sepparator(content[m]): + command.information = remove_line_prefix(content[m]) + m += 1 + l = m + + # Returns + if content[l].startswith("//") and "Returns:" in content[l]: + m = l+1 + while not check_command_sepparator(content[m]): + command.returns = remove_line_prefix(content[m]) + m += 1 + l = m + + # Remarks + if content[l].startswith("//") and "Remarks:" in content[l]: + m = l+1 + while not check_command_sepparator(content[m]): + command.remarks = remove_line_prefix(content[m]) + m += 1 + l = m + + # Parameters + if content[l].startswith("//") and "Parameters:" in content[l]: + m = l+1 + while not check_command_sepparator(content[m]): + command.parameters = remove_line_prefix(content[m]) + m += 1 + l = m + + # Example + if content[l].startswith("//") and "Example:" in content[l]: + m = l+1 + while not check_command_sepparator(content[m]): + command.example = remove_line_prefix(content[m]) + m += 1 + l = m - if content[y].startswith("// Returns:"): - newCommand.returns += content[y].replace("// Returns: ", "") - k = y+1 - while content[k] != "//": - newCommand.returns += content[k].replace("// ", " ").strip() - k += 1 - y = k - - if newCommand.command: - newFamily.commands.append(newCommand) + new_family.commands.append(command) + all_commands.append(new_family) + +def output_wiki(): + """ + Writes content to a MeadeToWikiOutput.txt file + """ - allCommands.append(newFamily) + f = open("./scripts/MeadeToWikiOutput.txt", "w") + + for fam in all_commands: + f.write(f"## {fam.name}\n") + f.write("
\n\n") + + for cmd in fam.commands: + f.write(f"### {cmd.description}\n") + + if cmd.information: + #f.write("**Information:**\n") + for line in cmd.information: + f.write(f"{line}") + f.write("\n\n") + + f.write(f"**Command:**\n") + f.write(f"`{cmd.command}`\n") + f.write("\n") + + f.write("**Returns:**\n") + for line in cmd.returns: + f.write(f"- {line}\n") + f.write("\n") + + if cmd.parameters: + f.write("**Parameters:**\n") + for param in cmd.parameters: + f.write(f"- {param}\n") + f.write("\n") + if cmd.remarks: + f.write("**Remarks:**\n") + for param in cmd.remarks: + f.write(f"{param}\n") + f.write("\n") -# Example of printing output -for fam in allCommands: - print("***** {0} *****".format(fam.name)) - print("Command Count: {0}".format(len(fam.commands))) + if cmd.example: + f.write("**Example:**\n") + for param in cmd.example: + f.write(f"- {param}\n") + f.write("\n") + + f.write("
") + f.write("\n") + f.write("\n") + + f.write("\n\n") + + f.close() + print("File written to: ./scripts/MeadeToWikiOutput.txt") + +if __name__ == "__main__": + output_wiki() + +""" +# Output Excample +for fam in all_commands: + print("-----") + print(fam.name) for cmd in fam.commands: - print("\tCommand: {0}".format(cmd.command)) - print("\tShort: {0}".format(cmd.short)) - print("\tLong Description: {0}".format(cmd.long)) - print("\tReturns: {0}".format(cmd.returns)) - print("\r") - -print("Family Count: {0}".format(len(allCommands))) -for fam in allCommands: - print("{0}".format(fam.name)) - print("\t{0}".format(len(fam.commands))) \ No newline at end of file + print("############################") + print(f"Command: {cmd.command}") + print(f"Description: {cmd.description}") + print(f"Information: {cmd.information}") + print(f"Returns: {cmd.returns}") + print(f"Parameters: {cmd.parameters}") + print(f"Remarks: {cmd.remarks}") + +""" \ No newline at end of file diff --git a/src/MeadeCommandProcessor.cpp b/src/MeadeCommandProcessor.cpp index 77dee86e..399f3777 100644 --- a/src/MeadeCommandProcessor.cpp +++ b/src/MeadeCommandProcessor.cpp @@ -22,558 +22,926 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp // //------------------------------------------------------------------ // INITIALIZE FAMILY -// +// // :I# -// Initialize Scope -// This puts the Arduino in Serial Control Mode and displays RA on line 1 and -// DEC on line 2 of the display. Serial Control Mode can be ended manually by -// pressing the SELECT key, or programmatically with the :Qq# command. -// Returns: nothing +// Description: +// Initialize Scope +// Information: +// This puts the Arduino in Serial Control Mode and displays RA on line 1 and +// DEC on line 2 of the display. Serial Control Mode can be ended manually by +// pressing the SELECT key, or programmatically with the :Qq# command. +// Returns: +// nothing // //------------------------------------------------------------------ // SYNC CONTROL FAMILY // // :CM# -// Synchronize Declination and Right Ascension. -// This tells the scope what it is currently pointing at. The scope synchronizes -// to the current target coordinates (set with :Sd# and :Sr#) -// Returns: NONE# +// Description: +// Synchronize Declination and Right Ascension. +// Information: +// This tells the scope what it is currently pointing at. The scope synchronizes +// to the current target coordinates +// Remarks: +// Set with ":Sd#" and ":Sr#" +// Returns: +// "NONE#" // //------------------------------------------------------------------ // DISTANCE FAMILY // // :D# -// Query Mount Status -// This queries the mount for its slewing status -// Returns: '|#' if slewing, ' #' if not +// Description: +// Query Mount Status +// Information: +// This queries the mount for its slewing status +// Returns: +// "|#" if slewing +// " #" if not // //------------------------------------------------------------------ // GPS FAMILY // // :gT# -// Set Mount Time -// Attempts to set the mount time and location from the GPS for 2 minutes. This is essentially a -// blocking call, no other activities take place (except tracking, but only if interrupt-driven). -// Use :Gt# and :Gg# to retrieve Lat and Long, -// Returns: 1 if the data was set, 0 if not (timedout) +// Description: +// Set Mount Time +// Information: +// Attempts to set the mount time and location from the GPS for 2 minutes. This is essentially a +// blocking call, no other activities take place (except tracking, but only if interrupt-driven). +// Remarks: +// Use ":Gt#" and ":Gg#" to retrieve Lat and Long, +// Returns: +// "1" if the data was set +// "0" if not (timedout) // // :gTnnn# -// Set Mount Time w/ timeout -// Attempts to set the mount time and location from the GPS with a custom timeout. This is also blocking -// but by using a low timeout, you can avoid long pauses and let the user know that it's not ready yet. -// Where nnn is an integer defining the number of milliseconds to wait for the GPS to get a bearing. -// Returns: 1 if the data was set, 0 if not (timedout) +// Description: +// Set Mount Time w/ timeout +// Information: +// Attempts to set the mount time and location from the GPS with a custom timeout. This is also blocking +// but by using a low timeout, you can avoid long pauses and let the user know that it's not ready yet. +// Returns: +// "1" if the data was set +// "0" if not (timedout) +// Parameters: +// "nnn" is an integer defining the number of milliseconds to wait for the GPS to get a bearing // //------------------------------------------------------------------ // GET FAMILY // // :GVP# -// Get the Product Name -// Returns: 'OpenAstroTracker#' +// Description: +// Get the Product Name +// Returns: +// "OpenAstroTracker#" // // :GVN# -// Get the Firmware Version Number -// Returns: 'V1.major.minor#' from version.h +// Description: +// Get the Firmware Version Number +// Returns: +// "V1.major.minor#" from version.h // // :Gd# -// Get Target Declination -// Returns: sDD*MM'SS# -// Where s is + or -, DD is degrees, MM is minutes, SS is seconds. +// Description: +// Get Target Declination +// Returns: +// "sDD*MM'SS#" +// Parameters: +// "s" is + or - +// "DD" is degrees +// "MM" is minutes +// "SS" is seconds // // :GD# -// Get Current Declination -// Returns: sDD*MM'SS# -// Where s is + or -, DD is degrees, MM is minutes, SS is seconds. +// Description: +// Get Current Declination +// Returns: +// "sDD*MM'SS#" +// Parameters: +// "s" is + or - +// "DD" is degrees +// "MM" is minutes +// "SS" is seconds. // // :Gr# -// Get Target Right Ascension -// Returns: HH:MM:SS# -// Where HH is hour, MM is minutes, SS is seconds. +// Description: +// Get Target Right Ascension +// Returns: +// HH:MM:SS# +// Parameters: +// "HH" is hour +// "MM" is minutes +// "SS" is seconds // // :GR# -// Get Current Right Ascension -// Returns: HH:MM:SS# -// Where HH is hour, MM is minutes, SS is seconds. +// Description: +// Get Current Right Ascension +// Returns: +// "HH:MM:SS#" +// Parameters: +// "HH" is hour +// "MM" is minutes +// "SS" is seconds // // :Gt# -// Get Site Latitude -// Returns: sDD*MM# -// Where s is + or - and DD is the latitude in degrees and MM the minutes. +// Description: +// Get Site Latitude +// Returns: +// "sDD*MM#" +// Parameters: +// "s" is + or - +// "DD" is the latitude in degrees +// "MM" the minutes // // :Gg# -// Get Site Longitude -// Returns: DDD*MM# -// Where DDD is the longitude in degrees and MM the minutes. Longitudes are from 0 to 360 going WEST. so 179W is 359 and 179E is 1. +// Description: +// Get Site Longitude +// Returns: +// "DDD*MM#" +// Parameters: +// "DDD" is the longitude in degrees +// "MM" the minutes +// Remarks: +// Longitudes are from 0 to 360 going WEST. so 179W is 359 and 179E is 1. // // :Gc# -// Get current Clock format -// Returns: 24# +// Description: +// Get current Clock format +// Returns: +// "24#" // // :GG# -// Get UTC offset time -// Returns: sHH# -// Where s is the sign and HH are the number of hours that need to be added to local time to convert to UTC time +// Description: +// Get UTC offset time +// Returns: +// "sHH#" +// Parameters: +// "s" is the sign +// "HH" are the number of hours that need to be added to local time to convert to UTC time // // :Ga# -// Get local time in 12h format -// Returns: HH:MM:SS# -// Where HH are hours (modulo 12), MM are minutes and SS are seconds of the local time. +// Description: +// Get local time in 12h format +// Returns: +// "HH:MM:SS#" +// Parameters: +// "HH" are hours (modulo 12) +// "MM" are minutes +// "SS" are seconds of the local time // // :GL# -// Get local time in 24h format -// Returns: HH:MM:SS# -// Where HH are hours, MM are minutes and SS are seconds of the local time. +// Description: +// Get local time in 24h format +// Returns: +// "HH:MM:SS#" +// Parameters: +// "HH" are hours +// "MM" are minutes +// "SS" are seconds of the local time // // :GC# -// Get current date -// Returns: MM/DD/YY# -// Where MM is the month (1-12), day is the day (1-31) and year is the lower two digits of the year +// Description: +// Get current date +// Returns: +// "MM/DD/YY#" +// Parameters: +// "MM" is the month (1-12) +// "day" is the day (1-31) +// "year" is the lower two digits of the year // // :GM# -// Get Site Name 1 -// Returns: OAT1# +// Description: +// Get Site Name 1 +// Returns: +// "OAT1#" // // :GN# -// Get Site Name 2 -// Returns: OAT2# +// Description: +// Get Site Name 2 +// Returns: +// "OAT2#" // // :GO# -// Get Site Name 3 -// Returns: OAT2# +// Description: +// Get Site Name 3 +// Returns: +// OAT2# // // :GP# -// Get Site Name 4 -// Returns: OAT4# +// Description: +// Get Site Name 4 +// Returns: +// OAT4# // // :GT# -// Get tracking rate -// Returns: 60.0# +// Description: +// Get tracking rate +// Returns: +// 60.0# +// +//------------------------------------------------------------------ +// GET EXTENSIONS // -// -- GET Extensions -- // :GIS# -// Get DEC or RA Slewing -// Returns: 1# if either RA or DEC is slewing. 0# if not. +// Description: +// Get DEC or RA Slewing +// Returns: +// "1#" if either RA or DEC is slewing +// "0#" if not // // :GIT# -// Get Tracking -// Returns: 1# if tracking is on. 0# if not. +// Description: +// Get Tracking +// Returns: +// "1#" if tracking is on +// "0#" if not // // :GIG# -// Get Guiding -// Returns: 1# if currently guiding. 0# if not. +// Description: +// Get Guiding +// Returns: +// "1#" if currently guiding +// "0#" if not // // :GX# -// Get Mount Status -// Returns: string reflecting the mounts' status. The string is a comma-delimited list of statuses: -// Idle,--T--,11219,0,927,071906,+900000,# -// | | | | | | | -// | | | | | | | -// | | | | | | | -// | | | | | | +------------------ [6] The current DEC position -// | | | | | +------------------------- [5] The current RA position -// | | | | +------------------------------- [4] The Tracking stepper position -// | | | +---------------------------------- [3] The DEC stepper position -// | | +-------------------------------------- [2] The RA stepper position -// | +-------------------------------------------- [1] The motion state. -// | First character is RA slewing state ('R' is East, 'r' is West, '-' is stopped). -// | Second character is DEC slewing state ('d' is North, 'D' is South, '-' is stopped). -// | Third character is TRK slewing state ('T' is Tracking, '-' is stopped). -// | * Fourth character is AZ slewing state ('Z' and 'z' is adjusting, '-' is stopped). -// | * Fifth character is ALT slewing state ('A' and 'a' is adjusting, '-' is stopped). -// +------------------------------------------------- [0] The mount status. One of 'Idle', 'Parked', 'Parking', 'Guiding', 'SlewToTarget', 'FreeSlew', 'ManualSlew', 'Tracking', 'Homing' -// * Az and Alt are optional. The string may only be 3 characters long +// Description: +// Get Mount Status +// Information: +// String reflecting the mounts' status. The string is a comma-delimited list of statuses +// Returns: +// "Idle,--T--,11219,0,927,071906,+900000,#" +// Parameters: +// [0] The mount status. One of 'Idle', 'Parked', 'Parking', 'Guiding', 'SlewToTarget', 'FreeSlew', 'ManualSlew', 'Tracking', 'Homing' +// [1] The motion state. +// [2] The RA stepper position +// [3] The DEC stepper position +// [4] The Tracking stepper position +// [5] The current RA position +// [6] The current DEC position +// Remarks: +// The motion state +// First character is RA slewing state ('R' is East, 'r' is West, '-' is stopped). +// Second character is DEC slewing state ('d' is North, 'D' is South, '-' is stopped). +// Third character is TRK slewing state ('T' is Tracking, '-' is stopped). +// Fourth character is AZ slewing state ('Z' and 'z' is adjusting, '-' is stopped). +// Fifth character is ALT slewing state ('A' and 'a' is adjusting, '-' is stopped). +// Az and Alt are optional. The string may only be 3 characters long // //------------------------------------------------------------------ // SET FAMILY // // :SdsDD*MM:SS# -// Set Target Declination -// This sets the target DEC. Use a Movement command to slew there. -// Where s is + or -, DD is degrees, MM is minutes, SS is seconds. -// Returns: 1 if successfully set, otherwise 0 +// Description: +// Set Target Declination +// Information: +// This sets the target DEC. Use a Movement command to slew there. +// Parameters: +// "s" is + or - +// "DD" is degrees +// "MM" is minutes +// "SS" is seconds +// Returns: +// "1" if successfully set +// "0" otherwise // // :SrHH:MM:SS# -// Set Right Ascension -// This sets the target RA. Use a Movement command to slew there. -// Where HH is hours, MM is minutes, SS is seconds. -// Returns: 1 if successfully set, otherwise 0 +// Description: +// Set Right Ascension +// Information: +// This sets the target RA. Use a Movement command to slew there. +// Returns: +// "1" if successfully set +// "0" otherwise +// Parameters: +// "HH" is hours +// "MM" is minutes +// "SS" is seconds // // :StsDD*MM# -// Set Site Latitude -// This sets the latitude of the location of the mount. -// Where s is the sign ('+' or '-'), DD is the degree (90 or less), MM is minutes. -// Returns: 1 if successfully set, otherwise 0 +// Description: +// Set Site Latitude +// Information: +// This sets the latitude of the location of the mount. +// Returns: +// "1" if successfully set +// "0" otherwise +// Parameters: +// "s" is the sign ('+' or '-') +// "DD" is the degree (90 or less) +// "MM" is minutes // // :SgDDD*MM# -// Set Site Longitude -// This sets the longitude of the location of the mount. -// Where DDD the nmber of degrees (0 to 360), MM is minutes. Longitudes are from 0 to 360 going WEST. so 179W is 359 and 179E is 1. -// Returns: 1 if successfully set, otherwise 0 +// Description: +// Set Site Longitude +// Information: +// This sets the longitude of the location of the mount. +// Returns: +// "1" if successfully set +// "0" otherwise +// Parameters: +// "DDD" the nmber of degrees (0 to 360) +// "MM" is minutes +// Remarks: +// Longitudes are from 0 to 360 going WEST. so 179W is 359 and 179E is 1. // // :SGsHH# -// Set Site UTC Offset -// This sets the offset of the timezone in which the mount is in hours from UTC. -// Where s is the sign and HH is the number of hours. -// Returns: 1 +// Description: +// Set Site UTC Offset +// Information: +// This sets the offset of the timezone in which the mount is in hours from UTC. +// Returns: +// "1" +// Parameters: +// "s" is the sign +// "HH" is the number of hours // // :SLHH:MM:SS# -// Set Site Local Time -// This sets the local time of the timezone in which the mount is located. -// Where HH is hours, MM is minutes and SS is seconds. -// Returns: 1 +// Description: +// Set Site Local Time +// Information: +// This sets the local time of the timezone in which the mount is located. +// Returns: +// "1" +// Parameters: +// "HH" is hours +// "MM" is minutes +// "SS" is seconds // // :SCMM/DD/YY# -// Set Site Date -// This sets the date -// Where HHMM is the month, DD is the day and YY is the year since 2000. -// Returns: 1Updating Planetary Data# # +// Description: +// Set Site Date +// Information: +// This sets the date +// Returns: +// "1Updating Planetary Data# #" +// Parameters: +// "HHMM" is the month +// "DD" is the day +// "YY" is the year since 2000 +// +//------------------------------------------------------------------ +// SET Extensions // -// -- SET Extensions -- // :SHHH:MM# -// Set Hour Time (HA) -// This sets the scopes HA. -// Where HH is hours, MM is minutes. -// Returns: 1 if successfully set, otherwise 0 +// Description: +// Set Hour Time (HA) +// Information: +// This sets the scopes HA. +// Returns: +// "1" if successfully set +// "0" otherwise +// Parameters: +// "HH" is hours +// "MM" is minutes // // :SHP# -// Set Home Point -// This sets the current orientation of the scope as its home point. -// Returns: 1 +// Description: +// Set Home Point +// Information: +// This sets the current orientation of the scope as its home point. +// Returns: +// "1" // // :SHLHH:MM# -// Set LST Time -// This sets the scopes LST (and HA). -// Where HH is hours, MM is minutes. -// Returns: 1 if successfully set, otherwise 0 +// Description: +// Set LST Time +// Information: +// This sets the scopes LST (and HA). +// Returns: +// "1" if successfully set +// "0" otherwise +// Parameters: +// "HH" is hours +// "MM" is minutes // // :SYsDD*MM:SS.HH:MM:SS# -// Synchronize Declination and Right Ascension. -// This tells the scope what it is currently pointing at. -// Where s is + or -, DD is degrees, HH is hours, MM is minutes, SS is seconds. -// Returns: 1 if successfully set, otherwise 0 +// Description: +// Synchronize Declination and Right Ascension. +// Information: +// This tells the scope what it is currently pointing at. +// Returns: +// "1" if successfully set +// "0" otherwise +// Parameters: +// "s" is + or - +// "DD" is degrees +// "HH" is hours +// "MM" is minutes +// "SS" is seconds // //------------------------------------------------------------------ // RATE CONTROL FAMILY // // :Rs# -// Set Slew rate -// Where s is one of 'S', 'M', 'C', or 'G' in order of decreasing speed -// Returns: nothing +// Description: +// Set Slew rate +// Parameters: +// "s" is one of 'S', 'M', 'C', or 'G' in order of decreasing speed +// Returns: +// nothing // //------------------------------------------------------------------ // MOVEMENT FAMILY // // :MS# -// Start Slew to Target (Asynchronously) -// This starts slewing the scope to the target RA and DEC coordinates and returns immediately. -// Returns: 0 +// Description: +// Start Slew to Target (Asynchronously) +// Information: +// This starts slewing the scope to the target RA and DEC coordinates and returns immediately. +// Returns: +// "0" // -// -- MOVEMENT Extensions -- +//------------------------------------------------------------------ +// MOVEMENT EXTENSIONS // // :MGdnnnn# -// Run a Guide pulse -// This runs the motors at increased speed for a short period of time. -// Where d is one of 'N', 'E', 'W', or 'S' and nnnn is the duration in ms. -// Returns: 1 +// Description: +// Run a Guide pulse +// Information: +// This runs the motors at increased speed for a short period of time. +// Parameters: +// "d" is one of 'N', 'E', 'W', or 'S' +// "nnnn" is the duration in ms +// Returns: +// "1" // // :MTs# -// Set Tracking mode -// This turns the scopes tracking mode on or off. -// Where s is 1 to turn on Tracking and 0 to turn it off. -// Returns: 1 +// Description: +// Set Tracking mode +// Information: +// This turns the scopes tracking mode on or off. +// Parameters: +// "s" is "1" to turn on Tracking and "0" to turn it off +// Returns: +// "1" // // :Mc# -// Start slewing -// This starts slewing the mount in the given direction. -// Where c is one of 'n', 'e', 'w', or 's'. -// Returns: nothing +// Description: +// Start slewing +// Information: +// This starts slewing the mount in the given direction. +// Parameters: +// "c" is one of 'n', 'e', 'w', or 's' +// Returns: +// nothing // // :MXxnnnnn# -// Move stepper -// This starts moving one of the steppers by the given amount of steps and returns immediately. -// Where x is the stepper to move (r for RA, d for DEC, f for FOC, z for AZ, t for ALT) and nnnn is the number of steps. -// Returns: 1 if successfully scheduled +// Description: +// Move stepper +// Information: +// This starts moving one of the steppers by the given amount of steps and returns immediately. +// Parameters: +// "x" is the stepper to move (r for RA, d for DEC, f for FOC, z for AZ, t for ALT) +// "nnnn" is the number of steps +// Returns: +// "1" if successfully scheduled // // :MAZn.nn# -// Move Azimuth -// If the scope supports automated azimuth operation, move azimuth by n.nn arcminutes -// Where n.nn is a signed floating point number representing the number of arcminutes to move the mount left or right. -// Returns: nothing +// Description: +// Move Azimuth +// Information: +// If the scope supports automated azimuth operation, move azimuth by n.nn arcminutes +// Parameters: +// "n.nn" is a signed floating point number representing the number of arcminutes to move the mount left or right +// Returns: +// nothing // // :MALn.nn# -// Move Altitude -// If the scope supports automated altitude operation, move altitude by n.nn arcminutes -// Where n.nn is a signed floating point number representing the number of arcminutes to raise or lower the mount. -// Returns: nothing +// Description: +// Move Altitude +// Information: +// If the scope supports automated altitude operation, move altitude by n.nn arcminutes +// Parameters: +// "n.nn" is a signed floating point number representing the number of arcminutes to raise or lower the mount. +// Returns: +// nothing // //------------------------------------------------------------------ // HOME FAMILY // // :hP# -// Park Scope and stop motors -// This slews the scope back to it's home position (RA ring centered, DEC -// at 90, basically pointing at celestial pole) and stops all movement (including tracking). -// Returns: Nothing +// Description: +// Park Scope and stop motors +// Information: +// This slews the scope back to it's home position (RA ring centered, DEC +// at 90, basically pointing at celestial pole) and stops all movement (including tracking). +// Returns: +// nothing // // :hF# -// Move Scope to Home position -// This slews the scope back to its home position (RA ring centered, DEC -// at 90, basically pointing at celestial pole). Mount will keep tracking. -// Returns: Nothing +// Description: +// Move Scope to Home position +// Information: +// This slews the scope back to its home position (RA ring centered, DEC +// at 90, basically pointing at celestial pole). Mount will keep tracking. +// Returns: +// nothing +// +//------------------------------------------------------------------ +// PARK Extensions // -// -- PARK Extensions -- // :hU# -// Unpark Scope -// This currently simply turns on tracking. -// Returns: 1 +// Description: +// Unpark Scope +// Information: +// This currently simply turns on tracking. +// Returns: +// "1" // //------------------------------------------------------------------ // QUIT MOVEMENT FAMILY // // :Q# -// Stop all motors -// This stops all motors, including tracking. Note that deceleration curves are still followed. -// Returns: 1 when all motors have stopped. +// Description: +// Stop all motors +// Information: +// This stops all motors, including tracking. Note that deceleration curves are still followed. +// Returns: +// "1" when all motors have stopped // // :Qd# -// Stop Slewing -// Stops slew in specified direction where d is n, s, e, w, a (the first four are the cardinal directions, a stands for All). -// Returns: nothing +// Description: +// Stop Slewing +// Information: +// Stops slew in specified direction where d is n, s, e, w, a (the first four are the cardinal directions, a stands for All). +// Returns: +// nothing +// +//------------------------------------------------------------------ +// QUIT MOVEMENT Extensions // -// -- QUIT MOVEMENT Extensions -- // :Qq# -// Disconnect, Quit Control mode -// This quits Serial Control mode and starts tracking. -// Returns: nothing +// Description: +// Disconnect, Quit Control mode +// Information: +// This quits Serial Control mode and starts tracking. +// Returns: +// nothing // //------------------------------------------------------------------ // EXTRA OAT FAMILY - These are meant for the PC control app // // :XFR# -// Perform a Factory Reset -// Clears all the EEPROM settings -// Returns: 1# +// Description: +// Perform a Factory Reset +// Information: +// Clears all the EEPROM settings +// Returns: +// "1#" // // :XDnnn# -// Run drift alignment -// This runs a drift alignment procedure where the mounts slews east, pauses, slews west and pauses. -// Where nnn is the number of seconds the entire alignment should take. The call is blocking and will -// only return once the drift alignment is complete. -// Returns: nothing +// Description: +// Run drift alignment +// Information: +// This runs a drift alignment procedure where the mounts slews east, pauses, slews west and pauses. +// Where nnn is the number of seconds the entire alignment should take. The call is blocking and will +// only return once the drift alignment is complete. +// Returns: +// nothing // // :XL0# -// Turn off the Digital level -// Returns: 1# or 0# if there is no Digital Level +// Description: +// Turn off the Digital level +// Returns: +// "1#" if successful +// "0#" if there is no Digital Level // // :XL1# -// Turn on the Digital level -// Returns: 1# or 0# if there is no Digital Level +// Description: +// Turn on the Digital level +// Returns: +// "1#" if successful +// "0#" if there is no Digital Level // // :XLGR# -// Digital Level - Get Reference -// Gets the reference pitch and roll values of the mount (Digital Level addon). These -// values are the values of the pitch and roll when the mount is level. -// Returns: ,# or 0# if there is no Digital Level +// Description: +// Digital Level - Get Reference +// Information: +// Gets the reference pitch and roll values of the mount (Digital Level addon). These +// values are the values of the pitch and roll when the mount is level. +// Returns: +// ",#" +// "0#" if there is no Digital Level // // :XLGC# -// Digital Level - Get Values -// Gets the current pitch and roll values of the mount (Digital Level addon). -// Returns: ,# or 0# if there is no Digital Level +// Description: +// Digital Level - Get Values +// Information: +// Gets the current pitch and roll values of the mount (Digital Level addon). +// Returns: +// ",#" +// "0#" if there is no Digital Level // // :XLGT# -// Digital Level - Get Temperature -// Get the current temperature in Celsius of the mount (Digital Level addon). -// Returns: # or 0# if there is no Digital Level +// Description: +// Digital Level - Get Temperature +// Information: +// Get the current temperature in Celsius of the mount (Digital Level addon). +// Returns: +// "#" +// "0#" if there is no Digital Level // // :XLSR# -// Digital Level - Set Reference Roll -// Sets the reference roll value of the mount (Digital Level addon). This is the value -// at which the mount is level. -// Returns: 1# or 0# if there is no Digital Level +// Description: +// Digital Level - Set Reference Roll +// Information: +// Sets the reference roll value of the mount (Digital Level addon). This is the value +// at which the mount is level. +// Returns: +// "1#" if successful +// "0#" if there is no Digital Level // // :XLSP# -// Digital Level - Set Reference Pitch -// Sets the reference pitch value of the mount (Digital Level addon). This is the value -// at which the mount is level. -// Returns: 1# or 0# if there is no Digital Level +// Description: +// Digital Level - Set Reference Pitch +// Information: +// Sets the reference pitch value of the mount (Digital Level addon). This is the value +// at which the mount is level. +// Returns: +// "1#" if succsessful +// "0#" if there is no Digital Level // // :XGB# -// Get Backlash correction steps -// Get the number of steps the RA stepper motor needs to overshoot and backtrack when slewing east. -// Returns: integer# +// Description: +// Get Backlash correction steps +// Information: +// Get the number of steps the RA stepper motor needs to overshoot and backtrack when slewing east. +// Returns: +// "integer#" // // :XGCn.nn*m.mm# -// Get stepper motor positions for target -// Get the positions of stepper motors when pointed at the given coordinates. -// Where n.nn is the RA coordinate (0.0 - 23.999) -// m.mm is the DEC coordinate (-90.00 - +90.00) -// Returns: ralong,declong# -// Where ralong is the stepper position of the RA stepper -// declong is the stepper position of the DEC stepper +// Description: +// Get stepper motor positions for target +// Information: +// Get the positions of stepper motors when pointed at the given coordinates. +// Parameters: +// "n.nn" is the RA coordinate (0.0 - 23.999) +// "m.mm" is the DEC coordinate (-90.00 - +90.00) +// "ralong" is the stepper position of the RA stepper +// "declong" is the stepper position of the DEC stepper +// Returns: +// "ralong,declong#" // // :XGR# -// Get RA steps -// Get the number of steps the RA stepper motor needs to take to rotate RA by one degree -// Returns: float# +// Description: +// Get RA steps +// Information: +// Get the number of steps the RA stepper motor needs to take to rotate RA by one degree +// Returns: +// "float#" // // :XGD# -// Get DEC steps -// Get the number of steps the DEC stepper motor needs to take to rotate DEC by one degree -// Returns: float# +// Description: +// Get DEC steps +// Information: +// Get the number of steps the DEC stepper motor needs to take to rotate DEC by one degree +// Returns: +// "float#" // // :XGDL# -// Get DEC limits -// Get the lower and upper limits for the DEC stepper motor in steps -// Returns: integer|integer# +// Description: +// Get DEC limits +// Information: +// Get the lower and upper limits for the DEC stepper motor in steps +// Returns: +// "integer|integer#" // // :XGS# -// Get Tracking speed adjustment -// Get the adjustment factor used to speed up (>1.0) or slow down (<1.0) the tracking speed of the mount. -// Returns: float# +// Description: +// Get Tracking speed adjustment +// Information: +// Get the adjustment factor used to speed up (>1.0) or slow down (<1.0) the tracking speed of the mount. +// Returns: +// "float#" // // :XGT# -// Get Tracking speed -// Get the absolute tracking speed of the mount. -// Returns: float# +// Description: +// Get Tracking speed +// Information: +// Get the absolute tracking speed of the mount. +// Returns: +// "float#" // // :XGH# -// Get HA -// Get the current HA of the mount. -// Returns: HHMMSS# +// Description: +// Get HA +// Information: +// Get the current HA of the mount. +// Returns: +// "HHMMSS#" // // :XGM# -// Get Mount configuration settings -// Returns: ,,,,,# -// Where is one of the supported boards (currently Mega, ESP32) -// is a pipe-delimited string of Motor type (NEMA or 28BYJ), Pulley Teeth, Steps per revolution) -// is either NO_GPS or GPS, depending on whether a GPS module is present -// is either NO_AZ_ALT, AUTO_AZ_ALT, AUTO_AZ, or AUTO_ALT, depending on which AutoPA stepper motors are present -// is either NO_GYRO or GYRO depending on whether the Digial level is present -// Example: ESP32,28BYJ|16|4096.00,28BYJ|16|4096.00,NO_GPS,NO_AZ_ALT,NO_GYRO# +// Description: +// Get Mount configuration settings +// Returns: +// ",,,,,#" +// Parameters: +// "" is one of the supported boards (currently Mega, ESP32, MKS) +// "" is a pipe-delimited string of Motor type (NEMA or 28BYJ), Pulley Teeth, Steps per revolution) +// "" is either NO_GPS or GPS, depending on whether a GPS module is present +// "" is either NO_AZ_ALT, AUTO_AZ_ALT, AUTO_AZ, or AUTO_ALT, depending on which AutoPA stepper motors are present +// "" is either NO_GYRO or GYRO depending on whether the Digial level is present +// Example: +// "ESP32,28BYJ|16|4096.00,28BYJ|16|4096.00,NO_GPS,NO_AZ_ALT,NO_GYRO#" // // :XGMS# -// Get Mount driver configuration -// Returns: ,,|,,|# -// Where is one of the supported drivers: U = ULN2003, TU=TMC2209UART, TS=TMC2209STANDALONE, A=A4983 -// is the microstepping divider (1, 2, 4, 8, 15, 21, 64, 128, 256) used when slewing -// is the microstepping divider (1, 2, 4, 8, 15, 21, 64, 128, 256) used when tracking RA -// is the microstepping divider (1, 2, 4, 8, 15, 21, 64, 128, 256) used when guiding DEC -// Example: TU,8,64|TU,16,64|# +// Description: +// Get Mount driver configuration +// Returns: +// ",,|,,|#" +// Parameters: +// "" is one of the supported drivers: U = ULN2003, TU=TMC2209UART, TS=TMC2209STANDALONE, A=A4983 +// "" is the microstepping divider (1, 2, 4, 8, 15, 21, 64, 128, 256) used when slewing +// "" is the microstepping divider (1, 2, 4, 8, 15, 21, 64, 128, 256) used when tracking RA +// "" is the microstepping divider (1, 2, 4, 8, 15, 21, 64, 128, 256) used when guiding DEC +// Example: +// "TU,8,64|TU,16,64|#" // // :XGN# -// Get network settings -// Gets the current status of the Wifi connection. Reply only available when running on ESP boards. -// Returns: 1,,,,:,,# - if Wifi is enabled -// 0,# - if Wifi is not enabled +// Description: +// Get network settings +// Information: +// Gets the current status of the Wifi connection. Reply only available when running on ESP boards. +// Returns: +// "1,,,,:,,#" if Wifi is enabled +// "0,#" if Wifi is not enabled // // :XGL# -// Get LST -// Get the current LST of the mount. -// Returns: HHMMSS +// Description: +// Get LST +// Information: +// Get the current LST of the mount. +// Returns: +// "HHMMSS" // // :XSBn# -// Set Backlash correction steps -// Sets the number of steps the RA stepper motor needs to overshoot and backtrack when slewing east. -// Returns: nothing +// Description: +// Set Backlash correction steps +// Information: +// Sets the number of steps the RA stepper motor needs to overshoot and backtrack when slewing east. +// Returns: +// nothing // // :XSRn.n# -// Set RA steps -// Set the number of steps the RA stepper motor needs to take to rotate by one degree. -// Where n.n is the number of steps (only one decimal point is supported) -// Returns: nothing +// Description: +// Set RA steps +// Information: +// Set the number of steps the RA stepper motor needs to take to rotate by one degree. +// Parameters: +// "n.n" is the number of steps (only one decimal point is supported) +// Returns: +// nothing // // :XSDn.n# -// Set DEC steps -// Set the number of steps the DEC stepper motor needs to take to rotate by one degree. -// Where n.n is the number of steps (only one decimal point is supported) -// Returns: nothing +// Description: +// Set DEC steps +// Information: +// Set the number of steps the DEC stepper motor needs to take to rotate by one degree. +// Parameters: +// "n.n" is the number of steps (only one decimal point is supported) +// Returns: +// nothing // // :XSDLU# -// Set DEC upper limit -// Set the upper limit for the DEC stepper motor to the current position -// Returns: nothing +// Description: +// Set DEC upper limit +// Information: +// Set the upper limit for the DEC stepper motor to the current position +// Returns: +// nothing // // :XSDLu# -// Clear DEC upper limit -// Clears the upper limit for the DEC stepper motor -// Returns: nothing +// Description: +// Clear DEC upper limit +// Information: +// Clears the upper limit for the DEC stepper motor +// Returns: +// nothing // // :XSDLL# -// Set DEC lower limit -// Set the lowerlimit for the DEC stepper motor to the current position -// Returns: nothing +// Description: +// Set DEC lower limit +// Information: +// Set the lowerlimit for the DEC stepper motor to the current position +// Returns: +// nothing // // :XSDLl# -// Clear DEC lower limit -// Clear the lower limit for the DEC stepper motor +// Description: +// Clear DEC lower limit +// Information: +// Clear the lower limit for the DEC stepper motor // Returns: nothing // // :XSSn.nnn# -// Set Tracking speed adjustment -// Set the adjustment factor used to speed up (>1.0) or slow down (<1.0) the tracking speed of the mount. -// Where n.nnn is the factor to multiply the theoretical speed by. -// Returns: nothing +// Description: +// Set Tracking speed adjustment +// Information: +// Set the adjustment factor used to speed up "(>1.0)" or slow down "(<1.0)" the tracking speed of the mount +// Parameters: +// "n.nnn" is the factor to multiply the theoretical speed by +// Returns: +// nothing // // :XSMn# -// Set Manual Slewing Mode -// Toggle the manual slewing mode state where the RA and DEC motors run at a constant speed. -// Where n is '1' to turn it on, otherwise turn it off. -// Returns: nothing +// Description: +// Set Manual Slewing Mode +// Information: +// Toggle the manual slewing mode state where the RA and DEC motors run at a constant speed +// Parameters: +// "n" is '1' to turn it on, otherwise turn it off +// Returns: +// nothing // // :XSXn.nnn# -// Set RA Speed -// Set RA manual slewing speed in degrees/sec immediately. Max is around 2.5 degs/s. -// Must be in manual slewing mode. -// Returns: nothing +// Description: +// Set RA Speed +// Information: +// Set RA manual slewing speed in degrees/sec immediately. Max is around 2.5 degs/s +// Returns: +// nothing +// Remarks: +// Must be in manual slewing mode. // // :XSYn.nnn# -// Set DEC Speed -// Set DEC manual slewing speed in degrees/sec immediately. Max is around 2.5 degs/s. -// Must be in manual slewing mode. -// Returns: nothing +// Description: +// Set DEC Speed +// Information: +// Set DEC manual slewing speed in degrees/sec immediately. Max is around 2.5 degs/s +// Returns: +// nothing +// Remarks: +// Must be in manual slewing mode. // //------------------------------------------------------------------ // FOCUS FAMILY // // :F+# -// Start Focuser moving inward (toward objective) -// Continues pull in until stopped -// Returns: nothing +// Description: +// Start Focuser moving inward (toward objective) +// Information: +// Continues pull in until stopped +// Returns: +// nothing // // :F-# -// Pull out -// Continues pull out until stopped -// Returns: nothing +// Description: +// Pull out +// Information: +// Continues pull out until stopped +// Returns: +// nothing // // :Fn# -// Set speed factor -// Set focuser speed to where is an ASCII digit 1..4. 1 is slowest, 4 i fastest -// Returns: nothing +// Description: +// Set speed factor +// Information: +// Set focuser speed to where is an ASCII digit 1..4. 1 is slowest, 4 i fastest +// Returns: +// nothing // // :FS# -// Set slowest speed factor -// Set focuser to the slowest speed it can use -// Returns: nothing +// Description: +// Set slowest speed factor +// Information: +// Set focuser to the slowest speed it can use +// Returns: +// nothing // // :FF# -// Set fastest speed factor -// Set focuser speed to the fastest speed it can use -// Returns: nothing +// Description: +// Set fastest speed factor +// Information: +// Set focuser speed to the fastest speed it can use +// Returns: +// nothing // // :Fp# -// Get position -// Get the current position of the focus stepper motor -// Returns: nnn# where nnn is the current position of the stepper +// Description: +// Get position +// Information: +// Get the current position of the focus stepper motor +// Returns: +// "nnn#" +// Parameters: +// "nnn" is the current position of the stepper // // :FB# -// Get focuser state -// Gets the state of the focuser stepper. -// Returns: 0 if the focuser is idle. 1 if the focuser is moving. +// Description: +// Get focuser state +// Information: +// Gets the state of the focuser stepper. +// Returns: +// "0" if the focuser is idle +// "1" if the focuser is moving // // :FQ# -// Stop focuser -// Stops the stepper motor of teh focuser. -// Returns: nothing +// Description: +// Stop focuser +// Information: +// Stops the stepper motor of teh focuser. +// Returns: +// nothing // //------------------------------------------------------------------ /////////////////////////////////////////////////////////////////////////////////////////