diff --git a/GroundSystem.py b/GroundSystem.py index 9f5b543..a7f9863 100644 --- a/GroundSystem.py +++ b/GroundSystem.py @@ -19,7 +19,7 @@ # # cFS Ground System Version 2.0.0 # -#!/usr/bin/env python3 +# !/usr/bin/env python3 # import shlex import subprocess @@ -31,21 +31,21 @@ from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox from RoutingService import RoutingService -from Ui_MainWindow import Ui_MainWindow +from UiMainWindow import UiMainWindow from _version import __version__ as _version from _version import _version_string __version__ = _version -#ROOTDIR = Path(sys.argv[0]).resolve().parent +# ROOTDIR = Path(sys.argv[0]).resolve().parent ROOTDIR = pathlib.Path(__file__).parent.absolute() # # CFS Ground System: Setup and manage the main window # -class GroundSystem(QMainWindow, Ui_MainWindow): +class GroundSystem(QMainWindow, UiMainWindow): TLM_HDR_V1_OFFSET = 4 TLM_HDR_V2_OFFSET = 4 CMD_HDR_PRI_V1_OFFSET = 0 @@ -60,58 +60,58 @@ def __init__(self): super().__init__() self.setupUi(self) - self.RoutingService = None + self.routing_service = None self.alert = QMessageBox() # set initial defaults - self.sbTlmOffset.setValue(self.TLM_HDR_V1_OFFSET) - self.sbCmdOffsetPri.setValue(self.CMD_HDR_PRI_V1_OFFSET) - self.sbCmdOffsetSec.setValue(self.CMD_HDR_SEC_V1_OFFSET) + self.sb_tlm_offset.setValue(self.TLM_HDR_V1_OFFSET) + self.sb_cmd_offset_pri.setValue(self.CMD_HDR_PRI_V1_OFFSET) + self.sb_cmd_offset_sec.setValue(self.CMD_HDR_SEC_V1_OFFSET) - self.pushButtonStartTlm.clicked.connect(self.startTlmSystem) - self.pushButtonStartCmd.clicked.connect(self.startCmdSystem) - self.cbTlmHeaderVer.currentIndexChanged.connect(self.setTlmOffset) - self.cbCmdHeaderVer.currentIndexChanged.connect(self.setCmdOffsets) + self.push_button_start_tlm.clicked.connect(self.start_tlm_system) + self.push_button_start_cmd.clicked.connect(self.start_cmd_system) + self.cb_tlm_header_ver.currentIndexChanged.connect(self.set_tlm_offset) + self.cb_cmd_header_ver.currentIndexChanged.connect(self.set_cmd_offsets) - for sb in (self.sbTlmOffset, self.sbCmdOffsetPri, self.sbCmdOffsetSec): - sb.valueChanged.connect(self.saveOffsets) + for sb in (self.sb_tlm_offset, self.sb_cmd_offset_pri, self.sb_cmd_offset_sec): + sb.valueChanged.connect(self.save_offsets) # Init lists - self.ipAddressesList = ['All'] - self.spacecraftNames = ['All'] + self.ip_addresses_list = ['All'] + self.spacecraft_names = ['All'] def closeEvent(self, evnt): - if self.RoutingService: - self.RoutingService.stop() + if self.routing_service: + self.routing_service.stop() print("Stopped routing service") os.kill(0, signal.SIGKILL) super().closeEvent(evnt) # Read the selected spacecraft from combo box on GUI - def getSelectedSpacecraftAddress(self): - return self.comboBoxIpAddresses.currentText().strip() + def get_selected_spacecraft_address(self): + return self.combo_box_ip_addresses.currentText().strip() # Returns the name of the selected spacecraft - def getSelectedSpacecraftName(self): - return self.spacecraftNames[self.ipAddressesList.index( - self.getSelectedSpacecraftAddress())].strip() + def get_selected_spacecraft_name(self): + return self.spacecraft_names[self.ip_addresses_list.index( + self.get_selected_spacecraft_address())].strip() # # Display popup with error # - def DisplayErrorMessage(self, message): + def display_error_message(self, message): print(message) self.alert.setText(message) self.alert.setIcon(QMessageBox.Warning) self.alert.exec_() # Start the telemetry system for the selected spacecraft - def startTlmSystem(self): + def start_tlm_system(self): # Setup the subscription (to let the telemetry # system know the messages it will be receiving) subscription = '--sub=GroundSystem' - selectedSpacecraft = self.getSelectedSpacecraftName() - if selectedSpacecraft != 'All': - subscription += f'.{selectedSpacecraft}.TelemetryPackets' + selected_spacecraft = self.get_selected_spacecraft_name() + if selected_spacecraft != 'All': + subscription += f'.{selected_spacecraft}.TelemetryPackets' # Open Telemetry System system_call = f'python3 {ROOTDIR}/Subsystems/tlmGUI/TelemetrySystem.py {subscription}' @@ -120,66 +120,66 @@ def startTlmSystem(self): # Start command system @staticmethod - def startCmdSystem(): + def start_cmd_system(): subprocess.Popen( ['python3', f'{ROOTDIR}/Subsystems/cmdGui/CommandSystem.py']) # Start FDL-FUL gui system - def startFDLSystem(self): - selectedSpacecraft = self.getSelectedSpacecraftName() - if selectedSpacecraft == 'All': - self.DisplayErrorMessage( + def start_fdl_system(self): + selected_spacecraft = self.get_selected_spacecraft_name() + if selected_spacecraft == 'All': + self.display_error_message( 'Cannot open FDL manager.\nNo spacecraft selected.') else: - subscription = f'--sub=GroundSystem.{selectedSpacecraft}' + subscription = f'--sub=GroundSystem.{selected_spacecraft}' subprocess.Popen([ 'python3', f'{ROOTDIR}/Subsystems/fdlGui/FdlSystem.py', subscription ]) - def setTlmOffset(self): - selectedVer = self.cbTlmHeaderVer.currentText().strip() - if selectedVer == "Custom": - self.sbTlmOffset.setEnabled(True) + def set_tlm_offset(self): + selected_ver = self.cb_tlm_header_ver.currentText().strip() + if selected_ver == "Custom": + self.sb_tlm_offset.setEnabled(True) else: - self.sbTlmOffset.setEnabled(False) - if selectedVer == "1": - self.sbTlmOffset.setValue(self.TLM_HDR_V1_OFFSET) - elif selectedVer == "2": - self.sbTlmOffset.setValue(self.TLM_HDR_V2_OFFSET) - - def setCmdOffsets(self): - selectedVer = self.cbCmdHeaderVer.currentText().strip() - if selectedVer == "Custom": - self.sbCmdOffsetPri.setEnabled(True) - self.sbCmdOffsetSec.setEnabled(True) + self.sb_tlm_offset.setEnabled(False) + if selected_ver == "1": + self.sb_tlm_offset.setValue(self.TLM_HDR_V1_OFFSET) + elif selected_ver == "2": + self.sb_tlm_offset.setValue(self.TLM_HDR_V2_OFFSET) + + def set_cmd_offsets(self): + selected_ver = self.cb_cmd_header_ver.currentText().strip() + if selected_ver == "Custom": + self.sb_cmd_offset_pri.setEnabled(True) + self.sb_cmd_offset_sec.setEnabled(True) else: - self.sbCmdOffsetPri.setEnabled(False) - self.sbCmdOffsetSec.setEnabled(False) - if selectedVer == "1": - self.sbCmdOffsetPri.setValue(self.CMD_HDR_PRI_V1_OFFSET) - self.sbCmdOffsetSec.setValue(self.CMD_HDR_SEC_V1_OFFSET) - elif selectedVer == "2": - self.sbCmdOffsetPri.setValue(self.CMD_HDR_PRI_V2_OFFSET) - self.sbCmdOffsetSec.setValue(self.CMD_HDR_SEC_V2_OFFSET) - - def saveOffsets(self): - offsets = bytes((self.sbTlmOffset.value(), self.sbCmdOffsetPri.value(), - self.sbCmdOffsetSec.value())) + self.sb_cmd_offset_pri.setEnabled(False) + self.sb_cmd_offset_sec.setEnabled(False) + if selected_ver == "1": + self.sb_cmd_offset_pri.setValue(self.CMD_HDR_PRI_V1_OFFSET) + self.sb_cmd_offset_sec.setValue(self.CMD_HDR_SEC_V1_OFFSET) + elif selected_ver == "2": + self.sb_cmd_offset_pri.setValue(self.CMD_HDR_PRI_V2_OFFSET) + self.sb_cmd_offset_sec.setValue(self.CMD_HDR_SEC_V2_OFFSET) + + def save_offsets(self): + offsets = bytes((self.sb_tlm_offset.value(), self.sb_cmd_offset_pri.value(), + self.sb_cmd_offset_sec.value())) with open("/tmp/OffsetData", "wb") as f: f.write(offsets) # Update the combo box list in gui - def updateIpList(self, ip, name): - self.ipAddressesList.append(ip) - self.spacecraftNames.append(name) - self.comboBoxIpAddresses.addItem(ip) + def update_ip_list(self, ip, name): + self.ip_addresses_list.append(ip) + self.spacecraft_names.append(name) + self.combo_box_ip_addresses.addItem(ip) # Start the routing service (see RoutingService.py) - def initRoutingService(self): - self.RoutingService = RoutingService() - self.RoutingService.signalUpdateIpList.connect(self.updateIpList) - self.RoutingService.start() + def init_routing_service(self): + self.routing_service = RoutingService() + self.routing_service.signal_update_ip_list.connect(self.update_ip_list) + self.routing_service.start() # @@ -187,26 +187,26 @@ def initRoutingService(self): # def main(): - # Report Version Number upon startup print(_version_string) - + # Init app app = QApplication(sys.argv) # Init main window - MainWindow = GroundSystem() + main_window = GroundSystem() # Show and put window on front - MainWindow.show() - MainWindow.raise_() + main_window.show() + main_window.raise_() # Start the Routing Service - MainWindow.initRoutingService() - MainWindow.saveOffsets() + main_window.init_routing_service() + main_window.save_offsets() # Execute the app sys.exit(app.exec_()) + if __name__ == "__main__": - main() + main() diff --git a/MainWindow.ui b/MainWindow.ui index 3a8cdfe..20c1d8a 100644 --- a/MainWindow.ui +++ b/MainWindow.ui @@ -1,7 +1,7 @@ - MainWindow - + main_window + true @@ -22,10 +22,10 @@ Main Window - - + + - + 22 @@ -49,7 +49,7 @@ - + @@ -73,7 +73,7 @@ - + 132 @@ -116,7 +116,7 @@ - + 132 @@ -154,7 +154,7 @@ - + false @@ -167,7 +167,7 @@ - + false @@ -180,7 +180,7 @@ - + 1 @@ -199,7 +199,7 @@ - + false @@ -228,12 +228,12 @@ - + 32 - + 0 @@ -246,7 +246,7 @@ - + 0 @@ -268,7 +268,7 @@ - + @@ -282,7 +282,7 @@ - + 0 @@ -302,9 +302,9 @@ - pushButton + push_button clicked() - MainWindow + main_window close() diff --git a/README.md b/README.md index 82330af..19b0fe7 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,16 @@ See [Guide-GroundSystem.md](https://github.com/nasa/cFS-GroundSystem/blob/master ## Version History +### Development Build: v3.0.0-rc4+dev7 + +- Free Address Info to fix resource leak +- Converted most variable,function, and method names into snake_case +- Set new build baseline for cFS-Caelum-rc4: v3.0.0-rc4 +- See and + + +### Development Build: v2.2.0-rc1+dev63 + - Add Virtualenv and Pipenv .gitignore support - Fix doc, comment, and message typos - See and diff --git a/RoutingService.py b/RoutingService.py index 93136eb..f361d8b 100644 --- a/RoutingService.py +++ b/RoutingService.py @@ -28,7 +28,7 @@ from PyQt5.QtCore import QThread, pyqtSignal # Receive port where the CFS TO_Lab app sends the telemetry packets -udpRecvPort = 1235 +udp_recv_port = 1235 # @@ -37,16 +37,16 @@ # class RoutingService(QThread): # Signal to update the spacecraft combo box (list) on main window GUI - signalUpdateIpList = pyqtSignal(str, bytes) + signal_update_ip_list = pyqtSignal(str, bytes) def __init__(self): super().__init__() # Init lists - self.ipAddressesList = ["All"] - self.spacecraftNames = ["All"] - self.specialPktId = [] - self.specialPktName = [] + self.ip_addresses_list = ["All"] + self.spacecraft_names = ["All"] + self.special_pkt_id = [] + self.special_pkt_name = [] self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) @@ -58,12 +58,12 @@ def __init__(self): # Run thread def run(self): # Init udp socket - self.sock.bind(('', udpRecvPort)) + self.sock.bind(('', udp_recv_port)) print('Attempting to wait for UDP messages') - socketErrorCount = 0 - while socketErrorCount < 5: + socket_error_count = 0 + while socket_error_count < 5: # Wait for UDP messages while True: @@ -77,49 +77,49 @@ def run(self): continue # Read host address - hostIpAddress = host[0] + host_ip_address = host[0] # # Add Host to the list if not already in list # - if hostIpAddress not in self.ipAddressesList: + if host_ip_address not in self.ip_addresses_list: ## MAKE SURE THERE'S NO SPACE BETWEEN "Spacecraft" ## AND THE FIRST CURLY BRACE!!! - hostName = f'Spacecraft{len(self.spacecraftNames)}' - my_hostName_as_bytes = hostName.encode() - print("Detected", hostName, "at", hostIpAddress) - self.ipAddressesList.append(hostIpAddress) - self.spacecraftNames.append(my_hostName_as_bytes) - self.signalUpdateIpList.emit(hostIpAddress, - my_hostName_as_bytes) + hostname = f'Spacecraft{len(self.spacecraft_names)}' + my_hostname_as_bytes = hostname.encode() + print("Detected", hostname, "at", host_ip_address) + self.ip_addresses_list.append(host_ip_address) + self.spacecraft_names.append(my_hostname_as_bytes) + self.signal_update_ip_list.emit(host_ip_address, + my_hostname_as_bytes) # Forward the message using zeroMQ - name = self.spacecraftNames[self.ipAddressesList.index( - hostIpAddress)] + name = self.spacecraft_names[self.ip_addresses_list.index( + host_ip_address)] self.forwardMessage(datagram, name) # Handle errors except socket.error: - print('Ignored socket error for attempt', socketErrorCount) - socketErrorCount += 1 + print('Ignored socket error for attempt', socket_error_count) + socket_error_count += 1 sleep(1) # Apply header using hostname and packet id and send msg using zeroMQ def forwardMessage(self, datagram, hostName): - # Forward message to channel GroundSystem.. - pktId = self.getPktId(datagram) - my_decoded_hostName = hostName.decode() - header = f"GroundSystem.{my_decoded_hostName}.TelemetryPackets.{pktId}" + # Forward message to channel GroundSystem.. + pkt_id = self.get_pkt_id(datagram) + my_decoded_hostname = hostName.decode() + header = f"GroundSystem.{my_decoded_hostname}.TelemetryPackets.{pkt_id}" my_header_as_bytes = header.encode() self.publisher.send_multipart([my_header_as_bytes, datagram]) # print(header) # Read the packet id from the telemetry packet @staticmethod - def getPktId(datagram): + def get_pkt_id(datagram): # Read the telemetry header - streamId = unpack(">H", datagram[:2]) - return hex(streamId[0]) + stream_id = unpack(">H", datagram[:2]) + return hex(stream_id[0]) # Close ZMQ vars def stop(self): diff --git a/Subsystems/cmdGui/CHeaderParser.py b/Subsystems/cmdGui/CHeaderParser.py index f0e4df7..f687f89 100644 --- a/Subsystems/cmdGui/CHeaderParser.py +++ b/Subsystems/cmdGui/CHeaderParser.py @@ -70,13 +70,13 @@ # # Translate known data types to arguments # -def findDataTypeNew(dataTypeOrig, paramName): - if '[' in paramName: +def find_data_type_new(data_type_orig, param_name): + if '[' in param_name: return '--string' - if dataTypeOrig in ['boolean']: + if data_type_orig in ['boolean']: return '--uint8' - if dataTypeOrig in ['int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64']: - return "--" + dataTypeOrig + if data_type_orig in ['int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64']: + return "--" + data_type_orig return None @@ -86,7 +86,7 @@ def findDataTypeNew(dataTypeOrig, paramName): # This file is expected to be created by the user # Returns list of paths to those files # Added by Keegan Moore -def getFileList(filename='CHeaderParser-hdr-paths.txt'): +def get_file_list(filename='CHeaderParser-hdr-paths.txt'): """ Gets the list of header files to be parsed from other file """ paths = [] @@ -115,7 +115,7 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): if __name__ == '__main__': # Get list of files to parse - file_list = getFileList() + file_list = get_file_list() # If list is empty, exit now if not file_list: @@ -123,8 +123,8 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): sys.exit() # initialize command codes/descriptions lists as empty lists - cmdCodes = [] - cmdDesc = [] + cmd_codes = [] + cmd_desc = [] # create empty list for dumping header data master_hdr = [] @@ -175,8 +175,8 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): # therefore a length of 3 if len(definition) == 3: # Add command descriptions/codes to respective lists - cmdDesc.append(definition[1]) - cmdCodes.append(definition[2]) + cmd_desc.append(definition[1]) + cmd_codes.append(definition[2]) print(("We need to save the command into to a pickle file " "in 'CommandFile/'.\nPlease do not use any spaces/quotes " @@ -194,14 +194,14 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): # # FIGURE OUT WHY SHE DID THIS \\\ # vvv - pickle.dump([cmdDesc, cmdCodes, cmdDesc], pickle_obj) + pickle.dump([cmd_desc, cmd_codes, cmd_desc], pickle_obj) # Create a copy of command descriptions to preserve the original # unused_cmdDesc will be used to prompt user for parameters - unused_cmdDesc = list(cmdDesc) + unused_cmd_desc = list(cmd_desc) # Create an empty list of used commands to be populated - used_cmdDesc = [] + used_cmd_desc = [] # Initialize looping variable cmd_index = 0 @@ -209,8 +209,8 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): # Print a list of unused commands for the user to pick from. print("\nUnused Commands") print("-----------------------------------------") - for i, cmd in enumerate(unused_cmdDesc, start=1): - print(f"(Command {i} of {len(unused_cmdDesc)}) {cmd}") + for i, cmd in enumerate(unused_cmd_desc, start=1): + print(f"(Command {i} of {len(unused_cmd_desc)}) {cmd}") while True: # Get user input to see if any commands from this file require parameters @@ -234,6 +234,7 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): # Continue to ask user for commands with parameters until we get -1 to exit. while True: + command_choice = "" # Get user input try: command_choice = input( @@ -250,20 +251,20 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): command_choice = int(command_choice) # Make sure the choice is within range - ## Note that if command_choice is a string - ## it will never be in the range - if command_choice not in range(1, len(unused_cmdDesc) + 1): + # Note that if command_choice is a string + # it will never be in the range + if command_choice not in range(1, len(unused_cmd_desc) + 1): print( f"You entered {command_choice}, but that isn't an option.") else: - ## Choices are presented to user starting at 1, but list - ## indices start at 0 + # Choices are presented to user starting at 1, but list + # indicies start at 0 command_choice -= 1 - cmdName = unused_cmdDesc[command_choice] + cmd_name = unused_cmd_desc[command_choice] # Initialize Parameter variables to empty lists - paramNames, paramDesc, dataTypesOrig,\ - dataTypesNew, paramLens, stringLens = ([] for _ in range(6)) + param_names, param_desc, data_types_orig, \ + data_types_new, param_lens, string_lens = ([] for _ in range(6)) # This empty list will hold possibly multiple lists of line numbers # each list representing where inside the App Header file the @@ -272,7 +273,7 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): print( "This program will now attempt to find the command structure for", - cmdName) + cmd_name) # create a copy of file_lines for parsing structures file_lines = list(master_hdr) @@ -331,6 +332,8 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): print("--------------------------------------------") while True: + struct_choice = "" + # Give the user the option to exit too. try: struct_choice = input( @@ -348,8 +351,8 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): struct_choice = int(struct_choice) # Make sure the choice is valid - ## Note that if struct_choice is a string - ## it will never be in range + # Note that if struct_choice is a string + # it will never be in range if struct_choice not in range(1, len(list_cmd_structs) + 1): print( @@ -376,7 +379,6 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): # Display the command structure with indexed before each line print("\n\n") for line_num, line in enumerate(cmd_struct_lines): - # Dereference the index number in cmd_struct_lines to get the actual line number actual_line = line @@ -403,45 +405,45 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): line_split = file_lines[actual_line].split() # Add original data type (C data type) to list - dataTypesOrig.append(line_split[0]) + data_types_orig.append(line_split[0]) - # Get rid of any occurence of ';' (at the end of the line) - paramNames.append(re.sub(';', '', line_split[1])) + # Get rid of any occurance of ';' (at the end of the line) + param_names.append(re.sub(';', '', line_split[1])) # Not sure about why we are keeping track of this yet # just fill it with null for now - paramDesc.append('') + param_desc.append('') # Determines data type for us to use # returns null if no type could match - dataTypeNew = findDataTypeNew(dataTypesOrig[-1], - paramNames[-1]) + data_type_new = find_data_type_new(data_types_orig[-1], + param_names[-1]) # If no type could match, ask user for data type - if not dataTypeNew: - dataTypeNew = input( - (f'Data type for {paramNames[-1]} not found. ' + if not data_type_new: + data_type_new = input( + (f'Data type for {param_names[-1]} not found. ' 'Please enter new data type by hand: ')) - dataTypesNew.append(dataTypeNew.strip()) + data_types_new.append(data_type_new.strip()) # finds length if --string data type - if 'string' in dataTypeNew: + if 'string' in data_type_new: # Split parameter name into list, separating by '[' or ']' # if paramNames[-1] == 'array[10]' then # array_name_size == ['array', '10'] - array_name_size = re.split(r'\[|\]', paramNames[-1]) + array_name_size = re.split(r'\[|\]', param_names[-1]) # Re-assign paramName to just the name of the array # (before -> 'array[10]', after -> 'array') - paramNames[-1] = array_name_size[0] + param_names[-1] = array_name_size[0] # set array size to the second element array_size = array_name_size[1] # Add array size to the parameter list - paramLens.append(array_size) + param_lens.append(array_size) print("Array size:", array_size) @@ -469,21 +471,21 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): pass # Ignore non-integer and try again # Add string length argument to parameter list - stringLens.append(array_size) + string_lens.append(array_size) else: - stringLens.append('') - paramLens.append('') + string_lens.append('') + param_lens.append('') # print the last element of list to see if it worked - print("dataTypeOrig:", dataTypesOrig[-1]) - print("dataTypeNew:", dataTypesNew[-1]) - print("paramName:", paramNames[-1]) - print("paramLen:", paramLens[-1]) - print("stringLen:", stringLens[-1]) + print("dataTypeOrig:", data_types_orig[-1]) + print("dataTypeNew:", data_types_new[-1]) + print("paramName:", param_names[-1]) + print("paramLen:", param_lens[-1]) + print("stringLen:", string_lens[-1]) - print("Added:", paramNames[-1], "with type", - dataTypesNew[-1]) + print("Added:", param_names[-1], "with type", + data_types_new[-1]) # Remove used parameter from command structure lines # so that the user doesn't choose the same parameter twice @@ -497,29 +499,29 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): # Start the loop over to see if user has more parameters # Add command to used commands, to keep track of things - used_cmdDesc.append(unused_cmdDesc[command_choice]) + used_cmd_desc.append(unused_cmd_desc[command_choice]) # Take this command out of the list of unused commands before restarting the loop - del unused_cmdDesc[command_choice] + del unused_cmd_desc[command_choice] # If we later want the list of structs to be updated, to remove # previously selected structs, uncomment this line - #del list_cmd_structs[struct_choice] + # del list_cmd_structs[struct_choice] # saves parameter information in pickle file for command - pickle_file = f'{ROOTDIR}/ParameterFiles/{cmdName}' + pickle_file = f'{ROOTDIR}/ParameterFiles/{cmd_name}' with open(pickle_file, 'wb') as pickle_obj: pickle.dump([ - dataTypesOrig, paramNames, paramLens, paramDesc, - dataTypesNew, stringLens + data_types_orig, param_names, param_lens, param_desc, + data_types_new, string_lens ], pickle_obj) # Print a list of unused commands for the user to pick from. print("") print("Unused Commands") print("-----------------------------------------") - for cmd_index, cmd in enumerate(unused_cmdDesc, start=1): - print(f"Command ({cmd_index} of {len(unused_cmdDesc)})", + for cmd_index, cmd in enumerate(unused_cmd_desc, start=1): + print(f"Command ({cmd_index} of {len(unused_cmd_desc)})", cmd) # End of 'while True:' @@ -527,4 +529,4 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'): print("Thank you for using CHeaderParser.") print("The following commands have been added with parameters: ") - print(used_cmdDesc) + print(used_cmd_desc) diff --git a/Subsystems/cmdGui/CommandParser.py b/Subsystems/cmdGui/CommandParser.py index 01af00d..177844c 100644 --- a/Subsystems/cmdGui/CommandParser.py +++ b/Subsystems/cmdGui/CommandParser.py @@ -31,8 +31,8 @@ class CommandParser(HTMLParser): # Initializes allData variable # def reset(self): - self.allData = [] - self.allhref = [] + self.all_data = [] + self.all_href = [] HTMLParser.reset(self) # @@ -40,7 +40,7 @@ def reset(self): # def handle_data(self, data): if data.strip(): # excludes new lines - self.allData.append(data.strip()) + self.all_data.append(data.strip()) # print self.allData[-1] # @@ -51,7 +51,7 @@ def handle_starttag(self, tag, attrs): for name, value in attrs: if name == 'href': val = re.split('#', value)[0] - self.allhref.append(val) + self.all_href.append(val) # print self.allhref[-1] @@ -70,32 +70,32 @@ def handle_starttag(self, tag, attrs): print('\nFILE:', html_file) reader = html_obj.read() soup = BeautifulSoup(reader) - cmdNames = [] # names of commands - cmdCodes = [] # command codes - htmlFiles = [] # HTML files with parameter information + cmd_names = [] # names of commands + cmd_codes = [] # command codes + html_files = [] # HTML files with parameter information # gets HTML file names for link in soup.findAll(text="Command Structure"): - htmlFile = link.find_next('a')[ + html_file = link.find_next('a')[ 'href'] # next element with 'a' tag - htmlFile = re.split(r'\.', htmlFile)[0] - htmlFiles.append(htmlFile.encode('ascii')) + html_file = re.split(r'\.', html_file)[0] + html_files.append(html_file.encode('ascii')) # gets command names and command codes for names in soup.findAll(text="Name:"): # finds all 'Name:' text pre_cmdCode = names.find_previous('td').get_text() - cmdCode = pre_cmdCode.split()[-1] - cmdCodes.append(cmdCode.encode('ascii')) - cmdName = names.next_element.get_text( + cmd_code = pre_cmdCode.split()[-1] + cmd_codes.append(cmd_code.encode('ascii')) + cmd_name = names.next_element.get_text( ) # finds next text element - cmdNames.append(cmdName.encode('ascii')) + cmd_names.append(cmd_name.encode('ascii')) # prints values after iterating through whole file - print('CMD NAMES:', cmdNames) - print('CMD CODES:', cmdCodes) - print('HTML FILES:', htmlFiles) + print('CMD NAMES:', cmd_names) + print('CMD CODES:', cmd_codes) + print('HTML FILES:', html_files) # writes data to pickle file pickle_file = 'CommandFiles/' + re.split(r'/|\.', html_file)[-2] with open(pickle_file, 'wb') as pickle_obj: - pickle.dump([cmdNames, cmdCodes, htmlFiles], pickle_obj) + pickle.dump([cmd_names, cmd_codes, html_files], pickle_obj) diff --git a/Subsystems/cmdGui/CommandSystem.py b/Subsystems/cmdGui/CommandSystem.py index b858d1c..5a9233b 100644 --- a/Subsystems/cmdGui/CommandSystem.py +++ b/Subsystems/cmdGui/CommandSystem.py @@ -17,7 +17,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -#!/usr/bin/env python3 +# !/usr/bin/env python3 # import csv import pickle @@ -30,13 +30,13 @@ QTableWidgetItem) from MiniCmdUtil import MiniCmdUtil -from Ui_CommandSystemDialog import Ui_CommandSystemDialog +from UiCommandsystemdialog import UiCommandsystemdialog -## ../cFS/tools/cFS-GroundSystem/Subsystems/cmdGui/ +# ../cFS/tools/cFS-GroundSystem/Subsystems/cmdGui/ ROOTDIR = Path(sys.argv[0]).resolve().parent -class CommandSystem(QDialog, Ui_CommandSystemDialog): +class CommandSystem(QDialog, UiCommandsystemdialog): # # Init the class @@ -50,13 +50,13 @@ def __init__(self): # # Processes 'Display Page' button # - def ProcessButtonGeneric(self, idx): - if cmdPageIsValid[idx]: - pktId = self.tblCmdSys.item(idx, 1).text() - address = self.tblCmdSys.item(idx, 2).text() + def process_button_generic(self, idx): + if cmd_page_is_valid[idx]: + pkt_id = self.tbl_cmd_sys.item(idx, 1).text() + address = self.tbl_cmd_sys.item(idx, 2).text() launch_string = ( f'python3 {ROOTDIR}/{cmdClass[0]} ' - f'--title=\"{cmdPageDesc[idx]}\" --pktid={pktId} ' + f'--title=\"{cmdPageDesc[idx]}\" --pktid={pkt_id} ' f'--file={cmdPageDefFile[idx]} --address=\"{address}\" ' f'--port={cmdPagePort[idx]} --endian={cmdPageEndian[idx]}') cmd_args = shlex.split(launch_string) @@ -66,48 +66,48 @@ def ProcessButtonGeneric(self, idx): # Determines if command requires parameters # @staticmethod - def checkParams(idx): - pickle_file = f'{ROOTDIR}/ParameterFiles/{quickParam[idx]}' + def check_params(idx): + pickle_file = f'{ROOTDIR}/ParameterFiles/{quick_param[idx]}' try: with open(pickle_file, 'rb') as pickle_obj: - paramNames = pickle.load(pickle_obj)[1] - return len(paramNames) > 0 + param_names = pickle.load(pickle_obj)[1] + return len(param_names) > 0 except IOError: return False # # Processes quick button # - def ProcessQuickButton(self, idx): - if cmdPageIsValid[idx] and quickIndices[idx] >= 0: - qIdx = quickIndices[idx] - pktId = self.tblCmdSys.item(idx, 1).text() - address = self.tblCmdSys.item(idx, 2).text() + def process_quick_button(self, idx): + if cmd_page_is_valid[idx] and quick_indices[idx] >= 0: + q_idx = quick_indices[idx] + pkt_id = self.tbl_cmd_sys.item(idx, 1).text() + address = self.tbl_cmd_sys.item(idx, 2).text() # if requires parameters - if self.checkParams(qIdx): + if self.check_params(q_idx): launch_string = ( f'python3 {ROOTDIR}/Parameter.py ' - f'--title=\"{subsys[qIdx]}\" ' - f'--descrip=\"{quickCmd[qIdx]}\" ' + f'--title=\"{subsys[q_idx]}\" ' + f'--descrip=\"{quick_cmd[q_idx]}\" ' f'--idx={idx} --host=\"{address}\" ' - f'--port={quickPort[qIdx]} ' - f'--pktid={pktId} --endian={quickEndian[qIdx]} ' - f'--cmdcode={quickCode[qIdx]} --file={quickParam[qIdx]}') + f'--port={quick_port[q_idx]} ' + f'--pktid={pkt_id} --endian={quick_endian[q_idx]} ' + f'--cmdcode={quick_code[q_idx]} --file={quick_param[q_idx]}') cmd_args = shlex.split(launch_string) subprocess.Popen(cmd_args) # if doesn't require parameters else: - self.mcu = MiniCmdUtil(address, quickPort[qIdx], - quickEndian[qIdx], pktId, - quickCode[qIdx]) - sendSuccess = self.mcu.sendPacket() - print("Command sent successfully:", sendSuccess) + self.mcu = MiniCmdUtil(address, quick_port[q_idx], + quick_endian[q_idx], pkt_id, + quick_code[q_idx]) + send_success = self.mcu.send_packet() + print("Command sent successfully:", send_success) # launch_string = ( # f'{ROOTDIR.parent}/cmdUtil/cmdUtil ' - # f'--host=\"{address}\" --port={quickPort[qIdx]} ' - # f'--pktid={pktId} --endian={quickEndian[qIdx]} ' - # f'--cmdcode={quickCode[qIdx]}') + # f'--host=\"{address}\" --port={quickPort[q_idx]} ' + # f'--pktid={pkt_id} --endian={quickEndian[q_idx]} ' + # f'--cmdcode={quickCode[q_idx]}') def closeEvent(self, event): if self.mcu: @@ -123,29 +123,29 @@ def closeEvent(self, event): # # Set defaults for the arguments # - cmdDefFile = "command-pages.txt" + cmd_def_file = "command-pages.txt" # # Init the QT application and the telemetry dialog class # app = QApplication(sys.argv) - Command = CommandSystem() - tbl = Command.tblCmdSys + command = CommandSystem() + tbl = command.tbl_cmd_sys # # Read in the contents of the telemetry packet definition # - cmdPageIsValid, cmdPageDesc, cmdPageDefFile, cmdPageAppid, \ - cmdPageEndian, cmdClass, cmdPageAddress, cmdPagePort = ([] for _ in range(8)) + cmd_page_is_valid, cmdPageDesc, cmdPageDefFile, cmdPageAppid, \ + cmdPageEndian, cmdClass, cmdPageAddress, cmdPagePort = ([] for _ in range(8)) i = 0 - with open(f"{ROOTDIR}/{cmdDefFile}") as cmdfile: + with open(f"{ROOTDIR}/{cmd_def_file}") as cmdfile: reader = csv.reader(cmdfile, skipinitialspace=True) for cmdRow in reader: try: if not cmdRow[0].startswith('#'): - cmdPageIsValid.append(True) + cmd_page_is_valid.append(True) cmdPageDesc.append(cmdRow[0]) cmdPageDefFile.append(cmdRow[1]) cmdPageAppid.append(int(cmdRow[2], 16)) @@ -155,9 +155,9 @@ def closeEvent(self, event): cmdPagePort.append(int(cmdRow[6])) i += 1 except IndexError as e: - fullErr = repr(e) - errName = fullErr[:fullErr.index('(')] - print(f"{errName}:", e) + full_err = repr(e) + err_name = full_err[:full_err.index('(')] + print(f"{err_name}:", e) print(("This could be due to improper formatting in " "command-pages.txt.\nThis is a common error " "caused by blank lines in command-pages.txt")) @@ -166,62 +166,62 @@ def closeEvent(self, event): # for _ in range(i, 22): cmdPageAppid.append(0) - cmdPageIsValid.append(False) + cmd_page_is_valid.append(False) # # Read in contents of quick button definition file # - quickDefFile = 'quick-buttons.txt' - subsys, subsysFile, quickCmd, quickCode, quickPktId,\ - quickEndian, quickAddress, quickPort, quickParam, \ - quickIndices = ([] for _ in range(10)) + quick_def_file = 'quick-buttons.txt' + subsys, subsys_file, quick_cmd, quick_code, quick_pkt_id, \ + quick_endian, quick_address, quick_port, quick_param, \ + quick_indices = ([] for _ in range(10)) - with open(f'{ROOTDIR}/{quickDefFile}') as subFile: + with open(f'{ROOTDIR}/{quick_def_file}') as subFile: reader = csv.reader(subFile) for fileRow in reader: if not fileRow[0].startswith('#'): subsys.append(fileRow[0]) - subsysFile.append(fileRow[1]) - quickCmd.append(fileRow[2].strip()) - quickCode.append(fileRow[3].strip()) - quickPktId.append(fileRow[4].strip()) - quickEndian.append(fileRow[5].strip()) - quickAddress.append(fileRow[6].strip()) - quickPort.append(fileRow[7].strip()) - quickParam.append(fileRow[8].strip()) + subsys_file.append(fileRow[1]) + quick_cmd.append(fileRow[2].strip()) + quick_code.append(fileRow[3].strip()) + quick_pkt_id.append(fileRow[4].strip()) + quick_endian.append(fileRow[5].strip()) + quick_address.append(fileRow[6].strip()) + quick_port.append(fileRow[7].strip()) + quick_param.append(fileRow[8].strip()) # # fill the data fields on the page # for k, desc in enumerate(cmdPageDesc): - if cmdPageIsValid[k]: + if cmd_page_is_valid[k]: tbl.insertRow(k) for col, text in enumerate( - (desc, hex(cmdPageAppid[k]), cmdPageAddress[k])): - tblItem = QTableWidgetItem(text) - tbl.setItem(k, col, tblItem) - tblBtn = QPushButton("Display Page") - tblBtn.clicked.connect( - lambda _, x=k: Command.ProcessButtonGeneric(x)) - tbl.setCellWidget(k, 3, tblBtn) - quickIdx = -1 + (desc, hex(cmdPageAppid[k]), cmdPageAddress[k])): + tbl_item = QTableWidgetItem(text) + tbl.setItem(k, col, tbl_item) + tbl_btn = QPushButton("Display Page") + tbl_btn.clicked.connect( + lambda _, x=k: command.process_button_generic(x)) + tbl.setCellWidget(k, 3, tbl_btn) + quick_idx = -1 try: - quickIdx = subsys.index(desc) + quick_idx = subsys.index(desc) except ValueError: pass # Ignore quick button else: - quickBtn = QPushButton(quickCmd[quickIdx]) - quickBtn.clicked.connect( - lambda _, x=k: Command.ProcessQuickButton(x)) - tbl.setCellWidget(k, 4, quickBtn) - quickIndices.append(quickIdx) + quick_btn = QPushButton(quick_cmd[quick_idx]) + quick_btn.clicked.connect( + lambda _, x=k: command.process_quick_button(x)) + tbl.setCellWidget(k, 4, quick_btn) + quick_indices.append(quick_idx) tbl.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents) tbl.horizontalHeader().setStretchLastSection(True) # # Display the page # - Command.show() - Command.raise_() + command.show() + command.raise_() print('Command System started.') sys.exit(app.exec_()) diff --git a/Subsystems/cmdGui/CommandSystemDialog.ui b/Subsystems/cmdGui/CommandSystemDialog.ui index 74a0f3d..3e4adac 100644 --- a/Subsystems/cmdGui/CommandSystemDialog.ui +++ b/Subsystems/cmdGui/CommandSystemDialog.ui @@ -13,7 +13,7 @@ Command System Main Page - + 80 @@ -22,9 +22,9 @@ 25 - + - + Qt::Horizontal @@ -44,7 +44,7 @@ - + Qt::Horizontal @@ -58,7 +58,7 @@ - + 80 @@ -67,9 +67,9 @@ 33 - + - + Qt::Horizontal @@ -85,7 +85,7 @@ - + Qt::Horizontal @@ -105,7 +105,7 @@ - + Qt::Horizontal @@ -118,7 +118,7 @@ - + Qt::Vertical @@ -132,7 +132,7 @@ - + 30 @@ -177,7 +177,7 @@ - buttonBox + button_box clicked(QAbstractButton*) CommandSystemDialog close() diff --git a/Subsystems/cmdGui/GenericCommandDialog.ui b/Subsystems/cmdGui/GenericCommandDialog.ui index 42c425a..86a61df 100644 --- a/Subsystems/cmdGui/GenericCommandDialog.ui +++ b/Subsystems/cmdGui/GenericCommandDialog.ui @@ -1,7 +1,7 @@ GenericCommandDialog - + 0 @@ -13,15 +13,15 @@ Command Page - + - + - + - + - + Subsystem @@ -31,7 +31,7 @@ - + 159 @@ -49,9 +49,9 @@ - + - + 0 @@ -76,12 +76,12 @@ - + - + @@ -93,7 +93,7 @@ - + 0 @@ -117,7 +117,7 @@ - + Qt::Horizontal @@ -130,7 +130,7 @@ - + Qt::Horizontal @@ -152,7 +152,7 @@ - + QAbstractItemView::NoEditTriggers @@ -181,7 +181,7 @@ - buttonBox + button_box clicked(QAbstractButton*) GenericCommandDialog close() diff --git a/Subsystems/cmdGui/HTMLDocsParser.py b/Subsystems/cmdGui/HTMLDocsParser.py index f932954..f47965d 100644 --- a/Subsystems/cmdGui/HTMLDocsParser.py +++ b/Subsystems/cmdGui/HTMLDocsParser.py @@ -29,7 +29,7 @@ class HTMLDocsParser(HTMLParser): # Initializes allData variable # def reset(self): - self.allData = [] + self.all_data = [] HTMLParser.reset(self) # @@ -37,22 +37,22 @@ def reset(self): # def handle_data(self, data): if data.strip(): # excludes new lines - self.allData.append(data.strip()) + self.all_data.append(data.strip()) # # Determines UNIX data type of parameter # @staticmethod - def findDataTypeNew(dataTypeOrig, paramLn): - if paramLn: # assumes all string types have length enclosed in brackets + def find_data_type_new(data_type_orig, param_ln): + if param_ln: # assumes all string types have length enclosed in brackets return '--string' - if dataTypeOrig in ('uint8', 'boolean'): + if data_type_orig in ('uint8', 'boolean'): return '--byte' - if dataTypeOrig == 'uint16': + if data_type_orig == 'uint16': return '--half' - if dataTypeOrig == 'uint32': + if data_type_orig == 'uint32': return '--word' - if dataTypeOrig == 'uint64': + if data_type_orig == 'uint64': return '--double' return '' @@ -60,7 +60,7 @@ def findDataTypeNew(dataTypeOrig, paramLn): # Determines character array size for string types # @staticmethod - def findStringLen(kywd): + def find_string_len(kywd): hdr_files = glob.glob('../../../build/cpu1/inc/*.h') hdr_files += glob.glob('../../fsw/cfe-core/src/inc/cfe_*.h') hdr_files += glob.glob('../../fsw/mission_inc/cfe_mission_cfg.h') @@ -98,74 +98,74 @@ def findStringLen(kywd): with open(html_file) as file_obj: # opens HTML file reader = file_obj.read() # reads HTML file parser.feed(reader) # feeds file contents to parser - allData = parser.allData + all_data = parser.all_data - dataTypesOrig = [] # uint8, uint16, uint32, char, boolean - paramNames = [] # parameter name - paramLen = [] # original parameter length - paramDesc = [] # parameter description - dataTypesNew = [] # --string, --byte, --half, --word, --double - stringLen = [] # evaluated parameter length + data_types_orig = [] # uint8, uint16, uint32, char, boolean + param_names = [] # parameter name + param_len = [] # original parameter length + param_desc = [] # parameter description + data_types_new = [] # --string, --byte, --half, --word, --double + string_len = [] # evaluated parameter length try: - i = allData.index("Data Fields") + 1 - j = allData.index("Detailed Description") + i = all_data.index("Data Fields") + 1 + j = all_data.index("Detailed Description") # iterates through lines between Data Fields and Detailed Description while i < j: # skips header parameters - if any([x in allData[i + 1] for x in ('Header', 'Hdr')]): + if any([x in all_data[i + 1] for x in ('Header', 'Hdr')]): # if 'Header' in data[i + 1] or 'Hdr' in data[i + 1]: i += 1 while not any( - [x in allData[i] + [x in all_data[i] for x in ('uint', 'char')]) and i < j: # while 'uint' not in data[i] and 'char' not in data[ # i] and i < j: i += 1 else: - dataTypesOrig.append(allData[i]) # stores data type + data_types_orig.append(all_data[i]) # stores data type i += 1 - paramNames.append(allData[i]) # stores parameter name + param_names.append(all_data[i]) # stores parameter name i += 1 param_len = '' - if '[' in allData[i]: - param_len = allData[ + if '[' in all_data[i]: + param_len = all_data[ i] # stores string length if provided i += 1 - paramLen.append(param_len) + param_len.append(param_len) desc_string = '' - while not any([x in allData[i] for x in ('uint', 'char')]) and i < j: - desc_string = f'{desc_string} {allData[i]}' + while not any([x in all_data[i] for x in ('uint', 'char')]) and i < j: + desc_string = f'{desc_string} {all_data[i]}' i += 1 - paramDesc.append(desc_string.lstrip() - ) # stores parameter description + param_desc.append(desc_string.lstrip() + ) # stores parameter description # determines new data type of parameter - dataTypeNew = parser.findDataTypeNew( - dataTypesOrig[-1], paramLen[-1]) - dataTypesNew.append(dataTypeNew) + data_type_new = parser.find_data_type_new( + data_types_orig[-1], param_len[-1]) + data_types_new.append(data_type_new) # finds size of character array if type --string keyword = '' - if dataTypeNew == '--string': + if data_type_new == '--string': keyword = re.sub(r'\[|\]|\(|\)', '', - paramLen[-1]) # removes brackets + param_len[-1]) # removes brackets while not keyword.isdigit(): - keyword = parser.findStringLen(keyword) + keyword = parser.find_string_len(keyword) keyword = re.sub(r'\[|\]|\(|\)', '', keyword) if keyword == '0': keyword = input( - f'{paramLen[-1]} not found. Please enter value manually: ' + f'{param_len[-1]} not found. Please enter value manually: ' ) - stringLen.append(keyword) + string_len.append(keyword) - print("DATA TYPES:", dataTypesOrig) - print("PARAM NAMES: ", paramNames) - print("PARAM STRING LEN:", paramLen) - print("PARAM DESC: ", paramDesc) - print("UNIX DATA TYPES:", dataTypesNew) - print("STRING LENGTH:", stringLen, "\n") + print("DATA TYPES:", data_types_orig) + print("PARAM NAMES: ", param_names) + print("PARAM STRING LEN:", param_len) + print("PARAM DESC: ", param_desc) + print("UNIX DATA TYPES:", data_types_new) + print("STRING LENGTH:", string_len, "\n") except ValueError: print("Data Fields not found in HTML file") @@ -175,9 +175,9 @@ def findStringLen(kywd): pickle_file = 'ParameterFiles/' + file_split[-2] with open(pickle_file, 'wb') as pickle_obj: pickle.dump([ - dataTypesOrig, paramNames, paramLen, paramDesc, - dataTypesNew, stringLen + data_types_orig, param_names, param_len, param_desc, + data_types_new, string_len ], pickle_obj) # resets data list for next HTML file - parser.allData = [] + parser.all_data = [] diff --git a/Subsystems/cmdGui/MiniCmdUtil.py b/Subsystems/cmdGui/MiniCmdUtil.py index 360b82c..52f5187 100644 --- a/Subsystems/cmdGui/MiniCmdUtil.py +++ b/Subsystems/cmdGui/MiniCmdUtil.py @@ -27,127 +27,127 @@ class MiniCmdUtil: - ## Class objects + # Class objects sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - TypeSignature = namedtuple("TypeSignature", 'byteLen, signed, endian') + type_signature = namedtuple("TypeSignature", 'byteLen, signed, endian') dataTypes = { - ("b", "int8", "byte"): TypeSignature(1, True, None), - ("m", "uint8"): TypeSignature(1, False, None), - ("h", "int16", "half"): TypeSignature(2, True, None), - ("n", "uint16"): TypeSignature(2, False, None), - ("l", "int32", "long", "word"): TypeSignature(4, True, None), - ("o", "uint32"): TypeSignature(4, False, None), - ("q", "int64"): TypeSignature(8, True, None), - ("p", "uint64"): TypeSignature(8, False, None), - ("i", "int16b"): TypeSignature(2, True, "big"), - ("j", "int32b"): TypeSignature(4, True, "big"), - ("k", "int64b"): TypeSignature(8, True, "big"), - ("w", "uint16b"): TypeSignature(2, False, "big"), - ("x", "uint32b"): TypeSignature(4, False, "big"), - ("y", "uint64b"): TypeSignature(8, False, "big") + ("b", "int8", "byte"): type_signature(1, True, None), + ("m", "uint8"): type_signature(1, False, None), + ("h", "int16", "half"): type_signature(2, True, None), + ("n", "uint16"): type_signature(2, False, None), + ("l", "int32", "long", "word"): type_signature(4, True, None), + ("o", "uint32"): type_signature(4, False, None), + ("q", "int64"): type_signature(8, True, None), + ("p", "uint64"): type_signature(8, False, None), + ("i", "int16b"): type_signature(2, True, "big"), + ("j", "int32b"): type_signature(4, True, "big"), + ("k", "int64b"): type_signature(8, True, "big"), + ("w", "uint16b"): type_signature(2, False, "big"), + ("x", "uint32b"): type_signature(4, False, "big"), + ("y", "uint64b"): type_signature(8, False, "big") } def __init__(self, host="127.0.0.1", port=1234, endian="BE", - pktID=0, - cmdCode=0, + pkt_id=0, + cmd_code=0, parameters=None): self.host = host self.port = int(port) self.endian = "big" if endian == "BE" else "little" - self.pktID = int(pktID, 16) - self.cmdCode = int(cmdCode) + self.pkt_id = int(pkt_id, 16) + self.cmd_code = int(cmd_code) self.parameters = parameters self.payload = bytearray() self.packet = bytearray() with open("/tmp/OffsetData", "r+b") as f: self.mm = mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ) - self.cmdOffsetPri = 0 - self.cmdOffsetSec = 0 + self.cmd_offset_pri = 0 + self.cmd_offset_sec = 0 self.checksum = 0xFF - self.cfsCmdSecHdr = bytearray(2) + self.cfs_cmd_sec_hdr = bytearray(2) - def assemblePriHeader(self): - ccsdsPri = bytearray(6) - ccsdsPri[:2] = self.pktID.to_bytes(2, byteorder='big') - ccsdsPri[2:4] = (0xC000).to_bytes(2, byteorder='big') - totalPacketLen = len(ccsdsPri) + len(self.cfsCmdSecHdr) - self.assemblePayload() - totalPacketLen += len(self.payload) - totalPacketLen += self.cmdOffsetPri + self.cmdOffsetSec - ccsdsPri[4:] = (totalPacketLen - 7).to_bytes(2, byteorder="big") - return ccsdsPri + def assemble_pri_header(self): + ccsds_pri = bytearray(6) + ccsds_pri[:2] = self.pkt_id.to_bytes(2, byteorder='big') + ccsds_pri[2:4] = (0xC000).to_bytes(2, byteorder='big') + total_packet_len = len(ccsds_pri) + len(self.cfs_cmd_sec_hdr) + self.assemble_payload() + total_packet_len += len(self.payload) + total_packet_len += self.cmd_offset_pri + self.cmd_offset_sec + ccsds_pri[4:] = (total_packet_len - 7).to_bytes(2, byteorder="big") + return ccsds_pri - def assemblePayload(self): + def assemble_payload(self): if self.parameters: - paramList = self.parameters.split(" ") - for param in paramList: - items = param.split("=") ## e.g. ["--uint16", "2"] - if "--string" not in param: ## non-string param - dataType = items[0].strip("-") ## Remove "--" prefix - dataVal = int(items[1]) - for key in self.dataTypes: ## Loop thru dictionary keys - if dataType in key: ## Check if e.g. "uint16" in key tuple - ## Get the TypeSignature tuple - typeSig = self.dataTypes[key] - break ## Stop checking dictionary - ## If TypeSignature endian is None, get the - ## user-provided/default endian. Otherwise get - ## the TypeSignature endian - endian = typeSig.endian or self.endian - ## Convert to bytes of correct length, endianess, and sign - dataValB = dataVal.to_bytes(typeSig.byteLen, - byteorder=endian, - signed=typeSig.signed) - ## Add data to payload bytearray - self.payload.extend(dataValB) + param_list = self.parameters.split(" ") + for param in param_list: + items = param.split("=") # e.g. ["--uint16", "2"] + if "--string" not in param: # non-string param + data_type = items[0].strip("-") # Remove "--" prefix + data_val = int(items[1]) + for key in self.dataTypes: # Loop thru dictionary keys + if data_type in key: # Check if e.g. "uint16" in key tuple + # Get the TypeSignature tuple + type_sig = self.dataTypes[key] + break # Stop checking dictionary + # If TypeSignature endian is None, get the + # user-provided/default endian. Otherwise get + # the TypeSignature endian + endian = type_sig.endian or self.endian + # Convert to bytes of correct length, endianess, and sign + data_val_b = data_val.to_bytes(type_sig.byteLen, + byteorder=endian, + signed=type_sig.signed) + # Add data to payload bytearray + self.payload.extend(data_val_b) else: - stringParams = items[1].strip("\"").split( - ":") ## e.g. ["16", "ES_APP"] - ## Zero init'd bytearray of length e.g. 16 - fixedLenStr = bytearray(int(stringParams[0])) - stringB = stringParams[1].encode( - ) ## Param string to bytes - ## Insert param bytes into front of bytearray - fixedLenStr[:len(stringB)] = stringB - ## Add data to payload bytearray - self.payload.extend(fixedLenStr) + string_params = items[1].strip("\"").split( + ":") # e.g. ["16", "ES_APP"] + # Zero init'd bytearray of length e.g. 16 + fixed_len_str = bytearray(int(string_params[0])) + string_b = string_params[1].encode( + ) # Param string to bytes + # Insert param bytes into front of bytearray + fixed_len_str[:len(string_b)] = string_b + # Add data to payload bytearray + self.payload.extend(fixed_len_str) - def assemblePacket(self): - self._getOffsets() - priHeader = self.assemblePriHeader() - self.packet.extend(priHeader) - priOffset = bytearray(self.cmdOffsetPri) - self.packet.extend(priOffset) - self.cfsCmdSecHdr[0] = self.cmdCode - secOffset = bytearray(self.cmdOffsetSec) - for b in b''.join((priHeader, priOffset, self.cfsCmdSecHdr, secOffset, + def assemble_packet(self): + self._get_offsets() + pri_header = self.assemble_pri_header() + self.packet.extend(pri_header) + pri_offset = bytearray(self.cmd_offset_pri) + self.packet.extend(pri_offset) + self.cfs_cmd_sec_hdr[0] = self.cmd_code + sec_offset = bytearray(self.cmd_offset_sec) + for b in b''.join((pri_header, pri_offset, self.cfs_cmd_sec_hdr, sec_offset, self.payload)): self.checksum ^= b - self.cfsCmdSecHdr[1] = self.checksum - self.packet.extend(self.cfsCmdSecHdr) - self.packet.extend(secOffset) + self.cfs_cmd_sec_hdr[1] = self.checksum + self.packet.extend(self.cfs_cmd_sec_hdr) + self.packet.extend(sec_offset) self.packet.extend(self.payload) self.checksum = 0xFF - def sendPacket(self): - self.assemblePacket() + def send_packet(self): + self.assemble_packet() print("Data to send:") for i, v in enumerate(self.packet): print(f"0x{format(v, '02X')}", end=" ") if (i + 1) % 8 == 0: print() print() - bytesSent = self.sock.sendto(self.packet, (self.host, self.port)) - return bytesSent > 0 + bytes_sent = self.sock.sendto(self.packet, (self.host, self.port)) + return bytes_sent > 0 - def _getOffsets(self): + def _get_offsets(self): try: - self.cmdOffsetPri = self.mm[1] - self.cmdOffsetSec = self.mm[2] + self.cmd_offset_pri = self.mm[1] + self.cmd_offset_sec = self.mm[2] except ValueError: pass diff --git a/Subsystems/cmdGui/Parameter.py b/Subsystems/cmdGui/Parameter.py index 1486765..1b73b02 100644 --- a/Subsystems/cmdGui/Parameter.py +++ b/Subsystems/cmdGui/Parameter.py @@ -29,12 +29,12 @@ from HTMLDocsParser import HTMLDocsParser from MiniCmdUtil import MiniCmdUtil -from Ui_ParameterDialog import Ui_Dialog +from UiParameterDialog import UiDialog ROOTDIR = Path(sys.argv[0]).resolve().parent -class Parameter(QDialog, Ui_Dialog): +class Parameter(QDialog, UiDialog): # # Initializes Parameter class # @@ -43,7 +43,7 @@ def __init__(self): self.setupUi(self) self.parser = HTMLDocsParser() self.setWindowTitle("Parameter Dialog") - self.SendButton_1.clicked.connect(self.ProcessSendButton) + self.send_button_1.clicked.connect(self.ProcessSendButton) self.mcu = None # @@ -51,7 +51,7 @@ def __init__(self): # def ProcessSendButton(self): input_list = [] - for j in range(self.tblParameters.rowCount()): + for j in range(self.tbl_parameters.rowCount()): item = tbl.item(j, 2) input_list.append(item.text().strip()) @@ -65,7 +65,7 @@ def ProcessSendButton(self): param_string = ' '.join(param_list) self.mcu = MiniCmdUtil(pageAddress, pagePort, pageEndian, pagePktId, cmdCode, param_string.strip()) - sendSuccess = self.mcu.sendPacket() + sendSuccess = self.mcu.send_packet() if sendSuccess: self.status_box.setText('Command sent!') else: @@ -122,7 +122,7 @@ def closeEvent(self, event): # app = QApplication(sys.argv) # creates instance of QtApplication class param = Parameter() # creates instance of Parameter class - tbl = param.tblParameters + tbl = param.tbl_parameters # # Gets parameter information from pickle files @@ -135,8 +135,8 @@ def closeEvent(self, event): # # Sets text in GUI # - param.subSystemTextBrowser.setText(subsysTitle) # subsystem name - param.commandAddressTextBrowser.setText( + param.sub_system_text_browser.setText(subsysTitle) # subsystem name + param.command_address_text_browser.setText( f'{cmdDesc} Command') # command name for i, name in enumerate(paramNames): diff --git a/Subsystems/cmdGui/ParameterDialog.ui b/Subsystems/cmdGui/ParameterDialog.ui index b89c55d..72f0ca6 100644 --- a/Subsystems/cmdGui/ParameterDialog.ui +++ b/Subsystems/cmdGui/ParameterDialog.ui @@ -1,7 +1,7 @@ Dialog - + true @@ -54,7 +54,7 @@ Qt::AlignCenter - + 670 @@ -102,7 +102,7 @@ Status: - + 690 @@ -134,7 +134,7 @@ Command: - + 30 @@ -147,7 +147,7 @@ Subsystem: - + 30 @@ -157,7 +157,7 @@ - + 260 @@ -167,7 +167,7 @@ - + 20 @@ -198,16 +198,16 @@ status_box - SendButton_1 - subSystemTextBrowser - commandAddressTextBrowser + send_button_1 + sub_system_text_browser + command_address_text_browser - buttonBox + button_box clicked(QAbstractButton*) - Dialog + dialog close() diff --git a/Subsystems/cmdGui/UdpCommands.py b/Subsystems/cmdGui/UdpCommands.py index c1e18b6..f448a64 100644 --- a/Subsystems/cmdGui/UdpCommands.py +++ b/Subsystems/cmdGui/UdpCommands.py @@ -17,7 +17,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -#!/usr/bin/env python3 +# !/usr/bin/env python3 # # UdpCommands.py -- This is a class that creates a simple command dialog and # sends commands using the cmdUtil UDP C program. @@ -43,58 +43,59 @@ QTableWidgetItem) from MiniCmdUtil import MiniCmdUtil -from Ui_GenericCommandDialog import Ui_GenericCommandDialog +from UiGenericcommanddialog import UiGenericcommanddialog -## ../cFS/tools/cFS-GroundSystem/Subsystems/cmdGui/ +# ../cFS/tools/cFS-GroundSystem/Subsystems/cmdGui/ ROOTDIR = Path(sys.argv[0]).resolve().parent -class SubsystemCommands(QDialog, Ui_GenericCommandDialog): + +class SubsystemCommands(QDialog, UiGenericcommanddialog): # # Init the class # def __init__(self): super().__init__() self.setupUi(self) - self.setWindowTitle(pageTitle) + self.setWindowTitle(page_title) self.mcu = None # # Determines if command requires parameters # @staticmethod - def checkParams(idx): + def check_params(idx): pf = f'{ROOTDIR}/ParameterFiles/{param_files[idx]}' try: with open(pf, 'rb') as po: - paramNames = pickle.load(po)[1] - return len(paramNames) > 0 # if has parameters + param_names = pickle.load(po)[1] + return len(param_names) > 0 # if has parameters except IOError: return False # # Generic button press method # - def ProcessSendButtonGeneric(self, idx): - if cmdItemIsValid[idx]: - param_bool = self.checkParams(idx) - address = self.commandAddressLineEdit.text() + def process_send_button_generic(self, idx): + if cmd_item_is_valid[idx]: + param_bool = self.check_params(idx) + address = self.command_address_line_edit.text() # If parameters are required, launches Parameters page if param_bool: launch_string = ( - f'python3 {ROOTDIR}/Parameter.py --title=\"{pageTitle}\" ' - f'--descrip=\"{cmdDesc[idx]}\" --idx={idx} ' - f'--host=\"{address}\" --port={pagePort} ' - f'--pktid={pagePktId} --endian={pageEndian} ' - f'--cmdcode={cmdCodes[idx]} --file={param_files[idx]}') + f'python3 {ROOTDIR}/Parameter.py --title=\"{page_title}\" ' + f'--descrip=\"{cmd_desc[idx]}\" --idx={idx} ' + f'--host=\"{address}\" --port={page_port} ' + f'--pktid={page_pkt_id} --endian={page_endian} ' + f'--cmdcode={cmd_codes[idx]} --file={param_files[idx]}') cmd_args = shlex.split(launch_string) subprocess.Popen(cmd_args) # If parameters not required, directly calls cmdUtil to send command else: - self.mcu = MiniCmdUtil(address, pagePort, pageEndian, - pagePktId, cmdCodes[idx]) - sendSuccess = self.mcu.sendPacket() - print("Command sent successfully:", sendSuccess) + self.mcu = MiniCmdUtil(address, page_port, page_endian, + page_pkt_id, cmd_codes[idx]) + send_success = self.mcu.send_packet() + print("Command sent successfully:", send_success) # launch_string = ( # f'{ROOTDIR.parent}/cmdUtil/cmdUtil --host=\"{address}\" ' # f'--port={pagePort} --pktid={pagePktId} ' @@ -125,12 +126,12 @@ def usage(): # # Set defaults for the arguments # - pageTitle = "Command Page" - pagePort = 1234 - pageAddress = "127.0.0.1" - pagePktId = 1801 - pageEndian = "LE" - pageDefFile = "cfe__es__msg_8h" + page_title = "Command Page" + page_port = 1234 + page_address = "127.0.0.1" + page_pkt_id = 1801 + page_endian = "LE" + page_def_file = "cfe__es__msg_8h" # # process cmd line args @@ -148,51 +149,51 @@ def usage(): usage() sys.exit() elif opt in ("-t", "--title"): - pageTitle = arg + page_title = arg elif opt in ("-f", "--file"): - pageDefFile = arg + page_def_file = arg elif opt in ("-p", "--pktid"): - pagePktId = arg + page_pkt_id = arg elif opt in ("-e", "--endian"): - pageEndian = arg + page_endian = arg elif opt in ("-a", "--address"): - pageAddress = arg + page_address = arg elif opt in ("-p", "--port"): - pagePort = arg + page_port = arg # # Init the QT application and the command class # app = QApplication(sys.argv) - Commands = SubsystemCommands() - Commands.subSystemLineEdit.setText(pageTitle) - Commands.packetId.display(pagePktId) - Commands.commandAddressLineEdit.setText(pageAddress) - tbl = Commands.tblCommands + commands = SubsystemCommands() + commands.sub_system_line_edit.setText(page_title) + commands.packet_id.display(page_pkt_id) + commands.command_address_line_edit.setText(page_address) + tbl = commands.tbl_commands # # Reads commands from command definition file # - pickle_file = f'{ROOTDIR}/CommandFiles/{pageDefFile}' + pickle_file = f'{ROOTDIR}/CommandFiles/{page_def_file}' with open(pickle_file, 'rb') as pickle_obj: - cmdDesc, cmdCodes, param_files = pickle.load(pickle_obj) + cmd_desc, cmd_codes, param_files = pickle.load(pickle_obj) - cmdItemIsValid = [] - for i in range(len(cmdDesc)): - cmdItemIsValid.append(True) + cmd_item_is_valid = [] + for i in range(len(cmd_desc)): + cmd_item_is_valid.append(True) # # Fill the data fields on the page # - for i, cmd in enumerate(cmdDesc): - if cmdItemIsValid[i]: + for i, cmd in enumerate(cmd_desc): + if cmd_item_is_valid[i]: tbl.insertRow(i) - tblItem = QTableWidgetItem(cmdDesc[i]) - tbl.setItem(i, 0, tblItem) - tblBtn = QPushButton("Send") - tblBtn.clicked.connect( - lambda _, x=i: Commands.ProcessSendButtonGeneric(x)) - tbl.setCellWidget(i, 1, tblBtn) + tbl_item = QTableWidgetItem(cmd_desc[i]) + tbl.setItem(i, 0, tbl_item) + tbl_btn = QPushButton("Send") + tbl_btn.clicked.connect( + lambda _, x=i: commands.process_send_button_generic(x)) + tbl.setCellWidget(i, 1, tbl_btn) tbl.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents) tbl.horizontalHeader().setStretchLastSection(True) # tbl.verticalHeader().setSectionResizeMode(QHeaderView.Stretch) @@ -200,6 +201,6 @@ def usage(): # # Display the page # - Commands.show() - Commands.raise_() + commands.show() + commands.raise_() sys.exit(app.exec_()) diff --git a/Subsystems/cmdGui/UiCommandsystemdialog.py b/Subsystems/cmdGui/UiCommandsystemdialog.py new file mode 100644 index 0000000..511e094 --- /dev/null +++ b/Subsystems/cmdGui/UiCommandsystemdialog.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/cmdGui/CommandSystemDialog.ui' +# +# Created by: PyQt5 UI code generator 5.10.1 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class UiCommandsystemdialog(object): + def setupUi(self, command_system_dialog): + command_system_dialog.setObjectName("CommandSystemDialog") + command_system_dialog.resize(772, 1020) + self.layout_widget_2 = QtWidgets.QWidget(command_system_dialog) + self.layout_widget_2.setGeometry(QtCore.QRect(80, 20, 621, 25)) + self.layout_widget_2.setObjectName("layoutWidget_2") + self.horizontal_layout = QtWidgets.QHBoxLayout(self.layout_widget_2) + self.horizontal_layout.setContentsMargins(0, 0, 0, 0) + self.horizontal_layout.setObjectName("horizontalLayout") + spacer_item = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout.addItem(spacer_item) + self.label = QtWidgets.QLabel(self.layout_widget_2) + self.label.setObjectName("label") + self.horizontal_layout.addWidget(self.label) + spacer_item1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout.addItem(spacer_item1) + self.layout_widget_3 = QtWidgets.QWidget(command_system_dialog) + self.layout_widget_3.setGeometry(QtCore.QRect(80, 60, 621, 33)) + self.layout_widget_3.setObjectName("layoutWidget_3") + self.horizontal_layout_2 = QtWidgets.QHBoxLayout(self.layout_widget_3) + self.horizontal_layout_2.setContentsMargins(0, 0, 0, 0) + self.horizontal_layout_2.setObjectName("horizontalLayout_2") + spacer_item2 = QtWidgets.QSpacerItem(90, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout_2.addItem(spacer_item2) + spacer_item3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout_2.addItem(spacer_item3) + self.label_2 = QtWidgets.QLabel(self.layout_widget_3) + self.label_2.setObjectName("label_2") + self.horizontal_layout_2.addWidget(self.label_2) + spacer_item4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout_2.addItem(spacer_item4) + self.button_box = QtWidgets.QDialogButtonBox(self.layout_widget_3) + self.button_box.setOrientation(QtCore.Qt.Vertical) + self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Close) + self.button_box.setCenterButtons(True) + self.button_box.setObjectName("buttonBox") + self.horizontal_layout_2.addWidget(self.button_box) + self.tbl_cmd_sys = QtWidgets.QTableWidget(command_system_dialog) + self.tbl_cmd_sys.setGeometry(QtCore.QRect(30, 120, 701, 721)) + self.tbl_cmd_sys.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) + self.tbl_cmd_sys.setObjectName("tblCmdSys") + self.tbl_cmd_sys.setColumnCount(5) + self.tbl_cmd_sys.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + self.tbl_cmd_sys.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.tbl_cmd_sys.setHorizontalHeaderItem(1, item) + item = QtWidgets.QTableWidgetItem() + self.tbl_cmd_sys.setHorizontalHeaderItem(2, item) + item = QtWidgets.QTableWidgetItem() + self.tbl_cmd_sys.setHorizontalHeaderItem(3, item) + item = QtWidgets.QTableWidgetItem() + self.tbl_cmd_sys.setHorizontalHeaderItem(4, item) + self.tbl_cmd_sys.verticalHeader().setVisible(False) + + self.retranslate_ui(command_system_dialog) + self.button_box.clicked['QAbstractButton*'].connect(command_system_dialog.close) + QtCore.QMetaObject.connectSlotsByName(command_system_dialog) + + def retranslate_ui(self, command_system_dialog): + _translate = QtCore.QCoreApplication.translate + command_system_dialog.setWindowTitle(_translate("CommandSystemDialog", "Command System Main Page")) + self.label.setText(_translate("CommandSystemDialog", "cFE/CFS Subsystem Commands")) + self.label_2.setText(_translate("CommandSystemDialog", "Available Pages")) + item = self.tbl_cmd_sys.horizontalHeaderItem(0) + item.setText(_translate("CommandSystemDialog", "Subsystem/Page")) + item = self.tbl_cmd_sys.horizontalHeaderItem(1) + item.setText(_translate("CommandSystemDialog", "Packet ID")) + item = self.tbl_cmd_sys.horizontalHeaderItem(2) + item.setText(_translate("CommandSystemDialog", "Send To")) diff --git a/Subsystems/cmdGui/UiGenericcommanddialog.py b/Subsystems/cmdGui/UiGenericcommanddialog.py new file mode 100644 index 0000000..0ad1cd8 --- /dev/null +++ b/Subsystems/cmdGui/UiGenericcommanddialog.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file +# '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/cmdGui/GenericCommandDialog.ui' +# +# Created by: PyQt5 UI code generator 5.10.1 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class UiGenericcommanddialog(object): + def setupUi(self, generic_command_dialog): + generic_command_dialog.setObjectName("GenericCommandDialog") + generic_command_dialog.resize(549, 1058) + self.vertical_layout_6 = QtWidgets.QVBoxLayout(generic_command_dialog) + self.vertical_layout_6.setObjectName("verticalLayout_6") + self.vertical_layout_4 = QtWidgets.QVBoxLayout() + self.vertical_layout_4.setObjectName("verticalLayout_4") + self.horizontal_layout = QtWidgets.QHBoxLayout() + self.horizontal_layout.setObjectName("horizontalLayout") + self.vertical_layout = QtWidgets.QVBoxLayout() + self.vertical_layout.setObjectName("verticalLayout") + self.sub_system_command_page_label = QtWidgets.QLabel(generic_command_dialog) + self.sub_system_command_page_label.setAlignment(QtCore.Qt.AlignCenter) + self.sub_system_command_page_label.setObjectName("subSystemCommandPageLabel") + self.vertical_layout.addWidget(self.sub_system_command_page_label) + self.sub_system_line_edit = QtWidgets.QLineEdit(generic_command_dialog) + self.sub_system_line_edit.setMinimumSize(QtCore.QSize(159, 31)) + self.sub_system_line_edit.setMaximumSize(QtCore.QSize(300, 31)) + self.sub_system_line_edit.setObjectName("subSystemLineEdit") + self.vertical_layout.addWidget(self.sub_system_line_edit) + self.horizontal_layout.addLayout(self.vertical_layout) + self.vertical_layout_2 = QtWidgets.QVBoxLayout() + self.vertical_layout_2.setObjectName("verticalLayout_2") + self.packet_id_label = QtWidgets.QLabel(generic_command_dialog) + size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) + size_policy.setHorizontalStretch(0) + size_policy.setVerticalStretch(0) + size_policy.setHeightForWidth(self.packet_id_label.sizePolicy().hasHeightForWidth()) + self.packet_id_label.setSizePolicy(size_policy) + self.packet_id_label.setMinimumSize(QtCore.QSize(0, 13)) + self.packet_id_label.setMaximumSize(QtCore.QSize(16777193, 13)) + self.packet_id_label.setObjectName("packetIdLabel") + self.vertical_layout_2.addWidget(self.packet_id_label) + self.packet_id = QtWidgets.QLCDNumber(generic_command_dialog) + self.packet_id.setObjectName("packetId") + self.vertical_layout_2.addWidget(self.packet_id) + self.horizontal_layout.addLayout(self.vertical_layout_2) + self.vertical_layout_3 = QtWidgets.QVBoxLayout() + self.vertical_layout_3.setObjectName("verticalLayout_3") + self.label_5 = QtWidgets.QLabel(generic_command_dialog) + self.label_5.setAlignment(QtCore.Qt.AlignCenter) + self.label_5.setObjectName("label_5") + self.vertical_layout_3.addWidget(self.label_5) + self.command_address_line_edit = QtWidgets.QLineEdit(generic_command_dialog) + size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + size_policy.setHorizontalStretch(0) + size_policy.setVerticalStretch(0) + size_policy.setHeightForWidth(self.command_address_line_edit.sizePolicy().hasHeightForWidth()) + self.command_address_line_edit.setSizePolicy(size_policy) + self.command_address_line_edit.setMinimumSize(QtCore.QSize(135, 31)) + self.command_address_line_edit.setMaximumSize(QtCore.QSize(135, 31)) + self.command_address_line_edit.setObjectName("commandAddressLineEdit") + self.vertical_layout_3.addWidget(self.command_address_line_edit) + self.horizontal_layout.addLayout(self.vertical_layout_3) + spacer_item = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout.addItem(spacer_item) + self.button_box = QtWidgets.QDialogButtonBox(generic_command_dialog) + self.button_box.setOrientation(QtCore.Qt.Horizontal) + self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Close) + self.button_box.setObjectName("buttonBox") + self.horizontal_layout.addWidget(self.button_box) + self.vertical_layout_4.addLayout(self.horizontal_layout) + self.label = QtWidgets.QLabel(generic_command_dialog) + self.label.setAlignment(QtCore.Qt.AlignCenter) + self.label.setObjectName("label") + self.vertical_layout_4.addWidget(self.label) + self.tbl_commands = QtWidgets.QTableWidget(generic_command_dialog) + self.tbl_commands.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) + self.tbl_commands.setObjectName("tblCommands") + self.tbl_commands.setColumnCount(2) + self.tbl_commands.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + self.tbl_commands.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.tbl_commands.setHorizontalHeaderItem(1, item) + self.tbl_commands.verticalHeader().setVisible(False) + self.tbl_commands.verticalHeader().setMinimumSectionSize(40) + self.vertical_layout_4.addWidget(self.tbl_commands) + self.vertical_layout_6.addLayout(self.vertical_layout_4) + + self.retranslate_ui(generic_command_dialog) + self.button_box.clicked['QAbstractButton*'].connect(generic_command_dialog.close) + QtCore.QMetaObject.connectSlotsByName(generic_command_dialog) + + def retranslate_ui(self, generic_command_dialog): + _translate = QtCore.QCoreApplication.translate + generic_command_dialog.setWindowTitle(_translate("GenericCommandDialog", "Command Page")) + self.sub_system_command_page_label.setText(_translate("GenericCommandDialog", "Subsystem")) + self.packet_id_label.setText(_translate("GenericCommandDialog", "Packet ID")) + self.label_5.setText(_translate("GenericCommandDialog", "Send To:")) + self.label.setText(_translate("GenericCommandDialog", "Command")) + item = self.tbl_commands.horizontalHeaderItem(0) + item.setText(_translate("GenericCommandDialog", "Command")) diff --git a/Subsystems/cmdGui/UiParameterDialog.py b/Subsystems/cmdGui/UiParameterDialog.py new file mode 100644 index 0000000..152cab7 --- /dev/null +++ b/Subsystems/cmdGui/UiParameterDialog.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/cmdGui/ParameterDialog.ui' +# +# Created by: PyQt5 UI code generator 5.10.1 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class UiDialog(object): + def setupUi(self, dialog): + dialog.setObjectName("Dialog") + dialog.setEnabled(True) + dialog.resize(782, 550) + self.label_title = QtWidgets.QLabel(dialog) + self.label_title.setGeometry(QtCore.QRect(330, 120, 91, 31)) + font = QtGui.QFont() + font.setFamily("Sans Serif") + font.setPointSize(10) + self.label_title.setFont(font) + self.label_title.setAlignment(QtCore.Qt.AlignCenter) + self.label_title.setObjectName("label_title") + self.label_instructions = QtWidgets.QLabel(dialog) + self.label_instructions.setGeometry(QtCore.QRect(120, 140, 551, 31)) + self.label_instructions.setAlignment(QtCore.Qt.AlignCenter) + self.label_instructions.setObjectName("label_instructions") + self.button_box = QtWidgets.QDialogButtonBox(dialog) + self.button_box.setGeometry(QtCore.QRect(670, 490, 101, 31)) + self.button_box.setLayoutDirection(QtCore.Qt.LeftToRight) + self.button_box.setOrientation(QtCore.Qt.Horizontal) + self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Close) + self.button_box.setCenterButtons(True) + self.button_box.setObjectName("buttonBox") + self.status_box = QtWidgets.QTextBrowser(dialog) + self.status_box.setGeometry(QtCore.QRect(480, 40, 201, 41)) + self.status_box.setAutoFillBackground(False) + self.status_box.setObjectName("status_box") + self.label_param_title_2 = QtWidgets.QLabel(dialog) + self.label_param_title_2.setGeometry(QtCore.QRect(480, 10, 61, 21)) + self.label_param_title_2.setObjectName("label_param_title_2") + self.send_button_1 = QtWidgets.QPushButton(dialog) + self.send_button_1.setGeometry(QtCore.QRect(690, 47, 71, 27)) + self.send_button_1.setAutoDefault(False) + self.send_button_1.setDefault(True) + self.send_button_1.setObjectName("SendButton_1") + self.label_5 = QtWidgets.QLabel(dialog) + self.label_5.setGeometry(QtCore.QRect(260, 10, 81, 20)) + self.label_5.setObjectName("label_5") + self.sub_system_command_page_label = QtWidgets.QLabel(dialog) + self.sub_system_command_page_label.setGeometry(QtCore.QRect(30, 10, 91, 24)) + self.sub_system_command_page_label.setObjectName("subSystemCommandPageLabel") + self.sub_system_text_browser = QtWidgets.QTextBrowser(dialog) + self.sub_system_text_browser.setGeometry(QtCore.QRect(30, 40, 221, 41)) + self.sub_system_text_browser.setObjectName("subSystemTextBrowser") + self.command_address_text_browser = QtWidgets.QTextBrowser(dialog) + self.command_address_text_browser.setGeometry(QtCore.QRect(260, 40, 211, 41)) + self.command_address_text_browser.setObjectName("commandAddressTextBrowser") + self.tbl_parameters = QtWidgets.QTableWidget(dialog) + self.tbl_parameters.setGeometry(QtCore.QRect(20, 180, 731, 301)) + self.tbl_parameters.setObjectName("tblParameters") + self.tbl_parameters.setColumnCount(3) + self.tbl_parameters.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + self.tbl_parameters.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.tbl_parameters.setHorizontalHeaderItem(1, item) + item = QtWidgets.QTableWidgetItem() + self.tbl_parameters.setHorizontalHeaderItem(2, item) + self.tbl_parameters.verticalHeader().setVisible(False) + + self.retranslate_ui(dialog) + self.button_box.clicked['QAbstractButton*'].connect(dialog.close) + QtCore.QMetaObject.connectSlotsByName(dialog) + dialog.setTabOrder(self.status_box, self.send_button_1) + dialog.setTabOrder(self.send_button_1, self.sub_system_text_browser) + dialog.setTabOrder(self.sub_system_text_browser, self.command_address_text_browser) + + def retranslate_ui(self, dialog): + _translate = QtCore.QCoreApplication.translate + dialog.setWindowTitle(_translate("Dialog", "Dialog")) + self.label_title.setText(_translate("Dialog", "Parameters")) + self.label_instructions.setText(_translate("Dialog", "Please enter the following parameters then click \'Send\':")) + self.label_param_title_2.setText(_translate("Dialog", "Status:")) + self.send_button_1.setText(_translate("Dialog", "Send")) + self.label_5.setText(_translate("Dialog", "Command:")) + self.sub_system_command_page_label.setText(_translate("Dialog", "Subsystem:")) + item = self.tbl_parameters.horizontalHeaderItem(0) + item.setText(_translate("Dialog", "Parameter")) + item = self.tbl_parameters.horizontalHeaderItem(1) + item.setText(_translate("Dialog", "Description")) + item = self.tbl_parameters.horizontalHeaderItem(2) + item.setText(_translate("Dialog", "Input")) + diff --git a/Subsystems/cmdGui/Ui_CommandSystemDialog.py b/Subsystems/cmdGui/Ui_CommandSystemDialog.py deleted file mode 100644 index 6ae441b..0000000 --- a/Subsystems/cmdGui/Ui_CommandSystemDialog.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/cmdGui/CommandSystemDialog.ui' -# -# Created by: PyQt5 UI code generator 5.10.1 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_CommandSystemDialog(object): - def setupUi(self, CommandSystemDialog): - CommandSystemDialog.setObjectName("CommandSystemDialog") - CommandSystemDialog.resize(772, 1020) - self.layoutWidget_2 = QtWidgets.QWidget(CommandSystemDialog) - self.layoutWidget_2.setGeometry(QtCore.QRect(80, 20, 621, 25)) - self.layoutWidget_2.setObjectName("layoutWidget_2") - self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget_2) - self.horizontalLayout.setContentsMargins(0, 0, 0, 0) - self.horizontalLayout.setObjectName("horizontalLayout") - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem) - self.label = QtWidgets.QLabel(self.layoutWidget_2) - self.label.setObjectName("label") - self.horizontalLayout.addWidget(self.label) - spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem1) - self.layoutWidget_3 = QtWidgets.QWidget(CommandSystemDialog) - self.layoutWidget_3.setGeometry(QtCore.QRect(80, 60, 621, 33)) - self.layoutWidget_3.setObjectName("layoutWidget_3") - self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.layoutWidget_3) - self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - spacerItem2 = QtWidgets.QSpacerItem(90, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_2.addItem(spacerItem2) - spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_2.addItem(spacerItem3) - self.label_2 = QtWidgets.QLabel(self.layoutWidget_3) - self.label_2.setObjectName("label_2") - self.horizontalLayout_2.addWidget(self.label_2) - spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_2.addItem(spacerItem4) - self.buttonBox = QtWidgets.QDialogButtonBox(self.layoutWidget_3) - self.buttonBox.setOrientation(QtCore.Qt.Vertical) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close) - self.buttonBox.setCenterButtons(True) - self.buttonBox.setObjectName("buttonBox") - self.horizontalLayout_2.addWidget(self.buttonBox) - self.tblCmdSys = QtWidgets.QTableWidget(CommandSystemDialog) - self.tblCmdSys.setGeometry(QtCore.QRect(30, 120, 701, 721)) - self.tblCmdSys.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) - self.tblCmdSys.setObjectName("tblCmdSys") - self.tblCmdSys.setColumnCount(5) - self.tblCmdSys.setRowCount(0) - item = QtWidgets.QTableWidgetItem() - self.tblCmdSys.setHorizontalHeaderItem(0, item) - item = QtWidgets.QTableWidgetItem() - self.tblCmdSys.setHorizontalHeaderItem(1, item) - item = QtWidgets.QTableWidgetItem() - self.tblCmdSys.setHorizontalHeaderItem(2, item) - item = QtWidgets.QTableWidgetItem() - self.tblCmdSys.setHorizontalHeaderItem(3, item) - item = QtWidgets.QTableWidgetItem() - self.tblCmdSys.setHorizontalHeaderItem(4, item) - self.tblCmdSys.verticalHeader().setVisible(False) - - self.retranslateUi(CommandSystemDialog) - self.buttonBox.clicked['QAbstractButton*'].connect(CommandSystemDialog.close) - QtCore.QMetaObject.connectSlotsByName(CommandSystemDialog) - - def retranslateUi(self, CommandSystemDialog): - _translate = QtCore.QCoreApplication.translate - CommandSystemDialog.setWindowTitle(_translate("CommandSystemDialog", "Command System Main Page")) - self.label.setText(_translate("CommandSystemDialog", "cFE/CFS Subsystem Commands")) - self.label_2.setText(_translate("CommandSystemDialog", "Available Pages")) - item = self.tblCmdSys.horizontalHeaderItem(0) - item.setText(_translate("CommandSystemDialog", "Subsystem/Page")) - item = self.tblCmdSys.horizontalHeaderItem(1) - item.setText(_translate("CommandSystemDialog", "Packet ID")) - item = self.tblCmdSys.horizontalHeaderItem(2) - item.setText(_translate("CommandSystemDialog", "Send To")) - diff --git a/Subsystems/cmdGui/Ui_GenericCommandDialog.py b/Subsystems/cmdGui/Ui_GenericCommandDialog.py deleted file mode 100644 index f5f7f15..0000000 --- a/Subsystems/cmdGui/Ui_GenericCommandDialog.py +++ /dev/null @@ -1,105 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/cmdGui/GenericCommandDialog.ui' -# -# Created by: PyQt5 UI code generator 5.10.1 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_GenericCommandDialog(object): - def setupUi(self, GenericCommandDialog): - GenericCommandDialog.setObjectName("GenericCommandDialog") - GenericCommandDialog.resize(549, 1058) - self.verticalLayout_6 = QtWidgets.QVBoxLayout(GenericCommandDialog) - self.verticalLayout_6.setObjectName("verticalLayout_6") - self.verticalLayout_4 = QtWidgets.QVBoxLayout() - self.verticalLayout_4.setObjectName("verticalLayout_4") - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.verticalLayout = QtWidgets.QVBoxLayout() - self.verticalLayout.setObjectName("verticalLayout") - self.subSystemCommandPageLabel = QtWidgets.QLabel(GenericCommandDialog) - self.subSystemCommandPageLabel.setAlignment(QtCore.Qt.AlignCenter) - self.subSystemCommandPageLabel.setObjectName("subSystemCommandPageLabel") - self.verticalLayout.addWidget(self.subSystemCommandPageLabel) - self.subSystemLineEdit = QtWidgets.QLineEdit(GenericCommandDialog) - self.subSystemLineEdit.setMinimumSize(QtCore.QSize(159, 31)) - self.subSystemLineEdit.setMaximumSize(QtCore.QSize(300, 31)) - self.subSystemLineEdit.setObjectName("subSystemLineEdit") - self.verticalLayout.addWidget(self.subSystemLineEdit) - self.horizontalLayout.addLayout(self.verticalLayout) - self.verticalLayout_2 = QtWidgets.QVBoxLayout() - self.verticalLayout_2.setObjectName("verticalLayout_2") - self.packetIdLabel = QtWidgets.QLabel(GenericCommandDialog) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.packetIdLabel.sizePolicy().hasHeightForWidth()) - self.packetIdLabel.setSizePolicy(sizePolicy) - self.packetIdLabel.setMinimumSize(QtCore.QSize(0, 13)) - self.packetIdLabel.setMaximumSize(QtCore.QSize(16777193, 13)) - self.packetIdLabel.setObjectName("packetIdLabel") - self.verticalLayout_2.addWidget(self.packetIdLabel) - self.packetId = QtWidgets.QLCDNumber(GenericCommandDialog) - self.packetId.setObjectName("packetId") - self.verticalLayout_2.addWidget(self.packetId) - self.horizontalLayout.addLayout(self.verticalLayout_2) - self.verticalLayout_3 = QtWidgets.QVBoxLayout() - self.verticalLayout_3.setObjectName("verticalLayout_3") - self.label_5 = QtWidgets.QLabel(GenericCommandDialog) - self.label_5.setAlignment(QtCore.Qt.AlignCenter) - self.label_5.setObjectName("label_5") - self.verticalLayout_3.addWidget(self.label_5) - self.commandAddressLineEdit = QtWidgets.QLineEdit(GenericCommandDialog) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.commandAddressLineEdit.sizePolicy().hasHeightForWidth()) - self.commandAddressLineEdit.setSizePolicy(sizePolicy) - self.commandAddressLineEdit.setMinimumSize(QtCore.QSize(135, 31)) - self.commandAddressLineEdit.setMaximumSize(QtCore.QSize(135, 31)) - self.commandAddressLineEdit.setObjectName("commandAddressLineEdit") - self.verticalLayout_3.addWidget(self.commandAddressLineEdit) - self.horizontalLayout.addLayout(self.verticalLayout_3) - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem) - self.buttonBox = QtWidgets.QDialogButtonBox(GenericCommandDialog) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close) - self.buttonBox.setObjectName("buttonBox") - self.horizontalLayout.addWidget(self.buttonBox) - self.verticalLayout_4.addLayout(self.horizontalLayout) - self.label = QtWidgets.QLabel(GenericCommandDialog) - self.label.setAlignment(QtCore.Qt.AlignCenter) - self.label.setObjectName("label") - self.verticalLayout_4.addWidget(self.label) - self.tblCommands = QtWidgets.QTableWidget(GenericCommandDialog) - self.tblCommands.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) - self.tblCommands.setObjectName("tblCommands") - self.tblCommands.setColumnCount(2) - self.tblCommands.setRowCount(0) - item = QtWidgets.QTableWidgetItem() - self.tblCommands.setHorizontalHeaderItem(0, item) - item = QtWidgets.QTableWidgetItem() - self.tblCommands.setHorizontalHeaderItem(1, item) - self.tblCommands.verticalHeader().setVisible(False) - self.tblCommands.verticalHeader().setMinimumSectionSize(40) - self.verticalLayout_4.addWidget(self.tblCommands) - self.verticalLayout_6.addLayout(self.verticalLayout_4) - - self.retranslateUi(GenericCommandDialog) - self.buttonBox.clicked['QAbstractButton*'].connect(GenericCommandDialog.close) - QtCore.QMetaObject.connectSlotsByName(GenericCommandDialog) - - def retranslateUi(self, GenericCommandDialog): - _translate = QtCore.QCoreApplication.translate - GenericCommandDialog.setWindowTitle(_translate("GenericCommandDialog", "Command Page")) - self.subSystemCommandPageLabel.setText(_translate("GenericCommandDialog", "Subsystem")) - self.packetIdLabel.setText(_translate("GenericCommandDialog", "Packet ID")) - self.label_5.setText(_translate("GenericCommandDialog", "Send To:")) - self.label.setText(_translate("GenericCommandDialog", "Command")) - item = self.tblCommands.horizontalHeaderItem(0) - item.setText(_translate("GenericCommandDialog", "Command")) - diff --git a/Subsystems/cmdGui/Ui_ParameterDialog.py b/Subsystems/cmdGui/Ui_ParameterDialog.py deleted file mode 100644 index cfe226a..0000000 --- a/Subsystems/cmdGui/Ui_ParameterDialog.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/cmdGui/ParameterDialog.ui' -# -# Created by: PyQt5 UI code generator 5.10.1 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName("Dialog") - Dialog.setEnabled(True) - Dialog.resize(782, 550) - self.label_title = QtWidgets.QLabel(Dialog) - self.label_title.setGeometry(QtCore.QRect(330, 120, 91, 31)) - font = QtGui.QFont() - font.setFamily("Sans Serif") - font.setPointSize(10) - self.label_title.setFont(font) - self.label_title.setAlignment(QtCore.Qt.AlignCenter) - self.label_title.setObjectName("label_title") - self.label_instructions = QtWidgets.QLabel(Dialog) - self.label_instructions.setGeometry(QtCore.QRect(120, 140, 551, 31)) - self.label_instructions.setAlignment(QtCore.Qt.AlignCenter) - self.label_instructions.setObjectName("label_instructions") - self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) - self.buttonBox.setGeometry(QtCore.QRect(670, 490, 101, 31)) - self.buttonBox.setLayoutDirection(QtCore.Qt.LeftToRight) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close) - self.buttonBox.setCenterButtons(True) - self.buttonBox.setObjectName("buttonBox") - self.status_box = QtWidgets.QTextBrowser(Dialog) - self.status_box.setGeometry(QtCore.QRect(480, 40, 201, 41)) - self.status_box.setAutoFillBackground(False) - self.status_box.setObjectName("status_box") - self.label_param_title_2 = QtWidgets.QLabel(Dialog) - self.label_param_title_2.setGeometry(QtCore.QRect(480, 10, 61, 21)) - self.label_param_title_2.setObjectName("label_param_title_2") - self.SendButton_1 = QtWidgets.QPushButton(Dialog) - self.SendButton_1.setGeometry(QtCore.QRect(690, 47, 71, 27)) - self.SendButton_1.setAutoDefault(False) - self.SendButton_1.setDefault(True) - self.SendButton_1.setObjectName("SendButton_1") - self.label_5 = QtWidgets.QLabel(Dialog) - self.label_5.setGeometry(QtCore.QRect(260, 10, 81, 20)) - self.label_5.setObjectName("label_5") - self.subSystemCommandPageLabel = QtWidgets.QLabel(Dialog) - self.subSystemCommandPageLabel.setGeometry(QtCore.QRect(30, 10, 91, 24)) - self.subSystemCommandPageLabel.setObjectName("subSystemCommandPageLabel") - self.subSystemTextBrowser = QtWidgets.QTextBrowser(Dialog) - self.subSystemTextBrowser.setGeometry(QtCore.QRect(30, 40, 221, 41)) - self.subSystemTextBrowser.setObjectName("subSystemTextBrowser") - self.commandAddressTextBrowser = QtWidgets.QTextBrowser(Dialog) - self.commandAddressTextBrowser.setGeometry(QtCore.QRect(260, 40, 211, 41)) - self.commandAddressTextBrowser.setObjectName("commandAddressTextBrowser") - self.tblParameters = QtWidgets.QTableWidget(Dialog) - self.tblParameters.setGeometry(QtCore.QRect(20, 180, 731, 301)) - self.tblParameters.setObjectName("tblParameters") - self.tblParameters.setColumnCount(3) - self.tblParameters.setRowCount(0) - item = QtWidgets.QTableWidgetItem() - self.tblParameters.setHorizontalHeaderItem(0, item) - item = QtWidgets.QTableWidgetItem() - self.tblParameters.setHorizontalHeaderItem(1, item) - item = QtWidgets.QTableWidgetItem() - self.tblParameters.setHorizontalHeaderItem(2, item) - self.tblParameters.verticalHeader().setVisible(False) - - self.retranslateUi(Dialog) - self.buttonBox.clicked['QAbstractButton*'].connect(Dialog.close) - QtCore.QMetaObject.connectSlotsByName(Dialog) - Dialog.setTabOrder(self.status_box, self.SendButton_1) - Dialog.setTabOrder(self.SendButton_1, self.subSystemTextBrowser) - Dialog.setTabOrder(self.subSystemTextBrowser, self.commandAddressTextBrowser) - - def retranslateUi(self, Dialog): - _translate = QtCore.QCoreApplication.translate - Dialog.setWindowTitle(_translate("Dialog", "Dialog")) - self.label_title.setText(_translate("Dialog", "Parameters")) - self.label_instructions.setText(_translate("Dialog", "Please enter the following parameters then click \'Send\':")) - self.label_param_title_2.setText(_translate("Dialog", "Status:")) - self.SendButton_1.setText(_translate("Dialog", "Send")) - self.label_5.setText(_translate("Dialog", "Command:")) - self.subSystemCommandPageLabel.setText(_translate("Dialog", "Subsystem:")) - item = self.tblParameters.horizontalHeaderItem(0) - item.setText(_translate("Dialog", "Parameter")) - item = self.tblParameters.horizontalHeaderItem(1) - item.setText(_translate("Dialog", "Description")) - item = self.tblParameters.horizontalHeaderItem(2) - item.setText(_translate("Dialog", "Input")) - diff --git a/Subsystems/cmdUtil/SendUdp.c b/Subsystems/cmdUtil/SendUdp.c index cceb930..efc707f 100644 --- a/Subsystems/cmdUtil/SendUdp.c +++ b/Subsystems/cmdUtil/SendUdp.c @@ -91,6 +91,7 @@ int SendUdp(char *hostname, char *portNum, unsigned char *packetData, int packet if (rp == NULL) { + freeaddrinfo(result); return -4; } diff --git a/Subsystems/tlmGUI/EventMessage.py b/Subsystems/tlmGUI/EventMessage.py index d24c602..df2e359 100644 --- a/Subsystems/tlmGUI/EventMessage.py +++ b/Subsystems/tlmGUI/EventMessage.py @@ -17,7 +17,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -#!/usr/bin/env python3 +# !/usr/bin/env python3 # # EVS Events page # @@ -59,15 +59,15 @@ from PyQt5.QtCore import QThread, pyqtSignal from PyQt5.QtWidgets import QApplication, QDialog -from Ui_EventMessageDialog import Ui_EventMessageDialog +from UiEventmessagedialog import UiEventmessagedialog ROOTDIR = Path(sys.argv[0]).resolve().parent -class EventMessageTelemetry(QDialog, Ui_EventMessageDialog): +class EventMessageTelemetry(QDialog, UiEventmessagedialog): def __init__(self, aid): super().__init__() - self.setupUi(self) + self.setup_ui(self) self.appId = aid self.eventTypes = { @@ -80,47 +80,48 @@ def __init__(self, aid): with open("/tmp/OffsetData", "r+b") as f: self.mm = mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ) - def initEMTlmReceiver(self, subscr): - self.setWindowTitle(f'{pageTitle} for: {subscr}') + def init_em_tlm_receiver(self, subscr): + self.setWindowTitle(f'{page_title} for: {subscr}') self.thread = EMTlmReceiver(subscr, self.appId) - self.thread.emSignalTlmDatagram.connect(self.processPendingDatagrams) + self.thread.em_signal_tlm_datagram.connect(self.process_pending_datagrams) self.thread.finished.connect(self.thread.deleteLater) self.thread.start() # This method processes packets. Called when the TelemetryReceiver receives a message/packet - def processPendingDatagrams(self, datagram): + def process_pending_datagrams(self, datagram): # Packet Header # uint16 StreamId; 0 # uint16 Sequence; 2 # uint16 Length; 4 - packetSeq = unpack(">H", datagram[2:4]) - seqCount = packetSeq[0] & 0x3FFF - self.sequenceCount.setValue(seqCount) + packet_seq = unpack(">H", datagram[2:4]) + seq_count = packet_seq[0] & 0x3FFF + self.sequence_count.setValue(seq_count) + tlm_offset = 0 # # Get App Name, Event ID, Type and Event Text! # try: - tlmOffset = self.mm[0] + tlm_offset = self.mm[0] except ValueError: pass - startByte = 12 + tlmOffset - appName = datagram[startByte:startByte + 20].decode('utf-8', 'ignore') - eventID = int.from_bytes(datagram[startByte + 20:startByte + 22], - byteorder='little') - eventType = int.from_bytes(datagram[startByte + 22:startByte + 24], - byteorder='little') - eventText = datagram[startByte + 32:].decode('utf-8', 'ignore') - appName = appName.split("\0")[0] - eventText = eventText.split("\0")[0] - eventTypeStr = self.eventTypes.get(eventType, "INVALID EVENT TYPE") - - eventString = f"EVENT --> {appName}-{eventTypeStr} Event ID: {eventID} : {eventText}" - self.eventOutput.appendPlainText(eventString) - - ## Reimplements closeEvent - ## to properly quit the thread - ## and close the window + start_byte = 12 + tlm_offset + app_name = datagram[start_byte:start_byte + 20].decode('utf-8', 'ignore') + event_id = int.from_bytes(datagram[start_byte + 20:start_byte + 22], + byteorder='little') + event_type = int.from_bytes(datagram[start_byte + 22:start_byte + 24], + byteorder='little') + event_text = datagram[start_byte + 32:].decode('utf-8', 'ignore') + app_name = app_name.split("\0")[0] + event_text = event_text.split("\0")[0] + event_type_str = self.eventTypes.get(event_type, "INVALID EVENT TYPE") + + event_string = f"EVENT --> {app_name}-{event_type_str} Event ID: {event_id} : {event_text}" + self.event_output.appendPlainText(event_string) + + # Reimplements closeEvent + # to properly quit the thread + # and close the window def closeEvent(self, event): self.thread.runs = False self.thread.wait(2000) @@ -130,27 +131,27 @@ def closeEvent(self, event): # Subscribes and receives zeroMQ messages class EMTlmReceiver(QThread): # Setup signal to communicate with front-end GUI - emSignalTlmDatagram = pyqtSignal(bytes) + em_signal_tlm_datagram = pyqtSignal(bytes) def __init__(self, subscr, aid): super().__init__() - self.appId = aid + self.app_id = aid self.runs = True # Init zeroMQ self.context = zmq.Context() self.subscriber = self.context.socket(zmq.SUB) self.subscriber.connect("ipc:///tmp/GroundSystem") - subscriptionString = f"{subscr}.Spacecraft1.TelemetryPackets.{appId}" - self.subscriber.setsockopt_string(zmq.SUBSCRIBE, subscriptionString) + subscription_string = f"{subscr}.Spacecraft1.TelemetryPackets.{app_id}" + self.subscriber.setsockopt_string(zmq.SUBSCRIBE, subscription_string) def run(self): while self.runs: # Read envelope with address address, datagram = self.subscriber.recv_multipart() # Ignore if not an event message - if self.appId in address.decode(): - self.emSignalTlmDatagram.emit(datagram) + if self.app_id in address.decode(): + self.em_signal_tlm_datagram.emit(datagram) # @@ -167,8 +168,8 @@ def usage(): # # Set defaults for the arguments # - pageTitle = "Event Messages" - appId = 999 + page_title = "Event Messages" + app_id = 999 endian = "L" subscription = "" @@ -190,11 +191,11 @@ def usage(): if opt in ("-p", "--port"): pass elif opt in ("-t", "--title"): - pageTitle = arg + page_title = arg elif opt in ("-f", "--file"): pass elif opt in ("-a", "--appid"): - appId = arg + app_id = arg elif opt in ("-e", "--endian"): endian = arg elif opt in ("-s", "--sub"): @@ -209,11 +210,11 @@ def usage(): # Init the QT application and the Event Message class # app = QApplication(sys.argv) - Telem = EventMessageTelemetry(appId) + telem = EventMessageTelemetry(app_id) # Display the page - Telem.show() - Telem.raise_() - Telem.initEMTlmReceiver(subscription) + telem.show() + telem.raise_() + telem.init_em_tlm_receiver(subscription) sys.exit(app.exec_()) diff --git a/Subsystems/tlmGUI/EventMessageDialog.ui b/Subsystems/tlmGUI/EventMessageDialog.ui index 425576c..c9173bd 100644 --- a/Subsystems/tlmGUI/EventMessageDialog.ui +++ b/Subsystems/tlmGUI/EventMessageDialog.ui @@ -1,7 +1,7 @@ - EventMessageDialog - + event_message_dialog + 0 @@ -13,9 +13,9 @@ Event Messages - + - + @@ -45,7 +45,7 @@ - + true @@ -58,7 +58,7 @@ - + Qt::Horizontal @@ -92,7 +92,7 @@ - + Qt::Horizontal @@ -105,7 +105,7 @@ - + Qt::Horizontal @@ -121,7 +121,7 @@ - + QDialogButtonBox::Close @@ -130,7 +130,7 @@ - + true @@ -141,9 +141,9 @@ - buttonBox + button_box clicked(QAbstractButton*) - EventMessageDialog + event_message_dialog close() diff --git a/Subsystems/tlmGUI/GenericTelemetry.py b/Subsystems/tlmGUI/GenericTelemetry.py index 44eab2e..8171601 100644 --- a/Subsystems/tlmGUI/GenericTelemetry.py +++ b/Subsystems/tlmGUI/GenericTelemetry.py @@ -31,13 +31,13 @@ from PyQt5.QtWidgets import (QApplication, QDialog, QHeaderView, QTableWidgetItem) -from Ui_GenericTelemetryDialog import Ui_GenericTelemetryDialog +from UiGenerictelemetrydialog import UiGenerictelemetrydialog -## ../cFS/tools/cFS-GroundSystem/Subsystems/tlmGUI +# ../cFS/tools/cFS-GroundSystem/Subsystems/tlmGUI ROOTDIR = Path(sys.argv[0]).resolve().parent -class SubsystemTelemetry(QDialog, Ui_GenericTelemetryDialog): +class SubsystemTelemetry(QDialog, UiGenerictelemetrydialog): # # Init the class # @@ -50,43 +50,44 @@ def __init__(self): # # This method decodes a telemetry item from the packet and displays it # - def displayTelemetryItem(self, datagram, tlmIndex, labelField, valueField): - if tlmItemIsValid[tlmIndex]: - tlmOffset = 0 + def display_telemetry_item(self, datagram, tlm_index, label_field, value_field): + if tlm_item_is_valid[tlm_index]: + tlm_offset = 0 try: - tlmOffset = self.mm[0] + tlm_offset = self.mm[0] except ValueError: pass - TlmField1 = tlmItemFormat[tlmIndex] - if TlmField1[0] == "<": - TlmField1 = TlmField1[1:] - itemStart = 0 + tlm_field1 = tlm_item_format[tlm_index] + if tlm_field1[0] == "<": + tlm_field1 = tlm_field1[1:] + + item_start = 0 try: - itemStart = int(tlmItemStart[tlmIndex]) + tlmOffset + item_start = int(tlm_item_start[tlm_index]) + tlm_offset except UnboundLocalError: pass - TlmField2 = datagram[itemStart:itemStart + - int(tlmItemSize[tlmIndex])] - if TlmField2: - TlmField = unpack(TlmField1, TlmField2) - if tlmItemDisplayType[tlmIndex] == 'Dec': - valueField.setText(str(TlmField[0])) - elif tlmItemDisplayType[tlmIndex] == 'Hex': - valueField.setText(hex(TlmField[0])) - elif tlmItemDisplayType[tlmIndex] == 'Enm': - valueField.setText(tlmItemEnum[tlmIndex][int(TlmField[0])]) - elif tlmItemDisplayType[tlmIndex] == 'Str': - valueField.setText(TlmField[0].decode('utf-8', 'ignore')) - labelField.setText(tlmItemDesc[tlmIndex]) + tlm_field2 = datagram[item_start:item_start + + int(tlmItemSize[tlm_index])] + if tlm_field2: + tlm_field = unpack(tlm_field1, tlm_field2) + if tlm_item_display_type[tlm_index] == 'Dec': + value_field.setText(str(tlm_field[0])) + elif tlm_item_display_type[tlm_index] == 'Hex': + value_field.setText(hex(tlm_field[0])) + elif tlm_item_display_type[tlm_index] == 'Enm': + value_field.setText(tlmItemEnum[tlm_index][int(tlm_field[0])]) + elif tlm_item_display_type[tlm_index] == 'Str': + value_field.setText(tlm_field[0].decode('utf-8', 'ignore')) + label_field.setText(tlmItemDesc[tlm_index]) else: - print("ERROR: Can't unpack buffer of length", len(TlmField2)) + print("ERROR: Can't unpack buffer of length", len(tlm_field2)) # Start the telemetry receiver (see GTTlmReceiver class) - def initGTTlmReceiver(self, subscr): - self.setWindowTitle(f"{pageTitle} for: {subscr}") + def init_gt_tlm_receiver(self, subscr): + self.setWindowTitle(f"{page_title} for: {subscr}") self.thread = GTTlmReceiver(subscr) - self.thread.gtSignalTlmDatagram.connect(self.processPendingDatagrams) + self.thread.gtSignalTlmDatagram.connect(self.process_pending_datagrams) self.thread.finished.connect(self.thread.deleteLater) self.thread.start() @@ -94,25 +95,25 @@ def initGTTlmReceiver(self, subscr): # This method processes packets. # Called when the TelemetryReceiver receives a message/packet # - def processPendingDatagrams(self, datagram): + def process_pending_datagrams(self, datagram): # # Show sequence number # - packetSeq = unpack(">H", datagram[2:4]) - seqCount = packetSeq[0] & 0x3FFF ## sequence count mask - self.sequenceCount.setValue(seqCount) + packet_seq = unpack(">H", datagram[2:4]) + seq_count = packet_seq[0] & 0x3FFF ## sequence count mask + self.sequence_count.setValue(seq_count) # # Decode and display all packet elements # - for k in range(self.tblTelemetry.rowCount()): - itemLabel = self.tblTelemetry.item(k, 0) - itemValue = self.tblTelemetry.item(k, 1) - self.displayTelemetryItem(datagram, k, itemLabel, itemValue) + for k in range(self.tbl_telemetry.rowCount()): + item_label = self.tbl_telemetry.item(k, 0) + item_value = self.tbl_telemetry.item(k, 1) + self.display_telemetry_item(datagram, k, item_label, item_value) - ## Reimplements closeEvent - ## to properly quit the thread - ## and close the window + # Reimplements closeEvent + # to properly quit the thread + # and close the window def closeEvent(self, event): self.thread.runs = False self.thread.wait(2000) @@ -123,7 +124,7 @@ def closeEvent(self, event): # Subscribes and receives zeroMQ messages class GTTlmReceiver(QThread): # Setup signal to communicate with front-end GUI - gtSignalTlmDatagram = pyqtSignal(bytes) + gt_signal_tlm_datagram = pyqtSignal(bytes) def __init__(self, subscr): super().__init__() @@ -133,16 +134,16 @@ def __init__(self, subscr): context = zmq.Context() self.subscriber = context.socket(zmq.SUB) self.subscriber.connect("ipc:///tmp/GroundSystem") - myTlmPgAPID = subscr.split(".", 1) - mySubscription = f"GroundSystem.Spacecraft1.TelemetryPackets.{myTlmPgAPID[1]}" - self.subscriber.setsockopt_string(zmq.SUBSCRIBE, mySubscription) + my_tlm_pg_apid = subscr.split(".", 1) + my_subscription = f"GroundSystem.Spacecraft1.TelemetryPackets.{my_tlm_pg_apid[1]}" + self.subscriber.setsockopt_string(zmq.SUBSCRIBE, my_subscription) def run(self): while self.runs: # Read envelope with address _, datagram = self.subscriber.recv_multipart() # Send signal with received packet to front-end/GUI - self.gtSignalTlmDatagram.emit(datagram) + self.gt_signal_tlm_datagram.emit(datagram) # @@ -162,10 +163,10 @@ def usage(): # # Set defaults for the arguments # - pageTitle = "Telemetry Page" + page_title = "Telemetry Page" # udpPort = 10000 - appId = 999 - tlmDefFile = f"{ROOTDIR}/telemetry_def.txt" + app_id = 999 + tlm_def_file = f"{ROOTDIR}/telemetry_def.txt" endian = "L" subscription = "" @@ -187,11 +188,11 @@ def usage(): elif opt in ("-p", "--port"): pass elif opt in ("-t", "--title"): - pageTitle = arg + page_title = arg elif opt in ("-f", "--file"): - tlmDefFile = arg + tlm_def_file = arg elif opt in ("-t", "--appid"): - appId = arg + app_id = arg elif opt in ("-e", "--endian"): endian = arg elif opt in ("-s", "--sub"): @@ -208,40 +209,40 @@ def usage(): # Init the QT application and the telemetry class # app = QApplication(sys.argv) - Telem = SubsystemTelemetry() - tbl = Telem.tblTelemetry - Telem.subSystemLineEdit.setText(pageTitle) - Telem.packetId.display(appId) + telem = SubsystemTelemetry() + tbl = telem.tbl_telemetry + telem.sub_system_line_edit.setText(page_title) + telem.packet_id.display(app_id) # # Read in the contents of the telemetry packet definition # - tlmItemIsValid, tlmItemDesc, \ - tlmItemStart, tlmItemSize, \ - tlmItemDisplayType, tlmItemFormat = ([] for _ in range(6)) + tlm_item_is_valid, tlmItemDesc, \ + tlm_item_start, tlmItemSize, \ + tlm_item_display_type, tlmItemFormat = ([] for _ in range(6)) - tlmItemEnum = [None] * 40 + tlm_item_enum = [None] * 40 i = 0 - with open(f"{ROOTDIR}/{tlmDefFile}") as tlmfile: + with open(f"{ROOTDIR}/{tlm_def_file}") as tlmfile: reader = csv.reader(tlmfile, skipinitialspace=True) for row in reader: if not row[0].startswith("#"): - tlmItemIsValid.append(True) - tlmItemDesc.append(row[0]) - tlmItemStart.append(row[1]) - tlmItemSize.append(row[2]) + tlm_item_is_valid.append(True) + tlm_item_desc.append(row[0]) + tlm_item_start.append(row[1]) + tlm_item_size.append(row[2]) if row[3].lower() == 's': - tlmItemFormat.append(f'{row[2]}{row[3]}') + tlm_item_format.append(f'{row[2]}{row[3]}') else: - tlmItemFormat.append(f'{py_endian}{row[3]}') - tlmItemDisplayType.append(row[4]) + tlm_item_format.append(f'{py_endian}{row[3]}') + tlm_item_display_type.append(row[4]) if row[4] == 'Enm': - tlmItemEnum[i] = row[5:9] - Telem.tblTelemetry.insertRow(i) - lblItem, valItem = QTableWidgetItem(), QTableWidgetItem() - Telem.tblTelemetry.setItem(i, 0, lblItem) - Telem.tblTelemetry.setItem(i, 1, valItem) + tlm_item_enum[i] = row[5:9] + telem.tbl_telemetry.insertRow(i) + lbl_item, val_item = QTableWidgetItem(), QTableWidgetItem() + telem.tbl_telemetry.setItem(i, 0, lbl_item) + telem.tbl_telemetry.setItem(i, 1, val_item) i += 1 tbl.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch) tbl.verticalHeader().setSectionResizeMode(QHeaderView.Stretch) @@ -249,8 +250,8 @@ def usage(): # # Display the page # - Telem.show() - Telem.raise_() - Telem.initGTTlmReceiver(subscription) + telem.show() + telem.raise_() + telem.init_gt_tlm_receiver(subscription) sys.exit(app.exec_()) diff --git a/Subsystems/tlmGUI/GenericTelemetryDialog.ui b/Subsystems/tlmGUI/GenericTelemetryDialog.ui index f1d2ed2..5fd9d2e 100644 --- a/Subsystems/tlmGUI/GenericTelemetryDialog.ui +++ b/Subsystems/tlmGUI/GenericTelemetryDialog.ui @@ -1,7 +1,7 @@ - GenericTelemetryDialog - + generic_telemetry_dialog + 0 @@ -35,7 +35,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">*No packets? Remember to select the IP address of<br />your spacecraft in the Main Window.</p></body></html> - + 20 @@ -64,7 +64,7 @@ p, li { white-space: pre-wrap; } - + 450 @@ -77,7 +77,7 @@ p, li { white-space: pre-wrap; } QDialogButtonBox::Close - + 260 @@ -86,9 +86,9 @@ p, li { white-space: pre-wrap; } 54 - + - + 0 @@ -113,7 +113,7 @@ p, li { white-space: pre-wrap; } - + 0 @@ -124,7 +124,7 @@ p, li { white-space: pre-wrap; } - + 350 @@ -133,7 +133,7 @@ p, li { white-space: pre-wrap; } 62 - + @@ -142,7 +142,7 @@ p, li { white-space: pre-wrap; } - + 101 @@ -168,7 +168,7 @@ p, li { white-space: pre-wrap; } - + 42 @@ -177,16 +177,16 @@ p, li { white-space: pre-wrap; } 62 - + - + Subsystem Telemetry Page - + 141 @@ -210,9 +210,9 @@ p, li { white-space: pre-wrap; } - buttonBox + button_box clicked(QAbstractButton*) - GenericTelemetryDialog + generic_telemetry_dialog close() diff --git a/Subsystems/tlmGUI/TelemetrySystem.py b/Subsystems/tlmGUI/TelemetrySystem.py index b0fb831..7fcfd39 100644 --- a/Subsystems/tlmGUI/TelemetrySystem.py +++ b/Subsystems/tlmGUI/TelemetrySystem.py @@ -32,12 +32,12 @@ from PyQt5.QtWidgets import (QApplication, QDialog, QHeaderView, QPushButton, QTableWidgetItem) -from Ui_TelemetrySystemDialog import Ui_TelemetrySystemDialog +from UiTelemetrysystemdialog import UiTelemetrysystemdialog ROOTDIR = Path(sys.argv[0]).resolve().parent -class TelemetrySystem(QDialog, Ui_TelemetrySystemDialog): +class TelemetrySystem(QDialog, UiTelemetrysystemdialog): # # Init the class # @@ -47,48 +47,48 @@ def __init__(self): self.setWindowTitle('Telemetry System Main Page') self.move(0, 100) - self.pktCount = 0 + self.pkt_count = 0 self.subscription = None # # convert a string of binary bytes to ascii hex # @staticmethod - def strToHex(aString): - hexStr = "" - for x in aString: - hexStr += f'{ord(x):02X} ' - return hexStr.strip() + def str_to_hex(a_string): + hex_str = "" + for x in a_string: + hex_str += f'{ord(x):02X} ' + return hex_str.strip() # # Dump the telemetry packet # - def dumpPacket(self, packetData): - appId = (ord(packetData[0]) << 8) + (ord(packetData[1])) + def dump_packet(self, packet_data): + app_id = (ord(packet_data[0]) << 8) + (ord(packet_data[1])) print("\n-----------------------------------------------") - print("\nPacket: App ID =", hex(appId)) - print("\nPacket Data:", self.strToHex(packetData)) + print("\nPacket: App ID =", hex(app_id)) + print("\nPacket Data:", self.str_to_hex(packet_data)) - def ProcessButtonGeneric(self, idx): - tempSub = f"{self.subscription}.{hex(tlmPageAppid[idx])}" - if tlmPageIsValid[idx]: + def process_button_generic(self, idx): + temp_sub = f"{self.subscription}.{hex(tlm_page_appid[idx])}" + if tlm_page_is_valid[idx]: # need to extract data from fields, then start page with right params - launch_string = (f'python3 {ROOTDIR}/{tlmClass[idx]} ' - f'--title=\"{tlmPageDesc[idx]}\" ' - f'--appid={hex(tlmPageAppid[idx])} ' - f'--port={tlmPagePort[idx]} ' - f'--file={tlmPageDefFile[idx]} ' - f'--endian={endian} --sub={tempSub}') + launch_string = (f'python3 {ROOTDIR}/{tlm_class[idx]} ' + f'--title=\"{tlm_page_desc[idx]}\" ' + f'--appid={hex(tlm_page_appid[idx])} ' + f'--port={tlm_page_port[idx]} ' + f'--file={tlm_page_def_file[idx]} ' + f'--endian={endian} --sub={temp_sub}') # print(launch_string) cmd_args = shlex.split(launch_string) subprocess.Popen(cmd_args) # Start the telemetry receiver (see TSTlmReceiver class) - def initTSTlmReceiver(self, subscr): + def init_ts_tlm_receiver(self, subscr): self.setWindowTitle(f'Telemetry System page for: {subscr}') self.subscription = subscr self.thread = TSTlmReceiver(subscr) - self.thread.tsSignalTlmDatagram.connect(self.processPendingDatagrams) + self.thread.ts_signal_tlm_datagram.connect(self.process_pending_datagrams) self.thread.finished.connect(self.thread.deleteLater) self.thread.start() @@ -96,44 +96,44 @@ def initTSTlmReceiver(self, subscr): # This method processes packets. # Called when the TelemetryReceiver receives a message/packet # - def processPendingDatagrams(self, datagram): + def process_pending_datagrams(self, datagram): # # Show number of packets received # - self.pktCount += 1 - self.packetCount.setValue(self.pktCount) + self.pkt_count += 1 + self.packet_count.setValue(self.pkt_count) # sendSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # # Decode the packet and forward it to the # correct port (if there is one) # - streamId = unpack(">H", datagram[:2]) + stream_id = unpack(">H", datagram[:2]) - ## Uncomment the next two lines to debug - # print("Packet ID =", hex(streamId[0])) + # Uncomment the next two lines to debug + # print("Packet ID =", hex(stream_id[0])) # self.dumpPacket(datagram) - for l in range(self.tblTlmSys.rowCount()): - if streamId[0] == tlmPageAppid[l]: + for l in range(self.tbl_tlm_sys.rowCount()): + if stream_id[0] == tlm_page_appid[l]: # send_host = "127.0.0.1" # send_port = tlmPagePort[l] # sendSocket.sendto(datagram, (send_host, send_port)) - tlmPageCount[l] += 1 - ## I wish I knew a better way to update the count field - ## in the GUI. Maybe store a pointer to the field in the gui - self.tblTlmSys.item(l, 2).setText(str(tlmPageCount[l])) + tlm_page_count[l] += 1 + # I wish I knew a better way to update the count field + # in the GUI. Maybe store a pointer to the field in the gui + self.tbl_tlm_sys.item(l, 2).setText(str(tlm_page_count[l])) - ## Unclear why line 15 is skipped. Removing for now, need - ## to evaluate long term (lbleier 06/01/2020) + # Unclear why line 15 is skipped. Removing for now, need + # to evaluate long term (lbleier 06/01/2020) # if l < 15: # self.tblTlmSys.item(l, 2).setText(str(tlmPageCount[l])) # else: # self.tblTlmSys.item(l + 1, 2).setText(str(tlmPageCount[l])) - ## Reimplements closeEvent - ## to properly quit the thread - ## and close the window + # Reimplements closeEvent + # to properly quit the thread + # and close the window def closeEvent(self, event): self.thread.runs = False self.thread.wait(2000) @@ -143,7 +143,7 @@ def closeEvent(self, event): # Subscribes and receives zeroMQ messages class TSTlmReceiver(QThread): # Setup signal to communicate with front-end GUI - tsSignalTlmDatagram = pyqtSignal(bytes) + ts_signal_tlm_datagram = pyqtSignal(bytes) def __init__(self, subscr): super().__init__() @@ -160,7 +160,7 @@ def run(self): # Receive and read envelope with address _, datagram = self.subscriber.recv_multipart() # Send signal with received packet to front-end/GUI - self.tsSignalTlmDatagram.emit(datagram) + self.ts_signal_tlm_datagram.emit(datagram) # @@ -171,13 +171,13 @@ def run(self): # Init the QT application and the telemetry dialog class # app = QApplication(sys.argv) - Telem = TelemetrySystem() - tbl = Telem.tblTlmSys + telem = TelemetrySystem() + tbl = telem.tbl_tlm_sys # # Set defaults for the arguments # - tlmDefFile = f"{ROOTDIR}/telemetry-pages.txt" + tlm_def_file = f"{ROOTDIR}/telemetry-pages.txt" endian = "L" subscription = "" @@ -200,21 +200,21 @@ def run(self): # # Read in the contents of the telemetry packet definition # - tlmPageIsValid, tlmPageDesc, tlmClass, tlmPagePort,\ - tlmPageAppid, tlmPageCount, tlmPageDefFile = ([] for _ in range(7)) + tlm_page_is_valid, tlm_page_desc, tlm_class, tlm_page_port, \ + tlm_page_appid, tlm_page_count, tlm_page_def_file = ([] for _ in range(7)) i = 0 - with open(tlmDefFile) as tlmfile: + with open(tlm_def_file) as tlmfile: reader = csv.reader(tlmfile, skipinitialspace=True) for row in reader: if not row[0].startswith('#'): - tlmPageIsValid.append(True) - tlmPageDesc.append(row[0]) - tlmClass.append(row[1]) - tlmPagePort.append(int(row[2], 16) + 10000) - tlmPageAppid.append(int(row[2], 16)) - tlmPageDefFile.append(row[3]) - tlmPageCount.append(0) + tlm_page_is_valid.append(True) + tlm_page_desc.append(row[0]) + tlm_class.append(row[1]) + tlm_page_port.append(int(row[2], 16) + 10000) + tlm_page_appid.append(int(row[2], 16)) + tlm_page_def_file.append(row[3]) + tlm_page_count.append(0) i += 1 # # Mark the remaining values as invalid @@ -226,15 +226,15 @@ def run(self): # # fill the data fields on the page # - for i, desc in enumerate(tlmPageDesc): - if tlmPageIsValid[i]: + for i, desc in enumerate(tlm_page_desc): + if tlm_page_is_valid[i]: tbl.insertRow(i) for col, text in enumerate( - (desc, hex(tlmPageAppid[i]), tlmPageCount[0])): + (desc, hex(tlm_page_appid[i]), tlm_page_count[0])): tblItem = QTableWidgetItem(str(text)) tbl.setItem(i, col, tblItem) btn = QPushButton("Display Page") - btn.clicked.connect(lambda _, x=i: Telem.ProcessButtonGeneric(x)) + btn.clicked.connect(lambda _, x=i: telem.process_button_generic(x)) tbl.setCellWidget(i, tbl.columnCount() - 1, btn) tbl.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents) tbl.horizontalHeader().setStretchLastSection(True) @@ -242,7 +242,7 @@ def run(self): # # Display the page # - Telem.show() - Telem.raise_() - Telem.initTSTlmReceiver(subscription) + telem.show() + telem.raise_() + telem.init_ts_tlm_receiver(subscription) sys.exit(app.exec_()) diff --git a/Subsystems/tlmGUI/TelemetrySystemDialog.ui b/Subsystems/tlmGUI/TelemetrySystemDialog.ui index 451078d..36e2038 100644 --- a/Subsystems/tlmGUI/TelemetrySystemDialog.ui +++ b/Subsystems/tlmGUI/TelemetrySystemDialog.ui @@ -1,7 +1,7 @@ - TelemetrySystemDialog - + telemetry_system_dialog + 0 @@ -13,11 +13,11 @@ Dialog - + - + Qt::Horizontal @@ -37,7 +37,7 @@ - + Qt::Horizontal @@ -52,12 +52,12 @@ - + QLayout::SetNoConstraint - + Qt::Horizontal @@ -70,7 +70,7 @@ - + Qt::Horizontal @@ -86,9 +86,9 @@ - + - + Qt::Horizontal @@ -108,7 +108,7 @@ - + true @@ -124,7 +124,7 @@ - + Qt::Horizontal @@ -139,7 +139,7 @@ - + Qt::Horizontal @@ -152,7 +152,7 @@ - + QDialogButtonBox::Close @@ -161,9 +161,9 @@ - + - + Qt::Horizontal @@ -183,7 +183,7 @@ - + Qt::Horizontal @@ -198,7 +198,7 @@ - + QAbstractItemView::NoEditTriggers @@ -232,7 +232,7 @@ - buttonBox + button_box clicked(QAbstractButton*) TelemetrySystemDialog close() diff --git a/Subsystems/tlmGUI/UiEventmessagedialog.py b/Subsystems/tlmGUI/UiEventmessagedialog.py new file mode 100644 index 0000000..d4116a6 --- /dev/null +++ b/Subsystems/tlmGUI/UiEventmessagedialog.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/tlmGUI/EventMessageDialog.ui' +# +# Created by: PyQt5 UI code generator 5.10.1 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class UiEventmessagedialog(object): + def setup_ui(self, event_message_dialog): + event_message_dialog.setObjectName("EventMessageDialog") + event_message_dialog.resize(591, 277) + self.vertical_layout = QtWidgets.QVBoxLayout(event_message_dialog) + self.vertical_layout.setObjectName("verticalLayout") + self.horizontal_layout = QtWidgets.QHBoxLayout() + self.horizontal_layout.setObjectName("horizontalLayout") + self.label_2 = QtWidgets.QLabel(event_message_dialog) + size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) + size_policy.setHorizontalStretch(0) + size_policy.setVerticalStretch(0) + size_policy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) + self.label_2.setSizePolicy(size_policy) + self.label_2.setMinimumSize(QtCore.QSize(91, 17)) + self.label_2.setMaximumSize(QtCore.QSize(135, 29)) + self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.label_2.setObjectName("label_2") + self.horizontal_layout.addWidget(self.label_2) + self.sequence_count = QtWidgets.QSpinBox(event_message_dialog) + self.sequence_count.setReadOnly(True) + self.sequence_count.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) + self.sequence_count.setMaximum(16384) + self.sequence_count.setObjectName("sequenceCount") + self.horizontal_layout.addWidget(self.sequence_count) + spacer_item = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout.addItem(spacer_item) + self.line = QtWidgets.QFrame(event_message_dialog) + self.line.setFrameShape(QtWidgets.QFrame.VLine) + self.line.setFrameShadow(QtWidgets.QFrame.Sunken) + self.line.setObjectName("line") + self.horizontal_layout.addWidget(self.line) + self.label = QtWidgets.QLabel(event_message_dialog) + self.label.setObjectName("label") + self.horizontal_layout.addWidget(self.label) + self.line_2 = QtWidgets.QFrame(event_message_dialog) + self.line_2.setFrameShape(QtWidgets.QFrame.VLine) + self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken) + self.line_2.setObjectName("line_2") + self.horizontal_layout.addWidget(self.line_2) + spacer_item1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout.addItem(spacer_item1) + spacer_item2 = QtWidgets.QSpacerItem(81, 31, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout.addItem(spacer_item2) + self.button_box = QtWidgets.QDialogButtonBox(event_message_dialog) + self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Close) + self.button_box.setObjectName("buttonBox") + self.horizontal_layout.addWidget(self.button_box) + self.vertical_layout.addLayout(self.horizontal_layout) + self.event_output = QtWidgets.QPlainTextEdit(event_message_dialog) + self.event_output.setReadOnly(True) + self.event_output.setObjectName("eventOutput") + self.vertical_layout.addWidget(self.event_output) + + self.retranslateUi(event_message_dialog) + self.button_box.clicked['QAbstractButton*'].connect(event_message_dialog.close) + QtCore.QMetaObject.connectSlotsByName(event_message_dialog) + + def retranslateUi(self, event_message_dialog): + _translate = QtCore.QCoreApplication.translate + event_message_dialog.setWindowTitle(_translate("EventMessageDialog", "Event Messages")) + self.label_2.setText(_translate("EventMessageDialog", "Sequence Count")) + self.label.setText(_translate("EventMessageDialog", "Events")) + diff --git a/Subsystems/tlmGUI/UiGenerictelemetrydialog.py b/Subsystems/tlmGUI/UiGenerictelemetrydialog.py new file mode 100644 index 0000000..04d5f8f --- /dev/null +++ b/Subsystems/tlmGUI/UiGenerictelemetrydialog.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/tlmGUI/GenericTelemetryDialog.ui' +# +# Created by: PyQt5 UI code generator 5.10.1 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class UiGenerictelemetrydialog(object): + def setupUi(self, generic_telemetry_dialog): + generic_telemetry_dialog.setObjectName("GenericTelemetryDialog") + generic_telemetry_dialog.resize(574, 836) + self.label_6 = QtWidgets.QLabel(generic_telemetry_dialog) + self.label_6.setGeometry(QtCore.QRect(29, 750, 711, 61)) + font = QtGui.QFont() + font.setPointSize(12) + self.label_6.setFont(font) + self.label_6.setObjectName("label_6") + self.tbl_telemetry = QtWidgets.QTableWidget(generic_telemetry_dialog) + self.tbl_telemetry.setGeometry(QtCore.QRect(20, 100, 431, 621)) + self.tbl_telemetry.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) + self.tbl_telemetry.setObjectName("tblTelemetry") + self.tbl_telemetry.setColumnCount(2) + self.tbl_telemetry.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + self.tbl_telemetry.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.tbl_telemetry.setHorizontalHeaderItem(1, item) + self.tbl_telemetry.horizontalHeader().setDefaultSectionSize(200) + self.tbl_telemetry.verticalHeader().setVisible(False) + self.button_box = QtWidgets.QDialogButtonBox(generic_telemetry_dialog) + self.button_box.setGeometry(QtCore.QRect(450, 100, 100, 31)) + self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Close) + self.button_box.setObjectName("buttonBox") + self.layout_widget = QtWidgets.QWidget(generic_telemetry_dialog) + self.layout_widget.setGeometry(QtCore.QRect(260, 24, 73, 54)) + self.layout_widget.setObjectName("layoutWidget") + self.vertical_layout = QtWidgets.QVBoxLayout(self.layout_widget) + self.vertical_layout.setContentsMargins(0, 0, 0, 0) + self.vertical_layout.setObjectName("verticalLayout") + self.packet_id_label = QtWidgets.QLabel(self.layout_widget) + size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + size_policy.setHorizontalStretch(0) + size_policy.setVerticalStretch(0) + size_policy.setHeightForWidth(self.packet_id_label.sizePolicy().hasHeightForWidth()) + self.packet_id_label.setSizePolicy(size_policy) + self.packet_id_label.setMinimumSize(QtCore.QSize(0, 21)) + self.packet_id_label.setMaximumSize(QtCore.QSize(16777215, 25)) + self.packet_id_label.setObjectName("packetIdLabel") + self.vertical_layout.addWidget(self.packet_id_label) + self.packet_id = QtWidgets.QLCDNumber(self.layout_widget) + size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) + size_policy.setHorizontalStretch(0) + size_policy.setVerticalStretch(0) + size_policy.setHeightForWidth(self.packet_id.sizePolicy().hasHeightForWidth()) + self.packet_id.setSizePolicy(size_policy) + self.packet_id.setObjectName("packetId") + self.vertical_layout.addWidget(self.packet_id) + self.layout_widget1 = QtWidgets.QWidget(generic_telemetry_dialog) + self.layout_widget1.setGeometry(QtCore.QRect(350, 23, 125, 62)) + self.layout_widget1.setObjectName("layoutWidget1") + self.vertical_layout_3 = QtWidgets.QVBoxLayout(self.layout_widget1) + self.vertical_layout_3.setContentsMargins(0, 0, 0, 0) + self.vertical_layout_3.setObjectName("verticalLayout_3") + self.label_5 = QtWidgets.QLabel(self.layout_widget1) + self.label_5.setObjectName("label_5") + self.vertical_layout_3.addWidget(self.label_5) + self.sequence_count = QtWidgets.QSpinBox(self.layout_widget1) + self.sequence_count.setMinimumSize(QtCore.QSize(101, 31)) + self.sequence_count.setMaximumSize(QtCore.QSize(101, 31)) + self.sequence_count.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) + self.sequence_count.setMaximum(16384) + self.sequence_count.setProperty("value", 0) + self.sequence_count.setObjectName("sequenceCount") + self.vertical_layout_3.addWidget(self.sequence_count) + self.layout_widget2 = QtWidgets.QWidget(generic_telemetry_dialog) + self.layout_widget2.setGeometry(QtCore.QRect(42, 24, 204, 62)) + self.layout_widget2.setObjectName("layoutWidget2") + self.vertical_layout_2 = QtWidgets.QVBoxLayout(self.layout_widget2) + self.vertical_layout_2.setContentsMargins(0, 0, 0, 0) + self.vertical_layout_2.setObjectName("verticalLayout_2") + self.sub_system_telemetry_page_label = QtWidgets.QLabel(self.layout_widget2) + self.sub_system_telemetry_page_label.setObjectName("subSystemTelemetryPageLabel") + self.vertical_layout_2.addWidget(self.sub_system_telemetry_page_label) + self.sub_system_line_edit = QtWidgets.QLineEdit(self.layout_widget2) + self.sub_system_line_edit.setMinimumSize(QtCore.QSize(141, 31)) + self.sub_system_line_edit.setMaximumSize(QtCore.QSize(141, 31)) + self.sub_system_line_edit.setReadOnly(True) + self.sub_system_line_edit.setObjectName("subSystemLineEdit") + self.vertical_layout_2.addWidget(self.sub_system_line_edit) + + self.retranslate_ui(generic_telemetry_dialog) + self.button_box.clicked['QAbstractButton*'].connect(generic_telemetry_dialog.close) + QtCore.QMetaObject.connectSlotsByName(generic_telemetry_dialog) + + def retranslate_ui(self, generic_telemetry_dialog): + _translate = QtCore.QCoreApplication.translate + generic_telemetry_dialog.setWindowTitle(_translate("GenericTelemetryDialog", "Telemetry Page")) + self.label_6.setText(_translate("GenericTelemetryDialog", "\n" +"\n" +"

