Skip to content
Snippets Groups Projects
Commit 0e527c8a authored by Robin Mueller's avatar Robin Mueller
Browse files

Service 3 testing continued

parent c3149ee6
No related branches found
No related tags found
No related merge requests found
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="OBSW_UdpClient Unit Test Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <configuration default="false" name="OBSW_TmTcClient Unit Test Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication">
<module name="tmtc" /> <module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <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$/OBSW_TmTcClient.py" />
<option name="PARAMETERS" value="-m 5 -p -c 1" /> <option name="PARAMETERS" value="-m 5 -p -c 1 --COM COM9" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" /> <option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" /> <option name="MODULE_MODE" value="false" />
......
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="OBSW_UdpClient Service 17 Test Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <configuration default="false" name="OBSW_TmTc Client Service 17 Test Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication">
<module name="tmtc" /> <module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <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$/OBSW_TmTcClient.py" />
<option name="PARAMETERS" value="-m 3 -s 17 -c 1 -p" /> <option name="PARAMETERS" value="-m 3 -s 17 -c 1 -p" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" /> <option name="EMULATE_TERMINAL" value="true" />
......
...@@ -53,7 +53,8 @@ class MultipleCommandSenderReceiver(SequentialCommandSenderReceiver): ...@@ -53,7 +53,8 @@ class MultipleCommandSenderReceiver(SequentialCommandSenderReceiver):
def sendAllQueue(self): def sendAllQueue(self):
while not self.tcQueue.empty(): while not self.tcQueue.empty():
if g.comIF == 1: if g.comIF == 1:
time.sleep(0.01) # pause could be smaller, but causes overrun error on flashed board pass
# time.sleep(0.01) # pause could be smaller, but causes overrun error on flashed board
self.sendAndPrintTc() self.sendAndPrintTc()
def sendAndPrintTc(self): def sendAndPrintTc(self):
...@@ -92,9 +93,9 @@ class MultipleCommandSenderReceiver(SequentialCommandSenderReceiver): ...@@ -92,9 +93,9 @@ class MultipleCommandSenderReceiver(SequentialCommandSenderReceiver):
def handleLastRepliesListening(self, start_time): def handleLastRepliesListening(self, start_time):
elapsed_time_seconds = 0 elapsed_time_seconds = 0
while elapsed_time_seconds < self.tmTimeout: while elapsed_time_seconds < self.tmTimeout/2.0:
elapsed_time_seconds = time.time() - start_time elapsed_time_seconds = time.time() - start_time
tmReady = self.comInterface.dataAvailable(self.tmTimeout/2.0) tmReady = self.comInterface.dataAvailable(self.tmTimeout/4.0)
if tmReady: if tmReady:
self.receiveTelemetryAndStoreInformation() self.receiveTelemetryAndStoreInformation()
......
...@@ -33,21 +33,41 @@ def packService3TestInto(tcQueue): ...@@ -33,21 +33,41 @@ def packService3TestInto(tcQueue):
tcQueue.put(("print", "\r\nTesting Service 3: Adding custom diganostics definition")) tcQueue.put(("print", "\r\nTesting Service 3: Adding custom diganostics definition"))
command = PUSTelecommand(service=3, subservice=2, SSC=3020, data=hkDefinition2) command = PUSTelecommand(service=3, subservice=2, SSC=3020, data=hkDefinition2)
tcQueue.put(command.packCommandTuple()) tcQueue.put(command.packCommandTuple())
# enable custom hk definition # enable custom hk definition
tcQueue.put(("print", "\r\nTesting Service 3: Enable custom definition")) tcQueue.put(("print", "\r\nTesting Service 3: Enable custom definition"))
command = PUSTelecommand(service=3, subservice=5, SSC=3030, data=sid1) command = PUSTelecommand(service=3, subservice=5, SSC=3030, data=sid1)
tcQueue.put(command.packCommandTuple()) tcQueue.put(command.packCommandTuple())
# enable gps0
# tcQueue.put(("print", "\r\nTesting Service 3: Enable GPS definition"))
# command = PUSTelecommand(service=3, subservice=5, SSC=3030, data=sidGps)
# tcQueue.put(command.packCommandTuple())
# enable custom diag definition # enable custom diag definition
# disable custom hk definition tcQueue.put(("print", "\r\nTesting Service 3: Enable custom diagnostics definition"))
# disable custom diag definition command = PUSTelecommand(service=3, subservice=7, SSC=3030, data=sid1)
tcQueue.put(command.packCommandTuple())
# enable gps0
tcQueue.put(("print", "\r\nTesting Service 3: Enable GPS definition"))
command = PUSTelecommand(service=3, subservice=5, SSC=3030, data=sidGps)
tcQueue.put(command.packCommandTuple())
# maybe wait a bit to receive at least 2 packets..
# Disable custom hk definition
tcQueue.put(("print", "\r\nTesting Service 3: Disable custom definition"))
command = PUSTelecommand(service=3, subservice=6, SSC=3030, data=sid1)
tcQueue.put(command.packCommandTuple())
# Disable custom diag definition
tcQueue.put(("print", "\r\nTesting Service 3: Disable custom diagnostics definition"))
command = PUSTelecommand(service=3, subservice=8, SSC=3030, data=sid1)
tcQueue.put(command.packCommandTuple())
# disable gps0
tcQueue.put(("print", "\r\nTesting Service 3: Disable GPS definition"))
command = PUSTelecommand(service=3, subservice=6, SSC=3030, data=sidGps)
tcQueue.put(command.packCommandTuple())
# report custom hk definition # report custom hk definition
# report custom diag definition # report custom diag definition
# report gps0 definition
# generate one custom hk definition # generate one custom hk definition
# generate one custom diag definition # generate one custom diag definition
# generate one gps 0 definition
# modify custom hk definition interval # modify custom hk definition interval
# modify custom diag definition interval # modify custom diag definition interval
# report custom hk definition # report custom hk definition
...@@ -58,10 +78,7 @@ def packService3TestInto(tcQueue): ...@@ -58,10 +78,7 @@ def packService3TestInto(tcQueue):
# report custom diag definition # report custom diag definition
# delete custom hk definition # delete custom hk definition
# delete custom diag definition # delete custom diag definition
# disable gps0
tcQueue.put(("print", "\r\nTesting Service 3: Disable GPS definition"))
command = PUSTelecommand(service=3, subservice=6, SSC=3030, data=sidGps)
tcQueue.put(command.packCommandTuple())
# tcQueue.put(("print", "\r\nTesting Service 3: Deleting custom HK definition")) # tcQueue.put(("print", "\r\nTesting Service 3: Deleting custom HK definition"))
# command = PUSTelecommand(service=3, subservice=3, SSC=3080, data=sid1) # command = PUSTelecommand(service=3, subservice=3, SSC=3080, data=sid1)
# tcQueue.put(command.packCommandTuple()) # tcQueue.put(command.packCommandTuple())
......
...@@ -178,7 +178,7 @@ class TestService5(TestService): ...@@ -178,7 +178,7 @@ class TestService5(TestService):
super().setUpClass() super().setUpClass()
print("Testing Service 5") print("Testing Service 5")
cls.waitIntervals = [1, 2, 3] cls.waitIntervals = [1, 2, 3]
cls.waitTime = [1.2, 1.5, 1.5] cls.waitTime = [1.5, 1.5, 1.5]
packService5TestInto(cls.testQueue) packService5TestInto(cls.testQueue)
def test_Service5(self): def test_Service5(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment