INTO-CPS-Association / unifmu

A universal mechanism for implementing Functional Mock-up Units (FMUs) in various languages
41 stars 4 forks source link

Method fmiSetDebugLogging is not being generated in the Model class #52

Closed clagms closed 2 months ago

clagms commented 1 year ago

The method fmiSetDebugLogging is not being generated in the Model class, but this method gets called by backend.py

To reproduce:

  1. use unifmu CLI to generate a dummyfmi.
  2. Load it in a cosim that enables debug logging
  3. Get an error message like the following:
    INFO:C:\work\gitlab\project_digit-bench-dlte\demonstrators\tb_lorc_halt_6dof\model_tlu\fmi2_tlu_motion\fmusv2\fmusiggen\resources\backend.py:dispatcher endpoint received: tcp://127.0.0.1:61936
    Interpretation instantiate took: 160948600
    Traceback (most recent call last):
    File "C:\work\gitlab\project_digit-bench-dlte\demonstrators\tb_lorc_halt_6dof\model_tlu\fmi2_tlu_motion\fmusv2\fmucontroller\resources\backend.py", line 63, in <module>
    result.status = slave.fmiSetDebugLogging(
    AttributeError: 'Model' object has no attribute 'fmiSetDebugLogging'

The workaround is to add the method to the class Model.

Additionally, in the backend.py, data.categores should be data.categories.

I suggest enhancing the tests so this code gets tested.

Maybe there are other functions that are not being generated? Perhaps the same bug occurs for FMI 3?

clagms commented 2 months ago

This has now been fixed in https://github.com/INTO-CPS-Association/unifmu/tree/dev/claudio To be merged at some point with the master.