How to create gui (graphic user interface) for standalong binary executable file

时间:2016-04-25 09:04:22

标签: user-interface modelica dymola

I have a model in Modelica language (platform: Dymola). Dymola creates a binary file of model during compiling/translation (dymosim.exe). If binary code export licence is available then a binary file which is standalone representative of original dymola model is created. This can be run on any computer without Dymola licence.

Now, My question is how can I create Gui for around this executable file with following requirements:- 1. It should be able to change in some input parameter values. 2. It should be able to get some output parameter values.

Now as background:- dymosim.exe takes parameter values as input from text file (dsin.txt) and writes output in another text file (dsres.txt)

Specifically, if one has such binary executable which takes input from a text file and writes output in specific format (of which rules are known) to another text file; then what are some tools to create gui for it?

3 个答案:

答案 0 :(得分:1)

Look into Dymola's embedded server support (DDE/OPC). Since you are using dymosim.exe, I believe you are using Windows so Dymola's restriction on only Visual Studio 32-bit code for embedded servers will be acceptable. (Most Modelica tools have similar embedded servers, but I don't think they are compatible.)

答案 1 :(得分:1)

Dymola dymosim.exe将其时间序列结果导出为*.mat个文件,您应该能够在GUI中找到处理*.mat格式的工具/库。

此外,dsin.txt有自己的格式,您可以先尝试理解它(尝试查找其注释),然后解析它,它不是一个包含随机字符串和数字列的文本文件。

答案 2 :(得分:1)

在协同仿真模式中使用FMI标准值得考虑,这意味着包含了求解器。 Dymola允许将模型导出为FMU包(在Windows平台中它是带有一些元数据的单个DLL,在Linux平台中它是.SO库)并提供这些功能值得你做的步骤:

  • fmiSetReal()将设置参数值
  • fmiDoStep()
  • fmiGetReal()将获得变量值

您可以直接调用这些函数,只需解压缩FMU包并在其中找到DLL并将其直接链接到您的应用程序。 或者推荐的方式(我们在我们的应用程序中完成):使用FMI Library提供与FMU包交互的通用C API,并以您需要的方式控制时间结构。