Skip to content

Commit

Permalink
Treat previous like der variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke committed Oct 24, 2016
1 parent 7d9bfdc commit ead44e7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions OMEdit/OMEditGUI/Plotting/VariablesWidget.cpp
Expand Up @@ -512,6 +512,10 @@ void VariablesTreeModel::insertVariablesItems(QString fileName, QString filePath
QString str = plotVariable;
str.chop((str.lastIndexOf("der(")/4)+1);
variables = StringHandler::makeVariableParts(str.mid(str.lastIndexOf("der(") + 4));
} else if (plotVariable.startsWith("previous(")) {
QString str = plotVariable;
str.chop((str.lastIndexOf("previous(")/9)+1);
variables = StringHandler::makeVariableParts(str.mid(str.lastIndexOf("previous(") + 9));
} else {
variables = StringHandler::makeVariableParts(plotVariable);
}
Expand All @@ -525,6 +529,8 @@ void VariablesTreeModel::insertVariablesItems(QString fileName, QString filePath
/* if last item */
if (variables.size() == count && plotVariable.startsWith("der(")) {
findVariable = parentVariable.isEmpty() ? fileName + ".der(" + variable + ")" : fileName + "." + parentVariable + ".der(" + variable + ")";
} else if (variables.size() == count && plotVariable.startsWith("previous(")) {
findVariable = parentVariable.isEmpty() ? fileName + ".previous(" + variable + ")" : fileName + "." + parentVariable + ".previous(" + variable + ")";
} else {
findVariable = parentVariable.isEmpty() ? fileName + "." + variable : fileName + "." + parentVariable + "." + variable;
}
Expand All @@ -550,6 +556,8 @@ void VariablesTreeModel::insertVariablesItems(QString fileName, QString filePath
/* if last item */
if (variables.size() == count && plotVariable.startsWith("der(")) {
variableData << filePath << fileName << fileName + "." + plotVariable << "der(" + variable + ")";
} else if (variables.size() == count && plotVariable.startsWith("previous(")) {
variableData << filePath << fileName << fileName + "." + plotVariable << "previous(" + variable + ")";
} else {
variableData << filePath << fileName << pParentVariablesTreeItem->getVariableName() + "." + variable << variable;
}
Expand Down

0 comments on commit ead44e7

Please sign in to comment.