Interface type that can be used to import and export simulation attributes over any node type supported by VILLASnode.
More...
#include <InterfaceVillas.h>
|
| InterfaceVillas (const String &nodeConfig, UInt queueLength=512, UInt sampleLength=64, const String &name="", UInt downsampling=1, spdlog::level::level_enum logLevel=spdlog::level::level_enum::info) |
| create a new InterfaceVillas instance
|
|
virtual void | importAttribute (CPS::AttributeBase::Ptr attr, UInt idx, Bool blockOnRead=false, Bool syncOnSimulationStart=true, const String &name="", const String &unit="") |
| configure an attribute import
|
|
virtual void | exportAttribute (CPS::AttributeBase::Ptr attr, UInt idx, Bool waitForOnWrite, const String &name="", const String &unit="") |
| configure an attribute export
|
|
virtual void | printVillasSignals () const |
|
| InterfaceQueued (std::shared_ptr< InterfaceWorker > intf, const String &name="", UInt downsampling=1) |
|
virtual void | open () override |
|
virtual void | close () override |
|
virtual void | pushDpsimAttrsToQueue () |
|
virtual void | popDpsimAttrsFromQueue (bool isSync=false) |
|
virtual void | syncExports () override |
|
virtual void | syncImports () override |
| Function called by the Simulation to perform interface synchronization.
|
|
virtual CPS::Task::List | getTasks () override |
|
virtual void | setLogger (CPS::Logger::Log log) override |
|
| Interface (const String &name="", spdlog::level::level_enum logLevel=spdlog::level::level_enum::info) |
|
virtual String & | getName () |
|
virtual void | addImport (CPS::AttributeBase::Ptr attr, bool blockOnRead=false, bool syncOnSimulationStart=true) |
|
virtual void | addExport (CPS::AttributeBase::Ptr attr) |
|
Interface type that can be used to import and export simulation attributes over any node type supported by VILLASnode.
Definition at line 21 of file InterfaceVillas.h.
◆ InterfaceVillas()
DPsim::InterfaceVillas::InterfaceVillas |
( |
const String & | nodeConfig, |
|
|
UInt | queueLength = 512, |
|
|
UInt | sampleLength = 64, |
|
|
const String & | name = "", |
|
|
UInt | downsampling = 1, |
|
|
spdlog::level::level_enum | logLevel = spdlog::level::level_enum::info ) |
create a new InterfaceVillas instance
- Parameters
-
nodeConfig | VILLASnode node configuration in JSON format |
queueLength | queue lenght configured for the node |
sampleLength | sample length configured for the node |
name | Name of this interface. Currently only used for naming the simulation tasks |
downsampling | Only import and export attributes on every nth timestep |
Definition at line 10 of file InterfaceVillas.cpp.
◆ exportAttribute()
void DPsim::InterfaceVillas::exportAttribute |
( |
CPS::AttributeBase::Ptr | attr, |
|
|
UInt | idx, |
|
|
Bool | waitForOnWrite, |
|
|
const String & | name = "", |
|
|
const String & | unit = "" ) |
|
virtual |
configure an attribute export
- Parameters
-
attr | the attribute which's value should be exported |
idx | The id given to the attribute within VILLASnode samples |
waitForOnWrite | Whether a sample that is sent from this interface is required to contain an updated value of this attribute |
name | Name given to the attribute within VILLASnode samples |
unit | Unit given to the attribute within VILLASnode samples |
Definition at line 28 of file InterfaceVillas.cpp.
◆ importAttribute()
void DPsim::InterfaceVillas::importAttribute |
( |
CPS::AttributeBase::Ptr | attr, |
|
|
UInt | idx, |
|
|
Bool | blockOnRead = false, |
|
|
Bool | syncOnSimulationStart = true, |
|
|
const String & | name = "", |
|
|
const String & | unit = "" ) |
|
virtual |
configure an attribute import
- Parameters
-
attr | the attribute that should be updated with the imported values |
idx | The id given to the attribute within VILLASnode samples |
blockOnRead | Whether the simulation should block on every import until the attribute has been updated |
syncOnSimulationStart | Whether the simulation should block before the first timestep until this attribute has been updated |
Definition at line 18 of file InterfaceVillas.cpp.
◆ printVillasSignals()
void DPsim::InterfaceVillas::printVillasSignals |
( |
| ) |
const |
|
virtual |
The documentation for this class was generated from the following files: