some fixes (some pep related)

This commit is contained in:
Robin Müller 2021-03-19 17:50:09 +01:00
parent 04920feea5
commit dc999188c0
8 changed files with 31 additions and 23 deletions

View File

@ -16,4 +16,4 @@ class CustomModeList(enum.IntEnum):
def custom_mode_operation(tmtc_backend: TmTcHandler, mode: int):
pass
pass

View File

@ -15,4 +15,3 @@ class CustomServiceList(enum.IntEnum):
TMP1075_1 = "tmp1075_1"
TMP1075_2 = "tmp1075_2"
HEATER = "heater"

View File

@ -26,8 +26,7 @@ class CustomGlobalIds(enum.Enum):
pass
def add_globals_pre_args_parsing(gui: bool = False):
def set_globals_pre_args_parsing(gui: bool = False):
set_default_globals_pre_args_parsing(apid=0x65, com_if_id=CoreComInterfaces.EthernetUDP)
servicelist = dict()

View File

@ -20,8 +20,8 @@ class EiveHookObject(TmTcHookBase):
return f"{SW_NAME} {VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_SUBMINOR}"
def add_globals_pre_args_parsing(self, gui: bool = False):
from config.globals_config import add_globals_pre_args_parsing
add_globals_pre_args_parsing(gui)
from config.globals_config import set_globals_pre_args_parsing
set_globals_pre_args_parsing(gui=gui)
def add_globals_post_args_parsing(self, args: argparse.Namespace):
from config.globals_config import add_globals_post_args_parsing

View File

@ -5,6 +5,7 @@
@author J. Meier
@date 17.12.2020
"""
from tmtccmd.core.definitions import QueueCommands
from tmtccmd.pus_tc.packer import TcQueueT
from tmtccmd.pus_tc.base import PusTelecommand
@ -25,24 +26,30 @@ class PDU1TestProcedure:
read_temperature = False
def pack_pdu1_test_into(pdu1_object_id: bytearray, p60dock_object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
tc_queue.appendleft(("print", "Testing PDU1"))
def pack_pdu1_test_into(
pdu1_object_id: bytearray, p60dock_object_id: bytearray, tc_queue: TcQueueT
):
tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU1"))
tc_queue.appendleft(("print", "P60 Dock: Enabling PDU1"))
command = pack_set_param_command(p60dock_object_id, P60DockConfigTable.out_en_1.parameter_address,
P60DockConfigTable.out_en_1.parameter_size, Channel.on)
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Enabling PDU1"))
command = pack_set_param_command(
p60dock_object_id, P60DockConfigTable.out_en_1.parameter_address,
P60DockConfigTable.out_en_1.parameter_size, Channel.on
)
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
tc_queue.appendleft(("print", "PDU1: Ping Test"))
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
command = pack_ping_command(pdu1_object_id, ping_data)
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.read_temperature:
tc_queue.appendleft(("print", "PDU1: Testing temperature reading"))
command = pack_get_param_command(pdu1_object_id, TableIds.hk, PDUHkTable.temperature.parameter_address,
PDUHkTable.temperature.parameter_size)
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Testing temperature reading"))
command = pack_get_param_command(
pdu1_object_id, TableIds.hk, PDUHkTable.temperature.parameter_address,
PDUHkTable.temperature.parameter_size
)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())

View File

@ -27,7 +27,7 @@ class PDU2TestProcedure:
channel_2_off = False # Reaction wheels 5V
read_temperature = True
read_channel_2_state = False # Reaction wheels 5V
read_cur_lu_lim_0 = False # OBC
read_cur_lu_lim_0 = False # OBC
channel_2_on = False # Reaction wheels 5V
invalid_table_id_test = False # Test to check if software properly handles invalid table ids
invalid_address_test = False # Test to check if software properly handles invalid addresses

View File

@ -5,6 +5,7 @@
@author J. Meier
@date 06.01.2021
"""
from tmtccmd.core.definitions import QueueCommands
from tmtccmd.pus_tc.packer import TcQueueT
from tmtccmd.pus_tc.base import PusTelecommand
@ -30,29 +31,31 @@ class Tmp1075ActionIds:
def pack_tmp1075_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
tc_queue.appendleft(("print", "Testing Tmp1075 Temperature Sensor Handler with object id: 0x" +
object_id.hex()))
tc_queue.appendleft(
(QueueCommands.PRINT,
"Testing Tmp1075 Temperature Sensor Handler with object id: 0x" + object_id.hex())
)
if Tmp1075TestProcedure.all or Tmp1075TestProcedure.start_adc_conversion:
tc_queue.appendleft(("print", "TMP1075: Starting new temperature conversion"))
tc_queue.appendleft((QueueCommands.PRINT, "TMP1075: Starting new temperature conversion"))
command = object_id + Tmp1075ActionIds.start_adc_conversion
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if Tmp1075TestProcedure.all or Tmp1075TestProcedure.get_temp:
tc_queue.appendleft(("print", "TMP1075: Read temperature"))
tc_queue.appendleft((QueueCommands.PRINT, "TMP1075: Read temperature"))
command = object_id + Tmp1075ActionIds.get_temp
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if Tmp1075TestProcedure.set_mode_normal:
tc_queue.appendleft(("print", "TMP1075: Set Mode Normal"))
tc_queue.appendleft((QueueCommands.PRINT, "TMP1075: Set Mode Normal"))
mode_data = pack_mode_data(object_id, 2, 0)
command = PusTelecommand(service=200, subservice=1, ssc=220, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
if Tmp1075TestProcedure.set_mode_on:
tc_queue.appendleft(("print", "TMP1075: Set Mode On"))
tc_queue.appendleft((QueueCommands.PRINT, "TMP1075: Set Mode On"))
mode_data = pack_mode_data(object_id, 1, 0)
command = PusTelecommand(service=200, subservice=1, ssc=221, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())

@ -1 +1 @@
Subproject commit bef9dc2b1bd046521f215901812fbbe8668a418c
Subproject commit 6cdd05fbe1c4582a23a975a5401bf5fe833c04b8