FMI Library: part of JModelica.org
Data Structures | Functions

The functions in this module are provided for convenience. The functionality is already available via other lower level functions. More...

Data Structures

struct  fmi1_import_model_counts_t
 Collection of counters providing model information. More...
 

Functions

FMILIB_EXPORT void fmi1_import_collect_model_counts (fmi1_import_t *fmu, fmi1_import_model_counts_t *counts)
 Collect model information by counting the number of variables with specific properties and fillinf in fmi1_import_model_counts_t struct. More...
 
FMILIB_EXPORT void fmi1_import_expand_variable_references (fmi1_import_t *fmu, const char *msgIn, char *msgOut, size_t maxMsgSize)
 Print msgIn into msgOut by expanding variable references of the form #<Type><VR># into variable names and replacing '##' with a single #. More...
 
FMILIB_EXPORT void fmi1_log_forwarding (fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_t category, fmi1_string_t message,...)
 An implementation of FMI 1.0 logger that forwards the messages to logger function inside jm_callbacks structure. More...
 
FMILIB_EXPORT void fmi1_log_forwarding_v (fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_t category, fmi1_string_t message, va_list args)
 An implementation of FMI 1.0 logger that forwards the messages to logger function inside jm_callbacks structure. More...
 
FMILIB_EXPORT void fmi1_default_callback_logger (fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_t category, fmi1_string_t message,...)
 Default FMI 1.0 logger may be used when instantiating FMUs. More...
 
FMILIB_EXPORT void fmi1_import_init_logger (jm_callbacks *cb, fmi1_callback_functions_t *fmiCallbacks)
 Given fmi1_callback_functions_t logger (fmi1_logger), the jm_callbacks logger may be setup to redirect the messages to the fmi1_logger. More...
 

Detailed Description

The functions in this module are provided for convenience. The functionality is already available via other lower level functions.

Function Documentation

FMILIB_EXPORT void fmi1_import_collect_model_counts ( fmi1_import_t fmu,
fmi1_import_model_counts_t counts 
)

Collect model information by counting the number of variables with specific properties and fillinf in fmi1_import_model_counts_t struct.

Parameters
fmu- An fmu object as returned by fmi1_import_parse_xml().
counts- a pointer to a preallocated struct.
FMILIB_EXPORT void fmi1_import_expand_variable_references ( fmi1_import_t fmu,
const char msgIn,
char msgOut,
size_t  maxMsgSize 
)

Print msgIn into msgOut by expanding variable references of the form #<Type><VR># into variable names and replacing '##' with a single #.

Parameters
fmu- An fmu object as returned by fmi1_import_parse_xml().
msgIn- Log message as produced by an FMU.
msgOut- Output message buffer.
maxMsgSize- maximum message size
FMILIB_EXPORT void fmi1_log_forwarding ( fmi1_component_t  c,
fmi1_string_t  instanceName,
fmi1_status_t  status,
fmi1_string_t  category,
fmi1_string_t  message,
  ... 
)

An implementation of FMI 1.0 logger that forwards the messages to logger function inside jm_callbacks structure.

The function is using a global array of active FMUs to find out which FMU is sending the log messege. It then forwards the message to the logger connected to the particular fmi1_import_t struct. The function is called by the FMU. The FMU must be loaded with non-zero registerGlobally parameter of fmi1_import_create_dllfmu() in order to work. If no matching fmi1_import_t struct is found on the global list then jm_get_default_callbacks() is used to get the default logger. Note that this function is not thread safe due to the use of the global list.

FMILIB_EXPORT void fmi1_log_forwarding_v ( fmi1_component_t  c,
fmi1_string_t  instanceName,
fmi1_status_t  status,
fmi1_string_t  category,
fmi1_string_t  message,
va_list  args 
)

An implementation of FMI 1.0 logger that forwards the messages to logger function inside jm_callbacks structure.

See fmi1_log_forwarding() for more information.

FMILIB_EXPORT void fmi1_default_callback_logger ( fmi1_component_t  c,
fmi1_string_t  instanceName,
fmi1_status_t  status,
fmi1_string_t  category,
fmi1_string_t  message,
  ... 
)

Default FMI 1.0 logger may be used when instantiating FMUs.

FMILIB_EXPORT void fmi1_import_init_logger ( jm_callbacks cb,
fmi1_callback_functions_t fmiCallbacks 
)

Given fmi1_callback_functions_t logger (fmi1_logger), the jm_callbacks logger may be setup to redirect the messages to the fmi1_logger.

The functions sets up the redirection. Note that the context field in jm_callbacks is set to point to the provided fmi1_callback_functions_t.

Parameters
cbFMI Library callbacks
fmiCallbacksFMI 1.0 standard callbacks