Compare commits

..

5 Commits

Author SHA1 Message Date
986f88e290 tmtccmd update 2021-04-25 12:03:49 +02:00
3b5d92f908 pushed new version number 2021-04-25 11:15:02 +02:00
684ae7a9c4 Merge branch 'mueller/master' into develop 2021-04-25 11:11:12 +02:00
7cc06ef0e0 minor change 2021-04-24 23:17:36 +02:00
3c343f751f updated tmtccmd submodule 2021-04-24 22:50:35 +02:00
12 changed files with 13 additions and 106 deletions

View File

@@ -15,4 +15,3 @@ class CustomServiceList(enum.Enum):
TMP1075_1 = "tmp1075_1" TMP1075_1 = "tmp1075_1"
TMP1075_2 = "tmp1075_2" TMP1075_2 = "tmp1075_2"
HEATER = "heater" HEATER = "heater"
IMTQ = "imtq"

View File

@@ -18,7 +18,6 @@ TMP_1075_2_HANDLER_ID = bytearray([0x44, 0x00, 0x00, 0x6])
HEATER_ID = bytearray([0x54, 0x00, 0x00, 0x1]) HEATER_ID = bytearray([0x54, 0x00, 0x00, 0x1])
PCDU_HANDLER_ID = bytearray([0x44, 0x00, 0x10, 0x00]) PCDU_HANDLER_ID = bytearray([0x44, 0x00, 0x10, 0x00])
SOLAR_ARRAY_DEPLOYMENT_ID = bytearray([0x44, 0x00, 0x10, 0x01]) SOLAR_ARRAY_DEPLOYMENT_ID = bytearray([0x44, 0x00, 0x10, 0x01])
IMTQ_HANDLER_ID = bytearray([0x44, 0x00, 0x10, 0x14])
class ObjIdIds(enum.IntEnum): class ObjIdIds(enum.IntEnum):
@@ -33,7 +32,6 @@ class ObjIdIds(enum.IntEnum):
TMP1075_2_HANDLER_ID = 8 TMP1075_2_HANDLER_ID = 8
HEATER_ID = 9 HEATER_ID = 9
SOLAR_ARRAY_DEPLOYMENT_ID = 10 SOLAR_ARRAY_DEPLOYMENT_ID = 10
IMTQ_HANDLER_ID = 11
def set_object_ids() -> Dict[int, bytearray]: def set_object_ids() -> Dict[int, bytearray]:
@@ -49,6 +47,5 @@ def set_object_ids() -> Dict[int, bytearray]:
ObjIdIds.HEATER_ID: HEATER_ID, ObjIdIds.HEATER_ID: HEATER_ID,
ObjIdIds.PCDU_HANDLER_ID: PCDU_HANDLER_ID, ObjIdIds.PCDU_HANDLER_ID: PCDU_HANDLER_ID,
ObjIdIds.SOLAR_ARRAY_DEPLOYMENT_ID: SOLAR_ARRAY_DEPLOYMENT_ID, ObjIdIds.SOLAR_ARRAY_DEPLOYMENT_ID: SOLAR_ARRAY_DEPLOYMENT_ID,
ObjIdIds.IMTQ_HANDLER_ID: IMTQ_HANDLER_ID,
}) })
return object_id_dict return object_id_dict

View File

@@ -1,4 +1,4 @@
SW_NAME = "eive" SW_NAME = "eive"
VERSION_MAJOR = 1 VERSION_MAJOR = 1
VERSION_MINOR = 3 VERSION_MINOR = 4
VERSION_SUBMINOR = 0 VERSION_SUBMINOR = 0

View File

@@ -6,11 +6,6 @@ class PDUConfigTable:
out_en_1 = TableEntry(bytearray([0x00, 0x49]), TableEntry.uint8_size) out_en_1 = TableEntry(bytearray([0x00, 0x49]), TableEntry.uint8_size)
out_en_2 = TableEntry(bytearray([0x00, 0x4A]), TableEntry.uint8_size) out_en_2 = TableEntry(bytearray([0x00, 0x4A]), TableEntry.uint8_size)
out_en_3 = TableEntry(bytearray([0x00, 0x4B]), TableEntry.uint8_size) out_en_3 = TableEntry(bytearray([0x00, 0x4B]), TableEntry.uint8_size)
out_en_4 = TableEntry(bytearray([0x00, 0x4C]), TableEntry.uint8_size)
out_en_5 = TableEntry(bytearray([0x00, 0x4D]), TableEntry.uint8_size)
out_en_6 = TableEntry(bytearray([0x00, 0x4E]), TableEntry.uint8_size)
out_en_7 = TableEntry(bytearray([0x00, 0x4F]), TableEntry.uint8_size)
out_en_8 = TableEntry(bytearray([0x00, 0x50]), TableEntry.uint8_size)
# When channel consumes more than cur_lu_lim, channel is turned of immediately # When channel consumes more than cur_lu_lim, channel is turned of immediately
cur_lu_lim_0 = TableEntry(bytearray([0x00, 0xB8]), TableEntry.uint16_size) cur_lu_lim_0 = TableEntry(bytearray([0x00, 0xB8]), TableEntry.uint16_size)

View File

