Skip to content

Commit

Permalink
Fixed bug in WOT Best VVT tab - validation error on paste into VVT ta…
Browse files Browse the repository at this point in the history
…bles
  • Loading branch information
vimsh committed Jun 9, 2017
1 parent 7f89361 commit 1ded706
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
Binary file modified MafScaling.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/com/vgi/mafscaling/MafScaling.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

public class MafScaling {
private static final Logger logger = Logger.getLogger(MafScaling.class);
private static final String Title = "MAF Scaling - v2.4.0";
private static final String Title = "MAF Scaling - v2.4.1";
private static final String OLTabName = "<html>Open Loop</html>";
private static final String CLTabName = "<html>Closed Loop</html>";
private static final String MRTabName = "<html>MAF Rescale</html>";
Expand Down
22 changes: 22 additions & 0 deletions src/com/vgi/mafscaling/VVTCalc.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.ResourceBundle;
import java.util.regex.Pattern;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
Expand Down Expand Up @@ -964,6 +966,26 @@ else if ('B' == mapUnit)
protected boolean getAxisData() {
return true;
}

protected boolean validateTable(JTable table) {
if ((table == origTable || table == newTable) && !Utils.isTableEmpty(table)) {
if (!Utils.isTableEmpty(table)) {
for (int i = table.getRowCount() - 1; i >= 0 && table.getValueAt(i, 0).toString().equals(""); --i)
Utils.removeRow(i, table);
if (table.getValueAt(0, 0).toString().isEmpty())
Utils.removeRow(0, table);
Utils.colorTable(table);
for (int i = 0; i < table.getRowCount(); ++i) {
if (!Pattern.matches(Utils.fpRegex, table.getValueAt(i, 0).toString())) {
JOptionPane.showMessageDialog(null, "Invalid value at row " + i, "Error", JOptionPane.ERROR_MESSAGE);
return false;
}
}
}
return true;
}
return Utils.validateTable(table);
}

protected boolean processLog() {
try {
Expand Down

0 comments on commit 1ded706

Please sign in to comment.