From 6e8ef41d7ca1f1fc02d45559222f9233d59527ed Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:04:35 +0200 Subject: [PATCH 01/11] update S/A depl cmd --- pus_tc/devs/solar_array_deployment.py | 22 -------- pus_tc/procedure_packer.py | 2 +- tmtc/solar_array_deployment.py | 80 +++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 23 deletions(-) delete mode 100644 pus_tc/devs/solar_array_deployment.py create mode 100644 tmtc/solar_array_deployment.py diff --git a/pus_tc/devs/solar_array_deployment.py b/pus_tc/devs/solar_array_deployment.py deleted file mode 100644 index 24bb94c..0000000 --- a/pus_tc/devs/solar_array_deployment.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -""" -@file solar_array_deployment.py -@brief The test function in this file simply returns a command which triggers the solar array deployment. -@author J. Meier -@date 15.02.2021 -""" -from spacepackets.ecss import PusTelecommand -from tmtccmd.tc import DefaultPusQueueHelper - - -class ActionIds: - DEPLOY_SOLAR_ARRAYS = bytearray([0x0, 0x0, 0x0, 0x5]) - - -def pack_solar_array_deployment_test_into( - object_id: bytearray, q: DefaultPusQueueHelper -): - q.add_log_cmd("Testing S/A Deployment") - - command = object_id + ActionIds.DEPLOY_SOLAR_ARRAYS - q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) diff --git a/pus_tc/procedure_packer.py b/pus_tc/procedure_packer.py index 4e3e1d9..f9da180 100644 --- a/pus_tc/procedure_packer.py +++ b/pus_tc/procedure_packer.py @@ -27,7 +27,7 @@ from tmtc.power.p60dock import pack_p60dock_cmds from tmtc.power.pdu2 import pack_pdu2_commands from tmtc.power.pdu1 import pack_pdu1_commands from tmtc.power.acu import pack_acu_commands -from pus_tc.devs.solar_array_deployment import pack_solar_array_deployment_test_into +from tmtc.solar_array_deployment import pack_solar_array_deployment_test_into from pus_tc.devs.imtq import pack_imtq_test_into from pus_tc.devs.tmp1075 import pack_tmp1075_test_into from pus_tc.devs.heater import pack_heater_cmds diff --git a/tmtc/solar_array_deployment.py b/tmtc/solar_array_deployment.py new file mode 100644 index 0000000..57921d9 --- /dev/null +++ b/tmtc/solar_array_deployment.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +""" +@file solar_array_deployment.py +@brief The test function in this file simply returns a command which triggers the solar array deployment. +@author J. Meier +@date 15.02.2021 +""" +import struct + +from config.definitions import CustomServiceList +from config.object_ids import SOLAR_ARRAY_DEPLOYMENT_ID +from tmtccmd.config.tmtc import ( + tmtc_definitions_provider, + TmtcDefinitionWrapper, + OpCodeEntry, +) +from tmtccmd.tc import service_provider +from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd +from tmtccmd.tc.decorator import ServiceProviderParams +from tmtccmd import get_console_logger + +LOGGER = get_console_logger() + + +class OpCodes: + MANUAL_DEPLOYMENT = "man_depl" + + +class Info: + MANUAL_DEPLOYMENT = "Manual Solar Array Deployment" + + +class ActionIds: + MANUAL_DEPLOYMENT = 5 + + +@tmtc_definitions_provider +def pack_sa_depl_cmds(defs: TmtcDefinitionWrapper): + oce = OpCodeEntry() + oce.add(keys=OpCodes.MANUAL_DEPLOYMENT, info=Info.MANUAL_DEPLOYMENT) + defs.add_service( + name=CustomServiceList.SA_DEPLYOMENT, + info="Solar Array Deployment", + op_code_entry=oce, + ) + + +@service_provider(CustomServiceList.SA_DEPLYOMENT) +def pack_solar_array_deployment_test_into(p: ServiceProviderParams): + q = p.queue_helper + user_data = bytearray() + burn_time = 0 + dry_run = 0 + while True: + burn_time = int(input("Please specify burn time in seconds [0-120 secs]: ")) + if burn_time < 0 or burn_time > 120: + LOGGER.warning(f"Invalid burn time {burn_time}") + continue + user_data.extend(struct.pack("!I", burn_time)) + break + while True: + dry_run = input("Dry run? [y/n]: ") + if dry_run in ["yes", "y", "1"]: + dry_run = 1 + elif dry_run in ["no", "n", "0"]: + dry_run = 0 + else: + LOGGER.warning("Invalid input for dry run parameter") + continue + user_data.append(dry_run) + break + if dry_run == 1: + dry_run_str = " as dry run" + else: + dry_run_str = "" + q.add_log_cmd(f"Testing S/A Deployment with burn time {burn_time}{dry_run_str}") + command = make_fsfw_action_cmd( + SOLAR_ARRAY_DEPLOYMENT_ID, ActionIds.MANUAL_DEPLOYMENT, user_data + ) + q.add_pus_tc(command) -- 2.43.0 From 4b0e2f0b0a71bb16b3cc885d9ea283eb87d8bdcb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:05:08 +0200 Subject: [PATCH 02/11] small tweak --- tmtc/solar_array_deployment.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tmtc/solar_array_deployment.py b/tmtc/solar_array_deployment.py index 57921d9..96eea65 100644 --- a/tmtc/solar_array_deployment.py +++ b/tmtc/solar_array_deployment.py @@ -49,8 +49,6 @@ def pack_sa_depl_cmds(defs: TmtcDefinitionWrapper): def pack_solar_array_deployment_test_into(p: ServiceProviderParams): q = p.queue_helper user_data = bytearray() - burn_time = 0 - dry_run = 0 while True: burn_time = int(input("Please specify burn time in seconds [0-120 secs]: ")) if burn_time < 0 or burn_time > 120: -- 2.43.0 From 105b7eb3dd895f7da050b4ea37f9053dbacbc944 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:10:16 +0200 Subject: [PATCH 03/11] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26e4fbb..9b82dc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ list yields a list of all related PRs for each release. # [unreleased] +# [v1.14.0] + +- Updates S/A deployment command + PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/118 + # [v1.13.0] - CFDP integration -- 2.43.0 From adf2327e6dda748c627b98c857683c6f783bb78a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:10:44 +0200 Subject: [PATCH 04/11] add date for release v1.13.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b82dc7..46a4d94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ list yields a list of all related PRs for each release. - Updates S/A deployment command PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/118 -# [v1.13.0] +# [v1.13.0] 13.10.2022 - CFDP integration PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/113 -- 2.43.0 From de815180c3c55d3ae90059af7aae23d03c3b023a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:12:05 +0200 Subject: [PATCH 05/11] add SA depl run config --- .run/SA Deployment.run.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .run/SA Deployment.run.xml diff --git a/.run/SA Deployment.run.xml b/.run/SA Deployment.run.xml new file mode 100644 index 0000000..fd6a069 --- /dev/null +++ b/.run/SA Deployment.run.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file -- 2.43.0 From bd533b5ab2b23ac2f34108172b1803fd85cc54e5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Oct 2022 18:12:31 +0200 Subject: [PATCH 06/11] add -l flag to SA depl --- .run/SA Deployment.run.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.run/SA Deployment.run.xml b/.run/SA Deployment.run.xml index fd6a069..df6593a 100644 --- a/.run/SA Deployment.run.xml +++ b/.run/SA Deployment.run.xml @@ -13,7 +13,7 @@