PLCControler.py
changeset 229 a5087e346baa
parent 226 6a2f7ddd2e50
child 233 de7ddb376150
--- a/PLCControler.py	Tue Aug 12 18:14:07 2008 +0200
+++ b/PLCControler.py	Tue Aug 12 18:15:07 2008 +0200
@@ -439,7 +439,7 @@
                 next_col = len(lines[-1]) + 1
             else:
                 next_col = col + len(chunk)
-            if next_row >= from_location[0] and next_col >= from_location[1] and len(chunk_infos) > 0:
+            if (next_row > from_location[0] or next_row == from_location[0] and next_col >= from_location[1]) and len(chunk_infos) > 0:
                 infos.append((chunk_infos, (row, col)))
             if next_row == to_location[0] and next_col > to_location[1] or next_row > to_location[0]:
                 return infos
@@ -1265,7 +1265,7 @@
         element = self.GetEditedElement(tagname)
         if element != None:
             element.settext(text)
-            self.RefreshPouUsingTree()
+            self.Project.RefreshElementUsingTree()
     
     # Return the edited element text
     def GetEditedElementText(self, tagname):
@@ -1671,7 +1671,7 @@
                 block.setinstanceName(blockname)
                 self.AddEditedElementPouVar(tagname, blocktype, blockname)
             element.addinstance("block", block)
-            self.RefreshPouUsingTree()
+            self.Project.RefreshElementUsingTree()
     
     def SetEditedElementBlockInfos(self, tagname, id, infos):
         element = self.GetEditedElement(tagname)
@@ -1732,7 +1732,7 @@
                         variable.addconnectionPointOut()
                         variable.connectionPointOut.setrelPositionXY(position.x, position.y)
                         block.outputVariables.appendvariable(variable)
-            self.RefreshPouUsingTree()
+            self.Project.RefreshElementUsingTree()
         
     def AddEditedElementVariable(self, tagname, id, type):
         element = self.GetEditedElement(tagname)
@@ -2233,7 +2233,7 @@
             if isinstance(instance, plcopen.fbdObjects_block):
                 self.RemoveEditedElementPouVar(tagname, instance.gettypeName(), instance.getinstanceName())
             element.removeinstance(id)
-            self.RefreshPouUsingTree()
+            self.Project.RefreshElementUsingTree()
 
     def GetEditedResourceVariables(self, tagname):
         varlist = []