all triggers should be documented way nicer #2001

better direction
This commit is contained in:
rusefillc 2020-12-10 20:56:12 -05:00
parent cf26d545a7
commit e5a090d745
1 changed files with 4 additions and 4 deletions

View File

@ -260,7 +260,7 @@ public class TriggerImage {
*/
double nextAngle = i == wheel.size() - 1 ? 360 + wheel.get(0).angle : wheel.get(i + 1).angle;
int arcDuration = (int) (nextAngle - current.angle);
int arcDuration = (int) (current.angle - nextAngle);
int arcStart = (int) arcToRusEFI(nextAngle);
if (current.state == 1) {
g.drawArc(WHEEL_BORDER, WHEEL_BORDER, WHEEL_DIAMETER, WHEEL_DIAMETER, arcStart, arcDuration);
@ -286,7 +286,7 @@ public class TriggerImage {
}
private static double arcToRusEFI(double angle) {
return (90 - angle);
return angle - 90;
}
private static void drawRadialLine(Graphics g, double angle) {
@ -295,9 +295,9 @@ public class TriggerImage {
double radianAngle = Math.toRadians(angle);
int smallX = (int) (SMALL_DIAMETER / 2 * Math.sin(radianAngle));
int smallY = -(int) (SMALL_DIAMETER / 2 * Math.cos(radianAngle));
int smallY = (int) (SMALL_DIAMETER / 2 * Math.cos(radianAngle));
int largeX = (int) (WHEEL_DIAMETER / 2 * Math.sin(radianAngle));
int largeY = -(int) (WHEEL_DIAMETER / 2 * Math.cos(radianAngle));
int largeY = (int) (WHEEL_DIAMETER / 2 * Math.cos(radianAngle));
g.drawLine(center + smallX, center + smallY, center + largeX, center + largeY);
}