Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
sumo2fmi_bridge.c File Reference
#include <foreign/fmi/fmi2Functions.h>
#include <string.h>
#include "libsumocpp2c.h"
#include "sumo2fmi_bridge.h"
Include dependency graph for sumo2fmi_bridge.c:

Go to the source code of this file.

Macros

#define BUFFER_SIZE   256
 
#define UNREFERENCED_PARAMETER(P)   (P)
 

Functions

fmi2Status sumo2fmi_getInteger (ModelInstance *comp, const fmi2ValueReference vr, int *value)
 
fmi2Status sumo2fmi_getString (ModelInstance *comp, const fmi2ValueReference vr, fmi2String *value)
 
void sumo2fmi_logError (ModelInstance *comp, const char *message,...)
 
void sumo2fmi_logEvent (ModelInstance *comp, const char *message,...)
 
void sumo2fmi_logMessage (ModelInstance *comp, int status, const char *category, const char *message, va_list args)
 
void sumo2fmi_set_startValues (ModelInstance *comp)
 
fmi2Status sumo2fmi_setString (ModelInstance *comp, fmi2ValueReference vr, fmi2String value)
 
fmi2Status sumo2fmi_step (ModelInstance *comp, double tNext)
 

Detailed Description

Author
Robert Hilbrich
Matthias Schwamborn
Date
Tue, 03 Mar 2020

Definition in file sumo2fmi_bridge.c.

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   256

Definition at line 37 of file sumo2fmi_bridge.c.

◆ UNREFERENCED_PARAMETER

#define UNREFERENCED_PARAMETER (   P)    (P)

Definition at line 35 of file sumo2fmi_bridge.c.

Function Documentation

◆ sumo2fmi_getInteger()

fmi2Status sumo2fmi_getInteger ( ModelInstance comp,
const fmi2ValueReference  vr,
int *  value 
)

Definition at line 107 of file sumo2fmi_bridge.c.

References fmi2Error, fmi2OK, libsumo_vehicle_getIDCount(), and UNREFERENCED_PARAMETER.

Referenced by fmi2GetInteger().

Here is the caller graph for this function:

◆ sumo2fmi_getString()

fmi2Status sumo2fmi_getString ( ModelInstance comp,
const fmi2ValueReference  vr,
fmi2String value 
)

Definition at line 120 of file sumo2fmi_bridge.c.

References fmi2Error, fmi2OK, ModelInstance::getterParameters, libsumo_vehicle_getLaneID(), libsumo_vehicle_getParameterWithKey(), libsumo_vehicle_getPosition(), and ModelInstance::libsumoCallOptions.

Referenced by fmi2GetString().

Here is the caller graph for this function:

◆ sumo2fmi_logError()

void sumo2fmi_logError ( ModelInstance comp,
const char *  message,
  ... 
)

Definition at line 74 of file sumo2fmi_bridge.c.

References fmi2Error, ModelInstance::logErrors, and sumo2fmi_logMessage().

Referenced by fmi2SetDebugLogging(), and sumo2fmi_set_startValues().

Here is the caller graph for this function:

◆ sumo2fmi_logEvent()

void sumo2fmi_logEvent ( ModelInstance comp,
const char *  message,
  ... 
)

Definition at line 62 of file sumo2fmi_bridge.c.

References fmi2OK, ModelInstance::logEvents, and sumo2fmi_logMessage().

Referenced by fmi2ExitInitializationMode().

Here is the caller graph for this function:

◆ sumo2fmi_logMessage()

void sumo2fmi_logMessage ( ModelInstance comp,
int  status,
const char *  category,
const char *  message,
va_list  args 
)

Definition at line 86 of file sumo2fmi_bridge.c.

References ModelInstance::allocateMemory, ModelInstance::componentEnvironment, ModelInstance::freeMemory, ModelInstance::instanceName, and ModelInstance::logger.

Referenced by sumo2fmi_logError(), and sumo2fmi_logEvent().

Here is the caller graph for this function:

◆ sumo2fmi_set_startValues()

void sumo2fmi_set_startValues ( ModelInstance comp)

Definition at line 40 of file sumo2fmi_bridge.c.

References ModelInstance::allocateMemory, BUFFER_SIZE, ModelInstance::freeMemory, ModelInstance::libsumoCallOptions, and sumo2fmi_logError().

Referenced by fmi2SetupExperiment().

Here is the caller graph for this function:

◆ sumo2fmi_setString()

fmi2Status sumo2fmi_setString ( ModelInstance comp,
fmi2ValueReference  vr,
fmi2String  value 
)

Definition at line 143 of file sumo2fmi_bridge.c.

References ModelInstance::allocateMemory, fmi2Error, fmi2OK, ModelInstance::freeMemory, ModelInstance::getterParameters, libsumo_vehicle_moveToXY(), and ModelInstance::libsumoCallOptions.

Referenced by fmi2SetString().

Here is the caller graph for this function:

◆ sumo2fmi_step()

fmi2Status sumo2fmi_step ( ModelInstance comp,
double  tNext 
)

Definition at line 164 of file sumo2fmi_bridge.c.

References fmi2OK, libsumo_step(), and UNREFERENCED_PARAMETER.

Referenced by fmi2DoStep().

Here is the caller graph for this function: