auto-sync
This commit is contained in:
parent
12b850f06d
commit
472202370d
|
@ -1,19 +0,0 @@
|
||||||
package com.irnems;
|
|
||||||
|
|
||||||
import jssc.SerialPortList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Date: 12/25/12
|
|
||||||
* (c) Andrey Belomutskiy
|
|
||||||
*/
|
|
||||||
public class Test {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
String[] portNames = SerialPortList.getPortNames();
|
|
||||||
System.out.println("Total " + portNames.length + " serial port(s)");
|
|
||||||
for (String portName : portNames) {
|
|
||||||
System.out.println(portName);
|
|
||||||
}
|
|
||||||
System.exit(0);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.rusefi.logic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (c) Andrey Belomutskiy 2012-2015
|
||||||
|
* 12/24/2015
|
||||||
|
*/
|
||||||
|
public class IgnitionMapBuilder {
|
||||||
|
|
||||||
|
public enum ChamberStyle {
|
||||||
|
OPEN_CHAMBER(33),
|
||||||
|
CLOSED_CHAMBER(28),
|
||||||
|
SWITL_TUMBLE(22);
|
||||||
|
|
||||||
|
|
||||||
|
private final int advance;
|
||||||
|
|
||||||
|
ChamberStyle(int advance) {
|
||||||
|
this.advance = advance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAdvance() {
|
||||||
|
return advance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static double getTopAdvanceForBore(ChamberStyle style) {
|
||||||
|
return style.advance;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.rusefi.logic.test;
|
||||||
|
|
||||||
|
import com.rusefi.logic.IgnitionMapBuilder;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (c) Andrey Belomutskiy 2012-2015
|
||||||
|
* 12/24/2015
|
||||||
|
*/
|
||||||
|
public class IgnitionMapBuilderTest {
|
||||||
|
@Test
|
||||||
|
public void testIgnitionMapBuilder() {
|
||||||
|
assertEquals(33.0, IgnitionMapBuilder.getTopAdvanceForBore(IgnitionMapBuilder.ChamberStyle.OPEN_CHAMBER));
|
||||||
|
|
||||||
|
assertEquals(22.0, IgnitionMapBuilder.getTopAdvanceForBore(IgnitionMapBuilder.ChamberStyle.SWITL_TUMBLE));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue