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

#include <element.h>

Inheritance diagram for Element:
Inheritance graph
Collaboration diagram for Element:
Collaboration graph

Classes

struct  LinkInfo
 The LinkInfo struct Stores link data for element connections. For slave elements, group_index indicates which contact group of the master this slave is assigned to (-1 = no group assigned). More...

Public Types

enum  kind {
  Simple = 1 , NextReport = 2 , PreviousReport = 4 , AllReport = 6 ,
  Master = 8 , Slave = 16 , Terminale = 32 , Thumbnail = 64 ,
  ConductorDefinition = 128
}
 The kind enum Used to know the kind of this element (master, slave, report ect...). More...
enum  { Type = UserType + 1000 }

Public Slots

void updateConductorTexts ()
 Element::updateConductorTexts Slot that is triggered when a cable is * connected to or disconnected from a terminal on this component.

Signals

void linkedElementChanged ()
void elementInfoChange (DiagramContext old_info, DiagramContext new_info)
void textAdded (DynamicElementTextItem *deti)
void textRemoved (DynamicElementTextItem *deti)
void textsGroupAdded (ElementTextItemGroup *group)
void textsGroupAboutToBeRemoved (ElementTextItemGroup *group)
void textAddedToGroup (DynamicElementTextItem *text, ElementTextItemGroup *group)
void textRemovedFromGroup (DynamicElementTextItem *text, ElementTextItemGroup *group)

Public Member Functions

 Element (const ElementsLocation &location, QGraphicsItem *=nullptr, int *state=nullptr, Element::kind link_type=Element::Simple)
 Element::Element.
 ~Element () override
 Element::~Element.
int type () const override
QList< Terminal * > terminals () const
 Element::terminals.
QList< Conductor * > conductors () const
 Element::conductors.
QList< QPair< Terminal *, Terminal * > > AlignedFreeTerminals () const
 Element::AlignedFreeTerminals.
DiagramContext elementInformations () const
virtual void setElementInformations (DiagramContext dc)
 Element::setElementInformations Set new information for this element. If new information is different of current infotmation emit elementInfoChange.
ElementData elementData () const
 Element::elementData.
void setElementData (ElementData data)
 Element::setElementData Set new data for this element. If m_information of data is changed, emit elementInfoChange.
DiagramContext kindInformations () const
 kindInformations
autonum::sequentialNumbers sequenceStruct () const
autonum::sequentialNumbersrSequenceStruct ()
void setUpFormula (bool code_letter=true, QUndoCommand *parent_undo=nullptr)
 Element::setUpFormula Set up the formula used to create the label of this element.
void setPrefix (QString)
 Element::setPrefix set Element Prefix.
QString getPrefix () const
 Element::getPrefix get Element Prefix.
void freezeLabel (bool freeze)
 Element::freezeLabel Freeze this element label.
bool isFreezeLabel () const
void freezeNewAddedElement ()
 Element::freezeNewAddedElement Freeze this label if needed.
QString actualLabel ()
 Element::actualLabel Always return the current label to be displayed. This function is useful when label is based on formula, because label can change at any time.
QString name () const override
 Element::name.
ElementsLocation location () const
virtual void setHighlighted (bool)
void displayHelpLine (bool b=true)
 Element::displayHelpLine Display the help line of each terminal if b is true.
QSize size () const
QPixmap pixmap ()
 Element::pixmap.
QPoint setHotspot (QPoint)
QPoint hotspot () const
void editProperty () override
virtual bool fromXml (QDomElement &, QHash< int, Terminal * > &)
 Element::fromXml Import the parameters of this element from a xml document. When call this function ensure this element is already in a scene, because the dynamic text item and element text item group (in the xml file) are created in this function and need a diagram for create their Xref, when this element is linked to another. If not the Xref can be not displayed, until the next call of update Xref of the group or text item.
virtual QDomElement toXml (QDomDocument &, QHash< Terminal *, int > &) const
 Element::toXml Allows to export the element in XML.
QUuid uuid () const
 Element::uuid.
int orientation () const
void addDynamicTextItem (DynamicElementTextItem *deti=nullptr)
 Element::addDynamiqueTextItem Add deti as a dynamic text item of this element, deti is reparented to this If deti is null, a new DynamicElementTextItem is created and added to this element.
