OMSimulatorLib The OMSimulator project is a FMI-based co-simulation environment.

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
oms::Model Class Reference

`#include <Model.h>`

Collaboration diagram for oms::Model:
[legend]

## Public Member Functions
| ~Model ()
const ComRef & | getCref () const
System * | getSystem (const ComRef &cref)
oms_status_enu_t | delete_ (const ComRef &cref)
Component * | getComponent (const ComRef &cref)
System * | getTopLevelSystem () const
std::string | getTempDirectory () const
oms_status_enu_t | rename (const ComRef &cref)
oms_status_enu_t | rename (const ComRef &cref, const ComRef &newCref)
oms_status_enu_t | list (const ComRef &cref, char **contents)
oms_status_enu_t | listVariants (const ComRef &cref, char **contents)
oms_status_enu_t | addSystem (const ComRef &cref, oms_system_enu_t type)
oms_status_enu_t | newResources (const ComRef &cref)
oms_status_enu_t | addResources (const ComRef &cref, const std::string &path)
oms_status_enu_t | deleteReferencesInSSD (const ComRef &cref)
oms_status_enu_t | deleteResourcesInSSP (const std::string &filename)
oms_status_enu_t | duplicateVariant (const ComRef &crefA, const ComRef &crefB)
oms_status_enu_t | activateVariant (const ComRef &crefA, const ComRef &crefB)
oms_status_enu_t | referenceResources (const ComRef &cref, const std::string &ssmFile)
oms_status_enu_t | reduceSSV (const std::string &ssvfile, const std::string &ssmfile, const std::string &filepath)
oms_status_enu_t | exportToSSD (Snapshot &snapshot) const
oms_status_enu_t | exportSnapshot (const ComRef &cref, char **contents)
oms_status_enu_t | exportSSVTemplate (const ComRef &cref, const std::string &filename)
oms_status_enu_t | exportSSMTemplate (const ComRef &cref, const std::string &filename)
void | exportSignalFilter (Snapshot &snapshot) const
void | exportUnitDefinitionsToSSD (pugi::xml_node &node) const
void | exportEnumerationDefinitionsToSSD (pugi::xml_node &node) const
oms_status_enu_t | importFromSnapshot (const Snapshot &snapshot)
oms_status_enu_t | importSnapshot (const char *snapshot, char **newCref)
oms_status_enu_t | importSignalFilter (const std::string &filename, const Snapshot &snapshot)
oms_status_enu_t | exportToFile (const std::string &filename) const
oms_system_enu_t | getSystemType (const pugi::xml_node &node, const std::string &sspVersion)
oms_system_enu_t | getSystemTypeHelper (const pugi::xml_node &node, const std::string &sspVersion)
oms_status_enu_t | updateParameterBindingsToSSD (pugi::xml_node &node, bool isTopSystemOrModel) const
void | copyResources (bool copy_resources)
bool | copyResources ()
oms::Element ** | getElements ()
void | writeAllResourcesToFilesystem (std::vector< std::string > &resources, Snapshot &snapshot) const
oms_status_enu_t | instantiate ()
oms_status_enu_t | initialize ()
oms_status_enu_t | simulate ()
oms_status_enu_t | doStep ()
oms_status_enu_t | stepUntil (double stopTime)
oms_status_enu_t | terminate ()
oms_status_enu_t | reset ()
oms_modelState_enu_t | getModelState () const
oms_status_enu_t | setStartTime (double value)
double | getStartTime () const
oms_status_enu_t | setStopTime (double value)
double | getStopTime () const
double | getTime () const
oms_status_enu_t | setLoggingInterval (double loggingInterval)
double | getLoggingInterval () const
oms_status_enu_t | setResultFile (const std::string &filename, int bufferSize)
oms_status_enu_t | getResultFile (char **filename, int *bufferSize)
oms_status_enu_t | emit (double time, bool force=false, bool *emitted=NULL)
oms_status_enu_t | addSignalsToResults (const char *regex)
oms_status_enu_t | removeSignalsFromResults (const char *regex)
std::string | escapeSpecialCharacters (const std::string &regex)
bool | validState (int validStates) const
bool | isIsolatedFMUModel () const
void | setIsolatedFMUModel ()
bool | useThreadPool ()
ctpl::thread_pool & | getThreadPool ()
oms_status_enu_t | loadSnapshot (const pugi::xml_node &node)
std::string | getVariantName ()

## Static Public Member Functions
static Model * | NewModel (const ComRef &cref)

## Public Attributes
std::vector< std::string > | importedResources
| list of imported resources from ssp
std::map< ComRef, char * > | ssdVariants
| list of all variants copied when user create a new variant using oms_duplicateVariant()

