Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::mimics::auxiliary::Square Class Referencefinal

Square element class. More...

#include <Square.hpp>

Inheritance diagram for iv::mimics::auxiliary::Square:
[legend]
Collaboration diagram for iv::mimics::auxiliary::Square:
[legend]

Public Member Functions

 Square ()
 
 Square (const std::vector< iv::math::geometry::Point2d > &points)
 
 ~Square () override=default
 
bool load (const iv::file::xml::node &nodeControlMimic) override
 
std::shared_ptr< iv::mimics::AbstractMimicElementclone () const override
 
AbstractComponentGUIpanelEditControl () override
 UI methods ///.
 
AbstractComponentGUIpanelSpecificEditSize ()
 
void postProcess () override
 Post process the Square.
 
bool save (iv::file::xml::node &nodeControlMimic) const override
 
void getChannels (const std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > &channelsInControl) const override
 Añade los canales que el MimicElement tiene enlazado.
 
void mapChannels (const std::function< void(std::weak_ptr< iv::channels::AbstractChannel > &)> &mapFunction) override
 Processed gets ///.
 
void executeCommand (const std::string &strAction) const override
 Run actions ///.
 
bool checkIntegrity () const override
 
iv::math::geometry::Point2d calculateCenter () const
 
iv::types::height calculateHeight () const
 
iv::types::width calculateWidth () const
 
void drawSpecific (IGraphics *graphics, std::optional< iv::types::color > colorWorkingState, std::optional< iv::types::color > colorControlState, iv::eLanguage drawingLanguage) override
 Draws the specific abstract element shape.
 
void move (double dx, double dy) override
 MOVEMENTS.
 
const iv::mimics::TitleSettingsgetTitleSettings () const
 
std::weak_ptr< iv::mimics::OnlineVariablesgetOnlineVariables () const
 
virtual void updateEnabledLanguages (const std::set< iv::eLanguage > &enabledLanguages)
 
virtual void addOptionsMenu (const std::shared_ptr< iv::mimics::MimicControlMenu > &menu)
 
bool isPointInMimic (iv::types::coord x, iv::types::coord y) const
 
virtual std::optional< iv::types::colorgetColorWorkingState () const
 Retrieves the color representing the current working state of the element.
 
virtual std::optional< iv::types::colorgetColorControlState () const
 Retrieves the color representing the current control state of the element.
 
virtual std::optional< std::string > getStringWorkingState () const
 
virtual std::optional< std::string > getStringControlState () const
 
virtual std::optional< iv::mimics::eAlarmStategetAlarmState () const
 
virtual iv::math::geometry::Point2d getAlarmIconPosition (const iv::math::geometry::Area &elementSize) const
 
virtual bool canShowCircularMenu () const
 Behaviours gets ///.
 
virtual bool hasAlternativeAction () const
 
virtual void runCommandControlWithoutMenu ()
 Ejecuta un comando accionado sin el menu de opciones (caso de un botón)
 
virtual void runAlternativeAction (CDialog *dlgFatherRef)
 Ejecuta código específico del control.
 
virtual void runEvaluation ()
 Ejecuta la evaluación del control.
 
void draw (IGraphics *graphics, iv::eLanguage drawingLanguage, const std::optional< std::unordered_set< iv::types::channelId > > &channelsRepeatedOpt=std::nullopt, const std::optional< std::set< std::shared_ptr< AbstractMimicElement > > > &otherMimicElements=std::nullopt)
 DRAWS.
 
void setRedrawFlag (bool reDrawFlag=true)
 
void removeGraphicsObjects (IGraphics *graphics)
 Elimina el elemento gráfico.
 
bool rotate (double angle)
 
void handleEvent (CEventMotion *evtMotion)
 

Public Attributes

eZDepth m_depth
 
iv::mimics::eMimicElementType m_mimicElementType
 
iv::mimics::Location m_location
 
iv::types::width m_width
 
iv::types::height m_height
 
iv::mimics::TitleSettings m_titleSettings
 
iv::mimics::Background m_background
 
std::shared_ptr< OnlineVariablesm_onlineVariables
 
std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > m_addedAlarms
 

Protected Member Functions

std::vector< iv::math::geometry::Point2dcalculateLimits (IGraphics *graphics, iv::eLanguage drawingLanguage)
 
virtual bool hasRepeatedChannels (const std::unordered_set< iv::types::channelId > &channelsRepeatedOpt) const
 Checks if the current mimic element contains any repeated channels.
 
virtual bool isRepeatedMimicElement (const std::set< std::shared_ptr< AbstractMimicElement > > &otherMimicsElements) const
 Determines whether the current mimic element shares significant similarities with others.
 
AbstractComponentGUIbuttonEditTitle ()
 
