cleaned up a bit

This commit is contained in:
Robin Müller 2021-06-21 11:15:02 +02:00
parent a70520d40c
commit 94b7240f7f
No known key found for this signature in database
GPG Key ID: FC76078F520434A5
4 changed files with 20 additions and 21 deletions

@ -1 +1 @@
Subproject commit 78e890f947f55a9417d390fea8d9bd5684d11730 Subproject commit f75892776e5a63fa704c3d0df7917b455a3d2ff3

View File

@ -40,7 +40,7 @@ from utility.mib_printer import Printer, PrettyPrinter
from utility.mib_sql_writer import SqlWriter from utility.mib_sql_writer import SqlWriter
from utility import mib_globals as g from utility import mib_globals as g
from parserbase.mib_file_list_parser import FileListParser from parserbase.mib_file_list_parser import FileListParser
from packetcontent.mib_packet_content_parser import ( from packetcontent.packet_content_parser import (
PacketContentParser, PacketContentParser,
PACKET_CONTENT_DEFINITION_DESTINATION, PACKET_CONTENT_DEFINITION_DESTINATION,
PACKET_CONTENT_CSV_NAME, PACKET_CONTENT_CSV_NAME,
@ -49,7 +49,7 @@ from packetcontent.mib_packet_content_parser import (
SQL_INSERT_PACKET_DATA_CMD, SQL_INSERT_PACKET_DATA_CMD,
SQL_DELETE_PACKET_DATA_CONTENT_CMD SQL_DELETE_PACKET_DATA_CONTENT_CMD
) )
from subservice.mib_subservice_parser import ( from subservice.subservice_parser import (
SubserviceParser, SubserviceParser,
SUBSERVICE_DEFINITION_DESTINATION, SUBSERVICE_DEFINITION_DESTINATION,
SUBSERVICE_CSV_NAME, SUBSERVICE_CSV_NAME,

View File

@ -1,15 +1,15 @@
#! /usr/bin/python3.8 #! /usr/bin/python3.8
""" """
@file mib_packet_content_parser.py @file packet_content_parser.py
@brief Parses the Service Packet Definition files for all variables @brief Parses the Service Packet Definition files for all variables
@details Used by the Mib Exporter, inherits generic File Parser @details Used by the Mib Exporter, inherits generic File Parser
""" """
import re import re
from parserbase.mib_file_list_parser import FileListParser from fsfwgen.parserbase.file_list_parser import FileListParser
from parserbase.mib_parser import FileParser from fsfwgen.parserbase.parser import FileParser
from utility.mib_csv_writer import CsvWriter from fsfwgen.utility.csv_writer import CsvWriter
from utility.mib_printer import Printer from fsfwgen.utility.printer import Printer
PACKET_CONTENT_DEFINITION_DESTINATION = ["../../mission/pus/servicepackets/", PACKET_CONTENT_DEFINITION_DESTINATION = ["../../mission/pus/servicepackets/",
"../../fsfw/pus/servicepackets/"] "../../fsfw/pus/servicepackets/"]

View File

@ -1,5 +1,5 @@
""" """
@file mib_subservice_parser.py @file subservice_parser.py
@brief Parses the Subservice definitions for the Mission Information Base. @brief Parses the Subservice definitions for the Mission Information Base.
@details Used by the MIB Exporter, inherits generic File Parser @details Used by the MIB Exporter, inherits generic File Parser
@author R. Mueller @author R. Mueller
@ -8,14 +8,14 @@
Example Stringset to scan for: Example Stringset to scan for:
enum Subservice: uint8_t { enum Subservice: uint8_t {
//!< [EXPORT] : [COMMAND] Perform connection test //!< [EXPORT] : [COMMAND] Perform connection test
CONNECTION_TEST = 1, CONNECTION_TEST = 1,
//!< [EXPORT] : [REPLY] Connection test reply //!< [EXPORT] : [REPLY] Connection test reply
CONNECTION_TEST_REPORT = 2, CONNECTION_TEST_REPORT = 2,
EVENT_TRIGGER_TEST = 128, //!< [EXPORT] : [COMMAND] Trigger test reply and test event EVENT_TRIGGER_TEST = 128, //!< [EXPORT] : [COMMAND] Trigger test reply and test event
MULTIPLE_EVENT_TRIGGER_TEST = 129, //!< [EXPORT] : [COMMAND] Trigger multiple events (5) MULTIPLE_EVENT_TRIGGER_TEST = 129, //!< [EXPORT] : [COMMAND] Trigger multiple events (5)
MULTIPLE_CONNECTION_TEST = 130 //!< [EXPORT] : [COMMAND] Trigger multiple connection tests MULTIPLE_CONNECTION_TEST = 130 //!< [EXPORT] : [COMMAND] Trigger multiple connection tests
}; };
""" """
import re import re
@ -23,8 +23,8 @@ from enum import Enum
from fsfwgen.parserbase.file_list_parser import FileListParser from fsfwgen.parserbase.file_list_parser import FileListParser
from fsfwgen.parserbase.parser import FileParser from fsfwgen.parserbase.parser import FileParser
from utility.mib_csv_writer import CsvWriter from fsfwgen.utility.csv_writer import CsvWriter
from utility.mib_printer import Printer from fsfwgen.utility.printer import Printer
SUBSERVICE_DEFINITION_DESTINATION = ["../../mission/", "../../fsfw/pus/"] SUBSERVICE_DEFINITION_DESTINATION = ["../../mission/", "../../fsfw/pus/"]
SUBSERVICE_CSV_NAME = "mib_subservices.csv" SUBSERVICE_CSV_NAME = "mib_subservices.csv"
@ -50,6 +50,7 @@ INSERT INTO Subservice(service,subsvcName,subsvcNumber,type,comment)
VALUES(?,?,?,?,?) VALUES(?,?,?,?,?)
""" """
class SubserviceColumns(Enum): class SubserviceColumns(Enum):
""" """
Specifies order of MIB columns Specifies order of MIB columns
@ -80,7 +81,6 @@ def main():
subservice_writer.move_csv("..") subservice_writer.move_csv("..")
# TODO: Not really happy with the multi-line implementation, but this is not trivial.. # TODO: Not really happy with the multi-line implementation, but this is not trivial..
# Right not, we are not using the last lines stored, we just store the string # Right not, we are not using the last lines stored, we just store the string
# of the last line (if its only a comment). It propably would be better to always # of the last line (if its only a comment). It propably would be better to always
@ -157,7 +157,6 @@ class SubserviceParser(FileParser):
self.dict_entry_list[Clmns.COMMENT.value] = "" self.dict_entry_list[Clmns.COMMENT.value] = ""
self.possible_match_on_next_lines = False self.possible_match_on_next_lines = False
def __scan_for_export_command(self, line: str) -> bool: def __scan_for_export_command(self, line: str) -> bool:
command_string = re.search(r"([^\[]*)\[export\][: ]*\[([\w]*)\][\s]*([^\n]*)", command_string = re.search(r"([^\[]*)\[export\][: ]*\[([\w]*)\][\s]*([^\n]*)",
line, re.IGNORECASE) line, re.IGNORECASE)