diff --git a/java_console/trigger-ui/src/main/java/com/rusefi/trigger/TriggerImage.java b/java_console/trigger-ui/src/main/java/com/rusefi/trigger/TriggerImage.java index 05cc9f922f..fd49b09e10 100644 --- a/java_console/trigger-ui/src/main/java/com/rusefi/trigger/TriggerImage.java +++ b/java_console/trigger-ui/src/main/java/com/rusefi/trigger/TriggerImage.java @@ -41,6 +41,7 @@ public class TriggerImage { /** * todo: https://github.com/rusefi/rusefi/issues/2077 + * * @see TriggerWheelInfo#isCrankBased */ private static String getTriggerName(TriggerWheelInfo triggerName) { @@ -163,6 +164,7 @@ public class TriggerImage { triggerPanel.tdcPosition = triggerWheelInfo.getTdcPosition(); triggerPanel.gaps = triggerWheelInfo.getGaps(); + triggerPanel.syncEdge = triggerWheelInfo.getSyncEdge(); EngineReport re0 = new EngineReport(waves.get(0).list, MIN_TIME, 720 * (1 + EXTRA_COUNT)); System.out.println(re0); @@ -328,6 +330,7 @@ public class TriggerImage { public String id; // angle public double tdcPosition; + public String syncEdge; public UpDownImage image; public TriggerWheelInfo.TriggerGaps gaps; @@ -364,13 +367,22 @@ public class TriggerImage { } else { tdcMessage = "TDC at synchronization point"; } - g.drawString(" " + tdcMessage, 0, tdcFontSize); + int y = tdcFontSize; + String prefix = " "; + g.drawString(prefix + tdcMessage, 0, y); + y += tdcFontSize; g.setColor(Color.darkGray); if (image == null) return; for (int i = 0; i < gaps.gapFrom.length; i++) { String message = "Sync " + (i + 1) + ": From " + gaps.gapFrom[i] + " to " + gaps.gapTo[i]; - g.drawString(" " + message, 0, tdcFontSize * (2 + i)); + g.drawString(prefix + " " + message, 0, y); + y += tdcFontSize; + } + + if (syncEdge != null) { + g.drawString(prefix + syncEdge, 0, y); + y += tdcFontSize; } int tdcX = image.engineReport.getTimeAxisTranslator().timeToScreen(MIN_TIME + tdcPosition, w); diff --git a/java_tools/trigger-image/src/main/java/com/rusefi/trigger/TriggerWheelInfo.java b/java_tools/trigger-image/src/main/java/com/rusefi/trigger/TriggerWheelInfo.java index f8677e0152..b073ef0cc2 100644 --- a/java_tools/trigger-image/src/main/java/com/rusefi/trigger/TriggerWheelInfo.java +++ b/java_tools/trigger-image/src/main/java/com/rusefi/trigger/TriggerWheelInfo.java @@ -22,6 +22,7 @@ public class TriggerWheelInfo { private final boolean hasSecondChannel; private final boolean hardcodedOperationMode; private final TriggerGaps gaps; + private final String syncEdge; public TriggerWheelInfo(int id, double tdcPosition, String triggerName, List signals, boolean isCrankBased, @@ -38,6 +39,7 @@ public class TriggerWheelInfo { this.hasSecondChannel = hasSecondChannel; this.hardcodedOperationMode = hardcodedOperationMode; this.gaps = gaps; + this.syncEdge = syncEdge; } private static TriggerWheelInfo readTriggerWheelInfo(String line, BufferedReader reader) throws IOException { @@ -104,6 +106,7 @@ public class TriggerWheelInfo { break; case TRIGGER_SYNC_EDGE: syncEdge = value; + break; default: throw new IllegalStateException("Unexpected key/value: " + line); } @@ -233,6 +236,10 @@ public class TriggerWheelInfo { return gaps; } + public String getSyncEdge() { + return syncEdge; + } + public interface TriggerWheelInfoConsumer { void onWheel(TriggerWheelInfo wheelInfo); }