removing pieces of dead text protocol from console

This commit is contained in:
rusefi 2019-06-16 17:34:51 -04:00
parent 0bf1653575
commit 3985c05998
12 changed files with 32 additions and 264 deletions

View File

@ -17,11 +17,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
*/ */
public class EngineState { public class EngineState {
public static final String SEPARATOR = ","; public static final String SEPARATOR = ",";
public static final ValueCallback<String> NOTHING = new ValueCallback<String>() {
@Override
public void onUpdate(String value) {
}
};
public static final String PACKING_DELIMITER = ":"; public static final String PACKING_DELIMITER = ":";
// see RUS_EFI_VERSION_TAG in firmware code // see RUS_EFI_VERSION_TAG in firmware code
public static final String RUS_EFI_VERSION_TAG = "rusEfiVersion"; public static final String RUS_EFI_VERSION_TAG = "rusEfiVersion";
@ -77,36 +72,6 @@ public class EngineState {
} }
); );
SensorCentral.getInstance().initialize(this);
// SensorStats.startRangeMeasurement(Sensor.CLT, Sensor.COOLANT_WIDTH);
// SensorStats.startRangeMeasurement(Sensor.IAT, Sensor.INTAKE_AIR_WIDTH);
SensorStats.startRangeMeasurement(Sensor.VREF, Sensor.VREF_WIDTH);
SensorStats.startStandardDeviation(Sensor.DWELL0, Sensor.DWELL0_SD);
SensorStats.startDelta(Sensor.INJECTOR_1_DWELL, Sensor.INJECTOR_2_DWELL, Sensor.INJ_1_2_DELTA);
SensorStats.startDelta(Sensor.INJECTOR_3_DWELL, Sensor.INJECTOR_4_DWELL, Sensor.INJ_3_4_DELTA);
SensorStats.startConversion(Sensor.CLT, Sensor.CLT_F, SensorConversion.celsius_to_fahrenheit);
SensorStats.startConversion(Sensor.IAT, Sensor.IAT_F, SensorConversion.celsius_to_fahrenheit);
SensorStats.startConversion(Sensor.MAFR, Sensor.MAFR_CFM, new SensorConversion() {
@Override
public double convertValue(double value) {
return value / 2.081989116;
}
});
registerStringValueAction("IAT", NOTHING);
registerStringValueAction("int_temp", NOTHING);
registerStringValueAction("mode", NOTHING);
registerStringValueAction("TPS", NOTHING);
registerStringValueAction("adcfast_co", NOTHING);
registerStringValueAction("adcfast_max", NOTHING);
registerStringValueAction("adcfast_min", NOTHING);
registerStringValueAction("key", NOTHING);
registerStringValueAction("value", NOTHING);
registerStringValueAction("msg", new ValueCallback<String>() { registerStringValueAction("msg", new ValueCallback<String>() {
@Override @Override
public void onUpdate(String value) { public void onUpdate(String value) {
@ -114,31 +79,6 @@ public class EngineState {
} }
}); });
registerStringValueAction("advance", NOTHING);
registerStringValueAction("dwell", NOTHING);
registerStringValueAction("offset0", NOTHING);
registerStringValueAction("offset1", NOTHING);
registerStringValueAction("crank_period", NOTHING);
registerStringValueAction("ckp_c", NOTHING);
registerStringValueAction("ev0", NOTHING);
registerStringValueAction("ev1", NOTHING);
registerStringValueAction("adc10", NOTHING);
registerStringValueAction("isC", NOTHING);
registerStringValueAction("p_d", NOTHING);
registerStringValueAction("s_d", NOTHING);
registerStringValueAction("pEC", NOTHING);
registerStringValueAction("sEC", NOTHING);
registerStringValueAction("wEC", NOTHING);
registerStringValueAction("wWi", NOTHING);
registerStringValueAction("wWi2", NOTHING);
registerStringValueAction("cid", NOTHING);
registerStringValueAction("i_d", NOTHING);
registerStringValueAction("i_p", NOTHING);
registerStringValueAction("a_time", NOTHING);
registerStringValueAction("time", new ValueCallback<String>() { registerStringValueAction("time", new ValueCallback<String>() {
public void onUpdate(String value) { public void onUpdate(String value) {
double time; double time;

View File

@ -5,8 +5,6 @@ package com.rusefi.core;
* (c) Andrey Belomutskiy * (c) Andrey Belomutskiy
*/ */
public interface ISensorCentral { public interface ISensorCentral {
void initialize(EngineState es);
double getValue(Sensor sensor); double getValue(Sensor sensor);
void setValue(double value, Sensor sensor); void setValue(double value, Sensor sensor);

View File

@ -18,10 +18,6 @@ import static com.rusefi.config.Fields.*;
*/ */
public enum Sensor { public enum Sensor {
MAP("MAP", SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, /*offset */ 40, BackgroundColor.MUD, 20, 300), MAP("MAP", SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, /*offset */ 40, BackgroundColor.MUD, 20, 300),
MAP_RAW("MAP_RAW", SensorCategory.SENSOR_INPUTS),
BARO("Baro", SensorCategory.SENSOR_INPUTS),
// todo: unify with ignitionAdvance
TIMING("Timing Advance", SensorCategory.OPERATIONS, "deg", -180, 180),
/** /**
* Please note that these enum names are used to make 'set_mock_XXX_voltage' commands * Please note that these enum names are used to make 'set_mock_XXX_voltage' commands
@ -29,67 +25,24 @@ public enum Sensor {
CLT("Coolant", SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, /*offset */ 4, BackgroundColor.MUD, -40, 300), CLT("Coolant", SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, /*offset */ 4, BackgroundColor.MUD, -40, 300),
AFR("A/F ratio", SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, /*offset */ 20, BackgroundColor.MUD, 0, 20), AFR("A/F ratio", SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, /*offset */ 20, BackgroundColor.MUD, 0, 20),
MAF("MAF", SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, /*offset */ 16, BackgroundColor.MUD, 0, 5), MAF("MAF", SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, /*offset */ 16, BackgroundColor.MUD, 0, 5),
MAFR("MAFR", SensorCategory.SENSOR_INPUTS, "kg/hr", 4),
knockCount("Knock", SensorCategory.SENSOR_INPUTS, "count", 30), // knockCount("Knock", SensorCategory.SENSOR_INPUTS, "count", 30),
KnockValue("Knock level", SensorCategory.SENSOR_INPUTS, "v", 6), // KnockValue("Knock level", SensorCategory.SENSOR_INPUTS, "v", 6),
ENGINE_LOAD("Engine Load", SensorCategory.SENSOR_INPUTS, "x", 300), // ENGINE_LOAD("Engine Load", SensorCategory.SENSOR_INPUTS, "x", 300),
MAFR_CFM("MAFR_CFM", SensorCategory.SENSOR_INPUTS, "cub f/m", 800), // MAFR_CFM("MAFR_CFM", SensorCategory.SENSOR_INPUTS, "cub f/m", 800),
CLT_F("Coolant F", SensorCategory.SENSOR_INPUTS, "temperature, F", -40, 500),
IAT_F("Intake Air F", SensorCategory.SENSOR_INPUTS, "temperature, F", -40, 350),
ADC0("adc0", SensorCategory.SENSOR_INPUTS, "%", 100),
ADC1("adc1", SensorCategory.SENSOR_INPUTS, "%", 100),
ADC2("adc2", SensorCategory.SENSOR_INPUTS, "%", 100),
ADC3("adc3", SensorCategory.SENSOR_INPUTS, "%", 100),
TRG_0_DUTY("trg0 duty", SensorCategory.SENSOR_INPUTS, "%", 100),
TRG_1_DUTY("trg1 duty", SensorCategory.SENSOR_INPUTS, "%", 100),
// COOLANT_WIDTH("c w", "", 30), // COOLANT_WIDTH("c w", "", 30),
// INTAKE_AIR_WIDTH("air w", "", 30), // INTAKE_AIR_WIDTH("air w", "", 30),
TABLE_SPARK("table spark", SensorCategory.OPERATIONS, "ms", -40, 40), // VREF("VRef", SensorCategory.SENSOR_INPUTS, "Volts", 6),
VREF("VRef", SensorCategory.SENSOR_INPUTS, "Volts", 6),
VBATT("VBatt", SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 28, BackgroundColor.BEIGE, 4, 18, "Volts"), VBATT("VBatt", SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 28, BackgroundColor.BEIGE, 4, 18, "Volts"),
VREF_WIDTH("VRef w", SensorCategory.OTHERS, "", 1),
DWELL0("Input dwl #1", SensorCategory.SNIFFING, "ms", 0, 30, BackgroundColor.BEIGE),
DWELL1("Input dwl #2", SensorCategory.SNIFFING, "ms", 0, 30, BackgroundColor.BEIGE),
DWELL2("Input dwl #3", SensorCategory.SNIFFING, "ms", 0, 30, BackgroundColor.BEIGE),
DWELL3("Input dwl #4", SensorCategory.SNIFFING, "ms", 0, 30, BackgroundColor.BEIGE),
DWELL0_SD("Input d #1", SensorCategory.SNIFFING, "std dev", 100),
ETB_CONTROL_QUALITY("ETB metric", SensorCategory.SNIFFING, "", 100), ETB_CONTROL_QUALITY("ETB metric", SensorCategory.SNIFFING, "", 100),
TOTAL_DWELL0("Input tdwl #1", SensorCategory.SNIFFING, "ms", 0, 30, BackgroundColor.BEIGE),
TOTAL_DWELL1("Input tdwl #2", SensorCategory.SNIFFING, "ms", 0, 30, BackgroundColor.BEIGE),
TOTAL_DWELL2("Input tdwl #3", SensorCategory.SNIFFING, "ms", 0, 30, BackgroundColor.BEIGE),
TOTAL_DWELL3("Input tdwl #4", SensorCategory.SNIFFING, "ms", 0, 30, BackgroundColor.BEIGE),
ADVANCE0("Input Adv #1", SensorCategory.SNIFFING, "deg", -180, 180, BackgroundColor.BROWN),
ADVANCE1("Input Adv #2", SensorCategory.SNIFFING, "deg", -180, 180, BackgroundColor.BROWN),
ADVANCE2("Input Adv #3", SensorCategory.SNIFFING, "deg", -180, 180, BackgroundColor.BROWN),
ADVANCE3("Input Adv #4", SensorCategory.SNIFFING, "deg", -180, 180, BackgroundColor.BROWN),
PERIOD0("Period", SensorCategory.SNIFFING, "dg", 0, 400),
DUTY0("Duty0", SensorCategory.SNIFFING, "%", 0, 100, BackgroundColor.RED),
DUTY1("Duty1", SensorCategory.SNIFFING, "%", 0, 100, BackgroundColor.RED),
IDLE_SWITCH("idle switch", SensorCategory.OTHERS),
CHARTSIZE("CHARTSIZE", SensorCategory.OTHERS),
CHART_STATUS("CHART_STATUS", SensorCategory.OTHERS),
ADC_STATUS("ADC_STATUS", SensorCategory.OTHERS),
ADC_FAST("ADC_FAST", SensorCategory.OTHERS, "b", 4000),
ADC_FAST_AVG("ADC_FAST_AVG", SensorCategory.OTHERS, "b", 4000),
INJECTOR_1_DWELL("inj #1", SensorCategory.SNIFFING),
INJECTOR_2_DWELL("inj #2", SensorCategory.SNIFFING),
INJECTOR_3_DWELL("inj #3", SensorCategory.SNIFFING),
INJECTOR_4_DWELL("inj #4", SensorCategory.SNIFFING),
IAT(SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 8, BackgroundColor.WHITE, -40, 150, "C"), IAT(SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 8, BackgroundColor.WHITE, -40, 150, "C"),
TPS(SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 12, BackgroundColor.MUD, 0, 100, "%"), // throttle position sensor TPS(SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 12, BackgroundColor.MUD, 0, 100, "%"), // throttle position sensor
crankingFuel(GAUGE_NAME_FUEL_CRANKING, SensorCategory.FUEL, FieldType.FLOAT, 44, BackgroundColor.MUD, 0, 30, "ms"), crankingFuel(GAUGE_NAME_FUEL_CRANKING, SensorCategory.FUEL, FieldType.FLOAT, 44, BackgroundColor.MUD, 0, 30, "ms"),
@ -146,8 +99,6 @@ public enum Sensor {
debugIntField4("debug i4", SensorCategory.DEBUG, FieldType.INT16, 292, BackgroundColor.MUD, 0, 5), debugIntField4("debug i4", SensorCategory.DEBUG, FieldType.INT16, 292, BackgroundColor.MUD, 0, 5),
debugIntField5("debug i5", SensorCategory.DEBUG, FieldType.INT16, 294, BackgroundColor.MUD, 0, 5), debugIntField5("debug i5", SensorCategory.DEBUG, FieldType.INT16, 294, BackgroundColor.MUD, 0, 5),
INJ_1_2_DELTA("inj 1-2 delta", SensorCategory.SNIFFING),
INJ_3_4_DELTA("inj 3-4 delta", SensorCategory.SNIFFING),
; ;
private final String name; private final String name;
@ -192,23 +143,22 @@ public enum Sensor {
} }
/** /**
* Text-based protocol is not very alive * This constructor is used for virtual sensors which do not directly come from ECU
*/ */
@Deprecated
Sensor(String name, SensorCategory category) {
this(name, category, "", 255);
}
@Deprecated
Sensor(String name, SensorCategory category, String units, double maxValue) { Sensor(String name, SensorCategory category, String units, double maxValue) {
this(name, category, units, 0, maxValue); this(name, category, units, 0, maxValue);
} }
@Deprecated /**
* This constructor is used for virtual sensors which do not directly come from ECU
*/
Sensor(String name, SensorCategory category, String units, double minValue, double maxValue) { Sensor(String name, SensorCategory category, String units, double minValue, double maxValue) {
this(name, category, units, minValue, maxValue, BackgroundColor.LIGHT_GRAY); this(name, category, units, minValue, maxValue, BackgroundColor.LIGHT_GRAY);
} }
/**
* This constructor is used for virtual sensors which do not directly come from ECU
*/
Sensor(String name, SensorCategory category, String units, double minValue, double maxValue, BackgroundColor color) { Sensor(String name, SensorCategory category, String units, double minValue, double maxValue, BackgroundColor color) {
this.name = name; this.name = name;
this.category = category; this.category = category;
@ -279,15 +229,6 @@ public enum Sensor {
} }
public double translateValue(double value) { public double translateValue(double value) {
switch (this) {
case ADVANCE0:
case ADVANCE1:
case ADVANCE2:
case ADVANCE3:
case TIMING:
return processAdvance(value);
default:
return value; return value;
} }
} }
}

View File

@ -92,102 +92,6 @@ public class SensorCentral implements ISensorCentral {
return () -> SensorCentral.this.getValue(sensor); return () -> SensorCentral.this.getValue(sensor);
} }
@Override
public void initialize(EngineState es) {
addDoubleSensor(RPM_KEY, Sensor.RPM, es);
addDoubleSensor("mat", Sensor.IAT, es);
addDoubleSensor("map", Sensor.MAP, es);
addDoubleSensor("map_r", Sensor.MAP_RAW, es);
addDoubleSensor("baro", Sensor.BARO, es);
addDoubleSensor("clt", Sensor.CLT, es);
addDoubleSensor("tp", Sensor.TPS, es);
addDoubleSensor("pps", Sensor.TPS, es);
addDoubleSensor("error", Sensor.lastErrorCode, es);
addDoubleSensor("warn", Sensor.errorCodeCounter, es);
addDoubleSensor("knck_c", Sensor.knockCount, es);
addDoubleSensor("knck_v", Sensor.KnockValue, es);
addDoubleSensor("target", Sensor.TARGET_AFR, es);
addDoubleSensor(Sensor.VSS, es);
addDoubleSensor(Sensor.ENGINE_LOAD, es);
addDoubleSensor(Sensor.DWELL0, es);
addDoubleSensor(Sensor.DWELL1, es);
addDoubleSensor(Sensor.DWELL2, es);
addDoubleSensor(Sensor.DWELL3, es);
addDoubleSensor(Sensor.TOTAL_DWELL0, es);
addDoubleSensor(Sensor.TOTAL_DWELL1, es);
addDoubleSensor(Sensor.TOTAL_DWELL2, es);
addDoubleSensor(Sensor.TOTAL_DWELL3, es);
addDoubleSensor(Sensor.ADVANCE0, es);
addDoubleSensor(Sensor.ADVANCE1, es);
addDoubleSensor(Sensor.ADVANCE2, es);
addDoubleSensor(Sensor.ADVANCE3, es);
addDoubleSensor(Sensor.knockCount, es);
addDoubleSensor(Sensor.KnockValue, es);
addDoubleSensor("tch", Sensor.tCharge, es);
addDoubleSensor(Sensor.AFR, es);
addDoubleSensor(Sensor.runningFuel, es);
addDoubleSensor(Sensor.baseFuel, es);
addDoubleSensor(Sensor.injectorLagMs, es);
addDoubleSensor(Sensor.cltCorrection, es);
addDoubleSensor(Sensor.iatCorrection, es);
addDoubleSensor(Sensor.TABLE_SPARK, es);
addDoubleSensor(Sensor.VREF, es);
addDoubleSensor(Sensor.VBATT, es);
addDoubleSensor(Sensor.MAF, es);
addDoubleSensor(Sensor.MAFR, es);
addDoubleSensor("period0", Sensor.PERIOD0, es);
addDoubleSensor("period1", Sensor.PERIOD0, es);
addDoubleSensor("duty0", Sensor.DUTY0, es);
addDoubleSensor("duty1", Sensor.DUTY1, es);
addDoubleSensor(Sensor.TIMING, es);
addDoubleSensor(Sensor.TRG_0_DUTY, es);
addDoubleSensor(Sensor.TRG_1_DUTY, es);
addDoubleSensor(Sensor.ADC0, es);
addDoubleSensor(Sensor.ADC1, es);
addDoubleSensor(Sensor.ADC2, es);
addDoubleSensor(Sensor.ADC3, es);
addDoubleSensor("idl", Sensor.IDLE_SWITCH, es);
addDoubleSensor("chart", Sensor.CHART_STATUS, true, es);
addDoubleSensor("chartsize", Sensor.CHARTSIZE, true, es);
addDoubleSensor("adcDebug", Sensor.ADC_STATUS, true, es);
addDoubleSensor("adcfast", Sensor.ADC_FAST, es);
addDoubleSensor("adcfastavg", Sensor.ADC_FAST_AVG, es);
}
/**
* Sensor enum name matches the protocol key
*/
private void addDoubleSensor(Sensor sensor, EngineState es) {
addDoubleSensor(sensor.name(), sensor, es);
}
private void addDoubleSensor(String key, final Sensor sensor, EngineState es) {
addDoubleSensor(key, sensor, false, es);
}
private void addDoubleSensor(final String key, final Sensor sensor, final boolean verbose, EngineState es) {
es.registerStringValueAction(key, new EngineState.ValueCallback<String>() {
@Override
public void onUpdate(String stringValue) {
double value;
try {
value = Double.parseDouble(stringValue);
} catch (NumberFormatException e) {
// serial protocol is not safe
return;
}
setValue(value, sensor);
if (verbose)
MessagesCentral.getInstance().postMessage(EngineState.class, key + "=" + value);
}
});
}
public interface SensorListener { public interface SensorListener {
void onSensorUpdate(double value); void onSensorUpdate(double value);
} }

View File

@ -39,9 +39,6 @@ public class EcuStimulator {
public boolean isDisplayingFuel = true; public boolean isDisplayingFuel = true;
private static final Sensor DWELL_SENSOR = Sensor.DWELL0;
public static final Sensor ADVANCE_SENSOR = Sensor.ADVANCE0;
private static final int MEASURES = 7; private static final int MEASURES = 7;
// private static final String C_FILE_NAME = "advance_map.c"; // private static final String C_FILE_NAME = "advance_map.c";
// private static final String C_PREFIX = "ad_"; // private static final String C_PREFIX = "ad_";
@ -115,7 +112,7 @@ public class EcuStimulator {
ChartHelper.setYRange(new Range(inputs.getEngineLoadMin(), inputs.getEngineLoadMax()), model); ChartHelper.setYRange(new Range(inputs.getEngineLoadMin(), inputs.getEngineLoadMax()), model);
buildTable(listener, DWELL_SENSOR); //buildTable(listener, DWELL_SENSOR);
try { try {
csv.close(); csv.close();
@ -150,7 +147,7 @@ public class EcuStimulator {
/** /**
* We are making a number of measurements and then we take the middle one * We are making a number of measurements and then we take the middle one
*/ */
MultipleMeasurements r = waitForMultipleResults(dwellSensor, ADVANCE_SENSOR); MultipleMeasurements r = waitForMultipleResults(dwellSensor, null);
List<Double> dwells = r.getDwells(); List<Double> dwells = r.getDwells();
List<Double> advances = r.getAdvances(); List<Double> advances = r.getAdvances();

View File

@ -46,7 +46,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see EngineSnifferPanel * @see EngineSnifferPanel
*/ */
public class Launcher { public class Launcher {
public static final int CONSOLE_VERSION = 20190614; public static final int CONSOLE_VERSION = 20190616;
public static final boolean SHOW_STIMULATOR = false; public static final boolean SHOW_STIMULATOR = false;
public static final String INPUT_FILES_PATH = ".."; public static final String INPUT_FILES_PATH = "..";
private static final String TAB_INDEX = "main_tab"; private static final String TAB_INDEX = "main_tab";

View File

@ -40,10 +40,8 @@ public class SensorLogger {
Sensor.TARGET_AFR, Sensor.TARGET_AFR,
Sensor.tCharge, Sensor.tCharge,
Sensor.veValue, Sensor.veValue,
Sensor.ENGINE_LOAD,
Sensor.DWELL, Sensor.DWELL,
Sensor.TIMING,
Sensor.baseFuel, Sensor.baseFuel,
Sensor.actualLastInjection, Sensor.actualLastInjection,

View File

@ -33,22 +33,19 @@ public class GaugesPanel {
Sensor.CLT, Sensor.CLT,
Sensor.IAT, Sensor.IAT,
Sensor.TPS, Sensor.TPS,
Sensor.MAP, Sensor.MAP,
Sensor.MAP_RAW,
Sensor.tCharge, Sensor.tCharge,
Sensor.DWELL1,
Sensor.DWELL0,
Sensor.DUTY0,
Sensor.ADVANCE0,
Sensor.BARO,
Sensor.baseFuel, Sensor.baseFuel,
Sensor.cltCorrection, Sensor.cltCorrection,
Sensor.iatCorrection, Sensor.iatCorrection,
Sensor.injectorLagMs, Sensor.injectorLagMs,
Sensor.lastErrorCode, Sensor.lastErrorCode,
Sensor.AFR, Sensor.AFR,
Sensor.TIMING, Sensor.VBATT,
Sensor.VREF Sensor.VSS,
}; };
private static final String GAUGES_ROWS = "gauges_rows"; private static final String GAUGES_ROWS = "gauges_rows";
private static final String GAUGES_COLUMNS = "gauges_cols"; private static final String GAUGES_COLUMNS = "gauges_cols";
@ -68,8 +65,8 @@ public class GaugesPanel {
private final GaugesGrid gauges; private final GaugesGrid gauges;
private final Node config; private final Node config;
private boolean showRpmPanel = true; private boolean showRpmPanel;
private boolean showMessagesPanel = true; private boolean showMessagesPanel;
private final JPanel lowerRpmPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)); private final JPanel lowerRpmPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
/** /**
* this panel is displayed on the right * this panel is displayed on the right

View File

@ -11,7 +11,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class SizeSelectorPanel extends JPanel { public class SizeSelectorPanel extends JPanel {
public static final int WIDTH = 7; public static final int WIDTH = 5;
public static final int HEIGHT = 3; public static final int HEIGHT = 3;
private List<Element> elements = new ArrayList<>(); private List<Element> elements = new ArrayList<>();

View File

@ -2,7 +2,6 @@ package com.rusefi.ui.engine;
import com.rusefi.core.Sensor; import com.rusefi.core.Sensor;
import java.util.Comparator;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
@ -15,13 +14,6 @@ public class NameUtil {
public static final String CRANK1 = "t1"; public static final String CRANK1 = "t1";
protected static final Map<String, Sensor> name2sensor = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); protected static final Map<String, Sensor> name2sensor = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
static {
name2sensor.put("inj1", Sensor.INJECTOR_1_DWELL);
name2sensor.put("inj2", Sensor.INJECTOR_2_DWELL);
name2sensor.put("inj3", Sensor.INJECTOR_3_DWELL);
name2sensor.put("inj4", Sensor.INJECTOR_4_DWELL);
}
static String getUiName(String name) { static String getUiName(String name) {
if (name.isEmpty()) if (name.isEmpty())
return name; return name;

View File

@ -11,11 +11,11 @@ import javax.swing.*;
*/ */
public class IdleLabel extends JLabel { public class IdleLabel extends JLabel {
public IdleLabel() { public IdleLabel() {
SensorCentral.getInstance().addListener(Sensor.IDLE_SWITCH, new SensorCentral.SensorListener() { // SensorCentral.getInstance().addListener(Sensor.IDLE_SWITCH, new SensorCentral.SensorListener() {
@Override // @Override
public void onSensorUpdate(double value) { // public void onSensorUpdate(double value) {
IdleLabel.this.setText("Idle: " + (value == 0)); // IdleLabel.this.setText("Idle: " + (value == 0));
} // }
}); // });
} }
} }

View File

@ -32,6 +32,7 @@ public class PotCommand {
}; };
((SpinnerNumberModel) voltageSpinner.getModel()).setStepSize(0.1); ((SpinnerNumberModel) voltageSpinner.getModel()).setStepSize(0.1);
voltageSpinner.setValue(1.0); voltageSpinner.setValue(1.0);
/*
voltageSpinner.addChangeListener(new ChangeListener() { voltageSpinner.addChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -40,7 +41,7 @@ public class PotCommand {
potSpinner.setValue(d); potSpinner.setValue(d);
} }
}); });
*/
potSpinner = new JSpinner() { potSpinner = new JSpinner() {
@Override @Override