From 1554509dda8ea893e7f345a6b46557863d227fdb Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 22 Jun 2020 23:17:23 -0400 Subject: [PATCH] REO progress more bugfixing --- java_console/inifile/src/com/rusefi/tune/xml/Msq.java | 10 ++++++++-- .../src/com/rusefi/ts_plugin/TuneUploder.java | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/java_console/inifile/src/com/rusefi/tune/xml/Msq.java b/java_console/inifile/src/com/rusefi/tune/xml/Msq.java index fc44b5c9aa..b4fce510bf 100644 --- a/java_console/inifile/src/com/rusefi/tune/xml/Msq.java +++ b/java_console/inifile/src/com/rusefi/tune/xml/Msq.java @@ -31,11 +31,17 @@ public class Msq { @NotNull public static Msq valueOf(ConfigurationImage image) { IniFileModel ini = IniFileModel.getInstance(); + Msq tune = create(); + for (String key : ini.allIniFields.keySet()) + tune.loadConstant(ini, key, image); + return tune; + } + + @NotNull + public static Msq create() { Msq tune = new Msq(); tune.page.add(new Page(null, null)); tune.page.add(new Page(0, Fields.TOTAL_CONFIG_SIZE)); - for (String key : ini.allIniFields.keySet()) - tune.loadConstant(ini, key, image); return tune; } diff --git a/java_tools/ts_plugin/src/com/rusefi/ts_plugin/TuneUploder.java b/java_tools/ts_plugin/src/com/rusefi/ts_plugin/TuneUploder.java index 441e161f32..ae39db8947 100644 --- a/java_tools/ts_plugin/src/com/rusefi/ts_plugin/TuneUploder.java +++ b/java_tools/ts_plugin/src/com/rusefi/ts_plugin/TuneUploder.java @@ -7,6 +7,7 @@ import com.efiAnalytics.plugin.ecu.servers.ControllerParameterServer; import com.rusefi.TsTuneReader; import com.rusefi.tune.xml.Constant; import com.rusefi.tune.xml.Msq; +import com.rusefi.tune.xml.Page; import org.jetbrains.annotations.NotNull; import javax.xml.bind.JAXBException; @@ -17,7 +18,7 @@ import java.util.TreeMap; public class TuneUploder { static Msq writeCurrentTune(ControllerAccess controllerAccess, String configurationName) { - Msq msq = new Msq(); + Msq msq = Msq.create(); ControllerParameterServer controllerParameterServer = controllerAccess.getControllerParameterServer(); Map fileSystemValues = getFileSystemValues(configurationName); @@ -79,7 +80,8 @@ public class TuneUploder { value = cp.getStringValue(); } - msq.findPage().constant.add(new Constant(parameterName, cp.getUnits(), value)); + Page page = msq.findPage(); + page.constant.add(new Constant(parameterName, cp.getUnits(), value)); } private static String getArrayValue(double[][] arrayValues) {