update code to new tmtccmd version
This commit is contained in:
@ -1,46 +1,27 @@
|
||||
from typing import Optional, Union
|
||||
from abc import abstractmethod
|
||||
from typing import Optional
|
||||
|
||||
from tmtccmd.com_if.com_interface_base import CommunicationInterface
|
||||
from tmtccmd.config.definitions import ServiceOpCodeDictT
|
||||
from tmtccmd.config.hook import TmTcHookBase
|
||||
from tmtccmd.core.backend import TmTcHandler
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.utility.obj_id import ObjectIdDictT
|
||||
|
||||
from tmtccmd.utility.retval import RetvalDictT
|
||||
|
||||
from common_tmtc.config.definitions import TM_SP_IDS
|
||||
from common_tmtc.pus_tc.cmd_definitions import common_fsfw_service_op_code_dict
|
||||
from tmtccmd import BackendBase
|
||||
from tmtccmd.com_if import ComInterface
|
||||
from tmtccmd.config import TmTcCfgHookBase, TmTcDefWrapper, default_json_path
|
||||
from tmtccmd.utility import ObjectIdDictT, RetvalDictT
|
||||
|
||||
|
||||
class CommonFsfwHookBase(TmTcHookBase):
|
||||
def pack_service_queue(
|
||||
self, service: Union[int, str], op_code: str, service_queue: TcQueueT
|
||||
):
|
||||
from common_tmtc.pus_tc.tc_packing import common_service_queue_user
|
||||
|
||||
common_service_queue_user(
|
||||
service=service, op_code=op_code, tc_queue=service_queue
|
||||
)
|
||||
|
||||
def __init__(self, json_cfg_path: str):
|
||||
class CommonFsfwHookBase(TmTcCfgHookBase):
|
||||
def __init__(self, json_cfg_path: Optional[str] = None):
|
||||
if json_cfg_path is None:
|
||||
json_cfg_path = default_json_path()
|
||||
super().__init__(json_cfg_path=json_cfg_path)
|
||||
|
||||
def get_service_op_code_dictionary(self) -> ServiceOpCodeDictT:
|
||||
return common_fsfw_service_op_code_dict()
|
||||
@abstractmethod
|
||||
def get_tmtc_definitions(self) -> TmTcDefWrapper:
|
||||
pass
|
||||
|
||||
def assign_communication_interface(
|
||||
self, com_if_key: str
|
||||
) -> Optional[CommunicationInterface]:
|
||||
from tmtccmd.config.com_if import create_communication_interface_default
|
||||
@abstractmethod
|
||||
def assign_communication_interface(self, com_if_key: str) -> Optional[ComInterface]:
|
||||
pass
|
||||
|
||||
return create_communication_interface_default(
|
||||
com_if_key=com_if_key,
|
||||
json_cfg_path=self.json_cfg_path,
|
||||
space_packet_ids=TM_SP_IDS,
|
||||
)
|
||||
|
||||
def perform_mode_operation(self, tmtc_backend: TmTcHandler, mode: int):
|
||||
def perform_mode_operation(self, tmtc_backend: BackendBase, mode: int):
|
||||
print("No custom mode operation implemented")
|
||||
|
||||
def get_object_ids(self) -> ObjectIdDictT:
|
||||
|
Reference in New Issue
Block a user