1- ![ Title ] ( fmu_manipulation_toolbox/resources/fmu_manipulation_toolbox.png )
1+ ![ ] ( fmu_manipulation_toolbox/resources/fmu_manipulation_toolbox.png )
22
3- FMU Manipulation Toolbox is a python package which help to analyse and modify a [ Functional Mock-up Units (FMUs)] ( http://fmi-standard.org/ )
4- without recompilation. It is highly customizable. It can even modify the ` modelDescription.xml ` file.
3+ FMU Manipulation Toolbox is a python package which help to analyse, modify or combine
4+ [ Functional Mock-up Units (FMUs)] ( http://fmi-standard.org/ ) without recompilation. It is highly customizable as it comes with
5+ a Python API.
56
6- Manipulating the ` modelDescription.xml ` can be a dangerous thing! Communicating with the FMU-developer and adapting
7- the way the FMU is generated, is preferable when possible.
7+ FMU Manipulation Toolbox can be used in different ways :
8+ - Using a Graphical User Interface: suitable for end user
9+ - Using a Command Line Interface: useful in
10+ - Using a python API: the most efficient for automation (CI/CD, transformation scripts, ...)
811
9- FMU Manipulation Toolbox also allows to group FMU's inside FMU Containers. (see [ doc/container.md] ( doc/container.md ) )
12+ Major features:
13+ - Analyse FMU content: list ports and their attributes, check compliance of ` ModelDescription.xml ` with XSD, ...
14+ - Alter FMU by modifying its ` modelDescription.xml ` file. NOTE: manipulating this file can be a dangerous
15+ thing! Communicating with the FMU-developer and adapting the way the FMU is generated is preferable when
16+ possible.
17+ - Add binary interface. Typical use case is porting a 32bits FMUs to 64bits (or vice et versa).
18+ - Nest FMUs in a [ FMU Container] ( doc/container.md )
19+
20+ FMI versions 2.0 and 3.0 are supported.
1021
1122## Installation
1223
@@ -17,29 +28,39 @@ Two options available to install FMU Manipulation Toolbox:
1728- Compile and install from [ github repository] ( https://github.com/grouperenault/fmu_manipulation_toolbox ) . You will need
1829 - Python required packages. See [ ` requirements.txt ` ] ( requirements.txt ) .
1930 - C compiler (C99 or later)
20- - CMake (>= 3.16)
31+ - CMake (>= 3.20)
32+
2133
2234### Supported platforms
23- FMU Manipulation Toolbox is tested on:
24- - Windows 10/11
35+
36+ FMU Manipulation Toolbox is packaged for:
37+ - Windows 10/11 (primary platform)
2538- Linux (Ubuntu 22.04)
39+ - Darwin
2640
27- Compilation is reported to work on:
28- - MacOS (Apple Silicon and Intel)
2941
3042## Graphical User Interface
3143
32- FMU Manipulation Toolbox is released with a GUI. You can launch it with the following command ` fmutool `
33- (without any option)
44+ FMU Manipulation Toolbox is released with a GUI. You can launch it with the following command ` fmutool-gui `
3445
3546![ GUI] ( doc/gui.png " GUI ")
3647
48+ Button colors descriptions:
49+ - red: remove information from the ` modelDescription.xml `
50+ - orange: alter ` modelDescription.xml `
51+ - green: add component into the FMU or check it
52+ - violet: extract and save
53+ - blue: filter actions scope or exit
54+
55+ ** Original FMU is never modified** . Use ` Save ` button to get modified copy of the original FMU.
56+
3757
3858## Command Line Interface
3959
4060FMU Manipulation Toolbox comes with 2 commands:
4161- ` fmutool ` : a versatile analysis and manipulation tool for FMU.
42- - ` fmucontainer ` : group FMU's inside FMU Containers. (see [ container/README.md] ( container/README.md ) )
62+ - ` fmucontainer ` : group FMUs inside FMU Containers. (see [ container/README.md] ( container/README.md ) )
63+ - `fmusplit: to extract FMUs from a FMU Container.
4364
4465
4566### Analysis and Manipulation tool:
@@ -163,14 +184,13 @@ You can write your own FMU Manipulation scripts. Once you downloaded fmutool mod
163184adding the ` import ` statement lets you access the API :
164185
165186``` python
166- from fmu_manipulation_toolbox.operations import FMU , OperationExtractNames, OperationStripTopLevel,
167-
168- OperationRenameFromCSV
187+ from fmu_manipulation_toolbox.operations import ...
169188```
170189
190+
171191### remove toplevel bus (if any)
172192
173- Give a FMU with the following I/O structure
193+ Given a FMU with the following I/O structure
174194```
175195├── Parameters
176196│ ├── Foo
@@ -194,6 +214,8 @@ The following transformation will lead into:
194214
195215The following code will do this transformation:
196216``` python
217+ from fmu_manipulation_toolbox.operations import FMU , OperationStripTopLevel
218+
197219fmu = FMU(r " bouncing_ball. fmu" )
198220operation = OperationStripTopLevel()
199221fmu.apply_operation(operation)
@@ -205,8 +227,10 @@ fmu.repack(r"bouncing_ball-modified.fmu")
205227The following code will dump all FMU's Scalars names into a CSV:
206228
207229``` python
230+ from fmu_manipulation_toolbox.operations import FMU , OperationSaveNamesToCSV
231+
208232fmu = FMU(r " bouncing_ball. fmu" )
209- operation = OperationExtractNames ()
233+ operation = OperationSaveNamesToCSV ()
210234fmu.apply_operation(operation)
211235operation.write_csv(r " bouncing_ball. csv" )
212236```
@@ -224,15 +248,20 @@ g;g;4;parameter;fixed
224248e;e;5;parameter;tunable
225249```
226250
251+
227252### Read CSV and rename FMU ports
228253
229- CSV file should contain- 2 columns:
254+ CSV file should contain 2 columns:
2302551 . the current name
2312562 . the new name
232257
233258``` python
259+ from fmu_manipulation_toolbox.operations import FMU , OperationRenameFromCSV
260+
234261fmu = FMU(r " bouncing_ball. fmu" )
235262operation = OperationRenameFromCSV(r " bouncing_ball-modified. csv" )
236263fmu.apply_operation(operation)
237264fmu.repack(r " bouncing_ball-renamed. fmu" )
238265```
266+
267+ More operations exist in [ ` Operation.py ` ] ( fmu_manipulation_toolbox/operations.py )
0 commit comments