# HG changeset patch # User laurent # Date 1301493016 -7200 # Node ID 01f49e491be5a8b38d2b52861faea8fb88874f9d # Parent 42150e041dbe34e2d50f3c5d6acefff1e01e8d1f Bug on Contact Rising and Falling edge not displayed correctly while debugging fixed diff -r 42150e041dbe -r 01f49e491be5 graphics/LD_Objects.py --- a/graphics/LD_Objects.py Wed Mar 30 15:49:09 2011 +0200 +++ b/graphics/LD_Objects.py Wed Mar 30 15:50:16 2011 +0200 @@ -417,9 +417,15 @@ self.Parent.UpdateRefreshRect(self.GetRedrawRect()) def SetValue(self, value): + if self.Type == CONTACT_RISING: + refresh = self.Value and not self.PreviousValue + elif self.Type == CONTACT_FALLING: + refresh = not self.Value and self.PreviousValue + else: + refresh = False self.PreviousValue = self.Value self.Value = value - if self.Value != self.PreviousValue: + if self.Value != self.PreviousValue or refresh: if self.Visible: self.Parent.UpdateRefreshRect(self.GetRedrawRect()) self.SpreadCurrent() @@ -436,7 +442,7 @@ elif self.Type == CONTACT_RISING: spreading &= self.Value and not self.PreviousValue elif self.Type == CONTACT_FALLING: - spreading &= self.Value and not self.PreviousValue + spreading &= not self.Value and self.PreviousValue else: spreading = False if spreading and not self.PreviousSpreading: @@ -635,7 +641,7 @@ if self.Type == CONTACT_NORMAL and self.Value or \ self.Type == CONTACT_REVERSE and not self.Value or \ self.Type == CONTACT_RISING and self.Value and not self.PreviousValue or \ - self.Type == CONTACT_RISING and self.Value and not self.PreviousValue: + self.Type == CONTACT_RISING and not self.Value and self.PreviousValue: if self.Forced: dc.SetPen(wx.CYAN_PEN) else: