mirror of
https://github.com/nasa/trick.git
synced 2025-06-18 15:18:18 +00:00
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:
@ -351,16 +351,7 @@ public class TrickQPActionController {
|
|||||||
|
|
||||||
for (int i = 0; i < selectedVars.length; i++) {
|
for (int i = 0; i < selectedVars.length; i++) {
|
||||||
LogVar varFrom = (LogVar)selectedVars[i];
|
LogVar varFrom = (LogVar)selectedVars[i];
|
||||||
if (varFrom.getName().indexOf('-') != -1) {
|
if (varFrom.getName().matches("-(?!>)")) {
|
||||||
// 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;
|
|
||||||
}***/
|
|
||||||
List<String> vars = get_components_from_array(varFrom.getName()); // expand variable
|
List<String> vars = get_components_from_array(varFrom.getName()); // expand variable
|
||||||
if ( (selectedTreeNodes!=null) && (selectedTreeNodes.size()>0)
|
if ( (selectedTreeNodes!=null) && (selectedTreeNodes.size()>0)
|
||||||
&& (((CommonTreeNode)selectedTreeNodes.get(0)).getNodeType()!=CommonTreeNode.PLOTS_NODE) ) {
|
&& (((CommonTreeNode)selectedTreeNodes.get(0)).getNodeType()!=CommonTreeNode.PLOTS_NODE) ) {
|
||||||
@ -591,7 +582,7 @@ public class TrickQPActionController {
|
|||||||
public List<String> get_components_from_array(String arrayvar) {
|
public List<String> get_components_from_array(String arrayvar) {
|
||||||
// MAX_DIMENSIONS is how many ranges we can handle splitting in a variable
|
// MAX_DIMENSIONS is how many ranges we can handle splitting in a variable
|
||||||
final int MAX_DIMENSIONS = 3;
|
final int MAX_DIMENSIONS = 3;
|
||||||
String[] parts = arrayvar.split("-");
|
String[] parts = arrayvar.split("-(?!>)");
|
||||||
int numparts = parts.length;
|
int numparts = parts.length;
|
||||||
if (numparts==1) {
|
if (numparts==1) {
|
||||||
// no range to split
|
// no range to split
|
||||||
@ -1564,7 +1555,6 @@ public class TrickQPActionController {
|
|||||||
application.productTree.addNode(application.plotsNode, pageNode, true);
|
application.productTree.addNode(application.plotsNode, pageNode, true);
|
||||||
return pageNode;
|
return pageNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method for adding a new var to a table column.
|
* Helper method for adding a new var to a table column.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user