SVGHMI: cosmetic fixes + removed dead code
authorEdouard Tisserant
Thu, 05 May 2022 10:37:36 +0200
changeset 3454 0b5ab53007a9
parent 3453 e5967a2ae2bb
child 3455 2716cd8e498d
SVGHMI: cosmetic fixes + removed dead code
svghmi/ui.py
svghmi/widget_pathslider.ysl2
--- a/svghmi/ui.py	Thu May 05 10:35:29 2022 +0200
+++ b/svghmi/ui.py	Thu May 05 10:37:36 2022 +0200
@@ -621,17 +621,20 @@
         self.args_box.Show(len(args)!=0)
         for arg, prefillarg in izip(args,prefillargs):
             self.AddArgToSignature(arg, prefillarg)
+
+        # TODO support predefined path count (as for XYGraph)
         paths = defs.findall("path")
         self.paths_box.Show(len(paths)!=0)
         for path in paths:
             self.AddPathToSignature(path)
 
-        for widget in widgets:
-            widget_type = widget.get("type")
-            for path in widget.iterchildren("path"):
-                path_value = path.get("value")
-                path_accepts = map(
-                    str.strip, path.get("accepts", '')[1:-1].split(','))
+        # # TODO DEAD CODE ?
+        # for widget in widgets:
+        #     widget_type = widget.get("type")
+        #     for path in widget.iterchildren("path"):
+        #         path_value = path.get("value")
+        #         path_accepts = map(
+        #             str.strip, path.get("accepts", '')[1:-1].split(','))
 
         self.main_panel.SetupScrolling(scroll_x=False)
 
--- a/svghmi/widget_pathslider.ysl2	Thu May 05 10:35:29 2022 +0200
+++ b/svghmi/widget_pathslider.ysl2	Thu May 05 10:37:36 2022 +0200
@@ -1,8 +1,8 @@
 // widget_pathslider.ysl2
 widget_desc("PathSlider") {
     longdesc
-    || 
-    PathSlider - 
+    ||
+    PathSlider -
     ||
 
     shortdesc > Slide an SVG element along a path by dragging it
@@ -10,7 +10,7 @@
     path name="value" accepts="HMI_INT,HMI_REAL" > value
     path name="min" count="optional" accepts="HMI_INT,HMI_REAL" > min
     path name="max" count="optional" accepts="HMI_INT,HMI_REAL" > max
-    
+
     arg name="min" count="optional" accepts="int,real" > minimum value
     arg name="max" count="optional" accepts="int,real" > maximum value
 }
@@ -25,7 +25,7 @@
         pathLength = undefined;
         precision = undefined;
         origPt = undefined;
-        
+
 
         scanPath() {
           this.pathLength = this.path_elt.getTotalLength();
@@ -67,7 +67,7 @@
               bestPoint = beforePoint,
               bestLength = beforeLength,
               bestDistance = beforeDistance;
-            } else if ((afterLength = bestLength + precision) <= this.pathLength && 
+            } else if ((afterLength = bestLength + precision) <= this.pathLength &&
                        (afterDistance = distance2(afterPoint = this.path_elt.getPointAtLength(afterLength))) < bestDistance) {
               bestPoint = afterPoint,
               bestLength = afterLength,