--- a/editors/LDViewer.py Mon Aug 14 22:30:41 2017 +0300
+++ b/editors/LDViewer.py Mon Aug 14 23:27:15 2017 +0300
@@ -28,6 +28,7 @@
from Viewer import *
+
def ExtractNextBlocks(block, block_list):
current_list = [block]
while len(current_list) > 0:
@@ -50,6 +51,7 @@
next_list.append(next)
current_list = next_list
+
def CalcBranchSize(elements, stops):
branch_size = 0
stop_list = stops
@@ -91,6 +93,7 @@
return 1
return branch_size
+
def RemoveElement(remove, element_tree):
if remove in element_tree and element_tree[remove]:
for child in element_tree[remove]["children"]:
@@ -99,6 +102,7 @@
element_tree.pop(remove)
## element_tree[remove] = None
+
def GenerateTree(element, element_tree, stop_list):
if element in element_tree:
connectors = element.GetConnectors()
@@ -128,6 +132,7 @@
element_tree[next] = {"parents":[element], "children":[], "weight":None}
GenerateTree(next, element_tree, stop_list)
+
def CalcWeight(element, element_tree):
weight = 0
parts = None
@@ -160,11 +165,10 @@
#-------------------------------------------------------------------------------
-"""
-Class derived from Viewer class that implements a Viewer of Ladder Diagram
-"""
-
class LD_Viewer(Viewer):
+ """
+ Class derived from Viewer class that implements a Viewer of Ladder Diagram
+ """
def __init__(self, parent, tagname, window, controler, debug = False, instancepath = ""):
Viewer.__init__(self, parent, tagname, window, controler, debug, instancepath)