Hopsan
NodeSignalND Class Reference

The base class for n-dimensional signal nodes, (that can be dynamically sized, but size should be kept constant during use) More...

#include <Nodes.h>

Inheritance diagram for NodeSignalND:
Node NodeSignal2D NodeSignal3D

Public Types

enum  DataIndexEnumT { Value }
 The data variable indexes, DataLength is used internally.
 

Public Member Functions

virtual void setSignalNumDimensions (size_t numDims)
 
virtual void setSignalQuantity (const HString &rQuantity, const HString &rUnit, const size_t dataId=Value)
 This function can be used to set unit string and displayName for signal nodes ONLY.
 
virtual void setSignalQuantityModifyable (bool tf, const size_t dataId=Value)
 
virtual HString getSignalQuantity (const size_t dataId=Value) const
 
virtual bool getSignalQuantityModifyable (const size_t dataId=Value) const
 
- Public Member Functions inherited from Node
 Node (const size_t datalength)
 
const HStringgetNiceName () const
 
const HStringgetNodeType () 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 NodeDataDescriptiongetDataDescription (const size_t id) 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
 
PortgetSortOrderSourcePort () const
 
ComponentgetWritePortComponentPtr () 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.
 
ComponentSystemgetOwnerSystem () const
 Returns a pointer to the ComponentSystem that own this Node.
 

Static Public Member Functions

static NodeCreatorFunction ()
 

Additional Inherited Members

- Protected Member Functions inherited from Node
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 inherited from Node
HString mNiceName
 
std::vector< NodeDataDescriptionmDataDescriptions
 
std::vector< double > mDataValues
 

Detailed Description

The base class for n-dimensional signal nodes, (that can be dynamically sized, but size should be kept constant during use)

Member Function Documentation

◆ getSignalQuantity()

virtual HString getSignalQuantity ( const size_t dataId = Value) const
inlinevirtual

Reimplemented from Node.

◆ getSignalQuantityModifyable()

virtual bool getSignalQuantityModifyable ( const size_t dataId = Value) const
inlinevirtual

Reimplemented from Node.

◆ setSignalNumDimensions()

void setSignalNumDimensions ( size_t numDims)
virtual

Reimplemented from Node.

◆ setSignalQuantity()

virtual void setSignalQuantity ( const HString & rQuantity,
const HString & rUnit,
const size_t dataId = Value )
inlinevirtual

This function can be used to set unit string and displayName for signal nodes ONLY.

Reimplemented from Node.

◆ setSignalQuantityModifyable()

virtual void setSignalQuantityModifyable ( bool tf,
const size_t dataId = Value )
inlinevirtual

Reimplemented from Node.