@@ -13,6 +13,7 @@ public enum VariableNamingConventions
1313 Flat ,
1414 Structured
1515 }
16+
1617 public enum GenerationTools
1718 {
1819 Vector_vVIRTUALtarget ,
@@ -63,10 +64,10 @@ public ModelDescription(Fmi3.fmiModelDescription input, Action<LogSeverity, stri
6364 Description = input . description ;
6465 InstantiationToken = input . instantiationToken . Normalize ( ) ;
6566 GenerationTool = string . IsNullOrEmpty ( input . generationTool )
66- ? GenerationTools . Unset
67- : input . generationTool . Normalize ( ) . Contains ( "Vector vVIRTUALtarget" )
68- ? GenerationTools . Vector_vVIRTUALtarget
69- : GenerationTools . Other ;
67+ ? GenerationTools . Unset
68+ : input . generationTool . Normalize ( ) . Contains ( "Vector vVIRTUALtarget" )
69+ ? GenerationTools . Vector_vVIRTUALtarget
70+ : GenerationTools . Other ;
7071 FmiVersion = input . fmiVersion ;
7172 Version = input . version ;
7273 VariableNamingConvention =
@@ -155,7 +156,8 @@ private void InitTypeDefMap(Fmi3.fmiModelDescriptionTypeDefinitions input)
155156 {
156157 if ( ! IsUnitInMap ( typeDefFloat64 . unit ) )
157158 {
158- throw new ModelDescriptionException ( $ "The type definition 'Float64' in the model description has a unit " +
159+ throw new ModelDescriptionException (
160+ $ "The type definition 'Float64' in the model description has a unit " +
159161 $ "'{ typeDefFloat64 . unit } ' that does not match.") ;
160162 }
161163
@@ -170,7 +172,8 @@ private void InitTypeDefMap(Fmi3.fmiModelDescriptionTypeDefinitions input)
170172 {
171173 if ( ! IsUnitInMap ( typeDefFloat32 . unit ) )
172174 {
173- throw new ModelDescriptionException ( $ "The type definition 'Float32' in the model description has a unit " +
175+ throw new ModelDescriptionException (
176+ $ "The type definition 'Float32' in the model description has a unit " +
174177 $ "'{ typeDefFloat32 . unit } ' that does not match.") ;
175178 }
176179
@@ -211,9 +214,21 @@ private void InitTypeDefMap(Fmi2.fmiModelDescriptionTypeDefinitions input)
211214
212215 if ( fmi2SimpleType . Item is Fmi2 . fmi2SimpleTypeReal typeDefReal )
213216 {
217+ if ( typeDefReal . unit is null )
218+ {
219+ TypeDefinitions . Add (
220+ fmi2SimpleType . name ,
221+ new TypeDefinition
222+ {
223+ Name = fmi2SimpleType . name
224+ } ) ;
225+ continue ;
226+ }
227+
214228 if ( ! IsUnitInMap ( typeDefReal . unit ) )
215229 {
216- throw new ModelDescriptionException ( $ "The type definition 'Real' in the model description has a unit " +
230+ throw new ModelDescriptionException (
231+ $ "The type definition 'Real' in the model description has a unit " +
217232 $ "'{ typeDefReal . unit } ' that does not match.") ;
218233 }
219234
0 commit comments