-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
137 lines (125 loc) · 4.44 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
from pathlib import Path
import c2a_generator
import importlib.metadata
C2A_GENERATOR_VERSION = "0.1.7"
assert (
importlib.metadata.version("c2a_generator") == C2A_GENERATOR_VERSION
), "Please run 'rye sync'"
root_path = (
Path(__file__).parent.parent / "sils-docker/sils/FlightSW/c2a-mobc-onglaisat"
)
# eh
c2a_generator.eh_rules_h.generate(
root_path / "design/eh.csv",
root_path / "src/src_user/Settings/System/EventHandlerRules/event_handler_rules.h",
base_id=9,
)
c2a_generator.eh_rules_c.generate(
root_path / "design/eh.csv",
root_path / "src/src_user/Settings/System/EventHandlerRules/event_handler_rules.c",
eh_header="""
#include "event_handler_rules.h"
#include <src_core/System/EventManager/event_handler.h>
#include "../../../TlmCmd/block_command_definitions.h"
#include "../../../TlmCmd/block_command_definitions.h"
#include "../../../IfWrapper/uart_user.h"
""",
)
# cmd
c2a_generator.cmd_def_c.generate(
root_path / "design/cmd.csv",
root_path / "src/src_user/TlmCmd/command_definitions.c",
)
c2a_generator.cmd_def_h.generate(
root_path / "design/cmd.csv",
root_path / "src/src_user/TlmCmd/command_definitions.h",
)
c2a_generator.cmd_csv.generate(
root_path / "design/cmd.csv",
root_path / "database/CMD_DB/ISSL6U_MOBC_CMD_DB_CMD_DB.csv",
)
# bct
# MRAM 一重領域: 1142 - 1269
# MRAM 三重領域: 1270 - 1279
# BCT MAX : 1280
bct_src = [
[
root_path / "design/bct/bc_sequence_list.csv",
0,
], # Block Cmds for Mode Transition (シーケンスリスト), ./src_user/Settings/Modes/Transitions/ で定義
[
root_path / "design/bct/bc_task_list.csv",
None,
], # Block Cmds for TaskList (タスクリスト), ./src_user/Settings/Modes/TaskLists/ で定義
[root_path / "design/bct/bc_app_router.csv", None],
[root_path / "design/bct/bc_app_combinator.csv", None],
[root_path / "design/bct/bc_cdh.csv", None],
[root_path / "design/bct/bc_comm.csv", None],
[root_path / "design/bct/bc_power.csv", None],
[root_path / "design/bct/bc_mif.csv", None],
[root_path / "design/bct/bc_thermal.csv", None],
[root_path / "design/bct/bc_mram.csv", 1142],
[root_path / "design/bct/bc_mram_triple.csv", 1270],
]
bc_header_header = """
#include <src_core/TlmCmd/block_command_table.h>
#include <src_core/TlmCmd/block_command_loader.h>
#include <src_core/TlmCmd/common_tlm_packet.h>
#include <src_core/TlmCmd/common_cmd_packet.h>
#include <src_core/System/TimeManager/obc_time.h>
#include <src_core/System/TimeManager/time_manager.h>
#include <src_core/System/EventManager/event_logger.h>
#include <src_core/Applications/timeline_command_dispatcher_id_define.h>
#include "../block_command_definitions.h"
#include "../telemetry_definitions.h"
#include "../command_definitions.h"
#include "../../Settings/Modes/mode_definitions.h"
#include "../../Settings/System/EventHandlerRules/event_handler_rules.h"
#include "../../Settings/port_config.h"
#include "../../Drivers/Aocs/aobc_command_definitions.h"
#include "../../Drivers/Thermal/tobc_command_definitions.h"
#include "../../Drivers/Mission/mif_command_definitions.h"
#include "../../Drivers/Mission/mif_telemetry_definitions.h"
#define EL_LOG_DR_PARTITION (7)
#define TL_TLM_DR_PARTITION (8)
"""[1:]
c2a_generator.bct_def_c.generate(
bct_src,
root_path / "src/src_user/TlmCmd/block_command_definitions.c",
bc_header_header,
)
c2a_generator.bct_def_h.generate(
bct_src, root_path / "src/src_user/TlmCmd/block_command_definitions.h"
)
c2a_generator.bct_csv.generate(
bct_src, root_path / "database/CMD_DB/ISSL6U_MOBC_CMD_DB_BCT.csv"
)
# tlm
tlm_path = root_path / "design/tlm"
c2a_generator.tlm_def_h.generate(
tlm_path, root_path / "src/src_user/TlmCmd/telemetry_definitions.h"
)
c2a_generator.tlm_def_c.generate(
tlm_path, root_path / "src/src_user/TlmCmd/telemetry_definitions.c"
)
c2a_generator.tlm_csv.generate(
tlm_path, root_path / "database/TLM_DB", prefix="ISSL6U_MOBC_TLM_DB_"
)
# wings
c2a_generator.wings_json.generate(
bct_src,
root_path
/ "../../../wings/aspnetapp/WINGS/ClientApp/src/assets/alias/c2a_onglai.json",
el_src=root_path / "design/el.csv",
cmd_src=root_path / "design/cmd.csv",
eh_src=root_path / "design/eh.csv",
eh_base_id=9,
)
c2a_generator.wings_json.generate(
bct_src,
root_path / "database/c2a_onglai.json",
el_src=root_path / "design/el.csv",
cmd_src=root_path / "design/cmd.csv",
eh_src=root_path / "design/eh.csv",
eh_base_id=9,
)