void removeDynamicTextItem (DynamicElementTextItem *deti)
 Element::removeDynamicTextItem Remove deti, no matter if is a child of this element or a child of a group of this element. Set he parent item of deti to 0, deti is not deleted.
QList< DynamicElementTextItem * > dynamicTextItems () const
 Element::dynamicTextItems.
ElementTextItemGroupaddTextGroup (const QString &name)
 Element::addTextGroup Create and add an element text item group to this element. If this element already have a group with the same name, then name will renamed to name1 or name2 etc....
void addTextGroup (ElementTextItemGroup *group)
 Element::addTextGroup.
void removeTextGroup (ElementTextItemGroup *group)
 Element::removeTextGroup Remove the text group group from this element, and set the parent of group to 0. group is not deleted. All texts owned by the group will be reparented to this element.
ElementTextItemGrouptextGroup (const QString &name) const
 Element::textGroup.
QList< ElementTextItemGroup * > textGroups () const
 Element::textGroups.
bool addTextToGroup (DynamicElementTextItem *text, ElementTextItemGroup *group)
 Element::addTextToGroup Add the text text to the group group; If group isn't owned by this element return false. The text must be a text of this element.
bool removeTextFromGroup (DynamicElementTextItem *text, ElementTextItemGroup *group)
 Element::removeTextFromGroup Remove the text text from the group group, en reparent text to this element.
bool isFree () const
virtual void linkToElement (Element *)
virtual void unlinkAllElements ()
virtual void unlinkElement (Element *)
virtual void initLink (QETProject *)
 Element::initLink Initialise the link between this element and other elements. This method can be call once because init the link according to uuid store in a private list, after link, the list is clear, so call another time do nothing.
QList< Element * > linkedElements ()
 Element::linkedElements.
int groupIndexForElement (Element *elmt) const
 Element::groupIndexForElement Returns the group index assigned to the given linked element. For slave elements, this indicates which contact group of the master this slave is assigned to.
void setGroupIndexForElement (Element *elmt, int index)
 Element::setGroupIndexForElement Sets the group index for a linked element.
virtual kind linkType () const
 linkType use elementData function instead
QString linkTypeToString () const
 linkTypeToString use elementData function instead
void newUuid ()
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
 Element::paint.
QRectF boundingRect () const override
QList< QPointF > plcTablePositions () const
 Positions where the PLC IO table is drawn (from the .elmt file).
Public Member Functions inherited from QetGraphicsItem
 QetGraphicsItem (QGraphicsItem *parent=nullptr)
 ~QetGraphicsItem () override=0
Diagramdiagram () const
virtual void setPos (const QPointF &p)
virtual void setPos (qreal x, qreal y)
virtual bool isMovable () const
virtual void setMovable (bool movable)
bool isHovered () const
QPointF hoverMousePos () const
QET::GraphicsItemState state () const
 QetGraphicsItem::state.

Static Public Member Functions

static bool valideXml (QDomElement &)
Static Public Member Functions inherited from QetGraphicsItem
static void showItem (QetGraphicsItem *item)
 QetGraphicsItem::QetGraphicsItem Default constructor.

Protected Member Functions

void drawAxes (QPainter *, const QStyleOptionGraphicsItem *)
void setSize (int, int)
 Element::setSize Define the size of the element. The size must be a multiple of 10. If not, the dimensions indicated will be arrrondies to higher tens.
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 Element::mouseMoveEvent.
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 Element::mouseReleaseEvent.
void hoverEnterEvent (QGraphicsSceneHoverEvent *) override
void hoverLeaveEvent (QGraphicsSceneHoverEvent *) override
void drawPlcTable (QPainter *painter)
 Element::drawPlcTable Draw the PLC table directly from in-memory ElementData. This overlays the stale picture from the .elmt file with current data.
Protected Member Functions inherited from QetGraphicsItem
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 QetGraphicsItem::mouseReleaseEvent handle mouse release click.
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
void hoverMoveEvent (QGraphicsSceneHoverEvent *event) override
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override

Protected Attributes

