OMSimulatorLib
The OMSimulator project is a FMI-based co-simulation environment that supports ordinary (i.e., non-delayed) and TLM connections.
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
oms::ComponentFMUCS Class Reference

#include <ComponentFMUCS.h>

Inheritance diagram for oms::ComponentFMUCS:
Inheritance graph
Collaboration diagram for oms::ComponentFMUCS:
Collaboration graph

Public Member Functions

 ~ComponentFMUCS ()
 
const FMUInfogetFMUInfo () const
 
oms_status_enu_t exportToSSD (pugi::xml_node &node, pugi::xml_node &ssvNode) const
 
oms_status_enu_t exportToSSVTemplate (pugi::xml_node &ssvNode)
 
oms_status_enu_t exportToSSMTemplate (pugi::xml_node &ssmNode)
 
oms_status_enu_t instantiate ()
 
oms_status_enu_t initialize ()
 
oms_status_enu_t terminate ()
 
oms_status_enu_t reset ()
 
oms_status_enu_t stepUntil (double stopTime)
 
oms_status_enu_t initializeDependencyGraph_initialUnknowns ()
 
oms_status_enu_t initializeDependencyGraph_outputs ()
 
VariablegetVariable (const ComRef &cref)
 
oms_status_enu_t getBoolean (const ComRef &cref, bool &value)
 
oms_status_enu_t getBoolean (const fmi2_value_reference_t &vr, bool &value)
 
oms_status_enu_t getInteger (const ComRef &cref, int &value)
 
oms_status_enu_t getInteger (const fmi2_value_reference_t &vr, int &value)
 
oms_status_enu_t getReal (const ComRef &cref, double &value)
 
oms_status_enu_t getReal (const fmi2_value_reference_t &vr, double &value)
 
oms_status_enu_t setBoolean (const ComRef &cref, bool value)
 
oms_status_enu_t setInteger (const ComRef &cref, int value)
 
oms_status_enu_t setReal (const ComRef &cref, double value)
 
oms_status_enu_t deleteStartValue (const ComRef &cref)
 
oms_status_enu_t setFmuTime (double time)
 
fmi2_import_t * getFMU ()
 
std::vector< VariablegetAllVariables ()
 
std::vector< VariablegetInputs ()
 
std::vector< VariablegetOutputs ()
 
oms_status_enu_t getRealOutputDerivative (const ComRef &cref, SignalDerivative &der)
 
oms_status_enu_t setRealInputDerivative (const ComRef &cref, const SignalDerivative &der)
 
oms_status_enu_t registerSignalsForResultFile (ResultWriter &resultFile)
 
oms_status_enu_t updateSignals (ResultWriter &resultWriter)
 
oms_status_enu_t addSignalsToResults (const char *regex)
 
oms_status_enu_t removeSignalsFromResults (const char *regex)
 
bool getCanGetAndSetState ()
 
oms_status_enu_t saveState ()
 
oms_status_enu_t freeState ()
 
oms_status_enu_t restoreState ()
 
oms_status_enu_t setFaultInjection (const ComRef &signal, oms_fault_type_enu_t faultType, double faultValue)
 
- Public Member Functions inherited from oms::Component
virtual ~Component ()
 
const ComRefgetCref () const
 
ComRef getFullCref () const
 
ElementgetElement ()
 
ConnectorgetConnector (const ComRef &cref)
 
Connector ** getConnectors ()
 
oms_status_enu_t deleteConnector (const ComRef &cref)
 
oms_status_enu_t getAllResources (std::vector< std::string > &resources) const
 
const std::string & getPath () const
 
const std::string & getTempDir () const
 
void setTempDir (const std::string &tempDir)
 
oms_component_enu_t getType () const
 
void fetchAllVars (bool enableOption)
 
SystemgetParentSystem () const
 
ModelgetModel () const
 
void setGeometry (const ssd::ElementGeometry &geometry)
 
oms_status_enu_t addTLMBus (const oms::ComRef &cref, oms_tlm_domain_t domain, const int dimensions, const oms_tlm_interpolation_t interpolation)
 
oms::TLMBusConnectorgetTLMBusConnector (const oms::ComRef &cref)
 
TLMBusConnector ** getTLMBusConnectors ()
 
oms_status_enu_t addConnectorToTLMBus (const ComRef &busCref, const ComRef &connectorCref, const std::string type)
 
oms_status_enu_t deleteConnectorFromTLMBus (const ComRef &busCref, const ComRef &connectorCref)
 
const DirectedGraphgetInitialUnknownsGraph ()
 
const DirectedGraphgetOutputsGraph ()
 

Static Public Member Functions

static ComponentNewComponent (const ComRef &cref, System *parentSystem, const std::string &fmuPath)
 
static ComponentNewComponent (const pugi::xml_node &node, System *parentSystem, const std::string &sspVersion)
 

Protected Member Functions

 ComponentFMUCS (const ComRef &cref, System *parentSystem, const std::string &fmuPath)
 
 ComponentFMUCS (ComponentFMUCS const &copy)
 not implemented More...
 
