From 4ba3f477f86f994acd42ba642d3c9eafa9127b2f Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Mon, 3 Dec 2018 13:13:27 +0000 Subject: [PATCH] Add new field "Group function" on properties of the selection widget and for csv export git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5627 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/autoNum/assignvariables.cpp | 1 + sources/diagramcontext.h | 1 + .../ui/elementpropertieseditorwidget.cpp | 2 +- sources/nomenclature.cpp | 7 +++- sources/qetapp.cpp | 37 ++++++++++++------- 5 files changed, 32 insertions(+), 16 deletions(-) diff --git a/sources/autoNum/assignvariables.cpp b/sources/autoNum/assignvariables.cpp index d163e1f6c..5639853fb 100644 --- a/sources/autoNum/assignvariables.cpp +++ b/sources/autoNum/assignvariables.cpp @@ -178,6 +178,7 @@ namespace autonum { QString str = formula; str.replace("%{label}", dc.value("label").toString()); + str.replace("%{group-function}", dc.value("group-function").toString()); str.replace("%{comment}", dc.value("comment").toString()); str.replace("%{description}", dc.value("description").toString()); str.replace("%{designation}", dc.value("designation").toString()); diff --git a/sources/diagramcontext.h b/sources/diagramcontext.h index 197606333..57122b102 100644 --- a/sources/diagramcontext.h +++ b/sources/diagramcontext.h @@ -35,6 +35,7 @@ * formula -> formula used to create the label (formula is make with variable) * designation -> exhaustive comment used to explain what the element does. * description -> exhaustive description used to explain what the element does. + * group-function -> the group function of element * 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 diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index 01cb8c516..4d89d24f5 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", "quantity", "unity", "machine-manufacturer-reference"}; + QStringList keys{"label", "group-function", "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 933421e61..1467e9ed3 100644 --- a/sources/nomenclature.cpp +++ b/sources/nomenclature.cpp @@ -93,6 +93,7 @@ QString nomenclature::getNomenclature() ""+ QObject::tr("F002") +";" //:Don't translate this text! //ID for label formula of element ""+ QObject::tr("G001") +";" //:Don't translate this text! //ID for order number ""+ QObject::tr("H001") +";" //:Don't translate this text! //ID for article description + ""+ QObject::tr("H002") +";" //:Don't translate this text! //ID for group function description ""+ 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 @@ -113,15 +114,16 @@ QString nomenclature::getNomenclature() ""+ QObject::tr("Formule du label") +";" ""+ QObject::tr("Désignation") +";" ""+ QObject::tr("Description") +";" + ""+ QObject::tr("Groupe fonctionnel") +";" ""+ QObject::tr("Commentaire") +";" ""+ QObject::tr("Fabricant") +";" - ""+ QObject::tr("Reference Fabricant") +";" + ""+ QObject::tr("Numéro de commande") +";" ""+ QObject::tr("Fournisseur") +";" ""+ QObject::tr("Quantité") +";" ""+ QObject::tr("Unité") +";" ""+ QObject::tr("Bloc auxiliaire 1") +";" ""+ QObject::tr("Bloc auxiliaire 2") +";" - ""+ QObject::tr("Machine-reference") +";" + ""+ QObject::tr("Numéro interne") +";" ""+ QObject::tr("Localisation") +";" ""+ QObject::tr("Fonction") +"\n"; @@ -174,6 +176,7 @@ QString nomenclature::getElementInfo(Element *elmt) { info += autonum::AssignVariables::formulaToLabel(elmt_info["formula"].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["description"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";"; + info += autonum::AssignVariables::formulaToLabel(elmt_info["group-function"].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) + ";"; diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index f55dfffd3..e7ee8e134 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -294,20 +294,23 @@ QStringList QETApp::elementInfoKeys() QStringList info_list; info_list << "formula" << "label" + << "group-function" + << "location" + << "comment" + << "function" + << "tension-protocol" + << "auxiliary1" + << "auxiliary2" + << "description" << "designation" << "manufacturer" << "manufacturer-reference" + << "machine-manufacturer-reference" << "provider" << "quantity" - << "unity" - << "auxiliary1" - << "auxiliary2" - << "machine-manufacturer-reference" - << "location" - << "function" - << "tension-protocol"; + << "unity"; return info_list; } @@ -322,20 +325,27 @@ QString QETApp::elementTranslatedInfoKey(const QString &info) { if (info == "formula") return tr("formule du label"); else if (info == "label") return tr("Label"); + else if (info == "group-function") return tr("Groupe fonctionnel"); + else if (info == "location") return tr("Localisation"); + else if (info == "comment") return tr("Commentaire"); + else if (info == "function") return tr("Fonction"); + else if (info == "tension-protocol") return tr("Tension / Protocole"); + else if (info == "auxiliary1") return tr("Bloc auxiliaire 1"); + else if (info == "auxiliary2") return tr("Bloc auxiliaire 2"); + else if (info == "description") return tr("Description textuelle"); else if (info == "designation") return tr("Numéro d'article"); else if (info == "manufacturer") return tr("Fabricant"); else if (info == "manufacturer-reference") return tr("Numéro de commande"); + else if (info == "machine-manufacturer-reference") return tr("Numéro interne"); 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"); - else if (info == "location") return tr("Localisation"); - else if (info == "function") return tr("Fonction"); - else if (info == "tension-protocol") return tr("Tension / Protocole"); + + + + return (info); } @@ -349,6 +359,7 @@ QString QETApp::elementInfoToVar(const QString &info) { if (info == "formula") return QString("%{formula}"); else if (info == "label") return QString("%{label}"); + else if (info == "group-function") return QString("%{group-function}"); else if (info == "comment") return QString("%{comment}"); else if (info == "description") return QString("%{description}"); else if (info == "designation") return QString("%{designation}");