QList< Element * > connected_elements
QList< LinkInfotmp_uuids_link
QHash< Element *, int > m_group_index_map
 Maps linked elements to their group index (for slave->master links).
QUuid m_uuid
kind m_link_type = Element::Simple
DiagramContext m_kind_informations
autonum::sequentialNumbers m_autoNum_seq
bool m_freeze_label = false
QString m_F_str
ElementsLocation m_location
QList< Terminal * > m_terminals
QPicture m_picture
QPicture m_low_zoom_picture
ElementData m_data
QList< QPointF > m_plc_table_positions
Protected Attributes inherited from QetGraphicsItem
bool is_movable_
bool m_first_move
bool snap_to_grid_
QPointF m_mouse_to_origin_movement
QET::GraphicsItemState m_state = QET:: GIOK

Private Member Functions

 Element (const Element &)
void drawHighlight (QPainter *, const QStyleOptionGraphicsItem *)
bool buildFromXml (const QDomElement &, int *=nullptr)
 Element::buildFromXml Build this element from an xml description.
bool parseElement (const QDomElement &dom)
 Element::parseElement Parse the element of the xml description of this element.
bool parseInput (const QDomElement &dom_element)
 Element::parseInput Parse the input (old text field) the parsed input are converted to dynamic text field, this function is only here to keep compatibility with old text.
DynamicElementTextItemparseDynamicText (const QDomElement &dom_element)
 Element::parseDynamicText Create the dynamic text field described in dom_element.
TerminalparseTerminal (const QDomElement &dom_element)
 Element::parseTerminal Parse partTerminal from xml structure.

Private Attributes

bool m_must_highlight = false
QSize dimensions
QPoint hotspot_coord
bool m_mouse_over = false
QString m_prefix
QList< DynamicElementTextItem * > m_dynamic_text_list
QList< ElementTextItemGroup * > m_texts_group

Friends

class DiagramEventAddElement
class DynamicElementTextItem

Detailed Description

This is the base class for electrical elements.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into an Element.

Returns
the QGraphicsItem type
Enumerator
Type 

◆ kind

The kind enum Used to know the kind of this element (master, slave, report ect...).

Enumerator
Simple 
NextReport 
PreviousReport 
AllReport 
Master 
Slave 
Terminale 
Thumbnail 
ConductorDefinition 

Constructor & Destructor Documentation

◆ Element() [1/2]

Element::Element ( const ElementsLocation & location,
QGraphicsItem * parent = nullptr,
int * state = nullptr,
Element::kind link_type = Element::Simple )

Element::Element.

Parameters
location: location of this element
parent: parent graphics item
state: state of the instantiation
link_type
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~Element()

Element::~Element ( )
override

◆ Element() [2/2]

Element::Element ( const Element & )
private
Here is the call graph for this function:

Member Function Documentation

◆ actualLabel()

QString Element::actualLabel ( )

Element::actualLabel Always return the current label to be displayed. This function is useful when label is based on formula, because label can change at any time.

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

◆ addDynamicTextItem()

void Element::addDynamicTextItem ( DynamicElementTextItem * deti = nullptr)

Element::addDynamiqueTextItem Add deti as a dynamic text item of this element, deti is reparented to this If deti is null, a new DynamicElementTextItem is created and added to this element.

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

◆ addTextGroup() [1/2]

ElementTextItemGroup * Element::addTextGroup ( const QString & name)

Element::addTextGroup Create and add an element text item group to this element. If this element already have a group with the same name, then name will renamed to name1 or name2 etc....

Parameters
name: the name of the group
Returns
the created group.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addTextGroup() [2/2]

void Element::addTextGroup ( ElementTextItemGroup * group)

Element::addTextGroup.

Parameters
groupadd group to the group of this element. the group must not be owned by an element.
Here is the call graph for this function:

◆ addTextToGroup()

bool Element::addTextToGroup ( DynamicElementTextItem * text,
ElementTextItemGroup * group )

Element::addTextToGroup Add the text text to the group group; If group isn't owned by this element return false. The text must be a text of this element.

Returns
: true if the text was successfully added to the group.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AlignedFreeTerminals()

QList< QPair< Terminal *, Terminal * > > Element::AlignedFreeTerminals ( ) const

Element::AlignedFreeTerminals.

Returns
a list of terminal (owned by this element) aligned to other terminal (from other element) The first Terminal of QPair is a Terminal owned by this element, this terminal haven't got any conductor docked. The second Terminal of QPair is a Terminal owned by an other element, which is aligned with the first Terminal. The second Terminal can have or not docked conductors.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ boundingRect()

QRectF Element::boundingRect ( ) const
override
Returns
Le rectangle delimitant le contour de l'element
Here is the caller graph for this function:

◆ buildFromXml()

bool Element::buildFromXml ( const QDomElement & xml_def_elmt,
int * state = nullptr )
private

Element::buildFromXml Build this element from an xml description.

Parameters
xml_def_elmt
stateOptional pointer which define the status of build 0 - evreything all right 4 - xml isn't a "definition" 5 - attribute of the definition isn't present or valid 6 - the definition is empty 7 - parsing of a xml node who describe a graphical part failed. 8 - No part of the drawing could be loaded
Returns
Here is the call graph for this function:

◆ conductors()

QList< Conductor * > Element::conductors ( ) const

Element::conductors.

Returns
The list of conductors docked to this element the list is sorted according to the position of the terminal where the conductor is docked from top to bottom, and left to right.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayHelpLine()

void Element::displayHelpLine ( bool b = true)

Element::displayHelpLine Display the help line of each terminal if b is true.

Parameters
b
Here is the call graph for this function:

◆ drawAxes()

void Element::drawAxes ( QPainter * painter,
const QStyleOptionGraphicsItem * options )
protected

Dessine un petit repere (axes x et y) relatif a l'element

Parameters
painterLe QPainter a utiliser pour dessiner les axes
optionsLes options de style a prendre en compte

◆ drawHighlight()

void Element::drawHighlight ( QPainter * painter,
const QStyleOptionGraphicsItem * options )
private

Dessine le cadre de selection de l'element de maniere systematiquement non antialiasee.

Parameters
painterLe QPainter a utiliser pour dessiner les bornes.
optionsLes options de style a prendre en compte
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawPlcTable()

void Element::drawPlcTable ( QPainter * painter)
protected

Element::drawPlcTable Draw the PLC table directly from in-memory ElementData. This overlays the stale picture from the .elmt file with current data.

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

◆ dynamicTextItems()

QList< DynamicElementTextItem * > Element::dynamicTextItems ( ) const

Element::dynamicTextItems.

Returns
all dynamic text items of this element directly child of this element. Texts in text-groups belonging to this element are not returned by this function.
See also
ElementTextItemGroup::texts
Here is the caller graph for this function:

◆ editProperty()

void Element::editProperty ( )
overridevirtual

Reimplemented from QetGraphicsItem.

Here is the call graph for this function:

◆ elementData()

ElementData Element::elementData ( ) const

Element::elementData.

Returns
the element data used by this element
Here is the caller graph for this function:

◆ elementInfoChange

void Element::elementInfoChange ( DiagramContext old_info,
DiagramContext new_info )
signal
Here is the caller graph for this function:

◆ elementInformations()

DiagramContext Element::elementInformations ( ) const
inline
Here is the caller graph for this function:

◆ freezeLabel()

void Element::freezeLabel ( bool freeze)

Element::freezeLabel Freeze this element label.

Here is the caller graph for this function:

◆ freezeNewAddedElement()

void Element::freezeNewAddedElement ( )

Element::freezeNewAddedElement Freeze this label if needed.

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

◆ fromXml()

bool Element::fromXml ( QDomElement & e,
QHash< int, Terminal * > & table_id_adr )
virtual

Element::fromXml Import the parameters of this element from a xml document. When call this function ensure this element is already in a scene, because the dynamic text item and element text item group (in the xml file) are created in this function and need a diagram for create their Xref, when this element is linked to another. If not the Xref can be not displayed, until the next call of update Xref of the group or text item.

Parameters
e: the dom element where the parameter is stored
table_id_adr: Reference to the mapping table between IDs of the XML file and the addresses in memory. If the import succeeds, it must be add the right couples (id, address).
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPrefix()

QString Element::getPrefix ( ) const

◆ groupIndexForElement()

