eive-tmtc/pus_tc/acs.py

33 lines
1.0 KiB
Python
Raw Normal View History

2021-09-13 18:06:25 +02:00
import enum
from tmtccmd.tc.definitions import TcQueueT
2021-10-04 01:33:03 +02:00
from spacepackets.ecss.definitions import PusServices
2021-09-13 18:06:25 +02:00
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
from tmtccmd.tc.packer import PusTelecommand
from config.object_ids import MGM_0_HANDLER_ID, MGM_1_HANDLER_ID, MGM_2_HANDLER_ID, MGM_3_HANDLER_ID
2021-09-17 13:06:53 +02:00
from pus_tc.pdu1 import pack_pdu1_commands, Pdu1OpCodes
from pus_tc.pdu2 import pack_pdu2_commands, Pdu2OpCodes
2021-09-13 18:06:25 +02:00
class AcsOpCodes(enum.Enum):
2021-09-17 13:06:53 +02:00
ALL_ON = "0"
ALL_OFF = "1"
POWER_CYCLE = "2"
2021-09-13 18:06:25 +02:00
# Switch on A side
2021-09-17 13:06:53 +02:00
ON_MGM_0 = "12"
ON_MGM_1 = "13"
ON_GYRO_0 = "14"
ON_GYRO_1 = "15"
2021-09-13 18:06:25 +02:00
# Switch on B side
2021-09-17 13:06:53 +02:00
ON_MGM_2 = "16"
ON_MGM_3 = "17"
ON_GYRO_2 = "18"
ON_GYRO_3 = "19"
2021-09-13 18:06:25 +02:00
def pack_acs_command(tc_queue: TcQueueT, op_code: str):
2021-09-17 13:06:53 +02:00
if op_code == AcsOpCodes.ALL_ON:
pass
2021-09-13 18:06:25 +02:00
if op_code == AcsOpCodes.ON_MGM_0.value:
app_data = pack_mode_data(object_id=MGM_0_HANDLER_ID, mode=Modes.ON, submode=0)
# return PusTelecommand(service=PusServices.SERVICE_200_MODE, subservice=)