FMI Library: part of JModelica.org
fmi2_import_convenience.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 Modelon AB
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the BSD style license.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  FMILIB_License.txt file for more details.
11 
12  You should have received a copy of the FMILIB_License.txt file
13  along with this program. If not, contact Modelon AB <http://www.modelon.com>.
14 */
15 
16 
17 
25 #ifndef FMI2_IMPORT_CONVENIENCE_H_
26 #define FMI2_IMPORT_CONVENIENCE_H_
27 
28 #include <FMI/fmi_import_context.h>
29 #include <FMI2/fmi2_functions.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
48 typedef struct {
50  unsigned int num_constants;
52  unsigned int num_fixed;
54  unsigned int num_tunable;
56  unsigned int num_discrete;
58  unsigned int num_continuous;
59 
61  unsigned int num_parameters;
65  unsigned int num_inputs;
67  unsigned int num_outputs;
69  unsigned int num_local;
71  unsigned int num_independent;
72 
74  unsigned int num_real_vars;
76  unsigned int num_integer_vars;
78  unsigned int num_enum_vars;
80  unsigned int num_bool_vars;
82  unsigned int num_string_vars;
84 
92 
102 void fmi2_import_expand_variable_references(fmi2_import_t* fmu, const char* msgIn, char* msgOut, size_t maxMsgSize);
103 
104 
115 void fmi2_log_forwarding(fmi2_component_t c, fmi2_string_t instanceName, fmi2_status_t status, fmi2_string_t category, fmi2_string_t message, ...);
116 
123 void fmi2_log_forwarding_v(fmi2_component_t c, fmi2_string_t instanceName, fmi2_status_t status, fmi2_string_t category, fmi2_string_t message, va_list args);
124 
125 
128 void fmi2_default_callback_logger(fmi2_component_t c, fmi2_string_t instanceName, fmi2_status_t status, fmi2_string_t category, fmi2_string_t message, ...);
129 
144 #ifdef __cplusplus
145 }
146 #endif
147 #endif /* FMI2_IMPORT_CONVENIENCE_H_ */
unsigned int num_calculated_parameters
Number of calculated parameters.
FMILIB_EXPORT void fmi2_import_init_logger(jm_callbacks *cb, fmi2_callback_functions_t *fmiCallbacks)
Given fmi2_callback_functions_t logger (fmi2_logger), the jm_callbacks logger may be setup to redirec...
unsigned int num_inputs
Number of inputs.
unsigned int num_discrete
Number of discrete variables.
size_t jm_callbacks * c
unsigned int num_local
Number of local variables.
Import context is the entry point to the library. It is used to initialize, unzip, get FMI version and start parsing.
FMILIB_EXPORT void fmi2_log_forwarding_v(fmi2_component_t c, fmi2_string_t instanceName, fmi2_status_t status, fmi2_string_t category, fmi2_string_t message, va_list args)
An implementation of FMI 2.0 logger that forwards the messages to logger function inside jm_callbacks...
FMILIB_EXPORT void fmi2_import_expand_variable_references(fmi2_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...
unsigned int num_outputs
Number of outputs.
unsigned int num_continuous
Number of continuous variables.
unsigned int num_real_vars
Number of real variables.
FMILIB_EXPORT void fmi2_import_collect_model_counts(fmi2_import_t *fmu, fmi2_import_model_counts_t *counts)
Collect model information by counting the number of variables with specific properties and fillinf in...
#define FMILIB_EXPORT
Used to declare the public API of the library needed for dynamic linking.
fmi1_capi_t * fmu
unsigned int num_enum_vars
Number of enumeration variables.
fmi2_status_t
Collection of counters providing model information.
unsigned int num_string_vars
Number of string variables.
unsigned int num_fixed
Number of fixed.
unsigned int num_parameters
Number of parameters.
The callbacks struct is sent to all the modules in the library.
Definition: jm_callbacks.h:73
unsigned int num_independent
Number of independent variables.
FMILIB_EXPORT void fmi2_default_callback_logger(fmi2_component_t c, fmi2_string_t instanceName, fmi2_status_t status, fmi2_string_t category, fmi2_string_t message,...)
Default FMI 2.0 logger may be used when instantiating FMUs.
unsigned int num_integer_vars
Number of integer variables.
unsigned int num_bool_vars
Number of boolean variables.
FMILIB_EXPORT void fmi2_log_forwarding(fmi2_component_t c, fmi2_string_t instanceName, fmi2_status_t status, fmi2_string_t category, fmi2_string_t message,...)
An implementation of FMI 2.0 logger that forwards the messages to logger function inside jm_callbacks...
unsigned int num_tunable
Number of tunable.
unsigned int num_constants
Number of constants.
struct fmi2_import_t fmi2_import_t
FMU version 2.0 object.