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"]) |