Skip to content

Commit

Permalink
- Read the nested equations indexes for the nonlinear equation.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18825 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Jan 28, 2014
1 parent 8dd8228 commit a977dfc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions OMEdit/OMEditGUI/Util/OMDumpXML.cpp
Expand Up @@ -270,6 +270,7 @@ OMEquation::OMEquation(const OMEquation &eq)
else
ops.append(new OMOperation(*op));
}
eqs = eq.eqs;
}

OMEquation::~OMEquation() {
Expand Down Expand Up @@ -357,6 +358,9 @@ bool MyHandler::startElement( const QString & namespaceURI, const QString & loca
currentEquation.depends.clear();
currentEquation.index = atts.value("index").toLong();
currentEquation.kind = currentKind;
nestedEquations.clear();
} else if (qName == "eq") {
nestedEquations.append(atts.value("index").toLong());
} else if (qName == "equations" ||
qName == "jacobian-equations") {
currentKind = regular;
Expand Down Expand Up @@ -400,6 +404,7 @@ bool MyHandler::endElement( const QString & namespaceURI, const QString & localN
} else if (qName == "equation") {
currentEquation.info = currentInfo;
currentEquation.ops = operations;
currentEquation.eqs = nestedEquations;
operations.clear();
if (currentEquation.index != equations.size()) {
printf("failing: %d expect %d\n", currentEquation.index, equations.size()+1);
Expand Down
2 changes: 2 additions & 0 deletions OMEdit/OMEditGUI/Util/OMDumpXML.h
Expand Up @@ -177,6 +177,7 @@ struct OMEquation {
QStringList defines;
QStringList depends;
QList<OMOperation*> ops;
QList<int> eqs;
OMEquation();
OMEquation(const OMEquation& eq);
~OMEquation();
Expand All @@ -193,6 +194,7 @@ class MyHandler : private QXmlDefaultHandler {
private:
OMVariable currentVariable;
OMEquation currentEquation;
QList<int> nestedEquations;
OMInfo currentInfo;
OMEquationType currentKind;
QString currentText;
Expand Down

0 comments on commit a977dfc

Please sign in to comment.