diff --git a/OMCompiler/Compiler/BackEnd/BackendVariable.mo b/OMCompiler/Compiler/BackEnd/BackendVariable.mo index b118fb7e98f..d80fa64f33d 100644 --- a/OMCompiler/Compiler/BackEnd/BackendVariable.mo +++ b/OMCompiler/Compiler/BackEnd/BackendVariable.mo @@ -2042,18 +2042,20 @@ algorithm kind := getVarKind(var); end getVarKindForVar; -public function isVarOnTopLevelAndOutput "and has the DAE.VarDirection = OUTPUT - The check for top-model is done by spliting the name at \'.\' and - check if the list-length is 1" +public function isVarOnTopLevelAndOutput "has the DAE.VarDirection = OUTPUT + Don't check for top level here as this is done by NFConvertDAE.makeDAEVar. + Otherwise the list of model variables may contradict with model structure, e.g. with --nonStdExposeLocalIOs." input BackendDAE.Var inVar; - output Boolean outBoolean = DAEUtil.topLevelOutput(inVar.varName, inVar.varDirection, inVar.connectorType); + //output Boolean outBoolean = DAEUtil.topLevelOutput(inVar.varName, inVar.varDirection, inVar.connectorType); + output Boolean outBoolean = isOutputVar(inVar); end isVarOnTopLevelAndOutput; -public function isVarOnTopLevelAndInput "and has the DAE.VarDirection = INPUT - The check for top-model is done by splitting the name at '.' and checking if - the list-length is 1." +public function isVarOnTopLevelAndInput "has the DAE.VarDirection = INPUT + Don't check for top level here as this is done by NFConvertDAE.makeDAEVar. + Otherwise the list of model variables may contradict with model structure, e.g. with --nonStdExposeLocalIOs." input BackendDAE.Var inVar; - output Boolean outBoolean = DAEUtil.topLevelInput(inVar.varName, inVar.varDirection, inVar.connectorType); + //output Boolean outBoolean = DAEUtil.topLevelInput(inVar.varName, inVar.varDirection, inVar.connectorType); + output Boolean outBoolean = isInput(inVar); end isVarOnTopLevelAndInput; public function isVarOnTopLevelAndInputNoDerInput diff --git a/testsuite/openmodelica/cppruntime/fmu/modelExchange/2.0/exposeLocalIOs.mos b/testsuite/openmodelica/cppruntime/fmu/modelExchange/2.0/exposeLocalIOs.mos index 01df9bb9fd3..faacae6f042 100644 --- a/testsuite/openmodelica/cppruntime/fmu/modelExchange/2.0/exposeLocalIOs.mos +++ b/testsuite/openmodelica/cppruntime/fmu/modelExchange/2.0/exposeLocalIOs.mos @@ -95,8 +95,7 @@ readFile("modelDescription.tmp.xml"); // true // "" // "LocalIOs.System.fmu" -// "Warning: The initial conditions are not fully specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->Show additional information from the initialization process, in OMNotebook call setCommandLineOptions(\"-d=initialization\"). -// " +// "" // 0 // " // // // -// +// name=\"component.measurement\" +// valueReference=\"1\" +// causality=\"output\" +// > +// // // // // // // // // @@ -148,7 +148,7 @@ readFile("modelDescription.tmp.xml"); // // // @@ -156,7 +156,7 @@ readFile("modelDescription.tmp.xml"); // // // @@ -164,95 +164,94 @@ readFile("modelDescription.tmp.xml"); // // // // // // -// +// // // // -// +// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // @@ -267,8 +266,15 @@ readFile("modelDescription.tmp.xml"); // // // +// +// +// +// +// // +// // +// // // //