[qet] [4679] Updated qet_labels xml.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 4679
Author:   dfochi
Date:     2016-08-31 21:58:58 +0200 (Wed, 31 Aug 2016)
Log Message:
-----------
Updated qet_labels xml. Element formula now works with all elements types (logic, hydraulic, pneumatic and energy)

Modified Paths:
--------------
    trunk/elements/10_electric/qet_labels.xml
    trunk/sources/qetgraphicsitem/customelement.cpp

Modified: trunk/elements/10_electric/qet_labels.xml
===================================================================
--- trunk/elements/10_electric/qet_labels.xml	2016-08-30 23:47:25 UTC (rev 4678)
+++ trunk/elements/10_electric/qet_labels.xml	2016-08-31 19:58:58 UTC (rev 4679)
@@ -273,6 +273,7 @@
     <category name="beckhoff">
       <category name="80building_management"></category>
     </category>
+        <category name="automation"></category>
     <category name="beka"></category>
     <category name="bosch_rexroth"></category>
     <category name="bti">
@@ -320,6 +321,7 @@
       <category name="20_frequency_drives"></category>
     </category>
     <category name="gce"></category>
+    <category name="gefran"></category>
     <category name="geindustrial">
       <category name="10_sofstarters"></category>
     </category>
@@ -513,6 +515,7 @@
       <category name="02_human_machine_interface">
         <category name="terminal_operateur"></category>
       </category>
+        <category name="05_bus_topology"></category>
       <category name="10_softstarter"></category>
       <category name="20_frequency_drives"></category>
       <category name="23_sinamics_drives"></category>
@@ -571,6 +574,6 @@
   </category>
   <category name="99_miscellaneous&amp;unsorted"></category>
   <report>
-    <directories>361</directories>
+    <directories>364</directories>
   </report>
 </labels>

Modified: trunk/sources/qetgraphicsitem/customelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/customelement.cpp	2016-08-30 23:47:25 UTC (rev 4678)
+++ trunk/sources/qetgraphicsitem/customelement.cpp	2016-08-31 19:58:58 UTC (rev 4679)
@@ -288,7 +288,7 @@
 		}
 
 		// Only Electric labels created so far
-		if (current_location.fileName() != "10_electric") return;
+		//if (current_location.fileName() != "10_electric")
 		QString qet_labels = "10_electric/qet_labels.xml";
 		QString filepath = QETApp::commonElementsDir().append(qet_labels);
 		QFile file(filepath);
@@ -335,6 +335,16 @@
 				}
 				rxml.readNext();
 		}
+		if (prefix == "") {
+			if (!(location().project()->elementAutoNumCurrentFormula().isEmpty()) && (location().project()->elementAutoNumCurrentFormula() != "") &&
+					(this->linkType()!=Element::Slave) && (this->linkType()!=Element::Terminale)) {
+				QString formula = location().project()->elementAutoNumCurrentFormula();
+				this->setPrefix(prefix);
+				DiagramContext &dc = this->rElementInformations();
+				dc.addValue("label", formula);
+				this->setTaggedText("label",formula);
+			}
+		}
 	}
 	//apply formula to specific label - This condition specify elements which have different labels e.g KM
 	//that are already specified in the element label (inside .elmt file). This method is not called if elements


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/