Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
source
OBSW MOD GENERATOR CORE
Commits
002cb5cb
Unverified
Commit
002cb5cb
authored
May 17, 2021
by
Robin Mueller
Browse files
added function to generate header file
parent
af383e7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
objects/objects.py
View file @
002cb5cb
...
...
@@ -31,7 +31,7 @@ def export_object_file(filename, object_list, file_separator: str = ","):
file
.
close
()
def
write_translation_file
(
filename
,
list_of_entries
,
date_string_full
:
str
):
def
write_translation_file
(
filename
:
str
,
list_of_entries
,
date_string_full
:
str
):
outputfile
=
open
(
filename
,
"w"
)
print
(
'ObjectParser: Writing translation file '
+
filename
)
definitions
=
""
...
...
@@ -51,6 +51,17 @@ def write_translation_file(filename, list_of_entries, date_string_full: str):
outputfile
.
close
()
def
write_translation_header_file
(
filename
:
str
=
"translateObjects.h"
):
file
=
open
(
filename
,
"w"
)
file
.
write
(
f
"#ifndef FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_
\n
"
f
"#define FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_
\n\n
"
f
"#include <fsfw/objectmanager/SystemObjectIF.h>
\n\n
"
f
"const char * translateObject(object_id_t object);
\n\n
"
f
"#endif /* FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ */
\n
"
)
def
sql_object_exporter
(
object_table
:
list
,
delete_cmd
:
str
,
create_cmd
:
str
,
insert_cmd
:
str
,
sql_table
:
str
):
sql_writer
=
SqlWriter
(
sql_table
)
sql_writer
.
delete
(
delete_cmd
)
...
...
@@ -60,4 +71,4 @@ def sql_object_exporter(object_table: list, delete_cmd: str, create_cmd: str, in
insert_cmd
,
(
entry
[
0
],
entry
[
1
][
0
])
)
sql_writer
.
commit
()
sql_writer
.
close
()
\ No newline at end of file
sql_writer
.
close
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment