Skip to content

Commit 8ec0023

Browse files
authored
Merge pull request #8 from grouperenault/fmu_manipulation_toolbox
Rename project to "FMU Manipulation Toolbox"
2 parents 66f0891 + 1d09652 commit 8ec0023

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+124
-91
lines changed

.github/workflows/fmutool-package.yml .github/workflows/fmu_manipulation_toolbox-package.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
22
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
3-
name: Release FMUTOOL
3+
name: Release FMUManipulationToolbox
44

55
on:
66
push:
@@ -39,7 +39,7 @@ jobs:
3939
uses: actions/upload-artifact@master
4040
with:
4141
name: remoting-win32
42-
path: ${{ github.workspace }}/fmutool/resources/win32/
42+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/win32/
4343
retention-days: 1
4444
remoting-windows64:
4545
runs-on: windows-latest
@@ -71,7 +71,7 @@ jobs:
7171
uses: actions/upload-artifact@master
7272
with:
7373
name: remoting-win64
74-
path: ${{ github.workspace }}/fmutool/resources/win64
74+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/win64
7575
retention-days: 1
7676
remoting-linux32:
7777
runs-on: ubuntu-latest
@@ -107,7 +107,7 @@ jobs:
107107
uses: actions/upload-artifact@master
108108
with:
109109
name: remoting-linux32
110-
path: ${{ github.workspace }}/fmutool/resources/linux32
110+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/linux32
111111
retention-days: 1
112112
remoting-linux64:
113113
runs-on: ubuntu-latest
@@ -138,7 +138,7 @@ jobs:
138138
uses: actions/upload-artifact@master
139139
with:
140140
name: remoting-linux64
141-
path: ${{ github.workspace }}/fmutool/resources/linux64
141+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/linux64
142142
retention-days: 1
143143
container-windows64:
144144
runs-on: windows-latest
@@ -170,7 +170,7 @@ jobs:
170170
uses: actions/upload-artifact@master
171171
with:
172172
name: container-win64
173-
path: ${{ github.workspace }}/fmutool/resources/win64
173+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/win64
174174
retention-days: 1
175175
container-linux64:
176176
runs-on: ubuntu-latest
@@ -201,7 +201,7 @@ jobs:
201201
uses: actions/upload-artifact@master
202202
with:
203203
name: container-linux64
204-
path: ${{ github.workspace }}/fmutool/resources/linux64
204+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/linux64
205205
retention-days: 1
206206
package:
207207
needs: [remoting-windows32, remoting-windows64, remoting-linux32, remoting-linux64, container-windows64, container-linux64]
@@ -211,27 +211,27 @@ jobs:
211211
- uses: actions/download-artifact@master
212212
with:
213213
name: remoting-win64
214-
path: ${{ github.workspace }}/fmutool/resources/win64/
214+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/win64/
215215
- uses: actions/download-artifact@master
216216
with:
217217
name: remoting-win32
218-
path: ${{ github.workspace }}/fmutool/resources/win32/
218+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/win32/
219219
- uses: actions/download-artifact@master
220220
with:
221221
name: remoting-linux32
222-
path: ${{ github.workspace }}/fmutool/resources/linux32/
222+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/linux32/
223223
- uses: actions/download-artifact@master
224224
with:
225225
name: remoting-linux64
226-
path: ${{ github.workspace }}/fmutool/resources/linux64/
226+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/linux64/
227227
- uses: actions/download-artifact@master
228228
with:
229229
name: container-win64
230-
path: ${{ github.workspace }}/fmutool/resources/win64/
230+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/win64/
231231
- uses: actions/download-artifact@master
232232
with:
233233
name: container-linux64
234-
path: ${{ github.workspace }}/fmutool/resources/linux64/
234+
path: ${{ github.workspace }}/fmu_manipulation_toolbox/resources/linux64/
235235
- name: Set up Python 3.10
236236
uses: actions/setup-python@v3
237237
with:

CHANGELOG.md

+6-1

README.md

+38-9

container/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ if (UNIX AND NOT APPLE)
4646
target_link_libraries(container Threads::Threads)
4747
endif()
4848
set_target_properties(container PROPERTIES
49-
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR}/../fmutool/resources/${FMI_PLATFORM}"
50-
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../fmutool/resources/${FMI_PLATFORM}")
49+
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR}/../fmu_manipulation_toolbox/resources/${FMI_PLATFORM}"
50+
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../fmu_manipulation_toolbox/resources/${FMI_PLATFORM}")
5151

5252
#target_compile_options(container PRIVATE /W4 /WX)
5353

doc/README.md

+6-6

doc/checker.md

+7-6

doc/example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fmutool.fmu_operations import FMU, OperationSaveNamesToCSV, OperationStripTopLevel, \
1+
from fmu_manipulation_toolbox.fmu_operations import FMU, OperationSaveNamesToCSV, OperationStripTopLevel, \
22
OperationRenameFromCSV, OperationAddRemotingWin32, OperationGetNames
33
# 1st Use Case: remove toplevel bus (if any)
44
fmu = FMU("tests/bouncing_ball.fmu")

doc/fmutool.png

-40 KB
Binary file not shown.

doc/gui.png

61.5 KB

doc/remoting.md

+1-1
File renamed without changes.
File renamed without changes.

fmutool/checker.py fmu_manipulation_toolbox/checker.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import importlib.util
22
import inspect
33
import os
4-
import glob
54
import xmlschema
65
from xmlschema.validators.exceptions import XMLSchemaValidationError
76
from .fmu_operations import OperationAbstract

