Skip to content

Commit d33c2c7

Browse files
author
vimsh
committed
Added Y-Axis linking for WOT Pulls
Fixed Load Comp and MAF IAT Comp if log file is less than default table row count Fixed displayed error row index on error
1 parent 8cbdca6 commit d33c2c7

File tree

11 files changed

+509
-81
lines changed

11 files changed

+509
-81
lines changed

MafScaling.jar

12 KB
Binary file not shown.

resources/arrowr.jpg

995 Bytes
Loading

src/com/vgi/mafscaling/ExcelAdapter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ protected void onPaste(JTable table, boolean extendRows, boolean extendCols) {
430430
}
431431
}
432432
catch(Exception e) {
433+
JOptionPane.showMessageDialog(null, e.getMessage(), "Error: ", JOptionPane.ERROR_MESSAGE);
433434
e.printStackTrace();
434435
logger.error(e);
435436
}

src/com/vgi/mafscaling/LoadComp.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,16 +411,18 @@ protected boolean processLog() {
411411
xStr = logDataTable.getValueAt(i, 5).toString();
412412
yStr = logDataTable.getValueAt(i, 1).toString();
413413
valStr = logDataTable.getValueAt(i, 7).toString();
414+
if (xStr.isEmpty() && yStr.isEmpty() && valStr.isEmpty())
415+
continue;
414416
if (!Pattern.matches(Utils.fpRegex, xStr)) {
415-
JOptionPane.showMessageDialog(null, "Invalid value for MP, row " + i + 1, "Invalid value", JOptionPane.ERROR_MESSAGE);
417+
JOptionPane.showMessageDialog(null, "Invalid value for MP, row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
416418
return false;
417419
}
418420
if (!Pattern.matches(Utils.fpRegex, yStr)) {
419-
JOptionPane.showMessageDialog(null, "Invalid value for RPM, row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
421+
JOptionPane.showMessageDialog(null, "Invalid value for RPM, row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
420422
return false;
421423
}
422424
if (!Pattern.matches(Utils.fpRegex, valStr)) {
423-
JOptionPane.showMessageDialog(null, "Invalid value for Trims, row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
425+
JOptionPane.showMessageDialog(null, "Invalid value for Trims, row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
424426
return false;
425427
}
426428
x = xAxisArray.get(Utils.closestValueIndex(Double.valueOf(xStr), xAxisArray));

src/com/vgi/mafscaling/LogStats.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ else if (elements[yColIdx].matches(Utils.tmRegex))
830830
boolean passFilters = true;
831831
for (int k = 0; k < filterButtonList.size() && useFilterArr[k]; ++k) {
832832
if (!Pattern.matches(Utils.fpRegex, elements[fltrColIdxArr[k]])) {
833-
JOptionPane.showMessageDialog(null, "Invalid value for Filter " + k + ", file " + logFile.getName() + ", column " + (fltrColIdxArr[k] + 1) + ", row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
833+
JOptionPane.showMessageDialog(null, "Invalid value for Filter " + (k + 1) + ", file " + logFile.getName() + ", column " + (fltrColIdxArr[k] + 1) + ", row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
834834
return;
835835
}
836836
fltrVal = Utils.parseValue(elements[fltrColIdxArr[k]]);
@@ -842,11 +842,11 @@ else if (elements[yColIdx].matches(Utils.tmRegex))
842842
// Value should be processed
843843
if (passFilters) {
844844
if (!Pattern.matches(Utils.fpRegex, elements[xColIdx]) && !Pattern.matches(Utils.onOffRegex, elements[xColIdx])) {
845-
JOptionPane.showMessageDialog(null, "Invalid value for X-Axis, file " + logFile.getName() + ", column " + (xColIdx + 1) + ", row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
845+
JOptionPane.showMessageDialog(null, "Invalid value for X-Axis, file " + logFile.getName() + ", column " + (xColIdx + 1) + ", row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
846846
return;
847847
}
848848
if (!Pattern.matches(Utils.fpRegex, elements[yColIdx]) && !Pattern.matches(Utils.onOffRegex, elements[yColIdx])) {
849-
JOptionPane.showMessageDialog(null, "Invalid value for Y-Axis, file " + logFile.getName() + ", column " + (yColIdx + 1) + ", row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
849+
JOptionPane.showMessageDialog(null, "Invalid value for Y-Axis, file " + logFile.getName() + ", column " + (yColIdx + 1) + ", row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
850850
return;
851851
}
852852
skip = false;
@@ -907,7 +907,7 @@ else if (elements[yColIdx].matches(Utils.tmRegex))
907907
val = 0;
908908
for (Integer vColIdx : vColIdxArray) {
909909
if (!Pattern.matches(Utils.fpRegex, elements[vColIdx]) && !Pattern.matches(Utils.onOffRegex, elements[vColIdx])) {
910-
JOptionPane.showMessageDialog(null, "Invalid value for Data, file " + logFile.getName() + ", column " + (vColIdx + 1) + ", row " + i, "Invalid value", JOptionPane.ERROR_MESSAGE);
910+
JOptionPane.showMessageDialog(null, "Invalid value for Data, file " + logFile.getName() + ", column " + (vColIdx + 1) + ", row " + (i + 1), "Invalid value", JOptionPane.ERROR_MESSAGE);
911911
return;
912912
}
913913
val += Utils.parseValue(elements[vColIdx]);

0 commit comments

Comments
 (0)