int Element::groupIndexForElement ( Element * elmt) const

Element::groupIndexForElement Returns the group index assigned to the given linked element. For slave elements, this indicates which contact group of the master this slave is assigned to.

Parameters
elmtthe linked element to query
Returns
group index, or -1 if not assigned
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hotspot()

QPoint Element::hotspot ( ) const
Returns
Le hotspot courant de l'element

◆ hoverEnterEvent()

void Element::hoverEnterEvent ( QGraphicsSceneHoverEvent * e)
overrideprotected

When mouse over element change m_mouse_over to true (used in paint() function ) Also highlight linked elements

Parameters
eQGraphicsSceneHoverEvent
Here is the call graph for this function:

◆ hoverLeaveEvent()

void Element::hoverLeaveEvent ( QGraphicsSceneHoverEvent * e)
overrideprotected

When mouse over element leave the position change m_mouse_over to false(used in paint() function ) Also un-highlight linked elements

Parameters
eQGraphicsSceneHoverEvent
Here is the call graph for this function:

◆ initLink()

void Element::initLink ( QETProject * prj)
virtual

Element::initLink Initialise the link between this element and other elements. This method can be call once because init the link according to uuid store in a private list, after link, the list is clear, so call another time do nothing.

Parameters
prj: ownership project of this element and other element to be linked

Reimplemented in MasterElement, SimpleElement, and TerminalElement.

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

◆ isFree()

bool Element::isFree ( ) const
inline
Here is the caller graph for this function:

◆ isFreezeLabel()

bool Element::isFreezeLabel ( ) const
inline
Here is the caller graph for this function:

◆ kindInformations()

DiagramContext Element::kindInformations ( ) const
inline

kindInformations

Deprecated
use elementData function instead
Returns
Here is the caller graph for this function:

◆ linkedElementChanged

void Element::linkedElementChanged ( )
signal
Here is the caller graph for this function:

◆ linkedElements()

QList< Element * > Element::linkedElements ( )
inline

Element::linkedElements.

Returns
the list of linked elements, the list is sorted by position
Here is the call graph for this function:
Here is the caller graph for this function:

◆ linkToElement()

virtual void Element::linkToElement ( Element * )
inlinevirtual

Reimplemented in MasterElement, ReportElement, and SlaveElement.

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

◆ linkType()

virtual kind Element::linkType ( ) const
inlinevirtual

linkType use elementData function instead

Returns
Here is the caller graph for this function:

◆ linkTypeToString()

QString Element::linkTypeToString ( ) const

linkTypeToString use elementData function instead

Element::linkTypeToString.

Returns
Deprecated
use instead ElementData::typeToString
Todo
remove this function
Returns

◆ location()

ElementsLocation Element::location ( ) const
Here is the caller graph for this function:

◆ mouseMoveEvent()

void Element::mouseMoveEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected

Element::mouseMoveEvent.

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

◆ mouseReleaseEvent()

void Element::mouseReleaseEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected

Element::mouseReleaseEvent.

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

◆ name()

QString Element::name ( ) const
overridevirtual

Element::name.

Returns
the human name of this element

Reimplemented from QetGraphicsItem.

Here is the caller graph for this function:

◆ newUuid()

void Element::newUuid ( )
inline

◆ orientation()

int Element::orientation ( ) const
inline

Indicate the current orientation of this element O = 0° 1 = 90° 2 = 180° 3 = 270°

Returns
the current orientation of this element
Here is the call graph for this function:
Here is the caller graph for this function:

◆ paint()

void Element::paint ( QPainter * painter,
const QStyleOptionGraphicsItem * options,
QWidget *  )
override

Element::paint.

Parameters
painter
options
Here is the call graph for this function:

◆ parseDynamicText()

DynamicElementTextItem * Element::parseDynamicText ( const QDomElement & dom_element)
private

Element::parseDynamicText Create the dynamic text field described in dom_element.

Parameters
dom_element
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseElement()

bool Element::parseElement ( const QDomElement & dom)
private

Element::parseElement Parse the element of the xml description of this element.

Parameters
dom
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseInput()

bool Element::parseInput ( const QDomElement & dom_element)
private