fmutool/cli.py fmu_manipulation_toolbox/cli.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def format(self, record):
2424
formatter = logging.Formatter(format_per_level[record.levelno])
2525
return formatter.format(record)
2626
init()
27-
logger = logging.getLogger("fmutool")
27+
logger = logging.getLogger("fmu_manipulation_toolbox")
2828
handler = logging.StreamHandler(stream=sys.stdout)
2929
handler.setFormatter(CustomFormatter())
3030
logger.addHandler(handler)
@@ -46,11 +46,11 @@ def make_wide(formatter, w=120, h=36):
4646

4747

4848
def fmutool():
49-
print(f"FMUTool version {version}")
49+
print(f"FMU Manipulation Toolbox version {version}")
5050
help_message = Help()
5151

5252
parser = argparse.ArgumentParser(prog='fmutool',
53-
description="Manipulate a FMU by modifying its 'modelDescription.xml'",
53+
description="Analyse and Manipulate a FMU by modifying its 'modelDescription.xml'",
5454
formatter_class=make_wide(argparse.HelpFormatter),
5555
add_help=False,
5656
epilog="see: https://github.com/grouperenault/fmutool/blob/main/README.md")

fmutool/fmu_container.py fmu_manipulation_toolbox/fmu_container.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from .fmu_operations import FMU, OperationAbstract, FMUException
1212
from .version import __version__ as tool_version
1313

14-
logger = logging.getLogger("fmutool")
14+
logger = logging.getLogger("fmu_manipulation_toolbox")
1515

1616

1717
class FMUPort:
File renamed without changes.

fmutool/gui.py fmu_manipulation_toolbox/gui.py

+17-9
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,15 @@ def __init__(self):
142142
self.setFont(font)
143143
self.setMinimumWidth(800)
144144
self.setMinimumHeight(480)
145+
146+
self.insertHtml('<center><img src="fmu_manipulation_toolbox.png"/></center><br>')
145147
LogWidget.XStream.stdout().messageWritten.connect(self.insertPlainText)
146148
LogWidget.XStream.stderr().messageWritten.connect(self.insertPlainText)
147149

150+
def loadResource(self, type, name):
151+
image_path = os.path.join(os.path.dirname(__file__), "resources", name.toString())
152+
return QPixmap(image_path)
153+
148154

149155
class HelpWidget(QLabel):
150156
HELP_URL = "https://github.com/grouperenault/fmutool/blob/main/README.md"
@@ -202,12 +208,12 @@ def get(self):
202208
return sorted(self.items_selected)
203209

204210

205-
class FmutoolMainWindow(QWidget):
211+
class FMUManipulationToolboxlMainWindow(QWidget):
206212
def __init__(self, app, *args, **kwargs):
207213
super().__init__(*args, **kwargs)
208214

209-
self.setWindowTitle('FMUTool - manipulate your FMU''s')
210-
self.setWindowIcon(QIcon(os.path.join(os.path.dirname(__file__), 'resources', 'fmutool.png')))
215+
self.setWindowTitle('FMU Manipulation Toolbox')
216+
self.setWindowIcon(QIcon(os.path.join(os.path.dirname(__file__), 'resources', 'icon.png')))
211217

212218
# set the grid layout
213219
self.layout = QGridLayout()
@@ -429,11 +435,13 @@ def apply_operation(self, operation):
429435

430436

431437
class Application:
432-
r""" ____ __ ___ __ __ ______ __
433-
\-^-/ / __/ / |/ / / / / //_ __/ ___ ___ / /
434-
(o o) / _/ / /|_/ / / /_/ / / / / _ \/ _ \ / /
435-
ooO--(_)--Ooo- /_/ /_/ /_/ \____/ /_/ \___/\___//_/"""
438+
"""
439+
Analyse and modify your FMUs.
440+
441+
Note: modifying the modelDescription.xml can damage your FMU ! Communicating with the FMU-developer and adapting the
442+
way the FMU is generated, is preferable when possible.
436443
444+
"""
437445
def __init__(self):
438446
QDir.addSearchPath('images', os.path.join(os.path.dirname(__file__), "resources"))
439447
self.app = QApplication(sys.argv)
@@ -472,9 +480,9 @@ def __init__(self):
472480
"""
473481

474482
self.app.setStyleSheet(css_dark)
475-
self.window = FmutoolMainWindow(self.app)
483+
self.window = FMUManipulationToolboxlMainWindow(self.app)
484+
print(" "*80, f"Version {version}")
476485
print(self.__doc__)
477-
print(f" Version {version}")
478486
sys.exit(self.app.exec())
479487

480488
def exit(self):
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
45.9 KB

fmutool/resources/license.txt fmu_manipulation_toolbox/resources/license.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FMPy Remoting Binaries License
22
==============================
33

44
The 32-bit remoting binaries (binaries/win64/<model_name>.dll and
5-
binaries/win64/server.exe) are part of FMUTOOL
5+
binaries/win64/server.exe) are part of FMU Manipulation Toolbox
66
and released under the 2-Clause BSD license:
77

88
Copyright 2023 Renault SAS
File renamed without changes.

fmutool/version.py fmu_manipulation_toolbox/version.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
try:
2-
from fmutool.__version__ import __doc__ as __version__
2+
from fmu_manipulation_toolbox.__version__ import __doc__ as __version__
33
except ModuleNotFoundError:
4-
__version__ = "0.0-dev"
4+
__version__ = "0.0.dev0"
55

66
__author__ = "[email protected]"
77
__copyright__ = "Copyright 2023-2024, Renault SAS"

fmutool/resources/fmutool.png

-171 KB
Binary file not shown.

0 commit comments

Comments
 (0)