QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
modelTerminalData.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 MODELTERMINALDATA_H
19#define MODELTERMINALDATA_H
20
21#include <QString>
22#include "../../qetgraphicsitem/element.h"
23#include "../realterminal.h"
24
26{
27 static modelRealTerminalData data(const QSharedPointer<RealTerminal> &real_t)
28 {
30 if (!real_t.isNull())
31 {
32 mrtd.level_ = real_t->level();
33 mrtd.label_ = real_t->label();
34 mrtd.Xref_ = real_t->Xref();
35 mrtd.cable_ = real_t->cable();
36 mrtd.cable_wire = real_t->cableWire();
37 mrtd.conductor_ = real_t->conductor();
38 mrtd.led_ = real_t->isLed();
39 mrtd.type_ = real_t->type();
40 mrtd.function_ = real_t->function();
41 mrtd.element_ = real_t->element();
42 mrtd.real_terminal = real_t.toWeakRef();
43 mrtd.bridged_ = real_t->isBridged();
44 }
45
46 return mrtd;
47 }
48
49 int level_ = -1;
50 QString label_;
51 QString Xref_;
52 QString cable_;
53 QString cable_wire;
54 QString conductor_;
55 bool led_ = false;
56 bool bridged_ = false;
57
60 QPointer<Element> element_;
61
62 QWeakPointer<RealTerminal> real_terminal;
63};
64
66{
67 QVector<modelRealTerminalData> real_data;
68 int pos_ = -1;
69 QUuid uuid_;
70};
71
72inline bool operator == (const modelPhysicalTerminalData &data_1, const modelPhysicalTerminalData &data_2) {
73 return data_1.uuid_ == data_2.uuid_;
74}
75
76#endif // MODELTERMINALDATA_H
TerminalType
Definition elementdata.h:72
@ TTGeneric
Definition elementdata.h:73
TerminalFunction
Definition elementdata.h:81
@ TFGeneric
Definition elementdata.h:82
bool operator==(const modelPhysicalTerminalData &data_1, const modelPhysicalTerminalData &data_2)
Definition modelTerminalData.h:72
Definition modelTerminalData.h:66
QVector< modelRealTerminalData > real_data
Definition modelTerminalData.h:67
QUuid uuid_
Definition modelTerminalData.h:69
int pos_
Definition modelTerminalData.h:68
Definition modelTerminalData.h:26
static modelRealTerminalData data(const QSharedPointer< RealTerminal > &real_t)
Definition modelTerminalData.h:27
QString label_
Definition modelTerminalData.h:50
int level_
Definition modelTerminalData.h:49
QWeakPointer< RealTerminal > real_terminal
Definition modelTerminalData.h:62
ElementData::TerminalType type_
Definition modelTerminalData.h:58
QString conductor_
Definition modelTerminalData.h:54
bool bridged_
Definition modelTerminalData.h:56
bool led_
Definition modelTerminalData.h:55
ElementData::TerminalFunction function_
Definition modelTerminalData.h:59
QString Xref_
Definition modelTerminalData.h:51
QPointer< Element > element_
Definition modelTerminalData.h:60
QString cable_
Definition modelTerminalData.h:52
QString cable_wire
Definition modelTerminalData.h:53