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

#include <Values.h>

Collaboration diagram for oms::Values:
Collaboration graph

Classes

struct  unitDefinitionsToExport
 

Public Member Functions

 Values ()
 
 ~Values ()
 
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 setString (const ComRef &cref, const std::string &value)
 
oms_status_enu_t setUnit (const ComRef &cref, const std::string &value)
 
void setUnitDefinitions (const ComRef &cref)
 
void getFilteredUnitDefinitionsToSSD (std::map< std::string, std::map< std::string, std::string >> &unitDefinitions)
 
void updateModelDescriptionRealStartValue (const ComRef &cref, double value)
 
void updateModelDescriptionIntegerStartValue (const ComRef &cref, int value)
 
void updateModelDescriptionBooleanStartValue (const ComRef &cref, bool value)
 
void updateModelDescriptionStringStartValue (const ComRef &cref, std::string value)
 
void updateModelDescriptionVariableUnit (const ComRef &cref, const std::string &value)
 
void copyModelDescriptionUnitToResources (Values &value)
 
oms_status_enu_t getBoolean (const ComRef &cref, bool &value)
 
oms_status_enu_t getInteger (const ComRef &cref, int &value)
 
oms_status_enu_t getReal (const ComRef &cref, double &value)
 
oms_status_enu_t getString (const ComRef &cref, std::string &value)
 
oms_status_enu_t setBooleanResources (const ComRef &cref, bool value, const ComRef &fullCref, bool externalInput, oms_modelState_enu_t modelState)
 
oms_status_enu_t setIntegerResources (const ComRef &cref, int value, const ComRef &fullCref, bool externalInput, oms_modelState_enu_t modelState)
 
oms_status_enu_t setRealResources (const ComRef &cref, double value, const ComRef &fullCref, bool externalInput, oms_modelState_enu_t modelState)
 
oms_status_enu_t setStringResources (const ComRef &cref, const std::string &value, const ComRef &fullCref, bool externalInput, oms_modelState_enu_t modelState)
 
oms_status_enu_t setUnitResources (const ComRef &cref, const std::string &value, const ComRef &fullCref)
 
oms_status_enu_t getBooleanResources (const ComRef &cref, bool &value, bool externalInput, oms_modelState_enu_t modelState)
 
oms_status_enu_t getIntegerResources (const ComRef &cref, int &value, bool externalInput, oms_modelState_enu_t modelState)
 
oms_status_enu_t getRealResources (const ComRef &cref, double &value, bool externalInput, oms_modelState_enu_t modelState)
 
oms_status_enu_t getStringResources (const ComRef &cref, std::string &value, bool externalInput, oms_modelState_enu_t modelState)
 
oms_status_enu_t getBooleanFromModeldescription (const ComRef &cref, bool &value)
 
oms_status_enu_t getIntegerFromModeldescription (const ComRef &cref, int &value)
 
oms_status_enu_t getRealFromModeldescription (const ComRef &cref, double &value)
 
oms_status_enu_t getStringFromModeldescription (const ComRef &cref, std::string &value)
 
std::string getUnit (ComRef &cref) const
 
std::string getUnitFromModeldescription (ComRef &cref) const
 
oms_status_enu_t exportToSSD (pugi::xml_node &node) const
 
oms_status_enu_t importFromSnapshot (const pugi::xml_node &node, const std::string &sspVersion, const Snapshot &snapshot, std::string variantName)
 
oms_status_enu_t importFromSnapshot (const Snapshot &snapshot, const std::string &ssvFilePath, const std::string &ssmFilename)
 
oms_status_enu_t deleteStartValue (const ComRef &cref)
 
oms_status_enu_t updateOrDeleteStartValueInReplacedComponent (Values &value, const ComRef &owner, std::vector< std::string > &warningList)
 
oms_status_enu_t deleteStartValueInResources (const ComRef &cref)
 
oms_status_enu_t deleteReferencesInSSD (const std::string &filename)
 
oms_status_enu_t deleteResourcesInSSP (const std::string &filename)
 
oms_status_enu_t exportToSSV (pugi::xml_node &ssvNode) const
 
oms_status_enu_t exportUnitDefinitions (Snapshot &snapshot, std::string filename, std::string variantName) const
 
oms_status_enu_t exportUnitDefinitionsToSSVTemplate (Snapshot &snapshot, std::string filename)
 
void importUnitDefinitions (const pugi::xml_node &node)
 
void exportToSSVTemplate (pugi::xml_node &ssvNode, const ComRef &cref)
 start values read from modelDescription.xml and creates a ssv template More...
 
