Add terminal strip data class

This commit is contained in:
joshua
2021-04-02 20:51:55 +02:00
parent 49674e7d33
commit 39aee4ad07
4 changed files with 91 additions and 15 deletions

View File

@@ -176,28 +176,30 @@ class PhysicalTerminal
*/
TerminalStrip::TerminalStrip(const QString &name, QETProject *project) :
QObject(project),
m_name(name),
m_project(project)
{}
{
m_data.m_name = name;
}
TerminalStrip::TerminalStrip(const QString &installation, const QString &location, const QString &name, QETProject *project) :
QObject(project),
m_installation(installation),
m_location(location),
m_name(name),
m_project(project)
{}
{
m_data.m_installation = installation;
m_data.m_location = location;
m_data.m_name = name;
}
void TerminalStrip::setInstallation(const QString &installation) {
m_installation = installation;
m_data.m_installation = installation;
}
void TerminalStrip::setLocation(const QString &location) {
m_location = location;
m_data.m_location = location;
}
void TerminalStrip::setName(const QString &name) {
m_name = name;
m_data.m_name = name;
}
/**

View File

@@ -20,6 +20,7 @@
#include <QObject>
#include <QPointer>
#include "terminalstripdata.h"
class Element;
class RealTerminal;
@@ -50,9 +51,7 @@ class TerminalStrip : public QObject
QSharedPointer<PhysicalTerminal> physicalTerminal(QSharedPointer<RealTerminal> terminal);
private:
QString m_installation;
QString m_location;
QString m_name;
TerminalStripData m_data;
QPointer<QETProject> m_project;
QVector<QPointer<Element>> m_terminal_elements_vector;
QVector<QSharedPointer<RealTerminal>> m_real_terminals;

View File

@@ -0,0 +1,33 @@
/*
Copyright 2006-2021 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/>.
*/
#include "terminalstripdata.h"
TerminalStripData::TerminalStripData()
{
}
QDomElement TerminalStripData::toXml(QDomDocument &xml_document) const
{
}
bool TerminalStripData::fromXml(const QDomElement &xml_element)
{
}

View File

@@ -0,0 +1,42 @@
/*
Copyright 2006-2021 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/>.
*/
#ifndef TERMINALSTRIPDATA_H
#define TERMINALSTRIPDATA_H
#include "../properties/propertiesinterface.h"
//#include "terminalstrip.h"
class TerminalStripData : public PropertiesInterface
{
friend class TerminalStrip;
public:
TerminalStripData();
void toSettings(QSettings &/*settings*/, const QString = QString()) const override {}
void fromSettings (const QSettings &/*settings*/, const QString = QString()) override {}
QDomElement toXml (QDomDocument &xml_document) const override;
bool fromXml (const QDomElement &xml_element) override;
private :
QString m_installation, m_location, m_name;
};
#endif // TERMINALSTRIPDATA_H