update deps and gen files
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
@ -11,11 +11,12 @@ from fsfwgen.events.event_parser import (
|
||||
handle_cpp_export,
|
||||
SubsystemDefinitionParser,
|
||||
EventParser,
|
||||
EventDictT,
|
||||
)
|
||||
from fsfwgen.parserbase.file_list_parser import FileListParser
|
||||
from fsfwgen.utility.printer import PrettyPrinter
|
||||
from fsfwgen.utility.file_management import copy_file
|
||||
from fsfwgen.core import get_console_logger
|
||||
from fsfwgen.logging import get_console_logger
|
||||
from definitions import BspType, ROOT_DIR, OBSW_ROOT_DIR
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
@ -32,8 +33,12 @@ MOVE_CSV_FILE = True
|
||||
PARSE_HOST_BSP = True
|
||||
|
||||
# Store these files relative to the events folder
|
||||
CPP_FILENAME = Path(f"{os.path.dirname(os.path.realpath(__file__))}/translateEvents.cpp")
|
||||
CPP_H_FILENAME = Path(f"{os.path.dirname(os.path.realpath(__file__))}/translateEvents.h")
|
||||
CPP_FILENAME = Path(
|
||||
f"{os.path.dirname(os.path.realpath(__file__))}/translateEvents.cpp"
|
||||
)
|
||||
CPP_H_FILENAME = Path(
|
||||
f"{os.path.dirname(os.path.realpath(__file__))}/translateEvents.h"
|
||||
)
|
||||
|
||||
BSP_SELECT = BspType.BSP_Q7S
|
||||
|
||||
@ -71,6 +76,8 @@ HEADER_DEFINITION_DESTINATIONS_AS_PATH = [
|
||||
Path(x) for x in HEADER_DEFINITION_DESTINATIONS
|
||||
]
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
|
||||
|
||||
def parse_events(
|
||||
generate_csv: bool = True, generate_cpp: bool = True, print_events: bool = True
|
||||
@ -83,7 +90,6 @@ def parse_events(
|
||||
PrettyPrinter.pprint(event_list)
|
||||
# Delay for clean printout
|
||||
time.sleep(0.1)
|
||||
# xml_test()
|
||||
if generate_csv:
|
||||
handle_csv_export(
|
||||
file_name=CSV_FILENAME, event_list=event_list, file_separator=FILE_SEPARATOR
|
||||
@ -109,7 +115,7 @@ def parse_events(
|
||||
copy_file(CPP_H_FILENAME, CPP_COPY_DESTINATION)
|
||||
|
||||
|
||||
def generate_event_list() -> list:
|
||||
def generate_event_list() -> EventDictT:
|
||||
subsystem_parser = SubsystemDefinitionParser(SUBSYSTEM_DEFS_DEST_AS_PATH)
|
||||
subsystem_table = subsystem_parser.parse_files()
|
||||
LOGGER.info(f"Found {len(subsystem_table)} subsystem definitions.")
|
||||
@ -124,6 +130,6 @@ def generate_event_list() -> list:
|
||||
event_parser.obsw_root_path = OBSW_ROOT_DIR
|
||||
event_parser.set_moving_window_mode(moving_window_size=7)
|
||||
event_table = event_parser.parse_files()
|
||||
event_list = sorted(event_table.items())
|
||||
LOGGER.info(f"Found {len(event_list)} entries")
|
||||
return event_list
|
||||
events_sorted = dict(sorted(event_table.items()))
|
||||
LOGGER.info(f"Found {len(events_sorted)} entries")
|
||||
return events_sorted
|
||||
|
Reference in New Issue
Block a user