commands to set and get pcdu parameters
This commit is contained in:
@ -3,6 +3,8 @@
|
||||
@author J. Meier, R. Mueller
|
||||
@date 21.12.2020
|
||||
"""
|
||||
import struct
|
||||
|
||||
from config.definitions import CustomServiceList
|
||||
from tmtccmd.config import add_op_code_entry, add_service_op_code_entry
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
@ -63,6 +65,16 @@ def add_acu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
|
||||
info=GsInfo.REQUEST_AUX_HK_ONCE,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.GET_PARAM,
|
||||
info=GsInfo.GET_PARAMETER,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.SET_PARAM,
|
||||
info=GsInfo.SET_PARAMETER,
|
||||
)
|
||||
add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.TEST, info=Info.TEST)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
@ -97,6 +109,25 @@ def pack_acu_commands(
|
||||
hk_sid = make_sid(object_id=object_id.as_bytes, set_id=gs.SetIds.ACU_AUX)
|
||||
command = generate_one_hk_command(sid=hk_sid, ssc=0)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code in GomspaceOpCodes.GET_PARAM:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, f"PDU1: {GsInfo.GET_PARAMETER}")
|
||||
)
|
||||
table_id = int(input("Specify table ID: "))
|
||||
memory_address = int(input("Specify memory address: 0x"), 16)
|
||||
parameter_size = int(input("Specify parameter size: "))
|
||||
command = gs.pack_get_param_command(object_id.as_bytes, table_id, memory_address, parameter_size)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code in GomspaceOpCodes.SET_PARAM:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, f"PDU1: {GsInfo.SET_PARAMETER}")
|
||||
)
|
||||
memory_address = int(input("Specify memory address: 0x"), 16)
|
||||
memory_address = struct.pack('!H', memory_address)
|
||||
parameter_size = int(input("Specify parameter size: "))
|
||||
parameter = int(input("Specify parameter: "))
|
||||
command = gs.pack_set_param_command(object_id.as_bytes, memory_address, parameter_size, parameter)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
pack_test_cmds(object_id=object_id, tc_queue=tc_queue)
|
||||
|
||||
return tc_queue
|
||||
|
@ -170,6 +170,9 @@ def add_pdu1_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=Pdu1OpCodes.TESTS.value, info="PDU1 Tests"
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=GomspaceOpCodes.SET_PARAM, info="Set parameter"
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.PDU1.value,
|
||||
|
@ -1,8 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""PDU2 is mounted on the X2 slot of the P60 dock
|
||||
"""PDU1 is mounted on the X2 slot of the P60 dock
|
||||
@author J. Meier
|
||||
@date 17.12.2020
|
||||
"""
|
||||
import gomspace.gomspace_common as gs
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
@ -292,3 +293,13 @@ def pack_pdu1_commands(object_id: ObjectId, tc_queue: TcQueueT, op_code: str):
|
||||
Channel.off,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code in GomspaceOpCodes.SET_PARAM:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, f"PDU1: {Info.SET_PARAMETER}")
|
||||
)
|
||||
memory_address = int(input("Specify memory address: 0x"), 16)
|
||||
memory_address = struct.pack('!H', memory_address)
|
||||
parameter_size = int(input("Specify parameter size: "))
|
||||
parameter = int(input("Specify parameter: "))
|
||||
command = gs.pack_set_param_command(object_id.as_bytes, memory_address, parameter_size, parameter)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
Reference in New Issue
Block a user