QElectroTech 0.100.0-dev
|
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.
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 |
QETProject * | project () 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< PhysicalTerminal > | physicalTerminal (int index) const |
TerminalStrip::physicalTerminalData. | |
QSharedPointer< PhysicalTerminal > | physicalTerminal (const QUuid &uuid) const |
TerminalStrip::physicalTerminal. | |
QVector< QSharedPointer< PhysicalTerminal > > | physicalTerminal () const |
TerminalStrip::physicalTerminal. | |
QSharedPointer< RealTerminal > | realTerminalForUuid (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< TerminalStripBridge > | isBridged (const QSharedPointer< RealTerminal > real_terminal) const |
TerminalStrip::isBridged Check if real_terminal is bridged. | |
QSharedPointer< TerminalStripBridge > | 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. | |
QSharedPointer< RealTerminal > | previousTerminalInLevel (const QSharedPointer< RealTerminal > &real_terminal) const |
TerminalStrip::previousTerminalInLevel. | |
QSharedPointer< RealTerminal > | nextTerminalInLevel (const QSharedPointer< RealTerminal > &real_terminal) const |
TerminalStrip::nextTerminalInLevel. | |
QSharedPointer< RealTerminal > | previousRealTerminal (const QSharedPointer< RealTerminal > &real_terminal) const |
QSharedPointer< RealTerminal > | nextRealTerminal (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< QETProject > | m_project |
QVector< QSharedPointer< PhysicalTerminal > > | m_physical_terminals |
QVector< QSharedPointer< TerminalStripBridge > > | m_bridge |
Friends | |
class | TerminalStripModel |
class | RealTerminalData |
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.
TerminalStrip::TerminalStrip | ( | QETProject * | project | ) |
project |
TerminalStrip::TerminalStrip | ( | const QString & | installation, |
const QString & | location, | ||
const QString & | name, | ||
QETProject * | project | ||
) |
installation | |
location | |
name | |
project |
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.
real_t_vector |
bool TerminalStrip::addTerminal | ( | Element * | terminal | ) |
TerminalStrip::addTerminal Add terminal to this terminal strip.
terminal |
bool TerminalStrip::addTerminal | ( | QSharedPointer< PhysicalTerminal > | phy_t | ) |
TerminalStrip::addTerminal Add phy_t in this terminal strip.
phy_t |
bool TerminalStrip::addTerminal | ( | QSharedPointer< RealTerminal > | real_t | ) |
void TerminalStrip::addTerminals | ( | QVector< QSharedPointer< PhysicalTerminal > > | phy_t_vector | ) |
void TerminalStrip::addTerminals | ( | QVector< QSharedPointer< RealTerminal > > | real_t_vector | ) |
TerminalStrip::addTerminals Add terminal in real_t_vector to this terminal.
real_t_vector |
|
signal |
|
signal |
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.
terminal_vector |
bool TerminalStrip::canUnBridge | ( | const QVector< QSharedPointer< RealTerminal > > & | real_terminals | ) | const |
m_real_terminals |
|
inline |
TerminalStripData TerminalStrip::data | ( | ) | const |
|
inline |
bool TerminalStrip::fromXml | ( | QDomElement & | xml_element | ) |
xml_element |
xml_element
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();.
added_terminal | |
receiver_terminal |
|
inline |
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.
real_terminals | : a vector of realterminal |
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.
real_terminals |
QSharedPointer< TerminalStripBridge > TerminalStrip::isBridged | ( | const QSharedPointer< RealTerminal > | real_terminal | ) | const |
TerminalStrip::isBridged Check if real_terminal is bridged.
real_terminal |
|
inline |
|
inline |
QSharedPointer< RealTerminal > TerminalStrip::nextRealTerminal | ( | const QSharedPointer< RealTerminal > & | real_terminal | ) | const |
QSharedPointer< RealTerminal > TerminalStrip::nextTerminalInLevel | ( | const QSharedPointer< RealTerminal > & | real_terminal | ) | const |
TerminalStrip::nextTerminalInLevel.
real_terminal |
|
signal |
QVector< QSharedPointer< PhysicalTerminal > > TerminalStrip::physicalTerminal | ( | ) | const |
TerminalStrip::physicalTerminal.
QSharedPointer< PhysicalTerminal > TerminalStrip::physicalTerminal | ( | const QUuid & | uuid | ) | const |
TerminalStrip::physicalTerminal.
uuid |
QSharedPointer< PhysicalTerminal > TerminalStrip::physicalTerminal | ( | int | index | ) | const |
TerminalStrip::physicalTerminalData.
index |
index
returned QSharedPointer can be null int TerminalStrip::physicalTerminalCount | ( | ) | const |
TerminalStrip::physicalTerminalCount.
int TerminalStrip::pos | ( | const QSharedPointer< PhysicalTerminal > & | terminal | ) | const |
terminal |
QSharedPointer< RealTerminal > TerminalStrip::previousRealTerminal | ( | const QSharedPointer< RealTerminal > & | real_terminal | ) | const |
QSharedPointer< RealTerminal > TerminalStrip::previousTerminalInLevel | ( | const QSharedPointer< RealTerminal > & | real_terminal | ) | const |
TerminalStrip::previousTerminalInLevel.
real_terminal |
QETProject * TerminalStrip::project | ( | ) | const |
QSharedPointer< RealTerminal > TerminalStrip::realTerminalForUuid | ( | const QUuid & | uuid | ) | const |
TerminalStrip::realTerminalForUuid.
uuid |
QVector< QSharedPointer< RealTerminal > > TerminalStrip::realTerminals | ( | ) | const |
bool TerminalStrip::removeTerminal | ( | Element * | terminal | ) |
TerminalStrip::removeTerminal Remove terminal from this terminal strip.
terminal |
bool TerminalStrip::removeTerminal | ( | QSharedPointer< PhysicalTerminal > | phy_t | ) |
TerminalStrip::removeTerminal Remove phy_t from this terminal strip.
phy_t |
bool TerminalStrip::removeTerminal | ( | QSharedPointer< RealTerminal > | real_t | ) |
void TerminalStrip::removeTerminals | ( | QVector< QSharedPointer< PhysicalTerminal > > | phy_t_vector | ) |
void TerminalStrip::removeTerminals | ( | QVector< QSharedPointer< RealTerminal > > | real_t_vector | ) |
TerminalStrip::removeTerminals Remove terminals in real_t_vector from this terminal strip.
real_t_vector |
bool TerminalStrip::setBridge | ( | const QSharedPointer< TerminalStripBridge > & | bridge, |
const QVector< QSharedPointer< RealTerminal > > & | real_terminals | ||
) |
TerminalStrip::setBridge Bridge the RealTerminal of real_terminals_data to bridge.
bridge | |
real_terminals_data |
bool TerminalStrip::setBridge | ( | const QVector< QSharedPointer< RealTerminal > > & | real_terminals | ) |
TerminalStrip::setBridge Set a bridge between all real terminal of real_terminals.
void TerminalStrip::setComment | ( | const QString & | comment | ) |
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.
data |
void TerminalStrip::setDescription | ( | const QString & | description | ) |
void TerminalStrip::setInstallation | ( | const QString & | installation | ) |
bool TerminalStrip::setLevel | ( | const QSharedPointer< RealTerminal > & | real_terminal, |
int | level | ||
) |
real_terminal_data | |
level |
void TerminalStrip::setLocation | ( | const QString & | location | ) |
void TerminalStrip::setName | ( | const QString & | name | ) |
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.
sorted_vector |
QDomElement TerminalStrip::toXml | ( | QDomDocument & | parent_document | ) |
void TerminalStrip::unBridge | ( | const QVector< QSharedPointer< RealTerminal > > & | real_terminals | ) |
TerminalStrip::unBridge Unbridge all real terminals of real_terminals.
real_terminals |
void TerminalStrip::unGroupTerminals | ( | const QVector< QSharedPointer< RealTerminal > > & | terminals_to_ungroup | ) |
TerminalStrip::unGroupTerminals Ungroup all real terminals of terminals_to_ungroup
.
terminals_to_ungroup |
|
inline |
|
inlinestatic |
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |