dsin.txt 中的数据类型是如何定义的? [英] How are the data types in dsin.txt defined?
问题描述
我目前正在开发一个 Python 接口,用于使用 Dymola 运行 Modelica 模拟,但我找不到关于 dsin.txt
文件中使用的数据类型的任何文档:
I am currently developing a python interface for running Modelica simulations using Dymola and I can't find any documentation on the data types used in the dsin.txt
file :
...
0 0 0 0 4 328 # timeToEmpty
-1 0 0 100 2 272 # level
0 0 0 0 3 256 # der(level)
-1 10 0 0 1 280 # initialFlowRate
0 0 0 0 6 320 # flowRate
...
文件本身有一些文档,但不是很有帮助:
There is some documentation inside the file itself, but it's not very helpful :
...
# column 6: Data type of variable.
# = 0: real.
# = 1: boolean.
# = 2: integer.
...
如您所见,我得到的类型与所描述的完全不同.我想知道数据的类型是 Real
、Integer
、Boolean
还是其他类型以相应地调整我的界面中的表示.>
As you can see, the types I'm getting are completely different than the ones described. I want to know if the data is of type Real
, Integer
, Boolean
or something else to adapt the representation in my interface accordingly.
推荐答案
找遍了各处,发现变量的描述在末尾的括号中包含了一个文本字段,里面写的是单位、显示单位和类型,如果它不是Real
.我只需要解析它.
After looking everywhere, i found that the description of the variables contain a text field in brackets at the end where the unit, the display unit and the type are written, if it is not Real
. I only need to parse it.
这篇关于dsin.txt 中的数据类型是如何定义的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!