Console should get much smarter around compatibility with older units #6845
only:progress
This commit is contained in:
parent
f65cc7d6e7
commit
dc97951d27
|
@ -7,6 +7,6 @@ import com.rusefi.tune.xml.Msq;
|
||||||
|
|
||||||
public class MsqFactory {
|
public class MsqFactory {
|
||||||
public static Msq valueOf(ConfigurationImage image, IniFileModel ini) {
|
public static Msq valueOf(ConfigurationImage image, IniFileModel ini) {
|
||||||
return Msq.valueOf(image, Fields.TOTAL_CONFIG_SIZE, Fields.TS_SIGNATURE, ini);
|
return Msq.valueOf(image, ini.getMetaInfo().getTotalSize(), Fields.TS_SIGNATURE, ini);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.rusefi.binaryprotocol.test;
|
package com.rusefi.binaryprotocol.test;
|
||||||
|
|
||||||
import com.opensr5.ConfigurationImage;
|
import com.opensr5.ConfigurationImage;
|
||||||
|
import com.opensr5.ini.IniFileModel;
|
||||||
import com.opensr5.ini.field.ScalarIniField;
|
import com.opensr5.ini.field.ScalarIniField;
|
||||||
import com.rusefi.TestHelper;
|
import com.rusefi.TestHelper;
|
||||||
import com.rusefi.binaryprotocol.BinaryProtocolState;
|
import com.rusefi.binaryprotocol.BinaryProtocolState;
|
||||||
|
@ -23,8 +24,10 @@ class BinaryProtocolServerSandbox {
|
||||||
// if (!f.exists())
|
// if (!f.exists())
|
||||||
// throw new IllegalStateException("File not found: " + BinaryProtocolServer.TEST_FILE);
|
// throw new IllegalStateException("File not found: " + BinaryProtocolServer.TEST_FILE);
|
||||||
|
|
||||||
|
IniFileModel model = IniFileModel.getInstance();
|
||||||
|
|
||||||
BinaryProtocolState state = new BinaryProtocolState();
|
BinaryProtocolState state = new BinaryProtocolState();
|
||||||
ConfigurationImage controller = new ConfigurationImage(new byte[Fields.TOTAL_CONFIG_SIZE]);
|
ConfigurationImage controller = new ConfigurationImage(new byte[model.getMetaInfo().getTotalSize()]);
|
||||||
ScalarIniField iniField = TestHelper.createIniField(Fields.TWOSTROKE);
|
ScalarIniField iniField = TestHelper.createIniField(Fields.TWOSTROKE);
|
||||||
iniField.setValue(controller, new Constant(iniField.getName(), "", "1", iniField.getDigits()));
|
iniField.setValue(controller, new Constant(iniField.getName(), "", "1", iniField.getDigits()));
|
||||||
state.setController(controller);
|
state.setController(controller);
|
||||||
|
|
Loading…
Reference in New Issue