void exportReduceSSV (pugi::xml_node &ssvNode, const ComRef &cref)
 reduced SSV file which contains only the referenced crefs in parametermapping More...
 
oms_status_enu_t exportToSSMTemplate (pugi::xml_node &ssmNode, const ComRef &cref)
 start values read from modelDescription.xml and creates a ssm template More...
 
oms_status_enu_t parseModelDescription (const filesystem::path &root, std::string &guid_)
 path without the filename, i.e. modelDescription.xml More...
 
oms_status_enu_t rename (const oms::ComRef &oldCref, const oms::ComRef &newCref)
 
oms_status_enu_t renameInResources (const oms::ComRef &oldCref, const oms::ComRef &newCref)
 
void exportParameterBindings (pugi::xml_node &node, Snapshot &snapshot, std::string variantName) const
 
bool hasResources ()
 returns if the system or subsystem or submodule have parameter resources either as ssv or inline More...
 

Public Attributes

std::map< ComRef, bool > booleanStartValues
 parameters and start values defined before instantiating the FMU More...
 
std::map< ComRef, double > realStartValues
 parameters and start values defined before instantiating the FMU More...
 
std::map< ComRef, int > integerStartValues
 parameters and start values defined before instantiating the FMU More...
 
std::map< ComRef, std::string > stringStartValues
 parameters and start values defined before instantiating the FMU More...
 
std::map< ComRef, bool > booleanValues
 input values defined after initialization More...
 
std::map< ComRef, double > realValues
 input values defined after initialization More...
 
std::map< ComRef, int > integerValues
 input values defined after initialization More...
 
std::map< ComRef, std::string > stringValues
 input values defined after initialization More...
 
std::map< ComRef, bool > modelDescriptionBooleanStartValues
 start values read from modelDescription.xml More...
 
std::map< ComRef, double > modelDescriptionRealStartValues
 start values read from modelDescription.xml More...
 
std::map< ComRef, int > modelDescriptionIntegerStartValues
 start values read from modelDescription.xml More...
 
std::map< ComRef, std::string > modelDescriptionStringStartValues
 start values read from modelDescription.xml More...
 
std::map< int, std::vector< int > > modelStructureOutputs
 output and its dependencies from <ModelStructure> More...
 
std::map< int, std::vector< int > > modelStructureDerivatives
 derivatives and its dependencies from <ModelStructure> More...
 
std::map< int, std::vector< int > > modelStructureInitialUnknowns
 initialUnknowns and its dependencies from <ModelStructure> More...
 
std::map< ComRef, std::string > modelDescriptionVariableUnits
 variable units read from modeldescription.xml More...
 
std::map< ComRef, std::string > variableUnits
 variable units set by user More...
 
std::vector< unitDefinitionsToExportunitDefinitionsToExportInSSP
 list of unitDefinitions to be exported in ssp More...
 
std::map< std::string, std::map< std::string, std::string > > modeldescriptionUnitDefinitions
 <UnitDefinitions> list read from modeldescription.xml More...
 
std::multimap< ComRef, ComRefmappedEntry
 parameter names and values provided in the parameter source are to be mapped to the parameters of the component or system More...
 
std::vector< ValuesparameterResources
 list of parameter resources provided inline or .ssv files More...
 
std::map< std::string, Valuesallresources
 mapped resources either inline or ssv More...
 
std::string ssmFile = ""
 mapped ssm files associated with ssv files; More...
 
bool linkResources = true
 

Private Member Functions

oms_status_enu_t exportStartValuesHelper (pugi::xml_node &node) const
 
void exportParameterMappingInline (pugi::xml_node &node) const
 
void exportParameterMappingToSSM (pugi::xml_node &node) const
 
oms_status_enu_t importStartValuesHelper (const pugi::xml_node &parameters)
 
void parseModelStructureDependencies (std::string &dependencies, std::vector< int > &dependencyList)
 
void importParameterMapping (const pugi::xml_node &parameterMapping)
 
oms::ComRef getMappedCrefEntry (const ComRef &cref) const
 
bool isEntryReferencedInSSM (const ComRef &cref) const
 
bool empty () const
 

Constructor & Destructor Documentation

◆ Values()

oms::Values::Values ( )

◆ ~Values()

oms::Values::~Values ( )

Member Function Documentation

◆ copyModelDescriptionUnitToResources()

void oms::Values::copyModelDescriptionUnitToResources ( Values value)
Here is the caller graph for this function:

◆ deleteReferencesInSSD()

oms_status_enu_t oms::Values::deleteReferencesInSSD ( const std::string &  filename)
Here is the caller graph for this function:

