From e0c6cc676874599b7af2d593bdbb580cfcf8c7e9 Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Sun, 2 Dec 2018 15:54:08 +0000 Subject: [PATCH] Add new fields "Quantity, Unity" onproperties of the selection widget and for csv export git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5626 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/autoNum/assignvariables.cpp | 2 ++ sources/diagramcontext.h | 2 ++ sources/editor/ui/elementpropertieseditorwidget.cpp | 2 +- sources/nomenclature.cpp | 8 +++++++- sources/qetapp.cpp | 6 ++++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/sources/autoNum/assignvariables.cpp b/sources/autoNum/assignvariables.cpp index dbe6ef2bd..d163e1f6c 100644 --- a/sources/autoNum/assignvariables.cpp +++ b/sources/autoNum/assignvariables.cpp @@ -184,6 +184,8 @@ namespace autonum str.replace("%{manufacturer}", dc.value("manufacturer").toString()); str.replace("%{manufacturer-reference}", dc.value("manufacturer-reference").toString()); str.replace("%{provider}", dc.value("provider").toString()); + str.replace("%{quantity}", dc.value("quantity").toString()); + str.replace("%{unity}", dc.value("unity").toString()); str.replace("%{auxiliary1}", dc.value("auxiliary1").toString()); str.replace("%{auxiliary2}", dc.value("auxiliary2").toString()); str.replace("%{machine-manufacturer-reference}", dc.value("machine-manufacturer-reference").toString()); diff --git a/sources/diagramcontext.h b/sources/diagramcontext.h index e4243fdce..197606333 100644 --- a/sources/diagramcontext.h +++ b/sources/diagramcontext.h @@ -38,6 +38,8 @@ * comment -> a little comment wich can be displayed in the folio * manufacturer -> the manufacturer of the element * manufacturer-reference -> the manufacturer reference of the element + * quantity -> quantity of the element + * unity -> unity of the element * auxiliary1 -> auxiliary 1 of element * auxiliary2 -> auxiliary 2 of element * machine-manufacturer-reference -> reference of the manufacturer machine diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index 2ad5668e9..01cb8c516 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -152,7 +152,7 @@ void ElementPropertiesEditorWidget::updateTree() */ void ElementPropertiesEditorWidget::populateTree() { - QStringList keys{"label", "comment", "description", "designation", "manufacturer", "manufacturer-reference", "provider", "machine-manufacturer-reference"}; + QStringList keys{"label", "comment", "description", "designation", "manufacturer", "manufacturer-reference", "provider", "quantity", "unity", "machine-manufacturer-reference"}; for(const QString& key : keys) { diff --git a/sources/nomenclature.cpp b/sources/nomenclature.cpp index 84361e71e..933421e61 100644 --- a/sources/nomenclature.cpp +++ b/sources/nomenclature.cpp @@ -96,7 +96,9 @@ QString nomenclature::getNomenclature() ""+ QObject::tr("I001") +";" //:Don't translate this text! //ID for comment ""+ QObject::tr("J001") +";" //:Don't translate this text! //ID for manufacturer ""+ QObject::tr("K001") +";" //:Don't translate this text! //ID for article number - ""+ QObject::tr("L001") +";" //:Don't translate this text! //ID for supplier + ""+ QObject::tr("L001") +";" //:Don't translate this text! //ID for quantity + ""+ QObject::tr("L002") +";" //:Don't translate this text! //ID for Unity + ""+ QObject::tr("L003") +";" //:Don't translate this text! //ID for supplier ""+ QObject::tr("M001") +";" //:Don't translate this text! //ID for auxiliary field 1 ""+ QObject::tr("M002") +";" //:Don't translate this text! //ID for auciliary field 2 ""+ QObject::tr("N001")+";" //:Don't translate this text! //ID for internal number @@ -115,6 +117,8 @@ QString nomenclature::getNomenclature() ""+ QObject::tr("Fabricant") +";" ""+ QObject::tr("Reference Fabricant") +";" ""+ QObject::tr("Fournisseur") +";" + ""+ QObject::tr("Quantité") +";" + ""+ QObject::tr("Unité") +";" ""+ QObject::tr("Bloc auxiliaire 1") +";" ""+ QObject::tr("Bloc auxiliaire 2") +";" ""+ QObject::tr("Machine-reference") +";" @@ -174,6 +178,8 @@ QString nomenclature::getElementInfo(Element *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["provider"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";"; + info += autonum::AssignVariables::formulaToLabel(elmt_info["quantity"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";"; + info += autonum::AssignVariables::formulaToLabel(elmt_info["unity"].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) + ";"; diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index f26f5c50b..f55dfffd3 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -300,6 +300,8 @@ QStringList QETApp::elementInfoKeys() << "manufacturer" << "manufacturer-reference" << "provider" + << "quantity" + << "unity" << "auxiliary1" << "auxiliary2" << "machine-manufacturer-reference" @@ -326,6 +328,8 @@ QString QETApp::elementTranslatedInfoKey(const QString &info) else if (info == "manufacturer") return tr("Fabricant"); else if (info == "manufacturer-reference") return tr("Numéro de commande"); else if (info == "provider") return tr("Fournisseur"); + else if (info == "quantity") return tr("Quantité"); + else if (info == "unity") return tr("Unité"); else if (info == "auxiliary1") return tr("Bloc auxiliaire 1"); else if (info == "auxiliary2") return tr("Bloc auxiliaire 2"); else if (info == "machine-manufacturer-reference") return tr("Numéro interne"); @@ -351,6 +355,8 @@ QString QETApp::elementInfoToVar(const QString &info) else if (info == "manufacturer") return QString("%{manufacturer}"); else if (info == "manufacturer-reference") return QString("%{manufacturer-reference}"); else if (info == "provider") return QString("%{provider}"); + else if (info == "quantity") return QString("%{quantity}"); + else if (info == "unity") return QString("%{unity}"); else if (info == "auxiliary1") return QString("%{auxiliary1}"); else if (info == "auxiliary2") return QString("%{auxiliary2}"); else if (info == "machine-manufacturer-reference") return QString("%{machine-manufacturer-reference}");