REO progress

more bugfixing
This commit is contained in:
rusefi 2020-06-22 23:17:23 -04:00
parent 3be0b3326c
commit 1554509dda
2 changed files with 12 additions and 4 deletions

View File

@ -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;
}

View File

@ -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<String, Constant> 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) {