## Private Member Functions
| Model (const ComRef &cref, const std::string &tempDir)
| Model (Model const &copy)
| not implemented
Model & | operator= (Model const &copy)
| not implemented
oms_status_enu_t | registerSignalsForResultFile ()

## Private Attributes
ComRef | cref
System * | system = NULL
std::string | tempDir
std::vector< oms::Element * > | elements
bool | copy_resources = true
oms_modelState_enu_t | modelState = oms_modelState_virgin
double | startTime = 0.0
double | stopTime = 1.0
ResultWriter * | resultFile = NULL
double | lastEmit
double | loggingInterval = 0.0
int | bufferSize = 10
Clock | clock
Values | values
std::string | resultFilename
| default <name>_res.mat
std::string | signalFilterFilename = "resources/signalFilter.xml"
std::string | variantName = "SystemStructure.ssd"
| default name
std::vector< std::string > | externalResources
| list of external ssv or ssm resources from filesystem
bool | isolatedFMU = false
ctpl::thread_pool * | pool = nullptr
ComRef | new_root_cref

## Constructor & Destructor Documentation

## ◆ ~Model()

oms::Model::~Model | ( |  | ) |

Here is the call graph for this function:

## ◆ Model() [1/2]

oms::Model::Model | ( | const ComRef & | cref,
|  | const std::string & | tempDir
| ) |  |
| private

Here is the call graph for this function:

## ◆ Model() [2/2]

oms::Model::Model | ( | Model const & | copy | ) |
| private

not implemented

## Member Function Documentation

## ◆ activateVariant()

oms_status_enu_t oms::Model::activateVariant | ( | const ComRef & | crefA,
|  | const ComRef & | crefB
| ) |  |

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

## ◆ addResources()

oms_status_enu_t oms::Model::addResources | ( | const ComRef & | cref,
|  | const std::string & | path
| ) |  |

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

## ◆ addSignalsToResults()

oms_status_enu_t oms::Model::addSignalsToResults | ( | const char * | regex | ) |

Here is the caller graph for this function:

## ◆ addSystem()

oms_status_enu_t oms::Model::addSystem | ( | const ComRef & | cref,
|  | oms_system_enu_t | type
| ) |  |

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

## ◆ copyResources() [1/2]

bool oms::Model::copyResources | ( |  | ) |
| inline

## ◆ copyResources() [2/2]

void oms::Model::copyResources | ( | bool | copy_resources | ) |
| inline

Here is the caller graph for this function:

## ◆ delete_()

oms_status_enu_t oms::Model::delete_ | ( | const ComRef & | cref | ) |

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

## ◆ deleteReferencesInSSD()

oms_status_enu_t oms::Model::deleteReferencesInSSD | ( | const ComRef & | cref | ) |

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

## ◆ deleteResourcesInSSP()

oms_status_enu_t oms::Model::deleteResourcesInSSP | ( | const std::string & | filename | ) |

Here is the caller graph for this function:

## ◆ doStep()

oms_status_enu_t oms::Model::doStep | ( |  | ) |

Here is the caller graph for this function:

## ◆ duplicateVariant()

oms_status_enu_t oms::Model::duplicateVariant | ( | const ComRef & | crefA,
|  | const ComRef & | crefB
| ) |  |

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

## ◆ emit()

oms_status_enu_t oms::Model::emit | ( | double | time,
|  | bool | force = `false`,
|  | bool * | emitted = `NULL`
| ) |  |

Here is the call graph for this function:

## ◆ escapeSpecialCharacters()

std::string oms::Model::escapeSpecialCharacters | ( | const std::string & | regex | ) |

## ◆ exportEnumerationDefinitionsToSSD()

void oms::Model::exportEnumerationDefinitionsToSSD | ( | pugi::xml_node & | node | ) | const

## ◆ exportSignalFilter()

void oms::Model::exportSignalFilter | ( | Snapshot & | snapshot | ) | const

Here is the call graph for this function:

## ◆ exportSnapshot()

oms_status_enu_t oms::Model::exportSnapshot | ( | const ComRef & | cref,
|  | char ** | contents
| ) |  |

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

## ◆ exportSSMTemplate()

oms_status_enu_t oms::Model::exportSSMTemplate | ( | const ComRef & | cref,
|  | const std::string & | filename
| ) |  |

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

## ◆ exportSSVTemplate()

oms_status_enu_t oms::Model::exportSSVTemplate | ( | const ComRef & | cref,
|  | const std::string & | filename
| ) |  |

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

## ◆ exportToFile()

oms_status_enu_t oms::Model::exportToFile | ( | const std::string & | filename | ) | const

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

## ◆ exportToSSD()

oms_status_enu_t oms::Model::exportToSSD | ( | Snapshot & | snapshot | ) | const

Here is the call graph for this function:

## ◆ exportUnitDefinitionsToSSD()

void oms::Model::exportUnitDefinitionsToSSD | ( | pugi::xml_node & | node | ) | const

## ◆ getComponent()

oms::Component * oms::Model::getComponent | ( | const ComRef & | cref | ) |

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

## ◆ getCref()

const ComRef & oms::Model::getCref | ( |  | ) | const
| inline

Here is the caller graph for this function:

## ◆ getElements()

oms::Element ** oms::Model::getElements | ( |  | ) |
| inline

Here is the caller graph for this function:

## ◆ getLoggingInterval()

double oms::Model::getLoggingInterval | ( |  | ) | const
| inline

## ◆ getModelState()

oms_modelState_enu_t oms::Model::getModelState | ( |  | ) | const
| inline

Here is the caller graph for this function:

## ◆ getResultFile()

oms_status_enu_t oms::Model::getResultFile | ( | char ** | filename,
|  | int * | bufferSize
| ) |  |

Here is the caller graph for this function:

## ◆ getStartTime()

double oms::Model::getStartTime | ( |  | ) | const
| inline

Here is the caller graph for this function:

## ◆ getStopTime()

double oms::Model::getStopTime | ( |  | ) | const
| inline

Here is the caller graph for this function:

## ◆ getSystem()

oms::System * oms::Model::getSystem | ( | const ComRef & | cref | ) |

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

## ◆ getSystemType()

oms_system_enu_t oms::Model::getSystemType | ( | const pugi::xml_node & | node,
|  | const std::string & | sspVersion
| ) |  |

## ◆ getSystemTypeHelper()

oms_system_enu_t oms::Model::getSystemTypeHelper | ( | const pugi::xml_node & | node,
|  | const std::string & | sspVersion
| ) |  |

## ◆ getTempDirectory()

std::string oms::Model::getTempDirectory | ( |  | ) | const
| inline

Here is the caller graph for this function:

## ◆ getThreadPool()

ctpl::thread_pool & oms::Model::getThreadPool | ( |  | ) |
| inline

## ◆ getTime()

double oms::Model::getTime | ( |  | ) | const

Here is the caller graph for this function:

## ◆ getTopLevelSystem()

System * oms::Model::getTopLevelSystem | ( |  | ) | const
| inline

## ◆ getVariantName()

std::string oms::Model::getVariantName | ( |  | ) |
| inline

## ◆ importFromSnapshot()

oms_status_enu_t oms::Model::importFromSnapshot | ( | const Snapshot & | snapshot | ) |

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

## ◆ importSignalFilter()

oms_status_enu_t oms::Model::importSignalFilter | ( | const std::string & | filename,
|  | const Snapshot & | snapshot
| ) |  |

Here is the call graph for this function:

## ◆ importSnapshot()

oms_status_enu_t oms::Model::importSnapshot | ( | const char * | snapshot,
|  | char ** | newCref
| ) |  |

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

## ◆ initialize()

oms_status_enu_t oms::Model::initialize | ( |  | ) |

Here is the caller graph for this function:

## ◆ instantiate()

oms_status_enu_t oms::Model::instantiate | ( |  | ) |

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

## ◆ isIsolatedFMUModel()

bool oms::Model::isIsolatedFMUModel | ( |  | ) | const
| inline

Here is the caller graph for this function:

## ◆ list()

oms_status_enu_t oms::Model::list | ( | const ComRef & | cref,
|  | char ** | contents
| ) |  |

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

## ◆ listVariants()

oms_status_enu_t oms::Model::listVariants | ( | const ComRef & | cref,
|  | char ** | contents
| ) |  |

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

## ◆ loadSnapshot()

oms_status_enu_t oms::Model::loadSnapshot | ( | const pugi::xml_node & | node | ) |

Here is the call graph for this function:

## ◆ NewModel()

oms::Model * oms::Model::NewModel | ( | const ComRef & | cref | ) |
| static

NewModel() is used instead of a constructor to make sure that only instances with valid names can be created.

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

## ◆ newResources()

oms_status_enu_t oms::Model::newResources | ( | const ComRef & | cref | ) |

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

## ◆ operator=()

Model & oms::Model::operator= | ( | Model const & | copy | ) |
| private

not implemented

## ◆ reduceSSV()

oms_status_enu_t oms::Model::reduceSSV | ( | const std::string & | ssvfile,
|  | const std::string & | ssmfile,
|  | const std::string & | filepath
| ) |  |

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

## ◆ referenceResources()

oms_status_enu_t oms::Model::referenceResources | ( | const ComRef & | cref,
|  | const std::string & | ssmFile
| ) |  |

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

## ◆ registerSignalsForResultFile()

oms_status_enu_t oms::Model::registerSignalsForResultFile | ( |  | ) |
| private

## ◆ removeSignalsFromResults()