*No packets? Remember to select the IP address of
your spacecraft in the Main Window.

")) + item = self.tbl_telemetry.horizontalHeaderItem(0) + item.setText(_translate("GenericTelemetryDialog", "Telemetry Point Label")) + item = self.tbl_telemetry.horizontalHeaderItem(1) + item.setText(_translate("GenericTelemetryDialog", "Telemetry Point Value")) + self.packet_id_label.setText(_translate("GenericTelemetryDialog", "Packet ID")) + self.label_5.setText(_translate("GenericTelemetryDialog", "Sequence Count")) + self.sub_system_telemetry_page_label.setText(_translate("GenericTelemetryDialog", "Subsystem Telemetry Page")) + diff --git a/Subsystems/tlmGUI/UiTelemetrysystemdialog.py b/Subsystems/tlmGUI/UiTelemetrysystemdialog.py new file mode 100644 index 0000000..4936ced --- /dev/null +++ b/Subsystems/tlmGUI/UiTelemetrysystemdialog.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/tlmGUI/TelemetrySystemDialog.ui' +# +# Created by: PyQt5 UI code generator 5.10.1 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class UiTelemetrysystemdialog(object): + def setupUi(self, telemetry_system_dialog): + telemetry_system_dialog.setObjectName("TelemetrySystemDialog") + telemetry_system_dialog.resize(625, 908) + self.vertical_layout = QtWidgets.QVBoxLayout(telemetry_system_dialog) + self.vertical_layout.setObjectName("verticalLayout") + self.horizontal_layout = QtWidgets.QHBoxLayout() + self.horizontal_layout.setObjectName("horizontalLayout") + spacer_item = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout.addItem(spacer_item) + self.label = QtWidgets.QLabel(telemetry_system_dialog) + self.label.setObjectName("label") + self.horizontal_layout.addWidget(self.label) + spacer_item1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout.addItem(spacer_item1) + self.vertical_layout.addLayout(self.horizontal_layout) + self.horizontal_layout_3 = QtWidgets.QHBoxLayout() + self.horizontal_layout_3.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint) + self.horizontal_layout_3.setObjectName("horizontalLayout_3") + spacer_item2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout_3.addItem(spacer_item2) + spacer_item3 = QtWidgets.QSpacerItem(80, 32, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout_3.addItem(spacer_item3) + self.horizontal_layout_2 = QtWidgets.QHBoxLayout() + self.horizontal_layout_2.setObjectName("horizontalLayout_2") + spacer_item4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout_2.addItem(spacer_item4) + self.label_6 = QtWidgets.QLabel(telemetry_system_dialog) + self.label_6.setObjectName("label_6") + self.horizontal_layout_2.addWidget(self.label_6) + self.packet_count = QtWidgets.QSpinBox(telemetry_system_dialog) + self.packet_count.setReadOnly(True) + self.packet_count.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) + self.packet_count.setMaximum(16384) + self.packet_count.setProperty("value", 0) + self.packet_count.setObjectName("packetCount") + self.horizontal_layout_2.addWidget(self.packet_count) + spacer_item5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout_2.addItem(spacer_item5) + self.horizontal_layout_3.addLayout(self.horizontal_layout_2) + spacer_item6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout_3.addItem(spacer_item6) + self.button_box = QtWidgets.QDialogButtonBox(telemetry_system_dialog) + self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Close) + self.button_box.setObjectName("buttonBox") + self.horizontal_layout_3.addWidget(self.button_box) + self.vertical_layout.addLayout(self.horizontal_layout_3) + self.horizontal_layout_4 = QtWidgets.QHBoxLayout() + self.horizontal_layout_4.setObjectName("horizontalLayout_4") + spacer_item7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout_4.addItem(spacer_item7) + self.label_2 = QtWidgets.QLabel(telemetry_system_dialog) + self.label_2.setObjectName("label_2") + self.horizontal_layout_4.addWidget(self.label_2) + spacer_item8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontal_layout_4.addItem(spacer_item8) + self.vertical_layout.addLayout(self.horizontal_layout_4) + self.tbl_tlm_sys = QtWidgets.QTableWidget(telemetry_system_dialog) + self.tbl_tlm_sys.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) + self.tbl_tlm_sys.setObjectName("tblTlmSys") + self.tbl_tlm_sys.setColumnCount(4) + self.tbl_tlm_sys.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + self.tbl_tlm_sys.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.tbl_tlm_sys.setHorizontalHeaderItem(1, item) + item = QtWidgets.QTableWidgetItem() + self.tbl_tlm_sys.setHorizontalHeaderItem(2, item) + item = QtWidgets.QTableWidgetItem() + self.tbl_tlm_sys.setHorizontalHeaderItem(3, item) + self.tbl_tlm_sys.verticalHeader().setVisible(False) + self.vertical_layout.addWidget(self.tbl_tlm_sys) + + self.retranslateUi(telemetry_system_dialog) + self.button_box.clicked['QAbstractButton*'].connect(telemetry_system_dialog.close) + QtCore.QMetaObject.connectSlotsByName(telemetry_system_dialog) + + def retranslateUi(self, telemetry_system_dialog): + _translate = QtCore.QCoreApplication.translate + telemetry_system_dialog.setWindowTitle(_translate("TelemetrySystemDialog", "Dialog")) + self.label.setText(_translate("TelemetrySystemDialog", "cFE/CFS Subsystem Telemetry")) + self.label_6.setText(_translate("TelemetrySystemDialog", "Packets Received")) + self.label_2.setText(_translate("TelemetrySystemDialog", "Available Pages")) + item = self.tbl_tlm_sys.horizontalHeaderItem(0) + item.setText(_translate("TelemetrySystemDialog", "Subsystem/Page")) + item = self.tbl_tlm_sys.horizontalHeaderItem(1) + item.setText(_translate("TelemetrySystemDialog", "Packet ID")) + item = self.tbl_tlm_sys.horizontalHeaderItem(2) + item.setText(_translate("TelemetrySystemDialog", "Packet Count")) + item = self.tbl_tlm_sys.horizontalHeaderItem(3) + item.setText(_translate("TelemetrySystemDialog", " ")) + diff --git a/Subsystems/tlmGUI/Ui_EventMessageDialog.py b/Subsystems/tlmGUI/Ui_EventMessageDialog.py deleted file mode 100644 index 8c22a66..0000000 --- a/Subsystems/tlmGUI/Ui_EventMessageDialog.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/tlmGUI/EventMessageDialog.ui' -# -# Created by: PyQt5 UI code generator 5.10.1 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_EventMessageDialog(object): - def setupUi(self, EventMessageDialog): - EventMessageDialog.setObjectName("EventMessageDialog") - EventMessageDialog.resize(591, 277) - self.verticalLayout = QtWidgets.QVBoxLayout(EventMessageDialog) - self.verticalLayout.setObjectName("verticalLayout") - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.label_2 = QtWidgets.QLabel(EventMessageDialog) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) - self.label_2.setSizePolicy(sizePolicy) - self.label_2.setMinimumSize(QtCore.QSize(91, 17)) - self.label_2.setMaximumSize(QtCore.QSize(135, 29)) - self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.label_2.setObjectName("label_2") - self.horizontalLayout.addWidget(self.label_2) - self.sequenceCount = QtWidgets.QSpinBox(EventMessageDialog) - self.sequenceCount.setReadOnly(True) - self.sequenceCount.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) - self.sequenceCount.setMaximum(16384) - self.sequenceCount.setObjectName("sequenceCount") - self.horizontalLayout.addWidget(self.sequenceCount) - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem) - self.line = QtWidgets.QFrame(EventMessageDialog) - self.line.setFrameShape(QtWidgets.QFrame.VLine) - self.line.setFrameShadow(QtWidgets.QFrame.Sunken) - self.line.setObjectName("line") - self.horizontalLayout.addWidget(self.line) - self.label = QtWidgets.QLabel(EventMessageDialog) - self.label.setObjectName("label") - self.horizontalLayout.addWidget(self.label) - self.line_2 = QtWidgets.QFrame(EventMessageDialog) - self.line_2.setFrameShape(QtWidgets.QFrame.VLine) - self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken) - self.line_2.setObjectName("line_2") - self.horizontalLayout.addWidget(self.line_2) - spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem1) - spacerItem2 = QtWidgets.QSpacerItem(81, 31, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem2) - self.buttonBox = QtWidgets.QDialogButtonBox(EventMessageDialog) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close) - self.buttonBox.setObjectName("buttonBox") - self.horizontalLayout.addWidget(self.buttonBox) - self.verticalLayout.addLayout(self.horizontalLayout) - self.eventOutput = QtWidgets.QPlainTextEdit(EventMessageDialog) - self.eventOutput.setReadOnly(True) - self.eventOutput.setObjectName("eventOutput") - self.verticalLayout.addWidget(self.eventOutput) - - self.retranslateUi(EventMessageDialog) - self.buttonBox.clicked['QAbstractButton*'].connect(EventMessageDialog.close) - QtCore.QMetaObject.connectSlotsByName(EventMessageDialog) - - def retranslateUi(self, EventMessageDialog): - _translate = QtCore.QCoreApplication.translate - EventMessageDialog.setWindowTitle(_translate("EventMessageDialog", "Event Messages")) - self.label_2.setText(_translate("EventMessageDialog", "Sequence Count")) - self.label.setText(_translate("EventMessageDialog", "Events")) - diff --git a/Subsystems/tlmGUI/Ui_GenericTelemetryDialog.py b/Subsystems/tlmGUI/Ui_GenericTelemetryDialog.py deleted file mode 100644 index 3937700..0000000 --- a/Subsystems/tlmGUI/Ui_GenericTelemetryDialog.py +++ /dev/null @@ -1,113 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/tlmGUI/GenericTelemetryDialog.ui' -# -# Created by: PyQt5 UI code generator 5.10.1 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_GenericTelemetryDialog(object): - def setupUi(self, GenericTelemetryDialog): - GenericTelemetryDialog.setObjectName("GenericTelemetryDialog") - GenericTelemetryDialog.resize(574, 836) - self.label_6 = QtWidgets.QLabel(GenericTelemetryDialog) - self.label_6.setGeometry(QtCore.QRect(29, 750, 711, 61)) - font = QtGui.QFont() - font.setPointSize(12) - self.label_6.setFont(font) - self.label_6.setObjectName("label_6") - self.tblTelemetry = QtWidgets.QTableWidget(GenericTelemetryDialog) - self.tblTelemetry.setGeometry(QtCore.QRect(20, 100, 431, 621)) - self.tblTelemetry.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) - self.tblTelemetry.setObjectName("tblTelemetry") - self.tblTelemetry.setColumnCount(2) - self.tblTelemetry.setRowCount(0) - item = QtWidgets.QTableWidgetItem() - self.tblTelemetry.setHorizontalHeaderItem(0, item) - item = QtWidgets.QTableWidgetItem() - self.tblTelemetry.setHorizontalHeaderItem(1, item) - self.tblTelemetry.horizontalHeader().setDefaultSectionSize(200) - self.tblTelemetry.verticalHeader().setVisible(False) - self.buttonBox = QtWidgets.QDialogButtonBox(GenericTelemetryDialog) - self.buttonBox.setGeometry(QtCore.QRect(450, 100, 100, 31)) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close) - self.buttonBox.setObjectName("buttonBox") - self.layoutWidget = QtWidgets.QWidget(GenericTelemetryDialog) - self.layoutWidget.setGeometry(QtCore.QRect(260, 24, 73, 54)) - self.layoutWidget.setObjectName("layoutWidget") - self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget) - self.verticalLayout.setContentsMargins(0, 0, 0, 0) - self.verticalLayout.setObjectName("verticalLayout") - self.packetIdLabel = QtWidgets.QLabel(self.layoutWidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.packetIdLabel.sizePolicy().hasHeightForWidth()) - self.packetIdLabel.setSizePolicy(sizePolicy) - self.packetIdLabel.setMinimumSize(QtCore.QSize(0, 21)) - self.packetIdLabel.setMaximumSize(QtCore.QSize(16777215, 25)) - self.packetIdLabel.setObjectName("packetIdLabel") - self.verticalLayout.addWidget(self.packetIdLabel) - self.packetId = QtWidgets.QLCDNumber(self.layoutWidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.packetId.sizePolicy().hasHeightForWidth()) - self.packetId.setSizePolicy(sizePolicy) - self.packetId.setObjectName("packetId") - self.verticalLayout.addWidget(self.packetId) - self.layoutWidget1 = QtWidgets.QWidget(GenericTelemetryDialog) - self.layoutWidget1.setGeometry(QtCore.QRect(350, 23, 125, 62)) - self.layoutWidget1.setObjectName("layoutWidget1") - self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.layoutWidget1) - self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) - self.verticalLayout_3.setObjectName("verticalLayout_3") - self.label_5 = QtWidgets.QLabel(self.layoutWidget1) - self.label_5.setObjectName("label_5") - self.verticalLayout_3.addWidget(self.label_5) - self.sequenceCount = QtWidgets.QSpinBox(self.layoutWidget1) - self.sequenceCount.setMinimumSize(QtCore.QSize(101, 31)) - self.sequenceCount.setMaximumSize(QtCore.QSize(101, 31)) - self.sequenceCount.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) - self.sequenceCount.setMaximum(16384) - self.sequenceCount.setProperty("value", 0) - self.sequenceCount.setObjectName("sequenceCount") - self.verticalLayout_3.addWidget(self.sequenceCount) - self.layoutWidget2 = QtWidgets.QWidget(GenericTelemetryDialog) - self.layoutWidget2.setGeometry(QtCore.QRect(42, 24, 204, 62)) - self.layoutWidget2.setObjectName("layoutWidget2") - self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.layoutWidget2) - self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) - self.verticalLayout_2.setObjectName("verticalLayout_2") - self.subSystemTelemetryPageLabel = QtWidgets.QLabel(self.layoutWidget2) - self.subSystemTelemetryPageLabel.setObjectName("subSystemTelemetryPageLabel") - self.verticalLayout_2.addWidget(self.subSystemTelemetryPageLabel) - self.subSystemLineEdit = QtWidgets.QLineEdit(self.layoutWidget2) - self.subSystemLineEdit.setMinimumSize(QtCore.QSize(141, 31)) - self.subSystemLineEdit.setMaximumSize(QtCore.QSize(141, 31)) - self.subSystemLineEdit.setReadOnly(True) - self.subSystemLineEdit.setObjectName("subSystemLineEdit") - self.verticalLayout_2.addWidget(self.subSystemLineEdit) - - self.retranslateUi(GenericTelemetryDialog) - self.buttonBox.clicked['QAbstractButton*'].connect(GenericTelemetryDialog.close) - QtCore.QMetaObject.connectSlotsByName(GenericTelemetryDialog) - - def retranslateUi(self, GenericTelemetryDialog): - _translate = QtCore.QCoreApplication.translate - GenericTelemetryDialog.setWindowTitle(_translate("GenericTelemetryDialog", "Telemetry Page")) - self.label_6.setText(_translate("GenericTelemetryDialog", "\n" -"\n" -"

