﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2624	missing elseif branch	Volker Waurich	Per Östlund	"I have some problems when evaluating (I want to implement a partially function evaluation module) the function Modelica.Electrical.Spice3.Internal.Mos.mosCalcNoBypassCode which occurs in the Inverter model from the msl.(find a smaller version of this model in testsuite\modelica\functions_eval\Inverter2.mo)

There are 3 if statements including an elseif in this function. the first one is:

{{{
  if ( SpiceRoot.useInitialConditions())    and (in_m.m_dICVBSIsGiven >0.5) then
    int_c.m_vbs := in_m_type * in_m.m_dICVBS;
  elseif ( SpiceRoot.initJunctionVoltages()) then
    int_c.m_vbs := if (in_m.m_off >0.5) then 0. else int_c.m_VBScrit;
  end if;
}}}

The DAE.Statement.STMT_IF is correct but there is a DAE.Else.NOELSE instead of an DAE.Else.ELSEIF. So the elseif branch is ignored. Also in the *_functions.c you'll only find:
{{{
tmp2 = omc_Modelica_Electrical_Spice3_Internal_SpiceRoot_useInitialConditions(threadData);
  if((tmp2.c1 && (_in_m._m_dICVBSIsGiven > 0.5)))
  {
    _int_c._m_vbs = (((modelica_real)(modelica_integer)_in_m_type) * _in_m._m_dICVBS);
  }
}}}

This occurs already in SimCodeMain.translateModel in the Env.Cache.functions structure. So this is possibly a frontend issue.


Could somebody have a look on that or give me a hint where to fix this?
"	defect	closed	normal	1.16.0	New Instantiation	trunk	fixed	elseif	Per Östlund Adrian Pop Christian Schubert Jens Frenkel Lennart Ochel
