Hopsan
|
Public Member Functions | |
Node (const size_t datalength) | |
virtual void | setSignalNumDimensions (size_t numDims) |
const HString & | getNiceName () const |
const HString & | getNodeType () const |
returns the node type | |
size_t | getNumDataVariables () const |
Returns the total number of variables in a node. | |
int | getDataIdFromName (const HString &rName) const |
This function gives you the data Id for a named data variable. | |
double | getDataValue (const size_t dataId) const |
get data from node | |
void | setDataValue (const size_t dataId, const double data) |
set data in node | |
const std::vector< NodeDataDescription > * | getDataDescriptions () const |
Get the vector of data descriptions for the node. | |
const NodeDataDescription * | getDataDescription (const size_t id) const |
virtual void | setSignalQuantity (const HString &rQuantity, const HString &rUnit, const size_t dataId=0) |
This function can be used to set unit string and displayName for signal nodes ONLY. | |
virtual void | setSignalQuantityModifyable (bool tf, const size_t dataId=0) |
virtual HString | getSignalQuantity (const size_t dataId=0) const |
virtual bool | getSignalQuantityModifyable (const size_t dataId=0) const |
void | logData (const size_t logSlot) |
Copy current data vector into log storage at given logslot. | |
int | getNumberOfPortsByType (const int type) const |
Returns the number of attached ports of a specific type. | |
size_t | getNumConnectedPorts () const |
bool | isConnectedToPort (const Port *pPort) const |
Port * | getSortOrderSourcePort () const |
Component * | getWritePortComponentPtr () const |
Returns a pointer to the component with the write port in the node. If connection is ok, any node can only have one write port. If no write port exists, a null pointer is returned. | |
ComponentSystem * | getOwnerSystem () const |
Returns a pointer to the ComponentSystem that own this Node. | |
Protected Member Functions | |
void | setNiceName (const HString &rNicename) |
void | setDataCharacteristics (const size_t id, const HString &rName, const HString &rShortname, const HString &rQuantityOrUnit, const NodeDataVariableTypeEnumT vartype=DefaultType) |
Set data name and unit for a specified data variable. | |
void | copyNodeDataValuesTo (Node *pOtherNode) const |
Copy variable values from this to pNode. | |
virtual void | copySignalQuantityAndUnitTo (Node *pOtherNode) const |
virtual void | setTLMNodeDataValuesTo (Node *pOtherNode) const |
void | preAllocateLogSpace (const size_t nLogSlots) |
Pre allocate memory for the needed amount of log data. | |
double * | getDataPtr (const size_t data_type) |
Protected Attributes | |
HString | mNiceName |
std::vector< NodeDataDescription > | mDataDescriptions |
std::vector< double > | mDataValues |
Friends | |
class | Port |
class | MultiPort |
class | PowerPort |
class | WritePort |
class | Component |
class | ComponentSystem |
class | ConnectionAssistant |
class | HopsanEssentials |
The Node base class.
Node | ( | const size_t | datalength | ) |
Node base class constructor
[in] | datalength | The length of the data vector |
|
protected |
Copy variable values from this to pNode.
pOtherNode | The destination node to copy into |
const NodeDataDescription * getDataDescription | ( | const size_t | id | ) | const |
Get a specific data name and unit
[in] | id | This is the ENUM data id |
const std::vector< NodeDataDescription > * getDataDescriptions | ( | ) | const |
Get the vector of data descriptions for the node.
int getDataIdFromName | ( | const HString & | rName | ) | const |
This function gives you the data Id for a named data variable.
[in] | rName | The data name |
|
inline |
get data from node
[in] | dataId | Identifier for the type of node data to get, (no bounds check is performed) |
bool isConnectedToPort | ( | const Port * | pPort | ) | const |
Check if a specified port is connected to this node
[in] | pPort | The port pointer to find |
void logData | ( | const size_t | logSlot | ) |
Copy current data vector into log storage at given logslot.
|
protected |
Set data name and unit for a specified data variable.
[in] | id | This is the ENUM data id |
[in] | rName | The variable name |
[in] | rShortname | The short variable name |
[in] | rQuantityOrUnit | The quantity or unit of the variable |
[in] | vartype | The type of the variable |
|
inline |
set data in node
[in] | dataId | Identifier for the type of node data to set, (no bounds check is performed) |
[in] | data | The data value |
|
virtual |
This function can be used to set unit string and displayName for signal nodes ONLY.
Reimplemented in NodeSignal, and NodeSignalND.