Element::parseInput Parse the input (old text field) the parsed input are converted to dynamic text field, this function is only here to keep compatibility with old text.

Parameters
dom_element
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseTerminal()

Terminal * Element::parseTerminal ( const QDomElement & dom_element)
private

Element::parseTerminal Parse partTerminal from xml structure.

Parameters
dom_element
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pixmap()

QPixmap Element::pixmap ( )

Element::pixmap.

Returns
the pixmap of this element
Here is the call graph for this function:

◆ plcTablePositions()

QList< QPointF > Element::plcTablePositions ( ) const
inline

Positions where the PLC IO table is drawn (from the .elmt file).

◆ removeDynamicTextItem()

void Element::removeDynamicTextItem ( DynamicElementTextItem * deti)

Element::removeDynamicTextItem Remove deti, no matter if is a child of this element or a child of a group of this element. Set he parent item of deti to 0, deti is not deleted.

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

◆ removeTextFromGroup()

bool Element::removeTextFromGroup ( DynamicElementTextItem * text,
ElementTextItemGroup * group )

Element::removeTextFromGroup Remove the text text from the group group, en reparent text to this element.

Returns
true if text was successfully removed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeTextGroup()

void Element::removeTextGroup ( ElementTextItemGroup * group)

Element::removeTextGroup Remove the text group group from this element, and set the parent of group to 0. group is not deleted. All texts owned by the group will be reparented to this element.

Parameters
group
Here is the call graph for this function:

◆ rSequenceStruct()

autonum::sequentialNumbers & Element::rSequenceStruct ( )
inline
Here is the caller graph for this function:

◆ sequenceStruct()

autonum::sequentialNumbers Element::sequenceStruct ( ) const
inline

◆ setElementData()

void Element::setElementData ( ElementData data)

Element::setElementData Set new data for this element. If m_information of data is changed, emit elementInfoChange.

Parameters
data
Here is the call graph for this function:

◆ setElementInformations()

void Element::setElementInformations ( DiagramContext dc)
virtual

Element::setElementInformations Set new information for this element. If new information is different of current infotmation emit elementInfoChange.

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

◆ setGroupIndexForElement()

void Element::setGroupIndexForElement ( Element * elmt,
int index )

Element::setGroupIndexForElement Sets the group index for a linked element.

Parameters
elmtthe linked element
indexthe group index to assign
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHighlighted()

void Element::setHighlighted ( bool hl)
virtual
Parameters
hltrue pour mettre l'element en evidence, false sinon
Here is the caller graph for this function:

◆ setHotspot()

QPoint Element::setHotspot ( QPoint hs)

Definit le hotspot de l'element par rapport au coin superieur gauche de son rectangle delimitant. Necessite que la taille ait deja ete definie

Parameters
hsCoordonnees du hotspot
Here is the caller graph for this function:

◆ setPrefix()

void Element::setPrefix ( QString prefix)

◆ setSize()

void Element::setSize ( int wid,
int hei )
protected

Element::setSize Define the size of the element. The size must be a multiple of 10. If not, the dimensions indicated will be arrrondies to higher tens.

Parameters
wid
hei
Here is the caller graph for this function:

◆ setUpFormula()

void Element::setUpFormula ( bool code_letter = true,
QUndoCommand * parent_undo = nullptr )

Element::setUpFormula Set up the formula used to create the label of this element.

Parameters
code_letter: Q_UNUSED(code_letter) if true set tagged text to code letter (ex K for coil) with condition : formula is empty, text tagged "label" is emptty or "_";
Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

QSize Element::size ( ) const
Returns
la taille de l'element sur le schema
Here is the caller graph for this function:

◆ terminals()

QList< Terminal * > Element::terminals ( ) const

Element::terminals.

Returns
the list of terminals of this element.
Here is the caller graph for this function:

◆ textAdded

void Element::textAdded ( DynamicElementTextItem * deti)
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ textAddedToGroup

void Element::textAddedToGroup ( DynamicElementTextItem * text,
ElementTextItemGroup * group )
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ textGroup()

ElementTextItemGroup * Element::textGroup ( const QString & name) const

Element::textGroup.

Parameters
name
Returns
the text group named name or nullptr if this element haven't got a group with this name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ textGroups()

