INTO-CPS-Association / digital_twin_tooling

Internal low level tool for running digital twin simulations in the app
Other
4 stars 1 forks source link

Utility API call for generating an FMU from a data-repeater #1

Open FrederikPM opened 3 years ago

FrederikPM commented 3 years ago

I think it is beneficial to have an API call to generate a data-repeater without needing the full yml configuration.

So an API call like: POST: generatefmu which generates an FMU with the name of the data-repeater and returns its path. The path can be temporary or a specific path could be passed with the API call.

FrederikPM commented 3 years ago

This allows the following UI workflow: The user adds and associates all needed elements, e.g. signals which is then linked to data-repeaters (from which the user generates fmus) and used in multi-models which is also linked to configurations and the user also includes servers and tools. When the user is satisfied with the setup the user presses save and the yml configuration is passed to the dt tooling.

CThuleHansen commented 3 years ago

@lausdahl This looks fine for me, and it also looks like it makes sense

lausdahl commented 3 years ago

Wasnt this already done it the last version of the API I send you last week. You post the data repeater anf then ask for prepare of it and it generates the fmu and returns its path together with the signals in json

FrederikPM commented 3 years ago

Yes. But for that a project needs to be configured beforehand with a yaml configuration that at least needs to contain the components needed at the time the user wants to generate the FMU.

I was thinking that if it is possible to generate the FMU without coupling to a project in the tooling server, then the full yaml configuration can be passed to the tooling server for the project to be configured whenever the user has saves the configuration in the app.

lausdahl commented 3 years ago

The reason I made it in the other way is that then you need to send more info. It would make more sense to create the project first (you dont need to post any json just a name). Like:

  1. PUT project name
  2. POST tools (I cannot generate a rabbitmq fmu without the tool)
  3. POST/PUT the data repeater you want

this completes the datarepeater For the user to make a simulation section

  1. someone must figure out what data repeater to link it with
  2. POST a generator of the data repeater and it will answer you with the info you need without modifying the project it just produces the fmu and replies with the signals you might want to use in the multimodel
  3. use the generated fmu file and make the config for the simulation and POST/PUT it to the desired path

this way you make the entry name of the element on load and post it when done. I think it may be better to have it organised in a project instead of memory in the frontend if we need to add traceability to it later. But we can of cause easily make the API you ask for.