Some Trick jobs are labeled "simobject.classPtr->Foo()" trick_dp barfs on the "->" string

The "->" string interferes with some code in quick plot trying to split array ranges into
individual variables.  The old code only tested for the '-' character.  Changed these
checks to regular expressions that only match '-' if it is not followed by '>'.  Also
converted tabs to spaces throughout the file, hence the big diff.

refs #51
This commit is contained in:
Alex Lin
2016-06-30 15:35:23 -05:00
parent 595feb280b
commit 48ad85d0af

View File

@ -351,16 +351,7 @@ public class TrickQPActionController {
for (int i = 0; i < selectedVars.length; i++) {
LogVar varFrom = (LogVar)selectedVars[i];
if (varFrom.getName().indexOf('-') != -1) {
// arrayed variable
/***
if (varFrom.getName().indexOf('-') < varFrom.getName().lastIndexOf('-')) {
JOptionPane.showMessageDialog(application.getMainFrame(),
"Too many ranged dimensions. \nPlease use Expand Var to get to one ranged dimension\n" +
"(or to a singular variable with no ranges).",
"Error", JOptionPane.WARNING_MESSAGE);
return;
}***/
if (varFrom.getName().matches("-(?!>)")) {
List<String> vars = get_components_from_array(varFrom.getName()); // expand variable
if ( (selectedTreeNodes!=null) && (selectedTreeNodes.size()>0)
&& (((CommonTreeNode)selectedTreeNodes.get(0)).getNodeType()!=CommonTreeNode.PLOTS_NODE) ) {
@ -591,7 +582,7 @@ public class TrickQPActionController {
public List<String> get_components_from_array(String arrayvar) {
// MAX_DIMENSIONS is how many ranges we can handle splitting in a variable
final int MAX_DIMENSIONS = 3;
String[] parts = arrayvar.split("-");
String[] parts = arrayvar.split("-(?!>)");
int numparts = parts.length;
if (numparts==1) {
// no range to split
@ -1564,7 +1555,6 @@ public class TrickQPActionController {
application.productTree.addNode(application.plotsNode, pageNode, true);
return pageNode;
}
/**
* Helper method for adding a new var to a table column.
*/