REO progress
This commit is contained in:
parent
1a7154647e
commit
7178491200
|
@ -3,6 +3,7 @@ package com.rusefi.tune.xml;
|
|||
import com.opensr5.ConfigurationImage;
|
||||
import com.opensr5.ini.IniFileModel;
|
||||
import com.opensr5.ini.field.IniField;
|
||||
import com.rusefi.config.Field;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.ui.storage.PersistentConfiguration;
|
||||
import com.rusefi.xml.XmlUtil;
|
||||
|
@ -12,13 +13,15 @@ import javax.xml.bind.JAXBException;
|
|||
import javax.xml.bind.annotation.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@XmlRootElement
|
||||
public class Msq {
|
||||
public static final String outputXmlFileName = PersistentConfiguration.RUSEFI_SETTINGS_FOLDER + File.separator + "output.msq";
|
||||
|
||||
private Page page = new Page();
|
||||
public List<Page> page = new ArrayList<>();
|
||||
|
||||
private final VersionInfo versionInfo;
|
||||
|
||||
|
@ -30,6 +33,8 @@ public class Msq {
|
|||
public static Msq valueOf(ConfigurationImage image) {
|
||||
IniFileModel ini = IniFileModel.getInstance();
|
||||
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;
|
||||
|
@ -74,13 +79,8 @@ public class Msq {
|
|||
return versionInfo;
|
||||
}
|
||||
|
||||
@XmlElement
|
||||
public Page getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(Page page) {
|
||||
this.page = page;
|
||||
private Page getPage() {
|
||||
return page.get(1);
|
||||
}
|
||||
|
||||
@XmlElement
|
||||
|
|
|
@ -1,21 +1,48 @@
|
|||
package com.rusefi.tune.xml;
|
||||
|
||||
import com.rusefi.config.generated.Fields;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Page {
|
||||
public final List<Constant> constant = new ArrayList<>();
|
||||
public final List<PcVariable> pcVariable = new ArrayList<>();
|
||||
|
||||
@XmlAttribute
|
||||
public int getNumber() {
|
||||
return 0;
|
||||
private Integer number;
|
||||
private Integer size;
|
||||
|
||||
public Page() {
|
||||
}
|
||||
|
||||
public Page(Integer number, Integer size) {
|
||||
this.number = number;
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
public int getSize() {
|
||||
return Fields.TOTAL_CONFIG_SIZE;
|
||||
public Integer getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(Integer number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
public Integer getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(Integer size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Page{" +
|
||||
"constant.size=" + constant.size() +
|
||||
", number=" + number +
|
||||
", size=" + size +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package com.rusefi.tune.xml;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlValue;
|
||||
|
||||
public class PcVariable {
|
||||
private String name;
|
||||
private String value;
|
||||
|
||||
@XmlAttribute
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@XmlValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PcVariable{" +
|
||||
"name='" + name + '\'' +
|
||||
", value='" + value + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -74,7 +74,7 @@ public class ConsoleTools {
|
|||
public static void main(String[] args) throws Exception {
|
||||
System.out.println(Arrays.toString(new File(".").list()));
|
||||
System.setProperty("ini_file_path", "../firmware/tunerstudio");
|
||||
calcBinaryImageTuneCrc(null, "current_configuration.rusefi_binary");
|
||||
// calcBinaryImageTuneCrc(null, "current_configuration.rusefi_binary");
|
||||
|
||||
calcXmlImageTuneCrc(null, "CurrentTune.msq");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue