2019-07-15 20:05 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000118QElectroTechDiagram Editorpublic2017-01-04 06:54
ReporterMorganol 
Assigned Toblack_sun 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
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.
Attached Files

-Relationships
+Relationships

-Notes

~0000207

scorpio810 (administrator)

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);
    }


~0000212

scorpio810 (administrator)

See workaround

~0000223

black_sun (developer)

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.

~0000226

scorpio810 (administrator)

bug with conductor auto connect

~0000227

scorpio810 (administrator)

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();
 }
+


+Notes

-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
+Issue History