Skip to content

Commit

Permalink
18/01/2020 : Ameliorations mineures et correction de bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanglinard26 committed Jan 18, 2020
1 parent eee338b commit 157af18
Show file tree
Hide file tree
Showing 3 changed files with 493 additions and 450 deletions.
4 changes: 2 additions & 2 deletions A2LParser/src/a2l/A2l.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public final void parse(File a2lFile) {

this.name = a2lFile.getName().substring(0, a2lFile.getName().length() - 4);

fireStateChanged("Start of parsing");
fireStateChanged("Loading file : " + a2lFile.getAbsolutePath());

try (BufferedReader buf = new BufferedReader(new FileReader(a2lFile))) {

Expand Down Expand Up @@ -321,7 +321,7 @@ private final List<String> parseLineWithRegex(Pattern regexQuote, String line) {
final String lineWoutComment;

if (line.indexOf("/*") > -1 || line.indexOf("*/") > -1 || line.indexOf("//") > -1) {
lineWoutComment = ParserUtils.LINE_COMMENT.matcher(line).replaceAll("");
lineWoutComment = ParserUtils.LINE_COMMENT.matcher(line).replaceAll("").trim();
if (lineWoutComment.length() == 0) {
return listWord;
}
Expand Down
24 changes: 18 additions & 6 deletions A2LParser/src/a2l/Characteristic.java
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,26 @@ public Double[] getResolution() {
tabResol = new Double[3];

cmX = this.axisDescrs.get(0).getCompuMethod();
val0 = formatValue(cmX.compute(1), this.axisDescrs.get(0).getNbDecimal());
val1 = formatValue(cmX.compute(2), this.axisDescrs.get(0).getNbDecimal());
tabResol[0] = ConversionType.TAB_VERB.compareTo(cmX.getConversionType()) != 0 ? val1 - val0 : Double.NaN;
if(cmX!= null)
{
val0 = formatValue(cmX.compute(1), this.axisDescrs.get(0).getNbDecimal());
val1 = formatValue(cmX.compute(2), this.axisDescrs.get(0).getNbDecimal());
tabResol[0] = ConversionType.TAB_VERB.compareTo(cmX.getConversionType()) != 0 ? val1 - val0 : Double.NaN;
}else{
tabResol[0] = Double.NaN;
}


cmY = this.axisDescrs.get(1).getCompuMethod();
val0 = formatValue(cmY.compute(1), this.axisDescrs.get(1).getNbDecimal());
val1 = formatValue(cmY.compute(2), this.axisDescrs.get(1).getNbDecimal());
tabResol[1] = ConversionType.TAB_VERB.compareTo(cmY.getConversionType()) != 0 ? val1 - val0 : Double.NaN;
if(cmY!= null)
{
val0 = formatValue(cmY.compute(1), this.axisDescrs.get(1).getNbDecimal());
val1 = formatValue(cmY.compute(2), this.axisDescrs.get(1).getNbDecimal());
tabResol[1] = ConversionType.TAB_VERB.compareTo(cmY.getConversionType()) != 0 ? val1 - val0 : Double.NaN;
}else{
tabResol[1] = Double.NaN;
}


val0 = formatValue(this.compuMethod.compute(1), getNbDecimal());
val1 = formatValue(this.compuMethod.compute(2), getNbDecimal());
Expand Down
Loading

0 comments on commit 157af18

Please sign in to comment.