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

The TerminalStrip class This class hold all the datas and configurations of a terminal strip (but the not the visual aspect). A terminal strip have some informations (name comment etc...) and is composed by one or several PhysicalTerminal. More...

#include <terminalstrip.h>

Inherits QObject.

Collaboration diagram for TerminalStrip:
Collaboration graph

Signals

void orderChanged ()
 
void bridgeChanged ()
 
void bridgeColorChanged (QSharedPointer< TerminalStripBridge > bridge)
 

Public Member Functions

 TerminalStrip (QETProject *project)
 TerminalStrip::TerminalStrip.
 
 TerminalStrip (const QString &installation, const QString &location, const QString &name, QETProject *project)
 TerminalStrip::TerminalStrip.
 
void setInstallation (const QString &installation)
 
QString installation () const
 
void setLocation (const QString &location)
 
QString location () const
 
void setName (const QString &name)
 
QString name () const
 
void setComment (const QString &comment)
 
QString comment () const
 
void setDescription (const QString &description)
 
QString description () const
 
QUuid uuid () const
 
QETProjectproject () const
 TerminalStrip::project.
 
TerminalStripData data () const
 TerminalStrip::data.
 
void setData (const TerminalStripData &data)
 TerminalStrip::setData Set the internal data of this strip to data. the uuid of the new data is set to the uuid of the previous data to keep the uuid of the terminal strip unchanged.
 
bool addTerminal (QSharedPointer< RealTerminal > real_t)
 
void addTerminals (QVector< QSharedPointer< RealTerminal > > real_t_vector)
 TerminalStrip::addTerminals Add terminal in real_t_vector to this terminal.
 
void addAndGroupTerminals (const QVector< QVector< QSharedPointer< RealTerminal > > > &real_t_vector)
 TerminalStrip::addAndGroupTerminals For each real terminals of second vector, add it to terminal strip and group them together.
 
bool removeTerminal (QSharedPointer< RealTerminal > real_t)
 
void removeTerminals (QVector< QSharedPointer< RealTerminal > > real_t_vector)
 TerminalStrip::removeTerminals Remove terminals in real_t_vector from this terminal strip.
 
bool addTerminal (Element *terminal)
 TerminalStrip::addTerminal Add terminal to this terminal strip.
 
bool removeTerminal (Element *terminal)
 TerminalStrip::removeTerminal Remove terminal from this terminal strip.
 
bool addTerminal (QSharedPointer< PhysicalTerminal > phy_t)
 TerminalStrip::addTerminal Add phy_t in this terminal strip.
 
void addTerminals (QVector< QSharedPointer< PhysicalTerminal > > phy_t_vector)
 
bool removeTerminal (QSharedPointer< PhysicalTerminal > phy_t)
 TerminalStrip::removeTerminal Remove phy_t from this terminal strip.
 
void removeTerminals (QVector< QSharedPointer< PhysicalTerminal > > phy_t_vector)
 
int pos (const QSharedPointer< PhysicalTerminal > &terminal) const
 TerminalStrip::pos.
 
int physicalTerminalCount () const
 TerminalStrip::physicalTerminalCount.
 
QSharedPointer< PhysicalTerminalphysicalTerminal (int index) const
 TerminalStrip::physicalTerminalData.
 
QSharedPointer< PhysicalTerminalphysicalTerminal (const QUuid &uuid) const
 TerminalStrip::physicalTerminal.
 
QVector< QSharedPointer< PhysicalTerminal > > physicalTerminal () const
 TerminalStrip::physicalTerminal.
 
QSharedPointer< RealTerminalrealTerminalForUuid (const QUuid &uuid) const
 TerminalStrip::realTerminalForUuid.
 
QVector< QSharedPointer< RealTerminal > > realTerminals () const
 TerminalStrip::realTerminals.
 
bool setOrderTo (const QVector< QSharedPointer< PhysicalTerminal > > &sorted_vector)
 TerminalStrip::setSortedTo Sort the physical terminal owned by this strip in the same order as sorted_vector. sorted_vector must contain exactly the same physical terminal as this strip else this function do nothing.
 
bool groupTerminals (const QSharedPointer< PhysicalTerminal > &receiver_terminal, const QVector< QSharedPointer< RealTerminal > > &added_terminals)
 TerminalStrip::groupTerminal Add added_terminal to receiver_terminal. At the end of this method, if there is physical terminal without any real terminal, they will be removed and receiver_terminal become a multi-level terminal. Emit the signal orderChanged();.
 
