QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
physicalterminal.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 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 QSharedPointer<RealTerminal> realTerminal(int pos) const;
90 QUuid uuid() const;
91 int pos() const;
92 int realTerminalCount() const;
93
94 static QString xmlTagName();
95
96 private:
97 QPointer<TerminalStrip> m_parent_terminal_strip;
98 QVector<QSharedPointer<RealTerminal>> m_real_terminal;
99 QUuid m_uuid = QUuid::createUuid();
100 QWeakPointer<PhysicalTerminal> m_this_weak;
101};
102
103#endif // PHYSICALTERMINAL_H
int levelOf(const QSharedPointer< RealTerminal > &terminal) const
levelOf
Definition physicalterminal.cpp:175
QWeakPointer< PhysicalTerminal > weakRef()
PhysicalTerminal::weakRef.
Definition physicalterminal.cpp:61
QSharedPointer< RealTerminal > realTerminal(int pos) const
PhysicalTerminal::realTerminal.
Definition physicalterminal.cpp:193
QVector< QSharedPointer< RealTerminal > > realTerminals() const
terminals
Definition physicalterminal.cpp:183
int levelCount() const
levelCount
Definition physicalterminal.cpp:165
friend class TerminalStrip
Definition physicalterminal.h:63
void setParentStrip(TerminalStrip *strip)
Definition physicalterminal.cpp:139
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:99
QPointer< TerminalStrip > m_parent_terminal_strip
Definition physicalterminal.h:97
~PhysicalTerminal()
Definition physicalterminal.cpp:144
int pos() const
Definition physicalterminal.cpp:209
QWeakPointer< PhysicalTerminal > m_this_weak
Definition physicalterminal.h:100
static QString xmlTagName()
Definition physicalterminal.cpp:222
friend class RealTerminal
Definition physicalterminal.h:64
TerminalStrip * terminalStrip() const
PhysicalTerminal::terminalStrip.
Definition physicalterminal.cpp:157
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
PhysicalTerminal(TerminalStrip *parent_strip, QVector< QSharedPointer< RealTerminal > > terminals)
PhysicalTerminal.
Definition physicalterminal.cpp:29
QVector< QSharedPointer< RealTerminal > > m_real_terminal
Definition physicalterminal.h:98
int realTerminalCount() const
Definition physicalterminal.cpp:218
QUuid uuid() const
uuid
Definition physicalterminal.cpp:205
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