editors/LDViewer.py
changeset 1081 9789531bc57c
parent 890 b3cafb73c5e9
child 1311 85ca4fa0720b
equal deleted inserted replaced
1080:5ec20f56b1d2 1081:9789531bc57c
   182         self.RungComments = []
   182         self.RungComments = []
   183         Viewer.ResetView(self)
   183         Viewer.ResetView(self)
   184 
   184 
   185     def RefreshView(self, variablepanel=True, selection=None):
   185     def RefreshView(self, variablepanel=True, selection=None):
   186         Viewer.RefreshView(self, variablepanel, selection)
   186         Viewer.RefreshView(self, variablepanel, selection)
   187         wx.CallAfter(self.Refresh)
   187         if self.GetDrawingMode() != FREEDRAWING_MODE:
   188         for i, rung in enumerate(self.Rungs):
   188             for i, rung in enumerate(self.Rungs):
   189             bbox = rung.GetBoundingBox()
   189                 bbox = rung.GetBoundingBox()
   190             if i < len(self.RungComments):
   190                 if i < len(self.RungComments):
   191                 if self.RungComments[i]:
   191                     if self.RungComments[i]:
   192                     pos = self.RungComments[i].GetPosition()
   192                         pos = self.RungComments[i].GetPosition()
   193                     if pos[1] > bbox.y:
   193                         if pos[1] > bbox.y:
   194                         self.RungComments.insert(i, None)
   194                             self.RungComments.insert(i, None)
   195             else:
   195                 else:
   196                 self.RungComments.insert(i, None)
   196                     self.RungComments.insert(i, None)
   197     
   197         
   198     def loadInstance(self, instance, ids, selection):
   198     def loadInstance(self, instance, ids, selection):
   199         Viewer.loadInstance(self, instance, ids, selection)
   199         Viewer.loadInstance(self, instance, ids, selection)
   200         if self.GetDrawingMode() != FREEDRAWING_MODE:
   200         if self.GetDrawingMode() != FREEDRAWING_MODE:
   201             if instance["type"] == "leftPowerRail":
   201             if instance["type"] == "leftPowerRail":
   202                 element = self.FindElementById(instance["id"])
   202                 element = self.FindElementById(instance["id"])