Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::mimics::AbstractMimicElement Class Referenceabstract

#include <AbstractMimicElement.hpp>

Inheritance diagram for iv::mimics::AbstractMimicElement:
[legend]
Collaboration diagram for iv::mimics::AbstractMimicElement:
[legend]

Classes

struct  Constants
 
struct  DefaultValues
 
struct  Keys
 
struct  Sections
 

Public Member Functions

virtual ~AbstractMimicElement ()
 
virtual bool load (const iv::file::xml::node &nodeControlMimic)
 
virtual bool save (iv::file::xml::node &nodeControlMimic) const
 
const iv::mimics::TitleSettingsgetTitleSettings () const
 
virtual std::shared_ptr< iv::mimics::AbstractMimicElementclone () const =0
 
std::weak_ptr< iv::mimics::OnlineVariablesgetOnlineVariables () const
 
virtual void updateEnabledLanguages (const std::set< iv::eLanguage > &enabledLanguages)
 
virtual void mapChannels (const std::function< void(std::weak_ptr< iv::channels::AbstractChannel > &)> &mapFunction)
 Processed gets ///.
 
virtual void getChannels (const std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > &channelsInControl) const
 Añade los canales que el MimicElement tiene enlazado.
 
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 executeCommand (const std::string &strAction) const =0
 Run actions ///.
 
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.
 
virtual AbstractComponentGUIpanelEditControl ()=0
 UI methods ///.
 
virtual void postProcess ()
 PROCESSES.
 
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.
 
virtual void move (double dx, double dy)
 MOVEMENTS.
 
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

 AbstractMimicElement (iv::mimics::eMimicElementType elementType)
 
 AbstractMimicElement (const AbstractMimicElement &other)
 
std::vector< iv::math::geometry::Point2dcalculateLimits (IGraphics *graphics, iv::eLanguage drawingLanguage)
 
virtual bool checkIntegrity () const
 
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.
 
virtual void drawSpecific (IGraphics *graphics, std::optional< iv::types::color > colorWorkingState, std::optional< iv::types::color > colorControlState, iv::eLanguage drawingLanguage)=0
 Draws the specific abstract element shape.
 
AbstractComponentGUIbuttonEditTitle ()
 
AbstractComponentGUIpanelEditSize ()
 
AbstractComponentGUIpanelEditOnlineVariables () const
 
AbstractComponentGUIpanelEditAddedAlarms () const
 

Protected Attributes

bool m_redrawFlag {false}
 

Private Member Functions

std::unique_ptr< CDrawTextprvCreateTextTitle (iv::eLanguage language) const
 
void applyPosition (IGraphics *graphics) const
 
void applyRotation (IGraphics *graphics) const
 
std::optional< iv::mimics::eAlarmStategetAddedAlarmsMimicAlarmState () const
 

Static Private Member Functions

static bool checkHasRepeated (const std::unordered_set< iv::types::channelId > &repeatedChannels, const std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > &elementChannels)
 

Private Attributes

std::unique_ptr< CDrawTextm_textTitleOpt
 
std::shared_ptr< std::vector< iv::math::geometry::Point2d > > m_polylinesLimits
 
uint32_t m_idBlockBackground
 
uint32_t m_idBlockForegorund
 
bool m_isCreatedForeground {false}
 
bool m_isCreatedBackground {false}
 
bool m_isMarked {false}
 

Constructor & Destructor Documentation

◆ ~AbstractMimicElement()

iv::mimics::AbstractMimicElement::~AbstractMimicElement ( )
virtualdefault

◆ AbstractMimicElement() [1/2]

iv::mimics::AbstractMimicElement::AbstractMimicElement ( iv::mimics::eMimicElementType elementType)
explicitprotected

◆ AbstractMimicElement() [2/2]

iv::mimics::AbstractMimicElement::AbstractMimicElement ( const AbstractMimicElement & other)
protected

