2021-09-08 13:20:22 +02:00
|
|
|
import enum
|
|
|
|
|
|
|
|
from tmtccmd.config.definitions import QueueCommands
|
|
|
|
from tmtccmd.tc.definitions import TcQueueT
|
2022-05-05 16:15:53 +02:00
|
|
|
from tmtccmd.tc.pus_8_funccmd import generate_action_command
|
2021-09-08 13:20:22 +02:00
|
|
|
|
|
|
|
|
2022-05-27 11:53:57 +02:00
|
|
|
from config.object_ids import GPS_HANDLER_1_ID, GPS_CONTROLLER
|
2021-09-08 13:20:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
class GpsOpCodes(enum.Enum):
|
|
|
|
RESET_GNSS = "5"
|
|
|
|
|
|
|
|
|
2022-05-25 12:06:17 +02:00
|
|
|
class SetIds:
|
|
|
|
HK = 0
|
|
|
|
|
|
|
|
|
2021-09-08 14:47:33 +02:00
|
|
|
def pack_gps_command(object_id: bytes, tc_queue: TcQueueT, op_code: str):
|
2021-09-08 13:20:22 +02:00
|
|
|
if op_code == GpsOpCodes.RESET_GNSS.value:
|
2022-05-27 11:53:57 +02:00
|
|
|
if object_id == GPS_CONTROLLER:
|
2021-09-08 13:20:22 +02:00
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 0"))
|
|
|
|
elif object_id == GPS_HANDLER_1_ID:
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 1"))
|
|
|
|
cmd = generate_action_command(object_id=object_id, action_id=int(op_code))
|
|
|
|
tc_queue.appendleft(cmd.pack_command_tuple())
|