AbstractComponentGUIpanelEditSize ()
 
AbstractComponentGUIpanelEditOnlineVariables () const
 
AbstractComponentGUIpanelEditAddedAlarms () const
 

Protected Attributes

std::vector< std::shared_ptr< iv::mimics::support::Line > > m_lines
 
iv::logics::LogicExpressionMap< iv::types::colorm_colorLogics
 
bool m_redrawFlag {false}
 

Private Member Functions

 Square (const Square &other)
 

Detailed Description

Square element class.

Warning
The first and third lines are vertical and the second and fourth lines are horizontal, and is drawn in clockwise order. This is important due to some functionalities that depend on this order.

Constructor & Destructor Documentation

◆ Square() [1/3]

iv::mimics::auxiliary::Square::Square ( )

◆ Square() [2/3]

iv::mimics::auxiliary::Square::Square ( const std::vector< iv::math::geometry::Point2d > & points)
explicit

◆ ~Square()

iv::mimics::auxiliary::Square::~Square ( )
overridedefault

◆ Square() [3/3]

iv::mimics::auxiliary::Square::Square ( const Square & other)
private

Member Function Documentation

◆ addOptionsMenu()

◆ buttonEditTitle()

AbstractComponentGUI * iv::mimics::AbstractMimicElement::buttonEditTitle ( )
protectedinherited

◆ calculateCenter()

iv::math::geometry::Point2d iv::mimics::auxiliary::Polyline::calculateCenter ( ) const
nodiscardinherited

◆ calculateHeight()

iv::types::height iv::mimics::auxiliary::Polyline::calculateHeight ( ) const
nodiscardinherited

◆ calculateLimits()

std::vector< iv::math::geometry::Point2d > iv::mimics::AbstractMimicElement::calculateLimits ( IGraphics * graphics,
iv::eLanguage drawingLanguage )
protectedinherited

◆ calculateWidth()

iv::types::width iv::mimics::auxiliary::Polyline::calculateWidth ( ) const
nodiscardinherited

◆ canShowCircularMenu()

◆ checkIntegrity()

bool iv::mimics::auxiliary::Polyline::checkIntegrity ( ) const
nodiscardoverridevirtualinherited

Reimplemented from iv::mimics::AbstractMimicElement.

◆ clone()

std::shared_ptr< iv::mimics::AbstractMimicElement > iv::mimics::auxiliary::Square::clone ( ) const
nodiscardoverridevirtual

Reimplemented from iv::mimics::auxiliary::Polyline.

◆ draw()

void iv::mimics::AbstractMimicElement::draw ( IGraphics * graphics,
iv::eLanguage drawingLanguage,
const std::optional< std::unordered_set< iv::types::channelId > > & channelsRepeatedOpt = std::nullopt,
const std::optional< std::set< std::shared_ptr< AbstractMimicElement > > > & otherMimicElements = std::nullopt )
inherited

DRAWS.

Dibuja el elemento en pantalla, con título, background, alarma, toda la parte común de todos los elementos.

Parameters
graphics
drawingLanguageLanguage to draw the element
channelsRepeatedOpt

◆ drawSpecific()

void iv::mimics::auxiliary::Polyline::drawSpecific ( IGraphics * graphics,
std::optional< iv::types::color > colorWorkingState,
std::optional< iv::types::color > colorControlState,
iv::eLanguage drawingLanguage )
overridevirtualinherited

Draws the specific abstract element shape.

Parameters
graphics
colorWorkingState
colorControlState
drawingLanguage

Implements iv::mimics::AbstractMimicElement.

◆ executeCommand()

void iv::mimics::auxiliary::Polyline::executeCommand ( const std::string & strAction) const
overridevirtualinherited

Run actions ///.

Ejecuta un comando accionado desde el menu de opciones

Parameters
strAction

Implements iv::mimics::AbstractMimicElement.

◆ getAlarmIconPosition()

iv::math::geometry::Point2d iv::mimics::AbstractMimicElement::getAlarmIconPosition ( const iv::math::geometry::Area & elementSize) const
nodiscardvirtualinherited

◆ getAlarmState()

◆ getChannels()

void iv::mimics::auxiliary::Polyline::getChannels ( const std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > & channelsInControl) const
overridevirtualinherited

Añade los canales que el MimicElement tiene enlazado.

Parameters
[out]channelsInControlMap of channels in mimic element
Deprecated
This function may be substituted by mapChannels

Reimplemented from iv::mimics::AbstractMimicElement.

◆ getColorControlState()

std::optional< iv::types::color > iv::mimics::AbstractMimicElement::getColorControlState ( ) const
nodiscardvirtualinherited

Retrieves the color representing the current control state of the element.

The control state describes how the element is being controlled, with examples including Remote/Local or Online/Offline. The returned color, if any, is intended to visually convey the control mode.