ComponentFMUCSoperator= (ComponentFMUCS const &copy)
 not implemented More...
 
- Protected Member Functions inherited from oms::Component
 Component (const ComRef &cref, oms_component_enu_t type, System *parentSystem, const std::string &path)
 
 Component (Component const &)
 not implemented More...
 
Componentoperator= (Component const &)
 not implemented More...
 

Private Member Functions

oms::ComRef getValidCref (ComRef cref)
 

Private Attributes

jm_callbacks callbacks
 
fmi2_callback_functions_t callbackFunctions
 
fmi_import_context_t * context = NULL
 
fmi2_import_t * fmu = NULL
 
FMUInfo fmuInfo
 
std::vector< VariableallVariables
 
std::vector< Variableinputs
 
std::vector< Variableoutputs
 
std::vector< Variableparameters
 
std::vector< VariablecalculatedParameters
 
std::vector< bool > exportVariables
 
Values values
 start values defined before instantiating the FMU and external inputs defined after initialization More...
 
std::unordered_map< unsigned int, unsigned int > resultFileMapping
 
double time
 
fmi2_FMU_state_t fmuState = NULL
 
double fmuStateTime
 
std::map< fmi2_value_reference_t, oms_fault_type_tfib
 fault injection blocks More...
 

Additional Inherited Members

- Protected Attributes inherited from oms::Component
DirectedGraph initialUnknownsGraph
 
DirectedGraph outputsGraph
 
Element element
 
std::vector< Connector * > connectors
 
std::vector< TLMBusConnector * > tlmbusconnectors
 
Clock clock
 
unsigned int clock_id
 
bool fetchAllVars_ = false
 

Constructor & Destructor Documentation

◆ ~ComponentFMUCS()

oms::ComponentFMUCS::~ComponentFMUCS ( )

◆ ComponentFMUCS() [1/2]

oms::ComponentFMUCS::ComponentFMUCS ( const ComRef cref,
System parentSystem,
const std::string &  fmuPath 
)
protected
Here is the caller graph for this function:

◆ ComponentFMUCS() [2/2]

oms::ComponentFMUCS::ComponentFMUCS ( ComponentFMUCS const &  copy)
protected

not implemented

Member Function Documentation

◆ addSignalsToResults()

oms_status_enu_t oms::ComponentFMUCS::addSignalsToResults ( const char *  regex)
virtual

Implements oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteStartValue()

oms_status_enu_t oms::ComponentFMUCS::deleteStartValue ( const ComRef cref)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportToSSD()

oms_status_enu_t oms::ComponentFMUCS::exportToSSD ( pugi::xml_node &  node,
pugi::xml_node &  ssvNode 
) const
virtual

Implements oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportToSSMTemplate()

oms_status_enu_t oms::ComponentFMUCS::exportToSSMTemplate ( pugi::xml_node &  ssmNode)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportToSSVTemplate()

oms_status_enu_t oms::ComponentFMUCS::exportToSSVTemplate ( pugi::xml_node &  ssvNode)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freeState()

oms_status_enu_t oms::ComponentFMUCS::freeState ( )
virtual

Reimplemented from oms::Component.

Here is the caller graph for this function:

◆ getAllVariables()

std::vector<Variable> oms::ComponentFMUCS::getAllVariables ( )
inline

◆ getBoolean() [1/2]

oms_status_enu_t oms::ComponentFMUCS::getBoolean ( const ComRef cref,
bool &  value 
)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBoolean() [2/2]

oms_status_enu_t oms::ComponentFMUCS::getBoolean ( const fmi2_value_reference_t &  vr,
bool &  value 
)

◆ getCanGetAndSetState()

bool oms::ComponentFMUCS::getCanGetAndSetState ( )
inlinevirtual

Reimplemented from oms::Component.

Here is the call graph for this function:

◆ getFMU()

fmi2_import_t* oms::ComponentFMUCS::getFMU ( )
inline

◆ getFMUInfo()

const FMUInfo* oms::ComponentFMUCS::getFMUInfo ( ) const
inlinevirtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInputs()

std::vector<Variable> oms::ComponentFMUCS::getInputs ( )
inline

◆ getInteger() [1/2]

oms_status_enu_t oms::ComponentFMUCS::getInteger ( const ComRef cref,
int &  value 
)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInteger() [2/2]

oms_status_enu_t oms::ComponentFMUCS::getInteger ( const fmi2_value_reference_t &  vr,
int &  value 
)

◆ getOutputs()

std::vector<Variable> oms::ComponentFMUCS::getOutputs ( )
inline
Here is the call graph for this function:

◆ getReal() [1/2]

oms_status_enu_t oms::ComponentFMUCS::getReal ( const ComRef cref,
double &  value 
)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getReal() [2/2]

oms_status_enu_t oms::ComponentFMUCS::getReal ( const fmi2_value_reference_t &  vr,
double &  value 
)

◆ getRealOutputDerivative()

oms_status_enu_t oms::ComponentFMUCS::getRealOutputDerivative ( const ComRef cref,
SignalDerivative der 
)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getValidCref()

