This commit is contained in:
tzim 2013-11-13 16:11:57 +00:00
parent 5f5a3f51d1
commit ef77c8f3bb

View file

@ -363,7 +363,7 @@ namespace DMX2
} }
private class circEvTarget : IEventTarget{ private class circEvTarget : IEventTarget{
Circuit c; SequenceurLineaire seq; Circuit c; SequenceurLineaire seq; int s=-2; bool ok=false;
public circEvTarget(SequenceurLineaire _seq, Circuit _c){ public circEvTarget(SequenceurLineaire _seq, Circuit _c){
c=_c; c=_c;
seq=_seq; seq=_seq;
@ -371,6 +371,13 @@ namespace DMX2
#region IEventTarget implementation #region IEventTarget implementation
bool IEventTarget.FireEvent (EventData data) bool IEventTarget.FireEvent (EventData data)
{ {
if (!ok) {
int val = seq.ValeurBruteCircuit (c);
int cs = Math.Sign (val - data.value);
if (s == -2) s =cs;
if (cs==0 || cs!=s) ok=true;
else return true ;
}
seq.ChangeValeur(c,data.value); seq.ChangeValeur(c,data.value);
return true; return true;
} }