@@ -12617,6 +12617,41 @@ algorithm
1261712617 simEqs := List.map1(bEqs,getSimEqsForBackendEqs,map);
1261812618end getSimEqsOfSimVar;
1261912619
12620+ public function getReqSimEqSysForSimVar
12621+ input Integer simVar;
12622+ input SimCode.SimCode simCode;
12623+ output list<SimCode.SimEqSystem> ses;
12624+ protected
12625+ list<Integer> sesIdcs;
12626+ list<SimCode.SimEqSystem> sesLst;
12627+ SimCode.BackendMapping bmap;
12628+ Option<SimCode.BackendMapping> bmapOpt;
12629+ algorithm
12630+ SimCode.SIMCODE(allEquations=sesLst, backendMapping=bmapOpt) := simCode;
12631+ bmap := Util.getOption(bmapOpt);
12632+ sesIdcs := getReqSimEqsForSimVar(simVar,bmap);
12633+ ses := List.map1(sesIdcs,getSimEqSysForIndex,sesLst);
12634+ end getReqSimEqSysForSimVar;
12635+
12636+ protected function getSimEqSysForIndex
12637+ input Integer idx;
12638+ input list<SimCode.SimEqSystem> allSimEqs;
12639+ output SimCode.SimEqSystem outSimEq;
12640+ algorithm
12641+ outSimEq :=List.getMemberOnTrue(idx,allSimEqs,indexIsEqual);
12642+ end getSimEqSysForIndex;
12643+
12644+ protected function indexIsEqual
12645+ input Integer idx;
12646+ input SimCode.SimEqSystem ses;
12647+ output Boolean b;
12648+ protected
12649+ Integer idx2;
12650+ algorithm
12651+ idx2 := equationIndex(ses);
12652+ b := intEq(idx,idx2);
12653+ end indexIsEqual;
12654+
1262012655public function getReqSimEqsForSimVar"outputs the indeces for the required simEqSys for the indexed SimVar
1262112656author:Waurich TUD 2014-04"
1262212657 input Integer simVar;
0 commit comments