oms::ComRef oms::ComponentFMUCS::getValidCref ( ComRef  cref)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVariable()

oms::Variable * oms::ComponentFMUCS::getVariable ( const ComRef cref)
virtual

Implements oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

oms_status_enu_t oms::ComponentFMUCS::initialize ( )
virtual

Implements oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeDependencyGraph_initialUnknowns()

oms_status_enu_t oms::ComponentFMUCS::initializeDependencyGraph_initialUnknowns ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeDependencyGraph_outputs()

oms_status_enu_t oms::ComponentFMUCS::initializeDependencyGraph_outputs ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ instantiate()

oms_status_enu_t oms::ComponentFMUCS::instantiate ( )
virtual

Implements oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NewComponent() [1/2]

oms::Component * oms::ComponentFMUCS::NewComponent ( const ComRef cref,
oms::System parentSystem,
const std::string &  fmuPath 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ NewComponent() [2/2]

oms::Component * oms::ComponentFMUCS::NewComponent ( const pugi::xml_node &  node,
oms::System parentSystem,
const std::string &  sspVersion 
)
static
Here is the call graph for this function:

◆ operator=()

ComponentFMUCS& oms::ComponentFMUCS::operator= ( ComponentFMUCS const &  copy)
protected

not implemented

Here is the caller graph for this function:

◆ registerSignalsForResultFile()

oms_status_enu_t oms::ComponentFMUCS::registerSignalsForResultFile ( ResultWriter resultFile)
virtual

Implements oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeSignalsFromResults()

oms_status_enu_t oms::ComponentFMUCS::removeSignalsFromResults ( const char *  regex)
virtual

Implements oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

oms_status_enu_t oms::ComponentFMUCS::reset ( )
virtual

Implements oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ restoreState()

oms_status_enu_t oms::ComponentFMUCS::restoreState ( )
virtual

Reimplemented from oms::Component.

Here is the caller graph for this function:

◆ saveState()

oms_status_enu_t oms::ComponentFMUCS::saveState ( )
virtual

Reimplemented from oms::Component.

Here is the caller graph for this function:

◆ setBoolean()

oms_status_enu_t oms::ComponentFMUCS::setBoolean ( const ComRef cref,
bool  value 
)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFaultInjection()

oms_status_enu_t oms::ComponentFMUCS::setFaultInjection ( const ComRef signal,
oms_fault_type_enu_t  faultType,
double  faultValue 
)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFmuTime()

oms_status_enu_t oms::ComponentFMUCS::setFmuTime ( double  time)
inline

◆ setInteger()

oms_status_enu_t oms::ComponentFMUCS::setInteger ( const ComRef cref,
int  value 
)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setReal()

oms_status_enu_t oms::ComponentFMUCS::setReal ( const ComRef cref,
double  value 
)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRealInputDerivative()

oms_status_enu_t oms::ComponentFMUCS::setRealInputDerivative ( const ComRef cref,
const SignalDerivative der 
)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stepUntil()

oms_status_enu_t oms::ComponentFMUCS::stepUntil ( double  stopTime)
virtual

Reimplemented from oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ terminate()

oms_status_enu_t oms::ComponentFMUCS::terminate ( )
virtual

Implements oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateSignals()

oms_status_enu_t oms::ComponentFMUCS::updateSignals ( ResultWriter resultWriter)
virtual

Implements oms::Component.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ allVariables

std::vector<Variable> oms::ComponentFMUCS::allVariables
private

◆ calculatedParameters

std::vector<Variable> oms::ComponentFMUCS::calculatedParameters
private

◆ callbackFunctions

fmi2_callback_functions_t oms::ComponentFMUCS::callbackFunctions
private

◆ callbacks

jm_callbacks oms::ComponentFMUCS::callbacks
private

◆ context

fmi_import_context_t* oms::ComponentFMUCS::context = NULL
private

◆ exportVariables

std::vector<bool> oms::ComponentFMUCS::exportVariables
private

◆ fib

std::map<fmi2_value_reference_t, oms_fault_type_t> oms::ComponentFMUCS::fib
private

fault injection blocks

◆ fmu

fmi2_import_t* oms::ComponentFMUCS::fmu = NULL
private

◆ fmuInfo

FMUInfo oms::ComponentFMUCS::fmuInfo
private

◆ fmuState

fmi2_FMU_state_t oms::ComponentFMUCS::fmuState = NULL
private

◆ fmuStateTime

double oms::ComponentFMUCS::fmuStateTime
private

◆ inputs

std::vector<Variable> oms::ComponentFMUCS::inputs
private

◆ outputs

std::vector<Variable> oms::ComponentFMUCS::outputs
private

◆ parameters

std::vector<Variable> oms::ComponentFMUCS::parameters
private

◆ resultFileMapping

std::unordered_map<unsigned int , unsigned int > oms::ComponentFMUCS::resultFileMapping
private

◆ time

double oms::ComponentFMUCS::time
private

◆ values

Values oms::ComponentFMUCS::values
private

start values defined before instantiating the FMU and external inputs defined after initialization


The documentation for this class was generated from the following files: