add TMP1075 dev prompt

This commit is contained in:
Robin Müller 2023-02-06 14:27:00 +01:00
parent 5e27a22a85
commit b474841d69
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
5 changed files with 27 additions and 14 deletions

View File

@ -10,6 +10,10 @@ list yields a list of all related PRs for each release.
# [unreleased]
## Fixed
- TMP1075 comands: Implement proper prompt for device select.
# [v2.10.0] 2023-02-03
tmtccmd v4.0.0rc0

View File

@ -71,6 +71,7 @@ class CustomServiceList(str, enum.Enum):
TIME = "time"
PROCEDURE = "proc"
RTD = "rtd"
TMP1075 = "tcs_tmp"
TVTTESTPROCEDURE = "tvtestproc"
CONTROLLERS = "controllers"
SCEX = "scex"

View File

@ -30,8 +30,10 @@ SCEX_HANDLER_ID = bytes([0x44, 0x33, 0x00, 0x32])
# Thermal Object IDs
THERMAL_CONTROLLER_ID = bytes([0x43, 0x40, 0x00, 0x01])
HEATER_CONTROLLER_ID = bytes([0x44, 0x41, 0x00, 0xA4])
TMP_1075_1_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x04])
TMP_1075_2_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x05])
TMP1075_HANDLER_TCS_BRD_0_ID = bytes([0x44, 0x42, 0x00, 0x04])
TMP1075_HANDLER_TCS_BRD_1_ID = bytes([0x44, 0x42, 0x00, 0x05])
TMP1075_HANDLER_PLPCDU_0_ID = bytes([0x44, 0x42, 0x00, 0x06])
TMP1075_HANDLER_IF_BRD_ID = bytes([0x44, 0x42, 0x00, 0x08])
# Communication Object IDs
SYRLINKS_HANDLER_ID = bytes([0x44, 0x53, 0x00, 0xA3])

View File

@ -45,8 +45,10 @@ from eive_tmtc.config.object_ids import (
PDU_1_HANDLER_ID,
PDU_2_HANDLER_ID,
ACU_HANDLER_ID,
TMP_1075_1_HANDLER_ID,
TMP_1075_2_HANDLER_ID,
TMP1075_HANDLER_TCS_BRD_0_ID,
TMP1075_HANDLER_TCS_BRD_1_ID,
TMP1075_HANDLER_PLPCDU_0_ID,
TMP1075_HANDLER_IF_BRD_ID,
HEATER_CONTROLLER_ID,
IMTQ_HANDLER_ID,
RW1_ID,
@ -74,6 +76,8 @@ from eive_tmtc.pus_tc.system.proc import pack_proc_commands
import eive_tmtc.config.object_ids as oids
from tmtccmd.util import ObjectIdU32
from eive_tmtc.utility.input_helper import InputHelper
def handle_default_procedure(
tc_base: TcHandlerBase,
@ -103,15 +107,17 @@ def handle_default_procedure(
return pack_acu_commands(object_id=object_id, q=queue_helper, op_code=op_code)
if service == CustomServiceList.TCS.value:
return pack_tcs_sys_commands(q=queue_helper, op_code=op_code)
if service == CustomServiceList.TMP1075_1.value:
object_id = cast(ObjectIdU32, obj_id_man.get(TMP_1075_1_HANDLER_ID))
if service == CustomServiceList.TMP1075.value:
menu_dict = {
"0": ("TMP1075 TCS Board 0", TMP1075_HANDLER_TCS_BRD_0_ID),
"1": ("TMP1075 TCS Board 1", TMP1075_HANDLER_TCS_BRD_1_ID),
"2": ("TMP1075 PL PCDU 0", TMP1075_HANDLER_PLPCDU_0_ID),
"4": ("TMP1075 IF Board", TMP1075_HANDLER_IF_BRD_ID),
}
input_helper = InputHelper(menu_dict)
tmp_select = input_helper.get_key()
return pack_tmp1075_test_into(
object_id=object_id, q=queue_helper, op_code=op_code
)
if service == CustomServiceList.TMP1075_2.value:
object_id = cast(ObjectIdU32, obj_id_man.get(TMP_1075_2_HANDLER_ID))
return pack_tmp1075_test_into(
object_id=object_id, q=queue_helper, op_code=op_code
object_id=menu_dict[tmp_select][1], q=queue_helper, op_code=op_code
)
if service == CustomServiceList.HEATER.value:
object_id = HEATER_CONTROLLER_ID

View File

@ -6,13 +6,13 @@
@date 13.02.2021
"""
import logging
from typing import Tuple, Dict
_LOGGER = logging.getLogger(__name__)
class InputHelper:
def __init__(self, menu: dict):
def __init__(self, menu: Dict[str, Tuple[str, ...]]):
"""
@brief Constructor
@param menu The menu describing the input options