◆ deleteResourcesInSSP()

oms_status_enu_t oms::Values::deleteResourcesInSSP ( const std::string &  filename)
Here is the caller graph for this function:

◆ deleteStartValue()

oms_status_enu_t oms::Values::deleteStartValue ( const ComRef cref)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteStartValueInResources()

oms_status_enu_t oms::Values::deleteStartValueInResources ( const ComRef cref)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ empty()

bool oms::Values::empty ( ) const
private
Here is the caller graph for this function:

◆ exportParameterBindings()

void oms::Values::exportParameterBindings ( pugi::xml_node &  node,
Snapshot snapshot,
std::string  variantName 
) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportParameterMappingInline()

void oms::Values::exportParameterMappingInline ( pugi::xml_node &  node) const
private
Here is the caller graph for this function:

◆ exportParameterMappingToSSM()

void oms::Values::exportParameterMappingToSSM ( pugi::xml_node &  node) const
private

◆ exportReduceSSV()

void oms::Values::exportReduceSSV ( pugi::xml_node &  ssvNode,
const ComRef cref 
)

reduced SSV file which contains only the referenced crefs in parametermapping

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

◆ exportStartValuesHelper()

oms_status_enu_t oms::Values::exportStartValuesHelper ( pugi::xml_node &  node) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportToSSD()

oms_status_enu_t oms::Values::exportToSSD ( pugi::xml_node &  node) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportToSSMTemplate()

oms_status_enu_t oms::Values::exportToSSMTemplate ( pugi::xml_node &  ssmNode,
const ComRef cref 
)

start values read from modelDescription.xml and creates a ssm template

Here is the caller graph for this function:

◆ exportToSSV()

oms_status_enu_t oms::Values::exportToSSV ( pugi::xml_node &  ssvNode) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportToSSVTemplate()

void oms::Values::exportToSSVTemplate ( pugi::xml_node &  ssvNode,
const ComRef cref 
)

start values read from modelDescription.xml and creates a ssv template

Here is the caller graph for this function:

◆ exportUnitDefinitions()

oms_status_enu_t oms::Values::exportUnitDefinitions ( Snapshot snapshot,
std::string  filename,
std::string  variantName 
) const
Here is the call graph for this function:

◆ exportUnitDefinitionsToSSVTemplate()

