diff --git a/README.md b/README.md index 33fdaef..b8ea868 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![](https://img.shields.io/badge/SDK-v14.0.0-blue) + # VIKTOR interaction with RFEM This sample application is made to showcase the interaction between VIKTOR and RFEM. It builds a model representing a truss, uses a VIKTOR worker running in an environment where RFEM is running with its web service enabled and visualizes the calculations inside the VIKTOR interface. @@ -8,4 +10,7 @@ This application uses [RFEM](https://www.dlubal.com/en). RFEM needs to be runnin ## The Worker -To interact with RFEM using the VIKTOR application we use the VIKTOR worker. Some steps need to be taken to make it work. These steps are described [here](app/lib/README.md). \ No newline at end of file +To interact with RFEM using the VIKTOR application we use the VIKTOR worker. Some steps need to be taken to make it work. These steps are described [here](app/lib/README.md). + +# App structure +This is an simple app. \ No newline at end of file diff --git a/app/truss/controller.py b/app/truss/controller.py index c5f9e0f..a422151 100644 --- a/app/truss/controller.py +++ b/app/truss/controller.py @@ -14,7 +14,7 @@ from viktor.views import GeometryAndDataView from viktor.views import GeometryResult from viktor.views import GeometryView -from viktor.views import SVGResult +from viktor.views import ImageResult from .constants import material_allowed_stress from .datagroups_and_visualisations import build_model_from_params @@ -107,7 +107,7 @@ def get_optimal_result(self, params: Munch, **kwargs) -> OptimizationResult: ax.set_xlabel("Height panels") ax.set_ylabel("UC") plt.savefig(io_, format="svg") - image = SVGResult(io_) + image = ImageResult(io_) # Return results return OptimizationResult( diff --git a/app/truss/model.py b/app/truss/model.py index a96ec9f..2b17c85 100644 --- a/app/truss/model.py +++ b/app/truss/model.py @@ -7,7 +7,7 @@ import numpy as np from munch import Munch -from viktor.core import UserException +from viktor.core import UserError from viktor.external.generic import GenericAnalysis from viktor.geometry import Color from viktor.geometry import Line @@ -120,7 +120,7 @@ def send2rfem(model: str, selection: int = 0) -> str: try: generic_analysis.execute(timeout=600) except TimeoutError as err: - raise UserException(err) + raise UserError(err) output_file = generic_analysis.get_output_file("output.json") json_str = output_file.read() json_str = json_str.decode("utf-8") diff --git a/requirements.txt b/requirements.txt index e610790..6cb3553 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -# viktor==13.7.0 +viktor==14.0.0 diff --git a/viktor.config.toml b/viktor.config.toml index e24f254..5a8c6a0 100644 --- a/viktor.config.toml +++ b/viktor.config.toml @@ -1,2 +1,2 @@ -app_type = 'simple' +app_type = 'editor' python_version = '3.10' \ No newline at end of file