Compare commits

...

9 Commits

Author SHA1 Message Date
01b3a894e6 prep v2.22.1 2023-04-12 13:24:29 +02:00
f075d28905 Merge branch 'main' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc 2023-04-11 22:08:10 +02:00
83f6a22a75 bugfixes 2023-04-11 22:08:05 +02:00
a38bae16cd Merge pull request 'NONE CANNER' (#183) from kranz_none_because_i_can into main
lit
Reviewed-on: #183
2023-04-11 21:10:08 +02:00
53666bdeda NONE CANNER 2023-04-11 21:04:09 +02:00
00281fdc5e add TCS obj prompt 2023-04-11 20:43:39 +02:00
43b530cdb7 typo 2023-04-08 13:23:06 +02:00
92ce64cd39 update changelog 2023-04-08 11:40:06 +02:00
268c9e3f0b add prompts for custom file name 2023-04-08 11:39:41 +02:00
5 changed files with 36 additions and 11 deletions

View File

@ -10,6 +10,12 @@ list yields a list of all related PRs for each release.
# [unreleased]
# [v2.22.1] 2023-04-12
## Added
- Prompts to specify custom filename for OBSW update
# [v2.22.0] 2023-04-07
- Various smaller and helper commands added for tests

View File

@ -1,4 +1,4 @@
__version__ = "2.22.0"
__version__ = "2.22.1"
import logging
from pathlib import Path
@ -6,7 +6,7 @@ from pathlib import Path
SW_NAME = "eive-tmtc"
VERSION_MAJOR = 2
VERSION_MINOR = 22
VERSION_REVISION = 0
VERSION_REVISION = 1
EIVE_TMTC_ROOT = Path(__file__).parent
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent

View File

@ -2,6 +2,7 @@ import enum
class Mode(enum.IntEnum):
NONE = 0
RX_ONLY = 10
RX_AND_TX_DEF_DATARATE = 11
RX_AND_TX_LOW_DATARATE = 12

View File

@ -267,7 +267,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
)
elif op_code in OpCode.SWITCH_TO_BOTH_SD_CARDS:
while True:
active_sd_card = int(input("Please specify active SD cqrd [0/1]: "))
active_sd_card = int(input("Please specify active SD card [0/1]: "))
if active_sd_card not in [0, 1]:
_LOGGER.warning("Invalid SD card specified. Try again")
break
@ -343,7 +343,11 @@ def determine_chip_and_copy() -> (int, int):
def pack_obsw_update_cmd(action_id: int) -> PusTelecommand:
chip, copy = determine_chip_and_copy()
user_data = bytes([chip, copy])
user_data = bytearray([chip, copy])
custom_file_name = input("Use custom filename [y/n] ?: ")
if custom_file_name.lower() in ["y", "yes", "1"]:
custom_file_name = input("Specify custom filename: ")
user_data.extend(custom_file_name.encode())
return create_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=action_id, user_data=user_data
)

View File

@ -15,6 +15,7 @@ from eive_tmtc.config.object_ids import (
SUS_6_R_LOC_XFYBZM_PT_XF,
RW1_ID,
RW2_ID,
RTD_0_PLOC_HSPD,
)
SUBSYSTEM_DICT = {
@ -40,6 +41,20 @@ ACS_OBJ_DICT = {
13: ("RW 2", RW2_ID),
}
TCS_OBJ_DICT = {
0: ("RTD 0", RTD_0_PLOC_HSPD),
}
def get_obj_if_from_dict(lut: dict) -> bytes:
for k, v in lut.items():
print(f"{k}: {v[0]}")
obj_key = int(input("Please specify target object by key: "))
name_and_obj_id = lut[obj_key]
if name_and_obj_id is None:
raise ValueError("invalid key")
return name_and_obj_id[1]
def prompt_object() -> bytes:
for k, v in SUBSYSTEM_DICT.items():
@ -49,10 +64,9 @@ def prompt_object() -> bytes:
if subsystem is None:
raise ValueError("invalid key")
if subsystem == "acs":
for k, v in ACS_OBJ_DICT.items():
print(f"{k}: {v[0]}")
obj_key = int(input("Please specify target object by key: "))
acs_obj = ACS_OBJ_DICT[obj_key]
if acs_obj is None:
raise ValueError("invalid key")
return acs_obj[1]
return get_obj_if_from_dict(ACS_OBJ_DICT)
elif subsystem == "tcs":
return get_obj_if_from_dict(TCS_OBJ_DICT)
else:
print(f"No object for subsystem {subsystem}")
return bytes()