mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-11 22:54:12 +02:00
Revert "Add cable management: drawing, cores, numbering, cross-references and cable list"
This commit is contained in:
@@ -67,7 +67,6 @@ XRefProperties::XRefProperties()
|
||||
m_prefix_keys << "power" << "delay" << "switch";
|
||||
m_master_label = "%f-%l%c";
|
||||
m_slave_label = "(%f-%l%c)";
|
||||
m_font = QString();
|
||||
m_offset = 0;
|
||||
m_slave_offset = 0;
|
||||
m_xref_pos = Qt::AlignBottom;
|
||||
@@ -98,7 +97,6 @@ void XRefProperties::toSettings(QSettings &settings,
|
||||
settings.setValue(prefix % "master_label", master_label);
|
||||
QString slave_label = m_slave_label;
|
||||
settings.setValue(prefix % "slave_label", slave_label);
|
||||
settings.setValue(prefix % "font", m_font);
|
||||
|
||||
|
||||
QMetaEnum var = QMetaEnum::fromType<Qt::Alignment>();
|
||||
@@ -130,7 +128,6 @@ void XRefProperties::fromSettings(const QSettings &settings,
|
||||
m_slave_offset = settings.value(prefix % "slave_offset", "0").toInt();
|
||||
m_master_label = settings.value(prefix % "master_label", "%f-%l%c").toString();
|
||||
m_slave_label = settings.value(prefix % "slave_label", "(%f-%l%c)").toString();
|
||||
m_font = settings.value(prefix % "font").toString();
|
||||
|
||||
m_xref_pos = xrefPosFromKey(settings.value(prefix % "xrefpos").toString());
|
||||
|
||||
@@ -172,14 +169,6 @@ QDomElement XRefProperties::toXml(QDomDocument &xml_document) const
|
||||
xml_element.setAttribute("master_label", master_label);
|
||||
QString slave_label = m_slave_label;
|
||||
xml_element.setAttribute("slave_label", slave_label);
|
||||
//Only the cable cross-reference has a font of its own, and only
|
||||
//it ever sets one. Writing the attribute unconditionally put
|
||||
//font="" on every cross-reference type of every project the
|
||||
//program saved; a file which does not hold the attribute reads
|
||||
//back as no font, which is what all of them are.
|
||||
if (!m_font.isEmpty()) {
|
||||
xml_element.setAttribute("font", m_font);
|
||||
}
|
||||
foreach (QString key, m_prefix.keys()) {
|
||||
xml_element.setAttribute(key % "prefix", m_prefix.value(key));
|
||||
}
|
||||
@@ -208,7 +197,6 @@ bool XRefProperties::fromXml(const QDomElement &xml_element) {
|
||||
m_slave_offset = xml_element.attribute("slave_offset", "0").toInt();
|
||||
m_master_label = xml_element.attribute("master_label", "%f-%l%c");
|
||||
m_slave_label = xml_element.attribute("slave_label","(%f-%l%c)");
|
||||
m_font = xml_element.attribute("font");
|
||||
foreach (QString key, m_prefix_keys) {
|
||||
m_prefix.insert(key, xml_element.attribute(key % "prefix"));
|
||||
}
|
||||
@@ -218,17 +206,15 @@ bool XRefProperties::fromXml(const QDomElement &xml_element) {
|
||||
/**
|
||||
@brief XRefProperties::defaultProperties
|
||||
@return the default properties stored in the setting file
|
||||
One entry per kind of element which shows a cross reference, stored
|
||||
under its own key: "coil", "protection", "commutator", "plc" -- and
|
||||
"cable", which is not an element at all: it is the reference a cable
|
||||
writes in the label of each of its sections when the cable runs on
|
||||
several folios.
|
||||
For the xref, there are 2 properties.
|
||||
For coil, stored with the string "coil" in the returned QHash.
|
||||
For protection, stored with the string "protection" in the returned QHash.
|
||||
*/
|
||||
QHash<QString, XRefProperties> XRefProperties::defaultProperties()
|
||||
{
|
||||
QHash <QString, XRefProperties> hash;
|
||||
QStringList keys;
|
||||
keys << "coil" << "protection" << "commutator" << "plc" << "cable";
|
||||
keys << "coil" << "protection" << "commutator" << "plc";
|
||||
|
||||
QSettings settings;
|
||||
|
||||
@@ -237,13 +223,6 @@ QHash<QString, XRefProperties> XRefProperties::defaultProperties()
|
||||
XRefProperties properties;
|
||||
QString str("diagrameditor/defaultxref");
|
||||
properties.fromSettings(settings, str += key);
|
||||
|
||||
//A cable takes the very same default text as a relay master
|
||||
//and the other types, "%f-%l%c": what it names is then the
|
||||
//other section of the cable -- the folio it stands on and
|
||||
//the place it stands at there, which is what an element
|
||||
//points at as well. No default of its own, so that setting
|
||||
//the five of them apart needs no thought at all.
|
||||
hash.insert(key, properties);
|
||||
}
|
||||
|
||||
@@ -262,8 +241,7 @@ bool XRefProperties::operator ==(const XRefProperties &xrp) const{
|
||||
&& m_offset == xrp.m_offset
|
||||
&& m_slave_offset== xrp.m_slave_offset
|
||||
&& m_xref_pos == xrp.m_xref_pos
|
||||
&& m_slave_label == xrp.m_slave_label
|
||||
&& m_font == xrp.m_font);
|
||||
&& m_slave_label == xrp.m_slave_label);
|
||||
}
|
||||
|
||||
bool XRefProperties::operator !=(const XRefProperties &xrp) const
|
||||
|
||||
Reference in New Issue
Block a user