Skip to content

Commit

Permalink
Added Y-Axis linking for WOT Pulls
Browse files Browse the repository at this point in the history
Fixed Load Comp and MAF IAT Comp if log file is less than default table row count
Fixed displayed error row index on error
  • Loading branch information
vimsh committed Feb 10, 2018
1 parent 8cbdca6 commit d33c2c7
Show file tree
Hide file tree
Showing 11 changed files with 509 additions and 81 deletions.
Binary file modified MafScaling.jar
Binary file not shown.
Binary file added resources/arrowr.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/com/vgi/mafscaling/ExcelAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ protected void onPaste(JTable table, boolean extendRows, boolean extendCols) {
}
}
catch(Exception e) {
JOptionPane.showMessageDialog(null, e.getMessage(), "Error: ", JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
logger.error(e);
}
Expand Down
8 changes: 5 additions & 3 deletions src/com/vgi/mafscaling/LoadComp.java
Original file line number Diff line number Diff line change
Expand Up @@ -411,16 +411,18 @@ protected boolean processLog() {
xStr = logDataTable.getValueAt(i, 5).toString();
yStr = logDataTable.getValueAt(i, 1).toString();
valStr = logDataTable.getValueAt(i, 7).toString();
if (xStr.isEmpty() && yStr.isEmpty() && valStr.isEmpty())
continue;
if (!Pattern.matches(Utils.fpRegex, xStr)) {
JOptionPane.showMessageDialog(null, "Invalid value for MP, row " + i + 1, "Invalid value", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, "Invalid value for MP, row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
return false;
}
if (!Pattern.matches(Utils.fpRegex, yStr)) {
JOptionPane.showMessageDialog(null, "Invalid value for RPM, row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, "Invalid value for RPM, row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
return false;
}
if (!Pattern.matches(Utils.fpRegex, valStr)) {
JOptionPane.showMessageDialog(null, "Invalid value for Trims, row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, "Invalid value for Trims, row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
return false;
}
x = xAxisArray.get(Utils.closestValueIndex(Double.valueOf(xStr), xAxisArray));
Expand Down
8 changes: 4 additions & 4 deletions src/com/vgi/mafscaling/LogStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ else if (elements[yColIdx].matches(Utils.tmRegex))
boolean passFilters = true;
for (int k = 0; k < filterButtonList.size() && useFilterArr[k]; ++k) {
if (!Pattern.matches(Utils.fpRegex, elements[fltrColIdxArr[k]])) {
JOptionPane.showMessageDialog(null, "Invalid value for Filter " + k + ", file " + logFile.getName() + ", column " + (fltrColIdxArr[k] + 1) + ", row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, "Invalid value for Filter " + (k + 1) + ", file " + logFile.getName() + ", column " + (fltrColIdxArr[k] + 1) + ", row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
return;
}
fltrVal = Utils.parseValue(elements[fltrColIdxArr[k]]);
Expand All @@ -842,11 +842,11 @@ else if (elements[yColIdx].matches(Utils.tmRegex))
// Value should be processed
if (passFilters) {
if (!Pattern.matches(Utils.fpRegex, elements[xColIdx]) && !Pattern.matches(Utils.onOffRegex, elements[xColIdx])) {
JOptionPane.showMessageDialog(null, "Invalid value for X-Axis, file " + logFile.getName() + ", column " + (xColIdx + 1) + ", row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, "Invalid value for X-Axis, file " + logFile.getName() + ", column " + (xColIdx + 1) + ", row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
return;
}
if (!Pattern.matches(Utils.fpRegex, elements[yColIdx]) && !Pattern.matches(Utils.onOffRegex, elements[yColIdx])) {
JOptionPane.showMessageDialog(null, "Invalid value for Y-Axis, file " + logFile.getName() + ", column " + (yColIdx + 1) + ", row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, "Invalid value for Y-Axis, file " + logFile.getName() + ", column " + (yColIdx + 1) + ", row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
return;
}
skip = false;
Expand Down Expand Up @@ -907,7 +907,7 @@ else if (elements[yColIdx].matches(Utils.tmRegex))
val = 0;
for (Integer vColIdx : vColIdxArray) {
if (!Pattern.matches(Utils.fpRegex, elements[vColIdx]) && !Pattern.matches(Utils.onOffRegex, elements[vColIdx])) {
JOptionPane.showMessageDialog(null, "Invalid value for Data, file " + logFile.getName() + ", column " + (vColIdx + 1) + ", row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, "Invalid value for Data, file " + logFile.getName() + ", column " + (vColIdx + 1) + ", row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
return;
}
val += Utils.parseValue(elements[vColIdx]);
Expand Down
Loading

0 comments on commit d33c2c7

Please sign in to comment.