mirror of https://github.com/FOME-Tech/fome-fw.git
refactoring
This commit is contained in:
parent
11235befde
commit
eeef824894
|
@ -159,15 +159,18 @@ public class EngineReport {
|
||||||
public static class UpDown {
|
public static class UpDown {
|
||||||
// times in sys ticks
|
// times in sys ticks
|
||||||
public final int upTime;
|
public final int upTime;
|
||||||
public final int upIndex;
|
/**
|
||||||
|
* Only trigger channels have these
|
||||||
|
*/
|
||||||
|
public final int upTriggerCycleIndex;
|
||||||
public final int downTime;
|
public final int downTime;
|
||||||
public final int downIndex;
|
public final int downTriggerCycleIndex;
|
||||||
|
|
||||||
public UpDown(int upTime, int upIndex, int downTime, int downIndex) {
|
public UpDown(int upTime, int upIndex, int downTime, int downIndex) {
|
||||||
this.upTime = upTime;
|
this.upTime = upTime;
|
||||||
this.upIndex = upIndex;
|
this.upTriggerCycleIndex = upIndex;
|
||||||
this.downTime = downTime;
|
this.downTime = downTime;
|
||||||
this.downIndex = downIndex;
|
this.downTriggerCycleIndex = downIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDuration() {
|
public int getDuration() {
|
||||||
|
|
|
@ -32,10 +32,10 @@ public class EngineChartParserTest {
|
||||||
|
|
||||||
EngineReport.UpDown upDown = list.get(0);
|
EngineReport.UpDown upDown = list.get(0);
|
||||||
assertEquals(24, upDown.upTime);
|
assertEquals(24, upDown.upTime);
|
||||||
assertEquals(156, upDown.upIndex);
|
assertEquals(156, upDown.upTriggerCycleIndex);
|
||||||
|
|
||||||
assertEquals(39, upDown.downTime);
|
assertEquals(39, upDown.downTime);
|
||||||
assertEquals(157, upDown.downIndex);
|
assertEquals(157, upDown.downTriggerCycleIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -282,12 +282,12 @@ public class UpDownImage extends JPanel {
|
||||||
String fromAngleStr = RevolutionLog.angle2string(fromAngle);
|
String fromAngleStr = RevolutionLog.angle2string(fromAngle);
|
||||||
|
|
||||||
g.setColor(Color.darkGray);
|
g.setColor(Color.darkGray);
|
||||||
if (upDown.upIndex != -1) {
|
if (upDown.upTriggerCycleIndex != -1) {
|
||||||
g.drawString("" + upDown.upIndex, x1, (int) (0.25 * d.height));
|
g.drawString("" + upDown.upTriggerCycleIndex, x1, (int) (0.25 * d.height));
|
||||||
// System.out.println("digital_event," + upDown.upIndex + "," + fromAngleStr);
|
// System.out.println("digital_event," + upDown.upIndex + "," + fromAngleStr);
|
||||||
}
|
}
|
||||||
if (upDown.downIndex != -1) {
|
if (upDown.downTriggerCycleIndex != -1) {
|
||||||
g.drawString("" + upDown.downIndex, x2, (int) (0.25 * d.height));
|
g.drawString("" + upDown.downTriggerCycleIndex, x2, (int) (0.25 * d.height));
|
||||||
// System.out.println("digital_event," + upDown.downIndex + "," + toAngleStr);
|
// System.out.println("digital_event," + upDown.downIndex + "," + toAngleStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue