QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
PhysicalTerminal Class Reference

The PhysicalTerminal class Represent a physical terminal. A physical terminal is composed a least by one RealTerminal. When a physical terminal have more than one real terminal that mean the physical terminal have levels (one by real terminal). The index of real terminals returned by the function terminals() is the same as the real level of the real terminal, the index are from back to front. More...

#include <physicalterminal.h>

Collaboration diagram for PhysicalTerminal:
Collaboration graph

Public Member Functions

 PhysicalTerminal ()
 
 ~PhysicalTerminal ()
 
TerminalStripterminalStrip () const
 PhysicalTerminal::terminalStrip.
 
int levelCount () const
 levelCount
 
int levelOf (const QSharedPointer< RealTerminal > &terminal) const
 levelOf
 
QVector< QSharedPointer< RealTerminal > > realTerminals () const
 terminals
 
QUuid uuid () const
 uuid
 
int pos () const
 
int realTerminalCount () const
 

Static Public Member Functions

static QString xmlTagName ()
 

Private Member Functions

 PhysicalTerminal (TerminalStrip *parent_strip, QVector< QSharedPointer< RealTerminal > > terminals)
 PhysicalTerminal.
 
QSharedPointer< PhysicalTerminalsharedRef ()
 PhysicalTerminal::sharedRef.
 
QWeakPointer< PhysicalTerminalweakRef ()
 PhysicalTerminal::weakRef.
 
QDomElement toXml (QDomDocument &parent_document) const
 toXml
 
void setTerminals (const QVector< QSharedPointer< RealTerminal > > &terminals)
 setTerminals Set the RealTerminal who compose this physical terminal. The position of the RealTerminal in terminals represent the level of these in this physical terminal.
 
void addTerminal (const QSharedPointer< RealTerminal > &terminal)
 addTerminals Append the real terminal terminal to this physical terminal.
 
bool removeTerminal (const QSharedPointer< RealTerminal > &terminal)
 removeTerminal Remove terminal from the list of real terminal
 
bool setLevelOf (const QSharedPointer< RealTerminal > &terminal, int level)
 setLevelOf Change the level of terminal
 
void setParentStrip (TerminalStrip *strip)
 

Private Attributes

QPointer< TerminalStripm_parent_terminal_strip
 
QVector< QSharedPointer< RealTerminal > > m_real_terminal
 
QUuid m_uuid = QUuid::createUuid()
 
QWeakPointer< PhysicalTerminalm_this_weak
 

Friends

class TerminalStrip
 
class RealTerminal
 

Detailed Description

The PhysicalTerminal class Represent a physical terminal. A physical terminal is composed a least by one RealTerminal. When a physical terminal have more than one real terminal that mean the physical terminal have levels (one by real terminal). The index of real terminals returned by the function terminals() is the same as the real level of the real terminal, the index are from back to front.

Example for a 3 levels terminal. index 0 = back (mounting plate) index 1 = middle index 2 = front (electrical cabinet door)

 m
 o    _
 u   | |
 n   | | _
 t   | || |
 i   | || | _
 n   | || || |   d
 g   |0||1||2|   o
     | || ||_|   o
 p   | || |      r
 l   | ||_|
 a   | |
 t   |_|
 e

Constructor & Destructor Documentation

◆ PhysicalTerminal() [1/2]

PhysicalTerminal::PhysicalTerminal ( TerminalStrip parent_strip,
QVector< QSharedPointer< RealTerminal > >  terminals 
)
private

PhysicalTerminal.

Parameters
parent_strip: Parent terminal strip
terminals: A vector of real terminals who compose this physical terminal. terminals must have at least one terminal
Here is the call graph for this function:

◆ PhysicalTerminal() [2/2]

PhysicalTerminal::PhysicalTerminal ( )
inline

◆ ~PhysicalTerminal()

PhysicalTerminal::~PhysicalTerminal ( )

Member Function Documentation

◆ addTerminal()

void PhysicalTerminal::addTerminal ( const QSharedPointer< RealTerminal > &  terminal)
private

addTerminals Append the real terminal terminal to this physical terminal.

Parameters
terminal
Here is the call graph for this function:

◆ levelCount()

int PhysicalTerminal::levelCount ( ) const

levelCount

Returns
the number of level of this terminal

◆ levelOf()

int PhysicalTerminal::levelOf ( const QSharedPointer< RealTerminal > &  terminal) const

levelOf

Parameters
terminal
Returns
the level of real terminal terminal or -1 if \terminal is not a part of this physicalTerminal

◆ pos()

int PhysicalTerminal::pos ( ) const

◆ realTerminalCount()

int PhysicalTerminal::realTerminalCount ( ) const

◆ realTerminals()

QVector< QSharedPointer< RealTerminal > > PhysicalTerminal::realTerminals ( ) const

terminals

Returns
A vector of RealTerminal who compose this PhysicalTerminal

◆ removeTerminal()

bool PhysicalTerminal::removeTerminal ( const QSharedPointer< RealTerminal > &  terminal)
private

removeTerminal Remove terminal from the list of real terminal

Parameters
terminal
Returns
true if successfully removed
Here is the caller graph for this function:

◆ setLevelOf()

bool PhysicalTerminal::setLevelOf ( const QSharedPointer< RealTerminal > &  terminal,
int  level 
)
private

setLevelOf Change the level of terminal

Parameters
terminal
level

◆ setParentStrip()

void PhysicalTerminal::setParentStrip ( TerminalStrip strip)
private

◆ setTerminals()

void PhysicalTerminal::setTerminals ( const QVector< QSharedPointer< RealTerminal > > &  terminals)
private

setTerminals Set the RealTerminal who compose this physical terminal. The position of the RealTerminal in terminals represent the level of these in this physical terminal.

Parameters
terminals
Here is the call graph for this function:

◆ sharedRef()

QSharedPointer< PhysicalTerminal > PhysicalTerminal::sharedRef ( )
private

PhysicalTerminal::sharedRef.

Returns
a QSharedPointer of this
Here is the call graph for this function:
Here is the caller graph for this function:

◆ terminalStrip()

TerminalStrip * PhysicalTerminal::terminalStrip ( ) const

PhysicalTerminal::terminalStrip.

Returns
The parent terminal strip ornullptr
Here is the call graph for this function:

◆ toXml()

QDomElement PhysicalTerminal::toXml ( QDomDocument &  parent_document) const
private

toXml

Parameters
parent_document
Returns
this physical terminal to xml
Here is the call graph for this function:

◆ uuid()

QUuid PhysicalTerminal::uuid ( ) const

uuid

Returns
the uuid of this physical terminal

◆ weakRef()

QWeakPointer< PhysicalTerminal > PhysicalTerminal::weakRef ( )
private

PhysicalTerminal::weakRef.

Returns
a QWeakPointer of this, weak pointer can be null
Here is the caller graph for this function:

◆ xmlTagName()

QString PhysicalTerminal::xmlTagName ( )
static
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ RealTerminal

friend class RealTerminal
friend

◆ TerminalStrip

friend class TerminalStrip
friend

Member Data Documentation

◆ m_parent_terminal_strip

QPointer<TerminalStrip> PhysicalTerminal::m_parent_terminal_strip
private

◆ m_real_terminal

QVector<QSharedPointer<RealTerminal> > PhysicalTerminal::m_real_terminal
private

◆ m_this_weak

QWeakPointer<PhysicalTerminal> PhysicalTerminal::m_this_weak
private

◆ m_uuid

QUuid PhysicalTerminal::m_uuid = QUuid::createUuid()
private

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