TV test procedures #89

Merged
muellerr merged 22 commits from kranz/master into develop 2022-05-25 15:01:10 +02:00
10 changed files with 451 additions and 74 deletions

View File

@ -117,7 +117,7 @@ SUS_3_N_LOC_XFYBZF_PT_YF = bytes([0x44, 0x12, 0x00, 0x35])
SUS_9_R_LOC_XBYBZB_PT_YF = bytes([0x44, 0x12, 0x00, 0x41]) SUS_9_R_LOC_XBYBZB_PT_YF = bytes([0x44, 0x12, 0x00, 0x41])
SUS_4_N_LOC_XMYFZF_PT_ZF = bytes([0x44, 0x12, 0x00, 0x36]) SUS_4_N_LOC_XMYFZF_PT_ZF = bytes([0x44, 0x12, 0x00, 0x36])
SUS_10_N_LOC_XMYBZF_PT_ZF = bytes([0x44, 0x12, 0x00, 0x42]) SUS_10_R_LOC_XMYBZF_PT_ZF = bytes([0x44, 0x12, 0x00, 0x42])
SUS_5_N_LOC_XFYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x37]) SUS_5_N_LOC_XFYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x37])
SUS_11_R_LOC_XBYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x43]) SUS_11_R_LOC_XBYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x43])

View File

@ -1,3 +1,4 @@
from pus_tc.system.proc import add_proc_cmds
from tmtccmd.config import ( from tmtccmd.config import (
add_op_code_entry, add_op_code_entry,
add_service_op_code_entry, add_service_op_code_entry,
@ -487,37 +488,6 @@ def add_ploc_supv_cmds(cmd_dict: ServiceOpCodeDictT):
] = service_ploc_memory_dumper_tuple ] = service_ploc_memory_dumper_tuple
def add_proc_cmds(cmd_dict: ServiceOpCodeDictT):
from pus_tc.system.proc import OpCodes, KAI
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict, keys=OpCodes.HEATER, info=KAI.HEATER[1]
)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.PROCEDURE.value,
info="Procedures",
op_code_entry=op_code_dict,
)
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict, keys=OpCodes.BAT_FT, info=KAI.BAT_FT[1]
)
add_op_code_entry(
op_code_dict=op_code_dict, keys=OpCodes.PCDU_FT, info=KAI.PCDU_FT[1]
)
add_op_code_entry(
op_code_dict=op_code_dict, keys=OpCodes.CORE_FT, info=KAI.CORE_FT[1], options={}
)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.PROCEDURE.value,
info="TV Test Procedures",
op_code_entry=op_code_dict,
)
def add_system_cmds(cmd_dict: ServiceOpCodeDictT): def add_system_cmds(cmd_dict: ServiceOpCodeDictT):
from pus_tc.system.acs import AcsOpCodes, SusOpCodes from pus_tc.system.acs import AcsOpCodes, SusOpCodes
import pus_tc.system.tcs as tcs import pus_tc.system.tcs as tcs

View File

@ -12,6 +12,10 @@ class GpsOpCodes(enum.Enum):
RESET_GNSS = "5" RESET_GNSS = "5"
class SetIds:
HK = 0
def pack_gps_command(object_id: bytes, tc_queue: TcQueueT, op_code: str): def pack_gps_command(object_id: bytes, tc_queue: TcQueueT, op_code: str):
if op_code == GpsOpCodes.RESET_GNSS.value: if op_code == GpsOpCodes.RESET_GNSS.value:
if object_id == GPS_HANDLER_0_ID: if object_id == GPS_HANDLER_0_ID:

View File

