This commit is contained in:
parent
6a704897bb
commit
d3fe455b1b
|
@ -50,7 +50,7 @@ public class ArrayIniField extends IniField {
|
|||
public String getValue(ConfigurationImage image) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int rowIndex = 0; rowIndex < rows; rowIndex++) {
|
||||
sb.append("\n\t");
|
||||
sb.append("\n ");
|
||||
for (int colIndex = 0; colIndex < cols; colIndex++) {
|
||||
Field f = new Field("", getOffset(rowIndex, colIndex), getType());
|
||||
sb.append(' ');
|
||||
|
|
|
@ -8,6 +8,8 @@ public class Constant {
|
|||
private String units;
|
||||
private String value;
|
||||
private String digits;
|
||||
private String rows;
|
||||
private String cols;
|
||||
|
||||
public Constant() {
|
||||
}
|
||||
|
@ -39,6 +41,24 @@ public class Constant {
|
|||
return digits;
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
public String getRows() {
|
||||
return rows;
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
public String getCols() {
|
||||
return cols;
|
||||
}
|
||||
|
||||
public void setCols(String cols) {
|
||||
this.cols = cols;
|
||||
}
|
||||
|
||||
public void setRows(String rows) {
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
public void setDigits(String digits) {
|
||||
this.digits = digits;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.rusefi.tune.xml;
|
|||
import com.devexperts.logging.Logging;
|
||||
import com.opensr5.ConfigurationImage;
|
||||
import com.opensr5.ini.IniFileModel;
|
||||
import com.opensr5.ini.field.ArrayIniField;
|
||||
import com.opensr5.ini.field.IniField;
|
||||
import com.rusefi.xml.XmlUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
@ -82,10 +83,20 @@ public class Msq {
|
|||
String value = field.getValue(image);
|
||||
Page page = findPage();
|
||||
if (page == null) {
|
||||
System.out.println("Msq: No page");
|
||||
log.error("Msq: No page");
|
||||
return;
|
||||
}
|
||||
page.constant.add(new Constant(field.getName(), field.getUnits(), value, field.getDigits()));
|
||||
if (value.isEmpty()) {
|
||||
log.debug("Skipping " + field.getName());
|
||||
return;
|
||||
}
|
||||
Constant constant = new Constant(field.getName(), field.getUnits(), value, field.getDigits());
|
||||
page.constant.add(constant);
|
||||
if (field instanceof ArrayIniField) {
|
||||
ArrayIniField arrayIniField = (ArrayIniField) field;
|
||||
constant.setCols(Integer.toString(arrayIniField.getCols()));
|
||||
constant.setRows(Integer.toString(arrayIniField.getRows()));
|
||||
}
|
||||
}
|
||||
|
||||
public Page findPage() {
|
||||
|
|
Loading…
Reference in New Issue