Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
|
#include <StationLogics.hpp>
Public Member Functions | |
StationLogics (iv::types::unitId unitId) | |
~StationLogics () | |
bool | readStationLomFile (const std::string &file) |
void | clear () const |
void | update (const iv::logic::StationLogics &other) |
bool | hasLogic () const |
iv::types::unitId | getUnitID () const |
void | processLogic () const |
std::shared_ptr< iv::logic::station::StationLogicBlocks > | getStationLogicBlocks () |
Private Member Functions | |
bool | processLoadedStationLogicBlocks () const |
std::optional< std::weak_ptr< iv::logic::station::StationBlockParam > > | findOutputParameterWithGlobalId (uint32_t globalId) const |
Static Private Member Functions | |
static void | processLoadedStationLogicBlockIOParameter (const std::shared_ptr< iv::logic::station::StationBlockParam > &blockParameter) |
static void | prvProcessFollower (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the follower block. It copies the input value to the output. | |
static void | prvProcessAdd (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the add block. It sums the input values and stores the result in the output. | |
static void | prvProcessSub (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the sub block. It subtracts the second input value from the first input value and stores the result in the output. | |
static void | prvProcessDiv (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the div block. It divides the first input value by the second input value and stores the quotient in the first output and the remainder in the second output. | |
static void | prvProcessMult (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the mult block. It multiplies the input values and stores the result in the output. | |
static void | prvProcessAnd (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the and block. It performs a logical AND operation between the input values and stores the result in the output. | |
static void | prvProcessOr (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the or block. It performs a logical OR operation between the input values and stores the result in the output. | |
static void | prvProcessCompare (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the compare block. It compares the input values using the specified operator and stores the result in the output. | |
static void | prvProcessNot (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the not block. It performs a logical NOT operation on the input value and stores the result in the output. | |
static void | prvProcessMean (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the mean block. It calculates the mean value of the input values and stores the result in the output. | |
static void | prvProcessIfElse (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the if-else block. It evaluates the condition and stores the true value in the output if the condition is true, otherwise stores the false value. | |
static void | prvProcessAbs (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the abs block. It calculates the absolute value of the input value and stores the result in the output. | |
static void | prvProcessAnalogConstant (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the analog constant block. It stores the constant value in the output. | |
static void | prvProcessAnalogRoot (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Processes the analog root block. It calculates the square root of the input value and stores the result in the output. | |
static void | prvProcessAnalogAlmType (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
static void | prvProcessAnalogAlmType2Limits (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
static void | prvProcessAnalogAlmState (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
static std::vector< std::shared_ptr< iv::logic::station::StationBlockParam > > | prvGetInputsParams (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Gets the input parameters from a block. | |
static std::vector< std::shared_ptr< iv::logic::station::StationBlockParam > > | prvGetOutputsParams (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock) |
Gets the output parameters from a block. | |
static std::vector< std::shared_ptr< iv::logic::station::StationBlockParam > > | prvGetParamsOfType (const std::shared_ptr< iv::logic::station::StationBlock > &pBlock, iv::logic::eDBBlockParamType paramType) |
Gets the parameters of a specific type from a block. | |
static std::optional< iv::types::channelValue > | prvGetInputValue (const std::shared_ptr< iv::logic::station::StationBlockParam > &inputParam) |
Gets the input parameter value. It might be a channel value, a constant value or a value from another block. | |
static void | prvSetOutputValue (const std::shared_ptr< iv::logic::station::StationBlockParam > &outputParam, iv::types::channelValue) |
Sets the output parameter value. It might be a channel value or a value to be stored in the parameter. | |
static void | prvInvalidateOutputValue (const std::shared_ptr< iv::logic::station::StationBlockParam > &outputParam) |
Invalidates the output parameter value that goes to another block. | |
Private Attributes | |
iv::types::unitId | m_unitID |
std::shared_ptr< iv::logic::station::StationLogicBlocks > | m_stationLogics |
|
explicit |
iv::logic::StationLogics::~StationLogics | ( | ) |
void iv::logic::StationLogics::clear | ( | ) | const |
|
nodiscardprivate |
std::shared_ptr< iv::logic::station::StationLogicBlocks > iv::logic::StationLogics::getStationLogicBlocks | ( | ) |
|
nodiscard |
|
nodiscard |
|
staticprivate |
|
nodiscardprivate |
void iv::logic::StationLogics::processLogic | ( | ) | const |
|
staticprivate |
Gets the input parameters from a block.
pBlock | Block to get the input parameters from |
|
staticprivate |
Gets the input parameter value. It might be a channel value, a constant value or a value from another block.
inputParam | Input parameter to get the value from |
|
staticprivate |
Gets the output parameters from a block.
pBlock | Block to get the output parameters from |
|
staticprivate |
Gets the parameters of a specific type from a block.
pBlock | Block to get the parameters from |
paramType | Type of the parameters to get |
|
staticprivate |
Invalidates the output parameter value that goes to another block.
outputParam | Output parameter to invalidate the value |
|
staticprivate |
Processes the abs block. It calculates the absolute value of the input value and stores the result in the output.
pBlock | Abs block |
|
staticprivate |
Processes the add block. It sums the input values and stores the result in the output.
pBlock | Add block |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
Processes the analog constant block. It stores the constant value in the output.
pBlock | Analog constant block |
|
staticprivate |
Processes the analog root block. It calculates the square root of the input value and stores the result in the output.
pBlock | Analog root block |
|
staticprivate |
Processes the and block. It performs a logical AND operation between the input values and stores the result in the output.
pBlock | And block |
|
staticprivate |
Processes the compare block. It compares the input values using the specified operator and stores the result in the output.
pBlock | Compare block |
|
staticprivate |
Processes the div block. It divides the first input value by the second input value and stores the quotient in the first output and the remainder in the second output.
pBlock | Div block |
|
staticprivate |
Processes the follower block. It copies the input value to the output.
pBlock | Follower block |
|
staticprivate |
Processes the if-else block. It evaluates the condition and stores the true value in the output if the condition is true, otherwise stores the false value.
pBlock | If-else block |
|
staticprivate |
Processes the mean block. It calculates the mean value of the input values and stores the result in the output.
pBlock | Mean block |
|
staticprivate |
Processes the mult block. It multiplies the input values and stores the result in the output.
pBlock | Mult block |
|
staticprivate |
Processes the not block. It performs a logical NOT operation on the input value and stores the result in the output.
pBlock | Not block |
|
staticprivate |
Processes the or block. It performs a logical OR operation between the input values and stores the result in the output.
pBlock | Or block |
|
staticprivate |
Processes the sub block. It subtracts the second input value from the first input value and stores the result in the output.
pBlock | Sub block |
|
staticprivate |
Sets the output parameter value. It might be a channel value or a value to be stored in the parameter.
outputParam | Output parameter to set the value to |
value | Value to set |
bool iv::logic::StationLogics::readStationLomFile | ( | const std::string & | file | ) |
void iv::logic::StationLogics::update | ( | const iv::logic::StationLogics & | other | ) |
|
private |
|
private |