QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
conductorproperties.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 CONDUCTOR_PROPERTIES_H
19#define CONDUCTOR_PROPERTIES_H
20
21#include "qet.h"
22#include <QColor>
23#include <QSettings>
24
25class QPainter;
26
32 public:
34 virtual ~SingleLineProperties();
35
36 void setPhasesCount(int);
37 unsigned short int phasesCount();
38 bool isPen() const;
39 void draw(QPainter *, QET::ConductorSegmentType, const QRectF &);
40 void toXml(QDomElement &) const;
41 void fromXml(QDomElement &);
42 void toSettings(QSettings &, const QString & = QString()) const;
43 void fromSettings(QSettings &, const QString & = QString());
44
50 bool is_pen;
51
52 int operator==(const SingleLineProperties &) const;
53 int operator!=(const SingleLineProperties &) const;
54
55 private:
56 unsigned short int phases;
57 void drawGround (QPainter *, QET::ConductorSegmentType, QPointF, qreal);
58 void drawNeutral(QPainter *, QPointF, qreal);
59 void drawPen(QPainter *, QET::ConductorSegmentType, QPointF, qreal);
60};
61
68{
69 public:
71 virtual ~ConductorProperties();
72
80
81
82 //Attributes
84
85 QColor
89
90 QString
99
100 int
103
104 double
108
109 bool
112 m_bicolor = false;
113
114 Qt::Alignment
115 m_horizontal_alignment = Qt::AlignBottom,
116 m_vertical_alignment = Qt::AlignRight;
117
118 Qt::PenStyle style;
119
121
122 // methods
123 void toXml(QDomElement &) const;
124 void fromXml(QDomElement &);
125 void toSettings(QSettings &, const QString & = QString()) const;
126 void fromSettings(QSettings &, const QString & = QString());
127 static QString typeToString(ConductorType);
128 void applyForEqualAttributes(QList<ConductorProperties> list);
129
131
132 // operators
133 bool operator==(const ConductorProperties &) const;
134 bool operator!=(const ConductorProperties &) const;
135
136 private:
137 void readStyle(const QString &);
138 QString writeStyle() const;
139};
140
142
143#endif
The ConductorProperties class This class represents the functional properties of a particular conduct...
Definition conductorproperties.h:68
QString m_wire_section
Definition conductorproperties.h:95
static QString typeToString(ConductorType)
Definition conductorproperties.cpp:455
void readStyle(const QString &)
Definition conductorproperties.cpp:808
void toSettings(QSettings &, const QString &=QString()) const
Definition conductorproperties.cpp:377
double verti_rotate_text
Definition conductorproperties.h:106
QString m_cable
Definition conductorproperties.h:98
int m_dash_size
Definition conductorproperties.h:102
QString text
Definition conductorproperties.h:91
QColor m_color_2
Definition conductorproperties.h:87
bool m_bicolor
Definition conductorproperties.h:112
QColor text_color
Definition conductorproperties.h:88
ConductorProperties()
Definition conductorproperties.cpp:242
double cond_size
Definition conductorproperties.h:105
bool m_show_text
Definition conductorproperties.h:110
QString m_tension_protocol
Definition conductorproperties.h:93
QColor color
Definition conductorproperties.h:86
ConductorType type
Definition conductorproperties.h:83
void fromXml(QDomElement &)
ConductorProperties::fromXml Import conductor properties from the attribute of the xml element 'e'.
Definition conductorproperties.cpp:314
QString m_wire_color
Definition conductorproperties.h:94
Qt::Alignment m_horizontal_alignment
Definition conductorproperties.h:115
void applyForEqualAttributes(QList< ConductorProperties > list)
ConductorProperties::applyForEqualAttributes Test each attribute of properties in the list separatly....
Definition conductorproperties.cpp:471
Qt::Alignment m_vertical_alignment
Definition conductorproperties.h:116
bool operator==(const ConductorProperties &) const
ConductorProperties::operator ==.
Definition conductorproperties.cpp:766
bool m_one_text_per_folio
Definition conductorproperties.h:111
Qt::PenStyle style
Definition conductorproperties.h:118
static ConductorProperties defaultProperties()
ConductorProperties::defaultProperties.
Definition conductorproperties.cpp:751
bool operator!=(const ConductorProperties &) const
Definition conductorproperties.cpp:800
QString m_bus
Definition conductorproperties.h:97
QString m_function
Definition conductorproperties.h:92
void toXml(QDomElement &) const
ConductorProperties::toXml Export conductor properties to the XML element 'e'.
Definition conductorproperties.cpp:269
virtual ~ConductorProperties()
Definition conductorproperties.cpp:259
SingleLineProperties singleLineProperties
Definition conductorproperties.h:120
int text_size
Definition conductorproperties.h:101
QString writeStyle() const
Definition conductorproperties.cpp:858
ConductorType
The ConductorType enum Represents the kind of a particular conductor: Single: singleline symbols,...
Definition conductorproperties.h:79
@ Multi
Definition conductorproperties.h:79
@ Single
Definition conductorproperties.h:79
double horiz_rotate_text
Definition conductorproperties.h:107
QString m_formula
Definition conductorproperties.h:96
void fromSettings(QSettings &, const QString &=QString())
Definition conductorproperties.cpp:412
The SingleLineProperties class This class represents the properties of a singleline conductor.
Definition conductorproperties.h:31
bool hasGround
Whether the singleline conductor should display the ground symbol.
Definition conductorproperties.h:46
unsigned short int phasesCount()
Definition conductorproperties.cpp:48
void fromXml(QDomElement &)
Definition conductorproperties.cpp:231
void draw(QPainter *, QET::ConductorSegmentType, const QRectF &)
Definition conductorproperties.cpp:69
void toSettings(QSettings &, const QString &=QString()) const
Definition conductorproperties.cpp:896
unsigned short int phases
Definition conductorproperties.h:56
SingleLineProperties()
Definition conductorproperties.cpp:26
void drawPen(QPainter *, QET::ConductorSegmentType, QPointF, qreal)
SingleLineProperties::drawPen Draw the PEN (Protective Earth Neutral) symbol using painter at positio...
Definition conductorproperties.cpp:191
int operator!=(const SingleLineProperties &) const
Definition conductorproperties.cpp:887
void drawGround(QPainter *, QET::ConductorSegmentType, QPointF, qreal)
Definition conductorproperties.cpp:125
int operator==(const SingleLineProperties &) const
Definition conductorproperties.cpp:873
virtual ~SingleLineProperties()
Destructeur.
Definition conductorproperties.cpp:35
void toXml(QDomElement &) const
Definition conductorproperties.cpp:218
bool is_pen
Protective Earth Neutral: visually merge neutral and ground.
Definition conductorproperties.h:50
void setPhasesCount(int)
Definition conductorproperties.cpp:43
bool isPen() const
Definition conductorproperties.cpp:58
bool hasNeutral
Whether the singleline conductor should display the neutral symbol.
Definition conductorproperties.h:48
void drawNeutral(QPainter *, QPointF, qreal)
Definition conductorproperties.cpp:159
void fromSettings(QSettings &, const QString &=QString())
Definition conductorproperties.cpp:909
Q_DECLARE_METATYPE(NamesList)
ConductorSegmentType
Known kinds of conductor segments.
Definition qet.h:84