deployment test

This commit is contained in:
Jakob Meier 2021-02-16 15:33:26 +01:00
parent 110ec9644a
commit 1d5fe4ebc7
5 changed files with 32 additions and 1 deletions

View File

@ -35,6 +35,7 @@ class ServiceList(enum.Enum):
TMP1075_1 = auto()
TMP1075_2 = auto()
HEATER = auto()
SA_DEPL = auto()
class SerialConfig(enum.Enum):

View File

@ -160,6 +160,8 @@ def add_globals_post_args_parsing(args: argparse.Namespace):
service = ServiceList.TMP1075_2
elif service == "heater":
service = ServiceList.HEATER
elif service == "sa_depl":
service = ServiceList.SA_DEPL
else:
logger.warning("Service not known! Setting standard service 17")
service = ServiceList.SERVICE_17

View File

@ -20,6 +20,7 @@ class ObjectIds(enum.Enum):
TMP1075_1_HANDLER_ID = auto()
TMP1075_2_HANDLER_ID = auto()
HEATER = auto()
SOLAR_ARRAY_DEPLOYMENT_HANDLER = auto()
def set_object_ids(object_id_dict: Dict[ObjectIds, bytearray]):
@ -33,7 +34,8 @@ def set_object_ids(object_id_dict: Dict[ObjectIds, bytearray]):
o_ids.ACU_HANDLER_ID: bytearray([0x44, 0x00, 0x00, 0x4]),
o_ids.TMP1075_1_HANDLER_ID: bytearray([0x44, 0x00, 0x00, 0x5]),
o_ids.TMP1075_2_HANDLER_ID: bytearray([0x44, 0x00, 0x00, 0x6]),
o_ids.HEATER: bytearray([0x54, 0x00, 0x00, 0x1]),
o_ids.HEATER: bytearray([0x54, 0x00, 0x00, 0x3]),
o_ids.SOLAR_ARRAY_DEPLOYMENT_HANDLER: bytearray([0x44, 0x00, 0x00, 0x8]),
o_ids.INVALID: bytearray([0xFF, 0xFF, 0xFF, 0xFF]),
}
)

View File

@ -20,6 +20,7 @@ from tmtc_core.core.tmtcc_object_id_manager import get_object_id
from config.tmtcc_object_ids import ObjectIds
from pus_tc.tmtcc_tc_tmp1075 import pack_tmp1075_test_into
from pus_tc.tmtcc_tc_heater import pack_heater_test_into
from pus_tc.tmtcc_tc_solar_array_deployment import pack_solar_array_deployment_test_into
LOGGER = get_logger()
@ -52,6 +53,9 @@ def pack_service_queue_user(service: ServiceList, op_code: str, service_queue: T
if service == ServiceList.HEATER:
object_id = get_object_id(ObjectIds.HEATER)
return pack_heater_test_into(object_id, service_queue)
if service == ServiceList.SA_DEPL:
object_id = get_object_id(ObjectIds.SOLAR_ARRAY_DEPLOYMENT_HANDLER)
return pack_solar_array_deployment_test_into(object_id, service_queue)
LOGGER.warning("Invalid Service !")

View File

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
"""
@file tmtcc_tc_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 tmtc_core.core.tmtc_core_definitions import QueueCommands
from tmtc_core.pus_tc.tmtcc_pus_tc_packer import TcQueueT
from tmtc_core.pus_tc.tmtcc_pus_tc_base import PusTelecommand
class ActionIds:
DEPLOY_SOLAR_ARRAYS = bytearray([0x0, 0x0, 0x0, 0x5])
def pack_solar_array_deployment_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
tc_queue.appendleft((QueueCommands.PRINT, "Testing S/A Deployment"))
command = object_id + ActionIds.DEPLOY_SOLAR_ARRAYS
command = PusTelecommand(service=8, subservice=128, ssc=200, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())