@@ -1,58 +0,0 @@
# -*- coding: utf-8 -*-
"""
@file imtq.py
@brief Tests for the ISIS IMTQ (Magnettorquer) device handler
@author J. Meier
@date 25.03.2021
"""
from tmtccmd.core.definitions import QueueCommands
from tmtccmd.pus_tc.packer import TcQueueT
from tmtccmd.pus_tc.base import PusTelecommand
class ImtqTestProcedure:
"""
@brief Use this class to define the tests to perform for the IMTQ Handler.
@details Setting all to True will run all tests.
Setting all to False will only run the tests set to True.
"""
all = False
command_dipole = True
class ImtqActionIds:
start_actuation_dipole = bytearray([0x0, 0x0, 0x0, 0x02])
def pack_imtq_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
tc_queue.appendleft(
(QueueCommands.PRINT,
"Testing ISIS IMTQ handler with object id: 0x" + object_id.hex())
)
if ImtqTestProcedure.all or ImtqTestProcedure.command_dipole:
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Commanding dipole"))
command = object_id + ImtqActionIds.start_adc_conversion
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
def pack_dipole_command(object_id: bytearray, x_dipole: int, y_dipole: int, z_dipole: int, duration: int) -> bytearray:
""" This function packs the command causing the ISIS IMTQ to generate a dipole.
@param object_id The object id of the gomspace device handler.
@param x_dipole The dipole of the x coil in 10^-4*Am^2 (max. 2000)
@param y_dipole The dipole of the y coil in 10^-4*Am^2 (max. 2000)
@param z_dipole The dipole of the z coil in 10^-4*Am^2 (max. 2000)
@param duration The duration in milliseconds the dipole will be generated by the coils.
When set to 0, the dipole will be generated until a new dipole actuation
command is sent.
"""
action_id = ImtqActionIds.start_actuation_dipole
command = bytearray()
command = object_id + action_id
command.extend(x_dipole.to_bytes(length=2, byteorder='big'))
command.extend(y_dipole.to_bytes(length=2, byteorder='big'))
command.extend(z_dipole.to_bytes(length=2, byteorder='big'))
command.extend(duration.to_bytes(length=2, byteorder='big'))
return command

View File

@@ -24,10 +24,6 @@ class PDU1TestProcedure:
reboot = False reboot = False
ping = False ping = False
read_temperature = False read_temperature = False
turn_channel_2_on = False # Star Tracker connected to this channel (5V)
turn_channel_2_off = False
turn_channel_3_on = False # MTQ connected to this channel (5V)
turn_channel_3_off = True
def pack_pdu1_test_into( def pack_pdu1_test_into(
@@ -35,6 +31,14 @@ def pack_pdu1_test_into(
): ):
tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU1")) tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU1"))
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Enabling PDU1"))
command = pack_set_param_command(
p60dock_object_id, P60DockConfigTable.out_en_1.parameter_address,
P60DockConfigTable.out_en_1.parameter_size, Channel.on
)
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.ping: if PDU1TestProcedure.all or PDU1TestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test")) tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
@@ -49,27 +53,3 @@ def pack_pdu1_test_into(
) )
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command) command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_on:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 2 on (Star Tracker)"))
command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.on)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_off:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 2 off (Star Tracker)"))
command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.off)
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_3_on:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 3 on (MTQ)"))
command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_3.parameter_address,
PDUConfigTable.out_en_3.parameter_size, Channel.on)
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_3_off:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 3 off (MTQ)"))
command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_3.parameter_address,
PDUConfigTable.out_en_3.parameter_size, Channel.off)
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())

View File

@@ -101,5 +101,4 @@ def pack_pdu2_test_into(pdu2_object_id: bytearray, p60dock_object_id: bytearray,
command = pack_request_full_hk_table_command(pdu2_object_id) command = pack_request_full_hk_table_command(pdu2_object_id)
command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command) command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
return tc_queue return tc_queue

View File

@@ -19,7 +19,6 @@ from pus_tc.p60dock import pack_p60dock_test_into
from pus_tc.pdu2 import pack_pdu2_test_into from pus_tc.pdu2 import pack_pdu2_test_into
from pus_tc.pdu1 import pack_pdu1_test_into from pus_tc.pdu1 import pack_pdu1_test_into
from pus_tc.acu import pack_acu_test_into from pus_tc.acu import pack_acu_test_into
from pus_tc.imtq import pack_imtq_test_into
from pus_tc.tmp1075 import pack_tmp1075_test_into from pus_tc.tmp1075 import pack_tmp1075_test_into
from pus_tc.heater import pack_heater_test_into from pus_tc.heater import pack_heater_test_into
from config.definitions import CustomServiceList from config.definitions import CustomServiceList
@@ -55,11 +54,8 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
object_id = get_object_id(ObjIdIds.TMP1075_2_HANDLER_ID) object_id = get_object_id(ObjIdIds.TMP1075_2_HANDLER_ID)
return pack_tmp1075_test_into(object_id, service_queue) return pack_tmp1075_test_into(object_id, service_queue)
if service == CustomServiceList.HEATER.value: if service == CustomServiceList.HEATER.value:
object_id = get_object_id(ObjIdIds.HEATER_ID) object_id = get_object_id(ObjIdIds.HEATER)
return pack_heater_test_into(object_id, service_queue) return pack_heater_test_into(object_id, service_queue)
if service == CustomServiceList.IMTQ.value:
object_id = get_object_id(ObjIdIds.IMTQ_HANDLER_ID)
return pack_imtq_test_into(object_id, service_queue)
LOGGER.warning("Invalid Service !") LOGGER.warning("Invalid Service !")

View File

@@ -16,7 +16,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,

View File

@@ -16,7 +16,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,

Submodule tmtc_core deleted from bd46c5a852

Submodule tmtccmd updated: 563603d0a1...1773f62856