Deprecated method removed and bug on chunk extract fixed
authorlbessard
Tue, 12 Aug 2008 18:15:07 +0200
changeset 229 a5087e346baa
parent 228 da7ddaf27cca
child 230 45d70748e45a
Deprecated method removed and bug on chunk extract fixed
PLCControler.py
--- 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 = []