Skip to content

Commit

Permalink
Mitsubishi 4G93 Trigger issues #4918
Browse files Browse the repository at this point in the history
  • Loading branch information
rusefillc committed Jan 3, 2023
1 parent def809a commit 8133d24
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,14 +363,13 @@ public void paint(Graphics g) {
}
g.drawString(" " + tdcMessage, 0, 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));
}


if (image == null)
return;
int tdcX = image.engineReport.getTimeAxisTranslator().timeToScreen(MIN_TIME + tdcPosition, w);
g.drawLine(tdcX, 0, tdcX, h);
Graphics2D g2 = (Graphics2D) g;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ public class TriggerWheelInfo {
private final boolean isCrankBased;
private final boolean hasSecondChannel;
private final boolean hardcodedOperationMode;
private final boolean isSynchronizationNeeded;
private final TriggerGaps gaps;

public TriggerWheelInfo(int id, double tdcPosition, String triggerName, List<TriggerSignal> signals,
boolean isCrankBased,
boolean isSecondWheelCam,
boolean hasSecondChannel,
boolean hardcodedOperationMode, TriggerGaps gaps) {
boolean hardcodedOperationMode,
boolean isSynchronizationNeeded, TriggerGaps gaps) {
this.id = id;
this.isSecondWheelCam = isSecondWheelCam;
this.tdcPosition = tdcPosition;
Expand All @@ -37,6 +39,7 @@ public TriggerWheelInfo(int id, double tdcPosition, String triggerName, List<Tri
this.isCrankBased = isCrankBased;
this.hasSecondChannel = hasSecondChannel;
this.hardcodedOperationMode = hardcodedOperationMode;
this.isSynchronizationNeeded = isSynchronizationNeeded;
this.gaps = gaps;
}

Expand All @@ -57,7 +60,7 @@ private static TriggerWheelInfo readTriggerWheelInfo(String line, BufferedReader
boolean isSecondWheelCam = false;
boolean hasSecondChannel = false;
boolean hardcodedOperationMode = false;
int cycleDuration = -1;
boolean isSynchronizationNeeded = false;
TriggerWheelInfo.TriggerGaps gaps = null;
while (true) {
line = reader.readLine();
Expand Down Expand Up @@ -87,7 +90,7 @@ private static TriggerWheelInfo readTriggerWheelInfo(String line, BufferedReader
isCrankBased = Boolean.parseBoolean(value);
break;
case TRIGGER_CYCLE_DURATION:
cycleDuration = (int)Double.parseDouble(value);
//cycleDuration = (int)Double.parseDouble(value);
break;
case TRIGGER_IS_SECOND_WHEEL_CAM:
isSecondWheelCam = Boolean.parseBoolean(value);
Expand All @@ -98,6 +101,9 @@ private static TriggerWheelInfo readTriggerWheelInfo(String line, BufferedReader
case TRIGGER_HARDCODED_OPERATION_MODE:
hardcodedOperationMode = Boolean.parseBoolean(value);
break;
case "isSynchronizationNeeded":
isSynchronizationNeeded = Integer.parseInt(value) > 0;
break;
default:
throw new IllegalStateException("Unexpected key/value: " + line);
}
Expand All @@ -111,6 +117,7 @@ private static TriggerWheelInfo readTriggerWheelInfo(String line, BufferedReader
isSecondWheelCam,
hasSecondChannel,
hardcodedOperationMode,
isSynchronizationNeeded,
gaps
);
}
Expand Down

0 comments on commit 8133d24

Please sign in to comment.