void unGroupTerminals (const QVector< QSharedPointer< RealTerminal > > &terminals_to_ungroup)
 TerminalStrip::unGroupTerminals Ungroup all real terminals of terminals_to_ungroup.
 
bool setLevel (const QSharedPointer< RealTerminal > &real_terminal, int level)
 TerminalStrip::setLevel.
 
bool isBridgeable (const QVector< QSharedPointer< RealTerminal > > &real_terminals) const
 TerminalStrip::isBridgeable Check if all realTerminal in real_terminals are bridgeable together. To be bridgeable, each real terminal must belong to this terminal strip be at the same level, be consecutive and not belong to the same physicalTerminal and at least one terminal must be not bridged.
 
bool isBridgeable (QSharedPointer< TerminalStripBridge > bridge, const QVector< QSharedPointer< RealTerminal > > &real_terminals) const
 TerminalStrip::isBridgeable Check if all RealTerminal of real_terminals can be bridged to the bridge bridge.
 
bool setBridge (const QVector< QSharedPointer< RealTerminal > > &real_terminals)
 TerminalStrip::setBridge Set a bridge between all real terminal of real_terminals.
 
bool setBridge (const QSharedPointer< TerminalStripBridge > &bridge, const QVector< QSharedPointer< RealTerminal > > &real_terminals)
 TerminalStrip::setBridge Bridge the RealTerminal of real_terminals_data to bridge.
 
void unBridge (const QVector< QSharedPointer< RealTerminal > > &real_terminals)
 TerminalStrip::unBridge Unbridge all real terminals of real_terminals.
 
bool canUnBridge (const QVector< QSharedPointer< RealTerminal > > &real_terminals) const
 TerminalStrip::canUnBridge.
 
QSharedPointer< TerminalStripBridgeisBridged (const QSharedPointer< RealTerminal > real_terminal) const
 TerminalStrip::isBridged Check if real_terminal is bridged.
 
QSharedPointer< TerminalStripBridgebridgeFor (const QVector< QSharedPointer< RealTerminal > > &terminal_vector) const
 TerminalStrip::bridgeFor Return the bridge where at least one terminal of terminal_vector belong. If several terminals are bridged but not to the same bridge return a TerminalStripBridge with 0 real_terminals_uuid_vector.
 
QSharedPointer< RealTerminalpreviousTerminalInLevel (const QSharedPointer< RealTerminal > &real_terminal) const
 TerminalStrip::previousTerminalInLevel.
 
QSharedPointer< RealTerminalnextTerminalInLevel (const QSharedPointer< RealTerminal > &real_terminal) const
 TerminalStrip::nextTerminalInLevel.
 
QSharedPointer< RealTerminalpreviousRealTerminal (const QSharedPointer< RealTerminal > &real_terminal) const
 
QSharedPointer< RealTerminalnextRealTerminal (const QSharedPointer< RealTerminal > &real_terminal) const
 
QDomElement toXml (QDomDocument &parent_document)
 TerminalStrip::toXml.
 
bool fromXml (QDomElement &xml_element)
 TerminalStrip::fromXml.
 

Static Public Member Functions

static QString xmlTagName ()
 

Private Attributes

TerminalStripData m_data
 
QPointer< QETProjectm_project
 
QVector< QSharedPointer< PhysicalTerminal > > m_physical_terminals
 
QVector< QSharedPointer< TerminalStripBridge > > m_bridge
 

Friends

class TerminalStripModel
 
class RealTerminalData
 

Detailed Description

The TerminalStrip class This class hold all the datas and configurations of a terminal strip (but the not the visual aspect). A terminal strip have some informations (name comment etc...) and is composed by one or several PhysicalTerminal.

Constructor & Destructor Documentation

◆ TerminalStrip() [1/2]

TerminalStrip::TerminalStrip ( QETProject project)

TerminalStrip::TerminalStrip.

Parameters
project

◆ TerminalStrip() [2/2]

TerminalStrip::TerminalStrip ( const QString &  installation,
const QString &  location,
const QString &  name,
QETProject project 
)

TerminalStrip::TerminalStrip.

Parameters
installation
location
name
project
Here is the call graph for this function:

Member Function Documentation

◆ addAndGroupTerminals()

void TerminalStrip::addAndGroupTerminals ( const QVector< QVector< QSharedPointer< RealTerminal > > > &  real_t_vector)

TerminalStrip::addAndGroupTerminals For each real terminals of second vector, add it to terminal strip and group them together.

Parameters
real_t_vector
Here is the call graph for this function:

◆ addTerminal() [1/3]

bool TerminalStrip::addTerminal ( Element terminal)

TerminalStrip::addTerminal Add terminal to this terminal strip.

Parameters
terminal
Returns
true if the terminal was successfully added. Return false, if terminal already exist. Return false, if terminal is not a terminal element.
Here is the call graph for this function:

◆ addTerminal() [2/3]

bool TerminalStrip::addTerminal ( QSharedPointer< PhysicalTerminal phy_t)

TerminalStrip::addTerminal Add phy_t in this terminal strip.

Parameters
phy_t
Returns
true if successfully added. A terminal can't be added is already belong to another terminal strip.
Here is the call graph for this function:

◆ addTerminal() [3/3]

bool TerminalStrip::addTerminal ( QSharedPointer< RealTerminal real_t)
Here is the call graph for this function:

◆ addTerminals() [1/2]

void TerminalStrip::addTerminals ( QVector< QSharedPointer< PhysicalTerminal > >  phy_t_vector)
Here is the call graph for this function:

◆ addTerminals() [2/2]

void TerminalStrip::addTerminals ( QVector< QSharedPointer< RealTerminal > >  real_t_vector)

TerminalStrip::addTerminals Add terminal in real_t_vector to this terminal.

Parameters
real_t_vector
Here is the call graph for this function:

◆ bridgeChanged

void TerminalStrip::bridgeChanged ( )
signal
Here is the caller graph for this function:

◆ bridgeColorChanged

void TerminalStrip::bridgeColorChanged ( QSharedPointer< TerminalStripBridge bridge)
signal
Here is the caller graph for this function:

◆ bridgeFor()

QSharedPointer< TerminalStripBridge > TerminalStrip::bridgeFor ( const QVector< QSharedPointer< RealTerminal > > &  terminal_vector) const

TerminalStrip::bridgeFor Return the bridge where at least one terminal of terminal_vector belong. If several terminals are bridged but not to the same bridge return a TerminalStripBridge with 0 real_terminals_uuid_vector.

See also
TerminalStripBridge
Parameters
terminal_vector
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ canUnBridge()

bool TerminalStrip::canUnBridge ( const QVector< QSharedPointer< RealTerminal > > &  real_terminals) const

TerminalStrip::canUnBridge.

Parameters
m_real_terminals
Returns
True if all terminals of real_terminals can be unbridged. For this method return True, all terminals must be bridged together, be consecutive and in one or the both extremities of the bridge.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ comment()

QString TerminalStrip::comment ( ) const
inline
Here is the caller graph for this function:

◆ data()

TerminalStripData TerminalStrip::data ( ) const

TerminalStrip::data.

Returns
The internal data of this strip
Here is the caller graph for this function:

◆ description()

QString TerminalStrip::description ( ) const
inline
Here is the caller graph for this function:

◆ fromXml()

bool TerminalStrip::fromXml ( QDomElement &  xml_element)

TerminalStrip::fromXml.

Parameters
xml_element
Returns
Set up this terminal strip from the xml description xml_element
Here is the call graph for this function:

◆ groupTerminals()

bool TerminalStrip::groupTerminals ( const QSharedPointer< PhysicalTerminal > &  receiver_terminal,
const QVector< QSharedPointer< RealTerminal > > &  added_terminals 
)

TerminalStrip::groupTerminal Add added_terminal to receiver_terminal. At the end of this method, if there is physical terminal without any real terminal, they will be removed and receiver_terminal become a multi-level terminal. Emit the signal orderChanged();.

Parameters
added_terminal
receiver_terminal
Returns
true if success
Here is the call graph for this function:

◆ installation()

QString TerminalStrip::installation ( ) const
inline
Here is the caller graph for this function:

◆ isBridgeable() [1/2]

bool TerminalStrip::isBridgeable ( const QVector< QSharedPointer< RealTerminal > > &  real_terminals) const

TerminalStrip::isBridgeable Check if all realTerminal in real_terminals are bridgeable together. To be bridgeable, each real terminal must belong to this terminal strip be at the same level, be consecutive and not belong to the same physicalTerminal and at least one terminal must be not bridged.

Parameters
real_terminals: a vector of realterminal
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isBridgeable() [2/2]

bool TerminalStrip::isBridgeable ( QSharedPointer< TerminalStripBridge bridge,
const QVector< QSharedPointer< RealTerminal > > &  real_terminals 
) const

TerminalStrip::isBridgeable Check if all RealTerminal of real_terminals can be bridged to the bridge bridge.

Parameters
real_terminals
Returns
true if can be bridged.
Here is the call graph for this function:

◆ isBridged()

QSharedPointer< TerminalStripBridge > TerminalStrip::isBridged ( const QSharedPointer< RealTerminal real_terminal) const