Returns
An optional color representing the control state. Returns std::nullopt the element has no control state.

Reimplemented in iv::mimics::elements::Compressor, iv::mimics::elements::Damper, iv::mimics::elements::Fan, iv::mimics::elements::Generator, and iv::mimics::elements::Pump.

◆ getColorWorkingState()

std::optional< iv::types::color > iv::mimics::AbstractMimicElement::getColorWorkingState ( ) const
nodiscardvirtualinherited

Retrieves the color representing the current working state of the element.

The working state reflects the functional status of the element, which can represent states such as Running/Stopped, Open/Closed, or Undefined. The returned color, if any, is intended to visually indicate this status.

Returns
An optional color representing the working state. Returns std::nullopt if no color is the element has no working state.

Reimplemented in iv::mimics::Digital, iv::mimics::elements::Breaker, iv::mimics::elements::Compressor, iv::mimics::elements::Damper, iv::mimics::elements::Dial, iv::mimics::elements::Digital, iv::mimics::elements::Display, iv::mimics::elements::Fan, iv::mimics::elements::Generator, iv::mimics::elements::LevelBar, iv::mimics::elements::Pump, iv::mimics::elements::Shaft, iv::mimics::elements::Tank, iv::mimics::elements::Valve, iv::mimics::elementsAutomated::DamperAutomated, iv::mimics::elementsAutomated::ValveAutomated, and iv::mimics::elementsPms::BreakerPms.

◆ getOnlineVariables()

std::weak_ptr< iv::mimics::OnlineVariables > iv::mimics::AbstractMimicElement::getOnlineVariables ( ) const
nodiscardinherited

◆ getStringControlState()

std::optional< std::string > iv::mimics::AbstractMimicElement::getStringControlState ( ) const
nodiscardvirtualinherited

◆ getStringWorkingState()

◆ getTitleSettings()

const iv::mimics::TitleSettings & iv::mimics::AbstractMimicElement::getTitleSettings ( ) const
inlinenodiscardinherited

◆ handleEvent()

void iv::mimics::AbstractMimicElement::handleEvent ( CEventMotion * evtMotion)
inherited

TODO: No se usa, y junto a este, el executeCommand

◆ hasAlternativeAction()

◆ hasRepeatedChannels()

bool iv::mimics::AbstractMimicElement::hasRepeatedChannels ( const std::unordered_set< iv::types::channelId > & channelsRepeatedOpt) const
protectedvirtualinherited

Checks if the current mimic element contains any repeated channels.

Parameters
channelsRepeatedOptA set of channel IDs that are considered as repeated.
Returns
True if at least one channel of the mimic element is found in channelsRepeatedOpt, false otherwise.

Reimplemented in iv::mimics::elements::DynamicText, iv::mimics::elementsAutomated::DamperAutomated, iv::mimics::elementsAutomated::ValveAutomated, iv::mimics::elementsPms::BreakerPms, and iv::mimics::elementsPms::GeneratorPms.

◆ isPointInMimic()

bool iv::mimics::AbstractMimicElement::isPointInMimic ( iv::types::coord x,
iv::types::coord y ) const
nodiscardinherited

◆ isRepeatedMimicElement()

bool iv::mimics::AbstractMimicElement::isRepeatedMimicElement ( const std::set< std::shared_ptr< AbstractMimicElement > > & otherMimicsElements) const
protectedvirtualinherited

Determines whether the current mimic element shares significant similarities with others.

Parameters
otherMimicsElementsA set of other mimics elements to be compared against.
Returns
True if the element is repeated, false otherwise.

Reimplemented in iv::mimics::elements::DynamicText, iv::mimics::elementsAutomated::DamperAutomated, iv::mimics::elementsAutomated::ValveAutomated, iv::mimics::elementsPms::BreakerPms, and iv::mimics::elementsPms::GeneratorPms.

◆ load()

bool iv::mimics::auxiliary::Square::load ( const iv::file::xml::node & nodeControlMimic)
overridevirtual

Reimplemented from iv::mimics::auxiliary::Polyline.

◆ mapChannels()

void iv::mimics::auxiliary::Polyline::mapChannels ( const std::function< void(std::weak_ptr< iv::channels::AbstractChannel > &)> & mapFunction)
overridevirtualinherited

Processed gets ///.

Applies a function over each channel in the mimic element

Parameters
mapFunctionFunction to apply over each channel

Reimplemented from iv::mimics::AbstractMimicElement.

◆ move()

void iv::mimics::auxiliary::Polyline::move ( double dx,
double dy )
overridevirtualinherited

MOVEMENTS.

Reimplemented from iv::mimics::AbstractMimicElement.

◆ panelEditAddedAlarms()

