Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::logic::StationLogics Class Reference

#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::StationLogicBlocksgetStationLogicBlocks ()
 

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::channelValueprvGetInputValue (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::StationLogicBlocksm_stationLogics
 

Constructor & Destructor Documentation

◆ StationLogics()

iv::logic::StationLogics::StationLogics ( iv::types::unitId unitId)
explicit

◆ ~StationLogics()

iv::logic::StationLogics::~StationLogics ( )

Member Function Documentation

◆ clear()

void iv::logic::StationLogics::clear ( ) const

◆ findOutputParameterWithGlobalId()

std::optional< std::weak_ptr< iv::logic::station::StationBlockParam > > iv::logic::StationLogics::findOutputParameterWithGlobalId ( uint32_t globalId) const
nodiscardprivate

◆ getStationLogicBlocks()

std::shared_ptr< iv::logic::station::StationLogicBlocks > iv::logic::StationLogics::getStationLogicBlocks ( )

◆ getUnitID()

iv::types::unitId iv::logic::StationLogics::getUnitID ( ) const
nodiscard

◆ hasLogic()

bool iv::logic::StationLogics::hasLogic ( ) const
nodiscard

◆ processLoadedStationLogicBlockIOParameter()

void iv::logic::StationLogics::processLoadedStationLogicBlockIOParameter ( const std::shared_ptr< iv::logic::station::StationBlockParam > & blockParameter)
staticprivate

◆ processLoadedStationLogicBlocks()

bool iv::logic::StationLogics::processLoadedStationLogicBlocks ( ) const
nodiscardprivate

◆ processLogic()

void iv::logic::StationLogics::processLogic ( ) const

◆ prvGetInputsParams()

std::vector< std::shared_ptr< iv::logic::station::StationBlockParam > > iv::logic::StationLogics::prvGetInputsParams ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Gets the input parameters from a block.

Parameters
pBlockBlock to get the input parameters from
Returns
Vector with the input parameters

◆ prvGetInputValue()

std::optional< iv::types::channelValue > iv::logic::StationLogics::prvGetInputValue ( const std::shared_ptr< iv::logic::station::StationBlockParam > & inputParam)
staticprivate

Gets the input parameter value. It might be a channel value, a constant value or a value from another block.

Parameters
inputParamInput parameter to get the value from
Returns
The value of the input parameter if it has a value, otherwise returns std::nullopt

◆ prvGetOutputsParams()

std::vector< std::shared_ptr< iv::logic::station::StationBlockParam > > iv::logic::StationLogics::prvGetOutputsParams ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Gets the output parameters from a block.

Parameters
pBlockBlock to get the output parameters from
Returns
Vector with the output parameters

◆ prvGetParamsOfType()

std::vector< std::shared_ptr< iv::logic::station::StationBlockParam > > iv::logic::StationLogics::prvGetParamsOfType ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock,
iv::logic::eDBBlockParamType paramType )
staticprivate

Gets the parameters of a specific type from a block.

Parameters
pBlockBlock to get the parameters from
paramTypeType of the parameters to get
Returns
Vector with the parameters of the specified type

◆ prvInvalidateOutputValue()

void iv::logic::StationLogics::prvInvalidateOutputValue ( const std::shared_ptr< iv::logic::station::StationBlockParam > & outputParam)
staticprivate

Invalidates the output parameter value that goes to another block.

Parameters
outputParamOutput parameter to invalidate the value

◆ prvProcessAbs()

void iv::logic::StationLogics::prvProcessAbs ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the abs block. It calculates the absolute value of the input value and stores the result in the output.

Parameters
pBlockAbs block

◆ prvProcessAdd()

void iv::logic::StationLogics::prvProcessAdd ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the add block. It sums the input values and stores the result in the output.

Parameters
pBlockAdd block

◆ prvProcessAnalogAlmState()

void iv::logic::StationLogics::prvProcessAnalogAlmState ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

◆ prvProcessAnalogAlmType()

void iv::logic::StationLogics::prvProcessAnalogAlmType ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

◆ prvProcessAnalogAlmType2Limits()

void iv::logic::StationLogics::prvProcessAnalogAlmType2Limits ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

◆ prvProcessAnalogConstant()

void iv::logic::StationLogics::prvProcessAnalogConstant ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the analog constant block. It stores the constant value in the output.

Parameters
pBlockAnalog constant block

◆ prvProcessAnalogRoot()

void iv::logic::StationLogics::prvProcessAnalogRoot ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the analog root block. It calculates the square root of the input value and stores the result in the output.

Parameters
pBlockAnalog root block

◆ prvProcessAnd()

void iv::logic::StationLogics::prvProcessAnd ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the and block. It performs a logical AND operation between the input values and stores the result in the output.

Parameters
pBlockAnd block

◆ prvProcessCompare()

void iv::logic::StationLogics::prvProcessCompare ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the compare block. It compares the input values using the specified operator and stores the result in the output.

Parameters
pBlockCompare block

◆ prvProcessDiv()

void iv::logic::StationLogics::prvProcessDiv ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
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.

Parameters
pBlockDiv block

◆ prvProcessFollower()

void iv::logic::StationLogics::prvProcessFollower ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the follower block. It copies the input value to the output.

Parameters
pBlockFollower block

◆ prvProcessIfElse()

void iv::logic::StationLogics::prvProcessIfElse ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
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.

Parameters
pBlockIf-else block

◆ prvProcessMean()

void iv::logic::StationLogics::prvProcessMean ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the mean block. It calculates the mean value of the input values and stores the result in the output.

Parameters
pBlockMean block

◆ prvProcessMult()

void iv::logic::StationLogics::prvProcessMult ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the mult block. It multiplies the input values and stores the result in the output.

Parameters
pBlockMult block

◆ prvProcessNot()

void iv::logic::StationLogics::prvProcessNot ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the not block. It performs a logical NOT operation on the input value and stores the result in the output.

Parameters
pBlockNot block

◆ prvProcessOr()

void iv::logic::StationLogics::prvProcessOr ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the or block. It performs a logical OR operation between the input values and stores the result in the output.

Parameters
pBlockOr block

◆ prvProcessSub()

void iv::logic::StationLogics::prvProcessSub ( const std::shared_ptr< iv::logic::station::StationBlock > & pBlock)
staticprivate

Processes the sub block. It subtracts the second input value from the first input value and stores the result in the output.

Parameters
pBlockSub block

◆ prvSetOutputValue()

void iv::logic::StationLogics::prvSetOutputValue ( const std::shared_ptr< iv::logic::station::StationBlockParam > & outputParam,
iv::types::channelValue value )
staticprivate

Sets the output parameter value. It might be a channel value or a value to be stored in the parameter.

Parameters
outputParamOutput parameter to set the value to
valueValue to set

◆ readStationLomFile()

bool iv::logic::StationLogics::readStationLomFile ( const std::string & file)

◆ update()

void iv::logic::StationLogics::update ( const iv::logic::StationLogics & other)

Member Data Documentation

◆ m_stationLogics

std::shared_ptr<iv::logic::station::StationLogicBlocks> iv::logic::StationLogics::m_stationLogics
private

◆ m_unitID

iv::types::unitId iv::logic::StationLogics::m_unitID
private

The documentation for this class was generated from the following files: