equal
deleted
inserted
replaced
446 #------------------------------------------------------------------------------- |
446 #------------------------------------------------------------------------------- |
447 # Adding element functions |
447 # Adding element functions |
448 #------------------------------------------------------------------------------- |
448 #------------------------------------------------------------------------------- |
449 |
449 |
450 def AddLadderRung(self): |
450 def AddLadderRung(self): |
451 dialog = LDElementDialog(self.Parent, "coil") |
451 dialog = LDElementDialog(self.ParentWindow, "coil") |
452 varlist = [] |
452 varlist = [] |
453 vars = self.Controler.GetCurrentElementEditingInterfaceVars() |
453 vars = self.Controler.GetCurrentElementEditingInterfaceVars() |
454 if vars: |
454 if vars: |
455 for var in vars: |
455 for var in vars: |
456 if var["Class"] != "Input" and var["Type"] == "BOOL": |
456 if var["Class"] != "Input" and var["Type"] == "BOOL": |
535 elif self.SelectedElement and isinstance(self.SelectedElement,Graphic_Group): |
535 elif self.SelectedElement and isinstance(self.SelectedElement,Graphic_Group): |
536 if False not in [self.IsWire(element) for element in self.SelectedElement.GetElements()]: |
536 if False not in [self.IsWire(element) for element in self.SelectedElement.GetElements()]: |
537 for element in self.SelectedElement.GetElements(): |
537 for element in self.SelectedElement.GetElements(): |
538 wires.append(element) |
538 wires.append(element) |
539 if len(wires) > 0: |
539 if len(wires) > 0: |
540 dialog = LDElementDialog(self.Parent, "contact") |
540 dialog = LDElementDialog(self.ParentWindow, "contact") |
541 varlist = [] |
541 varlist = [] |
542 vars = self.Controler.GetCurrentElementEditingInterfaceVars() |
542 vars = self.Controler.GetCurrentElementEditingInterfaceVars() |
543 if vars: |
543 if vars: |
544 for var in vars: |
544 for var in vars: |
545 if var["Class"] != "Output" and var["Type"] == "BOOL": |
545 if var["Class"] != "Output" and var["Type"] == "BOOL": |
756 connectors[index + 1].Connect((new_wire, -1), False) |
756 connectors[index + 1].Connect((new_wire, -1), False) |
757 new_wire.ConnectStartPoint(None, right_element) |
757 new_wire.ConnectStartPoint(None, right_element) |
758 new_wire.ConnectEndPoint(None, connectors[index + 1]) |
758 new_wire.ConnectEndPoint(None, connectors[index + 1]) |
759 right_elements.reverse() |
759 right_elements.reverse() |
760 elif right_powerrail: |
760 elif right_powerrail: |
761 dialog = LDElementDialog(self.Parent, "coil") |
761 dialog = LDElementDialog(self.ParentWindow, "coil") |
762 varlist = [] |
762 varlist = [] |
763 vars = self.Controler.GetCurrentElementEditingInterfaceVars() |
763 vars = self.Controler.GetCurrentElementEditingInterfaceVars() |
764 if vars: |
764 if vars: |
765 for var in vars: |
765 for var in vars: |
766 if var["Class"] != "Input" and var["Type"] == "BOOL": |
766 if var["Class"] != "Input" and var["Type"] == "BOOL": |
1177 |
1177 |
1178 def EditContactContent(self, contact): |
1178 def EditContactContent(self, contact): |
1179 if self.GetDrawingMode() == FREEDRAWING_MODE: |
1179 if self.GetDrawingMode() == FREEDRAWING_MODE: |
1180 Viewer.EditContactContent(self, contact) |
1180 Viewer.EditContactContent(self, contact) |
1181 else: |
1181 else: |
1182 dialog = LDElementDialog(self.Parent, "contact") |
1182 dialog = LDElementDialog(self.ParentWindow, "contact") |
1183 varlist = [] |
1183 varlist = [] |
1184 vars = self.Controler.GetCurrentElementEditingInterfaceVars() |
1184 vars = self.Controler.GetCurrentElementEditingInterfaceVars() |
1185 if vars: |
1185 if vars: |
1186 for var in vars: |
1186 for var in vars: |
1187 if var["Class"] != "Output" and var["Type"] == "BOOL": |
1187 if var["Class"] != "Output" and var["Type"] == "BOOL": |
1200 |
1200 |
1201 def EditCoilContent(self, coil): |
1201 def EditCoilContent(self, coil): |
1202 if self.GetDrawingMode() == FREEDRAWING_MODE: |
1202 if self.GetDrawingMode() == FREEDRAWING_MODE: |
1203 Viewer.EditCoilContent(self, coil) |
1203 Viewer.EditCoilContent(self, coil) |
1204 else: |
1204 else: |
1205 dialog = LDElementDialog(self.Parent, "coil") |
1205 dialog = LDElementDialog(self.ParentWindow, "coil") |
1206 varlist = [] |
1206 varlist = [] |
1207 vars = self.Controler.GetCurrentElementEditingInterfaceVars() |
1207 vars = self.Controler.GetCurrentElementEditingInterfaceVars() |
1208 if vars: |
1208 if vars: |
1209 for var in vars: |
1209 for var in vars: |
1210 if var["Class"] != "Input" and var["Type"] == "BOOL": |
1210 if var["Class"] != "Input" and var["Type"] == "BOOL": |