TerminalStrip::isBridged Check if real_terminal is bridged.

Parameters
real_terminal
Returns
a pointer of TerminalStripBridge if bridget or a null QSharedPointer.
Here is the caller graph for this function:

◆ location()

QString TerminalStrip::location ( ) const
inline
Here is the caller graph for this function:

◆ name()

QString TerminalStrip::name ( ) const
inline
Here is the caller graph for this function:

◆ nextRealTerminal()

QSharedPointer< RealTerminal > TerminalStrip::nextRealTerminal ( const QSharedPointer< RealTerminal > &  real_terminal) const
Here is the call graph for this function:

◆ nextTerminalInLevel()

QSharedPointer< RealTerminal > TerminalStrip::nextTerminalInLevel ( const QSharedPointer< RealTerminal > &  real_terminal) const

TerminalStrip::nextTerminalInLevel.

Parameters
real_terminal
Returns
The next real terminal at the same level of real_t or a null RealTerminalData if there not a next real terminal
Here is the caller graph for this function:

◆ orderChanged

void TerminalStrip::orderChanged ( )
signal
Here is the caller graph for this function:

◆ physicalTerminal() [1/3]

QVector< QSharedPointer< PhysicalTerminal > > TerminalStrip::physicalTerminal ( ) const

TerminalStrip::physicalTerminal.

Returns
A vector of all physical terminal owned by this terminal strip. The order of the vector is the same as the order of the terminal in the strip

◆ physicalTerminal() [2/3]

QSharedPointer< PhysicalTerminal > TerminalStrip::physicalTerminal ( const QUuid &  uuid) const

TerminalStrip::physicalTerminal.

Parameters
uuid
Returns
the the physicalTerminal with the uuid uuid or a empty QSharedPointer if empty.
Here is the call graph for this function:

◆ physicalTerminal() [3/3]

QSharedPointer< PhysicalTerminal > TerminalStrip::physicalTerminal ( int  index) const

TerminalStrip::physicalTerminalData.

Parameters
index
Returns
The data of the physical terminal at index index returned QSharedPointer can be null
Here is the caller graph for this function:

◆ physicalTerminalCount()

int TerminalStrip::physicalTerminalCount ( ) const

TerminalStrip::physicalTerminalCount.

Returns
the number of physical terminal. A physical terminal is the representation of a real electrical terminal. Notice that a physical terminal can have level (like in real life)
Here is the caller graph for this function:

◆ pos()

int TerminalStrip::pos ( const QSharedPointer< PhysicalTerminal > &  terminal) const

TerminalStrip::pos.

Parameters
terminal
Returns
the position of the physical terminal or -1 if not found

◆ previousRealTerminal()

QSharedPointer< RealTerminal > TerminalStrip::previousRealTerminal ( const QSharedPointer< RealTerminal > &  real_terminal) const
Here is the call graph for this function:

◆ previousTerminalInLevel()

QSharedPointer< RealTerminal > TerminalStrip::previousTerminalInLevel ( const QSharedPointer< RealTerminal > &  real_terminal) const

TerminalStrip::previousTerminalInLevel.

Parameters
real_terminal
Returns
The previous real terminal at the samne level of real_t or a null RealTerminalData if there not a previous real terminal
Here is the caller graph for this function:

◆ project()

QETProject * TerminalStrip::project ( ) const

TerminalStrip::project.

Returns
the project of this terminal strip or nullptr
Here is the caller graph for this function:

◆ realTerminalForUuid()

QSharedPointer< RealTerminal > TerminalStrip::realTerminalForUuid ( const QUuid &  uuid) const

TerminalStrip::realTerminalForUuid.

Parameters
uuid
Returns
the real terminal with uuid uuid or a null QSharedPointer if not found
Here is the call graph for this function:

◆ realTerminals()

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

TerminalStrip::realTerminals.

Returns
All real terminal owned by this strip
Here is the caller graph for this function:

◆ removeTerminal() [1/3]

bool TerminalStrip::removeTerminal ( Element terminal)

TerminalStrip::removeTerminal Remove terminal from this terminal strip.

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

◆ removeTerminal() [2/3]

bool TerminalStrip::removeTerminal ( QSharedPointer< PhysicalTerminal phy_t)

TerminalStrip::removeTerminal Remove phy_t from this terminal strip.

Parameters
phy_t
Returns
true if successfully removed. Return false if can't be removed because not owned by this strip
Here is the call graph for this function:

◆ removeTerminal() [3/3]

bool TerminalStrip::removeTerminal ( QSharedPointer< RealTerminal real_t)
Here is the call graph for this function:

