Hopsan
|
Functions | |
void | addConditionalConstant (const HString &rName, const HString &rDescription, std::vector< HString > &rConditions, int &rData) |
Add (register) a conditional constant parameter to the component. | |
void | addConditionalConstant (const HString &rName, const HString &rDescription, std::vector< HString > &rConditions, const int defaultValue, int &rData) |
Add (register) a conditional constant parameter to the component. | |
void | addConstant (const HString &rName, const HString &rDescription, const HString &rQuantityOrUnit, const double defaultValue, double &rData) |
Add (register) a constant parameter with a default value to the component. | |
void | addConstant (const HString &rName, const HString &rDescription, const HString &rQuantity, const HString &rUnit, const double defaultValue, double &rData) |
Add (register) a constant parameter with a default value to the component. | |
Port * | addPowerPort (const HString &rPortName, const HString &rNodeType, const HString &rDescription="", const Port::RequireConnectionEnumT reqConnect=Port::Required) |
Add a PowerPort with description to the component. | |
Port * | addPowerMultiPort (const HString &rPortName, const HString &rNodeType, const HString &rDescription="", const Port::RequireConnectionEnumT reqConnect=Port::Required) |
Add a PowerMultiPort with description to the component. | |
Port * | addReadMultiPort (const HString &rPortName, const HString &rNodeType, const HString &rDescription="", const Port::RequireConnectionEnumT reqConnect=Port::Required) |
Add a ReadMultiPort with description to the component. | |
Port * | addReadPort (const HString &rPortName, const HString &rNodeType, const HString &rDescription="", const Port::RequireConnectionEnumT reqConnect=Port::Required) |
Add a ReadPort with description to the component. | |
Port * | addWritePort (const HString &rPortName, const HString &rNodeType, const HString &rDescription="", const Port::RequireConnectionEnumT reqConnect=Port::Required) |
Add a WritePort with description to the component. | |
Port * | addInputVariable (const HString &rName, const HString &rDescription, const HString &rQuantityOrUnit, const double defaultValue, double **ppNodeData=0) |
Add an inputVariable (Scalar signal ReadPort) | |
Port * | addOutputVariable (const HString &rName, const HString &rDescription, const HString &rQuantityOrUnit, double **ppNodeData=0) |
Add an outputVariable (Scalar signal WritePort) without default value. | |
Port * | addOutputVariable (const HString &rName, const HString &rDescription, const HString &rQuantityOrUnit, const double defaultValue, double **ppNodeData=0) |
Add an outputVariable (Scalar signal WritePort) with default value. | |
double | getDefaultStartValue (Port *pPort, const size_t idx, const size_t portIdx=0) |
Get the an actual start value of a port. | |
double | getDefaultStartValue (const HString &rPortName, const HString &rDataName, const size_t portIdx=0) |
Get the an actual start value of a port. | |
void | setDefaultStartValue (Port *pPort, const size_t idx, const double value) |
Set the default startvalue in a port. | |
void | setDefaultStartValue (const HString &rPortName, const HString &rDataName, const double value) |
Set the default startvalue in a port. | |
HString | findFilePath (const HString &rFileName) const |
Find and return the full file path name of fileName within the system search path, parent systems included (path to HMF file is always in here) | |
void | setConstantValue (const HString &rName, const double value) |
Set the value of a constant parameter. | |
void | setConstantValue (const HString &rName, const int value) |
Set the value of a constant parameter. | |
void | setConstantValue (const HString &rName, const HString &rValue) |
Set the value of a constant parameter. | |
void | setConstantValue (const HString &rName, const char *value) |
Set the value of a constant parameter. | |
void | setConstantValue (const HString &rName, const bool value) |
Set the value of a constant parameter. | |
void | addConstant (const HString &rName, const HString &rDescription, const HString &rUnit, double &rData) |
Add (register) a constant parameter to the component. | |
void | addConstant (const HString &rName, const HString &rDescription, const HString &rUnit, int &rData) |
Add (register) a constant parameter to the component. | |
void | addConstant (const HString &rName, const HString &rDescription, const HString &rUnit, HString &rData) |
Add (register) a constant parameter to the component. | |
void | addConstant (const HString &rName, const HString &rDescription, const HString &rUnit, bool &rData) |
Add (register) a constant parameter to the component. | |
void | addConstant (const HString &rName, const HString &rDescription, const HString &rUnit, const int defaultValue, int &rData) |
Add (register) a constant parameter with a default value to the component. | |
void | addConstant (const HString &rName, const HString &rDescription, const HString &rUnit, const HString &defaultValue, HString &rData) |
Add (register) a constant parameter with a default value to the component. | |
void | addConstant (const HString &rName, const HString &rDescription, const HString &rUnit, const bool defaultValue, bool &rData) |
Add (register) a constant parameter with a default value to the component. | |
void addConditionalConstant | ( | const HString & | rName, |
const HString & | rDescription, | ||
std::vector< HString > & | rConditions, | ||
const int | defaultValue, | ||
int & | rData ) |
Add (register) a conditional constant parameter to the component.
[in] | rName | The name of the constant |
[in] | rDescription | The description of the constant |
[in] | rConditions | The condition descriptions as a vector of text |
[in] | defaultValue | The default value |
[in] | rData | A reference to the condition data constant |
void addConditionalConstant | ( | const HString & | rName, |
const HString & | rDescription, | ||
std::vector< HString > & | rConditions, | ||
int & | rData ) |
Add (register) a conditional constant parameter to the component.
[in] | rName | The name of the constant |
[in] | rDescription | The description of the constant |
[in] | rConditions | The condition descriptions as a vector of text |
[in] | rData | A reference to the condition data constant (it will automatically get default value 0) |
void addConstant | ( | const HString & | rName, |
const HString & | rDescription, | ||
const HString & | rQuantity, | ||
const HString & | rUnit, | ||
const double | defaultValue, | ||
double & | rData ) |
Add (register) a constant parameter with a default value to the component.
[in] | rName | The name of the constant |
[in] | rDescription | The description of the constant |
[in] | rQuantity | The physical quantity type (if any) |
[in] | rUnit | The unit of the constant value |
[in] | defaultValue | Default constant value |
[in] | rData | A reference to the data variable |
void addConstant | ( | const HString & | rName, |
const HString & | rDescription, | ||
const HString & | rQuantityOrUnit, | ||
const double | defaultValue, | ||
double & | rData ) |
Add (register) a constant parameter with a default value to the component.
[in] | rName | The name of the constant |
[in] | rDescription | The description of the constant |
[in] | rQuantityOrUnit | The Quantity or Unit of the constant value |
[in] | defaultValue | Default constant value |
[in] | rData | A reference to the data variable |
void addConstant | ( | const HString & | rName, |
const HString & | rDescription, | ||
const HString & | rUnit, | ||
bool & | rData ) |
Add (register) a constant parameter to the component.
[in] | rName | The name of the constant |
[in] | rDescription | The description of the constant |
[in] | rUnit | The unit of the constant value |
[in] | rData | A reference to the data constant |
void addConstant | ( | const HString & | rName, |
const HString & | rDescription, | ||
const HString & | rUnit, | ||
const bool | defaultValue, | ||
bool & | rData ) |
Add (register) a constant parameter with a default value to the component.
[in] | rName | The name of the constant |
[in] | rDescription | The description of the constant |
[in] | rUnit | The unit of the constant value |
[in] | defaultValue | Default constant value |
[in] | rData | A reference to the data variable |
void addConstant | ( | const HString & | rName, |
const HString & | rDescription, | ||
const HString & | rUnit, | ||
const HString & | defaultValue, | ||
HString & | rData ) |
Add (register) a constant parameter with a default value to the component.
[in] | rName | The name of the constant |
[in] | rDescription | The description of the constant |
[in] | rUnit | The unit of the constant value |
[in] | defaultValue | Default constant value |
[in] | rData | A reference to the data variable |
void addConstant | ( | const HString & | rName, |
const HString & | rDescription, | ||
const HString & | rUnit, | ||
const int | defaultValue, | ||
int & | rData ) |
Add (register) a constant parameter with a default value to the component.
[in] | rName | The name of the constant |
[in] | rDescription | The description of the constant |
[in] | rUnit | The unit of the constant value |
[in] | defaultValue | Default constant value |
[in] | rData | A reference to the data variable |
void addConstant | ( | const HString & | rName, |
const HString & | rDescription, | ||
const HString & | rUnit, | ||
double & | rData ) |
Add (register) a constant parameter to the component.
[in] | rName | The name of the constant |
[in] | rDescription | The description of the constant |
[in] | rUnit | The unit of the constant value |
[in] | rData | A reference to the data constant |
void addConstant | ( | const HString & | rName, |
const HString & | rDescription, | ||
const HString & | rUnit, | ||
HString & | rData ) |
Add (register) a constant parameter to the component.
[in] | rName | The name of the constant |
[in] | rDescription | The description of the constant |
[in] | rUnit | The unit of the constant value |
[in] | rData | A reference to the data constant |
void addConstant | ( | const HString & | rName, |
const HString & | rDescription, | ||
const HString & | rUnit, | ||
int & | rData ) |
Add (register) a constant parameter to the component.
[in] | rName | The name of the constant |
[in] | rDescription | The description of the constant |
[in] | rUnit | The unit of the constant value |
[in] | rData | A reference to the data constant |
|
protected |
Add an inputVariable (Scalar signal ReadPort)
[in] | rName | The name of the variable |
[in] | rDescription | The description of the variable |
[in] | rQuantityOrUnit | The quantity or unit of the variable value |
[in] | defaultValue | The default variable value (if not connected) |
[in,out] | ppNodeData | Optional pointer to pointer to data. The data pointer will be registered and automatically assigned before initialisation) |
|
protected |
Add an outputVariable (Scalar signal WritePort) with default value.
[in] | rName | The name of the variable |
[in] | rDescription | The description of the variable |
[in] | rQuantityOrUnit | The quantity or unit of the variable value |
[in] | defaultValue | The default variable value (if not connected) |
[in,out] | ppNodeData | Optional pointer to pointer to data. The data pointer will be registered and automatically assigned before initialisation) |
|
protected |
Add an outputVariable (Scalar signal WritePort) without default value.
[in] | rName | The name of the variable |
[in] | rDescription | The description of the variable |
[in] | rQuantityOrUnit | The quantity or unit of the variable value |
[in,out] | ppNodeData | Optional pointer to pointer to data. The data pointer will be registered and automatically assigned before initialisation) |
|
protected |
Add a PowerMultiPort with description to the component.
[in] | rPortName | The desired name of the port (may be automatically changed) |
[in] | rNodeType | The type of node that must be connected to the port |
[in] | rDescription | The port description |
[in] | reqConnect | Specify if the port must be connected or if it is optional (Required or NotRequired) |
|
protected |
Add a PowerPort with description to the component.
[in] | rPortName | The desired name of the port (may be automatically changed) |
[in] | rNodeType | The type of node that must be connected to the port |
[in] | rDescription | The port description |
[in] | reqConnect | Specify if the port must be connected or if it is optional (Required or NotRequired) |
|
protected |
Add a ReadMultiPort with description to the component.
[in] | rPortName | The desired name of the port (may be automatically changed) |
[in] | rNodeType | The type of node that must be connected to the port |
[in] | rDescription | The port description |
[in] | reqConnect | Specify if the port must be connected or if it is optional (Required or NotRequired) |
|
protected |
Add a ReadPort with description to the component.
[in] | rPortName | The desired name of the port (may be automatically changed) |
[in] | rNodeType | The type of node that must be connected to the port |
[in] | rDescription | The port description |
[in] | reqConnect | Specify if the port must be connected or if it is optional (Required or NotRequired) |
|
protected |
Add a WritePort with description to the component.
[in] | rPortName | The desired name of the port (may be automatically changed) |
[in] | rNodeType | The type of node that must be connected to the port |
[in] | rDescription | The port description |
[in] | reqConnect | Specify if the port must be connected or if it is optional (Required or NotRequired) |
Find and return the full file path name of fileName within the system search path, parent systems included (path to HMF file is always in here)
With this function you can find external files based on a path relative to the model file path This makes it possible to avoid absolute paths for external file resources
rFileName | the name of the file to search for |
double getDefaultStartValue | ( | const HString & | rPortName, |
const HString & | rDataName, | ||
const size_t | portIdx = 0 ) |
Get the an actual start value of a port.
[in] | rPortName | is the port which should be read from |
[in] | rDataName | The name of the data in the port to read from example: "Pressure" |
[in] | portIdx | The index of a subport in a multiport. If pPort is not a multiport this value will be ignored |
This slower version uses string names for lookup, and will report errors if names are incorrect
double getDefaultStartValue | ( | Port * | pPort, |
const size_t | idx, | ||
const size_t | portIdx = 0 ) |
Get the an actual start value of a port.
[in] | pPort | is the port which should be read from |
[in] | idx | is the index of the start value e.g. NodeHydraulic::Pressure |
[in] | portIdx | The index of a subport in a multiport. If pPort is not a multiport this value will be ignored |
void setConstantValue | ( | const HString & | rName, |
const bool | value ) |
Set the value of a constant parameter.
void setConstantValue | ( | const HString & | rName, |
const char * | value ) |
Set the value of a constant parameter.
void setConstantValue | ( | const HString & | rName, |
const double | value ) |
Set the value of a constant parameter.
Set the value of a constant parameter.
void setConstantValue | ( | const HString & | rName, |
const int | value ) |
Set the value of a constant parameter.
void setDefaultStartValue | ( | const HString & | rPortName, |
const HString & | rDataName, | ||
const double | value ) |
Set the default startvalue in a port.
[in] | rPortName | The name of the port that should be written to |
[in] | rDataName | The port variable to be written to, Example: "Pressure" |
[in] | value | is the start value that should be written |
This slower version uses string names for lookup, and will report errors if names are incorrect
void setDefaultStartValue | ( | Port * | pPort, |
const size_t | idx, | ||
const double | value ) |
Set the default startvalue in a port.
[in] | pPort | is the port which should be written to |
[in] | idx | is the index of the start value e.g. NodeHydraulic::Pressure |
[in] | value | is the start value that should be written |