QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
physicalterminal.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef PHYSICALTERMINAL_H
19#define PHYSICALTERMINAL_H
20
21#include <QSharedPointer>
22#include <QDomElement>
23#include <QPointer>
24#include <QUuid>
25#include <QVector>
26
27class RealTerminal;
28class TerminalStrip;
29
62{
63 friend class TerminalStrip;
64 friend class RealTerminal;
65
66 private:
67 PhysicalTerminal(TerminalStrip *parent_strip, QVector<QSharedPointer<RealTerminal>> terminals);
68 QSharedPointer<PhysicalTerminal> sharedRef();
69 QWeakPointer<PhysicalTerminal> weakRef();
70
71 QDomElement toXml(QDomDocument &parent_document) const;
72
73 void setTerminals(const QVector<QSharedPointer<RealTerminal>> &terminals);
74 void addTerminal(const QSharedPointer<RealTerminal> &terminal);
75 bool removeTerminal(const QSharedPointer<RealTerminal> &terminal);
76
77 bool setLevelOf(const QSharedPointer<RealTerminal> &terminal, int level);
78
79 void setParentStrip(TerminalStrip *strip);
80
81 public:
84
86 int levelCount() const;
87 int levelOf(const QSharedPointer<RealTerminal> &terminal) const;
88 QVector<QSharedPointer<RealTerminal>> realTerminals() const;
89 QUuid uuid() const;
90 int pos() const;
91 int realTerminalCount() const;
92
93 static QString xmlTagName();
94
95 private:
96 QPointer<TerminalStrip> m_parent_terminal_strip;
97 QVector<QSharedPointer<RealTerminal>> m_real_terminal;
98 QUuid m_uuid = QUuid::createUuid();
99 QWeakPointer<PhysicalTerminal> m_this_weak;
100};
101
102#endif // PHYSICALTERMINAL_H
The PhysicalTerminal class Represent a physical terminal. A physical terminal is composed a least by ...
Definition physicalterminal.h:62
int levelOf(const QSharedPointer< RealTerminal > &terminal) const
levelOf
Definition physicalterminal.cpp:180
QWeakPointer< PhysicalTerminal > weakRef()
PhysicalTerminal::weakRef.
Definition physicalterminal.cpp:61
QVector< QSharedPointer< RealTerminal > > realTerminals() const
terminals
Definition physicalterminal.cpp:188
int levelCount() const
levelCount
Definition physicalterminal.cpp:170
void setParentStrip(TerminalStrip *strip)
Definition physicalterminal.cpp:144
void addTerminal(const QSharedPointer< RealTerminal > &terminal)
addTerminals Append the real terminal terminal to this physical terminal.
Definition physicalterminal.cpp:102
void setTerminals(const QVector< QSharedPointer< RealTerminal > > &terminals)
setTerminals Set the RealTerminal who compose this physical terminal. The position of the RealTermina...
Definition physicalterminal.cpp:87
QSharedPointer< PhysicalTerminal > sharedRef()
PhysicalTerminal::sharedRef.
Definition physicalterminal.cpp:45
QUuid m_uuid
Definition physicalterminal.h:98
QPointer< TerminalStrip > m_parent_terminal_strip
Definition physicalterminal.h:96
~PhysicalTerminal()
Definition physicalterminal.cpp:149
int pos() const
Definition physicalterminal.cpp:200
QWeakPointer< PhysicalTerminal > m_this_weak
Definition physicalterminal.h:99
static QString xmlTagName()
Definition physicalterminal.cpp:213
TerminalStrip * terminalStrip() const
PhysicalTerminal::terminalStrip.
Definition physicalterminal.cpp:162
QDomElement toXml(QDomDocument &parent_document) const
toXml
Definition physicalterminal.cpp:70
PhysicalTerminal()
Definition physicalterminal.h:82
bool removeTerminal(const QSharedPointer< RealTerminal > &terminal)
removeTerminal Remove terminal from the list of real terminal
Definition physicalterminal.cpp:113
bool setLevelOf(const QSharedPointer< RealTerminal > &terminal, int level)
setLevelOf Change the level of terminal
Definition physicalterminal.cpp:128
QVector< QSharedPointer< RealTerminal > > m_real_terminal
Definition physicalterminal.h:97
int realTerminalCount() const
Definition physicalterminal.cpp:209
QUuid uuid() const
uuid
Definition physicalterminal.cpp:196
The RealTerminal class Represent a real terminal. A real terminal can be a drawn terminal in a folio ...
Definition realterminal.h:43
The TerminalStrip class This class hold all the datas and configurations of a terminal strip (but the...
Definition terminalstrip.h:45