mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-01 17:30:52 +01:00
Element : variable assignement of label is now managed by an external class instead of the element itself
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4772 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "nomenclature.h"
|
||||
#include "elementprovider.h"
|
||||
#include "assignvariables.h"
|
||||
#define PR(x) qDebug() << #x " = " << x;
|
||||
|
||||
/**
|
||||
@@ -101,24 +102,24 @@ QString nomenclature::getNomenclature()
|
||||
|
||||
if(m_list_diagram.isEmpty()) return data;
|
||||
|
||||
foreach (Diagram *d, m_list_diagram) {
|
||||
//Get only simple, master and unlinked slave element.
|
||||
ElementProvider ep(d);
|
||||
QSettings settings;
|
||||
QList <Element *> list_elements;
|
||||
|
||||
if (settings.value("nomenclature/terminal-exportlist", true).toBool()){
|
||||
list_elements << ep.find(Element::Simple | Element::Master | Element::Terminale);
|
||||
|
||||
}else{
|
||||
|
||||
list_elements << ep.find(Element::Simple | Element::Master);
|
||||
|
||||
}
|
||||
|
||||
list_elements << ep.freeElement(Element::Slave);
|
||||
|
||||
foreach (Element *elmt, list_elements) {
|
||||
foreach (Diagram *d, m_list_diagram) {
|
||||
//Get only simple, master and unlinked slave element.
|
||||
ElementProvider ep(d);
|
||||
QSettings settings;
|
||||
QList <Element *> list_elements;
|
||||
|
||||
if (settings.value("nomenclature/terminal-exportlist", true).toBool()){
|
||||
list_elements << ep.find(Element::Simple | Element::Master | Element::Terminale);
|
||||
|
||||
}else{
|
||||
|
||||
list_elements << ep.find(Element::Simple | Element::Master);
|
||||
|
||||
}
|
||||
|
||||
list_elements << ep.freeElement(Element::Slave);
|
||||
|
||||
foreach (Element *elmt, list_elements) {
|
||||
data += getElementInfo(elmt);
|
||||
}
|
||||
}
|
||||
@@ -142,15 +143,16 @@ QString nomenclature::getElementInfo(Element *elmt) {
|
||||
info += diagram -> border_and_titleblock.folio() + ";";
|
||||
info += elmt -> name() + ";";
|
||||
info += elmt-> diagram()-> convertPosition(elmt -> scenePos()).toString() + ";";
|
||||
info += elmt->assignVariables(elmt_info["label"].toString(), elmt) + ";";
|
||||
info += elmt->assignVariables(elmt_info["designation"].toString(), elmt) + ";";
|
||||
info += elmt->assignVariables(elmt_info["comment"].toString(), elmt) + ";";
|
||||
info += elmt->assignVariables(elmt_info["manufacturer"].toString(), elmt) + ";";
|
||||
info += elmt->assignVariables(elmt_info["manufacturer-reference"].toString(), elmt) + ";";
|
||||
info += elmt->assignVariables(elmt_info["auxiliary1"].toString(), elmt) + ";";
|
||||
info += elmt->assignVariables(elmt_info["auxiliary2"].toString(), elmt) + ";";
|
||||
info += elmt->assignVariables(elmt_info["machine-manufacturer-reference"].toString(), elmt) + ";";
|
||||
info += elmt->assignVariables(elmt_info["location"].toString(), elmt) + ";";
|
||||
info += elmt->assignVariables(elmt_info["function"].toString(), elmt) + "\n";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["label"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["designation"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["comment"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["manufacturer"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["manufacturer-reference"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["auxiliary1"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["auxiliary2"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["machine-manufacturer-reference"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["location"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
|
||||
info += autonum::AssignVariables::formulaToLabel(elmt_info["function"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + "\n";
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user