mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
TEST a Merge branch 'XMLProperties'
it gets built let's test it for bugs Conflicts: sources/ElementsCollection/fileelementcollectionitem.cpp sources/QetGraphicsItemModeler/qetgraphicshandleritem.h sources/borderproperties.cpp sources/conductorproperties.cpp sources/conductorproperties.h sources/diagram.cpp sources/diagram.h sources/diagramprintdialog.cpp sources/diagramprintdialog.h sources/editor/graphicspart/customelementgraphicpart.cpp sources/editor/graphicspart/partarc.cpp sources/editor/graphicspart/partdynamictextfield.cpp sources/editor/graphicspart/partdynamictextfield.h sources/editor/graphicspart/partellipse.cpp sources/editor/graphicspart/partline.cpp sources/editor/graphicspart/partpolygon.cpp sources/editor/graphicspart/partrectangle.cpp sources/editor/graphicspart/partterminal.cpp sources/editor/graphicspart/partterminal.h sources/editor/graphicspart/parttext.cpp sources/properties/propertiesinterface.cpp sources/properties/propertiesinterface.h sources/properties/terminaldata.cpp sources/properties/terminaldata.h sources/properties/xrefproperties.cpp sources/properties/xrefproperties.h sources/qetgraphicsitem/conductor.cpp sources/qetgraphicsitem/conductor.h sources/qetgraphicsitem/conductortextitem.h sources/qetgraphicsitem/dynamicelementtextitem.h sources/qetgraphicsitem/element.cpp sources/qetgraphicsitem/element.h sources/qetgraphicsitem/elementtextitemgroup.h sources/qetgraphicsitem/slaveelement.cpp sources/qetgraphicsitem/slaveelement.h sources/qetgraphicsitem/terminal.cpp sources/qetgraphicsitem/terminal.h sources/qetproject.cpp sources/titleblockproperties.cpp
This commit is contained in:
@@ -22,13 +22,15 @@
|
||||
#include <QColor>
|
||||
#include <QSettings>
|
||||
|
||||
#include "propertiesinterface.h"
|
||||
|
||||
class QPainter;
|
||||
|
||||
/**
|
||||
@brief The SingleLineProperties class
|
||||
This class represents the properties of a singleline conductor.
|
||||
*/
|
||||
class SingleLineProperties {
|
||||
class SingleLineProperties: public PropertiesInterface {
|
||||
public:
|
||||
SingleLineProperties();
|
||||
virtual ~SingleLineProperties();
|
||||
@@ -37,23 +39,25 @@ class SingleLineProperties {
|
||||
unsigned short int phasesCount();
|
||||
bool isPen() const;
|
||||
void draw(QPainter *, QET::ConductorSegmentType, const QRectF &);
|
||||
void toXml(QDomElement &) const;
|
||||
void fromXml(QDomElement &);
|
||||
void toSettings(QSettings &, const QString & = QString()) const;
|
||||
void fromSettings(QSettings &, const QString & = QString());
|
||||
QDomElement toXml(QDomDocument& doc) const override;
|
||||
bool fromXml(const QDomElement &) override;
|
||||
static bool valideXml(QDomElement& element);
|
||||
void toSettings(QSettings &, const QString & = QString()) const override;
|
||||
void fromSettings(const QSettings &, const QString & = QString()) override;
|
||||
|
||||
/// Whether the singleline conductor should display the ground symbol
|
||||
bool hasGround;
|
||||
bool hasGround{true};
|
||||
/// Whether the singleline conductor should display the neutral symbol
|
||||
bool hasNeutral;
|
||||
bool hasNeutral{true};
|
||||
/// Protective Earth Neutral: visually merge neutral and ground
|
||||
bool is_pen;
|
||||
|
||||
bool is_pen{false};
|
||||
|
||||
int operator==(const SingleLineProperties &) const;
|
||||
int operator!=(const SingleLineProperties &) const;
|
||||
|
||||
private:
|
||||
unsigned short int phases;
|
||||
unsigned short int phases{1};
|
||||
void drawGround (QPainter *, QET::ConductorSegmentType, QPointF, qreal);
|
||||
void drawNeutral(QPainter *, QPointF, qreal);
|
||||
void drawPen(QPainter *, QET::ConductorSegmentType, QPointF, qreal);
|
||||
@@ -64,7 +68,7 @@ class SingleLineProperties {
|
||||
This class represents the functional properties of a particular conductor,
|
||||
i.e. properties other than path and terminals.
|
||||
*/
|
||||
class ConductorProperties
|
||||
class ConductorProperties: public PropertiesInterface
|
||||
{
|
||||
public:
|
||||
ConductorProperties();
|
||||
@@ -78,52 +82,45 @@ class ConductorProperties
|
||||
*/
|
||||
enum ConductorType { Single, Multi };
|
||||
|
||||
//Attributes
|
||||
ConductorType type{ConductorType::Single};
|
||||
|
||||
//Attributes
|
||||
ConductorType type;
|
||||
// TODO: set default values!
|
||||
QColor color{QColor(Qt::black)},
|
||||
m_color_2{QColor(Qt::black)},
|
||||
text_color{QColor(Qt::black)};
|
||||
|
||||
QColor
|
||||
color,
|
||||
m_color_2,
|
||||
text_color;
|
||||
QString text,
|
||||
m_function,
|
||||
m_tension_protocol,
|
||||
m_wire_color,
|
||||
m_wire_section,
|
||||
m_formula;
|
||||
|
||||
QString
|
||||
text,
|
||||
m_function,
|
||||
m_tension_protocol,
|
||||
m_wire_color,
|
||||
m_wire_section,
|
||||
m_formula,
|
||||
m_bus,
|
||||
m_cable;
|
||||
int text_size{9},
|
||||
m_dash_size = 1;
|
||||
|
||||
int
|
||||
text_size,
|
||||
m_dash_size = 1;
|
||||
double cond_size{1},
|
||||
verti_rotate_text,
|
||||
horiz_rotate_text;
|
||||
|
||||
double
|
||||
cond_size,
|
||||
verti_rotate_text,
|
||||
horiz_rotate_text;
|
||||
bool m_show_text{true},
|
||||
m_one_text_per_folio{true},
|
||||
m_bicolor = false;
|
||||
|
||||
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::Alignment
|
||||
m_horizontal_alignment = Qt::AlignBottom,
|
||||
m_vertical_alignment = Qt::AlignRight;
|
||||
|
||||
Qt::PenStyle style;
|
||||
Qt::PenStyle style{Qt::PenStyle::SolidLine};
|
||||
|
||||
SingleLineProperties singleLineProperties;
|
||||
|
||||
// methods
|
||||
void toXml(QDomElement &) const;
|
||||
void fromXml(QDomElement &);
|
||||
void toSettings(QSettings &, const QString & = QString()) const;
|
||||
void fromSettings(QSettings &, const QString & = QString());
|
||||
// methods
|
||||
QDomElement toXml(QDomDocument &doc) const override;
|
||||
bool fromXml(const QDomElement &) override;
|
||||
static bool valideXml(QDomElement& element);
|
||||
void toSettings(QSettings &, const QString & = QString()) const override;
|
||||
void fromSettings(const QSettings &, const QString & = QString()) override;
|
||||
static QString typeToString(ConductorType);
|
||||
void applyForEqualAttributes(QList<ConductorProperties> list);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user