oms_status_enu_t oms::Values::exportUnitDefinitionsToSSVTemplate ( Snapshot snapshot,
std::string  filename 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBoolean()

oms_status_enu_t oms::Values::getBoolean ( const ComRef cref,
bool &  value 
)
Here is the caller graph for this function:

◆ getBooleanFromModeldescription()

oms_status_enu_t oms::Values::getBooleanFromModeldescription ( const ComRef cref,
bool &  value 
)
Here is the caller graph for this function:

◆ getBooleanResources()

oms_status_enu_t oms::Values::getBooleanResources ( const ComRef cref,
bool &  value,
bool  externalInput,
oms_modelState_enu_t  modelState 
)
Here is the caller graph for this function:

◆ getFilteredUnitDefinitionsToSSD()

void oms::Values::getFilteredUnitDefinitionsToSSD ( std::map< std::string, std::map< std::string, std::string >> &  unitDefinitions)
Here is the caller graph for this function:

◆ getInteger()

oms_status_enu_t oms::Values::getInteger ( const ComRef cref,
int &  value 
)
Here is the caller graph for this function:

◆ getIntegerFromModeldescription()

oms_status_enu_t oms::Values::getIntegerFromModeldescription ( const ComRef cref,
int &  value 
)
Here is the caller graph for this function:

◆ getIntegerResources()

oms_status_enu_t oms::Values::getIntegerResources ( const ComRef cref,
int &  value,
bool  externalInput,
oms_modelState_enu_t  modelState 
)
Here is the caller graph for this function:

◆ getMappedCrefEntry()

oms::ComRef oms::Values::getMappedCrefEntry ( const ComRef cref) const
private
Here is the caller graph for this function:

◆ getReal()

oms_status_enu_t oms::Values::getReal ( const ComRef cref,
double &  value 
)
Here is the caller graph for this function:

◆ getRealFromModeldescription()

oms_status_enu_t oms::Values::getRealFromModeldescription ( const ComRef cref,
double &  value 
)
Here is the caller graph for this function:

◆ getRealResources()

oms_status_enu_t oms::Values::getRealResources ( const ComRef cref,
double &  value,
bool  externalInput,
oms_modelState_enu_t  modelState 
)
Here is the caller graph for this function:

◆ getString()

oms_status_enu_t oms::Values::getString ( const ComRef cref,
std::string &  value 
)
Here is the caller graph for this function:

◆ getStringFromModeldescription()

oms_status_enu_t oms::Values::getStringFromModeldescription ( const ComRef cref,
std::string &  value 
)
Here is the caller graph for this function:

◆ getStringResources()

oms_status_enu_t oms::Values::getStringResources ( const ComRef cref,
std::string &  value,
bool  externalInput,
oms_modelState_enu_t  modelState 
)
Here is the caller graph for this function:

◆ getUnit()

std::string oms::Values::getUnit ( ComRef cref) const
Here is the caller graph for this function:

◆ getUnitFromModeldescription()

std::string oms::Values::getUnitFromModeldescription ( ComRef cref) const
Here is the caller graph for this function:

◆ hasResources()

bool oms::Values::hasResources ( )

returns if the system or subsystem or submodule have parameter resources either as ssv or inline

Here is the caller graph for this function:

◆ importFromSnapshot() [1/2]

oms_status_enu_t oms::Values::importFromSnapshot ( const pugi::xml_node &  node,
const std::string &  sspVersion,
const Snapshot snapshot,
std::string  variantName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importFromSnapshot() [2/2]

oms_status_enu_t oms::Values::importFromSnapshot ( const Snapshot snapshot,
const std::string &  ssvFilePath,
const std::string &  ssmFilename 
)
Here is the call graph for this function:

◆ importParameterMapping()

void oms::Values::importParameterMapping ( const pugi::xml_node &  parameterMapping)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importStartValuesHelper()

oms_status_enu_t oms::Values::importStartValuesHelper ( const pugi::xml_node &  parameters)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importUnitDefinitions()

void oms::Values::importUnitDefinitions ( const pugi::xml_node &  node)
Here is the caller graph for this function:

◆ isEntryReferencedInSSM()

bool oms::Values::isEntryReferencedInSSM ( const ComRef cref) const
private
Here is the caller graph for this function:

◆ parseModelDescription()

oms_status_enu_t oms::Values::parseModelDescription ( const filesystem::path &  root,
std::string &  guid_ 
)

path without the filename, i.e. modelDescription.xml

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

◆ parseModelStructureDependencies()

void oms::Values::parseModelStructureDependencies ( std::string &  dependencies,
std::vector< int > &  dependencyList 
)
private
Here is the caller graph for this function:

◆ rename()

oms_status_enu_t oms::Values::rename ( const oms::ComRef oldCref,
const oms::ComRef newCref 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ renameInResources()

oms_status_enu_t oms::Values::renameInResources ( const oms::ComRef oldCref,
const oms::ComRef newCref 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBoolean()

oms_status_enu_t oms::Values::setBoolean ( const ComRef cref,
bool  value 
)
Here is the caller graph for this function:

◆ setBooleanResources()

oms_status_enu_t oms::Values::setBooleanResources ( const ComRef cref,
bool  value,
const ComRef fullCref,
bool  externalInput,
oms_modelState_enu_t  modelState 
)
Here is the caller graph for this function:

◆ setInteger()

oms_status_enu_t oms::Values::setInteger ( const ComRef cref,
int  value 
)
Here is the caller graph for this function:

◆ setIntegerResources()

oms_status_enu_t oms::Values::setIntegerResources ( const ComRef cref,
int  value,
const ComRef fullCref,
bool  externalInput,
oms_modelState_enu_t  modelState 
)
Here is the caller graph for this function:

◆ setReal()

oms_status_enu_t oms::Values::setReal ( const ComRef cref,
double  value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRealResources()

oms_status_enu_t oms::Values::setRealResources ( const ComRef cref,
double  value,
const ComRef fullCref,
bool  externalInput,
oms_modelState_enu_t  modelState 
)
Here is the caller graph for this function:

◆ setString()

oms_status_enu_t oms::Values::setString ( const ComRef cref,
const std::string &  value 
)
Here is the caller graph for this function:

◆ setStringResources()

oms_status_enu_t oms::Values::setStringResources ( const ComRef cref,
const std::string &  value,
const ComRef fullCref,
bool  externalInput,
oms_modelState_enu_t  modelState 
)
Here is the caller graph for this function:

◆ setUnit()

oms_status_enu_t oms::Values::setUnit ( const ComRef cref,
const std::string &  value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUnitDefinitions()

void oms::Values::setUnitDefinitions ( const ComRef cref)
Here is the caller graph for this function:

◆ setUnitResources()

oms_status_enu_t oms::Values::setUnitResources ( const ComRef cref,
const std::string &  value,
const ComRef fullCref 
)
Here is the caller graph for this function:

◆ updateModelDescriptionBooleanStartValue()

void oms::Values::updateModelDescriptionBooleanStartValue ( const ComRef cref,
bool  value 
)
Here is the caller graph for this function:

◆ updateModelDescriptionIntegerStartValue()

void oms::Values::updateModelDescriptionIntegerStartValue ( const ComRef cref,
int  value 
)
Here is the caller graph for this function:

◆ updateModelDescriptionRealStartValue()

void oms::Values::updateModelDescriptionRealStartValue ( const ComRef cref,
double  value 
)
Here is the caller graph for this function:

◆ updateModelDescriptionStringStartValue()

void oms::Values::updateModelDescriptionStringStartValue ( const ComRef cref,
std::string  value 
)
Here is the caller graph for this function:

◆ updateModelDescriptionVariableUnit()

void oms::Values::updateModelDescriptionVariableUnit ( const ComRef cref,
const std::string &  value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateOrDeleteStartValueInReplacedComponent()

oms_status_enu_t oms::Values::updateOrDeleteStartValueInReplacedComponent ( Values value,
const ComRef owner,
std::vector< std::string > &  warningList 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ allresources

std::map<std::string, Values> oms::Values::allresources

mapped resources either inline or ssv

◆ booleanStartValues

std::map<ComRef, bool> oms::Values::booleanStartValues

parameters and start values defined before instantiating the FMU

◆ booleanValues

std::map<ComRef, bool> oms::Values::booleanValues

input values defined after initialization

◆ integerStartValues

std::map<ComRef, int> oms::Values::integerStartValues

parameters and start values defined before instantiating the FMU

◆ integerValues

std::map<ComRef, int> oms::Values::integerValues

input values defined after initialization

◆ linkResources

bool oms::Values::linkResources = true

◆ mappedEntry

std::multimap<ComRef, ComRef> oms::Values::mappedEntry

parameter names and values provided in the parameter source are to be mapped to the parameters of the component or system

◆ modelDescriptionBooleanStartValues

std::map<ComRef, bool> oms::Values::modelDescriptionBooleanStartValues

start values read from modelDescription.xml

◆ modelDescriptionIntegerStartValues

std::map<ComRef, int> oms::Values::modelDescriptionIntegerStartValues

start values read from modelDescription.xml

◆ modelDescriptionRealStartValues

std::map<ComRef, double> oms::Values::modelDescriptionRealStartValues

start values read from modelDescription.xml

◆ modelDescriptionStringStartValues

std::map<ComRef, std::string> oms::Values::modelDescriptionStringStartValues

start values read from modelDescription.xml

◆ modeldescriptionUnitDefinitions

std::map<std::string, std::map<std::string, std::string> > oms::Values::modeldescriptionUnitDefinitions

<UnitDefinitions> list read from modeldescription.xml

◆ modelDescriptionVariableUnits

std::map<ComRef, std::string> oms::Values::modelDescriptionVariableUnits

variable units read from modeldescription.xml

◆ modelStructureDerivatives

std::map<int, std::vector<int> > oms::Values::modelStructureDerivatives

derivatives and its dependencies from <ModelStructure>

◆ modelStructureInitialUnknowns

std::map<int, std::vector<int> > oms::Values::modelStructureInitialUnknowns

initialUnknowns and its dependencies from <ModelStructure>

◆ modelStructureOutputs

std::map<int, std::vector<int> > oms::Values::modelStructureOutputs

output and its dependencies from <ModelStructure>

◆ parameterResources

std::vector<Values> oms::Values::parameterResources

list of parameter resources provided inline or .ssv files

◆ realStartValues

std::map<ComRef, double> oms::Values::realStartValues

parameters and start values defined before instantiating the FMU

◆ realValues

std::map<ComRef, double> oms::Values::realValues

input values defined after initialization

◆ ssmFile

std::string oms::Values::ssmFile = ""

mapped ssm files associated with ssv files;

◆ stringStartValues

std::map<ComRef, std::string> oms::Values::stringStartValues

parameters and start values defined before instantiating the FMU

◆ stringValues

std::map<ComRef, std::string> oms::Values::stringValues

input values defined after initialization

◆ unitDefinitionsToExportInSSP

std::vector<unitDefinitionsToExport> oms::Values::unitDefinitionsToExportInSSP

list of unitDefinitions to be exported in ssp

◆ variableUnits

std::map<ComRef, std::string> oms::Values::variableUnits

variable units set by user


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