Member Function Documentation

◆ addOptionsMenu()

◆ applyPosition()

void iv::mimics::AbstractMimicElement::applyPosition ( IGraphics * graphics) const
private

◆ applyRotation()

void iv::mimics::AbstractMimicElement::applyRotation ( IGraphics * graphics) const
private

◆ buttonEditTitle()

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

◆ calculateLimits()

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

◆ canShowCircularMenu()

◆ checkHasRepeated()

bool iv::mimics::AbstractMimicElement::checkHasRepeated ( const std::unordered_set< iv::types::channelId > & repeatedChannels,
const std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > & elementChannels )
staticprivate

◆ checkIntegrity()

◆ clone()

◆ 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 )

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()

◆ executeCommand()

◆ getAddedAlarmsMimicAlarmState()

std::optional< iv::mimics::eAlarmState > iv::mimics::AbstractMimicElement::getAddedAlarmsMimicAlarmState ( ) const
nodiscardprivate

◆ getAlarmIconPosition()

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

◆ getAlarmState()

◆ getChannels()

◆ getColorControlState()

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

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
nodiscardvirtual

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
nodiscard

◆ getStringControlState()

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

◆ getStringWorkingState()

◆ getTitleSettings()

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

◆ handleEvent()

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

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
protectedvirtual

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
nodiscard

◆ isRepeatedMimicElement()

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

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()

◆ mapChannels()

◆ move()

void iv::mimics::AbstractMimicElement::move ( double dx,
double dy )
virtual

◆ panelEditAddedAlarms()

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

◆ panelEditControl()

◆ panelEditOnlineVariables()

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

◆ panelEditSize()

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

◆ postProcess()

void iv::mimics::AbstractMimicElement::postProcess ( )
virtual

PROCESSES.

Procesa ciertos atributos del elemento.

Note
La intención es que se procese tras el panel de edición y que prepare el elemento para ser dibujado.

Reimplemented in iv::mimics::auxiliary::Line, and iv::mimics::auxiliary::Square.

◆ prvCreateTextTitle()

std::unique_ptr< CDrawText > iv::mimics::AbstractMimicElement::prvCreateTextTitle ( iv::eLanguage language) const
nodiscardprivate

◆ removeGraphicsObjects()

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

Elimina el elemento gráfico.

Parameters
graphics

◆ rotate()

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

◆ runAlternativeAction()

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

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 ( )
virtual

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

◆ runEvaluation()

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

Ejecuta la evaluación del control.

◆ save()

◆ setRedrawFlag()

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

◆ updateEnabledLanguages()

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

Member Data Documentation

◆ m_addedAlarms

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

◆ m_background

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

◆ m_depth

eZDepth iv::mimics::AbstractMimicElement::m_depth

Model

◆ m_height

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

◆ m_idBlockBackground

uint32_t iv::mimics::AbstractMimicElement::m_idBlockBackground
private

◆ m_idBlockForegorund

uint32_t iv::mimics::AbstractMimicElement::m_idBlockForegorund
private

◆ m_isCreatedBackground

bool iv::mimics::AbstractMimicElement::m_isCreatedBackground {false}
private

◆ m_isCreatedForeground

bool iv::mimics::AbstractMimicElement::m_isCreatedForeground {false}
private

◆ m_isMarked

bool iv::mimics::AbstractMimicElement::m_isMarked {false}
private

◆ m_location

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

◆ m_mimicElementType

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

◆ m_onlineVariables

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

◆ m_polylinesLimits

std::shared_ptr<std::vector<iv::math::geometry::Point2d> > iv::mimics::AbstractMimicElement::m_polylinesLimits
private

◆ m_redrawFlag

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

Controller

◆ m_textTitleOpt

std::unique_ptr<CDrawText> iv::mimics::AbstractMimicElement::m_textTitleOpt
private

◆ m_titleSettings

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

◆ m_width

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

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