Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 1600 → Rev 1601

/dongfang_FC_rewrite_tool/src/dongfang/mkt/configuration/ConfigSet.java
258,8 → 258,13
return declaredSections;
}
 
public void setData(int[] data) {
public void setData(int[] data) throws IOException {
int offset = 0;
int dataLength = data.length - 12;
if (dataLength != getByteCount()) {
throw new IOException("The received number of databytes (" + dataLength + ") was not equal to the length of the declared parameter set(" + getByteCount()+").");
}
for (ConfigEntry entry : entries) {
offset += entry.setValue(data, offset);
}
323,6 → 328,10
"/parametertemplate/@eepromVersion", doc);
int eepromVersion = Integer.parseInt(s_eepromVersion);
 
String s_declaredLength = xpath.evaluate(
"/parametertemplate/@length", doc);
int declaredLength = Integer.parseInt(s_declaredLength);
 
if (eepromVersion != version) {
throw new IOException(
"Version mismatch between file name ("
406,6 → 415,9
}
}
result.name = "" + version;
if (result.getByteCount() != declaredLength) {
throw new IOException("The number of parameters in the set (" + result.getEntries().size() + ") was not equal to the declared length (" + declaredLength + ").");
}
return result;
} catch (IOException ex) {
throw ex;