AbstractComponentGUI * iv::mimics::AbstractMimicElement::panelEditAddedAlarms ( ) const
nodiscardprotectedinherited

◆ panelEditControl()

AbstractComponentGUI * iv::mimics::auxiliary::Square::panelEditControl ( )
overridevirtual

UI methods ///.

PANELS

Crea el panel de edición del control.

Returns
Panel de edición del control.

Reimplemented from iv::mimics::auxiliary::Polyline.

◆ panelEditOnlineVariables()

AbstractComponentGUI * iv::mimics::AbstractMimicElement::panelEditOnlineVariables ( ) const
nodiscardprotectedinherited

◆ panelEditSize()

AbstractComponentGUI * iv::mimics::AbstractMimicElement::panelEditSize ( )
protectedinherited

◆ panelSpecificEditSize()

AbstractComponentGUI * iv::mimics::auxiliary::Square::panelSpecificEditSize ( )

◆ postProcess()

void iv::mimics::auxiliary::Square::postProcess ( )
overridevirtual

Post process the Square.

Note
Update the square points to match the new width and height

Reimplemented from iv::mimics::AbstractMimicElement.

◆ removeGraphicsObjects()

void iv::mimics::AbstractMimicElement::removeGraphicsObjects ( IGraphics * graphics)
inherited

Elimina el elemento gráfico.

Parameters
graphics

◆ rotate()

bool iv::mimics::AbstractMimicElement::rotate ( double angle)
inherited

◆ runAlternativeAction()

void iv::mimics::AbstractMimicElement::runAlternativeAction ( CDialog * dlgFatherRef)
virtualinherited

Ejecuta código específico del control.

Note
El objetivo es que este comportamiento sea específico de cada control y se ejecute al pulsar sobre el control si este no puede mostrar menú circular.

Reimplemented in iv::mimics::auxiliary::Link, iv::mimics::elements::PmsPriorities, iv::mimics::elementsAutomated::DamperAutomated, iv::mimics::elementsAutomated::ValveAutomated, iv::mimics::elementsPms::BreakerPms, iv::mimics::elementsPms::GeneratorPms, and iv::mimics::elementsPms::OperationModesPms.

◆ runCommandControlWithoutMenu()

void iv::mimics::AbstractMimicElement::runCommandControlWithoutMenu ( )
virtualinherited

Ejecuta un comando accionado sin el menu de opciones (caso de un botón)

◆ runEvaluation()

void iv::mimics::AbstractMimicElement::runEvaluation ( )
virtualinherited

Ejecuta la evaluación del control.

◆ save()

bool iv::mimics::auxiliary::Polyline::save ( iv::file::xml::node & nodeControlMimic) const
overridevirtualinherited

Reimplemented from iv::mimics::AbstractMimicElement.

◆ setRedrawFlag()

void iv::mimics::AbstractMimicElement::setRedrawFlag ( bool reDrawFlag = true)
inherited

◆ updateEnabledLanguages()

void iv::mimics::AbstractMimicElement::updateEnabledLanguages ( const std::set< iv::eLanguage > & enabledLanguages)
virtualinherited

Member Data Documentation

◆ m_addedAlarms

std::shared_ptr<std::vector<std::weak_ptr<iv::channels::AbstractChannel> > > iv::mimics::AbstractMimicElement::m_addedAlarms
inherited

◆ m_background

iv::mimics::Background iv::mimics::AbstractMimicElement::m_background
inherited

◆ m_colorLogics

iv::logics::LogicExpressionMap<iv::types::color> iv::mimics::auxiliary::Polyline::m_colorLogics
protectedinherited

◆ m_depth

eZDepth iv::mimics::AbstractMimicElement::m_depth
inherited

Model

◆ m_height

iv::types::height iv::mimics::AbstractMimicElement::m_height
inherited

◆ m_lines

std::vector<std::shared_ptr<iv::mimics::support::Line> > iv::mimics::auxiliary::Polyline::m_lines
protectedinherited

◆ m_location

iv::mimics::Location iv::mimics::AbstractMimicElement::m_location
inherited

◆ m_mimicElementType

iv::mimics::eMimicElementType iv::mimics::AbstractMimicElement::m_mimicElementType
inherited

◆ m_onlineVariables

std::shared_ptr<OnlineVariables> iv::mimics::AbstractMimicElement::m_onlineVariables
inherited

◆ m_redrawFlag

bool iv::mimics::AbstractMimicElement::m_redrawFlag {false}
protectedinherited

Controller

◆ m_titleSettings

iv::mimics::TitleSettings iv::mimics::AbstractMimicElement::m_titleSettings
inherited

◆ m_width

iv::types::width iv::mimics::AbstractMimicElement::m_width
inherited

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