From fd01098345b8c8059235f5699168345001b06ba1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 1 Mar 2022 17:25:50 +0100 Subject: [PATCH] spacepackets and tmtc update --- lint.py | 31 +++++++++++++++++++++++-------- pus_tc/plpcdu.py | 5 +++++ pus_tc/star_tracker.py | 4 +++- spacepackets | 2 +- tmtccmd | 2 +- 5 files changed, 33 insertions(+), 11 deletions(-) diff --git a/lint.py b/lint.py index 25bfdce..27291b2 100755 --- a/lint.py +++ b/lint.py @@ -4,18 +4,33 @@ import sys def main(): - # Ignore folder created by venv - exclude_dirs_flag = "--exclude bin,lib" + exclude_dirs_flag = "" + if not os.path.exists("setup.cfg"): + exclude_dirs_flag = ( + "--exclude .git,__pycache__,docs/conf.py,old,build,dist,venv" + ) additional_flags_both_steps = "--count --statistics" additional_flags_first_step = "--select=E9,F63,F7,F82 --show-source" - flake8_first_step_cmd = f"flake8 . {additional_flags_both_steps} {additional_flags_first_step} {exclude_dirs_flag}" + flake8_first_step_cmd = ( + f"flake8 . {additional_flags_both_steps} " + f"{additional_flags_first_step} {exclude_dirs_flag}" + ) status = os.system(flake8_first_step_cmd) - if os.WEXITSTATUS(status) != 0: - print("Flake8 linter errors") - sys.exit(0) + if os.name == "nt": + if status != 0: + print(f"Flake8 linter errors with status {status}") + else: + if os.WEXITSTATUS(status) != 0: + print(f"Flake8 linter errors with status {status}") + sys.exit(0) + additional_flags_second_step = ( + '--exit-zero --max-complexity=10 --per-file-ignores="__init__.py:F401"' + ) + if not os.path.exists("setup.cfg"): + additional_flags_second_step += " --max-line-length=100" flake8_second_step_cmd = ( - f"flake8 . {additional_flags_both_steps} --exit-zero --max-complexity=10 " - f"--max-line-length=127 {exclude_dirs_flag}" + f"flake8 . {additional_flags_both_steps} {additional_flags_second_step}" + f" {exclude_dirs_flag}" ) os.system(flake8_second_step_cmd) diff --git a/pus_tc/plpcdu.py b/pus_tc/plpcdu.py index e18a993..6717aaa 100644 --- a/pus_tc/plpcdu.py +++ b/pus_tc/plpcdu.py @@ -3,6 +3,7 @@ import enum from tmtccmd.config import QueueCommands from tmtccmd.tc.definitions import TcQueueT from tmtccmd.tc.service_200_mode import pack_mode_data, Modes, Subservices +from tmtccmd.tc.service_20_parameter import pack_boolean_parameter_command from spacepackets.ecss.tc import PusTelecommand from config.object_ids import PL_PCDU_ID @@ -10,6 +11,7 @@ from config.object_ids import PL_PCDU_ID class OpCodes: SWITCH_ADC_ON = ["0", "switch-adc-on"] SWITCH_ALL_ON = ["1", "switch-all-on"] + UPDATE_DRO_TO_X8_WAIT = ["2", "dro-to-x8-wait"] class Submodes(enum.IntEnum): @@ -36,3 +38,6 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str): service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data ) tc_queue.appendleft(mode_cmd.pack_command_tuple()) + if op_code in OpCodes.UPDATE_DRO_TO_X8_WAIT: + tc_queue.appendleft((QueueCommands.PRINT, "Updating DRO to X8 wait time")) + param_data = \ No newline at end of file diff --git a/pus_tc/star_tracker.py b/pus_tc/star_tracker.py index 42b7dbf..fdf693d 100644 --- a/pus_tc/star_tracker.py +++ b/pus_tc/star_tracker.py @@ -95,7 +95,9 @@ class FileDefs: ) q7s_ground_config = "/mnt/sd0/startracker/json/ground-config.json" q7s_flight_config = "/mnt/sd0/startracker/flight-config.json" - + firmware2_1 = "" + firmware22_1 = "" + firmware_origin = "" json_dict = { "1": ["Q7S flight config", FileDefs.q7s_flight_config], diff --git a/spacepackets b/spacepackets index 8580a08..19e8a58 160000 --- a/spacepackets +++ b/spacepackets @@ -1 +1 @@ -Subproject commit 8580a08e9876efc542e19dc957f220be3b250dc8 +Subproject commit 19e8a588fa0723a5991f80bb2fd52dfc64f0ac64 diff --git a/tmtccmd b/tmtccmd index f7bbf4b..9af8340 160000 --- a/tmtccmd +++ b/tmtccmd @@ -1 +1 @@ -Subproject commit f7bbf4bd9f6dc169a8b9e6a76fa9ef0aceb341d4 +Subproject commit 9af8340c0276460128bd343139bc6e20bf020f6a