@ -136,8 +136,7 @@ def pack_single_rw_test_into(
speed = int(input("Specify speed [0.1 RPM]: ")) speed = int(input("Specify speed [0.1 RPM]: "))
ramp_time = int(input("Specify ramp time [ms]: ")) ramp_time = int(input("Specify ramp time [ms]: "))
tc_queue.appendleft((QueueCommands.PRINT, f"RW {rw_idx}: {InfoDevs.SPEED}")) tc_queue.appendleft((QueueCommands.PRINT, f"RW {rw_idx}: {InfoDevs.SPEED}"))
command = pack_set_speed_command(object_id, speed, ramp_time) command = pack_set_speed_command(object_id, speed, ramp_time, 40)
command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
if op_code in OpCodesDevs.ON: if op_code in OpCodesDevs.ON:
@ -196,17 +195,21 @@ def pack_rw_ass_cmds(tc_queue: TcQueueT, object_id: bytes, op_code: str):
tc_queue.appendleft(cmd.pack_command_tuple()) tc_queue.appendleft(cmd.pack_command_tuple())
def pack_set_speed_command(object_id: bytes, speed: int, ramp_time: int) -> bytearray: def pack_set_speed_command(
object_id: bytes, speed: int, ramp_time: int, ssc: int
) -> PusTelecommand:
"""With this function a command is packed to set the speed of a reaction wheel """With this function a command is packed to set the speed of a reaction wheel
:param object_id: The object id of the reaction wheel handler. :param object_id: The object id of the reaction wheel handler.
:param speed: Valid speeds are [-65000, -1000] and [1000, 65000]. Values are :param speed: Valid speeds are [-65000, -1000] and [1000, 65000]. Values are
specified in 0.1 * RPM specified in 0.1 * RPM
:param ramp_time: The time after which the reaction wheel will reached the commanded speed. :param ramp_time: The time after which the reaction wheel will reach the commanded speed.
Valid times are 10 - 10000 ms Valid times are 10 - 10000 ms
:param ssc: Source sequence count
""" """
command_id = RwCommandIds.SET_SPEED command_id = RwCommandIds.SET_SPEED
command = bytearray() command = bytearray()
command += object_id + command_id command += object_id + command_id
command = command + struct.pack("!i", speed) command = command + struct.pack("!i", speed)
command = command + ramp_time.to_bytes(length=2, byteorder="big") command = command + ramp_time.to_bytes(length=2, byteorder="big")
command = PusTelecommand(service=8, subservice=128, ssc=ssc, app_data=command)
return command return command

View File

@ -85,6 +85,10 @@ class StarTrackerActionIds:
FIRMWARE_UPDATE = 84 FIRMWARE_UPDATE = 84
class SetIds:
TEMPERATURE = 25
class FileDefs: class FileDefs:
download_path = "/mnt/sd0/startracker" download_path = "/mnt/sd0/startracker"
json_file = "/mnt/sd0/startracker/full.json" json_file = "/mnt/sd0/startracker/full.json"

2
pus_tc/devs/sus.py Normal file
View File

@ -0,0 +1,2 @@
class SetIds:
HK = 3

View File

@ -1,4 +1,10 @@
from tmtccmd.config import QueueCommands from config.definitions import CustomServiceList
from tmtccmd.config import (
QueueCommands,
ServiceOpCodeDictT,
add_op_code_entry,
add_service_op_code_entry,
)
from tmtccmd.tc.definitions import TcQueueT from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.tc.pus_3_fsfw_hk import * from tmtccmd.tc.pus_3_fsfw_hk import *
@ -21,15 +27,18 @@ from pus_tc.devs.mgms import MgmLis3SetIds as MgmSetIds_0_2
from pus_tc.devs.mgms import MgmRm3100SetIds as MgmSetIds_1_3 from pus_tc.devs.mgms import MgmRm3100SetIds as MgmSetIds_1_3
from pus_tc.devs.gyros import AdisGyroSetIds as GyroSetIds_0_2 from pus_tc.devs.gyros import AdisGyroSetIds as GyroSetIds_0_2
from pus_tc.devs.gyros import L3gGyroSetIds as GyroSetIds_1_3 from pus_tc.devs.gyros import L3gGyroSetIds as GyroSetIds_1_3
from pus_tc.devs.gps import Gnss0SetIds as GnssSetIds_0 from pus_tc.devs.gps import SetIds as GpsSetIds
from pus_tc.devs.gps import Gnss1SetIds as GnssSetIds_1
from pus_tc.devs.imtq import ImtqSetIds from pus_tc.devs.imtq import ImtqSetIds
from pus_tc.devs.sus import SetIds
from pus_tc.devs.star_tracker import SetIds as StrSetIds
from pus_tc.devs.reaction_wheels import RwSetIds
from pus_tc.system.tcs import pack_tcs_sys_commands from pus_tc.system.tcs import pack_tcs_sys_commands
from pus_tc.system.controllers import pack_controller_commands from pus_tc.system.controllers import pack_controller_commands
from pus_tc.system.acs import pack_acs_command from pus_tc.system.acs import pack_acs_command, pack_sus_cmds
from pus_tc.devs.imtq import pack_dipole_command from pus_tc.devs.imtq import pack_imtq_test_into, pack_dipole_command
from pus_tc.devs.star_tracker import pack_star_tracker_commands
from pus_tc.devs.reaction_wheels import pack_rw_ass_cmds, pack_set_speed_command
class OpCodes: class OpCodes:
@ -43,6 +52,10 @@ class OpCodes:
ACS_FT = ["acs-ft"] ACS_FT = ["acs-ft"]
MGT_FT = ["mgt-ft"] MGT_FT = ["mgt-ft"]
MGT_FT_DP = ["mgt-ft-dp"] MGT_FT_DP = ["mgt-ft-dp"]
SUS_FT = ["sus-ft"]
STR_FT = ["str-ft"]
RW_FT_ONE_RW = ["rw-ft-one-rw"]
RW_FT_TWO_RWS = ["rw-ft-two-rws"]
class KeyAndInfo: class KeyAndInfo:
@ -56,6 +69,10 @@ class KeyAndInfo:
ACS_FT = ["ACS", "ACS functional test"] ACS_FT = ["ACS", "ACS functional test"]
MGT_FT = ["MGT", "MGT functional test"] MGT_FT = ["MGT", "MGT functional test"]
MGT_FT_DP = ["MGT dipole", "MGT functional test with dipole"] MGT_FT_DP = ["MGT dipole", "MGT functional test with dipole"]
SUS_FT = ["SUS", "SUS functional test"]
STR_FT = ["STR", "STR functional test"]
RW_FT_ONE_RW = ["RW ONE RW", "RW functional test with one RW"]
RW_FT_TWO_RWS = ["RW TWO RWS", "RW functional test with two RWs"]
KAI = KeyAndInfo KAI = KeyAndInfo
@ -69,8 +86,14 @@ PROC_INFO_DICT = {
KAI.TCS_FT_OFF[0]: [OpCodes.TCS_FT_OFF, KAI.TCS_FT_OFF[1], 120.0, 10.0], KAI.TCS_FT_OFF[0]: [OpCodes.TCS_FT_OFF, KAI.TCS_FT_OFF[1], 120.0, 10.0],
KAI.ACS_FT[0]: [OpCodes.ACS_FT, KAI.ACS_FT[1], 120.0, 10.0], KAI.ACS_FT[0]: [OpCodes.ACS_FT, KAI.ACS_FT[1], 120.0, 10.0],
KAI.MGT_FT[0]: [OpCodes.MGT_FT, KAI.MGT_FT[1], 120.0, 10.0], KAI.MGT_FT[0]: [OpCodes.MGT_FT, KAI.MGT_FT[1], 120.0, 10.0],
KAI.MGT_FT_DP[0]: [OpCodes.MGT_FT_DP, KAI.MGT_FT_DP[1], 120.0, 10.0],
# collection_time for KAI.MGT_FT_DP maybe be reduced as a full 120seconds is not needed after MGTs are tested # collection_time for KAI.MGT_FT_DP maybe be reduced as a full 120seconds is not needed after MGTs are tested
KAI.MGT_FT_DP[0]: [OpCodes.MGT_FT_DP, KAI.MGT_FT_DP[1], 10.0, 10.0],
KAI.SUS_FT[0]: [OpCodes.SUS_FT, KAI.SUS_FT[1], 120.0, 10.0],
KAI.STR_FT[0]: [OpCodes.STR_FT, KAI.STR_FT[1], 120.0, 10.0],
# collection_time for KAI.RW_FT_ONE_RW maybe be reduced as a full 120seconds is not needed after RWs are tested
KAI.RW_FT_ONE_RW[0]: [OpCodes.RW_FT_ONE_RW, KAI.RW_FT_ONE_RW[1], 10.0, 1.0],
# collection_time for KAI.RW_FT_ONE_RW maybe be reduced as a full 120seconds is not needed after RWs are tested
KAI.RW_FT_TWO_RWS[0]: [OpCodes.RW_FT_TWO_RWS, KAI.RW_FT_TWO_RWS[1], 10.0, 1.0],
} }
@ -80,12 +103,29 @@ def generic_print(tc_queue: TcQueueT, info: dict):
) )
def add_proc_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict = dict()
for proc_entry in PROC_INFO_DICT.values():
add_op_code_entry(
op_code_dict=op_code_dict, keys=proc_entry[0], info=proc_entry[1]
)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.PROCEDURE.value,
info="TV Test Procedures",
op_code_entry=op_code_dict,
)
def pack_generic_hk_listening_cmds( def pack_generic_hk_listening_cmds(
tc_queue: TcQueueT, tc_queue: TcQueueT,
proc_key: str, proc_key: str,
sid_list: list[bytearray], sid_list: list[bytearray],
diag: bool, diag: bool,
mgt: bool, mgt: bool,
one_rw: bool,
two_rws: bool,
): ):
info = PROC_INFO_DICT[proc_key] info = PROC_INFO_DICT[proc_key]
collection_time = info[2] collection_time = info[2]
@ -105,6 +145,16 @@ def pack_generic_hk_listening_cmds(
tc_queue=tc_queue, tc_queue=tc_queue,
) )
elif one_rw is True:
activate_one_rw_in_sequence(
tc_queue=tc_queue,
)
elif two_rws is True:
activate_two_rws_in_sequence(
tc_queue=tc_queue,
)
else: else:
pass pass
@ -127,14 +177,26 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
key = KAI.BAT_FT[0] key = KAI.BAT_FT[0]
sid_list.append(make_sid(oids.BPX_HANDLER_ID, BpxSetIds.GET_HK_SET)) sid_list.append(make_sid(oids.BPX_HANDLER_ID, BpxSetIds.GET_HK_SET))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False, mgt=False tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
) )
if op_code in OpCodes.CORE_FT: if op_code in OpCodes.CORE_FT:
key = KAI.CORE_FT[0] key = KAI.CORE_FT[0]
sid_list.append(make_sid(oids.CORE_CONTROLLER_ID, CoreSetIds.HK)) sid_list.append(make_sid(oids.CORE_CONTROLLER_ID, CoreSetIds.HK))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False, mgt=False tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
) )
if op_code in OpCodes.PCDU_FT: if op_code in OpCodes.PCDU_FT:
@ -148,14 +210,26 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
sid_list.append(make_sid(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_AUX)) sid_list.append(make_sid(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_AUX))
sid_list.append(make_sid(oids.ACU_HANDLER_ID, GsSetIds.ACU_AUX)) sid_list.append(make_sid(oids.ACU_HANDLER_ID, GsSetIds.ACU_AUX))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False, mgt=False tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
) )
if op_code in OpCodes.RAD_SEN_FT: if op_code in OpCodes.RAD_SEN_FT:
key = KAI.RAD_SEN_FT[0] key = KAI.RAD_SEN_FT[0]
sid_list.append(make_sid(oids.RAD_SENSOR_ID, RadSetIds.RAD_SEN_CORE)) sid_list.append(make_sid(oids.RAD_SENSOR_ID, RadSetIds.RAD_SEN_CORE))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False, mgt=False tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
) )
if op_code in OpCodes.TCS_FT_ON: if op_code in OpCodes.TCS_FT_ON:
@ -181,9 +255,15 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
sid_list.append(make_sid(oids.GYRO_0_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK)) sid_list.append(make_sid(oids.GYRO_0_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK))
sid_list.append(make_sid(oids.GYRO_1_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK)) sid_list.append(make_sid(oids.GYRO_1_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK))
# GNSS0 # GNSS0
sid_list.append(make_sid(oids.GPS_HANDLER_0_ID, GnssSetIds_0.CORE_HK)) sid_list.append(make_sid(oids.GPS_HANDLER_0_ID, GpsSetIds.HK))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False, mgt=False tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
) )
pack_acs_command(tc_queue=tc_queue, op_code="acs-off") pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
@ -198,9 +278,15 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
sid_list.append(make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK)) sid_list.append(make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK))
sid_list.append(make_sid(oids.GYRO_3_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK)) sid_list.append(make_sid(oids.GYRO_3_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK))
# GNSS1 # GNSS1
sid_list.append(make_sid(oids.GPS_HANDLER_1_ID, GnssSetIds_1.CORE_HK)) sid_list.append(make_sid(oids.GPS_HANDLER_1_ID, GpsSetIds.HK))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False, mgt=False tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
) )
pack_acs_command(tc_queue=tc_queue, op_code="acs-off") pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
@ -220,10 +306,16 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
sid_list.append(make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK)) sid_list.append(make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK))
sid_list.append(make_sid(oids.GYRO_3_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK)) sid_list.append(make_sid(oids.GYRO_3_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK))
# GNSS0+1 # GNSS0+1
sid_list.append(make_sid(oids.GPS_HANDLER_0_ID, GnssSetIds_0.CORE_HK)) sid_list.append(make_sid(oids.GPS_HANDLER_0_ID, GpsSetIds.HK))
sid_list.append(make_sid(oids.GPS_HANDLER_1_ID, GnssSetIds_1.CORE_HK)) sid_list.append(make_sid(oids.GPS_HANDLER_1_ID, GpsSetIds.HK))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False, mgt=False tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
) )
pack_acs_command(tc_queue=tc_queue, op_code="acs-off") pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
@ -231,39 +323,214 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
if op_code in OpCodes.MGT_FT: if op_code in OpCodes.MGT_FT:
key = KAI.MGT_FT[0] key = KAI.MGT_FT[0]
# missing imtq to ON
# mgt 1: imtq und hk # mgt 1: imtq und hk
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="2")
# MISSING: imtq board activation to ON (implementation pending by Jakob)
sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET)) sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET))
sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET)) sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET))
sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET)) sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False, mgt=False tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
) )
# MISSING: imtq board deactivation to OFF (implementation pending by Jakob) pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="0")
# missing imtq to ON
# mgt 2.: imtq + dual side + dipole
if op_code in OpCodes.MGT_FT_DP: if op_code in OpCodes.MGT_FT_DP:
key = KAI.MGT_FT_DP[0] key = KAI.MGT_FT_DP[0]
pack_acs_command(tc_queue=tc_queue, op_code="acs-d")
# MISSING: imtq board activation to ON (implementation pending by Jakob) pack_acs_command(tc_queue=tc_queue, op_code="acs-d")
# mgt 2.: imtq + dual side + dipole
pack_imtq_test_into(
object_id=oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="2"
)
sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET)) sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET))
sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET)) sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET))
sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET)) sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False, mgt=True tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=True,
one_rw=False,
two_rws=False,
) )
# MISSING: imtq board deactivation to OFF (implementation pending by Jakob) pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="0")
pack_acs_command(tc_queue=tc_queue, op_code="acs-off") pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
if op_code in OpCodes.SUS_FT:
key = KAI.SUS_FT[0]
pack_sus_cmds(tc_queue=tc_queue, op_code="sus-nom")
sus_n_ids = [
oids.SUS_0_N_LOC_XFYFZM_PT_XF,
oids.SUS_1_N_LOC_XBYFZM_PT_XB,
oids.SUS_2_N_LOC_XFYBZB_PT_YB,
oids.SUS_3_N_LOC_XFYBZF_PT_YF,
oids.SUS_4_N_LOC_XMYFZF_PT_ZF,
oids.SUS_5_N_LOC_XFYMZB_PT_ZB,
]
sus_r_ids = [
oids.SUS_6_R_LOC_XFYBZM_PT_XF,
oids.SUS_7_R_LOC_XBYBZM_PT_XB,
oids.SUS_8_R_LOC_XBYBZB_PT_YB,
oids.SUS_9_R_LOC_XBYBZB_PT_YF,
oids.SUS_10_R_LOC_XMYBZF_PT_ZF,
oids.SUS_11_R_LOC_XBYMZB_PT_ZB,
]
# SUSs
for nom_sus in sus_n_ids:
sid_list.append(make_sid(nom_sus, SetIds.HK))
pack_generic_hk_listening_cmds(
tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
)
pack_acs_command(tc_queue=tc_queue, op_code="sus-off")
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
pack_sus_cmds(tc_queue=tc_queue, op_code="sus-red")
# SUSs
for red_sus in sus_r_ids:
sid_list.append(make_sid(red_sus, SetIds.HK))
pack_generic_hk_listening_cmds(
tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
)
pack_acs_command(tc_queue=tc_queue, op_code="sus-off")
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
pack_sus_cmds(tc_queue=tc_queue, op_code="sus-d")
# SUSs
for nom_sus in sus_n_ids:
sid_list.append(make_sid(nom_sus, SetIds.HK))
for red_sus in sus_r_ids:
sid_list.append(make_sid(red_sus, SetIds.HK))
pack_generic_hk_listening_cmds(
tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
)
pack_acs_command(tc_queue=tc_queue, op_code="sus-off")
if op_code in OpCodes.STR_FT:
key = KAI.STR_FT[0]
pack_star_tracker_commands(
object_id=oids.STAR_TRACKER_ID, tc_queue=tc_queue, op_code="2"
)
# STR
sid_list.append(make_sid(oids.STAR_TRACKER_ID, StrSetIds.TEMPERATURE))
pack_generic_hk_listening_cmds(
tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=False,
)
pack_star_tracker_commands(
object_id=oids.STAR_TRACKER_ID, tc_queue=tc_queue, op_code="3"
)
if op_code in OpCodes.RW_FT_ONE_RW:
key = KAI.RW_FT_ONE_RW[0]
# RW NORMAL
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="nml")
# RW HK für alle RWs nur einzeln
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.STATUS_SET_ID))
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.TEMPERATURE_SET_ID))
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.LAST_RESET))
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.TM_SET))
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.STATUS_SET_ID))
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.TEMPERATURE_SET_ID))
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.LAST_RESET))
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.TM_SET))
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.STATUS_SET_ID))
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.TEMPERATURE_SET_ID))
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.LAST_RESET))
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.TM_SET))
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.STATUS_SET_ID))
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.TEMPERATURE_SET_ID))
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.LAST_RESET))
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.TM_SET))
pack_generic_hk_listening_cmds(
tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=True,
two_rws=False,
)
# RW OFF
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="off")
# ass command with 2 rws to speed
if op_code in OpCodes.RW_FT_TWO_RWS:
key = KAI.RW_FT_TWO_RWS[0]
# RW NORMAL
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="nml")
# RW
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.STATUS_SET_ID))
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.TEMPERATURE_SET_ID))
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.LAST_RESET))
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.TM_SET))
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.STATUS_SET_ID))
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.TEMPERATURE_SET_ID))
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.LAST_RESET))
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.TM_SET))
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.STATUS_SET_ID))
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.TEMPERATURE_SET_ID))
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.LAST_RESET))
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.TM_SET))
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.STATUS_SET_ID))
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.TEMPERATURE_SET_ID))
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.LAST_RESET))
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.TM_SET))
pack_generic_hk_listening_cmds(
tc_queue=tc_queue,
proc_key=key,
sid_list=sid_list,
diag=False,
mgt=False,
one_rw=False,
two_rws=True,
)
# RW OFF
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="off")
""" """
def listen_to_hk_for_x_seconds( def listen_to_hk_for_x_seconds(
@ -332,7 +599,7 @@ def activate_mgts_alternately(
duration=30000, duration=30000,
) )
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0)) tc_queue.appendleft((QueueCommands.WAIT, 40.0))
command = pack_dipole_command( command = pack_dipole_command(
object_id=oids.IMTQ_HANDLER_ID, object_id=oids.IMTQ_HANDLER_ID,
@ -342,7 +609,7 @@ def activate_mgts_alternately(
duration=30000, duration=30000,
) )
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0)) tc_queue.appendleft((QueueCommands.WAIT, 40.0))
command = pack_dipole_command( command = pack_dipole_command(
object_id=oids.IMTQ_HANDLER_ID, object_id=oids.IMTQ_HANDLER_ID,
@ -352,7 +619,7 @@ def activate_mgts_alternately(
duration=30000, duration=30000,
) )
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0)) tc_queue.appendleft((QueueCommands.WAIT, 40.0))
command = pack_dipole_command( command = pack_dipole_command(
object_id=oids.IMTQ_HANDLER_ID, object_id=oids.IMTQ_HANDLER_ID,
@ -362,7 +629,7 @@ def activate_mgts_alternately(
duration=30000, duration=30000,
) )
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0)) tc_queue.appendleft((QueueCommands.WAIT, 40.0))
command = pack_dipole_command( command = pack_dipole_command(
object_id=oids.IMTQ_HANDLER_ID, object_id=oids.IMTQ_HANDLER_ID,
@ -372,7 +639,7 @@ def activate_mgts_alternately(
duration=30000, duration=30000,
) )
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0)) tc_queue.appendleft((QueueCommands.WAIT, 40.0))
command = pack_dipole_command( command = pack_dipole_command(
object_id=oids.IMTQ_HANDLER_ID, object_id=oids.IMTQ_HANDLER_ID,
@ -382,4 +649,131 @@ def activate_mgts_alternately(
duration=30000, duration=30000,
) )
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 40.0))
def activate_one_rw_in_sequence(
tc_queue: TcQueueT,
):
# RW1 speed cmd
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
command = pack_set_speed_command(
object_id=oids.RW1_ID,
speed=20000,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 70.0))
command = pack_set_speed_command(
object_id=oids.RW1_ID,
speed=0,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0)) tc_queue.appendleft((QueueCommands.WAIT, 10.0))
# RW2 speed cmd
command = pack_set_speed_command(
object_id=oids.RW2_ID,
speed=20000,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 70.0))
command = pack_set_speed_command(
object_id=oids.RW2_ID,
speed=0,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0))
# RW3 speed cmd
command = pack_set_speed_command(
object_id=oids.RW3_ID,
speed=20000,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 70.0))
command = pack_set_speed_command(
object_id=oids.RW3_ID,
speed=0,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0))
# RW4 speed cmd
command = pack_set_speed_command(
object_id=oids.RW4_ID,
speed=20000,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 70.0))
command = pack_set_speed_command(
object_id=oids.RW4_ID,
speed=0,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
def activate_two_rws_in_sequence(tc_queue: TcQueueT):
# RW1+3 speed cmd
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
command = pack_set_speed_command(
object_id=oids.RW1_ID,
speed=-20000,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
command = pack_set_speed_command(
object_id=oids.RW3_ID,
speed=-20000,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 70.0))
command = pack_set_speed_command(
object_id=oids.RW1_ID,
speed=0,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
command = pack_set_speed_command(
object_id=oids.RW3_ID,
speed=0,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0))
# RW2+4 speed cmd
command = pack_set_speed_command(
object_id=oids.RW2_ID,
speed=-20000,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
command = pack_set_speed_command(
object_id=oids.RW4_ID,
speed=-20000,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 70.0))
command = pack_set_speed_command(
object_id=oids.RW2_ID,
speed=0,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
command = pack_set_speed_command(
object_id=oids.RW4_ID,
speed=0,
ramp_time=10000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 5.0))

View File

@ -1 +1 @@
tmtccmd >= 2.2.1 tmtccmd >= 2.2.2

View File

@ -27,7 +27,7 @@ classifiers =
[options] [options]
install_requires = install_requires =
tmtccmd >= 2.2.1 tmtccmd >= 2.2.2
packages = find: packages = find:
python_requires = >=3.8 python_requires = >=3.8

@ -1 +1 @@
Subproject commit 0ea7df5f46b069da95fbe795e1541f28071b6371 Subproject commit 2354f5d2778c7681ddf6602766dd4e68b943e1c0