50 self.SetType(type, connectors) |
50 self.SetType(type, connectors) |
51 |
51 |
52 # Destructor |
52 # Destructor |
53 def __del__(self): |
53 def __del__(self): |
54 self.Connectors = [] |
54 self.Connectors = [] |
|
55 |
|
56 # Make a clone of this LD_PowerRail |
|
57 def Clone(self, id = None, pos = None): |
|
58 powerrail = LD_PowerRail(self.Parent, self.Type, id) |
|
59 powerrail.SetSize(self.Size[0], self.Size[1]) |
|
60 if pos is not None: |
|
61 powerrail.SetPosition(pos.x, pos.y) |
|
62 powerrail.Connectors = [] |
|
63 for connector in self.Connectors: |
|
64 if connector is not None: |
|
65 powerrail.Connectors.append(connector.Clone(powerrail)) |
|
66 else: |
|
67 powerrail.Connectors.append(None) |
|
68 return powerrail |
55 |
69 |
56 # Forbids to change the power rail size |
70 # Forbids to change the power rail size |
57 def SetSize(self, width, height): |
71 def SetSize(self, width, height): |
58 if self.Parent.GetDrawingMode() == FREEDRAWING_MODE: |
72 if self.Parent.GetDrawingMode() == FREEDRAWING_MODE: |
59 Graphic_Element.SetSize(self, width, height) |
73 Graphic_Element.SetSize(self, width, height) |
342 |
356 |
343 # Destructor |
357 # Destructor |
344 def __del__(self): |
358 def __del__(self): |
345 self.Input = None |
359 self.Input = None |
346 self.Output = None |
360 self.Output = None |
|
361 |
|
362 # Make a clone of this LD_Contact |
|
363 def Clone(self, id = None, pos = None): |
|
364 contact = LD_Contact(self.Parent, self.Type, self.Name, id) |
|
365 contact.SetSize(self.Size[0], self.Size[1]) |
|
366 if pos is not None: |
|
367 contact.SetPosition(pos.x, pos.y) |
|
368 contact.Input = self.Input.Clone(contact) |
|
369 contact.Output = self.Output.Clone(contact) |
|
370 return contact |
347 |
371 |
348 # Forbids to change the contact size |
372 # Forbids to change the contact size |
349 def SetSize(self, width, height): |
373 def SetSize(self, width, height): |
350 if self.Parent.GetDrawingMode() == FREEDRAWING_MODE: |
374 if self.Parent.GetDrawingMode() == FREEDRAWING_MODE: |
351 Graphic_Element.SetSize(self, width, height) |
375 Graphic_Element.SetSize(self, width, height) |
531 |
555 |
532 # Destructor |
556 # Destructor |
533 def __del__(self): |
557 def __del__(self): |
534 self.Input = None |
558 self.Input = None |
535 self.Output = None |
559 self.Output = None |
|
560 |
|
561 # Make a clone of this LD_Coil |
|
562 def Clone(self, id = None, pos = None): |
|
563 coil = LD_Coil(self.Parent, self.Type, self.Name, id) |
|
564 coil.SetSize(self.Size[0], self.Size[1]) |
|
565 if pos is not None: |
|
566 coil.SetPosition(pos.x, pos.y) |
|
567 coil.Input = self.Input.Clone(coil) |
|
568 coil.Output = self.Output.Clone(coil) |
|
569 return coil |
536 |
570 |
537 # Forbids to change the contact size |
571 # Forbids to change the contact size |
538 def SetSize(self, width, height): |
572 def SetSize(self, width, height): |
539 if self.Parent.GetDrawingMode() == FREEDRAWING_MODE: |
573 if self.Parent.GetDrawingMode() == FREEDRAWING_MODE: |
540 Graphic_Element.SetSize(self, width, height) |
574 Graphic_Element.SetSize(self, width, height) |