Solenoid test in console (#2178)
* give it a try * create component * add command maybe * try * try * add pic * try TCU_SOLENOID_COUNT * try * use injection and ignition count fields
This commit is contained in:
parent
077ba2bf9e
commit
a43bf01ecd
|
@ -120,6 +120,16 @@ static void doRunFuel(int humanIndex, const char *delayStr, const char * onTimeS
|
||||||
pinbench(delayStr, onTimeStr, offTimeStr, countStr, &enginePins.injectors[humanIndex - 1], b);
|
pinbench(delayStr, onTimeStr, offTimeStr, countStr, &enginePins.injectors[humanIndex - 1], b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void doTestSolenoid(int humanIndex, const char *delayStr, const char * onTimeStr, const char *offTimeStr,
|
||||||
|
const char *countStr) {
|
||||||
|
if (humanIndex < 1 || humanIndex > TCU_SOLENOID_COUNT) {
|
||||||
|
scheduleMsg(logger, "Invalid index: %d", humanIndex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
brain_pin_e b = CONFIG(tcu_solenoid)[humanIndex - 1];
|
||||||
|
pinbench(delayStr, onTimeStr, offTimeStr, countStr, &enginePins.tcuSolenoids[humanIndex - 1], b);
|
||||||
|
}
|
||||||
|
|
||||||
static void doBenchTestFsio(int humanIndex, const char *delayStr, const char * onTimeStr, const char *offTimeStr,
|
static void doBenchTestFsio(int humanIndex, const char *delayStr, const char * onTimeStr, const char *offTimeStr,
|
||||||
const char *countStr) {
|
const char *countStr) {
|
||||||
if (humanIndex < 1 || humanIndex > FSIO_COMMAND_COUNT) {
|
if (humanIndex < 1 || humanIndex > FSIO_COMMAND_COUNT) {
|
||||||
|
@ -140,6 +150,16 @@ static void fuelbench2(const char *delayStr, const char *indexStr, const char *
|
||||||
doRunFuel(index, delayStr, onTimeStr, offTimeStr, countStr);
|
doRunFuel(index, delayStr, onTimeStr, offTimeStr, countStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* delay 100, solenoid #2, 1000ms ON, 1000ms OFF, repeat 3 times
|
||||||
|
* tcusolbench 100 2 1000 1000 3
|
||||||
|
*/
|
||||||
|
static void tcusolbench(const char *delayStr, const char *indexStr, const char * onTimeStr, const char *offTimeStr,
|
||||||
|
const char *countStr) {
|
||||||
|
int index = atoi(indexStr);
|
||||||
|
doTestSolenoid(index, delayStr, onTimeStr, offTimeStr, countStr);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* delay 100, channel #1, 5ms ON, 1000ms OFF, repeat 3 times
|
* delay 100, channel #1, 5ms ON, 1000ms OFF, repeat 3 times
|
||||||
* fsiobench2 100 1 5 1000 3
|
* fsiobench2 100 1 5 1000 3
|
||||||
|
@ -409,6 +429,7 @@ void initBenchTest(Logging *sharedLogger) {
|
||||||
addConsoleAction(CMD_HPFP_BENCH, hpfpValveBench);
|
addConsoleAction(CMD_HPFP_BENCH, hpfpValveBench);
|
||||||
|
|
||||||
addConsoleActionSSSSS("fuelbench2", fuelbench2);
|
addConsoleActionSSSSS("fuelbench2", fuelbench2);
|
||||||
|
addConsoleActionSSSSS("tcusolbench", tcusolbench);
|
||||||
addConsoleActionSSSSS("fsiobench2", fsioBench2);
|
addConsoleActionSSSSS("fsiobench2", fsioBench2);
|
||||||
addConsoleActionSSSSS("sparkbench2", sparkbench2);
|
addConsoleActionSSSSS("sparkbench2", sparkbench2);
|
||||||
instance.setPeriod(200 /*ms*/);
|
instance.setPeriod(200 /*ms*/);
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
|
@ -28,6 +28,7 @@ public class BenchTestPane {
|
||||||
content.add(createFuelPumpTest());
|
content.add(createFuelPumpTest());
|
||||||
content.add(createSparkTest());
|
content.add(createSparkTest());
|
||||||
content.add(createInjectorTest());
|
content.add(createInjectorTest());
|
||||||
|
content.add(createSolenoidTest());
|
||||||
content.add(createMILTest());
|
content.add(createMILTest());
|
||||||
content.add(createIdleTest());
|
content.add(createIdleTest());
|
||||||
content.add(createStarterTest());
|
content.add(createStarterTest());
|
||||||
|
@ -105,7 +106,7 @@ public class BenchTestPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Component createSparkTest() {
|
private Component createSparkTest() {
|
||||||
final JComboBox<Integer> indexes = createIndexCombo();
|
final JComboBox<Integer> indexes = createIndexCombo(Fields.IGNITION_PIN_COUNT);
|
||||||
CommandControl panel = new CommandControl(uiContext,"Spark #", "spark.jpg", TEST, indexes) {
|
CommandControl panel = new CommandControl(uiContext,"Spark #", "spark.jpg", TEST, indexes) {
|
||||||
@Override
|
@Override
|
||||||
protected String getCommand() {
|
protected String getCommand() {
|
||||||
|
@ -116,7 +117,7 @@ public class BenchTestPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Component createInjectorTest() {
|
private Component createInjectorTest() {
|
||||||
final JComboBox<Integer> indexes = createIndexCombo();
|
final JComboBox<Integer> indexes = createIndexCombo(Fields.INJECTION_PIN_COUNT);
|
||||||
CommandControl panel = new CommandControl(uiContext,"Injector #", "injector.png", TEST, indexes) {
|
CommandControl panel = new CommandControl(uiContext,"Injector #", "injector.png", TEST, indexes) {
|
||||||
@Override
|
@Override
|
||||||
protected String getCommand() {
|
protected String getCommand() {
|
||||||
|
@ -126,10 +127,21 @@ public class BenchTestPane {
|
||||||
return panel.getContent();
|
return panel.getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Component createSolenoidTest() {
|
||||||
|
final JComboBox<Integer> indexes = createIndexCombo(Fields.TCU_SOLENOID_COUNT);
|
||||||
|
CommandControl panel = new CommandControl(uiContext,"TCU Solenoid #", "solenoid.jpg", TEST, indexes) {
|
||||||
|
@Override
|
||||||
|
protected String getCommand() {
|
||||||
|
return "tcusolbench 1000 " + indexes.getSelectedItem() + " 1000 1000 3";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return panel.getContent();
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private JComboBox<Integer> createIndexCombo() {
|
private JComboBox<Integer> createIndexCombo(Integer count) {
|
||||||
JComboBox<Integer> indexes = new JComboBox<>();
|
JComboBox<Integer> indexes = new JComboBox<>();
|
||||||
for (int i = 1; i <= 12; i++) {
|
for (int i = 1; i <= count; i++) {
|
||||||
indexes.addItem(i);
|
indexes.addItem(i);
|
||||||
}
|
}
|
||||||
return indexes;
|
return indexes;
|
||||||
|
@ -139,4 +151,4 @@ public class BenchTestPane {
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue