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 | Private Member Functions | Private Attributes | List of all members
oms::Model Class Reference

#include <Model.h>

Collaboration diagram for oms::Model:
Collaboration graph

Public Member Functions

 ~Model ()
 
const ComRefgetCref () const
 
SystemgetSystem (const ComRef &cref)
 
oms_status_enu_t delete_ (const ComRef &cref)
 
ComponentgetComponent (const ComRef &cref)
 
SystemgetTopLevelSystem () const
 
std::string getTempDirectory () const
 
oms_status_enu_t rename (const ComRef &cref)
 
oms_status_enu_t list (const ComRef &cref, char **contents)
 
oms_status_enu_t addSystem (const ComRef &cref, oms_system_enu_t type)
 
oms_status_enu_t exportToSSD (pugi::xml_node &node) const
 
oms_status_enu_t importFromSSD (const pugi::xml_node &node)
 
oms_status_enu_t exportToFile (const std::string &filename) const
 
void copyResources (bool copy_resources)
 
bool copyResources ()
 
oms::Element ** getElements ()
 
oms_status_enu_t getAllResources (std::vector< std::string > &resources) const
 
oms_status_enu_t instantiate ()
 
oms_status_enu_t initialize ()
 
oms_status_enu_t simulate_asynchronous (void(*cb)(const char *cref, double time, oms_status_enu_t status))
 
oms_status_enu_t simulate ()
 
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
 
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 emit (double time, bool force=false)
 
oms_status_enu_t addSignalsToResults (const char *regex)
 
oms_status_enu_t removeSignalsFromResults (const char *regex)
 
oms_status_enu_t cancelSimulation_asynchronous ()
 
bool cancelSimulation () const
 
bool validState (int validStates) const
 

Static Public Member Functions

static ModelNewModel (const ComRef &cref)
 

Private Member Functions

 Model (const ComRef &cref, const std::string &tempDir)
 
 Model (Model const &copy)
 not implemented More...
 
Modeloperator= (Model const &copy)
 not implemented More...
 
oms_status_enu_t registerSignalsForResultFile ()
 

Private Attributes

ComRef cref
 
Systemsystem = 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
 
ResultWriterresultFile = NULL
 
double lastEmit
 
double loggingInterval = 0.0
 
int bufferSize = 10
 
std::string resultFilename
 default <name>_res.mat More...
 
Clock clock
 
unsigned int clock_id
 
bool cancelSim
 

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:
Here is the caller graph for this function:

◆ Model() [2/2]

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

not implemented

Member Function Documentation

◆ addSignalsToResults()

oms_status_enu_t oms::Model::addSignalsToResults ( const char *  regex)
Here is the call graph for this function:
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:

◆ cancelSimulation()

bool oms::Model::cancelSimulation ( ) const
inline
Here is the caller graph for this function:

◆ cancelSimulation_asynchronous()

oms_status_enu_t oms::Model::cancelSimulation_asynchronous ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyResources() [1/2]

void oms::Model::copyResources ( bool  copy_resources)
inline
Here is the caller graph for this function:

◆ copyResources() [2/2]

bool oms::Model::copyResources ( )
inline

◆ 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:

◆ emit()

oms_status_enu_t oms::Model::emit ( double  time,
bool  force = false 
)
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 ( pugi::xml_node &  node) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAllResources()

oms_status_enu_t oms::Model::getAllResources ( std::vector< std::string > &  resources) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 call graph for this function:
Here is the caller graph for this function:

◆ getElements()

oms::Element** oms::Model::getElements ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLoggingInterval()

double oms::Model::getLoggingInterval ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getModelState()

oms_modelState_enu_t oms::Model::getModelState ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStartTime()

double oms::Model::getStartTime ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStopTime()

double oms::Model::getStopTime ( ) const
inline
Here is the call graph for this function:
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:

◆ getTempDirectory()

std::string oms::Model::getTempDirectory ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTopLevelSystem()

System* oms::Model::getTopLevelSystem ( ) const
inline
Here is the caller graph for this function:

◆ importFromSSD()

oms_status_enu_t oms::Model::importFromSSD ( const pugi::xml_node &  node)
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 call graph for this function:
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:

◆ 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:

◆ 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:

◆ operator=()

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

not implemented

Here is the caller graph for this function:

◆ registerSignalsForResultFile()

oms_status_enu_t oms::Model::registerSignalsForResultFile ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeSignalsFromResults()

oms_status_enu_t oms::Model::removeSignalsFromResults ( const char *  regex)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rename()

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

◆ reset()

oms_status_enu_t oms::Model::reset ( )
Here is the call graph for this function:
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 call graph for this function:
Here is the caller graph for this function:

◆ setStartTime()

oms_status_enu_t oms::Model::setStartTime ( double  value)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStopTime()

oms_status_enu_t oms::Model::setStopTime ( double  value)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ simulate()

oms_status_enu_t oms::Model::simulate ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ simulate_asynchronous()

oms_status_enu_t oms::Model::simulate_asynchronous ( void(*)(const char *cref, double time, oms_status_enu_t status)  cb)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stepUntil()

oms_status_enu_t oms::Model::stepUntil ( double  stopTime)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ terminate()

oms_status_enu_t oms::Model::terminate ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validState()

bool oms::Model::validState ( int  validStates) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ bufferSize

int oms::Model::bufferSize = 10
private

◆ cancelSim

bool oms::Model::cancelSim
private

◆ clock

Clock oms::Model::clock
private

◆ clock_id

unsigned int oms::Model::clock_id
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

◆ 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

◆ resultFile

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

◆ resultFilename

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

default <name>_res.mat

◆ 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

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