fmu-manipulation-toolbox 1.9.2b4__tar.gz → 1.9.2rc2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/PKG-INFO +1 -1
- fmu_manipulation_toolbox-1.9.2rc2/fmu_manipulation_toolbox/__version__.py +1 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/cli/datalog2pcap.py +34 -4
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/container.py +56 -17
- fmu_manipulation_toolbox-1.9.2rc2/fmu_manipulation_toolbox/gui/__init__.py +0 -0
- fmu_manipulation_toolbox-1.9.2rc2/fmu_manipulation_toolbox/gui/gui.py +749 -0
- fmu_manipulation_toolbox-1.9.2rc2/fmu_manipulation_toolbox/gui/gui_style.py +252 -0
- fmu_manipulation_toolbox-1.9.2rc2/fmu_manipulation_toolbox/resources/darwin64/container.dylib +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/linux32/client_sm.so +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/linux64/client_sm.so +0 -0
- fmu_manipulation_toolbox-1.9.2rc2/fmu_manipulation_toolbox/resources/linux64/container.so +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/win32/client_sm.dll +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/win32/server_sm.exe +0 -0
- fmu_manipulation_toolbox-1.9.2rc2/fmu_manipulation_toolbox/resources/win64/client_sm.dll +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/win64/container.dll +0 -0
- fmu_manipulation_toolbox-1.9.2rc2/fmu_manipulation_toolbox/resources/win64/server_sm.exe +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox.egg-info/PKG-INFO +1 -1
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox.egg-info/SOURCES.txt +3 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/setup.py +1 -1
- fmu_manipulation_toolbox-1.9.2b4/fmu_manipulation_toolbox/__version__.py +0 -1
- fmu_manipulation_toolbox-1.9.2b4/fmu_manipulation_toolbox/resources/darwin64/container.dylib +0 -0
- fmu_manipulation_toolbox-1.9.2b4/fmu_manipulation_toolbox/resources/linux64/container.so +0 -0
- fmu_manipulation_toolbox-1.9.2b4/fmu_manipulation_toolbox/resources/win64/client_sm.dll +0 -0
- fmu_manipulation_toolbox-1.9.2b4/fmu_manipulation_toolbox/resources/win64/server_sm.exe +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/LICENSE.txt +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/README.md +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/__init__.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/__main__.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/assembly.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/checker.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/cli/__init__.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/cli/fmucontainer.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/cli/fmusplit.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/cli/fmutool.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/cli/utils.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/help.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/ls.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/operations.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/remoting.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/checkbox-checked-disabled.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/checkbox-checked-hover.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/checkbox-checked.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/checkbox-unchecked-disabled.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/checkbox-unchecked-hover.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/checkbox-unchecked.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/container.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/drop_fmu.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Annotation.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2AttributeGroups.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2ModelDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2ScalarVariable.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Type.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Unit.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2VariableDependency.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Annotation.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3AttributeGroups.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3BuildDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3InterfaceType.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3LayeredStandardManifest.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3ModelDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Terminal.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3TerminalsAndIcons.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Type.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Unit.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Variable.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3VariableDependency.xsd +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmu.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/fmu_manipulation_toolbox.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/help.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/icon-round.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/icon.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/icon_fmu.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/license.txt +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/linux32/server_sm +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/linux64/server_sm +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/mask.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/resources/model.png +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/split.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/terminals.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox/version.py +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox.egg-info/dependency_links.txt +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox.egg-info/entry_points.txt +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox.egg-info/requires.txt +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/fmu_manipulation_toolbox.egg-info/top_level.txt +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/setup.cfg +0 -0
- {fmu_manipulation_toolbox-1.9.2b4 → fmu_manipulation_toolbox-1.9.2rc2}/tests/test_suite.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmu_manipulation_toolbox
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.2rc2
|
|
4
4
|
Summary: FMU Manipulation Toolbox is a python package which helps to analyze, modify or combine Functional Mock-up Units (FMUs) without recompilation.
|
|
5
5
|
Home-page: https://github.com/grouperenault/fmu_manipulation_toolbox/
|
|
6
6
|
Author: Nicolas.LAURENT@Renault.com
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'V1.9.2rc2'
|
|
@@ -15,6 +15,20 @@ class DatalogConverter:
|
|
|
15
15
|
def __init__(self, cvs_filename: Union[Path, str]):
|
|
16
16
|
self.csv_filename = Path(cvs_filename)
|
|
17
17
|
self.pcap_filename = self.csv_filename.with_suffix(".pcap")
|
|
18
|
+
self.opcode_name = {
|
|
19
|
+
"CAN": {
|
|
20
|
+
0x0001: "FMI3_LS_BUS_OP_FORMAT_ERROR",
|
|
21
|
+
0x0010: "FMI3_LS_BUS_CAN_OP_CAN_TRANSMIT",
|
|
22
|
+
0x0011: "FMI3_LS_BUS_CAN_OP_CANFD_TRANSMIT",
|
|
23
|
+
0x0012: "FMI3_LS_BUS_CAN_OP_CANXL_TRANSMIT",
|
|
24
|
+
0x0020: "FMI3_LS_BUS_CAN_OP_CONFIRM",
|
|
25
|
+
0x0030: "FMI3_LS_BUS_CAN_OP_ARBITRATION_LOST",
|
|
26
|
+
0x0031: "FMI3_LS_BUS_CAN_OP_BUS_ERROR",
|
|
27
|
+
0x0040: "FMI3_LS_BUS_CAN_OP_CONFIGURATION",
|
|
28
|
+
0x0041: "FMI3_LS_BUS_CAN_OP_STATUS",
|
|
29
|
+
0x0042: "FMI3_LS_BUS_CAN_OP_WAKEUP"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
18
32
|
|
|
19
33
|
def open_pcap(self):
|
|
20
34
|
logger.info(f"Creating PCAP file '{self.pcap_filename}'...")
|
|
@@ -31,7 +45,10 @@ class DatalogConverter:
|
|
|
31
45
|
# captured from each packet.
|
|
32
46
|
|
|
33
47
|
file.write(int(227).to_bytes(4, byteorder="big")) # link type. his field is defined in the Section
|
|
34
|
-
#
|
|
48
|
+
# 8.1 IANA registry.
|
|
49
|
+
# 190: Reserved for Controller Area Network (CAN) v. 2.0B packets
|
|
50
|
+
# 210: Reserved for FlexRay automotive bus
|
|
51
|
+
# 227: CAN (Controller Area Network) frames, with a pseudo-header followed by the frame payload.
|
|
35
52
|
return file
|
|
36
53
|
|
|
37
54
|
def open_csv(self):
|
|
@@ -42,15 +59,21 @@ class DatalogConverter:
|
|
|
42
59
|
def decode_hexstring(self, hex_string: bytes, time_s, time_us):
|
|
43
60
|
opcode = int.from_bytes(hex_string[0:4], byteorder="little")
|
|
44
61
|
length = int.from_bytes(hex_string[4:8], byteorder="little")
|
|
45
|
-
|
|
62
|
+
|
|
46
63
|
if opcode == 0x10: # TRANSMIT
|
|
64
|
+
can_id = int.from_bytes(hex_string[8:12], byteorder="little")
|
|
47
65
|
rtr = int.from_bytes(hex_string[13:14], byteorder="little")
|
|
48
66
|
ide = int.from_bytes(hex_string[12:13], byteorder="little")
|
|
49
67
|
data_length = int.from_bytes(hex_string[14:16], byteorder="little")
|
|
50
68
|
raw_data = hex_string[16:]
|
|
51
69
|
|
|
70
|
+
raw_str = ""
|
|
71
|
+
for i, b in enumerate(raw_data):
|
|
72
|
+
raw_str += f"{i}:{b:d} "
|
|
73
|
+
logger.info(f"time={time_s}.{time_us:06d} data length {data_length} with data {raw_str}")
|
|
74
|
+
|
|
52
75
|
logger.debug(f"time={time_s}.{time_us:06d} OP=0x{opcode:04X} len={length} {data_length} id={can_id}"
|
|
53
|
-
f" ide={ide} rtr={rtr} len={data_length} {raw_data}")
|
|
76
|
+
f" ide={ide} rtr={rtr} len={data_length} raw_len={len(raw_data)} {raw_str}")
|
|
54
77
|
|
|
55
78
|
# TimeStamp
|
|
56
79
|
self.pcapfile.write(time_s.to_bytes(4, byteorder="big"))
|
|
@@ -76,7 +99,14 @@ class DatalogConverter:
|
|
|
76
99
|
self.pcapfile.write(dlc.to_bytes(1, byteorder="big"))
|
|
77
100
|
|
|
78
101
|
# PAYLOAD
|
|
79
|
-
self.pcapfile.write(raw_data)
|
|
102
|
+
self.pcapfile.write(raw_data[0:data_length])
|
|
103
|
+
|
|
104
|
+
elif opcode == 0x40:
|
|
105
|
+
parameter = int.from_bytes(hex_string[8:9], byteorder="little")
|
|
106
|
+
logger.debug(f"Config parameter: {parameter}")
|
|
107
|
+
if (parameter == 1):
|
|
108
|
+
baudrate = int.from_bytes(hex_string[9:13], byteorder="little")
|
|
109
|
+
logger.debug(f"baudrate parameter: {baudrate}")
|
|
80
110
|
|
|
81
111
|
def convert(self):
|
|
82
112
|
with self.open_csv() as self.csvfile, self.open_pcap() as self.pcapfile:
|
|
@@ -196,6 +196,7 @@ class EmbeddedFMU(OperationAbstract):
|
|
|
196
196
|
self.model_identifier = None
|
|
197
197
|
self.guid = None
|
|
198
198
|
self.fmi_version = None
|
|
199
|
+
self.platforms = set()
|
|
199
200
|
self.ports: Dict[str, EmbeddedFMUPort] = {}
|
|
200
201
|
|
|
201
202
|
self.has_event_mode = False
|
|
@@ -240,6 +241,22 @@ class EmbeddedFMU(OperationAbstract):
|
|
|
240
241
|
port = EmbeddedFMUPort(fmu_port.fmi_type, fmu_port, fmi_version=self.fmi_version)
|
|
241
242
|
self.ports[port.name] = port
|
|
242
243
|
|
|
244
|
+
def closure(self):
|
|
245
|
+
osname = {
|
|
246
|
+
"win64": "Windows",
|
|
247
|
+
"linux64": "Linux",
|
|
248
|
+
"darwin64": "Darwin",
|
|
249
|
+
"x86_64-windows": "Windows",
|
|
250
|
+
"x86_64-linux": "Linux",
|
|
251
|
+
"aarch64-darwin": "Darwin"
|
|
252
|
+
}
|
|
253
|
+
try:
|
|
254
|
+
for directory in (Path(self.fmu.tmp_directory) / "binaries").iterdir():
|
|
255
|
+
if directory.is_dir() and str(directory.stem) in osname:
|
|
256
|
+
self.platforms.add(osname[str(directory.stem)])
|
|
257
|
+
except FileNotFoundError:
|
|
258
|
+
pass # no binaries
|
|
259
|
+
|
|
243
260
|
def __repr__(self):
|
|
244
261
|
properties = f"{len(self.ports)} variables, ts={self.step_size}s"
|
|
245
262
|
if len(self.terminals) > 0:
|
|
@@ -602,9 +619,13 @@ class FMUContainer:
|
|
|
602
619
|
canHandleVariableCommunicationStepSize="true"
|
|
603
620
|
canBeInstantiatedOnlyOncePerProcess="{only_once}"
|
|
604
621
|
canNotUseMemoryManagementFunctions="true"
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
622
|
+
canGetAndSetFMUState="false"
|
|
623
|
+
canSerializeFMUState="false"
|
|
624
|
+
providesDirectionalDerivatives="false"
|
|
625
|
+
providesAdjointDerivatives="false"
|
|
626
|
+
providesPerElementDependencies="false"
|
|
627
|
+
providesEvaluateDiscreteStates="false"
|
|
628
|
+
hasEventMode="true"
|
|
608
629
|
needsExecutionTool="{execution_tool}">
|
|
609
630
|
</CoSimulation>
|
|
610
631
|
|
|
@@ -1214,7 +1235,20 @@ class FMUContainer:
|
|
|
1214
1235
|
logger.debug(f"Copying {origin} in {destination}")
|
|
1215
1236
|
shutil.copy(origin, destination)
|
|
1216
1237
|
|
|
1217
|
-
def get_bindir_and_suffixe(self) -> Tuple[str, str, str]:
|
|
1238
|
+
def get_bindir_and_suffixe(self) -> Generator[Tuple[str, str, str], Any, None]:
|
|
1239
|
+
fmu_iter = iter(self.involved_fmu.values())
|
|
1240
|
+
try:
|
|
1241
|
+
fmu = next(fmu_iter)
|
|
1242
|
+
except StopIteration:
|
|
1243
|
+
raise FMUContainerError("No fmu declared in this container.")
|
|
1244
|
+
|
|
1245
|
+
os_list = fmu.platforms
|
|
1246
|
+
logger.debug(f"FMU '{fmu.name}' OS support: {', '.join(fmu.platforms)}.")
|
|
1247
|
+
|
|
1248
|
+
for fmu in fmu_iter:
|
|
1249
|
+
logger.debug(f"FMU '{fmu.name}' OS support: {', '.join(fmu.platforms)}.")
|
|
1250
|
+
os_list &= fmu.platforms
|
|
1251
|
+
|
|
1218
1252
|
suffixes = {
|
|
1219
1253
|
"Windows": "dll",
|
|
1220
1254
|
"Linux": "so",
|
|
@@ -1236,11 +1270,16 @@ class FMUContainer:
|
|
|
1236
1270
|
else:
|
|
1237
1271
|
target_bindirs = origin_bindirs
|
|
1238
1272
|
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1273
|
+
if os_list:
|
|
1274
|
+
logger.info(f"Container will be built for {', '.join(os_list)}.")
|
|
1275
|
+
else:
|
|
1276
|
+
logger.critical("No common OS found for embedded FMU. Try to re-run with '-debug'. Container won't be runnable.")
|
|
1277
|
+
|
|
1278
|
+
for os_name in os_list:
|
|
1279
|
+
try:
|
|
1280
|
+
yield origin_bindirs[os_name], suffixes[os_name], target_bindirs[os_name]
|
|
1281
|
+
except KeyError:
|
|
1282
|
+
raise FMUContainerError(f"OS '{os_name}' is not supported.")
|
|
1244
1283
|
|
|
1245
1284
|
def make_fmu_skeleton(self, base_directory: Path) -> Path:
|
|
1246
1285
|
logger.debug(f"Initialize directory '{base_directory}'")
|
|
@@ -1260,14 +1299,14 @@ class FMUContainer:
|
|
|
1260
1299
|
|
|
1261
1300
|
self.copyfile(origin / "model.png", base_directory)
|
|
1262
1301
|
|
|
1263
|
-
origin_bindir, suffixe, target_bindir
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1302
|
+
for origin_bindir, suffixe, target_bindir in self.get_bindir_and_suffixe():
|
|
1303
|
+
library_filename = origin / origin_bindir / f"container.{suffixe}"
|
|
1304
|
+
if library_filename.is_file():
|
|
1305
|
+
binary_directory = binaries_directory / target_bindir
|
|
1306
|
+
binary_directory.mkdir(exist_ok=True)
|
|
1307
|
+
self.copyfile(library_filename, binary_directory / f"{self.identifier}.{suffixe}")
|
|
1308
|
+
else:
|
|
1309
|
+
logger.critical(f"File {library_filename} not found.")
|
|
1271
1310
|
|
|
1272
1311
|
for i, fmu in enumerate(self.involved_fmu.values()):
|
|
1273
1312
|
shutil.copytree(self.long_path(fmu.fmu.tmp_directory),
|
|
File without changes
|