View Issue Details

IDProjectCategoryView StatusLast Update
0000118QElectroTechDiagram Editorpublic2017-01-04 06:54
ReporterMorganol Assigned Toblack_sun  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionSVN/trunk 
Target VersionFixed in Version 
Summary0000118: Autonumbering do not work correctly with links
DescriptionI am only lifting this from forum, reported by Calypso:
https://qelectrotech.org/forum/viewtopic.php?pid=5827#p5827

And i converted and cut the video from there, attached.
TagsNo tags attached.

Activities

Morganol

2016-11-10 02:03

reporter  

Bildschirmaufnahme 2016-10-28 19_21_59.m4v (764,221 bytes)

scorpio810

2016-11-23 16:43

administrator   ~0000207

Last edited: 2016-11-23 16:51

View 5 revisions

I think the problem is when you auto connect report folio wich contain "properties_.m_tension_protocol" and "properties_.m_function" are erased by this code :

conductor -> setProperties(m_diagram -> defaultConductorProperties);

In : sources/diagramevent/diagrameventaddelement.cpp

while (!element -> AlignedFreeTerminals().isEmpty() && m_diagram -> project() -> autoConductor())
    {
        QPair <Terminal *, Terminal *> pair = element -> AlignedFreeTerminals().takeFirst();

        Conductor *conductor = new Conductor(pair.first, pair.second);
        conductor -> setProperties(m_diagram -> defaultConductorProperties);

It's disable fonction :

foreach(Conductor *other_conductor, relatedPotentialConductors())
    {
        ConductorProperties other_properties = other_conductor->properties();
        other_properties.text = properties_.text;
        other_properties.color = properties_.color;
        other_properties.cond_size = properties_.cond_size;
        other_properties.m_function = properties_.m_function;
        other_properties.m_tension_protocol = properties_.m_tension_protocol;
        other_conductor->setProperties(other_properties);
    }

scorpio810

2016-11-23 19:45

administrator   ~0000212

See workaround

black_sun

2017-01-02 19:49

developer   ~0000223

Fini d'être corrigé avec le commit N° 4830.
La correction à été effectué en plusieurs étapes, tout au long des commit visant à séparer la formule/autonum, du label des conducteurs.

scorpio810

2017-01-04 03:04

administrator   ~0000226

bug with conductor auto connect

scorpio810

2017-01-04 03:58

administrator   ~0000227

Last edited: 2017-01-04 06:54

View 5 revisions

Bug fix, need more tests before commits change

Edit: when adding a new color and change conductor size before auto connect report element it loose function and tension_protocol and dont applied color and size properties



diff --git a/sources/diagramevent/diagrameventaddelement.cpp b/sources/diagramevent/diagrameventaddelement.cpp
--- a/sources/diagramevent/diagrameventaddelement.cpp
+++ b/sources/diagramevent/diagrameventaddelement.cpp
@@ -227,7 +227,31 @@
         Conductor *conductor = new Conductor(pair.first, pair.second);
         new AddItemCommand<Conductor *>(conductor, m_diagram, QPointF(), undo_object);
 
-			//Autonum the new conductor, the undo command associated for this, have for parent undo_object
+
+				//Get all conductors at the same potential of conductor
+			QSet <Conductor *> conductors_list = conductor->relatedPotentialConductors();
+
+				//Compare the properties of every conductors stored in conductors_list,
+				//if every conductors properties is equal, we use this properties for conductor.
+			ConductorProperties others_properties;
+			bool use_properties = false;
+			if (!conductors_list.isEmpty())
+			{
+				use_properties = true;
+				others_properties = (*conductors_list.begin())->properties();
+				foreach (Conductor *cond, conductors_list)
+					if (cond->properties() != others_properties)
+						use_properties = false;
+			}
+
+			if (use_properties)
+				conductor->setProperties(others_properties);
+			else
+			{
+				conductor -> setProperties(m_diagram-> defaultConductorProperties);
+			}
+			
+		//Autonum the new conductor, the undo command associated for this, have for parent undo_object
         ConductorAutoNumerotation can  (conductor, m_diagram, undo_object);
         can.numerate();
         if (m_diagram->freezeNewConductors() || m_diagram->project()->isFreezeNewConductors()) {
@@ -240,3 +264,4 @@
     element->updateLabel();
     element->freezeNewAddedElement();
 }
+

Issue History

Date Modified Username Field Change
2016-11-10 02:03 Morganol New Issue
2016-11-10 02:03 Morganol File Added: Bildschirmaufnahme 2016-10-28 19_21_59.m4v
2016-11-23 16:43 scorpio810 Note Added: 0000207
2016-11-23 16:43 scorpio810 Assigned To => black_sun
2016-11-23 16:43 scorpio810 Status new => assigned
2016-11-23 16:44 scorpio810 Note Edited: 0000207 View Revisions
2016-11-23 16:45 scorpio810 Note Edited: 0000207 View Revisions
2016-11-23 16:50 scorpio810 Note Edited: 0000207 View Revisions
2016-11-23 16:51 scorpio810 Note Edited: 0000207 View Revisions
2016-11-23 19:45 scorpio810 Note Added: 0000212
2017-01-02 19:49 black_sun Status assigned => resolved
2017-01-02 19:49 black_sun Resolution open => fixed
2017-01-02 19:49 black_sun Note Added: 0000223
2017-01-04 03:04 scorpio810 Note Added: 0000226
2017-01-04 03:58 scorpio810 Note Added: 0000227
2017-01-04 03:59 scorpio810 Note Edited: 0000227 View Revisions
2017-01-04 04:05 scorpio810 Note Edited: 0000227 View Revisions
2017-01-04 06:20 scorpio810 Note Edited: 0000227 View Revisions
2017-01-04 06:54 scorpio810 Note Edited: 0000227 View Revisions