Correction bug clignotement sur telecommande
This commit is contained in:
parent
59d40ad743
commit
ea2e765caa
1 changed files with 14 additions and 4 deletions
|
|
@ -229,10 +229,10 @@ namespace DMX2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Circuit> circuitTelecomande=new List<Circuit>();
|
HashSet<Circuit> circuitTelecomande=new HashSet<Circuit>();
|
||||||
int circuitTelecomandeVal=0;
|
int circuitTelecomandeVal=0;
|
||||||
|
|
||||||
public List<Circuit> CircuitTelecomande {
|
public HashSet<Circuit> CircuitTelecomande {
|
||||||
get {
|
get {
|
||||||
return circuitTelecomande;
|
return circuitTelecomande;
|
||||||
}
|
}
|
||||||
|
|
@ -250,6 +250,12 @@ namespace DMX2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsCircuitTel(Circuit c){
|
||||||
|
if (circuitTelecomande.Count == 0)
|
||||||
|
return false;
|
||||||
|
return circuitTelecomande.Contains (c);
|
||||||
|
}
|
||||||
|
|
||||||
// On utilise un thread qui boucle au lieu d'un timer.
|
// On utilise un thread qui boucle au lieu d'un timer.
|
||||||
// C'est un peu moins précis, mais ca consomme beaucoup moins de ressources
|
// C'est un peu moins précis, mais ca consomme beaucoup moins de ressources
|
||||||
|
|
||||||
|
|
@ -314,6 +320,8 @@ namespace DMX2
|
||||||
foreach (var seq in sequenceurs) {
|
foreach (var seq in sequenceurs) {
|
||||||
val = Math.Max (val, seq.ValeurCircuit (c));
|
val = Math.Max (val, seq.ValeurCircuit (c));
|
||||||
}
|
}
|
||||||
|
if (IsCircuitTel (c))
|
||||||
|
val = circuitTelecomandeVal;
|
||||||
c.ValeurCourante = val * master / 100;
|
c.ValeurCourante = val * master / 100;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -322,15 +330,17 @@ namespace DMX2
|
||||||
foreach (var seq in sequenceurs) {
|
foreach (var seq in sequenceurs) {
|
||||||
val = Math.Max (val, seq.ValeurCircuit (c));
|
val = Math.Max (val, seq.ValeurCircuit (c));
|
||||||
}
|
}
|
||||||
|
if (IsCircuitTel (c))
|
||||||
|
val = circuitTelecomandeVal;
|
||||||
c.ValeurCourante = val;
|
c.ValeurCourante = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (circuitTelecomande.Count > 0) {
|
/*if (circuitTelecomande.Count > 0) {
|
||||||
foreach (Circuit c in circuitTelecomande) {
|
foreach (Circuit c in circuitTelecomande) {
|
||||||
c.ValeurCourante = circuitTelecomandeVal * master / 100;
|
c.ValeurCourante = circuitTelecomandeVal * master / 100;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
EventManager.ProcessEvents();
|
EventManager.ProcessEvents();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue