equal
deleted
inserted
replaced
373 |
373 |
374 def SetForced(self, forced): |
374 def SetForced(self, forced): |
375 if self.Forced != forced: |
375 if self.Forced != forced: |
376 self.Forced = forced |
376 self.Forced = forced |
377 if self.Visible: |
377 if self.Visible: |
378 self.Parent.UpdateRefreshRect(self.GetRedrawRect()) |
378 self.Parent.ElementNeedRefresh(self) |
379 |
379 |
380 def SetValue(self, value): |
380 def SetValue(self, value): |
381 if self.Type == CONTACT_RISING: |
381 if self.Type == CONTACT_RISING: |
382 refresh = self.Value and not self.PreviousValue |
382 refresh = self.Value and not self.PreviousValue |
383 elif self.Type == CONTACT_FALLING: |
383 elif self.Type == CONTACT_FALLING: |
386 refresh = False |
386 refresh = False |
387 self.PreviousValue = self.Value |
387 self.PreviousValue = self.Value |
388 self.Value = value |
388 self.Value = value |
389 if self.Value != self.PreviousValue or refresh: |
389 if self.Value != self.PreviousValue or refresh: |
390 if self.Visible: |
390 if self.Visible: |
391 self.Parent.UpdateRefreshRect(self.GetRedrawRect()) |
391 self.Parent.ElementNeedRefresh(self) |
392 self.SpreadCurrent() |
392 self.SpreadCurrent() |
393 |
393 |
394 def SpreadCurrent(self): |
394 def SpreadCurrent(self): |
395 if self.Parent.Debug: |
395 if self.Parent.Debug: |
396 if self.Value is None: |
396 if self.Value is None: |
723 if self.Value and not self.PreviousValue: |
723 if self.Value and not self.PreviousValue: |
724 self.Output.SpreadCurrent(True) |
724 self.Output.SpreadCurrent(True) |
725 elif not self.Value and self.PreviousValue: |
725 elif not self.Value and self.PreviousValue: |
726 self.Output.SpreadCurrent(False) |
726 self.Output.SpreadCurrent(False) |
727 if self.Value != self.PreviousValue and self.Visible: |
727 if self.Value != self.PreviousValue and self.Visible: |
728 self.Parent.UpdateRefreshRect(self.GetRedrawRect()) |
728 self.Parent.ElementNeedRefresh(self) |
729 |
729 |
730 # Make a clone of this LD_Coil |
730 # Make a clone of this LD_Coil |
731 def Clone(self, parent, id = None, pos = None): |
731 def Clone(self, parent, id = None, pos = None): |
732 coil = LD_Coil(parent, self.Type, self.Name, id) |
732 coil = LD_Coil(parent, self.Type, self.Name, id) |
733 coil.SetSize(self.Size[0], self.Size[1]) |
733 coil.SetSize(self.Size[0], self.Size[1]) |