MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
mbdynFMI.cc File Reference
#include "mbconfig.h"
#include "mbdynFMI.h"
#include "stepsol.h"
#include <sstream>
#include <iostream>
#include <fmilib.h>
#include <FMI2/fmi2_import.h>
#include <FMI/fmi_version.h>
#include <FMI2/fmi2_types.h>
#include <FMI2/fmi2_functions.h>
#include <FMI2/fmi2_enums.h>
#include <FMI/fmi_util.h>
#include "fmi2_import_impl.h"
#include <FMI1/fmi1_import.h>
#include <FMI1/fmi1_types.h>
#include <FMI1/fmi1_functions.h>
#include <FMI1/fmi1_enums.h>
#include "fmi1_import_impl.h"
Include dependency graph for mbdynFMI.cc:

Go to the source code of this file.

Macros

#define STATUSCHECK(a)
 

Functions

void do_event_iteration (fmi2_import_t *fmu, fmi2_event_info_t *eventInfo)
 
static void stepFinished (fmi2_component_environment_t env, fmi2_status_t status)
 
int annotation_start_handle (void *context, const char *parentName, void *parent, const char *elm, const char **attr)
 
int annotation_data_handle (void *context, const char *s, int len)
 
int annotation_end_handle (void *context, const char *elm)
 

Variables

fmi2_xml_callbacks_t annotation_callbacks
 

Macro Definition Documentation

Function Documentation

int annotation_data_handle ( void *  context,
const char *  s,
int  len 
)

Definition at line 110 of file mbdynFMI.cc.

110  {
111  int i;
112  for(i = 0; i < len; i++){
113  printf("%c", s[i]);
114  }
115  return 0;
116 }
int annotation_end_handle ( void *  context,
const char *  elm 
)

Definition at line 118 of file mbdynFMI.cc.

118  {
119  printf("\nAnnotation element %s end\n", elm);
120  return 0;
121 }
int annotation_start_handle ( void *  context,
const char *  parentName,
void *  parent,
const char *  elm,
const char **  attr 
)

Definition at line 98 of file mbdynFMI.cc.

98  {
99  int i = 0;
100  printf("Annotation element %s start (tool: %s, parent:%s)\n", elm, parentName,
101  parent?fmi2_import_get_variable_name((fmi2_import_variable_t*)parent):"model");
102  while(attr[i]) {
103  printf("Attribute %s = %s\n", attr[i], attr[i+1]);
104  i+=2;
105  }
106  printf("Annotation data:\n");
107  return 0;
108 }
void do_event_iteration ( fmi2_import_t *  fmu,
fmi2_event_info_t *  eventInfo 
)

Definition at line 84 of file mbdynFMI.cc.

Referenced by fmu2::CheckInterrupts(), and fmu2::Initialize().

85 {
86  eventInfo->newDiscreteStatesNeeded = fmi2_true;
87  eventInfo->terminateSimulation = fmi2_false;
88  while (eventInfo->newDiscreteStatesNeeded && !eventInfo->terminateSimulation) {
89  fmi2_import_new_discrete_states(fmu, eventInfo);
90  }
91 }
Definition: mbdynFMI.h:65
static void stepFinished ( fmi2_component_environment_t  env,
fmi2_status_t  status 
)
static

Definition at line 93 of file mbdynFMI.cc.

Referenced by fmu2::setCallBackFunction().

93  {
94  silent_cout("stepFinished is called with fmiStatus = "<< fmi2_status_to_string(status)<<std::endl);
95 }

Variable Documentation

fmi2_xml_callbacks_t annotation_callbacks
Initial value:
= {
annotation_end_handle, ((void*)0) }
int annotation_end_handle(void *context, const char *elm)
Definition: mbdynFMI.cc:118
int annotation_start_handle(void *context, const char *parentName, void *parent, const char *elm, const char **attr)
Definition: mbdynFMI.cc:98
int annotation_data_handle(void *context, const char *s, int len)
Definition: mbdynFMI.cc:110

Definition at line 124 of file mbdynFMI.cc.

Referenced by fmu2::parseXML().