oms_status_enu_t oms::Model::removeSignalsFromResults | ( | const char * | regex | ) |

Here is the caller graph for this function:

## ◆ rename() [1/2]

oms_status_enu_t oms::Model::rename | ( | const ComRef & | cref | ) |

Here is the call graph for this function:

## ◆ rename() [2/2]

oms_status_enu_t oms::Model::rename | ( | const ComRef & | cref,
|  | const ComRef & | newCref
| ) |  |

Here is the call graph for this function:

## ◆ reset()

oms_status_enu_t oms::Model::reset | ( |  | ) |

Here is the caller graph for this function:

## ◆ setIsolatedFMUModel()

void oms::Model::setIsolatedFMUModel | ( |  | ) |
| inline

Here is the caller graph for this function:

## ◆ setLoggingInterval()

oms_status_enu_t oms::Model::setLoggingInterval | ( | double | loggingInterval | ) |

Here is the caller graph for this function:

## ◆ setResultFile()

oms_status_enu_t oms::Model::setResultFile | ( | const std::string & | filename,
|  | int | bufferSize
| ) |  |

Here is the caller graph for this function:

## ◆ setStartTime()

oms_status_enu_t oms::Model::setStartTime | ( | double | value | ) |

Here is the caller graph for this function:

## ◆ setStopTime()

oms_status_enu_t oms::Model::setStopTime | ( | double | value | ) |

Here is the caller graph for this function:

## ◆ simulate()

oms_status_enu_t oms::Model::simulate | ( |  | ) |

Here is the caller graph for this function:

## ◆ stepUntil()

oms_status_enu_t oms::Model::stepUntil | ( | double | stopTime | ) |

Here is the caller graph for this function:

## ◆ terminate()

oms_status_enu_t oms::Model::terminate | ( |  | ) |

Here is the caller graph for this function:

## ◆ updateParameterBindingsToSSD()

oms_status_enu_t oms::Model::updateParameterBindingsToSSD | ( | pugi::xml_node & | node,
|  | bool | isTopSystemOrModel
| ) |  | const

## ◆ useThreadPool()

bool oms::Model::useThreadPool | ( |  | ) |
| inline

## ◆ validState()

bool oms::Model::validState | ( | int | validStates | ) | const
| inline

## ◆ writeAllResourcesToFilesystem()

void oms::Model::writeAllResourcesToFilesystem | ( | std::vector< std::string > & | resources,
|  | Snapshot & | snapshot
| ) |  | const

Here is the call graph for this function:

## Member Data Documentation

## ◆ bufferSize

int oms::Model::bufferSize = 10
| private

## ◆ clock

Clock oms::Model::clock
| private

## ◆ copy_resources

bool oms::Model::copy_resources = true
| private

## ◆ cref

ComRef oms::Model::cref
| private

## ◆ elements

std::vector<oms::Element*> oms::Model::elements
| private

## ◆ externalResources

std::vector<std::string> oms::Model::externalResources
| private

list of external ssv or ssm resources from filesystem

## ◆ importedResources

std::vector<std::string> oms::Model::importedResources

list of imported resources from ssp

## ◆ isolatedFMU

bool oms::Model::isolatedFMU = false
| private

## ◆ lastEmit

double oms::Model::lastEmit
| private

## ◆ loggingInterval

double oms::Model::loggingInterval = 0.0
| private

## ◆ modelState

oms_modelState_enu_t oms::Model::modelState = oms_modelState_virgin
| private

## ◆ new_root_cref

ComRef oms::Model::new_root_cref
| private

## ◆ pool

ctpl::thread_pool* oms::Model::pool = nullptr
| private

## ◆ resultFile

ResultWriter* oms::Model::resultFile = NULL
| private

## ◆ resultFilename

std::string oms::Model::resultFilename
| private

default <name>_res.mat

## ◆ signalFilterFilename

std::string oms::Model::signalFilterFilename = "resources/signalFilter.xml"
| private

## ◆ ssdVariants

std::map<ComRef, char*> oms::Model::ssdVariants

list of all variants copied when user create a new variant using oms_duplicateVariant()

## ◆ startTime

double oms::Model::startTime = 0.0
| private

## ◆ stopTime

double oms::Model::stopTime = 1.0
| private

## ◆ system

System* oms::Model::system = NULL
| private

## ◆ tempDir

std::string oms::Model::tempDir
| private

## ◆ values

Values oms::Model::values
| private

## ◆ variantName

std::string oms::Model::variantName = "SystemStructure.ssd"
| private

default name

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

- /var/lib/jenkins/ws/OMSimulator_PR-1619/src/OMSimulatorLib/Model.h
- /var/lib/jenkins/ws/OMSimulator_PR-1619/src/OMSimulatorLib/Model.cpp