◆ removeTerminals() [1/2]

void TerminalStrip::removeTerminals ( QVector< QSharedPointer< PhysicalTerminal > >  phy_t_vector)
Here is the call graph for this function:

◆ removeTerminals() [2/2]

void TerminalStrip::removeTerminals ( QVector< QSharedPointer< RealTerminal > >  real_t_vector)

TerminalStrip::removeTerminals Remove terminals in real_t_vector from this terminal strip.

Parameters
real_t_vector
Here is the call graph for this function:

◆ setBridge() [1/2]

bool TerminalStrip::setBridge ( const QSharedPointer< TerminalStripBridge > &  bridge,
const QVector< QSharedPointer< RealTerminal > > &  real_terminals 
)

TerminalStrip::setBridge Bridge the RealTerminal of real_terminals_data to bridge.

Parameters
bridge
real_terminals_data
Returns
true if all RealTerminal was successfully bridged
Here is the call graph for this function:

◆ setBridge() [2/2]

bool TerminalStrip::setBridge ( const QVector< QSharedPointer< RealTerminal > > &  real_terminals)

TerminalStrip::setBridge Set a bridge between all real terminal of real_terminals.

See also
TerminalStrip::isBridgeable
Returns
true if bridge was successfully created
Here is the call graph for this function:

◆ setComment()

void TerminalStrip::setComment ( const QString &  comment)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setData()

void TerminalStrip::setData ( const TerminalStripData data)

TerminalStrip::setData Set the internal data of this strip to data. the uuid of the new data is set to the uuid of the previous data to keep the uuid of the terminal strip unchanged.

Parameters
data
Here is the call graph for this function:

◆ setDescription()

void TerminalStrip::setDescription ( const QString &  description)
Here is the call graph for this function:

◆ setInstallation()

void TerminalStrip::setInstallation ( const QString &  installation)
Here is the call graph for this function:

◆ setLevel()

bool TerminalStrip::setLevel ( const QSharedPointer< RealTerminal > &  real_terminal,
int  level 
)

TerminalStrip::setLevel.

Parameters
real_terminal_data
level
Returns
Here is the call graph for this function:

◆ setLocation()

void TerminalStrip::setLocation ( const QString &  location)
Here is the call graph for this function:

◆ setName()

void TerminalStrip::setName ( const QString &  name)
Here is the call graph for this function:

◆ setOrderTo()

bool TerminalStrip::setOrderTo ( const QVector< QSharedPointer< PhysicalTerminal > > &  sorted_vector)

TerminalStrip::setSortedTo Sort the physical terminal owned by this strip in the same order as sorted_vector. sorted_vector must contain exactly the same physical terminal as this strip else this function do nothing.

To avoid any mistake, you should call TerminalStrip::physicalTerminal() sort the returned vector and call this function with sorted vector, then you are sure the vector contain the same values, no more no less.

Parameters
sorted_vector
Returns
true is successfully sorted.
Here is the call graph for this function:

◆ toXml()

QDomElement TerminalStrip::toXml ( QDomDocument &  parent_document)

TerminalStrip::toXml.

Parameters
parent_document
Returns
Here is the call graph for this function:

◆ unBridge()

void TerminalStrip::unBridge ( const QVector< QSharedPointer< RealTerminal > > &  real_terminals)

TerminalStrip::unBridge Unbridge all real terminals of real_terminals.

See also
TerminalStrip::canUnBridge
Parameters
real_terminals
Here is the call graph for this function:

◆ unGroupTerminals()

void TerminalStrip::unGroupTerminals ( const QVector< QSharedPointer< RealTerminal > > &  terminals_to_ungroup)

TerminalStrip::unGroupTerminals Ungroup all real terminals of terminals_to_ungroup.

Parameters
terminals_to_ungroup
Here is the call graph for this function:

◆ uuid()

QUuid TerminalStrip::uuid ( ) const
inline
Here is the caller graph for this function:

◆ xmlTagName()

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

Friends And Related Symbol Documentation

◆ RealTerminalData

friend class RealTerminalData
friend

◆ TerminalStripModel

friend class TerminalStripModel
friend

Member Data Documentation

◆ m_bridge

QVector<QSharedPointer<TerminalStripBridge> > TerminalStrip::m_bridge
private

◆ m_data

TerminalStripData TerminalStrip::m_data
private

◆ m_physical_terminals

QVector<QSharedPointer<PhysicalTerminal> > TerminalStrip::m_physical_terminals
private

◆ m_project

QPointer<QETProject> TerminalStrip::m_project
private

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