QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
PlcLinkWidget Class Reference

The PlcLinkWidget class Provides a dedicated widget for linking a PLC-Slave to a PLC-Master IO entry. Displays all PLC-Masters as expandable items, each showing their IO entries. Each IO entry can only be linked to one slave. Already-linked entries are shown as struck-through and greyed out. More...

#include <plclinkwidget.h>

Inheritance diagram for PlcLinkWidget:
Inheritance graph
Collaboration diagram for PlcLinkWidget:
Collaboration graph

Classes

struct  PlcIoEntry

Public Slots

void updateUi () override

Public Member Functions

 PlcLinkWidget (Element *elmt, QWidget *parent=nullptr)
 ~PlcLinkWidget () override=default
void setElement (Element *element) override
void apply () override
QUndoCommand * associatedUndo () const override
 PropertiesEditorWidget::associatedUndo By default, return a nullptr.
QString title () const override
 PropertiesEditorWidget::title.
Public Member Functions inherited from AbstractElementPropertiesEditorWidget
 AbstractElementPropertiesEditorWidget (QWidget *parent=nullptr)
Public Member Functions inherited from PropertiesEditorWidget
 PropertiesEditorWidget (QWidget *parent=nullptr)
 PropertiesEditorWidget::PropertiesEditorWidget Constructor.
virtual void reset ()
virtual void updateUi ()
virtual bool setLiveEdit (bool live_edit)
 PropertiesEditorWidget::setLiveEdit Set the editor in live edit mode. When an editor is in live edit mode, every change is applied immediately (no need to call apply). If live edit can be enabled, return true, or else false. By default this method does nothing and returns false (live edit is disabled). Inherited class of PropertiesEditorWidget must reimplement this method to manage the live edit mode.
bool isLiveEdit () const
 PropertiesEditorWidget::isLiveEdit.

Private Slots

void on_m_search_field_textEdited (const QString &text)
void on_m_tree_widget_customContextMenuRequested (const QPoint &pos)
void on_m_unlink_pb_clicked ()
void on_m_show_this_pb_clicked ()

Private Member Functions

void buildPlcTree ()
 PlcLinkWidget::buildPlcTree Build the tree showing all PLC-Masters with their IO entries. IO entries already linked to a slave are shown as struck-through and greyed out.
void hideButtons ()
void showButtons ()

Private Attributes

QLabel * m_label {nullptr}
QPushButton * m_unlink_pb {nullptr}
QPushButton * m_show_this_pb {nullptr}
QLineEdit * m_search_field {nullptr}
QTreeWidget * m_tree_widget {nullptr}
QLabel * m_hidden_masters_label {nullptr}
QHash< QTreeWidgetItem *, PlcIoEntrym_io_entry_hash
Elementm_element_to_link = nullptr
int m_pending_io_index = -1

Additional Inherited Members

Protected Member Functions inherited from PropertiesEditorWidget
virtual void enableLiveEdit ()
virtual void disableLiveEdit ()
Protected Attributes inherited from AbstractElementPropertiesEditorWidget
QPointer< Elementm_element
Protected Attributes inherited from PropertiesEditorWidget
bool m_live_edit

Detailed Description

The PlcLinkWidget class Provides a dedicated widget for linking a PLC-Slave to a PLC-Master IO entry. Displays all PLC-Masters as expandable items, each showing their IO entries. Each IO entry can only be linked to one slave. Already-linked entries are shown as struck-through and greyed out.

Constructor & Destructor Documentation

◆ PlcLinkWidget()

PlcLinkWidget::PlcLinkWidget ( Element * elmt,
QWidget * parent = nullptr )
explicit
Here is the call graph for this function:

◆ ~PlcLinkWidget()

PlcLinkWidget::~PlcLinkWidget ( )
overridedefault

Member Function Documentation

◆ apply()

void PlcLinkWidget::apply ( )
overridevirtual

Reimplemented from PropertiesEditorWidget.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ associatedUndo()

QUndoCommand * PlcLinkWidget::associatedUndo ( ) const
overridevirtual

PropertiesEditorWidget::associatedUndo By default, return a nullptr.

Returns
nullptr

Reimplemented from PropertiesEditorWidget.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildPlcTree()

void PlcLinkWidget::buildPlcTree ( )
private

PlcLinkWidget::buildPlcTree Build the tree showing all PLC-Masters with their IO entries. IO entries already linked to a slave are shown as struck-through and greyed out.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hideButtons()

void PlcLinkWidget::hideButtons ( )
private
Here is the caller graph for this function:

◆ on_m_search_field_textEdited

void PlcLinkWidget::on_m_search_field_textEdited ( const QString & text)
privateslot
Here is the caller graph for this function:

◆ on_m_show_this_pb_clicked

void PlcLinkWidget::on_m_show_this_pb_clicked ( )
privateslot
Here is the caller graph for this function:

◆ on_m_tree_widget_customContextMenuRequested

void PlcLinkWidget::on_m_tree_widget_customContextMenuRequested ( const QPoint & pos)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_m_unlink_pb_clicked

void PlcLinkWidget::on_m_unlink_pb_clicked ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setElement()

void PlcLinkWidget::setElement ( Element * element)
overridevirtual

Implements AbstractElementPropertiesEditorWidget.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showButtons()

void PlcLinkWidget::showButtons ( )
private
Here is the caller graph for this function:

◆ title()

QString PlcLinkWidget::title ( ) const
overridevirtual

PropertiesEditorWidget::title.

Returns
the title of this editor

Reimplemented from PropertiesEditorWidget.

◆ updateUi

void PlcLinkWidget::updateUi ( )
overrideslot
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_element_to_link

Element* PlcLinkWidget::m_element_to_link = nullptr
private

◆ m_hidden_masters_label

QLabel* PlcLinkWidget::m_hidden_masters_label {nullptr}
private

◆ m_io_entry_hash

QHash<QTreeWidgetItem*, PlcIoEntry> PlcLinkWidget::m_io_entry_hash
private

◆ m_label

QLabel* PlcLinkWidget::m_label {nullptr}
private

◆ m_pending_io_index

int PlcLinkWidget::m_pending_io_index = -1
private

◆ m_search_field

QLineEdit* PlcLinkWidget::m_search_field {nullptr}
private

◆ m_show_this_pb

QPushButton* PlcLinkWidget::m_show_this_pb {nullptr}
private

◆ m_tree_widget

QTreeWidget* PlcLinkWidget::m_tree_widget {nullptr}
private

◆ m_unlink_pb

QPushButton* PlcLinkWidget::m_unlink_pb {nullptr}
private

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