mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Add terminal strip data class
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
33
sources/TerminalStrip/terminalstripdata.cpp
Normal file
33
sources/TerminalStrip/terminalstripdata.cpp
Normal 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)
|
||||
{
|
||||
|
||||
}
|
||||
42
sources/TerminalStrip/terminalstripdata.h
Normal file
42
sources/TerminalStrip/terminalstripdata.h
Normal 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
|
||||
Reference in New Issue
Block a user