349 |
349 |
350 def RemoveDataConsumer(self, consumer): |
350 def RemoveDataConsumer(self, consumer): |
351 iec_path = self.DataConsumers.pop(consumer, None) |
351 iec_path = self.DataConsumers.pop(consumer, None) |
352 if iec_path is not None: |
352 if iec_path is not None: |
353 self.DataProducer.UnsubscribeDebugIECVariable(iec_path, consumer) |
353 self.DataProducer.UnsubscribeDebugIECVariable(iec_path, consumer) |
|
354 |
|
355 def RegisterVariables(self): |
|
356 pass |
354 |
357 |
355 def GetDataType(self, iec_path): |
358 def GetDataType(self, iec_path): |
356 if self.DataProducer is not None: |
359 if self.DataProducer is not None: |
357 infos = self.DataProducer.GetInstanceInfos(iec_path) |
360 infos = self.DataProducer.GetInstanceInfos(iec_path) |
358 if infos is not None: |
361 if infos is not None: |
2013 return rect |
2016 return rect |
2014 |
2017 |
2015 def Clone(self, parent, connectors = {}, dx = 0, dy = 0): |
2018 def Clone(self, parent, connectors = {}, dx = 0, dy = 0): |
2016 start_connector = connectors.get(self.StartConnected, None) |
2019 start_connector = connectors.get(self.StartConnected, None) |
2017 end_connector = connectors.get(self.EndConnected, None) |
2020 end_connector = connectors.get(self.EndConnected, None) |
|
2021 print self.StartConnected, "=>", start_connector, ",", self.EndConnected, "=>", end_connector |
2018 if start_connector is not None and end_connector is not None: |
2022 if start_connector is not None and end_connector is not None: |
2019 wire = Wire(parent) |
2023 wire = Wire(parent) |
2020 wire.SetPoints([(point.x + dx, point.y + dy) for point in self.Points]) |
2024 wire.SetPoints([(point.x + dx, point.y + dy) for point in self.Points]) |
2021 start_connector.Connect((wire, 0), False) |
2025 start_connector.Connect((wire, 0), False) |
2022 end_connector.Connect((wire, -1), False) |
2026 end_connector.Connect((wire, -1), False) |