*No packets? Remember to select the IP address of
your spacecraft in the Main Window.

")) - item = self.tblTelemetry.horizontalHeaderItem(0) - item.setText(_translate("GenericTelemetryDialog", "Telemetry Point Label")) - item = self.tblTelemetry.horizontalHeaderItem(1) - item.setText(_translate("GenericTelemetryDialog", "Telemetry Point Value")) - self.packetIdLabel.setText(_translate("GenericTelemetryDialog", "Packet ID")) - self.label_5.setText(_translate("GenericTelemetryDialog", "Sequence Count")) - self.subSystemTelemetryPageLabel.setText(_translate("GenericTelemetryDialog", "Subsystem Telemetry Page")) - diff --git a/Subsystems/tlmGUI/Ui_TelemetrySystemDialog.py b/Subsystems/tlmGUI/Ui_TelemetrySystemDialog.py deleted file mode 100644 index 59ffeae..0000000 --- a/Subsystems/tlmGUI/Ui_TelemetrySystemDialog.py +++ /dev/null @@ -1,102 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/Subsystems/tlmGUI/TelemetrySystemDialog.ui' -# -# Created by: PyQt5 UI code generator 5.10.1 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_TelemetrySystemDialog(object): - def setupUi(self, TelemetrySystemDialog): - TelemetrySystemDialog.setObjectName("TelemetrySystemDialog") - TelemetrySystemDialog.resize(625, 908) - self.verticalLayout = QtWidgets.QVBoxLayout(TelemetrySystemDialog) - self.verticalLayout.setObjectName("verticalLayout") - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem) - self.label = QtWidgets.QLabel(TelemetrySystemDialog) - self.label.setObjectName("label") - self.horizontalLayout.addWidget(self.label) - spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem1) - self.verticalLayout.addLayout(self.horizontalLayout) - self.horizontalLayout_3 = QtWidgets.QHBoxLayout() - self.horizontalLayout_3.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint) - self.horizontalLayout_3.setObjectName("horizontalLayout_3") - spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_3.addItem(spacerItem2) - spacerItem3 = QtWidgets.QSpacerItem(80, 32, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_3.addItem(spacerItem3) - self.horizontalLayout_2 = QtWidgets.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_2.addItem(spacerItem4) - self.label_6 = QtWidgets.QLabel(TelemetrySystemDialog) - self.label_6.setObjectName("label_6") - self.horizontalLayout_2.addWidget(self.label_6) - self.packetCount = QtWidgets.QSpinBox(TelemetrySystemDialog) - self.packetCount.setReadOnly(True) - self.packetCount.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) - self.packetCount.setMaximum(16384) - self.packetCount.setProperty("value", 0) - self.packetCount.setObjectName("packetCount") - self.horizontalLayout_2.addWidget(self.packetCount) - spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_2.addItem(spacerItem5) - self.horizontalLayout_3.addLayout(self.horizontalLayout_2) - spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_3.addItem(spacerItem6) - self.buttonBox = QtWidgets.QDialogButtonBox(TelemetrySystemDialog) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close) - self.buttonBox.setObjectName("buttonBox") - self.horizontalLayout_3.addWidget(self.buttonBox) - self.verticalLayout.addLayout(self.horizontalLayout_3) - self.horizontalLayout_4 = QtWidgets.QHBoxLayout() - self.horizontalLayout_4.setObjectName("horizontalLayout_4") - spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_4.addItem(spacerItem7) - self.label_2 = QtWidgets.QLabel(TelemetrySystemDialog) - self.label_2.setObjectName("label_2") - self.horizontalLayout_4.addWidget(self.label_2) - spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_4.addItem(spacerItem8) - self.verticalLayout.addLayout(self.horizontalLayout_4) - self.tblTlmSys = QtWidgets.QTableWidget(TelemetrySystemDialog) - self.tblTlmSys.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) - self.tblTlmSys.setObjectName("tblTlmSys") - self.tblTlmSys.setColumnCount(4) - self.tblTlmSys.setRowCount(0) - item = QtWidgets.QTableWidgetItem() - self.tblTlmSys.setHorizontalHeaderItem(0, item) - item = QtWidgets.QTableWidgetItem() - self.tblTlmSys.setHorizontalHeaderItem(1, item) - item = QtWidgets.QTableWidgetItem() - self.tblTlmSys.setHorizontalHeaderItem(2, item) - item = QtWidgets.QTableWidgetItem() - self.tblTlmSys.setHorizontalHeaderItem(3, item) - self.tblTlmSys.verticalHeader().setVisible(False) - self.verticalLayout.addWidget(self.tblTlmSys) - - self.retranslateUi(TelemetrySystemDialog) - self.buttonBox.clicked['QAbstractButton*'].connect(TelemetrySystemDialog.close) - QtCore.QMetaObject.connectSlotsByName(TelemetrySystemDialog) - - def retranslateUi(self, TelemetrySystemDialog): - _translate = QtCore.QCoreApplication.translate - TelemetrySystemDialog.setWindowTitle(_translate("TelemetrySystemDialog", "Dialog")) - self.label.setText(_translate("TelemetrySystemDialog", "cFE/CFS Subsystem Telemetry")) - self.label_6.setText(_translate("TelemetrySystemDialog", "Packets Received")) - self.label_2.setText(_translate("TelemetrySystemDialog", "Available Pages")) - item = self.tblTlmSys.horizontalHeaderItem(0) - item.setText(_translate("TelemetrySystemDialog", "Subsystem/Page")) - item = self.tblTlmSys.horizontalHeaderItem(1) - item.setText(_translate("TelemetrySystemDialog", "Packet ID")) - item = self.tblTlmSys.horizontalHeaderItem(2) - item.setText(_translate("TelemetrySystemDialog", "Packet Count")) - item = self.tblTlmSys.horizontalHeaderItem(3) - item.setText(_translate("TelemetrySystemDialog", " ")) - diff --git a/TlmUDPSender.py b/TlmUDPSender.py index 9e37357..108299b 100644 --- a/TlmUDPSender.py +++ b/TlmUDPSender.py @@ -39,6 +39,6 @@ # send_host = "192.168.1.4" send_port = 1235 datagram = b'Test tlm message' - sendSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - sendSocket.sendto(datagram, (send_host, send_port)) + send_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + send_socket.sendto(datagram, (send_host, send_port)) print(f'Sent msg #{num} to {send_host}:{send_port}') diff --git a/UiMainWindow.py b/UiMainWindow.py new file mode 100644 index 0000000..7382fcb --- /dev/null +++ b/UiMainWindow.py @@ -0,0 +1,180 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/MainWindow.ui' +# +# Created by: PyQt5 UI code generator 5.10.1 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class UiMainWindow(object): + def setupUi(self, main_window): + main_window.setObjectName("MainWindow") + main_window.setEnabled(True) + main_window.resize(552, 305) + size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + size_policy.setHorizontalStretch(24) + size_policy.setVerticalStretch(0) + size_policy.setHeightForWidth(main_window.sizePolicy().hasHeightForWidth()) + main_window.setSizePolicy(size_policy) + self.central_widget = QtWidgets.QWidget(main_window) + self.central_widget.setObjectName("centralwidget") + self.vertical_layout = QtWidgets.QVBoxLayout(self.central_widget) + self.vertical_layout.setObjectName("verticalLayout") + self.label_home_title = QtWidgets.QLabel(self.central_widget) + font = QtGui.QFont() + font.setPointSize(22) + font.setBold(False) + font.setWeight(50) + self.label_home_title.setFont(font) + self.label_home_title.setAlignment(QtCore.Qt.AlignCenter) + self.label_home_title.setObjectName("labelHomeTitle") + self.vertical_layout.addWidget(self.label_home_title) + self.line_2 = QtWidgets.QFrame(self.central_widget) + self.line_2.setFrameShape(QtWidgets.QFrame.HLine) + self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken) + self.line_2.setObjectName("line_2") + self.vertical_layout.addWidget(self.line_2) + self.grid_layout = QtWidgets.QGridLayout() + self.grid_layout.setObjectName("gridLayout") + self.label_3 = QtWidgets.QLabel(self.central_widget) + size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) + size_policy.setHorizontalStretch(0) + size_policy.setVerticalStretch(0) + size_policy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) + self.label_3.setSizePolicy(size_policy) + self.label_3.setMinimumSize(QtCore.QSize(141, 0)) + self.label_3.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) + self.label_3.setObjectName("label_3") + self.grid_layout.addWidget(self.label_3, 0, 0, 1, 1) + self.combo_box_ip_addresses = QtWidgets.QComboBox(self.central_widget) + self.combo_box_ip_addresses.setMinimumSize(QtCore.QSize(132, 0)) + self.combo_box_ip_addresses.setMaximumSize(QtCore.QSize(132, 16777215)) + self.combo_box_ip_addresses.setObjectName("comboBoxIpAddresses") + self.combo_box_ip_addresses.addItem("") + self.grid_layout.addWidget(self.combo_box_ip_addresses, 0, 1, 1, 1) + self.label_4 = QtWidgets.QLabel(self.central_widget) + size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) + size_policy.setHorizontalStretch(0) + size_policy.setVerticalStretch(0) + size_policy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) + self.label_4.setSizePolicy(size_policy) + self.label_4.setMinimumSize(QtCore.QSize(169, 0)) + self.label_4.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) + self.label_4.setObjectName("label_4") + self.grid_layout.addWidget(self.label_4, 1, 0, 1, 1) + self.cb_tlm_header_ver = QtWidgets.QComboBox(self.central_widget) + self.cb_tlm_header_ver.setMinimumSize(QtCore.QSize(132, 0)) + self.cb_tlm_header_ver.setMaximumSize(QtCore.QSize(132, 16777215)) + self.cb_tlm_header_ver.setObjectName("cbTlmHeaderVer") + self.cb_tlm_header_ver.addItem("") + self.cb_tlm_header_ver.addItem("") + self.cb_tlm_header_ver.addItem("") + self.grid_layout.addWidget(self.cb_tlm_header_ver, 1, 1, 1, 1) + self.label_2 = QtWidgets.QLabel(self.central_widget) + self.label_2.setObjectName("label_2") + self.grid_layout.addWidget(self.label_2, 2, 0, 1, 1) + self.sb_tlm_offset = QtWidgets.QSpinBox(self.central_widget) + self.sb_tlm_offset.setEnabled(False) + self.sb_tlm_offset.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) + self.sb_tlm_offset.setObjectName("sbTlmOffset") + self.grid_layout.addWidget(self.sb_tlm_offset, 1, 2, 1, 1) + self.sb_cmd_offset_pri = QtWidgets.QSpinBox(self.central_widget) + self.sb_cmd_offset_pri.setEnabled(False) + self.sb_cmd_offset_pri.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) + self.sb_cmd_offset_pri.setObjectName("sbCmdOffsetPri") + self.grid_layout.addWidget(self.sb_cmd_offset_pri, 2, 2, 1, 1) + self.cb_cmd_header_ver = QtWidgets.QComboBox(self.central_widget) + self.cb_cmd_header_ver.setObjectName("cbCmdHeaderVer") + self.cb_cmd_header_ver.addItem("") + self.cb_cmd_header_ver.addItem("") + self.cb_cmd_header_ver.addItem("") + self.grid_layout.addWidget(self.cb_cmd_header_ver, 2, 1, 1, 1) + self.sb_cmd_offset_sec = QtWidgets.QSpinBox(self.central_widget) + self.sb_cmd_offset_sec.setEnabled(False) + self.sb_cmd_offset_sec.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) + self.sb_cmd_offset_sec.setObjectName("sbCmdOffsetSec") + self.grid_layout.addWidget(self.sb_cmd_offset_sec, 2, 3, 1, 1) + self.label = QtWidgets.QLabel(self.central_widget) + self.label.setObjectName("label") + self.grid_layout.addWidget(self.label, 0, 2, 1, 1) + self.label_6 = QtWidgets.QLabel(self.central_widget) + self.label_6.setObjectName("label_6") + self.grid_layout.addWidget(self.label_6, 0, 3, 1, 1) + self.vertical_layout.addLayout(self.grid_layout) + self.horizontal_layout_2 = QtWidgets.QHBoxLayout() + self.horizontal_layout_2.setSpacing(32) + self.horizontal_layout_2.setObjectName("horizontalLayout_2") + self.push_button_start_tlm = QtWidgets.QPushButton(self.central_widget) + size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + size_policy.setHorizontalStretch(0) + size_policy.setVerticalStretch(0) + size_policy.setHeightForWidth(self.push_button_start_tlm.sizePolicy().hasHeightForWidth()) + self.push_button_start_tlm.setSizePolicy(size_policy) + self.push_button_start_tlm.setObjectName("pushButtonStartTlm") + self.horizontal_layout_2.addWidget(self.push_button_start_tlm) + self.push_button_start_cmd = QtWidgets.QPushButton(self.central_widget) + size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + size_policy.setHorizontalStretch(0) + size_policy.setVerticalStretch(0) + size_policy.setHeightForWidth(self.push_button_start_cmd.sizePolicy().hasHeightForWidth()) + self.push_button_start_cmd.setSizePolicy(size_policy) + self.push_button_start_cmd.setObjectName("pushButtonStartCmd") + self.horizontal_layout_2.addWidget(self.push_button_start_cmd) + self.vertical_layout.addLayout(self.horizontal_layout_2) + self.line = QtWidgets.QFrame(self.central_widget) + self.line.setFrameShape(QtWidgets.QFrame.HLine) + self.line.setFrameShadow(QtWidgets.QFrame.Sunken) + self.line.setObjectName("line") + self.vertical_layout.addWidget(self.line) + self.horizontal_layout_4 = QtWidgets.QHBoxLayout() + self.horizontal_layout_4.setObjectName("horizontalLayout_4") + self.label_5 = QtWidgets.QLabel(self.central_widget) + font = QtGui.QFont() + font.setPointSize(11) + self.label_5.setFont(font) + self.label_5.setObjectName("label_5") + self.horizontal_layout_4.addWidget(self.label_5) + self.push_button = QtWidgets.QPushButton(self.central_widget) + size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + size_policy.setHorizontalStretch(0) + size_policy.setVerticalStretch(0) + size_policy.setHeightForWidth(self.push_button.sizePolicy().hasHeightForWidth()) + self.push_button.setSizePolicy(size_policy) + self.push_button.setObjectName("pushButton") + self.horizontal_layout_4.addWidget(self.push_button) + self.vertical_layout.addLayout(self.horizontal_layout_4) + main_window.setCentralWidget(self.central_widget) + + self.retranslate_ui(main_window) + self.push_button.clicked.connect(main_window.close) + QtCore.QMetaObject.connectSlotsByName(main_window) + + def retranslate_ui(self, main_window): + _translate = QtCore.QCoreApplication.translate + main_window.setWindowTitle(_translate("MainWindow", "Main Window")) + self.label_home_title.setText(_translate("MainWindow", "CFS Ground System")) + self.label_3.setText(_translate("MainWindow", "Selected IP Address")) + self.combo_box_ip_addresses.setItemText(0, _translate("MainWindow", "All")) + self.label_4.setText(_translate("MainWindow", "Tlm header version")) + self.cb_tlm_header_ver.setItemText(0, _translate("MainWindow", "1")) + self.cb_tlm_header_ver.setItemText(1, _translate("MainWindow", "2")) + self.cb_tlm_header_ver.setItemText(2, _translate("MainWindow", "Custom")) + self.label_2.setText(_translate("MainWindow", "Cmd header version")) + self.sb_tlm_offset.setToolTip(_translate("MainWindow", + "