QList< ElementTextItemGroup * > Element::textGroups ( ) const

Element::textGroups.

Returns
All texts groups of this element
Here is the caller graph for this function:

◆ textRemoved

void Element::textRemoved ( DynamicElementTextItem * deti)
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ textRemovedFromGroup

void Element::textRemovedFromGroup ( DynamicElementTextItem * text,
ElementTextItemGroup * group )
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ textsGroupAboutToBeRemoved

void Element::textsGroupAboutToBeRemoved ( ElementTextItemGroup * group)
signal
Here is the caller graph for this function:

◆ textsGroupAdded

void Element::textsGroupAdded ( ElementTextItemGroup * group)
signal
Here is the caller graph for this function:

◆ toXml()

QDomElement Element::toXml ( QDomDocument & document,
QHash< Terminal *, int > & table_adr_id ) const
virtual

Element::toXml Allows to export the element in XML.

Parameters
document: XML document to use
table_adr_id: Correspondence table between the addresses of the terminals and their id in the XML representation; this table completed by this method
Returns
The XML element representing this electrical element
Here is the call graph for this function:
Here is the caller graph for this function:

◆ type()

int Element::type ( ) const
inlineoverride

◆ unlinkAllElements()

virtual void Element::unlinkAllElements ( )
inlinevirtual

Reimplemented in MasterElement, ReportElement, and SlaveElement.

Here is the caller graph for this function:

◆ unlinkElement()

virtual void Element::unlinkElement ( Element * )
inlinevirtual

Reimplemented in MasterElement, ReportElement, and SlaveElement.

Here is the call graph for this function:

◆ updateConductorTexts

void Element::updateConductorTexts ( )
slot

Element::updateConductorTexts Slot that is triggered when a cable is * connected to or disconnected from a terminal on this component.

Element::updateConductorTexts

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

◆ uuid()

QUuid Element::uuid ( ) const
inline

Element::uuid.

Returns
the uuid of this element
Here is the caller graph for this function:

◆ valideXml()

bool Element::valideXml ( QDomElement & e)
static

Permet de savoir si un element XML (QDomElement) represente bien un element

Parameters
eLe QDomElement a valide
Returns
true si l'element XML est un Element, false sinon
Here is the caller graph for this function:

◆ DiagramEventAddElement

friend class DiagramEventAddElement
friend

◆ DynamicElementTextItem

friend class DynamicElementTextItem
friend

Member Data Documentation

◆ connected_elements

QList<Element *> Element::connected_elements
protected

◆ dimensions

QSize Element::dimensions
private

◆ hotspot_coord

QPoint Element::hotspot_coord
private

◆ m_autoNum_seq

autonum::sequentialNumbers Element::m_autoNum_seq
protected

◆ m_data

ElementData Element::m_data
protected

◆ m_dynamic_text_list

QList<DynamicElementTextItem *> Element::m_dynamic_text_list
private

◆ m_F_str

QString Element::m_F_str
protected

◆ m_freeze_label

bool Element::m_freeze_label = false
protected

◆ m_group_index_map

QHash<Element *, int> Element::m_group_index_map
protected

Maps linked elements to their group index (for slave->master links).

◆ m_kind_informations

DiagramContext Element::m_kind_informations
protected

◆ m_link_type

kind Element::m_link_type = Element::Simple
protected

◆ m_location

ElementsLocation Element::m_location
protected

◆ m_low_zoom_picture

QPicture Element::m_low_zoom_picture
protected

◆ m_mouse_over

bool Element::m_mouse_over = false
private

◆ m_must_highlight

bool Element::m_must_highlight = false
private

◆ m_picture

QPicture Element::m_picture
protected

◆ m_plc_table_positions

QList<QPointF> Element::m_plc_table_positions
protected

◆ m_prefix

QString Element::m_prefix
private

◆ m_terminals

QList<Terminal *> Element::m_terminals
protected

◆ m_texts_group

QList<ElementTextItemGroup *> Element::m_texts_group
private

◆ m_uuid

QUuid Element::m_uuid
protected

◆ tmp_uuids_link

QList<LinkInfo> Element::tmp_uuids_link
protected

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