From 17d187d4b0c57e4263f384cbe72a96d387e2a8a5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 19:12:25 +0200 Subject: [PATCH] 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