バックナンバーはこちら。
https://www.simulationroom999.com/blog/model-based-of-minimum-2-backnumber/
はじめに
何とかFMILibraryのビルドを通すことができた。
これから実際にFMILibraryを使っていくことになるが、
ビルドした際にサンプルプロジェクトも生成された様子。
よって、このサンプルプロジェクトをベースに話を進める。
登場人物
博識フクロウのフクさん

イラスト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
サンプルプロジェクトの在り処

確か、サンプルプロジェクトがあるって話だったけど、
どこにあるの?

ビルドする時にbuild-fmiというフォルダを作成して、
その中でビルドしたと思う。

うん。
build-fmiでやった。

その中にFMILibrary.slnってファイルがあるんで、
それが全サンプルプロジェクトを抱え込んだソリューションファイルになる。

あ、ホントだ!
FMILibrary.slnってがある!
これを起動すればいいんだな。ポチー
どのサンプルプロジェクトを使用するのか?

なんかむくちゃプロジェクトがあるんだけど・・・。


まぁ使うプロジェクトは一個だ。
fmi2_import_cs_testってプロジェクトをベースにする。


これをそのまま使うの?

すでにビルド済みのものが、
\build-fmi\MinSizeRel
の中に
fmi2_import_cs_test.exe
として存在はしてるけどねー。
FMI2.0仕様に則って動作する。

ちなみに似た名前で
fmi_import_cs_test.exe
ってのがあるけど、
こっちはFMI1.0仕様の方だね。
実行方法

なんだ。
じゃー、そのまま実行!

・・・

あれ?
コマンドプロンプトっぽいのが一瞬だけ表示したような気がしたけど、
すぐ消えた???

動かし方がわからん!!

まぁ引数付で起動しないといけないタイプのプログラムなんで、
先にコマンドプロンプトを起動してから該当プログラムを起動だな。

なるほど!

じゃーあらためてコマンドプロンプト経由で・・・。

・・・。

なんか動いた・・・のか?
C:\FMILibrary-2.0.3\build-fmi\MinSizeRel>fmi2_import_cs_test.exe
Usage: fmi2_import_cs_test.exe <fmu_file> <temporary_dir>
Press 'Enter' to exit

こらこら!
引数付きで起動っていったでしょ!!

あ、そっか。

で、引数は何を渡せば良いの?

さっき太郎くんが実行した画面に答えは書いてあるけどねー。
まぁ次回はそこらへんをやるか。
まとめ

まとめだよ。
- FMILibraryのサンプルプロジェクトを確認。
- 大量にある。
- 今回はfmi2_import_cs_testを使用。
- すでにビルド済みのものが存在。
- fmi2_import_cs_testは引数を要求するタイプの実行プログラム。
- よって、ただ起動しただけでは何もしてくれない。
- 引数については次回説明予定。
バックナンバーはこちら。
コメント