Offset (in bytes) to be added to existing offsets listed in telemetry text files

")) + self.sb_cmd_offset_pri.setToolTip(_translate("MainWindow", + "

Offset (in bytes) to be added after the primary header in a command packet

")) + self.cb_cmd_header_ver.setItemText(0, _translate("MainWindow", "1")) + self.cb_cmd_header_ver.setItemText(1, _translate("MainWindow", "2")) + self.cb_cmd_header_ver.setItemText(2, _translate("MainWindow", "Custom")) + self.sb_cmd_offset_sec.setToolTip(_translate("MainWindow", + "

Offset (in bytes) to be added after the secondary header in a command packet

")) + self.label.setText(_translate("MainWindow", "Offsets")) + self.label_6.setText(_translate("MainWindow", "(Hover for info)")) + self.push_button_start_tlm.setText(_translate("MainWindow", "Start Telemetry System")) + self.push_button_start_cmd.setText(_translate("MainWindow", "Start Command System")) + self.label_5.setText(_translate("MainWindow", "*Read Guide-GroundSystem.txt for help")) + self.push_button.setText(_translate("MainWindow", "Close")) diff --git a/Ui_MainWindow.py b/Ui_MainWindow.py deleted file mode 100644 index d020d3f..0000000 --- a/Ui_MainWindow.py +++ /dev/null @@ -1,177 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file '/home/lbleier/cFS/tools/cFS-GroundSystem/MainWindow.ui' -# -# Created by: PyQt5 UI code generator 5.10.1 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.setEnabled(True) - MainWindow.resize(552, 305) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(24) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) - MainWindow.setSizePolicy(sizePolicy) - self.centralwidget = QtWidgets.QWidget(MainWindow) - self.centralwidget.setObjectName("centralwidget") - self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget) - self.verticalLayout.setObjectName("verticalLayout") - self.labelHomeTitle = QtWidgets.QLabel(self.centralwidget) - font = QtGui.QFont() - font.setPointSize(22) - font.setBold(False) - font.setWeight(50) - self.labelHomeTitle.setFont(font) - self.labelHomeTitle.setAlignment(QtCore.Qt.AlignCenter) - self.labelHomeTitle.setObjectName("labelHomeTitle") - self.verticalLayout.addWidget(self.labelHomeTitle) - self.line_2 = QtWidgets.QFrame(self.centralwidget) - self.line_2.setFrameShape(QtWidgets.QFrame.HLine) - self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken) - self.line_2.setObjectName("line_2") - self.verticalLayout.addWidget(self.line_2) - self.gridLayout = QtWidgets.QGridLayout() - self.gridLayout.setObjectName("gridLayout") - self.label_3 = QtWidgets.QLabel(self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) - self.label_3.setSizePolicy(sizePolicy) - self.label_3.setMinimumSize(QtCore.QSize(141, 0)) - self.label_3.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) - self.label_3.setObjectName("label_3") - self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1) - self.comboBoxIpAddresses = QtWidgets.QComboBox(self.centralwidget) - self.comboBoxIpAddresses.setMinimumSize(QtCore.QSize(132, 0)) - self.comboBoxIpAddresses.setMaximumSize(QtCore.QSize(132, 16777215)) - self.comboBoxIpAddresses.setObjectName("comboBoxIpAddresses") - self.comboBoxIpAddresses.addItem("") - self.gridLayout.addWidget(self.comboBoxIpAddresses, 0, 1, 1, 1) - self.label_4 = QtWidgets.QLabel(self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) - self.label_4.setSizePolicy(sizePolicy) - self.label_4.setMinimumSize(QtCore.QSize(169, 0)) - self.label_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) - self.label_4.setObjectName("label_4") - self.gridLayout.addWidget(self.label_4, 1, 0, 1, 1) - self.cbTlmHeaderVer = QtWidgets.QComboBox(self.centralwidget) - self.cbTlmHeaderVer.setMinimumSize(QtCore.QSize(132, 0)) - self.cbTlmHeaderVer.setMaximumSize(QtCore.QSize(132, 16777215)) - self.cbTlmHeaderVer.setObjectName("cbTlmHeaderVer") - self.cbTlmHeaderVer.addItem("") - self.cbTlmHeaderVer.addItem("") - self.cbTlmHeaderVer.addItem("") - self.gridLayout.addWidget(self.cbTlmHeaderVer, 1, 1, 1, 1) - self.label_2 = QtWidgets.QLabel(self.centralwidget) - self.label_2.setObjectName("label_2") - self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1) - self.sbTlmOffset = QtWidgets.QSpinBox(self.centralwidget) - self.sbTlmOffset.setEnabled(False) - self.sbTlmOffset.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) - self.sbTlmOffset.setObjectName("sbTlmOffset") - self.gridLayout.addWidget(self.sbTlmOffset, 1, 2, 1, 1) - self.sbCmdOffsetPri = QtWidgets.QSpinBox(self.centralwidget) - self.sbCmdOffsetPri.setEnabled(False) - self.sbCmdOffsetPri.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) - self.sbCmdOffsetPri.setObjectName("sbCmdOffsetPri") - self.gridLayout.addWidget(self.sbCmdOffsetPri, 2, 2, 1, 1) - self.cbCmdHeaderVer = QtWidgets.QComboBox(self.centralwidget) - self.cbCmdHeaderVer.setObjectName("cbCmdHeaderVer") - self.cbCmdHeaderVer.addItem("") - self.cbCmdHeaderVer.addItem("") - self.cbCmdHeaderVer.addItem("") - self.gridLayout.addWidget(self.cbCmdHeaderVer, 2, 1, 1, 1) - self.sbCmdOffsetSec = QtWidgets.QSpinBox(self.centralwidget) - self.sbCmdOffsetSec.setEnabled(False) - self.sbCmdOffsetSec.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) - self.sbCmdOffsetSec.setObjectName("sbCmdOffsetSec") - self.gridLayout.addWidget(self.sbCmdOffsetSec, 2, 3, 1, 1) - self.label = QtWidgets.QLabel(self.centralwidget) - self.label.setObjectName("label") - self.gridLayout.addWidget(self.label, 0, 2, 1, 1) - self.label_6 = QtWidgets.QLabel(self.centralwidget) - self.label_6.setObjectName("label_6") - self.gridLayout.addWidget(self.label_6, 0, 3, 1, 1) - self.verticalLayout.addLayout(self.gridLayout) - self.horizontalLayout_2 = QtWidgets.QHBoxLayout() - self.horizontalLayout_2.setSpacing(32) - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - self.pushButtonStartTlm = QtWidgets.QPushButton(self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButtonStartTlm.sizePolicy().hasHeightForWidth()) - self.pushButtonStartTlm.setSizePolicy(sizePolicy) - self.pushButtonStartTlm.setObjectName("pushButtonStartTlm") - self.horizontalLayout_2.addWidget(self.pushButtonStartTlm) - self.pushButtonStartCmd = QtWidgets.QPushButton(self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButtonStartCmd.sizePolicy().hasHeightForWidth()) - self.pushButtonStartCmd.setSizePolicy(sizePolicy) - self.pushButtonStartCmd.setObjectName("pushButtonStartCmd") - self.horizontalLayout_2.addWidget(self.pushButtonStartCmd) - self.verticalLayout.addLayout(self.horizontalLayout_2) - self.line = QtWidgets.QFrame(self.centralwidget) - self.line.setFrameShape(QtWidgets.QFrame.HLine) - self.line.setFrameShadow(QtWidgets.QFrame.Sunken) - self.line.setObjectName("line") - self.verticalLayout.addWidget(self.line) - self.horizontalLayout_4 = QtWidgets.QHBoxLayout() - self.horizontalLayout_4.setObjectName("horizontalLayout_4") - self.label_5 = QtWidgets.QLabel(self.centralwidget) - font = QtGui.QFont() - font.setPointSize(11) - self.label_5.setFont(font) - self.label_5.setObjectName("label_5") - self.horizontalLayout_4.addWidget(self.label_5) - self.pushButton = QtWidgets.QPushButton(self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth()) - self.pushButton.setSizePolicy(sizePolicy) - self.pushButton.setObjectName("pushButton") - self.horizontalLayout_4.addWidget(self.pushButton) - self.verticalLayout.addLayout(self.horizontalLayout_4) - MainWindow.setCentralWidget(self.centralwidget) - - self.retranslateUi(MainWindow) - self.pushButton.clicked.connect(MainWindow.close) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - - def retranslateUi(self, MainWindow): - _translate = QtCore.QCoreApplication.translate - MainWindow.setWindowTitle(_translate("MainWindow", "Main Window")) - self.labelHomeTitle.setText(_translate("MainWindow", "CFS Ground System")) - self.label_3.setText(_translate("MainWindow", "Selected IP Address")) - self.comboBoxIpAddresses.setItemText(0, _translate("MainWindow", "All")) - self.label_4.setText(_translate("MainWindow", "Tlm header version")) - self.cbTlmHeaderVer.setItemText(0, _translate("MainWindow", "1")) - self.cbTlmHeaderVer.setItemText(1, _translate("MainWindow", "2")) - self.cbTlmHeaderVer.setItemText(2, _translate("MainWindow", "Custom")) - self.label_2.setText(_translate("MainWindow", "Cmd header version")) - self.sbTlmOffset.setToolTip(_translate("MainWindow", "

