move some modules
This commit is contained in:
parent
6c663b473c
commit
6b657b5623
@ -10,6 +10,8 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
- Move low level ACS board device modules `gyros.py` and `mgms.py`
|
||||||
|
to the `tmtc.acs` module.
|
||||||
- Bump tmtccmd to include more pythonic log usage. All related changes.
|
- Bump tmtccmd to include more pythonic log usage. All related changes.
|
||||||
It is recommended to use `logging.getLogger(__name__)` for module level loggers now.
|
It is recommended to use `logging.getLogger(__name__)` for module level loggers now.
|
||||||
- Moved TCS components to `tmtc` module
|
- Moved TCS components to `tmtc` module
|
||||||
|
@ -15,6 +15,8 @@ def get_event_dict() -> EventDictT:
|
|||||||
if os.path.exists(DEFAULT_EVENTS_CSV_PATH):
|
if os.path.exists(DEFAULT_EVENTS_CSV_PATH):
|
||||||
__EVENT_DICT = parse_fsfw_events_csv(DEFAULT_EVENTS_CSV_PATH)
|
__EVENT_DICT = parse_fsfw_events_csv(DEFAULT_EVENTS_CSV_PATH)
|
||||||
else:
|
else:
|
||||||
logging.getLogger(__name__).warning(f"No Event CSV file found at {DEFAULT_EVENTS_CSV_PATH}")
|
logging.getLogger(__name__).warning(
|
||||||
|
f"No Event CSV file found at {DEFAULT_EVENTS_CSV_PATH}"
|
||||||
|
)
|
||||||
__EVENT_DICT = dict()
|
__EVENT_DICT = dict()
|
||||||
return __EVENT_DICT
|
return __EVENT_DICT
|
||||||
|
@ -142,7 +142,9 @@ CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
|
|||||||
def get_object_ids() -> ObjectIdDictT:
|
def get_object_ids() -> ObjectIdDictT:
|
||||||
global __OBJECT_ID_DICT
|
global __OBJECT_ID_DICT
|
||||||
if not os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
|
if not os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
|
||||||
logging.getLogger(__name__).warning(f"No Objects CSV file found at {DEFAULT_OBJECTS_CSV_PATH}")
|
logging.getLogger(__name__).warning(
|
||||||
|
f"No Objects CSV file found at {DEFAULT_OBJECTS_CSV_PATH}"
|
||||||
|
)
|
||||||
if __OBJECT_ID_DICT is None:
|
if __OBJECT_ID_DICT is None:
|
||||||
if os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
|
if os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
|
||||||
__OBJECT_ID_DICT = parse_fsfw_objects_csv(csv_file=DEFAULT_OBJECTS_CSV_PATH)
|
__OBJECT_ID_DICT = parse_fsfw_objects_csv(csv_file=DEFAULT_OBJECTS_CSV_PATH)
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
import enum
|
|
||||||
|
|
||||||
|
|
||||||
class AdisGyroSetId(enum.IntEnum):
|
|
||||||
CORE_HK = 0
|
|
||||||
CFG_HK = 1
|
|
||||||
|
|
||||||
|
|
||||||
class L3gGyroSetId(enum.IntEnum):
|
|
||||||
CORE_HK = 0
|
|
@ -1,9 +0,0 @@
|
|||||||
import enum
|
|
||||||
|
|
||||||
|
|
||||||
class MgmLis3SetId(enum.IntEnum):
|
|
||||||
CORE_HK = 0
|
|
||||||
|
|
||||||
|
|
||||||
class MgmRm3100SetId(enum.IntEnum):
|
|
||||||
CORE_HK = 0
|
|
@ -8,7 +8,6 @@ from tmtccmd.tc import service_provider
|
|||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class OpCode:
|
class OpCode:
|
||||||
SET_CURRENT_TIME = ["0", "set-curr-time"]
|
SET_CURRENT_TIME = ["0", "set-curr-time"]
|
||||||
|
|
||||||
@ -22,6 +21,8 @@ def pack_set_current_time_ascii_command(p: ServiceProviderParams):
|
|||||||
q = p.queue_helper
|
q = p.queue_helper
|
||||||
time_test_current_time = datetime.utcnow().isoformat() + "Z" + "\0"
|
time_test_current_time = datetime.utcnow().isoformat() + "Z" + "\0"
|
||||||
current_time_ascii = time_test_current_time.encode("ascii")
|
current_time_ascii = time_test_current_time.encode("ascii")
|
||||||
logging.getLogger(__name__).info(f"Current time in ASCII format: {current_time_ascii}")
|
logging.getLogger(__name__).info(
|
||||||
|
f"Current time in ASCII format: {current_time_ascii}"
|
||||||
|
)
|
||||||
q.add_log_cmd(Info.SET_CURRENT_TIME)
|
q.add_log_cmd(Info.SET_CURRENT_TIME)
|
||||||
q.add_pus_tc(PusTelecommand(service=9, subservice=128, app_data=current_time_ascii))
|
q.add_pus_tc(PusTelecommand(service=9, subservice=128, app_data=current_time_ascii))
|
||||||
|
@ -19,7 +19,7 @@ from tmtccmd.util.obj_id import ObjectIdU32, ObjectIdDictT
|
|||||||
|
|
||||||
from eive_tmtc.pus_tm.devs.bpx_bat import handle_bpx_hk_data
|
from eive_tmtc.pus_tm.devs.bpx_bat import handle_bpx_hk_data
|
||||||
from eive_tmtc.pus_tm.devs.gps import handle_gps_data
|
from eive_tmtc.pus_tm.devs.gps import handle_gps_data
|
||||||
from eive_tmtc.pus_tm.devs.gyros import handle_gyros_hk_data
|
from eive_tmtc.tmtc.acs.gyros import handle_gyros_hk_data
|
||||||
from eive_tmtc.tmtc.power.tm import (
|
from eive_tmtc.tmtc.power.tm import (
|
||||||
handle_pdu_data,
|
handle_pdu_data,
|
||||||
handle_p60_hk_data,
|
handle_p60_hk_data,
|
||||||
@ -34,7 +34,7 @@ from eive_tmtc.tmtc.acs.imtq import (
|
|||||||
)
|
)
|
||||||
from eive_tmtc.pus_tm.defs import FsfwTmTcPrinter
|
from eive_tmtc.pus_tm.defs import FsfwTmTcPrinter
|
||||||
from eive_tmtc.tmtc.core import handle_core_hk_data
|
from eive_tmtc.tmtc.core import handle_core_hk_data
|
||||||
from eive_tmtc.pus_tm.devs.mgms import handle_mgm_hk_data
|
from eive_tmtc.tmtc.acs.mgms import handle_mgm_hk_data
|
||||||
import eive_tmtc.config.object_ids as obj_ids
|
import eive_tmtc.config.object_ids as obj_ids
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,11 +1,20 @@
|
|||||||
|
import enum
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
|
import config.objects as obj_ids
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
from eive_tmtc.pus_tc.devs.gyros import L3gGyroSetId, AdisGyroSetId
|
|
||||||
import eive_tmtc.config.object_ids as obj_ids
|
class AdisGyroSetId(enum.IntEnum):
|
||||||
|
CORE_HK = 0
|
||||||
|
CFG_HK = 1
|
||||||
|
|
||||||
|
|
||||||
|
class L3gGyroSetId(enum.IntEnum):
|
||||||
|
CORE_HK = 0
|
||||||
|
|
||||||
|
|
||||||
def handle_gyros_hk_data(
|
def handle_gyros_hk_data(
|
@ -1,10 +1,19 @@
|
|||||||
|
import enum
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
|
import config.object_id as obj_ids
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
from eive_tmtc.pus_tc.devs.mgms import MgmRm3100SetId, MgmLis3SetId
|
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
import eive_tmtc.config.object_ids as obj_ids
|
|
||||||
|
|
||||||
|
class MgmLis3SetId(enum.IntEnum):
|
||||||
|
CORE_HK = 0
|
||||||
|
|
||||||
|
|
||||||
|
class MgmRm3100SetId(enum.IntEnum):
|
||||||
|
CORE_HK = 0
|
||||||
|
|
||||||
|
|
||||||
def handle_mgm_hk_data(
|
def handle_mgm_hk_data(
|
@ -81,7 +81,9 @@ def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
if q.empty():
|
if q.empty():
|
||||||
logging.getLogger(__name__).info(f"Queue is empty, no stack for op code {op_code}")
|
logging.getLogger(__name__).info(
|
||||||
|
f"Queue is empty, no stack for op code {op_code}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
|
4
tmtcc.py
4
tmtcc.py
@ -393,7 +393,9 @@ def setup_tmtc_handlers(
|
|||||||
gui: bool,
|
gui: bool,
|
||||||
) -> (CcsdsTmHandler, TcHandler):
|
) -> (CcsdsTmHandler, TcHandler):
|
||||||
cfdp_in_ccsds_wrapper = setup_cfdp_handler()
|
cfdp_in_ccsds_wrapper = setup_cfdp_handler()
|
||||||
verification_wrapper = VerificationWrapper(verificator, _LOGGER, printer.file_logger)
|
verification_wrapper = VerificationWrapper(
|
||||||
|
verificator, _LOGGER, printer.file_logger
|
||||||
|
)
|
||||||
pus_handler = PusHandler(verification_wrapper, printer, raw_logger)
|
pus_handler = PusHandler(verification_wrapper, printer, raw_logger)
|
||||||
ccsds_handler = CcsdsTmHandler(generic_handler=UnknownApidHandler(None))
|
ccsds_handler = CcsdsTmHandler(generic_handler=UnknownApidHandler(None))
|
||||||
ccsds_handler.add_apid_handler(pus_handler)
|
ccsds_handler.add_apid_handler(pus_handler)
|
||||||
|
Loading…
Reference in New Issue
Block a user