Fix negative motor reporting

This commit is contained in:
Sam El-Husseini 2017-12-27 20:35:36 -08:00
parent 1903a6e347
commit 7e2251d8ac

View File

@ -42,8 +42,7 @@ namespace pxsim.visuals {
private updateSpeed(speed: number) {
let c = Math.PI * (90 * 2);
if (speed < 0) speed = 100 - speed;
speed = Math.abs(speed);
let pct = ((100 - speed) / 100) * c;
this.circleBar.setAttribute('stroke-dashoffset', `${pct}`);
}