Offset (in bytes) to be added to existing offsets listed in telemetry text files

")) - self.sbCmdOffsetPri.setToolTip(_translate("MainWindow", "

Offset (in bytes) to be added after the primary header in a command packet

")) - self.cbCmdHeaderVer.setItemText(0, _translate("MainWindow", "1")) - self.cbCmdHeaderVer.setItemText(1, _translate("MainWindow", "2")) - self.cbCmdHeaderVer.setItemText(2, _translate("MainWindow", "Custom")) - self.sbCmdOffsetSec.setToolTip(_translate("MainWindow", "

Offset (in bytes) to be added after the secondary header in a command packet

")) - self.label.setText(_translate("MainWindow", "Offsets")) - self.label_6.setText(_translate("MainWindow", "(Hover for info)")) - self.pushButtonStartTlm.setText(_translate("MainWindow", "Start Telemetry System")) - self.pushButtonStartCmd.setText(_translate("MainWindow", "Start Command System")) - self.label_5.setText(_translate("MainWindow", "*Read Guide-GroundSystem.txt for help")) - self.pushButton.setText(_translate("MainWindow", "Close")) - diff --git a/_version.py b/_version.py index c5d02b9..f69dcf6 100644 --- a/_version.py +++ b/_version.py @@ -20,15 +20,15 @@ # # Development Build Macro Definitions -_cFS_GrndSys_build_number = 63 -_cFS_GrndSys_build_baseline = "v2.2.0-rc1" +_cFS_GrndSys_build_number = 7 +_cFS_GrndSys_build_baseline = "v3.0.0-rc4" # Version Number Definitions # ONLY APPLY for OFFICIAL release builds _cFS_GrndSys_MAJOR = 2 _cFS_GrndSys_MINOR = 1 -_cFS_GrndSys_REVISION = 99 -_cFS_GrndSys_MISSIONREV = 0 +_cFS_GrndSys_REVISION = 0 +_cFS_GrndSys_MISSIONREV = 255 # Development Build format for __version__ # Baseline git tag + Number of commits since baseline diff --git a/setup.py b/setup.py index 7dd13ba..cd61db7 100644 --- a/setup.py +++ b/setup.py @@ -2,13 +2,13 @@ from _version import __version__ as _version setup( - name='cFS-GroundSystem', - packages=['Subsystems','Subsystems.tlmGUI','Subsystems.cmdGui','Subsystems.cmdUtil'], - include_package_data=True, - version=_version, - entry_points={ - 'console_scripts':[ - 'cFS-GroundSystem=GroundSystem:main' - ] - }, - ) + name='cFS-GroundSystem', + packages=['Subsystems', 'Subsystems.tlmGUI', 'Subsystems.cmdGui', 'Subsystems.cmdUtil'], + include_package_data=True, + version=_version, + entry_points={ + 'console_scripts': [ + 'cFS-GroundSystem=GroundSystem:main' + ] + }, +)