バックナンバーはこちら。
https://www.simulationroom999.com/blog/model-based-of-minimum-2-backnumber/
はじめに
FMILibraryによるmodelDescription.xml内の変数情報を列挙するコード修正は完了。
前回までに説明したAPI全てを使用している。
(enum→文字列変換含む)
そしていよいよ結果が分かる。
登場人物
博識フクロウのフクさん

イラストACにて公開の「kino_k」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=iKciwKA9&area=1
エンジニア歴8年の太郎くん

イラストACにて公開の「しのみ」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=uCKphAW2&area=1
修正コード実行

太郎くん
じゃー実行するよー!ポチー
==============================
Variable name: HIGHT
Description: Hight of the ball
VR: 0
Variability: continuous : 4
Causality: output : 3
Initial: exact : 0
base_type: Real : 0
==============================
Variable name: HIGHT_SPEED
Description: Speed of the ball
VR: 1
Variability: continuous : 4
Causality: local : 4
Initial: exact : 0
base_type: Real : 0
==============================
Variable name: HIGHT_SPEED alias
Description: Speed of the ball
VR: 1
Variability: continuous : 4
Causality: local : 4
Initial: calculated : 2
base_type: Real : 0
==============================
Variable name: HIGHT_ACC
Description: Speed of the ball
VR: 4
Variability: continuous : 4
Causality: local : 4
Initial: calculated : 2
base_type: Real : 0
==============================
Variable name: A variable
Description: Speed of the ball
VR: 100
Variability: continuous : 4
Causality: local : 4
Initial: exact : 0
base_type: Real : 0
==============================
Variable name: GRAVITY
Description: Gravity constant
VR: 2
Variability: continuous : 4
Causality: local : 4
Initial: exact : 0
base_type: Real : 0
==============================
Variable name: BOUNCE_COF
Description: Bouncing coefficient
VR: 3
Variability: continuous : 4
Causality: local : 4
Initial: exact : 0
base_type: Real : 0
==============================
Variable name: LOGGER_TEST
Description: The logger will print the value of this variable when it is set.
VR: 0
Variability: continuous : 4
Causality: local : 4
Initial: calculated : 2
base_type: String : 3
==============================
Variable name: LOGGER_TEST_INTEGER
Description: This is only used to test logger replace function #i0#
VR: 0
Variability: continuous : 4
Causality: local : 4
Initial: calculated : 2
base_type: Integer : 1
==============================
Variable name: LOGGER_TEST_BOOLEAN
Description: This is only used to test logger replace function #b0#
VR: 0
Variability: continuous : 4
Causality: local : 4
Initial: calculated : 2
base_type: Boolean : 2
==============================
Variable name: LOGGER_TEST_DERIVATIVE
Description: This is to test that the derivative attribute may appear on any Real variables.
VR: 10
Variability: continuous : 4
Causality: local : 4
Initial: calculated : 2
base_type: Real : 0
==============================
Variable name: LOGGER_TEST_DERIVATIVE_DER
Description: This is to test that the derivative attribute may appear on any Real variables.
VR: 11
Variability: fixed : 1
Causality: local : 4
Initial: calculated : 2
base_type: Real : 0
==============================
結果確認

太郎くん
これはうまく行ったんじゃん?

フクさん
そうだね。
modelDescription.xmlに記載されてるものが列挙され、
内容もあってるね。

フクさん
ちなみに変リストのソートルールは
「XMLファイルに記載されているオリジナルの順序」
にしてある。

太郎くん
確かにその順番になってるね。
まとめ

フクさん
まとめだよ。
- 「modelDescription.xml内の変数情報を列挙」を実施。
- 問題無く動作。
- modelDescription.xmlに記載されてる変数がすべて列挙されていることを確認。
- ソートルールは「XMLファイルに記載されているオリジナルの順序」
- こちらも想定通りの動作になっていることを確認。
バックナンバーはこちら。
コメント