Skip to content

Commit

Permalink
Replacing BackendDAE record constructors in FindZeroCrossings
Browse files Browse the repository at this point in the history
  • Loading branch information
gossen authored and OpenModelica-Hudson committed Jul 3, 2015
1 parent fbf521a commit 5691325
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions Compiler/BackEnd/FindZeroCrossings.mo
Expand Up @@ -242,22 +242,23 @@ protected function encapsulateWhenConditions_EqSystem "author: lochel"
output BackendDAE.EqSystem outEqSystem;
output Integer outIndex;
output HashTableExpToIndex.HashTable outHT;
protected
BackendDAE.Variables orderedVars;
BackendDAE.EquationArray orderedEqs;
BackendDAE.StateSets stateSets;
BackendDAE.BaseClockPartitionKind partitionKind;
list<BackendDAE.Var> varLst;
list<BackendDAE.Equation> eqnLst;
algorithm
BackendDAE.EQSYSTEM(orderedVars=orderedVars, orderedEqs=orderedEqs, stateSets=stateSets, partitionKind=partitionKind) := inEqSystem;

((orderedEqs, varLst, eqnLst, outIndex, outHT)) := BackendEquation.traverseEquationArray(orderedEqs, encapsulateWhenConditions_Equation, (BackendEquation.emptyEqns(), {}, {}, inIndex, inHT));

orderedVars := BackendVariable.addVars(varLst, orderedVars);
orderedEqs := BackendEquation.addEquations(eqnLst, orderedEqs);

outEqSystem := BackendDAEUtil.createEqSystem(orderedVars, orderedEqs, stateSets, partitionKind);
outEqSystem := match inEqSystem
local
BackendDAE.Variables orderedVars;
BackendDAE.EquationArray orderedEqs;
BackendDAE.EqSystem syst;
list<BackendDAE.Var> varLst;
list<BackendDAE.Equation> eqnLst;
case syst as BackendDAE.EQSYSTEM(orderedVars=orderedVars, orderedEqs=orderedEqs)
algorithm
((orderedEqs, varLst, eqnLst, outIndex, outHT)) :=
BackendEquation.traverseEquationArray( orderedEqs, encapsulateWhenConditions_Equation,
(BackendEquation.emptyEqns(), {}, {}, inIndex, inHT) );
syst.orderedVars := BackendVariable.addVars(varLst, orderedVars);
syst.orderedEqs := BackendEquation.addEquations(eqnLst, orderedEqs);
then BackendDAEUtil.clearEqSyst(syst);
end match;
end encapsulateWhenConditions_EqSystem;

protected function encapsulateWhenConditions_Equation "author: lochel"
Expand Down

0 comments on commit 5691325

Please sign in to comment.