From ac65b058949f017acb9a7a672c296f3e86d47016 Mon Sep 17 00:00:00 2001 From: Luuk Boot Date: Wed, 31 May 2023 14:30:27 +0200 Subject: [PATCH 1/3] Updated to skd 14.0.0 --- README.md | 2 ++ app/truss/controller.py | 4 ++-- app/truss/model.py | 4 ++-- requirements.txt | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 33fdaef..02a5294 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. 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 From 88919b211259ceab2c9b914360c4359b840302a7 Mon Sep 17 00:00:00 2001 From: Luuk Boot Date: Wed, 31 May 2023 14:31:04 +0200 Subject: [PATCH 2/3] Updated --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 02a5294..b8ea868 100644 --- a/README.md +++ b/README.md @@ -10,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 From 63cc0a1b7b1d5431de1b26af62af451a192dc90d Mon Sep 17 00:00:00 2001 From: LuukBoot <121462516+LuukBoot@users.noreply.github.com> Date: Mon, 19 Jun 2023 11:50:17 +0200 Subject: [PATCH 3/3] UPdated to editor --- viktor.config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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