From 0742e91c0aee99f79be76324c76ec65015b1fd6b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 18:17:57 +0200 Subject: [PATCH 01/15] update tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 16ec4a19..7a4d6ee1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 16ec4a1914cc2668dc314167c9b0537f989b295a +Subproject commit 7a4d6ee13a32119a9a9e815d32680ae7ab302699 From 0ab9d3bbe948b5df583d68eb8ebd6c66f04df906 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 18:28:33 +0200 Subject: [PATCH 02/15] modgen update --- generators/modgen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/modgen b/generators/modgen index 5ed4a2ae..d56e04c4 160000 --- a/generators/modgen +++ b/generators/modgen @@ -1 +1 @@ -Subproject commit 5ed4a2ae59e90c3763616bdaf41eb3317e849100 +Subproject commit d56e04c42676ae19783a2732306a260cd679773b From ff93529bac41f02f4d02ba0e3d060847288191e7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 18:56:38 +0200 Subject: [PATCH 03/15] continued object id gen --- generators/definitions.py | 7 +++ generators/events/__init__.py | 0 generators/modgen | 2 +- generators/objects/__init__.py | 0 generators/objects/objects.py | 108 +++++++++++++++++++++++++++++++++ 5 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 generators/definitions.py create mode 100644 generators/events/__init__.py create mode 100644 generators/objects/__init__.py create mode 100644 generators/objects/objects.py diff --git a/generators/definitions.py b/generators/definitions.py new file mode 100644 index 00000000..16b404e5 --- /dev/null +++ b/generators/definitions.py @@ -0,0 +1,7 @@ +import enum + + +class BspType(enum.Enum): + BSP_Q7S = "bsp_q7s" + BSP_HOSTED = "bsp_hosted" + BSP_LINUX_BOARD = "bsp_linux_board" diff --git a/generators/events/__init__.py b/generators/events/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/generators/modgen b/generators/modgen index d56e04c4..7717b36e 160000 --- a/generators/modgen +++ b/generators/modgen @@ -1 +1 @@ -Subproject commit d56e04c42676ae19783a2732306a260cd679773b +Subproject commit 7717b36e07de4c45b6c8693eba8c7bdf812fea48 diff --git a/generators/objects/__init__.py b/generators/objects/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/generators/objects/objects.py b/generators/objects/objects.py new file mode 100644 index 00000000..a5e40da9 --- /dev/null +++ b/generators/objects/objects.py @@ -0,0 +1,108 @@ +#! /usr/bin/env python3 +""" +@file objects.py +@brief Part of the Mission Information Base Exporter for the SOURCE project by KSat. +@details +Object exporter. +To use MySQLdb, run pip install mysqlclient or install in IDE. +On Windows, Build Tools installation might be necessary +@data 21.11.2019 +""" +import datetime + +from modgen.objects.objects import sql_object_exporter, ObjectDefinitionParser, write_translation_file, \ + export_object_file +from modgen.utility.csv_writer import CsvWriter +from modgen.utility.printer import PrettyPrinter +from modgen.utility.file_management import copy_file +from modgen.utility.sql_writer import SQL_DATABASE_NAME + +from definitions import BspType + +DATE_TODAY = datetime.datetime.now() +DATE_STRING_FULL = DATE_TODAY.strftime("%Y-%m-%d %H:%M:%S") + +GENERATE_CSV = True +MOVE_CSV = True + +GENERATE_CPP = True +COPY_CPP = True + +BSP_SELECT = BspType.BSP_Q7S + +BSP_DIR_NAME = BSP_SELECT.value + +EXPORT_TO_SQL = True + +CPP_COPY_DESTINATION = f"../../{BSP_DIR_NAME}/fsfwconfig/objects/" +CSV_MOVE_DESTINATION = "../" +CPP_FILENAME = "translateObjects.cpp" +CSV_OBJECT_FILENAME = "mib_objects.csv" +FILE_SEPARATOR = ";" + +if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: + SUBSYSTEM_DEFINITION_DESTINATION = f"../../fsfwconfig/objects/systemObjectList.h" +else: + SUBSYSTEM_DEFINITION_DESTINATION = f"../../{BSP_DIR_NAME}/fsfwconfig/objects/systemObjectList.h" + +FRAMEWORK_SUBSYSTEM_DEFINITION_DESTINATION = "../../fsfw/objectmanager/frameworkObjects.h" +OBJECTS_DEFINITIONS = [SUBSYSTEM_DEFINITION_DESTINATION, FRAMEWORK_SUBSYSTEM_DEFINITION_DESTINATION] + +SQL_DELETE_OBJECTS_CMD = """ + DROP TABLE IF EXISTS Objects + """ + +SQL_CREATE_OBJECTS_CMD = """ + CREATE TABLE IF NOT EXISTS Objects( + id INTEGER PRIMARY KEY, + objectid TEXT, + name TEXT + ) + """ + +SQL_INSERT_INTO_OBJECTS_CMD = """ +INSERT INTO Objects(objectid, name) +VALUES(?,?) +""" + + +def main(): + print("Parsing objects: ") + list_items = parse_objects() + handle_file_export(list_items) + if EXPORT_TO_SQL: + print("ObjectParser: Exporting to SQL") + sql_object_exporter( + object_table=list_items, delete_cmd=SQL_DELETE_OBJECTS_CMD, insert_cmd=SQL_INSERT_INTO_OBJECTS_CMD, + create_cmd=SQL_CREATE_OBJECTS_CMD, sql_table="../" + SQL_DATABASE_NAME + ) + + +def parse_objects(): + # fetch objects + object_parser = ObjectDefinitionParser(OBJECTS_DEFINITIONS) + subsystem_definitions = object_parser.parse_files() + # id_subsystem_definitions.update(framework_subsystem_definitions) + list_items = sorted(subsystem_definitions.items()) + PrettyPrinter.pprint(list_items) + print("ObjectParser: Number of objects: ", len(list_items)) + return list_items + + +def handle_file_export(list_items): + csv_writer = CsvWriter(CSV_OBJECT_FILENAME) + if GENERATE_CPP: + print("ObjectParser: Generating translation C++ file.") + write_translation_file(filename=CPP_FILENAME, list_of_entries=list_items, date_string_full=DATE_STRING_FULL) + if COPY_CPP: + print("ObjectParser: Copying object file to " + CPP_COPY_DESTINATION) + copy_file(CPP_FILENAME, CPP_COPY_DESTINATION) + if GENERATE_CSV: + print("ObjectParser: Generating text export.") + export_object_file(filename=CSV_OBJECT_FILENAME, object_list=list_items, file_separator=FILE_SEPARATOR) + if MOVE_CSV: + csv_writer.move_csv(CSV_MOVE_DESTINATION) + + +if __name__ == "__main__": + main() From 6837ee641bf68395663b9d05d871c41bccf1a264 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 18:58:15 +0200 Subject: [PATCH 04/15] object update --- generators/mib_objects.csv | 60 ++++++++ generators/modgen | 2 +- generators/objects/translateObjects.cpp | 196 ++++++++++++++++++++++++ generators/obsw_mib.db | Bin 0 -> 8192 bytes 4 files changed, 257 insertions(+), 1 deletion(-) create mode 100644 generators/mib_objects.csv create mode 100644 generators/objects/translateObjects.cpp create mode 100644 generators/obsw_mib.db diff --git a/generators/mib_objects.csv b/generators/mib_objects.csv new file mode 100644 index 00000000..3e3e8cb6 --- /dev/null +++ b/generators/mib_objects.csv @@ -0,0 +1,60 @@ +0x00005060;P60DOCK_TEST_TASK +0x44001000;PCDU_HANDLER +0x44001001;SOLAR_ARRAY_DEPL_HANDLER +0x44001002;SYRLINKS_HK_HANDLER +0x47000001;GPIO_IF +0x49000001;ARDUINO_COM_IF +0x49000002;CSP_COM_IF +0x49000003;I2C_COM_IF +0x49000004;UART_COM_IF +0x49000005;SPI_COM_IF +0x51000300;PUS_SERVICE_3 +0x51000400;PUS_SERVICE_5 +0x51000500;PUS_SERVICE_6 +0x51000800;PUS_SERVICE_8 +0x51002300;PUS_SERVICE_23 +0x51020100;PUS_SERVICE_201 +0x52000002;TM_FUNNEL +0x53000000;FSFW_OBJECTS_START +0x53000001;PUS_SERVICE_1_VERIFICATION +0x53000002;PUS_SERVICE_2_DEVICE_ACCESS +0x53000003;PUS_SERVICE_3_HOUSEKEEPING +0x53000005;PUS_SERVICE_5_EVENT_REPORTING +0x53000008;PUS_SERVICE_8_FUNCTION_MGMT +0x53000009;PUS_SERVICE_9_TIME_MGMT +0x53000017;PUS_SERVICE_17_TEST +0x53000020;PUS_SERVICE_20_PARAMETERS +0x53000200;PUS_SERVICE_200_MODE_MGMT +0x53010000;HEALTH_TABLE +0x53010100;MODE_STORE +0x53030000;EVENT_MANAGER +0x53040000;INTERNAL_ERROR_REPORTER +0x534f0100;TC_STORE +0x534f0200;TM_STORE +0x534f0300;IPC_STORE +0x53500010;TIME_STAMPER +0x53ffffff;FSFW_OBJECTS_END +0x54000003;HEATER_HANDLER +0x54000004;RTD_IC3 +0x54000005;RTD_IC4 +0x54000006;RTD_IC5 +0x54000007;RTD_IC6 +0x54000008;RTD_IC7 +0x54000009;RTD_IC8 +0x5400000A;RTD_IC9 +0x5400000B;RTD_IC10 +0x5400000C;RTD_IC11 +0x5400000D;RTD_IC12 +0x5400000E;RTD_IC13 +0x5400000F;RTD_IC14 +0x54000010;SPI_TEST +0x5400001F;RTD_IC15 +0x5400002F;RTD_IC16 +0x5400003F;RTD_IC17 +0x5400004F;RTD_IC18 +0x54000050;RAD_SENSOR +0x5400AFFE;DUMMY_HANDLER +0x5400CAFE;DUMMY_INTERFACE +0x54123456;LIBGPIOD_TEST +0x54694269;TEST_TASK +0xFFFFFFFF;NO_OBJECT diff --git a/generators/modgen b/generators/modgen index 7717b36e..bf38f952 160000 --- a/generators/modgen +++ b/generators/modgen @@ -1 +1 @@ -Subproject commit 7717b36e07de4c45b6c8693eba8c7bdf812fea48 +Subproject commit bf38f952f18f18db858ce5a7a719da7742cfc611 diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp new file mode 100644 index 00000000..9cf2fd59 --- /dev/null +++ b/generators/objects/translateObjects.cpp @@ -0,0 +1,196 @@ +/** + * @brief Auto-generated object translation file. + * @details + * Contains 60 translations. + * Generated on: 2021-05-17 18:57:35 + */ +#include "translateObjects.h" + +const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; +const char *PCDU_HANDLER_STRING = "PCDU_HANDLER"; +const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER"; +const char *SYRLINKS_HK_HANDLER_STRING = "SYRLINKS_HK_HANDLER"; +const char *GPIO_IF_STRING = "GPIO_IF"; +const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF"; +const char *CSP_COM_IF_STRING = "CSP_COM_IF"; +const char *I2C_COM_IF_STRING = "I2C_COM_IF"; +const char *UART_COM_IF_STRING = "UART_COM_IF"; +const char *SPI_COM_IF_STRING = "SPI_COM_IF"; +const char *PUS_SERVICE_3_STRING = "PUS_SERVICE_3"; +const char *PUS_SERVICE_5_STRING = "PUS_SERVICE_5"; +const char *PUS_SERVICE_6_STRING = "PUS_SERVICE_6"; +const char *PUS_SERVICE_8_STRING = "PUS_SERVICE_8"; +const char *PUS_SERVICE_23_STRING = "PUS_SERVICE_23"; +const char *PUS_SERVICE_201_STRING = "PUS_SERVICE_201"; +const char *TM_FUNNEL_STRING = "TM_FUNNEL"; +const char *FSFW_OBJECTS_START_STRING = "FSFW_OBJECTS_START"; +const char *PUS_SERVICE_1_VERIFICATION_STRING = "PUS_SERVICE_1_VERIFICATION"; +const char *PUS_SERVICE_2_DEVICE_ACCESS_STRING = "PUS_SERVICE_2_DEVICE_ACCESS"; +const char *PUS_SERVICE_3_HOUSEKEEPING_STRING = "PUS_SERVICE_3_HOUSEKEEPING"; +const char *PUS_SERVICE_5_EVENT_REPORTING_STRING = "PUS_SERVICE_5_EVENT_REPORTING"; +const char *PUS_SERVICE_8_FUNCTION_MGMT_STRING = "PUS_SERVICE_8_FUNCTION_MGMT"; +const char *PUS_SERVICE_9_TIME_MGMT_STRING = "PUS_SERVICE_9_TIME_MGMT"; +const char *PUS_SERVICE_17_TEST_STRING = "PUS_SERVICE_17_TEST"; +const char *PUS_SERVICE_20_PARAMETERS_STRING = "PUS_SERVICE_20_PARAMETERS"; +const char *PUS_SERVICE_200_MODE_MGMT_STRING = "PUS_SERVICE_200_MODE_MGMT"; +const char *HEALTH_TABLE_STRING = "HEALTH_TABLE"; +const char *MODE_STORE_STRING = "MODE_STORE"; +const char *EVENT_MANAGER_STRING = "EVENT_MANAGER"; +const char *INTERNAL_ERROR_REPORTER_STRING = "INTERNAL_ERROR_REPORTER"; +const char *TC_STORE_STRING = "TC_STORE"; +const char *TM_STORE_STRING = "TM_STORE"; +const char *IPC_STORE_STRING = "IPC_STORE"; +const char *TIME_STAMPER_STRING = "TIME_STAMPER"; +const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; +const char *HEATER_HANDLER_STRING = "HEATER_HANDLER"; +const char *RTD_IC3_STRING = "RTD_IC3"; +const char *RTD_IC4_STRING = "RTD_IC4"; +const char *RTD_IC5_STRING = "RTD_IC5"; +const char *RTD_IC6_STRING = "RTD_IC6"; +const char *RTD_IC7_STRING = "RTD_IC7"; +const char *RTD_IC8_STRING = "RTD_IC8"; +const char *RTD_IC9_STRING = "RTD_IC9"; +const char *RTD_IC10_STRING = "RTD_IC10"; +const char *RTD_IC11_STRING = "RTD_IC11"; +const char *RTD_IC12_STRING = "RTD_IC12"; +const char *RTD_IC13_STRING = "RTD_IC13"; +const char *RTD_IC14_STRING = "RTD_IC14"; +const char *SPI_TEST_STRING = "SPI_TEST"; +const char *RTD_IC15_STRING = "RTD_IC15"; +const char *RTD_IC16_STRING = "RTD_IC16"; +const char *RTD_IC17_STRING = "RTD_IC17"; +const char *RTD_IC18_STRING = "RTD_IC18"; +const char *RAD_SENSOR_STRING = "RAD_SENSOR"; +const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; +const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; +const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST"; +const char *TEST_TASK_STRING = "TEST_TASK"; +const char *NO_OBJECT_STRING = "NO_OBJECT"; + +const char* translateObject(object_id_t object) { + switch( (object & 0xFFFFFFFF) ) { + case 0x00005060: + return P60DOCK_TEST_TASK_STRING; + case 0x44001000: + return PCDU_HANDLER_STRING; + case 0x44001001: + return SOLAR_ARRAY_DEPL_HANDLER_STRING; + case 0x44001002: + return SYRLINKS_HK_HANDLER_STRING; + case 0x47000001: + return GPIO_IF_STRING; + case 0x49000001: + return ARDUINO_COM_IF_STRING; + case 0x49000002: + return CSP_COM_IF_STRING; + case 0x49000003: + return I2C_COM_IF_STRING; + case 0x49000004: + return UART_COM_IF_STRING; + case 0x49000005: + return SPI_COM_IF_STRING; + case 0x51000300: + return PUS_SERVICE_3_STRING; + case 0x51000400: + return PUS_SERVICE_5_STRING; + case 0x51000500: + return PUS_SERVICE_6_STRING; + case 0x51000800: + return PUS_SERVICE_8_STRING; + case 0x51002300: + return PUS_SERVICE_23_STRING; + case 0x51020100: + return PUS_SERVICE_201_STRING; + case 0x52000002: + return TM_FUNNEL_STRING; + case 0x53000000: + return FSFW_OBJECTS_START_STRING; + case 0x53000001: + return PUS_SERVICE_1_VERIFICATION_STRING; + case 0x53000002: + return PUS_SERVICE_2_DEVICE_ACCESS_STRING; + case 0x53000003: + return PUS_SERVICE_3_HOUSEKEEPING_STRING; + case 0x53000005: + return PUS_SERVICE_5_EVENT_REPORTING_STRING; + case 0x53000008: + return PUS_SERVICE_8_FUNCTION_MGMT_STRING; + case 0x53000009: + return PUS_SERVICE_9_TIME_MGMT_STRING; + case 0x53000017: + return PUS_SERVICE_17_TEST_STRING; + case 0x53000020: + return PUS_SERVICE_20_PARAMETERS_STRING; + case 0x53000200: + return PUS_SERVICE_200_MODE_MGMT_STRING; + case 0x53010000: + return HEALTH_TABLE_STRING; + case 0x53010100: + return MODE_STORE_STRING; + case 0x53030000: + return EVENT_MANAGER_STRING; + case 0x53040000: + return INTERNAL_ERROR_REPORTER_STRING; + case 0x534f0100: + return TC_STORE_STRING; + case 0x534f0200: + return TM_STORE_STRING; + case 0x534f0300: + return IPC_STORE_STRING; + case 0x53500010: + return TIME_STAMPER_STRING; + case 0x53ffffff: + return FSFW_OBJECTS_END_STRING; + case 0x54000003: + return HEATER_HANDLER_STRING; + case 0x54000004: + return RTD_IC3_STRING; + case 0x54000005: + return RTD_IC4_STRING; + case 0x54000006: + return RTD_IC5_STRING; + case 0x54000007: + return RTD_IC6_STRING; + case 0x54000008: + return RTD_IC7_STRING; + case 0x54000009: + return RTD_IC8_STRING; + case 0x5400000A: + return RTD_IC9_STRING; + case 0x5400000B: + return RTD_IC10_STRING; + case 0x5400000C: + return RTD_IC11_STRING; + case 0x5400000D: + return RTD_IC12_STRING; + case 0x5400000E: + return RTD_IC13_STRING; + case 0x5400000F: + return RTD_IC14_STRING; + case 0x54000010: + return SPI_TEST_STRING; + case 0x5400001F: + return RTD_IC15_STRING; + case 0x5400002F: + return RTD_IC16_STRING; + case 0x5400003F: + return RTD_IC17_STRING; + case 0x5400004F: + return RTD_IC18_STRING; + case 0x54000050: + return RAD_SENSOR_STRING; + case 0x5400AFFE: + return DUMMY_HANDLER_STRING; + case 0x5400CAFE: + return DUMMY_INTERFACE_STRING; + case 0x54123456: + return LIBGPIOD_TEST_STRING; + case 0x54694269: + return TEST_TASK_STRING; + case 0xFFFFFFFF: + return NO_OBJECT_STRING; + default: + return "UNKNOWN_OBJECT"; + } + return 0; +} diff --git a/generators/obsw_mib.db b/generators/obsw_mib.db new file mode 100644 index 0000000000000000000000000000000000000000..8729a9a05bf13d2ffa915f129beb257f04d84266 GIT binary patch literal 8192 zcmeHKOKjsr7*0xIiSsH8aoVQcx-8u$bh|r#<-sn3sXa+d;s;}=P$U?2p_LX`DnSvI zmdlDWS0n@n4j^&o!eviz-2)OQE}S?ZB*cL$694#-+FZCIqDH1w`XYpf2|dP+IVE(t2jphd7a<){Y%-rXzDva}FzX4U z4QXI9%aHq`p2pP#?}=I(R}#D{s%czKa9va~IPyI!T#YEFag^va5oK@^*Q1KpGq@S! zig+!98!;}6yBT~h#!=%c;H_l62uJv!v6F!Z5!`P)oq_ui+-r0)a4&+pjdlj^MzG%4 z&cJ#EYmF-zSc_nFZ42Peyg+r#|Kn2@Z{($?fZYXFJr3K@AHEc)%4fteS1$v<#d#ee zB%{Ex3G)MNdxSQh1P=13tJ*PA5wbi3D3=m(69}FGPACWkc8p6YTn0SWZ*2g6gX>k`O#npHj`>ZP(<5LN%*v zz=TWSI6`2+G#JDA0Z%#GE#RIDdm&z_H}fIKbl)-vgP$xM#U9zg_G(H9%B+xim|~ki zjsE5e2-SE*B=^!nxfe!tYZ)Zba(O+2v}C|ShxwG9CdiCrB-BsK`fNCJjKFdo#-%$V zNJn$2o|ft?@+orBaz^b2i1A#kro}27yEC6m2=PGKc_LGRl2$6rB%w{%Fo^HBAI}Ub zr=>F6C)65R2Id7z7eOh{r$?E@L9%Gjd<+ykSFi)n6o?P3)*;jNB_Q|}ONJeQy-ZI6 zz*-$>o^+rTNJxfOTQy*LdUy!>S+?J*rbtM7x@)&pNs$oHG^w}BDe@nas>=e95K3(j zu0-b-E5o&!HC!nHb9v5aGgx;_EkBy+q*{uRFc&h6V)$OntUUq@EIpn`#?+iyaDRv< zYdj1rT%)vJScc5+0Z_x{BES$;4c5dh^AG6Mawa|-Pm;^Sm4`s`>|7%I?i5poDa8k{ r|K2pwtuBBL&arqX literal 0 HcmV?d00001 From 99acbccf846481aab3a907b6d4af80ccc7dd9c76 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 19:03:37 +0200 Subject: [PATCH 05/15] generated translation file --- fsfwconfig/objects/translateObjects.cpp | 438 +++++++++++------------- generators/modgen | 2 +- generators/objects/objects.py | 11 +- generators/objects/translateObjects.cpp | 2 +- generators/obsw_mib.db | Bin 8192 -> 8192 bytes 5 files changed, 205 insertions(+), 248 deletions(-) diff --git a/fsfwconfig/objects/translateObjects.cpp b/fsfwconfig/objects/translateObjects.cpp index bfb8fb85..d29b55fc 100644 --- a/fsfwconfig/objects/translateObjects.cpp +++ b/fsfwconfig/objects/translateObjects.cpp @@ -1,242 +1,196 @@ -/* Auto-generated event translation file. Contains 77 translations. */ -#include - -const char *AT91_UART2_TEST_TASK_STRING = "AT91_UART2_TEST_TASK"; -const char *ARDUINO_0_STRING = "ARDUINO_0"; -const char *ARDUINO_1_STRING = "ARDUINO_1"; -const char *ARDUINO_2_STRING = "ARDUINO_2"; -const char *ARDUINO_3_STRING = "ARDUINO_3"; -const char *ARDUINO_4_STRING = "ARDUINO_4"; -const char *AT91_I2C_TEST_TASK_STRING = "AT91_I2C_TEST_TASK"; -const char *TEST_TASK_STRING = "TEST_TASK"; -const char *PCDU_HANDLER_STRING = "PCDU_HANDLER"; -const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; -const char *S_ADC1_DEC2_STRING = "S_ADC1_DEC2"; -const char *GPS0_HANDLER_STRING = "GPS0_HANDLER"; -const char *DLR_PVCH_STRING = "DLR_PVCH"; -const char *GYRO1_STRING = "GYRO1"; -const char *DLR_IRAS_STRING = "DLR_IRAS"; -const char *_DEC1_O1_STRING = "_DEC1_O1"; -const char *_DEC1_O2_STRING = "_DEC1_O2"; -const char *S1_DEC1_O3_STRING = "S1_DEC1_O3"; -const char *S2_DEC1_O4_STRING = "S2_DEC1_O4"; -const char *S3_DEC1_O5_STRING = "S3_DEC1_O5"; -const char *PT1000_PVHC_DEC1_O6_STRING = "PT1000_PVHC_DEC1_O6"; -const char *PT1000_CCSDS1_DEC2_STRING = "PT1000_CCSDS1_DEC2"; -const char *PT1000_MGT1_DEC2_STRING = "PT1000_MGT1_DEC2"; -const char *S4_DEC2_STRING = "S4_DEC2"; -const char *S5_DEC2_STRING = "S5_DEC2"; -const char *S6_DEC2_STRING = "S6_DEC2"; -const char *PT1000_PVCH_DEC2_STRING = "PT1000_PVCH_DEC2"; -const char *_DEC3_STRING = "_DEC3"; -const char *PT1000_CCSDS2_DEC3_STRING = "PT1000_CCSDS2_DEC3"; -const char *S7_DEC3_STRING = "S7_DEC3"; -const char *S8_DEC3_STRING = "S8_DEC3"; -const char *PT1000_PVCH_DEC3_STRING = "PT1000_PVCH_DEC3"; -const char *GYRO2_STRING = "GYRO2"; -const char *PT1000_PLOC_DEC4_STRING = "PT1000_PLOC_DEC4"; -const char *S9_DEC4_STRING = "S9_DEC4"; -const char *S10_DEC4_STRING = "S10_DEC4"; -const char *PT1000_PVHC_DEC4_STRING = "PT1000_PVHC_DEC4"; -const char *S_ADC_DEC4_STRING = "S_ADC_DEC4"; -const char *GPS1_HANDLER_STRING = "GPS1_HANDLER"; -const char *DUMMY_GPS_COM_IF_STRING = "DUMMY_GPS_COM_IF"; -const char *RS232_DEVICE_COM_IF_STRING = "RS232_DEVICE_COM_IF"; -const char *I2C_DEVICE_COM_IF_STRING = "I2C_DEVICE_COM_IF"; -const char *GPIO_DEVICE_COM_IF_STRING = "GPIO_DEVICE_COM_IF"; -const char *SPI_POLLING_TASK_STRING = "SPI_POLLING_TASK"; -const char *SPI_DEVICE_COM_IF_STRING = "SPI_DEVICE_COM_IF"; -const char *DUMMY_ECHO_COM_IF_STRING = "DUMMY_ECHO_COM_IF"; -const char *SD_CARD_HANDLER_STRING = "SD_CARD_HANDLER"; -const char *CCSDS_PACKET_DISTRIBUTOR_STRING = "CCSDS_PACKET_DISTRIBUTOR"; -const char *PUS_PACKET_DISTRIBUTOR_STRING = "PUS_PACKET_DISTRIBUTOR"; -const char *UDP_TMTC_BRIDGE_STRING = "UDP_TMTC_BRIDGE"; -const char *EMAC_POLLING_TASK_STRING = "EMAC_POLLING_TASK"; -const char *SERIAL_POLLING_TASK_STRING = "SERIAL_POLLING_TASK"; -const char *UART_TMTC_BRIDGE_STRING = "UART_TMTC_BRIDGE"; -const char *PUS_SERVICE_1_STRING = "PUS_SERVICE_1"; -const char *PUS_SERVICE_2_STRING = "PUS_SERVICE_2"; -const char *PUS_SERVICE_3_STRING = "PUS_SERVICE_3"; -const char *PUS_SERVICE_5_STRING = "PUS_SERVICE_5"; -const char *PUS_SERVICE_6_STRING = "PUS_SERVICE_6"; -const char *PUS_SERVICE_8_STRING = "PUS_SERVICE_8"; -const char *PUS_SERVICE_9_STRING = "PUS_SERVICE_9"; -const char *PUS_SERVICE_17_STRING = "PUS_SERVICE_17"; -const char *PUS_SERVICE_23_STRING = "PUS_SERVICE_23"; -const char *PUS_SERVICE_200_STRING = "PUS_SERVICE_200"; -const char *PUS_SERVICE_201_STRING = "PUS_SERVICE_201"; -const char *PUS_TIME_STRING = "PUS_TIME"; -const char *PUS_FUNNEL_STRING = "PUS_FUNNEL"; -const char *HEALTH_TABLE_STRING = "HEALTH_TABLE"; -const char *MODE_STORE_STRING = "MODE_STORE"; -const char *EVENT_MANAGER_STRING = "EVENT_MANAGER"; -const char *INTERNAL_ERROR_REPORTER_STRING = "INTERNAL_ERROR_REPORTER"; -const char *TC_STORE_STRING = "TC_STORE"; -const char *TM_STORE_STRING = "TM_STORE"; -const char *IPC_STORE_STRING = "IPC_STORE"; -const char *AT91_SPI_TEST_TASK_STRING = "AT91_SPI_TEST_TASK"; -const char *STM32_TEST_TASK_STRING = "STM32_TEST_TASK"; -const char *AT91_UART0_TEST_TASK_STRING = "AT91_UART0_TEST_TASK"; -const char *NO_OBJECT_STRING = "NO_OBJECT"; - -const char* translateObject(object_id_t object){ - switch((object&0xFFFFFFFF)){ - case 0x000123336: - return AT91_UART2_TEST_TASK_STRING; - case 0x01010100: - return ARDUINO_0_STRING; - case 0x01010101: - return ARDUINO_1_STRING; - case 0x01010102: - return ARDUINO_2_STRING; - case 0x01010103: - return ARDUINO_3_STRING; - case 0x01010104: - return ARDUINO_4_STRING; - case 0x12345678: - return AT91_I2C_TEST_TASK_STRING; - case 0x42694269: - return TEST_TASK_STRING; - case 0x44003200: - return PCDU_HANDLER_STRING; - case 0x4400AFFE: - return DUMMY_HANDLER_STRING; - case 0x44020108: - return S_ADC1_DEC2_STRING; - case 0x44101F00: - return GPS0_HANDLER_STRING; - case 0x44104000: - return DLR_PVCH_STRING; - case 0x44105000: - return GYRO1_STRING; - case 0x44106000: - return DLR_IRAS_STRING; - case 0x44115401: - return _DEC1_O1_STRING; - case 0x44115402: - return _DEC1_O2_STRING; - case 0x44115404: - return S1_DEC1_O3_STRING; - case 0x44115405: - return S2_DEC1_O4_STRING; - case 0x44115406: - return S3_DEC1_O5_STRING; - case 0x44115407: - return PT1000_PVHC_DEC1_O6_STRING; - case 0x44125401: - return PT1000_CCSDS1_DEC2_STRING; - case 0x44125403: - return PT1000_MGT1_DEC2_STRING; - case 0x44125404: - return S4_DEC2_STRING; - case 0x44125405: - return S5_DEC2_STRING; - case 0x44125406: - return S6_DEC2_STRING; - case 0x44125407: - return PT1000_PVCH_DEC2_STRING; - case 0x44130301: - return _DEC3_STRING; - case 0x44130302: - return PT1000_CCSDS2_DEC3_STRING; - case 0x44130305: - return S7_DEC3_STRING; - case 0x44130306: - return S8_DEC3_STRING; - case 0x44130307: - return PT1000_PVCH_DEC3_STRING; - case 0x44130308: - return GYRO2_STRING; - case 0x44145401: - return PT1000_PLOC_DEC4_STRING; - case 0x44145404: - return S9_DEC4_STRING; - case 0x44145405: - return S10_DEC4_STRING; - case 0x44145406: - return PT1000_PVHC_DEC4_STRING; - case 0x44145407: - return S_ADC_DEC4_STRING; - case 0x44202000: - return GPS1_HANDLER_STRING; - case 0x49001F00: - return DUMMY_GPS_COM_IF_STRING; - case 0x49005200: - return RS232_DEVICE_COM_IF_STRING; - case 0x49005300: - return I2C_DEVICE_COM_IF_STRING; - case 0x49005400: - return GPIO_DEVICE_COM_IF_STRING; - case 0x49005410: - return SPI_POLLING_TASK_STRING; - case 0x49005600: - return SPI_DEVICE_COM_IF_STRING; - case 0x4900AFFE: - return DUMMY_ECHO_COM_IF_STRING; - case 0x4D0073AD: - return SD_CARD_HANDLER_STRING; - case 0x50000100: - return CCSDS_PACKET_DISTRIBUTOR_STRING; - case 0x50000200: - return PUS_PACKET_DISTRIBUTOR_STRING; - case 0x50000300: - return UDP_TMTC_BRIDGE_STRING; - case 0x50000400: - return EMAC_POLLING_TASK_STRING; - case 0x50000600: - return SERIAL_POLLING_TASK_STRING; - case 0x5000500: - return UART_TMTC_BRIDGE_STRING; - case 0x51000100: - return PUS_SERVICE_1_STRING; - case 0x51000200: - return PUS_SERVICE_2_STRING; - case 0x51000300: - return PUS_SERVICE_3_STRING; - case 0x51000400: - return PUS_SERVICE_5_STRING; - case 0x51000500: - return PUS_SERVICE_6_STRING; - case 0x51000800: - return PUS_SERVICE_8_STRING; - case 0x51000900: - return PUS_SERVICE_9_STRING; - case 0x51001700: - return PUS_SERVICE_17_STRING; - case 0x51002300: - return PUS_SERVICE_23_STRING; - case 0x51020000: - return PUS_SERVICE_200_STRING; - case 0x51020100: - return PUS_SERVICE_201_STRING; - case 0x52000001: - return PUS_TIME_STRING; - case 0x52000002: - return PUS_FUNNEL_STRING; - case 0x53010000: - return HEALTH_TABLE_STRING; - case 0x53010100: - return MODE_STORE_STRING; - case 0x53030000: - return EVENT_MANAGER_STRING; - case 0x53040000: - return INTERNAL_ERROR_REPORTER_STRING; - case 0x534f0100: - return TC_STORE_STRING; - case 0x534f0200: - return TM_STORE_STRING; - case 0x534f0300: - return IPC_STORE_STRING; - case 0x66666666: - return AT91_SPI_TEST_TASK_STRING; - case 0x77777777: - return STM32_TEST_TASK_STRING; - case 0x87654321: - return AT91_UART0_TEST_TASK_STRING; - case 0xFFFFFFFF: - return NO_OBJECT_STRING; - default: - return "UNKNOWN_OBJECT"; - } - return 0; -} +/** + * @brief Auto-generated object translation file. + * @details + * Contains 60 translations. + * Generated on: 2021-05-17 19:02:48 + */ +#include "translateObjects.h" + +const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; +const char *PCDU_HANDLER_STRING = "PCDU_HANDLER"; +const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER"; +const char *SYRLINKS_HK_HANDLER_STRING = "SYRLINKS_HK_HANDLER"; +const char *GPIO_IF_STRING = "GPIO_IF"; +const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF"; +const char *CSP_COM_IF_STRING = "CSP_COM_IF"; +const char *I2C_COM_IF_STRING = "I2C_COM_IF"; +const char *UART_COM_IF_STRING = "UART_COM_IF"; +const char *SPI_COM_IF_STRING = "SPI_COM_IF"; +const char *PUS_SERVICE_3_STRING = "PUS_SERVICE_3"; +const char *PUS_SERVICE_5_STRING = "PUS_SERVICE_5"; +const char *PUS_SERVICE_6_STRING = "PUS_SERVICE_6"; +const char *PUS_SERVICE_8_STRING = "PUS_SERVICE_8"; +const char *PUS_SERVICE_23_STRING = "PUS_SERVICE_23"; +const char *PUS_SERVICE_201_STRING = "PUS_SERVICE_201"; +const char *TM_FUNNEL_STRING = "TM_FUNNEL"; +const char *FSFW_OBJECTS_START_STRING = "FSFW_OBJECTS_START"; +const char *PUS_SERVICE_1_VERIFICATION_STRING = "PUS_SERVICE_1_VERIFICATION"; +const char *PUS_SERVICE_2_DEVICE_ACCESS_STRING = "PUS_SERVICE_2_DEVICE_ACCESS"; +const char *PUS_SERVICE_3_HOUSEKEEPING_STRING = "PUS_SERVICE_3_HOUSEKEEPING"; +const char *PUS_SERVICE_5_EVENT_REPORTING_STRING = "PUS_SERVICE_5_EVENT_REPORTING"; +const char *PUS_SERVICE_8_FUNCTION_MGMT_STRING = "PUS_SERVICE_8_FUNCTION_MGMT"; +const char *PUS_SERVICE_9_TIME_MGMT_STRING = "PUS_SERVICE_9_TIME_MGMT"; +const char *PUS_SERVICE_17_TEST_STRING = "PUS_SERVICE_17_TEST"; +const char *PUS_SERVICE_20_PARAMETERS_STRING = "PUS_SERVICE_20_PARAMETERS"; +const char *PUS_SERVICE_200_MODE_MGMT_STRING = "PUS_SERVICE_200_MODE_MGMT"; +const char *HEALTH_TABLE_STRING = "HEALTH_TABLE"; +const char *MODE_STORE_STRING = "MODE_STORE"; +const char *EVENT_MANAGER_STRING = "EVENT_MANAGER"; +const char *INTERNAL_ERROR_REPORTER_STRING = "INTERNAL_ERROR_REPORTER"; +const char *TC_STORE_STRING = "TC_STORE"; +const char *TM_STORE_STRING = "TM_STORE"; +const char *IPC_STORE_STRING = "IPC_STORE"; +const char *TIME_STAMPER_STRING = "TIME_STAMPER"; +const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; +const char *HEATER_HANDLER_STRING = "HEATER_HANDLER"; +const char *RTD_IC3_STRING = "RTD_IC3"; +const char *RTD_IC4_STRING = "RTD_IC4"; +const char *RTD_IC5_STRING = "RTD_IC5"; +const char *RTD_IC6_STRING = "RTD_IC6"; +const char *RTD_IC7_STRING = "RTD_IC7"; +const char *RTD_IC8_STRING = "RTD_IC8"; +const char *RTD_IC9_STRING = "RTD_IC9"; +const char *RTD_IC10_STRING = "RTD_IC10"; +const char *RTD_IC11_STRING = "RTD_IC11"; +const char *RTD_IC12_STRING = "RTD_IC12"; +const char *RTD_IC13_STRING = "RTD_IC13"; +const char *RTD_IC14_STRING = "RTD_IC14"; +const char *SPI_TEST_STRING = "SPI_TEST"; +const char *RTD_IC15_STRING = "RTD_IC15"; +const char *RTD_IC16_STRING = "RTD_IC16"; +const char *RTD_IC17_STRING = "RTD_IC17"; +const char *RTD_IC18_STRING = "RTD_IC18"; +const char *RAD_SENSOR_STRING = "RAD_SENSOR"; +const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; +const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; +const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST"; +const char *TEST_TASK_STRING = "TEST_TASK"; +const char *NO_OBJECT_STRING = "NO_OBJECT"; + +const char* translateObject(object_id_t object) { + switch( (object & 0xFFFFFFFF) ) { + case 0x00005060: + return P60DOCK_TEST_TASK_STRING; + case 0x44001000: + return PCDU_HANDLER_STRING; + case 0x44001001: + return SOLAR_ARRAY_DEPL_HANDLER_STRING; + case 0x44001002: + return SYRLINKS_HK_HANDLER_STRING; + case 0x47000001: + return GPIO_IF_STRING; + case 0x49000001: + return ARDUINO_COM_IF_STRING; + case 0x49000002: + return CSP_COM_IF_STRING; + case 0x49000003: + return I2C_COM_IF_STRING; + case 0x49000004: + return UART_COM_IF_STRING; + case 0x49000005: + return SPI_COM_IF_STRING; + case 0x51000300: + return PUS_SERVICE_3_STRING; + case 0x51000400: + return PUS_SERVICE_5_STRING; + case 0x51000500: + return PUS_SERVICE_6_STRING; + case 0x51000800: + return PUS_SERVICE_8_STRING; + case 0x51002300: + return PUS_SERVICE_23_STRING; + case 0x51020100: + return PUS_SERVICE_201_STRING; + case 0x52000002: + return TM_FUNNEL_STRING; + case 0x53000000: + return FSFW_OBJECTS_START_STRING; + case 0x53000001: + return PUS_SERVICE_1_VERIFICATION_STRING; + case 0x53000002: + return PUS_SERVICE_2_DEVICE_ACCESS_STRING; + case 0x53000003: + return PUS_SERVICE_3_HOUSEKEEPING_STRING; + case 0x53000005: + return PUS_SERVICE_5_EVENT_REPORTING_STRING; + case 0x53000008: + return PUS_SERVICE_8_FUNCTION_MGMT_STRING; + case 0x53000009: + return PUS_SERVICE_9_TIME_MGMT_STRING; + case 0x53000017: + return PUS_SERVICE_17_TEST_STRING; + case 0x53000020: + return PUS_SERVICE_20_PARAMETERS_STRING; + case 0x53000200: + return PUS_SERVICE_200_MODE_MGMT_STRING; + case 0x53010000: + return HEALTH_TABLE_STRING; + case 0x53010100: + return MODE_STORE_STRING; + case 0x53030000: + return EVENT_MANAGER_STRING; + case 0x53040000: + return INTERNAL_ERROR_REPORTER_STRING; + case 0x534f0100: + return TC_STORE_STRING; + case 0x534f0200: + return TM_STORE_STRING; + case 0x534f0300: + return IPC_STORE_STRING; + case 0x53500010: + return TIME_STAMPER_STRING; + case 0x53ffffff: + return FSFW_OBJECTS_END_STRING; + case 0x54000003: + return HEATER_HANDLER_STRING; + case 0x54000004: + return RTD_IC3_STRING; + case 0x54000005: + return RTD_IC4_STRING; + case 0x54000006: + return RTD_IC5_STRING; + case 0x54000007: + return RTD_IC6_STRING; + case 0x54000008: + return RTD_IC7_STRING; + case 0x54000009: + return RTD_IC8_STRING; + case 0x5400000A: + return RTD_IC9_STRING; + case 0x5400000B: + return RTD_IC10_STRING; + case 0x5400000C: + return RTD_IC11_STRING; + case 0x5400000D: + return RTD_IC12_STRING; + case 0x5400000E: + return RTD_IC13_STRING; + case 0x5400000F: + return RTD_IC14_STRING; + case 0x54000010: + return SPI_TEST_STRING; + case 0x5400001F: + return RTD_IC15_STRING; + case 0x5400002F: + return RTD_IC16_STRING; + case 0x5400003F: + return RTD_IC17_STRING; + case 0x5400004F: + return RTD_IC18_STRING; + case 0x54000050: + return RAD_SENSOR_STRING; + case 0x5400AFFE: + return DUMMY_HANDLER_STRING; + case 0x5400CAFE: + return DUMMY_INTERFACE_STRING; + case 0x54123456: + return LIBGPIOD_TEST_STRING; + case 0x54694269: + return TEST_TASK_STRING; + case 0xFFFFFFFF: + return NO_OBJECT_STRING; + default: + return "UNKNOWN_OBJECT"; + } + return 0; +} diff --git a/generators/modgen b/generators/modgen index bf38f952..af383e7f 160000 --- a/generators/modgen +++ b/generators/modgen @@ -1 +1 @@ -Subproject commit bf38f952f18f18db858ce5a7a719da7742cfc611 +Subproject commit af383e7f14454c5e745073a8790c296508c94b35 diff --git a/generators/objects/objects.py b/generators/objects/objects.py index a5e40da9..085ac45e 100644 --- a/generators/objects/objects.py +++ b/generators/objects/objects.py @@ -14,7 +14,7 @@ from modgen.objects.objects import sql_object_exporter, ObjectDefinitionParser, export_object_file from modgen.utility.csv_writer import CsvWriter from modgen.utility.printer import PrettyPrinter -from modgen.utility.file_management import copy_file +from modgen.utility.file_management import copy_file, move_file from modgen.utility.sql_writer import SQL_DATABASE_NAME from definitions import BspType @@ -34,7 +34,11 @@ BSP_DIR_NAME = BSP_SELECT.value EXPORT_TO_SQL = True -CPP_COPY_DESTINATION = f"../../{BSP_DIR_NAME}/fsfwconfig/objects/" +if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: + CPP_COPY_DESTINATION = f"../../fsfwconfig/objects/" +else: + CPP_COPY_DESTINATION = f"../../{BSP_DIR_NAME}/fsfwconfig/objects/" + CSV_MOVE_DESTINATION = "../" CPP_FILENAME = "translateObjects.cpp" CSV_OBJECT_FILENAME = "mib_objects.csv" @@ -90,7 +94,6 @@ def parse_objects(): def handle_file_export(list_items): - csv_writer = CsvWriter(CSV_OBJECT_FILENAME) if GENERATE_CPP: print("ObjectParser: Generating translation C++ file.") write_translation_file(filename=CPP_FILENAME, list_of_entries=list_items, date_string_full=DATE_STRING_FULL) @@ -101,7 +104,7 @@ def handle_file_export(list_items): print("ObjectParser: Generating text export.") export_object_file(filename=CSV_OBJECT_FILENAME, object_list=list_items, file_separator=FILE_SEPARATOR) if MOVE_CSV: - csv_writer.move_csv(CSV_MOVE_DESTINATION) + move_file(file_name=CSV_OBJECT_FILENAME, destination=CSV_MOVE_DESTINATION) if __name__ == "__main__": diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 9cf2fd59..d29b55fc 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 60 translations. - * Generated on: 2021-05-17 18:57:35 + * Generated on: 2021-05-17 19:02:48 */ #include "translateObjects.h" diff --git a/generators/obsw_mib.db b/generators/obsw_mib.db index 8729a9a05bf13d2ffa915f129beb257f04d84266..fc7f1e1321b092235ba0482b32fd7e58b931e825 100644 GIT binary patch delta 33 gcmZp0XmFSyEy&8iz`z8=Fu*)f$C#0IW5NP?08+dK4FCWD delta 33 fcmZp0XmFSyEy%>czyQK9z&KIIn2~8?!UA~!QcDE| From 17d187d4b0c57e4263f384cbe72a96d387e2a8a5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 19:12:25 +0200 Subject: [PATCH 06/15] generated header file as well --- fsfwconfig/objects/translateObjects.cpp | 2 +- fsfwconfig/objects/translateObjects.h | 10 +--------- generators/modgen | 2 +- generators/objects/objects.py | 9 +++++++-- generators/objects/translateObjects.cpp | 2 +- generators/objects/translateObjects.h | 8 ++++++++ generators/obsw_mib.db | Bin 8192 -> 8192 bytes 7 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 generators/objects/translateObjects.h diff --git a/fsfwconfig/objects/translateObjects.cpp b/fsfwconfig/objects/translateObjects.cpp index d29b55fc..9eccd0b7 100644 --- a/fsfwconfig/objects/translateObjects.cpp +++ b/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 60 translations. - * Generated on: 2021-05-17 19:02:48 + * Generated on: 2021-05-17 19:11:51 */ #include "translateObjects.h" diff --git a/fsfwconfig/objects/translateObjects.h b/fsfwconfig/objects/translateObjects.h index 2e5a8c40..dbf5b468 100644 --- a/fsfwconfig/objects/translateObjects.h +++ b/fsfwconfig/objects/translateObjects.h @@ -1,16 +1,8 @@ -/* - * translateObjects.h - * - * Created on: 28 May 2019 - * Author: Robin - */ - #ifndef FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ #define FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ -#include +#include const char* translateObject(object_id_t object); - #endif /* FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ */ diff --git a/generators/modgen b/generators/modgen index af383e7f..236aaf71 160000 --- a/generators/modgen +++ b/generators/modgen @@ -1 +1 @@ -Subproject commit af383e7f14454c5e745073a8790c296508c94b35 +Subproject commit 236aaf71ea43d1e6e21e8bdbc4b72e24978ccf04 diff --git a/generators/objects/objects.py b/generators/objects/objects.py index 085ac45e..966957e5 100644 --- a/generators/objects/objects.py +++ b/generators/objects/objects.py @@ -11,8 +11,7 @@ On Windows, Build Tools installation might be necessary import datetime from modgen.objects.objects import sql_object_exporter, ObjectDefinitionParser, write_translation_file, \ - export_object_file -from modgen.utility.csv_writer import CsvWriter + export_object_file, write_translation_header_file from modgen.utility.printer import PrettyPrinter from modgen.utility.file_management import copy_file, move_file from modgen.utility.sql_writer import SQL_DATABASE_NAME @@ -28,6 +27,8 @@ MOVE_CSV = True GENERATE_CPP = True COPY_CPP = True +GENERATE_HEADER = True + BSP_SELECT = BspType.BSP_Q7S BSP_DIR_NAME = BSP_SELECT.value @@ -41,6 +42,7 @@ else: CSV_MOVE_DESTINATION = "../" CPP_FILENAME = "translateObjects.cpp" +CPP_H_FILENAME = "translateObjects.h" CSV_OBJECT_FILENAME = "mib_objects.csv" FILE_SEPARATOR = ";" @@ -100,6 +102,9 @@ def handle_file_export(list_items): if COPY_CPP: print("ObjectParser: Copying object file to " + CPP_COPY_DESTINATION) copy_file(CPP_FILENAME, CPP_COPY_DESTINATION) + if GENERATE_HEADER: + write_translation_header_file(filename=CPP_H_FILENAME) + copy_file(filename=CPP_H_FILENAME, destination=CPP_COPY_DESTINATION) if GENERATE_CSV: print("ObjectParser: Generating text export.") export_object_file(filename=CSV_OBJECT_FILENAME, object_list=list_items, file_separator=FILE_SEPARATOR) diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index d29b55fc..9eccd0b7 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 60 translations. - * Generated on: 2021-05-17 19:02:48 + * Generated on: 2021-05-17 19:11:51 */ #include "translateObjects.h" diff --git a/generators/objects/translateObjects.h b/generators/objects/translateObjects.h new file mode 100644 index 00000000..dbf5b468 --- /dev/null +++ b/generators/objects/translateObjects.h @@ -0,0 +1,8 @@ +#ifndef FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ +#define FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ + +#include + +const char* translateObject(object_id_t object); + +#endif /* FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ */ diff --git a/generators/obsw_mib.db b/generators/obsw_mib.db index fc7f1e1321b092235ba0482b32fd7e58b931e825..07567c875293cb68228798b519fc368bcf5e458f 100644 GIT binary patch delta 33 gcmZp0XmFSyEy&Hlz`z8=Fu*=h$C#0OW5NP?08^d?9RL6T delta 33 gcmZp0XmFSyEy&8iz`z8=Fu*)f$C#0IW5NP?08+dK4FCWD From c0bde2ddeb4dd3d54d026a4f26ac5cc78fa94527 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 19:13:00 +0200 Subject: [PATCH 07/15] generated for host as well --- .../fsfwconfig/objects/translateObjects.cpp | 109 ++++++++++++++++++ .../fsfwconfig/objects/translateObjects.h | 8 ++ generators/mib_objects.csv | 35 +----- generators/objects/translateObjects.cpp | 105 ++--------------- generators/obsw_mib.db | Bin 8192 -> 8192 bytes 5 files changed, 129 insertions(+), 128 deletions(-) create mode 100644 bsp_hosted/fsfwconfig/objects/translateObjects.cpp create mode 100644 bsp_hosted/fsfwconfig/objects/translateObjects.h diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp new file mode 100644 index 00000000..9aac2b47 --- /dev/null +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -0,0 +1,109 @@ +/** + * @brief Auto-generated object translation file. + * @details + * Contains 31 translations. + * Generated on: 2021-05-17 19:12:49 + */ +#include "translateObjects.h" + +const char *TEST_TASK_STRING = "TEST_TASK"; +const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; +const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF"; +const char *PUS_SERVICE_3_STRING = "PUS_SERVICE_3"; +const char *PUS_SERVICE_5_STRING = "PUS_SERVICE_5"; +const char *PUS_SERVICE_6_STRING = "PUS_SERVICE_6"; +const char *PUS_SERVICE_8_STRING = "PUS_SERVICE_8"; +const char *PUS_SERVICE_23_STRING = "PUS_SERVICE_23"; +const char *PUS_SERVICE_201_STRING = "PUS_SERVICE_201"; +const char *TM_FUNNEL_STRING = "TM_FUNNEL"; +const char *FSFW_OBJECTS_START_STRING = "FSFW_OBJECTS_START"; +const char *PUS_SERVICE_1_VERIFICATION_STRING = "PUS_SERVICE_1_VERIFICATION"; +const char *PUS_SERVICE_2_DEVICE_ACCESS_STRING = "PUS_SERVICE_2_DEVICE_ACCESS"; +const char *PUS_SERVICE_3_HOUSEKEEPING_STRING = "PUS_SERVICE_3_HOUSEKEEPING"; +const char *PUS_SERVICE_5_EVENT_REPORTING_STRING = "PUS_SERVICE_5_EVENT_REPORTING"; +const char *PUS_SERVICE_8_FUNCTION_MGMT_STRING = "PUS_SERVICE_8_FUNCTION_MGMT"; +const char *PUS_SERVICE_9_TIME_MGMT_STRING = "PUS_SERVICE_9_TIME_MGMT"; +const char *PUS_SERVICE_17_TEST_STRING = "PUS_SERVICE_17_TEST"; +const char *PUS_SERVICE_20_PARAMETERS_STRING = "PUS_SERVICE_20_PARAMETERS"; +const char *PUS_SERVICE_200_MODE_MGMT_STRING = "PUS_SERVICE_200_MODE_MGMT"; +const char *HEALTH_TABLE_STRING = "HEALTH_TABLE"; +const char *MODE_STORE_STRING = "MODE_STORE"; +const char *EVENT_MANAGER_STRING = "EVENT_MANAGER"; +const char *INTERNAL_ERROR_REPORTER_STRING = "INTERNAL_ERROR_REPORTER"; +const char *TC_STORE_STRING = "TC_STORE"; +const char *TM_STORE_STRING = "TM_STORE"; +const char *IPC_STORE_STRING = "IPC_STORE"; +const char *TIME_STAMPER_STRING = "TIME_STAMPER"; +const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; +const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; +const char *NO_OBJECT_STRING = "NO_OBJECT"; + +const char* translateObject(object_id_t object) { + switch( (object & 0xFFFFFFFF) ) { + case 0x42694269: + return TEST_TASK_STRING; + case 0x4400AFFE: + return DUMMY_HANDLER_STRING; + case 0x49000001: + return ARDUINO_COM_IF_STRING; + case 0x51000300: + return PUS_SERVICE_3_STRING; + case 0x51000400: + return PUS_SERVICE_5_STRING; + case 0x51000500: + return PUS_SERVICE_6_STRING; + case 0x51000800: + return PUS_SERVICE_8_STRING; + case 0x51002300: + return PUS_SERVICE_23_STRING; + case 0x51020100: + return PUS_SERVICE_201_STRING; + case 0x52000002: + return TM_FUNNEL_STRING; + case 0x53000000: + return FSFW_OBJECTS_START_STRING; + case 0x53000001: + return PUS_SERVICE_1_VERIFICATION_STRING; + case 0x53000002: + return PUS_SERVICE_2_DEVICE_ACCESS_STRING; + case 0x53000003: + return PUS_SERVICE_3_HOUSEKEEPING_STRING; + case 0x53000005: + return PUS_SERVICE_5_EVENT_REPORTING_STRING; + case 0x53000008: + return PUS_SERVICE_8_FUNCTION_MGMT_STRING; + case 0x53000009: + return PUS_SERVICE_9_TIME_MGMT_STRING; + case 0x53000017: + return PUS_SERVICE_17_TEST_STRING; + case 0x53000020: + return PUS_SERVICE_20_PARAMETERS_STRING; + case 0x53000200: + return PUS_SERVICE_200_MODE_MGMT_STRING; + case 0x53010000: + return HEALTH_TABLE_STRING; + case 0x53010100: + return MODE_STORE_STRING; + case 0x53030000: + return EVENT_MANAGER_STRING; + case 0x53040000: + return INTERNAL_ERROR_REPORTER_STRING; + case 0x534f0100: + return TC_STORE_STRING; + case 0x534f0200: + return TM_STORE_STRING; + case 0x534f0300: + return IPC_STORE_STRING; + case 0x53500010: + return TIME_STAMPER_STRING; + case 0x53ffffff: + return FSFW_OBJECTS_END_STRING; + case 0xCAFECAFE: + return DUMMY_INTERFACE_STRING; + case 0xFFFFFFFF: + return NO_OBJECT_STRING; + default: + return "UNKNOWN_OBJECT"; + } + return 0; +} diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.h b/bsp_hosted/fsfwconfig/objects/translateObjects.h new file mode 100644 index 00000000..dbf5b468 --- /dev/null +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.h @@ -0,0 +1,8 @@ +#ifndef FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ +#define FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ + +#include + +const char* translateObject(object_id_t object); + +#endif /* FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ */ diff --git a/generators/mib_objects.csv b/generators/mib_objects.csv index 3e3e8cb6..5c0bc321 100644 --- a/generators/mib_objects.csv +++ b/generators/mib_objects.csv @@ -1,13 +1,6 @@ -0x00005060;P60DOCK_TEST_TASK -0x44001000;PCDU_HANDLER -0x44001001;SOLAR_ARRAY_DEPL_HANDLER -0x44001002;SYRLINKS_HK_HANDLER -0x47000001;GPIO_IF +0x42694269;TEST_TASK +0x4400AFFE;DUMMY_HANDLER 0x49000001;ARDUINO_COM_IF -0x49000002;CSP_COM_IF -0x49000003;I2C_COM_IF -0x49000004;UART_COM_IF -0x49000005;SPI_COM_IF 0x51000300;PUS_SERVICE_3 0x51000400;PUS_SERVICE_5 0x51000500;PUS_SERVICE_6 @@ -34,27 +27,5 @@ 0x534f0300;IPC_STORE 0x53500010;TIME_STAMPER 0x53ffffff;FSFW_OBJECTS_END -0x54000003;HEATER_HANDLER -0x54000004;RTD_IC3 -0x54000005;RTD_IC4 -0x54000006;RTD_IC5 -0x54000007;RTD_IC6 -0x54000008;RTD_IC7 -0x54000009;RTD_IC8 -0x5400000A;RTD_IC9 -0x5400000B;RTD_IC10 -0x5400000C;RTD_IC11 -0x5400000D;RTD_IC12 -0x5400000E;RTD_IC13 -0x5400000F;RTD_IC14 -0x54000010;SPI_TEST -0x5400001F;RTD_IC15 -0x5400002F;RTD_IC16 -0x5400003F;RTD_IC17 -0x5400004F;RTD_IC18 -0x54000050;RAD_SENSOR -0x5400AFFE;DUMMY_HANDLER -0x5400CAFE;DUMMY_INTERFACE -0x54123456;LIBGPIOD_TEST -0x54694269;TEST_TASK +0xCAFECAFE;DUMMY_INTERFACE 0xFFFFFFFF;NO_OBJECT diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 9eccd0b7..9aac2b47 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,21 +1,14 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 60 translations. - * Generated on: 2021-05-17 19:11:51 + * Contains 31 translations. + * Generated on: 2021-05-17 19:12:49 */ #include "translateObjects.h" -const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; -const char *PCDU_HANDLER_STRING = "PCDU_HANDLER"; -const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER"; -const char *SYRLINKS_HK_HANDLER_STRING = "SYRLINKS_HK_HANDLER"; -const char *GPIO_IF_STRING = "GPIO_IF"; +const char *TEST_TASK_STRING = "TEST_TASK"; +const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF"; -const char *CSP_COM_IF_STRING = "CSP_COM_IF"; -const char *I2C_COM_IF_STRING = "I2C_COM_IF"; -const char *UART_COM_IF_STRING = "UART_COM_IF"; -const char *SPI_COM_IF_STRING = "SPI_COM_IF"; const char *PUS_SERVICE_3_STRING = "PUS_SERVICE_3"; const char *PUS_SERVICE_5_STRING = "PUS_SERVICE_5"; const char *PUS_SERVICE_6_STRING = "PUS_SERVICE_6"; @@ -42,53 +35,17 @@ const char *TM_STORE_STRING = "TM_STORE"; const char *IPC_STORE_STRING = "IPC_STORE"; const char *TIME_STAMPER_STRING = "TIME_STAMPER"; const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; -const char *HEATER_HANDLER_STRING = "HEATER_HANDLER"; -const char *RTD_IC3_STRING = "RTD_IC3"; -const char *RTD_IC4_STRING = "RTD_IC4"; -const char *RTD_IC5_STRING = "RTD_IC5"; -const char *RTD_IC6_STRING = "RTD_IC6"; -const char *RTD_IC7_STRING = "RTD_IC7"; -const char *RTD_IC8_STRING = "RTD_IC8"; -const char *RTD_IC9_STRING = "RTD_IC9"; -const char *RTD_IC10_STRING = "RTD_IC10"; -const char *RTD_IC11_STRING = "RTD_IC11"; -const char *RTD_IC12_STRING = "RTD_IC12"; -const char *RTD_IC13_STRING = "RTD_IC13"; -const char *RTD_IC14_STRING = "RTD_IC14"; -const char *SPI_TEST_STRING = "SPI_TEST"; -const char *RTD_IC15_STRING = "RTD_IC15"; -const char *RTD_IC16_STRING = "RTD_IC16"; -const char *RTD_IC17_STRING = "RTD_IC17"; -const char *RTD_IC18_STRING = "RTD_IC18"; -const char *RAD_SENSOR_STRING = "RAD_SENSOR"; -const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; -const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST"; -const char *TEST_TASK_STRING = "TEST_TASK"; const char *NO_OBJECT_STRING = "NO_OBJECT"; const char* translateObject(object_id_t object) { switch( (object & 0xFFFFFFFF) ) { - case 0x00005060: - return P60DOCK_TEST_TASK_STRING; - case 0x44001000: - return PCDU_HANDLER_STRING; - case 0x44001001: - return SOLAR_ARRAY_DEPL_HANDLER_STRING; - case 0x44001002: - return SYRLINKS_HK_HANDLER_STRING; - case 0x47000001: - return GPIO_IF_STRING; + case 0x42694269: + return TEST_TASK_STRING; + case 0x4400AFFE: + return DUMMY_HANDLER_STRING; case 0x49000001: return ARDUINO_COM_IF_STRING; - case 0x49000002: - return CSP_COM_IF_STRING; - case 0x49000003: - return I2C_COM_IF_STRING; - case 0x49000004: - return UART_COM_IF_STRING; - case 0x49000005: - return SPI_COM_IF_STRING; case 0x51000300: return PUS_SERVICE_3_STRING; case 0x51000400: @@ -141,52 +98,8 @@ const char* translateObject(object_id_t object) { return TIME_STAMPER_STRING; case 0x53ffffff: return FSFW_OBJECTS_END_STRING; - case 0x54000003: - return HEATER_HANDLER_STRING; - case 0x54000004: - return RTD_IC3_STRING; - case 0x54000005: - return RTD_IC4_STRING; - case 0x54000006: - return RTD_IC5_STRING; - case 0x54000007: - return RTD_IC6_STRING; - case 0x54000008: - return RTD_IC7_STRING; - case 0x54000009: - return RTD_IC8_STRING; - case 0x5400000A: - return RTD_IC9_STRING; - case 0x5400000B: - return RTD_IC10_STRING; - case 0x5400000C: - return RTD_IC11_STRING; - case 0x5400000D: - return RTD_IC12_STRING; - case 0x5400000E: - return RTD_IC13_STRING; - case 0x5400000F: - return RTD_IC14_STRING; - case 0x54000010: - return SPI_TEST_STRING; - case 0x5400001F: - return RTD_IC15_STRING; - case 0x5400002F: - return RTD_IC16_STRING; - case 0x5400003F: - return RTD_IC17_STRING; - case 0x5400004F: - return RTD_IC18_STRING; - case 0x54000050: - return RAD_SENSOR_STRING; - case 0x5400AFFE: - return DUMMY_HANDLER_STRING; - case 0x5400CAFE: + case 0xCAFECAFE: return DUMMY_INTERFACE_STRING; - case 0x54123456: - return LIBGPIOD_TEST_STRING; - case 0x54694269: - return TEST_TASK_STRING; case 0xFFFFFFFF: return NO_OBJECT_STRING; default: diff --git a/generators/obsw_mib.db b/generators/obsw_mib.db index 07567c875293cb68228798b519fc368bcf5e458f..46ec76360a2f5d24f20c4fead8fe49fac6d1b7ea 100644 GIT binary patch delta 542 zcmY*WyK59d7~e_aBW8BSXuLBwGkcuiBM)%yZZ8;Zve})*J+r%EAA;3tBZ45rLatF# z+o*hCBWR&m*`&5mEG%pk{10rzPAs+YyW9nmZ}^7c_xR?=%=X&$+EX#hEX$g}-mB?n z%U!~DZoc8`O?3>5?lOh_AC2=9oucYPXE&H z^gVq|AJcm@p%-awXY1R{<$803ZMzg>sNs(gWWM&9H+qj&D>^QkX3C zeB&s1B$`CROCkDVG^5vbZ|kns(WYPJMVgsf0|})EyF^FpA|B)O`|vj6WBu9FFe%TG zIxI>lYN%-qy}FG{$7x_j?#3y&B?Xy-hw=hB32$*f0bk`AG7EpueH`Z1BH<9IWx`-f zEf5=CAVT3Yo@d~ c<*Qy2Y?!Q0ki@@nJ1eWhE=*ojg_mFZ52NXRsQ>@~ literal 8192 zcmeHKOKjsr7*0x|#LlBEBmHCeapA-PAt4T2k@&}t)JEctkVknq-}lYTKi_<|WB)bYO^iiK;VuPaKkQh@iSM2f+-AVItR2LC*7mJ^T>p^`@}8`A@6LJqEm!jo{sb9q2s4kG5A z!#hXk14t5Q!Y&>DY<{!UF4TUmeOLRec2+yA8MRKWR{gX3Q}urJi|R+!&@uIjO{3iS;+!wwQ zJ{H~=UKNP2E7VJWm3}EbD1B4XSpWhiuD1I zJDfzwz(ZorZ2N%me|B_;4bti-eG$ULgdStZoD#ay19CI!i;#{eHknTx-=&Q%FzX4U z4QXI9%aHpGJ&mgg-fL)STuJb5Lrvpyg6j<>gCpOw!qqh7G>#Iz)<7AY#Pz6+>lxgP zaiwuBgBvj}H+D1lUW}vqRlr-xdJ&HBL479!4wyABe+-ZWZ+%|ckAs8+>Kzp zzMX;f2-fOXGO!lG>e?2-oq2)knE%J8EZ)dVPXW6Nta==_p+9^nPL@-1UBqO1ITGnU7nPUW&>o6|e zX@GPzm+EP$&LW>87cFPhu7eoQ#cEotvavh!$%GIOl$|Fs6)0(?!b}p{gbjoEe*5vv zpmJI&vwcFXp=DrRuyg^G@_c%fNgO1L2F=Gn!E*&W08N4Tz-k>bU0()*U$JD^0ocp* zBmk_{faXaDN`ZuAXth-ZmZyh@pr2*?txAf7q^G-fTjdl90Zo&7OH7gfm{eU6fP_$L zgK#A}zgQWr&8*?Y5-^wNj5dRH$JENBnNF&u7zwkKVHCsnVrK0TU|{L-L^7u4%!2zv zG+F&&VBs32^};e_eh+{eHWvYgsA{k#Zkc~Tr|UyGE6Bx sfc^KTiEecPba0NvLm|&FX9>4a1nxRI<8$k%i@Yu}U1JiS3gKPqZ=84H@&Et; From ed5bb4406ca76713b0e3efa4f44b918e059e00e3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 19:13:45 +0200 Subject: [PATCH 08/15] deleted .db --- .gitignore | 6 ++---- generators/obsw_mib.db | Bin 8192 -> 0 bytes 2 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 generators/obsw_mib.db diff --git a/.gitignore b/.gitignore index 70a3325b..564a96fd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,6 @@ Debug Debug* Release Release* -MinSizeRel -MinSizeRel* -RelWithDebInfo -RelWithDebInfo* .settings .metadata @@ -19,3 +15,5 @@ __pycache__ !misc/eclipse/**/.cproject !misc/eclipse/**/.project + +generators/*.db diff --git a/generators/obsw_mib.db b/generators/obsw_mib.db deleted file mode 100644 index 46ec76360a2f5d24f20c4fead8fe49fac6d1b7ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmeH~O;giA7{^mY5zGrBQf#P%0|Om=*)%P*<3X2n(?*)4Zc>!f4rrM{1ZJ?~Fyo1< z7jIrYc=6yj@Zxy%>NoJ>_!acxvuS~?GkyS_eWu$a`~UCmv%fq!Z2X|P)9qN>2Zwu` zUCU9%l}tvtXIYA(=+K6sox~{I44*u}H6z^r?N(QA)!%E}Z0suVlOYL60+N6vAPGnU zl7J*22}lBxfFvLZ{O<&gCo&^h)65*d>~3y7>qJ{mJCD21`4YkODuO&#F_3 z@!j}hd@x=cheq3|7&-ly{!Ra+ztMMftWRn`w9ndG?S&R-ww6_Ys$bQQ>O1w7y03=n zZ5S>?5|9KW0ZBj-kOU+FNk9^i1pZk9+1X)bZWbMR{Rkr#t==bYlD`hZ5;}6RM|i8X zgJ6U46AAUOORncZzKM>?&UPAJ>^it^!u*~{WkRX{qxh%e~0@~306UAb|G#uLTN-9C9Q}; zzGfC|3#koOLx`-CFkt}>F&wU@r$C%bMH})&K~&?3LN>Xpprl*i{RlM(ZYB+up4%2C zLA#rdLOjz}J7zJV>%L1EJhF6_pdKU(R|F$C2aT+SDGmta7|%_B(do~K>=n^yudsx~ z$^2!o^tQ|Msfv~=O9}HO3*%sOPi8_D(NRoa2B+I42q(&$Z90Tgk6`!@uE5~sV!PzHAp^2w zj)2OmhZjL*P_3931Q9A-9J*|t7epvfQ7oIog80Xx&dfOwA)`_?-HDB9t?k37=|%zb lJ#(lxv;=cv@8r{L;IP(&k1GQrKqwWLtGw~TftroiegpM_FOUEL From 73e2b6eea88537d2328d67594ea793bebecbabac Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 19:17:38 +0200 Subject: [PATCH 09/15] moved makefiles to archive --- Makefile => misc/archive/Makefile | 0 Makefile-Hosted => misc/archive/Makefile-Hosted | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Makefile => misc/archive/Makefile (100%) rename Makefile-Hosted => misc/archive/Makefile-Hosted (100%) diff --git a/Makefile b/misc/archive/Makefile similarity index 100% rename from Makefile rename to misc/archive/Makefile diff --git a/Makefile-Hosted b/misc/archive/Makefile-Hosted similarity index 100% rename from Makefile-Hosted rename to misc/archive/Makefile-Hosted From da17ec22fba31cbc13a96ddaf2a2b9c684a125aa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 19:39:35 +0200 Subject: [PATCH 10/15] generated event translation files --- .../fsfwconfig/events/subsystemIdRanges.h | 2 +- common/config/commonSubsystemId.h | 26 -- common/config/commonSubsystemIds.h | 26 ++ fsfwconfig/events/subsystemIdRanges.h | 2 +- fsfwconfig/events/translateEvents.cpp | 354 +++++++++--------- fsfwconfig/events/translateEvents.h | 8 - generators/events/event_parser.py | 100 +++++ generators/events/translateEvents.cpp | 264 +++++++++++++ generators/events/translateEvents.h | 8 + generators/mib_events.csv | 83 ++++ generators/modgen | 2 +- linux/devices/SusHandler.h | 2 +- .../devicedefinitions/SusDefinitions.h | 5 + .../IMTQHandlerDefinitions.h | 8 +- .../devicedefinitions/PlocDefinitions.h | 4 +- 15 files changed, 678 insertions(+), 216 deletions(-) delete mode 100644 common/config/commonSubsystemId.h create mode 100644 common/config/commonSubsystemIds.h create mode 100644 generators/events/event_parser.py create mode 100644 generators/events/translateEvents.cpp create mode 100644 generators/events/translateEvents.h create mode 100644 generators/mib_events.csv rename {mission => linux}/devices/devicedefinitions/SusDefinitions.h (96%) diff --git a/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h b/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h index 98776b6a..7335a804 100644 --- a/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h +++ b/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h @@ -1,7 +1,7 @@ #ifndef CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ #define CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ -#include "commonSubsystemId.h" +#include #include /** diff --git a/common/config/commonSubsystemId.h b/common/config/commonSubsystemId.h deleted file mode 100644 index b19fea3a..00000000 --- a/common/config/commonSubsystemId.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef COMMON_CONFIG_COMMONSUBSYSTEMID_H_ -#define COMMON_CONFIG_COMMONSUBSYSTEMID_H_ - -#include - -namespace SUBSYSTEM_ID { -enum: uint8_t { - COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, - PUS_SERVICE_2, - PUS_SERVICE_3, - PUS_SERVICE_5, - PUS_SERVICE_6, - PUS_SERVICE_8, - PUS_SERVICE_23, - MGM_LIS3MDL, - MGM_RM3100, - PCDU_HANDLER, - HEATER_HANDLER, - SA_DEPL_HANDLER, - PLOC_HANDLER, - COMMON_SUBSYSTEM_ID_END -}; -} - - -#endif /* COMMON_CONFIG_COMMONSUBSYSTEMID_H_ */ diff --git a/common/config/commonSubsystemIds.h b/common/config/commonSubsystemIds.h new file mode 100644 index 00000000..64ab8173 --- /dev/null +++ b/common/config/commonSubsystemIds.h @@ -0,0 +1,26 @@ +#ifndef COMMON_CONFIG_COMMONSUBSYSTEMIDS_H_ +#define COMMON_CONFIG_COMMONSUBSYSTEMIDS_H_ + +#include + +namespace SUBSYSTEM_ID { +enum: uint8_t { + COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, + PUS_SERVICE_2 = 100, + PUS_SERVICE_3 = 101, + PUS_SERVICE_5 = 102, + PUS_SERVICE_6 = 103, + PUS_SERVICE_8 = 104, + PUS_SERVICE_23 = 105, + MGM_LIS3MDL = 106, + MGM_RM3100 = 107, + PCDU_HANDLER = 108, + HEATER_HANDLER = 109, + SA_DEPL_HANDLER = 110, + PLOC_HANDLER = 111, + COMMON_SUBSYSTEM_ID_END +}; +} + + +#endif /* COMMON_CONFIG_COMMONSUBSYSTEMIDS_H_ */ diff --git a/fsfwconfig/events/subsystemIdRanges.h b/fsfwconfig/events/subsystemIdRanges.h index f6f6b161..f728db21 100644 --- a/fsfwconfig/events/subsystemIdRanges.h +++ b/fsfwconfig/events/subsystemIdRanges.h @@ -1,7 +1,7 @@ #ifndef FSFWCONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ #define FSFWCONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ -#include "commonSubsystemId.h" +#include #include #include diff --git a/fsfwconfig/events/translateEvents.cpp b/fsfwconfig/events/translateEvents.cpp index 49e1223a..62ee369c 100644 --- a/fsfwconfig/events/translateEvents.cpp +++ b/fsfwconfig/events/translateEvents.cpp @@ -1,12 +1,10 @@ /** - * @brief Auto-generated event translation file. Contains 80 translations. - * Generated on: 2020-05-02 20:13:41 + * @brief Auto-generated event translation file. Contains 83 translations. + * @details + * Generated on: 2021-05-17 19:38:14 */ -#include +#include "translateEvents.h" -const char *GPS_STARTUP_FAILED_STRING = "GPS_STARTUP_FAILED"; -const char *GPS_FIX_STRING = "GPS_FIX"; -const char *GPS_LOST_FIX_STRING = "GPS_LOST_FIX"; const char *STORE_SEND_WRITE_FAILED_STRING = "STORE_SEND_WRITE_FAILED"; const char *STORE_WRITE_FAILED_STRING = "STORE_WRITE_FAILED"; const char *STORE_SEND_READ_FAILED_STRING = "STORE_SEND_READ_FAILED"; @@ -82,173 +80,185 @@ const char *RF_LOST_STRING = "RF_LOST"; const char *BIT_LOCK_STRING = "BIT_LOCK"; const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST"; const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED"; -const char *TEST_EVENT_SERVICE_1_STRING = "TEST_EVENT_SERVICE_1"; -const char *TEST2_STRING = "TEST2"; +const char *CLOCK_SET_STRING = "CLOCK_SET"; +const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; +const char *TEST_STRING = "TEST"; +const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; +const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; +const char *ACK_FAILURE_STRING = "ACK_FAILURE"; +const char *EXE_FAILURE_STRING = "EXE_FAILURE"; +const char *CRC_FAILURE_EVENT_STRING = "CRC_FAILURE_EVENT"; -const char * translateEvents(Event event){ - switch((event&0xFFFF)){ - case 1000: - return GPS_STARTUP_FAILED_STRING; - case 1001: - return GPS_FIX_STRING; - case 1002: - return GPS_LOST_FIX_STRING; - case 2200: - return STORE_SEND_WRITE_FAILED_STRING; - case 2201: - return STORE_WRITE_FAILED_STRING; - case 2202: - return STORE_SEND_READ_FAILED_STRING; - case 2203: - return STORE_READ_FAILED_STRING; - case 2204: - return UNEXPECTED_MSG_STRING; - case 2205: - return STORING_FAILED_STRING; - case 2206: - return TM_DUMP_FAILED_STRING; - case 2207: - return STORE_INIT_FAILED_STRING; - case 2208: - return STORE_INIT_EMPTY_STRING; - case 2209: - return STORE_CONTENT_CORRUPTED_STRING; - case 2210: - return STORE_INITIALIZE_STRING; - case 2211: - return INIT_DONE_STRING; - case 2212: - return DUMP_FINISHED_STRING; - case 2213: - return DELETION_FINISHED_STRING; - case 2214: - return DELETION_FAILED_STRING; - case 2215: - return AUTO_CATALOGS_SENDING_FAILED_STRING; - case 2600: - return GET_DATA_FAILED_STRING; - case 2601: - return STORE_DATA_FAILED_STRING; - case 2800: - return DEVICE_BUILDING_COMMAND_FAILED_STRING; - case 2801: - return DEVICE_SENDING_COMMAND_FAILED_STRING; - case 2802: - return DEVICE_REQUESTING_REPLY_FAILED_STRING; - case 2803: - return DEVICE_READING_REPLY_FAILED_STRING; - case 2804: - return DEVICE_INTERPRETING_REPLY_FAILED_STRING; - case 2805: - return DEVICE_MISSED_REPLY_STRING; - case 2806: - return DEVICE_UNKNOWN_REPLY_STRING; - case 2807: - return DEVICE_UNREQUESTED_REPLY_STRING; - case 2808: - return INVALID_DEVICE_COMMAND_STRING; - case 2809: - return MONITORING_LIMIT_EXCEEDED_STRING; - case 2810: - return MONITORING_AMBIGUOUS_STRING; - case 4201: - return FUSE_CURRENT_HIGH_STRING; - case 4202: - return FUSE_WENT_OFF_STRING; - case 4204: - return POWER_ABOVE_HIGH_LIMIT_STRING; - case 4205: - return POWER_BELOW_LOW_LIMIT_STRING; - case 4300: - return SWITCH_WENT_OFF_STRING; - case 5000: - return HEATER_ON_STRING; - case 5001: - return HEATER_OFF_STRING; - case 5002: - return HEATER_TIMEOUT_STRING; - case 5003: - return HEATER_STAYED_ON_STRING; - case 5004: - return HEATER_STAYED_OFF_STRING; - case 5200: - return TEMP_SENSOR_HIGH_STRING; - case 5201: - return TEMP_SENSOR_LOW_STRING; - case 5202: - return TEMP_SENSOR_GRADIENT_STRING; - case 5901: - return COMPONENT_TEMP_LOW_STRING; - case 5902: - return COMPONENT_TEMP_HIGH_STRING; - case 5903: - return COMPONENT_TEMP_OOL_LOW_STRING; - case 5904: - return COMPONENT_TEMP_OOL_HIGH_STRING; - case 5905: - return TEMP_NOT_IN_OP_RANGE_STRING; - case 7101: - return FDIR_CHANGED_STATE_STRING; - case 7102: - return FDIR_STARTS_RECOVERY_STRING; - case 7103: - return FDIR_TURNS_OFF_DEVICE_STRING; - case 7201: - return MONITOR_CHANGED_STATE_STRING; - case 7202: - return VALUE_BELOW_LOW_LIMIT_STRING; - case 7203: - return VALUE_ABOVE_HIGH_LIMIT_STRING; - case 7204: - return VALUE_OUT_OF_RANGE_STRING; - case 7301: - return SWITCHING_TM_FAILED_STRING; - case 7400: - return CHANGING_MODE_STRING; - case 7401: - return MODE_INFO_STRING; - case 7402: - return FALLBACK_FAILED_STRING; - case 7403: - return MODE_TRANSITION_FAILED_STRING; - case 7404: - return CANT_KEEP_MODE_STRING; - case 7405: - return OBJECT_IN_INVALID_MODE_STRING; - case 7406: - return FORCING_MODE_STRING; - case 7407: - return MODE_CMD_REJECTED_STRING; - case 7506: - return HEALTH_INFO_STRING; - case 7507: - return CHILD_CHANGED_HEALTH_STRING; - case 7508: - return CHILD_PROBLEMS_STRING; - case 7509: - return OVERWRITING_HEALTH_STRING; - case 7510: - return TRYING_RECOVERY_STRING; - case 7511: - return RECOVERY_STEP_STRING; - case 7512: - return RECOVERY_DONE_STRING; - case 7900: - return RF_AVAILABLE_STRING; - case 7901: - return RF_LOST_STRING; - case 7902: - return BIT_LOCK_STRING; - case 7903: - return BIT_LOCK_LOST_STRING; - case 7905: - return FRAME_PROCESSING_FAILED_STRING; - case 8000: - return TEST_EVENT_SERVICE_1_STRING; - case 9100: - return TEST2_STRING; - default: - return "UNKNOWN_EVENT"; +const char * translateEvents(Event event) { + switch( (event & 0xffff) ) { + case(2200): + return STORE_SEND_WRITE_FAILED_STRING; + case(2201): + return STORE_WRITE_FAILED_STRING; + case(2202): + return STORE_SEND_READ_FAILED_STRING; + case(2203): + return STORE_READ_FAILED_STRING; + case(2204): + return UNEXPECTED_MSG_STRING; + case(2205): + return STORING_FAILED_STRING; + case(2206): + return TM_DUMP_FAILED_STRING; + case(2207): + return STORE_INIT_FAILED_STRING; + case(2208): + return STORE_INIT_EMPTY_STRING; + case(2209): + return STORE_CONTENT_CORRUPTED_STRING; + case(2210): + return STORE_INITIALIZE_STRING; + case(2211): + return INIT_DONE_STRING; + case(2212): + return DUMP_FINISHED_STRING; + case(2213): + return DELETION_FINISHED_STRING; + case(2214): + return DELETION_FAILED_STRING; + case(2215): + return AUTO_CATALOGS_SENDING_FAILED_STRING; + case(2600): + return GET_DATA_FAILED_STRING; + case(2601): + return STORE_DATA_FAILED_STRING; + case(2800): + return DEVICE_BUILDING_COMMAND_FAILED_STRING; + case(2801): + return DEVICE_SENDING_COMMAND_FAILED_STRING; + case(2802): + return DEVICE_REQUESTING_REPLY_FAILED_STRING; + case(2803): + return DEVICE_READING_REPLY_FAILED_STRING; + case(2804): + return DEVICE_INTERPRETING_REPLY_FAILED_STRING; + case(2805): + return DEVICE_MISSED_REPLY_STRING; + case(2806): + return DEVICE_UNKNOWN_REPLY_STRING; + case(2807): + return DEVICE_UNREQUESTED_REPLY_STRING; + case(2808): + return INVALID_DEVICE_COMMAND_STRING; + case(2809): + return MONITORING_LIMIT_EXCEEDED_STRING; + case(2810): + return MONITORING_AMBIGUOUS_STRING; + case(4201): + return FUSE_CURRENT_HIGH_STRING; + case(4202): + return FUSE_WENT_OFF_STRING; + case(4204): + return POWER_ABOVE_HIGH_LIMIT_STRING; + case(4205): + return POWER_BELOW_LOW_LIMIT_STRING; + case(4300): + return SWITCH_WENT_OFF_STRING; + case(5000): + return HEATER_ON_STRING; + case(5001): + return HEATER_OFF_STRING; + case(5002): + return HEATER_TIMEOUT_STRING; + case(5003): + return HEATER_STAYED_ON_STRING; + case(5004): + return HEATER_STAYED_OFF_STRING; + case(5200): + return TEMP_SENSOR_HIGH_STRING; + case(5201): + return TEMP_SENSOR_LOW_STRING; + case(5202): + return TEMP_SENSOR_GRADIENT_STRING; + case(5901): + return COMPONENT_TEMP_LOW_STRING; + case(5902): + return COMPONENT_TEMP_HIGH_STRING; + case(5903): + return COMPONENT_TEMP_OOL_LOW_STRING; + case(5904): + return COMPONENT_TEMP_OOL_HIGH_STRING; + case(5905): + return TEMP_NOT_IN_OP_RANGE_STRING; + case(7101): + return FDIR_CHANGED_STATE_STRING; + case(7102): + return FDIR_STARTS_RECOVERY_STRING; + case(7103): + return FDIR_TURNS_OFF_DEVICE_STRING; + case(7201): + return MONITOR_CHANGED_STATE_STRING; + case(7202): + return VALUE_BELOW_LOW_LIMIT_STRING; + case(7203): + return VALUE_ABOVE_HIGH_LIMIT_STRING; + case(7204): + return VALUE_OUT_OF_RANGE_STRING; + case(7301): + return SWITCHING_TM_FAILED_STRING; + case(7400): + return CHANGING_MODE_STRING; + case(7401): + return MODE_INFO_STRING; + case(7402): + return FALLBACK_FAILED_STRING; + case(7403): + return MODE_TRANSITION_FAILED_STRING; + case(7404): + return CANT_KEEP_MODE_STRING; + case(7405): + return OBJECT_IN_INVALID_MODE_STRING; + case(7406): + return FORCING_MODE_STRING; + case(7407): + return MODE_CMD_REJECTED_STRING; + case(7506): + return HEALTH_INFO_STRING; + case(7507): + return CHILD_CHANGED_HEALTH_STRING; + case(7508): + return CHILD_PROBLEMS_STRING; + case(7509): + return OVERWRITING_HEALTH_STRING; + case(7510): + return TRYING_RECOVERY_STRING; + case(7511): + return RECOVERY_STEP_STRING; + case(7512): + return RECOVERY_DONE_STRING; + case(7900): + return RF_AVAILABLE_STRING; + case(7901): + return RF_LOST_STRING; + case(7902): + return BIT_LOCK_STRING; + case(7903): + return BIT_LOCK_LOST_STRING; + case(7905): + return FRAME_PROCESSING_FAILED_STRING; + case(8900): + return CLOCK_SET_STRING; + case(8901): + return CLOCK_SET_FAILURE_STRING; + case(9700): + return TEST_STRING; + case(10600): + return CHANGE_OF_SETUP_PARAMETER_STRING; + case(11101): + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case(11102): + return ACK_FAILURE_STRING; + case(11103): + return EXE_FAILURE_STRING; + case(11104): + return CRC_FAILURE_EVENT_STRING; + default: + return "UNKNOWN_EVENT"; } return 0; } diff --git a/fsfwconfig/events/translateEvents.h b/fsfwconfig/events/translateEvents.h index e7a88326..9034dcf2 100644 --- a/fsfwconfig/events/translateEvents.h +++ b/fsfwconfig/events/translateEvents.h @@ -1,10 +1,3 @@ -/* - * translateEvent.h - * - * Created on: 28 May 2019 - * Author: Robin - */ - #ifndef FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ #define FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ @@ -12,5 +5,4 @@ const char * translateEvents(Event event); - #endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */ diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py new file mode 100644 index 00000000..bed2c6fd --- /dev/null +++ b/generators/events/event_parser.py @@ -0,0 +1,100 @@ +#! /usr/bin/python3 +""" +@file event_parser.py +@brief Part of the Mission Information Base Exporter for the SOURCE project by KSat. +@details +Event exporter. + +To use MySQLdb, run pip install mysqlclient or install in IDE. +On Windows, Build Tools installation might be necessary +@data 21.11.2019 +""" +import datetime + +from modgen.events.event_parser import handle_csv_export, handle_cpp_export, SubsystemDefinitionParser, EventParser +from modgen.parserbase.file_list_parser import FileListParser +from modgen.utility.printer import PrettyPrinter +from modgen.utility.file_management import copy_file, move_file + +from definitions import BspType + +DATE_TODAY = datetime.datetime.now() +DATE_STRING_FULL = DATE_TODAY.strftime("%Y-%m-%d %H:%M:%S") + +GENERATE_CPP = True +GENERATE_CPP_H = True +GENERATE_CSV = True +COPY_CPP_FILE = True +COPY_CPP_H_FILE = True +MOVE_CSV_FILE = True + +PARSE_HOST_BSP = True + +CSV_FILENAME = "mib_events.csv" +CSV_MOVE_DESTINATION = "../" + +CPP_FILENAME = "translateEvents.cpp" +CPP_H_FILENAME = "translateEvents.h" + +BSP_SELECT = BspType.BSP_Q7S + +BSP_DIR_NAME = BSP_SELECT.value + +if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: + FSFW_CONFIG_ROOT = f"../../fsfwconfig" + +else: + FSFW_CONFIG_ROOT = f"../../{BSP_DIR_NAME}/fsfwconfig" + +CPP_COPY_DESTINATION = f"{FSFW_CONFIG_ROOT}/events/" + +FILE_SEPARATOR = ";" +SUBSYSTEM_DEFINITION_DESTINATIONS = [ + f"{FSFW_CONFIG_ROOT}/events/subsystemIdRanges.h", + "../../fsfw/events/fwSubsystemIdRanges.h", + f"../../common/config/commonSubsystemIds.h" +] +HEADER_DEFINITION_DESTINATIONS = ["../../mission/", "../../fsfw/", f"{FSFW_CONFIG_ROOT}", "../../test/"] + + +def main(): + print("EventParser: Parsing events: ") + event_list = parse_events() + if GENERATE_CSV: + handle_csv_export(file_name=CSV_FILENAME, event_list=event_list, file_separator=FILE_SEPARATOR) + if MOVE_CSV_FILE: + move_file(file_name=CSV_FILENAME, destination=CSV_MOVE_DESTINATION) + if GENERATE_CPP: + handle_cpp_export( + event_list=event_list, date_string=DATE_STRING_FULL, file_name=CPP_FILENAME, + generate_header=GENERATE_CPP_H, header_file_name=CPP_H_FILENAME + ) + if COPY_CPP_FILE: + print(f"EventParser: Copying file to {CPP_COPY_DESTINATION}") + copy_file(CPP_FILENAME, CPP_COPY_DESTINATION) + copy_file(CPP_H_FILENAME, CPP_COPY_DESTINATION) + print("") + + +def parse_events(): + subsystem_parser = SubsystemDefinitionParser(SUBSYSTEM_DEFINITION_DESTINATIONS) + subsystem_table = subsystem_parser.parse_files() + print(f"Found {len(subsystem_table)} subsystem definitions.") + PrettyPrinter.pprint(subsystem_table) + event_header_parser = FileListParser(HEADER_DEFINITION_DESTINATIONS) + event_headers = event_header_parser.parse_header_files( + True, "Parsing event header file list:\n", True + ) + # PrettyPrinter.pprint(event_headers) + # myEventList = parseHeaderFiles(subsystem_table, event_headers) + event_parser = EventParser(event_headers, subsystem_table) + event_parser.set_moving_window_mode(moving_window_size=7) + event_table = event_parser.parse_files() + list_items = sorted(event_table.items()) + print(f"Found {len(list_items)} entries:") + PrettyPrinter.pprint(list_items) + return list_items + + +if __name__ == "__main__": + main() diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp new file mode 100644 index 00000000..62ee369c --- /dev/null +++ b/generators/events/translateEvents.cpp @@ -0,0 +1,264 @@ +/** + * @brief Auto-generated event translation file. Contains 83 translations. + * @details + * Generated on: 2021-05-17 19:38:14 + */ +#include "translateEvents.h" + +const char *STORE_SEND_WRITE_FAILED_STRING = "STORE_SEND_WRITE_FAILED"; +const char *STORE_WRITE_FAILED_STRING = "STORE_WRITE_FAILED"; +const char *STORE_SEND_READ_FAILED_STRING = "STORE_SEND_READ_FAILED"; +const char *STORE_READ_FAILED_STRING = "STORE_READ_FAILED"; +const char *UNEXPECTED_MSG_STRING = "UNEXPECTED_MSG"; +const char *STORING_FAILED_STRING = "STORING_FAILED"; +const char *TM_DUMP_FAILED_STRING = "TM_DUMP_FAILED"; +const char *STORE_INIT_FAILED_STRING = "STORE_INIT_FAILED"; +const char *STORE_INIT_EMPTY_STRING = "STORE_INIT_EMPTY"; +const char *STORE_CONTENT_CORRUPTED_STRING = "STORE_CONTENT_CORRUPTED"; +const char *STORE_INITIALIZE_STRING = "STORE_INITIALIZE"; +const char *INIT_DONE_STRING = "INIT_DONE"; +const char *DUMP_FINISHED_STRING = "DUMP_FINISHED"; +const char *DELETION_FINISHED_STRING = "DELETION_FINISHED"; +const char *DELETION_FAILED_STRING = "DELETION_FAILED"; +const char *AUTO_CATALOGS_SENDING_FAILED_STRING = "AUTO_CATALOGS_SENDING_FAILED"; +const char *GET_DATA_FAILED_STRING = "GET_DATA_FAILED"; +const char *STORE_DATA_FAILED_STRING = "STORE_DATA_FAILED"; +const char *DEVICE_BUILDING_COMMAND_FAILED_STRING = "DEVICE_BUILDING_COMMAND_FAILED"; +const char *DEVICE_SENDING_COMMAND_FAILED_STRING = "DEVICE_SENDING_COMMAND_FAILED"; +const char *DEVICE_REQUESTING_REPLY_FAILED_STRING = "DEVICE_REQUESTING_REPLY_FAILED"; +const char *DEVICE_READING_REPLY_FAILED_STRING = "DEVICE_READING_REPLY_FAILED"; +const char *DEVICE_INTERPRETING_REPLY_FAILED_STRING = "DEVICE_INTERPRETING_REPLY_FAILED"; +const char *DEVICE_MISSED_REPLY_STRING = "DEVICE_MISSED_REPLY"; +const char *DEVICE_UNKNOWN_REPLY_STRING = "DEVICE_UNKNOWN_REPLY"; +const char *DEVICE_UNREQUESTED_REPLY_STRING = "DEVICE_UNREQUESTED_REPLY"; +const char *INVALID_DEVICE_COMMAND_STRING = "INVALID_DEVICE_COMMAND"; +const char *MONITORING_LIMIT_EXCEEDED_STRING = "MONITORING_LIMIT_EXCEEDED"; +const char *MONITORING_AMBIGUOUS_STRING = "MONITORING_AMBIGUOUS"; +const char *FUSE_CURRENT_HIGH_STRING = "FUSE_CURRENT_HIGH"; +const char *FUSE_WENT_OFF_STRING = "FUSE_WENT_OFF"; +const char *POWER_ABOVE_HIGH_LIMIT_STRING = "POWER_ABOVE_HIGH_LIMIT"; +const char *POWER_BELOW_LOW_LIMIT_STRING = "POWER_BELOW_LOW_LIMIT"; +const char *SWITCH_WENT_OFF_STRING = "SWITCH_WENT_OFF"; +const char *HEATER_ON_STRING = "HEATER_ON"; +const char *HEATER_OFF_STRING = "HEATER_OFF"; +const char *HEATER_TIMEOUT_STRING = "HEATER_TIMEOUT"; +const char *HEATER_STAYED_ON_STRING = "HEATER_STAYED_ON"; +const char *HEATER_STAYED_OFF_STRING = "HEATER_STAYED_OFF"; +const char *TEMP_SENSOR_HIGH_STRING = "TEMP_SENSOR_HIGH"; +const char *TEMP_SENSOR_LOW_STRING = "TEMP_SENSOR_LOW"; +const char *TEMP_SENSOR_GRADIENT_STRING = "TEMP_SENSOR_GRADIENT"; +const char *COMPONENT_TEMP_LOW_STRING = "COMPONENT_TEMP_LOW"; +const char *COMPONENT_TEMP_HIGH_STRING = "COMPONENT_TEMP_HIGH"; +const char *COMPONENT_TEMP_OOL_LOW_STRING = "COMPONENT_TEMP_OOL_LOW"; +const char *COMPONENT_TEMP_OOL_HIGH_STRING = "COMPONENT_TEMP_OOL_HIGH"; +const char *TEMP_NOT_IN_OP_RANGE_STRING = "TEMP_NOT_IN_OP_RANGE"; +const char *FDIR_CHANGED_STATE_STRING = "FDIR_CHANGED_STATE"; +const char *FDIR_STARTS_RECOVERY_STRING = "FDIR_STARTS_RECOVERY"; +const char *FDIR_TURNS_OFF_DEVICE_STRING = "FDIR_TURNS_OFF_DEVICE"; +const char *MONITOR_CHANGED_STATE_STRING = "MONITOR_CHANGED_STATE"; +const char *VALUE_BELOW_LOW_LIMIT_STRING = "VALUE_BELOW_LOW_LIMIT"; +const char *VALUE_ABOVE_HIGH_LIMIT_STRING = "VALUE_ABOVE_HIGH_LIMIT"; +const char *VALUE_OUT_OF_RANGE_STRING = "VALUE_OUT_OF_RANGE"; +const char *SWITCHING_TM_FAILED_STRING = "SWITCHING_TM_FAILED"; +const char *CHANGING_MODE_STRING = "CHANGING_MODE"; +const char *MODE_INFO_STRING = "MODE_INFO"; +const char *FALLBACK_FAILED_STRING = "FALLBACK_FAILED"; +const char *MODE_TRANSITION_FAILED_STRING = "MODE_TRANSITION_FAILED"; +const char *CANT_KEEP_MODE_STRING = "CANT_KEEP_MODE"; +const char *OBJECT_IN_INVALID_MODE_STRING = "OBJECT_IN_INVALID_MODE"; +const char *FORCING_MODE_STRING = "FORCING_MODE"; +const char *MODE_CMD_REJECTED_STRING = "MODE_CMD_REJECTED"; +const char *HEALTH_INFO_STRING = "HEALTH_INFO"; +const char *CHILD_CHANGED_HEALTH_STRING = "CHILD_CHANGED_HEALTH"; +const char *CHILD_PROBLEMS_STRING = "CHILD_PROBLEMS"; +const char *OVERWRITING_HEALTH_STRING = "OVERWRITING_HEALTH"; +const char *TRYING_RECOVERY_STRING = "TRYING_RECOVERY"; +const char *RECOVERY_STEP_STRING = "RECOVERY_STEP"; +const char *RECOVERY_DONE_STRING = "RECOVERY_DONE"; +const char *RF_AVAILABLE_STRING = "RF_AVAILABLE"; +const char *RF_LOST_STRING = "RF_LOST"; +const char *BIT_LOCK_STRING = "BIT_LOCK"; +const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST"; +const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED"; +const char *CLOCK_SET_STRING = "CLOCK_SET"; +const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; +const char *TEST_STRING = "TEST"; +const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; +const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; +const char *ACK_FAILURE_STRING = "ACK_FAILURE"; +const char *EXE_FAILURE_STRING = "EXE_FAILURE"; +const char *CRC_FAILURE_EVENT_STRING = "CRC_FAILURE_EVENT"; + +const char * translateEvents(Event event) { + switch( (event & 0xffff) ) { + case(2200): + return STORE_SEND_WRITE_FAILED_STRING; + case(2201): + return STORE_WRITE_FAILED_STRING; + case(2202): + return STORE_SEND_READ_FAILED_STRING; + case(2203): + return STORE_READ_FAILED_STRING; + case(2204): + return UNEXPECTED_MSG_STRING; + case(2205): + return STORING_FAILED_STRING; + case(2206): + return TM_DUMP_FAILED_STRING; + case(2207): + return STORE_INIT_FAILED_STRING; + case(2208): + return STORE_INIT_EMPTY_STRING; + case(2209): + return STORE_CONTENT_CORRUPTED_STRING; + case(2210): + return STORE_INITIALIZE_STRING; + case(2211): + return INIT_DONE_STRING; + case(2212): + return DUMP_FINISHED_STRING; + case(2213): + return DELETION_FINISHED_STRING; + case(2214): + return DELETION_FAILED_STRING; + case(2215): + return AUTO_CATALOGS_SENDING_FAILED_STRING; + case(2600): + return GET_DATA_FAILED_STRING; + case(2601): + return STORE_DATA_FAILED_STRING; + case(2800): + return DEVICE_BUILDING_COMMAND_FAILED_STRING; + case(2801): + return DEVICE_SENDING_COMMAND_FAILED_STRING; + case(2802): + return DEVICE_REQUESTING_REPLY_FAILED_STRING; + case(2803): + return DEVICE_READING_REPLY_FAILED_STRING; + case(2804): + return DEVICE_INTERPRETING_REPLY_FAILED_STRING; + case(2805): + return DEVICE_MISSED_REPLY_STRING; + case(2806): + return DEVICE_UNKNOWN_REPLY_STRING; + case(2807): + return DEVICE_UNREQUESTED_REPLY_STRING; + case(2808): + return INVALID_DEVICE_COMMAND_STRING; + case(2809): + return MONITORING_LIMIT_EXCEEDED_STRING; + case(2810): + return MONITORING_AMBIGUOUS_STRING; + case(4201): + return FUSE_CURRENT_HIGH_STRING; + case(4202): + return FUSE_WENT_OFF_STRING; + case(4204): + return POWER_ABOVE_HIGH_LIMIT_STRING; + case(4205): + return POWER_BELOW_LOW_LIMIT_STRING; + case(4300): + return SWITCH_WENT_OFF_STRING; + case(5000): + return HEATER_ON_STRING; + case(5001): + return HEATER_OFF_STRING; + case(5002): + return HEATER_TIMEOUT_STRING; + case(5003): + return HEATER_STAYED_ON_STRING; + case(5004): + return HEATER_STAYED_OFF_STRING; + case(5200): + return TEMP_SENSOR_HIGH_STRING; + case(5201): + return TEMP_SENSOR_LOW_STRING; + case(5202): + return TEMP_SENSOR_GRADIENT_STRING; + case(5901): + return COMPONENT_TEMP_LOW_STRING; + case(5902): + return COMPONENT_TEMP_HIGH_STRING; + case(5903): + return COMPONENT_TEMP_OOL_LOW_STRING; + case(5904): + return COMPONENT_TEMP_OOL_HIGH_STRING; + case(5905): + return TEMP_NOT_IN_OP_RANGE_STRING; + case(7101): + return FDIR_CHANGED_STATE_STRING; + case(7102): + return FDIR_STARTS_RECOVERY_STRING; + case(7103): + return FDIR_TURNS_OFF_DEVICE_STRING; + case(7201): + return MONITOR_CHANGED_STATE_STRING; + case(7202): + return VALUE_BELOW_LOW_LIMIT_STRING; + case(7203): + return VALUE_ABOVE_HIGH_LIMIT_STRING; + case(7204): + return VALUE_OUT_OF_RANGE_STRING; + case(7301): + return SWITCHING_TM_FAILED_STRING; + case(7400): + return CHANGING_MODE_STRING; + case(7401): + return MODE_INFO_STRING; + case(7402): + return FALLBACK_FAILED_STRING; + case(7403): + return MODE_TRANSITION_FAILED_STRING; + case(7404): + return CANT_KEEP_MODE_STRING; + case(7405): + return OBJECT_IN_INVALID_MODE_STRING; + case(7406): + return FORCING_MODE_STRING; + case(7407): + return MODE_CMD_REJECTED_STRING; + case(7506): + return HEALTH_INFO_STRING; + case(7507): + return CHILD_CHANGED_HEALTH_STRING; + case(7508): + return CHILD_PROBLEMS_STRING; + case(7509): + return OVERWRITING_HEALTH_STRING; + case(7510): + return TRYING_RECOVERY_STRING; + case(7511): + return RECOVERY_STEP_STRING; + case(7512): + return RECOVERY_DONE_STRING; + case(7900): + return RF_AVAILABLE_STRING; + case(7901): + return RF_LOST_STRING; + case(7902): + return BIT_LOCK_STRING; + case(7903): + return BIT_LOCK_LOST_STRING; + case(7905): + return FRAME_PROCESSING_FAILED_STRING; + case(8900): + return CLOCK_SET_STRING; + case(8901): + return CLOCK_SET_FAILURE_STRING; + case(9700): + return TEST_STRING; + case(10600): + return CHANGE_OF_SETUP_PARAMETER_STRING; + case(11101): + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case(11102): + return ACK_FAILURE_STRING; + case(11103): + return EXE_FAILURE_STRING; + case(11104): + return CRC_FAILURE_EVENT_STRING; + default: + return "UNKNOWN_EVENT"; + } + return 0; +} diff --git a/generators/events/translateEvents.h b/generators/events/translateEvents.h new file mode 100644 index 00000000..9034dcf2 --- /dev/null +++ b/generators/events/translateEvents.h @@ -0,0 +1,8 @@ +#ifndef FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ +#define FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ + +#include + +const char * translateEvents(Event event); + +#endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */ diff --git a/generators/mib_events.csv b/generators/mib_events.csv new file mode 100644 index 00000000..81459869 --- /dev/null +++ b/generators/mib_events.csv @@ -0,0 +1,83 @@ +2200;STORE_SEND_WRITE_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2201;STORE_WRITE_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2202;STORE_SEND_READ_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2203;STORE_READ_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2204;UNEXPECTED_MSG;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2205;STORING_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2206;TM_DUMP_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2207;STORE_INIT_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2208;STORE_INIT_EMPTY;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2209;STORE_CONTENT_CORRUPTED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2210;STORE_INITIALIZE;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2211;INIT_DONE;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2212;DUMP_FINISHED;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2213;DELETION_FINISHED;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2214;DELETION_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2215;AUTO_CATALOGS_SENDING_FAILED;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2600;GET_DATA_FAILED;LOW; ;../../fsfw/storagemanager/StorageManagerIF.h +2601;STORE_DATA_FAILED;LOW; ;../../fsfw/storagemanager/StorageManagerIF.h +2800;DEVICE_BUILDING_COMMAND_FAILED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2801;DEVICE_SENDING_COMMAND_FAILED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2802;DEVICE_REQUESTING_REPLY_FAILED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2803;DEVICE_READING_REPLY_FAILED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2804;DEVICE_INTERPRETING_REPLY_FAILED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2805;DEVICE_MISSED_REPLY;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2806;DEVICE_UNKNOWN_REPLY;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2807;DEVICE_UNREQUESTED_REPLY;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2808;INVALID_DEVICE_COMMAND;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2809;MONITORING_LIMIT_EXCEEDED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2810;MONITORING_AMBIGUOUS;HIGH; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +4201;FUSE_CURRENT_HIGH;LOW; ;../../fsfw/power/Fuse.h +4202;FUSE_WENT_OFF;LOW; ;../../fsfw/power/Fuse.h +4204;POWER_ABOVE_HIGH_LIMIT;LOW; ;../../fsfw/power/Fuse.h +4205;POWER_BELOW_LOW_LIMIT;LOW; ;../../fsfw/power/Fuse.h +4300;SWITCH_WENT_OFF;LOW; ;../../fsfw/power/PowerSwitchIF.h +5000;HEATER_ON;INFO; ;../../fsfw/thermal/Heater.h +5001;HEATER_OFF;INFO; ;../../fsfw/thermal/Heater.h +5002;HEATER_TIMEOUT;LOW; ;../../fsfw/thermal/Heater.h +5003;HEATER_STAYED_ON;LOW; ;../../fsfw/thermal/Heater.h +5004;HEATER_STAYED_OFF;LOW; ;../../fsfw/thermal/Heater.h +5200;TEMP_SENSOR_HIGH;LOW; ;../../fsfw/thermal/AbstractTemperatureSensor.h +5201;TEMP_SENSOR_LOW;LOW; ;../../fsfw/thermal/AbstractTemperatureSensor.h +5202;TEMP_SENSOR_GRADIENT;LOW; ;../../fsfw/thermal/AbstractTemperatureSensor.h +5901;COMPONENT_TEMP_LOW;LOW; ;../../fsfw/thermal/ThermalComponentIF.h +5902;COMPONENT_TEMP_HIGH;LOW; ;../../fsfw/thermal/ThermalComponentIF.h +5903;COMPONENT_TEMP_OOL_LOW;LOW; ;../../fsfw/thermal/ThermalComponentIF.h +5904;COMPONENT_TEMP_OOL_HIGH;LOW; ;../../fsfw/thermal/ThermalComponentIF.h +5905;TEMP_NOT_IN_OP_RANGE;LOW; ;../../fsfw/thermal/ThermalComponentIF.h +7101;FDIR_CHANGED_STATE;INFO; ;../../fsfw/fdir/FailureIsolationBase.h +7102;FDIR_STARTS_RECOVERY;MEDIUM; ;../../fsfw/fdir/FailureIsolationBase.h +7103;FDIR_TURNS_OFF_DEVICE;MEDIUM; ;../../fsfw/fdir/FailureIsolationBase.h +7201;MONITOR_CHANGED_STATE;LOW; ;../../fsfw/monitoring/MonitoringIF.h +7202;VALUE_BELOW_LOW_LIMIT;LOW; ;../../fsfw/monitoring/MonitoringIF.h +7203;VALUE_ABOVE_HIGH_LIMIT;LOW; ;../../fsfw/monitoring/MonitoringIF.h +7204;VALUE_OUT_OF_RANGE;LOW; ;../../fsfw/monitoring/MonitoringIF.h +7301;SWITCHING_TM_FAILED;LOW; ;../../fsfw/datapool/HkSwitchHelper.h +7400;CHANGING_MODE;INFO; ;../../fsfw/modes/HasModesIF.h +7401;MODE_INFO;INFO; ;../../fsfw/modes/HasModesIF.h +7402;FALLBACK_FAILED;HIGH; ;../../fsfw/modes/HasModesIF.h +7403;MODE_TRANSITION_FAILED;LOW; ;../../fsfw/modes/HasModesIF.h +7404;CANT_KEEP_MODE;HIGH; ;../../fsfw/modes/HasModesIF.h +7405;OBJECT_IN_INVALID_MODE;LOW; ;../../fsfw/modes/HasModesIF.h +7406;FORCING_MODE;MEDIUM; ;../../fsfw/modes/HasModesIF.h +7407;MODE_CMD_REJECTED;LOW; ;../../fsfw/modes/HasModesIF.h +7506;HEALTH_INFO;INFO; ;../../fsfw/health/HasHealthIF.h +7507;CHILD_CHANGED_HEALTH;INFO; ;../../fsfw/health/HasHealthIF.h +7508;CHILD_PROBLEMS;LOW; ;../../fsfw/health/HasHealthIF.h +7509;OVERWRITING_HEALTH;LOW; ;../../fsfw/health/HasHealthIF.h +7510;TRYING_RECOVERY;MEDIUM; ;../../fsfw/health/HasHealthIF.h +7511;RECOVERY_STEP;MEDIUM; ;../../fsfw/health/HasHealthIF.h +7512;RECOVERY_DONE;MEDIUM; ;../../fsfw/health/HasHealthIF.h +7900;RF_AVAILABLE;INFO; ;../../fsfw/datalinklayer/DataLinkLayer.h +7901;RF_LOST;INFO; ;../../fsfw/datalinklayer/DataLinkLayer.h +7902;BIT_LOCK;INFO; ;../../fsfw/datalinklayer/DataLinkLayer.h +7903;BIT_LOCK_LOST;INFO; ;../../fsfw/datalinklayer/DataLinkLayer.h +7905;FRAME_PROCESSING_FAILED;LOW; ;../../fsfw/datalinklayer/DataLinkLayer.h +8900;CLOCK_SET;INFO; ;../../fsfw/pus/Service9TimeManagement.h +8901;CLOCK_SET_FAILURE;LOW; ;../../fsfw/pus/Service9TimeManagement.h +9700;TEST;INFO; ;../../fsfw/pus/Service17Test.h +10600;CHANGE_OF_SETUP_PARAMETER;LOW; ;../../mission/devices/MGMHandlerLIS3MDL.h +11101;MEMORY_READ_RPT_CRC_FAILURE;LOW; ;../../mission/devices/PlocHandler.h +11102;ACK_FAILURE;LOW; ;../../mission/devices/PlocHandler.h +11103;EXE_FAILURE;LOW; ;../../mission/devices/PlocHandler.h +11104;CRC_FAILURE_EVENT;LOW; ;../../mission/devices/PlocHandler.h diff --git a/generators/modgen b/generators/modgen index 236aaf71..8016ac97 160000 --- a/generators/modgen +++ b/generators/modgen @@ -1 +1 @@ -Subproject commit 236aaf71ea43d1e6e21e8bdbc4b72e24978ccf04 +Subproject commit 8016ac974530d3ee11f6af0b44f5c7df337c88a3 diff --git a/linux/devices/SusHandler.h b/linux/devices/SusHandler.h index c73cee97..2312d383 100644 --- a/linux/devices/SusHandler.h +++ b/linux/devices/SusHandler.h @@ -1,8 +1,8 @@ #ifndef MISSION_DEVICES_SUSHANDLER_H_ #define MISSION_DEVICES_SUSHANDLER_H_ +#include "devicedefinitions/SusDefinitions.h" #include -#include #include #include diff --git a/mission/devices/devicedefinitions/SusDefinitions.h b/linux/devices/devicedefinitions/SusDefinitions.h similarity index 96% rename from mission/devices/devicedefinitions/SusDefinitions.h rename to linux/devices/devicedefinitions/SusDefinitions.h index 18f33e0d..ba56ec07 100644 --- a/mission/devices/devicedefinitions/SusDefinitions.h +++ b/linux/devices/devicedefinitions/SusDefinitions.h @@ -1,6 +1,11 @@ #ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SUS_H_ #define MISSION_DEVICES_DEVICEDEFINITIONS_SUS_H_ +#include +#include +#include + + namespace SUS { /** diff --git a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h index 1cfdf933..76dd85c5 100644 --- a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h +++ b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h @@ -98,7 +98,7 @@ public: COIL_Y_CURRENT, this); lp_var_t coilZCurrentmA = lp_var_t(sid.objectId, COIL_Z_CURRENT, this); - /** All temperatures in [°C] */ + /** All temperatures in [�C] */ lp_var_t coilXTemperature = lp_var_t(sid.objectId, COIL_X_TEMPERATURE, this); lp_var_t coilYTemperature = lp_var_t(sid.objectId, @@ -182,9 +182,9 @@ private: /** * @brief Constructor * - * @param xDipole The dipole of the x coil in 10^-4*Am^2 - * @param yDipole The dipole of the y coil in 10^-4*Am^2 - * @param zDipole The dipole of the z coil in 10^-4*Am^2 + * @param xDipole The dipole of the x coil in 10 ^ -4 * Am^2 + * @param yDipole The dipole of the y coil in 10 ^ -4 * Am^2 + * @param zDipole The dipole of the z coil in 10 ^ -4 * Am^2 * @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. diff --git a/mission/devices/devicedefinitions/PlocDefinitions.h b/mission/devices/devicedefinitions/PlocDefinitions.h index f5add451..5cc38d5a 100644 --- a/mission/devices/devicedefinitions/PlocDefinitions.h +++ b/mission/devices/devicedefinitions/PlocDefinitions.h @@ -53,7 +53,7 @@ namespace PLOC { * * @details The last two bytes of the packet data field contain a CRC calculated over the whole * space packet. This is the CRC-16-CCITT as specified in - * ECSS-E-ST-70-41C – Telemetry and telecommand packet utilization. + * ECSS-E-ST-70-41C Telemetry and telecommand packet utilization. */ class TcMemRead : public SpacePacket { public: @@ -107,7 +107,7 @@ namespace PLOC { * the PLOC. * @details The last two bytes of the packet data field contain a CRC calculated over the whole * space packet. This is the CRC-16-CCITT as specified in - * ECSS-E-ST-70-41C – Telemetry and telecommand packet utilization. + * ECSS-E-ST-70-41C Telemetry and telecommand packet utilization. */ class TcMemWrite : public SpacePacket { public: From 5c591f628a1e1cfcb16e173c832842cb956eae5e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 19:49:29 +0200 Subject: [PATCH 11/15] compiling with translation files --- bsp_q7s/ObjectFactory.cpp | 3 +-- cmake/BBBCrossCompileConfig.cmake | 2 +- cmake/Q7SCrossCompileConfig.cmake | 2 +- cmake/RPiCrossCompileConfig.cmake | 2 +- fsfwconfig/CMakeLists.txt | 13 ++++++++++++- fsfwconfig/FSFWConfig.h | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/bsp_q7s/ObjectFactory.cpp b/bsp_q7s/ObjectFactory.cpp index 22418bc5..85573bbd 100644 --- a/bsp_q7s/ObjectFactory.cpp +++ b/bsp_q7s/ObjectFactory.cpp @@ -29,13 +29,12 @@ #include #include - +#include #include #include #include #include #include -#include #include #include diff --git a/cmake/BBBCrossCompileConfig.cmake b/cmake/BBBCrossCompileConfig.cmake index b32897f5..e1a669db 100644 --- a/cmake/BBBCrossCompileConfig.cmake +++ b/cmake/BBBCrossCompileConfig.cmake @@ -13,7 +13,7 @@ if(NOT DEFINED ENV{BBB_ROOTFS}) "Define the BBB_ROOTFS variable to point to the Beagle Bone Black rootfs." ) else() - set(SYSROOT_PATH "$ENV{BBB_ROOTFS}") + set(SYSROOT_PATH "$ENV{BBB_ROOTFS}" CACHE FILEPATH "BBB root filesystem path") message(STATUS "Beagle Bone Black sysroot: ${SYSROOT_PATH}") endif() diff --git a/cmake/Q7SCrossCompileConfig.cmake b/cmake/Q7SCrossCompileConfig.cmake index 2c5bd4e9..66d9e0a8 100644 --- a/cmake/Q7SCrossCompileConfig.cmake +++ b/cmake/Q7SCrossCompileConfig.cmake @@ -6,7 +6,7 @@ if(NOT DEFINED ENV{Q7S_SYSROOT}) # "point to the raspbian rootfs." # ) else() - set(SYSROOT_PATH "$ENV{Q7S_SYSROOT}") + set(SYSROOT_PATH "$ENV{Q7S_SYSROOT}" CACHE FILEPATH "Q7S root filesystem path") endif() if(NOT DEFINED ENV{CROSS_COMPILE}) diff --git a/cmake/RPiCrossCompileConfig.cmake b/cmake/RPiCrossCompileConfig.cmake index e1b4cce3..1f246443 100644 --- a/cmake/RPiCrossCompileConfig.cmake +++ b/cmake/RPiCrossCompileConfig.cmake @@ -25,7 +25,7 @@ if(NOT DEFINED ENV{RASPBIAN_ROOTFS}) "point to the raspbian rootfs." ) else() - set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}") + set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}" CACHE FILEPATH "RPi root filesystem path") endif() if(NOT DEFINED ENV{CROSS_COMPILE}) diff --git a/fsfwconfig/CMakeLists.txt b/fsfwconfig/CMakeLists.txt index 87ddea03..277b89db 100644 --- a/fsfwconfig/CMakeLists.txt +++ b/fsfwconfig/CMakeLists.txt @@ -7,5 +7,16 @@ target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) +# If a special translation file for object IDs exists, compile it. +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") + target_sources(${TARGET_NAME} PRIVATE + objects/translateObjects.cpp + ) +endif() - +# If a special translation file for events exists, compile it. +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") + target_sources(${TARGET_NAME} PRIVATE + events/translateEvents.cpp + ) +endif() diff --git a/fsfwconfig/FSFWConfig.h b/fsfwconfig/FSFWConfig.h index 097f8aaf..8095bd12 100644 --- a/fsfwconfig/FSFWConfig.h +++ b/fsfwconfig/FSFWConfig.h @@ -25,7 +25,7 @@ //! If FSFW_OBJ_EVENT_TRANSLATION is set to one, //! additional output which requires the translation files translateObjects //! and translateEvents (and their compiled source files) -#define FSFW_OBJ_EVENT_TRANSLATION 0 +#define FSFW_OBJ_EVENT_TRANSLATION 1 #if FSFW_OBJ_EVENT_TRANSLATION == 1 //! Specify whether info events are printed too. From e5921bece390988d28ba62b43cca48ac8abd9026 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 19:50:07 +0200 Subject: [PATCH 12/15] regenerated hosted events --- .../fsfwconfig/events/translateEvents.cpp | 264 ++++++++++++++++++ .../fsfwconfig/events/translateEvents.h | 8 + generators/events/event_parser.py | 2 +- generators/events/translateEvents.cpp | 2 +- 4 files changed, 274 insertions(+), 2 deletions(-) create mode 100644 bsp_hosted/fsfwconfig/events/translateEvents.cpp create mode 100644 bsp_hosted/fsfwconfig/events/translateEvents.h diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp new file mode 100644 index 00000000..7b9ce4b5 --- /dev/null +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -0,0 +1,264 @@ +/** + * @brief Auto-generated event translation file. Contains 83 translations. + * @details + * Generated on: 2021-05-17 19:49:55 + */ +#include "translateEvents.h" + +const char *STORE_SEND_WRITE_FAILED_STRING = "STORE_SEND_WRITE_FAILED"; +const char *STORE_WRITE_FAILED_STRING = "STORE_WRITE_FAILED"; +const char *STORE_SEND_READ_FAILED_STRING = "STORE_SEND_READ_FAILED"; +const char *STORE_READ_FAILED_STRING = "STORE_READ_FAILED"; +const char *UNEXPECTED_MSG_STRING = "UNEXPECTED_MSG"; +const char *STORING_FAILED_STRING = "STORING_FAILED"; +const char *TM_DUMP_FAILED_STRING = "TM_DUMP_FAILED"; +const char *STORE_INIT_FAILED_STRING = "STORE_INIT_FAILED"; +const char *STORE_INIT_EMPTY_STRING = "STORE_INIT_EMPTY"; +const char *STORE_CONTENT_CORRUPTED_STRING = "STORE_CONTENT_CORRUPTED"; +const char *STORE_INITIALIZE_STRING = "STORE_INITIALIZE"; +const char *INIT_DONE_STRING = "INIT_DONE"; +const char *DUMP_FINISHED_STRING = "DUMP_FINISHED"; +const char *DELETION_FINISHED_STRING = "DELETION_FINISHED"; +const char *DELETION_FAILED_STRING = "DELETION_FAILED"; +const char *AUTO_CATALOGS_SENDING_FAILED_STRING = "AUTO_CATALOGS_SENDING_FAILED"; +const char *GET_DATA_FAILED_STRING = "GET_DATA_FAILED"; +const char *STORE_DATA_FAILED_STRING = "STORE_DATA_FAILED"; +const char *DEVICE_BUILDING_COMMAND_FAILED_STRING = "DEVICE_BUILDING_COMMAND_FAILED"; +const char *DEVICE_SENDING_COMMAND_FAILED_STRING = "DEVICE_SENDING_COMMAND_FAILED"; +const char *DEVICE_REQUESTING_REPLY_FAILED_STRING = "DEVICE_REQUESTING_REPLY_FAILED"; +const char *DEVICE_READING_REPLY_FAILED_STRING = "DEVICE_READING_REPLY_FAILED"; +const char *DEVICE_INTERPRETING_REPLY_FAILED_STRING = "DEVICE_INTERPRETING_REPLY_FAILED"; +const char *DEVICE_MISSED_REPLY_STRING = "DEVICE_MISSED_REPLY"; +const char *DEVICE_UNKNOWN_REPLY_STRING = "DEVICE_UNKNOWN_REPLY"; +const char *DEVICE_UNREQUESTED_REPLY_STRING = "DEVICE_UNREQUESTED_REPLY"; +const char *INVALID_DEVICE_COMMAND_STRING = "INVALID_DEVICE_COMMAND"; +const char *MONITORING_LIMIT_EXCEEDED_STRING = "MONITORING_LIMIT_EXCEEDED"; +const char *MONITORING_AMBIGUOUS_STRING = "MONITORING_AMBIGUOUS"; +const char *FUSE_CURRENT_HIGH_STRING = "FUSE_CURRENT_HIGH"; +const char *FUSE_WENT_OFF_STRING = "FUSE_WENT_OFF"; +const char *POWER_ABOVE_HIGH_LIMIT_STRING = "POWER_ABOVE_HIGH_LIMIT"; +const char *POWER_BELOW_LOW_LIMIT_STRING = "POWER_BELOW_LOW_LIMIT"; +const char *SWITCH_WENT_OFF_STRING = "SWITCH_WENT_OFF"; +const char *HEATER_ON_STRING = "HEATER_ON"; +const char *HEATER_OFF_STRING = "HEATER_OFF"; +const char *HEATER_TIMEOUT_STRING = "HEATER_TIMEOUT"; +const char *HEATER_STAYED_ON_STRING = "HEATER_STAYED_ON"; +const char *HEATER_STAYED_OFF_STRING = "HEATER_STAYED_OFF"; +const char *TEMP_SENSOR_HIGH_STRING = "TEMP_SENSOR_HIGH"; +const char *TEMP_SENSOR_LOW_STRING = "TEMP_SENSOR_LOW"; +const char *TEMP_SENSOR_GRADIENT_STRING = "TEMP_SENSOR_GRADIENT"; +const char *COMPONENT_TEMP_LOW_STRING = "COMPONENT_TEMP_LOW"; +const char *COMPONENT_TEMP_HIGH_STRING = "COMPONENT_TEMP_HIGH"; +const char *COMPONENT_TEMP_OOL_LOW_STRING = "COMPONENT_TEMP_OOL_LOW"; +const char *COMPONENT_TEMP_OOL_HIGH_STRING = "COMPONENT_TEMP_OOL_HIGH"; +const char *TEMP_NOT_IN_OP_RANGE_STRING = "TEMP_NOT_IN_OP_RANGE"; +const char *FDIR_CHANGED_STATE_STRING = "FDIR_CHANGED_STATE"; +const char *FDIR_STARTS_RECOVERY_STRING = "FDIR_STARTS_RECOVERY"; +const char *FDIR_TURNS_OFF_DEVICE_STRING = "FDIR_TURNS_OFF_DEVICE"; +const char *MONITOR_CHANGED_STATE_STRING = "MONITOR_CHANGED_STATE"; +const char *VALUE_BELOW_LOW_LIMIT_STRING = "VALUE_BELOW_LOW_LIMIT"; +const char *VALUE_ABOVE_HIGH_LIMIT_STRING = "VALUE_ABOVE_HIGH_LIMIT"; +const char *VALUE_OUT_OF_RANGE_STRING = "VALUE_OUT_OF_RANGE"; +const char *SWITCHING_TM_FAILED_STRING = "SWITCHING_TM_FAILED"; +const char *CHANGING_MODE_STRING = "CHANGING_MODE"; +const char *MODE_INFO_STRING = "MODE_INFO"; +const char *FALLBACK_FAILED_STRING = "FALLBACK_FAILED"; +const char *MODE_TRANSITION_FAILED_STRING = "MODE_TRANSITION_FAILED"; +const char *CANT_KEEP_MODE_STRING = "CANT_KEEP_MODE"; +const char *OBJECT_IN_INVALID_MODE_STRING = "OBJECT_IN_INVALID_MODE"; +const char *FORCING_MODE_STRING = "FORCING_MODE"; +const char *MODE_CMD_REJECTED_STRING = "MODE_CMD_REJECTED"; +const char *HEALTH_INFO_STRING = "HEALTH_INFO"; +const char *CHILD_CHANGED_HEALTH_STRING = "CHILD_CHANGED_HEALTH"; +const char *CHILD_PROBLEMS_STRING = "CHILD_PROBLEMS"; +const char *OVERWRITING_HEALTH_STRING = "OVERWRITING_HEALTH"; +const char *TRYING_RECOVERY_STRING = "TRYING_RECOVERY"; +const char *RECOVERY_STEP_STRING = "RECOVERY_STEP"; +const char *RECOVERY_DONE_STRING = "RECOVERY_DONE"; +const char *RF_AVAILABLE_STRING = "RF_AVAILABLE"; +const char *RF_LOST_STRING = "RF_LOST"; +const char *BIT_LOCK_STRING = "BIT_LOCK"; +const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST"; +const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED"; +const char *CLOCK_SET_STRING = "CLOCK_SET"; +const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; +const char *TEST_STRING = "TEST"; +const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; +const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; +const char *ACK_FAILURE_STRING = "ACK_FAILURE"; +const char *EXE_FAILURE_STRING = "EXE_FAILURE"; +const char *CRC_FAILURE_EVENT_STRING = "CRC_FAILURE_EVENT"; + +const char * translateEvents(Event event) { + switch( (event & 0xffff) ) { + case(2200): + return STORE_SEND_WRITE_FAILED_STRING; + case(2201): + return STORE_WRITE_FAILED_STRING; + case(2202): + return STORE_SEND_READ_FAILED_STRING; + case(2203): + return STORE_READ_FAILED_STRING; + case(2204): + return UNEXPECTED_MSG_STRING; + case(2205): + return STORING_FAILED_STRING; + case(2206): + return TM_DUMP_FAILED_STRING; + case(2207): + return STORE_INIT_FAILED_STRING; + case(2208): + return STORE_INIT_EMPTY_STRING; + case(2209): + return STORE_CONTENT_CORRUPTED_STRING; + case(2210): + return STORE_INITIALIZE_STRING; + case(2211): + return INIT_DONE_STRING; + case(2212): + return DUMP_FINISHED_STRING; + case(2213): + return DELETION_FINISHED_STRING; + case(2214): + return DELETION_FAILED_STRING; + case(2215): + return AUTO_CATALOGS_SENDING_FAILED_STRING; + case(2600): + return GET_DATA_FAILED_STRING; + case(2601): + return STORE_DATA_FAILED_STRING; + case(2800): + return DEVICE_BUILDING_COMMAND_FAILED_STRING; + case(2801): + return DEVICE_SENDING_COMMAND_FAILED_STRING; + case(2802): + return DEVICE_REQUESTING_REPLY_FAILED_STRING; + case(2803): + return DEVICE_READING_REPLY_FAILED_STRING; + case(2804): + return DEVICE_INTERPRETING_REPLY_FAILED_STRING; + case(2805): + return DEVICE_MISSED_REPLY_STRING; + case(2806): + return DEVICE_UNKNOWN_REPLY_STRING; + case(2807): + return DEVICE_UNREQUESTED_REPLY_STRING; + case(2808): + return INVALID_DEVICE_COMMAND_STRING; + case(2809): + return MONITORING_LIMIT_EXCEEDED_STRING; + case(2810): + return MONITORING_AMBIGUOUS_STRING; + case(4201): + return FUSE_CURRENT_HIGH_STRING; + case(4202): + return FUSE_WENT_OFF_STRING; + case(4204): + return POWER_ABOVE_HIGH_LIMIT_STRING; + case(4205): + return POWER_BELOW_LOW_LIMIT_STRING; + case(4300): + return SWITCH_WENT_OFF_STRING; + case(5000): + return HEATER_ON_STRING; + case(5001): + return HEATER_OFF_STRING; + case(5002): + return HEATER_TIMEOUT_STRING; + case(5003): + return HEATER_STAYED_ON_STRING; + case(5004): + return HEATER_STAYED_OFF_STRING; + case(5200): + return TEMP_SENSOR_HIGH_STRING; + case(5201): + return TEMP_SENSOR_LOW_STRING; + case(5202): + return TEMP_SENSOR_GRADIENT_STRING; + case(5901): + return COMPONENT_TEMP_LOW_STRING; + case(5902): + return COMPONENT_TEMP_HIGH_STRING; + case(5903): + return COMPONENT_TEMP_OOL_LOW_STRING; + case(5904): + return COMPONENT_TEMP_OOL_HIGH_STRING; + case(5905): + return TEMP_NOT_IN_OP_RANGE_STRING; + case(7101): + return FDIR_CHANGED_STATE_STRING; + case(7102): + return FDIR_STARTS_RECOVERY_STRING; + case(7103): + return FDIR_TURNS_OFF_DEVICE_STRING; + case(7201): + return MONITOR_CHANGED_STATE_STRING; + case(7202): + return VALUE_BELOW_LOW_LIMIT_STRING; + case(7203): + return VALUE_ABOVE_HIGH_LIMIT_STRING; + case(7204): + return VALUE_OUT_OF_RANGE_STRING; + case(7301): + return SWITCHING_TM_FAILED_STRING; + case(7400): + return CHANGING_MODE_STRING; + case(7401): + return MODE_INFO_STRING; + case(7402): + return FALLBACK_FAILED_STRING; + case(7403): + return MODE_TRANSITION_FAILED_STRING; + case(7404): + return CANT_KEEP_MODE_STRING; + case(7405): + return OBJECT_IN_INVALID_MODE_STRING; + case(7406): + return FORCING_MODE_STRING; + case(7407): + return MODE_CMD_REJECTED_STRING; + case(7506): + return HEALTH_INFO_STRING; + case(7507): + return CHILD_CHANGED_HEALTH_STRING; + case(7508): + return CHILD_PROBLEMS_STRING; + case(7509): + return OVERWRITING_HEALTH_STRING; + case(7510): + return TRYING_RECOVERY_STRING; + case(7511): + return RECOVERY_STEP_STRING; + case(7512): + return RECOVERY_DONE_STRING; + case(7900): + return RF_AVAILABLE_STRING; + case(7901): + return RF_LOST_STRING; + case(7902): + return BIT_LOCK_STRING; + case(7903): + return BIT_LOCK_LOST_STRING; + case(7905): + return FRAME_PROCESSING_FAILED_STRING; + case(8900): + return CLOCK_SET_STRING; + case(8901): + return CLOCK_SET_FAILURE_STRING; + case(9700): + return TEST_STRING; + case(10600): + return CHANGE_OF_SETUP_PARAMETER_STRING; + case(11101): + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case(11102): + return ACK_FAILURE_STRING; + case(11103): + return EXE_FAILURE_STRING; + case(11104): + return CRC_FAILURE_EVENT_STRING; + default: + return "UNKNOWN_EVENT"; + } + return 0; +} diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.h b/bsp_hosted/fsfwconfig/events/translateEvents.h new file mode 100644 index 00000000..9034dcf2 --- /dev/null +++ b/bsp_hosted/fsfwconfig/events/translateEvents.h @@ -0,0 +1,8 @@ +#ifndef FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ +#define FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ + +#include + +const char * translateEvents(Event event); + +#endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */ diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py index bed2c6fd..d3d3b15c 100644 --- a/generators/events/event_parser.py +++ b/generators/events/event_parser.py @@ -36,7 +36,7 @@ CSV_MOVE_DESTINATION = "../" CPP_FILENAME = "translateEvents.cpp" CPP_H_FILENAME = "translateEvents.h" -BSP_SELECT = BspType.BSP_Q7S +BSP_SELECT = BspType.BSP_HOSTED BSP_DIR_NAME = BSP_SELECT.value diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 62ee369c..7b9ce4b5 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 83 translations. * @details - * Generated on: 2021-05-17 19:38:14 + * Generated on: 2021-05-17 19:49:55 */ #include "translateEvents.h" From da94a61cfe7f07cb7962714b5f01ce4f848638db Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 19:50:24 +0200 Subject: [PATCH 13/15] default bsp is q7s --- generators/events/event_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py index d3d3b15c..bed2c6fd 100644 --- a/generators/events/event_parser.py +++ b/generators/events/event_parser.py @@ -36,7 +36,7 @@ CSV_MOVE_DESTINATION = "../" CPP_FILENAME = "translateEvents.cpp" CPP_H_FILENAME = "translateEvents.h" -BSP_SELECT = BspType.BSP_HOSTED +BSP_SELECT = BspType.BSP_Q7S BSP_DIR_NAME = BSP_SELECT.value From fd29f6ce85f8ec626676009b93eb66312ae69ae2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 19:51:38 +0200 Subject: [PATCH 14/15] hosted compiling with event translation --- bsp_hosted/fsfwconfig/CMakeLists.txt | 13 ++++++++++++- bsp_hosted/fsfwconfig/FSFWConfig.h | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bsp_hosted/fsfwconfig/CMakeLists.txt b/bsp_hosted/fsfwconfig/CMakeLists.txt index a906098f..fc961da8 100644 --- a/bsp_hosted/fsfwconfig/CMakeLists.txt +++ b/bsp_hosted/fsfwconfig/CMakeLists.txt @@ -6,5 +6,16 @@ target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) +# If a special translation file for object IDs exists, compile it. +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") + target_sources(${TARGET_NAME} PRIVATE + objects/translateObjects.cpp + ) +endif() - +# If a special translation file for events exists, compile it. +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") + target_sources(${TARGET_NAME} PRIVATE + events/translateEvents.cpp + ) +endif() diff --git a/bsp_hosted/fsfwconfig/FSFWConfig.h b/bsp_hosted/fsfwconfig/FSFWConfig.h index 3174d596..e48895d9 100644 --- a/bsp_hosted/fsfwconfig/FSFWConfig.h +++ b/bsp_hosted/fsfwconfig/FSFWConfig.h @@ -25,7 +25,7 @@ //! If FSFW_OBJ_EVENT_TRANSLATION is set to one, //! additional output which requires the translation files translateObjects //! and translateEvents (and their compiled source files) -#define FSFW_OBJ_EVENT_TRANSLATION 0 +#define FSFW_OBJ_EVENT_TRANSLATION 1 #if FSFW_OBJ_EVENT_TRANSLATION == 1 //! Specify whether info events are printed too. From 9ccd0d2e725b9c02ff6da921c68b87bc05dd5418 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 20:03:56 +0200 Subject: [PATCH 15/15] moved fsfwconfig into linux folder --- CMakeLists.txt | 8 +- bsp_q7s/InitMission.cpp | 5 +- fsfwconfig/ipc/MissionMessageTypes.cpp | 11 -- generators/events/event_parser.py | 2 +- generators/mib_objects.csv | 35 +++++- generators/objects/objects.py | 16 ++- generators/objects/translateObjects.cpp | 105 ++++++++++++++++-- linux/CMakeLists.txt | 1 + linux/boardtest/LibgpiodTest.cpp | 3 +- linux/boardtest/SpiTestClass.cpp | 2 +- linux/devices/HeaterHandler.h | 3 +- .../fsfwconfig}/CMakeLists.txt | 0 {fsfwconfig => linux/fsfwconfig}/FSFWConfig.h | 0 {fsfwconfig => linux/fsfwconfig}/OBSWConfig.h | 0 .../fsfwconfig}/devices/addresses.cpp | 0 .../fsfwconfig}/devices/addresses.h | 2 +- .../fsfwconfig}/devices/gpioIds.h | 0 .../fsfwconfig}/devices/heaterSwitcherList.h | 4 +- .../fsfwconfig}/devices/powerSwitcherList.h | 2 +- .../fsfwconfig}/devices/spi.h | 0 .../fsfwconfig}/events/subsystemIdRanges.h | 0 .../fsfwconfig}/events/translateEvents.cpp | 0 .../fsfwconfig}/events/translateEvents.h | 0 .../fsfwconfig}/fsfwconfig.mk | 0 linux/fsfwconfig/ipc/MissionMessageTypes.cpp | 12 ++ .../fsfwconfig}/ipc/MissionMessageTypes.h | 0 .../fsfwconfig}/objects/systemObjectList.h | 0 .../fsfwconfig}/objects/translateObjects.cpp | 2 +- .../fsfwconfig}/objects/translateObjects.h | 0 .../pollingSequenceFactory.cpp | 2 +- .../pollingsequence/pollingSequenceFactory.h | 0 .../fsfwconfig}/returnvalues/classIds.h | 0 {fsfwconfig => linux/fsfwconfig}/tmtc/apid.h | 0 .../fsfwconfig}/tmtc/pusIds.h | 0 .../devicedefinitions/Max31865Definitions.h | 2 +- 35 files changed, 165 insertions(+), 52 deletions(-) delete mode 100644 fsfwconfig/ipc/MissionMessageTypes.cpp rename {fsfwconfig => linux/fsfwconfig}/CMakeLists.txt (100%) rename {fsfwconfig => linux/fsfwconfig}/FSFWConfig.h (100%) rename {fsfwconfig => linux/fsfwconfig}/OBSWConfig.h (100%) rename {fsfwconfig => linux/fsfwconfig}/devices/addresses.cpp (100%) rename {fsfwconfig => linux/fsfwconfig}/devices/addresses.h (92%) rename {fsfwconfig => linux/fsfwconfig}/devices/gpioIds.h (100%) rename {fsfwconfig => linux/fsfwconfig}/devices/heaterSwitcherList.h (94%) rename {fsfwconfig => linux/fsfwconfig}/devices/powerSwitcherList.h (95%) rename {fsfwconfig => linux/fsfwconfig}/devices/spi.h (100%) rename {fsfwconfig => linux/fsfwconfig}/events/subsystemIdRanges.h (100%) rename {fsfwconfig => linux/fsfwconfig}/events/translateEvents.cpp (100%) rename {fsfwconfig => linux/fsfwconfig}/events/translateEvents.h (100%) rename {fsfwconfig => linux/fsfwconfig}/fsfwconfig.mk (100%) create mode 100644 linux/fsfwconfig/ipc/MissionMessageTypes.cpp rename {fsfwconfig => linux/fsfwconfig}/ipc/MissionMessageTypes.h (100%) rename {fsfwconfig => linux/fsfwconfig}/objects/systemObjectList.h (100%) rename {fsfwconfig => linux/fsfwconfig}/objects/translateObjects.cpp (99%) rename {fsfwconfig => linux/fsfwconfig}/objects/translateObjects.h (100%) rename {fsfwconfig => linux/fsfwconfig}/pollingsequence/pollingSequenceFactory.cpp (99%) rename {fsfwconfig => linux/fsfwconfig}/pollingsequence/pollingSequenceFactory.h (100%) rename {fsfwconfig => linux/fsfwconfig}/returnvalues/classIds.h (100%) rename {fsfwconfig => linux/fsfwconfig}/tmtc/apid.h (100%) rename {fsfwconfig => linux/fsfwconfig}/tmtc/pusIds.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index c799f927..f0887e25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,8 +72,7 @@ if(TGT_BSP) if(${TGT_BSP} MATCHES "arm/q7s" OR ${TGT_BSP} MATCHES "arm/raspberrypi" OR ${TGT_BSP} MATCHES "arm/beagleboneblack" ) - set(ROOT_CONFIG_FOLDER TRUE) - set(FSFW_CONFIG_PATH "fsfwconfig") + set(FSFW_CONFIG_PATH "linux/fsfwconfig") set(ADD_LINUX_FILES TRUE) set(ADD_CSP_LIB TRUE) set(FSFW_HAL_ADD_LINUX ON) @@ -108,11 +107,6 @@ set(LWGPS_CONFIG_PATH "${COMMON_PATH}/config") # Add executable add_executable(${TARGET_NAME}) -# Add subdirectories -if(ROOT_CONFIG_FOLDER) - add_subdirectory(${FSFW_CONFIG_PATH}) -endif() - if(ADD_CSP_LIB) add_subdirectory(${CSP_LIB_PATH}) endif() diff --git a/bsp_q7s/InitMission.cpp b/bsp_q7s/InitMission.cpp index 797c5e71..ce385037 100644 --- a/bsp_q7s/InitMission.cpp +++ b/bsp_q7s/InitMission.cpp @@ -1,6 +1,7 @@ #include "InitMission.h" #include "ObjectFactory.h" -#include +#include "OBSWConfig.h" +#include "pollingsequence/pollingSequenceFactory.h" #include @@ -11,7 +12,7 @@ #include #include #include -#include + #include /* This is configured for linux without CR */ diff --git a/fsfwconfig/ipc/MissionMessageTypes.cpp b/fsfwconfig/ipc/MissionMessageTypes.cpp deleted file mode 100644 index 8536245f..00000000 --- a/fsfwconfig/ipc/MissionMessageTypes.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -void messagetypes::clearMissionMessage(CommandMessage* message) { -// switch(message->getMessageType()) { -// default: -// break; -// } -} - - diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py index bed2c6fd..c04f5dfc 100644 --- a/generators/events/event_parser.py +++ b/generators/events/event_parser.py @@ -41,7 +41,7 @@ BSP_SELECT = BspType.BSP_Q7S BSP_DIR_NAME = BSP_SELECT.value if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: - FSFW_CONFIG_ROOT = f"../../fsfwconfig" + FSFW_CONFIG_ROOT = f"../../linux/fsfwconfig" else: FSFW_CONFIG_ROOT = f"../../{BSP_DIR_NAME}/fsfwconfig" diff --git a/generators/mib_objects.csv b/generators/mib_objects.csv index 5c0bc321..3e3e8cb6 100644 --- a/generators/mib_objects.csv +++ b/generators/mib_objects.csv @@ -1,6 +1,13 @@ -0x42694269;TEST_TASK -0x4400AFFE;DUMMY_HANDLER +0x00005060;P60DOCK_TEST_TASK +0x44001000;PCDU_HANDLER +0x44001001;SOLAR_ARRAY_DEPL_HANDLER +0x44001002;SYRLINKS_HK_HANDLER +0x47000001;GPIO_IF 0x49000001;ARDUINO_COM_IF +0x49000002;CSP_COM_IF +0x49000003;I2C_COM_IF +0x49000004;UART_COM_IF +0x49000005;SPI_COM_IF 0x51000300;PUS_SERVICE_3 0x51000400;PUS_SERVICE_5 0x51000500;PUS_SERVICE_6 @@ -27,5 +34,27 @@ 0x534f0300;IPC_STORE 0x53500010;TIME_STAMPER 0x53ffffff;FSFW_OBJECTS_END -0xCAFECAFE;DUMMY_INTERFACE +0x54000003;HEATER_HANDLER +0x54000004;RTD_IC3 +0x54000005;RTD_IC4 +0x54000006;RTD_IC5 +0x54000007;RTD_IC6 +0x54000008;RTD_IC7 +0x54000009;RTD_IC8 +0x5400000A;RTD_IC9 +0x5400000B;RTD_IC10 +0x5400000C;RTD_IC11 +0x5400000D;RTD_IC12 +0x5400000E;RTD_IC13 +0x5400000F;RTD_IC14 +0x54000010;SPI_TEST +0x5400001F;RTD_IC15 +0x5400002F;RTD_IC16 +0x5400003F;RTD_IC17 +0x5400004F;RTD_IC18 +0x54000050;RAD_SENSOR +0x5400AFFE;DUMMY_HANDLER +0x5400CAFE;DUMMY_INTERFACE +0x54123456;LIBGPIOD_TEST +0x54694269;TEST_TASK 0xFFFFFFFF;NO_OBJECT diff --git a/generators/objects/objects.py b/generators/objects/objects.py index 966957e5..8709fe22 100644 --- a/generators/objects/objects.py +++ b/generators/objects/objects.py @@ -32,25 +32,23 @@ GENERATE_HEADER = True BSP_SELECT = BspType.BSP_Q7S BSP_DIR_NAME = BSP_SELECT.value +if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: + FSFW_CONFIG_ROOT = f"../../linux/fsfwconfig" + +else: + FSFW_CONFIG_ROOT = f"../../{BSP_DIR_NAME}/fsfwconfig" EXPORT_TO_SQL = True -if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: - CPP_COPY_DESTINATION = f"../../fsfwconfig/objects/" -else: - CPP_COPY_DESTINATION = f"../../{BSP_DIR_NAME}/fsfwconfig/objects/" - +CPP_COPY_DESTINATION = f"{FSFW_CONFIG_ROOT}/objects/" CSV_MOVE_DESTINATION = "../" CPP_FILENAME = "translateObjects.cpp" CPP_H_FILENAME = "translateObjects.h" CSV_OBJECT_FILENAME = "mib_objects.csv" FILE_SEPARATOR = ";" -if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: - SUBSYSTEM_DEFINITION_DESTINATION = f"../../fsfwconfig/objects/systemObjectList.h" -else: - SUBSYSTEM_DEFINITION_DESTINATION = f"../../{BSP_DIR_NAME}/fsfwconfig/objects/systemObjectList.h" +SUBSYSTEM_DEFINITION_DESTINATION = f"{FSFW_CONFIG_ROOT}/objects/systemObjectList.h" FRAMEWORK_SUBSYSTEM_DEFINITION_DESTINATION = "../../fsfw/objectmanager/frameworkObjects.h" OBJECTS_DEFINITIONS = [SUBSYSTEM_DEFINITION_DESTINATION, FRAMEWORK_SUBSYSTEM_DEFINITION_DESTINATION] diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 9aac2b47..9bdb173f 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,14 +1,21 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 31 translations. - * Generated on: 2021-05-17 19:12:49 + * Contains 60 translations. + * Generated on: 2021-05-17 19:57:25 */ #include "translateObjects.h" -const char *TEST_TASK_STRING = "TEST_TASK"; -const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; +const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; +const char *PCDU_HANDLER_STRING = "PCDU_HANDLER"; +const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER"; +const char *SYRLINKS_HK_HANDLER_STRING = "SYRLINKS_HK_HANDLER"; +const char *GPIO_IF_STRING = "GPIO_IF"; const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF"; +const char *CSP_COM_IF_STRING = "CSP_COM_IF"; +const char *I2C_COM_IF_STRING = "I2C_COM_IF"; +const char *UART_COM_IF_STRING = "UART_COM_IF"; +const char *SPI_COM_IF_STRING = "SPI_COM_IF"; const char *PUS_SERVICE_3_STRING = "PUS_SERVICE_3"; const char *PUS_SERVICE_5_STRING = "PUS_SERVICE_5"; const char *PUS_SERVICE_6_STRING = "PUS_SERVICE_6"; @@ -35,17 +42,53 @@ const char *TM_STORE_STRING = "TM_STORE"; const char *IPC_STORE_STRING = "IPC_STORE"; const char *TIME_STAMPER_STRING = "TIME_STAMPER"; const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; +const char *HEATER_HANDLER_STRING = "HEATER_HANDLER"; +const char *RTD_IC3_STRING = "RTD_IC3"; +const char *RTD_IC4_STRING = "RTD_IC4"; +const char *RTD_IC5_STRING = "RTD_IC5"; +const char *RTD_IC6_STRING = "RTD_IC6"; +const char *RTD_IC7_STRING = "RTD_IC7"; +const char *RTD_IC8_STRING = "RTD_IC8"; +const char *RTD_IC9_STRING = "RTD_IC9"; +const char *RTD_IC10_STRING = "RTD_IC10"; +const char *RTD_IC11_STRING = "RTD_IC11"; +const char *RTD_IC12_STRING = "RTD_IC12"; +const char *RTD_IC13_STRING = "RTD_IC13"; +const char *RTD_IC14_STRING = "RTD_IC14"; +const char *SPI_TEST_STRING = "SPI_TEST"; +const char *RTD_IC15_STRING = "RTD_IC15"; +const char *RTD_IC16_STRING = "RTD_IC16"; +const char *RTD_IC17_STRING = "RTD_IC17"; +const char *RTD_IC18_STRING = "RTD_IC18"; +const char *RAD_SENSOR_STRING = "RAD_SENSOR"; +const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; +const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST"; +const char *TEST_TASK_STRING = "TEST_TASK"; const char *NO_OBJECT_STRING = "NO_OBJECT"; const char* translateObject(object_id_t object) { switch( (object & 0xFFFFFFFF) ) { - case 0x42694269: - return TEST_TASK_STRING; - case 0x4400AFFE: - return DUMMY_HANDLER_STRING; + case 0x00005060: + return P60DOCK_TEST_TASK_STRING; + case 0x44001000: + return PCDU_HANDLER_STRING; + case 0x44001001: + return SOLAR_ARRAY_DEPL_HANDLER_STRING; + case 0x44001002: + return SYRLINKS_HK_HANDLER_STRING; + case 0x47000001: + return GPIO_IF_STRING; case 0x49000001: return ARDUINO_COM_IF_STRING; + case 0x49000002: + return CSP_COM_IF_STRING; + case 0x49000003: + return I2C_COM_IF_STRING; + case 0x49000004: + return UART_COM_IF_STRING; + case 0x49000005: + return SPI_COM_IF_STRING; case 0x51000300: return PUS_SERVICE_3_STRING; case 0x51000400: @@ -98,8 +141,52 @@ const char* translateObject(object_id_t object) { return TIME_STAMPER_STRING; case 0x53ffffff: return FSFW_OBJECTS_END_STRING; - case 0xCAFECAFE: + case 0x54000003: + return HEATER_HANDLER_STRING; + case 0x54000004: + return RTD_IC3_STRING; + case 0x54000005: + return RTD_IC4_STRING; + case 0x54000006: + return RTD_IC5_STRING; + case 0x54000007: + return RTD_IC6_STRING; + case 0x54000008: + return RTD_IC7_STRING; + case 0x54000009: + return RTD_IC8_STRING; + case 0x5400000A: + return RTD_IC9_STRING; + case 0x5400000B: + return RTD_IC10_STRING; + case 0x5400000C: + return RTD_IC11_STRING; + case 0x5400000D: + return RTD_IC12_STRING; + case 0x5400000E: + return RTD_IC13_STRING; + case 0x5400000F: + return RTD_IC14_STRING; + case 0x54000010: + return SPI_TEST_STRING; + case 0x5400001F: + return RTD_IC15_STRING; + case 0x5400002F: + return RTD_IC16_STRING; + case 0x5400003F: + return RTD_IC17_STRING; + case 0x5400004F: + return RTD_IC18_STRING; + case 0x54000050: + return RAD_SENSOR_STRING; + case 0x5400AFFE: + return DUMMY_HANDLER_STRING; + case 0x5400CAFE: return DUMMY_INTERFACE_STRING; + case 0x54123456: + return LIBGPIOD_TEST_STRING; + case 0x54694269: + return TEST_TASK_STRING; case 0xFFFFFFFF: return NO_OBJECT_STRING; default: diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 1e00391b..a078035a 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -3,3 +3,4 @@ add_subdirectory(uart) add_subdirectory(utility) add_subdirectory(boardtest) add_subdirectory(devices) +add_subdirectory(fsfwconfig) \ No newline at end of file diff --git a/linux/boardtest/LibgpiodTest.cpp b/linux/boardtest/LibgpiodTest.cpp index d085671a..3aa9c22a 100644 --- a/linux/boardtest/LibgpiodTest.cpp +++ b/linux/boardtest/LibgpiodTest.cpp @@ -1,6 +1,7 @@ #include "LibgpiodTest.h" -#include +#include "devices/gpioIds.h" + #include #include #include diff --git a/linux/boardtest/SpiTestClass.cpp b/linux/boardtest/SpiTestClass.cpp index 387c7eb5..4fc52f29 100644 --- a/linux/boardtest/SpiTestClass.cpp +++ b/linux/boardtest/SpiTestClass.cpp @@ -1,6 +1,6 @@ #include "SpiTestClass.h" -#include +#include "devices/gpioIds.h" #include #include diff --git a/linux/devices/HeaterHandler.h b/linux/devices/HeaterHandler.h index 8969ebd9..678710df 100644 --- a/linux/devices/HeaterHandler.h +++ b/linux/devices/HeaterHandler.h @@ -1,12 +1,13 @@ #ifndef MISSION_DEVICES_HEATERHANDLER_H_ #define MISSION_DEVICES_HEATERHANDLER_H_ +#include "devices/heaterSwitcherList.h" + #include #include #include #include #include -#include #include #include #include diff --git a/fsfwconfig/CMakeLists.txt b/linux/fsfwconfig/CMakeLists.txt similarity index 100% rename from fsfwconfig/CMakeLists.txt rename to linux/fsfwconfig/CMakeLists.txt diff --git a/fsfwconfig/FSFWConfig.h b/linux/fsfwconfig/FSFWConfig.h similarity index 100% rename from fsfwconfig/FSFWConfig.h rename to linux/fsfwconfig/FSFWConfig.h diff --git a/fsfwconfig/OBSWConfig.h b/linux/fsfwconfig/OBSWConfig.h similarity index 100% rename from fsfwconfig/OBSWConfig.h rename to linux/fsfwconfig/OBSWConfig.h diff --git a/fsfwconfig/devices/addresses.cpp b/linux/fsfwconfig/devices/addresses.cpp similarity index 100% rename from fsfwconfig/devices/addresses.cpp rename to linux/fsfwconfig/devices/addresses.cpp diff --git a/fsfwconfig/devices/addresses.h b/linux/fsfwconfig/devices/addresses.h similarity index 92% rename from fsfwconfig/devices/addresses.h rename to linux/fsfwconfig/devices/addresses.h index 3de3a105..0deb8490 100644 --- a/fsfwconfig/devices/addresses.h +++ b/linux/fsfwconfig/devices/addresses.h @@ -2,7 +2,7 @@ #define FSFWCONFIG_DEVICES_ADDRESSES_H_ #include -#include +#include "objects/systemObjectList.h" #include namespace addresses { diff --git a/fsfwconfig/devices/gpioIds.h b/linux/fsfwconfig/devices/gpioIds.h similarity index 100% rename from fsfwconfig/devices/gpioIds.h rename to linux/fsfwconfig/devices/gpioIds.h diff --git a/fsfwconfig/devices/heaterSwitcherList.h b/linux/fsfwconfig/devices/heaterSwitcherList.h similarity index 94% rename from fsfwconfig/devices/heaterSwitcherList.h rename to linux/fsfwconfig/devices/heaterSwitcherList.h index eeb59068..014e795c 100644 --- a/fsfwconfig/devices/heaterSwitcherList.h +++ b/linux/fsfwconfig/devices/heaterSwitcherList.h @@ -1,6 +1,8 @@ #ifndef FSFWCONFIG_DEVICES_HEATERSWITCHERLIST_H_ #define FSFWCONFIG_DEVICES_HEATERSWITCHERLIST_H_ +#include + namespace heaterSwitches { enum switcherList: uint8_t { HEATER_0, @@ -15,6 +17,4 @@ namespace heaterSwitches { }; } - - #endif /* FSFWCONFIG_DEVICES_HEATERSWITCHERLIST_H_ */ diff --git a/fsfwconfig/devices/powerSwitcherList.h b/linux/fsfwconfig/devices/powerSwitcherList.h similarity index 95% rename from fsfwconfig/devices/powerSwitcherList.h rename to linux/fsfwconfig/devices/powerSwitcherList.h index b8e3f89f..48821db2 100644 --- a/fsfwconfig/devices/powerSwitcherList.h +++ b/linux/fsfwconfig/devices/powerSwitcherList.h @@ -1,7 +1,7 @@ #ifndef FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ #define FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ -#include +#include "OBSWConfig.h" namespace pcduSwitches { /* Switches are uint8_t datatype and go from 0 to 255 */ diff --git a/fsfwconfig/devices/spi.h b/linux/fsfwconfig/devices/spi.h similarity index 100% rename from fsfwconfig/devices/spi.h rename to linux/fsfwconfig/devices/spi.h diff --git a/fsfwconfig/events/subsystemIdRanges.h b/linux/fsfwconfig/events/subsystemIdRanges.h similarity index 100% rename from fsfwconfig/events/subsystemIdRanges.h rename to linux/fsfwconfig/events/subsystemIdRanges.h diff --git a/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp similarity index 100% rename from fsfwconfig/events/translateEvents.cpp rename to linux/fsfwconfig/events/translateEvents.cpp diff --git a/fsfwconfig/events/translateEvents.h b/linux/fsfwconfig/events/translateEvents.h similarity index 100% rename from fsfwconfig/events/translateEvents.h rename to linux/fsfwconfig/events/translateEvents.h diff --git a/fsfwconfig/fsfwconfig.mk b/linux/fsfwconfig/fsfwconfig.mk similarity index 100% rename from fsfwconfig/fsfwconfig.mk rename to linux/fsfwconfig/fsfwconfig.mk diff --git a/linux/fsfwconfig/ipc/MissionMessageTypes.cpp b/linux/fsfwconfig/ipc/MissionMessageTypes.cpp new file mode 100644 index 00000000..9ac6f0f4 --- /dev/null +++ b/linux/fsfwconfig/ipc/MissionMessageTypes.cpp @@ -0,0 +1,12 @@ +#include "MissionMessageTypes.h" +#include + + +void messagetypes::clearMissionMessage(CommandMessage* message) { + switch(message->getMessageType()) { + default: + break; + } +} + + diff --git a/fsfwconfig/ipc/MissionMessageTypes.h b/linux/fsfwconfig/ipc/MissionMessageTypes.h similarity index 100% rename from fsfwconfig/ipc/MissionMessageTypes.h rename to linux/fsfwconfig/ipc/MissionMessageTypes.h diff --git a/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h similarity index 100% rename from fsfwconfig/objects/systemObjectList.h rename to linux/fsfwconfig/objects/systemObjectList.h diff --git a/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp similarity index 99% rename from fsfwconfig/objects/translateObjects.cpp rename to linux/fsfwconfig/objects/translateObjects.cpp index 9eccd0b7..9bdb173f 100644 --- a/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 60 translations. - * Generated on: 2021-05-17 19:11:51 + * Generated on: 2021-05-17 19:57:25 */ #include "translateObjects.h" diff --git a/fsfwconfig/objects/translateObjects.h b/linux/fsfwconfig/objects/translateObjects.h similarity index 100% rename from fsfwconfig/objects/translateObjects.h rename to linux/fsfwconfig/objects/translateObjects.h diff --git a/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp similarity index 99% rename from fsfwconfig/pollingsequence/pollingSequenceFactory.cpp rename to linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 578b0c44..a8c7312b 100644 --- a/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include "objects/systemObjectList.h" ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence) diff --git a/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h similarity index 100% rename from fsfwconfig/pollingsequence/pollingSequenceFactory.h rename to linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h diff --git a/fsfwconfig/returnvalues/classIds.h b/linux/fsfwconfig/returnvalues/classIds.h similarity index 100% rename from fsfwconfig/returnvalues/classIds.h rename to linux/fsfwconfig/returnvalues/classIds.h diff --git a/fsfwconfig/tmtc/apid.h b/linux/fsfwconfig/tmtc/apid.h similarity index 100% rename from fsfwconfig/tmtc/apid.h rename to linux/fsfwconfig/tmtc/apid.h diff --git a/fsfwconfig/tmtc/pusIds.h b/linux/fsfwconfig/tmtc/pusIds.h similarity index 100% rename from fsfwconfig/tmtc/pusIds.h rename to linux/fsfwconfig/tmtc/pusIds.h diff --git a/mission/devices/devicedefinitions/Max31865Definitions.h b/mission/devices/devicedefinitions/Max31865Definitions.h index d21f41e4..bdf82dc8 100644 --- a/mission/devices/devicedefinitions/Max31865Definitions.h +++ b/mission/devices/devicedefinitions/Max31865Definitions.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include "objects/systemObjectList.h" namespace Max31865Definitions {