Console should get much smarter around compatibility with older units #6845
only:preparation
This commit is contained in:
parent
1f4fd624ea
commit
259ecc4bbf
|
@ -0,0 +1,4 @@
|
||||||
|
package com.rusefi.config.generated;
|
||||||
|
|
||||||
|
public class VariableRegistryValues extends Fields {
|
||||||
|
}
|
|
@ -16,7 +16,7 @@ import java.util.Comparator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
import static com.rusefi.config.generated.Fields.*;
|
import static com.rusefi.config.generated.VariableRegistryValues.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andrey Belomutskiy
|
* @author Andrey Belomutskiy
|
||||||
|
@ -83,7 +83,7 @@ public enum Sensor implements BinaryLogEntry {
|
||||||
// // TPS/load AE
|
// // TPS/load AE
|
||||||
// engineLoadAccelDelta("load accel delta", SensorCategory.FUEL, FieldType.INT16, 76, 1.0 / PACK_MULT_PERCENT, -5, 5, "ratio"),
|
// engineLoadAccelDelta("load accel delta", SensorCategory.FUEL, FieldType.INT16, 76, 1.0 / PACK_MULT_PERCENT, -5, 5, "ratio"),
|
||||||
// deltaTps(Fields.GAUGE_NAME_FUEL_TPS_ROC, SensorCategory.FUEL, FieldType.INT16, 78, 1.0 / PACK_MULT_PERCENT, -100, 100, "%"),
|
// deltaTps(Fields.GAUGE_NAME_FUEL_TPS_ROC, SensorCategory.FUEL, FieldType.INT16, 78, 1.0 / PACK_MULT_PERCENT, -100, 100, "%"),
|
||||||
tpsAccelFuel(Fields.GAUGE_NAME_FUEL_TPS_EXTRA, SensorCategory.FUEL, FieldType.INT16, TsOutputs.TPSACCELFUEL, 1.0 / PACK_MULT_MS, 0, 200, "ms"),
|
tpsAccelFuel(GAUGE_NAME_FUEL_TPS_EXTRA, SensorCategory.FUEL, FieldType.INT16, TsOutputs.TPSACCELFUEL, 1.0 / PACK_MULT_MS, 0, 200, "ms"),
|
||||||
//
|
//
|
||||||
// // Ignition
|
// // Ignition
|
||||||
// ignitionAdvance("ignition timing", SensorCategory.OPERATIONS, FieldType.INT16, 84, 1.0 / PACK_MULT_ANGLE, 30, 140, "deg"),
|
// ignitionAdvance("ignition timing", SensorCategory.OPERATIONS, FieldType.INT16, 84, 1.0 / PACK_MULT_ANGLE, 30, 140, "deg"),
|
||||||
|
|
|
@ -8,8 +8,8 @@ import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.rusefi.config.generated.Fields.PROTOCOL_ES_DOWN;
|
import static com.rusefi.config.generated.VariableRegistryValues.PROTOCOL_ES_DOWN;
|
||||||
import static com.rusefi.config.generated.Fields.PROTOCOL_ES_UP;
|
import static com.rusefi.config.generated.VariableRegistryValues.PROTOCOL_ES_UP;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A model of a digital signal represented as a sequence of {@link UpDown}
|
* A model of a digital signal represented as a sequence of {@link UpDown}
|
||||||
|
|
|
@ -2,6 +2,9 @@ package com.rusefi.autotune;
|
||||||
|
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.config.generated.Fields;
|
||||||
|
|
||||||
|
import static com.rusefi.config.generated.VariableRegistryValues.FUEL_LOAD_COUNT;
|
||||||
|
import static com.rusefi.config.generated.VariableRegistryValues.FUEL_RPM_COUNT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Air/Fuel ratio data point
|
* Air/Fuel ratio data point
|
||||||
*
|
*
|
||||||
|
@ -19,9 +22,9 @@ public class AfrDataPoint {
|
||||||
public AfrDataPoint(double afr, int rpmIndex, int engineLoadIndex, int rpm, double engineLoad) {
|
public AfrDataPoint(double afr, int rpmIndex, int engineLoadIndex, int rpm, double engineLoad) {
|
||||||
this.rpm = rpm;
|
this.rpm = rpm;
|
||||||
this.engineLoad = engineLoad;
|
this.engineLoad = engineLoad;
|
||||||
if (rpmIndex < 0 || rpmIndex >= Fields.FUEL_RPM_COUNT)
|
if (rpmIndex < 0 || rpmIndex >= FUEL_RPM_COUNT)
|
||||||
throw new IllegalStateException("rpmIndex " + rpmIndex);
|
throw new IllegalStateException("rpmIndex " + rpmIndex);
|
||||||
if (engineLoadIndex < 0 || engineLoadIndex >= Fields.FUEL_LOAD_COUNT)
|
if (engineLoadIndex < 0 || engineLoadIndex >= FUEL_LOAD_COUNT)
|
||||||
throw new IllegalStateException("engineLoadIndex " + engineLoadIndex);
|
throw new IllegalStateException("engineLoadIndex " + engineLoadIndex);
|
||||||
this.afr = afr;
|
this.afr = afr;
|
||||||
this.rpmIndex = rpmIndex;
|
this.rpmIndex = rpmIndex;
|
||||||
|
@ -29,10 +32,10 @@ public class AfrDataPoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AfrDataPoint valueOf(double afr, int rpm, double engineLoad) {
|
public static AfrDataPoint valueOf(double afr, int rpm, double engineLoad) {
|
||||||
int rpmIndex = (int) (rpm / 7000.0 * Fields.FUEL_RPM_COUNT);
|
int rpmIndex = (int) (rpm / 7000.0 * FUEL_RPM_COUNT);
|
||||||
if (rpmIndex < 0 || rpmIndex >= Fields.FUEL_RPM_COUNT)
|
if (rpmIndex < 0 || rpmIndex >= FUEL_RPM_COUNT)
|
||||||
return null;
|
return null;
|
||||||
int engineLoadIndex = (int) (engineLoad / 120.0 * Fields.FUEL_LOAD_COUNT);
|
int engineLoadIndex = (int) (engineLoad / 120.0 * FUEL_LOAD_COUNT);
|
||||||
return new AfrDataPoint(afr, rpmIndex, engineLoadIndex, rpm, engineLoad);
|
return new AfrDataPoint(afr, rpmIndex, engineLoadIndex, rpm, engineLoad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ package com.rusefi.autotune;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import static com.rusefi.autotune.MathUtil.square;
|
import static com.rusefi.autotune.MathUtil.square;
|
||||||
import static com.rusefi.config.generated.Fields.FUEL_LOAD_COUNT;
|
import static com.rusefi.config.generated.VariableRegistryValues.FUEL_LOAD_COUNT;
|
||||||
import static com.rusefi.config.generated.Fields.FUEL_RPM_COUNT;
|
import static com.rusefi.config.generated.VariableRegistryValues.FUEL_RPM_COUNT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1/5/2016
|
* 1/5/2016
|
||||||
|
|
|
@ -7,6 +7,8 @@ import org.junit.jupiter.api.Test;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.rusefi.config.generated.VariableRegistryValues.FUEL_LOAD_COUNT;
|
||||||
|
import static com.rusefi.config.generated.VariableRegistryValues.FUEL_RPM_COUNT;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -111,7 +113,7 @@ public class FuelAutoTuneTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
static double[][] createVeTable(double value) {
|
static double[][] createVeTable(double value) {
|
||||||
double veMap[][] = new double[Fields.FUEL_LOAD_COUNT][Fields.FUEL_RPM_COUNT];
|
double veMap[][] = new double[FUEL_LOAD_COUNT][FUEL_RPM_COUNT];
|
||||||
MathUtil.setArray2D(veMap, value);
|
MathUtil.setArray2D(veMap, value);
|
||||||
return veMap;
|
return veMap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.opensr5.ConfigurationImage;
|
||||||
import com.rusefi.config.Field;
|
import com.rusefi.config.Field;
|
||||||
import com.rusefi.config.FieldCommandResponse;
|
import com.rusefi.config.FieldCommandResponse;
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.config.generated.Fields;
|
||||||
|
import com.rusefi.config.generated.VariableRegistryValues;
|
||||||
import com.rusefi.core.Pair;
|
import com.rusefi.core.Pair;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
@ -31,7 +32,7 @@ public class FieldTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void setBooleanValue() {
|
public void setBooleanValue() {
|
||||||
byte[] config = new byte[Fields.persistent_config_s_size];
|
byte[] config = new byte[VariableRegistryValues.persistent_config_s_size];
|
||||||
ConfigurationImage ci = new ConfigurationImage(config);
|
ConfigurationImage ci = new ConfigurationImage(config);
|
||||||
|
|
||||||
assertFalse(Fields.ISFORCEDINDUCTION.getBooleanValue(ci));
|
assertFalse(Fields.ISFORCEDINDUCTION.getBooleanValue(ci));
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.rusefi.config.generated.Integration.TOP_DEAD_CENTER_MESSAGE;
|
||||||
import static com.rusefi.waves.EngineReport.isCloseEnough;
|
import static com.rusefi.waves.EngineReport.isCloseEnough;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ public class EngineChartParserTest {
|
||||||
EngineChart result = EngineChartParser.unpackToMap("r!1199!64224414!crank2!u!64225149_3!Injector 2!u!64225149!Spark 1!u!64225249!Injector 2!d!64225303!Spark 1!d!64225649!crank2!d!64226105_4!crank!d!64226980_5!crank2!u!64227730_6!Injector 1!u!64227730!Spark 1!u!64227830!Injector 1!d!64227884!Spark 1!d!64228230!crank2!d!64228678_7!crank2!u!64230212_8!Injector 3!u!64230212!Spark 1!u!64230312!Injector 3!d!64230366!Spark 1!d!64230712!crank2!d!64231156_9!crank!u!64231982_0!crank2!u!64232672_1!Injector 4!u!64232672!Spark 1!u!64232772!Injector 4!d!64232826!Spark 1!d!64233172!crank2!d!64233626_2!r!1200!64234412!crank2!u!64235150_3!Injector 2!u!64235150!Spark 1!u!64235250!Injector 2!d!64235304!Spark 1!d!64235650!crank2!d!64236106_4!crank!d!64236981_5!crank2!u!64237730_6!Injector 1!u!64237730!Spark 1!u!64237830!Injector 1!d!64237884!Spark 1!d!64238230!crank2!d!64238677_7!crank2!u!64240213_8!Injector 3!u!64240213!Spark 1!u!64240313!Injector 3!d!64240367!Spark 1!d!64240713!crank2!d!64241158_9!crank!u!64241982_0!crank2!u!64242674_1!Injector 4!u!64242674!Spark 1!u!64242774!Injector 4!d!64242828!Spark 1!d!64243174!crank2!d!64243625_2!r!1200!64244412!crank2!u!64245149_3!Injector 2!u!64245149!Spark 1!u!64245249!Injector 2!d!64245303!Spark 1!d!64245649!crank2!d!64246106_4!crank!d!64246980_5!crank2!u!64247728_6!Injector 1!u!64247728!Spark 1!u!64247828!Injector 1!d!64247882!Spark 1!d!64248228!crank2!d!64248679_7!crank2!u!64250212_8!Injector 3!u!64250212!Spark 1!u!64250312!Injector 3!d!64250366!Spark 1!d!64250712!crank2!d!64251158_9!crank!u!64251982_0!crank2!u!64252674_1!Injector 4!u!64252674!Spark 1!u!64252774!Injector 4!d!64252828!Spark 1!d!64253174!crank2!d!64253625_2!r!1200!64254412!crank2!u!64255150_3!Injector 2!u!64255150!Spark 1!u!64255250!Injector 2!d!64255304!Spark 1!d!64255650!crank2!d!64256106_4!crank!d!64256982_5!crank2!u!64257728_6!Injector 1!u!64257728!Spark 1!u!64257828!Injector 1!d!64257882!Spark 1!d!64258228!crank2!d!64258678_7!crank2!u!64260214_8!Injector 3!u!64260214!Spark 1!u!64260314!Injector 3!d!64260368!Spark 1!d!64260714!,");
|
EngineChart result = EngineChartParser.unpackToMap("r!1199!64224414!crank2!u!64225149_3!Injector 2!u!64225149!Spark 1!u!64225249!Injector 2!d!64225303!Spark 1!d!64225649!crank2!d!64226105_4!crank!d!64226980_5!crank2!u!64227730_6!Injector 1!u!64227730!Spark 1!u!64227830!Injector 1!d!64227884!Spark 1!d!64228230!crank2!d!64228678_7!crank2!u!64230212_8!Injector 3!u!64230212!Spark 1!u!64230312!Injector 3!d!64230366!Spark 1!d!64230712!crank2!d!64231156_9!crank!u!64231982_0!crank2!u!64232672_1!Injector 4!u!64232672!Spark 1!u!64232772!Injector 4!d!64232826!Spark 1!d!64233172!crank2!d!64233626_2!r!1200!64234412!crank2!u!64235150_3!Injector 2!u!64235150!Spark 1!u!64235250!Injector 2!d!64235304!Spark 1!d!64235650!crank2!d!64236106_4!crank!d!64236981_5!crank2!u!64237730_6!Injector 1!u!64237730!Spark 1!u!64237830!Injector 1!d!64237884!Spark 1!d!64238230!crank2!d!64238677_7!crank2!u!64240213_8!Injector 3!u!64240213!Spark 1!u!64240313!Injector 3!d!64240367!Spark 1!d!64240713!crank2!d!64241158_9!crank!u!64241982_0!crank2!u!64242674_1!Injector 4!u!64242674!Spark 1!u!64242774!Injector 4!d!64242828!Spark 1!d!64243174!crank2!d!64243625_2!r!1200!64244412!crank2!u!64245149_3!Injector 2!u!64245149!Spark 1!u!64245249!Injector 2!d!64245303!Spark 1!d!64245649!crank2!d!64246106_4!crank!d!64246980_5!crank2!u!64247728_6!Injector 1!u!64247728!Spark 1!u!64247828!Injector 1!d!64247882!Spark 1!d!64248228!crank2!d!64248679_7!crank2!u!64250212_8!Injector 3!u!64250212!Spark 1!u!64250312!Injector 3!d!64250366!Spark 1!d!64250712!crank2!d!64251158_9!crank!u!64251982_0!crank2!u!64252674_1!Injector 4!u!64252674!Spark 1!u!64252774!Injector 4!d!64252828!Spark 1!d!64253174!crank2!d!64253625_2!r!1200!64254412!crank2!u!64255150_3!Injector 2!u!64255150!Spark 1!u!64255250!Injector 2!d!64255304!Spark 1!d!64255650!crank2!d!64256106_4!crank!d!64256982_5!crank2!u!64257728_6!Injector 1!u!64257728!Spark 1!u!64257828!Injector 1!d!64257882!Spark 1!d!64258228!crank2!d!64258678_7!crank2!u!64260214_8!Injector 3!u!64260214!Spark 1!u!64260314!Injector 3!d!64260368!Spark 1!d!64260714!,");
|
||||||
assertFalse(result.getMap().isEmpty());
|
assertFalse(result.getMap().isEmpty());
|
||||||
|
|
||||||
StringBuilder revolutions = result.get(Fields.TOP_DEAD_CENTER_MESSAGE);
|
StringBuilder revolutions = result.get(TOP_DEAD_CENTER_MESSAGE);
|
||||||
|
|
||||||
RevolutionLog rl = RevolutionLog.parseRevolutions(revolutions);
|
RevolutionLog rl = RevolutionLog.parseRevolutions(revolutions);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.rusefi;
|
package com.rusefi;
|
||||||
|
|
||||||
import com.rusefi.binaryprotocol.BinaryProtocol;
|
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||||
import com.rusefi.config.generated.Fields;
|
|
||||||
import com.rusefi.config.generated.Integration;
|
import com.rusefi.config.generated.Integration;
|
||||||
|
import com.rusefi.config.generated.VariableRegistryValues;
|
||||||
import com.rusefi.core.preferences.storage.PersistentConfiguration;
|
import com.rusefi.core.preferences.storage.PersistentConfiguration;
|
||||||
import com.rusefi.ui.MessagesView;
|
import com.rusefi.ui.MessagesView;
|
||||||
import com.rusefi.ui.UIContext;
|
import com.rusefi.ui.UIContext;
|
||||||
|
@ -14,7 +14,8 @@ import java.awt.*;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
import static com.rusefi.CommandControl.TEST;
|
import static com.rusefi.CommandControl.TEST;
|
||||||
import static com.rusefi.config.generated.Fields.*;
|
import static com.rusefi.config.generated.Integration.CMD_STARTER_BENCH;
|
||||||
|
import static com.rusefi.config.generated.Integration.*;
|
||||||
|
|
||||||
public class BenchTestPane {
|
public class BenchTestPane {
|
||||||
private final JPanel content = new JPanel(new GridLayout(2, 5));
|
private final JPanel content = new JPanel(new GridLayout(2, 5));
|
||||||
|
@ -100,7 +101,7 @@ public class BenchTestPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Component createSparkTest() {
|
private Component createSparkTest() {
|
||||||
final JComboBox<Integer> indexes = createIndexCombo(Fields.MAX_CYLINDER_COUNT);
|
final JComboBox<Integer> indexes = createIndexCombo(VariableRegistryValues.MAX_CYLINDER_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() {
|
||||||
|
@ -111,7 +112,7 @@ public class BenchTestPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Component createInjectorTest() {
|
private Component createInjectorTest() {
|
||||||
final JComboBox<Integer> indexes = createIndexCombo(Fields.MAX_CYLINDER_COUNT);
|
final JComboBox<Integer> indexes = createIndexCombo(VariableRegistryValues.MAX_CYLINDER_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() {
|
||||||
|
@ -122,7 +123,7 @@ public class BenchTestPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Component createSolenoidTest() {
|
private Component createSolenoidTest() {
|
||||||
final JComboBox<Integer> indexes = createIndexCombo(Fields.TCU_SOLENOID_COUNT);
|
final JComboBox<Integer> indexes = createIndexCombo(VariableRegistryValues.TCU_SOLENOID_COUNT);
|
||||||
CommandControl panel = new CommandControl(uiContext,"TCU Solenoid #", "solenoid.jpg", TEST, indexes) {
|
CommandControl panel = new CommandControl(uiContext,"TCU Solenoid #", "solenoid.jpg", TEST, indexes) {
|
||||||
@Override
|
@Override
|
||||||
protected String getCommand() {
|
protected String getCommand() {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.rusefi.ui;
|
||||||
import com.devexperts.logging.Logging;
|
import com.devexperts.logging.Logging;
|
||||||
import com.rusefi.NamedThreadFactory;
|
import com.rusefi.NamedThreadFactory;
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.config.generated.Fields;
|
||||||
|
import com.rusefi.config.generated.VariableRegistryValues;
|
||||||
import com.rusefi.core.ui.AutoupdateUtil;
|
import com.rusefi.core.ui.AutoupdateUtil;
|
||||||
import com.rusefi.io.can.PCanIoStream;
|
import com.rusefi.io.can.PCanIoStream;
|
||||||
import com.rusefi.tools.CANConnectorStartup;
|
import com.rusefi.tools.CANConnectorStartup;
|
||||||
|
@ -21,7 +22,7 @@ public class PcanConnectorUI {
|
||||||
FrameHelper frame = new FrameHelper(WindowConstants.EXIT_ON_CLOSE);
|
FrameHelper frame = new FrameHelper(WindowConstants.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
JPanel panel = new JPanel(new BorderLayout());
|
JPanel panel = new JPanel(new BorderLayout());
|
||||||
panel.add(new JLabel("Running PCAN connector for TS: RX on " + Integer.toString(Fields.CAN_ECU_SERIAL_RX_ID, 16)), BorderLayout.NORTH);
|
panel.add(new JLabel("Running PCAN connector for TS: RX on " + Integer.toString(VariableRegistryValues.CAN_ECU_SERIAL_RX_ID, 16)), BorderLayout.NORTH);
|
||||||
JTextArea logTextArea = new JTextArea();
|
JTextArea logTextArea = new JTextArea();
|
||||||
JPanel panelForScroll = new JPanel(new BorderLayout());
|
JPanel panelForScroll = new JPanel(new BorderLayout());
|
||||||
panelForScroll.add(logTextArea, BorderLayout.CENTER);
|
panelForScroll.add(logTextArea, BorderLayout.CENTER);
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.rusefi;
|
||||||
|
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.config.generated.Fields;
|
||||||
import com.rusefi.config.generated.Integration;
|
import com.rusefi.config.generated.Integration;
|
||||||
|
import com.rusefi.config.generated.VariableRegistryValues;
|
||||||
import com.rusefi.io.IoStream;
|
import com.rusefi.io.IoStream;
|
||||||
import com.rusefi.io.commands.GetOutputsCommandBrokenHelper;
|
import com.rusefi.io.commands.GetOutputsCommandBrokenHelper;
|
||||||
import com.rusefi.io.commands.HelloCommand;
|
import com.rusefi.io.commands.HelloCommand;
|
||||||
|
@ -177,7 +178,7 @@ covered by FullServerTest
|
||||||
|
|
||||||
BackendTestHelper.runApplicationConnectorBlocking(backend, serverPortForRemoteUsers);
|
BackendTestHelper.runApplicationConnectorBlocking(backend, serverPortForRemoteUsers);
|
||||||
|
|
||||||
SessionDetails sessionDetails = TestHelper.createTestSession(TestHelper.TEST_TOKEN_1, Fields.TS_SIGNATURE);
|
SessionDetails sessionDetails = TestHelper.createTestSession(TestHelper.TEST_TOKEN_1, VariableRegistryValues.TS_SIGNATURE);
|
||||||
ApplicationRequest applicationRequest = new ApplicationRequest(sessionDetails, BackendTestHelper.createTestUserResolver().apply(TestHelper.TEST_TOKEN_1));
|
ApplicationRequest applicationRequest = new ApplicationRequest(sessionDetails, BackendTestHelper.createTestUserResolver().apply(TestHelper.TEST_TOKEN_1));
|
||||||
|
|
||||||
// start authenticator
|
// start authenticator
|
||||||
|
|
|
@ -3,8 +3,8 @@ package com.rusefi.proxy.client;
|
||||||
import com.rusefi.BackendTestHelper;
|
import com.rusefi.BackendTestHelper;
|
||||||
import com.rusefi.TestHelper;
|
import com.rusefi.TestHelper;
|
||||||
import com.rusefi.Timeouts;
|
import com.rusefi.Timeouts;
|
||||||
import com.rusefi.config.generated.Fields;
|
|
||||||
import com.rusefi.config.generated.Integration;
|
import com.rusefi.config.generated.Integration;
|
||||||
|
import com.rusefi.config.generated.VariableRegistryValues;
|
||||||
import com.rusefi.io.IoStream;
|
import com.rusefi.io.IoStream;
|
||||||
import com.rusefi.io.commands.GetOutputsCommandBrokenHelper;
|
import com.rusefi.io.commands.GetOutputsCommandBrokenHelper;
|
||||||
import com.rusefi.io.commands.HelloCommand;
|
import com.rusefi.io.commands.HelloCommand;
|
||||||
|
@ -55,7 +55,7 @@ public class LocalApplicationProxyTest {
|
||||||
}, parameter -> backendCreated.countDown(), StatusConsumer.ANONYMOUS);
|
}, parameter -> backendCreated.countDown(), StatusConsumer.ANONYMOUS);
|
||||||
assertLatch(backendCreated);
|
assertLatch(backendCreated);
|
||||||
|
|
||||||
SessionDetails sessionDetails = TestHelper.createTestSession(TEST_TOKEN_1, Fields.TS_SIGNATURE);
|
SessionDetails sessionDetails = TestHelper.createTestSession(TEST_TOKEN_1, VariableRegistryValues.TS_SIGNATURE);
|
||||||
ApplicationRequest applicationRequest = new ApplicationRequest(sessionDetails, BackendTestHelper.createTestUserResolver().apply(TEST_TOKEN_1));
|
ApplicationRequest applicationRequest = new ApplicationRequest(sessionDetails, BackendTestHelper.createTestUserResolver().apply(TEST_TOKEN_1));
|
||||||
|
|
||||||
CountDownLatch disconnected = new CountDownLatch(1);
|
CountDownLatch disconnected = new CountDownLatch(1);
|
||||||
|
@ -71,7 +71,7 @@ public class LocalApplicationProxyTest {
|
||||||
CountDownLatch gaugePokes = new CountDownLatch(3);
|
CountDownLatch gaugePokes = new CountDownLatch(3);
|
||||||
|
|
||||||
try (ServerSocketReference ignored1 = createMockBackend(context, gaugePokes)) {
|
try (ServerSocketReference ignored1 = createMockBackend(context, gaugePokes)) {
|
||||||
SessionDetails sessionDetails = TestHelper.createTestSession(TEST_TOKEN_1, Fields.TS_SIGNATURE);
|
SessionDetails sessionDetails = TestHelper.createTestSession(TEST_TOKEN_1, VariableRegistryValues.TS_SIGNATURE);
|
||||||
ApplicationRequest applicationRequest = new ApplicationRequest(sessionDetails, BackendTestHelper.createTestUserResolver().apply(TEST_TOKEN_1));
|
ApplicationRequest applicationRequest = new ApplicationRequest(sessionDetails, BackendTestHelper.createTestUserResolver().apply(TEST_TOKEN_1));
|
||||||
|
|
||||||
try (ServerSocketReference ignored2 = LocalApplicationProxy.startAndRun(context, applicationRequest, -1, TcpIoStream.DisconnectListener.VOID, LocalApplicationProxy.ConnectionListener.VOID)) {
|
try (ServerSocketReference ignored2 = LocalApplicationProxy.startAndRun(context, applicationRequest, -1, TcpIoStream.DisconnectListener.VOID, LocalApplicationProxy.ConnectionListener.VOID)) {
|
||||||
|
@ -99,7 +99,7 @@ public class LocalApplicationProxyTest {
|
||||||
|
|
||||||
applicationConnection.sendPacket(commandPacket);
|
applicationConnection.sendPacket(commandPacket);
|
||||||
BinaryProtocolServer.Packet response = applicationConnection.readPacket();
|
BinaryProtocolServer.Packet response = applicationConnection.readPacket();
|
||||||
assertEquals(Fields.TS_TOTAL_OUTPUT_SIZE + 1, response.getPacket().length);
|
assertEquals(VariableRegistryValues.TS_TOTAL_OUTPUT_SIZE + 1, response.getPacket().length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ public class LocalApplicationProxyTest {
|
||||||
|
|
||||||
try (ServerSocketReference ignored1 = createMockBackend(context, gaugePokes)) {
|
try (ServerSocketReference ignored1 = createMockBackend(context, gaugePokes)) {
|
||||||
|
|
||||||
SessionDetails sessionDetails = TestHelper.createTestSession(TEST_TOKEN_1, Fields.TS_SIGNATURE);
|
SessionDetails sessionDetails = TestHelper.createTestSession(TEST_TOKEN_1, VariableRegistryValues.TS_SIGNATURE);
|
||||||
ApplicationRequest applicationRequest = new ApplicationRequest(sessionDetails, BackendTestHelper.createTestUserResolver().apply(TEST_TOKEN_1));
|
ApplicationRequest applicationRequest = new ApplicationRequest(sessionDetails, BackendTestHelper.createTestUserResolver().apply(TEST_TOKEN_1));
|
||||||
|
|
||||||
CountDownLatch disconnected = new CountDownLatch(1);
|
CountDownLatch disconnected = new CountDownLatch(1);
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.rusefi.server;
|
||||||
|
|
||||||
import com.devexperts.logging.Logging;
|
import com.devexperts.logging.Logging;
|
||||||
import com.rusefi.config.generated.Integration;
|
import com.rusefi.config.generated.Integration;
|
||||||
|
import com.rusefi.config.generated.VariableRegistryValues;
|
||||||
import com.rusefi.core.SignatureHelper;
|
import com.rusefi.core.SignatureHelper;
|
||||||
import com.rusefi.auth.AuthTokenUtil;
|
import com.rusefi.auth.AuthTokenUtil;
|
||||||
import com.rusefi.binaryprotocol.IncomingDataBuffer;
|
import com.rusefi.binaryprotocol.IncomingDataBuffer;
|
||||||
|
@ -140,7 +141,7 @@ public class ControllerConnectionState {
|
||||||
outputRoundAroundDuration = (int) (System.currentTimeMillis() - start);
|
outputRoundAroundDuration = (int) (System.currentTimeMillis() - start);
|
||||||
if (packet == null)
|
if (packet == null)
|
||||||
throw new IOException("getOutputs: No response");
|
throw new IOException("getOutputs: No response");
|
||||||
if (packet.length != 1 + Fields.TS_TOTAL_OUTPUT_SIZE)
|
if (packet.length != 1 + VariableRegistryValues.TS_TOTAL_OUTPUT_SIZE)
|
||||||
throw new IOException("getOutputs: unexpected package length " + packet.length);
|
throw new IOException("getOutputs: unexpected package length " + packet.length);
|
||||||
sensorsHolder.grabSensorValues(packet);
|
sensorsHolder.grabSensorValues(packet);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.opensr5.ini.field.IniField;
|
||||||
import com.rusefi.NamedThreadFactory;
|
import com.rusefi.NamedThreadFactory;
|
||||||
import com.rusefi.TsTuneReader;
|
import com.rusefi.TsTuneReader;
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.config.generated.Fields;
|
||||||
|
import com.rusefi.config.generated.VariableRegistryValues;
|
||||||
import com.rusefi.tools.online.Online;
|
import com.rusefi.tools.online.Online;
|
||||||
import com.rusefi.tools.online.UploadResult;
|
import com.rusefi.tools.online.UploadResult;
|
||||||
import com.rusefi.ts_plugin.util.ManifestHelper;
|
import com.rusefi.ts_plugin.util.ManifestHelper;
|
||||||
|
@ -182,7 +183,7 @@ public class TuneUploadTab {
|
||||||
if (model.allIniFields == null)
|
if (model.allIniFields == null)
|
||||||
return;
|
return;
|
||||||
for (Map.Entry<String, IniField> field : allIniFields.entrySet()) {
|
for (Map.Entry<String, IniField> field : allIniFields.entrySet()) {
|
||||||
boolean isOnlineTuneField = field.getValue().getOffset() >= Fields.engine_configuration_s_size;
|
boolean isOnlineTuneField = field.getValue().getOffset() >= VariableRegistryValues.engine_configuration_s_size;
|
||||||
if (!isOnlineTuneField) {
|
if (!isOnlineTuneField) {
|
||||||
try {
|
try {
|
||||||
controllerAccess.getControllerParameterServer().subscribe(configurationName, field.getKey(), listener);
|
controllerAccess.getControllerParameterServer().subscribe(configurationName, field.getKey(), listener);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||||
import com.rusefi.binaryprotocol.MsqFactory;
|
import com.rusefi.binaryprotocol.MsqFactory;
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.config.generated.Fields;
|
||||||
import com.rusefi.config.generated.Integration;
|
import com.rusefi.config.generated.Integration;
|
||||||
|
import com.rusefi.config.generated.VariableRegistryValues;
|
||||||
import com.rusefi.enums.engine_type_e;
|
import com.rusefi.enums.engine_type_e;
|
||||||
import com.rusefi.tune.xml.Constant;
|
import com.rusefi.tune.xml.Constant;
|
||||||
import com.rusefi.tune.xml.Msq;
|
import com.rusefi.tune.xml.Msq;
|
||||||
|
@ -80,7 +81,7 @@ public class WriteSimulatorConfiguration {
|
||||||
Msq m = MsqFactory.valueOf(configuration, ini);
|
Msq m = MsqFactory.valueOf(configuration, ini);
|
||||||
String name = Fields.KNOCKNOISERPMBINS.getName();
|
String name = Fields.KNOCKNOISERPMBINS.getName();
|
||||||
Constant noiseRpmBins = m.page.get(1).getConstantsAsMap().get(name);
|
Constant noiseRpmBins = m.page.get(1).getConstantsAsMap().get(name);
|
||||||
if (!noiseRpmBins.getValue().contains(Fields.DEFAULT_RPM_AXIS_HIGH_VALUE + ".0"))
|
if (!noiseRpmBins.getValue().contains(VariableRegistryValues.DEFAULT_RPM_AXIS_HIGH_VALUE + ".0"))
|
||||||
throw new IllegalStateException(name + " canary wonders if everything is fine?");
|
throw new IllegalStateException(name + " canary wonders if everything is fine?");
|
||||||
m.writeXmlFile(outputXmlFileName);
|
m.writeXmlFile(outputXmlFileName);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue