diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Test.xml b/.idea/runConfigurations/OBSW_TmTcClient_Test.xml new file mode 100644 index 0000000000000000000000000000000000000000..7524486bbfcb468b7f28b212c0ee4d734b1df5c9 --- /dev/null +++ b/.idea/runConfigurations/OBSW_TmTcClient_Test.xml @@ -0,0 +1,24 @@ +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="OBSW_TmTcClient Test" type="PythonConfigurationType" factoryName="Python"> + <module name="tmtc" /> + <option name="INTERPRETER_OPTIONS" value="" /> + <option name="PARENT_ENVS" value="true" /> + <envs> + <env name="PYTHONUNBUFFERED" value="1" /> + </envs> + <option name="SDK_HOME" value="" /> + <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> + <option name="IS_MODULE_SDK" value="true" /> + <option name="ADD_CONTENT_ROOTS" value="true" /> + <option name="ADD_SOURCE_ROOTS" value="true" /> + <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> + <option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" /> + <option name="PARAMETERS" value="-h" /> + <option name="SHOW_COMMAND_LINE" value="false" /> + <option name="EMULATE_TERMINAL" value="false" /> + <option name="MODULE_MODE" value="false" /> + <option name="REDIRECT_INPUT" value="false" /> + <option name="INPUT_FILE" value="" /> + <method v="2" /> + </configuration> +</component> \ No newline at end of file diff --git a/OBSW_TmTcClient.py b/OBSW_TmTcClient.py index 69305d4d979cb613512a8d6596a90aa72b7138d1..116dbe63da6557905185ac200555b152cc2ec98a 100644 --- a/OBSW_TmTcClient.py +++ b/OBSW_TmTcClient.py @@ -69,14 +69,20 @@ from utility.OBSW_ArgParser import parseInputArguments from utility.OBSW_TmTcPrinter import TmtcPrinter from comIF.OBSW_Ethernet_ComIF import EthernetComIF from comIF.OBSW_Serial_ComIF import SerialComIF +from gui.OBSW_TmtcGUI import TmtcGUI def main(): args = parseInputArguments() setGlobals(args) tmtcPrinter = TmtcPrinter(g.displayMode, g.printToFile, True) - communicationInterface = setCommunicationInterface(tmtcPrinter) - atexit.register(communicationInterface.keyboardInterruptHandler) + communicationInterface = 0 + if g.modeId == "GUIMode": + GUI = TmtcGUI() + GUI.open() + else: + communicationInterface = setCommunicationInterface(tmtcPrinter) + atexit.register(communicationInterface.keyboardInterruptHandler) if g.modeId == "ListenerMode": Receiver = CommandSenderReceiver(communicationInterface, tmtcPrinter, g.tmTimeout, g.tcSendTimeoutFactor, g.printToFile) diff --git a/config/OBSW_Config.py b/config/OBSW_Config.py index 6608e594d9dd0cd15a1be6508cd0f1ed7b201891..45a312ac99faa5e20e513a9a45d09b6ddc5e6801 100644 --- a/config/OBSW_Config.py +++ b/config/OBSW_Config.py @@ -69,8 +69,7 @@ def setGlobals(args): global recAddress, sendAddress, scriptMode, modeId, service, displayMode, comIF, comPort, serialTimeout global tmTimeout, tcSendTimeoutFactor, sockSend, sockReceive, printToFile, printHkData, printRawTmData if args.mode == 0: - print("GUI mode not implemented yet. Try other modes") - exit() + print("GUI mode not implemented yet !") if args.shortDisplayMode: displayMode = "short" else: diff --git a/config/__init__.py b/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/gui/OBSW_TmtcGUI.py b/gui/OBSW_TmtcGUI.py index a64eca3168473920b38cd7a439772df54c0a1ace..23c13e8f44ab2c229d024bdcb4e7985ac55ff5eb 100644 --- a/gui/OBSW_TmtcGUI.py +++ b/gui/OBSW_TmtcGUI.py @@ -15,6 +15,7 @@ """ from tkinter import * + # A first simple version has drop down menus to chose all necessary options # which are normally handled by the args parser. # when pressing save, all chosen values get passed to the globals file (OBSW_Config) @@ -22,6 +23,13 @@ from tkinter import * # A third button to perform a keyboard interrupt should be implemented # include a really nice source badge and make it large ! # plan this on paper first... -window = Tk() -window.title("Hallo Welt") -window.mainloop() +class TmtcGUI: + def __init__(self): + self.window = Tk() + + def open(self): + self.window.title("Hallo Welt") + self.window.mainloop() + + def close(self): + self.window.quit() diff --git a/sendreceive/__init__.py b/sendreceive/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tc/__init__.py b/tc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tm/__init__.py b/tm/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/utility/__init__.py b/utility/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391