diff --git a/.idea/runConfigurations/OBSW_UdpClient_GPS0_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_GPS0_Serial.xml similarity index 86% rename from .idea/runConfigurations/OBSW_UdpClient_GPS0_Serial.xml rename to .idea/runConfigurations/OBSW_TmTcClient_GPS0_Serial.xml index ba1c3707892750476f676e3e2e6dae06a8b7acf4..09af589ec8c66c0128f16d1dde3460d3ffb6b47d 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_GPS0_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_GPS0_Serial.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="OBSW_UdpClient GPS0 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> + <configuration default="false" name="OBSW_TmTcClient GPS0 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <module name="tmtc" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_GPS1_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_GPS1_Serial.xml similarity index 76% rename from .idea/runConfigurations/OBSW_UdpClient_GPS1_Serial.xml rename to .idea/runConfigurations/OBSW_TmTcClient_GPS1_Serial.xml index f44bd48e740b9432829f0057ef061edd949d2578..efc9a7fb9eb4bbec015c5fc73cb6f2e5722888a1 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_GPS1_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_GPS1_Serial.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="OBSW_UdpClient GPS1 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> + <configuration default="false" name="OBSW_TmTcClient GPS1 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <module name="tmtc" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> @@ -12,7 +12,7 @@ <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="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="$PROJECT_DIR$/../../../../../../../Robin/NoSyncDokumente/sourceobsw/tmtc/OBSW_TmTcClient.py" /> <option name="PARAMETERS" value="-m 3 -s GPS1 -c 1" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_2_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_Service_2_Serial.xml similarity index 76% rename from .idea/runConfigurations/OBSW_UdpClient_Service_2_Serial.xml rename to .idea/runConfigurations/OBSW_TmTcClient_Service_2_Serial.xml index c832a76c20f08a38802e657f94abeefaafc9db70..caaa02f4f038c4064ead2851c52361690cb55267 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_2_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Service_2_Serial.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="OBSW_UdpClient Service 2 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> + <configuration default="false" name="OBSW_TmTcClient Service 2 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <module name="tmtc" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> @@ -12,7 +12,7 @@ <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="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="$PROJECT_DIR$/../../../../../../../Robin/NoSyncDokumente/sourceobsw/tmtc/OBSW_TmTcClient.py" /> <option name="PARAMETERS" value="-m 3 -s 2 -p -c 1" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_3_Serial_.xml b/.idea/runConfigurations/OBSW_TmTcClient_Service_3_Serial_.xml similarity index 86% rename from .idea/runConfigurations/OBSW_UdpClient_Service_3_Serial_.xml rename to .idea/runConfigurations/OBSW_TmTcClient_Service_3_Serial_.xml index ded0da255f7f8546938e02734ce809f2e4303e61..b2d26715d6a80233a6b8fb332249c2daea99a1ec 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_3_Serial_.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Service_3_Serial_.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="OBSW_UdpClient Service 3 Serial " type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> + <configuration default="false" name="OBSW_TmTcClient Service 3 Serial " type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <module name="tmtc" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_5_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_Service_5_Serial.xml similarity index 76% rename from .idea/runConfigurations/OBSW_UdpClient_Service_5_Serial.xml rename to .idea/runConfigurations/OBSW_TmTcClient_Service_5_Serial.xml index 46c3c45d18991eea64d7f788d466fbf38ff9faa0..711bf6fa0f0523453efb72ff3db12c33889a04d4 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_5_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Service_5_Serial.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="OBSW_UdpClient Service 5 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> + <configuration default="false" name="OBSW_TmTcClient Service 5 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <module name="tmtc" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> @@ -12,7 +12,7 @@ <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="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="$PROJECT_DIR$/../../../../../../../Robin/NoSyncDokumente/sourceobsw/tmtc/OBSW_TmTcClient.py" /> <option name="PARAMETERS" value="-m 3 -s 5 -c 1 -p" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_8_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_Service_8_Serial.xml similarity index 76% rename from .idea/runConfigurations/OBSW_UdpClient_Service_8_Serial.xml rename to .idea/runConfigurations/OBSW_TmTcClient_Service_8_Serial.xml index 4c7bf512efc5943a7e0c3b45b7ed9a26e9eb3587..5d938cdddcbecb7d62483648b71c122c8f48fef8 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_8_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Service_8_Serial.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="OBSW_UdpClient Service 8 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> + <configuration default="false" name="OBSW_TmTcClient Service 8 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <module name="tmtc" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> @@ -12,7 +12,7 @@ <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="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\OBSW_TmTcClient.py" /> + <option name="SCRIPT_NAME" value="$PROJECT_DIR$/../../../../../../../Robin/NoSyncDokumente/sourceobsw/tmtc/OBSW_TmTcClient.py" /> <option name="PARAMETERS" value="-m 3 -s 8 -p -c 1" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_9_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_Service_9_Serial.xml similarity index 86% rename from .idea/runConfigurations/OBSW_UdpClient_Service_9_Serial.xml rename to .idea/runConfigurations/OBSW_TmTcClient_Service_9_Serial.xml index 12e291875dd5ada9421fdfbf34e7c4fda6202ed5..07b98328c0a8457dc11bb2a4c8ba528dd5abd5cc 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_9_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Service_9_Serial.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="OBSW_UdpClient Service 9 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> + <configuration default="false" name="OBSW_TmTcClient Service 9 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <module name="tmtc" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Software_Serial.xml b/.idea/runConfigurations/OBSW_TmTcClient_Software_Serial.xml similarity index 86% rename from .idea/runConfigurations/OBSW_UdpClient_Software_Serial.xml rename to .idea/runConfigurations/OBSW_TmTcClient_Software_Serial.xml index a1a1c3eb4071aa6ed2c95151b01dba14ae6c529a..1d7176cf51f6959c281712f3222a8c21d4a2c10d 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Software_Serial.xml +++ b/.idea/runConfigurations/OBSW_TmTcClient_Software_Serial.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="OBSW_UdpClient Software Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> + <configuration default="false" name="OBSW_TmTcClient Software Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <module name="tmtc" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> diff --git a/OBSW_TmTcClient.py b/OBSW_TmTcClient.py index ac2e0d63658acab7e54728b9959d17eba4bb9b7d..c202aef75bfb098e6f7fb15866b2e6ed396a5d6f 100644 --- a/OBSW_TmTcClient.py +++ b/OBSW_TmTcClient.py @@ -1,5 +1,4 @@ -#!/usr/bin/python3.8 -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 """ @file OBSW_TmTcClient.py diff --git a/sendreceive/OBSW_CommandSenderReceiver.py b/sendreceive/OBSW_CommandSenderReceiver.py index 7135ee7190197ac25cb7120d8368d8996cee8ca5..7100728b390d314276fbb10605edf5f6c0223f47 100644 --- a/sendreceive/OBSW_CommandSenderReceiver.py +++ b/sendreceive/OBSW_CommandSenderReceiver.py @@ -24,8 +24,8 @@ class CommandSenderReceiver: """ This is the generic CommandSenderReceiver object. All TMTC objects inherit this object """ - def __init__(self, comInterface: ComIF_T, tmtcPrinter: TmTcPrinterT, tmListener: TmListenerT, tmTimeout: int, - tcSendTimeoutFactor: int, doPrintToFile: bool): + def __init__(self, comInterface: ComIF_T, tmtcPrinter: TmTcPrinterT, tmListener: TmListenerT, tmTimeout: float, + tcSendTimeoutFactor: float, doPrintToFile: bool): """ :param comInterface: CommunicationInterface object. Instantiate the desired one and pass it here :param tmtcPrinter: TmTcPrinter object. Instantiate it and pass it here. diff --git a/sendreceive/OBSW_MultipleCommandsSenderReceiver.py b/sendreceive/OBSW_MultipleCommandsSenderReceiver.py index 7f4180e02d8252cfd48dbec28ae6b800764c1696..1c8becbc68e2fd3c0be8b9adf06f6bc674def1f8 100644 --- a/sendreceive/OBSW_MultipleCommandsSenderReceiver.py +++ b/sendreceive/OBSW_MultipleCommandsSenderReceiver.py @@ -8,17 +8,38 @@ """ from config import OBSW_Config as g from sendreceive.OBSW_SequentialSenderReceiver import SequentialCommandSenderReceiver +from comIF.OBSW_ComInterface import ComIF_T +from utility.OBSW_TmTcPrinter import TmTcPrinterT +from sendreceive.OBSW_TmListener import TmListenerT +from typing import Union import queue import time import threading -# Difference to seqential sender: This class can send TCs in bursts. Wait intervals can be specified with -# wait time between the send bursts. This is generally done in the separate test classes in UnitTest class MultipleCommandSenderReceiver(SequentialCommandSenderReceiver): - def __init__(self, comInterface, tmtcPrinter, tcQueue, tmTimeout, waitIntervals, - waitTime, printTm, tcTimeoutFactor, doPrintToFile): - super().__init__(comInterface, tmtcPrinter, tmTimeout, tcQueue, tcTimeoutFactor, doPrintToFile) + """ + Difference to seqential sender: This class can send TCs in bursts. Wait intervals can be specified with + wait time between the send bursts. This is generally done in the separate test classes in UnitTest + """ + def __init__(self, comInterface: ComIF_T, tmtcPrinter: TmTcPrinterT, tcQueue, tmListener: TmListenerT, + tmTimeout: float, waitIntervals: list, waitTime: Union[float, list], printTm: bool, + tcTimeoutFactor: float, doPrintToFile: bool): + """ + TCs are sent in burst when applicable. Wait intervals can be specified by supplying respective arguments + :param comInterface: + :param tmtcPrinter: + :param tcQueue: + :param tmTimeout: + :param waitIntervals: List of pause intervals. For example [1,3] means that a waitTime is applied after + sendinf the first and the third telecommand + :param waitTime: List of wait times or uniform wait time as float + :param printTm: + :param tcTimeoutFactor: + :param doPrintToFile: + """ + super().__init__(comInterface=comInterface, tmtcPrinter=tmtcPrinter, tmListener=tmListener,tmTimeout=tmTimeout, + tcQueue=tcQueue,tcTimeoutFactor=tcTimeoutFactor, doPrintToFile=doPrintToFile) self.waitIntervals = waitIntervals self.waitTime = waitTime self.printTm = printTm diff --git a/sendreceive/OBSW_SequentialSenderReceiver.py b/sendreceive/OBSW_SequentialSenderReceiver.py index 2804bd85df873a436c8c130b14f80a6dad15c729..baea1ec127cc684f8d9c3b9a2fb466d5ece94b83 100644 --- a/sendreceive/OBSW_SequentialSenderReceiver.py +++ b/sendreceive/OBSW_SequentialSenderReceiver.py @@ -22,8 +22,8 @@ class SequentialCommandSenderReceiver(CommandSenderReceiver): """ Specific implementation of CommandSenderReceiver to send multiple telecommands in sequence """ - def __init__(self, comInterface: ComIF_T, tmtcPrinter: TmTcPrinterT, tmListener: TmListenerT, tmTimeout: int, - tcQueue, tcTimeoutFactor: int, doPrintToFile: bool): + def __init__(self, comInterface: ComIF_T, tmtcPrinter: TmTcPrinterT, tmListener: TmListenerT, tmTimeout: float, + tcQueue, tcTimeoutFactor: float, doPrintToFile: bool): """ :param comInterface: CommunicationInterface object, passed on to CommandSenderReceiver :param tmListener: TmListener object which runs in the background and receives all Telemetry diff --git a/sendreceive/OBSW_SingleCommandSenderReceiver.py b/sendreceive/OBSW_SingleCommandSenderReceiver.py index 36383c8202fc07edceb96b85bf554c69cbd1d746..4f0266a478aa9d306725c3cc10087015bf780012 100644 --- a/sendreceive/OBSW_SingleCommandSenderReceiver.py +++ b/sendreceive/OBSW_SingleCommandSenderReceiver.py @@ -19,7 +19,7 @@ import logging class SingleCommandSenderReceiver(CommandSenderReceiver): """ This object can be used by instantiating it and calling sendSingleTcAndReceiveTm() """ def __init__(self, comInterface: ComIF_T, tmtcPrinter: TmTcPrinterT, tmListener: TmListenerT, - pusPacketTuple: tuple, tmTimeout: int, tcTimeoutFactor: int, doPrintToFile: bool): + pusPacketTuple: tuple, tmTimeout: float, tcTimeoutFactor: float, doPrintToFile: bool): """ :param comInterface: CommunicationInterface object, passed on to CommandSenderReceiver :param tmListener: TmListener object which runs in the background and receives all TM diff --git a/sendreceive/OBSW_TmListener.py b/sendreceive/OBSW_TmListener.py index 34ee2339b56f6c64e310d58b1f6747cb16412f0f..2f47c904036a6de779944fef89045142f654f4e3 100644 --- a/sendreceive/OBSW_TmListener.py +++ b/sendreceive/OBSW_TmListener.py @@ -35,7 +35,7 @@ class TmListener: self.listenerActive.set() # I don't think a listener is useful without the main program, so we might just declare it daemonic. # UPDATE: Right now, the main program is not in a permanent loop and setting the thread daemonic will - # cancel the program + # cancel the program. Solved for now by setting a permanent loop at the end of the main program self.listenerThread = threading.Thread(target=self.performOperation, daemon=True) # This Event is set by sender objects to perform mode operations self.modeChangeEvent = threading.Event()