mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +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) :
|
TerminalStrip::TerminalStrip(const QString &name, QETProject *project) :
|
||||||
QObject(project),
|
QObject(project),
|
||||||
m_name(name),
|
|
||||||
m_project(project)
|
m_project(project)
|
||||||
{}
|
{
|
||||||
|
m_data.m_name = name;
|
||||||
|
}
|
||||||
|
|
||||||
TerminalStrip::TerminalStrip(const QString &installation, const QString &location, const QString &name, QETProject *project) :
|
TerminalStrip::TerminalStrip(const QString &installation, const QString &location, const QString &name, QETProject *project) :
|
||||||
QObject(project),
|
QObject(project),
|
||||||
m_installation(installation),
|
|
||||||
m_location(location),
|
|
||||||
m_name(name),
|
|
||||||
m_project(project)
|
m_project(project)
|
||||||
{}
|
{
|
||||||
|
m_data.m_installation = installation;
|
||||||
|
m_data.m_location = location;
|
||||||
|
m_data.m_name = name;
|
||||||
|
}
|
||||||
|
|
||||||
void TerminalStrip::setInstallation(const QString &installation) {
|
void TerminalStrip::setInstallation(const QString &installation) {
|
||||||
m_installation = installation;
|
m_data.m_installation = installation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalStrip::setLocation(const QString &location) {
|
void TerminalStrip::setLocation(const QString &location) {
|
||||||
m_location = location;
|
m_data.m_location = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalStrip::setName(const QString &name) {
|
void TerminalStrip::setName(const QString &name) {
|
||||||
m_name = name;
|
m_data.m_name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
#include "terminalstripdata.h"
|
||||||
|
|
||||||
class Element;
|
class Element;
|
||||||
class RealTerminal;
|
class RealTerminal;
|
||||||
@@ -33,9 +34,9 @@ class TerminalStrip : public QObject
|
|||||||
TerminalStrip(const QString &name, QETProject *project);
|
TerminalStrip(const QString &name, QETProject *project);
|
||||||
|
|
||||||
TerminalStrip(const QString &installation,
|
TerminalStrip(const QString &installation,
|
||||||
const QString &location,
|
const QString &location,
|
||||||
const QString &name,
|
const QString &name,
|
||||||
QETProject *project);
|
QETProject *project);
|
||||||
|
|
||||||
void setInstallation(const QString &installation);
|
void setInstallation(const QString &installation);
|
||||||
void setLocation(const QString &location);
|
void setLocation(const QString &location);
|
||||||
@@ -50,9 +51,7 @@ class TerminalStrip : public QObject
|
|||||||
QSharedPointer<PhysicalTerminal> physicalTerminal(QSharedPointer<RealTerminal> terminal);
|
QSharedPointer<PhysicalTerminal> physicalTerminal(QSharedPointer<RealTerminal> terminal);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_installation;
|
TerminalStripData m_data;
|
||||||
QString m_location;
|
|
||||||
QString m_name;
|
|
||||||
QPointer<QETProject> m_project;
|
QPointer<QETProject> m_project;
|
||||||
QVector<QPointer<Element>> m_terminal_elements_vector;
|
QVector<QPointer<Element>> m_terminal_elements_vector;
|
||||||
QVector<QSharedPointer<RealTerminal>> m_real_terminals;
|
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