WIP: Add Kabel to qet

This commit is contained in:
Simon De Backer
2020-09-24 22:39:48 +02:00
parent 30b8205f82
commit 546433cac2
4 changed files with 205 additions and 133 deletions

View File

@@ -1,17 +1,17 @@
/*
Copyright 2006-2020 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -41,17 +41,17 @@ class SingleLineProperties {
void fromXml(QDomElement &);
void toSettings(QSettings &, const QString & = QString()) const;
void fromSettings(QSettings &, const QString & = QString());
/// Whether the singleline conductor should display the ground symbol
bool hasGround;
/// Whether the singleline conductor should display the neutral symbol
bool hasNeutral;
/// Protective Earth Neutral: visually merge neutral and ground
bool is_pen;
int operator==(const SingleLineProperties &) const;
int operator!=(const SingleLineProperties &) const;
private:
unsigned short int phases;
void drawGround (QPainter *, QET::ConductorSegmentType, QPointF, qreal);
@@ -69,7 +69,7 @@ class ConductorProperties
public:
ConductorProperties();
virtual ~ConductorProperties();
/**
@brief The ConductorType enum Represents
the kind of a particular conductor:
@@ -81,36 +81,44 @@ class ConductorProperties
//Attributes
ConductorType type;
QColor color,
m_color_2,
text_color;
QString text,
m_function,
m_tension_protocol,
m_wire_color,
m_wire_section,
m_formula;
int text_size,
m_dash_size = 1;
double cond_size,
verti_rotate_text,
horiz_rotate_text;
bool m_show_text,
m_one_text_per_folio,
m_bicolor = false;
Qt::Alignment m_horizontal_alignment = Qt::AlignBottom,
m_vertical_alignment = Qt::AlignRight;
QColor
color,
m_color_2,
text_color;
QString
text,
m_function,
m_tension_protocol,
m_wire_color,
m_wire_section,
m_formula,
m_bus,
m_cable;
int
text_size,
m_dash_size = 1;
double
cond_size,
verti_rotate_text,
horiz_rotate_text;
bool
m_show_text,
m_one_text_per_folio,
m_bicolor = false;
Qt::Alignment
m_horizontal_alignment = Qt::AlignBottom,
m_vertical_alignment = Qt::AlignRight;
Qt::PenStyle style;
SingleLineProperties singleLineProperties;
// methods
void toXml(QDomElement &) const;
void fromXml(QDomElement &);
@@ -120,11 +128,11 @@ class ConductorProperties
void applyForEqualAttributes(QList<ConductorProperties> list);
static ConductorProperties defaultProperties();
// operators
bool operator==(const ConductorProperties &) const;
bool operator!=(const ConductorProperties &) const;
private:
void readStyle(const QString &);
QString writeStyle() const;