Linux GNU 11.4.0 Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 72.0% 3553 / 0 / 4934
Functions: -% 0 / 1 / 1
Branches: 56.6% 716 / 0 / 1266

build_cmake/OMCompiler/Compiler/generated-mo/Template/CodegenFMU.mo
Line Branch Exec Source
1 encapsulated package CodegenFMU
2 "
3 file: CodegenFMU.mo
4 package: CodegenFMU
5 description: Generated by Susan.
6 "
7
8 public import Tpl;
9
10 public import SimCodeVar;
11 public import HashTableCrefSimVar;
12 public import SimCode;
13 public import SimCodeFunction;
14 public import SimCodeCodegenUtil;
15 public import SimCodeFunctionUtil;
16 public import BackendDAE;
17 public import System;
18 public import Autoconf;
19 protected import Absyn;
20 protected import AbsynUtil;
21 public import MMath;
22 public import DAE;
23 public import ClassInf;
24 public import ClassInfUtil;
25 protected import SCode;
26 protected import SCodeDump;
27 public import StringUtil;
28 public import Util;
29 public import List;
30 public import ComponentReferenceBasics;
31 public import ComponentReference;
32 public import Expression;
33 protected import ExpressionDump;
34 public import ExpressionBasics;
35 public import Config;
36 public import Testsuite;
37 public import Flags;
38 public import FlagsUtil;
39 public import Settings;
40 public import Patternm;
41 public import Error;
42 public import Values;
43 public import ValuesUtil;
44 public import DAEDump;
45 public import Algorithm;
46 protected import ElementSource;
47 public import DAEUtil;
48 public import TypesDump;
49 public import Types;
50 public import HashTableCrIListArray;
51 public import BackendVariable;
52 public import HpcOmSimCode;
53 public import HpcOmCodegenUtil;
54 public import FMI;
55 public import CodegenUtil;
56 public import CodegenUtilSimulation;
57 public import CodegenC;
58 public import CodegenCFunctions;
59 public import CodegenFMUCommon;
60 public import CodegenFMUModelDescription;
61 protected import CodegenFMU1;
62 protected import CodegenFMU2;
63 protected import CodegenFMU3;
64
65 protected function fun_56
66 input Tpl.Text in_txt;
67 input Boolean in_mArg;
68 input Tpl.Text in_a_fileNamePrefixHash;
69 input SimCode.SimCode in_a_simCode;
70
71 output Tpl.Text out_txt;
72 algorithm
73 out_txt :=
74 match(in_txt, in_mArg, in_a_fileNamePrefixHash, in_a_simCode)
75 local
76 Tpl.Text txt;
77 Tpl.Text a_fileNamePrefixHash;
78 SimCode.SimCode a_simCode;
79
80 case ( txt,
81 false,
82 _,
83 _ )
84 then txt;
85
86 case ( txt,
87 _,
88 a_fileNamePrefixHash,
89 a_simCode )
90 algorithm
91 15 txt := CodegenFMU3.fmiTerminalsAndIconsFile(txt, a_simCode, Tpl.textString(a_fileNamePrefixHash));
92 then txt;
93 end match;
94 end fun_56;
95
96 protected function fun_57
97 input Tpl.Text in_txt;
98 input Boolean in_mArg;
99 input Tpl.Text in_a_fileNamePrefixHash;
100 input list<String> in_a_sourceFiles;
101 input SimCode.SimCode in_a_simCode;
102
103 output Tpl.Text out_txt;
104 algorithm
105 out_txt :=
106 match(in_txt, in_mArg, in_a_fileNamePrefixHash, in_a_sourceFiles, in_a_simCode)
107 local
108 Tpl.Text txt;
109 Tpl.Text a_fileNamePrefixHash;
110 list<String> a_sourceFiles;
111 SimCode.SimCode a_simCode;
112
113 case ( txt,
114 false,
115 _,
116 _,
117 _ )
118 then txt;
119
120 case ( txt,
121 _,
122 a_fileNamePrefixHash,
123 a_sourceFiles,
124 a_simCode )
125 algorithm
126 15 txt := CodegenFMU3.fmiBuildDescriptionFile(txt, a_simCode, a_sourceFiles, Tpl.textString(a_fileNamePrefixHash));
127 then txt;
128 end match;
129 end fun_57;
130
131 protected function fun_58
132 input Tpl.Text in_txt;
133 input Option<SimCode.FmiSimulationFlags> in_a_sc_fmiSimulationFlags;
134 input String in_a_fileNamePrefix;
135 input Tpl.Text in_a_fileNamePrefixHash;
136
137 output Tpl.Text out_txt;
138 algorithm
139 out_txt :=
140 match(in_txt, in_a_sc_fmiSimulationFlags, in_a_fileNamePrefix, in_a_fileNamePrefixHash)
141 local
142 Tpl.Text txt;
143 String a_fileNamePrefix;
144 Tpl.Text a_fileNamePrefixHash;
145 SimCode.FmiSimulationFlags i_fmiSimFlags;
146 Tpl.Text txt_1;
147 Tpl.Text txt_0;
148
149 case ( txt,
150 SOME((i_fmiSimFlags as SimCode.FMI_SIMULATION_FLAGS(nameValueTuples = _))),
151 a_fileNamePrefix,
152 a_fileNamePrefixHash )
153 algorithm
154 5 txt_0 := CodegenFMUCommon.fmuSimulationFlagsFile(Tpl.emptyTxt, i_fmiSimFlags);
155 5 txt_1 := Tpl.writeText(Tpl.emptyTxt, a_fileNamePrefixHash);
156 5 txt_1 := Tpl.writeTok(txt_1, Tpl.ST_STRING(".fmutmp/resources/"));
157 5 txt_1 := Tpl.writeStr(txt_1, a_fileNamePrefix);
158 5 txt_1 := Tpl.writeTok(txt_1, Tpl.ST_STRING("_flags.json"));
159 5 Tpl.textFile(txt_0, Tpl.textString(txt_1));
160 then txt;
161
162 case ( txt,
163 _,
164 _,
165 _ )
166 then txt;
167 end match;
168 end fun_58;
169
170 public function translateModel
171 input Tpl.Text in_txt;
172 input SimCode.SimCode in_a_simCode;
173 input String in_a_FMUVersion;
174 input String in_a_FMUType;
175 input list<String> in_a_sourceFiles;
176
177 output Tpl.Text out_txt;
178 algorithm
179 out_txt :=
180 match(in_txt, in_a_simCode, in_a_FMUVersion, in_a_FMUType, in_a_sourceFiles)
181 local
182 Tpl.Text txt;
183 String a_FMUVersion;
184 String a_FMUType;
185 list<String> a_sourceFiles;
186 Option<SimCode.FmiSimulationFlags> i_sc_fmiSimulationFlags;
187 SimCode.SimCode i_sc;
188 list<String> i_sc_externalFunctionIncludes;
189 list<SimCode.SimGenericCall> i_generic__loop__calls;
190 list<SimCode.SimGenericCall> i_sc_generic__loop__calls;
191 list<SimCodeFunction.RecordDeclaration> i_recordDecls;
192 list<SimCodeFunction.Function> i_modelInfo_functions;
193 list<DAE.Exp> i_literals;
194 String i_fileNamePrefix;
195 Tpl.Text txt_36;
196 Tpl.Text txt_35;
197 Tpl.Text txt_34;
198 Tpl.Text txt_33;
199 Tpl.Text l_0___3;
200 Boolean ret_31;
201 Tpl.Text l_0___2;
202 Boolean ret_29;
203 Tpl.Text l_0___1;
204 Tpl.Text txt_27;
205 Tpl.Text txt_26;
206 Tpl.Text txt_25;
207 Tpl.Text txt_24;
208 Tpl.Text txt_23;
209 Tpl.Text txt_22;
210 Tpl.Text txt_21;
211 Tpl.Text txt_20;
212 Tpl.Text l_0__;
213 Tpl.Text txt_18;
214 Tpl.Text txt_17;
215 Tpl.Text txt_16;
216 Tpl.Text txt_15;
217 Tpl.Text txt_14;
218 Tpl.Text txt_13;
219 Tpl.Text txt_12;
220 Tpl.Text txt_11;
221 Tpl.Text txt_10;
222 Tpl.Text txt_9;
223 Tpl.Text txt_8;
224 Tpl.Text txt_7;
225 Tpl.Text l_fileNamePrefixTmpDir;
226 String ret_5;
227 Tpl.Text l_fileNamePrefixHash;
228 String ret_3;
229 Tpl.Text l_target;
230 String ret_1;
231 Tpl.Text l_guid;
232
233 case ( txt,
234 (i_sc as SimCode.SIMCODE(modelInfo = SimCode.MODELINFO(functions = i_modelInfo_functions), fileNamePrefix = i_fileNamePrefix, literals = i_literals, recordDecls = i_recordDecls, generic_loop_calls = (i_generic__loop__calls as i_sc_generic__loop__calls), externalFunctionIncludes = i_sc_externalFunctionIncludes, fmiSimulationFlags = i_sc_fmiSimulationFlags)),
235 a_FMUVersion,
236 a_FMUType,
237 a_sourceFiles )
238 algorithm
239 82 ret_1 := System.getUUIDStr();
240 82 l_guid := Tpl.writeStr(Tpl.emptyTxt, ret_1);
241 82 ret_3 := Config.simulationCodeTarget();
242 82 l_target := Tpl.writeStr(Tpl.emptyTxt, ret_3);
243 82 ret_5 := Util.hashFileNamePrefix(i_fileNamePrefix);
244 82 l_fileNamePrefixHash := Tpl.writeStr(Tpl.emptyTxt, ret_5);
245 82 l_fileNamePrefixTmpDir := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixHash);
246 82 l_fileNamePrefixTmpDir := Tpl.writeTok(l_fileNamePrefixTmpDir, Tpl.ST_STRING(".fmutmp/sources/"));
247 82 l_fileNamePrefixTmpDir := Tpl.writeStr(l_fileNamePrefixTmpDir, i_fileNamePrefix);
248 82 txt_7 := CodegenC.simulationLiteralsFile(Tpl.emptyTxt, i_fileNamePrefix, i_literals);
249 82 txt_8 := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixTmpDir);
250 82 txt_8 := Tpl.writeTok(txt_8, Tpl.ST_STRING("_literals.h"));
251 82 Tpl.textFile(txt_7, Tpl.textString(txt_8));
252 82 txt_9 := CodegenC.simulationFunctionsHeaderFile(Tpl.emptyTxt, i_fileNamePrefix, i_modelInfo_functions, i_recordDecls, i_sc_generic__loop__calls);
253 82 txt_10 := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixTmpDir);
254 82 txt_10 := Tpl.writeTok(txt_10, Tpl.ST_STRING("_functions.h"));
255 82 Tpl.textFile(txt_9, Tpl.textString(txt_10));
256 82 txt_11 := CodegenC.simulationFunctionsFile(Tpl.emptyTxt, i_fileNamePrefix, i_modelInfo_functions, i_generic__loop__calls);
257 82 txt_12 := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixTmpDir);
258 82 txt_12 := Tpl.writeTok(txt_12, Tpl.ST_STRING("_functions.c"));
259 82 Tpl.textFile(txt_11, Tpl.textString(txt_12));
260 82 txt_13 := CodegenCFunctions.externalFunctionIncludes(Tpl.emptyTxt, i_sc_externalFunctionIncludes);
261 82 txt_14 := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixTmpDir);
262 82 txt_14 := Tpl.writeTok(txt_14, Tpl.ST_STRING("_includes.h"));
263 82 Tpl.textFile(txt_13, Tpl.textString(txt_14));
264 82 txt_15 := CodegenCFunctions.recordsFile(Tpl.emptyTxt, i_fileNamePrefix, i_recordDecls, true);
265 82 txt_16 := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixTmpDir);
266 82 txt_16 := Tpl.writeTok(txt_16, Tpl.ST_STRING("_records.c"));
267 82 Tpl.textFile(txt_15, Tpl.textString(txt_16));
268 82 txt_17 := CodegenC.simulationHeaderFile(Tpl.emptyTxt, i_sc);
269 82 txt_18 := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixTmpDir);
270 82 txt_18 := Tpl.writeTok(txt_18, Tpl.ST_STRING("_model.h"));
271 82 Tpl.textFile(txt_17, Tpl.textString(txt_18));
272 82 l_0__ := generateSimulationFiles(Tpl.emptyTxt, i_sc, Tpl.textString(l_guid), Tpl.textString(l_fileNamePrefixTmpDir), a_FMUVersion);
273 82 txt_20 := simulationInitFunction(Tpl.emptyTxt, i_sc, Tpl.textString(l_guid));
274 82 txt_21 := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixTmpDir);
275 82 txt_21 := Tpl.writeTok(txt_21, Tpl.ST_STRING("_init_fmu.c"));
276 82 Tpl.textFile(txt_20, Tpl.textString(txt_21));
277 82 txt_22 := fmumodel_identifierHeaderFile(Tpl.emptyTxt, i_sc, Tpl.textString(l_guid), a_FMUVersion, a_FMUType);
278 82 txt_23 := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixTmpDir);
279 82 txt_23 := Tpl.writeTok(txt_23, Tpl.ST_STRING("_FMU.h"));
280 82 Tpl.textFile(txt_22, Tpl.textString(txt_23));
281 82 txt_24 := fmumodel_identifierFile(Tpl.emptyTxt, i_sc, Tpl.textString(l_guid), a_FMUVersion, a_FMUType);
282 82 txt_25 := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixTmpDir);
283 82 txt_25 := Tpl.writeTok(txt_25, Tpl.ST_STRING("_FMU.c"));
284 82 Tpl.textFile(txt_24, Tpl.textString(txt_25));
285 82 txt_26 := CodegenFMUModelDescription.fmuModelDescriptionFile(Tpl.emptyTxt, i_sc, Tpl.textString(l_guid), a_FMUVersion, a_FMUType, a_sourceFiles);
286 82 txt_27 := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixHash);
287 82 txt_27 := Tpl.writeTok(txt_27, Tpl.ST_STRING(".fmutmp/modelDescription.xml"));
288 82 Tpl.textFile(txt_26, Tpl.textString(txt_27));
289
3/4
✓ Branch 0 taken 82 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 67 times.
✓ Branch 4 taken 15 times.
82 ret_29 := stringEq(a_FMUVersion, "3.0");
290 82 l_0___1 := fun_56(Tpl.emptyTxt, ret_29, l_fileNamePrefixHash, i_sc);
291
3/4
✓ Branch 0 taken 82 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 67 times.
✓ Branch 4 taken 15 times.
82 ret_31 := stringEq(a_FMUVersion, "3.0");
292 82 l_0___2 := fun_57(Tpl.emptyTxt, ret_31, l_fileNamePrefixHash, a_sourceFiles, i_sc);
293 82 l_0___3 := fun_58(Tpl.emptyTxt, i_sc_fmiSimulationFlags, i_fileNamePrefix, l_fileNamePrefixHash);
294 82 txt_33 := CodegenFMUCommon.fmudeffile(Tpl.emptyTxt, i_sc, a_FMUVersion);
295 82 txt_34 := Tpl.writeText(Tpl.emptyTxt, l_fileNamePrefixHash);
296 82 txt_34 := Tpl.writeTok(txt_34, Tpl.ST_STRING(".fmutmp/sources/"));
297 82 txt_34 := Tpl.writeStr(txt_34, i_fileNamePrefix);
298 82 txt_34 := Tpl.writeTok(txt_34, Tpl.ST_STRING(".def"));
299 82 Tpl.textFile(txt_33, Tpl.textString(txt_34));
300 82 txt_35 := fmuSourceMakefile(Tpl.emptyTxt, i_sc, a_FMUVersion, Tpl.textString(l_fileNamePrefixHash));
301 82 txt_36 := Tpl.writeStr(Tpl.emptyTxt, i_fileNamePrefix);
302 82 txt_36 := Tpl.writeTok(txt_36, Tpl.ST_STRING("_FMU.makefile"));
303 82 Tpl.textFile(txt_35, Tpl.textString(txt_36));
304 then txt;
305
306 case ( txt,
307 _,
308 _,
309 _,
310 _ )
311 then txt;
312 end match;
313 end translateModel;
314
315 public function generateSimulationFiles
316 input Tpl.Text in_txt;
317 input SimCode.SimCode in_a_simCode;
318 input String in_a_guid;
319 input String in_a_modelNamePrefix;
320 input String in_a_fmuVersion;
321
322 output Tpl.Text out_txt;
323 algorithm
324 out_txt :=
325 match(in_txt, in_a_simCode, in_a_guid, in_a_modelNamePrefix, in_a_fmuVersion)
326 local
327 Tpl.Text txt;
328 String a_guid;
329 String a_modelNamePrefix;
330 String a_fmuVersion;
331 SimCode.SimCode i_simCode;
332 Tpl.Text txt_43;
333 Tpl.Text txt_42;
334 Tpl.Text txt_41;
335 Tpl.Text txt_40;
336 Tpl.Text txt_39;
337 Tpl.Text txt_38;
338 Tpl.Text txt_37;
339 Tpl.Text txt_36;
340 Tpl.Text txt_35;
341 Tpl.Text txt_34;
342 Tpl.Text txt_33;
343 Tpl.Text txt_32;
344 Tpl.Text txt_31;
345 Tpl.Text txt_30;
346 Tpl.Text txt_29;
347 Tpl.Text txt_28;
348 Tpl.Text txt_27;
349 Tpl.Text txt_26;
350 Tpl.Text txt_25;
351 Tpl.Text txt_24;
352 Tpl.Text txt_23;
353 Tpl.Text txt_22;
354 Tpl.Text txt_21;
355 Tpl.Text l_mixheader;
356 Tpl.Text txt_19;
357 Tpl.Text txt_18;
358 Tpl.Text txt_17;
359 Tpl.Text txt_16;
360 Tpl.Text txt_15;
361 Tpl.Text txt_14;
362 Tpl.Text txt_13;
363 Tpl.Text txt_12;
364 Tpl.Text txt_11;
365 Tpl.Text txt_10;
366 Tpl.Text txt_9;
367 Tpl.Text txt_8;
368 Tpl.Text txt_7;
369 Tpl.Text txt_6;
370 Tpl.Text txt_5;
371 Tpl.Text txt_4;
372 Tpl.Text txt_3;
373 Tpl.Text txt_2;
374 Tpl.Text txt_1;
375 Tpl.Text txt_0;
376
377 case ( txt,
378 (i_simCode as SimCode.SIMCODE(modelInfo = _)),
379 a_guid,
380 a_modelNamePrefix,
381 a_fmuVersion )
382 algorithm
383 82 System.tmpTickResetIndex(0, 0);
384 82 System.tmpTickResetIndex(0, 1);
385 82 txt_0 := CodegenC.simulationFile_exo(Tpl.emptyTxt, i_simCode);
386 82 txt_1 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
387 82 txt_1 := Tpl.writeTok(txt_1, Tpl.ST_STRING("_01exo.c"));
388 82 Tpl.textFileConvertLines(txt_0, Tpl.textString(txt_1));
389 82 System.tmpTickResetIndex(0, 0);
390 82 System.tmpTickResetIndex(0, 1);
391 82 txt_2 := CodegenC.simulationFile_nls(Tpl.emptyTxt, i_simCode);
392 82 txt_3 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
393 82 txt_3 := Tpl.writeTok(txt_3, Tpl.ST_STRING("_02nls.c"));
394 82 Tpl.textFileConvertLines(txt_2, Tpl.textString(txt_3));
395 82 System.tmpTickResetIndex(0, 0);
396 82 System.tmpTickResetIndex(0, 1);
397 82 txt_4 := CodegenC.simulationFile_lsy(Tpl.emptyTxt, i_simCode);
398 82 txt_5 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
399 82 txt_5 := Tpl.writeTok(txt_5, Tpl.ST_STRING("_03lsy.c"));
400 82 Tpl.textFileConvertLines(txt_4, Tpl.textString(txt_5));
401 82 System.tmpTickResetIndex(0, 0);
402 82 System.tmpTickResetIndex(0, 1);
403 82 txt_6 := CodegenC.simulationFile_set(Tpl.emptyTxt, i_simCode);
404 82 txt_7 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
405 82 txt_7 := Tpl.writeTok(txt_7, Tpl.ST_STRING("_04set.c"));
406 82 Tpl.textFileConvertLines(txt_6, Tpl.textString(txt_7));
407 82 System.tmpTickResetIndex(0, 0);
408 82 System.tmpTickResetIndex(0, 1);
409 82 txt_8 := CodegenC.simulationFile_evt(Tpl.emptyTxt, i_simCode);
410 82 txt_9 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
411 82 txt_9 := Tpl.writeTok(txt_9, Tpl.ST_STRING("_05evt.c"));
412 82 Tpl.textFileConvertLines(txt_8, Tpl.textString(txt_9));
413 82 System.tmpTickResetIndex(0, 0);
414 82 System.tmpTickResetIndex(0, 1);
415 82 txt_10 := CodegenC.simulationFile_inz(Tpl.emptyTxt, i_simCode);
416 82 txt_11 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
417 82 txt_11 := Tpl.writeTok(txt_11, Tpl.ST_STRING("_06inz.c"));
418 82 Tpl.textFileConvertLines(txt_10, Tpl.textString(txt_11));
419 82 txt_12 := CodegenC.simulationFile_dly(Tpl.emptyTxt, i_simCode);
420 82 txt_13 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
421 82 txt_13 := Tpl.writeTok(txt_13, Tpl.ST_STRING("_07dly.c"));
422 82 Tpl.textFileConvertLines(txt_12, Tpl.textString(txt_13));
423 82 System.tmpTickResetIndex(0, 0);
424 82 System.tmpTickResetIndex(0, 1);
425 82 txt_14 := CodegenC.simulationFile_bnd(Tpl.emptyTxt, i_simCode);
426 82 txt_15 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
427 82 txt_15 := Tpl.writeTok(txt_15, Tpl.ST_STRING("_08bnd.c"));
428 82 Tpl.textFileConvertLines(txt_14, Tpl.textString(txt_15));
429 82 System.tmpTickResetIndex(0, 0);
430 82 System.tmpTickResetIndex(0, 1);
431 82 txt_16 := CodegenC.simulationFile_alg(Tpl.emptyTxt, i_simCode);
432 82 txt_17 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
433 82 txt_17 := Tpl.writeTok(txt_17, Tpl.ST_STRING("_09alg.c"));
434 82 Tpl.textFileConvertLines(txt_16, Tpl.textString(txt_17));
435 82 System.tmpTickResetIndex(0, 0);
436 82 System.tmpTickResetIndex(0, 1);
437 82 txt_18 := CodegenC.simulationFile_asr(Tpl.emptyTxt, i_simCode);
438 82 txt_19 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
439 82 txt_19 := Tpl.writeTok(txt_19, Tpl.ST_STRING("_10asr.c"));
440 82 Tpl.textFileConvertLines(txt_18, Tpl.textString(txt_19));
441 82 System.tmpTickResetIndex(0, 0);
442 82 System.tmpTickResetIndex(0, 1);
443 82 l_mixheader := Tpl.emptyTxt;
444 82 (txt_21, l_mixheader) := CodegenC.simulationFile_mix(Tpl.emptyTxt, i_simCode, l_mixheader);
445 82 txt_22 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
446 82 txt_22 := Tpl.writeTok(txt_22, Tpl.ST_STRING("_11mix.c"));
447 82 Tpl.textFileConvertLines(txt_21, Tpl.textString(txt_22));
448 82 txt_23 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
449 82 txt_23 := Tpl.writeTok(txt_23, Tpl.ST_STRING("_11mix.h"));
450 82 Tpl.textFile(l_mixheader, Tpl.textString(txt_23));
451 82 System.tmpTickResetIndex(0, 0);
452 82 System.tmpTickResetIndex(0, 1);
453 82 txt_24 := CodegenC.simulationFile_jac(Tpl.emptyTxt, i_simCode);
454 82 txt_25 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
455 82 txt_25 := Tpl.writeTok(txt_25, Tpl.ST_STRING("_12jac.c"));
456 82 Tpl.textFileConvertLines(txt_24, Tpl.textString(txt_25));
457 82 txt_26 := CodegenC.simulationFile_jac_header(Tpl.emptyTxt, i_simCode);
458 82 txt_27 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
459 82 txt_27 := Tpl.writeTok(txt_27, Tpl.ST_STRING("_12jac.h"));
460 82 Tpl.textFile(txt_26, Tpl.textString(txt_27));
461 82 System.tmpTickResetIndex(0, 0);
462 82 System.tmpTickResetIndex(0, 1);
463 82 txt_28 := CodegenC.simulationFile_opt(Tpl.emptyTxt, i_simCode);
464 82 txt_29 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
465 82 txt_29 := Tpl.writeTok(txt_29, Tpl.ST_STRING("_13opt.c"));
466 82 Tpl.textFileConvertLines(txt_28, Tpl.textString(txt_29));
467 82 txt_30 := CodegenC.simulationFile_opt_header(Tpl.emptyTxt, i_simCode);
468 82 txt_31 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
469 82 txt_31 := Tpl.writeTok(txt_31, Tpl.ST_STRING("_13opt.h"));
470 82 Tpl.textFile(txt_30, Tpl.textString(txt_31));
471 82 System.tmpTickResetIndex(0, 0);
472 82 System.tmpTickResetIndex(0, 1);
473 82 txt_32 := CodegenC.simulationFile_lnz(Tpl.emptyTxt, i_simCode);
474 82 txt_33 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
475 82 txt_33 := Tpl.writeTok(txt_33, Tpl.ST_STRING("_14lnz.c"));
476 82 Tpl.textFileConvertLines(txt_32, Tpl.textString(txt_33));
477 82 System.tmpTickResetIndex(0, 0);
478 82 System.tmpTickResetIndex(0, 1);
479 82 txt_34 := CodegenC.simulationFile_syn(Tpl.emptyTxt, i_simCode);
480 82 txt_35 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
481 82 txt_35 := Tpl.writeTok(txt_35, Tpl.ST_STRING("_15syn.c"));
482 82 Tpl.textFileConvertLines(txt_34, Tpl.textString(txt_35));
483 82 System.tmpTickResetIndex(0, 0);
484 82 System.tmpTickResetIndex(0, 1);
485 82 txt_36 := CodegenC.simulationFile_dae(Tpl.emptyTxt, i_simCode);
486 82 txt_37 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
487 82 txt_37 := Tpl.writeTok(txt_37, Tpl.ST_STRING("_16dae.c"));
488 82 Tpl.textFileConvertLines(txt_36, Tpl.textString(txt_37));
489 82 System.tmpTickResetIndex(0, 0);
490 82 System.tmpTickResetIndex(0, 1);
491 82 txt_38 := CodegenC.simulationFile_inl(Tpl.emptyTxt, i_simCode);
492 82 txt_39 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
493 82 txt_39 := Tpl.writeTok(txt_39, Tpl.ST_STRING("_17inl.c"));
494 82 Tpl.textFileConvertLines(txt_38, Tpl.textString(txt_39));
495 82 System.tmpTickResetIndex(0, 0);
496 82 System.tmpTickResetIndex(0, 1);
497 82 txt_40 := CodegenC.simulationFile_spd(Tpl.emptyTxt, i_simCode);
498 82 txt_41 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
499 82 txt_41 := Tpl.writeTok(txt_41, Tpl.ST_STRING("_18spd.c"));
500 82 Tpl.textFileConvertLines(txt_40, Tpl.textString(txt_41));
501 82 System.tmpTickResetIndex(0, 0);
502 82 System.tmpTickResetIndex(0, 1);
503 82 txt_42 := CodegenC.simulationFile(Tpl.emptyTxt, i_simCode, a_guid, a_fmuVersion);
504 82 txt_43 := Tpl.writeStr(Tpl.emptyTxt, a_modelNamePrefix);
505 82 txt_43 := Tpl.writeTok(txt_43, Tpl.ST_STRING(".c"));
506 82 Tpl.textFileConvertLines(txt_42, Tpl.textString(txt_43));
507 then txt;
508
509 case ( txt,
510 _,
511 _,
512 _,
513 _ )
514 then txt;
515 end match;
516 end generateSimulationFiles;
517
518 public function VendorAnnotations
519 input Tpl.Text in_txt;
520 input SimCode.SimCode in_a_simCode;
521
522 output Tpl.Text out_txt;
523 algorithm
524 out_txt :=
525 match(in_txt, in_a_simCode)
526 local
527 Tpl.Text txt;
528
529 case ( txt,
530 SimCode.SIMCODE(modelInfo = _) )
531 algorithm
532 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
533 "<VendorAnnotations>\n",
534 "</VendorAnnotations>"
535 }, false));
536 then txt;
537
538 case ( txt,
539 _ )
540 then txt;
541 end match;
542 end VendorAnnotations;
543
544 protected function fun_62
545 input Tpl.Text in_txt;
546 input Boolean in_mArg;
547 input SimCode.SimCode in_a_simCode;
548
549 output Tpl.Text out_txt;
550 algorithm
551 out_txt :=
552 match(in_txt, in_mArg, in_a_simCode)
553 local
554 Tpl.Text txt;
555 SimCode.SimCode a_simCode;
556 Tpl.Text txt_1;
557 Tpl.Text txt_0;
558
559 case ( txt,
560 false,
561 a_simCode )
562 algorithm
563 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
564 "// fmu1_model_interface.h pulls in fmiModelFunctions.h (the FMI 1.0 types) and defines the\n",
565 "// ModelInstance struct used by the declarations below and by fmu1_model_interface.c.inc.\n",
566 "// The FMI 2.0 fmi2Functions.h header is not needed for FMI 1.0. The implementation\n",
567 "// (fmu1_model_interface.c.inc) is inlined further down, after the forward declarations\n",
568 "// that it calls (setStartValues, getReal, ...). See #15838.\n",
569 "#include \"fmi-export/fmu1_model_interface.h\"\n",
570 "#define fmu1_model_interface_setupDataStruc "
571 }, false));
572 2 txt_0 := CodegenUtilSimulation.modelNamePrefix(Tpl.emptyTxt, a_simCode);
573 2 txt := CodegenUtil.symbolName(txt, Tpl.textString(txt_0), "setupDataStruc");
574 then txt;
575
576 case ( txt,
577 _,
578 a_simCode )
579 algorithm
580 65 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define fmu2_model_interface_setupDataStruc "));
581 65 txt_1 := CodegenUtilSimulation.modelNamePrefix(Tpl.emptyTxt, a_simCode);
582 65 txt := CodegenUtil.symbolName(txt, Tpl.textString(txt_1), "setupDataStruc");
583 65 txt := Tpl.softNewLine(txt);
584 65 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
585 "#include \"fmi-export/fmu2_model_interface.h\"\n",
586 "#include \"fmi-export/fmu_read_flags.h\""
587 }, false));
588 then txt;
589 end match;
590 end fun_62;
591
592 protected function fun_63
593 input Tpl.Text in_txt;
594 input Boolean in_mArg;
595 input SimCode.SimCode in_a_simCode;
596 input String in_a_FMUVersion;
597
598 output Tpl.Text out_txt;
599 algorithm
600 out_txt :=
601 match(in_txt, in_mArg, in_a_simCode, in_a_FMUVersion)
602 local
603 Tpl.Text txt;
604 SimCode.SimCode a_simCode;
605 String a_FMUVersion;
606 Tpl.Text txt_1;
607 Boolean ret_0;
608
609 case ( txt,
610 false,
611 a_simCode,
612 a_FMUVersion )
613 algorithm
614 67 ret_0 := FMI.isFMIVersion20(a_FMUVersion);
615 67 txt := fun_62(txt, ret_0, a_simCode);
616 then txt;
617
618 case ( txt,
619 _,
620 a_simCode,
621 _ )
622 algorithm
623 15 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define fmu3_model_interface_setupDataStruc "));
624 15 txt_1 := CodegenUtilSimulation.modelNamePrefix(Tpl.emptyTxt, a_simCode);
625 15 txt := CodegenUtil.symbolName(txt, Tpl.textString(txt_1), "setupDataStruc");
626 15 txt := Tpl.softNewLine(txt);
627 15 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#include \"fmi-export/fmu3_model_interface.h\""));
628 then txt;
629 end match;
630 end fun_63;
631
632 protected function fun_64
633 input Tpl.Text in_txt;
634 input Boolean in_mArg;
635 input SimCode.SimCode in_a_simCode;
636
637 output Tpl.Text out_txt;
638 algorithm
639 out_txt :=
640 match(in_txt, in_mArg, in_a_simCode)
641 local
642 Tpl.Text txt;
643 SimCode.SimCode a_simCode;
644
645 case ( txt,
646 false,
647 _ )
648 then txt;
649
650 case ( txt,
651 _,
652 a_simCode )
653 algorithm
654 65 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define FMI2_FUNCTION_PREFIX "));
655 65 txt := CodegenUtilSimulation.modelNamePrefix(txt, a_simCode);
656 65 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
657 "_\n",
658 "#include \"fmi2Functions.h\"\n",
659 "#include \"fmi-export/fmu2_model_interface.h\"\n",
660 "#include \"fmi-export/fmu_read_flags.h\""
661 }, false));
662 then txt;
663 end match;
664 end fun_64;
665
666 protected function fun_65
667 input Tpl.Text in_txt;
668 input Boolean in_mArg;
669 input SimCode.SimCode in_a_simCode;
670 input String in_a_FMUVersion;
671
672 output Tpl.Text out_txt;
673 algorithm
674 out_txt :=
675 match(in_txt, in_mArg, in_a_simCode, in_a_FMUVersion)
676 local
677 Tpl.Text txt;
678 SimCode.SimCode a_simCode;
679 String a_FMUVersion;
680 String ret_1;
681 Boolean ret_0;
682
683 case ( txt,
684 false,
685 a_simCode,
686 a_FMUVersion )
687 algorithm
688 67 ret_0 := FMI.isFMIVersion20(a_FMUVersion);
689 67 txt := fun_64(txt, ret_0, a_simCode);
690 then txt;
691
692 case ( txt,
693 _,
694 a_simCode,
695 _ )
696 algorithm
697 15 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
698 "// FMI 3.0 export. fmu3_model_interface.c is self-contained (its own model\n",
699 "// engine) and is built independently of the FMI 2.0 files. The generated\n",
700 "// per-base-type get/set helper functions below (getReal/setReal/...) are\n",
701 "// shared model code. FMI 3.0 requires globally unique value references, so the\n",
702 "// per-base-type value references are shifted by the offsets below to recover\n",
703 "// the per-type index used by the engine. fmi2Functions.h is included only for\n",
704 "// the FMI 2.0 scalar/utility types used by the engine and the generated helpers.\n",
705 "#define FMI2_FUNCTION_PREFIX "
706 }, false));
707 15 txt := CodegenUtilSimulation.modelNamePrefix(txt, a_simCode);
708 15 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
709 "_\n",
710 "#include \"fmi2Functions.h\"\n",
711 "#define FMI3_FUNCTION_PREFIX "
712 }, false));
713 15 txt := CodegenUtilSimulation.modelNamePrefix(txt, a_simCode);
714 15 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
715 "_\n",
716 "#include \"fmi3Functions.h\"\n",
717 "\n",
718 "#define FMI3_REAL_VR_OFFSET 0\n",
719 "#define FMI3_INTEGER_VR_OFFSET (NUMBER_OF_REALS)\n",
720 "#define FMI3_BOOLEAN_VR_OFFSET (NUMBER_OF_REALS + NUMBER_OF_INTEGERS)\n",
721 "#define FMI3_STRING_VR_OFFSET (NUMBER_OF_REALS + NUMBER_OF_INTEGERS + NUMBER_OF_BOOLEANS)\n",
722 "// external objects are exported as FMI 3.0 Binary, then the model clocks, after the string block\n",
723 "#define FMI3_BINARY_VR_OFFSET (NUMBER_OF_REALS + NUMBER_OF_INTEGERS + NUMBER_OF_BOOLEANS + NUMBER_OF_STRINGS)\n",
724 "#define FMI3_CLOCK_VR_OFFSET (NUMBER_OF_REALS + NUMBER_OF_INTEGERS + NUMBER_OF_BOOLEANS + NUMBER_OF_STRINGS + NUMBER_OF_EXTERNALOBJECTS)\n",
725 "#define FMI3_TIME_VR (NUMBER_OF_REALS + NUMBER_OF_INTEGERS + NUMBER_OF_BOOLEANS + NUMBER_OF_STRINGS + NUMBER_OF_EXTERNALOBJECTS + NUMBER_OF_CLOCKS)\n",
726 "#define FMI3_EVENT_INDICATOR_VR_START (FMI3_TIME_VR + 1)\n"
727 }, true));
728 15 ret_1 := SimCodeCodegenUtil.fmi3ArrayDefines(a_simCode);
729 15 txt := Tpl.writeStr(txt, ret_1);
730 then txt;
731 end match;
732 end fun_65;
733
734 protected function fun_66
735 input Tpl.Text in_txt;
736 input Boolean in_mArg;
737
738 output Tpl.Text out_txt;
739 algorithm
740 out_txt :=
741 match(in_txt, in_mArg)
742 local
743 Tpl.Text txt;
744
745 case ( txt,
746 false )
747 algorithm
748 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
749 "void eventUpdate(ModelInstance* comp, fmiEventInfo* eventInfo);\n",
750 "fmiReal getReal(ModelInstance* comp, const fmiValueReference vr);\n",
751 "fmiStatus setReal(ModelInstance* comp, const fmiValueReference vr, const fmiReal value);\n",
752 "fmiInteger getInteger(ModelInstance* comp, const fmiValueReference vr);\n",
753 "fmiStatus setInteger(ModelInstance* comp, const fmiValueReference vr, const fmiInteger value);\n",
754 "fmiBoolean getBoolean(ModelInstance* comp, const fmiValueReference vr);\n",
755 "fmiStatus setBoolean(ModelInstance* comp, const fmiValueReference vr, const fmiBoolean value);\n",
756 "fmiString getString(ModelInstance* comp, const fmiValueReference vr);\n",
757 "fmiStatus setString(ModelInstance* comp, const fmiValueReference vr, fmiString value);\n",
758 "fmiStatus setExternalFunction(ModelInstance* c, const fmiValueReference vr, const void* value);"
759 }, false));
760 then txt;
761
762 case ( txt,
763 _ )
764 algorithm
765 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
766 "void eventUpdate(ModelInstance* comp, fmi2EventInfo* eventInfo);\n",
767 "fmi2Real getReal(ModelInstance* comp, const fmi2ValueReference vr);\n",
768 "fmi2Status setReal(ModelInstance* comp, const fmi2ValueReference vr, const fmi2Real value);\n",
769 "fmi2Integer getInteger(ModelInstance* comp, const fmi2ValueReference vr);\n",
770 "fmi2Status setInteger(ModelInstance* comp, const fmi2ValueReference vr, const fmi2Integer value);\n",
771 "fmi2Boolean getBoolean(ModelInstance* comp, const fmi2ValueReference vr);\n",
772 "fmi2Status setBoolean(ModelInstance* comp, const fmi2ValueReference vr, const fmi2Boolean value);\n",
773 "fmi2String getString(ModelInstance* comp, const fmi2ValueReference vr);\n",
774 "fmi2Status setString(ModelInstance* comp, const fmi2ValueReference vr, fmi2String value);\n",
775 "fmi2Status setExternalFunction(ModelInstance* c, const fmi2ValueReference vr, const void* value);\n",
776 "fmi2ValueReference mapInputReference2InputNumber(const fmi2ValueReference vr);\n",
777 "fmi2ValueReference mapOutputReference2OutputNumber(const fmi2ValueReference vr);\n",
778 "fmi2ValueReference mapOutputReference2RealOutputDerivatives(const fmi2ValueReference vr);\n",
779 "fmi2ValueReference mapInitialUnknownsdependentIndex(const fmi2ValueReference vr);\n",
780 "fmi2ValueReference mapInitialUnknownsIndependentIndex(const fmi2ValueReference vr);"
781 }, false));
782 then txt;
783 end match;
784 end fun_66;
785
786 protected function fun_67
787 input Tpl.Text in_txt;
788 input Boolean in_mArg;
789
790 output Tpl.Text out_txt;
791 algorithm
792 out_txt :=
793 match(in_txt, in_mArg)
794 local
795 Tpl.Text txt;
796
797 case ( txt,
798 false )
799 then txt;
800
801 case ( txt,
802 _ )
803 algorithm
804 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
805 "// FMI 1.0 inlines the model interface implementation here, after the forward declarations\n",
806 "// above (setStartValues, setDefaultStartValues, getReal, ...) that it calls. See #15838.\n",
807 "#if !defined(OMC_RUST_SIMULATION_RUNTIME)\n",
808 "#include \"fmi-export/fmu1_model_interface.c.inc\"\n",
809 "#endif"
810 }, false));
811 then txt;
812 end match;
813 end fun_67;
814
815 protected function fun_68
816 input Tpl.Text in_txt;
817 input SimCode.SimCode in_a_simCode;
818 input String in_a_guid;
819 input String in_a_FMUVersion;
820
821 output Tpl.Text out_txt;
822 algorithm
823 out_txt :=
824 match(in_txt, in_a_simCode, in_a_guid, in_a_FMUVersion)
825 local
826 Tpl.Text txt;
827 String a_guid;
828 String a_FMUVersion;
829 SimCode.ModelInfo i_modelInfo;
830 SimCode.SimCode i_simCode;
831 Boolean ret_6;
832 Boolean ret_5;
833 Boolean ret_4;
834 Boolean ret_3;
835 Boolean ret_2;
836 Boolean ret_1;
837 Tpl.Text txt_0;
838
839 case ( txt,
840 (i_simCode as SimCode.SIMCODE(modelInfo = i_modelInfo)),
841 a_guid,
842 a_FMUVersion )
843 algorithm
844 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#ifndef "));
845 82 txt := CodegenUtilSimulation.modelNamePrefix(txt, i_simCode);
846 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
847 "_FMU_H\n",
848 "#define "
849 }, false));
850 82 txt := CodegenUtilSimulation.modelNamePrefix(txt, i_simCode);
851 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
852 "_FMU_H\n",
853 "\n",
854 "#include \"simulation_data.h\"\n",
855 "\n",
856 "// define class name and unique id\n",
857 "#define MODEL_IDENTIFIER "
858 }, false));
859 82 txt := CodegenUtilSimulation.modelNamePrefix(txt, i_simCode);
860 82 txt := Tpl.softNewLine(txt);
861 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define MODEL_GUID \"{"));
862 82 txt := Tpl.writeStr(txt, a_guid);
863 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
864 "}\"\n",
865 "\n"
866 }, true));
867 82 txt := ModelDefineData(txt, i_simCode, i_modelInfo);
868 82 txt := Tpl.softNewLine(txt);
869 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
870 "\n",
871 "#ifdef __cplusplus\n",
872 "extern \"C\" {\n",
873 "#endif\n",
874 "\n",
875 "extern void "
876 }, false));
877 82 txt_0 := CodegenUtilSimulation.modelNamePrefix(Tpl.emptyTxt, i_simCode);
878 82 txt := CodegenUtil.symbolName(txt, Tpl.textString(txt_0), "setupDataStruc");
879 82 txt := Tpl.writeTok(txt, Tpl.ST_LINE("(DATA *data, threadData_t *threadData);\n"));
880 82 ret_1 := FMI.isFMIVersion30(a_FMUVersion);
881 82 txt := fun_63(txt, ret_1, i_simCode, a_FMUVersion);
882 82 txt := Tpl.softNewLine(txt);
883 82 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
884 82 ret_2 := FMI.isFMIVersion30(a_FMUVersion);
885 82 txt := fun_65(txt, ret_2, i_simCode, a_FMUVersion);
886 82 txt := Tpl.softNewLine(txt);
887 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
888 "\n",
889 "void setStartValues(ModelInstance *comp);\n",
890 "void setDefaultStartValues(ModelInstance *comp);\n"
891 }, true));
892 82 ret_3 := FMI.isFMIVersion20(a_FMUVersion);
893 82 ret_4 := FMI.isFMIVersion30(a_FMUVersion);
894 82 ret_5 := boolOr(ret_3, ret_4);
895 82 txt := fun_66(txt, ret_5);
896 82 txt := Tpl.softNewLine(txt);
897 82 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
898 82 ret_6 := FMI.isFMIVersion10(a_FMUVersion);
899 82 txt := fun_67(txt, ret_6);
900 82 txt := Tpl.softNewLine(txt);
901 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
902 "\n",
903 "#ifdef __cplusplus\n",
904 "}\n",
905 "#endif\n",
906 "\n",
907 "#endif /* "
908 }, false));
909 82 txt := CodegenUtilSimulation.modelNamePrefix(txt, i_simCode);
910 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_FMU_H */"));
911 then txt;
912
913 case ( txt,
914 _,
915 _,
916 _ )
917 then txt;
918 end match;
919 end fun_68;
920
921 public function fmumodel_identifierHeaderFile
922 input Tpl.Text txt;
923 input SimCode.SimCode a_simCode;
924 input String a_guid;
925 input String a_FMUVersion;
926 input String a_FMUType;
927
928 output Tpl.Text out_txt;
929 algorithm
930 82 out_txt := fun_68(txt, a_simCode, a_guid, a_FMUVersion);
931 end fmumodel_identifierHeaderFile;
932
933 protected function fun_70
934 input Tpl.Text in_txt;
935 input Boolean in_mArg;
936
937 output Tpl.Text out_txt;
938 algorithm
939 out_txt :=
940 match(in_txt, in_mArg)
941 local
942 Tpl.Text txt;
943
944 case ( txt,
945 false )
946 algorithm
947 67 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
948 "const int omc_fmu3_nArrays = 0;\n",
949 "const unsigned int omc_fmu3_arrayVrs[1] = {0};\n",
950 "const unsigned int omc_fmu3_arrayLengths[1] = {0};"
951 }, false));
952 then txt;
953
954 case ( txt,
955 _ )
956 algorithm
957 15 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
958 "const int omc_fmu3_nArrays = FMI3_NUMBER_OF_ARRAYS;\n",
959 "#if FMI3_NUMBER_OF_ARRAYS > 0\n",
960 "const unsigned int omc_fmu3_arrayVrs[] = FMI3_ARRAY_VRS;\n",
961 "const unsigned int omc_fmu3_arrayLengths[] = FMI3_ARRAY_LENGTHS;\n",
962 "#else\n",
963 "const unsigned int omc_fmu3_arrayVrs[1] = {0};\n",
964 "const unsigned int omc_fmu3_arrayLengths[1] = {0};\n",
965 "#endif"
966 }, false));
967 then txt;
968 end match;
969 end fun_70;
970
971 protected function fun_71
972 input Tpl.Text in_txt;
973 input Boolean in_mArg;
974
975 output Tpl.Text out_txt;
976 algorithm
977 out_txt :=
978 match(in_txt, in_mArg)
979 local
980 Tpl.Text txt;
981
982 case ( txt,
983 false )
984 algorithm
985 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("1"));
986 then txt;
987
988 case ( txt,
989 _ )
990 algorithm
991 65 txt := Tpl.writeTok(txt, Tpl.ST_STRING("2"));
992 then txt;
993 end match;
994 end fun_71;
995
996 protected function fun_72
997 input Tpl.Text in_txt;
998 input Boolean in_mArg;
999 input String in_a_FMUVersion;
1000
1001 output Tpl.Text out_txt;
1002 algorithm
1003 out_txt :=
1004 match(in_txt, in_mArg, in_a_FMUVersion)
1005 local
1006 Tpl.Text txt;
1007 String a_FMUVersion;
1008 Boolean ret_0;
1009
1010 case ( txt,
1011 false,
1012 a_FMUVersion )
1013 algorithm
1014 67 ret_0 := FMI.isFMIVersion20(a_FMUVersion);
1015 67 txt := fun_71(txt, ret_0);
1016 then txt;
1017
1018 case ( txt,
1019 _,
1020 _ )
1021 algorithm
1022 15 txt := Tpl.writeTok(txt, Tpl.ST_STRING("3"));
1023 then txt;
1024 end match;
1025 end fun_72;
1026
1027 protected function fun_73
1028 input Tpl.Text in_txt;
1029 input Boolean in_mArg;
1030 input String in_a_FMUType;
1031 input SimCode.ModelInfo in_a_modelInfo;
1032 input SimCode.SimCode in_a_simCode;
1033
1034 output Tpl.Text out_txt;
1035 algorithm
1036 out_txt :=
1037 match(in_txt, in_mArg, in_a_FMUType, in_a_modelInfo, in_a_simCode)
1038 local
1039 Tpl.Text txt;
1040 String a_FMUType;
1041 SimCode.ModelInfo a_modelInfo;
1042 SimCode.SimCode a_simCode;
1043
1044 case ( txt,
1045 false,
1046 _,
1047 a_modelInfo,
1048 a_simCode )
1049 algorithm
1050 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1051 2 txt := eventUpdateFunction(txt, a_simCode);
1052 2 txt := Tpl.softNewLine(txt);
1053 2 txt := getRealFunction(txt, a_simCode, a_modelInfo);
1054 2 txt := Tpl.softNewLine(txt);
1055 2 txt := setRealFunction(txt, a_simCode, a_modelInfo);
1056 2 txt := Tpl.softNewLine(txt);
1057 2 txt := getIntegerFunction(txt, a_simCode, a_modelInfo);
1058 2 txt := Tpl.softNewLine(txt);
1059 2 txt := setIntegerFunction(txt, a_simCode, a_modelInfo);
1060 2 txt := Tpl.softNewLine(txt);
1061 2 txt := getBooleanFunction(txt, a_simCode, a_modelInfo);
1062 2 txt := Tpl.softNewLine(txt);
1063 2 txt := setBooleanFunction(txt, a_simCode, a_modelInfo);
1064 2 txt := Tpl.softNewLine(txt);
1065 2 txt := getStringFunction(txt, a_simCode, a_modelInfo);
1066 2 txt := Tpl.softNewLine(txt);
1067 2 txt := setStringFunction(txt, a_simCode, a_modelInfo);
1068 2 txt := Tpl.softNewLine(txt);
1069 2 txt := setExternalFunction(txt, a_modelInfo);
1070 2 txt := Tpl.popBlock(txt);
1071 then txt;
1072
1073 case ( txt,
1074 _,
1075 a_FMUType,
1076 a_modelInfo,
1077 a_simCode )
1078 algorithm
1079 80 txt := eventUpdateFunction2(txt, a_simCode);
1080 80 txt := Tpl.softNewLine(txt);
1081 80 txt := getRealFunction2(txt, a_simCode, a_modelInfo);
1082 80 txt := Tpl.softNewLine(txt);
1083 80 txt := setRealFunction2(txt, a_simCode, a_modelInfo);
1084 80 txt := Tpl.softNewLine(txt);
1085 80 txt := getIntegerFunction2(txt, a_simCode, a_modelInfo);
1086 80 txt := Tpl.softNewLine(txt);
1087 80 txt := setIntegerFunction2(txt, a_simCode, a_modelInfo);
1088 80 txt := Tpl.softNewLine(txt);
1089 80 txt := getBooleanFunction2(txt, a_simCode, a_modelInfo);
1090 80 txt := Tpl.softNewLine(txt);
1091 80 txt := setBooleanFunction2(txt, a_simCode, a_modelInfo);
1092 80 txt := Tpl.softNewLine(txt);
1093 80 txt := getStringFunction2(txt, a_simCode, a_modelInfo);
1094 80 txt := Tpl.softNewLine(txt);
1095 80 txt := setStringFunction2(txt, a_simCode, a_modelInfo);
1096 80 txt := Tpl.softNewLine(txt);
1097 80 txt := setExternalFunction2(txt, a_modelInfo);
1098 80 txt := Tpl.softNewLine(txt);
1099 80 txt := mapInputAndOutputs(txt, a_simCode);
1100 80 txt := Tpl.softNewLine(txt);
1101 80 txt := mapRealOutputDerivatives(txt, a_simCode, a_FMUType);
1102 80 txt := Tpl.softNewLine(txt);
1103 80 txt := mapInitialUnknownsdependentCrefs(txt, a_simCode);
1104 80 txt := Tpl.softNewLine(txt);
1105 80 txt := mapInitialUnknownsIndependentCrefs(txt, a_simCode);
1106 then txt;
1107 end match;
1108 end fun_73;
1109
1110 protected function fun_74
1111 input Tpl.Text in_txt;
1112 input SimCode.SimCode in_a_simCode;
1113 input String in_a_FMUVersion;
1114 input String in_a_FMUType;
1115
1116 output Tpl.Text out_txt;
1117 algorithm
1118 out_txt :=
1119 match(in_txt, in_a_simCode, in_a_FMUVersion, in_a_FMUType)
1120 local
1121 Tpl.Text txt;
1122 String a_FMUVersion;
1123 String a_FMUType;
1124 SimCode.ModelInfo i_modelInfo;
1125 String i_fileNamePrefix;
1126 SimCode.SimCode i_simCode;
1127 Boolean ret_5;
1128 Boolean ret_4;
1129 Boolean ret_3;
1130 Boolean ret_2;
1131 Tpl.Text txt_1;
1132 Boolean ret_0;
1133
1134 case ( txt,
1135 (i_simCode as SimCode.SIMCODE(fileNamePrefix = i_fileNamePrefix, modelInfo = i_modelInfo)),
1136 a_FMUVersion,
1137 a_FMUType )
1138 algorithm
1139 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#include \""));
1140 82 txt := CodegenUtilSimulation.modelNamePrefix(txt, i_simCode);
1141 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
1142 "_FMU.h\"\n",
1143 "\n",
1144 "// include fmu header files, typedefs and macros\n",
1145 "#include <stdio.h>\n",
1146 "#include <string.h>\n",
1147 "#include <assert.h>\n",
1148 "#include \"openmodelica.h\"\n",
1149 "#include \"openmodelica_func.h\"\n",
1150 "#include \"util/omc_error.h\"\n",
1151 "#include \""
1152 }, false));
1153 82 txt := Tpl.writeStr(txt, i_fileNamePrefix);
1154 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
1155 "_functions.h\"\n",
1156 "\n",
1157 "#include \"simulation/solver/events.h\"\n",
1158 "\n"
1159 }, true));
1160 82 txt := setDefaultStartValues(txt, i_modelInfo);
1161 82 txt := Tpl.softNewLine(txt);
1162 82 txt := setStartValues(txt, i_modelInfo);
1163 82 txt := Tpl.softNewLine(txt);
1164 82 txt := Tpl.writeTok(txt, Tpl.ST_LINE("const size_t omc_fmu_threadDataSize = sizeof(threadData_t);\n"));
1165 82 ret_0 := FMI.isFMIVersion30(a_FMUVersion);
1166 82 txt := fun_70(txt, ret_0);
1167 82 txt := Tpl.softNewLine(txt);
1168 82 txt := Tpl.writeTok(txt, Tpl.ST_LINE("void omc_fmu_setupDataStruc(DATA *data, threadData_t *threadData) {\n"));
1169 82 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1170 82 txt_1 := CodegenUtilSimulation.modelNamePrefix(Tpl.emptyTxt, i_simCode);
1171 82 txt := CodegenUtil.symbolName(txt, Tpl.textString(txt_1), "setupDataStruc");
1172 82 txt := Tpl.writeTok(txt, Tpl.ST_LINE("(data, threadData);\n"));
1173 82 txt := Tpl.popBlock(txt);
1174 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
1175 "}\n",
1176 "#if defined(OMC_RUST_SIMULATION_RUNTIME)\n",
1177 "#include \"fmi-export/fmu"
1178 }, false));
1179 82 ret_2 := FMI.isFMIVersion30(a_FMUVersion);
1180 82 txt := fun_72(txt, ret_2, a_FMUVersion);
1181 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
1182 "_rust_interface.c.inc\"\n",
1183 "#endif\n",
1184 "\n",
1185 "// implementation of the Model Exchange functions\n"
1186 }, true));
1187 82 ret_3 := FMI.isFMIVersion20(a_FMUVersion);
1188 82 ret_4 := FMI.isFMIVersion30(a_FMUVersion);
1189 82 ret_5 := boolOr(ret_3, ret_4);
1190 82 txt := fun_73(txt, ret_5, a_FMUType, i_modelInfo, i_simCode);
1191 82 txt := Tpl.softNewLine(txt);
1192 82 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
1193 then txt;
1194
1195 case ( txt,
1196 _,
1197 _,
1198 _ )
1199 then txt;
1200 end match;
1201 end fun_74;
1202
1203 public function fmumodel_identifierFile
1204 input Tpl.Text txt;
1205 input SimCode.SimCode a_simCode;
1206 input String a_guid;
1207 input String a_FMUVersion;
1208 input String a_FMUType;
1209
1210 output Tpl.Text out_txt;
1211 algorithm
1212 82 out_txt := fun_74(txt, a_simCode, a_FMUVersion, a_FMUType);
1213 end fmumodel_identifierFile;
1214
1215 protected function fun_76
1216 input Tpl.Text in_txt;
1217 input Boolean in_mArg;
1218 input list<SimCodeVar.SimVar> in_a_listStates;
1219 input list<SimCodeVar.SimVar> in_a_vars_stateVars;
1220
1221 output Tpl.Text out_txt;
1222 algorithm
1223 out_txt :=
1224 match(in_txt, in_mArg, in_a_listStates, in_a_vars_stateVars)
1225 local
1226 Tpl.Text txt;
1227 list<SimCodeVar.SimVar> a_listStates;
1228 list<SimCodeVar.SimVar> a_vars_stateVars;
1229 Integer ret_0;
1230
1231 case ( txt,
1232 false,
1233 _,
1234 a_vars_stateVars )
1235 algorithm
1236 47 ret_0 := SimCodeCodegenUtil.numScalarElems(a_vars_stateVars);
1237 47 txt := Tpl.writeStr(txt, intString(ret_0));
1238 then txt;
1239
1240 case ( txt,
1241 _,
1242 a_listStates,
1243 _ )
1244 algorithm
1245 35 txt := CodegenFMUCommon.statesnumwithDummy(txt, a_listStates);
1246 then txt;
1247 end match;
1248 end fun_76;
1249
1250 protected function fun_77
1251 input Tpl.Text in_txt;
1252 input Boolean in_mArg;
1253 input SimCode.SimCode in_a_simCode;
1254 input SimCodeVar.SimVar in_a_simvar;
1255
1256 output Tpl.Text out_txt;
1257 algorithm
1258 out_txt :=
1259 match(in_txt, in_mArg, in_a_simCode, in_a_simvar)
1260 local
1261 Tpl.Text txt;
1262 SimCode.SimCode a_simCode;
1263 SimCodeVar.SimVar a_simvar;
1264 String ret_0;
1265
1266 case ( txt,
1267 false,
1268 a_simCode,
1269 a_simvar )
1270 algorithm
1271 101 ret_0 := SimCodeCodegenUtil.getFMIScalarVRs(a_simvar, a_simCode);
1272 101 txt := Tpl.writeStr(txt, ret_0);
1273 then txt;
1274
1275 case ( txt,
1276 _,
1277 _,
1278 _ )
1279 then txt;
1280 end match;
1281 end fun_77;
1282
1283 protected function lm_78
1284 input output Tpl.Text txt;
1285 input list<SimCodeVar.SimVar> items;
1286 input SimCode.SimCode a_simCode;
1287 algorithm
1288
2/2
✓ Branch 0 taken 101 times.
✓ Branch 1 taken 82 times.
183 for lstElt_78 in items loop
1289 txt := match lstElt_78
1290 local
1291 SimCodeVar.SimVar i_simvar;
1292 DAE.ComponentRef i_name;
1293 Boolean ret_1;
1294 Tpl.Text txt_0;
1295
1296 case (i_simvar as SimCodeVar.SIMVAR(name = i_name))
1297 algorithm
1298 101 txt_0 := CodegenUtil.crefStr(Tpl.emptyTxt, i_name);
1299
3/4
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 97 times.
✓ Branch 5 taken 4 times.
✗ Branch 6 not taken.
101 ret_1 := stringEq(Tpl.textString(txt_0), "$dummy");
1300 101 txt := fun_77(txt, ret_1, a_simCode, i_simvar);
1301 101 txt := Tpl.nextIter(txt);
1302 then txt;
1303
1304 case _
1305 then txt;
1306 end match;
1307 end for;
1308 end lm_78;
1309
1310 protected function fun_79
1311 input Tpl.Text in_txt;
1312 input Boolean in_mArg;
1313 input SimCode.SimCode in_a_simCode;
1314 input SimCodeVar.SimVar in_a_simvar;
1315
1316 output Tpl.Text out_txt;
1317 algorithm
1318 out_txt :=
1319 match(in_txt, in_mArg, in_a_simCode, in_a_simvar)
1320 local
1321 Tpl.Text txt;
1322 SimCode.SimCode a_simCode;
1323 SimCodeVar.SimVar a_simvar;
1324 String ret_0;
1325
1326 case ( txt,
1327 false,
1328 a_simCode,
1329 a_simvar )
1330 algorithm
1331 101 ret_0 := SimCodeCodegenUtil.getFMIScalarVRs(a_simvar, a_simCode);
1332 101 txt := Tpl.writeStr(txt, ret_0);
1333 then txt;
1334
1335 case ( txt,
1336 _,
1337 _,
1338 _ )
1339 then txt;
1340 end match;
1341 end fun_79;
1342
1343 protected function lm_80
1344 input output Tpl.Text txt;
1345 input list<SimCodeVar.SimVar> items;
1346 input SimCode.SimCode a_simCode;
1347 algorithm
1348
2/2
✓ Branch 0 taken 101 times.
✓ Branch 1 taken 82 times.
183 for lstElt_80 in items loop
1349 txt := match lstElt_80
1350 local
1351 SimCodeVar.SimVar i_simvar;
1352 DAE.ComponentRef i_name;
1353 Boolean ret_1;
1354 Tpl.Text txt_0;
1355
1356 case (i_simvar as SimCodeVar.SIMVAR(name = i_name))
1357 algorithm
1358 101 txt_0 := CodegenUtil.crefStr(Tpl.emptyTxt, i_name);
1359
3/4
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 97 times.
✓ Branch 5 taken 4 times.
✗ Branch 6 not taken.
101 ret_1 := stringEq(Tpl.textString(txt_0), "der($dummy)");
1360 101 txt := fun_79(txt, ret_1, a_simCode, i_simvar);
1361 101 txt := Tpl.nextIter(txt);
1362 then txt;
1363
1364 case _
1365 then txt;
1366 end match;
1367 end for;
1368 end lm_80;
1369
1370 protected function lm_81
1371 input output Tpl.Text txt;
1372 input list<SimCodeFunction.Function> items;
1373 algorithm
1374
2/2
✓ Branch 0 taken 106 times.
✓ Branch 1 taken 82 times.
188 for lstElt_81 in items loop
1375 txt := match lstElt_81
1376 local
1377 SimCodeFunction.Function i_fn;
1378
1379 case i_fn
1380 algorithm
1381 106 txt := defineExternalFunction(txt, i_fn);
1382 106 txt := Tpl.nextIter(txt);
1383 then txt;
1384 end match;
1385 end for;
1386 end lm_81;
1387
1388 protected function fun_82
1389 input Tpl.Text in_txt;
1390 input SimCode.ModelInfo in_a_modelInfo;
1391 input SimCode.SimCode in_a_simCode;
1392
1393 output Tpl.Text out_txt;
1394 algorithm
1395 out_txt :=
1396 match(in_txt, in_a_modelInfo, in_a_simCode)
1397 local
1398 Tpl.Text txt;
1399 SimCode.SimCode a_simCode;
1400 list<SimCodeVar.SimVar> i_vars_derivativeVars;
1401 list<SimCodeFunction.Function> i_functions;
1402 Integer i_numberOfClocks;
1403 list<SimCodeVar.SimVar> i_vars_extObjVars;
1404 Integer i_varInfo_numZeroCrossings;
1405 list<SimCodeVar.SimVar> i_listStates;
1406 Integer i_varInfo_numRealInputVars;
1407 list<SimCodeVar.SimVar> i_vars_boolAliasVars;
1408 list<SimCodeVar.SimVar> i_vars_boolParamVars;
1409 list<SimCodeVar.SimVar> i_vars_boolAlgVars;
1410 list<SimCodeVar.SimVar> i_vars_stringAliasVars;
1411 list<SimCodeVar.SimVar> i_vars_stringParamVars;
1412 list<SimCodeVar.SimVar> i_vars_stringAlgVars;
1413 list<SimCodeVar.SimVar> i_vars_intAliasVars;
1414 list<SimCodeVar.SimVar> i_vars_intParamVars;
1415 list<SimCodeVar.SimVar> i_vars_intAlgVars;
1416 list<SimCodeVar.SimVar> i_vars_aliasVars;
1417 list<SimCodeVar.SimVar> i_vars_paramVars;
1418 list<SimCodeVar.SimVar> i_vars_algVars;
1419 list<SimCodeVar.SimVar> i_vars_discreteAlgVars;
1420 list<SimCodeVar.SimVar> i_vars_stateVars;
1421 Integer ret_33;
1422 Integer ret_32;
1423 Boolean ret_31;
1424 Integer ret_30;
1425 Tpl.Text l_numberOfRealInputs;
1426 Integer ret_28;
1427 Integer ret_27;
1428 Integer ret_26;
1429 Integer ret_25;
1430 Integer ret_24;
1431 Tpl.Text l_numberOfBooleans;
1432 Integer ret_22;
1433 Integer ret_21;
1434 Integer ret_20;
1435 Integer ret_19;
1436 Integer ret_18;
1437 Tpl.Text l_numberOfStrings;
1438 Integer ret_16;
1439 Integer ret_15;
1440 Integer ret_14;
1441 Integer ret_13;
1442 Integer ret_12;
1443 Tpl.Text l_numberOfIntegers;
1444 Integer ret_10;
1445 Integer ret_9;
1446 Integer ret_8;
1447 Integer ret_7;
1448 Integer ret_6;
1449 Integer ret_5;
1450 Integer ret_4;
1451 Integer ret_3;
1452 Integer ret_2;
1453 Integer ret_1;
1454 Tpl.Text l_numberOfReals;
1455
1456 case ( txt,
1457 SimCode.MODELINFO(varInfo = SimCode.VARINFO(numRealInputVars = i_varInfo_numRealInputVars, numZeroCrossings = i_varInfo_numZeroCrossings), vars = SimCodeVar.SIMVARS(stateVars = (i_vars_stateVars as i_listStates), discreteAlgVars = i_vars_discreteAlgVars, algVars = i_vars_algVars, paramVars = i_vars_paramVars, aliasVars = i_vars_aliasVars, intAlgVars = i_vars_intAlgVars, intParamVars = i_vars_intParamVars, intAliasVars = i_vars_intAliasVars, stringAlgVars = i_vars_stringAlgVars, stringParamVars = i_vars_stringParamVars, stringAliasVars = i_vars_stringAliasVars, boolAlgVars = i_vars_boolAlgVars, boolParamVars = i_vars_boolParamVars, boolAliasVars = i_vars_boolAliasVars, extObjVars = i_vars_extObjVars, derivativeVars = i_vars_derivativeVars), nClocks = i_numberOfClocks, functions = i_functions),
1458 a_simCode )
1459 algorithm
1460 82 ret_1 := SimCodeCodegenUtil.numScalarElems(i_vars_stateVars);
1461 82 ret_2 := intMul(ret_1, 2);
1462 82 ret_3 := SimCodeCodegenUtil.numScalarElems(i_vars_discreteAlgVars);
1463 82 ret_4 := SimCodeCodegenUtil.numScalarElems(i_vars_algVars);
1464 82 ret_5 := SimCodeCodegenUtil.numScalarElems(i_vars_paramVars);
1465 82 ret_6 := SimCodeCodegenUtil.numScalarElems(i_vars_aliasVars);
1466 82 ret_7 := intAdd(ret_5, ret_6);
1467 82 ret_8 := intAdd(ret_4, ret_7);
1468 82 ret_9 := intAdd(ret_3, ret_8);
1469 82 ret_10 := intAdd(ret_2, ret_9);
1470 82 l_numberOfReals := Tpl.writeStr(Tpl.emptyTxt, intString(ret_10));
1471 82 ret_12 := SimCodeCodegenUtil.numScalarElems(i_vars_intAlgVars);
1472 82 ret_13 := SimCodeCodegenUtil.numScalarElems(i_vars_intParamVars);
1473 82 ret_14 := SimCodeCodegenUtil.numScalarElems(i_vars_intAliasVars);
1474 82 ret_15 := intAdd(ret_13, ret_14);
1475 82 ret_16 := intAdd(ret_12, ret_15);
1476 82 l_numberOfIntegers := Tpl.writeStr(Tpl.emptyTxt, intString(ret_16));
1477 82 ret_18 := SimCodeCodegenUtil.numScalarElems(i_vars_stringAlgVars);
1478 82 ret_19 := SimCodeCodegenUtil.numScalarElems(i_vars_stringParamVars);
1479 82 ret_20 := SimCodeCodegenUtil.numScalarElems(i_vars_stringAliasVars);
1480 82 ret_21 := intAdd(ret_19, ret_20);
1481 82 ret_22 := intAdd(ret_18, ret_21);
1482 82 l_numberOfStrings := Tpl.writeStr(Tpl.emptyTxt, intString(ret_22));
1483 82 ret_24 := SimCodeCodegenUtil.numScalarElems(i_vars_boolAlgVars);
1484 82 ret_25 := SimCodeCodegenUtil.numScalarElems(i_vars_boolParamVars);
1485 82 ret_26 := SimCodeCodegenUtil.numScalarElems(i_vars_boolAliasVars);
1486 82 ret_27 := intAdd(ret_25, ret_26);
1487 82 ret_28 := intAdd(ret_24, ret_27);
1488 82 l_numberOfBooleans := Tpl.writeStr(Tpl.emptyTxt, intString(ret_28));
1489 82 l_numberOfRealInputs := Tpl.writeStr(Tpl.emptyTxt, intString(i_varInfo_numRealInputVars));
1490 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
1491 "// define model size\n",
1492 "#define NUMBER_OF_STATES "
1493 }, false));
1494 82 ret_30 := SimCodeCodegenUtil.numScalarElems(i_vars_stateVars);
1495 82 ret_31 := intEq(ret_30, 1);
1496 82 txt := fun_76(txt, ret_31, i_listStates, i_vars_stateVars);
1497 82 txt := Tpl.softNewLine(txt);
1498 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define NUMBER_OF_EVENT_INDICATORS "));
1499 82 txt := Tpl.writeStr(txt, intString(i_varInfo_numZeroCrossings));
1500 82 txt := Tpl.softNewLine(txt);
1501 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define NUMBER_OF_REALS "));
1502 82 txt := Tpl.writeText(txt, l_numberOfReals);
1503 82 txt := Tpl.softNewLine(txt);
1504 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define NUMBER_OF_REAL_INPUTS "));
1505 82 txt := Tpl.writeText(txt, l_numberOfRealInputs);
1506 82 txt := Tpl.softNewLine(txt);
1507 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define NUMBER_OF_INTEGERS "));
1508 82 txt := Tpl.writeText(txt, l_numberOfIntegers);
1509 82 txt := Tpl.softNewLine(txt);
1510 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define NUMBER_OF_STRINGS "));
1511 82 txt := Tpl.writeText(txt, l_numberOfStrings);
1512 82 txt := Tpl.softNewLine(txt);
1513 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define NUMBER_OF_BOOLEANS "));
1514 82 txt := Tpl.writeText(txt, l_numberOfBooleans);
1515 82 txt := Tpl.softNewLine(txt);
1516 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define NUMBER_OF_EXTERNALOBJECTS "));
1517 82 ret_32 := listLength(i_vars_extObjVars);
1518 82 txt := Tpl.writeStr(txt, intString(ret_32));
1519 82 txt := Tpl.softNewLine(txt);
1520 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define NUMBER_OF_CLOCKS "));
1521 82 txt := Tpl.writeStr(txt, intString(i_numberOfClocks));
1522 82 txt := Tpl.softNewLine(txt);
1523 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define NUMBER_OF_EXTERNALFUNCTIONS "));
1524 82 ret_33 := SimCodeCodegenUtil.countDynamicExternalFunctions(i_functions);
1525 82 txt := Tpl.writeStr(txt, intString(ret_33));
1526 82 txt := Tpl.softNewLine(txt);
1527 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
1528 "\n",
1529 "// define initial state vector as vector of value references (arrays expanded to\n",
1530 "// their scalar element value references)\n",
1531 "#define STATES { "
1532 }, false));
1533 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1534 82 txt := lm_78(txt, i_vars_stateVars, a_simCode);
1535 82 txt := Tpl.popIter(txt);
1536 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
1537 " }\n",
1538 "#define STATESDERIVATIVES { "
1539 }, false));
1540 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1541 82 txt := lm_80(txt, i_vars_derivativeVars, a_simCode);
1542 82 txt := Tpl.popIter(txt);
1543 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
1544 " }\n",
1545 "\n"
1546 }, true));
1547 82 System.tmpTickReset(0);
1548 82 txt := Tpl.softNewLine(txt);
1549 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1550 82 txt := lm_81(txt, i_functions);
1551 82 txt := Tpl.popIter(txt);
1552 then txt;
1553
1554 case ( txt,
1555 _,
1556 _ )
1557 then txt;
1558 end match;
1559 end fun_82;
1560
1561 public function ModelDefineData
1562 input Tpl.Text txt;
1563 input SimCode.SimCode a_simCode;
1564 input SimCode.ModelInfo a_modelInfo;
1565
1566 output Tpl.Text out_txt;
1567 algorithm
1568 82 out_txt := fun_82(txt, a_modelInfo, a_simCode);
1569 end ModelDefineData;
1570
1571 public function dervativeNameCStyle
1572 input Tpl.Text in_txt;
1573 input DAE.ComponentRef in_a_cr;
1574
1575 output Tpl.Text out_txt;
1576 algorithm
1577 out_txt :=
1578 match(in_txt, in_a_cr)
1579 local
1580 Tpl.Text txt;
1581 DAE.ComponentRef i_componentRef;
1582
1583 case ( txt,
1584 DAE.CREF_QUAL(ident = "$DER", componentRef = i_componentRef) )
1585 algorithm
1586 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("der_"));
1587 ✗ txt := CodegenUtil.crefStr(txt, i_componentRef);
1588 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
1589 then txt;
1590
1591 case ( txt,
1592 _ )
1593 then txt;
1594 end match;
1595 end dervativeNameCStyle;
1596
1597 public function defineExternalFunction
1598 input Tpl.Text in_txt;
1599 input SimCodeFunction.Function in_a_fn;
1600
1601 output Tpl.Text out_txt;
1602 algorithm
1603 out_txt :=
1604 match(in_txt, in_a_fn)
1605 local
1606 Tpl.Text txt;
1607 String i_language;
1608 String i_extName;
1609 Integer ret_1;
1610 Tpl.Text l_fname;
1611
1612 case ( txt,
1613 SimCodeFunction.EXTERNAL_FUNCTION(dynamicLoad = true, extName = i_extName, language = i_language) )
1614 algorithm
1615 ✗ l_fname := CodegenUtil.extFunctionName(Tpl.emptyTxt, i_extName, i_language);
1616 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define $P"));
1617 ✗ txt := Tpl.writeText(txt, l_fname);
1618 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
1619 ✗ ret_1 := System.tmpTick();
1620 ✗ txt := Tpl.writeStr(txt, intString(ret_1));
1621 then txt;
1622
1623 case ( txt,
1624 _ )
1625 then txt;
1626 end match;
1627 end defineExternalFunction;
1628
1629 protected function lm_86
1630 input output Tpl.Text txt;
1631 input list<SimCodeVar.SimVar> items;
1632 algorithm
1633
2/2
✓ Branch 0 taken 101 times.
✓ Branch 1 taken 82 times.
183 for lstElt_86 in items loop
1634 txt := match lstElt_86
1635 local
1636 SimCodeVar.SimVar i_var;
1637
1638 case i_var
1639 algorithm
1640 101 txt := initValsDefault(txt, i_var, "realVars");
1641 101 txt := Tpl.nextIter(txt);
1642 then txt;
1643 end match;
1644 end for;
1645 end lm_86;
1646
1647 protected function lm_87
1648 input output Tpl.Text txt;
1649 input list<SimCodeVar.SimVar> items;
1650 algorithm
1651
2/2
✓ Branch 0 taken 101 times.
✓ Branch 1 taken 82 times.
183 for lstElt_87 in items loop
1652 txt := match lstElt_87
1653 local
1654 SimCodeVar.SimVar i_var;
1655
1656 case i_var
1657 algorithm
1658 101 txt := initValsDefault(txt, i_var, "realVars");
1659 101 txt := Tpl.nextIter(txt);
1660 then txt;
1661 end match;
1662 end for;
1663 end lm_87;
1664
1665 protected function lm_88
1666 input output Tpl.Text txt;
1667 input list<SimCodeVar.SimVar> items;
1668 algorithm
1669
2/2
✓ Branch 0 taken 3639 times.
✓ Branch 1 taken 82 times.
3721 for lstElt_88 in items loop
1670 txt := match lstElt_88
1671 local
1672 SimCodeVar.SimVar i_var;
1673
1674 case i_var
1675 algorithm
1676 3639 txt := initValsDefault(txt, i_var, "realVars");
1677 3639 txt := Tpl.nextIter(txt);
1678 then txt;
1679 end match;
1680 end for;
1681 end lm_88;
1682
1683 protected function lm_89
1684 input output Tpl.Text txt;
1685 input list<SimCodeVar.SimVar> items;
1686 algorithm
1687
2/2
✓ Branch 0 taken 248 times.
✓ Branch 1 taken 82 times.
330 for lstElt_89 in items loop
1688 txt := match lstElt_89
1689 local
1690 SimCodeVar.SimVar i_var;
1691
1692 case i_var
1693 algorithm
1694 248 txt := initValsDefault(txt, i_var, "realVars");
1695 248 txt := Tpl.nextIter(txt);
1696 then txt;
1697 end match;
1698 end for;
1699 end lm_89;
1700
1701 protected function lm_90
1702 input output Tpl.Text txt;
1703 input list<SimCodeVar.SimVar> items;
1704 algorithm
1705
2/2
✓ Branch 0 taken 163 times.
✓ Branch 1 taken 82 times.
245 for lstElt_90 in items loop
1706 txt := match lstElt_90
1707 local
1708 SimCodeVar.SimVar i_var;
1709
1710 case i_var
1711 algorithm
1712 163 txt := initValsDefault(txt, i_var, "integerVars");
1713 163 txt := Tpl.nextIter(txt);
1714 then txt;
1715 end match;
1716 end for;
1717 end lm_90;
1718
1719 protected function lm_91
1720 input output Tpl.Text txt;
1721 input list<SimCodeVar.SimVar> items;
1722 algorithm
1723
2/2
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 82 times.
98 for lstElt_91 in items loop
1724 txt := match lstElt_91
1725 local
1726 SimCodeVar.SimVar i_var;
1727
1728 case i_var
1729 algorithm
1730 16 txt := initValsDefault(txt, i_var, "booleanVars");
1731 16 txt := Tpl.nextIter(txt);
1732 then txt;
1733 end match;
1734 end for;
1735 end lm_91;
1736
1737 protected function lm_92
1738 input output Tpl.Text txt;
1739 input list<SimCodeVar.SimVar> items;
1740 algorithm
1741
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 82 times.
85 for lstElt_92 in items loop
1742 txt := match lstElt_92
1743 local
1744 SimCodeVar.SimVar i_var;
1745
1746 case i_var
1747 algorithm
1748 3 txt := initValsDefault(txt, i_var, "stringVars");
1749 3 txt := Tpl.nextIter(txt);
1750 then txt;
1751 end match;
1752 end for;
1753 end lm_92;
1754
1755 protected function lm_93
1756 input output Tpl.Text txt;
1757 input list<SimCodeVar.SimVar> items;
1758 algorithm
1759
2/2
✓ Branch 0 taken 2078 times.
✓ Branch 1 taken 82 times.
2160 for lstElt_93 in items loop
1760 txt := match lstElt_93
1761 local
1762 SimCodeVar.SimVar i_var;
1763
1764 case i_var
1765 algorithm
1766 2078 txt := initParamsDefault(txt, i_var, "realParameter");
1767 2078 txt := Tpl.nextIter(txt);
1768 then txt;
1769 end match;
1770 end for;
1771 end lm_93;
1772
1773 protected function lm_94
1774 input output Tpl.Text txt;
1775 input list<SimCodeVar.SimVar> items;
1776 algorithm
1777
2/2
✓ Branch 0 taken 164 times.
✓ Branch 1 taken 82 times.
246 for lstElt_94 in items loop
1778 txt := match lstElt_94
1779 local
1780 SimCodeVar.SimVar i_var;
1781
1782 case i_var
1783 algorithm
1784 164 txt := initParamsDefault(txt, i_var, "integerParameter");
1785 164 txt := Tpl.nextIter(txt);
1786 then txt;
1787 end match;
1788 end for;
1789 end lm_94;
1790
1791 protected function lm_95
1792 input output Tpl.Text txt;
1793 input list<SimCodeVar.SimVar> items;
1794 algorithm
1795
2/2
✓ Branch 0 taken 195 times.
✓ Branch 1 taken 82 times.
277 for lstElt_95 in items loop
1796 txt := match lstElt_95
1797 local
1798 SimCodeVar.SimVar i_var;
1799
1800 case i_var
1801 algorithm
1802 195 txt := initParamsDefault(txt, i_var, "booleanParameter");
1803 195 txt := Tpl.nextIter(txt);
1804 then txt;
1805 end match;
1806 end for;
1807 end lm_95;
1808
1809 protected function lm_96
1810 input output Tpl.Text txt;
1811 input list<SimCodeVar.SimVar> items;
1812 algorithm
1813
2/2
✓ Branch 0 taken 126 times.
✓ Branch 1 taken 82 times.
208 for lstElt_96 in items loop
1814 txt := match lstElt_96
1815 local
1816 SimCodeVar.SimVar i_var;
1817
1818 case i_var
1819 algorithm
1820 126 txt := initParamsDefault(txt, i_var, "stringParameter");
1821 126 txt := Tpl.nextIter(txt);
1822 then txt;
1823 end match;
1824 end for;
1825 end lm_96;
1826
1827 public function setDefaultStartValues
1828 input Tpl.Text in_txt;
1829 input SimCode.ModelInfo in_a_modelInfo;
1830
1831 output Tpl.Text out_txt;
1832 algorithm
1833 out_txt :=
1834 match(in_txt, in_a_modelInfo)
1835 local
1836 Tpl.Text txt;
1837 list<SimCodeVar.SimVar> i_vars_stringParamVars;
1838 list<SimCodeVar.SimVar> i_vars_boolParamVars;
1839 list<SimCodeVar.SimVar> i_vars_intParamVars;
1840 list<SimCodeVar.SimVar> i_vars_paramVars;
1841 list<SimCodeVar.SimVar> i_vars_stringAlgVars;
1842 list<SimCodeVar.SimVar> i_vars_boolAlgVars;
1843 list<SimCodeVar.SimVar> i_vars_intAlgVars;
1844 list<SimCodeVar.SimVar> i_vars_discreteAlgVars;
1845 list<SimCodeVar.SimVar> i_vars_algVars;
1846 list<SimCodeVar.SimVar> i_vars_derivativeVars;
1847 list<SimCodeVar.SimVar> i_vars_stateVars;
1848
1849 case ( txt,
1850 SimCode.MODELINFO(varInfo = SimCode.VARINFO(numStateVars = _, numAlgVars = _), vars = SimCodeVar.SIMVARS(stateVars = i_vars_stateVars, derivativeVars = i_vars_derivativeVars, algVars = i_vars_algVars, discreteAlgVars = i_vars_discreteAlgVars, intAlgVars = i_vars_intAlgVars, boolAlgVars = i_vars_boolAlgVars, stringAlgVars = i_vars_stringAlgVars, paramVars = i_vars_paramVars, intParamVars = i_vars_intParamVars, boolParamVars = i_vars_boolParamVars, stringParamVars = i_vars_stringParamVars)) )
1851 algorithm
1852 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
1853 "// Set values for all variables that define a start value\n",
1854 "OMC_DISABLE_OPT\n",
1855 "void omc_fmu_setDefaultStartValues(DATA *fmuData) {\n"
1856 }, true));
1857 82 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1858 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1859 82 txt := lm_86(txt, i_vars_stateVars);
1860 82 txt := Tpl.popIter(txt);
1861 82 txt := Tpl.softNewLine(txt);
1862 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1863 82 txt := lm_87(txt, i_vars_derivativeVars);
1864 82 txt := Tpl.popIter(txt);
1865 82 txt := Tpl.softNewLine(txt);
1866 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1867 82 txt := lm_88(txt, i_vars_algVars);
1868 82 txt := Tpl.popIter(txt);
1869 82 txt := Tpl.softNewLine(txt);
1870 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1871 82 txt := lm_89(txt, i_vars_discreteAlgVars);
1872 82 txt := Tpl.popIter(txt);
1873 82 txt := Tpl.softNewLine(txt);
1874 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1875 82 txt := lm_90(txt, i_vars_intAlgVars);
1876 82 txt := Tpl.popIter(txt);
1877 82 txt := Tpl.softNewLine(txt);
1878 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1879 82 txt := lm_91(txt, i_vars_boolAlgVars);
1880 82 txt := Tpl.popIter(txt);
1881 82 txt := Tpl.softNewLine(txt);
1882 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1883 82 txt := lm_92(txt, i_vars_stringAlgVars);
1884 82 txt := Tpl.popIter(txt);
1885 82 txt := Tpl.softNewLine(txt);
1886 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1887 82 txt := lm_93(txt, i_vars_paramVars);
1888 82 txt := Tpl.popIter(txt);
1889 82 txt := Tpl.softNewLine(txt);
1890 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1891 82 txt := lm_94(txt, i_vars_intParamVars);
1892 82 txt := Tpl.popIter(txt);
1893 82 txt := Tpl.softNewLine(txt);
1894 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1895 82 txt := lm_95(txt, i_vars_boolParamVars);
1896 82 txt := Tpl.popIter(txt);
1897 82 txt := Tpl.softNewLine(txt);
1898 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1899 82 txt := lm_96(txt, i_vars_stringParamVars);
1900 82 txt := Tpl.popIter(txt);
1901 82 txt := Tpl.softNewLine(txt);
1902 82 txt := Tpl.popBlock(txt);
1903 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
1904 "}\n",
1905 "\n",
1906 "void setDefaultStartValues(ModelInstance *comp) {\n",
1907 " omc_fmu_setDefaultStartValues(comp->fmuData);\n",
1908 "}"
1909 }, false));
1910 then txt;
1911
1912 case ( txt,
1913 _ )
1914 then txt;
1915 end match;
1916 end setDefaultStartValues;
1917
1918 protected function lm_98
1919 input output Tpl.Text txt;
1920 input list<SimCodeVar.SimVar> items;
1921 algorithm
1922
2/2
✓ Branch 0 taken 101 times.
✓ Branch 1 taken 82 times.
183 for lstElt_98 in items loop
1923 txt := match lstElt_98
1924 local
1925 SimCodeVar.SimVar i_var;
1926
1927 case i_var
1928 algorithm
1929 101 txt := initVals(txt, i_var, "realVars");
1930 101 txt := Tpl.nextIter(txt);
1931 then txt;
1932 end match;
1933 end for;
1934 end lm_98;
1935
1936 protected function lm_99
1937 input output Tpl.Text txt;
1938 input list<SimCodeVar.SimVar> items;
1939 algorithm
1940
2/2
✓ Branch 0 taken 101 times.
✓ Branch 1 taken 82 times.
183 for lstElt_99 in items loop
1941 txt := match lstElt_99
1942 local
1943 SimCodeVar.SimVar i_var;
1944
1945 case i_var
1946 algorithm
1947 101 txt := initVals(txt, i_var, "realVars");
1948 101 txt := Tpl.nextIter(txt);
1949 then txt;
1950 end match;
1951 end for;
1952 end lm_99;
1953
1954 protected function lm_100
1955 input output Tpl.Text txt;
1956 input list<SimCodeVar.SimVar> items;
1957 algorithm
1958
2/2
✓ Branch 0 taken 3639 times.
✓ Branch 1 taken 82 times.
3721 for lstElt_100 in items loop
1959 txt := match lstElt_100
1960 local
1961 SimCodeVar.SimVar i_var;
1962
1963 case i_var
1964 algorithm
1965 3639 txt := initVals(txt, i_var, "realVars");
1966 3639 txt := Tpl.nextIter(txt);
1967 then txt;
1968 end match;
1969 end for;
1970 end lm_100;
1971
1972 protected function lm_101
1973 input output Tpl.Text txt;
1974 input list<SimCodeVar.SimVar> items;
1975 algorithm
1976
2/2
✓ Branch 0 taken 248 times.
✓ Branch 1 taken 82 times.
330 for lstElt_101 in items loop
1977 txt := match lstElt_101
1978 local
1979 SimCodeVar.SimVar i_var;
1980
1981 case i_var
1982 algorithm
1983 248 txt := initVals(txt, i_var, "realVars");
1984 248 txt := Tpl.nextIter(txt);
1985 then txt;
1986 end match;
1987 end for;
1988 end lm_101;
1989
1990 protected function lm_102
1991 input output Tpl.Text txt;
1992 input list<SimCodeVar.SimVar> items;
1993 algorithm
1994
2/2
✓ Branch 0 taken 163 times.
✓ Branch 1 taken 82 times.
245 for lstElt_102 in items loop
1995 txt := match lstElt_102
1996 local
1997 SimCodeVar.SimVar i_var;
1998
1999 case i_var
2000 algorithm
2001 163 txt := initVals(txt, i_var, "integerVars");
2002 163 txt := Tpl.nextIter(txt);
2003 then txt;
2004 end match;
2005 end for;
2006 end lm_102;
2007
2008 protected function lm_103
2009 input output Tpl.Text txt;
2010 input list<SimCodeVar.SimVar> items;
2011 algorithm
2012
2/2
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 82 times.
98 for lstElt_103 in items loop
2013 txt := match lstElt_103
2014 local
2015 SimCodeVar.SimVar i_var;
2016
2017 case i_var
2018 algorithm
2019 16 txt := initVals(txt, i_var, "booleanVars");
2020 16 txt := Tpl.nextIter(txt);
2021 then txt;
2022 end match;
2023 end for;
2024 end lm_103;
2025
2026 protected function lm_104
2027 input output Tpl.Text txt;
2028 input list<SimCodeVar.SimVar> items;
2029 algorithm
2030
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 82 times.
85 for lstElt_104 in items loop
2031 txt := match lstElt_104
2032 local
2033 SimCodeVar.SimVar i_var;
2034
2035 case i_var
2036 algorithm
2037 3 txt := initVals(txt, i_var, "stringVars");
2038 3 txt := Tpl.nextIter(txt);
2039 then txt;
2040 end match;
2041 end for;
2042 end lm_104;
2043
2044 protected function lm_105
2045 input output Tpl.Text txt;
2046 input list<SimCodeVar.SimVar> items;
2047 algorithm
2048
2/2
✓ Branch 0 taken 2078 times.
✓ Branch 1 taken 82 times.
2160 for lstElt_105 in items loop
2049 txt := match lstElt_105
2050 local
2051 SimCodeVar.SimVar i_var;
2052
2053 case i_var
2054 algorithm
2055 2078 txt := initParams(txt, i_var, "realParameter");
2056 2078 txt := Tpl.nextIter(txt);
2057 then txt;
2058 end match;
2059 end for;
2060 end lm_105;
2061
2062 protected function lm_106
2063 input output Tpl.Text txt;
2064 input list<SimCodeVar.SimVar> items;
2065 algorithm
2066
2/2
✓ Branch 0 taken 164 times.
✓ Branch 1 taken 82 times.
246 for lstElt_106 in items loop
2067 txt := match lstElt_106
2068 local
2069 SimCodeVar.SimVar i_var;
2070
2071 case i_var
2072 algorithm
2073 164 txt := initParams(txt, i_var, "integerParameter");
2074 164 txt := Tpl.nextIter(txt);
2075 then txt;
2076 end match;
2077 end for;
2078 end lm_106;
2079
2080 protected function lm_107
2081 input output Tpl.Text txt;
2082 input list<SimCodeVar.SimVar> items;
2083 algorithm
2084
2/2
✓ Branch 0 taken 195 times.
✓ Branch 1 taken 82 times.
277 for lstElt_107 in items loop
2085 txt := match lstElt_107
2086 local
2087 SimCodeVar.SimVar i_var;
2088
2089 case i_var
2090 algorithm
2091 195 txt := initParams(txt, i_var, "booleanParameter");
2092 195 txt := Tpl.nextIter(txt);
2093 then txt;
2094 end match;
2095 end for;
2096 end lm_107;
2097
2098 protected function lm_108
2099 input output Tpl.Text txt;
2100 input list<SimCodeVar.SimVar> items;
2101 algorithm
2102
2/2
✓ Branch 0 taken 126 times.
✓ Branch 1 taken 82 times.
208 for lstElt_108 in items loop
2103 txt := match lstElt_108
2104 local
2105 SimCodeVar.SimVar i_var;
2106
2107 case i_var
2108 algorithm
2109 126 txt := initParams(txt, i_var, "stringParameter");
2110 126 txt := Tpl.nextIter(txt);
2111 then txt;
2112 end match;
2113 end for;
2114 end lm_108;
2115
2116 public function setStartValues
2117 input Tpl.Text in_txt;
2118 input SimCode.ModelInfo in_a_modelInfo;
2119
2120 output Tpl.Text out_txt;
2121 algorithm
2122 out_txt :=
2123 match(in_txt, in_a_modelInfo)
2124 local
2125 Tpl.Text txt;
2126 list<SimCodeVar.SimVar> i_vars_stringParamVars;
2127 list<SimCodeVar.SimVar> i_vars_boolParamVars;
2128 list<SimCodeVar.SimVar> i_vars_intParamVars;
2129 list<SimCodeVar.SimVar> i_vars_paramVars;
2130 list<SimCodeVar.SimVar> i_vars_stringAlgVars;
2131 list<SimCodeVar.SimVar> i_vars_boolAlgVars;
2132 list<SimCodeVar.SimVar> i_vars_intAlgVars;
2133 list<SimCodeVar.SimVar> i_vars_discreteAlgVars;
2134 list<SimCodeVar.SimVar> i_vars_algVars;
2135 list<SimCodeVar.SimVar> i_vars_derivativeVars;
2136 list<SimCodeVar.SimVar> i_vars_stateVars;
2137
2138 case ( txt,
2139 SimCode.MODELINFO(varInfo = SimCode.VARINFO(numStateVars = _, numAlgVars = _), vars = SimCodeVar.SIMVARS(stateVars = i_vars_stateVars, derivativeVars = i_vars_derivativeVars, algVars = i_vars_algVars, discreteAlgVars = i_vars_discreteAlgVars, intAlgVars = i_vars_intAlgVars, boolAlgVars = i_vars_boolAlgVars, stringAlgVars = i_vars_stringAlgVars, paramVars = i_vars_paramVars, intParamVars = i_vars_intParamVars, boolParamVars = i_vars_boolParamVars, stringParamVars = i_vars_stringParamVars)) )
2140 algorithm
2141 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
2142 "// Set values for all variables that define a start value\n",
2143 "OMC_DISABLE_OPT\n",
2144 "void setStartValues(ModelInstance *comp) {\n"
2145 }, true));
2146 82 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
2147 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2148 82 txt := lm_98(txt, i_vars_stateVars);
2149 82 txt := Tpl.popIter(txt);
2150 82 txt := Tpl.softNewLine(txt);
2151 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2152 82 txt := lm_99(txt, i_vars_derivativeVars);
2153 82 txt := Tpl.popIter(txt);
2154 82 txt := Tpl.softNewLine(txt);
2155 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2156 82 txt := lm_100(txt, i_vars_algVars);
2157 82 txt := Tpl.popIter(txt);
2158 82 txt := Tpl.softNewLine(txt);
2159 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2160 82 txt := lm_101(txt, i_vars_discreteAlgVars);
2161 82 txt := Tpl.popIter(txt);
2162 82 txt := Tpl.softNewLine(txt);
2163 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2164 82 txt := lm_102(txt, i_vars_intAlgVars);
2165 82 txt := Tpl.popIter(txt);
2166 82 txt := Tpl.softNewLine(txt);
2167 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2168 82 txt := lm_103(txt, i_vars_boolAlgVars);
2169 82 txt := Tpl.popIter(txt);
2170 82 txt := Tpl.softNewLine(txt);
2171 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2172 82 txt := lm_104(txt, i_vars_stringAlgVars);
2173 82 txt := Tpl.popIter(txt);
2174 82 txt := Tpl.softNewLine(txt);
2175 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2176 82 txt := lm_105(txt, i_vars_paramVars);
2177 82 txt := Tpl.popIter(txt);
2178 82 txt := Tpl.softNewLine(txt);
2179 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2180 82 txt := lm_106(txt, i_vars_intParamVars);
2181 82 txt := Tpl.popIter(txt);
2182 82 txt := Tpl.softNewLine(txt);
2183 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2184 82 txt := lm_107(txt, i_vars_boolParamVars);
2185 82 txt := Tpl.popIter(txt);
2186 82 txt := Tpl.softNewLine(txt);
2187 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2188 82 txt := lm_108(txt, i_vars_stringParamVars);
2189 82 txt := Tpl.popIter(txt);
2190 82 txt := Tpl.softNewLine(txt);
2191 82 txt := Tpl.popBlock(txt);
2192 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
2193 "}\n",
2194 "\n"
2195 }, true));
2196 then txt;
2197
2198 case ( txt,
2199 _ )
2200 then txt;
2201 end match;
2202 end setStartValues;
2203
2204 protected function lm_110
2205 input output Tpl.Text txt;
2206 input list<SimCode.SimEqSystem> items;
2207 input output Tpl.Text a_sub;
2208 algorithm
2209 ✗ for lstElt_110 in items loop
2210 (txt, a_sub) := match lstElt_110
2211 local
2212 DAE.ComponentRef i_cref;
2213 String ret_1;
2214 Tpl.Text txt_0;
2215
2216 case SimCode.SES_SIMPLE_ASSIGN(cref = i_cref)
2217 algorithm
2218 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("if (sim_verbose) { printf(\"Setting variable start value: %s(start=%f)\\n\", \""));
2219 ✗ txt_0 := CodegenUtil.crefStrNoUnderscore(Tpl.emptyTxt, i_cref);
2220 ✗ ret_1 := Util.escapeModelicaStringToCString(Tpl.textString(txt_0));
2221 ✗ txt := Tpl.writeStr(txt, ret_1);
2222 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\", "));
2223 ✗ (txt, a_sub) := CodegenCFunctions.cref(txt, i_cref, a_sub);
2224 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("); }"));
2225 ✗ txt := Tpl.nextIter(txt);
2226 ✗ then (txt, a_sub);
2227
2228 case _
2229 ✗ then (txt, a_sub);
2230 end match;
2231 end for;
2232 end lm_110;
2233
2234 public function initializeFunction
2235 input Tpl.Text txt;
2236 input list<SimCode.SimEqSystem> a_allEquations;
2237
2238 output Tpl.Text out_txt;
2239 protected
2240 Tpl.Text l_eqPart;
2241 Tpl.Text l_varFrees;
2242 Tpl.Text l_varDecls;
2243 Tpl.Text l_sub;
2244 algorithm
2245 ✗ l_sub := Tpl.emptyTxt;
2246 l_varDecls := Tpl.emptyTxt;
2247 l_varFrees := Tpl.emptyTxt;
2248 l_eqPart := Tpl.emptyTxt;
2249 ✗ out_txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
2250 "// Used to set the first time event, if any.\n",
2251 "void initialize(ModelInstance* comp, fmiEventInfo* eventInfo) {\n",
2252 "\n"
2253 }, true));
2254 ✗ out_txt := Tpl.pushBlock(out_txt, Tpl.BT_INDENT(2));
2255 ✗ out_txt := Tpl.writeText(out_txt, l_varDecls);
2256 ✗ out_txt := Tpl.softNewLine(out_txt);
2257 ✗ out_txt := Tpl.writeTok(out_txt, Tpl.ST_NEW_LINE());
2258 ✗ out_txt := Tpl.writeText(out_txt, l_eqPart);
2259 ✗ out_txt := Tpl.softNewLine(out_txt);
2260 ✗ out_txt := Tpl.pushIter(out_txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2261 ✗ (out_txt, l_sub) := lm_110(out_txt, a_allEquations, l_sub);
2262 ✗ out_txt := Tpl.popIter(out_txt);
2263 ✗ out_txt := Tpl.softNewLine(out_txt);
2264 ✗ out_txt := Tpl.writeTok(out_txt, Tpl.ST_NEW_LINE());
2265 ✗ out_txt := Tpl.popBlock(out_txt);
2266 ✗ out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING("}"));
2267 end initializeFunction;
2268
2269 protected function fun_112
2270 input Tpl.Text in_txt;
2271 input Boolean in_mArg;
2272 input Integer in_a_var_index;
2273 input String in_a_arrayName;
2274 input DAE.Type in_a_type__;
2275
2276 output Tpl.Text out_txt;
2277 algorithm
2278 out_txt :=
2279 match(in_txt, in_mArg, in_a_var_index, in_a_arrayName, in_a_type__)
2280 local
2281 Tpl.Text txt;
2282 Integer a_var_index;
2283 String a_arrayName;
2284 DAE.Type a_type__;
2285
2286 case ( txt,
2287 false,
2288 a_var_index,
2289 a_arrayName,
2290 a_type__ )
2291 algorithm
2292 4271 txt := Tpl.writeTok(txt, Tpl.ST_STRING("put_"));
2293 4271 txt := CodegenCFunctions.expTypeShort(txt, a_type__);
2294 4271 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_element(comp->fmuData->localData[0]->"));
2295 4271 txt := Tpl.writeStr(txt, a_arrayName);
2296 4271 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
2297 4271 txt := Tpl.writeStr(txt, intString(a_var_index));
2298 4271 txt := Tpl.writeTok(txt, Tpl.ST_STRING("], 0, &comp->fmuData->modelData->"));
2299 4271 txt := Tpl.writeStr(txt, a_arrayName);
2300 4271 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Data["));
2301 4271 txt := Tpl.writeStr(txt, intString(a_var_index));
2302 4271 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].attribute.start);"));
2303 then txt;
2304
2305 case ( txt,
2306 _,
2307 _,
2308 _,
2309 _ )
2310 then txt;
2311 end match;
2312 end fun_112;
2313
2314 protected function fun_113
2315 input Tpl.Text in_txt;
2316 input Boolean in_mArg;
2317 input Integer in_a_var_index;
2318 input String in_a_arrayName;
2319 input DAE.Type in_a_type__;
2320 input DAE.ComponentRef in_a_name;
2321
2322 output Tpl.Text out_txt;
2323 algorithm
2324 out_txt :=
2325 match(in_txt, in_mArg, in_a_var_index, in_a_arrayName, in_a_type__, in_a_name)
2326 local
2327 Tpl.Text txt;
2328 Integer a_var_index;
2329 String a_arrayName;
2330 DAE.Type a_type__;
2331 DAE.ComponentRef a_name;
2332 Boolean ret_1;
2333 Tpl.Text txt_0;
2334
2335 case ( txt,
2336 false,
2337 a_var_index,
2338 a_arrayName,
2339 a_type__,
2340 a_name )
2341 algorithm
2342 4271 txt_0 := CodegenUtil.crefStr(Tpl.emptyTxt, a_name);
2343
3/4
✓ Branch 1 taken 25 times.
✓ Branch 2 taken 4246 times.
✓ Branch 5 taken 25 times.
✗ Branch 6 not taken.
4271 ret_1 := stringEq(Tpl.textString(txt_0), "der($dummy)");
2344 4271 txt := fun_112(txt, ret_1, a_var_index, a_arrayName, a_type__);
2345 then txt;
2346
2347 case ( txt,
2348 _,
2349 _,
2350 _,
2351 _,
2352 _ )
2353 then txt;
2354 end match;
2355 end fun_113;
2356
2357 public function initVals
2358 input Tpl.Text in_txt;
2359 input SimCodeVar.SimVar in_a_var;
2360 input String in_a_arrayName;
2361
2362 output Tpl.Text out_txt;
2363 algorithm
2364 out_txt :=
2365 match(in_txt, in_a_var, in_a_arrayName)
2366 local
2367 Tpl.Text txt;
2368 String a_arrayName;
2369 Integer i_var_index;
2370 DAE.Type i_type__;
2371 DAE.ComponentRef i_name;
2372 Boolean ret_1;
2373 Tpl.Text txt_0;
2374
2375 case ( txt,
2376 SimCodeVar.SIMVAR(type_ = i_type__, name = i_name, index = i_var_index),
2377 a_arrayName )
2378 algorithm
2379 4271 txt_0 := CodegenUtil.crefStr(Tpl.emptyTxt, i_name);
2380
3/4
✓ Branch 1 taken 81 times.
✓ Branch 2 taken 4190 times.
✓ Branch 5 taken 81 times.
✗ Branch 6 not taken.
4271 ret_1 := stringEq(Tpl.textString(txt_0), "$dummy");
2381 4271 txt := fun_113(txt, ret_1, i_var_index, a_arrayName, i_type__, i_name);
2382 then txt;
2383
2384 case ( txt,
2385 _,
2386 _ )
2387 then txt;
2388 end match;
2389 end initVals;
2390
2391 public function initParams
2392 input Tpl.Text in_txt;
2393 input SimCodeVar.SimVar in_a_var;
2394 input String in_a_arrayName;
2395
2396 output Tpl.Text out_txt;
2397 algorithm
2398 out_txt :=
2399 match(in_txt, in_a_var, in_a_arrayName)
2400 local
2401 Tpl.Text txt;
2402 String a_arrayName;
2403 Integer i_index;
2404 DAE.Type i_type__;
2405
2406 case ( txt,
2407 SimCodeVar.SIMVAR(index = i_index, type_ = i_type__),
2408 a_arrayName )
2409 algorithm
2410 2563 txt := Tpl.writeTok(txt, Tpl.ST_STRING("put_"));
2411 2563 txt := CodegenCFunctions.expTypeShort(txt, i_type__);
2412 2563 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_element(comp->fmuData->simulationInfo->"));
2413 2563 txt := Tpl.writeStr(txt, a_arrayName);
2414 2563 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
2415 2563 txt := Tpl.writeStr(txt, intString(i_index));
2416 2563 txt := Tpl.writeTok(txt, Tpl.ST_STRING("], 0, &comp->fmuData->modelData->"));
2417 2563 txt := Tpl.writeStr(txt, a_arrayName);
2418 2563 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Data["));
2419 2563 txt := Tpl.writeStr(txt, intString(i_index));
2420 2563 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].attribute.start);"));
2421 then txt;
2422
2423 case ( txt,
2424 _,
2425 _ )
2426 then txt;
2427 end match;
2428 end initParams;
2429
2430 public function initValsDefault
2431 input Tpl.Text in_txt;
2432 input SimCodeVar.SimVar in_a_var;
2433 input String in_a_arrayName;
2434
2435 output Tpl.Text out_txt;
2436 algorithm
2437 out_txt :=
2438 match(in_txt, in_a_var, in_a_arrayName)
2439 local
2440 Tpl.Text txt;
2441 String a_arrayName;
2442 DAE.Type i_type__;
2443 Integer i_index;
2444 SimCodeVar.SimVar i_var;
2445
2446 case ( txt,
2447 (i_var as SimCodeVar.SIMVAR(index = i_index, type_ = DAE.T_REAL(varLst = _))),
2448 a_arrayName )
2449 algorithm
2450 4081 txt := Tpl.writeTok(txt, Tpl.ST_STRING("put_real_element("));
2451 4081 txt := initValDefault(txt, i_var);
2452 4081 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &fmuData->modelData->"));
2453 4081 txt := Tpl.writeStr(txt, a_arrayName);
2454 4081 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Data["));
2455 4081 txt := Tpl.writeStr(txt, intString(i_index));
2456 4081 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].attribute.start);"));
2457 then txt;
2458
2459 case ( txt,
2460 (i_var as SimCodeVar.SIMVAR(index = i_index, type_ = DAE.T_ARRAY(ty = DAE.T_REAL(varLst = _)))),
2461 a_arrayName )
2462 algorithm
2463 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("put_real_element("));
2464 8 txt := initValDefault(txt, i_var);
2465 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &fmuData->modelData->"));
2466 8 txt := Tpl.writeStr(txt, a_arrayName);
2467 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Data["));
2468 8 txt := Tpl.writeStr(txt, intString(i_index));
2469 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].attribute.start);"));
2470 then txt;
2471
2472 case ( txt,
2473 (i_var as SimCodeVar.SIMVAR(index = i_index, type_ = DAE.T_STRING(varLst = _))),
2474 a_arrayName )
2475 algorithm
2476 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("omc_string_move((modelica_string*) fmuData->modelData->"));
2477 3 txt := Tpl.writeStr(txt, a_arrayName);
2478 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Data["));
2479 3 txt := Tpl.writeStr(txt, intString(i_index));
2480 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].attribute.start.data, "));
2481 3 txt := initValDefault(txt, i_var);
2482 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(");"));
2483 then txt;
2484
2485 case ( txt,
2486 (i_var as SimCodeVar.SIMVAR(index = i_index, type_ = DAE.T_ARRAY(ty = DAE.T_STRING(varLst = _)))),
2487 a_arrayName )
2488 algorithm
2489 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("omc_string_move((modelica_string*) fmuData->modelData->"));
2490 ✗ txt := Tpl.writeStr(txt, a_arrayName);
2491 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Data["));
2492 ✗ txt := Tpl.writeStr(txt, intString(i_index));
2493 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("].attribute.start.data, "));
2494 ✗ txt := initValDefault(txt, i_var);
2495 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(");"));
2496 then txt;
2497
2498 case ( txt,
2499 (i_var as SimCodeVar.SIMVAR(index = i_index, type_ = i_type__)),
2500 a_arrayName )
2501 algorithm
2502 179 txt := Tpl.writeTok(txt, Tpl.ST_STRING("put_"));
2503 179 txt := CodegenCFunctions.expTypeShort(txt, i_type__);
2504 179 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_element("));
2505 179 txt := initValDefault(txt, i_var);
2506 179 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &fmuData->modelData->"));
2507 179 txt := Tpl.writeStr(txt, a_arrayName);
2508 179 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Data["));
2509 179 txt := Tpl.writeStr(txt, intString(i_index));
2510 179 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].attribute.start);"));
2511 then txt;
2512
2513 case ( txt,
2514 _,
2515 _ )
2516 then txt;
2517 end match;
2518 end initValsDefault;
2519
2520 public function initParamsDefault
2521 input Tpl.Text in_txt;
2522 input SimCodeVar.SimVar in_a_var;
2523 input String in_a_arrayName;
2524
2525 output Tpl.Text out_txt;
2526 algorithm
2527 out_txt :=
2528 match(in_txt, in_a_var, in_a_arrayName)
2529 local
2530 Tpl.Text txt;
2531 String a_arrayName;
2532 DAE.Type i_type__;
2533 Integer i_index;
2534 SimCodeVar.SimVar i_var;
2535
2536 case ( txt,
2537 (i_var as SimCodeVar.SIMVAR(index = i_index, type_ = DAE.T_REAL(varLst = _))),
2538 a_arrayName )
2539 algorithm
2540 2078 txt := Tpl.writeTok(txt, Tpl.ST_STRING("put_real_element("));
2541 2078 txt := initValDefault(txt, i_var);
2542 2078 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &fmuData->modelData->"));
2543 2078 txt := Tpl.writeStr(txt, a_arrayName);
2544 2078 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Data["));
2545 2078 txt := Tpl.writeStr(txt, intString(i_index));
2546 2078 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].attribute.start);"));
2547 then txt;
2548
2549 case ( txt,
2550 (i_var as SimCodeVar.SIMVAR(index = i_index, type_ = DAE.T_STRING(varLst = _))),
2551 a_arrayName )
2552 algorithm
2553 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING("omc_string_move((modelica_string*) fmuData->modelData->"));
2554 126 txt := Tpl.writeStr(txt, a_arrayName);
2555 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Data["));
2556 126 txt := Tpl.writeStr(txt, intString(i_index));
2557 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].attribute.start.data, "));
2558 126 txt := initValDefault(txt, i_var);
2559 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING(");"));
2560 then txt;
2561
2562 case ( txt,
2563 (i_var as SimCodeVar.SIMVAR(index = i_index, type_ = i_type__)),
2564 a_arrayName )
2565 algorithm
2566 359 txt := Tpl.writeTok(txt, Tpl.ST_STRING("put_"));
2567 359 txt := CodegenCFunctions.expTypeShort(txt, i_type__);
2568 359 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_element("));
2569 359 txt := initValDefault(txt, i_var);
2570 359 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &fmuData->modelData->"));
2571 359 txt := Tpl.writeStr(txt, a_arrayName);
2572 359 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Data["));
2573 359 txt := Tpl.writeStr(txt, intString(i_index));
2574 359 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].attribute.start);"));
2575 then txt;
2576
2577 case ( txt,
2578 _,
2579 _ )
2580 then txt;
2581 end match;
2582 end initParamsDefault;
2583
2584 protected function fun_118
2585 input Tpl.Text in_txt;
2586 input DAE.Type in_a_var_type__;
2587
2588 output Tpl.Text out_txt;
2589 algorithm
2590 out_txt :=
2591 match(in_txt, in_a_var_type__)
2592 local
2593 Tpl.Text txt;
2594 DAE.Type i_var_type__;
2595 Tpl.Text txt_0;
2596 String ret_0;
2597
2598 case ( txt,
2599 DAE.T_INTEGER(varLst = _) )
2600 algorithm
2601 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
2602 then txt;
2603
2604 case ( txt,
2605 DAE.T_REAL(varLst = _) )
2606 algorithm
2607 2155 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
2608 then txt;
2609
2610 case ( txt,
2611 DAE.T_ENUMERATION(index = _) )
2612 algorithm
2613 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
2614 then txt;
2615
2616 case ( txt,
2617 DAE.T_BOOL(varLst = _) )
2618 algorithm
2619 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
2620 then txt;
2621
2622 case ( txt,
2623 DAE.T_ARRAY(ty = DAE.T_INTEGER(varLst = _)) )
2624 algorithm
2625 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
2626 then txt;
2627
2628 case ( txt,
2629 DAE.T_ARRAY(ty = DAE.T_REAL(varLst = _)) )
2630 algorithm
2631 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
2632 then txt;
2633
2634 case ( txt,
2635 DAE.T_ARRAY(ty = DAE.T_ENUMERATION(index = _)) )
2636 algorithm
2637 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
2638 then txt;
2639
2640 case ( txt,
2641 DAE.T_ARRAY(ty = DAE.T_BOOL(varLst = _)) )
2642 algorithm
2643 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
2644 then txt;
2645
2646 case ( txt,
2647 DAE.T_STRING(varLst = _) )
2648 algorithm
2649 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("omc_string_new(\"\")"));
2650 then txt;
2651
2652 case ( txt,
2653 DAE.T_ARRAY(ty = DAE.T_STRING(varLst = _)) )
2654 algorithm
2655 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("omc_string_new(\"\")"));
2656 then txt;
2657
2658 case ( txt,
2659 i_var_type__ )
2660 algorithm
2661 ✗ txt_0 := Tpl.writeTok(Tpl.emptyTxt, Tpl.ST_STRING("Unknown type for initValDefault: "));
2662 ✗ ret_0 := TypesDump.unparseType(i_var_type__);
2663 ✗ txt_0 := Tpl.writeStr(txt_0, ret_0);
2664 ✗ txt := CodegenUtil.error(txt, Tpl.sourceInfo("CodegenFMU.tpl", 682, 22), Tpl.textString(txt_0));
2665 then txt;
2666 end match;
2667 end fun_118;
2668
2669 protected function fun_119
2670 input Tpl.Text in_txt;
2671 input Option<DAE.Exp> in_a_var_initialValue;
2672 input DAE.Type in_a_var_type__;
2673
2674 output Tpl.Text out_txt;
2675 algorithm
2676 out_txt :=
2677 match(in_txt, in_a_var_initialValue, in_a_var_type__)
2678 local
2679 Tpl.Text txt;
2680 DAE.Type a_var_type__;
2681 DAE.Exp i_v;
2682
2683 case ( txt,
2684 SOME((i_v as DAE.SCONST(string = _))),
2685 _ )
2686 algorithm
2687 121 txt := Tpl.writeTok(txt, Tpl.ST_STRING("omc_string_new("));
2688 121 txt := initVal(txt, i_v);
2689 121 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2690 then txt;
2691
2692 case ( txt,
2693 SOME((i_v as DAE.ICONST(integer = _))),
2694 _ )
2695 algorithm
2696 281 txt := initVal(txt, i_v);
2697 then txt;
2698
2699 case ( txt,
2700 SOME((i_v as DAE.RCONST(real = _))),
2701 _ )
2702 algorithm
2703 4004 txt := initVal(txt, i_v);
2704 then txt;
2705
2706 case ( txt,
2707 SOME((i_v as DAE.BCONST(bool = _))),
2708 _ )
2709 algorithm
2710 205 txt := initVal(txt, i_v);
2711 then txt;
2712
2713 case ( txt,
2714 SOME((i_v as DAE.ENUM_LITERAL(name = _))),
2715 _ )
2716 algorithm
2717 37 txt := initVal(txt, i_v);
2718 then txt;
2719
2720 case ( txt,
2721 SOME((i_v as DAE.ARRAY(ty = _))),
2722 _ )
2723 algorithm
2724 3 txt := initVal(txt, i_v);
2725 then txt;
2726
2727 case ( txt,
2728 SOME((i_v as DAE.REDUCTION(reductionInfo = _))),
2729 _ )
2730 algorithm
2731 1 txt := initVal(txt, i_v);
2732 then txt;
2733
2734 case ( txt,
2735 _,
2736 a_var_type__ )
2737 algorithm
2738 2182 txt := fun_118(txt, a_var_type__);
2739 then txt;
2740 end match;
2741 end fun_119;
2742
2743 public function initValDefault
2744 input Tpl.Text in_txt;
2745 input SimCodeVar.SimVar in_a_var;
2746
2747 output Tpl.Text out_txt;
2748 algorithm
2749 out_txt :=
2750 match(in_txt, in_a_var)
2751 local
2752 Tpl.Text txt;
2753 DAE.Type i_var_type__;
2754 Option<DAE.Exp> i_var_initialValue;
2755
2756 case ( txt,
2757 SimCodeVar.SIMVAR(initialValue = i_var_initialValue, type_ = i_var_type__) )
2758 algorithm
2759 6834 txt := fun_119(txt, i_var_initialValue, i_var_type__);
2760 then txt;
2761
2762 case ( txt,
2763 _ )
2764 then txt;
2765 end match;
2766 end initValDefault;
2767
2768 protected function fun_121
2769 input Tpl.Text in_txt;
2770 input Boolean in_a_bool;
2771
2772 output Tpl.Text out_txt;
2773 algorithm
2774 out_txt :=
2775 match(in_txt, in_a_bool)
2776 local
2777 Tpl.Text txt;
2778
2779 case ( txt,
2780 false )
2781 algorithm
2782 127 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
2783 then txt;
2784
2785 case ( txt,
2786 _ )
2787 algorithm
2788 78 txt := Tpl.writeTok(txt, Tpl.ST_STRING("1"));
2789 then txt;
2790 end match;
2791 end fun_121;
2792
2793 public function initVal
2794 input Tpl.Text in_txt;
2795 input DAE.Exp in_a_initialValue;
2796
2797 output Tpl.Text out_txt;
2798 algorithm
2799 out_txt :=
2800 match(in_txt, in_a_initialValue)
2801 local
2802 Tpl.Text txt;
2803 DAE.Exp i_initialValue;
2804 DAE.Exp i_first;
2805 Integer i_index;
2806 Boolean i_bool;
2807 String i_string;
2808 Real i_real;
2809 Integer i_integer;
2810 Tpl.Text txt_1;
2811 String ret_1;
2812 String ret_0;
2813
2814 case ( txt,
2815 DAE.ICONST(integer = i_integer) )
2816 algorithm
2817 281 txt := Tpl.writeStr(txt, intString(i_integer));
2818 then txt;
2819
2820 case ( txt,
2821 DAE.RCONST(real = i_real) )
2822 algorithm
2823 4008 txt := Tpl.writeStr(txt, realString(i_real));
2824 then txt;
2825
2826 case ( txt,
2827 DAE.SCONST(string = i_string) )
2828 algorithm
2829 121 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
2830 121 ret_0 := Util.escapeModelicaStringToXmlString(i_string);
2831 121 txt := Tpl.writeStr(txt, ret_0);
2832 121 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
2833 then txt;
2834
2835 case ( txt,
2836 DAE.BCONST(bool = i_bool) )
2837 algorithm
2838 205 txt := fun_121(txt, i_bool);
2839 then txt;
2840
2841 case ( txt,
2842 DAE.ENUM_LITERAL(index = i_index) )
2843 algorithm
2844 37 txt := Tpl.writeStr(txt, intString(i_index));
2845 then txt;
2846
2847 case ( txt,
2848 DAE.ARRAY(array = i_first :: _) )
2849 algorithm
2850 3 txt := initVal(txt, i_first);
2851 then txt;
2852
2853 case ( txt,
2854 DAE.REDUCTION(expr = i_first) )
2855 algorithm
2856 1 txt := initVal(txt, i_first);
2857 then txt;
2858
2859 case ( txt,
2860 i_initialValue )
2861 algorithm
2862 ✗ txt_1 := Tpl.writeTok(Tpl.emptyTxt, Tpl.ST_STRING("initial value of unknown type: "));
2863 ✗ ret_1 := ExpressionBasics.printExpStr(i_initialValue);
2864 ✗ txt_1 := Tpl.writeStr(txt_1, ret_1);
2865 ✗ txt := CodegenUtil.error(txt, Tpl.sourceInfo("CodegenFMU.tpl", 696, 14), Tpl.textString(txt_1));
2866 then txt;
2867 end match;
2868 end initVal;
2869
2870 public function eventUpdateFunction
2871 input Tpl.Text in_txt;
2872 input SimCode.SimCode in_a_simCode;
2873
2874 output Tpl.Text out_txt;
2875 algorithm
2876 out_txt :=
2877 match(in_txt, in_a_simCode)
2878 local
2879 Tpl.Text txt;
2880
2881 case ( txt,
2882 SimCode.SIMCODE(modelInfo = _) )
2883 algorithm
2884 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
2885 "// Used to set the next time event, if any.\n",
2886 "void eventUpdate(ModelInstance* comp, fmiEventInfo* eventInfo) {\n",
2887 "}\n",
2888 "\n"
2889 }, true));
2890 then txt;
2891
2892 case ( txt,
2893 _ )
2894 then txt;
2895 end match;
2896 end eventUpdateFunction;
2897
2898 protected function lm_124
2899 input output Tpl.Text txt;
2900 input list<SimCodeVar.SimVar> items;
2901 input SimCode.SimCode a_simCode;
2902 algorithm
2903
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 2 times.
3 for lstElt_124 in items loop
2904 txt := match lstElt_124
2905 local
2906 SimCodeVar.SimVar i_var;
2907
2908 case i_var
2909 algorithm
2910 1 txt := SwitchVars(txt, a_simCode, i_var, "realVars");
2911 1 txt := Tpl.nextIter(txt);
2912 then txt;
2913 end match;
2914 end for;
2915 end lm_124;
2916
2917 protected function lm_125
2918 input output Tpl.Text txt;
2919 input list<SimCodeVar.SimVar> items;
2920 input SimCode.SimCode a_simCode;
2921 algorithm
2922
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 2 times.
3 for lstElt_125 in items loop
2923 txt := match lstElt_125
2924 local
2925 SimCodeVar.SimVar i_var;
2926
2927 case i_var
2928 algorithm
2929 1 txt := SwitchVars(txt, a_simCode, i_var, "realVars");
2930 1 txt := Tpl.nextIter(txt);
2931 then txt;
2932 end match;
2933 end for;
2934 end lm_125;
2935
2936 protected function lm_126
2937 input output Tpl.Text txt;
2938 input list<SimCodeVar.SimVar> items;
2939 input SimCode.SimCode a_simCode;
2940 algorithm
2941
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_126 in items loop
2942 txt := match lstElt_126
2943 local
2944 SimCodeVar.SimVar i_var;
2945
2946 case i_var
2947 algorithm
2948 ✗ txt := SwitchVars(txt, a_simCode, i_var, "realVars");
2949 ✗ txt := Tpl.nextIter(txt);
2950 then txt;
2951 end match;
2952 end for;
2953 end lm_126;
2954
2955 protected function lm_127
2956 input output Tpl.Text txt;
2957 input list<SimCodeVar.SimVar> items;
2958 input SimCode.SimCode a_simCode;
2959 algorithm
2960
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_127 in items loop
2961 txt := match lstElt_127
2962 local
2963 SimCodeVar.SimVar i_var;
2964
2965 case i_var
2966 algorithm
2967 ✗ txt := SwitchVars(txt, a_simCode, i_var, "realVars");
2968 ✗ txt := Tpl.nextIter(txt);
2969 then txt;
2970 end match;
2971 end for;
2972 end lm_127;
2973
2974 protected function lm_128
2975 input output Tpl.Text txt;
2976 input list<SimCodeVar.SimVar> items;
2977 input SimCode.SimCode a_simCode;
2978 algorithm
2979
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_128 in items loop
2980 txt := match lstElt_128
2981 local
2982 SimCodeVar.SimVar i_var;
2983
2984 case i_var
2985 algorithm
2986 ✗ txt := SwitchParameters(txt, a_simCode, i_var, "realParameter");
2987 ✗ txt := Tpl.nextIter(txt);
2988 then txt;
2989 end match;
2990 end for;
2991 end lm_128;
2992
2993 protected function lm_129
2994 input output Tpl.Text txt;
2995 input list<SimCodeVar.SimVar> items;
2996 input SimCode.SimCode a_simCode;
2997 algorithm
2998
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_129 in items loop
2999 txt := match lstElt_129
3000 local
3001 SimCodeVar.SimVar i_var;
3002
3003 case i_var
3004 algorithm
3005 ✗ txt := SwitchAliasVars(txt, a_simCode, i_var, "Real", "-");
3006 ✗ txt := Tpl.nextIter(txt);
3007 then txt;
3008 end match;
3009 end for;
3010 end lm_129;
3011
3012 protected function fun_130
3013 input Tpl.Text in_txt;
3014 input SimCode.ModelInfo in_a_modelInfo;
3015 input SimCode.SimCode in_a_simCode;
3016
3017 output Tpl.Text out_txt;
3018 algorithm
3019 out_txt :=
3020 match(in_txt, in_a_modelInfo, in_a_simCode)
3021 local
3022 Tpl.Text txt;
3023 SimCode.SimCode a_simCode;
3024 list<SimCodeVar.SimVar> i_vars_aliasVars;
3025 list<SimCodeVar.SimVar> i_vars_paramVars;
3026 list<SimCodeVar.SimVar> i_vars_discreteAlgVars;
3027 list<SimCodeVar.SimVar> i_vars_algVars;
3028 list<SimCodeVar.SimVar> i_vars_derivativeVars;
3029 list<SimCodeVar.SimVar> i_vars_stateVars;
3030
3031 case ( txt,
3032 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stateVars = i_vars_stateVars, derivativeVars = i_vars_derivativeVars, algVars = i_vars_algVars, discreteAlgVars = i_vars_discreteAlgVars, paramVars = i_vars_paramVars, aliasVars = i_vars_aliasVars), varInfo = SimCode.VARINFO(numStateVars = _, numAlgVars = _)),
3033 a_simCode )
3034 algorithm
3035 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3036 "fmiReal getReal(ModelInstance* comp, const fmiValueReference vr) {\n",
3037 " switch (vr) {\n"
3038 }, true));
3039 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
3040 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3041 2 txt := lm_124(txt, i_vars_stateVars, a_simCode);
3042 2 txt := Tpl.popIter(txt);
3043 2 txt := Tpl.softNewLine(txt);
3044 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3045 2 txt := lm_125(txt, i_vars_derivativeVars, a_simCode);
3046 2 txt := Tpl.popIter(txt);
3047 2 txt := Tpl.softNewLine(txt);
3048 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3049 2 txt := lm_126(txt, i_vars_algVars, a_simCode);
3050 2 txt := Tpl.popIter(txt);
3051 2 txt := Tpl.softNewLine(txt);
3052 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3053 2 txt := lm_127(txt, i_vars_discreteAlgVars, a_simCode);
3054 2 txt := Tpl.popIter(txt);
3055 2 txt := Tpl.softNewLine(txt);
3056 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3057 2 txt := lm_128(txt, i_vars_paramVars, a_simCode);
3058 2 txt := Tpl.popIter(txt);
3059 2 txt := Tpl.softNewLine(txt);
3060 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3061 2 txt := lm_129(txt, i_vars_aliasVars, a_simCode);
3062 2 txt := Tpl.popIter(txt);
3063 2 txt := Tpl.softNewLine(txt);
3064 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3065 "default:\n",
3066 " return 0;\n"
3067 }, true));
3068 2 txt := Tpl.popBlock(txt);
3069 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3070 " }\n",
3071 "}\n",
3072 "\n"
3073 }, true));
3074 then txt;
3075
3076 case ( txt,
3077 _,
3078 _ )
3079 then txt;
3080 end match;
3081 end fun_130;
3082
3083 public function getRealFunction
3084 input Tpl.Text txt;
3085 input SimCode.SimCode a_simCode;
3086 input SimCode.ModelInfo a_modelInfo;
3087
3088 output Tpl.Text out_txt;
3089 algorithm
3090 2 out_txt := fun_130(txt, a_modelInfo, a_simCode);
3091 end getRealFunction;
3092
3093 protected function lm_132
3094 input output Tpl.Text txt;
3095 input list<SimCodeVar.SimVar> items;
3096 input SimCode.SimCode a_simCode;
3097 algorithm
3098
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 2 times.
3 for lstElt_132 in items loop
3099 txt := match lstElt_132
3100 local
3101 SimCodeVar.SimVar i_var;
3102
3103 case i_var
3104 algorithm
3105 1 txt := SwitchVarsSet(txt, a_simCode, i_var, "realVars");
3106 1 txt := Tpl.nextIter(txt);
3107 then txt;
3108 end match;
3109 end for;
3110 end lm_132;
3111
3112 protected function lm_133
3113 input output Tpl.Text txt;
3114 input list<SimCodeVar.SimVar> items;
3115 input SimCode.SimCode a_simCode;
3116 algorithm
3117
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 2 times.
3 for lstElt_133 in items loop
3118 txt := match lstElt_133
3119 local
3120 SimCodeVar.SimVar i_var;
3121
3122 case i_var
3123 algorithm
3124 1 txt := SwitchVarsSet(txt, a_simCode, i_var, "realVars");
3125 1 txt := Tpl.nextIter(txt);
3126 then txt;
3127 end match;
3128 end for;
3129 end lm_133;
3130
3131 protected function lm_134
3132 input output Tpl.Text txt;
3133 input list<SimCodeVar.SimVar> items;
3134 input SimCode.SimCode a_simCode;
3135 algorithm
3136
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_134 in items loop
3137 txt := match lstElt_134
3138 local
3139 SimCodeVar.SimVar i_var;
3140
3141 case i_var
3142 algorithm
3143 ✗ txt := SwitchVarsSet(txt, a_simCode, i_var, "realVars");
3144 ✗ txt := Tpl.nextIter(txt);
3145 then txt;
3146 end match;
3147 end for;
3148 end lm_134;
3149
3150 protected function lm_135
3151 input output Tpl.Text txt;
3152 input list<SimCodeVar.SimVar> items;
3153 input SimCode.SimCode a_simCode;
3154 algorithm
3155
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_135 in items loop
3156 txt := match lstElt_135
3157 local
3158 SimCodeVar.SimVar i_var;
3159
3160 case i_var
3161 algorithm
3162 ✗ txt := SwitchVarsSet(txt, a_simCode, i_var, "realVars");
3163 ✗ txt := Tpl.nextIter(txt);
3164 then txt;
3165 end match;
3166 end for;
3167 end lm_135;
3168
3169 protected function lm_136
3170 input output Tpl.Text txt;
3171 input list<SimCodeVar.SimVar> items;
3172 input SimCode.SimCode a_simCode;
3173 algorithm
3174
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_136 in items loop
3175 txt := match lstElt_136
3176 local
3177 SimCodeVar.SimVar i_var;
3178
3179 case i_var
3180 algorithm
3181 ✗ txt := SwitchParametersSet(txt, a_simCode, i_var, "realParameter");
3182 ✗ txt := Tpl.nextIter(txt);
3183 then txt;
3184 end match;
3185 end for;
3186 end lm_136;
3187
3188 protected function lm_137
3189 input output Tpl.Text txt;
3190 input list<SimCodeVar.SimVar> items;
3191 input SimCode.SimCode a_simCode;
3192 algorithm
3193
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_137 in items loop
3194 txt := match lstElt_137
3195 local
3196 SimCodeVar.SimVar i_var;
3197
3198 case i_var
3199 algorithm
3200 ✗ txt := SwitchAliasVarsSet(txt, a_simCode, i_var, "Real", "-");
3201 ✗ txt := Tpl.nextIter(txt);
3202 then txt;
3203 end match;
3204 end for;
3205 end lm_137;
3206
3207 protected function fun_138
3208 input Tpl.Text in_txt;
3209 input SimCode.ModelInfo in_a_modelInfo;
3210 input SimCode.SimCode in_a_simCode;
3211
3212 output Tpl.Text out_txt;
3213 algorithm
3214 out_txt :=
3215 match(in_txt, in_a_modelInfo, in_a_simCode)
3216 local
3217 Tpl.Text txt;
3218 SimCode.SimCode a_simCode;
3219 list<SimCodeVar.SimVar> i_vars_aliasVars;
3220 list<SimCodeVar.SimVar> i_vars_paramVars;
3221 list<SimCodeVar.SimVar> i_vars_discreteAlgVars;
3222 list<SimCodeVar.SimVar> i_vars_algVars;
3223 list<SimCodeVar.SimVar> i_vars_derivativeVars;
3224 list<SimCodeVar.SimVar> i_vars_stateVars;
3225
3226 case ( txt,
3227 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stateVars = i_vars_stateVars, derivativeVars = i_vars_derivativeVars, algVars = i_vars_algVars, discreteAlgVars = i_vars_discreteAlgVars, paramVars = i_vars_paramVars, aliasVars = i_vars_aliasVars), varInfo = SimCode.VARINFO(numStateVars = _, numAlgVars = _)),
3228 a_simCode )
3229 algorithm
3230 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3231 "fmiStatus setReal(ModelInstance* comp, const fmiValueReference vr, const fmiReal value) {\n",
3232 " switch (vr) {\n"
3233 }, true));
3234 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
3235 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3236 2 txt := lm_132(txt, i_vars_stateVars, a_simCode);
3237 2 txt := Tpl.popIter(txt);
3238 2 txt := Tpl.softNewLine(txt);
3239 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3240 2 txt := lm_133(txt, i_vars_derivativeVars, a_simCode);
3241 2 txt := Tpl.popIter(txt);
3242 2 txt := Tpl.softNewLine(txt);
3243 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3244 2 txt := lm_134(txt, i_vars_algVars, a_simCode);
3245 2 txt := Tpl.popIter(txt);
3246 2 txt := Tpl.softNewLine(txt);
3247 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3248 2 txt := lm_135(txt, i_vars_discreteAlgVars, a_simCode);
3249 2 txt := Tpl.popIter(txt);
3250 2 txt := Tpl.softNewLine(txt);
3251 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3252 2 txt := lm_136(txt, i_vars_paramVars, a_simCode);
3253 2 txt := Tpl.popIter(txt);
3254 2 txt := Tpl.softNewLine(txt);
3255 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3256 2 txt := lm_137(txt, i_vars_aliasVars, a_simCode);
3257 2 txt := Tpl.popIter(txt);
3258 2 txt := Tpl.softNewLine(txt);
3259 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3260 "default:\n",
3261 " return fmiError;\n"
3262 }, true));
3263 2 txt := Tpl.popBlock(txt);
3264 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3265 " }\n",
3266 " return fmiOK;\n",
3267 "}\n",
3268 "\n"
3269 }, true));
3270 then txt;
3271
3272 case ( txt,
3273 _,
3274 _ )
3275 then txt;
3276 end match;
3277 end fun_138;
3278
3279 public function setRealFunction
3280 input Tpl.Text txt;
3281 input SimCode.SimCode a_simCode;
3282 input SimCode.ModelInfo a_modelInfo;
3283
3284 output Tpl.Text out_txt;
3285 algorithm
3286 2 out_txt := fun_138(txt, a_modelInfo, a_simCode);
3287 end setRealFunction;
3288
3289 protected function lm_140
3290 input output Tpl.Text txt;
3291 input list<SimCodeVar.SimVar> items;
3292 input SimCode.SimCode a_simCode;
3293 algorithm
3294
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_140 in items loop
3295 txt := match lstElt_140
3296 local
3297 SimCodeVar.SimVar i_var;
3298
3299 case i_var
3300 algorithm
3301 ✗ txt := SwitchVars(txt, a_simCode, i_var, "integerVars");
3302 ✗ txt := Tpl.nextIter(txt);
3303 then txt;
3304 end match;
3305 end for;
3306 end lm_140;
3307
3308 protected function lm_141
3309 input output Tpl.Text txt;
3310 input list<SimCodeVar.SimVar> items;
3311 input SimCode.SimCode a_simCode;
3312 algorithm
3313
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_141 in items loop
3314 txt := match lstElt_141
3315 local
3316 SimCodeVar.SimVar i_var;
3317
3318 case i_var
3319 algorithm
3320 ✗ txt := SwitchParameters(txt, a_simCode, i_var, "integerParameter");
3321 ✗ txt := Tpl.nextIter(txt);
3322 then txt;
3323 end match;
3324 end for;
3325 end lm_141;
3326
3327 protected function lm_142
3328 input output Tpl.Text txt;
3329 input list<SimCodeVar.SimVar> items;
3330 input SimCode.SimCode a_simCode;
3331 algorithm
3332
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_142 in items loop
3333 txt := match lstElt_142
3334 local
3335 SimCodeVar.SimVar i_var;
3336
3337 case i_var
3338 algorithm
3339 ✗ txt := SwitchAliasVars(txt, a_simCode, i_var, "Integer", "-");
3340 ✗ txt := Tpl.nextIter(txt);
3341 then txt;
3342 end match;
3343 end for;
3344 end lm_142;
3345
3346 protected function fun_143
3347 input Tpl.Text in_txt;
3348 input SimCode.ModelInfo in_a_modelInfo;
3349 input SimCode.SimCode in_a_simCode;
3350
3351 output Tpl.Text out_txt;
3352 algorithm
3353 out_txt :=
3354 match(in_txt, in_a_modelInfo, in_a_simCode)
3355 local
3356 Tpl.Text txt;
3357 SimCode.SimCode a_simCode;
3358 list<SimCodeVar.SimVar> i_vars_intAliasVars;
3359 list<SimCodeVar.SimVar> i_vars_intParamVars;
3360 list<SimCodeVar.SimVar> i_vars_intAlgVars;
3361
3362 case ( txt,
3363 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(intAlgVars = i_vars_intAlgVars, intParamVars = i_vars_intParamVars, intAliasVars = i_vars_intAliasVars)),
3364 a_simCode )
3365 algorithm
3366 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3367 "fmiInteger getInteger(ModelInstance* comp, const fmiValueReference vr) {\n",
3368 " switch (vr) {\n"
3369 }, true));
3370 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
3371 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3372 2 txt := lm_140(txt, i_vars_intAlgVars, a_simCode);
3373 2 txt := Tpl.popIter(txt);
3374 2 txt := Tpl.softNewLine(txt);
3375 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3376 2 txt := lm_141(txt, i_vars_intParamVars, a_simCode);
3377 2 txt := Tpl.popIter(txt);
3378 2 txt := Tpl.softNewLine(txt);
3379 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3380 2 txt := lm_142(txt, i_vars_intAliasVars, a_simCode);
3381 2 txt := Tpl.popIter(txt);
3382 2 txt := Tpl.softNewLine(txt);
3383 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3384 "default:\n",
3385 " return 0;\n"
3386 }, true));
3387 2 txt := Tpl.popBlock(txt);
3388 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3389 " }\n",
3390 "}"
3391 }, false));
3392 then txt;
3393
3394 case ( txt,
3395 _,
3396 _ )
3397 then txt;
3398 end match;
3399 end fun_143;
3400
3401 public function getIntegerFunction
3402 input Tpl.Text txt;
3403 input SimCode.SimCode a_simCode;
3404 input SimCode.ModelInfo a_modelInfo;
3405
3406 output Tpl.Text out_txt;
3407 algorithm
3408 2 out_txt := fun_143(txt, a_modelInfo, a_simCode);
3409 end getIntegerFunction;
3410
3411 protected function lm_145
3412 input output Tpl.Text txt;
3413 input list<SimCodeVar.SimVar> items;
3414 input SimCode.SimCode a_simCode;
3415 algorithm
3416
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_145 in items loop
3417 txt := match lstElt_145
3418 local
3419 SimCodeVar.SimVar i_var;
3420
3421 case i_var
3422 algorithm
3423 ✗ txt := SwitchVarsSet(txt, a_simCode, i_var, "integerVars");
3424 ✗ txt := Tpl.nextIter(txt);
3425 then txt;
3426 end match;
3427 end for;
3428 end lm_145;
3429
3430 protected function lm_146
3431 input output Tpl.Text txt;
3432 input list<SimCodeVar.SimVar> items;
3433 input SimCode.SimCode a_simCode;
3434 algorithm
3435
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_146 in items loop
3436 txt := match lstElt_146
3437 local
3438 SimCodeVar.SimVar i_var;
3439
3440 case i_var
3441 algorithm
3442 ✗ txt := SwitchParametersSet(txt, a_simCode, i_var, "integerParameter");
3443 ✗ txt := Tpl.nextIter(txt);
3444 then txt;
3445 end match;
3446 end for;
3447 end lm_146;
3448
3449 protected function lm_147
3450 input output Tpl.Text txt;
3451 input list<SimCodeVar.SimVar> items;
3452 input SimCode.SimCode a_simCode;
3453 algorithm
3454
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_147 in items loop
3455 txt := match lstElt_147
3456 local
3457 SimCodeVar.SimVar i_var;
3458
3459 case i_var
3460 algorithm
3461 ✗ txt := SwitchAliasVarsSet(txt, a_simCode, i_var, "Integer", "-");
3462 ✗ txt := Tpl.nextIter(txt);
3463 then txt;
3464 end match;
3465 end for;
3466 end lm_147;
3467
3468 protected function fun_148
3469 input Tpl.Text in_txt;
3470 input SimCode.ModelInfo in_a_modelInfo;
3471 input SimCode.SimCode in_a_simCode;
3472
3473 output Tpl.Text out_txt;
3474 algorithm
3475 out_txt :=
3476 match(in_txt, in_a_modelInfo, in_a_simCode)
3477 local
3478 Tpl.Text txt;
3479 SimCode.SimCode a_simCode;
3480 list<SimCodeVar.SimVar> i_vars_intAliasVars;
3481 list<SimCodeVar.SimVar> i_vars_intParamVars;
3482 list<SimCodeVar.SimVar> i_vars_intAlgVars;
3483
3484 case ( txt,
3485 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(intAlgVars = i_vars_intAlgVars, intParamVars = i_vars_intParamVars, intAliasVars = i_vars_intAliasVars)),
3486 a_simCode )
3487 algorithm
3488 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3489 "fmiStatus setInteger(ModelInstance* comp, const fmiValueReference vr, const fmiInteger value) {\n",
3490 " switch (vr) {\n"
3491 }, true));
3492 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
3493 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3494 2 txt := lm_145(txt, i_vars_intAlgVars, a_simCode);
3495 2 txt := Tpl.popIter(txt);
3496 2 txt := Tpl.softNewLine(txt);
3497 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3498 2 txt := lm_146(txt, i_vars_intParamVars, a_simCode);
3499 2 txt := Tpl.popIter(txt);
3500 2 txt := Tpl.softNewLine(txt);
3501 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3502 2 txt := lm_147(txt, i_vars_intAliasVars, a_simCode);
3503 2 txt := Tpl.popIter(txt);
3504 2 txt := Tpl.softNewLine(txt);
3505 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3506 "default:\n",
3507 " return fmiError;\n"
3508 }, true));
3509 2 txt := Tpl.popBlock(txt);
3510 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3511 " }\n",
3512 " return fmiOK;\n",
3513 "}"
3514 }, false));
3515 then txt;
3516
3517 case ( txt,
3518 _,
3519 _ )
3520 then txt;
3521 end match;
3522 end fun_148;
3523
3524 public function setIntegerFunction
3525 input Tpl.Text txt;
3526 input SimCode.SimCode a_simCode;
3527 input SimCode.ModelInfo a_modelInfo;
3528
3529 output Tpl.Text out_txt;
3530 algorithm
3531 2 out_txt := fun_148(txt, a_modelInfo, a_simCode);
3532 end setIntegerFunction;
3533
3534 protected function lm_150
3535 input output Tpl.Text txt;
3536 input list<SimCodeVar.SimVar> items;
3537 input SimCode.SimCode a_simCode;
3538 algorithm
3539
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
4 for lstElt_150 in items loop
3540 txt := match lstElt_150
3541 local
3542 SimCodeVar.SimVar i_var;
3543
3544 case i_var
3545 algorithm
3546 2 txt := SwitchVars(txt, a_simCode, i_var, "booleanVars");
3547 2 txt := Tpl.nextIter(txt);
3548 then txt;
3549 end match;
3550 end for;
3551 end lm_150;
3552
3553 protected function lm_151
3554 input output Tpl.Text txt;
3555 input list<SimCodeVar.SimVar> items;
3556 input SimCode.SimCode a_simCode;
3557 algorithm
3558
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 2 times.
6 for lstElt_151 in items loop
3559 txt := match lstElt_151
3560 local
3561 SimCodeVar.SimVar i_var;
3562
3563 case i_var
3564 algorithm
3565 4 txt := SwitchParameters(txt, a_simCode, i_var, "booleanParameter");
3566 4 txt := Tpl.nextIter(txt);
3567 then txt;
3568 end match;
3569 end for;
3570 end lm_151;
3571
3572 protected function lm_152
3573 input output Tpl.Text txt;
3574 input list<SimCodeVar.SimVar> items;
3575 input SimCode.SimCode a_simCode;
3576 algorithm
3577
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_152 in items loop
3578 txt := match lstElt_152
3579 local
3580 SimCodeVar.SimVar i_var;
3581
3582 case i_var
3583 algorithm
3584 ✗ txt := SwitchAliasVars(txt, a_simCode, i_var, "Boolean", "!");
3585 ✗ txt := Tpl.nextIter(txt);
3586 then txt;
3587 end match;
3588 end for;
3589 end lm_152;
3590
3591 protected function fun_153
3592 input Tpl.Text in_txt;
3593 input SimCode.ModelInfo in_a_modelInfo;
3594 input SimCode.SimCode in_a_simCode;
3595
3596 output Tpl.Text out_txt;
3597 algorithm
3598 out_txt :=
3599 match(in_txt, in_a_modelInfo, in_a_simCode)
3600 local
3601 Tpl.Text txt;
3602 SimCode.SimCode a_simCode;
3603 list<SimCodeVar.SimVar> i_vars_boolAliasVars;
3604 list<SimCodeVar.SimVar> i_vars_boolParamVars;
3605 list<SimCodeVar.SimVar> i_vars_boolAlgVars;
3606
3607 case ( txt,
3608 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(boolAlgVars = i_vars_boolAlgVars, boolParamVars = i_vars_boolParamVars, boolAliasVars = i_vars_boolAliasVars)),
3609 a_simCode )
3610 algorithm
3611 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3612 "fmiBoolean getBoolean(ModelInstance* comp, const fmiValueReference vr) {\n",
3613 " switch (vr) {\n"
3614 }, true));
3615 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
3616 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3617 2 txt := lm_150(txt, i_vars_boolAlgVars, a_simCode);
3618 2 txt := Tpl.popIter(txt);
3619 2 txt := Tpl.softNewLine(txt);
3620 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3621 2 txt := lm_151(txt, i_vars_boolParamVars, a_simCode);
3622 2 txt := Tpl.popIter(txt);
3623 2 txt := Tpl.softNewLine(txt);
3624 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3625 2 txt := lm_152(txt, i_vars_boolAliasVars, a_simCode);
3626 2 txt := Tpl.popIter(txt);
3627 2 txt := Tpl.softNewLine(txt);
3628 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3629 "default:\n",
3630 " return fmiFalse;\n"
3631 }, true));
3632 2 txt := Tpl.popBlock(txt);
3633 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3634 " }\n",
3635 "}\n",
3636 "\n"
3637 }, true));
3638 then txt;
3639
3640 case ( txt,
3641 _,
3642 _ )
3643 then txt;
3644 end match;
3645 end fun_153;
3646
3647 public function getBooleanFunction
3648 input Tpl.Text txt;
3649 input SimCode.SimCode a_simCode;
3650 input SimCode.ModelInfo a_modelInfo;
3651
3652 output Tpl.Text out_txt;
3653 algorithm
3654 2 out_txt := fun_153(txt, a_modelInfo, a_simCode);
3655 end getBooleanFunction;
3656
3657 protected function lm_155
3658 input output Tpl.Text txt;
3659 input list<SimCodeVar.SimVar> items;
3660 input SimCode.SimCode a_simCode;
3661 algorithm
3662
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
4 for lstElt_155 in items loop
3663 txt := match lstElt_155
3664 local
3665 SimCodeVar.SimVar i_var;
3666
3667 case i_var
3668 algorithm
3669 2 txt := SwitchVarsSet(txt, a_simCode, i_var, "booleanVars");
3670 2 txt := Tpl.nextIter(txt);
3671 then txt;
3672 end match;
3673 end for;
3674 end lm_155;
3675
3676 protected function lm_156
3677 input output Tpl.Text txt;
3678 input list<SimCodeVar.SimVar> items;
3679 input SimCode.SimCode a_simCode;
3680 algorithm
3681
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 2 times.
6 for lstElt_156 in items loop
3682 txt := match lstElt_156
3683 local
3684 SimCodeVar.SimVar i_var;
3685
3686 case i_var
3687 algorithm
3688 4 txt := SwitchParametersSet(txt, a_simCode, i_var, "booleanParameter");
3689 4 txt := Tpl.nextIter(txt);
3690 then txt;
3691 end match;
3692 end for;
3693 end lm_156;
3694
3695 protected function lm_157
3696 input output Tpl.Text txt;
3697 input list<SimCodeVar.SimVar> items;
3698 input SimCode.SimCode a_simCode;
3699 algorithm
3700
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_157 in items loop
3701 txt := match lstElt_157
3702 local
3703 SimCodeVar.SimVar i_var;
3704
3705 case i_var
3706 algorithm
3707 ✗ txt := SwitchAliasVarsSet(txt, a_simCode, i_var, "Boolean", "!");
3708 ✗ txt := Tpl.nextIter(txt);
3709 then txt;
3710 end match;
3711 end for;
3712 end lm_157;
3713
3714 protected function fun_158
3715 input Tpl.Text in_txt;
3716 input SimCode.ModelInfo in_a_modelInfo;
3717 input SimCode.SimCode in_a_simCode;
3718
3719 output Tpl.Text out_txt;
3720 algorithm
3721 out_txt :=
3722 match(in_txt, in_a_modelInfo, in_a_simCode)
3723 local
3724 Tpl.Text txt;
3725 SimCode.SimCode a_simCode;
3726 list<SimCodeVar.SimVar> i_vars_boolAliasVars;
3727 list<SimCodeVar.SimVar> i_vars_boolParamVars;
3728 list<SimCodeVar.SimVar> i_vars_boolAlgVars;
3729
3730 case ( txt,
3731 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(boolAlgVars = i_vars_boolAlgVars, boolParamVars = i_vars_boolParamVars, boolAliasVars = i_vars_boolAliasVars)),
3732 a_simCode )
3733 algorithm
3734 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3735 "fmiStatus setBoolean(ModelInstance* comp, const fmiValueReference vr, const fmiBoolean value) {\n",
3736 " switch (vr) {\n"
3737 }, true));
3738 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
3739 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3740 2 txt := lm_155(txt, i_vars_boolAlgVars, a_simCode);
3741 2 txt := Tpl.popIter(txt);
3742 2 txt := Tpl.softNewLine(txt);
3743 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3744 2 txt := lm_156(txt, i_vars_boolParamVars, a_simCode);
3745 2 txt := Tpl.popIter(txt);
3746 2 txt := Tpl.softNewLine(txt);
3747 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3748 2 txt := lm_157(txt, i_vars_boolAliasVars, a_simCode);
3749 2 txt := Tpl.popIter(txt);
3750 2 txt := Tpl.softNewLine(txt);
3751 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3752 "default:\n",
3753 " return fmiError;\n"
3754 }, true));
3755 2 txt := Tpl.popBlock(txt);
3756 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3757 " }\n",
3758 " return fmiOK;\n",
3759 "}\n",
3760 "\n"
3761 }, true));
3762 then txt;
3763
3764 case ( txt,
3765 _,
3766 _ )
3767 then txt;
3768 end match;
3769 end fun_158;
3770
3771 public function setBooleanFunction
3772 input Tpl.Text txt;
3773 input SimCode.SimCode a_simCode;
3774 input SimCode.ModelInfo a_modelInfo;
3775
3776 output Tpl.Text out_txt;
3777 algorithm
3778 2 out_txt := fun_158(txt, a_modelInfo, a_simCode);
3779 end setBooleanFunction;
3780
3781 protected function lm_160
3782 input output Tpl.Text txt;
3783 input list<SimCodeVar.SimVar> items;
3784 input SimCode.SimCode a_simCode;
3785 algorithm
3786
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_160 in items loop
3787 txt := match lstElt_160
3788 local
3789 SimCodeVar.SimVar i_var;
3790
3791 case i_var
3792 algorithm
3793 ✗ txt := SwitchVars(txt, a_simCode, i_var, "stringVars");
3794 ✗ txt := Tpl.nextIter(txt);
3795 then txt;
3796 end match;
3797 end for;
3798 end lm_160;
3799
3800 protected function lm_161
3801 input output Tpl.Text txt;
3802 input list<SimCodeVar.SimVar> items;
3803 input SimCode.SimCode a_simCode;
3804 algorithm
3805
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_161 in items loop
3806 txt := match lstElt_161
3807 local
3808 SimCodeVar.SimVar i_var;
3809
3810 case i_var
3811 algorithm
3812 ✗ txt := SwitchParameters(txt, a_simCode, i_var, "stringParameter");
3813 ✗ txt := Tpl.nextIter(txt);
3814 then txt;
3815 end match;
3816 end for;
3817 end lm_161;
3818
3819 protected function lm_162
3820 input output Tpl.Text txt;
3821 input list<SimCodeVar.SimVar> items;
3822 input SimCode.SimCode a_simCode;
3823 algorithm
3824
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_162 in items loop
3825 txt := match lstElt_162
3826 local
3827 SimCodeVar.SimVar i_var;
3828
3829 case i_var
3830 algorithm
3831 ✗ txt := SwitchAliasVars(txt, a_simCode, i_var, "String", "");
3832 ✗ txt := Tpl.nextIter(txt);
3833 then txt;
3834 end match;
3835 end for;
3836 end lm_162;
3837
3838 protected function fun_163
3839 input Tpl.Text in_txt;
3840 input SimCode.ModelInfo in_a_modelInfo;
3841 input SimCode.SimCode in_a_simCode;
3842
3843 output Tpl.Text out_txt;
3844 algorithm
3845 out_txt :=
3846 match(in_txt, in_a_modelInfo, in_a_simCode)
3847 local
3848 Tpl.Text txt;
3849 SimCode.SimCode a_simCode;
3850 list<SimCodeVar.SimVar> i_vars_stringAliasVars;
3851 list<SimCodeVar.SimVar> i_vars_stringParamVars;
3852 list<SimCodeVar.SimVar> i_vars_stringAlgVars;
3853
3854 case ( txt,
3855 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stringAlgVars = i_vars_stringAlgVars, stringParamVars = i_vars_stringParamVars, stringAliasVars = i_vars_stringAliasVars)),
3856 a_simCode )
3857 algorithm
3858 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3859 "fmiString getString(ModelInstance* comp, const fmiValueReference vr) {\n",
3860 " switch (vr) {\n"
3861 }, true));
3862 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
3863 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3864 2 txt := lm_160(txt, i_vars_stringAlgVars, a_simCode);
3865 2 txt := Tpl.popIter(txt);
3866 2 txt := Tpl.softNewLine(txt);
3867 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3868 2 txt := lm_161(txt, i_vars_stringParamVars, a_simCode);
3869 2 txt := Tpl.popIter(txt);
3870 2 txt := Tpl.softNewLine(txt);
3871 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3872 2 txt := lm_162(txt, i_vars_stringAliasVars, a_simCode);
3873 2 txt := Tpl.popIter(txt);
3874 2 txt := Tpl.softNewLine(txt);
3875 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3876 "default:\n",
3877 " return \"\";\n"
3878 }, true));
3879 2 txt := Tpl.popBlock(txt);
3880 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3881 " }\n",
3882 "}\n",
3883 "\n"
3884 }, true));
3885 then txt;
3886
3887 case ( txt,
3888 _,
3889 _ )
3890 then txt;
3891 end match;
3892 end fun_163;
3893
3894 public function getStringFunction
3895 input Tpl.Text txt;
3896 input SimCode.SimCode a_simCode;
3897 input SimCode.ModelInfo a_modelInfo;
3898
3899 output Tpl.Text out_txt;
3900 algorithm
3901 2 out_txt := fun_163(txt, a_modelInfo, a_simCode);
3902 end getStringFunction;
3903
3904 protected function lm_165
3905 input output Tpl.Text txt;
3906 input list<SimCodeVar.SimVar> items;
3907 input SimCode.SimCode a_simCode;
3908 algorithm
3909
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_165 in items loop
3910 txt := match lstElt_165
3911 local
3912 SimCodeVar.SimVar i_var;
3913
3914 case i_var
3915 algorithm
3916 ✗ txt := SwitchVarsSet(txt, a_simCode, i_var, "stringVars");
3917 ✗ txt := Tpl.nextIter(txt);
3918 then txt;
3919 end match;
3920 end for;
3921 end lm_165;
3922
3923 protected function lm_166
3924 input output Tpl.Text txt;
3925 input list<SimCodeVar.SimVar> items;
3926 input SimCode.SimCode a_simCode;
3927 algorithm
3928
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_166 in items loop
3929 txt := match lstElt_166
3930 local
3931 SimCodeVar.SimVar i_var;
3932
3933 case i_var
3934 algorithm
3935 ✗ txt := SwitchParametersSet(txt, a_simCode, i_var, "stringParameter");
3936 ✗ txt := Tpl.nextIter(txt);
3937 then txt;
3938 end match;
3939 end for;
3940 end lm_166;
3941
3942 protected function lm_167
3943 input output Tpl.Text txt;
3944 input list<SimCodeVar.SimVar> items;
3945 input SimCode.SimCode a_simCode;
3946 algorithm
3947
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 for lstElt_167 in items loop
3948 txt := match lstElt_167
3949 local
3950 SimCodeVar.SimVar i_var;
3951
3952 case i_var
3953 algorithm
3954 ✗ txt := SwitchAliasVarsSet(txt, a_simCode, i_var, "String", "");
3955 ✗ txt := Tpl.nextIter(txt);
3956 then txt;
3957 end match;
3958 end for;
3959 end lm_167;
3960
3961 protected function fun_168
3962 input Tpl.Text in_txt;
3963 input SimCode.ModelInfo in_a_modelInfo;
3964 input SimCode.SimCode in_a_simCode;
3965
3966 output Tpl.Text out_txt;
3967 algorithm
3968 out_txt :=
3969 match(in_txt, in_a_modelInfo, in_a_simCode)
3970 local
3971 Tpl.Text txt;
3972 SimCode.SimCode a_simCode;
3973 list<SimCodeVar.SimVar> i_vars_stringAliasVars;
3974 list<SimCodeVar.SimVar> i_vars_stringParamVars;
3975 list<SimCodeVar.SimVar> i_vars_stringAlgVars;
3976
3977 case ( txt,
3978 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stringAlgVars = i_vars_stringAlgVars, stringParamVars = i_vars_stringParamVars, stringAliasVars = i_vars_stringAliasVars)),
3979 a_simCode )
3980 algorithm
3981 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3982 "fmiStatus setString(ModelInstance* comp, const fmiValueReference vr, fmiString value) {\n",
3983 " switch (vr) {\n"
3984 }, true));
3985 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
3986 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3987 2 txt := lm_165(txt, i_vars_stringAlgVars, a_simCode);
3988 2 txt := Tpl.popIter(txt);
3989 2 txt := Tpl.softNewLine(txt);
3990 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3991 2 txt := lm_166(txt, i_vars_stringParamVars, a_simCode);
3992 2 txt := Tpl.popIter(txt);
3993 2 txt := Tpl.softNewLine(txt);
3994 2 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3995 2 txt := lm_167(txt, i_vars_stringAliasVars, a_simCode);
3996 2 txt := Tpl.popIter(txt);
3997 2 txt := Tpl.softNewLine(txt);
3998 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
3999 "default:\n",
4000 " return fmiError;\n"
4001 }, true));
4002 2 txt := Tpl.popBlock(txt);
4003 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4004 " }\n",
4005 " return fmiOK;\n",
4006 "}\n",
4007 "\n"
4008 }, true));
4009 then txt;
4010
4011 case ( txt,
4012 _,
4013 _ )
4014 then txt;
4015 end match;
4016 end fun_168;
4017
4018 public function setStringFunction
4019 input Tpl.Text txt;
4020 input SimCode.SimCode a_simCode;
4021 input SimCode.ModelInfo a_modelInfo;
4022
4023 output Tpl.Text out_txt;
4024 algorithm
4025 2 out_txt := fun_168(txt, a_modelInfo, a_simCode);
4026 end setStringFunction;
4027
4028 public function setExternalFunction
4029 input Tpl.Text in_txt;
4030 input SimCode.ModelInfo in_a_modelInfo;
4031
4032 output Tpl.Text out_txt;
4033 algorithm
4034 out_txt :=
4035 match(in_txt, in_a_modelInfo)
4036 local
4037 Tpl.Text txt;
4038 list<SimCodeFunction.Function> i_functions;
4039 Tpl.Text l_externalFuncs;
4040
4041 case ( txt,
4042 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stateVars = _), functions = i_functions) )
4043 algorithm
4044 2 l_externalFuncs := setExternalFunctionsSwitch(Tpl.emptyTxt, i_functions);
4045 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4046 "fmiStatus setExternalFunction(ModelInstance* c, const fmiValueReference vr, const void* value){\n",
4047 " switch (vr) {\n"
4048 }, true));
4049 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
4050 2 txt := Tpl.writeText(txt, l_externalFuncs);
4051 2 txt := Tpl.softNewLine(txt);
4052 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4053 "default:\n",
4054 " return fmiError;\n"
4055 }, true));
4056 2 txt := Tpl.popBlock(txt);
4057 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4058 " }\n",
4059 " return fmiOK;\n",
4060 "}\n",
4061 "\n"
4062 }, true));
4063 then txt;
4064
4065 case ( txt,
4066 _ )
4067 then txt;
4068 end match;
4069 end setExternalFunction;
4070
4071 public function eventUpdateFunction2
4072 input Tpl.Text in_txt;
4073 input SimCode.SimCode in_a_simCode;
4074
4075 output Tpl.Text out_txt;
4076 algorithm
4077 out_txt :=
4078 match(in_txt, in_a_simCode)
4079 local
4080 Tpl.Text txt;
4081
4082 case ( txt,
4083 SimCode.SIMCODE(modelInfo = _) )
4084 algorithm
4085 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4086 "// Used to set the next time event, if any.\n",
4087 "void eventUpdate(ModelInstance* comp, fmi2EventInfo* eventInfo) {\n",
4088 "}\n",
4089 "\n"
4090 }, true));
4091 then txt;
4092
4093 case ( txt,
4094 _ )
4095 then txt;
4096 end match;
4097 end eventUpdateFunction2;
4098
4099 protected function fun_172
4100 input Tpl.Text in_txt;
4101 input Integer in_a_numAlgAliasVars;
4102 input Tpl.Text in_a_ixFirstAlias;
4103 input Tpl.Text in_a_ixEnd;
4104
4105 output Tpl.Text out_txt;
4106 algorithm
4107 out_txt :=
4108 match(in_txt, in_a_numAlgAliasVars, in_a_ixFirstAlias, in_a_ixEnd)
4109 local
4110 Tpl.Text txt;
4111 Tpl.Text a_ixFirstAlias;
4112 Tpl.Text a_ixEnd;
4113
4114 case ( txt,
4115 0,
4116 _,
4117 _ )
4118 then txt;
4119
4120 case ( txt,
4121 _,
4122 a_ixFirstAlias,
4123 a_ixEnd )
4124 algorithm
4125 42 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if (vr < "));
4126 42 txt := Tpl.writeText(txt, a_ixEnd);
4127 42 txt := Tpl.writeTok(txt, Tpl.ST_LINE(") {\n"));
4128 42 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4129 42 txt := Tpl.writeTok(txt, Tpl.ST_STRING("int ix = comp->fmuData->callback->fmiRealAliasIndexes[vr-"));
4130 42 txt := Tpl.writeText(txt, a_ixFirstAlias);
4131 42 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4132 "];\n",
4133 "return ix>=0 ? getReal(comp, ix) : -getReal(comp, -(ix+1));\n"
4134 }, true));
4135 42 txt := Tpl.popBlock(txt);
4136 42 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
4137 then txt;
4138 end match;
4139 end fun_172;
4140
4141 protected function fun_173
4142 input Tpl.Text in_txt;
4143 input SimCode.ModelInfo in_a_modelInfo;
4144
4145 output Tpl.Text out_txt;
4146 algorithm
4147 out_txt :=
4148 match(in_txt, in_a_modelInfo)
4149 local
4150 Tpl.Text txt;
4151 Integer i_numAlgAliasVars;
4152 list<SimCodeVar.SimVar> i_vars_paramVars;
4153 list<SimCodeVar.SimVar> i_vars_discreteAlgVars;
4154 list<SimCodeVar.SimVar> i_vars_algVars;
4155 list<SimCodeVar.SimVar> i_vars_stateVars;
4156 Integer ret_25;
4157 Integer ret_24;
4158 Integer ret_23;
4159 Integer ret_22;
4160 Integer ret_21;
4161 Integer ret_20;
4162 Integer ret_19;
4163 Integer ret_18;
4164 Integer ret_17;
4165 Tpl.Text l_ixEnd;
4166 Integer ret_15;
4167 Integer ret_14;
4168 Integer ret_13;
4169 Integer ret_12;
4170 Integer ret_11;
4171 Integer ret_10;
4172 Integer ret_9;
4173 Integer ret_8;
4174 Tpl.Text l_ixFirstAlias;
4175 Integer ret_6;
4176 Integer ret_5;
4177 Integer ret_4;
4178 Integer ret_3;
4179 Integer ret_2;
4180 Integer ret_1;
4181 Tpl.Text l_ixFirstParam;
4182
4183 case ( txt,
4184 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stateVars = i_vars_stateVars, algVars = i_vars_algVars, discreteAlgVars = i_vars_discreteAlgVars, paramVars = i_vars_paramVars), varInfo = SimCode.VARINFO(numAlgAliasVars = i_numAlgAliasVars, numParams = _, numStateVars = _, numAlgVars = _, numDiscreteReal = _)) )
4185 algorithm
4186 80 ret_1 := SimCodeCodegenUtil.numScalarElems(i_vars_stateVars);
4187 80 ret_2 := intMul(2, ret_1);
4188 80 ret_3 := SimCodeCodegenUtil.numScalarElems(i_vars_algVars);
4189 80 ret_4 := SimCodeCodegenUtil.numScalarElems(i_vars_discreteAlgVars);
4190 80 ret_5 := intAdd(ret_3, ret_4);
4191 80 ret_6 := intAdd(ret_2, ret_5);
4192 80 l_ixFirstParam := Tpl.writeStr(Tpl.emptyTxt, intString(ret_6));
4193 80 ret_8 := SimCodeCodegenUtil.numScalarElems(i_vars_paramVars);
4194 80 ret_9 := SimCodeCodegenUtil.numScalarElems(i_vars_stateVars);
4195 80 ret_10 := intMul(2, ret_9);
4196 80 ret_11 := SimCodeCodegenUtil.numScalarElems(i_vars_algVars);
4197 80 ret_12 := SimCodeCodegenUtil.numScalarElems(i_vars_discreteAlgVars);
4198 80 ret_13 := intAdd(ret_11, ret_12);
4199 80 ret_14 := intAdd(ret_10, ret_13);
4200 80 ret_15 := intAdd(ret_8, ret_14);
4201 80 l_ixFirstAlias := Tpl.writeStr(Tpl.emptyTxt, intString(ret_15));
4202 80 ret_17 := SimCodeCodegenUtil.numScalarElems(i_vars_paramVars);
4203 80 ret_18 := SimCodeCodegenUtil.numScalarElems(i_vars_stateVars);
4204 80 ret_19 := intMul(2, ret_18);
4205 80 ret_20 := SimCodeCodegenUtil.numScalarElems(i_vars_algVars);
4206 80 ret_21 := SimCodeCodegenUtil.numScalarElems(i_vars_discreteAlgVars);
4207 80 ret_22 := intAdd(ret_20, ret_21);
4208 80 ret_23 := intAdd(ret_19, ret_22);
4209 80 ret_24 := intAdd(ret_17, ret_23);
4210 80 ret_25 := intAdd(i_numAlgAliasVars, ret_24);
4211 80 l_ixEnd := Tpl.writeStr(Tpl.emptyTxt, intString(ret_25));
4212 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("fmi2Real getReal(ModelInstance* comp, const fmi2ValueReference vr) {\n"));
4213 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4214 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if (vr < "));
4215 80 txt := Tpl.writeText(txt, l_ixFirstParam);
4216 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4217 ") {\n",
4218 " return comp->fmuData->localData[0]->realVars[vr];\n",
4219 "}\n",
4220 "if (vr < "
4221 }, false));
4222 80 txt := Tpl.writeText(txt, l_ixFirstAlias);
4223 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE(") {\n"));
4224 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4225 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING("return comp->fmuData->simulationInfo->realParameter[vr-"));
4226 80 txt := Tpl.writeText(txt, l_ixFirstParam);
4227 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("];\n"));
4228 80 txt := Tpl.popBlock(txt);
4229 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("}\n"));
4230 80 txt := fun_172(txt, i_numAlgAliasVars, l_ixFirstAlias, l_ixEnd);
4231 80 txt := Tpl.softNewLine(txt);
4232 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("return NAN;\n"));
4233 80 txt := Tpl.popBlock(txt);
4234 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4235 "}\n",
4236 "\n"
4237 }, true));
4238 then txt;
4239
4240 case ( txt,
4241 _ )
4242 then txt;
4243 end match;
4244 end fun_173;
4245
4246 public function getRealFunction2
4247 input Tpl.Text txt;
4248 input SimCode.SimCode a_simCode;
4249 input SimCode.ModelInfo a_modelInfo;
4250
4251 output Tpl.Text out_txt;
4252 algorithm
4253 80 out_txt := fun_173(txt, a_modelInfo);
4254 end getRealFunction2;
4255
4256 protected function fun_175
4257 input Tpl.Text in_txt;
4258 input Integer in_a_numAlgAliasVars;
4259 input Tpl.Text in_a_ixFirstAlias;
4260 input Tpl.Text in_a_ixEnd;
4261
4262 output Tpl.Text out_txt;
4263 algorithm
4264 out_txt :=
4265 match(in_txt, in_a_numAlgAliasVars, in_a_ixFirstAlias, in_a_ixEnd)
4266 local
4267 Tpl.Text txt;
4268 Tpl.Text a_ixFirstAlias;
4269 Tpl.Text a_ixEnd;
4270
4271 case ( txt,
4272 0,
4273 _,
4274 _ )
4275 then txt;
4276
4277 case ( txt,
4278 _,
4279 a_ixFirstAlias,
4280 a_ixEnd )
4281 algorithm
4282 42 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if (vr < "));
4283 42 txt := Tpl.writeText(txt, a_ixEnd);
4284 42 txt := Tpl.writeTok(txt, Tpl.ST_LINE(") {\n"));
4285 42 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4286 42 txt := Tpl.writeTok(txt, Tpl.ST_STRING("int ix = comp->fmuData->callback->fmiRealAliasIndexes[vr-"));
4287 42 txt := Tpl.writeText(txt, a_ixFirstAlias);
4288 42 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4289 "];\n",
4290 "return ix >= 0 ? setReal(comp, ix, value) : setReal(comp, -(ix+1), -value);\n"
4291 }, true));
4292 42 txt := Tpl.popBlock(txt);
4293 42 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
4294 then txt;
4295 end match;
4296 end fun_175;
4297
4298 protected function fun_176
4299 input Tpl.Text in_txt;
4300 input SimCode.ModelInfo in_a_modelInfo;
4301
4302 output Tpl.Text out_txt;
4303 algorithm
4304 out_txt :=
4305 match(in_txt, in_a_modelInfo)
4306 local
4307 Tpl.Text txt;
4308 Integer i_numAlgAliasVars;
4309 list<SimCodeVar.SimVar> i_vars_paramVars;
4310 list<SimCodeVar.SimVar> i_vars_discreteAlgVars;
4311 list<SimCodeVar.SimVar> i_vars_algVars;
4312 list<SimCodeVar.SimVar> i_vars_stateVars;
4313 Integer ret_25;
4314 Integer ret_24;
4315 Integer ret_23;
4316 Integer ret_22;
4317 Integer ret_21;
4318 Integer ret_20;
4319 Integer ret_19;
4320 Integer ret_18;
4321 Integer ret_17;
4322 Tpl.Text l_ixEnd;
4323 Integer ret_15;
4324 Integer ret_14;
4325 Integer ret_13;
4326 Integer ret_12;
4327 Integer ret_11;
4328 Integer ret_10;
4329 Integer ret_9;
4330 Integer ret_8;
4331 Tpl.Text l_ixFirstAlias;
4332 Integer ret_6;
4333 Integer ret_5;
4334 Integer ret_4;
4335 Integer ret_3;
4336 Integer ret_2;
4337 Integer ret_1;
4338 Tpl.Text l_ixFirstParam;
4339
4340 case ( txt,
4341 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stateVars = i_vars_stateVars, algVars = i_vars_algVars, discreteAlgVars = i_vars_discreteAlgVars, paramVars = i_vars_paramVars), varInfo = SimCode.VARINFO(numAlgAliasVars = i_numAlgAliasVars, numParams = _, numStateVars = _, numAlgVars = _, numDiscreteReal = _)) )
4342 algorithm
4343 80 ret_1 := SimCodeCodegenUtil.numScalarElems(i_vars_stateVars);
4344 80 ret_2 := intMul(2, ret_1);
4345 80 ret_3 := SimCodeCodegenUtil.numScalarElems(i_vars_algVars);
4346 80 ret_4 := SimCodeCodegenUtil.numScalarElems(i_vars_discreteAlgVars);
4347 80 ret_5 := intAdd(ret_3, ret_4);
4348 80 ret_6 := intAdd(ret_2, ret_5);
4349 80 l_ixFirstParam := Tpl.writeStr(Tpl.emptyTxt, intString(ret_6));
4350 80 ret_8 := SimCodeCodegenUtil.numScalarElems(i_vars_paramVars);
4351 80 ret_9 := SimCodeCodegenUtil.numScalarElems(i_vars_stateVars);
4352 80 ret_10 := intMul(2, ret_9);
4353 80 ret_11 := SimCodeCodegenUtil.numScalarElems(i_vars_algVars);
4354 80 ret_12 := SimCodeCodegenUtil.numScalarElems(i_vars_discreteAlgVars);
4355 80 ret_13 := intAdd(ret_11, ret_12);
4356 80 ret_14 := intAdd(ret_10, ret_13);
4357 80 ret_15 := intAdd(ret_8, ret_14);
4358 80 l_ixFirstAlias := Tpl.writeStr(Tpl.emptyTxt, intString(ret_15));
4359 80 ret_17 := SimCodeCodegenUtil.numScalarElems(i_vars_paramVars);
4360 80 ret_18 := SimCodeCodegenUtil.numScalarElems(i_vars_stateVars);
4361 80 ret_19 := intMul(2, ret_18);
4362 80 ret_20 := SimCodeCodegenUtil.numScalarElems(i_vars_algVars);
4363 80 ret_21 := SimCodeCodegenUtil.numScalarElems(i_vars_discreteAlgVars);
4364 80 ret_22 := intAdd(ret_20, ret_21);
4365 80 ret_23 := intAdd(ret_19, ret_22);
4366 80 ret_24 := intAdd(ret_17, ret_23);
4367 80 ret_25 := intAdd(i_numAlgAliasVars, ret_24);
4368 80 l_ixEnd := Tpl.writeStr(Tpl.emptyTxt, intString(ret_25));
4369 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4370 "fmi2Status setReal(ModelInstance* comp, const fmi2ValueReference vr, const fmi2Real value) {\n",
4371 " // set start value attribute for all variable that has start value, till initialization mode\n"
4372 }, true));
4373 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4374 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if (vr < "));
4375 80 txt := Tpl.writeText(txt, l_ixFirstParam);
4376 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4377 " && (comp->state == model_state_instantiated || comp->state == model_state_initialization_mode)) {\n",
4378 " put_real_element(value, 0, &comp->fmuData->modelData->realVarsData[vr].attribute.start);\n",
4379 "}\n",
4380 "if (vr < "
4381 }, false));
4382 80 txt := Tpl.writeText(txt, l_ixFirstParam);
4383 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4384 ") {\n",
4385 " comp->fmuData->localData[0]->realVars[vr] = value;\n",
4386 " return fmi2OK;\n",
4387 "}\n",
4388 "if (vr < "
4389 }, false));
4390 80 txt := Tpl.writeText(txt, l_ixFirstAlias);
4391 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE(") {\n"));
4392 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4393 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING("comp->fmuData->simulationInfo->realParameter[vr-"));
4394 80 txt := Tpl.writeText(txt, l_ixFirstParam);
4395 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4396 "] = value;\n",
4397 "return fmi2OK;\n"
4398 }, true));
4399 80 txt := Tpl.popBlock(txt);
4400 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("}\n"));
4401 80 txt := fun_175(txt, i_numAlgAliasVars, l_ixFirstAlias, l_ixEnd);
4402 80 txt := Tpl.softNewLine(txt);
4403 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("return fmi2Error;\n"));
4404 80 txt := Tpl.popBlock(txt);
4405 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4406 "}\n",
4407 "\n"
4408 }, true));
4409 then txt;
4410
4411 case ( txt,
4412 _ )
4413 then txt;
4414 end match;
4415 end fun_176;
4416
4417 public function setRealFunction2
4418 input Tpl.Text txt;
4419 input SimCode.SimCode a_simCode;
4420 input SimCode.ModelInfo a_modelInfo;
4421
4422 output Tpl.Text out_txt;
4423 algorithm
4424 80 out_txt := fun_176(txt, a_modelInfo);
4425 end setRealFunction2;
4426
4427 protected function fun_178
4428 input Tpl.Text in_txt;
4429 input Integer in_a_numAliasVars;
4430 input Tpl.Text in_a_ixFirstAlias;
4431 input Tpl.Text in_a_ixEnd;
4432
4433 output Tpl.Text out_txt;
4434 algorithm
4435 out_txt :=
4436 match(in_txt, in_a_numAliasVars, in_a_ixFirstAlias, in_a_ixEnd)
4437 local
4438 Tpl.Text txt;
4439 Tpl.Text a_ixFirstAlias;
4440 Tpl.Text a_ixEnd;
4441
4442 case ( txt,
4443 0,
4444 _,
4445 _ )
4446 then txt;
4447
4448 case ( txt,
4449 _,
4450 a_ixFirstAlias,
4451 a_ixEnd )
4452 algorithm
4453 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if (vr < "));
4454 7 txt := Tpl.writeText(txt, a_ixEnd);
4455 7 txt := Tpl.writeTok(txt, Tpl.ST_LINE(") {\n"));
4456 7 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4457 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING("int ix = comp->fmuData->callback->fmiIntegerAliasIndexes[vr-"));
4458 7 txt := Tpl.writeText(txt, a_ixFirstAlias);
4459 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4460 "];\n",
4461 "return ix>=0 ? getInteger(comp, ix) : -getInteger(comp, -(ix+1));\n"
4462 }, true));
4463 7 txt := Tpl.popBlock(txt);
4464 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
4465 then txt;
4466 end match;
4467 end fun_178;
4468
4469 protected function fun_179
4470 input Tpl.Text in_txt;
4471 input SimCode.ModelInfo in_a_modelInfo;
4472
4473 output Tpl.Text out_txt;
4474 algorithm
4475 out_txt :=
4476 match(in_txt, in_a_modelInfo)
4477 local
4478 Tpl.Text txt;
4479 Integer i_numAliasVars;
4480 Integer i_numParams;
4481 Integer i_numAlgVars;
4482 Integer ret_5;
4483 Integer ret_4;
4484 Tpl.Text l_ixEnd;
4485 Integer ret_2;
4486 Tpl.Text l_ixFirstAlias;
4487 Tpl.Text l_ixFirstParam;
4488
4489 case ( txt,
4490 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stateVars = _), varInfo = SimCode.VARINFO(numIntAliasVars = i_numAliasVars, numIntParams = i_numParams, numIntAlgVars = i_numAlgVars)) )
4491 algorithm
4492 80 l_ixFirstParam := Tpl.writeStr(Tpl.emptyTxt, intString(i_numAlgVars));
4493 80 ret_2 := intAdd(i_numParams, i_numAlgVars);
4494 80 l_ixFirstAlias := Tpl.writeStr(Tpl.emptyTxt, intString(ret_2));
4495 ret_4 := intAdd(i_numParams, i_numAlgVars);
4496 80 ret_5 := intAdd(i_numAliasVars, ret_4);
4497 80 l_ixEnd := Tpl.writeStr(Tpl.emptyTxt, intString(ret_5));
4498 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("fmi2Integer getInteger(ModelInstance* comp, const fmi2ValueReference vr) {\n"));
4499 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4500 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if (vr < "));
4501 80 txt := Tpl.writeText(txt, l_ixFirstParam);
4502 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4503 ") {\n",
4504 " return comp->fmuData->localData[0]->integerVars[vr];\n",
4505 "}\n",
4506 "if (vr < "
4507 }, false));
4508 80 txt := Tpl.writeText(txt, l_ixFirstAlias);
4509 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE(") {\n"));
4510 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4511 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING("return comp->fmuData->simulationInfo->integerParameter[vr-"));
4512 80 txt := Tpl.writeText(txt, l_ixFirstParam);
4513 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("];\n"));
4514 80 txt := Tpl.popBlock(txt);
4515 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("}\n"));
4516 80 txt := fun_178(txt, i_numAliasVars, l_ixFirstAlias, l_ixEnd);
4517 80 txt := Tpl.softNewLine(txt);
4518 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("return 0;\n"));
4519 80 txt := Tpl.popBlock(txt);
4520 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4521 "}\n",
4522 "\n"
4523 }, true));
4524 then txt;
4525
4526 case ( txt,
4527 _ )
4528 then txt;
4529 end match;
4530 end fun_179;
4531
4532 public function getIntegerFunction2
4533 input Tpl.Text txt;
4534 input SimCode.SimCode a_simCode;
4535 input SimCode.ModelInfo a_modelInfo;
4536
4537 output Tpl.Text out_txt;
4538 algorithm
4539 80 out_txt := fun_179(txt, a_modelInfo);
4540 end getIntegerFunction2;
4541
4542 protected function fun_181
4543 input Tpl.Text in_txt;
4544 input Integer in_a_numAliasVars;
4545 input Tpl.Text in_a_ixFirstAlias;
4546 input Tpl.Text in_a_ixEnd;
4547
4548 output Tpl.Text out_txt;
4549 algorithm
4550 out_txt :=
4551 match(in_txt, in_a_numAliasVars, in_a_ixFirstAlias, in_a_ixEnd)
4552 local
4553 Tpl.Text txt;
4554 Tpl.Text a_ixFirstAlias;
4555 Tpl.Text a_ixEnd;
4556
4557 case ( txt,
4558 0,
4559 _,
4560 _ )
4561 then txt;
4562
4563 case ( txt,
4564 _,
4565 a_ixFirstAlias,
4566 a_ixEnd )
4567 algorithm
4568 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if (vr < "));
4569 7 txt := Tpl.writeText(txt, a_ixEnd);
4570 7 txt := Tpl.writeTok(txt, Tpl.ST_LINE(") {\n"));
4571 7 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4572 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING("int ix = comp->fmuData->callback->fmiIntegerAliasIndexes[vr-"));
4573 7 txt := Tpl.writeText(txt, a_ixFirstAlias);
4574 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4575 "];\n",
4576 "return ix >= 0 ? setInteger(comp, ix, value) : setInteger(comp, -(ix+1), -value);\n"
4577 }, true));
4578 7 txt := Tpl.popBlock(txt);
4579 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
4580 then txt;
4581 end match;
4582 end fun_181;
4583
4584 protected function fun_182
4585 input Tpl.Text in_txt;
4586 input SimCode.ModelInfo in_a_modelInfo;
4587
4588 output Tpl.Text out_txt;
4589 algorithm
4590 out_txt :=
4591 match(in_txt, in_a_modelInfo)
4592 local
4593 Tpl.Text txt;
4594 Integer i_numAliasVars;
4595 Integer i_numParams;
4596 Integer i_numAlgVars;
4597 Integer ret_5;
4598 Integer ret_4;
4599 Tpl.Text l_ixEnd;
4600 Integer ret_2;
4601 Tpl.Text l_ixFirstAlias;
4602 Tpl.Text l_ixFirstParam;
4603
4604 case ( txt,
4605 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stateVars = _), varInfo = SimCode.VARINFO(numIntAliasVars = i_numAliasVars, numIntParams = i_numParams, numIntAlgVars = i_numAlgVars)) )
4606 algorithm
4607 80 l_ixFirstParam := Tpl.writeStr(Tpl.emptyTxt, intString(i_numAlgVars));
4608 80 ret_2 := intAdd(i_numParams, i_numAlgVars);
4609 80 l_ixFirstAlias := Tpl.writeStr(Tpl.emptyTxt, intString(ret_2));
4610 ret_4 := intAdd(i_numParams, i_numAlgVars);
4611 80 ret_5 := intAdd(i_numAliasVars, ret_4);
4612 80 l_ixEnd := Tpl.writeStr(Tpl.emptyTxt, intString(ret_5));
4613 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4614 "fmi2Status setInteger(ModelInstance* comp, const fmi2ValueReference vr, const fmi2Integer value) {\n",
4615 " // set start value attribute for all variable that has start value, till initialization mode\n"
4616 }, true));
4617 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4618 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if (vr < "));
4619 80 txt := Tpl.writeText(txt, l_ixFirstParam);
4620 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4621 " && (comp->state == model_state_instantiated || comp->state == model_state_initialization_mode)) {\n",
4622 " put_integer_element(value, 0, &comp->fmuData->modelData->integerVarsData[vr].attribute.start);\n",
4623 "}\n",
4624 "if (vr < "
4625 }, false));
4626 80 txt := Tpl.writeText(txt, l_ixFirstParam);
4627 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4628 ") {\n",
4629 " comp->fmuData->localData[0]->integerVars[vr] = value;\n",
4630 " return fmi2OK;\n",
4631 "}\n",
4632 "if (vr < "
4633 }, false));
4634 80 txt := Tpl.writeText(txt, l_ixFirstAlias);
4635 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE(") {\n"));
4636 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4637 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING("comp->fmuData->simulationInfo->integerParameter[vr-"));
4638 80 txt := Tpl.writeText(txt, l_ixFirstParam);
4639 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4640 "] = value;\n",
4641 "return fmi2OK;\n"
4642 }, true));
4643 80 txt := Tpl.popBlock(txt);
4644 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("}\n"));
4645 80 txt := fun_181(txt, i_numAliasVars, l_ixFirstAlias, l_ixEnd);
4646 80 txt := Tpl.softNewLine(txt);
4647 80 txt := Tpl.writeTok(txt, Tpl.ST_LINE("return fmi2Error;\n"));
4648 80 txt := Tpl.popBlock(txt);
4649 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
4650 then txt;
4651
4652 case ( txt,
4653 _ )
4654 then txt;
4655 end match;
4656 end fun_182;
4657
4658 public function setIntegerFunction2
4659 input Tpl.Text txt;
4660 input SimCode.SimCode a_simCode;
4661 input SimCode.ModelInfo a_modelInfo;
4662
4663 output Tpl.Text out_txt;
4664 algorithm
4665 80 out_txt := fun_182(txt, a_modelInfo);
4666 end setIntegerFunction2;
4667
4668 protected function lm_184
4669 input output Tpl.Text txt;
4670 input list<SimCodeVar.SimVar> items;
4671 input SimCode.SimCode a_simCode;
4672 algorithm
4673
2/2
✓ Branch 0 taken 14 times.
✓ Branch 1 taken 80 times.
94 for lstElt_184 in items loop
4674 txt := match lstElt_184
4675 local
4676 SimCodeVar.SimVar i_var;
4677
4678 case i_var
4679 algorithm
4680 14 txt := SwitchVars(txt, a_simCode, i_var, "booleanVars");
4681 14 txt := Tpl.nextIter(txt);
4682 then txt;
4683 end match;
4684 end for;
4685 end lm_184;
4686
4687 protected function lm_185
4688 input output Tpl.Text txt;
4689 input list<SimCodeVar.SimVar> items;
4690 input SimCode.SimCode a_simCode;
4691 algorithm
4692
2/2
✓ Branch 0 taken 191 times.
✓ Branch 1 taken 80 times.
271 for lstElt_185 in items loop
4693 txt := match lstElt_185
4694 local
4695 SimCodeVar.SimVar i_var;
4696
4697 case i_var
4698 algorithm
4699 191 txt := SwitchParameters(txt, a_simCode, i_var, "booleanParameter");
4700 191 txt := Tpl.nextIter(txt);
4701 then txt;
4702 end match;
4703 end for;
4704 end lm_185;
4705
4706 protected function lm_186
4707 input output Tpl.Text txt;
4708 input list<SimCodeVar.SimVar> items;
4709 input SimCode.SimCode a_simCode;
4710 algorithm
4711
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 80 times.
80 for lstElt_186 in items loop
4712 txt := match lstElt_186
4713 local
4714 SimCodeVar.SimVar i_var;
4715
4716 case i_var
4717 algorithm
4718 ✗ txt := SwitchAliasVars(txt, a_simCode, i_var, "Boolean", "!");
4719 ✗ txt := Tpl.nextIter(txt);
4720 then txt;
4721 end match;
4722 end for;
4723 end lm_186;
4724
4725 protected function fun_187
4726 input Tpl.Text in_txt;
4727 input SimCode.ModelInfo in_a_modelInfo;
4728 input SimCode.SimCode in_a_simCode;
4729
4730 output Tpl.Text out_txt;
4731 algorithm
4732 out_txt :=
4733 match(in_txt, in_a_modelInfo, in_a_simCode)
4734 local
4735 Tpl.Text txt;
4736 SimCode.SimCode a_simCode;
4737 list<SimCodeVar.SimVar> i_vars_boolAliasVars;
4738 list<SimCodeVar.SimVar> i_vars_boolParamVars;
4739 list<SimCodeVar.SimVar> i_vars_boolAlgVars;
4740
4741 case ( txt,
4742 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(boolAlgVars = i_vars_boolAlgVars, boolParamVars = i_vars_boolParamVars, boolAliasVars = i_vars_boolAliasVars)),
4743 a_simCode )
4744 algorithm
4745 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4746 "fmi2Boolean getBoolean(ModelInstance* comp, const fmi2ValueReference vr) {\n",
4747 " switch (vr) {\n"
4748 }, true));
4749 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
4750 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4751 80 txt := lm_184(txt, i_vars_boolAlgVars, a_simCode);
4752 80 txt := Tpl.popIter(txt);
4753 80 txt := Tpl.softNewLine(txt);
4754 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4755 80 txt := lm_185(txt, i_vars_boolParamVars, a_simCode);
4756 80 txt := Tpl.popIter(txt);
4757 80 txt := Tpl.softNewLine(txt);
4758 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4759 80 txt := lm_186(txt, i_vars_boolAliasVars, a_simCode);
4760 80 txt := Tpl.popIter(txt);
4761 80 txt := Tpl.softNewLine(txt);
4762 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4763 "default:\n",
4764 " return fmi2False;\n"
4765 }, true));
4766 80 txt := Tpl.popBlock(txt);
4767 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4768 " }\n",
4769 "}\n",
4770 "\n"
4771 }, true));
4772 then txt;
4773
4774 case ( txt,
4775 _,
4776 _ )
4777 then txt;
4778 end match;
4779 end fun_187;
4780
4781 public function getBooleanFunction2
4782 input Tpl.Text txt;
4783 input SimCode.SimCode a_simCode;
4784 input SimCode.ModelInfo a_modelInfo;
4785
4786 output Tpl.Text out_txt;
4787 algorithm
4788 80 out_txt := fun_187(txt, a_modelInfo, a_simCode);
4789 end getBooleanFunction2;
4790
4791 protected function lm_189
4792 input output Tpl.Text txt;
4793 input list<SimCodeVar.SimVar> items;
4794 input SimCode.SimCode a_simCode;
4795 algorithm
4796
2/2
✓ Branch 0 taken 14 times.
✓ Branch 1 taken 80 times.
94 for lstElt_189 in items loop
4797 txt := match lstElt_189
4798 local
4799 SimCodeVar.SimVar i_var;
4800
4801 case i_var
4802 algorithm
4803 14 txt := SwitchVarsSet(txt, a_simCode, i_var, "booleanVars");
4804 14 txt := Tpl.nextIter(txt);
4805 then txt;
4806 end match;
4807 end for;
4808 end lm_189;
4809
4810 protected function lm_190
4811 input output Tpl.Text txt;
4812 input list<SimCodeVar.SimVar> items;
4813 input SimCode.SimCode a_simCode;
4814 algorithm
4815
2/2
✓ Branch 0 taken 191 times.
✓ Branch 1 taken 80 times.
271 for lstElt_190 in items loop
4816 txt := match lstElt_190
4817 local
4818 SimCodeVar.SimVar i_var;
4819
4820 case i_var
4821 algorithm
4822 191 txt := SwitchParametersSet(txt, a_simCode, i_var, "booleanParameter");
4823 191 txt := Tpl.nextIter(txt);
4824 then txt;
4825 end match;
4826 end for;
4827 end lm_190;
4828
4829 protected function lm_191
4830 input output Tpl.Text txt;
4831 input list<SimCodeVar.SimVar> items;
4832 input SimCode.SimCode a_simCode;
4833 algorithm
4834
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 80 times.
80 for lstElt_191 in items loop
4835 txt := match lstElt_191
4836 local
4837 SimCodeVar.SimVar i_var;
4838
4839 case i_var
4840 algorithm
4841 ✗ txt := SwitchAliasVarsSet(txt, a_simCode, i_var, "Boolean", "!");
4842 ✗ txt := Tpl.nextIter(txt);
4843 then txt;
4844 end match;
4845 end for;
4846 end lm_191;
4847
4848 protected function fun_192
4849 input Tpl.Text in_txt;
4850 input SimCode.ModelInfo in_a_modelInfo;
4851 input SimCode.SimCode in_a_simCode;
4852
4853 output Tpl.Text out_txt;
4854 algorithm
4855 out_txt :=
4856 match(in_txt, in_a_modelInfo, in_a_simCode)
4857 local
4858 Tpl.Text txt;
4859 SimCode.SimCode a_simCode;
4860 list<SimCodeVar.SimVar> i_vars_boolAliasVars;
4861 list<SimCodeVar.SimVar> i_vars_boolParamVars;
4862 list<SimCodeVar.SimVar> i_vars_boolAlgVars;
4863
4864 case ( txt,
4865 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(boolAlgVars = i_vars_boolAlgVars, boolParamVars = i_vars_boolParamVars, boolAliasVars = i_vars_boolAliasVars)),
4866 a_simCode )
4867 algorithm
4868 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4869 "fmi2Status setBoolean(ModelInstance* comp, const fmi2ValueReference vr, const fmi2Boolean value) {\n",
4870 " switch (vr) {\n"
4871 }, true));
4872 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
4873 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4874 80 txt := lm_189(txt, i_vars_boolAlgVars, a_simCode);
4875 80 txt := Tpl.popIter(txt);
4876 80 txt := Tpl.softNewLine(txt);
4877 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4878 80 txt := lm_190(txt, i_vars_boolParamVars, a_simCode);
4879 80 txt := Tpl.popIter(txt);
4880 80 txt := Tpl.softNewLine(txt);
4881 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4882 80 txt := lm_191(txt, i_vars_boolAliasVars, a_simCode);
4883 80 txt := Tpl.popIter(txt);
4884 80 txt := Tpl.softNewLine(txt);
4885 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4886 "default:\n",
4887 " return fmi2Error;\n"
4888 }, true));
4889 80 txt := Tpl.popBlock(txt);
4890 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4891 " }\n",
4892 " return fmi2OK;\n",
4893 "}\n",
4894 "\n"
4895 }, true));
4896 then txt;
4897
4898 case ( txt,
4899 _,
4900 _ )
4901 then txt;
4902 end match;
4903 end fun_192;
4904
4905 public function setBooleanFunction2
4906 input Tpl.Text txt;
4907 input SimCode.SimCode a_simCode;
4908 input SimCode.ModelInfo a_modelInfo;
4909
4910 output Tpl.Text out_txt;
4911 algorithm
4912 80 out_txt := fun_192(txt, a_modelInfo, a_simCode);
4913 end setBooleanFunction2;
4914
4915 protected function lm_194
4916 input output Tpl.Text txt;
4917 input list<SimCodeVar.SimVar> items;
4918 input SimCode.SimCode a_simCode;
4919 algorithm
4920
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 80 times.
83 for lstElt_194 in items loop
4921 txt := match lstElt_194
4922 local
4923 SimCodeVar.SimVar i_var;
4924
4925 case i_var
4926 algorithm
4927 3 txt := SwitchVars(txt, a_simCode, i_var, "stringVars");
4928 3 txt := Tpl.nextIter(txt);
4929 then txt;
4930 end match;
4931 end for;
4932 end lm_194;
4933
4934 protected function lm_195
4935 input output Tpl.Text txt;
4936 input list<SimCodeVar.SimVar> items;
4937 input SimCode.SimCode a_simCode;
4938 algorithm
4939
2/2
✓ Branch 0 taken 126 times.
✓ Branch 1 taken 80 times.
206 for lstElt_195 in items loop
4940 txt := match lstElt_195
4941 local
4942 SimCodeVar.SimVar i_var;
4943
4944 case i_var
4945 algorithm
4946 126 txt := SwitchParameters(txt, a_simCode, i_var, "stringParameter");
4947 126 txt := Tpl.nextIter(txt);
4948 then txt;
4949 end match;
4950 end for;
4951 end lm_195;
4952
4953 protected function lm_196
4954 input output Tpl.Text txt;
4955 input list<SimCodeVar.SimVar> items;
4956 input SimCode.SimCode a_simCode;
4957 algorithm
4958
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 80 times.
80 for lstElt_196 in items loop
4959 txt := match lstElt_196
4960 local
4961 SimCodeVar.SimVar i_var;
4962
4963 case i_var
4964 algorithm
4965 ✗ txt := SwitchAliasVars(txt, a_simCode, i_var, "String", "");
4966 ✗ txt := Tpl.nextIter(txt);
4967 then txt;
4968 end match;
4969 end for;
4970 end lm_196;
4971
4972 protected function fun_197
4973 input Tpl.Text in_txt;
4974 input SimCode.ModelInfo in_a_modelInfo;
4975 input SimCode.SimCode in_a_simCode;
4976
4977 output Tpl.Text out_txt;
4978 algorithm
4979 out_txt :=
4980 match(in_txt, in_a_modelInfo, in_a_simCode)
4981 local
4982 Tpl.Text txt;
4983 SimCode.SimCode a_simCode;
4984 list<SimCodeVar.SimVar> i_vars_stringAliasVars;
4985 list<SimCodeVar.SimVar> i_vars_stringParamVars;
4986 list<SimCodeVar.SimVar> i_vars_stringAlgVars;
4987
4988 case ( txt,
4989 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stringAlgVars = i_vars_stringAlgVars, stringParamVars = i_vars_stringParamVars, stringAliasVars = i_vars_stringAliasVars)),
4990 a_simCode )
4991 algorithm
4992 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
4993 "fmi2String getString(ModelInstance* comp, const fmi2ValueReference vr) {\n",
4994 " switch (vr) {\n"
4995 }, true));
4996 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
4997 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4998 80 txt := lm_194(txt, i_vars_stringAlgVars, a_simCode);
4999 80 txt := Tpl.popIter(txt);
5000 80 txt := Tpl.softNewLine(txt);
5001 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5002 80 txt := lm_195(txt, i_vars_stringParamVars, a_simCode);
5003 80 txt := Tpl.popIter(txt);
5004 80 txt := Tpl.softNewLine(txt);
5005 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5006 80 txt := lm_196(txt, i_vars_stringAliasVars, a_simCode);
5007 80 txt := Tpl.popIter(txt);
5008 80 txt := Tpl.softNewLine(txt);
5009 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5010 "default:\n",
5011 " return \"\";\n"
5012 }, true));
5013 80 txt := Tpl.popBlock(txt);
5014 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5015 " }\n",
5016 "}\n",
5017 "\n"
5018 }, true));
5019 then txt;
5020
5021 case ( txt,
5022 _,
5023 _ )
5024 then txt;
5025 end match;
5026 end fun_197;
5027
5028 public function getStringFunction2
5029 input Tpl.Text txt;
5030 input SimCode.SimCode a_simCode;
5031 input SimCode.ModelInfo a_modelInfo;
5032
5033 output Tpl.Text out_txt;
5034 algorithm
5035 80 out_txt := fun_197(txt, a_modelInfo, a_simCode);
5036 end getStringFunction2;
5037
5038 protected function lm_199
5039 input output Tpl.Text txt;
5040 input list<SimCodeVar.SimVar> items;
5041 input SimCode.SimCode a_simCode;
5042 algorithm
5043
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 80 times.
83 for lstElt_199 in items loop
5044 txt := match lstElt_199
5045 local
5046 SimCodeVar.SimVar i_var;
5047
5048 case i_var
5049 algorithm
5050 3 txt := SwitchVarsSet(txt, a_simCode, i_var, "stringVars");
5051 3 txt := Tpl.nextIter(txt);
5052 then txt;
5053 end match;
5054 end for;
5055 end lm_199;
5056
5057 protected function lm_200
5058 input output Tpl.Text txt;
5059 input list<SimCodeVar.SimVar> items;
5060 input SimCode.SimCode a_simCode;
5061 algorithm
5062
2/2
✓ Branch 0 taken 126 times.
✓ Branch 1 taken 80 times.
206 for lstElt_200 in items loop
5063 txt := match lstElt_200
5064 local
5065 SimCodeVar.SimVar i_var;
5066
5067 case i_var
5068 algorithm
5069 126 txt := SwitchParametersSet(txt, a_simCode, i_var, "stringParameter");
5070 126 txt := Tpl.nextIter(txt);
5071 then txt;
5072 end match;
5073 end for;
5074 end lm_200;
5075
5076 protected function lm_201
5077 input output Tpl.Text txt;
5078 input list<SimCodeVar.SimVar> items;
5079 input SimCode.SimCode a_simCode;
5080 algorithm
5081
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 80 times.
80 for lstElt_201 in items loop
5082 txt := match lstElt_201
5083 local
5084 SimCodeVar.SimVar i_var;
5085
5086 case i_var
5087 algorithm
5088 ✗ txt := SwitchAliasVarsSet(txt, a_simCode, i_var, "String", "");
5089 ✗ txt := Tpl.nextIter(txt);
5090 then txt;
5091 end match;
5092 end for;
5093 end lm_201;
5094
5095 protected function fun_202
5096 input Tpl.Text in_txt;
5097 input SimCode.ModelInfo in_a_modelInfo;
5098 input SimCode.SimCode in_a_simCode;
5099
5100 output Tpl.Text out_txt;
5101 algorithm
5102 out_txt :=
5103 match(in_txt, in_a_modelInfo, in_a_simCode)
5104 local
5105 Tpl.Text txt;
5106 SimCode.SimCode a_simCode;
5107 list<SimCodeVar.SimVar> i_vars_stringAliasVars;
5108 list<SimCodeVar.SimVar> i_vars_stringParamVars;
5109 list<SimCodeVar.SimVar> i_vars_stringAlgVars;
5110
5111 case ( txt,
5112 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stringAlgVars = i_vars_stringAlgVars, stringParamVars = i_vars_stringParamVars, stringAliasVars = i_vars_stringAliasVars)),
5113 a_simCode )
5114 algorithm
5115 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5116 "fmi2Status setString(ModelInstance* comp, const fmi2ValueReference vr, fmi2String value) {\n",
5117 " switch (vr) {\n"
5118 }, true));
5119 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
5120 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5121 80 txt := lm_199(txt, i_vars_stringAlgVars, a_simCode);
5122 80 txt := Tpl.popIter(txt);
5123 80 txt := Tpl.softNewLine(txt);
5124 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5125 80 txt := lm_200(txt, i_vars_stringParamVars, a_simCode);
5126 80 txt := Tpl.popIter(txt);
5127 80 txt := Tpl.softNewLine(txt);
5128 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5129 80 txt := lm_201(txt, i_vars_stringAliasVars, a_simCode);
5130 80 txt := Tpl.popIter(txt);
5131 80 txt := Tpl.softNewLine(txt);
5132 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5133 "default:\n",
5134 " return fmi2Error;\n"
5135 }, true));
5136 80 txt := Tpl.popBlock(txt);
5137 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5138 " }\n",
5139 " return fmi2OK;\n",
5140 "}\n",
5141 "\n"
5142 }, true));
5143 then txt;
5144
5145 case ( txt,
5146 _,
5147 _ )
5148 then txt;
5149 end match;
5150 end fun_202;
5151
5152 public function setStringFunction2
5153 input Tpl.Text txt;
5154 input SimCode.SimCode a_simCode;
5155 input SimCode.ModelInfo a_modelInfo;
5156
5157 output Tpl.Text out_txt;
5158 algorithm
5159 80 out_txt := fun_202(txt, a_modelInfo, a_simCode);
5160 end setStringFunction2;
5161
5162 public function setExternalFunction2
5163 input Tpl.Text in_txt;
5164 input SimCode.ModelInfo in_a_modelInfo;
5165
5166 output Tpl.Text out_txt;
5167 algorithm
5168 out_txt :=
5169 match(in_txt, in_a_modelInfo)
5170 local
5171 Tpl.Text txt;
5172 list<SimCodeFunction.Function> i_functions;
5173 Tpl.Text l_externalFuncs;
5174
5175 case ( txt,
5176 SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(stateVars = _), functions = i_functions) )
5177 algorithm
5178 80 l_externalFuncs := setExternalFunctionsSwitch(Tpl.emptyTxt, i_functions);
5179 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5180 "fmi2Status setExternalFunction(ModelInstance* c, const fmi2ValueReference vr, const void* value){\n",
5181 " switch (vr) {\n"
5182 }, true));
5183 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
5184 80 txt := Tpl.writeText(txt, l_externalFuncs);
5185 80 txt := Tpl.softNewLine(txt);
5186 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5187 "default:\n",
5188 " return fmi2Error;\n"
5189 }, true));
5190 80 txt := Tpl.popBlock(txt);
5191 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5192 " }\n",
5193 " return fmi2OK;\n",
5194 "}\n",
5195 "\n"
5196 }, true));
5197 then txt;
5198
5199 case ( txt,
5200 _ )
5201 then txt;
5202 end match;
5203 end setExternalFunction2;
5204
5205 protected function lm_205
5206 input output Tpl.Text txt;
5207 input list<SimCodeFunction.Function> items;
5208 algorithm
5209
2/2
✓ Branch 0 taken 106 times.
✓ Branch 1 taken 82 times.
188 for lstElt_205 in items loop
5210 txt := match lstElt_205
5211 local
5212 SimCodeFunction.Function i_fn;
5213
5214 case i_fn
5215 algorithm
5216 106 txt := setExternalFunctionSwitch(txt, i_fn);
5217 106 txt := Tpl.nextIter(txt);
5218 then txt;
5219 end match;
5220 end for;
5221 end lm_205;
5222
5223 public function setExternalFunctionsSwitch
5224 input Tpl.Text txt;
5225 input list<SimCodeFunction.Function> a_functions;
5226
5227 output Tpl.Text out_txt;
5228 algorithm
5229 82 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5230 82 out_txt := lm_205(out_txt, a_functions);
5231 82 out_txt := Tpl.popIter(out_txt);
5232 end setExternalFunctionsSwitch;
5233
5234 public function setExternalFunctionSwitch
5235 input Tpl.Text in_txt;
5236 input SimCodeFunction.Function in_a_fn;
5237
5238 output Tpl.Text out_txt;
5239 algorithm
5240 out_txt :=
5241 match(in_txt, in_a_fn)
5242 local
5243 Tpl.Text txt;
5244 String i_language;
5245 String i_extName;
5246 Tpl.Text l_fname;
5247
5248 case ( txt,
5249 SimCodeFunction.EXTERNAL_FUNCTION(dynamicLoad = true, extName = i_extName, language = i_language) )
5250 algorithm
5251 ✗ l_fname := CodegenUtil.extFunctionName(Tpl.emptyTxt, i_extName, i_language);
5252 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("case $P"));
5253 ✗ txt := Tpl.writeText(txt, l_fname);
5254 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : ptr_"));
5255 ✗ txt := Tpl.writeText(txt, l_fname);
5256 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("=(ptrT_"));
5257 ✗ txt := Tpl.writeText(txt, l_fname);
5258 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")value; break;"));
5259 then txt;
5260
5261 case ( txt,
5262 _ )
5263 then txt;
5264 end match;
5265 end setExternalFunctionSwitch;
5266
5267 protected function fun_208
5268 input Tpl.Text in_txt;
5269 input String in_a_comment;
5270
5271 output Tpl.Text out_txt;
5272 algorithm
5273 out_txt :=
5274 match(in_txt, in_a_comment)
5275 local
5276 Tpl.Text txt;
5277 String i_comment;
5278
5279 case ( txt,
5280 "" )
5281 then txt;
5282
5283 case ( txt,
5284 i_comment )
5285 algorithm
5286 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING("// \""));
5287 10 txt := Tpl.writeStr(txt, i_comment);
5288 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
5289 then txt;
5290 end match;
5291 end fun_208;
5292
5293 protected function fun_209
5294 input Tpl.Text in_txt;
5295 input Boolean in_mArg;
5296 input Integer in_a_index;
5297 input String in_a_arrayName;
5298 input SimCode.SimCode in_a_simCode;
5299 input DAE.ComponentRef in_a_name;
5300
5301 output Tpl.Text out_txt;
5302 algorithm
5303 out_txt :=
5304 match(in_txt, in_mArg, in_a_index, in_a_arrayName, in_a_simCode, in_a_name)
5305 local
5306 Tpl.Text txt;
5307 Integer a_index;
5308 String a_arrayName;
5309 SimCode.SimCode a_simCode;
5310 DAE.ComponentRef a_name;
5311 Integer ret_1;
5312 Integer ret_0;
5313
5314 case ( txt,
5315 false,
5316 a_index,
5317 a_arrayName,
5318 a_simCode,
5319 a_name )
5320 algorithm
5321 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
5322 18 ret_0 := SimCodeCodegenUtil.lookupVR(a_name, a_simCode);
5323 18 txt := Tpl.writeStr(txt, intString(ret_0));
5324 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : return comp->fmuData->localData[0]->"));
5325 18 txt := Tpl.writeStr(txt, a_arrayName);
5326 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
5327 18 txt := Tpl.writeStr(txt, intString(a_index));
5328 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]; break;"));
5329 then txt;
5330
5331 case ( txt,
5332 _,
5333 a_index,
5334 a_arrayName,
5335 a_simCode,
5336 a_name )
5337 algorithm
5338 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
5339 3 ret_1 := SimCodeCodegenUtil.lookupVR(a_name, a_simCode);
5340 3 txt := Tpl.writeStr(txt, intString(ret_1));
5341 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : return omc_string_data(comp->fmuData->localData[0]->"));
5342 3 txt := Tpl.writeStr(txt, a_arrayName);
5343 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
5344 3 txt := Tpl.writeStr(txt, intString(a_index));
5345 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]); break;"));
5346 then txt;
5347 end match;
5348 end fun_209;
5349
5350 protected function fun_210
5351 input Tpl.Text in_txt;
5352 input Boolean in_mArg;
5353 input Integer in_a_index;
5354 input SimCode.SimCode in_a_simCode;
5355 input DAE.ComponentRef in_a_name;
5356 input String in_a_arrayName;
5357
5358 output Tpl.Text out_txt;
5359 algorithm
5360 out_txt :=
5361 match(in_txt, in_mArg, in_a_index, in_a_simCode, in_a_name, in_a_arrayName)
5362 local
5363 Tpl.Text txt;
5364 Integer a_index;
5365 SimCode.SimCode a_simCode;
5366 DAE.ComponentRef a_name;
5367 String a_arrayName;
5368 Boolean ret_0;
5369
5370 case ( txt,
5371 false,
5372 a_index,
5373 a_simCode,
5374 a_name,
5375 a_arrayName )
5376 algorithm
5377
3/4
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 18 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
21 ret_0 := stringEq(a_arrayName, "stringVars");
5378 21 txt := fun_209(txt, ret_0, a_index, a_arrayName, a_simCode, a_name);
5379 then txt;
5380
5381 case ( txt,
5382 _,
5383 _,
5384 _,
5385 _,
5386 _ )
5387 then txt;
5388 end match;
5389 end fun_210;
5390
5391 protected function fun_211
5392 input Tpl.Text in_txt;
5393 input Boolean in_mArg;
5394 input Integer in_a_index;
5395 input SimCode.SimCode in_a_simCode;
5396 input String in_a_arrayName;
5397 input DAE.ComponentRef in_a_name;
5398
5399 output Tpl.Text out_txt;
5400 algorithm
5401 out_txt :=
5402 match(in_txt, in_mArg, in_a_index, in_a_simCode, in_a_arrayName, in_a_name)
5403 local
5404 Tpl.Text txt;
5405 Integer a_index;
5406 SimCode.SimCode a_simCode;
5407 String a_arrayName;
5408 DAE.ComponentRef a_name;
5409 Boolean ret_1;
5410 Tpl.Text txt_0;
5411
5412 case ( txt,
5413 false,
5414 a_index,
5415 a_simCode,
5416 a_arrayName,
5417 a_name )
5418 algorithm
5419 21 txt_0 := CodegenUtil.crefStr(Tpl.emptyTxt, a_name);
5420
1/4
✗ Branch 1 not taken.
✓ Branch 2 taken 21 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
21 ret_1 := stringEq(Tpl.textString(txt_0), "der($dummy)");
5421 21 txt := fun_210(txt, ret_1, a_index, a_simCode, a_name, a_arrayName);
5422 then txt;
5423
5424 case ( txt,
5425 _,
5426 _,
5427 _,
5428 _,
5429 _ )
5430 then txt;
5431 end match;
5432 end fun_211;
5433
5434 protected function fun_212
5435 input Tpl.Text in_txt;
5436 input SimCodeVar.SimVar in_a_simVar;
5437 input SimCode.SimCode in_a_simCode;
5438 input String in_a_arrayName;
5439
5440 output Tpl.Text out_txt;
5441 algorithm
5442 out_txt :=
5443 match(in_txt, in_a_simVar, in_a_simCode, in_a_arrayName)
5444 local
5445 Tpl.Text txt;
5446 SimCode.SimCode a_simCode;
5447 String a_arrayName;
5448 Integer i_index;
5449 DAE.ComponentRef i_name;
5450 String i_comment;
5451 Boolean ret_2;
5452 Tpl.Text txt_1;
5453 Tpl.Text l_description;
5454
5455 case ( txt,
5456 SimCodeVar.SIMVAR(comment = i_comment, name = i_name, index = i_index),
5457 a_simCode,
5458 a_arrayName )
5459 algorithm
5460 21 l_description := fun_208(Tpl.emptyTxt, i_comment);
5461 21 txt_1 := CodegenUtil.crefStr(Tpl.emptyTxt, i_name);
5462
3/4
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 19 times.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
21 ret_2 := stringEq(Tpl.textString(txt_1), "$dummy");
5463 21 txt := fun_211(txt, ret_2, i_index, a_simCode, a_arrayName, i_name);
5464 then txt;
5465
5466 case ( txt,
5467 _,
5468 _,
5469 _ )
5470 then txt;
5471 end match;
5472 end fun_212;
5473
5474 public function SwitchVars
5475 input Tpl.Text txt;
5476 input SimCode.SimCode a_simCode;
5477 input SimCodeVar.SimVar a_simVar;
5478 input String a_arrayName;
5479
5480 output Tpl.Text out_txt;
5481 algorithm
5482 21 out_txt := fun_212(txt, a_simVar, a_simCode, a_arrayName);
5483 end SwitchVars;
5484
5485 protected function fun_214
5486 input Tpl.Text in_txt;
5487 input String in_a_comment;
5488
5489 output Tpl.Text out_txt;
5490 algorithm
5491 out_txt :=
5492 match(in_txt, in_a_comment)
5493 local
5494 Tpl.Text txt;
5495 String i_comment;
5496
5497 case ( txt,
5498 "" )
5499 then txt;
5500
5501 case ( txt,
5502 i_comment )
5503 algorithm
5504 310 txt := Tpl.writeTok(txt, Tpl.ST_STRING("// \""));
5505 310 txt := Tpl.writeStr(txt, i_comment);
5506 310 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
5507 then txt;
5508 end match;
5509 end fun_214;
5510
5511 protected function fun_215
5512 input Tpl.Text in_txt;
5513 input Boolean in_mArg;
5514 input Integer in_a_index;
5515 input String in_a_arrayName;
5516 input SimCode.SimCode in_a_simCode;
5517 input DAE.ComponentRef in_a_name;
5518
5519 output Tpl.Text out_txt;
5520 algorithm
5521 out_txt :=
5522 match(in_txt, in_mArg, in_a_index, in_a_arrayName, in_a_simCode, in_a_name)
5523 local
5524 Tpl.Text txt;
5525 Integer a_index;
5526 String a_arrayName;
5527 SimCode.SimCode a_simCode;
5528 DAE.ComponentRef a_name;
5529 Integer ret_1;
5530 Integer ret_0;
5531
5532 case ( txt,
5533 false,
5534 a_index,
5535 a_arrayName,
5536 a_simCode,
5537 a_name )
5538 algorithm
5539 195 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
5540 195 ret_0 := SimCodeCodegenUtil.lookupVR(a_name, a_simCode);
5541 195 txt := Tpl.writeStr(txt, intString(ret_0));
5542 195 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : return comp->fmuData->simulationInfo->"));
5543 195 txt := Tpl.writeStr(txt, a_arrayName);
5544 195 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
5545 195 txt := Tpl.writeStr(txt, intString(a_index));
5546 195 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]; break;"));
5547 then txt;
5548
5549 case ( txt,
5550 _,
5551 a_index,
5552 a_arrayName,
5553 a_simCode,
5554 a_name )
5555 algorithm
5556 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
5557 126 ret_1 := SimCodeCodegenUtil.lookupVR(a_name, a_simCode);
5558 126 txt := Tpl.writeStr(txt, intString(ret_1));
5559 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : return omc_string_data(comp->fmuData->simulationInfo->"));
5560 126 txt := Tpl.writeStr(txt, a_arrayName);
5561 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
5562 126 txt := Tpl.writeStr(txt, intString(a_index));
5563 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]); break;"));
5564 then txt;
5565 end match;
5566 end fun_215;
5567
5568 protected function fun_216
5569 input Tpl.Text in_txt;
5570 input SimCodeVar.SimVar in_a_simVar;
5571 input SimCode.SimCode in_a_simCode;
5572 input String in_a_arrayName;
5573
5574 output Tpl.Text out_txt;
5575 algorithm
5576 out_txt :=
5577 match(in_txt, in_a_simVar, in_a_simCode, in_a_arrayName)
5578 local
5579 Tpl.Text txt;
5580 SimCode.SimCode a_simCode;
5581 String a_arrayName;
5582 Integer i_index;
5583 DAE.ComponentRef i_name;
5584 String i_comment;
5585 Boolean ret_1;
5586 Tpl.Text l_description;
5587
5588 case ( txt,
5589 SimCodeVar.SIMVAR(comment = i_comment, name = i_name, index = i_index),
5590 a_simCode,
5591 a_arrayName )
5592 algorithm
5593 321 l_description := fun_214(Tpl.emptyTxt, i_comment);
5594
3/4
✓ Branch 0 taken 126 times.
✓ Branch 1 taken 195 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 126 times.
321 ret_1 := stringEq(a_arrayName, "stringParameter");
5595 321 txt := fun_215(txt, ret_1, i_index, a_arrayName, a_simCode, i_name);
5596 then txt;
5597
5598 case ( txt,
5599 _,
5600 _,
5601 _ )
5602 then txt;
5603 end match;
5604 end fun_216;
5605
5606 public function SwitchParameters
5607 input Tpl.Text txt;
5608 input SimCode.SimCode a_simCode;
5609 input SimCodeVar.SimVar a_simVar;
5610 input String a_arrayName;
5611
5612 output Tpl.Text out_txt;
5613 algorithm
5614 321 out_txt := fun_216(txt, a_simVar, a_simCode, a_arrayName);
5615 end SwitchParameters;
5616
5617 protected function fun_218
5618 input Tpl.Text in_txt;
5619 input String in_a_comment;
5620
5621 output Tpl.Text out_txt;
5622 algorithm
5623 out_txt :=
5624 match(in_txt, in_a_comment)
5625 local
5626 Tpl.Text txt;
5627 String i_comment;
5628
5629 case ( txt,
5630 "" )
5631 then txt;
5632
5633 case ( txt,
5634 i_comment )
5635 algorithm
5636 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("// \""));
5637 ✗ txt := Tpl.writeStr(txt, i_comment);
5638 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
5639 then txt;
5640 end match;
5641 end fun_218;
5642
5643 protected function fun_219
5644 input Tpl.Text in_txt;
5645 input Boolean in_mArg;
5646 input SimCode.SimCode in_a_simCode;
5647 input DAE.ComponentRef in_a_varName;
5648 input String in_a_arrayName;
5649 input Tpl.Text in_a_crefName;
5650
5651 output Tpl.Text out_txt;
5652 algorithm
5653 out_txt :=
5654 match(in_txt, in_mArg, in_a_simCode, in_a_varName, in_a_arrayName, in_a_crefName)
5655 local
5656 Tpl.Text txt;
5657 SimCode.SimCode a_simCode;
5658 DAE.ComponentRef a_varName;
5659 String a_arrayName;
5660 Tpl.Text a_crefName;
5661 Integer ret_0;
5662
5663 case ( txt,
5664 false,
5665 a_simCode,
5666 a_varName,
5667 a_arrayName,
5668 a_crefName )
5669 algorithm
5670 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
5671 ✗ txt := Tpl.writeText(txt, a_crefName);
5672 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : return get"));
5673 ✗ txt := Tpl.writeStr(txt, a_arrayName);
5674 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(comp, "));
5675 ✗ ret_0 := SimCodeCodegenUtil.lookupVR(a_varName, a_simCode);
5676 ✗ txt := Tpl.writeStr(txt, intString(ret_0));
5677 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("); break;"));
5678 then txt;
5679
5680 case ( txt,
5681 _,
5682 _,
5683 _,
5684 _,
5685 a_crefName )
5686 algorithm
5687 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
5688 ✗ txt := Tpl.writeText(txt, a_crefName);
5689 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : return comp->fmuData->localData[0]->timeValue; break;"));
5690 then txt;
5691 end match;
5692 end fun_219;
5693
5694 protected function fun_220
5695 input Tpl.Text in_txt;
5696 input Boolean in_mArg;
5697 input SimCode.SimCode in_a_simCode;
5698 input DAE.ComponentRef in_a_varName;
5699 input String in_a_arrayName;
5700 input String in_a_negate;
5701 input Tpl.Text in_a_crefName;
5702
5703 output Tpl.Text out_txt;
5704 algorithm
5705 out_txt :=
5706 match(in_txt, in_mArg, in_a_simCode, in_a_varName, in_a_arrayName, in_a_negate, in_a_crefName)
5707 local
5708 Tpl.Text txt;
5709 SimCode.SimCode a_simCode;
5710 DAE.ComponentRef a_varName;
5711 String a_arrayName;
5712 String a_negate;
5713 Tpl.Text a_crefName;
5714 Integer ret_0;
5715
5716 case ( txt,
5717 false,
5718 a_simCode,
5719 a_varName,
5720 a_arrayName,
5721 a_negate,
5722 a_crefName )
5723 algorithm
5724 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
5725 ✗ txt := Tpl.writeText(txt, a_crefName);
5726 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : return ("));
5727 ✗ txt := Tpl.writeStr(txt, a_negate);
5728 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" get"));
5729 ✗ txt := Tpl.writeStr(txt, a_arrayName);
5730 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(comp, "));
5731 ✗ ret_0 := SimCodeCodegenUtil.lookupVR(a_varName, a_simCode);
5732 ✗ txt := Tpl.writeStr(txt, intString(ret_0));
5733 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")); break;"));
5734 then txt;
5735
5736 case ( txt,
5737 _,
5738 _,
5739 _,
5740 _,
5741 _,
5742 a_crefName )
5743 algorithm
5744 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
5745 ✗ txt := Tpl.writeText(txt, a_crefName);
5746 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : return comp->fmuData->localData[0]->timeValue; break;"));
5747 then txt;
5748 end match;
5749 end fun_220;
5750
5751 protected function fun_221
5752 input Tpl.Text in_txt;
5753 input SimCodeVar.AliasVariable in_a_aliasvar;
5754 input String in_a_negate;
5755 input SimCode.SimCode in_a_simCode;
5756 input String in_a_arrayName;
5757 input Tpl.Text in_a_crefName;
5758
5759 output Tpl.Text out_txt;
5760 algorithm
5761 out_txt :=
5762 match(in_txt, in_a_aliasvar, in_a_negate, in_a_simCode, in_a_arrayName, in_a_crefName)
5763 local
5764 Tpl.Text txt;
5765 String a_negate;
5766 SimCode.SimCode a_simCode;
5767 String a_arrayName;
5768 Tpl.Text a_crefName;
5769 DAE.ComponentRef i_varName;
5770 Boolean ret_3;
5771 Tpl.Text txt_2;
5772 Boolean ret_1;
5773 Tpl.Text txt_0;
5774
5775 case ( txt,
5776 SimCodeVar.ALIAS(varName = i_varName),
5777 _,
5778 a_simCode,
5779 a_arrayName,
5780 a_crefName )
5781 algorithm
5782 ✗ txt_0 := CodegenUtil.crefStr(Tpl.emptyTxt, i_varName);
5783 ✗ ret_1 := stringEq(Tpl.textString(txt_0), "time");
5784 ✗ txt := fun_219(txt, ret_1, a_simCode, i_varName, a_arrayName, a_crefName);
5785 then txt;
5786
5787 case ( txt,
5788 SimCodeVar.NEGATEDALIAS(varName = i_varName),
5789 a_negate,
5790 a_simCode,
5791 a_arrayName,
5792 a_crefName )
5793 algorithm
5794 ✗ txt_2 := CodegenUtil.crefStr(Tpl.emptyTxt, i_varName);
5795 ✗ ret_3 := stringEq(Tpl.textString(txt_2), "time");
5796 ✗ txt := fun_220(txt, ret_3, a_simCode, i_varName, a_arrayName, a_negate, a_crefName);
5797 then txt;
5798
5799 case ( txt,
5800 _,
5801 _,
5802 _,
5803 _,
5804 _ )
5805 then txt;
5806 end match;
5807 end fun_221;
5808
5809 protected function fun_222
5810 input Tpl.Text in_txt;
5811 input SimCodeVar.SimVar in_a_simVar;
5812 input SimCode.SimCode in_a_simCode;
5813 input String in_a_arrayName;
5814 input String in_a_negate;
5815
5816 output Tpl.Text out_txt;
5817 algorithm
5818 out_txt :=
5819 match(in_txt, in_a_simVar, in_a_simCode, in_a_arrayName, in_a_negate)
5820 local
5821 Tpl.Text txt;
5822 SimCode.SimCode a_simCode;
5823 String a_arrayName;
5824 String a_negate;
5825 SimCodeVar.AliasVariable i_aliasvar;
5826 DAE.ComponentRef i_name;
5827 String i_comment;
5828 Integer ret_2;
5829 Tpl.Text l_crefName;
5830 Tpl.Text l_description;
5831
5832 case ( txt,
5833 SimCodeVar.SIMVAR(comment = i_comment, name = i_name, aliasvar = i_aliasvar),
5834 a_simCode,
5835 a_arrayName,
5836 a_negate )
5837 algorithm
5838 ✗ l_description := fun_218(Tpl.emptyTxt, i_comment);
5839 ✗ ret_2 := SimCodeCodegenUtil.lookupVR(i_name, a_simCode);
5840 ✗ l_crefName := Tpl.writeStr(Tpl.emptyTxt, intString(ret_2));
5841 ✗ txt := fun_221(txt, i_aliasvar, a_negate, a_simCode, a_arrayName, l_crefName);
5842 then txt;
5843
5844 case ( txt,
5845 _,
5846 _,
5847 _,
5848 _ )
5849 then txt;
5850 end match;
5851 end fun_222;
5852
5853 public function SwitchAliasVars
5854 input Tpl.Text txt;
5855 input SimCode.SimCode a_simCode;
5856 input SimCodeVar.SimVar a_simVar;
5857 input String a_arrayName;
5858 input String a_negate;
5859
5860 output Tpl.Text out_txt;
5861 algorithm
5862 ✗ out_txt := fun_222(txt, a_simVar, a_simCode, a_arrayName, a_negate);
5863 end SwitchAliasVars;
5864
5865 protected function fun_224
5866 input Tpl.Text in_txt;
5867 input String in_a_comment;
5868
5869 output Tpl.Text out_txt;
5870 algorithm
5871 out_txt :=
5872 match(in_txt, in_a_comment)
5873 local
5874 Tpl.Text txt;
5875 String i_comment;
5876
5877 case ( txt,
5878 "" )
5879 then txt;
5880
5881 case ( txt,
5882 i_comment )
5883 algorithm
5884 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING("// \""));
5885 10 txt := Tpl.writeStr(txt, i_comment);
5886 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
5887 then txt;
5888 end match;
5889 end fun_224;
5890
5891 protected function fun_225
5892 input Tpl.Text in_txt;
5893 input Boolean in_mArg;
5894 input Integer in_a_index;
5895 input String in_a_arrayName;
5896 input SimCode.SimCode in_a_simCode;
5897 input DAE.ComponentRef in_a_name;
5898
5899 output Tpl.Text out_txt;
5900 algorithm
5901 out_txt :=
5902 match(in_txt, in_mArg, in_a_index, in_a_arrayName, in_a_simCode, in_a_name)
5903 local
5904 Tpl.Text txt;
5905 Integer a_index;
5906 String a_arrayName;
5907 SimCode.SimCode a_simCode;
5908 DAE.ComponentRef a_name;
5909 Integer ret_1;
5910 Integer ret_0;
5911
5912 case ( txt,
5913 false,
5914 a_index,
5915 a_arrayName,
5916 a_simCode,
5917 a_name )
5918 algorithm
5919 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
5920 18 ret_0 := SimCodeCodegenUtil.lookupVR(a_name, a_simCode);
5921 18 txt := Tpl.writeStr(txt, intString(ret_0));
5922 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : comp->fmuData->localData[0]->"));
5923 18 txt := Tpl.writeStr(txt, a_arrayName);
5924 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
5925 18 txt := Tpl.writeStr(txt, intString(a_index));
5926 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING("] = value; break;"));
5927 then txt;
5928
5929 case ( txt,
5930 _,
5931 a_index,
5932 a_arrayName,
5933 a_simCode,
5934 a_name )
5935 algorithm
5936 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
5937 3 ret_1 := SimCodeCodegenUtil.lookupVR(a_name, a_simCode);
5938 3 txt := Tpl.writeStr(txt, intString(ret_1));
5939 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : omc_string_move(&comp->fmuData->localData[0]->"));
5940 3 txt := Tpl.writeStr(txt, a_arrayName);
5941 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
5942 3 txt := Tpl.writeStr(txt, intString(a_index));
5943 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("], omc_string_new(value)); break;"));
5944 then txt;
5945 end match;
5946 end fun_225;
5947
5948 protected function fun_226
5949 input Tpl.Text in_txt;
5950 input Boolean in_mArg;
5951 input Integer in_a_index;
5952 input SimCode.SimCode in_a_simCode;
5953 input DAE.ComponentRef in_a_name;
5954 input String in_a_arrayName;
5955
5956 output Tpl.Text out_txt;
5957 algorithm
5958 out_txt :=
5959 match(in_txt, in_mArg, in_a_index, in_a_simCode, in_a_name, in_a_arrayName)
5960 local
5961 Tpl.Text txt;
5962 Integer a_index;
5963 SimCode.SimCode a_simCode;
5964 DAE.ComponentRef a_name;
5965 String a_arrayName;
5966 Boolean ret_0;
5967
5968 case ( txt,
5969 false,
5970 a_index,
5971 a_simCode,
5972 a_name,
5973 a_arrayName )
5974 algorithm
5975
3/4
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 18 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
21 ret_0 := stringEq(a_arrayName, "stringVars");
5976 21 txt := fun_225(txt, ret_0, a_index, a_arrayName, a_simCode, a_name);
5977 then txt;
5978
5979 case ( txt,
5980 _,
5981 _,
5982 _,
5983 _,
5984 _ )
5985 then txt;
5986 end match;
5987 end fun_226;
5988
5989 protected function fun_227
5990 input Tpl.Text in_txt;
5991 input Boolean in_mArg;
5992 input Integer in_a_index;
5993 input SimCode.SimCode in_a_simCode;
5994 input String in_a_arrayName;
5995 input DAE.ComponentRef in_a_name;
5996
5997 output Tpl.Text out_txt;
5998 algorithm
5999 out_txt :=
6000 match(in_txt, in_mArg, in_a_index, in_a_simCode, in_a_arrayName, in_a_name)
6001 local
6002 Tpl.Text txt;
6003 Integer a_index;
6004 SimCode.SimCode a_simCode;
6005 String a_arrayName;
6006 DAE.ComponentRef a_name;
6007 Boolean ret_1;
6008 Tpl.Text txt_0;
6009
6010 case ( txt,
6011 false,
6012 a_index,
6013 a_simCode,
6014 a_arrayName,
6015 a_name )
6016 algorithm
6017 21 txt_0 := CodegenUtil.crefStr(Tpl.emptyTxt, a_name);
6018
1/4
✗ Branch 1 not taken.
✓ Branch 2 taken 21 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
21 ret_1 := stringEq(Tpl.textString(txt_0), "der($dummy)");
6019 21 txt := fun_226(txt, ret_1, a_index, a_simCode, a_name, a_arrayName);
6020 then txt;
6021
6022 case ( txt,
6023 _,
6024 _,
6025 _,
6026 _,
6027 _ )
6028 then txt;
6029 end match;
6030 end fun_227;
6031
6032 protected function fun_228
6033 input Tpl.Text in_txt;
6034 input SimCodeVar.SimVar in_a_simVar;
6035 input SimCode.SimCode in_a_simCode;
6036 input String in_a_arrayName;
6037
6038 output Tpl.Text out_txt;
6039 algorithm
6040 out_txt :=
6041 match(in_txt, in_a_simVar, in_a_simCode, in_a_arrayName)
6042 local
6043 Tpl.Text txt;
6044 SimCode.SimCode a_simCode;
6045 String a_arrayName;
6046 Integer i_index;
6047 DAE.ComponentRef i_name;
6048 String i_comment;
6049 Boolean ret_2;
6050 Tpl.Text txt_1;
6051 Tpl.Text l_description;
6052
6053 case ( txt,
6054 SimCodeVar.SIMVAR(comment = i_comment, name = i_name, index = i_index),
6055 a_simCode,
6056 a_arrayName )
6057 algorithm
6058 21 l_description := fun_224(Tpl.emptyTxt, i_comment);
6059 21 txt_1 := CodegenUtil.crefStr(Tpl.emptyTxt, i_name);
6060
3/4
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 19 times.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
21 ret_2 := stringEq(Tpl.textString(txt_1), "$dummy");
6061 21 txt := fun_227(txt, ret_2, i_index, a_simCode, a_arrayName, i_name);
6062 then txt;
6063
6064 case ( txt,
6065 _,
6066 _,
6067 _ )
6068 then txt;
6069 end match;
6070 end fun_228;
6071
6072 public function SwitchVarsSet
6073 input Tpl.Text txt;
6074 input SimCode.SimCode a_simCode;
6075 input SimCodeVar.SimVar a_simVar;
6076 input String a_arrayName;
6077
6078 output Tpl.Text out_txt;
6079 algorithm
6080 21 out_txt := fun_228(txt, a_simVar, a_simCode, a_arrayName);
6081 end SwitchVarsSet;
6082
6083 protected function fun_230
6084 input Tpl.Text in_txt;
6085 input String in_a_comment;
6086
6087 output Tpl.Text out_txt;
6088 algorithm
6089 out_txt :=
6090 match(in_txt, in_a_comment)
6091 local
6092 Tpl.Text txt;
6093 String i_comment;
6094
6095 case ( txt,
6096 "" )
6097 then txt;
6098
6099 case ( txt,
6100 i_comment )
6101 algorithm
6102 310 txt := Tpl.writeTok(txt, Tpl.ST_STRING("// \""));
6103 310 txt := Tpl.writeStr(txt, i_comment);
6104 310 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
6105 then txt;
6106 end match;
6107 end fun_230;
6108
6109 protected function fun_231
6110 input Tpl.Text in_txt;
6111 input Boolean in_mArg;
6112 input Integer in_a_index;
6113 input String in_a_arrayName;
6114 input SimCode.SimCode in_a_simCode;
6115 input DAE.ComponentRef in_a_name;
6116
6117 output Tpl.Text out_txt;
6118 algorithm
6119 out_txt :=
6120 match(in_txt, in_mArg, in_a_index, in_a_arrayName, in_a_simCode, in_a_name)
6121 local
6122 Tpl.Text txt;
6123 Integer a_index;
6124 String a_arrayName;
6125 SimCode.SimCode a_simCode;
6126 DAE.ComponentRef a_name;
6127 Integer ret_1;
6128 Integer ret_0;
6129
6130 case ( txt,
6131 false,
6132 a_index,
6133 a_arrayName,
6134 a_simCode,
6135 a_name )
6136 algorithm
6137 195 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
6138 195 ret_0 := SimCodeCodegenUtil.lookupVR(a_name, a_simCode);
6139 195 txt := Tpl.writeStr(txt, intString(ret_0));
6140 195 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : comp->fmuData->simulationInfo->"));
6141 195 txt := Tpl.writeStr(txt, a_arrayName);
6142 195 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
6143 195 txt := Tpl.writeStr(txt, intString(a_index));
6144 195 txt := Tpl.writeTok(txt, Tpl.ST_STRING("] = value; break;"));
6145 then txt;
6146
6147 case ( txt,
6148 _,
6149 a_index,
6150 a_arrayName,
6151 a_simCode,
6152 a_name )
6153 algorithm
6154 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
6155 126 ret_1 := SimCodeCodegenUtil.lookupVR(a_name, a_simCode);
6156 126 txt := Tpl.writeStr(txt, intString(ret_1));
6157 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : omc_string_move(&comp->fmuData->simulationInfo->"));
6158 126 txt := Tpl.writeStr(txt, a_arrayName);
6159 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
6160 126 txt := Tpl.writeStr(txt, intString(a_index));
6161 126 txt := Tpl.writeTok(txt, Tpl.ST_STRING("], omc_string_new(value)); break;"));
6162 then txt;
6163 end match;
6164 end fun_231;
6165
6166 protected function fun_232
6167 input Tpl.Text in_txt;
6168 input SimCodeVar.SimVar in_a_simVar;
6169 input SimCode.SimCode in_a_simCode;
6170 input String in_a_arrayName;
6171
6172 output Tpl.Text out_txt;
6173 algorithm
6174 out_txt :=
6175 match(in_txt, in_a_simVar, in_a_simCode, in_a_arrayName)
6176 local
6177 Tpl.Text txt;
6178 SimCode.SimCode a_simCode;
6179 String a_arrayName;
6180 Integer i_index;
6181 DAE.ComponentRef i_name;
6182 String i_comment;
6183 Boolean ret_1;
6184 Tpl.Text l_description;
6185
6186 case ( txt,
6187 SimCodeVar.SIMVAR(comment = i_comment, name = i_name, index = i_index),
6188 a_simCode,
6189 a_arrayName )
6190 algorithm
6191 321 l_description := fun_230(Tpl.emptyTxt, i_comment);
6192
3/4
✓ Branch 0 taken 126 times.
✓ Branch 1 taken 195 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 126 times.
321 ret_1 := stringEq(a_arrayName, "stringParameter");
6193 321 txt := fun_231(txt, ret_1, i_index, a_arrayName, a_simCode, i_name);
6194 then txt;
6195
6196 case ( txt,
6197 _,
6198 _,
6199 _ )
6200 then txt;
6201 end match;
6202 end fun_232;
6203
6204 public function SwitchParametersSet
6205 input Tpl.Text txt;
6206 input SimCode.SimCode a_simCode;
6207 input SimCodeVar.SimVar a_simVar;
6208 input String a_arrayName;
6209
6210 output Tpl.Text out_txt;
6211 algorithm
6212 321 out_txt := fun_232(txt, a_simVar, a_simCode, a_arrayName);
6213 end SwitchParametersSet;
6214
6215 protected function fun_234
6216 input Tpl.Text in_txt;
6217 input String in_a_comment;
6218
6219 output Tpl.Text out_txt;
6220 algorithm
6221 out_txt :=
6222 match(in_txt, in_a_comment)
6223 local
6224 Tpl.Text txt;
6225 String i_comment;
6226
6227 case ( txt,
6228 "" )
6229 then txt;
6230
6231 case ( txt,
6232 i_comment )
6233 algorithm
6234 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("// \""));
6235 ✗ txt := Tpl.writeStr(txt, i_comment);
6236 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
6237 then txt;
6238 end match;
6239 end fun_234;
6240
6241 protected function fun_235
6242 input Tpl.Text in_txt;
6243 input Boolean in_mArg;
6244 input SimCode.SimCode in_a_simCode;
6245 input DAE.ComponentRef in_a_varName;
6246 input String in_a_arrayName;
6247 input Tpl.Text in_a_crefName;
6248
6249 output Tpl.Text out_txt;
6250 algorithm
6251 out_txt :=
6252 match(in_txt, in_mArg, in_a_simCode, in_a_varName, in_a_arrayName, in_a_crefName)
6253 local
6254 Tpl.Text txt;
6255 SimCode.SimCode a_simCode;
6256 DAE.ComponentRef a_varName;
6257 String a_arrayName;
6258 Tpl.Text a_crefName;
6259 Integer ret_0;
6260
6261 case ( txt,
6262 false,
6263 a_simCode,
6264 a_varName,
6265 a_arrayName,
6266 a_crefName )
6267 algorithm
6268 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
6269 ✗ txt := Tpl.writeText(txt, a_crefName);
6270 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : return set"));
6271 ✗ txt := Tpl.writeStr(txt, a_arrayName);
6272 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(comp, "));
6273 ✗ ret_0 := SimCodeCodegenUtil.lookupVR(a_varName, a_simCode);
6274 ✗ txt := Tpl.writeStr(txt, intString(ret_0));
6275 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", value); break;"));
6276 then txt;
6277
6278 case ( txt,
6279 _,
6280 _,
6281 _,
6282 _,
6283 _ )
6284 then txt;
6285 end match;
6286 end fun_235;
6287
6288 protected function fun_236
6289 input Tpl.Text in_txt;
6290 input Boolean in_mArg;
6291 input String in_a_negate;
6292 input SimCode.SimCode in_a_simCode;
6293 input DAE.ComponentRef in_a_varName;
6294 input String in_a_arrayName;
6295 input Tpl.Text in_a_crefName;
6296
6297 output Tpl.Text out_txt;
6298 algorithm
6299 out_txt :=
6300 match(in_txt, in_mArg, in_a_negate, in_a_simCode, in_a_varName, in_a_arrayName, in_a_crefName)
6301 local
6302 Tpl.Text txt;
6303 String a_negate;
6304 SimCode.SimCode a_simCode;
6305 DAE.ComponentRef a_varName;
6306 String a_arrayName;
6307 Tpl.Text a_crefName;
6308 Integer ret_0;
6309
6310 case ( txt,
6311 false,
6312 a_negate,
6313 a_simCode,
6314 a_varName,
6315 a_arrayName,
6316 a_crefName )
6317 algorithm
6318 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
6319 ✗ txt := Tpl.writeText(txt, a_crefName);
6320 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" : return set"));
6321 ✗ txt := Tpl.writeStr(txt, a_arrayName);
6322 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(comp, "));
6323 ✗ ret_0 := SimCodeCodegenUtil.lookupVR(a_varName, a_simCode);
6324 ✗ txt := Tpl.writeStr(txt, intString(ret_0));
6325 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", ("));
6326 ✗ txt := Tpl.writeStr(txt, a_negate);
6327 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" value)); break;"));
6328 then txt;
6329
6330 case ( txt,
6331 _,
6332 _,
6333 _,
6334 _,
6335 _,
6336 _ )
6337 then txt;
6338 end match;
6339 end fun_236;
6340
6341 protected function fun_237
6342 input Tpl.Text in_txt;
6343 input SimCodeVar.AliasVariable in_a_aliasvar;
6344 input String in_a_negate;
6345 input SimCode.SimCode in_a_simCode;
6346 input String in_a_arrayName;
6347 input Tpl.Text in_a_crefName;
6348
6349 output Tpl.Text out_txt;
6350 algorithm
6351 out_txt :=
6352 match(in_txt, in_a_aliasvar, in_a_negate, in_a_simCode, in_a_arrayName, in_a_crefName)
6353 local
6354 Tpl.Text txt;
6355 String a_negate;
6356 SimCode.SimCode a_simCode;
6357 String a_arrayName;
6358 Tpl.Text a_crefName;
6359 DAE.ComponentRef i_varName;
6360 Boolean ret_3;
6361 Tpl.Text txt_2;
6362 Boolean ret_1;
6363 Tpl.Text txt_0;
6364
6365 case ( txt,
6366 SimCodeVar.ALIAS(varName = i_varName),
6367 _,
6368 a_simCode,
6369 a_arrayName,
6370 a_crefName )
6371 algorithm
6372 ✗ txt_0 := CodegenUtil.crefStr(Tpl.emptyTxt, i_varName);
6373 ✗ ret_1 := stringEq(Tpl.textString(txt_0), "time");
6374 ✗ txt := fun_235(txt, ret_1, a_simCode, i_varName, a_arrayName, a_crefName);
6375 then txt;
6376
6377 case ( txt,
6378 SimCodeVar.NEGATEDALIAS(varName = i_varName),
6379 a_negate,
6380 a_simCode,
6381 a_arrayName,
6382 a_crefName )
6383 algorithm
6384 ✗ txt_2 := CodegenUtil.crefStr(Tpl.emptyTxt, i_varName);
6385 ✗ ret_3 := stringEq(Tpl.textString(txt_2), "time");
6386 ✗ txt := fun_236(txt, ret_3, a_negate, a_simCode, i_varName, a_arrayName, a_crefName);
6387 then txt;
6388
6389 case ( txt,
6390 _,
6391 _,
6392 _,
6393 _,
6394 _ )
6395 then txt;
6396 end match;
6397 end fun_237;
6398
6399 protected function fun_238
6400 input Tpl.Text in_txt;
6401 input SimCodeVar.SimVar in_a_simVar;
6402 input SimCode.SimCode in_a_simCode;
6403 input String in_a_arrayName;
6404 input String in_a_negate;
6405
6406 output Tpl.Text out_txt;
6407 algorithm
6408 out_txt :=
6409 match(in_txt, in_a_simVar, in_a_simCode, in_a_arrayName, in_a_negate)
6410 local
6411 Tpl.Text txt;
6412 SimCode.SimCode a_simCode;
6413 String a_arrayName;
6414 String a_negate;
6415 SimCodeVar.AliasVariable i_aliasvar;
6416 DAE.ComponentRef i_name;
6417 String i_comment;
6418 Integer ret_2;
6419 Tpl.Text l_crefName;
6420 Tpl.Text l_description;
6421
6422 case ( txt,
6423 SimCodeVar.SIMVAR(comment = i_comment, name = i_name, aliasvar = i_aliasvar),
6424 a_simCode,
6425 a_arrayName,
6426 a_negate )
6427 algorithm
6428 ✗ l_description := fun_234(Tpl.emptyTxt, i_comment);
6429 ✗ ret_2 := SimCodeCodegenUtil.lookupVR(i_name, a_simCode);
6430 ✗ l_crefName := Tpl.writeStr(Tpl.emptyTxt, intString(ret_2));
6431 ✗ txt := fun_237(txt, i_aliasvar, a_negate, a_simCode, a_arrayName, l_crefName);
6432 then txt;
6433
6434 case ( txt,
6435 _,
6436 _,
6437 _,
6438 _ )
6439 then txt;
6440 end match;
6441 end fun_238;
6442
6443 public function SwitchAliasVarsSet
6444 input Tpl.Text txt;
6445 input SimCode.SimCode a_simCode;
6446 input SimCodeVar.SimVar a_simVar;
6447 input String a_arrayName;
6448 input String a_negate;
6449
6450 output Tpl.Text out_txt;
6451 algorithm
6452 ✗ out_txt := fun_238(txt, a_simVar, a_simCode, a_arrayName, a_negate);
6453 end SwitchAliasVarsSet;
6454
6455 protected function fun_240
6456 input Tpl.Text in_txt;
6457 input SimCodeVar.SimVar in_a_var;
6458 input Integer in_a_index0;
6459 input SimCode.SimCode in_a_simCode;
6460
6461 output Tpl.Text out_txt;
6462 algorithm
6463 out_txt :=
6464 match(in_txt, in_a_var, in_a_index0, in_a_simCode)
6465 local
6466 Tpl.Text txt;
6467 Integer a_index0;
6468 SimCode.SimCode a_simCode;
6469 DAE.ComponentRef i_name;
6470 Integer ret_0;
6471
6472 case ( txt,
6473 SimCodeVar.SIMVAR(name = i_name, type_ = DAE.T_REAL(varLst = _)),
6474 a_index0,
6475 a_simCode )
6476 algorithm
6477 30 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
6478 30 ret_0 := SimCodeCodegenUtil.lookupVR(i_name, a_simCode);
6479 30 txt := Tpl.writeStr(txt, intString(ret_0));
6480 30 txt := Tpl.writeTok(txt, Tpl.ST_STRING(": return "));
6481 30 txt := Tpl.writeStr(txt, intString(a_index0));
6482 30 txt := Tpl.writeTok(txt, Tpl.ST_STRING("; break;"));
6483 then txt;
6484
6485 case ( txt,
6486 _,
6487 _,
6488 _ )
6489 then txt;
6490 end match;
6491 end fun_240;
6492
6493 protected function lm_241
6494 input output Tpl.Text txt;
6495 input list<SimCodeVar.SimVar> items;
6496 input SimCode.SimCode a_simCode;
6497 algorithm
6498
2/2
✓ Branch 0 taken 34 times.
✓ Branch 1 taken 80 times.
114 for lstElt_241 in items loop
6499 txt := match lstElt_241
6500 local
6501 Integer x_index0;
6502 SimCodeVar.SimVar i_var;
6503
6504 case i_var
6505 algorithm
6506 34 x_index0 := Tpl.getIteri_i0(txt);
6507 34 txt := fun_240(txt, i_var, x_index0, a_simCode);
6508 34 txt := Tpl.nextIter(txt);
6509 then txt;
6510 end match;
6511 end for;
6512 end lm_241;
6513
6514 protected function fun_242
6515 input Tpl.Text in_txt;
6516 input SimCodeVar.SimVar in_a_var;
6517 input Integer in_a_index0;
6518 input SimCode.SimCode in_a_simCode;
6519
6520 output Tpl.Text out_txt;
6521 algorithm
6522 out_txt :=
6523 match(in_txt, in_a_var, in_a_index0, in_a_simCode)
6524 local
6525 Tpl.Text txt;
6526 Integer a_index0;
6527 SimCode.SimCode a_simCode;
6528 DAE.ComponentRef i_name;
6529 Integer ret_0;
6530
6531 case ( txt,
6532 SimCodeVar.SIMVAR(name = i_name, type_ = DAE.T_REAL(varLst = _)),
6533 a_index0,
6534 a_simCode )
6535 algorithm
6536 87 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
6537 87 ret_0 := SimCodeCodegenUtil.lookupVR(i_name, a_simCode);
6538 87 txt := Tpl.writeStr(txt, intString(ret_0));
6539 87 txt := Tpl.writeTok(txt, Tpl.ST_STRING(": return "));
6540 87 txt := Tpl.writeStr(txt, intString(a_index0));
6541 87 txt := Tpl.writeTok(txt, Tpl.ST_STRING("; break;"));
6542 then txt;
6543
6544 case ( txt,
6545 _,
6546 _,
6547 _ )
6548 then txt;
6549 end match;
6550 end fun_242;
6551
6552 protected function lm_243
6553 input output Tpl.Text txt;
6554 input list<SimCodeVar.SimVar> items;
6555 input SimCode.SimCode a_simCode;
6556 algorithm
6557
2/2
✓ Branch 0 taken 93 times.
✓ Branch 1 taken 80 times.
173 for lstElt_243 in items loop
6558 txt := match lstElt_243
6559 local
6560 Integer x_index0;
6561 SimCodeVar.SimVar i_var;
6562
6563 case i_var
6564 algorithm
6565 93 x_index0 := Tpl.getIteri_i0(txt);
6566 93 txt := fun_242(txt, i_var, x_index0, a_simCode);
6567 93 txt := Tpl.nextIter(txt);
6568 then txt;
6569 end match;
6570 end for;
6571 end lm_243;
6572
6573 public function mapInputAndOutputs
6574 input Tpl.Text in_txt;
6575 input SimCode.SimCode in_a_simCode;
6576
6577 output Tpl.Text out_txt;
6578 algorithm
6579 out_txt :=
6580 match(in_txt, in_a_simCode)
6581 local
6582 Tpl.Text txt;
6583 list<SimCodeVar.SimVar> i_outputVars;
6584 SimCode.SimCode i_simCode;
6585 list<SimCodeVar.SimVar> i_inputVars;
6586
6587 case ( txt,
6588 (i_simCode as SimCode.SIMCODE(modelInfo = SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(inputVars = i_inputVars, outputVars = i_outputVars)))) )
6589 algorithm
6590 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6591 "/* function maps input references to a input index used in partialDerivatives */\n",
6592 "fmi2ValueReference mapInputReference2InputNumber(const fmi2ValueReference vr) {\n",
6593 " switch (vr) {\n"
6594 }, true));
6595 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(6));
6596 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
6597 80 txt := lm_241(txt, i_inputVars, i_simCode);
6598 80 txt := Tpl.popIter(txt);
6599 80 txt := Tpl.softNewLine(txt);
6600 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6601 "default:\n",
6602 " return -1;\n"
6603 }, true));
6604 80 txt := Tpl.popBlock(txt);
6605 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6606 " }\n",
6607 "}\n",
6608 "/* function maps output references to a input index used in partialDerivatives */\n",
6609 "fmi2ValueReference mapOutputReference2OutputNumber(const fmi2ValueReference vr) {\n",
6610 " switch (vr) {\n"
6611 }, true));
6612 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(6));
6613 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
6614 80 txt := lm_243(txt, i_outputVars, i_simCode);
6615 80 txt := Tpl.popIter(txt);
6616 80 txt := Tpl.softNewLine(txt);
6617 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6618 "default:\n",
6619 " return -1;\n"
6620 }, true));
6621 80 txt := Tpl.popBlock(txt);
6622 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6623 " }\n",
6624 "}"
6625 }, false));
6626 then txt;
6627
6628 case ( txt,
6629 _ )
6630 then txt;
6631 end match;
6632 end mapInputAndOutputs;
6633
6634 protected function fun_245
6635 input Tpl.Text in_txt;
6636 input SimCodeVar.SimVar in_a_var;
6637 input String in_a_FMUType;
6638 input SimCode.SimCode in_a_simCode;
6639
6640 output Tpl.Text out_txt;
6641 algorithm
6642 out_txt :=
6643 match(in_txt, in_a_var, in_a_FMUType, in_a_simCode)
6644 local
6645 Tpl.Text txt;
6646 String a_FMUType;
6647 SimCode.SimCode a_simCode;
6648 DAE.ComponentRef i_name;
6649 Integer ret_1;
6650 Integer ret_0;
6651
6652 case ( txt,
6653 SimCodeVar.SIMVAR(name = i_name, type_ = DAE.T_REAL(varLst = _)),
6654 a_FMUType,
6655 a_simCode )
6656 algorithm
6657 87 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
6658 87 ret_0 := SimCodeCodegenUtil.lookupVR(i_name, a_simCode);
6659 87 txt := Tpl.writeStr(txt, intString(ret_0));
6660 87 txt := Tpl.writeTok(txt, Tpl.ST_STRING(": return "));
6661 87 ret_1 := SimCodeCodegenUtil.lookupVRForRealOutputDerivative(i_name, a_simCode, a_FMUType);
6662 87 txt := Tpl.writeStr(txt, intString(ret_1));
6663 87 txt := Tpl.writeTok(txt, Tpl.ST_STRING("; break;"));
6664 then txt;
6665
6666 case ( txt,
6667 _,
6668 _,
6669 _ )
6670 then txt;
6671 end match;
6672 end fun_245;
6673
6674 protected function lm_246
6675 input output Tpl.Text txt;
6676 input list<SimCodeVar.SimVar> items;
6677 input String a_FMUType;
6678 input SimCode.SimCode a_simCode;
6679 algorithm
6680
2/2
✓ Branch 0 taken 93 times.
✓ Branch 1 taken 80 times.
173 for lstElt_246 in items loop
6681 txt := match lstElt_246
6682 local
6683 SimCodeVar.SimVar i_var;
6684
6685 case i_var
6686 algorithm
6687 93 txt := fun_245(txt, i_var, a_FMUType, a_simCode);
6688 93 txt := Tpl.nextIter(txt);
6689 then txt;
6690 end match;
6691 end for;
6692 end lm_246;
6693
6694 public function mapRealOutputDerivatives
6695 input Tpl.Text in_txt;
6696 input SimCode.SimCode in_a_simCode;
6697 input String in_a_FMUType;
6698
6699 output Tpl.Text out_txt;
6700 algorithm
6701 out_txt :=
6702 match(in_txt, in_a_simCode, in_a_FMUType)
6703 local
6704 Tpl.Text txt;
6705 String a_FMUType;
6706 SimCode.SimCode i_simCode;
6707 list<SimCodeVar.SimVar> i_outputVars;
6708
6709 case ( txt,
6710 (i_simCode as SimCode.SIMCODE(modelInfo = SimCode.MODELINFO(vars = SimCodeVar.SIMVARS(outputVars = i_outputVars)))),
6711 a_FMUType )
6712 algorithm
6713 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6714 "/* function maps output references to an internal output Real derivatives */\n",
6715 "fmi2ValueReference mapOutputReference2RealOutputDerivatives(const fmi2ValueReference vr) {\n",
6716 " switch (vr) {\n"
6717 }, true));
6718 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(6));
6719 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
6720 80 txt := lm_246(txt, i_outputVars, a_FMUType, i_simCode);
6721 80 txt := Tpl.popIter(txt);
6722 80 txt := Tpl.softNewLine(txt);
6723 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6724 "default:\n",
6725 " return -1;\n"
6726 }, true));
6727 80 txt := Tpl.popBlock(txt);
6728 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6729 " }\n",
6730 "}"
6731 }, false));
6732 then txt;
6733
6734 case ( txt,
6735 _,
6736 _ )
6737 then txt;
6738 end match;
6739 end mapRealOutputDerivatives;
6740
6741 protected function lm_248
6742 input output Tpl.Text txt;
6743 input list<tuple<Integer, DAE.ComponentRef>> items;
6744 input SimCode.SimCode a_simCode;
6745 algorithm
6746
2/2
✓ Branch 0 taken 1669 times.
✓ Branch 1 taken 80 times.
1749 for lstElt_248 in items loop
6747 txt := match lstElt_248
6748 local
6749 Integer i_index;
6750 DAE.ComponentRef i_cref;
6751 Integer ret_0;
6752
6753 case (i_index, i_cref)
6754 algorithm
6755 1669 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
6756 1669 ret_0 := SimCodeCodegenUtil.lookupVR(i_cref, a_simCode);
6757 1669 txt := Tpl.writeStr(txt, intString(ret_0));
6758 1669 txt := Tpl.writeTok(txt, Tpl.ST_STRING(": return "));
6759 1669 txt := Tpl.writeStr(txt, intString(i_index));
6760 1669 txt := Tpl.writeTok(txt, Tpl.ST_STRING("; break;"));
6761 1669 txt := Tpl.nextIter(txt);
6762 then txt;
6763 end match;
6764 end for;
6765 end lm_248;
6766
6767 public function mapInitialUnknownsdependentCrefs
6768 input Tpl.Text in_txt;
6769 input SimCode.SimCode in_a_simCode;
6770
6771 output Tpl.Text out_txt;
6772 algorithm
6773 out_txt :=
6774 match(in_txt, in_a_simCode)
6775 local
6776 Tpl.Text txt;
6777 SimCode.SimCode i_simCode;
6778 list<tuple<Integer, DAE.ComponentRef>> i_sortedUnknownCrefs;
6779
6780 case ( txt,
6781 (i_simCode as SimCode.SIMCODE(modelStructure = SOME(SimCode.FMIMODELSTRUCTURE(fmiInitialUnknowns = SimCode.FMIINITIALUNKNOWNS(sortedUnknownCrefs = i_sortedUnknownCrefs))))) )
6782 algorithm
6783 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6784 "/* function maps initialUnknowns UnknownVars ValueReferences to an internal partial derivatives index */\n",
6785 "fmi2ValueReference mapInitialUnknownsdependentIndex(const fmi2ValueReference vr) {\n",
6786 " switch (vr) {\n"
6787 }, true));
6788 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(6));
6789 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
6790 80 txt := lm_248(txt, i_sortedUnknownCrefs, i_simCode);
6791 80 txt := Tpl.popIter(txt);
6792 80 txt := Tpl.softNewLine(txt);
6793 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6794 "default:\n",
6795 " return -1;\n"
6796 }, true));
6797 80 txt := Tpl.popBlock(txt);
6798 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6799 " }\n",
6800 "}"
6801 }, false));
6802 then txt;
6803
6804 case ( txt,
6805 _ )
6806 algorithm
6807 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6808 "/* no model structure / initial unknowns available */\n",
6809 "fmi2ValueReference mapInitialUnknownsdependentIndex(const fmi2ValueReference vr) {\n",
6810 " return -1;\n",
6811 "}"
6812 }, false));
6813 then txt;
6814 end match;
6815 end mapInitialUnknownsdependentCrefs;
6816
6817 protected function lm_250
6818 input output Tpl.Text txt;
6819 input list<tuple<Integer, DAE.ComponentRef>> items;
6820 input SimCode.SimCode a_simCode;
6821 algorithm
6822
2/2
✓ Branch 0 taken 429 times.
✓ Branch 1 taken 80 times.
509 for lstElt_250 in items loop
6823 txt := match lstElt_250
6824 local
6825 Integer i_index;
6826 DAE.ComponentRef i_cref;
6827 Integer ret_0;
6828
6829 case (i_index, i_cref)
6830 algorithm
6831 429 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
6832 429 ret_0 := SimCodeCodegenUtil.lookupVR(i_cref, a_simCode);
6833 429 txt := Tpl.writeStr(txt, intString(ret_0));
6834 429 txt := Tpl.writeTok(txt, Tpl.ST_STRING(": return "));
6835 429 txt := Tpl.writeStr(txt, intString(i_index));
6836 429 txt := Tpl.writeTok(txt, Tpl.ST_STRING("; break;"));
6837 429 txt := Tpl.nextIter(txt);
6838 then txt;
6839 end match;
6840 end for;
6841 end lm_250;
6842
6843 public function mapInitialUnknownsIndependentCrefs
6844 input Tpl.Text in_txt;
6845 input SimCode.SimCode in_a_simCode;
6846
6847 output Tpl.Text out_txt;
6848 algorithm
6849 out_txt :=
6850 match(in_txt, in_a_simCode)
6851 local
6852 Tpl.Text txt;
6853 SimCode.SimCode i_simCode;
6854 list<tuple<Integer, DAE.ComponentRef>> i_sortedknownCrefs;
6855
6856 case ( txt,
6857 (i_simCode as SimCode.SIMCODE(modelStructure = SOME(SimCode.FMIMODELSTRUCTURE(fmiInitialUnknowns = SimCode.FMIINITIALUNKNOWNS(sortedknownCrefs = i_sortedknownCrefs))))) )
6858 algorithm
6859 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6860 "/* function maps initialUnknowns knownVars ValueReferences to an internal partial derivatives index */\n",
6861 "fmi2ValueReference mapInitialUnknownsIndependentIndex(const fmi2ValueReference vr) {\n",
6862 " switch (vr) {\n"
6863 }, true));
6864 80 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(6));
6865 80 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
6866 80 txt := lm_250(txt, i_sortedknownCrefs, i_simCode);
6867 80 txt := Tpl.popIter(txt);
6868 80 txt := Tpl.softNewLine(txt);
6869 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6870 "default:\n",
6871 " return -1;\n"
6872 }, true));
6873 80 txt := Tpl.popBlock(txt);
6874 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6875 " }\n",
6876 "}"
6877 }, false));
6878 then txt;
6879
6880 case ( txt,
6881 _ )
6882 algorithm
6883 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6884 "/* no model structure / initial unknowns available */\n",
6885 "fmi2ValueReference mapInitialUnknownsIndependentIndex(const fmi2ValueReference vr) {\n",
6886 " return -1;\n",
6887 "}"
6888 }, false));
6889 then txt;
6890 end match;
6891 end mapInitialUnknownsIndependentCrefs;
6892
6893 protected function fun_252
6894 input Tpl.Text in_txt;
6895 input Boolean in_mArg;
6896
6897 output Tpl.Text out_txt;
6898 algorithm
6899 out_txt :=
6900 match(in_txt, in_mArg)
6901 local
6902 Tpl.Text txt;
6903
6904 case ( txt,
6905 false )
6906 then txt;
6907
6908 case ( txt,
6909 _ )
6910 algorithm
6911 11 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define FMU_EXPERIMENTAL 1"));
6912 then txt;
6913 end match;
6914 end fun_252;
6915
6916 public function settingsfile
6917 input Tpl.Text in_txt;
6918 input SimCode.SimCode in_a_simCode;
6919
6920 output Tpl.Text out_txt;
6921 algorithm
6922 out_txt :=
6923 match(in_txt, in_a_simCode)
6924 local
6925 Tpl.Text txt;
6926 SimCode.SimCode i_simCode;
6927 Integer i_varInfo_numStringAlgVars;
6928 Integer i_maxDelayedIndex;
6929 Integer i_varInfo_numMixedSystems;
6930 Integer i_varInfo_numNonLinearSystems;
6931 Integer i_varInfo_numLinearSystems;
6932 Boolean ret_0;
6933
6934 case ( txt,
6935 (i_simCode as SimCode.SIMCODE(modelInfo = SimCode.MODELINFO(varInfo = SimCode.VARINFO(numLinearSystems = i_varInfo_numLinearSystems, numNonLinearSystems = i_varInfo_numNonLinearSystems, numMixedSystems = i_varInfo_numMixedSystems, numStringAlgVars = i_varInfo_numStringAlgVars)), delayedExps = SimCode.DELAYED_EXPRESSIONS(maxDelayedIndex = i_maxDelayedIndex), fmiSimulationFlags = _)) )
6936 algorithm
6937 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6938 "#if !defined(OMC_SIM_SETTINGS_CMDLINE)\n",
6939 "#define OMC_SIM_SETTINGS_CMDLINE\n",
6940 "#define OMC_NUM_LINEAR_SYSTEMS "
6941 }, false));
6942 82 txt := Tpl.writeStr(txt, intString(i_varInfo_numLinearSystems));
6943 82 txt := Tpl.softNewLine(txt);
6944 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define OMC_NUM_NONLINEAR_SYSTEMS "));
6945 82 txt := Tpl.writeStr(txt, intString(i_varInfo_numNonLinearSystems));
6946 82 txt := Tpl.softNewLine(txt);
6947 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define OMC_NUM_MIXED_SYSTEMS "));
6948 82 txt := Tpl.writeStr(txt, intString(i_varInfo_numMixedSystems));
6949 82 txt := Tpl.softNewLine(txt);
6950 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define OMC_NDELAY_EXPRESSIONS "));
6951 82 txt := Tpl.writeStr(txt, intString(i_maxDelayedIndex));
6952 82 txt := Tpl.softNewLine(txt);
6953 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define OMC_NVAR_STRING "));
6954 82 txt := Tpl.writeStr(txt, intString(i_varInfo_numStringAlgVars));
6955 82 txt := Tpl.softNewLine(txt);
6956 82 ret_0 := Flags.isSet(Flags.FMU_EXPERIMENTAL);
6957 82 txt := fun_252(txt, ret_0);
6958 82 txt := Tpl.softNewLine(txt);
6959 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#define OMC_MODEL_PREFIX \""));
6960 82 txt := CodegenUtilSimulation.modelNamePrefix(txt, i_simCode);
6961 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
6962 "\"\n",
6963 "#define OMC_MINIMAL_RUNTIME 1\n",
6964 "#define OMC_FMI_RUNTIME 1\n",
6965 "#endif"
6966 }, false));
6967 then txt;
6968
6969 case ( txt,
6970 _ )
6971 then txt;
6972 end match;
6973 end settingsfile;
6974
6975 protected function fun_254
6976 input Tpl.Text in_txt;
6977 input String in_a_makefileParams_platform;
6978
6979 output Tpl.Text out_txt;
6980 algorithm
6981 out_txt :=
6982 match(in_txt, in_a_makefileParams_platform)
6983 local
6984 Tpl.Text txt;
6985
6986 case ( txt,
6987 "win32" )
6988 algorithm
6989 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\"mkdir.exe\""));
6990 then txt;
6991
6992 case ( txt,
6993 "win64" )
6994 algorithm
6995 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\"mkdir.exe\""));
6996 then txt;
6997
6998 case ( txt,
6999 _ )
7000 algorithm
7001 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("mkdir"));
7002 then txt;
7003 end match;
7004 end fun_254;
7005
7006 protected function fun_255
7007 input Tpl.Text in_txt;
7008 input String in_mArg;
7009 input Tpl.Text in_a_omhome;
7010 input Tpl.Text in_a_prefix;
7011 input String in_a_fileNamePrefixHash;
7012
7013 output Tpl.Text out_txt;
7014 algorithm
7015 out_txt :=
7016 match(in_txt, in_mArg, in_a_omhome, in_a_prefix, in_a_fileNamePrefixHash)
7017 local
7018 Tpl.Text txt;
7019 Tpl.Text a_omhome;
7020 Tpl.Text a_prefix;
7021 String a_fileNamePrefixHash;
7022
7023 case ( txt,
7024 "msvc",
7025 a_omhome,
7026 a_prefix,
7027 a_fileNamePrefixHash )
7028 algorithm
7029 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\t"));
7030 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("cmake -E rm -f "));
7031 ✗ txt := Tpl.writeStr(txt, a_fileNamePrefixHash);
7032 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(".fmutmp/sources/"));
7033 ✗ txt := Tpl.writeText(txt, a_prefix);
7034 ✗ txt := Tpl.writeTok(txt, Tpl.ST_LINE("_init.xml\n"));
7035 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\t"));
7036 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("cmake -E copy_directory \""));
7037 ✗ txt := Tpl.writeText(txt, a_omhome);
7038 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/share/omc/runtime/c/fmi/buildproject\" "));
7039 ✗ txt := Tpl.writeStr(txt, a_fileNamePrefixHash);
7040 ✗ txt := Tpl.writeTok(txt, Tpl.ST_LINE(".fmutmp/sources\n"));
7041 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\t"));
7042 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("cmake -E copy "));
7043 ✗ txt := Tpl.writeText(txt, a_prefix);
7044 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("_FMU.libs "));
7045 ✗ txt := Tpl.writeStr(txt, a_fileNamePrefixHash);
7046 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(".fmutmp/sources/"));
7047 then txt;
7048
7049 case ( txt,
7050 _,
7051 a_omhome,
7052 a_prefix,
7053 a_fileNamePrefixHash )
7054 algorithm
7055 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\t"));
7056 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("rm -f "));
7057 82 txt := Tpl.writeStr(txt, a_fileNamePrefixHash);
7058 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".fmutmp/sources/"));
7059 82 txt := Tpl.writeText(txt, a_prefix);
7060 82 txt := Tpl.writeTok(txt, Tpl.ST_LINE("_init.xml\n"));
7061 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\t"));
7062 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("cp -a \""));
7063 82 txt := Tpl.writeText(txt, a_omhome);
7064 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("/share/omc/runtime/c/fmi/buildproject/\"* "));
7065 82 txt := Tpl.writeStr(txt, a_fileNamePrefixHash);
7066 82 txt := Tpl.writeTok(txt, Tpl.ST_LINE(".fmutmp/sources\n"));
7067 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\t"));
7068 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("cp -a "));
7069 82 txt := Tpl.writeText(txt, a_prefix);
7070 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_FMU.libs "));
7071 82 txt := Tpl.writeStr(txt, a_fileNamePrefixHash);
7072 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".fmutmp/sources/"));
7073 then txt;
7074 end match;
7075 end fun_255;
7076
7077 protected function fun_256
7078 input Tpl.Text in_txt;
7079 input SimCode.SimCode in_a_simCode;
7080 input String in_a_fileNamePrefixHash;
7081
7082 output Tpl.Text out_txt;
7083 algorithm
7084 out_txt :=
7085 match(in_txt, in_a_simCode, in_a_fileNamePrefixHash)
7086 local
7087 Tpl.Text txt;
7088 String a_fileNamePrefixHash;
7089 String i_fileNamePrefix;
7090 String i_makefileParams_omhome;
7091 String i_makefileParams_platform;
7092 String str_6;
7093 Tpl.Text txt_5;
7094 String ret_4;
7095 Tpl.Text l_prefix;
7096 Tpl.Text l_omhome;
7097 Tpl.Text l_mkdir;
7098 Tpl.Text l_includedir;
7099
7100 case ( txt,
7101 SimCode.SIMCODE(modelInfo = SimCode.MODELINFO(name = _), makefileParams = SimCodeFunction.MAKEFILE_PARAMS(platform = i_makefileParams_platform, omhome = i_makefileParams_omhome), simulationSettingsOpt = _, fileNamePrefix = i_fileNamePrefix),
7102 a_fileNamePrefixHash )
7103 algorithm
7104 82 l_includedir := Tpl.writeStr(Tpl.emptyTxt, a_fileNamePrefixHash);
7105 82 l_includedir := Tpl.writeTok(l_includedir, Tpl.ST_STRING(".fmutmp/sources/"));
7106 82 l_mkdir := fun_254(Tpl.emptyTxt, i_makefileParams_platform);
7107 82 l_omhome := Tpl.writeStr(Tpl.emptyTxt, i_makefileParams_omhome);
7108 82 l_prefix := Tpl.writeStr(Tpl.emptyTxt, i_fileNamePrefix);
7109 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
7110 "# FIXME: before you push into master...\n",
7111 "RUNTIMEDIR="
7112 }, false));
7113 82 txt := Tpl.writeStr(txt, i_makefileParams_omhome);
7114 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
7115 "/include/omc/c/\n",
7116 "#COPY_RUNTIMEFILES=$(FMI_ME_OBJS:%= && (OMCFILE=% && cp $(RUNTIMEDIR)/$$OMCFILE.c $$OMCFILE.c))\n",
7117 "\n",
7118 "fmu:\n"
7119 }, true));
7120 82 ret_4 := Config.simulationCodeTarget();
7121 82 txt_5 := CodegenUtil.getGeneralTarget(Tpl.emptyTxt, ret_4);
7122 82 str_6 := Tpl.textString(txt_5);
7123 82 txt := fun_255(txt, str_6, l_omhome, l_prefix, a_fileNamePrefixHash);
7124 82 txt := Tpl.softNewLine(txt);
7125 82 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
7126 then txt;
7127
7128 case ( txt,
7129 _,
7130 _ )
7131 then txt;
7132 end match;
7133 end fun_256;
7134
7135 public function fmuSourceMakefile
7136 input Tpl.Text txt;
7137 input SimCode.SimCode a_simCode;
7138 input String a_FMUVersion;
7139 input String a_fileNamePrefixHash;
7140
7141 output Tpl.Text out_txt;
7142 algorithm
7143 82 out_txt := fun_256(txt, a_simCode, a_fileNamePrefixHash);
7144 end fmuSourceMakefile;
7145
7146 protected function fun_258
7147 input Tpl.Text in_txt;
7148 input Boolean in_mArg;
7149
7150 output Tpl.Text out_txt;
7151 algorithm
7152 out_txt :=
7153 match(in_txt, in_mArg)
7154 local
7155 Tpl.Text txt;
7156
7157 case ( txt,
7158 false )
7159 algorithm
7160 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("1.0"));
7161 then txt;
7162
7163 case ( txt,
7164 _ )
7165 algorithm
7166 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("3.0"));
7167 then txt;
7168 end match;
7169 end fun_258;
7170
7171 protected function fun_259
7172 input Tpl.Text in_txt;
7173 input Boolean in_mArg;
7174 input String in_a_fmiInfo_fmiDescription;
7175
7176 output Tpl.Text out_txt;
7177 algorithm
7178 out_txt :=
7179 match(in_txt, in_mArg, in_a_fmiInfo_fmiDescription)
7180 local
7181 Tpl.Text txt;
7182 String a_fmiInfo_fmiDescription;
7183
7184 case ( txt,
7185 false,
7186 a_fmiInfo_fmiDescription )
7187 algorithm
7188 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" \""));
7189 ✗ txt := Tpl.writeStr(txt, a_fmiInfo_fmiDescription);
7190 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
7191 then txt;
7192
7193 case ( txt,
7194 _,
7195 _ )
7196 then txt;
7197 end match;
7198 end fun_259;
7199
7200 public function importFMUModelDescription
7201 input Tpl.Text in_txt;
7202 input FMI.FmiImport in_a_fmi;
7203
7204 output Tpl.Text out_txt;
7205 algorithm
7206 out_txt :=
7207 match(in_txt, in_a_fmi)
7208 local
7209 Tpl.Text txt;
7210 Boolean i_generateOutputConnectors;
7211 Boolean i_generateInputConnectors;
7212 list<FMI.ModelVariables> i_fmiModelVariablesList;
7213 list<FMI.TypeDefinitions> i_fmiTypeDefinitionsList;
7214 String i_fmiInfo_fmiDescription;
7215 String i_fmiInfo_fmiModelIdentifier;
7216 String i_fmiInfo_fmiVersion;
7217 Boolean ret_2;
7218 Boolean ret_1;
7219 Tpl.Text l_mdVersion;
7220
7221 case ( txt,
7222 FMI.FMIIMPORT(fmiInfo = FMI.INFO(fmiVersion = i_fmiInfo_fmiVersion, fmiModelIdentifier = i_fmiInfo_fmiModelIdentifier, fmiDescription = i_fmiInfo_fmiDescription), fmiExperimentAnnotation = FMI.EXPERIMENTANNOTATION(fmiExperimentStartTime = _), fmiTypeDefinitionsList = i_fmiTypeDefinitionsList, fmiModelVariablesList = i_fmiModelVariablesList, generateInputConnectors = i_generateInputConnectors, generateOutputConnectors = i_generateOutputConnectors) )
7223 algorithm
7224 ✗ ret_1 := FMI.isFMIVersion30(i_fmiInfo_fmiVersion);
7225 ✗ l_mdVersion := fun_258(Tpl.emptyTxt, ret_1);
7226 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("model "));
7227 ✗ txt := Tpl.writeStr(txt, i_fmiInfo_fmiModelIdentifier);
7228 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("_Input_Output_FMU"));
7229 ✗ ret_2 := stringEq(i_fmiInfo_fmiDescription, "");
7230 ✗ txt := fun_259(txt, ret_2, i_fmiInfo_fmiDescription);
7231 ✗ txt := Tpl.softNewLine(txt);
7232 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
7233 ✗ txt := dumpFMITypeDefinitions(txt, i_fmiTypeDefinitionsList);
7234 ✗ txt := Tpl.softNewLine(txt);
7235 ✗ txt := dumpFMUModelDescriptionVariablesList(txt, Tpl.textString(l_mdVersion), i_fmiModelVariablesList, i_fmiTypeDefinitionsList, i_generateInputConnectors, i_generateOutputConnectors);
7236 ✗ txt := Tpl.softNewLine(txt);
7237 ✗ txt := Tpl.popBlock(txt);
7238 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
7239 ✗ txt := Tpl.writeStr(txt, i_fmiInfo_fmiModelIdentifier);
7240 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("_Input_Output_FMU;"));
7241 then txt;
7242
7243 case ( txt,
7244 _ )
7245 then txt;
7246 end match;
7247 end importFMUModelDescription;
7248
7249 protected function lm_261
7250 input output Tpl.Text txt;
7251 input list<FMI.ModelVariables> items;
7252 input Boolean a_generateOutputConnectors;
7253 input Boolean a_generateInputConnectors;
7254 input list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
7255 input String a_FMUVersion;
7256 algorithm
7257 ✗ for lstElt_261 in items loop
7258 txt := match lstElt_261
7259 local
7260 FMI.ModelVariables i_fmiModelVariable;
7261
7262 case i_fmiModelVariable
7263 algorithm
7264 ✗ txt := dumpFMUModelDescriptionVariable(txt, a_FMUVersion, i_fmiModelVariable, a_fmiTypeDefinitionsList, a_generateInputConnectors, a_generateOutputConnectors);
7265 ✗ txt := Tpl.nextIter(txt);
7266 then txt;
7267 end match;
7268 end for;
7269 end lm_261;
7270
7271 public function dumpFMUModelDescriptionVariablesList
7272 input Tpl.Text txt;
7273 input String a_FMUVersion;
7274 input list<FMI.ModelVariables> a_fmiModelVariablesList;
7275 input list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
7276 input Boolean a_generateInputConnectors;
7277 input Boolean a_generateOutputConnectors;
7278
7279 output Tpl.Text out_txt;
7280 algorithm
7281 ✗ out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
7282 ✗ out_txt := lm_261(out_txt, a_fmiModelVariablesList, a_generateOutputConnectors, a_generateInputConnectors, a_fmiTypeDefinitionsList, a_FMUVersion);
7283 ✗ out_txt := Tpl.popIter(out_txt);
7284 end dumpFMUModelDescriptionVariablesList;
7285
7286 protected function fun_263
7287 input Tpl.Text in_txt;
7288 input Boolean in_mArg;
7289
7290 output Tpl.Text out_txt;
7291 algorithm
7292 out_txt :=
7293 match(in_txt, in_mArg)
7294 local
7295 Tpl.Text txt;
7296
7297 case ( txt,
7298 false )
7299 then txt;
7300
7301 case ( txt,
7302 _ )
7303 algorithm
7304 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("true"));
7305 then txt;
7306 end match;
7307 end fun_263;
7308
7309 protected function fun_264
7310 input Tpl.Text in_txt;
7311 input Boolean in_mArg;
7312 input Integer in_a_y2Placement;
7313 input Integer in_a_y1Placement;
7314 input Integer in_a_x2Placement;
7315 input Integer in_a_x1Placement;
7316 input String in_a_description;
7317 input Boolean in_a_generateOutputConnectors;
7318 input Boolean in_a_generateInputConnectors;
7319 input String in_a_baseType;
7320 input String in_a_causality;
7321 input String in_a_name;
7322
7323 output Tpl.Text out_txt;
7324 algorithm
7325 out_txt :=
7326 match(in_txt, in_mArg, in_a_y2Placement, in_a_y1Placement, in_a_x2Placement, in_a_x1Placement, in_a_description, in_a_generateOutputConnectors, in_a_generateInputConnectors, in_a_baseType, in_a_causality, in_a_name)
7327 local
7328 Tpl.Text txt;
7329 Integer a_y2Placement;
7330 Integer a_y1Placement;
7331 Integer a_x2Placement;
7332 Integer a_x1Placement;
7333 String a_description;
7334 Boolean a_generateOutputConnectors;
7335 Boolean a_generateInputConnectors;
7336 String a_baseType;
7337 String a_causality;
7338 String a_name;
7339
7340 case ( txt,
7341 true,
7342 _,
7343 _,
7344 _,
7345 _,
7346 _,
7347 _,
7348 _,
7349 _,
7350 _,
7351 _ )
7352 then txt;
7353
7354 case ( txt,
7355 _,
7356 a_y2Placement,
7357 a_y1Placement,
7358 a_x2Placement,
7359 a_x1Placement,
7360 a_description,
7361 a_generateOutputConnectors,
7362 a_generateInputConnectors,
7363 a_baseType,
7364 a_causality,
7365 a_name )
7366 algorithm
7367 ✗ txt := dumpFMUModelDescriptionInputOutputVariable(txt, a_name, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
7368 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
7369 ✗ txt := dumpFMIModelVariableDescription(txt, a_description);
7370 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, a_x1Placement, a_x2Placement, a_y1Placement, a_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, a_causality);
7371 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
7372 then txt;
7373 end match;
7374 end fun_264;
7375
7376 protected function fun_265
7377 input Tpl.Text in_txt;
7378 input Boolean in_mArg;
7379
7380 output Tpl.Text out_txt;
7381 algorithm
7382 out_txt :=
7383 match(in_txt, in_mArg)
7384 local
7385 Tpl.Text txt;
7386
7387 case ( txt,
7388 false )
7389 then txt;
7390
7391 case ( txt,
7392 _ )
7393 algorithm
7394 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("true"));
7395 then txt;
7396 end match;
7397 end fun_265;
7398
7399 protected function fun_266
7400 input Tpl.Text in_txt;
7401 input Boolean in_mArg;
7402 input Integer in_a_y2Placement;
7403 input Integer in_a_y1Placement;
7404 input Integer in_a_x2Placement;
7405 input Integer in_a_x1Placement;
7406 input String in_a_description;
7407 input Boolean in_a_generateOutputConnectors;
7408 input Boolean in_a_generateInputConnectors;
7409 input String in_a_baseType;
7410 input String in_a_causality;
7411 input String in_a_name;
7412
7413 output Tpl.Text out_txt;
7414 algorithm
7415 out_txt :=
7416 match(in_txt, in_mArg, in_a_y2Placement, in_a_y1Placement, in_a_x2Placement, in_a_x1Placement, in_a_description, in_a_generateOutputConnectors, in_a_generateInputConnectors, in_a_baseType, in_a_causality, in_a_name)
7417 local
7418 Tpl.Text txt;
7419 Integer a_y2Placement;
7420 Integer a_y1Placement;
7421 Integer a_x2Placement;
7422 Integer a_x1Placement;
7423 String a_description;
7424 Boolean a_generateOutputConnectors;
7425 Boolean a_generateInputConnectors;
7426 String a_baseType;
7427 String a_causality;
7428 String a_name;
7429
7430 case ( txt,
7431 true,
7432 _,
7433 _,
7434 _,
7435 _,
7436 _,
7437 _,
7438 _,
7439 _,
7440 _,
7441 _ )
7442 then txt;
7443
7444 case ( txt,
7445 _,
7446 a_y2Placement,
7447 a_y1Placement,
7448 a_x2Placement,
7449 a_x1Placement,
7450 a_description,
7451 a_generateOutputConnectors,
7452 a_generateInputConnectors,
7453 a_baseType,
7454 a_causality,
7455 a_name )
7456 algorithm
7457 ✗ txt := dumpFMUModelDescriptionInputOutputVariable(txt, a_name, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
7458 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
7459 ✗ txt := dumpFMIModelVariableDescription(txt, a_description);
7460 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, a_x1Placement, a_x2Placement, a_y1Placement, a_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, a_causality);
7461 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
7462 then txt;
7463 end match;
7464 end fun_266;
7465
7466 protected function fun_267
7467 input Tpl.Text in_txt;
7468 input Boolean in_mArg;
7469
7470 output Tpl.Text out_txt;
7471 algorithm
7472 out_txt :=
7473 match(in_txt, in_mArg)
7474 local
7475 Tpl.Text txt;
7476
7477 case ( txt,
7478 false )
7479 then txt;
7480
7481 case ( txt,
7482 _ )
7483 algorithm
7484 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("true"));
7485 then txt;
7486 end match;
7487 end fun_267;
7488
7489 protected function fun_268
7490 input Tpl.Text in_txt;
7491 input Boolean in_mArg;
7492 input Integer in_a_y2Placement;
7493 input Integer in_a_y1Placement;
7494 input Integer in_a_x2Placement;
7495 input Integer in_a_x1Placement;
7496 input String in_a_description;
7497 input Boolean in_a_generateOutputConnectors;
7498 input Boolean in_a_generateInputConnectors;
7499 input String in_a_baseType;
7500 input String in_a_causality;
7501 input String in_a_name;
7502
7503 output Tpl.Text out_txt;
7504 algorithm
7505 out_txt :=
7506 match(in_txt, in_mArg, in_a_y2Placement, in_a_y1Placement, in_a_x2Placement, in_a_x1Placement, in_a_description, in_a_generateOutputConnectors, in_a_generateInputConnectors, in_a_baseType, in_a_causality, in_a_name)
7507 local
7508 Tpl.Text txt;
7509 Integer a_y2Placement;
7510 Integer a_y1Placement;
7511 Integer a_x2Placement;
7512 Integer a_x1Placement;
7513 String a_description;
7514 Boolean a_generateOutputConnectors;
7515 Boolean a_generateInputConnectors;
7516 String a_baseType;
7517 String a_causality;
7518 String a_name;
7519
7520 case ( txt,
7521 true,
7522 _,
7523 _,
7524 _,
7525 _,
7526 _,
7527 _,
7528 _,
7529 _,
7530 _,
7531 _ )
7532 then txt;
7533
7534 case ( txt,
7535 _,
7536 a_y2Placement,
7537 a_y1Placement,
7538 a_x2Placement,
7539 a_x1Placement,
7540 a_description,
7541 a_generateOutputConnectors,
7542 a_generateInputConnectors,
7543 a_baseType,
7544 a_causality,
7545 a_name )
7546 algorithm
7547 ✗ txt := dumpFMUModelDescriptionInputOutputVariable(txt, a_name, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
7548 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
7549 ✗ txt := dumpFMIModelVariableDescription(txt, a_description);
7550 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, a_x1Placement, a_x2Placement, a_y1Placement, a_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, a_causality);
7551 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
7552 then txt;
7553 end match;
7554 end fun_268;
7555
7556 protected function fun_269
7557 input Tpl.Text in_txt;
7558 input Boolean in_mArg;
7559
7560 output Tpl.Text out_txt;
7561 algorithm
7562 out_txt :=
7563 match(in_txt, in_mArg)
7564 local
7565 Tpl.Text txt;
7566
7567 case ( txt,
7568 false )
7569 then txt;
7570
7571 case ( txt,
7572 _ )
7573 algorithm
7574 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("true"));
7575 then txt;
7576 end match;
7577 end fun_269;
7578
7579 protected function fun_270
7580 input Tpl.Text in_txt;
7581 input Boolean in_mArg;
7582 input Integer in_a_y2Placement;
7583 input Integer in_a_y1Placement;
7584 input Integer in_a_x2Placement;
7585 input Integer in_a_x1Placement;
7586 input String in_a_description;
7587 input Boolean in_a_generateOutputConnectors;
7588 input Boolean in_a_generateInputConnectors;
7589 input String in_a_baseType;
7590 input String in_a_causality;
7591 input String in_a_name;
7592
7593 output Tpl.Text out_txt;
7594 algorithm
7595 out_txt :=
7596 match(in_txt, in_mArg, in_a_y2Placement, in_a_y1Placement, in_a_x2Placement, in_a_x1Placement, in_a_description, in_a_generateOutputConnectors, in_a_generateInputConnectors, in_a_baseType, in_a_causality, in_a_name)
7597 local
7598 Tpl.Text txt;
7599 Integer a_y2Placement;
7600 Integer a_y1Placement;
7601 Integer a_x2Placement;
7602 Integer a_x1Placement;
7603 String a_description;
7604 Boolean a_generateOutputConnectors;
7605 Boolean a_generateInputConnectors;
7606 String a_baseType;
7607 String a_causality;
7608 String a_name;
7609
7610 case ( txt,
7611 true,
7612 _,
7613 _,
7614 _,
7615 _,
7616 _,
7617 _,
7618 _,
7619 _,
7620 _,
7621 _ )
7622 then txt;
7623
7624 case ( txt,
7625 _,
7626 a_y2Placement,
7627 a_y1Placement,
7628 a_x2Placement,
7629 a_x1Placement,
7630 a_description,
7631 a_generateOutputConnectors,
7632 a_generateInputConnectors,
7633 a_baseType,
7634 a_causality,
7635 a_name )
7636 algorithm
7637 ✗ txt := dumpFMUModelDescriptionInputOutputVariable(txt, a_name, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
7638 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
7639 ✗ txt := dumpFMIModelVariableDescription(txt, a_description);
7640 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, a_x1Placement, a_x2Placement, a_y1Placement, a_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, a_causality);
7641 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
7642 then txt;
7643 end match;
7644 end fun_270;
7645
7646 protected function fun_271
7647 input Tpl.Text in_txt;
7648 input Boolean in_mArg;
7649
7650 output Tpl.Text out_txt;
7651 algorithm
7652 out_txt :=
7653 match(in_txt, in_mArg)
7654 local
7655 Tpl.Text txt;
7656
7657 case ( txt,
7658 false )
7659 then txt;
7660
7661 case ( txt,
7662 _ )
7663 algorithm
7664 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("true"));
7665 then txt;
7666 end match;
7667 end fun_271;
7668
7669 protected function fun_272
7670 input Tpl.Text in_txt;
7671 input Boolean in_mArg;
7672 input Integer in_a_y2Placement;
7673 input Integer in_a_y1Placement;
7674 input Integer in_a_x2Placement;
7675 input Integer in_a_x1Placement;
7676 input String in_a_description;
7677 input Boolean in_a_generateOutputConnectors;
7678 input Boolean in_a_generateInputConnectors;
7679 input String in_a_baseType;
7680 input String in_a_causality;
7681 input String in_a_name;
7682
7683 output Tpl.Text out_txt;
7684 algorithm
7685 out_txt :=
7686 match(in_txt, in_mArg, in_a_y2Placement, in_a_y1Placement, in_a_x2Placement, in_a_x1Placement, in_a_description, in_a_generateOutputConnectors, in_a_generateInputConnectors, in_a_baseType, in_a_causality, in_a_name)
7687 local
7688 Tpl.Text txt;
7689 Integer a_y2Placement;
7690 Integer a_y1Placement;
7691 Integer a_x2Placement;
7692 Integer a_x1Placement;
7693 String a_description;
7694 Boolean a_generateOutputConnectors;
7695 Boolean a_generateInputConnectors;
7696 String a_baseType;
7697 String a_causality;
7698 String a_name;
7699
7700 case ( txt,
7701 true,
7702 _,
7703 _,
7704 _,
7705 _,
7706 _,
7707 _,
7708 _,
7709 _,
7710 _,
7711 _ )
7712 then txt;
7713
7714 case ( txt,
7715 _,
7716 a_y2Placement,
7717 a_y1Placement,
7718 a_x2Placement,
7719 a_x1Placement,
7720 a_description,
7721 a_generateOutputConnectors,
7722 a_generateInputConnectors,
7723 a_baseType,
7724 a_causality,
7725 a_name )
7726 algorithm
7727 ✗ txt := dumpFMUModelDescriptionInputOutputVariable(txt, a_name, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
7728 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
7729 ✗ txt := dumpFMIModelVariableDescription(txt, a_description);
7730 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, a_x1Placement, a_x2Placement, a_y1Placement, a_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, a_causality);
7731 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
7732 then txt;
7733 end match;
7734 end fun_272;
7735
7736 protected function fun_273
7737 input Tpl.Text in_txt;
7738 input FMI.ModelVariables in_a_fmiModelVariable;
7739 input Boolean in_a_generateOutputConnectors;
7740 input Boolean in_a_generateInputConnectors;
7741
7742 output Tpl.Text out_txt;
7743 algorithm
7744 out_txt :=
7745 match(in_txt, in_a_fmiModelVariable, in_a_generateOutputConnectors, in_a_generateInputConnectors)
7746 local
7747 Tpl.Text txt;
7748 Boolean a_generateOutputConnectors;
7749 Boolean a_generateInputConnectors;
7750 Integer i_y2Placement;
7751 Integer i_y1Placement;
7752 Integer i_x2Placement;
7753 Integer i_x1Placement;
7754 String i_description;
7755 String i_baseType;
7756 String i_name;
7757 String i_causality;
7758 Boolean ret_20;
7759 Boolean ret_19;
7760 Boolean ret_18;
7761 Boolean ret_17;
7762 Boolean ret_16;
7763 Boolean ret_15;
7764 Boolean ret_14;
7765 Boolean ret_13;
7766 Boolean ret_12;
7767 Boolean ret_11;
7768 Boolean ret_10;
7769 Boolean ret_9;
7770 Boolean ret_8;
7771 Boolean ret_7;
7772 Boolean ret_6;
7773 Boolean ret_5;
7774 Boolean ret_4;
7775 Boolean ret_3;
7776 Boolean ret_2;
7777 Boolean ret_1;
7778 Tpl.Text l_isInputOrOutput;
7779
7780 case ( txt,
7781 FMI.REALVARIABLE(causality = i_causality, name = i_name, baseType = i_baseType, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
7782 a_generateOutputConnectors,
7783 a_generateInputConnectors )
7784 algorithm
7785 ✗ ret_1 := stringEq(i_causality, "input");
7786 ✗ ret_2 := stringEq(i_causality, "output");
7787 ✗ ret_3 := boolOr(ret_1, ret_2);
7788 ✗ l_isInputOrOutput := fun_263(Tpl.emptyTxt, ret_3);
7789 ✗ ret_4 := Tpl.isEmpty(l_isInputOrOutput);
7790 ✗ txt := fun_264(txt, ret_4, i_y2Placement, i_y1Placement, i_x2Placement, i_x1Placement, i_description, a_generateOutputConnectors, a_generateInputConnectors, i_baseType, i_causality, i_name);
7791 then txt;
7792
7793 case ( txt,
7794 FMI.INTEGERVARIABLE(causality = i_causality, name = i_name, baseType = i_baseType, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
7795 a_generateOutputConnectors,
7796 a_generateInputConnectors )
7797 algorithm
7798 ✗ ret_5 := stringEq(i_causality, "input");
7799 ✗ ret_6 := stringEq(i_causality, "output");
7800 ✗ ret_7 := boolOr(ret_5, ret_6);
7801 ✗ l_isInputOrOutput := fun_265(Tpl.emptyTxt, ret_7);
7802 ✗ ret_8 := Tpl.isEmpty(l_isInputOrOutput);
7803 ✗ txt := fun_266(txt, ret_8, i_y2Placement, i_y1Placement, i_x2Placement, i_x1Placement, i_description, a_generateOutputConnectors, a_generateInputConnectors, i_baseType, i_causality, i_name);
7804 then txt;
7805
7806 case ( txt,
7807 FMI.BOOLEANVARIABLE(causality = i_causality, name = i_name, baseType = i_baseType, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
7808 a_generateOutputConnectors,
7809 a_generateInputConnectors )
7810 algorithm
7811 ✗ ret_9 := stringEq(i_causality, "input");
7812 ✗ ret_10 := stringEq(i_causality, "output");
7813 ✗ ret_11 := boolOr(ret_9, ret_10);
7814 ✗ l_isInputOrOutput := fun_267(Tpl.emptyTxt, ret_11);
7815 ✗ ret_12 := Tpl.isEmpty(l_isInputOrOutput);
7816 ✗ txt := fun_268(txt, ret_12, i_y2Placement, i_y1Placement, i_x2Placement, i_x1Placement, i_description, a_generateOutputConnectors, a_generateInputConnectors, i_baseType, i_causality, i_name);
7817 then txt;
7818
7819 case ( txt,
7820 FMI.STRINGVARIABLE(causality = i_causality, name = i_name, baseType = i_baseType, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
7821 a_generateOutputConnectors,
7822 a_generateInputConnectors )
7823 algorithm
7824 ✗ ret_13 := stringEq(i_causality, "input");
7825 ✗ ret_14 := stringEq(i_causality, "output");
7826 ✗ ret_15 := boolOr(ret_13, ret_14);
7827 ✗ l_isInputOrOutput := fun_269(Tpl.emptyTxt, ret_15);
7828 ✗ ret_16 := Tpl.isEmpty(l_isInputOrOutput);
7829 ✗ txt := fun_270(txt, ret_16, i_y2Placement, i_y1Placement, i_x2Placement, i_x1Placement, i_description, a_generateOutputConnectors, a_generateInputConnectors, i_baseType, i_causality, i_name);
7830 then txt;
7831
7832 case ( txt,
7833 FMI.ENUMERATIONVARIABLE(causality = i_causality, name = i_name, baseType = i_baseType, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
7834 a_generateOutputConnectors,
7835 a_generateInputConnectors )
7836 algorithm
7837 ✗ ret_17 := stringEq(i_causality, "input");
7838 ✗ ret_18 := stringEq(i_causality, "output");
7839 ✗ ret_19 := boolOr(ret_17, ret_18);
7840 ✗ l_isInputOrOutput := fun_271(Tpl.emptyTxt, ret_19);
7841 ✗ ret_20 := Tpl.isEmpty(l_isInputOrOutput);
7842 ✗ txt := fun_272(txt, ret_20, i_y2Placement, i_y1Placement, i_x2Placement, i_x1Placement, i_description, a_generateOutputConnectors, a_generateInputConnectors, i_baseType, i_causality, i_name);
7843 then txt;
7844
7845 case ( txt,
7846 _,
7847 _,
7848 _ )
7849 then txt;
7850 end match;
7851 end fun_273;
7852
7853 protected function fun_274
7854 input Tpl.Text in_txt;
7855 input Boolean in_mArg;
7856
7857 output Tpl.Text out_txt;
7858 algorithm
7859 out_txt :=
7860 match(in_txt, in_mArg)
7861 local
7862 Tpl.Text txt;
7863
7864 case ( txt,
7865 false )
7866 then txt;
7867
7868 case ( txt,
7869 _ )
7870 algorithm
7871 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("true"));
7872 then txt;
7873 end match;
7874 end fun_274;
7875
7876 protected function fun_275
7877 input Tpl.Text in_txt;
7878 input Boolean in_mArg;
7879 input Integer in_a_y2Placement;
7880 input Integer in_a_y1Placement;
7881 input Integer in_a_x2Placement;
7882 input Integer in_a_x1Placement;
7883 input String in_a_description;
7884 input Boolean in_a_generateOutputConnectors;
7885 input Boolean in_a_generateInputConnectors;
7886 input String in_a_baseType;
7887 input String in_a_causality;
7888 input String in_a_name;
7889
7890 output Tpl.Text out_txt;
7891 algorithm
7892 out_txt :=
7893 match(in_txt, in_mArg, in_a_y2Placement, in_a_y1Placement, in_a_x2Placement, in_a_x1Placement, in_a_description, in_a_generateOutputConnectors, in_a_generateInputConnectors, in_a_baseType, in_a_causality, in_a_name)
7894 local
7895 Tpl.Text txt;
7896 Integer a_y2Placement;
7897 Integer a_y1Placement;
7898 Integer a_x2Placement;
7899 Integer a_x1Placement;
7900 String a_description;
7901 Boolean a_generateOutputConnectors;
7902 Boolean a_generateInputConnectors;
7903 String a_baseType;
7904 String a_causality;
7905 String a_name;
7906
7907 case ( txt,
7908 true,
7909 _,
7910 _,
7911 _,
7912 _,
7913 _,
7914 _,
7915 _,
7916 _,
7917 _,
7918 _ )
7919 then txt;
7920
7921 case ( txt,
7922 _,
7923 a_y2Placement,
7924 a_y1Placement,
7925 a_x2Placement,
7926 a_x1Placement,
7927 a_description,
7928 a_generateOutputConnectors,
7929 a_generateInputConnectors,
7930 a_baseType,
7931 a_causality,
7932 a_name )
7933 algorithm
7934 ✗ txt := dumpFMUModelDescriptionInputOutputVariable(txt, a_name, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
7935 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
7936 ✗ txt := dumpFMIModelVariableDescription(txt, a_description);
7937 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, a_x1Placement, a_x2Placement, a_y1Placement, a_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, a_causality);
7938 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
7939 then txt;
7940 end match;
7941 end fun_275;
7942
7943 protected function fun_276
7944 input Tpl.Text in_txt;
7945 input Boolean in_mArg;
7946
7947 output Tpl.Text out_txt;
7948 algorithm
7949 out_txt :=
7950 match(in_txt, in_mArg)
7951 local
7952 Tpl.Text txt;
7953
7954 case ( txt,
7955 false )
7956 then txt;
7957
7958 case ( txt,
7959 _ )
7960 algorithm
7961 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("true"));
7962 then txt;
7963 end match;
7964 end fun_276;
7965
7966 protected function fun_277
7967 input Tpl.Text in_txt;
7968 input Boolean in_mArg;
7969 input Integer in_a_y2Placement;
7970 input Integer in_a_y1Placement;
7971 input Integer in_a_x2Placement;
7972 input Integer in_a_x1Placement;
7973 input String in_a_description;
7974 input Boolean in_a_generateOutputConnectors;
7975 input Boolean in_a_generateInputConnectors;
7976 input String in_a_baseType;
7977 input String in_a_causality;
7978 input String in_a_name;
7979
7980 output Tpl.Text out_txt;
7981 algorithm
7982 out_txt :=
7983 match(in_txt, in_mArg, in_a_y2Placement, in_a_y1Placement, in_a_x2Placement, in_a_x1Placement, in_a_description, in_a_generateOutputConnectors, in_a_generateInputConnectors, in_a_baseType, in_a_causality, in_a_name)
7984 local
7985 Tpl.Text txt;
7986 Integer a_y2Placement;
7987 Integer a_y1Placement;
7988 Integer a_x2Placement;
7989 Integer a_x1Placement;
7990 String a_description;
7991 Boolean a_generateOutputConnectors;
7992 Boolean a_generateInputConnectors;
7993 String a_baseType;
7994 String a_causality;
7995 String a_name;
7996
7997 case ( txt,
7998 true,
7999 _,
8000 _,
8001 _,
8002 _,
8003 _,
8004 _,
8005 _,
8006 _,
8007 _,
8008 _ )
8009 then txt;
8010
8011 case ( txt,
8012 _,
8013 a_y2Placement,
8014 a_y1Placement,
8015 a_x2Placement,
8016 a_x1Placement,
8017 a_description,
8018 a_generateOutputConnectors,
8019 a_generateInputConnectors,
8020 a_baseType,
8021 a_causality,
8022 a_name )
8023 algorithm
8024 ✗ txt := dumpFMUModelDescriptionInputOutputVariable(txt, a_name, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
8025 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
8026 ✗ txt := dumpFMIModelVariableDescription(txt, a_description);
8027 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, a_x1Placement, a_x2Placement, a_y1Placement, a_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, a_causality);
8028 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
8029 then txt;
8030 end match;
8031 end fun_277;
8032
8033 protected function fun_278
8034 input Tpl.Text in_txt;
8035 input Boolean in_mArg;
8036
8037 output Tpl.Text out_txt;
8038 algorithm
8039 out_txt :=
8040 match(in_txt, in_mArg)
8041 local
8042 Tpl.Text txt;
8043
8044 case ( txt,
8045 false )
8046 then txt;
8047
8048 case ( txt,
8049 _ )
8050 algorithm
8051 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("true"));
8052 then txt;
8053 end match;
8054 end fun_278;
8055
8056 protected function fun_279
8057 input Tpl.Text in_txt;
8058 input Boolean in_mArg;
8059 input Integer in_a_y2Placement;
8060 input Integer in_a_y1Placement;
8061 input Integer in_a_x2Placement;
8062 input Integer in_a_x1Placement;
8063 input String in_a_description;
8064 input Boolean in_a_generateOutputConnectors;
8065 input Boolean in_a_generateInputConnectors;
8066 input String in_a_baseType;
8067 input String in_a_causality;
8068 input String in_a_name;
8069
8070 output Tpl.Text out_txt;
8071 algorithm
8072 out_txt :=
8073 match(in_txt, in_mArg, in_a_y2Placement, in_a_y1Placement, in_a_x2Placement, in_a_x1Placement, in_a_description, in_a_generateOutputConnectors, in_a_generateInputConnectors, in_a_baseType, in_a_causality, in_a_name)
8074 local
8075 Tpl.Text txt;
8076 Integer a_y2Placement;
8077 Integer a_y1Placement;
8078 Integer a_x2Placement;
8079 Integer a_x1Placement;
8080 String a_description;
8081 Boolean a_generateOutputConnectors;
8082 Boolean a_generateInputConnectors;
8083 String a_baseType;
8084 String a_causality;
8085 String a_name;
8086
8087 case ( txt,
8088 true,
8089 _,
8090 _,
8091 _,
8092 _,
8093 _,
8094 _,
8095 _,
8096 _,
8097 _,
8098 _ )
8099 then txt;
8100
8101 case ( txt,
8102 _,
8103 a_y2Placement,
8104 a_y1Placement,
8105 a_x2Placement,
8106 a_x1Placement,
8107 a_description,
8108 a_generateOutputConnectors,
8109 a_generateInputConnectors,
8110 a_baseType,
8111 a_causality,
8112 a_name )
8113 algorithm
8114 ✗ txt := dumpFMUModelDescriptionInputOutputVariable(txt, a_name, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
8115 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
8116 ✗ txt := dumpFMIModelVariableDescription(txt, a_description);
8117 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, a_x1Placement, a_x2Placement, a_y1Placement, a_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, a_causality);
8118 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
8119 then txt;
8120 end match;
8121 end fun_279;
8122
8123 protected function fun_280
8124 input Tpl.Text in_txt;
8125 input Boolean in_mArg;
8126
8127 output Tpl.Text out_txt;
8128 algorithm
8129 out_txt :=
8130 match(in_txt, in_mArg)
8131 local
8132 Tpl.Text txt;
8133
8134 case ( txt,
8135 false )
8136 then txt;
8137
8138 case ( txt,
8139 _ )
8140 algorithm
8141 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("true"));
8142 then txt;
8143 end match;
8144 end fun_280;
8145
8146 protected function fun_281
8147 input Tpl.Text in_txt;
8148 input Boolean in_mArg;
8149 input Integer in_a_y2Placement;
8150 input Integer in_a_y1Placement;
8151 input Integer in_a_x2Placement;
8152 input Integer in_a_x1Placement;
8153 input String in_a_description;
8154 input Boolean in_a_generateOutputConnectors;
8155 input Boolean in_a_generateInputConnectors;
8156 input String in_a_baseType;
8157 input String in_a_causality;
8158 input String in_a_name;
8159
8160 output Tpl.Text out_txt;
8161 algorithm
8162 out_txt :=
8163 match(in_txt, in_mArg, in_a_y2Placement, in_a_y1Placement, in_a_x2Placement, in_a_x1Placement, in_a_description, in_a_generateOutputConnectors, in_a_generateInputConnectors, in_a_baseType, in_a_causality, in_a_name)
8164 local
8165 Tpl.Text txt;
8166 Integer a_y2Placement;
8167 Integer a_y1Placement;
8168 Integer a_x2Placement;
8169 Integer a_x1Placement;
8170 String a_description;
8171 Boolean a_generateOutputConnectors;
8172 Boolean a_generateInputConnectors;
8173 String a_baseType;
8174 String a_causality;
8175 String a_name;
8176
8177 case ( txt,
8178 true,
8179 _,
8180 _,
8181 _,
8182 _,
8183 _,
8184 _,
8185 _,
8186 _,
8187 _,
8188 _ )
8189 then txt;
8190
8191 case ( txt,
8192 _,
8193 a_y2Placement,
8194 a_y1Placement,
8195 a_x2Placement,
8196 a_x1Placement,
8197 a_description,
8198 a_generateOutputConnectors,
8199 a_generateInputConnectors,
8200 a_baseType,
8201 a_causality,
8202 a_name )
8203 algorithm
8204 ✗ txt := dumpFMUModelDescriptionInputOutputVariable(txt, a_name, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
8205 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
8206 ✗ txt := dumpFMIModelVariableDescription(txt, a_description);
8207 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, a_x1Placement, a_x2Placement, a_y1Placement, a_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, a_causality);
8208 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
8209 then txt;
8210 end match;
8211 end fun_281;
8212
8213 protected function fun_282
8214 input Tpl.Text in_txt;
8215 input Boolean in_mArg;
8216
8217 output Tpl.Text out_txt;
8218 algorithm
8219 out_txt :=
8220 match(in_txt, in_mArg)
8221 local
8222 Tpl.Text txt;
8223
8224 case ( txt,
8225 false )
8226 then txt;
8227
8228 case ( txt,
8229 _ )
8230 algorithm
8231 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("true"));
8232 then txt;
8233 end match;
8234 end fun_282;
8235
8236 protected function fun_283
8237 input Tpl.Text in_txt;
8238 input Boolean in_mArg;
8239 input Integer in_a_y2Placement;
8240 input Integer in_a_y1Placement;
8241 input Integer in_a_x2Placement;
8242 input Integer in_a_x1Placement;
8243 input String in_a_description;
8244 input Boolean in_a_generateOutputConnectors;
8245 input Boolean in_a_generateInputConnectors;
8246 input String in_a_baseType;
8247 input String in_a_causality;
8248 input String in_a_name;
8249
8250 output Tpl.Text out_txt;
8251 algorithm
8252 out_txt :=
8253 match(in_txt, in_mArg, in_a_y2Placement, in_a_y1Placement, in_a_x2Placement, in_a_x1Placement, in_a_description, in_a_generateOutputConnectors, in_a_generateInputConnectors, in_a_baseType, in_a_causality, in_a_name)
8254 local
8255 Tpl.Text txt;
8256 Integer a_y2Placement;
8257 Integer a_y1Placement;
8258 Integer a_x2Placement;
8259 Integer a_x1Placement;
8260 String a_description;
8261 Boolean a_generateOutputConnectors;
8262 Boolean a_generateInputConnectors;
8263 String a_baseType;
8264 String a_causality;
8265 String a_name;
8266
8267 case ( txt,
8268 true,
8269 _,
8270 _,
8271 _,
8272 _,
8273 _,
8274 _,
8275 _,
8276 _,
8277 _,
8278 _ )
8279 then txt;
8280
8281 case ( txt,
8282 _,
8283 a_y2Placement,
8284 a_y1Placement,
8285 a_x2Placement,
8286 a_x1Placement,
8287 a_description,
8288 a_generateOutputConnectors,
8289 a_generateInputConnectors,
8290 a_baseType,
8291 a_causality,
8292 a_name )
8293 algorithm
8294 ✗ txt := dumpFMUModelDescriptionInputOutputVariable(txt, a_name, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
8295 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
8296 ✗ txt := dumpFMIModelVariableDescription(txt, a_description);
8297 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, a_x1Placement, a_x2Placement, a_y1Placement, a_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, a_causality);
8298 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
8299 then txt;
8300 end match;
8301 end fun_283;
8302
8303 protected function fun_284
8304 input Tpl.Text in_txt;
8305 input FMI.ModelVariables in_a_fmiModelVariable;
8306 input Boolean in_a_generateOutputConnectors;
8307 input Boolean in_a_generateInputConnectors;
8308
8309 output Tpl.Text out_txt;
8310 algorithm
8311 out_txt :=
8312 match(in_txt, in_a_fmiModelVariable, in_a_generateOutputConnectors, in_a_generateInputConnectors)
8313 local
8314 Tpl.Text txt;
8315 Boolean a_generateOutputConnectors;
8316 Boolean a_generateInputConnectors;
8317 Integer i_y2Placement;
8318 Integer i_y1Placement;
8319 Integer i_x2Placement;
8320 Integer i_x1Placement;
8321 String i_description;
8322 String i_baseType;
8323 String i_name;
8324 list<Integer> i_dimensions;
8325 String i_causality;
8326 Boolean ret_30;
8327 Boolean ret_29;
8328 Boolean ret_28;
8329 Boolean ret_27;
8330 Boolean ret_26;
8331 Boolean ret_25;
8332 Boolean ret_24;
8333 Boolean ret_23;
8334 Boolean ret_22;
8335 Boolean ret_21;
8336 Boolean ret_20;
8337 Boolean ret_19;
8338 Boolean ret_18;
8339 Boolean ret_17;
8340 Boolean ret_16;
8341 Boolean ret_15;
8342 Boolean ret_14;
8343 Boolean ret_13;
8344 Boolean ret_12;
8345 Boolean ret_11;
8346 Boolean ret_10;
8347 Boolean ret_9;
8348 Boolean ret_8;
8349 Boolean ret_7;
8350 Boolean ret_6;
8351 Boolean ret_5;
8352 Boolean ret_4;
8353 Boolean ret_3;
8354 Boolean ret_2;
8355 Boolean ret_1;
8356 Tpl.Text l_emitConnector;
8357
8358 case ( txt,
8359 FMI.FMI3REALVARIABLE(causality = i_causality, dimensions = i_dimensions, name = i_name, baseType = i_baseType, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
8360 a_generateOutputConnectors,
8361 a_generateInputConnectors )
8362 algorithm
8363 ✗ ret_1 := stringEq(i_causality, "input");
8364 ✗ ret_2 := stringEq(i_causality, "output");
8365 ✗ ret_3 := boolOr(ret_1, ret_2);
8366 ✗ ret_4 := listEmpty(i_dimensions);
8367 ✗ ret_5 := boolAnd(ret_3, ret_4);
8368 ✗ l_emitConnector := fun_274(Tpl.emptyTxt, ret_5);
8369 ✗ ret_6 := Tpl.isEmpty(l_emitConnector);
8370 ✗ txt := fun_275(txt, ret_6, i_y2Placement, i_y1Placement, i_x2Placement, i_x1Placement, i_description, a_generateOutputConnectors, a_generateInputConnectors, i_baseType, i_causality, i_name);
8371 then txt;
8372
8373 case ( txt,
8374 FMI.FMI3INTEGERVARIABLE(causality = i_causality, dimensions = i_dimensions, name = i_name, baseType = i_baseType, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
8375 a_generateOutputConnectors,
8376 a_generateInputConnectors )
8377 algorithm
8378 ✗ ret_7 := stringEq(i_causality, "input");
8379 ✗ ret_8 := stringEq(i_causality, "output");
8380 ✗ ret_9 := boolOr(ret_7, ret_8);
8381 ✗ ret_10 := listEmpty(i_dimensions);
8382 ✗ ret_11 := boolAnd(ret_9, ret_10);
8383 ✗ l_emitConnector := fun_276(Tpl.emptyTxt, ret_11);
8384 ✗ ret_12 := Tpl.isEmpty(l_emitConnector);
8385 ✗ txt := fun_277(txt, ret_12, i_y2Placement, i_y1Placement, i_x2Placement, i_x1Placement, i_description, a_generateOutputConnectors, a_generateInputConnectors, i_baseType, i_causality, i_name);
8386 then txt;
8387
8388 case ( txt,
8389 FMI.FMI3BOOLEANVARIABLE(causality = i_causality, dimensions = i_dimensions, name = i_name, baseType = i_baseType, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
8390 a_generateOutputConnectors,
8391 a_generateInputConnectors )
8392 algorithm
8393 ✗ ret_13 := stringEq(i_causality, "input");
8394 ✗ ret_14 := stringEq(i_causality, "output");
8395 ✗ ret_15 := boolOr(ret_13, ret_14);
8396 ✗ ret_16 := listEmpty(i_dimensions);
8397 ✗ ret_17 := boolAnd(ret_15, ret_16);
8398 ✗ l_emitConnector := fun_278(Tpl.emptyTxt, ret_17);
8399 ✗ ret_18 := Tpl.isEmpty(l_emitConnector);
8400 ✗ txt := fun_279(txt, ret_18, i_y2Placement, i_y1Placement, i_x2Placement, i_x1Placement, i_description, a_generateOutputConnectors, a_generateInputConnectors, i_baseType, i_causality, i_name);
8401 then txt;
8402
8403 case ( txt,
8404 FMI.FMI3STRINGVARIABLE(causality = i_causality, dimensions = i_dimensions, name = i_name, baseType = i_baseType, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
8405 a_generateOutputConnectors,
8406 a_generateInputConnectors )
8407 algorithm
8408 ✗ ret_19 := stringEq(i_causality, "input");
8409 ✗ ret_20 := stringEq(i_causality, "output");
8410 ✗ ret_21 := boolOr(ret_19, ret_20);
8411 ✗ ret_22 := listEmpty(i_dimensions);
8412 ✗ ret_23 := boolAnd(ret_21, ret_22);
8413 ✗ l_emitConnector := fun_280(Tpl.emptyTxt, ret_23);
8414 ✗ ret_24 := Tpl.isEmpty(l_emitConnector);
8415 ✗ txt := fun_281(txt, ret_24, i_y2Placement, i_y1Placement, i_x2Placement, i_x1Placement, i_description, a_generateOutputConnectors, a_generateInputConnectors, i_baseType, i_causality, i_name);
8416 then txt;
8417
8418 case ( txt,
8419 FMI.FMI3ENUMERATIONVARIABLE(causality = i_causality, dimensions = i_dimensions, name = i_name, baseType = i_baseType, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
8420 a_generateOutputConnectors,
8421 a_generateInputConnectors )
8422 algorithm
8423 ✗ ret_25 := stringEq(i_causality, "input");
8424 ✗ ret_26 := stringEq(i_causality, "output");
8425 ✗ ret_27 := boolOr(ret_25, ret_26);
8426 ✗ ret_28 := listEmpty(i_dimensions);
8427 ✗ ret_29 := boolAnd(ret_27, ret_28);
8428 ✗ l_emitConnector := fun_282(Tpl.emptyTxt, ret_29);
8429 ✗ ret_30 := Tpl.isEmpty(l_emitConnector);
8430 ✗ txt := fun_283(txt, ret_30, i_y2Placement, i_y1Placement, i_x2Placement, i_x1Placement, i_description, a_generateOutputConnectors, a_generateInputConnectors, i_baseType, i_causality, i_name);
8431 then txt;
8432
8433 case ( txt,
8434 _,
8435 _,
8436 _ )
8437 then txt;
8438 end match;
8439 end fun_284;
8440
8441 protected function fun_285
8442 input Tpl.Text in_txt;
8443 input String in_a_FMUVersion;
8444 input FMI.ModelVariables in_a_fmiModelVariable;
8445 input Boolean in_a_generateInputConnectors;
8446 input Boolean in_a_generateOutputConnectors;
8447
8448 output Tpl.Text out_txt;
8449 algorithm
8450 out_txt :=
8451 match(in_txt, in_a_FMUVersion, in_a_fmiModelVariable, in_a_generateInputConnectors, in_a_generateOutputConnectors)
8452 local
8453 Tpl.Text txt;
8454 FMI.ModelVariables a_fmiModelVariable;
8455 Boolean a_generateInputConnectors;
8456 Boolean a_generateOutputConnectors;
8457
8458 case ( txt,
8459 "1.0",
8460 a_fmiModelVariable,
8461 a_generateInputConnectors,
8462 a_generateOutputConnectors )
8463 algorithm
8464 ✗ txt := fun_273(txt, a_fmiModelVariable, a_generateOutputConnectors, a_generateInputConnectors);
8465 then txt;
8466
8467 case ( txt,
8468 "3.0",
8469 a_fmiModelVariable,
8470 a_generateInputConnectors,
8471 a_generateOutputConnectors )
8472 algorithm
8473 ✗ txt := fun_284(txt, a_fmiModelVariable, a_generateOutputConnectors, a_generateInputConnectors);
8474 then txt;
8475
8476 case ( txt,
8477 _,
8478 _,
8479 _,
8480 _ )
8481 then txt;
8482 end match;
8483 end fun_285;
8484
8485 public function dumpFMUModelDescriptionVariable
8486 input Tpl.Text txt;
8487 input String a_FMUVersion;
8488 input FMI.ModelVariables a_fmiModelVariable;
8489 input list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
8490 input Boolean a_generateInputConnectors;
8491 input Boolean a_generateOutputConnectors;
8492
8493 output Tpl.Text out_txt;
8494 algorithm
8495 ✗ out_txt := fun_285(txt, a_FMUVersion, a_fmiModelVariable, a_generateInputConnectors, a_generateOutputConnectors);
8496 end dumpFMUModelDescriptionVariable;
8497
8498 protected function fun_287
8499 input Tpl.Text in_txt;
8500 input Boolean in_mArg;
8501 input String in_a_name;
8502
8503 output Tpl.Text out_txt;
8504 algorithm
8505 out_txt :=
8506 match(in_txt, in_mArg, in_a_name)
8507 local
8508 Tpl.Text txt;
8509 String a_name;
8510
8511 case ( txt,
8512 false,
8513 _ )
8514 then txt;
8515
8516 case ( txt,
8517 _,
8518 a_name )
8519 algorithm
8520 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.BooleanOutput "));
8521 ✗ txt := Tpl.writeStr(txt, a_name);
8522 then txt;
8523 end match;
8524 end fun_287;
8525
8526 protected function fun_288
8527 input Tpl.Text in_txt;
8528 input Boolean in_mArg;
8529 input String in_a_name;
8530 input String in_a_baseType;
8531 input String in_a_causality;
8532 input Boolean in_a_generateOutputConnectors;
8533
8534 output Tpl.Text out_txt;
8535 algorithm
8536 out_txt :=
8537 match(in_txt, in_mArg, in_a_name, in_a_baseType, in_a_causality, in_a_generateOutputConnectors)
8538 local
8539 Tpl.Text txt;
8540 String a_name;
8541 String a_baseType;
8542 String a_causality;
8543 Boolean a_generateOutputConnectors;
8544 Boolean ret_3;
8545 Boolean ret_2;
8546 Boolean ret_1;
8547 Boolean ret_0;
8548
8549 case ( txt,
8550 false,
8551 a_name,
8552 a_baseType,
8553 a_causality,
8554 a_generateOutputConnectors )
8555 algorithm
8556 ✗ ret_0 := stringEq(a_causality, "output");
8557 ✗ ret_1 := stringEq(a_baseType, "Boolean");
8558 ✗ ret_2 := boolAnd(ret_0, ret_1);
8559 ✗ ret_3 := boolAnd(a_generateOutputConnectors, ret_2);
8560 ✗ txt := fun_287(txt, ret_3, a_name);
8561 then txt;
8562
8563 case ( txt,
8564 _,
8565 a_name,
8566 _,
8567 _,
8568 _ )
8569 algorithm
8570 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.IntegerOutput "));
8571 ✗ txt := Tpl.writeStr(txt, a_name);
8572 then txt;
8573 end match;
8574 end fun_288;
8575
8576 protected function fun_289
8577 input Tpl.Text in_txt;
8578 input Boolean in_mArg;
8579 input String in_a_name;
8580 input String in_a_baseType;
8581 input String in_a_causality;
8582 input Boolean in_a_generateOutputConnectors;
8583
8584 output Tpl.Text out_txt;
8585 algorithm
8586 out_txt :=
8587 match(in_txt, in_mArg, in_a_name, in_a_baseType, in_a_causality, in_a_generateOutputConnectors)
8588 local
8589 Tpl.Text txt;
8590 String a_name;
8591 String a_baseType;
8592 String a_causality;
8593 Boolean a_generateOutputConnectors;
8594 Boolean ret_3;
8595 Boolean ret_2;
8596 Boolean ret_1;
8597 Boolean ret_0;
8598
8599 case ( txt,
8600 false,
8601 a_name,
8602 a_baseType,
8603 a_causality,
8604 a_generateOutputConnectors )
8605 algorithm
8606 ✗ ret_0 := stringEq(a_causality, "output");
8607 ✗ ret_1 := stringEq(a_baseType, "Integer");
8608 ✗ ret_2 := boolAnd(ret_0, ret_1);
8609 ✗ ret_3 := boolAnd(a_generateOutputConnectors, ret_2);
8610 ✗ txt := fun_288(txt, ret_3, a_name, a_baseType, a_causality, a_generateOutputConnectors);
8611 then txt;
8612
8613 case ( txt,
8614 _,
8615 a_name,
8616 _,
8617 _,
8618 _ )
8619 algorithm
8620 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.RealOutput "));
8621 ✗ txt := Tpl.writeStr(txt, a_name);
8622 then txt;
8623 end match;
8624 end fun_289;
8625
8626 protected function fun_290
8627 input Tpl.Text in_txt;
8628 input Boolean in_mArg;
8629 input String in_a_name;
8630 input String in_a_baseType;
8631 input String in_a_causality;
8632 input Boolean in_a_generateOutputConnectors;
8633
8634 output Tpl.Text out_txt;
8635 algorithm
8636 out_txt :=
8637 match(in_txt, in_mArg, in_a_name, in_a_baseType, in_a_causality, in_a_generateOutputConnectors)
8638 local
8639 Tpl.Text txt;
8640 String a_name;
8641 String a_baseType;
8642 String a_causality;
8643 Boolean a_generateOutputConnectors;
8644 Boolean ret_3;
8645 Boolean ret_2;
8646 Boolean ret_1;
8647 Boolean ret_0;
8648
8649 case ( txt,
8650 false,
8651 a_name,
8652 a_baseType,
8653 a_causality,
8654 a_generateOutputConnectors )
8655 algorithm
8656 ✗ ret_0 := stringEq(a_causality, "output");
8657 ✗ ret_1 := stringEq(a_baseType, "Real");
8658 ✗ ret_2 := boolAnd(ret_0, ret_1);
8659 ✗ ret_3 := boolAnd(a_generateOutputConnectors, ret_2);
8660 ✗ txt := fun_289(txt, ret_3, a_name, a_baseType, a_causality, a_generateOutputConnectors);
8661 then txt;
8662
8663 case ( txt,
8664 _,
8665 a_name,
8666 _,
8667 _,
8668 _ )
8669 algorithm
8670 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.BooleanInput "));
8671 ✗ txt := Tpl.writeStr(txt, a_name);
8672 then txt;
8673 end match;
8674 end fun_290;
8675
8676 protected function fun_291
8677 input Tpl.Text in_txt;
8678 input Boolean in_mArg;
8679 input String in_a_name;
8680 input Boolean in_a_generateOutputConnectors;
8681 input String in_a_baseType;
8682 input String in_a_causality;
8683 input Boolean in_a_generateInputConnectors;
8684
8685 output Tpl.Text out_txt;
8686 algorithm
8687 out_txt :=
8688 match(in_txt, in_mArg, in_a_name, in_a_generateOutputConnectors, in_a_baseType, in_a_causality, in_a_generateInputConnectors)
8689 local
8690 Tpl.Text txt;
8691 String a_name;
8692 Boolean a_generateOutputConnectors;
8693 String a_baseType;
8694 String a_causality;
8695 Boolean a_generateInputConnectors;
8696 Boolean ret_3;
8697 Boolean ret_2;
8698 Boolean ret_1;
8699 Boolean ret_0;
8700
8701 case ( txt,
8702 false,
8703 a_name,
8704 a_generateOutputConnectors,
8705 a_baseType,
8706 a_causality,
8707 a_generateInputConnectors )
8708 algorithm
8709 ✗ ret_0 := stringEq(a_causality, "input");
8710 ✗ ret_1 := stringEq(a_baseType, "Boolean");
8711 ✗ ret_2 := boolAnd(ret_0, ret_1);
8712 ✗ ret_3 := boolAnd(a_generateInputConnectors, ret_2);
8713 ✗ txt := fun_290(txt, ret_3, a_name, a_baseType, a_causality, a_generateOutputConnectors);
8714 then txt;
8715
8716 case ( txt,
8717 _,
8718 a_name,
8719 _,
8720 _,
8721 _,
8722 _ )
8723 algorithm
8724 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.IntegerInput "));
8725 ✗ txt := Tpl.writeStr(txt, a_name);
8726 then txt;
8727 end match;
8728 end fun_291;
8729
8730 protected function fun_292
8731 input Tpl.Text in_txt;
8732 input Boolean in_mArg;
8733 input String in_a_name;
8734 input String in_a_causality;
8735 input String in_a_baseType;
8736 input Boolean in_a_generateInputConnectors;
8737 input Boolean in_a_generateOutputConnectors;
8738
8739 output Tpl.Text out_txt;
8740 algorithm
8741 out_txt :=
8742 match(in_txt, in_mArg, in_a_name, in_a_causality, in_a_baseType, in_a_generateInputConnectors, in_a_generateOutputConnectors)
8743 local
8744 Tpl.Text txt;
8745 String a_name;
8746 String a_causality;
8747 String a_baseType;
8748 Boolean a_generateInputConnectors;
8749 Boolean a_generateOutputConnectors;
8750 Boolean ret_3;
8751 Boolean ret_2;
8752 Boolean ret_1;
8753 Boolean ret_0;
8754
8755 case ( txt,
8756 false,
8757 a_name,
8758 a_causality,
8759 a_baseType,
8760 a_generateInputConnectors,
8761 a_generateOutputConnectors )
8762 algorithm
8763 ✗ ret_0 := stringEq(a_causality, "input");
8764 ✗ ret_1 := stringEq(a_baseType, "Integer");
8765 ✗ ret_2 := boolAnd(ret_0, ret_1);
8766 ✗ ret_3 := boolAnd(a_generateInputConnectors, ret_2);
8767 ✗ txt := fun_291(txt, ret_3, a_name, a_generateOutputConnectors, a_baseType, a_causality, a_generateInputConnectors);
8768 then txt;
8769
8770 case ( txt,
8771 _,
8772 a_name,
8773 _,
8774 _,
8775 _,
8776 _ )
8777 algorithm
8778 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.RealInput "));
8779 ✗ txt := Tpl.writeStr(txt, a_name);
8780 then txt;
8781 end match;
8782 end fun_292;
8783
8784 public function dumpFMUModelDescriptionInputOutputVariable
8785 input Tpl.Text txt;
8786 input String a_name;
8787 input String a_causality;
8788 input String a_baseType;
8789 input Boolean a_generateInputConnectors;
8790 input Boolean a_generateOutputConnectors;
8791
8792 output Tpl.Text out_txt;
8793 protected
8794 Boolean ret_3;
8795 Boolean ret_2;
8796 Boolean ret_1;
8797 Boolean ret_0;
8798 algorithm
8799 ✗ ret_0 := stringEq(a_causality, "input");
8800 ✗ ret_1 := stringEq(a_baseType, "Real");
8801 ✗ ret_2 := boolAnd(ret_0, ret_1);
8802 ✗ ret_3 := boolAnd(a_generateInputConnectors, ret_2);
8803 ✗ out_txt := fun_292(txt, ret_3, a_name, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
8804 end dumpFMUModelDescriptionInputOutputVariable;
8805
8806 protected function fun_294
8807 input Tpl.Text in_txt;
8808 input FMI.Info in_a_fmiInfo;
8809 input String in_a_name;
8810 input FMI.FmiImport in_a_fmi;
8811
8812 output Tpl.Text out_txt;
8813 algorithm
8814 out_txt :=
8815 match(in_txt, in_a_fmiInfo, in_a_name, in_a_fmi)
8816 local
8817 Tpl.Text txt;
8818 String a_name;
8819 FMI.FmiImport a_fmi;
8820
8821 case ( txt,
8822 FMI.INFO(fmiVersion = "1.0", fmiType = 0),
8823 a_name,
8824 a_fmi )
8825 algorithm
8826 2 txt := importFMU1ModelExchange(txt, a_fmi, a_name);
8827 then txt;
8828
8829 case ( txt,
8830 FMI.INFO(fmiVersion = "1.0", fmiType = 1),
8831 a_name,
8832 a_fmi )
8833 algorithm
8834 1 txt := importFMU1CoSimulationStandAlone(txt, a_fmi, a_name);
8835 then txt;
8836
8837 case ( txt,
8838 FMI.INFO(fmiVersion = "2.0", fmiType = 1),
8839 a_name,
8840 a_fmi )
8841 algorithm
8842 14 txt := importFMU2ModelExchange(txt, a_fmi, a_name);
8843 then txt;
8844
8845 case ( txt,
8846 FMI.INFO(fmiVersion = "3.0", fmiType = 2),
8847 a_name,
8848 a_fmi )
8849 algorithm
8850 1 txt := importFMU3ModelExchange(txt, a_fmi, a_name);
8851 then txt;
8852
8853 case ( txt,
8854 _,
8855 _,
8856 _ )
8857 then txt;
8858 end match;
8859 end fun_294;
8860
8861 public function importFMUModelica
8862 input Tpl.Text in_txt;
8863 input FMI.FmiImport in_a_fmi;
8864 input String in_a_name;
8865
8866 output Tpl.Text out_txt;
8867 algorithm
8868 out_txt :=
8869 match(in_txt, in_a_fmi, in_a_name)
8870 local
8871 Tpl.Text txt;
8872 String a_name;
8873 FMI.FmiImport i_fmi;
8874 FMI.Info i_fmiInfo;
8875
8876 case ( txt,
8877 (i_fmi as FMI.FMIIMPORT(fmiInfo = i_fmiInfo)),
8878 a_name )
8879 algorithm
8880 18 txt := fun_294(txt, i_fmiInfo, a_name, i_fmi);
8881 then txt;
8882
8883 case ( txt,
8884 _,
8885 _ )
8886 then txt;
8887 end match;
8888 end importFMUModelica;
8889
8890 protected function fun_296
8891 input Tpl.Text in_txt;
8892 input Boolean in_mArg;
8893 input FMI.Info in_a_fmiInfo;
8894 input String in_a_fmiInfo_fmiModelIdentifier;
8895 input String in_a_name;
8896
8897 output Tpl.Text out_txt;
8898 algorithm
8899 out_txt :=
8900 match(in_txt, in_mArg, in_a_fmiInfo, in_a_fmiInfo_fmiModelIdentifier, in_a_name)
8901 local
8902 Tpl.Text txt;
8903 FMI.Info a_fmiInfo;
8904 String a_fmiInfo_fmiModelIdentifier;
8905 String a_name;
8906 String ret_0;
8907
8908 case ( txt,
8909 false,
8910 _,
8911 _,
8912 a_name )
8913 algorithm
8914 ✗ txt := Tpl.writeStr(txt, a_name);
8915 then txt;
8916
8917 case ( txt,
8918 _,
8919 a_fmiInfo,
8920 a_fmiInfo_fmiModelIdentifier,
8921 _ )
8922 algorithm
8923 2 txt := Tpl.writeStr(txt, a_fmiInfo_fmiModelIdentifier);
8924 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
8925 2 ret_0 := FMI.getFMIType(a_fmiInfo);
8926 2 txt := Tpl.writeStr(txt, ret_0);
8927 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_FMU"));
8928 then txt;
8929 end match;
8930 end fun_296;
8931
8932 protected function fun_297
8933 input Tpl.Text in_txt;
8934 input Boolean in_mArg;
8935 input String in_a_fmiInfo_fmiDescription;
8936
8937 output Tpl.Text out_txt;
8938 algorithm
8939 out_txt :=
8940 match(in_txt, in_mArg, in_a_fmiInfo_fmiDescription)
8941 local
8942 Tpl.Text txt;
8943 String a_fmiInfo_fmiDescription;
8944
8945 case ( txt,
8946 false,
8947 a_fmiInfo_fmiDescription )
8948 algorithm
8949 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" \""));
8950 ✗ txt := Tpl.writeStr(txt, a_fmiInfo_fmiDescription);
8951 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
8952 then txt;
8953
8954 case ( txt,
8955 _,
8956 _ )
8957 then txt;
8958 end match;
8959 end fun_297;
8960
8961 protected function fun_298
8962 input Tpl.Text in_txt;
8963 input Boolean in_mArg;
8964 input Tpl.Text in_a_realInputVariablesReturnNames;
8965
8966 output Tpl.Text out_txt;
8967 algorithm
8968 out_txt :=
8969 match(in_txt, in_mArg, in_a_realInputVariablesReturnNames)
8970 local
8971 Tpl.Text txt;
8972 Tpl.Text a_realInputVariablesReturnNames;
8973
8974 case ( txt,
8975 false,
8976 a_realInputVariablesReturnNames )
8977 algorithm
8978 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Real "));
8979 1 txt := Tpl.writeText(txt, a_realInputVariablesReturnNames);
8980 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
8981 then txt;
8982
8983 case ( txt,
8984 _,
8985 _ )
8986 then txt;
8987 end match;
8988 end fun_298;
8989
8990 protected function fun_299
8991 input Tpl.Text in_txt;
8992 input Boolean in_mArg;
8993 input Tpl.Text in_a_integerInputVariablesReturnNames;
8994
8995 output Tpl.Text out_txt;
8996 algorithm
8997 out_txt :=
8998 match(in_txt, in_mArg, in_a_integerInputVariablesReturnNames)
8999 local
9000 Tpl.Text txt;
9001 Tpl.Text a_integerInputVariablesReturnNames;
9002
9003 case ( txt,
9004 false,
9005 a_integerInputVariablesReturnNames )
9006 algorithm
9007 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Integer "));
9008 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesReturnNames);
9009 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
9010 then txt;
9011
9012 case ( txt,
9013 _,
9014 _ )
9015 then txt;
9016 end match;
9017 end fun_299;
9018
9019 protected function fun_300
9020 input Tpl.Text in_txt;
9021 input Boolean in_mArg;
9022 input Tpl.Text in_a_booleanInputVariablesReturnNames;
9023
9024 output Tpl.Text out_txt;
9025 algorithm
9026 out_txt :=
9027 match(in_txt, in_mArg, in_a_booleanInputVariablesReturnNames)
9028 local
9029 Tpl.Text txt;
9030 Tpl.Text a_booleanInputVariablesReturnNames;
9031
9032 case ( txt,
9033 false,
9034 a_booleanInputVariablesReturnNames )
9035 algorithm
9036 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Boolean "));
9037 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesReturnNames);
9038 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
9039 then txt;
9040
9041 case ( txt,
9042 _,
9043 _ )
9044 then txt;
9045 end match;
9046 end fun_300;
9047
9048 protected function fun_301
9049 input Tpl.Text in_txt;
9050 input Boolean in_mArg;
9051 input Tpl.Text in_a_stringInputVariablesReturnNames;
9052
9053 output Tpl.Text out_txt;
9054 algorithm
9055 out_txt :=
9056 match(in_txt, in_mArg, in_a_stringInputVariablesReturnNames)
9057 local
9058 Tpl.Text txt;
9059 Tpl.Text a_stringInputVariablesReturnNames;
9060
9061 case ( txt,
9062 false,
9063 a_stringInputVariablesReturnNames )
9064 algorithm
9065 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("String "));
9066 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesReturnNames);
9067 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
9068 then txt;
9069
9070 case ( txt,
9071 _,
9072 _ )
9073 then txt;
9074 end match;
9075 end fun_301;
9076
9077 protected function fun_302
9078 input Tpl.Text in_txt;
9079 input Boolean in_mArg;
9080
9081 output Tpl.Text out_txt;
9082 algorithm
9083 out_txt :=
9084 match(in_txt, in_mArg)
9085 local
9086 Tpl.Text txt;
9087
9088 case ( txt,
9089 false )
9090 then txt;
9091
9092 case ( txt,
9093 _ )
9094 algorithm
9095 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("fmi_x = fmi1Functions.fmi1GetContinuousStates(fmi1me, numberOfContinuousStates, flowParamsStart+flowInitialized);"));
9096 then txt;
9097 end match;
9098 end fun_302;
9099
9100 protected function fun_303
9101 input Tpl.Text in_txt;
9102 input Boolean in_mArg;
9103 input Tpl.Text in_a_realParametersNames;
9104 input Tpl.Text in_a_realParametersVRs;
9105
9106 output Tpl.Text out_txt;
9107 algorithm
9108 out_txt :=
9109 match(in_txt, in_mArg, in_a_realParametersNames, in_a_realParametersVRs)
9110 local
9111 Tpl.Text txt;
9112 Tpl.Text a_realParametersNames;
9113 Tpl.Text a_realParametersVRs;
9114
9115 case ( txt,
9116 false,
9117 a_realParametersNames,
9118 a_realParametersVRs )
9119 algorithm
9120 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi1Functions.fmi1SetRealParameter(fmi1me, {"));
9121 1 txt := Tpl.writeText(txt, a_realParametersVRs);
9122 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
9123 1 txt := Tpl.writeText(txt, a_realParametersNames);
9124 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
9125 then txt;
9126
9127 case ( txt,
9128 _,
9129 _,
9130 _ )
9131 then txt;
9132 end match;
9133 end fun_303;
9134
9135 protected function fun_304
9136 input Tpl.Text in_txt;
9137 input Boolean in_mArg;
9138 input Tpl.Text in_a_integerParametersNames;
9139 input Tpl.Text in_a_integerParametersVRs;
9140
9141 output Tpl.Text out_txt;
9142 algorithm
9143 out_txt :=
9144 match(in_txt, in_mArg, in_a_integerParametersNames, in_a_integerParametersVRs)
9145 local
9146 Tpl.Text txt;
9147 Tpl.Text a_integerParametersNames;
9148 Tpl.Text a_integerParametersVRs;
9149
9150 case ( txt,
9151 false,
9152 a_integerParametersNames,
9153 a_integerParametersVRs )
9154 algorithm
9155 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi1Functions.fmi1SetIntegerParameter(fmi1me, {"));
9156 ✗ txt := Tpl.writeText(txt, a_integerParametersVRs);
9157 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
9158 ✗ txt := Tpl.writeText(txt, a_integerParametersNames);
9159 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
9160 then txt;
9161
9162 case ( txt,
9163 _,
9164 _,
9165 _ )
9166 then txt;
9167 end match;
9168 end fun_304;
9169
9170 protected function fun_305
9171 input Tpl.Text in_txt;
9172 input Boolean in_mArg;
9173 input Tpl.Text in_a_booleanParametersNames;
9174 input Tpl.Text in_a_booleanParametersVRs;
9175
9176 output Tpl.Text out_txt;
9177 algorithm
9178 out_txt :=
9179 match(in_txt, in_mArg, in_a_booleanParametersNames, in_a_booleanParametersVRs)
9180 local
9181 Tpl.Text txt;
9182 Tpl.Text a_booleanParametersNames;
9183 Tpl.Text a_booleanParametersVRs;
9184
9185 case ( txt,
9186 false,
9187 a_booleanParametersNames,
9188 a_booleanParametersVRs )
9189 algorithm
9190 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi1Functions.fmi1SetBooleanParameter(fmi1me, {"));
9191 1 txt := Tpl.writeText(txt, a_booleanParametersVRs);
9192 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
9193 1 txt := Tpl.writeText(txt, a_booleanParametersNames);
9194 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
9195 then txt;
9196
9197 case ( txt,
9198 _,
9199 _,
9200 _ )
9201 then txt;
9202 end match;
9203 end fun_305;
9204
9205 protected function fun_306
9206 input Tpl.Text in_txt;
9207 input Boolean in_mArg;
9208 input Tpl.Text in_a_stringParametersNames;
9209 input Tpl.Text in_a_stringParametersVRs;
9210
9211 output Tpl.Text out_txt;
9212 algorithm
9213 out_txt :=
9214 match(in_txt, in_mArg, in_a_stringParametersNames, in_a_stringParametersVRs)
9215 local
9216 Tpl.Text txt;
9217 Tpl.Text a_stringParametersNames;
9218 Tpl.Text a_stringParametersVRs;
9219
9220 case ( txt,
9221 false,
9222 a_stringParametersNames,
9223 a_stringParametersVRs )
9224 algorithm
9225 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi1Functions.fmi1SetStringParameter(fmi1me, {"));
9226 ✗ txt := Tpl.writeText(txt, a_stringParametersVRs);
9227 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
9228 ✗ txt := Tpl.writeText(txt, a_stringParametersNames);
9229 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
9230 then txt;
9231
9232 case ( txt,
9233 _,
9234 _,
9235 _ )
9236 then txt;
9237 end match;
9238 end fun_306;
9239
9240 protected function fun_307
9241 input Tpl.Text in_txt;
9242 input Boolean in_mArg;
9243 input Tpl.Text in_a_realDependentParametersVRs;
9244 input Tpl.Text in_a_realDependentParametersNames;
9245
9246 output Tpl.Text out_txt;
9247 algorithm
9248 out_txt :=
9249 match(in_txt, in_mArg, in_a_realDependentParametersVRs, in_a_realDependentParametersNames)
9250 local
9251 Tpl.Text txt;
9252 Tpl.Text a_realDependentParametersVRs;
9253 Tpl.Text a_realDependentParametersNames;
9254
9255 case ( txt,
9256 false,
9257 a_realDependentParametersVRs,
9258 a_realDependentParametersNames )
9259 algorithm
9260 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9261 ✗ txt := Tpl.writeText(txt, a_realDependentParametersNames);
9262 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetReal(fmi1me, {"));
9263 ✗ txt := Tpl.writeText(txt, a_realDependentParametersVRs);
9264 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
9265 then txt;
9266
9267 case ( txt,
9268 _,
9269 _,
9270 _ )
9271 then txt;
9272 end match;
9273 end fun_307;
9274
9275 protected function fun_308
9276 input Tpl.Text in_txt;
9277 input Boolean in_mArg;
9278 input Tpl.Text in_a_integerDependentParametersVRs;
9279 input Tpl.Text in_a_integerDependentParametersNames;
9280
9281 output Tpl.Text out_txt;
9282 algorithm
9283 out_txt :=
9284 match(in_txt, in_mArg, in_a_integerDependentParametersVRs, in_a_integerDependentParametersNames)
9285 local
9286 Tpl.Text txt;
9287 Tpl.Text a_integerDependentParametersVRs;
9288 Tpl.Text a_integerDependentParametersNames;
9289
9290 case ( txt,
9291 false,
9292 a_integerDependentParametersVRs,
9293 a_integerDependentParametersNames )
9294 algorithm
9295 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9296 ✗ txt := Tpl.writeText(txt, a_integerDependentParametersNames);
9297 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetInteger(fmi1me, {"));
9298 ✗ txt := Tpl.writeText(txt, a_integerDependentParametersVRs);
9299 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
9300 then txt;
9301
9302 case ( txt,
9303 _,
9304 _,
9305 _ )
9306 then txt;
9307 end match;
9308 end fun_308;
9309
9310 protected function fun_309
9311 input Tpl.Text in_txt;
9312 input Boolean in_mArg;
9313 input Tpl.Text in_a_booleanDependentParametersVRs;
9314 input Tpl.Text in_a_booleanDependentParametersNames;
9315
9316 output Tpl.Text out_txt;
9317 algorithm
9318 out_txt :=
9319 match(in_txt, in_mArg, in_a_booleanDependentParametersVRs, in_a_booleanDependentParametersNames)
9320 local
9321 Tpl.Text txt;
9322 Tpl.Text a_booleanDependentParametersVRs;
9323 Tpl.Text a_booleanDependentParametersNames;
9324
9325 case ( txt,
9326 false,
9327 a_booleanDependentParametersVRs,
9328 a_booleanDependentParametersNames )
9329 algorithm
9330 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9331 1 txt := Tpl.writeText(txt, a_booleanDependentParametersNames);
9332 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetBoolean(fmi1me, {"));
9333 1 txt := Tpl.writeText(txt, a_booleanDependentParametersVRs);
9334 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
9335 then txt;
9336
9337 case ( txt,
9338 _,
9339 _,
9340 _ )
9341 then txt;
9342 end match;
9343 end fun_309;
9344
9345 protected function fun_310
9346 input Tpl.Text in_txt;
9347 input Boolean in_mArg;
9348 input Tpl.Text in_a_stringDependentParametersVRs;
9349 input Tpl.Text in_a_stringDependentParametersNames;
9350
9351 output Tpl.Text out_txt;
9352 algorithm
9353 out_txt :=
9354 match(in_txt, in_mArg, in_a_stringDependentParametersVRs, in_a_stringDependentParametersNames)
9355 local
9356 Tpl.Text txt;
9357 Tpl.Text a_stringDependentParametersVRs;
9358 Tpl.Text a_stringDependentParametersNames;
9359
9360 case ( txt,
9361 false,
9362 a_stringDependentParametersVRs,
9363 a_stringDependentParametersNames )
9364 algorithm
9365 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9366 ✗ txt := Tpl.writeText(txt, a_stringDependentParametersNames);
9367 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetString(fmi1me, {"));
9368 ✗ txt := Tpl.writeText(txt, a_stringDependentParametersVRs);
9369 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
9370 then txt;
9371
9372 case ( txt,
9373 _,
9374 _,
9375 _ )
9376 then txt;
9377 end match;
9378 end fun_310;
9379
9380 protected function fun_311
9381 input Tpl.Text in_txt;
9382 input Boolean in_mArg;
9383 input Tpl.Text in_a_realInputVariablesNames;
9384 input Tpl.Text in_a_realInputVariablesVRs;
9385 input Tpl.Text in_a_realInputVariablesReturnNames;
9386
9387 output Tpl.Text out_txt;
9388 algorithm
9389 out_txt :=
9390 match(in_txt, in_mArg, in_a_realInputVariablesNames, in_a_realInputVariablesVRs, in_a_realInputVariablesReturnNames)
9391 local
9392 Tpl.Text txt;
9393 Tpl.Text a_realInputVariablesNames;
9394 Tpl.Text a_realInputVariablesVRs;
9395 Tpl.Text a_realInputVariablesReturnNames;
9396
9397 case ( txt,
9398 false,
9399 a_realInputVariablesNames,
9400 a_realInputVariablesVRs,
9401 a_realInputVariablesReturnNames )
9402 algorithm
9403 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9404 1 txt := Tpl.writeText(txt, a_realInputVariablesReturnNames);
9405 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1SetReal(fmi1me, {"));
9406 1 txt := Tpl.writeText(txt, a_realInputVariablesVRs);
9407 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
9408 1 txt := Tpl.writeText(txt, a_realInputVariablesNames);
9409 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
9410 then txt;
9411
9412 case ( txt,
9413 _,
9414 _,
9415 _,
9416 _ )
9417 then txt;
9418 end match;
9419 end fun_311;
9420
9421 protected function fun_312
9422 input Tpl.Text in_txt;
9423 input Boolean in_mArg;
9424 input Tpl.Text in_a_integerInputVariablesNames;
9425 input Tpl.Text in_a_integerInputVariablesVRs;
9426 input Tpl.Text in_a_integerInputVariablesReturnNames;
9427
9428 output Tpl.Text out_txt;
9429 algorithm
9430 out_txt :=
9431 match(in_txt, in_mArg, in_a_integerInputVariablesNames, in_a_integerInputVariablesVRs, in_a_integerInputVariablesReturnNames)
9432 local
9433 Tpl.Text txt;
9434 Tpl.Text a_integerInputVariablesNames;
9435 Tpl.Text a_integerInputVariablesVRs;
9436 Tpl.Text a_integerInputVariablesReturnNames;
9437
9438 case ( txt,
9439 false,
9440 a_integerInputVariablesNames,
9441 a_integerInputVariablesVRs,
9442 a_integerInputVariablesReturnNames )
9443 algorithm
9444 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9445 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesReturnNames);
9446 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1SetInteger(fmi1me, {"));
9447 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesVRs);
9448 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
9449 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesNames);
9450 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
9451 then txt;
9452
9453 case ( txt,
9454 _,
9455 _,
9456 _,
9457 _ )
9458 then txt;
9459 end match;
9460 end fun_312;
9461
9462 protected function fun_313
9463 input Tpl.Text in_txt;
9464 input Boolean in_mArg;
9465 input Tpl.Text in_a_booleanInputVariablesNames;
9466 input Tpl.Text in_a_booleanInputVariablesVRs;
9467 input Tpl.Text in_a_booleanInputVariablesReturnNames;
9468
9469 output Tpl.Text out_txt;
9470 algorithm
9471 out_txt :=
9472 match(in_txt, in_mArg, in_a_booleanInputVariablesNames, in_a_booleanInputVariablesVRs, in_a_booleanInputVariablesReturnNames)
9473 local
9474 Tpl.Text txt;
9475 Tpl.Text a_booleanInputVariablesNames;
9476 Tpl.Text a_booleanInputVariablesVRs;
9477 Tpl.Text a_booleanInputVariablesReturnNames;
9478
9479 case ( txt,
9480 false,
9481 a_booleanInputVariablesNames,
9482 a_booleanInputVariablesVRs,
9483 a_booleanInputVariablesReturnNames )
9484 algorithm
9485 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9486 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesReturnNames);
9487 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1SetBoolean(fmi1me, {"));
9488 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesVRs);
9489 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
9490 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesNames);
9491 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
9492 then txt;
9493
9494 case ( txt,
9495 _,
9496 _,
9497 _,
9498 _ )
9499 then txt;
9500 end match;
9501 end fun_313;
9502
9503 protected function fun_314
9504 input Tpl.Text in_txt;
9505 input Boolean in_mArg;
9506 input Tpl.Text in_a_stringStartVariablesNames;
9507 input Tpl.Text in_a_stringInputVariablesVRs;
9508 input Tpl.Text in_a_stringInputVariablesReturnNames;
9509
9510 output Tpl.Text out_txt;
9511 algorithm
9512 out_txt :=
9513 match(in_txt, in_mArg, in_a_stringStartVariablesNames, in_a_stringInputVariablesVRs, in_a_stringInputVariablesReturnNames)
9514 local
9515 Tpl.Text txt;
9516 Tpl.Text a_stringStartVariablesNames;
9517 Tpl.Text a_stringInputVariablesVRs;
9518 Tpl.Text a_stringInputVariablesReturnNames;
9519
9520 case ( txt,
9521 false,
9522 a_stringStartVariablesNames,
9523 a_stringInputVariablesVRs,
9524 a_stringInputVariablesReturnNames )
9525 algorithm
9526 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9527 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesReturnNames);
9528 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1SetString(fmi1me, {"));
9529 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesVRs);
9530 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
9531 ✗ txt := Tpl.writeText(txt, a_stringStartVariablesNames);
9532 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
9533 then txt;
9534
9535 case ( txt,
9536 _,
9537 _,
9538 _,
9539 _ )
9540 then txt;
9541 end match;
9542 end fun_314;
9543
9544 protected function fun_315
9545 input Tpl.Text in_txt;
9546 input Boolean in_mArg;
9547 input Tpl.Text in_a_realOutputVariablesVRs;
9548 input Tpl.Text in_a_realOutputVariablesNames;
9549
9550 output Tpl.Text out_txt;
9551 algorithm
9552 out_txt :=
9553 match(in_txt, in_mArg, in_a_realOutputVariablesVRs, in_a_realOutputVariablesNames)
9554 local
9555 Tpl.Text txt;
9556 Tpl.Text a_realOutputVariablesVRs;
9557 Tpl.Text a_realOutputVariablesNames;
9558
9559 case ( txt,
9560 false,
9561 a_realOutputVariablesVRs,
9562 a_realOutputVariablesNames )
9563 algorithm
9564 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9565 1 txt := Tpl.writeText(txt, a_realOutputVariablesNames);
9566 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetReal(fmi1me, {"));
9567 1 txt := Tpl.writeText(txt, a_realOutputVariablesVRs);
9568 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
9569 then txt;
9570
9571 case ( txt,
9572 _,
9573 _,
9574 _ )
9575 then txt;
9576 end match;
9577 end fun_315;
9578
9579 protected function fun_316
9580 input Tpl.Text in_txt;
9581 input Boolean in_mArg;
9582 input Tpl.Text in_a_integerOutputVariablesVRs;
9583 input Tpl.Text in_a_integerOutputVariablesNames;
9584
9585 output Tpl.Text out_txt;
9586 algorithm
9587 out_txt :=
9588 match(in_txt, in_mArg, in_a_integerOutputVariablesVRs, in_a_integerOutputVariablesNames)
9589 local
9590 Tpl.Text txt;
9591 Tpl.Text a_integerOutputVariablesVRs;
9592 Tpl.Text a_integerOutputVariablesNames;
9593
9594 case ( txt,
9595 false,
9596 a_integerOutputVariablesVRs,
9597 a_integerOutputVariablesNames )
9598 algorithm
9599 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9600 ✗ txt := Tpl.writeText(txt, a_integerOutputVariablesNames);
9601 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetInteger(fmi1me, {"));
9602 ✗ txt := Tpl.writeText(txt, a_integerOutputVariablesVRs);
9603 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
9604 then txt;
9605
9606 case ( txt,
9607 _,
9608 _,
9609 _ )
9610 then txt;
9611 end match;
9612 end fun_316;
9613
9614 protected function fun_317
9615 input Tpl.Text in_txt;
9616 input Boolean in_mArg;
9617 input Tpl.Text in_a_booleanOutputVariablesVRs;
9618 input Tpl.Text in_a_booleanOutputVariablesNames;
9619
9620 output Tpl.Text out_txt;
9621 algorithm
9622 out_txt :=
9623 match(in_txt, in_mArg, in_a_booleanOutputVariablesVRs, in_a_booleanOutputVariablesNames)
9624 local
9625 Tpl.Text txt;
9626 Tpl.Text a_booleanOutputVariablesVRs;
9627 Tpl.Text a_booleanOutputVariablesNames;
9628
9629 case ( txt,
9630 false,
9631 a_booleanOutputVariablesVRs,
9632 a_booleanOutputVariablesNames )
9633 algorithm
9634 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9635 1 txt := Tpl.writeText(txt, a_booleanOutputVariablesNames);
9636 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetBoolean(fmi1me, {"));
9637 1 txt := Tpl.writeText(txt, a_booleanOutputVariablesVRs);
9638 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
9639 then txt;
9640
9641 case ( txt,
9642 _,
9643 _,
9644 _ )
9645 then txt;
9646 end match;
9647 end fun_317;
9648
9649 protected function fun_318
9650 input Tpl.Text in_txt;
9651 input Boolean in_mArg;
9652 input Tpl.Text in_a_stringOutputVariablesVRs;
9653 input Tpl.Text in_a_stringOutputVariablesNames;
9654
9655 output Tpl.Text out_txt;
9656 algorithm
9657 out_txt :=
9658 match(in_txt, in_mArg, in_a_stringOutputVariablesVRs, in_a_stringOutputVariablesNames)
9659 local
9660 Tpl.Text txt;
9661 Tpl.Text a_stringOutputVariablesVRs;
9662 Tpl.Text a_stringOutputVariablesNames;
9663
9664 case ( txt,
9665 false,
9666 a_stringOutputVariablesVRs,
9667 a_stringOutputVariablesNames )
9668 algorithm
9669 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
9670 ✗ txt := Tpl.writeText(txt, a_stringOutputVariablesNames);
9671 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetString(fmi1me, {"));
9672 ✗ txt := Tpl.writeText(txt, a_stringOutputVariablesVRs);
9673 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
9674 then txt;
9675
9676 case ( txt,
9677 _,
9678 _,
9679 _ )
9680 then txt;
9681 end match;
9682 end fun_318;
9683
9684 protected function lm_319
9685 input output Tpl.Text txt;
9686 input list<Integer> items;
9687 algorithm
9688 ✗ for lstElt_319 in items loop
9689 txt := match lstElt_319
9690 local
9691 Integer i_eventIndicator;
9692
9693 case i_eventIndicator
9694 algorithm
9695 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("change(fmi_z_positive["));
9696 ✗ txt := Tpl.writeStr(txt, intString(i_eventIndicator));
9697 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("])"));
9698 ✗ txt := Tpl.nextIter(txt);
9699 then txt;
9700 end match;
9701 end for;
9702 end lm_319;
9703
9704 protected function fun_320
9705 input Tpl.Text in_txt;
9706 input Boolean in_mArg;
9707 input list<Integer> in_a_fmiInfo_fmiNumberOfEventIndicators;
9708
9709 output Tpl.Text out_txt;
9710 algorithm
9711 out_txt :=
9712 match(in_txt, in_mArg, in_a_fmiInfo_fmiNumberOfEventIndicators)
9713 local
9714 Tpl.Text txt;
9715 list<Integer> a_fmiInfo_fmiNumberOfEventIndicators;
9716
9717 case ( txt,
9718 false,
9719 _ )
9720 algorithm
9721 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" when {triggerDSSEvent > flowStatesInputs, nextEventTime < time, terminal()} then"));
9722 then txt;
9723
9724 case ( txt,
9725 _,
9726 a_fmiInfo_fmiNumberOfEventIndicators )
9727 algorithm
9728 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
9729 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("when {"));
9730 ✗ txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(" or ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
9731 ✗ txt := lm_319(txt, a_fmiInfo_fmiNumberOfEventIndicators);
9732 ✗ txt := Tpl.popIter(txt);
9733 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", triggerDSSEvent > flowStatesInputs, nextEventTime < time, terminal()} then"));
9734 ✗ txt := Tpl.popBlock(txt);
9735 then txt;
9736 end match;
9737 end fun_320;
9738
9739 protected function lm_321
9740 input output Tpl.Text txt;
9741 input list<Integer> items;
9742 algorithm
9743
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 time.
3 for lstElt_321 in items loop
9744 txt := match lstElt_321
9745 local
9746 Integer i_continuousStates;
9747
9748 case i_continuousStates
9749 algorithm
9750 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("reinit(fmi_x["));
9751 2 txt := Tpl.writeStr(txt, intString(i_continuousStates));
9752 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("], fmi_x_new["));
9753 2 txt := Tpl.writeStr(txt, intString(i_continuousStates));
9754 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]);"));
9755 2 txt := Tpl.nextIter(txt);
9756 then txt;
9757 end match;
9758 end for;
9759 end lm_321;
9760
9761 protected function fun_322
9762 input Tpl.Text in_txt;
9763 input Boolean in_mArg;
9764 input list<Integer> in_a_fmiInfo_fmiNumberOfContinuousStates;
9765
9766 output Tpl.Text out_txt;
9767 algorithm
9768 out_txt :=
9769 match(in_txt, in_mArg, in_a_fmiInfo_fmiNumberOfContinuousStates)
9770 local
9771 Tpl.Text txt;
9772 list<Integer> a_fmiInfo_fmiNumberOfContinuousStates;
9773
9774 case ( txt,
9775 false,
9776 _ )
9777 then txt;
9778
9779 case ( txt,
9780 _,
9781 a_fmiInfo_fmiNumberOfContinuousStates )
9782 algorithm
9783 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
9784 " if newStatesAvailable then\n",
9785 " fmi_x_new := fmi1Functions.fmi1GetContinuousStates(fmi1me, numberOfContinuousStates, flowStatesInputs);\n"
9786 }, true));
9787 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(6));
9788 1 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
9789 1 txt := lm_321(txt, a_fmiInfo_fmiNumberOfContinuousStates);
9790 1 txt := Tpl.popIter(txt);
9791 1 txt := Tpl.softNewLine(txt);
9792 1 txt := Tpl.popBlock(txt);
9793 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" end if;"));
9794 then txt;
9795 end match;
9796 end fun_322;
9797
9798 protected function fun_323
9799 input Tpl.Text in_txt;
9800 input Boolean in_mArg;
9801 input FMI.Info in_a_fmiInfo;
9802 input String in_a_fmiInfo_fmiModelIdentifier;
9803 input String in_a_name;
9804
9805 output Tpl.Text out_txt;
9806 algorithm
9807 out_txt :=
9808 match(in_txt, in_mArg, in_a_fmiInfo, in_a_fmiInfo_fmiModelIdentifier, in_a_name)
9809 local
9810 Tpl.Text txt;
9811 FMI.Info a_fmiInfo;
9812 String a_fmiInfo_fmiModelIdentifier;
9813 String a_name;
9814 String ret_0;
9815
9816 case ( txt,
9817 false,
9818 _,
9819 _,
9820 a_name )
9821 algorithm
9822 ✗ txt := Tpl.writeStr(txt, a_name);
9823 then txt;
9824
9825 case ( txt,
9826 _,
9827 a_fmiInfo,
9828 a_fmiInfo_fmiModelIdentifier,
9829 _ )
9830 algorithm
9831 2 txt := Tpl.writeStr(txt, a_fmiInfo_fmiModelIdentifier);
9832 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
9833 2 ret_0 := FMI.getFMIType(a_fmiInfo);
9834 2 txt := Tpl.writeStr(txt, ret_0);
9835 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_FMU"));
9836 then txt;
9837 end match;
9838 end fun_323;
9839
9840 public function importFMU1ModelExchange
9841 input Tpl.Text in_txt;
9842 input FMI.FmiImport in_a_fmi;
9843 input String in_a_name;
9844
9845 output Tpl.Text out_txt;
9846 algorithm
9847 out_txt :=
9848 match(in_txt, in_a_fmi, in_a_name)
9849 local
9850 Tpl.Text txt;
9851 String a_name;
9852 Real i_fmiExperimentAnnotation_fmiExperimentTolerance;
9853 Real i_fmiExperimentAnnotation_fmiExperimentStopTime;
9854 Real i_fmiExperimentAnnotation_fmiExperimentStartTime;
9855 list<Integer> i_fmiInfo_fmiNumberOfEventIndicators;
9856 list<Integer> i_fmiInfo_fmiNumberOfContinuousStates;
9857 Boolean i_generateOutputConnectors;
9858 Boolean i_generateInputConnectors;
9859 Boolean i_fmiDebugOutput;
9860 Integer i_fmiLogLevel;
9861 String i_fmuWorkingDirectory;
9862 list<FMI.TypeDefinitions> i_fmiTypeDefinitionsList;
9863 String i_fmiInfo_fmiDescription;
9864 FMI.Info i_fmiInfo;
9865 String i_fmiInfo_fmiModelIdentifier;
9866 list<FMI.ModelVariables> i_fmiModelVariablesList;
9867 Boolean ret_74;
9868 Boolean ret_73;
9869 Integer ret_72;
9870 Boolean ret_71;
9871 Integer ret_70;
9872 Boolean ret_69;
9873 Boolean ret_68;
9874 Boolean ret_67;
9875 Boolean ret_66;
9876 Boolean ret_65;
9877 Boolean ret_64;
9878 Boolean ret_63;
9879 Boolean ret_62;
9880 Boolean ret_61;
9881 Boolean ret_60;
9882 Boolean ret_59;
9883 Boolean ret_58;
9884 Boolean ret_57;
9885 Boolean ret_56;
9886 Boolean ret_55;
9887 Boolean ret_54;
9888 Boolean ret_53;
9889 Boolean ret_52;
9890 Boolean ret_51;
9891 Boolean ret_50;
9892 Boolean ret_49;
9893 Boolean ret_48;
9894 Boolean ret_47;
9895 Boolean ret_46;
9896 Boolean ret_45;
9897 Integer ret_44;
9898 Boolean ret_43;
9899 Boolean ret_42;
9900 Boolean ret_41;
9901 Boolean ret_40;
9902 Integer ret_39;
9903 Integer ret_38;
9904 Boolean ret_37;
9905 Boolean ret_36;
9906 Tpl.Text l_stringOutputVariablesNames;
9907 Tpl.Text l_stringOutputVariablesVRs;
9908 Tpl.Text l_booleanOutputVariablesNames;
9909 Tpl.Text l_booleanOutputVariablesVRs;
9910 Tpl.Text l_integerOutputVariablesNames;
9911 Tpl.Text l_integerOutputVariablesVRs;
9912 Tpl.Text l_realOutputVariablesNames;
9913 Tpl.Text l_realOutputVariablesVRs;
9914 Tpl.Text l_stringInputVariablesReturnNames;
9915 Tpl.Text l_stringStartVariablesNames;
9916 Tpl.Text l_stringInputVariablesVRs;
9917 Tpl.Text l_booleanInputVariablesReturnNames;
9918 Tpl.Text l_booleanInputVariablesNames;
9919 Tpl.Text l_booleanInputVariablesVRs;
9920 Tpl.Text l_integerInputVariablesReturnNames;
9921 Tpl.Text l_integerInputVariablesNames;
9922 Tpl.Text l_integerInputVariablesVRs;
9923 Tpl.Text l_realInputVariablesReturnNames;
9924 Tpl.Text l_realInputVariablesNames;
9925 Tpl.Text l_realInputVariablesVRs;
9926 Tpl.Text l_stringDependentParametersNames;
9927 Tpl.Text l_stringDependentParametersVRs;
9928 Tpl.Text l_booleanDependentParametersNames;
9929 Tpl.Text l_booleanDependentParametersVRs;
9930 Tpl.Text l_integerDependentParametersNames;
9931 Tpl.Text l_integerDependentParametersVRs;
9932 Tpl.Text l_realDependentParametersNames;
9933 Tpl.Text l_realDependentParametersVRs;
9934 Tpl.Text l_stringParametersNames;
9935 Tpl.Text l_stringParametersVRs;
9936 Tpl.Text l_booleanParametersNames;
9937 Tpl.Text l_booleanParametersVRs;
9938 Tpl.Text l_integerParametersNames;
9939 Tpl.Text l_integerParametersVRs;
9940 Tpl.Text l_realParametersNames;
9941 Tpl.Text l_realParametersVRs;
9942
9943 case ( txt,
9944 FMI.FMIIMPORT(fmiInfo = (i_fmiInfo as FMI.INFO(fmiModelIdentifier = i_fmiInfo_fmiModelIdentifier, fmiDescription = i_fmiInfo_fmiDescription, fmiNumberOfContinuousStates = i_fmiInfo_fmiNumberOfContinuousStates, fmiNumberOfEventIndicators = i_fmiInfo_fmiNumberOfEventIndicators)), fmiExperimentAnnotation = FMI.EXPERIMENTANNOTATION(fmiExperimentStartTime = i_fmiExperimentAnnotation_fmiExperimentStartTime, fmiExperimentStopTime = i_fmiExperimentAnnotation_fmiExperimentStopTime, fmiExperimentTolerance = i_fmiExperimentAnnotation_fmiExperimentTolerance), fmiModelVariablesList = i_fmiModelVariablesList, fmiTypeDefinitionsList = i_fmiTypeDefinitionsList, fmuWorkingDirectory = i_fmuWorkingDirectory, fmiLogLevel = i_fmiLogLevel, fmiDebugOutput = i_fmiDebugOutput, generateInputConnectors = i_generateInputConnectors, generateOutputConnectors = i_generateOutputConnectors),
9945 a_name )
9946 algorithm
9947 2 l_realParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", false, 1, "1.0");
9948 2 l_realParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", false, 2, "1.0");
9949 2 l_integerParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", false, 1, "1.0");
9950 2 l_integerParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", false, 2, "1.0");
9951 2 l_booleanParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", false, 1, "1.0");
9952 2 l_booleanParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", false, 2, "1.0");
9953 2 l_stringParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", false, 1, "1.0");
9954 2 l_stringParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", false, 2, "1.0");
9955 2 l_realDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", true, 1, "1.0");
9956 2 l_realDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", true, 2, "1.0");
9957 2 l_integerDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", true, 1, "1.0");
9958 2 l_integerDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", true, 2, "1.0");
9959 2 l_booleanDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", true, 1, "1.0");
9960 2 l_booleanDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", true, 2, "1.0");
9961 2 l_stringDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", true, 1, "1.0");
9962 2 l_stringDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", true, 2, "1.0");
9963 2 l_realInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 1, "1.0");
9964 2 l_realInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 2, "1.0");
9965 2 l_realInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 3, "1.0");
9966 2 l_integerInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 1, "1.0");
9967 2 l_integerInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 2, "1.0");
9968 2 l_integerInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 3, "1.0");
9969 2 l_booleanInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 1, "1.0");
9970 2 l_booleanInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 2, "1.0");
9971 2 l_booleanInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 3, "1.0");
9972 2 l_stringInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 1, "1.0");
9973 2 l_stringStartVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 2, "1.0");
9974 2 l_stringInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 3, "1.0");
9975 2 l_realOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "output", false, 1, "1.0");
9976 2 l_realOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "output", false, 2, "1.0");
9977 2 l_integerOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "output", false, 1, "1.0");
9978 2 l_integerOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "output", false, 2, "1.0");
9979 2 l_booleanOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "output", false, 1, "1.0");
9980 2 l_booleanOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "output", false, 2, "1.0");
9981 2 l_stringOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "output", false, 1, "1.0");
9982 2 l_stringOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "output", false, 2, "1.0");
9983 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("model "));
9984
2/4
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
2 ret_36 := stringEq(a_name, "");
9985 2 txt := fun_296(txt, ret_36, i_fmiInfo, i_fmiInfo_fmiModelIdentifier, a_name);
9986
2/4
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
2 ret_37 := stringEq(i_fmiInfo_fmiDescription, "");
9987 2 txt := fun_297(txt, ret_37, i_fmiInfo_fmiDescription);
9988 2 txt := Tpl.softNewLine(txt);
9989 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
9990 2 txt := dumpFMITypeDefinitions(txt, i_fmiTypeDefinitionsList);
9991 2 txt := Tpl.softNewLine(txt);
9992 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("constant String fmuWorkingDir = \""));
9993 2 txt := Tpl.writeStr(txt, i_fmuWorkingDirectory);
9994 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
9995 "\";\n",
9996 "parameter Integer logLevel = "
9997 }, false));
9998 2 txt := Tpl.writeStr(txt, intString(i_fmiLogLevel));
9999 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
10000 " \"log level used during the loading of FMU\" annotation (Dialog(tab=\"FMI\", group=\"Enable logging\"));\n",
10001 "parameter Boolean debugLogging = "
10002 }, false));
10003 2 txt := Tpl.writeStr(txt, Tpl.booleanString(i_fmiDebugOutput));
10004 2 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" \"enables the FMU simulation logging\" annotation (Dialog(tab=\"FMI\", group=\"Enable logging\"));\n"));
10005 2 txt := dumpFMIModelVariablesList(txt, "1.0", i_fmiModelVariablesList, i_fmiTypeDefinitionsList, i_generateInputConnectors, i_generateOutputConnectors);
10006 2 txt := Tpl.softNewLine(txt);
10007 2 txt := Tpl.popBlock(txt);
10008 2 txt := Tpl.writeTok(txt, Tpl.ST_LINE("protected\n"));
10009 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
10010 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("FMI1ModelExchange fmi1me = FMI1ModelExchange(logLevel, fmuWorkingDir, \""));
10011 2 txt := Tpl.writeStr(txt, i_fmiInfo_fmiModelIdentifier);
10012 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
10013 "\", debugLogging);\n",
10014 "constant Integer numberOfContinuousStates = "
10015 }, false));
10016 2 ret_38 := listLength(i_fmiInfo_fmiNumberOfContinuousStates);
10017 2 txt := Tpl.writeStr(txt, intString(ret_38));
10018 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
10019 ";\n",
10020 "Real fmi_x[numberOfContinuousStates] \"States\";\n",
10021 "Real fmi_x_new[numberOfContinuousStates](each fixed = true) \"New States\";\n",
10022 "constant Integer numberOfEventIndicators = "
10023 }, false));
10024 2 ret_39 := listLength(i_fmiInfo_fmiNumberOfEventIndicators);
10025 2 txt := Tpl.writeStr(txt, intString(ret_39));
10026 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
10027 ";\n",
10028 "Real fmi_z[numberOfEventIndicators] \"Events Indicators\";\n",
10029 "Boolean fmi_z_positive[numberOfEventIndicators](each fixed = true);\n",
10030 "parameter Real flowStartTime(fixed=false);\n",
10031 "Real flowTime;\n",
10032 "parameter Real flowInitialized(fixed=false);\n",
10033 "parameter Real flowParamsStart(fixed=false);\n",
10034 "parameter Real flowInitInputs(fixed=false);\n",
10035 "Real flowStatesInputs;\n"
10036 }, true));
10037
3/4
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
2 ret_40 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
10038 2 txt := fun_298(txt, ret_40, l_realInputVariablesReturnNames);
10039 2 txt := Tpl.softNewLine(txt);
10040
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_41 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
10041 2 txt := fun_299(txt, ret_41, l_integerInputVariablesReturnNames);
10042 2 txt := Tpl.softNewLine(txt);
10043
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_42 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
10044 2 txt := fun_300(txt, ret_42, l_booleanInputVariablesReturnNames);
10045 2 txt := Tpl.softNewLine(txt);
10046
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_43 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
10047 2 txt := fun_301(txt, ret_43, l_stringInputVariablesReturnNames);
10048 2 txt := Tpl.softNewLine(txt);
10049 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
10050 "Boolean callEventUpdate;\n",
10051 "constant Boolean intermediateResults = false;\n",
10052 "Boolean newStatesAvailable(fixed = true);\n",
10053 "Real triggerDSSEvent;\n",
10054 "Real nextEventTime;\n"
10055 }, true));
10056 2 txt := Tpl.popBlock(txt);
10057 2 txt := Tpl.writeTok(txt, Tpl.ST_LINE("initial equation\n"));
10058 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
10059 2 ret_44 := listLength(i_fmiInfo_fmiNumberOfContinuousStates);
10060 2 ret_45 := intGt(ret_44, 0);
10061 2 txt := fun_302(txt, ret_45);
10062 2 txt := Tpl.softNewLine(txt);
10063 2 txt := Tpl.popBlock(txt);
10064 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
10065 "initial algorithm\n",
10066 " flowParamsStart := 1;\n",
10067 " flowInitInputs := 1;\n",
10068 " flowStartTime := fmi1Functions.fmi1SetTime(fmi1me, time, 1);\n",
10069 " /* the parameters must be set before the FMU is initialized,\n",
10070 " otherwise the FMU computes its calculated parameters from the default values */\n"
10071 }, true));
10072 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
10073
3/4
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
2 ret_46 := stringEq(Tpl.textString(l_realParametersVRs), "");
10074 2 txt := fun_303(txt, ret_46, l_realParametersNames, l_realParametersVRs);
10075 2 txt := Tpl.softNewLine(txt);
10076
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_47 := stringEq(Tpl.textString(l_integerParametersVRs), "");
10077 2 txt := fun_304(txt, ret_47, l_integerParametersNames, l_integerParametersVRs);
10078 2 txt := Tpl.softNewLine(txt);
10079
3/4
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
2 ret_48 := stringEq(Tpl.textString(l_booleanParametersVRs), "");
10080 2 txt := fun_305(txt, ret_48, l_booleanParametersNames, l_booleanParametersVRs);
10081 2 txt := Tpl.softNewLine(txt);
10082
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_49 := stringEq(Tpl.textString(l_stringParametersVRs), "");
10083 2 txt := fun_306(txt, ret_49, l_stringParametersNames, l_stringParametersVRs);
10084 2 txt := Tpl.softNewLine(txt);
10085 2 txt := Tpl.writeTok(txt, Tpl.ST_LINE("flowInitialized := fmi1Functions.fmi1Initialize(fmi1me, flowParamsStart+flowInitInputs+flowStartTime);\n"));
10086 2 txt := Tpl.popBlock(txt);
10087 2 txt := Tpl.writeTok(txt, Tpl.ST_LINE("initial equation\n"));
10088 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
10089
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_50 := stringEq(Tpl.textString(l_realDependentParametersVRs), "");
10090 2 txt := fun_307(txt, ret_50, l_realDependentParametersVRs, l_realDependentParametersNames);
10091 2 txt := Tpl.softNewLine(txt);
10092
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_51 := stringEq(Tpl.textString(l_integerDependentParametersVRs), "");
10093 2 txt := fun_308(txt, ret_51, l_integerDependentParametersVRs, l_integerDependentParametersNames);
10094 2 txt := Tpl.softNewLine(txt);
10095
3/4
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
2 ret_52 := stringEq(Tpl.textString(l_booleanDependentParametersVRs), "");
10096 2 txt := fun_309(txt, ret_52, l_booleanDependentParametersVRs, l_booleanDependentParametersNames);
10097 2 txt := Tpl.softNewLine(txt);
10098
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_53 := stringEq(Tpl.textString(l_stringDependentParametersVRs), "");
10099 2 txt := fun_310(txt, ret_53, l_stringDependentParametersVRs, l_stringDependentParametersNames);
10100 2 txt := Tpl.softNewLine(txt);
10101 2 txt := Tpl.popBlock(txt);
10102 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
10103 "equation\n",
10104 " flowTime = fmi1Functions.fmi1SetTime(fmi1me, time, flowInitialized);\n"
10105 }, true));
10106 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
10107
3/4
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
2 ret_54 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
10108 2 txt := fun_311(txt, ret_54, l_realInputVariablesNames, l_realInputVariablesVRs, l_realInputVariablesReturnNames);
10109 2 txt := Tpl.softNewLine(txt);
10110
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_55 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
10111 2 txt := fun_312(txt, ret_55, l_integerInputVariablesNames, l_integerInputVariablesVRs, l_integerInputVariablesReturnNames);
10112 2 txt := Tpl.softNewLine(txt);
10113
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_56 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
10114 2 txt := fun_313(txt, ret_56, l_booleanInputVariablesNames, l_booleanInputVariablesVRs, l_booleanInputVariablesReturnNames);
10115 2 txt := Tpl.softNewLine(txt);
10116
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_57 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
10117 2 txt := fun_314(txt, ret_57, l_stringStartVariablesNames, l_stringInputVariablesVRs, l_stringInputVariablesReturnNames);
10118 2 txt := Tpl.softNewLine(txt);
10119 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
10120 "flowStatesInputs = fmi1Functions.fmi1SetContinuousStates(fmi1me, fmi_x, flowParamsStart + flowTime);\n",
10121 "der(fmi_x) = fmi1Functions.fmi1GetDerivatives(fmi1me, numberOfContinuousStates, flowStatesInputs);\n",
10122 "fmi_z = fmi1Functions.fmi1GetEventIndicators(fmi1me, numberOfEventIndicators, flowStatesInputs);\n",
10123 "for i in 1:size(fmi_z,1) loop\n",
10124 " fmi_z_positive[i] = if not terminal() then fmi_z[i] > 0 else pre(fmi_z_positive[i]);\n",
10125 "end for;\n",
10126 "callEventUpdate = fmi1Functions.fmi1CompletedIntegratorStep(fmi1me, flowStatesInputs);\n",
10127 "triggerDSSEvent = noEvent(if callEventUpdate then flowStatesInputs+1.0 else flowStatesInputs-1.0);\n",
10128 "nextEventTime = fmi1Functions.fmi1nextEventTime(fmi1me, flowStatesInputs);\n"
10129 }, true));
10130
3/4
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
2 ret_58 := stringEq(Tpl.textString(l_realOutputVariablesNames), "");
10131
3/4
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
2 ret_59 := stringEq(Tpl.textString(l_realOutputVariablesVRs), "");
10132 2 ret_60 := boolAnd(ret_58, ret_59);
10133 2 txt := fun_315(txt, ret_60, l_realOutputVariablesVRs, l_realOutputVariablesNames);
10134 2 txt := Tpl.softNewLine(txt);
10135
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_61 := stringEq(Tpl.textString(l_integerOutputVariablesNames), "");
10136
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_62 := stringEq(Tpl.textString(l_integerOutputVariablesVRs), "");
10137 2 ret_63 := boolAnd(ret_61, ret_62);
10138 2 txt := fun_316(txt, ret_63, l_integerOutputVariablesVRs, l_integerOutputVariablesNames);
10139 2 txt := Tpl.softNewLine(txt);
10140
3/4
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
2 ret_64 := stringEq(Tpl.textString(l_booleanOutputVariablesNames), "");
10141
3/4
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
2 ret_65 := stringEq(Tpl.textString(l_booleanOutputVariablesVRs), "");
10142 2 ret_66 := boolAnd(ret_64, ret_65);
10143 2 txt := fun_317(txt, ret_66, l_booleanOutputVariablesVRs, l_booleanOutputVariablesNames);
10144 2 txt := Tpl.softNewLine(txt);
10145
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_67 := stringEq(Tpl.textString(l_stringOutputVariablesNames), "");
10146
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
2 ret_68 := stringEq(Tpl.textString(l_stringOutputVariablesVRs), "");
10147 2 ret_69 := boolAnd(ret_67, ret_68);
10148 2 txt := fun_318(txt, ret_69, l_stringOutputVariablesVRs, l_stringOutputVariablesNames);
10149 2 txt := Tpl.softNewLine(txt);
10150 2 txt := dumpOutputGetEnumerationVariables(txt, i_fmiModelVariablesList, i_fmiTypeDefinitionsList, "fmi1Functions.fmi1GetInteger", "fmi1me");
10151 2 txt := Tpl.softNewLine(txt);
10152 2 txt := Tpl.popBlock(txt);
10153 2 txt := Tpl.writeTok(txt, Tpl.ST_LINE("algorithm\n"));
10154 2 ret_70 := listLength(i_fmiInfo_fmiNumberOfEventIndicators);
10155 2 ret_71 := intGt(ret_70, 0);
10156 2 txt := fun_320(txt, ret_71, i_fmiInfo_fmiNumberOfEventIndicators);
10157 2 txt := Tpl.softNewLine(txt);
10158 2 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" newStatesAvailable := fmi1Functions.fmi1EventUpdate(fmi1me, intermediateResults);\n"));
10159 2 ret_72 := listLength(i_fmiInfo_fmiNumberOfContinuousStates);
10160 2 ret_73 := intGt(ret_72, 0);
10161 2 txt := fun_322(txt, ret_73, i_fmiInfo_fmiNumberOfContinuousStates);
10162 2 txt := Tpl.softNewLine(txt);
10163 2 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" end when;\n"));
10164 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
10165 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("annotation(experiment(StartTime="));
10166 2 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentStartTime));
10167 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", StopTime="));
10168 2 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentStopTime));
10169 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", Tolerance="));
10170 2 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentTolerance));
10171 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
10172 "));\n",
10173 "annotation (Icon(graphics={\n",
10174 " Rectangle(\n",
10175 " extent={{-100,100},{100,-100}},\n",
10176 " lineColor={0,0,0},\n",
10177 " fillColor={240,240,240},\n",
10178 " fillPattern=FillPattern.Solid,\n",
10179 " lineThickness=0.5),\n",
10180 " Text(\n",
10181 " extent={{-100,40},{100,0}},\n",
10182 " lineColor={0,0,0},\n",
10183 " textString=\"%name\"),\n",
10184 " Text(\n",
10185 " extent={{-100,-50},{100,-90}},\n",
10186 " lineColor={0,0,0},\n",
10187 " textString=\"V1.0\")}));\n"
10188 }, true));
10189 2 txt := Tpl.popBlock(txt);
10190 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
10191 "protected\n",
10192 " class FMI1ModelExchange\n",
10193 " extends ExternalObject;\n",
10194 " function constructor\n",
10195 " input Integer logLevel;\n",
10196 " input String workingDirectory;\n",
10197 " input String instanceName;\n",
10198 " input Boolean debugLogging;\n",
10199 " output FMI1ModelExchange fmi1me;\n",
10200 " external \"C\" fmi1me = FMI1ModelExchangeConstructor_OMC(logLevel, workingDirectory, instanceName, debugLogging) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10201 " end constructor;\n",
10202 "\n",
10203 " function destructor\n",
10204 " input FMI1ModelExchange fmi1me;\n",
10205 " external \"C\" FMI1ModelExchangeDestructor_OMC(fmi1me) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10206 " end destructor;\n",
10207 " end FMI1ModelExchange;\n",
10208 "\n"
10209 }, true));
10210 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
10211 2 txt := dumpFMITypeDefinitionsMappingFunctions(txt, i_fmiTypeDefinitionsList);
10212 2 txt := Tpl.softNewLine(txt);
10213 2 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
10214 2 txt := dumpFMITypeDefinitionsArrayMappingFunctions(txt, i_fmiTypeDefinitionsList);
10215 2 txt := Tpl.softNewLine(txt);
10216 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
10217 "\n",
10218 "package fmi1Functions\n",
10219 " function fmi1Initialize\n",
10220 " input FMI1ModelExchange fmi1me;\n",
10221 " input Real preInitialized;\n",
10222 " output Real postInitialized=preInitialized;\n",
10223 " external \"C\" fmi1Initialize_OMC(fmi1me) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10224 " end fmi1Initialize;\n",
10225 "\n",
10226 " function fmi1SetTime\n",
10227 " input FMI1ModelExchange fmi1me;\n",
10228 " input Real inTime;\n",
10229 " input Real inFlow;\n",
10230 " output Real outFlow = inFlow;\n",
10231 " external \"C\" fmi1SetTime_OMC(fmi1me, inTime) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10232 " end fmi1SetTime;\n",
10233 "\n",
10234 " function fmi1GetContinuousStates\n",
10235 " input FMI1ModelExchange fmi1me;\n",
10236 " input Integer numberOfContinuousStates;\n",
10237 " input Real inFlowParams;\n",
10238 " output Real fmi_x[numberOfContinuousStates];\n",
10239 " external \"C\" fmi1GetContinuousStates_OMC(fmi1me, numberOfContinuousStates, inFlowParams, fmi_x) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10240 " end fmi1GetContinuousStates;\n",
10241 "\n",
10242 " function fmi1SetContinuousStates\n",
10243 " input FMI1ModelExchange fmi1me;\n",
10244 " input Real fmi_x[:];\n",
10245 " input Real inFlowParams;\n",
10246 " output Real outFlowStates;\n",
10247 " external \"C\" outFlowStates = fmi1SetContinuousStates_OMC(fmi1me, size(fmi_x, 1), inFlowParams, fmi_x) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10248 " end fmi1SetContinuousStates;\n",
10249 "\n",
10250 " function fmi1GetDerivatives\n",
10251 " input FMI1ModelExchange fmi1me;\n",
10252 " input Integer numberOfContinuousStates;\n",
10253 " input Real inFlowStates;\n",
10254 " output Real fmi_x[numberOfContinuousStates];\n",
10255 " external \"C\" fmi1GetDerivatives_OMC(fmi1me, numberOfContinuousStates, inFlowStates, fmi_x) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10256 " end fmi1GetDerivatives;\n",
10257 "\n",
10258 " function fmi1GetEventIndicators\n",
10259 " input FMI1ModelExchange fmi1me;\n",
10260 " input Integer numberOfEventIndicators;\n",
10261 " input Real inFlowStates;\n",
10262 " output Real fmi_z[numberOfEventIndicators];\n",
10263 " external \"C\" fmi1GetEventIndicators_OMC(fmi1me, numberOfEventIndicators, inFlowStates, fmi_z) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10264 " end fmi1GetEventIndicators;\n",
10265 "\n",
10266 " function fmi1GetReal\n",
10267 " input FMI1ModelExchange fmi1me;\n",
10268 " input Real realValuesReferences[:];\n",
10269 " input Real inFlowStatesInput;\n",
10270 " output Real realValues[size(realValuesReferences, 1)];\n",
10271 " external \"C\" fmi1GetReal_OMC(fmi1me, size(realValuesReferences, 1), realValuesReferences, inFlowStatesInput, realValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10272 " end fmi1GetReal;\n",
10273 "\n",
10274 " function fmi1SetReal\n",
10275 " input FMI1ModelExchange fmi1me;\n",
10276 " input Real realValueReferences[:];\n",
10277 " input Real realValues[size(realValueReferences, 1)];\n",
10278 " output Real outValues[size(realValueReferences, 1)] = realValues;\n",
10279 " external \"C\" fmi1SetReal_OMC(fmi1me, size(realValueReferences, 1), realValueReferences, realValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10280 " end fmi1SetReal;\n",
10281 "\n",
10282 " function fmi1SetRealParameter\n",
10283 " input FMI1ModelExchange fmi1me;\n",
10284 " input Real realValueReferences[:];\n",
10285 " input Real realValues[size(realValueReferences, 1)];\n",
10286 " output Real out_Value = 1;\n",
10287 " external \"C\" fmi1SetReal_OMC(fmi1me, size(realValueReferences, 1), realValueReferences, realValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10288 " end fmi1SetRealParameter;\n",
10289 "\n",
10290 " function fmi1GetInteger\n",
10291 " input FMI1ModelExchange fmi1me;\n",
10292 " input Real integerValueReferences[:];\n",
10293 " input Real inFlowStatesInput;\n",
10294 " output Integer integerValues[size(integerValueReferences, 1)];\n",
10295 " external \"C\" fmi1GetInteger_OMC(fmi1me, size(integerValueReferences, 1), integerValueReferences, inFlowStatesInput, integerValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10296 " end fmi1GetInteger;\n",
10297 "\n",
10298 " function fmi1SetInteger\n",
10299 " input FMI1ModelExchange fmi1me;\n",
10300 " input Real integerValuesReferences[:];\n",
10301 " input Integer integerValues[size(integerValuesReferences, 1)];\n",
10302 " output Integer outValues[size(integerValuesReferences, 1)] = integerValues;\n",
10303 " external \"C\" fmi1SetInteger_OMC(fmi1me, size(integerValuesReferences, 1), integerValuesReferences, integerValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10304 " end fmi1SetInteger;\n",
10305 "\n",
10306 " function fmi1SetIntegerParameter\n",
10307 " input FMI1ModelExchange fmi1me;\n",
10308 " input Real integerValuesReferences[:];\n",
10309 " input Integer integerValues[size(integerValuesReferences, 1)];\n",
10310 " output Real out_Value = 1;\n",
10311 " external \"C\" fmi1SetInteger_OMC(fmi1me, size(integerValuesReferences, 1), integerValuesReferences, integerValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10312 " end fmi1SetIntegerParameter;\n",
10313 "\n",
10314 " function fmi1GetBoolean\n",
10315 " input FMI1ModelExchange fmi1me;\n",
10316 " input Real booleanValuesReferences[:];\n",
10317 " input Real inFlowStatesInput;\n",
10318 " output Boolean booleanValues[size(booleanValuesReferences, 1)];\n",
10319 " external \"C\" fmi1GetBoolean_OMC(fmi1me, size(booleanValuesReferences, 1), booleanValuesReferences, inFlowStatesInput, booleanValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10320 " end fmi1GetBoolean;\n",
10321 "\n",
10322 " function fmi1SetBoolean\n",
10323 " input FMI1ModelExchange fmi1me;\n",
10324 " input Real booleanValueReferences[:];\n",
10325 " input Boolean booleanValues[size(booleanValueReferences, 1)];\n",
10326 " output Boolean outValues[size(booleanValueReferences, 1)] = booleanValues;\n",
10327 " external \"C\" fmi1SetBoolean_OMC(fmi1me, size(booleanValueReferences, 1), booleanValueReferences, booleanValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10328 " end fmi1SetBoolean;\n",
10329 "\n",
10330 " function fmi1SetBooleanParameter\n",
10331 " input FMI1ModelExchange fmi1me;\n",
10332 " input Real booleanValueReferences[:];\n",
10333 " input Boolean booleanValues[size(booleanValueReferences, 1)];\n",
10334 " output Real out_Value = 1;\n",
10335 " external \"C\" fmi1SetBoolean_OMC(fmi1me, size(booleanValueReferences, 1), booleanValueReferences, booleanValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10336 " end fmi1SetBooleanParameter;\n",
10337 "\n",
10338 " function fmi1GetString\n",
10339 " input FMI1ModelExchange fmi1me;\n",
10340 " input Real stringValuesReferences[:];\n",
10341 " input Real inFlowStatesInput;\n",
10342 " output String stringValues[size(stringValuesReferences, 1)];\n",
10343 " external \"C\" fmi1GetString_OMC(fmi1me, size(stringValuesReferences, 1), stringValuesReferences, inFlowStatesInput, stringValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10344 " end fmi1GetString;\n",
10345 "\n",
10346 " function fmi1SetString\n",
10347 " input FMI1ModelExchange fmi1me;\n",
10348 " input Real stringValueReferences[:];\n",
10349 " input String stringValues[size(stringValueReferences, 1)];\n",
10350 " output String outValues[size(stringValueReferences, 1)] = stringValues;\n",
10351 " external \"C\" fmi1SetString_OMC(fmi1me, size(stringValueReferences, 1), stringValueReferences, stringValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10352 " end fmi1SetString;\n",
10353 "\n",
10354 " function fmi1SetStringParameter\n",
10355 " input FMI1ModelExchange fmi1me;\n",
10356 " input Real stringValueReferences[:];\n",
10357 " input String stringValues[size(stringValueReferences, 1)];\n",
10358 " output Real out_Value = 1;\n",
10359 " external \"C\" fmi1SetString_OMC(fmi1me, size(stringValueReferences, 1), stringValueReferences, stringValues, 1) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10360 " end fmi1SetStringParameter;\n",
10361 "\n",
10362 " function fmi1EventUpdate\n",
10363 " input FMI1ModelExchange fmi1me;\n",
10364 " input Boolean intermediateResults;\n",
10365 " output Boolean outNewStatesAvailable;\n",
10366 " external \"C\" outNewStatesAvailable = fmi1EventUpdate_OMC(fmi1me, intermediateResults) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10367 " end fmi1EventUpdate;\n",
10368 "\n",
10369 " function fmi1nextEventTime\n",
10370 " input FMI1ModelExchange fmi1me;\n",
10371 " input Real inFlowStates;\n",
10372 " output Real outNewnextTime;\n",
10373 " external \"C\" outNewnextTime = fmi1nextEventTime_OMC(fmi1me, inFlowStates) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10374 " end fmi1nextEventTime;\n",
10375 "\n",
10376 " function fmi1CompletedIntegratorStep\n",
10377 " input FMI1ModelExchange fmi1me;\n",
10378 " input Real inFlowStates;\n",
10379 " output Boolean outCallEventUpdate;\n",
10380 " external \"C\" outCallEventUpdate = fmi1CompletedIntegratorStep_OMC(fmi1me, inFlowStates) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
10381 " end fmi1CompletedIntegratorStep;\n",
10382 "end fmi1Functions;\n"
10383 }, true));
10384 2 txt := Tpl.popBlock(txt);
10385 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
10386
2/4
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
2 ret_74 := stringEq(a_name, "");
10387 2 txt := fun_323(txt, ret_74, i_fmiInfo, i_fmiInfo_fmiModelIdentifier, a_name);
10388 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
10389 then txt;
10390
10391 case ( txt,
10392 _,
10393 _ )
10394 then txt;
10395 end match;
10396 end importFMU1ModelExchange;
10397
10398 protected function fun_325
10399 input Tpl.Text in_txt;
10400 input Boolean in_mArg;
10401 input FMI.Info in_a_fmiInfo;
10402 input String in_a_fmiInfo_fmiModelIdentifier;
10403 input String in_a_name;
10404
10405 output Tpl.Text out_txt;
10406 algorithm
10407 out_txt :=
10408 match(in_txt, in_mArg, in_a_fmiInfo, in_a_fmiInfo_fmiModelIdentifier, in_a_name)
10409 local
10410 Tpl.Text txt;
10411 FMI.Info a_fmiInfo;
10412 String a_fmiInfo_fmiModelIdentifier;
10413 String a_name;
10414 String ret_0;
10415
10416 case ( txt,
10417 false,
10418 _,
10419 _,
10420 a_name )
10421 algorithm
10422 ✗ txt := Tpl.writeStr(txt, a_name);
10423 then txt;
10424
10425 case ( txt,
10426 _,
10427 a_fmiInfo,
10428 a_fmiInfo_fmiModelIdentifier,
10429 _ )
10430 algorithm
10431 14 txt := Tpl.writeStr(txt, a_fmiInfo_fmiModelIdentifier);
10432 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
10433 14 ret_0 := FMI.getFMIType(a_fmiInfo);
10434 14 txt := Tpl.writeStr(txt, ret_0);
10435 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_FMU"));
10436 then txt;
10437 end match;
10438 end fun_325;
10439
10440 protected function fun_326
10441 input Tpl.Text in_txt;
10442 input Boolean in_mArg;
10443 input String in_a_fmiInfo_fmiDescription;
10444
10445 output Tpl.Text out_txt;
10446 algorithm
10447 out_txt :=
10448 match(in_txt, in_mArg, in_a_fmiInfo_fmiDescription)
10449 local
10450 Tpl.Text txt;
10451 String a_fmiInfo_fmiDescription;
10452
10453 case ( txt,
10454 false,
10455 a_fmiInfo_fmiDescription )
10456 algorithm
10457 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" \""));
10458 2 txt := Tpl.writeStr(txt, a_fmiInfo_fmiDescription);
10459 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
10460 then txt;
10461
10462 case ( txt,
10463 _,
10464 _ )
10465 then txt;
10466 end match;
10467 end fun_326;
10468
10469 protected function fun_327
10470 input Tpl.Text in_txt;
10471 input Boolean in_mArg;
10472 input Tpl.Text in_a_nRealInputVariables;
10473
10474 output Tpl.Text out_txt;
10475 algorithm
10476 out_txt :=
10477 match(in_txt, in_mArg, in_a_nRealInputVariables)
10478 local
10479 Tpl.Text txt;
10480 Tpl.Text a_nRealInputVariables;
10481
10482 case ( txt,
10483 false,
10484 a_nRealInputVariables )
10485 algorithm
10486 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Real realInputVariables["));
10487 3 txt := Tpl.writeText(txt, a_nRealInputVariables);
10488 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("];"));
10489 then txt;
10490
10491 case ( txt,
10492 _,
10493 _ )
10494 then txt;
10495 end match;
10496 end fun_327;
10497
10498 protected function fun_328
10499 input Tpl.Text in_txt;
10500 input Boolean in_mArg;
10501 input Tpl.Text in_a_realInputVariablesReturnNames;
10502
10503 output Tpl.Text out_txt;
10504 algorithm
10505 out_txt :=
10506 match(in_txt, in_mArg, in_a_realInputVariablesReturnNames)
10507 local
10508 Tpl.Text txt;
10509 Tpl.Text a_realInputVariablesReturnNames;
10510
10511 case ( txt,
10512 false,
10513 a_realInputVariablesReturnNames )
10514 algorithm
10515 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Real "));
10516 3 txt := Tpl.writeText(txt, a_realInputVariablesReturnNames);
10517 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
10518 then txt;
10519
10520 case ( txt,
10521 _,
10522 _ )
10523 then txt;
10524 end match;
10525 end fun_328;
10526
10527 protected function fun_329
10528 input Tpl.Text in_txt;
10529 input Boolean in_mArg;
10530 input Tpl.Text in_a_nIntegerInputVariables;
10531
10532 output Tpl.Text out_txt;
10533 algorithm
10534 out_txt :=
10535 match(in_txt, in_mArg, in_a_nIntegerInputVariables)
10536 local
10537 Tpl.Text txt;
10538 Tpl.Text a_nIntegerInputVariables;
10539
10540 case ( txt,
10541 false,
10542 a_nIntegerInputVariables )
10543 algorithm
10544 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Integer integerInputVariables["));
10545 ✗ txt := Tpl.writeText(txt, a_nIntegerInputVariables);
10546 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("];"));
10547 then txt;
10548
10549 case ( txt,
10550 _,
10551 _ )
10552 then txt;
10553 end match;
10554 end fun_329;
10555
10556 protected function fun_330
10557 input Tpl.Text in_txt;
10558 input Boolean in_mArg;
10559 input Tpl.Text in_a_integerInputVariablesReturnNames;
10560
10561 output Tpl.Text out_txt;
10562 algorithm
10563 out_txt :=
10564 match(in_txt, in_mArg, in_a_integerInputVariablesReturnNames)
10565 local
10566 Tpl.Text txt;
10567 Tpl.Text a_integerInputVariablesReturnNames;
10568
10569 case ( txt,
10570 false,
10571 a_integerInputVariablesReturnNames )
10572 algorithm
10573 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Integer "));
10574 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesReturnNames);
10575 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
10576 then txt;
10577
10578 case ( txt,
10579 _,
10580 _ )
10581 then txt;
10582 end match;
10583 end fun_330;
10584
10585 protected function fun_331
10586 input Tpl.Text in_txt;
10587 input Boolean in_mArg;
10588 input Tpl.Text in_a_nBooleanInputVariables;
10589
10590 output Tpl.Text out_txt;
10591 algorithm
10592 out_txt :=
10593 match(in_txt, in_mArg, in_a_nBooleanInputVariables)
10594 local
10595 Tpl.Text txt;
10596 Tpl.Text a_nBooleanInputVariables;
10597
10598 case ( txt,
10599 false,
10600 a_nBooleanInputVariables )
10601 algorithm
10602 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Boolean booleanInputVariables["));
10603 ✗ txt := Tpl.writeText(txt, a_nBooleanInputVariables);
10604 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("];"));
10605 then txt;
10606
10607 case ( txt,
10608 _,
10609 _ )
10610 then txt;
10611 end match;
10612 end fun_331;
10613
10614 protected function fun_332
10615 input Tpl.Text in_txt;
10616 input Boolean in_mArg;
10617 input Tpl.Text in_a_booleanInputVariablesReturnNames;
10618
10619 output Tpl.Text out_txt;
10620 algorithm
10621 out_txt :=
10622 match(in_txt, in_mArg, in_a_booleanInputVariablesReturnNames)
10623 local
10624 Tpl.Text txt;
10625 Tpl.Text a_booleanInputVariablesReturnNames;
10626
10627 case ( txt,
10628 false,
10629 a_booleanInputVariablesReturnNames )
10630 algorithm
10631 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Boolean "));
10632 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesReturnNames);
10633 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
10634 then txt;
10635
10636 case ( txt,
10637 _,
10638 _ )
10639 then txt;
10640 end match;
10641 end fun_332;
10642
10643 protected function fun_333
10644 input Tpl.Text in_txt;
10645 input Boolean in_mArg;
10646 input Tpl.Text in_a_nStringInputVariables;
10647
10648 output Tpl.Text out_txt;
10649 algorithm
10650 out_txt :=
10651 match(in_txt, in_mArg, in_a_nStringInputVariables)
10652 local
10653 Tpl.Text txt;
10654 Tpl.Text a_nStringInputVariables;
10655
10656 case ( txt,
10657 false,
10658 a_nStringInputVariables )
10659 algorithm
10660 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("String stringInputVariables["));
10661 ✗ txt := Tpl.writeText(txt, a_nStringInputVariables);
10662 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("];"));
10663 then txt;
10664
10665 case ( txt,
10666 _,
10667 _ )
10668 then txt;
10669 end match;
10670 end fun_333;
10671
10672 protected function fun_334
10673 input Tpl.Text in_txt;
10674 input Boolean in_mArg;
10675 input Tpl.Text in_a_stringInputVariablesReturnNames;
10676
10677 output Tpl.Text out_txt;
10678 algorithm
10679 out_txt :=
10680 match(in_txt, in_mArg, in_a_stringInputVariablesReturnNames)
10681 local
10682 Tpl.Text txt;
10683 Tpl.Text a_stringInputVariablesReturnNames;
10684
10685 case ( txt,
10686 false,
10687 a_stringInputVariablesReturnNames )
10688 algorithm
10689 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("String "));
10690 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesReturnNames);
10691 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
10692 then txt;
10693
10694 case ( txt,
10695 _,
10696 _ )
10697 then txt;
10698 end match;
10699 end fun_334;
10700
10701 protected function fun_335
10702 input Tpl.Text in_txt;
10703 input Boolean in_mArg;
10704 input Tpl.Text in_a_nRealEventInputVariables;
10705
10706 output Tpl.Text out_txt;
10707 algorithm
10708 out_txt :=
10709 match(in_txt, in_mArg, in_a_nRealEventInputVariables)
10710 local
10711 Tpl.Text txt;
10712 Tpl.Text a_nRealEventInputVariables;
10713
10714 case ( txt,
10715 false,
10716 a_nRealEventInputVariables )
10717 algorithm
10718 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Real realEventInputVariables["));
10719 3 txt := Tpl.writeText(txt, a_nRealEventInputVariables);
10720 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("](each fixed=true);"));
10721 then txt;
10722
10723 case ( txt,
10724 _,
10725 _ )
10726 then txt;
10727 end match;
10728 end fun_335;
10729
10730 protected function fun_336
10731 input Tpl.Text in_txt;
10732 input Boolean in_mArg;
10733 input Tpl.Text in_a_nIntegerEventInputVariables;
10734
10735 output Tpl.Text out_txt;
10736 algorithm
10737 out_txt :=
10738 match(in_txt, in_mArg, in_a_nIntegerEventInputVariables)
10739 local
10740 Tpl.Text txt;
10741 Tpl.Text a_nIntegerEventInputVariables;
10742
10743 case ( txt,
10744 false,
10745 a_nIntegerEventInputVariables )
10746 algorithm
10747 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Integer integerEventInputVariables["));
10748 ✗ txt := Tpl.writeText(txt, a_nIntegerEventInputVariables);
10749 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("](each fixed=true);"));
10750 then txt;
10751
10752 case ( txt,
10753 _,
10754 _ )
10755 then txt;
10756 end match;
10757 end fun_336;
10758
10759 protected function fun_337
10760 input Tpl.Text in_txt;
10761 input Boolean in_mArg;
10762 input Tpl.Text in_a_nBooleanEventInputVariables;
10763
10764 output Tpl.Text out_txt;
10765 algorithm
10766 out_txt :=
10767 match(in_txt, in_mArg, in_a_nBooleanEventInputVariables)
10768 local
10769 Tpl.Text txt;
10770 Tpl.Text a_nBooleanEventInputVariables;
10771
10772 case ( txt,
10773 false,
10774 a_nBooleanEventInputVariables )
10775 algorithm
10776 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Boolean booleanEventInputVariables["));
10777 ✗ txt := Tpl.writeText(txt, a_nBooleanEventInputVariables);
10778 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("](each fixed=true);"));
10779 then txt;
10780
10781 case ( txt,
10782 _,
10783 _ )
10784 then txt;
10785 end match;
10786 end fun_337;
10787
10788 protected function fun_338
10789 input Tpl.Text in_txt;
10790 input Boolean in_mArg;
10791 input Tpl.Text in_a_nStringEventInputVariables;
10792
10793 output Tpl.Text out_txt;
10794 algorithm
10795 out_txt :=
10796 match(in_txt, in_mArg, in_a_nStringEventInputVariables)
10797 local
10798 Tpl.Text txt;
10799 Tpl.Text a_nStringEventInputVariables;
10800
10801 case ( txt,
10802 false,
10803 a_nStringEventInputVariables )
10804 algorithm
10805 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("String stringEventInputVariables["));
10806 ✗ txt := Tpl.writeText(txt, a_nStringEventInputVariables);
10807 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("](each fixed=true);"));
10808 then txt;
10809
10810 case ( txt,
10811 _,
10812 _ )
10813 then txt;
10814 end match;
10815 end fun_338;
10816
10817 protected function fun_339
10818 input Tpl.Text in_txt;
10819 input Boolean in_mArg;
10820
10821 output Tpl.Text out_txt;
10822 algorithm
10823 out_txt :=
10824 match(in_txt, in_mArg)
10825 local
10826 Tpl.Text txt;
10827
10828 case ( txt,
10829 false )
10830 then txt;
10831
10832 case ( txt,
10833 _ )
10834 algorithm
10835 11 txt := Tpl.writeTok(txt, Tpl.ST_STRING("fmi_x = fmi2Functions.fmi2GetContinuousStates(fmi2me, numberOfContinuousStates, flowParamsStart+flowInitialized);"));
10836 then txt;
10837 end match;
10838 end fun_339;
10839
10840 protected function fun_340
10841 input Tpl.Text in_txt;
10842 input Boolean in_mArg;
10843 input Tpl.Text in_a_realParametersNames;
10844 input Tpl.Text in_a_realParametersVRs;
10845
10846 output Tpl.Text out_txt;
10847 algorithm
10848 out_txt :=
10849 match(in_txt, in_mArg, in_a_realParametersNames, in_a_realParametersVRs)
10850 local
10851 Tpl.Text txt;
10852 Tpl.Text a_realParametersNames;
10853 Tpl.Text a_realParametersVRs;
10854
10855 case ( txt,
10856 false,
10857 a_realParametersNames,
10858 a_realParametersVRs )
10859 algorithm
10860 9 txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi2Functions.fmi2SetRealParameter(fmi2me, {"));
10861 9 txt := Tpl.writeText(txt, a_realParametersVRs);
10862 9 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
10863 9 txt := Tpl.writeText(txt, a_realParametersNames);
10864 9 txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
10865 then txt;
10866
10867 case ( txt,
10868 _,
10869 _,
10870 _ )
10871 then txt;
10872 end match;
10873 end fun_340;
10874
10875 protected function fun_341
10876 input Tpl.Text in_txt;
10877 input Boolean in_mArg;
10878 input Tpl.Text in_a_integerParametersNames;
10879 input Tpl.Text in_a_integerParametersVRs;
10880
10881 output Tpl.Text out_txt;
10882 algorithm
10883 out_txt :=
10884 match(in_txt, in_mArg, in_a_integerParametersNames, in_a_integerParametersVRs)
10885 local
10886 Tpl.Text txt;
10887 Tpl.Text a_integerParametersNames;
10888 Tpl.Text a_integerParametersVRs;
10889
10890 case ( txt,
10891 false,
10892 a_integerParametersNames,
10893 a_integerParametersVRs )
10894 algorithm
10895 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi2Functions.fmi2SetIntegerParameter(fmi2me, {"));
10896 2 txt := Tpl.writeText(txt, a_integerParametersVRs);
10897 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
10898 2 txt := Tpl.writeText(txt, a_integerParametersNames);
10899 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
10900 then txt;
10901
10902 case ( txt,
10903 _,
10904 _,
10905 _ )
10906 then txt;
10907 end match;
10908 end fun_341;
10909
10910 protected function fun_342
10911 input Tpl.Text in_txt;
10912 input Boolean in_mArg;
10913 input Tpl.Text in_a_booleanParametersNames;
10914 input Tpl.Text in_a_booleanParametersVRs;
10915
10916 output Tpl.Text out_txt;
10917 algorithm
10918 out_txt :=
10919 match(in_txt, in_mArg, in_a_booleanParametersNames, in_a_booleanParametersVRs)
10920 local
10921 Tpl.Text txt;
10922 Tpl.Text a_booleanParametersNames;
10923 Tpl.Text a_booleanParametersVRs;
10924
10925 case ( txt,
10926 false,
10927 a_booleanParametersNames,
10928 a_booleanParametersVRs )
10929 algorithm
10930 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi2Functions.fmi2SetBooleanParameter(fmi2me, {"));
10931 4 txt := Tpl.writeText(txt, a_booleanParametersVRs);
10932 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
10933 4 txt := Tpl.writeText(txt, a_booleanParametersNames);
10934 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
10935 then txt;
10936
10937 case ( txt,
10938 _,
10939 _,
10940 _ )
10941 then txt;
10942 end match;
10943 end fun_342;
10944
10945 protected function fun_343
10946 input Tpl.Text in_txt;
10947 input Boolean in_mArg;
10948 input Tpl.Text in_a_stringParametersNames;
10949 input Tpl.Text in_a_stringParametersVRs;
10950
10951 output Tpl.Text out_txt;
10952 algorithm
10953 out_txt :=
10954 match(in_txt, in_mArg, in_a_stringParametersNames, in_a_stringParametersVRs)
10955 local
10956 Tpl.Text txt;
10957 Tpl.Text a_stringParametersNames;
10958 Tpl.Text a_stringParametersVRs;
10959
10960 case ( txt,
10961 false,
10962 a_stringParametersNames,
10963 a_stringParametersVRs )
10964 algorithm
10965 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi2Functions.fmi2SetStringParameter(fmi2me, {"));
10966 3 txt := Tpl.writeText(txt, a_stringParametersVRs);
10967 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
10968 3 txt := Tpl.writeText(txt, a_stringParametersNames);
10969 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
10970 then txt;
10971
10972 case ( txt,
10973 _,
10974 _,
10975 _ )
10976 then txt;
10977 end match;
10978 end fun_343;
10979
10980 protected function fun_344
10981 input Tpl.Text in_txt;
10982 input Boolean in_mArg;
10983 input Tpl.Text in_a_realDependentParametersVRs;
10984 input Tpl.Text in_a_realDependentParametersNames;
10985
10986 output Tpl.Text out_txt;
10987 algorithm
10988 out_txt :=
10989 match(in_txt, in_mArg, in_a_realDependentParametersVRs, in_a_realDependentParametersNames)
10990 local
10991 Tpl.Text txt;
10992 Tpl.Text a_realDependentParametersVRs;
10993 Tpl.Text a_realDependentParametersNames;
10994
10995 case ( txt,
10996 false,
10997 a_realDependentParametersVRs,
10998 a_realDependentParametersNames )
10999 algorithm
11000 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11001 ✗ txt := Tpl.writeText(txt, a_realDependentParametersNames);
11002 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi2Functions.fmi2GetReal(fmi2me, {"));
11003 ✗ txt := Tpl.writeText(txt, a_realDependentParametersVRs);
11004 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
11005 then txt;
11006
11007 case ( txt,
11008 _,
11009 _,
11010 _ )
11011 then txt;
11012 end match;
11013 end fun_344;
11014
11015 protected function fun_345
11016 input Tpl.Text in_txt;
11017 input Boolean in_mArg;
11018 input Tpl.Text in_a_integerDependentParametersVRs;
11019 input Tpl.Text in_a_integerDependentParametersNames;
11020
11021 output Tpl.Text out_txt;
11022 algorithm
11023 out_txt :=
11024 match(in_txt, in_mArg, in_a_integerDependentParametersVRs, in_a_integerDependentParametersNames)
11025 local
11026 Tpl.Text txt;
11027 Tpl.Text a_integerDependentParametersVRs;
11028 Tpl.Text a_integerDependentParametersNames;
11029
11030 case ( txt,
11031 false,
11032 a_integerDependentParametersVRs,
11033 a_integerDependentParametersNames )
11034 algorithm
11035 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11036 ✗ txt := Tpl.writeText(txt, a_integerDependentParametersNames);
11037 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi2Functions.fmi2GetInteger(fmi2me, {"));
11038 ✗ txt := Tpl.writeText(txt, a_integerDependentParametersVRs);
11039 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
11040 then txt;
11041
11042 case ( txt,
11043 _,
11044 _,
11045 _ )
11046 then txt;
11047 end match;
11048 end fun_345;
11049
11050 protected function fun_346
11051 input Tpl.Text in_txt;
11052 input Boolean in_mArg;
11053 input Tpl.Text in_a_booleanDependentParametersVRs;
11054 input Tpl.Text in_a_booleanDependentParametersNames;
11055
11056 output Tpl.Text out_txt;
11057 algorithm
11058 out_txt :=
11059 match(in_txt, in_mArg, in_a_booleanDependentParametersVRs, in_a_booleanDependentParametersNames)
11060 local
11061 Tpl.Text txt;
11062 Tpl.Text a_booleanDependentParametersVRs;
11063 Tpl.Text a_booleanDependentParametersNames;
11064
11065 case ( txt,
11066 false,
11067 a_booleanDependentParametersVRs,
11068 a_booleanDependentParametersNames )
11069 algorithm
11070 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11071 ✗ txt := Tpl.writeText(txt, a_booleanDependentParametersNames);
11072 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi2Functions.fmi2GetBoolean(fmi2me, {"));
11073 ✗ txt := Tpl.writeText(txt, a_booleanDependentParametersVRs);
11074 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
11075 then txt;
11076
11077 case ( txt,
11078 _,
11079 _,
11080 _ )
11081 then txt;
11082 end match;
11083 end fun_346;
11084
11085 protected function fun_347
11086 input Tpl.Text in_txt;
11087 input Boolean in_mArg;
11088 input Tpl.Text in_a_stringDependentParametersVRs;
11089 input Tpl.Text in_a_stringDependentParametersNames;
11090
11091 output Tpl.Text out_txt;
11092 algorithm
11093 out_txt :=
11094 match(in_txt, in_mArg, in_a_stringDependentParametersVRs, in_a_stringDependentParametersNames)
11095 local
11096 Tpl.Text txt;
11097 Tpl.Text a_stringDependentParametersVRs;
11098 Tpl.Text a_stringDependentParametersNames;
11099
11100 case ( txt,
11101 false,
11102 a_stringDependentParametersVRs,
11103 a_stringDependentParametersNames )
11104 algorithm
11105 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11106 ✗ txt := Tpl.writeText(txt, a_stringDependentParametersNames);
11107 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi2Functions.fmi2GetString(fmi2me, {"));
11108 ✗ txt := Tpl.writeText(txt, a_stringDependentParametersVRs);
11109 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
11110 then txt;
11111
11112 case ( txt,
11113 _,
11114 _,
11115 _ )
11116 then txt;
11117 end match;
11118 end fun_347;
11119
11120 protected function fun_348
11121 input Tpl.Text in_txt;
11122 input Boolean in_mArg;
11123 input Tpl.Text in_a_realInputVariablesNames;
11124 input Tpl.Text in_a_realInputVariablesVRs;
11125
11126 output Tpl.Text out_txt;
11127 algorithm
11128 out_txt :=
11129 match(in_txt, in_mArg, in_a_realInputVariablesNames, in_a_realInputVariablesVRs)
11130 local
11131 Tpl.Text txt;
11132 Tpl.Text a_realInputVariablesNames;
11133 Tpl.Text a_realInputVariablesVRs;
11134
11135 case ( txt,
11136 false,
11137 a_realInputVariablesNames,
11138 a_realInputVariablesVRs )
11139 algorithm
11140 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("realInputVariables := fmi2Functions.fmi2SetReal(fmi2me, {"));
11141 3 txt := Tpl.writeText(txt, a_realInputVariablesVRs);
11142 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
11143 3 txt := Tpl.writeText(txt, a_realInputVariablesNames);
11144 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
11145 then txt;
11146
11147 case ( txt,
11148 _,
11149 _,
11150 _ )
11151 then txt;
11152 end match;
11153 end fun_348;
11154
11155 protected function fun_349
11156 input Tpl.Text in_txt;
11157 input Boolean in_mArg;
11158 input Tpl.Text in_a_integerInputVariablesNames;
11159 input Tpl.Text in_a_integerInputVariablesVRs;
11160
11161 output Tpl.Text out_txt;
11162 algorithm
11163 out_txt :=
11164 match(in_txt, in_mArg, in_a_integerInputVariablesNames, in_a_integerInputVariablesVRs)
11165 local
11166 Tpl.Text txt;
11167 Tpl.Text a_integerInputVariablesNames;
11168 Tpl.Text a_integerInputVariablesVRs;
11169
11170 case ( txt,
11171 false,
11172 a_integerInputVariablesNames,
11173 a_integerInputVariablesVRs )
11174 algorithm
11175 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("integerInputVariables := fmi2Functions.fmi2SetInteger(fmi2me, {"));
11176 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesVRs);
11177 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
11178 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesNames);
11179 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
11180 then txt;
11181
11182 case ( txt,
11183 _,
11184 _,
11185 _ )
11186 then txt;
11187 end match;
11188 end fun_349;
11189
11190 protected function fun_350
11191 input Tpl.Text in_txt;
11192 input Boolean in_mArg;
11193 input Tpl.Text in_a_booleanInputVariablesNames;
11194 input Tpl.Text in_a_booleanInputVariablesVRs;
11195
11196 output Tpl.Text out_txt;
11197 algorithm
11198 out_txt :=
11199 match(in_txt, in_mArg, in_a_booleanInputVariablesNames, in_a_booleanInputVariablesVRs)
11200 local
11201 Tpl.Text txt;
11202 Tpl.Text a_booleanInputVariablesNames;
11203 Tpl.Text a_booleanInputVariablesVRs;
11204
11205 case ( txt,
11206 false,
11207 a_booleanInputVariablesNames,
11208 a_booleanInputVariablesVRs )
11209 algorithm
11210 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("booleanInputVariables := fmi2Functions.fmi2SetBoolean(fmi2me, {"));
11211 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesVRs);
11212 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
11213 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesNames);
11214 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
11215 then txt;
11216
11217 case ( txt,
11218 _,
11219 _,
11220 _ )
11221 then txt;
11222 end match;
11223 end fun_350;
11224
11225 protected function fun_351
11226 input Tpl.Text in_txt;
11227 input Boolean in_mArg;
11228 input Tpl.Text in_a_stringStartVariablesNames;
11229 input Tpl.Text in_a_stringInputVariablesVRs;
11230
11231 output Tpl.Text out_txt;
11232 algorithm
11233 out_txt :=
11234 match(in_txt, in_mArg, in_a_stringStartVariablesNames, in_a_stringInputVariablesVRs)
11235 local
11236 Tpl.Text txt;
11237 Tpl.Text a_stringStartVariablesNames;
11238 Tpl.Text a_stringInputVariablesVRs;
11239
11240 case ( txt,
11241 false,
11242 a_stringStartVariablesNames,
11243 a_stringInputVariablesVRs )
11244 algorithm
11245 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("stringInputVariables := fmi2Functions.fmi2SetString(fmi2me, {"));
11246 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesVRs);
11247 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
11248 ✗ txt := Tpl.writeText(txt, a_stringStartVariablesNames);
11249 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
11250 then txt;
11251
11252 case ( txt,
11253 _,
11254 _,
11255 _ )
11256 then txt;
11257 end match;
11258 end fun_351;
11259
11260 protected function fun_352
11261 input Tpl.Text in_txt;
11262 input Boolean in_mArg;
11263 input Tpl.Text in_a_realInputVariablesReturnNames;
11264
11265 output Tpl.Text out_txt;
11266 algorithm
11267 out_txt :=
11268 match(in_txt, in_mArg, in_a_realInputVariablesReturnNames)
11269 local
11270 Tpl.Text txt;
11271 Tpl.Text a_realInputVariablesReturnNames;
11272
11273 case ( txt,
11274 false,
11275 a_realInputVariablesReturnNames )
11276 algorithm
11277 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11278 3 txt := Tpl.writeText(txt, a_realInputVariablesReturnNames);
11279 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = realInputVariables;"));
11280 then txt;
11281
11282 case ( txt,
11283 _,
11284 _ )
11285 then txt;
11286 end match;
11287 end fun_352;
11288
11289 protected function fun_353
11290 input Tpl.Text in_txt;
11291 input Boolean in_mArg;
11292 input Tpl.Text in_a_integerInputVariablesReturnNames;
11293
11294 output Tpl.Text out_txt;
11295 algorithm
11296 out_txt :=
11297 match(in_txt, in_mArg, in_a_integerInputVariablesReturnNames)
11298 local
11299 Tpl.Text txt;
11300 Tpl.Text a_integerInputVariablesReturnNames;
11301
11302 case ( txt,
11303 false,
11304 a_integerInputVariablesReturnNames )
11305 algorithm
11306 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11307 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesReturnNames);
11308 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = integerInputVariables;"));
11309 then txt;
11310
11311 case ( txt,
11312 _,
11313 _ )
11314 then txt;
11315 end match;
11316 end fun_353;
11317
11318 protected function fun_354
11319 input Tpl.Text in_txt;
11320 input Boolean in_mArg;
11321 input Tpl.Text in_a_booleanInputVariablesReturnNames;
11322
11323 output Tpl.Text out_txt;
11324 algorithm
11325 out_txt :=
11326 match(in_txt, in_mArg, in_a_booleanInputVariablesReturnNames)
11327 local
11328 Tpl.Text txt;
11329 Tpl.Text a_booleanInputVariablesReturnNames;
11330
11331 case ( txt,
11332 false,
11333 a_booleanInputVariablesReturnNames )
11334 algorithm
11335 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11336 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesReturnNames);
11337 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = booleanInputVariables;"));
11338 then txt;
11339
11340 case ( txt,
11341 _,
11342 _ )
11343 then txt;
11344 end match;
11345 end fun_354;
11346
11347 protected function fun_355
11348 input Tpl.Text in_txt;
11349 input Boolean in_mArg;
11350 input Tpl.Text in_a_stringInputVariablesReturnNames;
11351
11352 output Tpl.Text out_txt;
11353 algorithm
11354 out_txt :=
11355 match(in_txt, in_mArg, in_a_stringInputVariablesReturnNames)
11356 local
11357 Tpl.Text txt;
11358 Tpl.Text a_stringInputVariablesReturnNames;
11359
11360 case ( txt,
11361 false,
11362 a_stringInputVariablesReturnNames )
11363 algorithm
11364 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11365 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesReturnNames);
11366 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = stringInputVariables;"));
11367 then txt;
11368
11369 case ( txt,
11370 _,
11371 _ )
11372 then txt;
11373 end match;
11374 end fun_355;
11375
11376 protected function fun_356
11377 input Tpl.Text in_txt;
11378 input Boolean in_mArg;
11379 input Tpl.Text in_a_realOutputVariablesVRs;
11380 input Tpl.Text in_a_realOutputVariablesNames;
11381
11382 output Tpl.Text out_txt;
11383 algorithm
11384 out_txt :=
11385 match(in_txt, in_mArg, in_a_realOutputVariablesVRs, in_a_realOutputVariablesNames)
11386 local
11387 Tpl.Text txt;
11388 Tpl.Text a_realOutputVariablesVRs;
11389 Tpl.Text a_realOutputVariablesNames;
11390
11391 case ( txt,
11392 false,
11393 a_realOutputVariablesVRs,
11394 a_realOutputVariablesNames )
11395 algorithm
11396 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11397 14 txt := Tpl.writeText(txt, a_realOutputVariablesNames);
11398 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi2Functions.fmi2GetReal(fmi2me, {"));
11399 14 txt := Tpl.writeText(txt, a_realOutputVariablesVRs);
11400 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
11401 then txt;
11402
11403 case ( txt,
11404 _,
11405 _,
11406 _ )
11407 then txt;
11408 end match;
11409 end fun_356;
11410
11411 protected function fun_357
11412 input Tpl.Text in_txt;
11413 input Boolean in_mArg;
11414 input Tpl.Text in_a_integerOutputVariablesVRs;
11415 input Tpl.Text in_a_integerOutputVariablesNames;
11416
11417 output Tpl.Text out_txt;
11418 algorithm
11419 out_txt :=
11420 match(in_txt, in_mArg, in_a_integerOutputVariablesVRs, in_a_integerOutputVariablesNames)
11421 local
11422 Tpl.Text txt;
11423 Tpl.Text a_integerOutputVariablesVRs;
11424 Tpl.Text a_integerOutputVariablesNames;
11425
11426 case ( txt,
11427 false,
11428 a_integerOutputVariablesVRs,
11429 a_integerOutputVariablesNames )
11430 algorithm
11431 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11432 4 txt := Tpl.writeText(txt, a_integerOutputVariablesNames);
11433 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi2Functions.fmi2GetInteger(fmi2me, {"));
11434 4 txt := Tpl.writeText(txt, a_integerOutputVariablesVRs);
11435 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
11436 then txt;
11437
11438 case ( txt,
11439 _,
11440 _,
11441 _ )
11442 then txt;
11443 end match;
11444 end fun_357;
11445
11446 protected function fun_358
11447 input Tpl.Text in_txt;
11448 input Boolean in_mArg;
11449 input Tpl.Text in_a_booleanOutputVariablesVRs;
11450 input Tpl.Text in_a_booleanOutputVariablesNames;
11451
11452 output Tpl.Text out_txt;
11453 algorithm
11454 out_txt :=
11455 match(in_txt, in_mArg, in_a_booleanOutputVariablesVRs, in_a_booleanOutputVariablesNames)
11456 local
11457 Tpl.Text txt;
11458 Tpl.Text a_booleanOutputVariablesVRs;
11459 Tpl.Text a_booleanOutputVariablesNames;
11460
11461 case ( txt,
11462 false,
11463 a_booleanOutputVariablesVRs,
11464 a_booleanOutputVariablesNames )
11465 algorithm
11466 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11467 3 txt := Tpl.writeText(txt, a_booleanOutputVariablesNames);
11468 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi2Functions.fmi2GetBoolean(fmi2me, {"));
11469 3 txt := Tpl.writeText(txt, a_booleanOutputVariablesVRs);
11470 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
11471 then txt;
11472
11473 case ( txt,
11474 _,
11475 _,
11476 _ )
11477 then txt;
11478 end match;
11479 end fun_358;
11480
11481 protected function fun_359
11482 input Tpl.Text in_txt;
11483 input Boolean in_mArg;
11484 input Tpl.Text in_a_stringOutputVariablesVRs;
11485 input Tpl.Text in_a_stringOutputVariablesNames;
11486
11487 output Tpl.Text out_txt;
11488 algorithm
11489 out_txt :=
11490 match(in_txt, in_mArg, in_a_stringOutputVariablesVRs, in_a_stringOutputVariablesNames)
11491 local
11492 Tpl.Text txt;
11493 Tpl.Text a_stringOutputVariablesVRs;
11494 Tpl.Text a_stringOutputVariablesNames;
11495
11496 case ( txt,
11497 false,
11498 a_stringOutputVariablesVRs,
11499 a_stringOutputVariablesNames )
11500 algorithm
11501 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
11502 1 txt := Tpl.writeText(txt, a_stringOutputVariablesNames);
11503 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi2Functions.fmi2GetString(fmi2me, {"));
11504 1 txt := Tpl.writeText(txt, a_stringOutputVariablesVRs);
11505 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
11506 then txt;
11507
11508 case ( txt,
11509 _,
11510 _,
11511 _ )
11512 then txt;
11513 end match;
11514 end fun_359;
11515
11516 protected function lm_360
11517 input output Tpl.Text txt;
11518 input list<Integer> items;
11519 algorithm
11520
2/2
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 4 times.
14 for lstElt_360 in items loop
11521 txt := match lstElt_360
11522 local
11523 Integer i_eventIndicator;
11524
11525 case i_eventIndicator
11526 algorithm
11527 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING("change(fmi_z_positive["));
11528 10 txt := Tpl.writeStr(txt, intString(i_eventIndicator));
11529 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING("])"));
11530 10 txt := Tpl.nextIter(txt);
11531 then txt;
11532 end match;
11533 end for;
11534 end lm_360;
11535
11536 protected function fun_361
11537 input Tpl.Text in_txt;
11538 input Boolean in_mArg;
11539 input list<Integer> in_a_fmiInfo_fmiNumberOfEventIndicators;
11540
11541 output Tpl.Text out_txt;
11542 algorithm
11543 out_txt :=
11544 match(in_txt, in_mArg, in_a_fmiInfo_fmiNumberOfEventIndicators)
11545 local
11546 Tpl.Text txt;
11547 list<Integer> a_fmiInfo_fmiNumberOfEventIndicators;
11548
11549 case ( txt,
11550 false,
11551 _ )
11552 algorithm
11553 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" when {triggerDSSEvent > flowStatesInputs, pre(nextEventTime) < time, terminal()} then"));
11554 then txt;
11555
11556 case ( txt,
11557 _,
11558 a_fmiInfo_fmiNumberOfEventIndicators )
11559 algorithm
11560 4 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
11561 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("when {"));
11562 4 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(" or ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
11563 4 txt := lm_360(txt, a_fmiInfo_fmiNumberOfEventIndicators);
11564 4 txt := Tpl.popIter(txt);
11565 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", triggerDSSEvent > flowStatesInputs, pre(nextEventTime) < time, terminal()} then"));
11566 4 txt := Tpl.popBlock(txt);
11567 then txt;
11568 end match;
11569 end fun_361;
11570
11571 protected function fun_362
11572 input Tpl.Text in_txt;
11573 input Boolean in_mArg;
11574 input Tpl.Text in_a_realEventInputVariablesNames;
11575 input Tpl.Text in_a_realEventInputVariablesVRs;
11576
11577 output Tpl.Text out_txt;
11578 algorithm
11579 out_txt :=
11580 match(in_txt, in_mArg, in_a_realEventInputVariablesNames, in_a_realEventInputVariablesVRs)
11581 local
11582 Tpl.Text txt;
11583 Tpl.Text a_realEventInputVariablesNames;
11584 Tpl.Text a_realEventInputVariablesVRs;
11585
11586 case ( txt,
11587 false,
11588 a_realEventInputVariablesNames,
11589 a_realEventInputVariablesVRs )
11590 algorithm
11591 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("realEventInputVariables := fmi2Functions.fmi2SetReal(fmi2me, {"));
11592 3 txt := Tpl.writeText(txt, a_realEventInputVariablesVRs);
11593 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
11594 3 txt := Tpl.writeText(txt, a_realEventInputVariablesNames);
11595 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
11596 then txt;
11597
11598 case ( txt,
11599 _,
11600 _,
11601 _ )
11602 then txt;
11603 end match;
11604 end fun_362;
11605
11606 protected function fun_363
11607 input Tpl.Text in_txt;
11608 input Boolean in_mArg;
11609 input Tpl.Text in_a_integerEventInputVariablesNames;
11610 input Tpl.Text in_a_integerEventInputVariablesVRs;
11611
11612 output Tpl.Text out_txt;
11613 algorithm
11614 out_txt :=
11615 match(in_txt, in_mArg, in_a_integerEventInputVariablesNames, in_a_integerEventInputVariablesVRs)
11616 local
11617 Tpl.Text txt;
11618 Tpl.Text a_integerEventInputVariablesNames;
11619 Tpl.Text a_integerEventInputVariablesVRs;
11620
11621 case ( txt,
11622 false,
11623 a_integerEventInputVariablesNames,
11624 a_integerEventInputVariablesVRs )
11625 algorithm
11626 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("integerEventInputVariables := fmi2Functions.fmi2SetInteger(fmi2me, {"));
11627 ✗ txt := Tpl.writeText(txt, a_integerEventInputVariablesVRs);
11628 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
11629 ✗ txt := Tpl.writeText(txt, a_integerEventInputVariablesNames);
11630 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
11631 then txt;
11632
11633 case ( txt,
11634 _,
11635 _,
11636 _ )
11637 then txt;
11638 end match;
11639 end fun_363;
11640
11641 protected function fun_364
11642 input Tpl.Text in_txt;
11643 input Boolean in_mArg;
11644 input Tpl.Text in_a_booleanEventInputVariablesNames;
11645 input Tpl.Text in_a_booleanEventInputVariablesVRs;
11646
11647 output Tpl.Text out_txt;
11648 algorithm
11649 out_txt :=
11650 match(in_txt, in_mArg, in_a_booleanEventInputVariablesNames, in_a_booleanEventInputVariablesVRs)
11651 local
11652 Tpl.Text txt;
11653 Tpl.Text a_booleanEventInputVariablesNames;
11654 Tpl.Text a_booleanEventInputVariablesVRs;
11655
11656 case ( txt,
11657 false,
11658 a_booleanEventInputVariablesNames,
11659 a_booleanEventInputVariablesVRs )
11660 algorithm
11661 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("booleanEventInputVariables := fmi2Functions.fmi2SetBoolean(fmi2me, {"));
11662 ✗ txt := Tpl.writeText(txt, a_booleanEventInputVariablesVRs);
11663 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
11664 ✗ txt := Tpl.writeText(txt, a_booleanEventInputVariablesNames);
11665 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
11666 then txt;
11667
11668 case ( txt,
11669 _,
11670 _,
11671 _ )
11672 then txt;
11673 end match;
11674 end fun_364;
11675
11676 protected function fun_365
11677 input Tpl.Text in_txt;
11678 input Boolean in_mArg;
11679 input Tpl.Text in_a_stringEventStartVariablesNames;
11680 input Tpl.Text in_a_stringEventInputVariablesVRs;
11681
11682 output Tpl.Text out_txt;
11683 algorithm
11684 out_txt :=
11685 match(in_txt, in_mArg, in_a_stringEventStartVariablesNames, in_a_stringEventInputVariablesVRs)
11686 local
11687 Tpl.Text txt;
11688 Tpl.Text a_stringEventStartVariablesNames;
11689 Tpl.Text a_stringEventInputVariablesVRs;
11690
11691 case ( txt,
11692 false,
11693 a_stringEventStartVariablesNames,
11694 a_stringEventInputVariablesVRs )
11695 algorithm
11696 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("stringEventInputVariables := fmi2Functions.fmi2SetString(fmi2me, {"));
11697 ✗ txt := Tpl.writeText(txt, a_stringEventInputVariablesVRs);
11698 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
11699 ✗ txt := Tpl.writeText(txt, a_stringEventStartVariablesNames);
11700 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
11701 then txt;
11702
11703 case ( txt,
11704 _,
11705 _,
11706 _ )
11707 then txt;
11708 end match;
11709 end fun_365;
11710
11711 protected function lm_366
11712 input output Tpl.Text txt;
11713 input list<Integer> items;
11714 algorithm
11715
2/2
✓ Branch 0 taken 19 times.
✓ Branch 1 taken 11 times.
30 for lstElt_366 in items loop
11716 txt := match lstElt_366
11717 local
11718 Integer i_continuousStates;
11719
11720 case i_continuousStates
11721 algorithm
11722 19 txt := Tpl.writeTok(txt, Tpl.ST_STRING("reinit(fmi_x["));
11723 19 txt := Tpl.writeStr(txt, intString(i_continuousStates));
11724 19 txt := Tpl.writeTok(txt, Tpl.ST_STRING("], fmi_x_new["));
11725 19 txt := Tpl.writeStr(txt, intString(i_continuousStates));
11726 19 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]);"));
11727 19 txt := Tpl.nextIter(txt);
11728 then txt;
11729 end match;
11730 end for;
11731 end lm_366;
11732
11733 protected function fun_367
11734 input Tpl.Text in_txt;
11735 input Boolean in_mArg;
11736 input list<Integer> in_a_fmiInfo_fmiNumberOfContinuousStates;
11737
11738 output Tpl.Text out_txt;
11739 algorithm
11740 out_txt :=
11741 match(in_txt, in_mArg, in_a_fmiInfo_fmiNumberOfContinuousStates)
11742 local
11743 Tpl.Text txt;
11744 list<Integer> a_fmiInfo_fmiNumberOfContinuousStates;
11745
11746 case ( txt,
11747 false,
11748 _ )
11749 then txt;
11750
11751 case ( txt,
11752 _,
11753 a_fmiInfo_fmiNumberOfContinuousStates )
11754 algorithm
11755 11 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
11756 " if newStatesAvailable then\n",
11757 " fmi_x_new := fmi2Functions.fmi2GetContinuousStates(fmi2me, numberOfContinuousStates, flowStatesInputs);\n"
11758 }, true));
11759 11 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(6));
11760 11 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
11761 11 txt := lm_366(txt, a_fmiInfo_fmiNumberOfContinuousStates);
11762 11 txt := Tpl.popIter(txt);
11763 11 txt := Tpl.softNewLine(txt);
11764 11 txt := Tpl.popBlock(txt);
11765 11 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" end if;"));
11766 then txt;
11767 end match;
11768 end fun_367;
11769
11770 protected function fun_368
11771 input Tpl.Text in_txt;
11772 input Boolean in_mArg;
11773 input FMI.Info in_a_fmiInfo;
11774 input String in_a_fmiInfo_fmiModelIdentifier;
11775 input String in_a_name;
11776
11777 output Tpl.Text out_txt;
11778 algorithm
11779 out_txt :=
11780 match(in_txt, in_mArg, in_a_fmiInfo, in_a_fmiInfo_fmiModelIdentifier, in_a_name)
11781 local
11782 Tpl.Text txt;
11783 FMI.Info a_fmiInfo;
11784 String a_fmiInfo_fmiModelIdentifier;
11785 String a_name;
11786 String ret_0;
11787
11788 case ( txt,
11789 false,
11790 _,
11791 _,
11792 a_name )
11793 algorithm
11794 ✗ txt := Tpl.writeStr(txt, a_name);
11795 then txt;
11796
11797 case ( txt,
11798 _,
11799 a_fmiInfo,
11800 a_fmiInfo_fmiModelIdentifier,
11801 _ )
11802 algorithm
11803 14 txt := Tpl.writeStr(txt, a_fmiInfo_fmiModelIdentifier);
11804 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
11805 14 ret_0 := FMI.getFMIType(a_fmiInfo);
11806 14 txt := Tpl.writeStr(txt, ret_0);
11807 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_FMU"));
11808 then txt;
11809 end match;
11810 end fun_368;
11811
11812 public function importFMU2ModelExchange
11813 input Tpl.Text in_txt;
11814 input FMI.FmiImport in_a_fmi;
11815 input String in_a_name;
11816
11817 output Tpl.Text out_txt;
11818 algorithm
11819 out_txt :=
11820 match(in_txt, in_a_fmi, in_a_name)
11821 local
11822 Tpl.Text txt;
11823 String a_name;
11824 Real i_fmiExperimentAnnotation_fmiExperimentTolerance;
11825 Real i_fmiExperimentAnnotation_fmiExperimentStopTime;
11826 Real i_fmiExperimentAnnotation_fmiExperimentStartTime;
11827 list<Integer> i_fmiInfo_fmiNumberOfEventIndicators;
11828 list<Integer> i_fmiInfo_fmiNumberOfContinuousStates;
11829 Boolean i_generateOutputConnectors;
11830 Boolean i_generateInputConnectors;
11831 Boolean i_fmiDebugOutput;
11832 Integer i_fmiLogLevel;
11833 String i_fmuWorkingDirectory;
11834 list<FMI.TypeDefinitions> i_fmiTypeDefinitionsList;
11835 String i_fmiInfo_fmiDescription;
11836 FMI.Info i_fmiInfo;
11837 String i_fmiInfo_fmiModelIdentifier;
11838 list<FMI.ModelVariables> i_fmiModelVariablesList;
11839 Boolean ret_126;
11840 Boolean ret_125;
11841 Integer ret_124;
11842 Boolean ret_123;
11843 Boolean ret_122;
11844 Boolean ret_121;
11845 Boolean ret_120;
11846 Boolean ret_119;
11847 Integer ret_118;
11848 Boolean ret_117;
11849 Boolean ret_116;
11850 Boolean ret_115;
11851 Boolean ret_114;
11852 Boolean ret_113;
11853 Boolean ret_112;
11854 Boolean ret_111;
11855 Boolean ret_110;
11856 Boolean ret_109;
11857 Boolean ret_108;
11858 Boolean ret_107;
11859 Boolean ret_106;
11860 Boolean ret_105;
11861 Boolean ret_104;
11862 Boolean ret_103;
11863 Boolean ret_102;
11864 Boolean ret_101;
11865 Boolean ret_100;
11866 Boolean ret_99;
11867 Boolean ret_98;
11868 Boolean ret_97;
11869 Boolean ret_96;
11870 Boolean ret_95;
11871 Boolean ret_94;
11872 Boolean ret_93;
11873 Boolean ret_92;
11874 Boolean ret_91;
11875 Boolean ret_90;
11876 Boolean ret_89;
11877 Integer ret_88;
11878 Boolean ret_87;
11879 Boolean ret_86;
11880 Boolean ret_85;
11881 Boolean ret_84;
11882 Boolean ret_83;
11883 Boolean ret_82;
11884 Boolean ret_81;
11885 Boolean ret_80;
11886 Boolean ret_79;
11887 Boolean ret_78;
11888 Boolean ret_77;
11889 Boolean ret_76;
11890 Integer ret_75;
11891 Integer ret_74;
11892 Boolean ret_73;
11893 Boolean ret_72;
11894 Tpl.Text l_stringOutputVariablesNames;
11895 Tpl.Text l_stringOutputVariablesVRs;
11896 Tpl.Text l_booleanOutputVariablesNames;
11897 Tpl.Text l_booleanOutputVariablesVRs;
11898 Tpl.Text l_integerOutputVariablesNames;
11899 Tpl.Text l_integerOutputVariablesVRs;
11900 Tpl.Text l_realOutputVariablesNames;
11901 Tpl.Text l_realOutputVariablesVRs;
11902 Tpl.Text l_stringEventInputVariablesReturnNames;
11903 Tpl.Text l_stringEventStartVariablesNames;
11904 Tpl.Text l_stringEventInputVariablesVRs;
11905 Integer ret_60;
11906 list<FMI.ModelVariables> ret_59;
11907 Tpl.Text l_nStringEventInputVariables;
11908 Tpl.Text l_booleanEventInputVariablesReturnNames;
11909 Tpl.Text l_booleanEventInputVariablesNames;
11910 Tpl.Text l_booleanEventInputVariablesVRs;
11911 Integer ret_54;
11912 list<FMI.ModelVariables> ret_53;
11913 Tpl.Text l_nBooleanEventInputVariables;
11914 Tpl.Text l_integerEventInputVariablesReturnNames;
11915 Tpl.Text l_integerEventInputVariablesNames;
11916 Tpl.Text l_integerEventInputVariablesVRs;
11917 Integer ret_48;
11918 list<FMI.ModelVariables> ret_47;
11919 Tpl.Text l_nIntegerEventInputVariables;
11920 Tpl.Text l_realEventInputVariablesReturnNames;
11921 Tpl.Text l_realEventInputVariablesNames;
11922 Tpl.Text l_realEventInputVariablesVRs;
11923 Integer ret_42;
11924 list<FMI.ModelVariables> ret_41;
11925 Tpl.Text l_nRealEventInputVariables;
11926 Tpl.Text l_stringInputVariablesReturnNames;
11927 Tpl.Text l_stringStartVariablesNames;
11928 Tpl.Text l_stringInputVariablesVRs;
11929 Integer ret_36;
11930 list<FMI.ModelVariables> ret_35;
11931 Tpl.Text l_nStringInputVariables;
11932 Tpl.Text l_booleanInputVariablesReturnNames;
11933 Tpl.Text l_booleanInputVariablesNames;
11934 Tpl.Text l_booleanInputVariablesVRs;
11935 Integer ret_30;
11936 list<FMI.ModelVariables> ret_29;
11937 Tpl.Text l_nBooleanInputVariables;
11938 Tpl.Text l_integerInputVariablesReturnNames;
11939 Tpl.Text l_integerInputVariablesNames;
11940 Tpl.Text l_integerInputVariablesVRs;
11941 Integer ret_24;
11942 list<FMI.ModelVariables> ret_23;
11943 Tpl.Text l_nIntegerInputVariables;
11944 Tpl.Text l_realInputVariablesReturnNames;
11945 Tpl.Text l_realInputVariablesNames;
11946 Tpl.Text l_realInputVariablesVRs;
11947 Integer ret_18;
11948 list<FMI.ModelVariables> ret_17;
11949 Tpl.Text l_nRealInputVariables;
11950 Tpl.Text l_stringDependentParametersNames;
11951 Tpl.Text l_stringDependentParametersVRs;
11952 Tpl.Text l_booleanDependentParametersNames;
11953 Tpl.Text l_booleanDependentParametersVRs;
11954 Tpl.Text l_integerDependentParametersNames;
11955 Tpl.Text l_integerDependentParametersVRs;
11956 Tpl.Text l_realDependentParametersNames;
11957 Tpl.Text l_realDependentParametersVRs;
11958 Tpl.Text l_stringParametersNames;
11959 Tpl.Text l_stringParametersVRs;
11960 Tpl.Text l_booleanParametersNames;
11961 Tpl.Text l_booleanParametersVRs;
11962 Tpl.Text l_integerParametersNames;
11963 Tpl.Text l_integerParametersVRs;
11964 Tpl.Text l_realParametersNames;
11965 Tpl.Text l_realParametersVRs;
11966
11967 case ( txt,
11968 FMI.FMIIMPORT(fmiInfo = (i_fmiInfo as FMI.INFO(fmiModelIdentifier = i_fmiInfo_fmiModelIdentifier, fmiDescription = i_fmiInfo_fmiDescription, fmiNumberOfContinuousStates = i_fmiInfo_fmiNumberOfContinuousStates, fmiNumberOfEventIndicators = i_fmiInfo_fmiNumberOfEventIndicators)), fmiExperimentAnnotation = FMI.EXPERIMENTANNOTATION(fmiExperimentStartTime = i_fmiExperimentAnnotation_fmiExperimentStartTime, fmiExperimentStopTime = i_fmiExperimentAnnotation_fmiExperimentStopTime, fmiExperimentTolerance = i_fmiExperimentAnnotation_fmiExperimentTolerance), fmiModelVariablesList = i_fmiModelVariablesList, fmiTypeDefinitionsList = i_fmiTypeDefinitionsList, fmuWorkingDirectory = i_fmuWorkingDirectory, fmiLogLevel = i_fmiLogLevel, fmiDebugOutput = i_fmiDebugOutput, generateInputConnectors = i_generateInputConnectors, generateOutputConnectors = i_generateOutputConnectors),
11969 a_name )
11970 algorithm
11971 14 l_realParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", false, 1, "2.0");
11972 14 l_realParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", false, 2, "2.0");
11973 14 l_integerParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", false, 1, "2.0");
11974 14 l_integerParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", false, 2, "2.0");
11975 14 l_booleanParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", false, 1, "2.0");
11976 14 l_booleanParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", false, 2, "2.0");
11977 14 l_stringParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", false, 1, "2.0");
11978 14 l_stringParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", false, 2, "2.0");
11979 14 l_realDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", true, 1, "2.0");
11980 14 l_realDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", true, 2, "2.0");
11981 14 l_integerDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", true, 1, "2.0");
11982 14 l_integerDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", true, 2, "2.0");
11983 14 l_booleanDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", true, 1, "2.0");
11984 14 l_booleanDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", true, 2, "2.0");
11985 14 l_stringDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", true, 1, "2.0");
11986 14 l_stringDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", true, 2, "2.0");
11987 14 ret_17 := FMI.filterModelVariables(i_fmiModelVariablesList, "real", "input");
11988 14 ret_18 := listLength(ret_17);
11989 14 l_nRealInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_18));
11990 14 l_realInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 1, "2.0");
11991 14 l_realInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 2, "2.0");
11992 14 l_realInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 3, "2.0");
11993 14 ret_23 := FMI.filterModelVariables(i_fmiModelVariablesList, "integer", "input");
11994 14 ret_24 := listLength(ret_23);
11995 14 l_nIntegerInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_24));
11996 14 l_integerInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 1, "2.0");
11997 14 l_integerInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 2, "2.0");
11998 14 l_integerInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 3, "2.0");
11999 14 ret_29 := FMI.filterModelVariables(i_fmiModelVariablesList, "boolean", "input");
12000 14 ret_30 := listLength(ret_29);
12001 14 l_nBooleanInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_30));
12002 14 l_booleanInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 1, "2.0");
12003 14 l_booleanInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 2, "2.0");
12004 14 l_booleanInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 3, "2.0");
12005 14 ret_35 := FMI.filterModelVariables(i_fmiModelVariablesList, "string", "input");
12006 14 ret_36 := listLength(ret_35);
12007 14 l_nStringInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_36));
12008 14 l_stringInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 1, "2.0");
12009 14 l_stringStartVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 2, "2.0");
12010 14 l_stringInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 3, "2.0");
12011 14 ret_41 := FMI.filterModelVariables(i_fmiModelVariablesList, "real", "input");
12012 14 ret_42 := listLength(ret_41);
12013 14 l_nRealEventInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_42));
12014 14 l_realEventInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 1, "2.0");
12015 14 l_realEventInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 2, "2.0");
12016 14 l_realEventInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 3, "2.0");
12017 14 ret_47 := FMI.filterModelVariables(i_fmiModelVariablesList, "integer", "input");
12018 14 ret_48 := listLength(ret_47);
12019 14 l_nIntegerEventInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_48));
12020 14 l_integerEventInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 1, "2.0");
12021 14 l_integerEventInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 2, "2.0");
12022 14 l_integerEventInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 3, "2.0");
12023 14 ret_53 := FMI.filterModelVariables(i_fmiModelVariablesList, "boolean", "input");
12024 14 ret_54 := listLength(ret_53);
12025 14 l_nBooleanEventInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_54));
12026 14 l_booleanEventInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 1, "2.0");
12027 14 l_booleanEventInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 2, "2.0");
12028 14 l_booleanEventInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 3, "2.0");
12029 14 ret_59 := FMI.filterModelVariables(i_fmiModelVariablesList, "string", "input");
12030 14 ret_60 := listLength(ret_59);
12031 14 l_nStringEventInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_60));
12032 14 l_stringEventInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 1, "2.0");
12033 14 l_stringEventStartVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 2, "2.0");
12034 14 l_stringEventInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 3, "2.0");
12035 14 l_realOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "output", false, 1, "2.0");
12036 14 l_realOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "output", false, 2, "2.0");
12037 14 l_integerOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "output", false, 1, "2.0");
12038 14 l_integerOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "output", false, 2, "2.0");
12039 14 l_booleanOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "output", false, 1, "2.0");
12040 14 l_booleanOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "output", false, 2, "2.0");
12041 14 l_stringOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "output", false, 1, "2.0");
12042 14 l_stringOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "output", false, 2, "2.0");
12043 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("model "));
12044
2/4
✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 14 times.
14 ret_72 := stringEq(a_name, "");
12045 14 txt := fun_325(txt, ret_72, i_fmiInfo, i_fmiInfo_fmiModelIdentifier, a_name);
12046
3/4
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
14 ret_73 := stringEq(i_fmiInfo_fmiDescription, "");
12047 14 txt := fun_326(txt, ret_73, i_fmiInfo_fmiDescription);
12048 14 txt := Tpl.softNewLine(txt);
12049 14 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
12050 14 txt := dumpFMITypeDefinitions(txt, i_fmiTypeDefinitionsList);
12051 14 txt := Tpl.softNewLine(txt);
12052 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("constant String fmuWorkingDir = \""));
12053 14 txt := Tpl.writeStr(txt, i_fmuWorkingDirectory);
12054 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12055 "\";\n",
12056 "parameter Integer logLevel = "
12057 }, false));
12058 14 txt := Tpl.writeStr(txt, intString(i_fmiLogLevel));
12059 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12060 " \"log level used during the loading of FMU\" annotation (Dialog(tab=\"FMI\", group=\"Enable logging\"));\n",
12061 "parameter Boolean debugLogging = "
12062 }, false));
12063 14 txt := Tpl.writeStr(txt, Tpl.booleanString(i_fmiDebugOutput));
12064 14 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" \"enables the FMU simulation logging\" annotation (Dialog(tab=\"FMI\", group=\"Enable logging\"));\n"));
12065 14 txt := dumpFMIModelVariablesList(txt, "2.0", i_fmiModelVariablesList, i_fmiTypeDefinitionsList, i_generateInputConnectors, i_generateOutputConnectors);
12066 14 txt := Tpl.softNewLine(txt);
12067 14 txt := Tpl.popBlock(txt);
12068 14 txt := Tpl.writeTok(txt, Tpl.ST_LINE("protected\n"));
12069 14 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
12070 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("FMI2ModelExchange fmi2me = FMI2ModelExchange(logLevel, fmuWorkingDir, \""));
12071 14 txt := Tpl.writeStr(txt, i_fmiInfo_fmiModelIdentifier);
12072 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12073 "\", debugLogging);\n",
12074 "constant Integer numberOfContinuousStates = "
12075 }, false));
12076 14 ret_74 := listLength(i_fmiInfo_fmiNumberOfContinuousStates);
12077 14 txt := Tpl.writeStr(txt, intString(ret_74));
12078 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12079 ";\n",
12080 "Real fmi_x[numberOfContinuousStates] \"States\";\n",
12081 "Real fmi_x_new[numberOfContinuousStates](each fixed=true) \"New States\";\n",
12082 "constant Integer numberOfEventIndicators = "
12083 }, false));
12084 14 ret_75 := listLength(i_fmiInfo_fmiNumberOfEventIndicators);
12085 14 txt := Tpl.writeStr(txt, intString(ret_75));
12086 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12087 ";\n",
12088 "Real fmi_z[numberOfEventIndicators] \"Events Indicators\";\n",
12089 "Boolean fmi_z_positive[numberOfEventIndicators](each fixed=true);\n",
12090 "parameter Real flowStartTime(fixed=false);\n",
12091 "Real flowTime;\n",
12092 "parameter Real flowEnterInitialization(fixed=false);\n",
12093 "parameter Real flowInitialized(fixed=false);\n",
12094 "parameter Real flowParamsStart(fixed=false);\n",
12095 "parameter Real flowInitInputs(fixed=false);\n",
12096 "Real flowStatesInputs;\n"
12097 }, true));
12098
3/4
✓ Branch 1 taken 11 times.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 11 times.
14 ret_76 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
12099 14 txt := fun_327(txt, ret_76, l_nRealInputVariables);
12100 14 txt := Tpl.softNewLine(txt);
12101
3/4
✓ Branch 1 taken 11 times.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 11 times.
14 ret_77 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
12102 14 txt := fun_328(txt, ret_77, l_realInputVariablesReturnNames);
12103 14 txt := Tpl.softNewLine(txt);
12104
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_78 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
12105 14 txt := fun_329(txt, ret_78, l_nIntegerInputVariables);
12106 14 txt := Tpl.softNewLine(txt);
12107
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_79 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
12108 14 txt := fun_330(txt, ret_79, l_integerInputVariablesReturnNames);
12109 14 txt := Tpl.softNewLine(txt);
12110
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_80 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
12111 14 txt := fun_331(txt, ret_80, l_nBooleanInputVariables);
12112 14 txt := Tpl.softNewLine(txt);
12113
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_81 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
12114 14 txt := fun_332(txt, ret_81, l_booleanInputVariablesReturnNames);
12115 14 txt := Tpl.softNewLine(txt);
12116
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_82 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
12117 14 txt := fun_333(txt, ret_82, l_nStringInputVariables);
12118 14 txt := Tpl.softNewLine(txt);
12119
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_83 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
12120 14 txt := fun_334(txt, ret_83, l_stringInputVariablesReturnNames);
12121 14 txt := Tpl.softNewLine(txt);
12122
3/4
✓ Branch 1 taken 11 times.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 11 times.
14 ret_84 := stringEq(Tpl.textString(l_realEventInputVariablesVRs), "");
12123 14 txt := fun_335(txt, ret_84, l_nRealEventInputVariables);
12124 14 txt := Tpl.softNewLine(txt);
12125
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_85 := stringEq(Tpl.textString(l_integerEventInputVariablesVRs), "");
12126 14 txt := fun_336(txt, ret_85, l_nIntegerEventInputVariables);
12127 14 txt := Tpl.softNewLine(txt);
12128
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_86 := stringEq(Tpl.textString(l_booleanEventInputVariablesVRs), "");
12129 14 txt := fun_337(txt, ret_86, l_nBooleanEventInputVariables);
12130 14 txt := Tpl.softNewLine(txt);
12131
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_87 := stringEq(Tpl.textString(l_stringEventInputVariablesVRs), "");
12132 14 txt := fun_338(txt, ret_87, l_nStringEventInputVariables);
12133 14 txt := Tpl.softNewLine(txt);
12134 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12135 "Boolean callEventUpdate;\n",
12136 "Boolean newStatesAvailable(fixed = true);\n",
12137 "Real triggerDSSEvent;\n",
12138 "Real nextEventTime(fixed = true);\n"
12139 }, true));
12140 14 txt := Tpl.popBlock(txt);
12141 14 txt := Tpl.writeTok(txt, Tpl.ST_LINE("initial equation\n"));
12142 14 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
12143 14 ret_88 := listLength(i_fmiInfo_fmiNumberOfContinuousStates);
12144 14 ret_89 := intGt(ret_88, 0);
12145 14 txt := fun_339(txt, ret_89);
12146 14 txt := Tpl.softNewLine(txt);
12147 14 txt := Tpl.popBlock(txt);
12148 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12149 "initial algorithm\n",
12150 " flowParamsStart := 1;\n",
12151 " flowInitInputs := 1;\n",
12152 " flowStartTime := fmi2Functions.fmi2SetupExperiment(fmi2me, false, 0.0, time, false, 0.0, flowParamsStart+flowInitInputs);\n",
12153 " flowEnterInitialization := fmi2Functions.fmi2EnterInitialization(fmi2me, flowParamsStart+flowInitInputs+flowStartTime);\n",
12154 " /* the parameters must be set while the FMU is still in Initialization Mode,\n",
12155 " otherwise the FMU computes its calculated parameters from the default values */\n"
12156 }, true));
12157 14 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
12158
3/4
✓ Branch 1 taken 5 times.
✓ Branch 2 taken 9 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 5 times.
14 ret_90 := stringEq(Tpl.textString(l_realParametersVRs), "");
12159 14 txt := fun_340(txt, ret_90, l_realParametersNames, l_realParametersVRs);
12160 14 txt := Tpl.softNewLine(txt);
12161
3/4
✓ Branch 1 taken 12 times.
✓ Branch 2 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 12 times.
14 ret_91 := stringEq(Tpl.textString(l_integerParametersVRs), "");
12162 14 txt := fun_341(txt, ret_91, l_integerParametersNames, l_integerParametersVRs);
12163 14 txt := Tpl.softNewLine(txt);
12164
3/4
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 10 times.
14 ret_92 := stringEq(Tpl.textString(l_booleanParametersVRs), "");
12165 14 txt := fun_342(txt, ret_92, l_booleanParametersNames, l_booleanParametersVRs);
12166 14 txt := Tpl.softNewLine(txt);
12167
3/4
✓ Branch 1 taken 11 times.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 11 times.
14 ret_93 := stringEq(Tpl.textString(l_stringParametersVRs), "");
12168 14 txt := fun_343(txt, ret_93, l_stringParametersNames, l_stringParametersVRs);
12169 14 txt := Tpl.softNewLine(txt);
12170 14 txt := Tpl.writeTok(txt, Tpl.ST_LINE("flowInitialized := fmi2Functions.fmi2ExitInitialization(fmi2me, flowParamsStart+flowInitInputs+flowStartTime+flowEnterInitialization);\n"));
12171 14 txt := Tpl.popBlock(txt);
12172 14 txt := Tpl.writeTok(txt, Tpl.ST_LINE("initial equation\n"));
12173 14 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
12174
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_94 := stringEq(Tpl.textString(l_realDependentParametersVRs), "");
12175 14 txt := fun_344(txt, ret_94, l_realDependentParametersVRs, l_realDependentParametersNames);
12176 14 txt := Tpl.softNewLine(txt);
12177
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_95 := stringEq(Tpl.textString(l_integerDependentParametersVRs), "");
12178 14 txt := fun_345(txt, ret_95, l_integerDependentParametersVRs, l_integerDependentParametersNames);
12179 14 txt := Tpl.softNewLine(txt);
12180
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_96 := stringEq(Tpl.textString(l_booleanDependentParametersVRs), "");
12181 14 txt := fun_346(txt, ret_96, l_booleanDependentParametersVRs, l_booleanDependentParametersNames);
12182 14 txt := Tpl.softNewLine(txt);
12183
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_97 := stringEq(Tpl.textString(l_stringDependentParametersVRs), "");
12184 14 txt := fun_347(txt, ret_97, l_stringDependentParametersVRs, l_stringDependentParametersNames);
12185 14 txt := Tpl.softNewLine(txt);
12186 14 txt := Tpl.popBlock(txt);
12187 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12188 "algorithm\n",
12189 " flowTime := if not initial() then fmi2Functions.fmi2SetTime(fmi2me, time, flowInitialized) else time;\n",
12190 " /* algorithm section ensures that inputs to fmi (if any) are set directly after the new time is set */\n"
12191 }, true));
12192 14 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
12193
3/4
✓ Branch 1 taken 11 times.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 11 times.
14 ret_98 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
12194 14 txt := fun_348(txt, ret_98, l_realInputVariablesNames, l_realInputVariablesVRs);
12195 14 txt := Tpl.softNewLine(txt);
12196
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_99 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
12197 14 txt := fun_349(txt, ret_99, l_integerInputVariablesNames, l_integerInputVariablesVRs);
12198 14 txt := Tpl.softNewLine(txt);
12199
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_100 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
12200 14 txt := fun_350(txt, ret_100, l_booleanInputVariablesNames, l_booleanInputVariablesVRs);
12201 14 txt := Tpl.softNewLine(txt);
12202
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_101 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
12203 14 txt := fun_351(txt, ret_101, l_stringStartVariablesNames, l_stringInputVariablesVRs);
12204 14 txt := Tpl.softNewLine(txt);
12205 14 txt := Tpl.popBlock(txt);
12206 14 txt := Tpl.writeTok(txt, Tpl.ST_LINE("equation\n"));
12207 14 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
12208
3/4
✓ Branch 1 taken 11 times.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 11 times.
14 ret_102 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
12209 14 txt := fun_352(txt, ret_102, l_realInputVariablesReturnNames);
12210 14 txt := Tpl.softNewLine(txt);
12211
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_103 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
12212 14 txt := fun_353(txt, ret_103, l_integerInputVariablesReturnNames);
12213 14 txt := Tpl.softNewLine(txt);
12214
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_104 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
12215 14 txt := fun_354(txt, ret_104, l_booleanInputVariablesReturnNames);
12216 14 txt := Tpl.softNewLine(txt);
12217
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_105 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
12218 14 txt := fun_355(txt, ret_105, l_stringInputVariablesReturnNames);
12219 14 txt := Tpl.softNewLine(txt);
12220 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12221 "flowStatesInputs = fmi2Functions.fmi2SetContinuousStates(fmi2me, fmi_x, flowParamsStart + flowTime);\n",
12222 "der(fmi_x) = fmi2Functions.fmi2GetDerivatives(fmi2me, numberOfContinuousStates, flowStatesInputs);\n",
12223 "fmi_z = fmi2Functions.fmi2GetEventIndicators(fmi2me, numberOfEventIndicators, flowStatesInputs);\n",
12224 "for i in 1:size(fmi_z,1) loop\n",
12225 " fmi_z_positive[i] = if not terminal() then fmi_z[i] > 0 else pre(fmi_z_positive[i]);\n",
12226 "end for;\n",
12227 "\n",
12228 "triggerDSSEvent = noEvent(if callEventUpdate then flowStatesInputs+1.0 else flowStatesInputs-1.0);\n",
12229 "\n"
12230 }, true));
12231
1/4
✗ Branch 1 not taken.
✓ Branch 2 taken 14 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
14 ret_106 := stringEq(Tpl.textString(l_realOutputVariablesNames), "");
12232
1/4
✗ Branch 1 not taken.
✓ Branch 2 taken 14 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
14 ret_107 := stringEq(Tpl.textString(l_realOutputVariablesVRs), "");
12233 14 ret_108 := boolAnd(ret_106, ret_107);
12234 14 txt := fun_356(txt, ret_108, l_realOutputVariablesVRs, l_realOutputVariablesNames);
12235 14 txt := Tpl.softNewLine(txt);
12236
3/4
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 10 times.
14 ret_109 := stringEq(Tpl.textString(l_integerOutputVariablesNames), "");
12237
3/4
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 10 times.
14 ret_110 := stringEq(Tpl.textString(l_integerOutputVariablesVRs), "");
12238 14 ret_111 := boolAnd(ret_109, ret_110);
12239 14 txt := fun_357(txt, ret_111, l_integerOutputVariablesVRs, l_integerOutputVariablesNames);
12240 14 txt := Tpl.softNewLine(txt);
12241
3/4
✓ Branch 1 taken 11 times.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 11 times.
14 ret_112 := stringEq(Tpl.textString(l_booleanOutputVariablesNames), "");
12242
3/4
✓ Branch 1 taken 11 times.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 11 times.
14 ret_113 := stringEq(Tpl.textString(l_booleanOutputVariablesVRs), "");
12243 14 ret_114 := boolAnd(ret_112, ret_113);
12244 14 txt := fun_358(txt, ret_114, l_booleanOutputVariablesVRs, l_booleanOutputVariablesNames);
12245 14 txt := Tpl.softNewLine(txt);
12246
3/4
✓ Branch 1 taken 13 times.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 13 times.
14 ret_115 := stringEq(Tpl.textString(l_stringOutputVariablesNames), "");
12247
3/4
✓ Branch 1 taken 13 times.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 13 times.
14 ret_116 := stringEq(Tpl.textString(l_stringOutputVariablesVRs), "");
12248 14 ret_117 := boolAnd(ret_115, ret_116);
12249 14 txt := fun_359(txt, ret_117, l_stringOutputVariablesVRs, l_stringOutputVariablesNames);
12250 14 txt := Tpl.softNewLine(txt);
12251 14 txt := dumpOutputGetEnumerationVariables(txt, i_fmiModelVariablesList, i_fmiTypeDefinitionsList, "fmi2Functions.fmi2GetInteger", "fmi2me");
12252 14 txt := Tpl.softNewLine(txt);
12253 14 txt := Tpl.writeTok(txt, Tpl.ST_LINE("callEventUpdate = fmi2Functions.fmi2CompletedIntegratorStep(fmi2me, flowStatesInputs+flowTime);\n"));
12254 14 txt := Tpl.popBlock(txt);
12255 14 txt := Tpl.writeTok(txt, Tpl.ST_LINE("algorithm\n"));
12256 14 ret_118 := listLength(i_fmiInfo_fmiNumberOfEventIndicators);
12257 14 ret_119 := intGt(ret_118, 0);
12258 14 txt := fun_361(txt, ret_119, i_fmiInfo_fmiNumberOfEventIndicators);
12259 14 txt := Tpl.softNewLine(txt);
12260 14 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" fmi2Functions.fmi2StartEventUpdate(fmi2me);\n"));
12261 14 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
12262
3/4
✓ Branch 1 taken 11 times.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 11 times.
14 ret_120 := stringEq(Tpl.textString(l_realEventInputVariablesVRs), "");
12263 14 txt := fun_362(txt, ret_120, l_realEventInputVariablesNames, l_realEventInputVariablesVRs);
12264 14 txt := Tpl.softNewLine(txt);
12265
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_121 := stringEq(Tpl.textString(l_integerEventInputVariablesVRs), "");
12266 14 txt := fun_363(txt, ret_121, l_integerEventInputVariablesNames, l_integerEventInputVariablesVRs);
12267 14 txt := Tpl.softNewLine(txt);
12268
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_122 := stringEq(Tpl.textString(l_booleanEventInputVariablesVRs), "");
12269 14 txt := fun_364(txt, ret_122, l_booleanEventInputVariablesNames, l_booleanEventInputVariablesVRs);
12270 14 txt := Tpl.softNewLine(txt);
12271
2/4
✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
14 ret_123 := stringEq(Tpl.textString(l_stringEventInputVariablesVRs), "");
12272 14 txt := fun_365(txt, ret_123, l_stringEventStartVariablesNames, l_stringEventInputVariablesVRs);
12273 14 txt := Tpl.softNewLine(txt);
12274 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12275 "newStatesAvailable := fmi2Functions.fmi2EndEventUpdate(fmi2me);\n",
12276 "nextEventTime := fmi2Functions.fmi2nextEventTime(fmi2me, flowStatesInputs);\n"
12277 }, true));
12278 14 txt := Tpl.popBlock(txt);
12279 14 ret_124 := listLength(i_fmiInfo_fmiNumberOfContinuousStates);
12280 14 ret_125 := intGt(ret_124, 0);
12281 14 txt := fun_367(txt, ret_125, i_fmiInfo_fmiNumberOfContinuousStates);
12282 14 txt := Tpl.softNewLine(txt);
12283 14 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" end when;\n"));
12284 14 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
12285 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("annotation(experiment(StartTime="));
12286 14 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentStartTime));
12287 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", StopTime="));
12288 14 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentStopTime));
12289 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", Tolerance="));
12290 14 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentTolerance));
12291 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12292 "));\n",
12293 "annotation (Icon(graphics={\n",
12294 " Rectangle(\n",
12295 " extent={{-100,100},{100,-100}},\n",
12296 " lineColor={0,0,0},\n",
12297 " fillColor={240,240,240},\n",
12298 " fillPattern=FillPattern.Solid,\n",
12299 " lineThickness=0.5),\n",
12300 " Text(\n",
12301 " extent={{-100,40},{100,0}},\n",
12302 " lineColor={0,0,0},\n",
12303 " textString=\"%name\"),\n",
12304 " Text(\n",
12305 " extent={{-100,-50},{100,-90}},\n",
12306 " lineColor={0,0,0},\n",
12307 " textString=\"V2.0\")}));\n"
12308 }, true));
12309 14 txt := Tpl.popBlock(txt);
12310 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12311 "protected\n",
12312 " class FMI2ModelExchange\n",
12313 " extends ExternalObject;\n",
12314 " function constructor\n",
12315 " input Integer logLevel;\n",
12316 " input String workingDirectory;\n",
12317 " input String instanceName;\n",
12318 " input Boolean debugLogging;\n",
12319 " output FMI2ModelExchange fmi2me;\n",
12320 " external \"C\" fmi2me = FMI2ModelExchangeConstructor_OMC(logLevel, workingDirectory, instanceName, debugLogging) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12321 " end constructor;\n",
12322 "\n",
12323 " function destructor\n",
12324 " input FMI2ModelExchange fmi2me;\n",
12325 " external \"C\" FMI2ModelExchangeDestructor_OMC(fmi2me) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12326 " end destructor;\n",
12327 " end FMI2ModelExchange;\n",
12328 "\n"
12329 }, true));
12330 14 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
12331 14 txt := dumpFMITypeDefinitionsMappingFunctions(txt, i_fmiTypeDefinitionsList);
12332 14 txt := Tpl.softNewLine(txt);
12333 14 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
12334 14 txt := dumpFMITypeDefinitionsArrayMappingFunctions(txt, i_fmiTypeDefinitionsList);
12335 14 txt := Tpl.softNewLine(txt);
12336 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
12337 "\n",
12338 "package fmi2Functions\n",
12339 " function fmi2SetupExperiment\n",
12340 " input FMI2ModelExchange fmi2me;\n",
12341 " input Boolean inToleranceDefined;\n",
12342 " input Real inTolerance;\n",
12343 " input Real inStartTime;\n",
12344 " input Boolean inStopTimeDefined;\n",
12345 " input Real inStopTime;\n",
12346 " input Real inFlow;\n",
12347 " output Real outFlow = inFlow;\n",
12348 " external \"C\" fmi2SetupExperiment_OMC(fmi2me, inToleranceDefined, inTolerance, inStartTime, inStopTimeDefined, inStopTime) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12349 " end fmi2SetupExperiment;\n",
12350 "\n",
12351 " function fmi2SetTime\n",
12352 " input FMI2ModelExchange fmi2me;\n",
12353 " input Real inTime;\n",
12354 " input Real inFlow;\n",
12355 " output Real outFlow = inFlow;\n",
12356 " external \"C\" fmi2SetTime_OMC(fmi2me, inTime) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12357 " end fmi2SetTime;\n",
12358 "\n",
12359 " function fmi2EnterInitialization\n",
12360 " input FMI2ModelExchange fmi2me;\n",
12361 " input Real inFlowVariable;\n",
12362 " output Real outFlowVariable = inFlowVariable;\n",
12363 " external \"C\" fmi2EnterInitializationModel_OMC(fmi2me) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12364 " end fmi2EnterInitialization;\n",
12365 "\n",
12366 " function fmi2ExitInitialization\n",
12367 " input FMI2ModelExchange fmi2me;\n",
12368 " input Real inFlowVariable;\n",
12369 " output Real outFlowVariable = inFlowVariable;\n",
12370 " external \"C\" fmi2ExitInitializationModel_OMC(fmi2me) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12371 " end fmi2ExitInitialization;\n",
12372 "\n",
12373 " function fmi2GetContinuousStates\n",
12374 " input FMI2ModelExchange fmi2me;\n",
12375 " input Integer numberOfContinuousStates;\n",
12376 " input Real inFlowParams;\n",
12377 " output Real fmi_x[numberOfContinuousStates];\n",
12378 " external \"C\" fmi2GetContinuousStates_OMC(fmi2me, numberOfContinuousStates, inFlowParams, fmi_x) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12379 " end fmi2GetContinuousStates;\n",
12380 "\n",
12381 " function fmi2SetContinuousStates\n",
12382 " input FMI2ModelExchange fmi2me;\n",
12383 " input Real fmi_x[:];\n",
12384 " input Real inFlowParams;\n",
12385 " output Real outFlowStates;\n",
12386 " external \"C\" outFlowStates = fmi2SetContinuousStates_OMC(fmi2me, size(fmi_x, 1), inFlowParams, fmi_x) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12387 " end fmi2SetContinuousStates;\n",
12388 "\n",
12389 " function fmi2GetDerivatives\n",
12390 " input FMI2ModelExchange fmi2me;\n",
12391 " input Integer numberOfContinuousStates;\n",
12392 " input Real inFlowStates;\n",
12393 " output Real fmi_x[numberOfContinuousStates];\n",
12394 " external \"C\" fmi2GetDerivatives_OMC(fmi2me, numberOfContinuousStates, inFlowStates, fmi_x) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12395 " end fmi2GetDerivatives;\n",
12396 "\n",
12397 " function fmi2GetEventIndicators\n",
12398 " input FMI2ModelExchange fmi2me;\n",
12399 " input Integer numberOfEventIndicators;\n",
12400 " input Real inFlowStates;\n",
12401 " output Real fmi_z[numberOfEventIndicators];\n",
12402 " external \"C\" fmi2GetEventIndicators_OMC(fmi2me, numberOfEventIndicators, inFlowStates, fmi_z) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12403 " end fmi2GetEventIndicators;\n",
12404 "\n",
12405 " function fmi2GetReal\n",
12406 " input FMI2ModelExchange fmi2me;\n",
12407 " input Real realValuesReferences[:];\n",
12408 " input Real inFlowStatesInput;\n",
12409 " output Real realValues[size(realValuesReferences, 1)];\n",
12410 " external \"C\" fmi2GetReal_OMC(fmi2me, size(realValuesReferences, 1), realValuesReferences, inFlowStatesInput, realValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12411 " end fmi2GetReal;\n",
12412 "\n",
12413 " function fmi2SetReal\n",
12414 " input FMI2ModelExchange fmi2me;\n",
12415 " input Real realValueReferences[:];\n",
12416 " input Real realValues[size(realValueReferences, 1)];\n",
12417 " output Real outValues[size(realValueReferences, 1)] = realValues;\n",
12418 " external \"C\" fmi2SetReal_OMC(fmi2me, size(realValueReferences, 1), realValueReferences, realValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12419 " end fmi2SetReal;\n",
12420 "\n",
12421 " function fmi2SetRealParameter\n",
12422 " input FMI2ModelExchange fmi2me;\n",
12423 " input Real realValueReferences[:];\n",
12424 " input Real realValues[size(realValueReferences, 1)];\n",
12425 " output Real out_Value = 1;\n",
12426 " external \"C\" fmi2SetReal_OMC(fmi2me, size(realValueReferences, 1), realValueReferences, realValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12427 " end fmi2SetRealParameter;\n",
12428 "\n",
12429 " function fmi2GetInteger\n",
12430 " input FMI2ModelExchange fmi2me;\n",
12431 " input Real integerValueReferences[:];\n",
12432 " input Real inFlowStatesInput;\n",
12433 " output Integer integerValues[size(integerValueReferences, 1)];\n",
12434 " external \"C\" fmi2GetInteger_OMC(fmi2me, size(integerValueReferences, 1), integerValueReferences, inFlowStatesInput, integerValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12435 " end fmi2GetInteger;\n",
12436 "\n",
12437 " function fmi2SetInteger\n",
12438 " input FMI2ModelExchange fmi2me;\n",
12439 " input Real integerValuesReferences[:];\n",
12440 " input Integer integerValues[size(integerValuesReferences, 1)];\n",
12441 " output Integer outValues[size(integerValuesReferences, 1)] = integerValues;\n",
12442 " external \"C\" fmi2SetInteger_OMC(fmi2me, size(integerValuesReferences, 1), integerValuesReferences, integerValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12443 " end fmi2SetInteger;\n",
12444 "\n",
12445 " function fmi2SetIntegerParameter\n",
12446 " input FMI2ModelExchange fmi2me;\n",
12447 " input Real integerValuesReferences[:];\n",
12448 " input Integer integerValues[size(integerValuesReferences, 1)];\n",
12449 " output Real out_Value = 1;\n",
12450 " external \"C\" fmi2SetInteger_OMC(fmi2me, size(integerValuesReferences, 1), integerValuesReferences, integerValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12451 " end fmi2SetIntegerParameter;\n",
12452 "\n",
12453 " function fmi2GetBoolean\n",
12454 " input FMI2ModelExchange fmi2me;\n",
12455 " input Real booleanValuesReferences[:];\n",
12456 " input Real inFlowStatesInput;\n",
12457 " output Boolean booleanValues[size(booleanValuesReferences, 1)];\n",
12458 " external \"C\" fmi2GetBoolean_OMC(fmi2me, size(booleanValuesReferences, 1), booleanValuesReferences, inFlowStatesInput, booleanValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12459 " end fmi2GetBoolean;\n",
12460 "\n",
12461 " function fmi2SetBoolean\n",
12462 " input FMI2ModelExchange fmi2me;\n",
12463 " input Real booleanValueReferences[:];\n",
12464 " input Boolean booleanValues[size(booleanValueReferences, 1)];\n",
12465 " output Boolean outValues[size(booleanValueReferences, 1)] = booleanValues;\n",
12466 " external \"C\" fmi2SetBoolean_OMC(fmi2me, size(booleanValueReferences, 1), booleanValueReferences, booleanValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12467 " end fmi2SetBoolean;\n",
12468 "\n",
12469 " function fmi2SetBooleanParameter\n",
12470 " input FMI2ModelExchange fmi2me;\n",
12471 " input Real booleanValueReferences[:];\n",
12472 " input Boolean booleanValues[size(booleanValueReferences, 1)];\n",
12473 " output Real out_Value = 1;\n",
12474 " external \"C\" fmi2SetBoolean_OMC(fmi2me, size(booleanValueReferences, 1), booleanValueReferences, booleanValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12475 " end fmi2SetBooleanParameter;\n",
12476 "\n",
12477 " function fmi2GetString\n",
12478 " input FMI2ModelExchange fmi2me;\n",
12479 " input Real stringValuesReferences[:];\n",
12480 " input Real inFlowStatesInput;\n",
12481 " output String stringValues[size(stringValuesReferences, 1)];\n",
12482 " external \"C\" fmi2GetString_OMC(fmi2me, size(stringValuesReferences, 1), stringValuesReferences, inFlowStatesInput, stringValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12483 " end fmi2GetString;\n",
12484 "\n",
12485 " function fmi2SetString\n",
12486 " input FMI2ModelExchange fmi2me;\n",
12487 " input Real stringValueReferences[:];\n",
12488 " input String stringValues[size(stringValueReferences, 1)];\n",
12489 " output String outValues[size(stringValueReferences, 1)] = stringValues;\n",
12490 " external \"C\" fmi2SetString_OMC(fmi2me, size(stringValueReferences, 1), stringValueReferences, stringValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12491 " end fmi2SetString;\n",
12492 "\n",
12493 " function fmi2SetStringParameter\n",
12494 " input FMI2ModelExchange fmi2me;\n",
12495 " input Real stringValueReferences[:];\n",
12496 " input String stringValues[size(stringValueReferences, 1)];\n",
12497 " output Real out_Value = 1;\n",
12498 " external \"C\" fmi2SetString_OMC(fmi2me, size(stringValueReferences, 1), stringValueReferences, stringValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12499 " end fmi2SetStringParameter;\n",
12500 "\n",
12501 " function fmi2StartEventUpdate\n",
12502 " input FMI2ModelExchange fmi2me;\n",
12503 " external \"C\" fmi2StartEventUpdate_OMC(fmi2me) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12504 " end fmi2StartEventUpdate;\n",
12505 "\n",
12506 " function fmi2EndEventUpdate\n",
12507 " input FMI2ModelExchange fmi2me;\n",
12508 " output Boolean outNewStatesAvailable;\n",
12509 " external \"C\" outNewStatesAvailable = fmi2EndEventUpdate_OMC(fmi2me) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12510 " end fmi2EndEventUpdate;\n",
12511 "\n",
12512 " function fmi2nextEventTime\n",
12513 " input FMI2ModelExchange fmi2me;\n",
12514 " input Real inFlowStates;\n",
12515 " output Real outNewnextTime;\n",
12516 " external \"C\" outNewnextTime = fmi2nextEventTime_OMC(fmi2me, inFlowStates) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12517 " end fmi2nextEventTime;\n",
12518 "\n",
12519 " function fmi2CompletedIntegratorStep\n",
12520 " input FMI2ModelExchange fmi2me;\n",
12521 " input Real inFlowStates;\n",
12522 " output Boolean outCallEventUpdate;\n",
12523 " external \"C\" outCallEventUpdate = fmi2CompletedIntegratorStep_OMC(fmi2me, inFlowStates) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
12524 " end fmi2CompletedIntegratorStep;\n",
12525 "end fmi2Functions;\n"
12526 }, true));
12527 14 txt := Tpl.popBlock(txt);
12528 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
12529
2/4
✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 14 times.
14 ret_126 := stringEq(a_name, "");
12530 14 txt := fun_368(txt, ret_126, i_fmiInfo, i_fmiInfo_fmiModelIdentifier, a_name);
12531 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
12532 then txt;
12533
12534 case ( txt,
12535 _,
12536 _ )
12537 then txt;
12538 end match;
12539 end importFMU2ModelExchange;
12540
12541 protected function fun_370
12542 input Tpl.Text in_txt;
12543 input Boolean in_mArg;
12544 input FMI.Info in_a_fmiInfo;
12545 input String in_a_fmiInfo_fmiModelIdentifier;
12546 input String in_a_name;
12547
12548 output Tpl.Text out_txt;
12549 algorithm
12550 out_txt :=
12551 match(in_txt, in_mArg, in_a_fmiInfo, in_a_fmiInfo_fmiModelIdentifier, in_a_name)
12552 local
12553 Tpl.Text txt;
12554 FMI.Info a_fmiInfo;
12555 String a_fmiInfo_fmiModelIdentifier;
12556 String a_name;
12557 String ret_0;
12558
12559 case ( txt,
12560 false,
12561 _,
12562 _,
12563 a_name )
12564 algorithm
12565 ✗ txt := Tpl.writeStr(txt, a_name);
12566 then txt;
12567
12568 case ( txt,
12569 _,
12570 a_fmiInfo,
12571 a_fmiInfo_fmiModelIdentifier,
12572 _ )
12573 algorithm
12574 1 txt := Tpl.writeStr(txt, a_fmiInfo_fmiModelIdentifier);
12575 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
12576 1 ret_0 := FMI.getFMIType(a_fmiInfo);
12577 1 txt := Tpl.writeStr(txt, ret_0);
12578 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_FMU"));
12579 then txt;
12580 end match;
12581 end fun_370;
12582
12583 protected function fun_371
12584 input Tpl.Text in_txt;
12585 input Boolean in_mArg;
12586 input String in_a_fmiInfo_fmiDescription;
12587
12588 output Tpl.Text out_txt;
12589 algorithm
12590 out_txt :=
12591 match(in_txt, in_mArg, in_a_fmiInfo_fmiDescription)
12592 local
12593 Tpl.Text txt;
12594 String a_fmiInfo_fmiDescription;
12595
12596 case ( txt,
12597 false,
12598 a_fmiInfo_fmiDescription )
12599 algorithm
12600 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" \""));
12601 ✗ txt := Tpl.writeStr(txt, a_fmiInfo_fmiDescription);
12602 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
12603 then txt;
12604
12605 case ( txt,
12606 _,
12607 _ )
12608 then txt;
12609 end match;
12610 end fun_371;
12611
12612 protected function fun_372
12613 input Tpl.Text in_txt;
12614 input Boolean in_mArg;
12615 input Tpl.Text in_a_nRealInputVariables;
12616
12617 output Tpl.Text out_txt;
12618 algorithm
12619 out_txt :=
12620 match(in_txt, in_mArg, in_a_nRealInputVariables)
12621 local
12622 Tpl.Text txt;
12623 Tpl.Text a_nRealInputVariables;
12624
12625 case ( txt,
12626 false,
12627 a_nRealInputVariables )
12628 algorithm
12629 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Real realInputVariables["));
12630 ✗ txt := Tpl.writeText(txt, a_nRealInputVariables);
12631 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("];"));
12632 then txt;
12633
12634 case ( txt,
12635 _,
12636 _ )
12637 then txt;
12638 end match;
12639 end fun_372;
12640
12641 protected function fun_373
12642 input Tpl.Text in_txt;
12643 input Boolean in_mArg;
12644 input Tpl.Text in_a_realInputVariablesReturnNames;
12645
12646 output Tpl.Text out_txt;
12647 algorithm
12648 out_txt :=
12649 match(in_txt, in_mArg, in_a_realInputVariablesReturnNames)
12650 local
12651 Tpl.Text txt;
12652 Tpl.Text a_realInputVariablesReturnNames;
12653
12654 case ( txt,
12655 false,
12656 a_realInputVariablesReturnNames )
12657 algorithm
12658 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Real "));
12659 ✗ txt := Tpl.writeText(txt, a_realInputVariablesReturnNames);
12660 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
12661 then txt;
12662
12663 case ( txt,
12664 _,
12665 _ )
12666 then txt;
12667 end match;
12668 end fun_373;
12669
12670 protected function fun_374
12671 input Tpl.Text in_txt;
12672 input Boolean in_mArg;
12673 input Tpl.Text in_a_nIntegerInputVariables;
12674
12675 output Tpl.Text out_txt;
12676 algorithm
12677 out_txt :=
12678 match(in_txt, in_mArg, in_a_nIntegerInputVariables)
12679 local
12680 Tpl.Text txt;
12681 Tpl.Text a_nIntegerInputVariables;
12682
12683 case ( txt,
12684 false,
12685 a_nIntegerInputVariables )
12686 algorithm
12687 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Integer integerInputVariables["));
12688 ✗ txt := Tpl.writeText(txt, a_nIntegerInputVariables);
12689 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("];"));
12690 then txt;
12691
12692 case ( txt,
12693 _,
12694 _ )
12695 then txt;
12696 end match;
12697 end fun_374;
12698
12699 protected function fun_375
12700 input Tpl.Text in_txt;
12701 input Boolean in_mArg;
12702 input Tpl.Text in_a_integerInputVariablesReturnNames;
12703
12704 output Tpl.Text out_txt;
12705 algorithm
12706 out_txt :=
12707 match(in_txt, in_mArg, in_a_integerInputVariablesReturnNames)
12708 local
12709 Tpl.Text txt;
12710 Tpl.Text a_integerInputVariablesReturnNames;
12711
12712 case ( txt,
12713 false,
12714 a_integerInputVariablesReturnNames )
12715 algorithm
12716 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Integer "));
12717 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesReturnNames);
12718 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
12719 then txt;
12720
12721 case ( txt,
12722 _,
12723 _ )
12724 then txt;
12725 end match;
12726 end fun_375;
12727
12728 protected function fun_376
12729 input Tpl.Text in_txt;
12730 input Boolean in_mArg;
12731 input Tpl.Text in_a_nBooleanInputVariables;
12732
12733 output Tpl.Text out_txt;
12734 algorithm
12735 out_txt :=
12736 match(in_txt, in_mArg, in_a_nBooleanInputVariables)
12737 local
12738 Tpl.Text txt;
12739 Tpl.Text a_nBooleanInputVariables;
12740
12741 case ( txt,
12742 false,
12743 a_nBooleanInputVariables )
12744 algorithm
12745 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Boolean booleanInputVariables["));
12746 ✗ txt := Tpl.writeText(txt, a_nBooleanInputVariables);
12747 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("];"));
12748 then txt;
12749
12750 case ( txt,
12751 _,
12752 _ )
12753 then txt;
12754 end match;
12755 end fun_376;
12756
12757 protected function fun_377
12758 input Tpl.Text in_txt;
12759 input Boolean in_mArg;
12760 input Tpl.Text in_a_booleanInputVariablesReturnNames;
12761
12762 output Tpl.Text out_txt;
12763 algorithm
12764 out_txt :=
12765 match(in_txt, in_mArg, in_a_booleanInputVariablesReturnNames)
12766 local
12767 Tpl.Text txt;
12768 Tpl.Text a_booleanInputVariablesReturnNames;
12769
12770 case ( txt,
12771 false,
12772 a_booleanInputVariablesReturnNames )
12773 algorithm
12774 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Boolean "));
12775 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesReturnNames);
12776 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
12777 then txt;
12778
12779 case ( txt,
12780 _,
12781 _ )
12782 then txt;
12783 end match;
12784 end fun_377;
12785
12786 protected function fun_378
12787 input Tpl.Text in_txt;
12788 input Boolean in_mArg;
12789 input Tpl.Text in_a_nStringInputVariables;
12790
12791 output Tpl.Text out_txt;
12792 algorithm
12793 out_txt :=
12794 match(in_txt, in_mArg, in_a_nStringInputVariables)
12795 local
12796 Tpl.Text txt;
12797 Tpl.Text a_nStringInputVariables;
12798
12799 case ( txt,
12800 false,
12801 a_nStringInputVariables )
12802 algorithm
12803 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("String stringInputVariables["));
12804 ✗ txt := Tpl.writeText(txt, a_nStringInputVariables);
12805 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("];"));
12806 then txt;
12807
12808 case ( txt,
12809 _,
12810 _ )
12811 then txt;
12812 end match;
12813 end fun_378;
12814
12815 protected function fun_379
12816 input Tpl.Text in_txt;
12817 input Boolean in_mArg;
12818 input Tpl.Text in_a_stringInputVariablesReturnNames;
12819
12820 output Tpl.Text out_txt;
12821 algorithm
12822 out_txt :=
12823 match(in_txt, in_mArg, in_a_stringInputVariablesReturnNames)
12824 local
12825 Tpl.Text txt;
12826 Tpl.Text a_stringInputVariablesReturnNames;
12827
12828 case ( txt,
12829 false,
12830 a_stringInputVariablesReturnNames )
12831 algorithm
12832 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("String "));
12833 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesReturnNames);
12834 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
12835 then txt;
12836
12837 case ( txt,
12838 _,
12839 _ )
12840 then txt;
12841 end match;
12842 end fun_379;
12843
12844 protected function fun_380
12845 input Tpl.Text in_txt;
12846 input Boolean in_mArg;
12847 input Tpl.Text in_a_nRealEventInputVariables;
12848
12849 output Tpl.Text out_txt;
12850 algorithm
12851 out_txt :=
12852 match(in_txt, in_mArg, in_a_nRealEventInputVariables)
12853 local
12854 Tpl.Text txt;
12855 Tpl.Text a_nRealEventInputVariables;
12856
12857 case ( txt,
12858 false,
12859 a_nRealEventInputVariables )
12860 algorithm
12861 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Real realEventInputVariables["));
12862 ✗ txt := Tpl.writeText(txt, a_nRealEventInputVariables);
12863 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("](each fixed=true);"));
12864 then txt;
12865
12866 case ( txt,
12867 _,
12868 _ )
12869 then txt;
12870 end match;
12871 end fun_380;
12872
12873 protected function fun_381
12874 input Tpl.Text in_txt;
12875 input Boolean in_mArg;
12876 input Tpl.Text in_a_nIntegerEventInputVariables;
12877
12878 output Tpl.Text out_txt;
12879 algorithm
12880 out_txt :=
12881 match(in_txt, in_mArg, in_a_nIntegerEventInputVariables)
12882 local
12883 Tpl.Text txt;
12884 Tpl.Text a_nIntegerEventInputVariables;
12885
12886 case ( txt,
12887 false,
12888 a_nIntegerEventInputVariables )
12889 algorithm
12890 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Integer integerEventInputVariables["));
12891 ✗ txt := Tpl.writeText(txt, a_nIntegerEventInputVariables);
12892 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("](each fixed=true);"));
12893 then txt;
12894
12895 case ( txt,
12896 _,
12897 _ )
12898 then txt;
12899 end match;
12900 end fun_381;
12901
12902 protected function fun_382
12903 input Tpl.Text in_txt;
12904 input Boolean in_mArg;
12905 input Tpl.Text in_a_nBooleanEventInputVariables;
12906
12907 output Tpl.Text out_txt;
12908 algorithm
12909 out_txt :=
12910 match(in_txt, in_mArg, in_a_nBooleanEventInputVariables)
12911 local
12912 Tpl.Text txt;
12913 Tpl.Text a_nBooleanEventInputVariables;
12914
12915 case ( txt,
12916 false,
12917 a_nBooleanEventInputVariables )
12918 algorithm
12919 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Boolean booleanEventInputVariables["));
12920 ✗ txt := Tpl.writeText(txt, a_nBooleanEventInputVariables);
12921 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("](each fixed=true);"));
12922 then txt;
12923
12924 case ( txt,
12925 _,
12926 _ )
12927 then txt;
12928 end match;
12929 end fun_382;
12930
12931 protected function fun_383
12932 input Tpl.Text in_txt;
12933 input Boolean in_mArg;
12934 input Tpl.Text in_a_nStringEventInputVariables;
12935
12936 output Tpl.Text out_txt;
12937 algorithm
12938 out_txt :=
12939 match(in_txt, in_mArg, in_a_nStringEventInputVariables)
12940 local
12941 Tpl.Text txt;
12942 Tpl.Text a_nStringEventInputVariables;
12943
12944 case ( txt,
12945 false,
12946 a_nStringEventInputVariables )
12947 algorithm
12948 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("String stringEventInputVariables["));
12949 ✗ txt := Tpl.writeText(txt, a_nStringEventInputVariables);
12950 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("](each fixed=true);"));
12951 then txt;
12952
12953 case ( txt,
12954 _,
12955 _ )
12956 then txt;
12957 end match;
12958 end fun_383;
12959
12960 protected function fun_384
12961 input Tpl.Text in_txt;
12962 input Boolean in_mArg;
12963
12964 output Tpl.Text out_txt;
12965 algorithm
12966 out_txt :=
12967 match(in_txt, in_mArg)
12968 local
12969 Tpl.Text txt;
12970
12971 case ( txt,
12972 false )
12973 then txt;
12974
12975 case ( txt,
12976 _ )
12977 algorithm
12978 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("fmi_x = fmi3Functions.fmi3GetContinuousStates(fmi3me, numberOfContinuousStates, flowParamsStart+flowInitialized);"));
12979 then txt;
12980 end match;
12981 end fun_384;
12982
12983 protected function fun_385
12984 input Tpl.Text in_txt;
12985 input Boolean in_mArg;
12986 input Tpl.Text in_a_realParametersNames;
12987 input Tpl.Text in_a_realParametersVRs;
12988
12989 output Tpl.Text out_txt;
12990 algorithm
12991 out_txt :=
12992 match(in_txt, in_mArg, in_a_realParametersNames, in_a_realParametersVRs)
12993 local
12994 Tpl.Text txt;
12995 Tpl.Text a_realParametersNames;
12996 Tpl.Text a_realParametersVRs;
12997
12998 case ( txt,
12999 false,
13000 a_realParametersNames,
13001 a_realParametersVRs )
13002 algorithm
13003 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi3Functions.fmi3SetRealParameter(fmi3me, {"));
13004 ✗ txt := Tpl.writeText(txt, a_realParametersVRs);
13005 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13006 ✗ txt := Tpl.writeText(txt, a_realParametersNames);
13007 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13008 then txt;
13009
13010 case ( txt,
13011 _,
13012 _,
13013 _ )
13014 then txt;
13015 end match;
13016 end fun_385;
13017
13018 protected function fun_386
13019 input Tpl.Text in_txt;
13020 input Boolean in_mArg;
13021 input Tpl.Text in_a_integerParametersNames;
13022 input Tpl.Text in_a_integerParametersVRs;
13023
13024 output Tpl.Text out_txt;
13025 algorithm
13026 out_txt :=
13027 match(in_txt, in_mArg, in_a_integerParametersNames, in_a_integerParametersVRs)
13028 local
13029 Tpl.Text txt;
13030 Tpl.Text a_integerParametersNames;
13031 Tpl.Text a_integerParametersVRs;
13032
13033 case ( txt,
13034 false,
13035 a_integerParametersNames,
13036 a_integerParametersVRs )
13037 algorithm
13038 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi3Functions.fmi3SetIntegerParameter(fmi3me, {"));
13039 ✗ txt := Tpl.writeText(txt, a_integerParametersVRs);
13040 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13041 ✗ txt := Tpl.writeText(txt, a_integerParametersNames);
13042 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13043 then txt;
13044
13045 case ( txt,
13046 _,
13047 _,
13048 _ )
13049 then txt;
13050 end match;
13051 end fun_386;
13052
13053 protected function fun_387
13054 input Tpl.Text in_txt;
13055 input Boolean in_mArg;
13056 input Tpl.Text in_a_booleanParametersNames;
13057 input Tpl.Text in_a_booleanParametersVRs;
13058
13059 output Tpl.Text out_txt;
13060 algorithm
13061 out_txt :=
13062 match(in_txt, in_mArg, in_a_booleanParametersNames, in_a_booleanParametersVRs)
13063 local
13064 Tpl.Text txt;
13065 Tpl.Text a_booleanParametersNames;
13066 Tpl.Text a_booleanParametersVRs;
13067
13068 case ( txt,
13069 false,
13070 a_booleanParametersNames,
13071 a_booleanParametersVRs )
13072 algorithm
13073 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi3Functions.fmi3SetBooleanParameter(fmi3me, {"));
13074 ✗ txt := Tpl.writeText(txt, a_booleanParametersVRs);
13075 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13076 ✗ txt := Tpl.writeText(txt, a_booleanParametersNames);
13077 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13078 then txt;
13079
13080 case ( txt,
13081 _,
13082 _,
13083 _ )
13084 then txt;
13085 end match;
13086 end fun_387;
13087
13088 protected function fun_388
13089 input Tpl.Text in_txt;
13090 input Boolean in_mArg;
13091 input Tpl.Text in_a_stringParametersNames;
13092 input Tpl.Text in_a_stringParametersVRs;
13093
13094 output Tpl.Text out_txt;
13095 algorithm
13096 out_txt :=
13097 match(in_txt, in_mArg, in_a_stringParametersNames, in_a_stringParametersVRs)
13098 local
13099 Tpl.Text txt;
13100 Tpl.Text a_stringParametersNames;
13101 Tpl.Text a_stringParametersVRs;
13102
13103 case ( txt,
13104 false,
13105 a_stringParametersNames,
13106 a_stringParametersVRs )
13107 algorithm
13108 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi3Functions.fmi3SetStringParameter(fmi3me, {"));
13109 ✗ txt := Tpl.writeText(txt, a_stringParametersVRs);
13110 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13111 ✗ txt := Tpl.writeText(txt, a_stringParametersNames);
13112 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13113 then txt;
13114
13115 case ( txt,
13116 _,
13117 _,
13118 _ )
13119 then txt;
13120 end match;
13121 end fun_388;
13122
13123 protected function fun_389
13124 input Tpl.Text in_txt;
13125 input Boolean in_mArg;
13126 input Tpl.Text in_a_realDependentParametersVRs;
13127 input Tpl.Text in_a_realDependentParametersNames;
13128
13129 output Tpl.Text out_txt;
13130 algorithm
13131 out_txt :=
13132 match(in_txt, in_mArg, in_a_realDependentParametersVRs, in_a_realDependentParametersNames)
13133 local
13134 Tpl.Text txt;
13135 Tpl.Text a_realDependentParametersVRs;
13136 Tpl.Text a_realDependentParametersNames;
13137
13138 case ( txt,
13139 false,
13140 a_realDependentParametersVRs,
13141 a_realDependentParametersNames )
13142 algorithm
13143 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13144 ✗ txt := Tpl.writeText(txt, a_realDependentParametersNames);
13145 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi3Functions.fmi3GetReal(fmi3me, {"));
13146 ✗ txt := Tpl.writeText(txt, a_realDependentParametersVRs);
13147 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
13148 then txt;
13149
13150 case ( txt,
13151 _,
13152 _,
13153 _ )
13154 then txt;
13155 end match;
13156 end fun_389;
13157
13158 protected function fun_390
13159 input Tpl.Text in_txt;
13160 input Boolean in_mArg;
13161 input Tpl.Text in_a_integerDependentParametersVRs;
13162 input Tpl.Text in_a_integerDependentParametersNames;
13163
13164 output Tpl.Text out_txt;
13165 algorithm
13166 out_txt :=
13167 match(in_txt, in_mArg, in_a_integerDependentParametersVRs, in_a_integerDependentParametersNames)
13168 local
13169 Tpl.Text txt;
13170 Tpl.Text a_integerDependentParametersVRs;
13171 Tpl.Text a_integerDependentParametersNames;
13172
13173 case ( txt,
13174 false,
13175 a_integerDependentParametersVRs,
13176 a_integerDependentParametersNames )
13177 algorithm
13178 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13179 ✗ txt := Tpl.writeText(txt, a_integerDependentParametersNames);
13180 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi3Functions.fmi3GetInteger(fmi3me, {"));
13181 ✗ txt := Tpl.writeText(txt, a_integerDependentParametersVRs);
13182 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
13183 then txt;
13184
13185 case ( txt,
13186 _,
13187 _,
13188 _ )
13189 then txt;
13190 end match;
13191 end fun_390;
13192
13193 protected function fun_391
13194 input Tpl.Text in_txt;
13195 input Boolean in_mArg;
13196 input Tpl.Text in_a_booleanDependentParametersVRs;
13197 input Tpl.Text in_a_booleanDependentParametersNames;
13198
13199 output Tpl.Text out_txt;
13200 algorithm
13201 out_txt :=
13202 match(in_txt, in_mArg, in_a_booleanDependentParametersVRs, in_a_booleanDependentParametersNames)
13203 local
13204 Tpl.Text txt;
13205 Tpl.Text a_booleanDependentParametersVRs;
13206 Tpl.Text a_booleanDependentParametersNames;
13207
13208 case ( txt,
13209 false,
13210 a_booleanDependentParametersVRs,
13211 a_booleanDependentParametersNames )
13212 algorithm
13213 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13214 ✗ txt := Tpl.writeText(txt, a_booleanDependentParametersNames);
13215 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi3Functions.fmi3GetBoolean(fmi3me, {"));
13216 ✗ txt := Tpl.writeText(txt, a_booleanDependentParametersVRs);
13217 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
13218 then txt;
13219
13220 case ( txt,
13221 _,
13222 _,
13223 _ )
13224 then txt;
13225 end match;
13226 end fun_391;
13227
13228 protected function fun_392
13229 input Tpl.Text in_txt;
13230 input Boolean in_mArg;
13231 input Tpl.Text in_a_stringDependentParametersVRs;
13232 input Tpl.Text in_a_stringDependentParametersNames;
13233
13234 output Tpl.Text out_txt;
13235 algorithm
13236 out_txt :=
13237 match(in_txt, in_mArg, in_a_stringDependentParametersVRs, in_a_stringDependentParametersNames)
13238 local
13239 Tpl.Text txt;
13240 Tpl.Text a_stringDependentParametersVRs;
13241 Tpl.Text a_stringDependentParametersNames;
13242
13243 case ( txt,
13244 false,
13245 a_stringDependentParametersVRs,
13246 a_stringDependentParametersNames )
13247 algorithm
13248 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13249 ✗ txt := Tpl.writeText(txt, a_stringDependentParametersNames);
13250 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi3Functions.fmi3GetString(fmi3me, {"));
13251 ✗ txt := Tpl.writeText(txt, a_stringDependentParametersVRs);
13252 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
13253 then txt;
13254
13255 case ( txt,
13256 _,
13257 _,
13258 _ )
13259 then txt;
13260 end match;
13261 end fun_392;
13262
13263 protected function fun_393
13264 input Tpl.Text in_txt;
13265 input Boolean in_mArg;
13266 input Tpl.Text in_a_realInputVariablesNames;
13267 input Tpl.Text in_a_realInputVariablesVRs;
13268
13269 output Tpl.Text out_txt;
13270 algorithm
13271 out_txt :=
13272 match(in_txt, in_mArg, in_a_realInputVariablesNames, in_a_realInputVariablesVRs)
13273 local
13274 Tpl.Text txt;
13275 Tpl.Text a_realInputVariablesNames;
13276 Tpl.Text a_realInputVariablesVRs;
13277
13278 case ( txt,
13279 false,
13280 a_realInputVariablesNames,
13281 a_realInputVariablesVRs )
13282 algorithm
13283 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("realInputVariables := fmi3Functions.fmi3SetReal(fmi3me, {"));
13284 ✗ txt := Tpl.writeText(txt, a_realInputVariablesVRs);
13285 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13286 ✗ txt := Tpl.writeText(txt, a_realInputVariablesNames);
13287 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13288 then txt;
13289
13290 case ( txt,
13291 _,
13292 _,
13293 _ )
13294 then txt;
13295 end match;
13296 end fun_393;
13297
13298 protected function fun_394
13299 input Tpl.Text in_txt;
13300 input Boolean in_mArg;
13301 input Tpl.Text in_a_integerInputVariablesNames;
13302 input Tpl.Text in_a_integerInputVariablesVRs;
13303
13304 output Tpl.Text out_txt;
13305 algorithm
13306 out_txt :=
13307 match(in_txt, in_mArg, in_a_integerInputVariablesNames, in_a_integerInputVariablesVRs)
13308 local
13309 Tpl.Text txt;
13310 Tpl.Text a_integerInputVariablesNames;
13311 Tpl.Text a_integerInputVariablesVRs;
13312
13313 case ( txt,
13314 false,
13315 a_integerInputVariablesNames,
13316 a_integerInputVariablesVRs )
13317 algorithm
13318 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("integerInputVariables := fmi3Functions.fmi3SetInteger(fmi3me, {"));
13319 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesVRs);
13320 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13321 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesNames);
13322 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13323 then txt;
13324
13325 case ( txt,
13326 _,
13327 _,
13328 _ )
13329 then txt;
13330 end match;
13331 end fun_394;
13332
13333 protected function fun_395
13334 input Tpl.Text in_txt;
13335 input Boolean in_mArg;
13336 input Tpl.Text in_a_booleanInputVariablesNames;
13337 input Tpl.Text in_a_booleanInputVariablesVRs;
13338
13339 output Tpl.Text out_txt;
13340 algorithm
13341 out_txt :=
13342 match(in_txt, in_mArg, in_a_booleanInputVariablesNames, in_a_booleanInputVariablesVRs)
13343 local
13344 Tpl.Text txt;
13345 Tpl.Text a_booleanInputVariablesNames;
13346 Tpl.Text a_booleanInputVariablesVRs;
13347
13348 case ( txt,
13349 false,
13350 a_booleanInputVariablesNames,
13351 a_booleanInputVariablesVRs )
13352 algorithm
13353 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("booleanInputVariables := fmi3Functions.fmi3SetBoolean(fmi3me, {"));
13354 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesVRs);
13355 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13356 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesNames);
13357 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13358 then txt;
13359
13360 case ( txt,
13361 _,
13362 _,
13363 _ )
13364 then txt;
13365 end match;
13366 end fun_395;
13367
13368 protected function fun_396
13369 input Tpl.Text in_txt;
13370 input Boolean in_mArg;
13371 input Tpl.Text in_a_stringStartVariablesNames;
13372 input Tpl.Text in_a_stringInputVariablesVRs;
13373
13374 output Tpl.Text out_txt;
13375 algorithm
13376 out_txt :=
13377 match(in_txt, in_mArg, in_a_stringStartVariablesNames, in_a_stringInputVariablesVRs)
13378 local
13379 Tpl.Text txt;
13380 Tpl.Text a_stringStartVariablesNames;
13381 Tpl.Text a_stringInputVariablesVRs;
13382
13383 case ( txt,
13384 false,
13385 a_stringStartVariablesNames,
13386 a_stringInputVariablesVRs )
13387 algorithm
13388 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("stringInputVariables := fmi3Functions.fmi3SetString(fmi3me, {"));
13389 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesVRs);
13390 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13391 ✗ txt := Tpl.writeText(txt, a_stringStartVariablesNames);
13392 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13393 then txt;
13394
13395 case ( txt,
13396 _,
13397 _,
13398 _ )
13399 then txt;
13400 end match;
13401 end fun_396;
13402
13403 protected function fun_397
13404 input Tpl.Text in_txt;
13405 input Boolean in_mArg;
13406 input Tpl.Text in_a_realInputVariablesReturnNames;
13407
13408 output Tpl.Text out_txt;
13409 algorithm
13410 out_txt :=
13411 match(in_txt, in_mArg, in_a_realInputVariablesReturnNames)
13412 local
13413 Tpl.Text txt;
13414 Tpl.Text a_realInputVariablesReturnNames;
13415
13416 case ( txt,
13417 false,
13418 a_realInputVariablesReturnNames )
13419 algorithm
13420 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13421 ✗ txt := Tpl.writeText(txt, a_realInputVariablesReturnNames);
13422 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = realInputVariables;"));
13423 then txt;
13424
13425 case ( txt,
13426 _,
13427 _ )
13428 then txt;
13429 end match;
13430 end fun_397;
13431
13432 protected function fun_398
13433 input Tpl.Text in_txt;
13434 input Boolean in_mArg;
13435 input Tpl.Text in_a_integerInputVariablesReturnNames;
13436
13437 output Tpl.Text out_txt;
13438 algorithm
13439 out_txt :=
13440 match(in_txt, in_mArg, in_a_integerInputVariablesReturnNames)
13441 local
13442 Tpl.Text txt;
13443 Tpl.Text a_integerInputVariablesReturnNames;
13444
13445 case ( txt,
13446 false,
13447 a_integerInputVariablesReturnNames )
13448 algorithm
13449 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13450 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesReturnNames);
13451 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = integerInputVariables;"));
13452 then txt;
13453
13454 case ( txt,
13455 _,
13456 _ )
13457 then txt;
13458 end match;
13459 end fun_398;
13460
13461 protected function fun_399
13462 input Tpl.Text in_txt;
13463 input Boolean in_mArg;
13464 input Tpl.Text in_a_booleanInputVariablesReturnNames;
13465
13466 output Tpl.Text out_txt;
13467 algorithm
13468 out_txt :=
13469 match(in_txt, in_mArg, in_a_booleanInputVariablesReturnNames)
13470 local
13471 Tpl.Text txt;
13472 Tpl.Text a_booleanInputVariablesReturnNames;
13473
13474 case ( txt,
13475 false,
13476 a_booleanInputVariablesReturnNames )
13477 algorithm
13478 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13479 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesReturnNames);
13480 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = booleanInputVariables;"));
13481 then txt;
13482
13483 case ( txt,
13484 _,
13485 _ )
13486 then txt;
13487 end match;
13488 end fun_399;
13489
13490 protected function fun_400
13491 input Tpl.Text in_txt;
13492 input Boolean in_mArg;
13493 input Tpl.Text in_a_stringInputVariablesReturnNames;
13494
13495 output Tpl.Text out_txt;
13496 algorithm
13497 out_txt :=
13498 match(in_txt, in_mArg, in_a_stringInputVariablesReturnNames)
13499 local
13500 Tpl.Text txt;
13501 Tpl.Text a_stringInputVariablesReturnNames;
13502
13503 case ( txt,
13504 false,
13505 a_stringInputVariablesReturnNames )
13506 algorithm
13507 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13508 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesReturnNames);
13509 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = stringInputVariables;"));
13510 then txt;
13511
13512 case ( txt,
13513 _,
13514 _ )
13515 then txt;
13516 end match;
13517 end fun_400;
13518
13519 protected function fun_401
13520 input Tpl.Text in_txt;
13521 input Boolean in_mArg;
13522 input Tpl.Text in_a_realOutputVariablesVRs;
13523 input Tpl.Text in_a_realOutputVariablesNames;
13524
13525 output Tpl.Text out_txt;
13526 algorithm
13527 out_txt :=
13528 match(in_txt, in_mArg, in_a_realOutputVariablesVRs, in_a_realOutputVariablesNames)
13529 local
13530 Tpl.Text txt;
13531 Tpl.Text a_realOutputVariablesVRs;
13532 Tpl.Text a_realOutputVariablesNames;
13533
13534 case ( txt,
13535 false,
13536 a_realOutputVariablesVRs,
13537 a_realOutputVariablesNames )
13538 algorithm
13539 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13540 1 txt := Tpl.writeText(txt, a_realOutputVariablesNames);
13541 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi3Functions.fmi3GetReal(fmi3me, {"));
13542 1 txt := Tpl.writeText(txt, a_realOutputVariablesVRs);
13543 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
13544 then txt;
13545
13546 case ( txt,
13547 _,
13548 _,
13549 _ )
13550 then txt;
13551 end match;
13552 end fun_401;
13553
13554 protected function fun_402
13555 input Tpl.Text in_txt;
13556 input Boolean in_mArg;
13557 input Tpl.Text in_a_integerOutputVariablesVRs;
13558 input Tpl.Text in_a_integerOutputVariablesNames;
13559
13560 output Tpl.Text out_txt;
13561 algorithm
13562 out_txt :=
13563 match(in_txt, in_mArg, in_a_integerOutputVariablesVRs, in_a_integerOutputVariablesNames)
13564 local
13565 Tpl.Text txt;
13566 Tpl.Text a_integerOutputVariablesVRs;
13567 Tpl.Text a_integerOutputVariablesNames;
13568
13569 case ( txt,
13570 false,
13571 a_integerOutputVariablesVRs,
13572 a_integerOutputVariablesNames )
13573 algorithm
13574 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13575 ✗ txt := Tpl.writeText(txt, a_integerOutputVariablesNames);
13576 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi3Functions.fmi3GetInteger(fmi3me, {"));
13577 ✗ txt := Tpl.writeText(txt, a_integerOutputVariablesVRs);
13578 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
13579 then txt;
13580
13581 case ( txt,
13582 _,
13583 _,
13584 _ )
13585 then txt;
13586 end match;
13587 end fun_402;
13588
13589 protected function fun_403
13590 input Tpl.Text in_txt;
13591 input Boolean in_mArg;
13592 input Tpl.Text in_a_booleanOutputVariablesVRs;
13593 input Tpl.Text in_a_booleanOutputVariablesNames;
13594
13595 output Tpl.Text out_txt;
13596 algorithm
13597 out_txt :=
13598 match(in_txt, in_mArg, in_a_booleanOutputVariablesVRs, in_a_booleanOutputVariablesNames)
13599 local
13600 Tpl.Text txt;
13601 Tpl.Text a_booleanOutputVariablesVRs;
13602 Tpl.Text a_booleanOutputVariablesNames;
13603
13604 case ( txt,
13605 false,
13606 a_booleanOutputVariablesVRs,
13607 a_booleanOutputVariablesNames )
13608 algorithm
13609 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13610 ✗ txt := Tpl.writeText(txt, a_booleanOutputVariablesNames);
13611 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi3Functions.fmi3GetBoolean(fmi3me, {"));
13612 ✗ txt := Tpl.writeText(txt, a_booleanOutputVariablesVRs);
13613 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
13614 then txt;
13615
13616 case ( txt,
13617 _,
13618 _,
13619 _ )
13620 then txt;
13621 end match;
13622 end fun_403;
13623
13624 protected function fun_404
13625 input Tpl.Text in_txt;
13626 input Boolean in_mArg;
13627 input Tpl.Text in_a_stringOutputVariablesVRs;
13628 input Tpl.Text in_a_stringOutputVariablesNames;
13629
13630 output Tpl.Text out_txt;
13631 algorithm
13632 out_txt :=
13633 match(in_txt, in_mArg, in_a_stringOutputVariablesVRs, in_a_stringOutputVariablesNames)
13634 local
13635 Tpl.Text txt;
13636 Tpl.Text a_stringOutputVariablesVRs;
13637 Tpl.Text a_stringOutputVariablesNames;
13638
13639 case ( txt,
13640 false,
13641 a_stringOutputVariablesVRs,
13642 a_stringOutputVariablesNames )
13643 algorithm
13644 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
13645 ✗ txt := Tpl.writeText(txt, a_stringOutputVariablesNames);
13646 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi3Functions.fmi3GetString(fmi3me, {"));
13647 ✗ txt := Tpl.writeText(txt, a_stringOutputVariablesVRs);
13648 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs);"));
13649 then txt;
13650
13651 case ( txt,
13652 _,
13653 _,
13654 _ )
13655 then txt;
13656 end match;
13657 end fun_404;
13658
13659 protected function lm_405
13660 input output Tpl.Text txt;
13661 input list<Integer> items;
13662 algorithm
13663 ✗ for lstElt_405 in items loop
13664 txt := match lstElt_405
13665 local
13666 Integer i_eventIndicator;
13667
13668 case i_eventIndicator
13669 algorithm
13670 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("change(fmi_z_positive["));
13671 ✗ txt := Tpl.writeStr(txt, intString(i_eventIndicator));
13672 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("])"));
13673 ✗ txt := Tpl.nextIter(txt);
13674 then txt;
13675 end match;
13676 end for;
13677 end lm_405;
13678
13679 protected function fun_406
13680 input Tpl.Text in_txt;
13681 input Boolean in_mArg;
13682 input list<Integer> in_a_fmiInfo_fmiNumberOfEventIndicators;
13683
13684 output Tpl.Text out_txt;
13685 algorithm
13686 out_txt :=
13687 match(in_txt, in_mArg, in_a_fmiInfo_fmiNumberOfEventIndicators)
13688 local
13689 Tpl.Text txt;
13690 list<Integer> a_fmiInfo_fmiNumberOfEventIndicators;
13691
13692 case ( txt,
13693 false,
13694 _ )
13695 algorithm
13696 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" when {triggerDSSEvent > flowStatesInputs, pre(nextEventTime) < time, terminal()} then"));
13697 then txt;
13698
13699 case ( txt,
13700 _,
13701 a_fmiInfo_fmiNumberOfEventIndicators )
13702 algorithm
13703 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
13704 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("when {"));
13705 ✗ txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(" or ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
13706 ✗ txt := lm_405(txt, a_fmiInfo_fmiNumberOfEventIndicators);
13707 ✗ txt := Tpl.popIter(txt);
13708 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", triggerDSSEvent > flowStatesInputs, pre(nextEventTime) < time, terminal()} then"));
13709 ✗ txt := Tpl.popBlock(txt);
13710 then txt;
13711 end match;
13712 end fun_406;
13713
13714 protected function fun_407
13715 input Tpl.Text in_txt;
13716 input Boolean in_mArg;
13717 input Tpl.Text in_a_realEventInputVariablesNames;
13718 input Tpl.Text in_a_realEventInputVariablesVRs;
13719
13720 output Tpl.Text out_txt;
13721 algorithm
13722 out_txt :=
13723 match(in_txt, in_mArg, in_a_realEventInputVariablesNames, in_a_realEventInputVariablesVRs)
13724 local
13725 Tpl.Text txt;
13726 Tpl.Text a_realEventInputVariablesNames;
13727 Tpl.Text a_realEventInputVariablesVRs;
13728
13729 case ( txt,
13730 false,
13731 a_realEventInputVariablesNames,
13732 a_realEventInputVariablesVRs )
13733 algorithm
13734 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("realEventInputVariables := fmi3Functions.fmi3SetReal(fmi3me, {"));
13735 ✗ txt := Tpl.writeText(txt, a_realEventInputVariablesVRs);
13736 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13737 ✗ txt := Tpl.writeText(txt, a_realEventInputVariablesNames);
13738 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13739 then txt;
13740
13741 case ( txt,
13742 _,
13743 _,
13744 _ )
13745 then txt;
13746 end match;
13747 end fun_407;
13748
13749 protected function fun_408
13750 input Tpl.Text in_txt;
13751 input Boolean in_mArg;
13752 input Tpl.Text in_a_integerEventInputVariablesNames;
13753 input Tpl.Text in_a_integerEventInputVariablesVRs;
13754
13755 output Tpl.Text out_txt;
13756 algorithm
13757 out_txt :=
13758 match(in_txt, in_mArg, in_a_integerEventInputVariablesNames, in_a_integerEventInputVariablesVRs)
13759 local
13760 Tpl.Text txt;
13761 Tpl.Text a_integerEventInputVariablesNames;
13762 Tpl.Text a_integerEventInputVariablesVRs;
13763
13764 case ( txt,
13765 false,
13766 a_integerEventInputVariablesNames,
13767 a_integerEventInputVariablesVRs )
13768 algorithm
13769 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("integerEventInputVariables := fmi3Functions.fmi3SetInteger(fmi3me, {"));
13770 ✗ txt := Tpl.writeText(txt, a_integerEventInputVariablesVRs);
13771 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13772 ✗ txt := Tpl.writeText(txt, a_integerEventInputVariablesNames);
13773 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13774 then txt;
13775
13776 case ( txt,
13777 _,
13778 _,
13779 _ )
13780 then txt;
13781 end match;
13782 end fun_408;
13783
13784 protected function fun_409
13785 input Tpl.Text in_txt;
13786 input Boolean in_mArg;
13787 input Tpl.Text in_a_booleanEventInputVariablesNames;
13788 input Tpl.Text in_a_booleanEventInputVariablesVRs;
13789
13790 output Tpl.Text out_txt;
13791 algorithm
13792 out_txt :=
13793 match(in_txt, in_mArg, in_a_booleanEventInputVariablesNames, in_a_booleanEventInputVariablesVRs)
13794 local
13795 Tpl.Text txt;
13796 Tpl.Text a_booleanEventInputVariablesNames;
13797 Tpl.Text a_booleanEventInputVariablesVRs;
13798
13799 case ( txt,
13800 false,
13801 a_booleanEventInputVariablesNames,
13802 a_booleanEventInputVariablesVRs )
13803 algorithm
13804 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("booleanEventInputVariables := fmi3Functions.fmi3SetBoolean(fmi3me, {"));
13805 ✗ txt := Tpl.writeText(txt, a_booleanEventInputVariablesVRs);
13806 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13807 ✗ txt := Tpl.writeText(txt, a_booleanEventInputVariablesNames);
13808 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13809 then txt;
13810
13811 case ( txt,
13812 _,
13813 _,
13814 _ )
13815 then txt;
13816 end match;
13817 end fun_409;
13818
13819 protected function fun_410
13820 input Tpl.Text in_txt;
13821 input Boolean in_mArg;
13822 input Tpl.Text in_a_stringEventStartVariablesNames;
13823 input Tpl.Text in_a_stringEventInputVariablesVRs;
13824
13825 output Tpl.Text out_txt;
13826 algorithm
13827 out_txt :=
13828 match(in_txt, in_mArg, in_a_stringEventStartVariablesNames, in_a_stringEventInputVariablesVRs)
13829 local
13830 Tpl.Text txt;
13831 Tpl.Text a_stringEventStartVariablesNames;
13832 Tpl.Text a_stringEventInputVariablesVRs;
13833
13834 case ( txt,
13835 false,
13836 a_stringEventStartVariablesNames,
13837 a_stringEventInputVariablesVRs )
13838 algorithm
13839 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("stringEventInputVariables := fmi3Functions.fmi3SetString(fmi3me, {"));
13840 ✗ txt := Tpl.writeText(txt, a_stringEventInputVariablesVRs);
13841 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
13842 ✗ txt := Tpl.writeText(txt, a_stringEventStartVariablesNames);
13843 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
13844 then txt;
13845
13846 case ( txt,
13847 _,
13848 _,
13849 _ )
13850 then txt;
13851 end match;
13852 end fun_410;
13853
13854 protected function lm_411
13855 input output Tpl.Text txt;
13856 input list<Integer> items;
13857 algorithm
13858
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 time.
3 for lstElt_411 in items loop
13859 txt := match lstElt_411
13860 local
13861 Integer i_continuousStates;
13862
13863 case i_continuousStates
13864 algorithm
13865 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("reinit(fmi_x["));
13866 2 txt := Tpl.writeStr(txt, intString(i_continuousStates));
13867 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("], fmi_x_new["));
13868 2 txt := Tpl.writeStr(txt, intString(i_continuousStates));
13869 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]);"));
13870 2 txt := Tpl.nextIter(txt);
13871 then txt;
13872 end match;
13873 end for;
13874 end lm_411;
13875
13876 protected function fun_412
13877 input Tpl.Text in_txt;
13878 input Boolean in_mArg;
13879 input list<Integer> in_a_fmiInfo_fmiNumberOfContinuousStates;
13880
13881 output Tpl.Text out_txt;
13882 algorithm
13883 out_txt :=
13884 match(in_txt, in_mArg, in_a_fmiInfo_fmiNumberOfContinuousStates)
13885 local
13886 Tpl.Text txt;
13887 list<Integer> a_fmiInfo_fmiNumberOfContinuousStates;
13888
13889 case ( txt,
13890 false,
13891 _ )
13892 then txt;
13893
13894 case ( txt,
13895 _,
13896 a_fmiInfo_fmiNumberOfContinuousStates )
13897 algorithm
13898 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
13899 " if newStatesAvailable then\n",
13900 " fmi_x_new := fmi3Functions.fmi3GetContinuousStates(fmi3me, numberOfContinuousStates, flowStatesInputs);\n"
13901 }, true));
13902 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(6));
13903 1 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
13904 1 txt := lm_411(txt, a_fmiInfo_fmiNumberOfContinuousStates);
13905 1 txt := Tpl.popIter(txt);
13906 1 txt := Tpl.softNewLine(txt);
13907 1 txt := Tpl.popBlock(txt);
13908 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" end if;"));
13909 then txt;
13910 end match;
13911 end fun_412;
13912
13913 protected function fun_413
13914 input Tpl.Text in_txt;
13915 input Boolean in_mArg;
13916 input FMI.Info in_a_fmiInfo;
13917 input String in_a_fmiInfo_fmiModelIdentifier;
13918 input String in_a_name;
13919
13920 output Tpl.Text out_txt;
13921 algorithm
13922 out_txt :=
13923 match(in_txt, in_mArg, in_a_fmiInfo, in_a_fmiInfo_fmiModelIdentifier, in_a_name)
13924 local
13925 Tpl.Text txt;
13926 FMI.Info a_fmiInfo;
13927 String a_fmiInfo_fmiModelIdentifier;
13928 String a_name;
13929 String ret_0;
13930
13931 case ( txt,
13932 false,
13933 _,
13934 _,
13935 a_name )
13936 algorithm
13937 ✗ txt := Tpl.writeStr(txt, a_name);
13938 then txt;
13939
13940 case ( txt,
13941 _,
13942 a_fmiInfo,
13943 a_fmiInfo_fmiModelIdentifier,
13944 _ )
13945 algorithm
13946 1 txt := Tpl.writeStr(txt, a_fmiInfo_fmiModelIdentifier);
13947 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
13948 1 ret_0 := FMI.getFMIType(a_fmiInfo);
13949 1 txt := Tpl.writeStr(txt, ret_0);
13950 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_FMU"));
13951 then txt;
13952 end match;
13953 end fun_413;
13954
13955 public function importFMU3ModelExchange
13956 input Tpl.Text in_txt;
13957 input FMI.FmiImport in_a_fmi;
13958 input String in_a_name;
13959
13960 output Tpl.Text out_txt;
13961 algorithm
13962 out_txt :=
13963 match(in_txt, in_a_fmi, in_a_name)
13964 local
13965 Tpl.Text txt;
13966 String a_name;
13967 Real i_fmiExperimentAnnotation_fmiExperimentTolerance;
13968 Real i_fmiExperimentAnnotation_fmiExperimentStopTime;
13969 Real i_fmiExperimentAnnotation_fmiExperimentStartTime;
13970 list<Integer> i_fmiInfo_fmiNumberOfEventIndicators;
13971 list<Integer> i_fmiInfo_fmiNumberOfContinuousStates;
13972 Boolean i_generateOutputConnectors;
13973 Boolean i_generateInputConnectors;
13974 Boolean i_fmiDebugOutput;
13975 Integer i_fmiLogLevel;
13976 String i_fmuWorkingDirectory;
13977 list<FMI.TypeDefinitions> i_fmiTypeDefinitionsList;
13978 String i_fmiInfo_fmiDescription;
13979 FMI.Info i_fmiInfo;
13980 String i_fmiInfo_fmiModelIdentifier;
13981 list<FMI.ModelVariables> i_fmiModelVariablesList;
13982 Boolean ret_126;
13983 Boolean ret_125;
13984 Integer ret_124;
13985 Boolean ret_123;
13986 Boolean ret_122;
13987 Boolean ret_121;
13988 Boolean ret_120;
13989 Boolean ret_119;
13990 Integer ret_118;
13991 Boolean ret_117;
13992 Boolean ret_116;
13993 Boolean ret_115;
13994 Boolean ret_114;
13995 Boolean ret_113;
13996 Boolean ret_112;
13997 Boolean ret_111;
13998 Boolean ret_110;
13999 Boolean ret_109;
14000 Boolean ret_108;
14001 Boolean ret_107;
14002 Boolean ret_106;
14003 Boolean ret_105;
14004 Boolean ret_104;
14005 Boolean ret_103;
14006 Boolean ret_102;
14007 Boolean ret_101;
14008 Boolean ret_100;
14009 Boolean ret_99;
14010 Boolean ret_98;
14011 Boolean ret_97;
14012 Boolean ret_96;
14013 Boolean ret_95;
14014 Boolean ret_94;
14015 Boolean ret_93;
14016 Boolean ret_92;
14017 Boolean ret_91;
14018 Boolean ret_90;
14019 Boolean ret_89;
14020 Integer ret_88;
14021 Boolean ret_87;
14022 Boolean ret_86;
14023 Boolean ret_85;
14024 Boolean ret_84;
14025 Boolean ret_83;
14026 Boolean ret_82;
14027 Boolean ret_81;
14028 Boolean ret_80;
14029 Boolean ret_79;
14030 Boolean ret_78;
14031 Boolean ret_77;
14032 Boolean ret_76;
14033 Integer ret_75;
14034 Integer ret_74;
14035 Boolean ret_73;
14036 Boolean ret_72;
14037 Tpl.Text l_stringOutputVariablesNames;
14038 Tpl.Text l_stringOutputVariablesVRs;
14039 Tpl.Text l_booleanOutputVariablesNames;
14040 Tpl.Text l_booleanOutputVariablesVRs;
14041 Tpl.Text l_integerOutputVariablesNames;
14042 Tpl.Text l_integerOutputVariablesVRs;
14043 Tpl.Text l_realOutputVariablesNames;
14044 Tpl.Text l_realOutputVariablesVRs;
14045 Tpl.Text l_stringEventInputVariablesReturnNames;
14046 Tpl.Text l_stringEventStartVariablesNames;
14047 Tpl.Text l_stringEventInputVariablesVRs;
14048 Integer ret_60;
14049 list<FMI.ModelVariables> ret_59;
14050 Tpl.Text l_nStringEventInputVariables;
14051 Tpl.Text l_booleanEventInputVariablesReturnNames;
14052 Tpl.Text l_booleanEventInputVariablesNames;
14053 Tpl.Text l_booleanEventInputVariablesVRs;
14054 Integer ret_54;
14055 list<FMI.ModelVariables> ret_53;
14056 Tpl.Text l_nBooleanEventInputVariables;
14057 Tpl.Text l_integerEventInputVariablesReturnNames;
14058 Tpl.Text l_integerEventInputVariablesNames;
14059 Tpl.Text l_integerEventInputVariablesVRs;
14060 Integer ret_48;
14061 list<FMI.ModelVariables> ret_47;
14062 Tpl.Text l_nIntegerEventInputVariables;
14063 Tpl.Text l_realEventInputVariablesReturnNames;
14064 Tpl.Text l_realEventInputVariablesNames;
14065 Tpl.Text l_realEventInputVariablesVRs;
14066 Integer ret_42;
14067 list<FMI.ModelVariables> ret_41;
14068 Tpl.Text l_nRealEventInputVariables;
14069 Tpl.Text l_stringInputVariablesReturnNames;
14070 Tpl.Text l_stringStartVariablesNames;
14071 Tpl.Text l_stringInputVariablesVRs;
14072 Integer ret_36;
14073 list<FMI.ModelVariables> ret_35;
14074 Tpl.Text l_nStringInputVariables;
14075 Tpl.Text l_booleanInputVariablesReturnNames;
14076 Tpl.Text l_booleanInputVariablesNames;
14077 Tpl.Text l_booleanInputVariablesVRs;
14078 Integer ret_30;
14079 list<FMI.ModelVariables> ret_29;
14080 Tpl.Text l_nBooleanInputVariables;
14081 Tpl.Text l_integerInputVariablesReturnNames;
14082 Tpl.Text l_integerInputVariablesNames;
14083 Tpl.Text l_integerInputVariablesVRs;
14084 Integer ret_24;
14085 list<FMI.ModelVariables> ret_23;
14086 Tpl.Text l_nIntegerInputVariables;
14087 Tpl.Text l_realInputVariablesReturnNames;
14088 Tpl.Text l_realInputVariablesNames;
14089 Tpl.Text l_realInputVariablesVRs;
14090 Integer ret_18;
14091 list<FMI.ModelVariables> ret_17;
14092 Tpl.Text l_nRealInputVariables;
14093 Tpl.Text l_stringDependentParametersNames;
14094 Tpl.Text l_stringDependentParametersVRs;
14095 Tpl.Text l_booleanDependentParametersNames;
14096 Tpl.Text l_booleanDependentParametersVRs;
14097 Tpl.Text l_integerDependentParametersNames;
14098 Tpl.Text l_integerDependentParametersVRs;
14099 Tpl.Text l_realDependentParametersNames;
14100 Tpl.Text l_realDependentParametersVRs;
14101 Tpl.Text l_stringParametersNames;
14102 Tpl.Text l_stringParametersVRs;
14103 Tpl.Text l_booleanParametersNames;
14104 Tpl.Text l_booleanParametersVRs;
14105 Tpl.Text l_integerParametersNames;
14106 Tpl.Text l_integerParametersVRs;
14107 Tpl.Text l_realParametersNames;
14108 Tpl.Text l_realParametersVRs;
14109
14110 case ( txt,
14111 FMI.FMIIMPORT(fmiInfo = (i_fmiInfo as FMI.INFO(fmiModelIdentifier = i_fmiInfo_fmiModelIdentifier, fmiDescription = i_fmiInfo_fmiDescription, fmiNumberOfContinuousStates = i_fmiInfo_fmiNumberOfContinuousStates, fmiNumberOfEventIndicators = i_fmiInfo_fmiNumberOfEventIndicators)), fmiExperimentAnnotation = FMI.EXPERIMENTANNOTATION(fmiExperimentStartTime = i_fmiExperimentAnnotation_fmiExperimentStartTime, fmiExperimentStopTime = i_fmiExperimentAnnotation_fmiExperimentStopTime, fmiExperimentTolerance = i_fmiExperimentAnnotation_fmiExperimentTolerance), fmiModelVariablesList = i_fmiModelVariablesList, fmiTypeDefinitionsList = i_fmiTypeDefinitionsList, fmuWorkingDirectory = i_fmuWorkingDirectory, fmiLogLevel = i_fmiLogLevel, fmiDebugOutput = i_fmiDebugOutput, generateInputConnectors = i_generateInputConnectors, generateOutputConnectors = i_generateOutputConnectors),
14112 a_name )
14113 algorithm
14114 1 l_realParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", false, 1, "3.0");
14115 1 l_realParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", false, 2, "3.0");
14116 1 l_integerParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", false, 1, "3.0");
14117 1 l_integerParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", false, 2, "3.0");
14118 1 l_booleanParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", false, 1, "3.0");
14119 1 l_booleanParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", false, 2, "3.0");
14120 1 l_stringParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", false, 1, "3.0");
14121 1 l_stringParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", false, 2, "3.0");
14122 1 l_realDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", true, 1, "3.0");
14123 1 l_realDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", true, 2, "3.0");
14124 1 l_integerDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", true, 1, "3.0");
14125 1 l_integerDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", true, 2, "3.0");
14126 1 l_booleanDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", true, 1, "3.0");
14127 1 l_booleanDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", true, 2, "3.0");
14128 1 l_stringDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", true, 1, "3.0");
14129 1 l_stringDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", true, 2, "3.0");
14130 1 ret_17 := FMI.filterModelVariables(i_fmiModelVariablesList, "real", "input");
14131 1 ret_18 := listLength(ret_17);
14132 1 l_nRealInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_18));
14133 1 l_realInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 1, "3.0");
14134 1 l_realInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 2, "3.0");
14135 1 l_realInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 3, "3.0");
14136 1 ret_23 := FMI.filterModelVariables(i_fmiModelVariablesList, "integer", "input");
14137 1 ret_24 := listLength(ret_23);
14138 1 l_nIntegerInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_24));
14139 1 l_integerInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 1, "3.0");
14140 1 l_integerInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 2, "3.0");
14141 1 l_integerInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 3, "3.0");
14142 1 ret_29 := FMI.filterModelVariables(i_fmiModelVariablesList, "boolean", "input");
14143 1 ret_30 := listLength(ret_29);
14144 1 l_nBooleanInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_30));
14145 1 l_booleanInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 1, "3.0");
14146 1 l_booleanInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 2, "3.0");
14147 1 l_booleanInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 3, "3.0");
14148 1 ret_35 := FMI.filterModelVariables(i_fmiModelVariablesList, "string", "input");
14149 1 ret_36 := listLength(ret_35);
14150 1 l_nStringInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_36));
14151 1 l_stringInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 1, "3.0");
14152 1 l_stringStartVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 2, "3.0");
14153 1 l_stringInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 3, "3.0");
14154 1 ret_41 := FMI.filterModelVariables(i_fmiModelVariablesList, "real", "input");
14155 1 ret_42 := listLength(ret_41);
14156 1 l_nRealEventInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_42));
14157 1 l_realEventInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 1, "3.0");
14158 1 l_realEventInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 2, "3.0");
14159 1 l_realEventInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 3, "3.0");
14160 1 ret_47 := FMI.filterModelVariables(i_fmiModelVariablesList, "integer", "input");
14161 1 ret_48 := listLength(ret_47);
14162 1 l_nIntegerEventInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_48));
14163 1 l_integerEventInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 1, "3.0");
14164 1 l_integerEventInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 2, "3.0");
14165 1 l_integerEventInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 3, "3.0");
14166 1 ret_53 := FMI.filterModelVariables(i_fmiModelVariablesList, "boolean", "input");
14167 1 ret_54 := listLength(ret_53);
14168 1 l_nBooleanEventInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_54));
14169 1 l_booleanEventInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 1, "3.0");
14170 1 l_booleanEventInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 2, "3.0");
14171 1 l_booleanEventInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 3, "3.0");
14172 1 ret_59 := FMI.filterModelVariables(i_fmiModelVariablesList, "string", "input");
14173 1 ret_60 := listLength(ret_59);
14174 1 l_nStringEventInputVariables := Tpl.writeStr(Tpl.emptyTxt, intString(ret_60));
14175 1 l_stringEventInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 1, "3.0");
14176 1 l_stringEventStartVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 2, "3.0");
14177 1 l_stringEventInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 3, "3.0");
14178 1 l_realOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "output", false, 1, "3.0");
14179 1 l_realOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "output", false, 2, "3.0");
14180 1 l_integerOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "output", false, 1, "3.0");
14181 1 l_integerOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "output", false, 2, "3.0");
14182 1 l_booleanOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "output", false, 1, "3.0");
14183 1 l_booleanOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "output", false, 2, "3.0");
14184 1 l_stringOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "output", false, 1, "3.0");
14185 1 l_stringOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "output", false, 2, "3.0");
14186 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("model "));
14187
2/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
1 ret_72 := stringEq(a_name, "");
14188 1 txt := fun_370(txt, ret_72, i_fmiInfo, i_fmiInfo_fmiModelIdentifier, a_name);
14189
2/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
1 ret_73 := stringEq(i_fmiInfo_fmiDescription, "");
14190 1 txt := fun_371(txt, ret_73, i_fmiInfo_fmiDescription);
14191 1 txt := Tpl.softNewLine(txt);
14192 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
14193 1 txt := dumpFMITypeDefinitions(txt, i_fmiTypeDefinitionsList);
14194 1 txt := Tpl.softNewLine(txt);
14195 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("constant String fmuWorkingDir = \""));
14196 1 txt := Tpl.writeStr(txt, i_fmuWorkingDirectory);
14197 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14198 "\";\n",
14199 "parameter Integer logLevel = "
14200 }, false));
14201 1 txt := Tpl.writeStr(txt, intString(i_fmiLogLevel));
14202 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14203 " \"log level used during the loading of FMU\" annotation (Dialog(tab=\"FMI\", group=\"Enable logging\"));\n",
14204 "parameter Boolean debugLogging = "
14205 }, false));
14206 1 txt := Tpl.writeStr(txt, Tpl.booleanString(i_fmiDebugOutput));
14207 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" \"enables the FMU simulation logging\" annotation (Dialog(tab=\"FMI\", group=\"Enable logging\"));\n"));
14208 1 txt := dumpFMIModelVariablesList(txt, "3.0", i_fmiModelVariablesList, i_fmiTypeDefinitionsList, i_generateInputConnectors, i_generateOutputConnectors);
14209 1 txt := Tpl.softNewLine(txt);
14210 1 txt := Tpl.popBlock(txt);
14211 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("protected\n"));
14212 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
14213 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("FMI3ModelExchange fmi3me = FMI3ModelExchange(logLevel, fmuWorkingDir, \""));
14214 1 txt := Tpl.writeStr(txt, i_fmiInfo_fmiModelIdentifier);
14215 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14216 "\", debugLogging);\n",
14217 "constant Integer numberOfContinuousStates = "
14218 }, false));
14219 1 ret_74 := listLength(i_fmiInfo_fmiNumberOfContinuousStates);
14220 1 txt := Tpl.writeStr(txt, intString(ret_74));
14221 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14222 ";\n",
14223 "Real fmi_x[numberOfContinuousStates] \"States\";\n",
14224 "Real fmi_x_new[numberOfContinuousStates](each fixed=true) \"New States\";\n",
14225 "constant Integer numberOfEventIndicators = "
14226 }, false));
14227 1 ret_75 := listLength(i_fmiInfo_fmiNumberOfEventIndicators);
14228 1 txt := Tpl.writeStr(txt, intString(ret_75));
14229 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14230 ";\n",
14231 "Real fmi_z[numberOfEventIndicators] \"Events Indicators\";\n",
14232 "Boolean fmi_z_positive[numberOfEventIndicators](each fixed=true);\n",
14233 "parameter Real flowStartTime(fixed=false);\n",
14234 "Real flowTime;\n",
14235 "parameter Real flowEnterInitialization(fixed=false);\n",
14236 "parameter Real flowInitialized(fixed=false);\n",
14237 "parameter Real flowParamsStart(fixed=false);\n",
14238 "parameter Real flowInitInputs(fixed=false);\n",
14239 "Real flowStatesInputs;\n"
14240 }, true));
14241
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_76 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
14242 1 txt := fun_372(txt, ret_76, l_nRealInputVariables);
14243 1 txt := Tpl.softNewLine(txt);
14244
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_77 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
14245 1 txt := fun_373(txt, ret_77, l_realInputVariablesReturnNames);
14246 1 txt := Tpl.softNewLine(txt);
14247
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_78 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
14248 1 txt := fun_374(txt, ret_78, l_nIntegerInputVariables);
14249 1 txt := Tpl.softNewLine(txt);
14250
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_79 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
14251 1 txt := fun_375(txt, ret_79, l_integerInputVariablesReturnNames);
14252 1 txt := Tpl.softNewLine(txt);
14253
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_80 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
14254 1 txt := fun_376(txt, ret_80, l_nBooleanInputVariables);
14255 1 txt := Tpl.softNewLine(txt);
14256
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_81 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
14257 1 txt := fun_377(txt, ret_81, l_booleanInputVariablesReturnNames);
14258 1 txt := Tpl.softNewLine(txt);
14259
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_82 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
14260 1 txt := fun_378(txt, ret_82, l_nStringInputVariables);
14261 1 txt := Tpl.softNewLine(txt);
14262
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_83 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
14263 1 txt := fun_379(txt, ret_83, l_stringInputVariablesReturnNames);
14264 1 txt := Tpl.softNewLine(txt);
14265
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_84 := stringEq(Tpl.textString(l_realEventInputVariablesVRs), "");
14266 1 txt := fun_380(txt, ret_84, l_nRealEventInputVariables);
14267 1 txt := Tpl.softNewLine(txt);
14268
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_85 := stringEq(Tpl.textString(l_integerEventInputVariablesVRs), "");
14269 1 txt := fun_381(txt, ret_85, l_nIntegerEventInputVariables);
14270 1 txt := Tpl.softNewLine(txt);
14271
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_86 := stringEq(Tpl.textString(l_booleanEventInputVariablesVRs), "");
14272 1 txt := fun_382(txt, ret_86, l_nBooleanEventInputVariables);
14273 1 txt := Tpl.softNewLine(txt);
14274
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_87 := stringEq(Tpl.textString(l_stringEventInputVariablesVRs), "");
14275 1 txt := fun_383(txt, ret_87, l_nStringEventInputVariables);
14276 1 txt := Tpl.softNewLine(txt);
14277 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14278 "Boolean callEventUpdate;\n",
14279 "Boolean newStatesAvailable(fixed = true);\n",
14280 "Real triggerDSSEvent;\n",
14281 "Real nextEventTime(fixed = true);\n"
14282 }, true));
14283 1 txt := Tpl.popBlock(txt);
14284 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("initial equation\n"));
14285 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
14286 1 ret_88 := listLength(i_fmiInfo_fmiNumberOfContinuousStates);
14287 1 ret_89 := intGt(ret_88, 0);
14288 1 txt := fun_384(txt, ret_89);
14289 1 txt := Tpl.softNewLine(txt);
14290 1 txt := Tpl.popBlock(txt);
14291 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14292 "initial algorithm\n",
14293 " flowParamsStart := 1;\n",
14294 " flowInitInputs := 1;\n",
14295 " flowStartTime := flowParamsStart+flowInitInputs;\n",
14296 " flowEnterInitialization := fmi3Functions.fmi3EnterInitialization(fmi3me, false, 0.0, time, false, 0.0, flowParamsStart+flowInitInputs);\n",
14297 " /* the parameters must be set while the FMU is still in Initialization Mode,\n",
14298 " otherwise the FMU computes its calculated parameters from the default values */\n"
14299 }, true));
14300 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
14301
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_90 := stringEq(Tpl.textString(l_realParametersVRs), "");
14302 1 txt := fun_385(txt, ret_90, l_realParametersNames, l_realParametersVRs);
14303 1 txt := Tpl.softNewLine(txt);
14304
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_91 := stringEq(Tpl.textString(l_integerParametersVRs), "");
14305 1 txt := fun_386(txt, ret_91, l_integerParametersNames, l_integerParametersVRs);
14306 1 txt := Tpl.softNewLine(txt);
14307
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_92 := stringEq(Tpl.textString(l_booleanParametersVRs), "");
14308 1 txt := fun_387(txt, ret_92, l_booleanParametersNames, l_booleanParametersVRs);
14309 1 txt := Tpl.softNewLine(txt);
14310
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_93 := stringEq(Tpl.textString(l_stringParametersVRs), "");
14311 1 txt := fun_388(txt, ret_93, l_stringParametersNames, l_stringParametersVRs);
14312 1 txt := Tpl.softNewLine(txt);
14313 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("flowInitialized := fmi3Functions.fmi3ExitInitialization(fmi3me, flowParamsStart+flowInitInputs+flowStartTime+flowEnterInitialization);\n"));
14314 1 txt := Tpl.popBlock(txt);
14315 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("initial equation\n"));
14316 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
14317
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_94 := stringEq(Tpl.textString(l_realDependentParametersVRs), "");
14318 1 txt := fun_389(txt, ret_94, l_realDependentParametersVRs, l_realDependentParametersNames);
14319 1 txt := Tpl.softNewLine(txt);
14320
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_95 := stringEq(Tpl.textString(l_integerDependentParametersVRs), "");
14321 1 txt := fun_390(txt, ret_95, l_integerDependentParametersVRs, l_integerDependentParametersNames);
14322 1 txt := Tpl.softNewLine(txt);
14323
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_96 := stringEq(Tpl.textString(l_booleanDependentParametersVRs), "");
14324 1 txt := fun_391(txt, ret_96, l_booleanDependentParametersVRs, l_booleanDependentParametersNames);
14325 1 txt := Tpl.softNewLine(txt);
14326
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_97 := stringEq(Tpl.textString(l_stringDependentParametersVRs), "");
14327 1 txt := fun_392(txt, ret_97, l_stringDependentParametersVRs, l_stringDependentParametersNames);
14328 1 txt := Tpl.softNewLine(txt);
14329 1 txt := Tpl.popBlock(txt);
14330 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14331 "algorithm\n",
14332 " flowTime := if not initial() then fmi3Functions.fmi3SetTime(fmi3me, time, flowInitialized) else time;\n",
14333 " /* algorithm section ensures that inputs to fmi (if any) are set directly after the new time is set */\n"
14334 }, true));
14335 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
14336
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_98 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
14337 1 txt := fun_393(txt, ret_98, l_realInputVariablesNames, l_realInputVariablesVRs);
14338 1 txt := Tpl.softNewLine(txt);
14339
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_99 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
14340 1 txt := fun_394(txt, ret_99, l_integerInputVariablesNames, l_integerInputVariablesVRs);
14341 1 txt := Tpl.softNewLine(txt);
14342
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_100 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
14343 1 txt := fun_395(txt, ret_100, l_booleanInputVariablesNames, l_booleanInputVariablesVRs);
14344 1 txt := Tpl.softNewLine(txt);
14345
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_101 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
14346 1 txt := fun_396(txt, ret_101, l_stringStartVariablesNames, l_stringInputVariablesVRs);
14347 1 txt := Tpl.softNewLine(txt);
14348 1 txt := Tpl.popBlock(txt);
14349 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("equation\n"));
14350 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
14351
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_102 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
14352 1 txt := fun_397(txt, ret_102, l_realInputVariablesReturnNames);
14353 1 txt := Tpl.softNewLine(txt);
14354
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_103 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
14355 1 txt := fun_398(txt, ret_103, l_integerInputVariablesReturnNames);
14356 1 txt := Tpl.softNewLine(txt);
14357
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_104 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
14358 1 txt := fun_399(txt, ret_104, l_booleanInputVariablesReturnNames);
14359 1 txt := Tpl.softNewLine(txt);
14360
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_105 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
14361 1 txt := fun_400(txt, ret_105, l_stringInputVariablesReturnNames);
14362 1 txt := Tpl.softNewLine(txt);
14363 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14364 "flowStatesInputs = fmi3Functions.fmi3SetContinuousStates(fmi3me, fmi_x, flowParamsStart + flowTime);\n",
14365 "der(fmi_x) = fmi3Functions.fmi3GetDerivatives(fmi3me, numberOfContinuousStates, flowStatesInputs);\n",
14366 "fmi_z = fmi3Functions.fmi3GetEventIndicators(fmi3me, numberOfEventIndicators, flowStatesInputs);\n",
14367 "for i in 1:size(fmi_z,1) loop\n",
14368 " fmi_z_positive[i] = if not terminal() then fmi_z[i] > 0 else pre(fmi_z_positive[i]);\n",
14369 "end for;\n",
14370 "\n",
14371 "triggerDSSEvent = noEvent(if callEventUpdate then flowStatesInputs+1.0 else flowStatesInputs-1.0);\n",
14372 "\n"
14373 }, true));
14374
1/4
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 ret_106 := stringEq(Tpl.textString(l_realOutputVariablesNames), "");
14375
1/4
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 ret_107 := stringEq(Tpl.textString(l_realOutputVariablesVRs), "");
14376 1 ret_108 := boolAnd(ret_106, ret_107);
14377 1 txt := fun_401(txt, ret_108, l_realOutputVariablesVRs, l_realOutputVariablesNames);
14378 1 txt := Tpl.softNewLine(txt);
14379
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_109 := stringEq(Tpl.textString(l_integerOutputVariablesNames), "");
14380
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_110 := stringEq(Tpl.textString(l_integerOutputVariablesVRs), "");
14381 1 ret_111 := boolAnd(ret_109, ret_110);
14382 1 txt := fun_402(txt, ret_111, l_integerOutputVariablesVRs, l_integerOutputVariablesNames);
14383 1 txt := Tpl.softNewLine(txt);
14384
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_112 := stringEq(Tpl.textString(l_booleanOutputVariablesNames), "");
14385
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_113 := stringEq(Tpl.textString(l_booleanOutputVariablesVRs), "");
14386 1 ret_114 := boolAnd(ret_112, ret_113);
14387 1 txt := fun_403(txt, ret_114, l_booleanOutputVariablesVRs, l_booleanOutputVariablesNames);
14388 1 txt := Tpl.softNewLine(txt);
14389
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_115 := stringEq(Tpl.textString(l_stringOutputVariablesNames), "");
14390
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_116 := stringEq(Tpl.textString(l_stringOutputVariablesVRs), "");
14391 1 ret_117 := boolAnd(ret_115, ret_116);
14392 1 txt := fun_404(txt, ret_117, l_stringOutputVariablesVRs, l_stringOutputVariablesNames);
14393 1 txt := Tpl.softNewLine(txt);
14394 1 txt := dumpOutputGetEnumerationVariables(txt, i_fmiModelVariablesList, i_fmiTypeDefinitionsList, "fmi3Functions.fmi3GetInteger", "fmi3me");
14395 1 txt := Tpl.softNewLine(txt);
14396 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("callEventUpdate = fmi3Functions.fmi3CompletedIntegratorStep(fmi3me, flowStatesInputs+flowTime);\n"));
14397 1 txt := Tpl.popBlock(txt);
14398 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("algorithm\n"));
14399 1 ret_118 := listLength(i_fmiInfo_fmiNumberOfEventIndicators);
14400 1 ret_119 := intGt(ret_118, 0);
14401 1 txt := fun_406(txt, ret_119, i_fmiInfo_fmiNumberOfEventIndicators);
14402 1 txt := Tpl.softNewLine(txt);
14403 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" fmi3Functions.fmi3StartEventUpdate(fmi3me);\n"));
14404 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
14405
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_120 := stringEq(Tpl.textString(l_realEventInputVariablesVRs), "");
14406 1 txt := fun_407(txt, ret_120, l_realEventInputVariablesNames, l_realEventInputVariablesVRs);
14407 1 txt := Tpl.softNewLine(txt);
14408
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_121 := stringEq(Tpl.textString(l_integerEventInputVariablesVRs), "");
14409 1 txt := fun_408(txt, ret_121, l_integerEventInputVariablesNames, l_integerEventInputVariablesVRs);
14410 1 txt := Tpl.softNewLine(txt);
14411
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_122 := stringEq(Tpl.textString(l_booleanEventInputVariablesVRs), "");
14412 1 txt := fun_409(txt, ret_122, l_booleanEventInputVariablesNames, l_booleanEventInputVariablesVRs);
14413 1 txt := Tpl.softNewLine(txt);
14414
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_123 := stringEq(Tpl.textString(l_stringEventInputVariablesVRs), "");
14415 1 txt := fun_410(txt, ret_123, l_stringEventStartVariablesNames, l_stringEventInputVariablesVRs);
14416 1 txt := Tpl.softNewLine(txt);
14417 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14418 "newStatesAvailable := fmi3Functions.fmi3EndEventUpdate(fmi3me);\n",
14419 "nextEventTime := fmi3Functions.fmi3nextEventTime(fmi3me, flowStatesInputs);\n"
14420 }, true));
14421 1 txt := Tpl.popBlock(txt);
14422 1 ret_124 := listLength(i_fmiInfo_fmiNumberOfContinuousStates);
14423 1 ret_125 := intGt(ret_124, 0);
14424 1 txt := fun_412(txt, ret_125, i_fmiInfo_fmiNumberOfContinuousStates);
14425 1 txt := Tpl.softNewLine(txt);
14426 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" end when;\n"));
14427 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
14428 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("annotation(experiment(StartTime="));
14429 1 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentStartTime));
14430 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", StopTime="));
14431 1 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentStopTime));
14432 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", Tolerance="));
14433 1 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentTolerance));
14434 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14435 "));\n",
14436 "annotation (Icon(graphics={\n",
14437 " Rectangle(\n",
14438 " extent={{-100,100},{100,-100}},\n",
14439 " lineColor={0,0,0},\n",
14440 " fillColor={240,240,240},\n",
14441 " fillPattern=FillPattern.Solid,\n",
14442 " lineThickness=0.5),\n",
14443 " Text(\n",
14444 " extent={{-100,40},{100,0}},\n",
14445 " lineColor={0,0,0},\n",
14446 " textString=\"%name\"),\n",
14447 " Text(\n",
14448 " extent={{-100,-50},{100,-90}},\n",
14449 " lineColor={0,0,0},\n",
14450 " textString=\"V3.0\")}));\n"
14451 }, true));
14452 1 txt := Tpl.popBlock(txt);
14453 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14454 "protected\n",
14455 " class FMI3ModelExchange\n",
14456 " extends ExternalObject;\n",
14457 " function constructor\n",
14458 " input Integer logLevel;\n",
14459 " input String workingDirectory;\n",
14460 " input String instanceName;\n",
14461 " input Boolean debugLogging;\n",
14462 " output FMI3ModelExchange fmi3me;\n",
14463 " external \"C\" fmi3me = FMI3ModelExchangeConstructor_OMC(logLevel, workingDirectory, instanceName, debugLogging) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14464 " end constructor;\n",
14465 "\n",
14466 " function destructor\n",
14467 " input FMI3ModelExchange fmi3me;\n",
14468 " external \"C\" FMI3ModelExchangeDestructor_OMC(fmi3me) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14469 " end destructor;\n",
14470 " end FMI3ModelExchange;\n",
14471 "\n"
14472 }, true));
14473 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
14474 1 txt := dumpFMITypeDefinitionsMappingFunctions(txt, i_fmiTypeDefinitionsList);
14475 1 txt := Tpl.softNewLine(txt);
14476 1 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
14477 1 txt := dumpFMITypeDefinitionsArrayMappingFunctions(txt, i_fmiTypeDefinitionsList);
14478 1 txt := Tpl.softNewLine(txt);
14479 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
14480 "\n",
14481 "package fmi3Functions\n",
14482 " function fmi3SetTime\n",
14483 " input FMI3ModelExchange fmi3me;\n",
14484 " input Real inTime;\n",
14485 " input Real inFlow;\n",
14486 " output Real outFlow = inFlow;\n",
14487 " external \"C\" fmi3SetTime_OMC(fmi3me, inTime) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14488 " end fmi3SetTime;\n",
14489 "\n",
14490 " function fmi3EnterInitialization\n",
14491 " \"FMI 3.0 folded what fmi2SetupExperiment carried into fmi3EnterInitializationMode.\"\n",
14492 " input FMI3ModelExchange fmi3me;\n",
14493 " input Boolean inToleranceDefined;\n",
14494 " input Real inTolerance;\n",
14495 " input Real inStartTime;\n",
14496 " input Boolean inStopTimeDefined;\n",
14497 " input Real inStopTime;\n",
14498 " input Real inFlowVariable;\n",
14499 " output Real outFlowVariable = inFlowVariable;\n",
14500 " external \"C\" fmi3EnterInitializationModel_OMC(fmi3me, inToleranceDefined, inTolerance, inStartTime, inStopTimeDefined, inStopTime) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14501 " end fmi3EnterInitialization;\n",
14502 "\n",
14503 " function fmi3ExitInitialization\n",
14504 " input FMI3ModelExchange fmi3me;\n",
14505 " input Real inFlowVariable;\n",
14506 " output Real outFlowVariable = inFlowVariable;\n",
14507 " external \"C\" fmi3ExitInitializationModel_OMC(fmi3me) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14508 " end fmi3ExitInitialization;\n",
14509 "\n",
14510 " function fmi3GetContinuousStates\n",
14511 " input FMI3ModelExchange fmi3me;\n",
14512 " input Integer numberOfContinuousStates;\n",
14513 " input Real inFlowParams;\n",
14514 " output Real fmi_x[numberOfContinuousStates];\n",
14515 " external \"C\" fmi3GetContinuousStates_OMC(fmi3me, numberOfContinuousStates, inFlowParams, fmi_x) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14516 " end fmi3GetContinuousStates;\n",
14517 "\n",
14518 " function fmi3SetContinuousStates\n",
14519 " input FMI3ModelExchange fmi3me;\n",
14520 " input Real fmi_x[:];\n",
14521 " input Real inFlowParams;\n",
14522 " output Real outFlowStates;\n",
14523 " external \"C\" outFlowStates = fmi3SetContinuousStates_OMC(fmi3me, size(fmi_x, 1), inFlowParams, fmi_x) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14524 " end fmi3SetContinuousStates;\n",
14525 "\n",
14526 " function fmi3GetDerivatives\n",
14527 " input FMI3ModelExchange fmi3me;\n",
14528 " input Integer numberOfContinuousStates;\n",
14529 " input Real inFlowStates;\n",
14530 " output Real fmi_x[numberOfContinuousStates];\n",
14531 " external \"C\" fmi3GetDerivatives_OMC(fmi3me, numberOfContinuousStates, inFlowStates, fmi_x) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14532 " end fmi3GetDerivatives;\n",
14533 "\n",
14534 " function fmi3GetEventIndicators\n",
14535 " input FMI3ModelExchange fmi3me;\n",
14536 " input Integer numberOfEventIndicators;\n",
14537 " input Real inFlowStates;\n",
14538 " output Real fmi_z[numberOfEventIndicators];\n",
14539 " external \"C\" fmi3GetEventIndicators_OMC(fmi3me, numberOfEventIndicators, inFlowStates, fmi_z) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14540 " end fmi3GetEventIndicators;\n",
14541 "\n",
14542 " function fmi3GetReal\n",
14543 " input FMI3ModelExchange fmi3me;\n",
14544 " input Real realValuesReferences[:];\n",
14545 " input Real inFlowStatesInput;\n",
14546 " output Real realValues[size(realValuesReferences, 1)];\n",
14547 " external \"C\" fmi3GetReal_OMC(fmi3me, size(realValuesReferences, 1), realValuesReferences, inFlowStatesInput, realValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14548 " end fmi3GetReal;\n",
14549 "\n",
14550 " function fmi3SetReal\n",
14551 " input FMI3ModelExchange fmi3me;\n",
14552 " input Real realValueReferences[:];\n",
14553 " input Real realValues[size(realValueReferences, 1)];\n",
14554 " output Real outValues[size(realValueReferences, 1)] = realValues;\n",
14555 " external \"C\" fmi3SetReal_OMC(fmi3me, size(realValueReferences, 1), realValueReferences, realValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14556 " end fmi3SetReal;\n",
14557 "\n",
14558 " function fmi3SetRealParameter\n",
14559 " input FMI3ModelExchange fmi3me;\n",
14560 " input Real realValueReferences[:];\n",
14561 " input Real realValues[size(realValueReferences, 1)];\n",
14562 " output Real out_Value = 1;\n",
14563 " external \"C\" fmi3SetReal_OMC(fmi3me, size(realValueReferences, 1), realValueReferences, realValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14564 " end fmi3SetRealParameter;\n",
14565 "\n",
14566 " function fmi3GetInteger\n",
14567 " input FMI3ModelExchange fmi3me;\n",
14568 " input Real integerValueReferences[:];\n",
14569 " input Real inFlowStatesInput;\n",
14570 " output Integer integerValues[size(integerValueReferences, 1)];\n",
14571 " external \"C\" fmi3GetInteger_OMC(fmi3me, size(integerValueReferences, 1), integerValueReferences, inFlowStatesInput, integerValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14572 " end fmi3GetInteger;\n",
14573 "\n",
14574 " function fmi3SetInteger\n",
14575 " input FMI3ModelExchange fmi3me;\n",
14576 " input Real integerValuesReferences[:];\n",
14577 " input Integer integerValues[size(integerValuesReferences, 1)];\n",
14578 " output Integer outValues[size(integerValuesReferences, 1)] = integerValues;\n",
14579 " external \"C\" fmi3SetInteger_OMC(fmi3me, size(integerValuesReferences, 1), integerValuesReferences, integerValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14580 " end fmi3SetInteger;\n",
14581 "\n",
14582 " function fmi3SetIntegerParameter\n",
14583 " input FMI3ModelExchange fmi3me;\n",
14584 " input Real integerValuesReferences[:];\n",
14585 " input Integer integerValues[size(integerValuesReferences, 1)];\n",
14586 " output Real out_Value = 1;\n",
14587 " external \"C\" fmi3SetInteger_OMC(fmi3me, size(integerValuesReferences, 1), integerValuesReferences, integerValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14588 " end fmi3SetIntegerParameter;\n",
14589 "\n",
14590 " function fmi3GetBoolean\n",
14591 " input FMI3ModelExchange fmi3me;\n",
14592 " input Real booleanValuesReferences[:];\n",
14593 " input Real inFlowStatesInput;\n",
14594 " output Boolean booleanValues[size(booleanValuesReferences, 1)];\n",
14595 " external \"C\" fmi3GetBoolean_OMC(fmi3me, size(booleanValuesReferences, 1), booleanValuesReferences, inFlowStatesInput, booleanValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14596 " end fmi3GetBoolean;\n",
14597 "\n",
14598 " function fmi3SetBoolean\n",
14599 " input FMI3ModelExchange fmi3me;\n",
14600 " input Real booleanValueReferences[:];\n",
14601 " input Boolean booleanValues[size(booleanValueReferences, 1)];\n",
14602 " output Boolean outValues[size(booleanValueReferences, 1)] = booleanValues;\n",
14603 " external \"C\" fmi3SetBoolean_OMC(fmi3me, size(booleanValueReferences, 1), booleanValueReferences, booleanValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14604 " end fmi3SetBoolean;\n",
14605 "\n",
14606 " function fmi3SetBooleanParameter\n",
14607 " input FMI3ModelExchange fmi3me;\n",
14608 " input Real booleanValueReferences[:];\n",
14609 " input Boolean booleanValues[size(booleanValueReferences, 1)];\n",
14610 " output Real out_Value = 1;\n",
14611 " external \"C\" fmi3SetBoolean_OMC(fmi3me, size(booleanValueReferences, 1), booleanValueReferences, booleanValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14612 " end fmi3SetBooleanParameter;\n",
14613 "\n",
14614 " function fmi3GetString\n",
14615 " input FMI3ModelExchange fmi3me;\n",
14616 " input Real stringValuesReferences[:];\n",
14617 " input Real inFlowStatesInput;\n",
14618 " output String stringValues[size(stringValuesReferences, 1)];\n",
14619 " external \"C\" fmi3GetString_OMC(fmi3me, size(stringValuesReferences, 1), stringValuesReferences, inFlowStatesInput, stringValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14620 " end fmi3GetString;\n",
14621 "\n",
14622 " function fmi3SetString\n",
14623 " input FMI3ModelExchange fmi3me;\n",
14624 " input Real stringValueReferences[:];\n",
14625 " input String stringValues[size(stringValueReferences, 1)];\n",
14626 " output String outValues[size(stringValueReferences, 1)] = stringValues;\n",
14627 " external \"C\" fmi3SetString_OMC(fmi3me, size(stringValueReferences, 1), stringValueReferences, stringValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14628 " end fmi3SetString;\n",
14629 "\n",
14630 " function fmi3SetStringParameter\n",
14631 " input FMI3ModelExchange fmi3me;\n",
14632 " input Real stringValueReferences[:];\n",
14633 " input String stringValues[size(stringValueReferences, 1)];\n",
14634 " output Real out_Value = 1;\n",
14635 " external \"C\" fmi3SetString_OMC(fmi3me, size(stringValueReferences, 1), stringValueReferences, stringValues) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14636 " end fmi3SetStringParameter;\n",
14637 "\n",
14638 " function fmi3StartEventUpdate\n",
14639 " input FMI3ModelExchange fmi3me;\n",
14640 " external \"C\" fmi3StartEventUpdate_OMC(fmi3me) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14641 " end fmi3StartEventUpdate;\n",
14642 "\n",
14643 " function fmi3EndEventUpdate\n",
14644 " input FMI3ModelExchange fmi3me;\n",
14645 " output Boolean outNewStatesAvailable;\n",
14646 " external \"C\" outNewStatesAvailable = fmi3EndEventUpdate_OMC(fmi3me) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14647 " end fmi3EndEventUpdate;\n",
14648 "\n",
14649 " function fmi3nextEventTime\n",
14650 " input FMI3ModelExchange fmi3me;\n",
14651 " input Real inFlowStates;\n",
14652 " output Real outNewnextTime;\n",
14653 " external \"C\" outNewnextTime = fmi3nextEventTime_OMC(fmi3me, inFlowStates) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14654 " end fmi3nextEventTime;\n",
14655 "\n",
14656 " function fmi3CompletedIntegratorStep\n",
14657 " input FMI3ModelExchange fmi3me;\n",
14658 " input Real inFlowStates;\n",
14659 " output Boolean outCallEventUpdate;\n",
14660 " external \"C\" outCallEventUpdate = fmi3CompletedIntegratorStep_OMC(fmi3me, inFlowStates) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
14661 " end fmi3CompletedIntegratorStep;\n",
14662 "end fmi3Functions;\n"
14663 }, true));
14664 1 txt := Tpl.popBlock(txt);
14665 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
14666
2/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
1 ret_126 := stringEq(a_name, "");
14667 1 txt := fun_413(txt, ret_126, i_fmiInfo, i_fmiInfo_fmiModelIdentifier, a_name);
14668 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
14669 then txt;
14670
14671 case ( txt,
14672 _,
14673 _ )
14674 then txt;
14675 end match;
14676 end importFMU3ModelExchange;
14677
14678 protected function fun_415
14679 input Tpl.Text in_txt;
14680 input Boolean in_mArg;
14681 input FMI.Info in_a_fmiInfo;
14682 input String in_a_fmiInfo_fmiModelIdentifier;
14683 input String in_a_name;
14684
14685 output Tpl.Text out_txt;
14686 algorithm
14687 out_txt :=
14688 match(in_txt, in_mArg, in_a_fmiInfo, in_a_fmiInfo_fmiModelIdentifier, in_a_name)
14689 local
14690 Tpl.Text txt;
14691 FMI.Info a_fmiInfo;
14692 String a_fmiInfo_fmiModelIdentifier;
14693 String a_name;
14694 String ret_0;
14695
14696 case ( txt,
14697 false,
14698 _,
14699 _,
14700 a_name )
14701 algorithm
14702 ✗ txt := Tpl.writeStr(txt, a_name);
14703 then txt;
14704
14705 case ( txt,
14706 _,
14707 a_fmiInfo,
14708 a_fmiInfo_fmiModelIdentifier,
14709 _ )
14710 algorithm
14711 1 txt := Tpl.writeStr(txt, a_fmiInfo_fmiModelIdentifier);
14712 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
14713 1 ret_0 := FMI.getFMIType(a_fmiInfo);
14714 1 txt := Tpl.writeStr(txt, ret_0);
14715 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_FMU"));
14716 then txt;
14717 end match;
14718 end fun_415;
14719
14720 protected function fun_416
14721 input Tpl.Text in_txt;
14722 input Boolean in_mArg;
14723 input String in_a_fmiInfo_fmiDescription;
14724
14725 output Tpl.Text out_txt;
14726 algorithm
14727 out_txt :=
14728 match(in_txt, in_mArg, in_a_fmiInfo_fmiDescription)
14729 local
14730 Tpl.Text txt;
14731 String a_fmiInfo_fmiDescription;
14732
14733 case ( txt,
14734 false,
14735 a_fmiInfo_fmiDescription )
14736 algorithm
14737 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" \""));
14738 ✗ txt := Tpl.writeStr(txt, a_fmiInfo_fmiDescription);
14739 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
14740 then txt;
14741
14742 case ( txt,
14743 _,
14744 _ )
14745 then txt;
14746 end match;
14747 end fun_416;
14748
14749 protected function fun_417
14750 input Tpl.Text in_txt;
14751 input Boolean in_mArg;
14752 input Tpl.Text in_a_realInputVariablesReturnNames;
14753
14754 output Tpl.Text out_txt;
14755 algorithm
14756 out_txt :=
14757 match(in_txt, in_mArg, in_a_realInputVariablesReturnNames)
14758 local
14759 Tpl.Text txt;
14760 Tpl.Text a_realInputVariablesReturnNames;
14761
14762 case ( txt,
14763 false,
14764 a_realInputVariablesReturnNames )
14765 algorithm
14766 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Real "));
14767 ✗ txt := Tpl.writeText(txt, a_realInputVariablesReturnNames);
14768 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
14769 then txt;
14770
14771 case ( txt,
14772 _,
14773 _ )
14774 then txt;
14775 end match;
14776 end fun_417;
14777
14778 protected function fun_418
14779 input Tpl.Text in_txt;
14780 input Boolean in_mArg;
14781 input Tpl.Text in_a_integerInputVariablesReturnNames;
14782
14783 output Tpl.Text out_txt;
14784 algorithm
14785 out_txt :=
14786 match(in_txt, in_mArg, in_a_integerInputVariablesReturnNames)
14787 local
14788 Tpl.Text txt;
14789 Tpl.Text a_integerInputVariablesReturnNames;
14790
14791 case ( txt,
14792 false,
14793 a_integerInputVariablesReturnNames )
14794 algorithm
14795 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Integer "));
14796 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesReturnNames);
14797 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
14798 then txt;
14799
14800 case ( txt,
14801 _,
14802 _ )
14803 then txt;
14804 end match;
14805 end fun_418;
14806
14807 protected function fun_419
14808 input Tpl.Text in_txt;
14809 input Boolean in_mArg;
14810 input Tpl.Text in_a_booleanInputVariablesReturnNames;
14811
14812 output Tpl.Text out_txt;
14813 algorithm
14814 out_txt :=
14815 match(in_txt, in_mArg, in_a_booleanInputVariablesReturnNames)
14816 local
14817 Tpl.Text txt;
14818 Tpl.Text a_booleanInputVariablesReturnNames;
14819
14820 case ( txt,
14821 false,
14822 a_booleanInputVariablesReturnNames )
14823 algorithm
14824 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Boolean "));
14825 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesReturnNames);
14826 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
14827 then txt;
14828
14829 case ( txt,
14830 _,
14831 _ )
14832 then txt;
14833 end match;
14834 end fun_419;
14835
14836 protected function fun_420
14837 input Tpl.Text in_txt;
14838 input Boolean in_mArg;
14839 input Tpl.Text in_a_stringInputVariablesReturnNames;
14840
14841 output Tpl.Text out_txt;
14842 algorithm
14843 out_txt :=
14844 match(in_txt, in_mArg, in_a_stringInputVariablesReturnNames)
14845 local
14846 Tpl.Text txt;
14847 Tpl.Text a_stringInputVariablesReturnNames;
14848
14849 case ( txt,
14850 false,
14851 a_stringInputVariablesReturnNames )
14852 algorithm
14853 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("String "));
14854 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesReturnNames);
14855 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
14856 then txt;
14857
14858 case ( txt,
14859 _,
14860 _ )
14861 then txt;
14862 end match;
14863 end fun_420;
14864
14865 protected function fun_421
14866 input Tpl.Text in_txt;
14867 input Boolean in_mArg;
14868 input Tpl.Text in_a_realParametersNames;
14869 input Tpl.Text in_a_realParametersVRs;
14870
14871 output Tpl.Text out_txt;
14872 algorithm
14873 out_txt :=
14874 match(in_txt, in_mArg, in_a_realParametersNames, in_a_realParametersVRs)
14875 local
14876 Tpl.Text txt;
14877 Tpl.Text a_realParametersNames;
14878 Tpl.Text a_realParametersVRs;
14879
14880 case ( txt,
14881 false,
14882 a_realParametersNames,
14883 a_realParametersVRs )
14884 algorithm
14885 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi1Functions.fmi1SetRealParameter(fmi1cs, {"));
14886 1 txt := Tpl.writeText(txt, a_realParametersVRs);
14887 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
14888 1 txt := Tpl.writeText(txt, a_realParametersNames);
14889 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
14890 then txt;
14891
14892 case ( txt,
14893 _,
14894 _,
14895 _ )
14896 then txt;
14897 end match;
14898 end fun_421;
14899
14900 protected function fun_422
14901 input Tpl.Text in_txt;
14902 input Boolean in_mArg;
14903 input Tpl.Text in_a_integerParametersNames;
14904 input Tpl.Text in_a_integerParametersVRs;
14905
14906 output Tpl.Text out_txt;
14907 algorithm
14908 out_txt :=
14909 match(in_txt, in_mArg, in_a_integerParametersNames, in_a_integerParametersVRs)
14910 local
14911 Tpl.Text txt;
14912 Tpl.Text a_integerParametersNames;
14913 Tpl.Text a_integerParametersVRs;
14914
14915 case ( txt,
14916 false,
14917 a_integerParametersNames,
14918 a_integerParametersVRs )
14919 algorithm
14920 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi1Functions.fmi1SetIntegerParameter(fmi1cs, {"));
14921 ✗ txt := Tpl.writeText(txt, a_integerParametersVRs);
14922 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
14923 ✗ txt := Tpl.writeText(txt, a_integerParametersNames);
14924 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
14925 then txt;
14926
14927 case ( txt,
14928 _,
14929 _,
14930 _ )
14931 then txt;
14932 end match;
14933 end fun_422;
14934
14935 protected function fun_423
14936 input Tpl.Text in_txt;
14937 input Boolean in_mArg;
14938 input Tpl.Text in_a_booleanParametersNames;
14939 input Tpl.Text in_a_booleanParametersVRs;
14940
14941 output Tpl.Text out_txt;
14942 algorithm
14943 out_txt :=
14944 match(in_txt, in_mArg, in_a_booleanParametersNames, in_a_booleanParametersVRs)
14945 local
14946 Tpl.Text txt;
14947 Tpl.Text a_booleanParametersNames;
14948 Tpl.Text a_booleanParametersVRs;
14949
14950 case ( txt,
14951 false,
14952 a_booleanParametersNames,
14953 a_booleanParametersVRs )
14954 algorithm
14955 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi1Functions.fmi1SetBooleanParameter(fmi1cs, {"));
14956 ✗ txt := Tpl.writeText(txt, a_booleanParametersVRs);
14957 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
14958 ✗ txt := Tpl.writeText(txt, a_booleanParametersNames);
14959 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
14960 then txt;
14961
14962 case ( txt,
14963 _,
14964 _,
14965 _ )
14966 then txt;
14967 end match;
14968 end fun_423;
14969
14970 protected function fun_424
14971 input Tpl.Text in_txt;
14972 input Boolean in_mArg;
14973 input Tpl.Text in_a_stringParametersNames;
14974 input Tpl.Text in_a_stringParametersVRs;
14975
14976 output Tpl.Text out_txt;
14977 algorithm
14978 out_txt :=
14979 match(in_txt, in_mArg, in_a_stringParametersNames, in_a_stringParametersVRs)
14980 local
14981 Tpl.Text txt;
14982 Tpl.Text a_stringParametersNames;
14983 Tpl.Text a_stringParametersVRs;
14984
14985 case ( txt,
14986 false,
14987 a_stringParametersNames,
14988 a_stringParametersVRs )
14989 algorithm
14990 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("flowParamsStart := fmi1Functions.fmi1SetStringParameter(fmi1cs, {"));
14991 ✗ txt := Tpl.writeText(txt, a_stringParametersVRs);
14992 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
14993 ✗ txt := Tpl.writeText(txt, a_stringParametersNames);
14994 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
14995 then txt;
14996
14997 case ( txt,
14998 _,
14999 _,
15000 _ )
15001 then txt;
15002 end match;
15003 end fun_424;
15004
15005 protected function fun_425
15006 input Tpl.Text in_txt;
15007 input Boolean in_mArg;
15008 input Tpl.Text in_a_realDependentParametersVRs;
15009 input Tpl.Text in_a_realDependentParametersNames;
15010
15011 output Tpl.Text out_txt;
15012 algorithm
15013 out_txt :=
15014 match(in_txt, in_mArg, in_a_realDependentParametersVRs, in_a_realDependentParametersNames)
15015 local
15016 Tpl.Text txt;
15017 Tpl.Text a_realDependentParametersVRs;
15018 Tpl.Text a_realDependentParametersNames;
15019
15020 case ( txt,
15021 false,
15022 a_realDependentParametersVRs,
15023 a_realDependentParametersNames )
15024 algorithm
15025 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15026 ✗ txt := Tpl.writeText(txt, a_realDependentParametersNames);
15027 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetReal(fmi1cs, {"));
15028 ✗ txt := Tpl.writeText(txt, a_realDependentParametersVRs);
15029 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
15030 then txt;
15031
15032 case ( txt,
15033 _,
15034 _,
15035 _ )
15036 then txt;
15037 end match;
15038 end fun_425;
15039
15040 protected function fun_426
15041 input Tpl.Text in_txt;
15042 input Boolean in_mArg;
15043 input Tpl.Text in_a_integerDependentParametersVRs;
15044 input Tpl.Text in_a_integerDependentParametersNames;
15045
15046 output Tpl.Text out_txt;
15047 algorithm
15048 out_txt :=
15049 match(in_txt, in_mArg, in_a_integerDependentParametersVRs, in_a_integerDependentParametersNames)
15050 local
15051 Tpl.Text txt;
15052 Tpl.Text a_integerDependentParametersVRs;
15053 Tpl.Text a_integerDependentParametersNames;
15054
15055 case ( txt,
15056 false,
15057 a_integerDependentParametersVRs,
15058 a_integerDependentParametersNames )
15059 algorithm
15060 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15061 ✗ txt := Tpl.writeText(txt, a_integerDependentParametersNames);
15062 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetInteger(fmi1cs, {"));
15063 ✗ txt := Tpl.writeText(txt, a_integerDependentParametersVRs);
15064 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
15065 then txt;
15066
15067 case ( txt,
15068 _,
15069 _,
15070 _ )
15071 then txt;
15072 end match;
15073 end fun_426;
15074
15075 protected function fun_427
15076 input Tpl.Text in_txt;
15077 input Boolean in_mArg;
15078 input Tpl.Text in_a_booleanDependentParametersVRs;
15079 input Tpl.Text in_a_booleanDependentParametersNames;
15080
15081 output Tpl.Text out_txt;
15082 algorithm
15083 out_txt :=
15084 match(in_txt, in_mArg, in_a_booleanDependentParametersVRs, in_a_booleanDependentParametersNames)
15085 local
15086 Tpl.Text txt;
15087 Tpl.Text a_booleanDependentParametersVRs;
15088 Tpl.Text a_booleanDependentParametersNames;
15089
15090 case ( txt,
15091 false,
15092 a_booleanDependentParametersVRs,
15093 a_booleanDependentParametersNames )
15094 algorithm
15095 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15096 ✗ txt := Tpl.writeText(txt, a_booleanDependentParametersNames);
15097 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetBoolean(fmi1cs, {"));
15098 ✗ txt := Tpl.writeText(txt, a_booleanDependentParametersVRs);
15099 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
15100 then txt;
15101
15102 case ( txt,
15103 _,
15104 _,
15105 _ )
15106 then txt;
15107 end match;
15108 end fun_427;
15109
15110 protected function fun_428
15111 input Tpl.Text in_txt;
15112 input Boolean in_mArg;
15113 input Tpl.Text in_a_stringDependentParametersVRs;
15114 input Tpl.Text in_a_stringDependentParametersNames;
15115
15116 output Tpl.Text out_txt;
15117 algorithm
15118 out_txt :=
15119 match(in_txt, in_mArg, in_a_stringDependentParametersVRs, in_a_stringDependentParametersNames)
15120 local
15121 Tpl.Text txt;
15122 Tpl.Text a_stringDependentParametersVRs;
15123 Tpl.Text a_stringDependentParametersNames;
15124
15125 case ( txt,
15126 false,
15127 a_stringDependentParametersVRs,
15128 a_stringDependentParametersNames )
15129 algorithm
15130 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15131 ✗ txt := Tpl.writeText(txt, a_stringDependentParametersNames);
15132 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetString(fmi1cs, {"));
15133 ✗ txt := Tpl.writeText(txt, a_stringDependentParametersVRs);
15134 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
15135 then txt;
15136
15137 case ( txt,
15138 _,
15139 _,
15140 _ )
15141 then txt;
15142 end match;
15143 end fun_428;
15144
15145 protected function fun_429
15146 input Tpl.Text in_txt;
15147 input Boolean in_mArg;
15148 input Tpl.Text in_a_realOutputVariablesVRs;
15149 input Tpl.Text in_a_realOutputVariablesNames;
15150
15151 output Tpl.Text out_txt;
15152 algorithm
15153 out_txt :=
15154 match(in_txt, in_mArg, in_a_realOutputVariablesVRs, in_a_realOutputVariablesNames)
15155 local
15156 Tpl.Text txt;
15157 Tpl.Text a_realOutputVariablesVRs;
15158 Tpl.Text a_realOutputVariablesNames;
15159
15160 case ( txt,
15161 false,
15162 a_realOutputVariablesVRs,
15163 a_realOutputVariablesNames )
15164 algorithm
15165 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15166 1 txt := Tpl.writeText(txt, a_realOutputVariablesNames);
15167 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetReal(fmi1cs, {"));
15168 1 txt := Tpl.writeText(txt, a_realOutputVariablesVRs);
15169 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
15170 then txt;
15171
15172 case ( txt,
15173 _,
15174 _,
15175 _ )
15176 then txt;
15177 end match;
15178 end fun_429;
15179
15180 protected function fun_430
15181 input Tpl.Text in_txt;
15182 input Boolean in_mArg;
15183 input Tpl.Text in_a_integerOutputVariablesVRs;
15184 input Tpl.Text in_a_integerOutputVariablesNames;
15185
15186 output Tpl.Text out_txt;
15187 algorithm
15188 out_txt :=
15189 match(in_txt, in_mArg, in_a_integerOutputVariablesVRs, in_a_integerOutputVariablesNames)
15190 local
15191 Tpl.Text txt;
15192 Tpl.Text a_integerOutputVariablesVRs;
15193 Tpl.Text a_integerOutputVariablesNames;
15194
15195 case ( txt,
15196 false,
15197 a_integerOutputVariablesVRs,
15198 a_integerOutputVariablesNames )
15199 algorithm
15200 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15201 ✗ txt := Tpl.writeText(txt, a_integerOutputVariablesNames);
15202 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetInteger(fmi1cs, {"));
15203 ✗ txt := Tpl.writeText(txt, a_integerOutputVariablesVRs);
15204 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
15205 then txt;
15206
15207 case ( txt,
15208 _,
15209 _,
15210 _ )
15211 then txt;
15212 end match;
15213 end fun_430;
15214
15215 protected function fun_431
15216 input Tpl.Text in_txt;
15217 input Boolean in_mArg;
15218 input Tpl.Text in_a_booleanOutputVariablesVRs;
15219 input Tpl.Text in_a_booleanOutputVariablesNames;
15220
15221 output Tpl.Text out_txt;
15222 algorithm
15223 out_txt :=
15224 match(in_txt, in_mArg, in_a_booleanOutputVariablesVRs, in_a_booleanOutputVariablesNames)
15225 local
15226 Tpl.Text txt;
15227 Tpl.Text a_booleanOutputVariablesVRs;
15228 Tpl.Text a_booleanOutputVariablesNames;
15229
15230 case ( txt,
15231 false,
15232 a_booleanOutputVariablesVRs,
15233 a_booleanOutputVariablesNames )
15234 algorithm
15235 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15236 ✗ txt := Tpl.writeText(txt, a_booleanOutputVariablesNames);
15237 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetBoolean(fmi1cs, {"));
15238 ✗ txt := Tpl.writeText(txt, a_booleanOutputVariablesVRs);
15239 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
15240 then txt;
15241
15242 case ( txt,
15243 _,
15244 _,
15245 _ )
15246 then txt;
15247 end match;
15248 end fun_431;
15249
15250 protected function fun_432
15251 input Tpl.Text in_txt;
15252 input Boolean in_mArg;
15253 input Tpl.Text in_a_stringOutputVariablesVRs;
15254 input Tpl.Text in_a_stringOutputVariablesNames;
15255
15256 output Tpl.Text out_txt;
15257 algorithm
15258 out_txt :=
15259 match(in_txt, in_mArg, in_a_stringOutputVariablesVRs, in_a_stringOutputVariablesNames)
15260 local
15261 Tpl.Text txt;
15262 Tpl.Text a_stringOutputVariablesVRs;
15263 Tpl.Text a_stringOutputVariablesNames;
15264
15265 case ( txt,
15266 false,
15267 a_stringOutputVariablesVRs,
15268 a_stringOutputVariablesNames )
15269 algorithm
15270 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15271 ✗ txt := Tpl.writeText(txt, a_stringOutputVariablesNames);
15272 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1GetString(fmi1cs, {"));
15273 ✗ txt := Tpl.writeText(txt, a_stringOutputVariablesVRs);
15274 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowInitialized);"));
15275 then txt;
15276
15277 case ( txt,
15278 _,
15279 _,
15280 _ )
15281 then txt;
15282 end match;
15283 end fun_432;
15284
15285 protected function fun_433
15286 input Tpl.Text in_txt;
15287 input Boolean in_mArg;
15288 input Tpl.Text in_a_realInputVariablesNames;
15289 input Tpl.Text in_a_realInputVariablesVRs;
15290 input Tpl.Text in_a_realInputVariablesReturnNames;
15291
15292 output Tpl.Text out_txt;
15293 algorithm
15294 out_txt :=
15295 match(in_txt, in_mArg, in_a_realInputVariablesNames, in_a_realInputVariablesVRs, in_a_realInputVariablesReturnNames)
15296 local
15297 Tpl.Text txt;
15298 Tpl.Text a_realInputVariablesNames;
15299 Tpl.Text a_realInputVariablesVRs;
15300 Tpl.Text a_realInputVariablesReturnNames;
15301
15302 case ( txt,
15303 false,
15304 a_realInputVariablesNames,
15305 a_realInputVariablesVRs,
15306 a_realInputVariablesReturnNames )
15307 algorithm
15308 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15309 ✗ txt := Tpl.writeText(txt, a_realInputVariablesReturnNames);
15310 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1SetReal(fmi1cs, {"));
15311 ✗ txt := Tpl.writeText(txt, a_realInputVariablesVRs);
15312 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
15313 ✗ txt := Tpl.writeText(txt, a_realInputVariablesNames);
15314 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
15315 then txt;
15316
15317 case ( txt,
15318 _,
15319 _,
15320 _,
15321 _ )
15322 then txt;
15323 end match;
15324 end fun_433;
15325
15326 protected function fun_434
15327 input Tpl.Text in_txt;
15328 input Boolean in_mArg;
15329 input Tpl.Text in_a_integerInputVariablesNames;
15330 input Tpl.Text in_a_integerInputVariablesVRs;
15331 input Tpl.Text in_a_integerInputVariablesReturnNames;
15332
15333 output Tpl.Text out_txt;
15334 algorithm
15335 out_txt :=
15336 match(in_txt, in_mArg, in_a_integerInputVariablesNames, in_a_integerInputVariablesVRs, in_a_integerInputVariablesReturnNames)
15337 local
15338 Tpl.Text txt;
15339 Tpl.Text a_integerInputVariablesNames;
15340 Tpl.Text a_integerInputVariablesVRs;
15341 Tpl.Text a_integerInputVariablesReturnNames;
15342
15343 case ( txt,
15344 false,
15345 a_integerInputVariablesNames,
15346 a_integerInputVariablesVRs,
15347 a_integerInputVariablesReturnNames )
15348 algorithm
15349 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15350 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesReturnNames);
15351 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1SetInteger(fmi1cs, {"));
15352 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesVRs);
15353 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
15354 ✗ txt := Tpl.writeText(txt, a_integerInputVariablesNames);
15355 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
15356 then txt;
15357
15358 case ( txt,
15359 _,
15360 _,
15361 _,
15362 _ )
15363 then txt;
15364 end match;
15365 end fun_434;
15366
15367 protected function fun_435
15368 input Tpl.Text in_txt;
15369 input Boolean in_mArg;
15370 input Tpl.Text in_a_booleanInputVariablesNames;
15371 input Tpl.Text in_a_booleanInputVariablesVRs;
15372 input Tpl.Text in_a_booleanInputVariablesReturnNames;
15373
15374 output Tpl.Text out_txt;
15375 algorithm
15376 out_txt :=
15377 match(in_txt, in_mArg, in_a_booleanInputVariablesNames, in_a_booleanInputVariablesVRs, in_a_booleanInputVariablesReturnNames)
15378 local
15379 Tpl.Text txt;
15380 Tpl.Text a_booleanInputVariablesNames;
15381 Tpl.Text a_booleanInputVariablesVRs;
15382 Tpl.Text a_booleanInputVariablesReturnNames;
15383
15384 case ( txt,
15385 false,
15386 a_booleanInputVariablesNames,
15387 a_booleanInputVariablesVRs,
15388 a_booleanInputVariablesReturnNames )
15389 algorithm
15390 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15391 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesReturnNames);
15392 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1SetBoolean(fmi1cs, {"));
15393 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesVRs);
15394 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
15395 ✗ txt := Tpl.writeText(txt, a_booleanInputVariablesNames);
15396 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
15397 then txt;
15398
15399 case ( txt,
15400 _,
15401 _,
15402 _,
15403 _ )
15404 then txt;
15405 end match;
15406 end fun_435;
15407
15408 protected function fun_436
15409 input Tpl.Text in_txt;
15410 input Boolean in_mArg;
15411 input Tpl.Text in_a_stringStartVariablesNames;
15412 input Tpl.Text in_a_stringInputVariablesVRs;
15413 input Tpl.Text in_a_stringInputVariablesReturnNames;
15414
15415 output Tpl.Text out_txt;
15416 algorithm
15417 out_txt :=
15418 match(in_txt, in_mArg, in_a_stringStartVariablesNames, in_a_stringInputVariablesVRs, in_a_stringInputVariablesReturnNames)
15419 local
15420 Tpl.Text txt;
15421 Tpl.Text a_stringStartVariablesNames;
15422 Tpl.Text a_stringInputVariablesVRs;
15423 Tpl.Text a_stringInputVariablesReturnNames;
15424
15425 case ( txt,
15426 false,
15427 a_stringStartVariablesNames,
15428 a_stringInputVariablesVRs,
15429 a_stringInputVariablesReturnNames )
15430 algorithm
15431 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
15432 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesReturnNames);
15433 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = fmi1Functions.fmi1SetString(fmi1cs, {"));
15434 ✗ txt := Tpl.writeText(txt, a_stringInputVariablesVRs);
15435 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, {"));
15436 ✗ txt := Tpl.writeText(txt, a_stringStartVariablesNames);
15437 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("});"));
15438 then txt;
15439
15440 case ( txt,
15441 _,
15442 _,
15443 _,
15444 _ )
15445 then txt;
15446 end match;
15447 end fun_436;
15448
15449 protected function fun_437
15450 input Tpl.Text in_txt;
15451 input Boolean in_mArg;
15452 input FMI.Info in_a_fmiInfo;
15453 input String in_a_fmiInfo_fmiModelIdentifier;
15454 input String in_a_name;
15455
15456 output Tpl.Text out_txt;
15457 algorithm
15458 out_txt :=
15459 match(in_txt, in_mArg, in_a_fmiInfo, in_a_fmiInfo_fmiModelIdentifier, in_a_name)
15460 local
15461 Tpl.Text txt;
15462 FMI.Info a_fmiInfo;
15463 String a_fmiInfo_fmiModelIdentifier;
15464 String a_name;
15465 String ret_0;
15466
15467 case ( txt,
15468 false,
15469 _,
15470 _,
15471 a_name )
15472 algorithm
15473 ✗ txt := Tpl.writeStr(txt, a_name);
15474 then txt;
15475
15476 case ( txt,
15477 _,
15478 a_fmiInfo,
15479 a_fmiInfo_fmiModelIdentifier,
15480 _ )
15481 algorithm
15482 1 txt := Tpl.writeStr(txt, a_fmiInfo_fmiModelIdentifier);
15483 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
15484 1 ret_0 := FMI.getFMIType(a_fmiInfo);
15485 1 txt := Tpl.writeStr(txt, ret_0);
15486 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_FMU"));
15487 then txt;
15488 end match;
15489 end fun_437;
15490
15491 public function importFMU1CoSimulationStandAlone
15492 input Tpl.Text in_txt;
15493 input FMI.FmiImport in_a_fmi;
15494 input String in_a_name;
15495
15496 output Tpl.Text out_txt;
15497 algorithm
15498 out_txt :=
15499 match(in_txt, in_a_fmi, in_a_name)
15500 local
15501 Tpl.Text txt;
15502 String a_name;
15503 Real i_fmiExperimentAnnotation_fmiExperimentTolerance;
15504 Boolean i_generateOutputConnectors;
15505 Boolean i_generateInputConnectors;
15506 Real i_fmiExperimentAnnotation_fmiExperimentStopTime;
15507 Real i_fmiExperimentAnnotation_fmiExperimentStartTime;
15508 Boolean i_fmiDebugOutput;
15509 Integer i_fmiLogLevel;
15510 String i_fmuWorkingDirectory;
15511 list<FMI.TypeDefinitions> i_fmiTypeDefinitionsList;
15512 String i_fmiInfo_fmiDescription;
15513 FMI.Info i_fmiInfo;
15514 String i_fmiInfo_fmiModelIdentifier;
15515 list<FMI.ModelVariables> i_fmiModelVariablesList;
15516 Boolean ret_66;
15517 Boolean ret_65;
15518 Boolean ret_64;
15519 Boolean ret_63;
15520 Boolean ret_62;
15521 Boolean ret_61;
15522 Boolean ret_60;
15523 Boolean ret_59;
15524 Boolean ret_58;
15525 Boolean ret_57;
15526 Boolean ret_56;
15527 Boolean ret_55;
15528 Boolean ret_54;
15529 Boolean ret_53;
15530 Boolean ret_52;
15531 Boolean ret_51;
15532 Boolean ret_50;
15533 Boolean ret_49;
15534 Boolean ret_48;
15535 Boolean ret_47;
15536 Boolean ret_46;
15537 Boolean ret_45;
15538 Boolean ret_44;
15539 Boolean ret_43;
15540 Boolean ret_42;
15541 Boolean ret_41;
15542 Boolean ret_40;
15543 Boolean ret_39;
15544 Boolean ret_38;
15545 Boolean ret_37;
15546 Boolean ret_36;
15547 Tpl.Text l_stringOutputVariablesNames;
15548 Tpl.Text l_stringOutputVariablesVRs;
15549 Tpl.Text l_booleanOutputVariablesNames;
15550 Tpl.Text l_booleanOutputVariablesVRs;
15551 Tpl.Text l_integerOutputVariablesNames;
15552 Tpl.Text l_integerOutputVariablesVRs;
15553 Tpl.Text l_realOutputVariablesNames;
15554 Tpl.Text l_realOutputVariablesVRs;
15555 Tpl.Text l_stringInputVariablesReturnNames;
15556 Tpl.Text l_stringStartVariablesNames;
15557 Tpl.Text l_stringInputVariablesVRs;
15558 Tpl.Text l_booleanInputVariablesReturnNames;
15559 Tpl.Text l_booleanInputVariablesNames;
15560 Tpl.Text l_booleanInputVariablesVRs;
15561 Tpl.Text l_integerInputVariablesReturnNames;
15562 Tpl.Text l_integerInputVariablesNames;
15563 Tpl.Text l_integerInputVariablesVRs;
15564 Tpl.Text l_realInputVariablesReturnNames;
15565 Tpl.Text l_realInputVariablesNames;
15566 Tpl.Text l_realInputVariablesVRs;
15567 Tpl.Text l_stringDependentParametersNames;
15568 Tpl.Text l_stringDependentParametersVRs;
15569 Tpl.Text l_booleanDependentParametersNames;
15570 Tpl.Text l_booleanDependentParametersVRs;
15571 Tpl.Text l_integerDependentParametersNames;
15572 Tpl.Text l_integerDependentParametersVRs;
15573 Tpl.Text l_realDependentParametersNames;
15574 Tpl.Text l_realDependentParametersVRs;
15575 Tpl.Text l_stringParametersNames;
15576 Tpl.Text l_stringParametersVRs;
15577 Tpl.Text l_booleanParametersNames;
15578 Tpl.Text l_booleanParametersVRs;
15579 Tpl.Text l_integerParametersNames;
15580 Tpl.Text l_integerParametersVRs;
15581 Tpl.Text l_realParametersNames;
15582 Tpl.Text l_realParametersVRs;
15583
15584 case ( txt,
15585 FMI.FMIIMPORT(fmiInfo = (i_fmiInfo as FMI.INFO(fmiModelIdentifier = i_fmiInfo_fmiModelIdentifier, fmiDescription = i_fmiInfo_fmiDescription)), fmiExperimentAnnotation = FMI.EXPERIMENTANNOTATION(fmiExperimentStartTime = i_fmiExperimentAnnotation_fmiExperimentStartTime, fmiExperimentStopTime = i_fmiExperimentAnnotation_fmiExperimentStopTime, fmiExperimentTolerance = i_fmiExperimentAnnotation_fmiExperimentTolerance), fmiModelVariablesList = i_fmiModelVariablesList, fmiTypeDefinitionsList = i_fmiTypeDefinitionsList, fmuWorkingDirectory = i_fmuWorkingDirectory, fmiLogLevel = i_fmiLogLevel, fmiDebugOutput = i_fmiDebugOutput, generateInputConnectors = i_generateInputConnectors, generateOutputConnectors = i_generateOutputConnectors),
15586 a_name )
15587 algorithm
15588 1 l_realParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", false, 1, "1.0");
15589 1 l_realParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", false, 2, "1.0");
15590 1 l_integerParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", false, 1, "1.0");
15591 1 l_integerParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", false, 2, "1.0");
15592 1 l_booleanParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", false, 1, "1.0");
15593 1 l_booleanParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", false, 2, "1.0");
15594 1 l_stringParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", false, 1, "1.0");
15595 1 l_stringParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", false, 2, "1.0");
15596 1 l_realDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", true, 1, "1.0");
15597 1 l_realDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "parameter", true, 2, "1.0");
15598 1 l_integerDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", true, 1, "1.0");
15599 1 l_integerDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "parameter", true, 2, "1.0");
15600 1 l_booleanDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", true, 1, "1.0");
15601 1 l_booleanDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "parameter", true, 2, "1.0");
15602 1 l_stringDependentParametersVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", true, 1, "1.0");
15603 1 l_stringDependentParametersNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "parameter", true, 2, "1.0");
15604 1 l_realInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 1, "1.0");
15605 1 l_realInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 2, "1.0");
15606 1 l_realInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "input", false, 3, "1.0");
15607 1 l_integerInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 1, "1.0");
15608 1 l_integerInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 2, "1.0");
15609 1 l_integerInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "input", false, 3, "1.0");
15610 1 l_booleanInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 1, "1.0");
15611 1 l_booleanInputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 2, "1.0");
15612 1 l_booleanInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "input", false, 3, "1.0");
15613 1 l_stringInputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 1, "1.0");
15614 1 l_stringStartVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 2, "1.0");
15615 1 l_stringInputVariablesReturnNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "input", false, 3, "1.0");
15616 1 l_realOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "output", false, 1, "1.0");
15617 1 l_realOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "real", "output", false, 2, "1.0");
15618 1 l_integerOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "output", false, 1, "1.0");
15619 1 l_integerOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "integer", "output", false, 2, "1.0");
15620 1 l_booleanOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "output", false, 1, "1.0");
15621 1 l_booleanOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "boolean", "output", false, 2, "1.0");
15622 1 l_stringOutputVariablesVRs := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "output", false, 1, "1.0");
15623 1 l_stringOutputVariablesNames := dumpVariables(Tpl.emptyTxt, i_fmiModelVariablesList, "string", "output", false, 2, "1.0");
15624 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("model "));
15625
2/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
1 ret_36 := stringEq(a_name, "");
15626 1 txt := fun_415(txt, ret_36, i_fmiInfo, i_fmiInfo_fmiModelIdentifier, a_name);
15627
2/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
1 ret_37 := stringEq(i_fmiInfo_fmiDescription, "");
15628 1 txt := fun_416(txt, ret_37, i_fmiInfo_fmiDescription);
15629 1 txt := Tpl.softNewLine(txt);
15630 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
15631 1 txt := dumpFMITypeDefinitions(txt, i_fmiTypeDefinitionsList);
15632 1 txt := Tpl.softNewLine(txt);
15633 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("constant String fmuLocation = \"file://"));
15634 1 txt := Tpl.writeStr(txt, i_fmuWorkingDirectory);
15635 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15636 "/resources\";\n",
15637 "constant String fmuWorkingDir = \""
15638 }, false));
15639 1 txt := Tpl.writeStr(txt, i_fmuWorkingDirectory);
15640 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15641 "\";\n",
15642 "parameter Integer logLevel = "
15643 }, false));
15644 1 txt := Tpl.writeStr(txt, intString(i_fmiLogLevel));
15645 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15646 " \"log level used during the loading of FMU\" annotation (Dialog(tab=\"FMI\", group=\"Enable logging\"));\n",
15647 "parameter Boolean debugLogging = "
15648 }, false));
15649 1 txt := Tpl.writeStr(txt, Tpl.booleanString(i_fmiDebugOutput));
15650 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15651 " \"enables the FMU simulation logging\" annotation (Dialog(tab=\"FMI\", group=\"Enable logging\"));\n",
15652 "constant String mimeType = \"\";\n",
15653 "constant Real timeout = 0.0;\n",
15654 "constant Boolean visible = false;\n",
15655 "constant Boolean interactive = false;\n",
15656 "parameter Real startTime = "
15657 }, false));
15658 1 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentStartTime));
15659 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15660 " \"start time used to initialize the slave\" annotation (Dialog(tab=\"FMI\", group=\"Step time\"));\n",
15661 "parameter Real stopTime = "
15662 }, false));
15663 1 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentStopTime));
15664 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15665 " \"stop time used to initialize the slave\" annotation (Dialog(tab=\"FMI\", group=\"Step time\"));\n",
15666 "parameter Real numberOfSteps = 500 annotation (Dialog(tab=\"FMI\", group=\"Step time\"));\n",
15667 "parameter Real communicationStepSize = (stopTime-startTime)/numberOfSteps \"step size used by fmiDoStep\" annotation (Dialog(tab=\"FMI\", group=\"Step time\"));\n",
15668 "constant Boolean stopTimeDefined = true;\n"
15669 }, true));
15670 1 txt := dumpFMIModelVariablesList(txt, "1.0", i_fmiModelVariablesList, i_fmiTypeDefinitionsList, i_generateInputConnectors, i_generateOutputConnectors);
15671 1 txt := Tpl.softNewLine(txt);
15672 1 txt := Tpl.popBlock(txt);
15673 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("protected\n"));
15674 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
15675 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("FMI1CoSimulation fmi1cs = FMI1CoSimulation(logLevel, fmuWorkingDir, \""));
15676 1 txt := Tpl.writeStr(txt, i_fmiInfo_fmiModelIdentifier);
15677 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15678 "\", debugLogging, fmuLocation, mimeType, timeout, visible, interactive, startTime, stopTimeDefined, stopTime);\n",
15679 "parameter Real flowParamsStart(fixed=false);\n",
15680 "parameter Real flowInitialized(fixed=false);\n",
15681 "Real flowStep;\n"
15682 }, true));
15683
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_38 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
15684 1 txt := fun_417(txt, ret_38, l_realInputVariablesReturnNames);
15685 1 txt := Tpl.softNewLine(txt);
15686
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_39 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
15687 1 txt := fun_418(txt, ret_39, l_integerInputVariablesReturnNames);
15688 1 txt := Tpl.softNewLine(txt);
15689
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_40 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
15690 1 txt := fun_419(txt, ret_40, l_booleanInputVariablesReturnNames);
15691 1 txt := Tpl.softNewLine(txt);
15692
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_41 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
15693 1 txt := fun_420(txt, ret_41, l_stringInputVariablesReturnNames);
15694 1 txt := Tpl.softNewLine(txt);
15695 1 txt := Tpl.popBlock(txt);
15696 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15697 "initial algorithm\n",
15698 " flowParamsStart := 1;\n",
15699 " /* the parameters must be set before the slave is initialized,\n",
15700 " otherwise the FMU computes its calculated parameters from the default values */\n"
15701 }, true));
15702 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
15703
1/4
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 ret_42 := stringEq(Tpl.textString(l_realParametersVRs), "");
15704 1 txt := fun_421(txt, ret_42, l_realParametersNames, l_realParametersVRs);
15705 1 txt := Tpl.softNewLine(txt);
15706
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_43 := stringEq(Tpl.textString(l_integerParametersVRs), "");
15707 1 txt := fun_422(txt, ret_43, l_integerParametersNames, l_integerParametersVRs);
15708 1 txt := Tpl.softNewLine(txt);
15709
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_44 := stringEq(Tpl.textString(l_booleanParametersVRs), "");
15710 1 txt := fun_423(txt, ret_44, l_booleanParametersNames, l_booleanParametersVRs);
15711 1 txt := Tpl.softNewLine(txt);
15712
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_45 := stringEq(Tpl.textString(l_stringParametersVRs), "");
15713 1 txt := fun_424(txt, ret_45, l_stringParametersNames, l_stringParametersVRs);
15714 1 txt := Tpl.softNewLine(txt);
15715 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("flowInitialized := fmi1Functions.fmi1InitializeSlave(fmi1cs, flowParamsStart);\n"));
15716 1 txt := Tpl.popBlock(txt);
15717 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("initial equation\n"));
15718 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
15719
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_46 := stringEq(Tpl.textString(l_realDependentParametersVRs), "");
15720 1 txt := fun_425(txt, ret_46, l_realDependentParametersVRs, l_realDependentParametersNames);
15721 1 txt := Tpl.softNewLine(txt);
15722
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_47 := stringEq(Tpl.textString(l_integerDependentParametersVRs), "");
15723 1 txt := fun_426(txt, ret_47, l_integerDependentParametersVRs, l_integerDependentParametersNames);
15724 1 txt := Tpl.softNewLine(txt);
15725
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_48 := stringEq(Tpl.textString(l_booleanDependentParametersVRs), "");
15726 1 txt := fun_427(txt, ret_48, l_booleanDependentParametersVRs, l_booleanDependentParametersNames);
15727 1 txt := Tpl.softNewLine(txt);
15728
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_49 := stringEq(Tpl.textString(l_stringDependentParametersVRs), "");
15729 1 txt := fun_428(txt, ret_49, l_stringDependentParametersVRs, l_stringDependentParametersNames);
15730 1 txt := Tpl.softNewLine(txt);
15731 1 txt := Tpl.popBlock(txt);
15732 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("equation\n"));
15733 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
15734
1/4
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 ret_50 := stringEq(Tpl.textString(l_realOutputVariablesNames), "");
15735
1/4
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 ret_51 := stringEq(Tpl.textString(l_realOutputVariablesVRs), "");
15736 1 ret_52 := boolAnd(ret_50, ret_51);
15737 1 txt := fun_429(txt, ret_52, l_realOutputVariablesVRs, l_realOutputVariablesNames);
15738 1 txt := Tpl.softNewLine(txt);
15739
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_53 := stringEq(Tpl.textString(l_integerOutputVariablesNames), "");
15740
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_54 := stringEq(Tpl.textString(l_integerOutputVariablesVRs), "");
15741 1 ret_55 := boolAnd(ret_53, ret_54);
15742 1 txt := fun_430(txt, ret_55, l_integerOutputVariablesVRs, l_integerOutputVariablesNames);
15743 1 txt := Tpl.softNewLine(txt);
15744
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_56 := stringEq(Tpl.textString(l_booleanOutputVariablesNames), "");
15745
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_57 := stringEq(Tpl.textString(l_booleanOutputVariablesVRs), "");
15746 1 ret_58 := boolAnd(ret_56, ret_57);
15747 1 txt := fun_431(txt, ret_58, l_booleanOutputVariablesVRs, l_booleanOutputVariablesNames);
15748 1 txt := Tpl.softNewLine(txt);
15749
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_59 := stringEq(Tpl.textString(l_stringOutputVariablesNames), "");
15750
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_60 := stringEq(Tpl.textString(l_stringOutputVariablesVRs), "");
15751 1 ret_61 := boolAnd(ret_59, ret_60);
15752 1 txt := fun_432(txt, ret_61, l_stringOutputVariablesVRs, l_stringOutputVariablesNames);
15753 1 txt := Tpl.softNewLine(txt);
15754
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_62 := stringEq(Tpl.textString(l_realInputVariablesVRs), "");
15755 1 txt := fun_433(txt, ret_62, l_realInputVariablesNames, l_realInputVariablesVRs, l_realInputVariablesReturnNames);
15756 1 txt := Tpl.softNewLine(txt);
15757
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_63 := stringEq(Tpl.textString(l_integerInputVariablesVRs), "");
15758 1 txt := fun_434(txt, ret_63, l_integerInputVariablesNames, l_integerInputVariablesVRs, l_integerInputVariablesReturnNames);
15759 1 txt := Tpl.softNewLine(txt);
15760
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_64 := stringEq(Tpl.textString(l_booleanInputVariablesVRs), "");
15761 1 txt := fun_435(txt, ret_64, l_booleanInputVariablesNames, l_booleanInputVariablesVRs, l_booleanInputVariablesReturnNames);
15762 1 txt := Tpl.softNewLine(txt);
15763
2/4
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 ret_65 := stringEq(Tpl.textString(l_stringInputVariablesVRs), "");
15764 1 txt := fun_436(txt, ret_65, l_stringStartVariablesNames, l_stringInputVariablesVRs, l_stringInputVariablesReturnNames);
15765 1 txt := Tpl.softNewLine(txt);
15766 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15767 "flowStep = fmi1Functions.fmi1DoStep(fmi1cs, time, communicationStepSize, true, flowInitialized);\n",
15768 "annotation(experiment(StartTime="
15769 }, false));
15770 1 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentStartTime));
15771 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", StopTime="));
15772 1 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentStopTime));
15773 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", Tolerance="));
15774 1 txt := Tpl.writeStr(txt, realString(i_fmiExperimentAnnotation_fmiExperimentTolerance));
15775 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15776 "));\n",
15777 "annotation (Icon(graphics={\n",
15778 " Rectangle(\n",
15779 " extent={{-100,100},{100,-100}},\n",
15780 " lineColor={0,0,0},\n",
15781 " fillColor={240,240,240},\n",
15782 " fillPattern=FillPattern.Solid,\n",
15783 " lineThickness=0.5),\n",
15784 " Text(\n",
15785 " extent={{-100,40},{100,0}},\n",
15786 " lineColor={0,0,0},\n",
15787 " textString=\"%name\"),\n",
15788 " Text(\n",
15789 " extent={{-100,-50},{100,-90}},\n",
15790 " lineColor={0,0,0},\n",
15791 " textString=\"V1.0\")}));\n"
15792 }, true));
15793 1 txt := Tpl.popBlock(txt);
15794 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15795 "protected\n",
15796 " class FMI1CoSimulation\n",
15797 " extends ExternalObject;\n",
15798 " function constructor\n",
15799 " input Integer fmiLogLevel;\n",
15800 " input String workingDirectory;\n",
15801 " input String instanceName;\n",
15802 " input Boolean debugLogging;\n",
15803 " input String fmuLocation;\n",
15804 " input String mimeType;\n",
15805 " input Real timeOut;\n",
15806 " input Boolean visible;\n",
15807 " input Boolean interactive;\n",
15808 " input Real tStart;\n",
15809 " input Boolean stopTimeDefined;\n",
15810 " input Real tStop;\n",
15811 " output FMI1CoSimulation fmi1cs;\n",
15812 " external \"C\" fmi1cs = FMI1CoSimulationConstructor_OMC(fmiLogLevel, workingDirectory, instanceName, debugLogging, fmuLocation, mimeType, timeOut, visible, interactive, tStart, stopTimeDefined, tStop) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15813 " end constructor;\n",
15814 "\n",
15815 " function destructor\n",
15816 " input FMI1CoSimulation fmi1cs;\n",
15817 " external \"C\" FMI1CoSimulationDestructor_OMC(fmi1cs) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15818 " end destructor;\n",
15819 " end FMI1CoSimulation;\n",
15820 "\n"
15821 }, true));
15822 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
15823 1 txt := dumpFMITypeDefinitionsMappingFunctions(txt, i_fmiTypeDefinitionsList);
15824 1 txt := Tpl.softNewLine(txt);
15825 1 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
15826 1 txt := dumpFMITypeDefinitionsArrayMappingFunctions(txt, i_fmiTypeDefinitionsList);
15827 1 txt := Tpl.softNewLine(txt);
15828 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
15829 "\n",
15830 "package fmi1Functions\n",
15831 " function fmi1InitializeSlave\n",
15832 " input FMI1CoSimulation fmi1cs;\n",
15833 " input Real preInitialized;\n",
15834 " output Real postInitialized=preInitialized;\n",
15835 " external \"C\" fmi1InitializeSlave_OMC(fmi1cs) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15836 " end fmi1InitializeSlave;\n",
15837 "\n",
15838 " function fmi1DoStep\n",
15839 " input FMI1CoSimulation fmi1cs;\n",
15840 " input Real currentCommunicationPoint;\n",
15841 " input Real communicationStepSize;\n",
15842 " input Boolean newStep;\n",
15843 " input Real preInitialized;\n",
15844 " output Real postInitialized=preInitialized;\n",
15845 " external \"C\" fmi1DoStep_OMC(fmi1cs, currentCommunicationPoint, communicationStepSize, newStep) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15846 " end fmi1DoStep;\n",
15847 "\n",
15848 " function fmi1GetReal\n",
15849 " input FMI1CoSimulation fmi1cs;\n",
15850 " input Real realValuesReferences[:];\n",
15851 " input Real inFlowStatesInput;\n",
15852 " output Real realValues[size(realValuesReferences, 1)];\n",
15853 " external \"C\" fmi1GetReal_OMC(fmi1cs, size(realValuesReferences, 1), realValuesReferences, inFlowStatesInput, realValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15854 " end fmi1GetReal;\n",
15855 "\n",
15856 " function fmi1SetReal\n",
15857 " input FMI1CoSimulation fmi1cs;\n",
15858 " input Real realValuesReferences[:];\n",
15859 " input Real realValues[size(realValuesReferences, 1)];\n",
15860 " output Real out_Values[size(realValuesReferences, 1)] = realValues;\n",
15861 " external \"C\" fmi1SetReal_OMC(fmi1cs, size(realValuesReferences, 1), realValuesReferences, realValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15862 " end fmi1SetReal;\n",
15863 "\n",
15864 " function fmi1SetRealParameter\n",
15865 " input FMI1CoSimulation fmi1cs;\n",
15866 " input Real realValuesReferences[:];\n",
15867 " input Real realValues[size(realValuesReferences, 1)];\n",
15868 " output Real out_Value = 1;\n",
15869 " external \"C\" fmi1SetReal_OMC(fmi1cs, size(realValuesReferences, 1), realValuesReferences, realValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15870 " end fmi1SetRealParameter;\n",
15871 "\n",
15872 " function fmi1GetInteger\n",
15873 " input FMI1CoSimulation fmi1cs;\n",
15874 " input Real integerValuesReferences[:];\n",
15875 " input Real inFlowStatesInput;\n",
15876 " output Integer integerValues[size(integerValuesReferences, 1)];\n",
15877 " external \"C\" fmi1GetInteger_OMC(fmi1cs, size(integerValuesReferences, 1), integerValuesReferences, inFlowStatesInput, integerValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15878 " end fmi1GetInteger;\n",
15879 "\n",
15880 " function fmi1SetInteger\n",
15881 " input FMI1CoSimulation fmi1cs;\n",
15882 " input Real integerValuesReferences[:];\n",
15883 " input Integer integerValues[size(integerValuesReferences, 1)];\n",
15884 " output Integer out_Values[size(integerValuesReferences, 1)] = integerValues;\n",
15885 " external \"C\" fmi1SetInteger_OMC(fmi1cs, size(integerValuesReferences, 1), integerValuesReferences, integerValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15886 " end fmi1SetInteger;\n",
15887 "\n",
15888 " function fmi1SetIntegerParameter\n",
15889 " input FMI1CoSimulation fmi1cs;\n",
15890 " input Real integerValuesReferences[:];\n",
15891 " input Integer integerValues[size(integerValuesReferences, 1)];\n",
15892 " output Real out_Value = 1;\n",
15893 " external \"C\" fmi1SetInteger_OMC(fmi1cs, size(integerValuesReferences, 1), integerValuesReferences, integerValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15894 " end fmi1SetIntegerParameter;\n",
15895 "\n",
15896 " function fmi1GetBoolean\n",
15897 " input FMI1CoSimulation fmi1cs;\n",
15898 " input Real booleanValuesReferences[:];\n",
15899 " input Real inFlowStatesInput;\n",
15900 " output Boolean booleanValues[size(booleanValuesReferences, 1)];\n",
15901 " external \"C\" fmi1GetBoolean_OMC(fmi1cs, size(booleanValuesReferences, 1), booleanValuesReferences, inFlowStatesInput, booleanValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15902 " end fmi1GetBoolean;\n",
15903 "\n",
15904 " function fmi1SetBoolean\n",
15905 " input FMI1CoSimulation fmi1cs;\n",
15906 " input Real booleanValuesReferences[:];\n",
15907 " input Boolean booleanValues[size(booleanValuesReferences, 1)];\n",
15908 " output Boolean out_Values[size(booleanValuesReferences, 1)] = booleanValues;\n",
15909 " external \"C\" fmi1SetBoolean_OMC(fmi1cs, size(booleanValuesReferences, 1), booleanValuesReferences, booleanValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15910 " end fmi1SetBoolean;\n",
15911 "\n",
15912 " function fmi1SetBooleanParameter\n",
15913 " input FMI1CoSimulation fmi1cs;\n",
15914 " input Real booleanValuesReferences[:];\n",
15915 " input Boolean booleanValues[size(booleanValuesReferences, 1)];\n",
15916 " output Real out_Value = 1;\n",
15917 " external \"C\" fmi1SetBoolean_OMC(fmi1cs, size(booleanValuesReferences, 1), booleanValuesReferences, booleanValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15918 " end fmi1SetBooleanParameter;\n",
15919 "\n",
15920 " function fmi1GetString\n",
15921 " input FMI1CoSimulation fmi1cs;\n",
15922 " input Real stringValuesReferences[:];\n",
15923 " input Real inFlowStatesInput;\n",
15924 " output String stringValues[size(stringValuesReferences, 1)];\n",
15925 " external \"C\" fmi1GetString_OMC(fmi1cs, size(stringValuesReferences, 1), stringValuesReferences, inFlowStatesInput, stringValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15926 " end fmi1GetString;\n",
15927 "\n",
15928 " function fmi1SetString\n",
15929 " input FMI1CoSimulation fmi1cs;\n",
15930 " input Real stringValuesReferences[:];\n",
15931 " input String stringValues[size(stringValuesReferences, 1)];\n",
15932 " output String out_Values[size(stringValuesReferences, 1)] = stringValues;\n",
15933 " external \"C\" fmi1SetString_OMC(fmi1cs, size(stringValuesReferences, 1), stringValuesReferences, stringValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15934 " end fmi1SetString;\n",
15935 "\n",
15936 " function fmi1SetStringParameter\n",
15937 " input FMI1CoSimulation fmi1cs;\n",
15938 " input Real stringValuesReferences[:];\n",
15939 " input String stringValues[size(stringValuesReferences, 1)];\n",
15940 " output Real out_Value = 1;\n",
15941 " external \"C\" fmi1SetString_OMC(fmi1cs, size(stringValuesReferences, 1), stringValuesReferences, stringValues, 2) annotation(Library = {\"OpenModelicaFMIRuntimeC\", \"fmilib\"});\n",
15942 " end fmi1SetStringParameter;\n",
15943 "end fmi1Functions;\n"
15944 }, true));
15945 1 txt := Tpl.popBlock(txt);
15946 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
15947
2/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
1 ret_66 := stringEq(a_name, "");
15948 1 txt := fun_437(txt, ret_66, i_fmiInfo, i_fmiInfo_fmiModelIdentifier, a_name);
15949 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
15950 then txt;
15951
15952 case ( txt,
15953 _,
15954 _ )
15955 then txt;
15956 end match;
15957 end importFMU1CoSimulationStandAlone;
15958
15959 protected function lm_439
15960 input output Tpl.Text txt;
15961 input list<FMI.TypeDefinitions> items;
15962 algorithm
15963
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 18 times.
24 for lstElt_439 in items loop
15964 txt := match lstElt_439
15965 local
15966 FMI.TypeDefinitions i_fmiTypeDefinition;
15967
15968 case i_fmiTypeDefinition
15969 algorithm
15970 6 txt := dumpFMITypeDefinition(txt, i_fmiTypeDefinition);
15971 6 txt := Tpl.nextIter(txt);
15972 then txt;
15973 end match;
15974 end for;
15975 end lm_439;
15976
15977 public function dumpFMITypeDefinitions
15978 input Tpl.Text txt;
15979 input list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
15980
15981 output Tpl.Text out_txt;
15982 algorithm
15983 18 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
15984 18 out_txt := lm_439(out_txt, a_fmiTypeDefinitionsList);
15985 18 out_txt := Tpl.popIter(out_txt);
15986 end dumpFMITypeDefinitions;
15987
15988 public function dumpFMITypeDefinition
15989 input Tpl.Text in_txt;
15990 input FMI.TypeDefinitions in_a_fmiTypeDefinition;
15991
15992 output Tpl.Text out_txt;
15993 algorithm
15994 out_txt :=
15995 match(in_txt, in_a_fmiTypeDefinition)
15996 local
15997 Tpl.Text txt;
15998 list<FMI.EnumerationItem> i_items;
15999 String i_name;
16000
16001 case ( txt,
16002 FMI.ENUMERATIONTYPE(name = i_name, items = i_items) )
16003 algorithm
16004 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("type "));
16005 6 txt := Tpl.writeStr(txt, i_name);
16006 6 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" = enumeration(\n"));
16007 6 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
16008 6 txt := dumpFMITypeDefinitionsItems(txt, i_items);
16009 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING(");"));
16010 6 txt := Tpl.popBlock(txt);
16011 then txt;
16012
16013 case ( txt,
16014 _ )
16015 then txt;
16016 end match;
16017 end dumpFMITypeDefinition;
16018
16019 protected function lm_442
16020 input output Tpl.Text txt;
16021 input list<FMI.EnumerationItem> items;
16022 algorithm
16023
2/2
✓ Branch 0 taken 23 times.
✓ Branch 1 taken 6 times.
29 for lstElt_442 in items loop
16024 txt := match lstElt_442
16025 local
16026 FMI.EnumerationItem i_item;
16027
16028 case i_item
16029 algorithm
16030 23 txt := dumpFMITypeDefinitionsItem(txt, i_item);
16031 23 txt := Tpl.nextIter(txt);
16032 then txt;
16033 end match;
16034 end for;
16035 end lm_442;
16036
16037 public function dumpFMITypeDefinitionsItems
16038 input Tpl.Text txt;
16039 input list<FMI.EnumerationItem> a_items;
16040
16041 output Tpl.Text out_txt;
16042 algorithm
16043 6 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_LINE(",\n")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
16044 6 out_txt := lm_442(out_txt, a_items);
16045 6 out_txt := Tpl.popIter(out_txt);
16046 end dumpFMITypeDefinitionsItems;
16047
16048 public function dumpFMITypeDefinitionsItem
16049 input Tpl.Text in_txt;
16050 input FMI.EnumerationItem in_a_item;
16051
16052 output Tpl.Text out_txt;
16053 algorithm
16054 out_txt :=
16055 match(in_txt, in_a_item)
16056 local
16057 Tpl.Text txt;
16058 String i_name;
16059
16060 case ( txt,
16061 FMI.ENUMERATIONITEM(name = i_name) )
16062 algorithm
16063 23 txt := Tpl.writeStr(txt, i_name);
16064 then txt;
16065
16066 case ( txt,
16067 _ )
16068 then txt;
16069 end match;
16070 end dumpFMITypeDefinitionsItem;
16071
16072 protected function lm_445
16073 input output Tpl.Text txt;
16074 input list<FMI.TypeDefinitions> items;
16075 algorithm
16076
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 18 times.
24 for lstElt_445 in items loop
16077 txt := match lstElt_445
16078 local
16079 FMI.TypeDefinitions i_fmiTypeDefinition;
16080
16081 case i_fmiTypeDefinition
16082 algorithm
16083 6 txt := dumpFMITypeDefinitionMappingFunction(txt, i_fmiTypeDefinition);
16084 6 txt := Tpl.nextIter(txt);
16085 then txt;
16086 end match;
16087 end for;
16088 end lm_445;
16089
16090 public function dumpFMITypeDefinitionsMappingFunctions
16091 input Tpl.Text txt;
16092 input list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
16093
16094 output Tpl.Text out_txt;
16095 algorithm
16096 18 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
16097 18 out_txt := lm_445(out_txt, a_fmiTypeDefinitionsList);
16098 18 out_txt := Tpl.popIter(out_txt);
16099 end dumpFMITypeDefinitionsMappingFunctions;
16100
16101 protected function lm_447
16102 input output Tpl.Text txt;
16103 input list<FMI.EnumerationItem> items;
16104 input String a_name;
16105 algorithm
16106
2/2
✓ Branch 0 taken 23 times.
✓ Branch 1 taken 6 times.
29 for lstElt_447 in items loop
16107 txt := match lstElt_447
16108 local
16109 Integer x_i0;
16110 FMI.EnumerationItem i_item;
16111
16112 case i_item
16113 algorithm
16114 23 x_i0 := Tpl.getIteri_i0(txt);
16115 23 txt := dumpFMITypeDefinitionMappingFunctionItems(txt, i_item, a_name, x_i0);
16116 23 txt := Tpl.nextIter(txt);
16117 then txt;
16118 end match;
16119 end for;
16120 end lm_447;
16121
16122 protected function fun_448
16123 input Tpl.Text in_txt;
16124 input Boolean in_mArg;
16125
16126 output Tpl.Text out_txt;
16127 algorithm
16128 out_txt :=
16129 match(in_txt, in_mArg)
16130 local
16131 Tpl.Text txt;
16132
16133 case ( txt,
16134 false )
16135 then txt;
16136
16137 case ( txt,
16138 _ )
16139 algorithm
16140 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end if;"));
16141 then txt;
16142 end match;
16143 end fun_448;
16144
16145 public function dumpFMITypeDefinitionMappingFunction
16146 input Tpl.Text in_txt;
16147 input FMI.TypeDefinitions in_a_fmiTypeDefinition;
16148
16149 output Tpl.Text out_txt;
16150 algorithm
16151 out_txt :=
16152 match(in_txt, in_a_fmiTypeDefinition)
16153 local
16154 Tpl.Text txt;
16155 list<FMI.EnumerationItem> i_items;
16156 String i_name;
16157 Boolean ret_1;
16158 Integer ret_0;
16159
16160 case ( txt,
16161 FMI.ENUMERATIONTYPE(name = i_name, items = i_items) )
16162 algorithm
16163 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("function map_"));
16164 6 txt := Tpl.writeStr(txt, i_name);
16165 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
16166 "_from_integer\n",
16167 " input Integer i;\n"
16168 }, true));
16169 6 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
16170 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("output "));
16171 6 txt := Tpl.writeStr(txt, i_name);
16172 6 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" outType;\n"));
16173 6 txt := Tpl.popBlock(txt);
16174 6 txt := Tpl.writeTok(txt, Tpl.ST_LINE("algorithm\n"));
16175 6 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
16176 6 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(1, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
16177 6 txt := lm_447(txt, i_items, i_name);
16178 6 txt := Tpl.popIter(txt);
16179 6 txt := Tpl.softNewLine(txt);
16180 6 ret_0 := listLength(i_items);
16181 6 ret_1 := intGt(ret_0, 1);
16182 6 txt := fun_448(txt, ret_1);
16183 6 txt := Tpl.softNewLine(txt);
16184 6 txt := Tpl.popBlock(txt);
16185 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end map_"));
16186 6 txt := Tpl.writeStr(txt, i_name);
16187 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_from_integer;"));
16188 then txt;
16189
16190 case ( txt,
16191 _ )
16192 then txt;
16193 end match;
16194 end dumpFMITypeDefinitionMappingFunction;
16195
16196 protected function fun_450
16197 input Tpl.Text in_txt;
16198 input Boolean in_mArg;
16199 input String in_a_name;
16200 input String in_a_typeName;
16201 input Integer in_a_i;
16202
16203 output Tpl.Text out_txt;
16204 algorithm
16205 out_txt :=
16206 match(in_txt, in_mArg, in_a_name, in_a_typeName, in_a_i)
16207 local
16208 Tpl.Text txt;
16209 String a_name;
16210 String a_typeName;
16211 Integer a_i;
16212
16213 case ( txt,
16214 false,
16215 a_name,
16216 a_typeName,
16217 a_i )
16218 algorithm
16219 17 txt := Tpl.writeTok(txt, Tpl.ST_STRING("elseif i == "));
16220 17 txt := Tpl.writeStr(txt, intString(a_i));
16221 17 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" then outType := "));
16222 17 txt := Tpl.writeStr(txt, a_typeName);
16223 17 txt := Tpl.writeTok(txt, Tpl.ST_STRING("."));
16224 17 txt := Tpl.writeStr(txt, a_name);
16225 17 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16226 then txt;
16227
16228 case ( txt,
16229 _,
16230 a_name,
16231 a_typeName,
16232 a_i )
16233 algorithm
16234 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if i == "));
16235 6 txt := Tpl.writeStr(txt, intString(a_i));
16236 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" then outType := "));
16237 6 txt := Tpl.writeStr(txt, a_typeName);
16238 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("."));
16239 6 txt := Tpl.writeStr(txt, a_name);
16240 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16241 then txt;
16242 end match;
16243 end fun_450;
16244
16245 public function dumpFMITypeDefinitionMappingFunctionItems
16246 input Tpl.Text in_txt;
16247 input FMI.EnumerationItem in_a_item;
16248 input String in_a_typeName;
16249 input Integer in_a_i;
16250
16251 output Tpl.Text out_txt;
16252 algorithm
16253 out_txt :=
16254 match(in_txt, in_a_item, in_a_typeName, in_a_i)
16255 local
16256 Tpl.Text txt;
16257 String a_typeName;
16258 Integer a_i;
16259 String i_name;
16260 Boolean ret_0;
16261
16262 case ( txt,
16263 FMI.ENUMERATIONITEM(name = i_name),
16264 a_typeName,
16265 a_i )
16266 algorithm
16267 23 ret_0 := intEq(a_i, 1);
16268 23 txt := fun_450(txt, ret_0, i_name, a_typeName, a_i);
16269 then txt;
16270
16271 case ( txt,
16272 _,
16273 _,
16274 _ )
16275 then txt;
16276 end match;
16277 end dumpFMITypeDefinitionMappingFunctionItems;
16278
16279 protected function lm_452
16280 input output Tpl.Text txt;
16281 input list<FMI.TypeDefinitions> items;
16282 algorithm
16283
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 18 times.
24 for lstElt_452 in items loop
16284 txt := match lstElt_452
16285 local
16286 FMI.TypeDefinitions i_fmiTypeDefinition;
16287
16288 case i_fmiTypeDefinition
16289 algorithm
16290 6 txt := dumpFMITypeDefinitionsArrayMappingFunction(txt, i_fmiTypeDefinition);
16291 6 txt := Tpl.nextIter(txt);
16292 then txt;
16293 end match;
16294 end for;
16295 end lm_452;
16296
16297 public function dumpFMITypeDefinitionsArrayMappingFunctions
16298 input Tpl.Text txt;
16299 input list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
16300
16301 output Tpl.Text out_txt;
16302 algorithm
16303 18 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
16304 18 out_txt := lm_452(out_txt, a_fmiTypeDefinitionsList);
16305 18 out_txt := Tpl.popIter(out_txt);
16306 end dumpFMITypeDefinitionsArrayMappingFunctions;
16307
16308 public function dumpFMITypeDefinitionsArrayMappingFunction
16309 input Tpl.Text in_txt;
16310 input FMI.TypeDefinitions in_a_fmiTypeDefinition;
16311
16312 output Tpl.Text out_txt;
16313 algorithm
16314 out_txt :=
16315 match(in_txt, in_a_fmiTypeDefinition)
16316 local
16317 Tpl.Text txt;
16318 String i_name;
16319
16320 case ( txt,
16321 FMI.ENUMERATIONTYPE(name = i_name) )
16322 algorithm
16323 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("function map_"));
16324 6 txt := Tpl.writeStr(txt, i_name);
16325 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
16326 "_from_integers\n",
16327 " input Integer fromInt[size(fromInt, 1)];\n"
16328 }, true));
16329 6 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
16330 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("output "));
16331 6 txt := Tpl.writeStr(txt, i_name);
16332 6 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" toEnum[size(fromInt, 1)];\n"));
16333 6 txt := Tpl.popBlock(txt);
16334 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
16335 "protected\n",
16336 " Integer n = size(fromInt, 1);\n",
16337 "algorithm\n",
16338 " for i in 1:n loop\n"
16339 }, true));
16340 6 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
16341 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("toEnum[i] := map_"));
16342 6 txt := Tpl.writeStr(txt, i_name);
16343 6 txt := Tpl.writeTok(txt, Tpl.ST_LINE("_from_integer(fromInt[i]);\n"));
16344 6 txt := Tpl.popBlock(txt);
16345 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
16346 " end for;\n",
16347 "end map_"
16348 }, false));
16349 6 txt := Tpl.writeStr(txt, i_name);
16350 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_from_integers;"));
16351 then txt;
16352
16353 case ( txt,
16354 _ )
16355 then txt;
16356 end match;
16357 end dumpFMITypeDefinitionsArrayMappingFunction;
16358
16359 protected function lm_455
16360 input output Tpl.Text txt;
16361 input list<FMI.ModelVariables> items;
16362 input Boolean a_generateOutputConnectors;
16363 input Boolean a_generateInputConnectors;
16364 input list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
16365 input String a_FMUVersion;
16366 algorithm
16367
2/2
✓ Branch 0 taken 641 times.
✓ Branch 1 taken 18 times.
659 for lstElt_455 in items loop
16368 txt := match lstElt_455
16369 local
16370 FMI.ModelVariables i_fmiModelVariable;
16371
16372 case i_fmiModelVariable
16373 algorithm
16374 641 txt := dumpFMIModelVariable(txt, a_FMUVersion, i_fmiModelVariable, a_fmiTypeDefinitionsList, a_generateInputConnectors, a_generateOutputConnectors);
16375 641 txt := Tpl.nextIter(txt);
16376 then txt;
16377 end match;
16378 end for;
16379 end lm_455;
16380
16381 public function dumpFMIModelVariablesList
16382 input Tpl.Text txt;
16383 input String a_FMUVersion;
16384 input list<FMI.ModelVariables> a_fmiModelVariablesList;
16385 input list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
16386 input Boolean a_generateInputConnectors;
16387 input Boolean a_generateOutputConnectors;
16388
16389 output Tpl.Text out_txt;
16390 algorithm
16391 18 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
16392 18 out_txt := lm_455(out_txt, a_fmiModelVariablesList, a_generateOutputConnectors, a_generateInputConnectors, a_fmiTypeDefinitionsList, a_FMUVersion);
16393 18 out_txt := Tpl.popIter(out_txt);
16394 end dumpFMIModelVariablesList;
16395
16396 protected function fun_457
16397 input Tpl.Text in_txt;
16398 input FMI.ModelVariables in_a_fmiModelVariable;
16399 input list<FMI.TypeDefinitions> in_a_fmiTypeDefinitionsList;
16400 input String in_a_FMUVersion;
16401 input Boolean in_a_generateOutputConnectors;
16402 input Boolean in_a_generateInputConnectors;
16403
16404 output Tpl.Text out_txt;
16405 algorithm
16406 out_txt :=
16407 match(in_txt, in_a_fmiModelVariable, in_a_fmiTypeDefinitionsList, in_a_FMUVersion, in_a_generateOutputConnectors, in_a_generateInputConnectors)
16408 local
16409 Tpl.Text txt;
16410 list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
16411 String a_FMUVersion;
16412 Boolean a_generateOutputConnectors;
16413 Boolean a_generateInputConnectors;
16414 String i_startValue_3;
16415 Boolean i_startValue_2;
16416 Integer i_startValue_1;
16417 Integer i_y2Placement;
16418 Integer i_y1Placement;
16419 Integer i_x2Placement;
16420 Integer i_x1Placement;
16421 String i_description;
16422 Boolean i_isFixed;
16423 Real i_startValue;
16424 Boolean i_hasStartValue;
16425 String i_name;
16426 String i_baseType;
16427 String i_causality;
16428 String i_variability;
16429
16430 case ( txt,
16431 FMI.REALVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, hasStartValue = i_hasStartValue, startValue = i_startValue, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16432 _,
16433 a_FMUVersion,
16434 a_generateOutputConnectors,
16435 a_generateInputConnectors )
16436 algorithm
16437 13 txt := dumpFMIModelVariableVariability(txt, i_variability);
16438 13 txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16439 13 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16440 13 txt := Tpl.writeStr(txt, i_name);
16441 13 txt := dumpFMIRealModelVariableStartValue(txt, a_FMUVersion, i_variability, i_hasStartValue, i_startValue, i_isFixed);
16442 13 txt := dumpFMIModelVariableDescription(txt, i_description);
16443 13 txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16444 13 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16445 then txt;
16446
16447 case ( txt,
16448 FMI.INTEGERVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, hasStartValue = i_hasStartValue, startValue = i_startValue_1, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16449 _,
16450 a_FMUVersion,
16451 a_generateOutputConnectors,
16452 a_generateInputConnectors )
16453 algorithm
16454 ✗ txt := dumpFMIModelVariableVariability(txt, i_variability);
16455 ✗ txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16456 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16457 ✗ txt := Tpl.writeStr(txt, i_name);
16458 ✗ txt := dumpFMIIntegerModelVariableStartValue(txt, a_FMUVersion, i_variability, i_hasStartValue, i_startValue_1, i_isFixed);
16459 ✗ txt := dumpFMIModelVariableDescription(txt, i_description);
16460 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16461 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16462 then txt;
16463
16464 case ( txt,
16465 FMI.BOOLEANVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, hasStartValue = i_hasStartValue, startValue = i_startValue_2, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16466 _,
16467 a_FMUVersion,
16468 a_generateOutputConnectors,
16469 a_generateInputConnectors )
16470 algorithm
16471 6 txt := dumpFMIModelVariableVariability(txt, i_variability);
16472 6 txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16473 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16474 6 txt := Tpl.writeStr(txt, i_name);
16475 6 txt := dumpFMIBooleanModelVariableStartValue(txt, a_FMUVersion, i_variability, i_hasStartValue, i_startValue_2, i_isFixed);
16476 6 txt := dumpFMIModelVariableDescription(txt, i_description);
16477 6 txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16478 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16479 then txt;
16480
16481 case ( txt,
16482 FMI.STRINGVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, hasStartValue = i_hasStartValue, startValue = i_startValue_3, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16483 _,
16484 a_FMUVersion,
16485 a_generateOutputConnectors,
16486 a_generateInputConnectors )
16487 algorithm
16488 ✗ txt := dumpFMIModelVariableVariability(txt, i_variability);
16489 ✗ txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16490 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16491 ✗ txt := Tpl.writeStr(txt, i_name);
16492 ✗ txt := dumpFMIStringModelVariableStartValue(txt, a_FMUVersion, i_variability, i_hasStartValue, i_startValue_3, i_isFixed);
16493 ✗ txt := dumpFMIModelVariableDescription(txt, i_description);
16494 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16495 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16496 then txt;
16497
16498 case ( txt,
16499 FMI.ENUMERATIONVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, hasStartValue = i_hasStartValue, startValue = i_startValue_1, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16500 a_fmiTypeDefinitionsList,
16501 _,
16502 a_generateOutputConnectors,
16503 a_generateInputConnectors )
16504 algorithm
16505 ✗ txt := dumpFMIModelVariableVariability(txt, i_variability);
16506 ✗ txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16507 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16508 ✗ txt := Tpl.writeStr(txt, i_name);
16509 ✗ txt := dumpFMIEnumerationModelVariableStartValue(txt, a_fmiTypeDefinitionsList, i_baseType, i_hasStartValue, i_startValue_1, i_isFixed);
16510 ✗ txt := dumpFMIModelVariableDescription(txt, i_description);
16511 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16512 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16513 then txt;
16514
16515 case ( txt,
16516 _,
16517 _,
16518 _,
16519 _,
16520 _ )
16521 then txt;
16522 end match;
16523 end fun_457;
16524
16525 protected function fun_458
16526 input Tpl.Text in_txt;
16527 input FMI.ModelVariables in_a_fmiModelVariable;
16528 input list<FMI.TypeDefinitions> in_a_fmiTypeDefinitionsList;
16529 input String in_a_FMUVersion;
16530 input Boolean in_a_generateOutputConnectors;
16531 input Boolean in_a_generateInputConnectors;
16532
16533 output Tpl.Text out_txt;
16534 algorithm
16535 out_txt :=
16536 match(in_txt, in_a_fmiModelVariable, in_a_fmiTypeDefinitionsList, in_a_FMUVersion, in_a_generateOutputConnectors, in_a_generateInputConnectors)
16537 local
16538 Tpl.Text txt;
16539 list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
16540 String a_FMUVersion;
16541 Boolean a_generateOutputConnectors;
16542 Boolean a_generateInputConnectors;
16543 String i_startValue_3;
16544 Boolean i_startValue_2;
16545 Integer i_startValue_1;
16546 Integer i_y2Placement;
16547 Integer i_y1Placement;
16548 Integer i_x2Placement;
16549 Integer i_x1Placement;
16550 String i_description;
16551 Boolean i_isFixed;
16552 Real i_startValue;
16553 Boolean i_hasStartValue;
16554 String i_name;
16555 String i_baseType;
16556 String i_causality;
16557 String i_variability;
16558
16559 case ( txt,
16560 FMI.REALVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, hasStartValue = i_hasStartValue, startValue = i_startValue, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16561 _,
16562 a_FMUVersion,
16563 a_generateOutputConnectors,
16564 a_generateInputConnectors )
16565 algorithm
16566 516 txt := dumpFMIModelVariableVariability(txt, i_variability);
16567 516 txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16568 516 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16569 516 txt := Tpl.writeStr(txt, i_name);
16570 516 txt := dumpFMIRealModelVariableStartValue(txt, a_FMUVersion, i_causality, i_hasStartValue, i_startValue, i_isFixed);
16571 516 txt := dumpFMIModelVariableDescription(txt, i_description);
16572 516 txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16573 516 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16574 then txt;
16575
16576 case ( txt,
16577 FMI.INTEGERVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, hasStartValue = i_hasStartValue, startValue = i_startValue_1, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16578 _,
16579 a_FMUVersion,
16580 a_generateOutputConnectors,
16581 a_generateInputConnectors )
16582 algorithm
16583 45 txt := dumpFMIModelVariableVariability(txt, i_variability);
16584 45 txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16585 45 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16586 45 txt := Tpl.writeStr(txt, i_name);
16587 45 txt := dumpFMIIntegerModelVariableStartValue(txt, a_FMUVersion, i_causality, i_hasStartValue, i_startValue_1, i_isFixed);
16588 45 txt := dumpFMIModelVariableDescription(txt, i_description);
16589 45 txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16590 45 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16591 then txt;
16592
16593 case ( txt,
16594 FMI.BOOLEANVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, hasStartValue = i_hasStartValue, startValue = i_startValue_2, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16595 _,
16596 a_FMUVersion,
16597 a_generateOutputConnectors,
16598 a_generateInputConnectors )
16599 algorithm
16600 38 txt := dumpFMIModelVariableVariability(txt, i_variability);
16601 38 txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16602 38 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16603 38 txt := Tpl.writeStr(txt, i_name);
16604 38 txt := dumpFMIBooleanModelVariableStartValue(txt, a_FMUVersion, i_causality, i_hasStartValue, i_startValue_2, i_isFixed);
16605 38 txt := dumpFMIModelVariableDescription(txt, i_description);
16606 38 txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16607 38 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16608 then txt;
16609
16610 case ( txt,
16611 FMI.STRINGVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, hasStartValue = i_hasStartValue, startValue = i_startValue_3, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16612 _,
16613 a_FMUVersion,
16614 a_generateOutputConnectors,
16615 a_generateInputConnectors )
16616 algorithm
16617 5 txt := dumpFMIModelVariableVariability(txt, i_variability);
16618 5 txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16619 5 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16620 5 txt := Tpl.writeStr(txt, i_name);
16621 5 txt := dumpFMIStringModelVariableStartValue(txt, a_FMUVersion, i_causality, i_hasStartValue, i_startValue_3, i_isFixed);
16622 5 txt := dumpFMIModelVariableDescription(txt, i_description);
16623 5 txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16624 5 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16625 then txt;
16626
16627 case ( txt,
16628 FMI.ENUMERATIONVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, hasStartValue = i_hasStartValue, startValue = i_startValue_1, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16629 a_fmiTypeDefinitionsList,
16630 _,
16631 a_generateOutputConnectors,
16632 a_generateInputConnectors )
16633 algorithm
16634 12 txt := dumpFMIModelVariableVariability(txt, i_variability);
16635 12 txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16636 12 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16637 12 txt := Tpl.writeStr(txt, i_name);
16638 12 txt := dumpFMIEnumerationModelVariableStartValue(txt, a_fmiTypeDefinitionsList, i_baseType, i_hasStartValue, i_startValue_1, i_isFixed);
16639 12 txt := dumpFMIModelVariableDescription(txt, i_description);
16640 12 txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16641 12 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16642 then txt;
16643
16644 case ( txt,
16645 _,
16646 _,
16647 _,
16648 _,
16649 _ )
16650 then txt;
16651 end match;
16652 end fun_458;
16653
16654 protected function fun_459
16655 input Tpl.Text in_txt;
16656 input FMI.ModelVariables in_a_fmiModelVariable;
16657 input Boolean in_a_generateOutputConnectors;
16658 input Boolean in_a_generateInputConnectors;
16659
16660 output Tpl.Text out_txt;
16661 algorithm
16662 out_txt :=
16663 match(in_txt, in_a_fmiModelVariable, in_a_generateOutputConnectors, in_a_generateInputConnectors)
16664 local
16665 Tpl.Text txt;
16666 Boolean a_generateOutputConnectors;
16667 Boolean a_generateInputConnectors;
16668 list<String> i_startValue_3;
16669 list<Boolean> i_startValue_2;
16670 list<Integer> i_startValue_1;
16671 Integer i_y2Placement;
16672 Integer i_y1Placement;
16673 Integer i_x2Placement;
16674 Integer i_x1Placement;
16675 String i_description;
16676 Boolean i_isFixed;
16677 list<Real> i_startValue;
16678 String i_name;
16679 String i_baseType;
16680 String i_causality;
16681 String i_variability;
16682
16683 case ( txt,
16684 FMI.FMI3REALVARIABLE(causality = "independent"),
16685 _,
16686 _ )
16687 then txt;
16688
16689 case ( txt,
16690 FMI.FMI3REALVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, startValue = i_startValue, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16691 a_generateOutputConnectors,
16692 a_generateInputConnectors )
16693 algorithm
16694 5 txt := dumpFMIModelVariableVariability(txt, i_variability);
16695 5 txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16696 5 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16697 5 txt := Tpl.writeStr(txt, i_name);
16698 5 txt := dumpFMI3RealModelVariableStartValue(txt, i_causality, i_startValue, i_isFixed);
16699 5 txt := dumpFMIModelVariableDescription(txt, i_description);
16700 5 txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16701 5 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16702 then txt;
16703
16704 case ( txt,
16705 FMI.FMI3INTEGERVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, startValue = i_startValue_1, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16706 a_generateOutputConnectors,
16707 a_generateInputConnectors )
16708 algorithm
16709 ✗ txt := dumpFMIModelVariableVariability(txt, i_variability);
16710 ✗ txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16711 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16712 ✗ txt := Tpl.writeStr(txt, i_name);
16713 ✗ txt := dumpFMI3IntegerModelVariableStartValue(txt, i_causality, i_startValue_1, i_isFixed);
16714 ✗ txt := dumpFMIModelVariableDescription(txt, i_description);
16715 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16716 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16717 then txt;
16718
16719 case ( txt,
16720 FMI.FMI3BOOLEANVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, startValue = i_startValue_2, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16721 a_generateOutputConnectors,
16722 a_generateInputConnectors )
16723 algorithm
16724 ✗ txt := dumpFMIModelVariableVariability(txt, i_variability);
16725 ✗ txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16726 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16727 ✗ txt := Tpl.writeStr(txt, i_name);
16728 ✗ txt := dumpFMI3BooleanModelVariableStartValue(txt, i_causality, i_startValue_2, i_isFixed);
16729 ✗ txt := dumpFMIModelVariableDescription(txt, i_description);
16730 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16731 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16732 then txt;
16733
16734 case ( txt,
16735 FMI.FMI3STRINGVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, startValue = i_startValue_3, isFixed = i_isFixed, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16736 a_generateOutputConnectors,
16737 a_generateInputConnectors )
16738 algorithm
16739 ✗ txt := dumpFMIModelVariableVariability(txt, i_variability);
16740 ✗ txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16741 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16742 ✗ txt := Tpl.writeStr(txt, i_name);
16743 ✗ txt := dumpFMI3StringModelVariableStartValue(txt, i_causality, i_startValue_3, i_isFixed);
16744 ✗ txt := dumpFMIModelVariableDescription(txt, i_description);
16745 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16746 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16747 then txt;
16748
16749 case ( txt,
16750 FMI.FMI3ENUMERATIONVARIABLE(variability = i_variability, causality = i_causality, baseType = i_baseType, name = i_name, description = i_description, x1Placement = i_x1Placement, x2Placement = i_x2Placement, y1Placement = i_y1Placement, y2Placement = i_y2Placement),
16751 a_generateOutputConnectors,
16752 a_generateInputConnectors )
16753 algorithm
16754 ✗ txt := dumpFMIModelVariableVariability(txt, i_variability);
16755 ✗ txt := dumpFMIModelVariableCausalityAndBaseType(txt, i_causality, i_baseType, a_generateInputConnectors, a_generateOutputConnectors);
16756 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16757 ✗ txt := Tpl.writeStr(txt, i_name);
16758 ✗ txt := dumpFMIModelVariableDescription(txt, i_description);
16759 ✗ txt := dumpFMIModelVariablePlacementAnnotation(txt, i_x1Placement, i_x2Placement, i_y1Placement, i_y2Placement, a_generateInputConnectors, a_generateOutputConnectors, i_causality);
16760 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
16761 then txt;
16762
16763 case ( txt,
16764 _,
16765 _,
16766 _ )
16767 then txt;
16768 end match;
16769 end fun_459;
16770
16771 public function dumpFMIModelVariable
16772 input Tpl.Text in_txt;
16773 input String in_a_FMUVersion;
16774 input FMI.ModelVariables in_a_fmiModelVariable;
16775 input list<FMI.TypeDefinitions> in_a_fmiTypeDefinitionsList;
16776 input Boolean in_a_generateInputConnectors;
16777 input Boolean in_a_generateOutputConnectors;
16778
16779 output Tpl.Text out_txt;
16780 algorithm
16781 out_txt :=
16782 match(in_txt, in_a_FMUVersion, in_a_fmiModelVariable, in_a_fmiTypeDefinitionsList, in_a_generateInputConnectors, in_a_generateOutputConnectors)
16783 local
16784 Tpl.Text txt;
16785 FMI.ModelVariables a_fmiModelVariable;
16786 list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
16787 Boolean a_generateInputConnectors;
16788 Boolean a_generateOutputConnectors;
16789 String i_FMUVersion;
16790
16791 case ( txt,
16792 (i_FMUVersion as "1.0"),
16793 a_fmiModelVariable,
16794 a_fmiTypeDefinitionsList,
16795 a_generateInputConnectors,
16796 a_generateOutputConnectors )
16797 algorithm
16798 19 txt := fun_457(txt, a_fmiModelVariable, a_fmiTypeDefinitionsList, i_FMUVersion, a_generateOutputConnectors, a_generateInputConnectors);
16799 then txt;
16800
16801 case ( txt,
16802 (i_FMUVersion as "2.0"),
16803 a_fmiModelVariable,
16804 a_fmiTypeDefinitionsList,
16805 a_generateInputConnectors,
16806 a_generateOutputConnectors )
16807 algorithm
16808 616 txt := fun_458(txt, a_fmiModelVariable, a_fmiTypeDefinitionsList, i_FMUVersion, a_generateOutputConnectors, a_generateInputConnectors);
16809 then txt;
16810
16811 case ( txt,
16812 "3.0",
16813 a_fmiModelVariable,
16814 _,
16815 a_generateInputConnectors,
16816 a_generateOutputConnectors )
16817 algorithm
16818 6 txt := fun_459(txt, a_fmiModelVariable, a_generateOutputConnectors, a_generateInputConnectors);
16819 then txt;
16820
16821 case ( txt,
16822 _,
16823 _,
16824 _,
16825 _,
16826 _ )
16827 then txt;
16828 end match;
16829 end dumpFMIModelVariable;
16830
16831 protected function fun_461
16832 input Tpl.Text in_txt;
16833 input Boolean in_mArg;
16834 input String in_a_variability;
16835
16836 output Tpl.Text out_txt;
16837 algorithm
16838 out_txt :=
16839 match(in_txt, in_mArg, in_a_variability)
16840 local
16841 Tpl.Text txt;
16842 String a_variability;
16843
16844 case ( txt,
16845 false,
16846 a_variability )
16847 algorithm
16848 8 txt := Tpl.writeStr(txt, a_variability);
16849 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16850 then txt;
16851
16852 case ( txt,
16853 _,
16854 _ )
16855 then txt;
16856 end match;
16857 end fun_461;
16858
16859 public function dumpFMIModelVariableVariability
16860 input Tpl.Text txt;
16861 input String a_variability;
16862
16863 output Tpl.Text out_txt;
16864 protected
16865 Boolean ret_0;
16866 algorithm
16867
3/4
✓ Branch 0 taken 632 times.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 632 times.
640 ret_0 := stringEq(a_variability, "");
16868 640 out_txt := fun_461(txt, ret_0, a_variability);
16869 end dumpFMIModelVariableVariability;
16870
16871 protected function fun_463
16872 input Tpl.Text in_txt;
16873 input Boolean in_mArg;
16874 input String in_a_baseType;
16875 input String in_a_causality;
16876
16877 output Tpl.Text out_txt;
16878 algorithm
16879 out_txt :=
16880 match(in_txt, in_mArg, in_a_baseType, in_a_causality)
16881 local
16882 Tpl.Text txt;
16883 String a_baseType;
16884 String a_causality;
16885
16886 case ( txt,
16887 false,
16888 a_baseType,
16889 a_causality )
16890 algorithm
16891 109 txt := Tpl.writeStr(txt, a_causality);
16892 109 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
16893 109 txt := Tpl.writeStr(txt, a_baseType);
16894 then txt;
16895
16896 case ( txt,
16897 _,
16898 a_baseType,
16899 _ )
16900 algorithm
16901 504 txt := Tpl.writeStr(txt, a_baseType);
16902 then txt;
16903 end match;
16904 end fun_463;
16905
16906 protected function fun_464
16907 input Tpl.Text in_txt;
16908 input Boolean in_mArg;
16909 input String in_a_baseType;
16910 input String in_a_causality;
16911
16912 output Tpl.Text out_txt;
16913 algorithm
16914 out_txt :=
16915 match(in_txt, in_mArg, in_a_baseType, in_a_causality)
16916 local
16917 Tpl.Text txt;
16918 String a_baseType;
16919 String a_causality;
16920 Boolean ret_0;
16921
16922 case ( txt,
16923 false,
16924 a_baseType,
16925 a_causality )
16926 algorithm
16927
3/4
✓ Branch 0 taken 504 times.
✓ Branch 1 taken 109 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 504 times.
613 ret_0 := stringEq(a_causality, "");
16928 613 txt := fun_463(txt, ret_0, a_baseType, a_causality);
16929 then txt;
16930
16931 case ( txt,
16932 _,
16933 _,
16934 _ )
16935 algorithm
16936 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.BooleanOutput"));
16937 then txt;
16938 end match;
16939 end fun_464;
16940
16941 protected function fun_465
16942 input Tpl.Text in_txt;
16943 input Boolean in_mArg;
16944 input String in_a_baseType;
16945 input String in_a_causality;
16946 input Boolean in_a_generateOutputConnectors;
16947
16948 output Tpl.Text out_txt;
16949 algorithm
16950 out_txt :=
16951 match(in_txt, in_mArg, in_a_baseType, in_a_causality, in_a_generateOutputConnectors)
16952 local
16953 Tpl.Text txt;
16954 String a_baseType;
16955 String a_causality;
16956 Boolean a_generateOutputConnectors;
16957 Boolean ret_3;
16958 Boolean ret_2;
16959 Boolean ret_1;
16960 Boolean ret_0;
16961
16962 case ( txt,
16963 false,
16964 a_baseType,
16965 a_causality,
16966 a_generateOutputConnectors )
16967 algorithm
16968
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 613 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
613 ret_0 := stringEq(a_causality, "output");
16969
4/4
✓ Branch 0 taken 89 times.
✓ Branch 1 taken 524 times.
✓ Branch 3 taken 45 times.
✓ Branch 4 taken 44 times.
613 ret_1 := stringEq(a_baseType, "Boolean");
16970 613 ret_2 := boolAnd(ret_0, ret_1);
16971 613 ret_3 := boolAnd(a_generateOutputConnectors, ret_2);
16972 613 txt := fun_464(txt, ret_3, a_baseType, a_causality);
16973 then txt;
16974
16975 case ( txt,
16976 _,
16977 _,
16978 _,
16979 _ )
16980 algorithm
16981 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.IntegerOutput"));
16982 then txt;
16983 end match;
16984 end fun_465;
16985
16986 protected function fun_466
16987 input Tpl.Text in_txt;
16988 input Boolean in_mArg;
16989 input String in_a_baseType;
16990 input String in_a_causality;
16991 input Boolean in_a_generateOutputConnectors;
16992
16993 output Tpl.Text out_txt;
16994 algorithm
16995 out_txt :=
16996 match(in_txt, in_mArg, in_a_baseType, in_a_causality, in_a_generateOutputConnectors)
16997 local
16998 Tpl.Text txt;
16999 String a_baseType;
17000 String a_causality;
17001 Boolean a_generateOutputConnectors;
17002 Boolean ret_3;
17003 Boolean ret_2;
17004 Boolean ret_1;
17005 Boolean ret_0;
17006
17007 case ( txt,
17008 false,
17009 a_baseType,
17010 a_causality,
17011 a_generateOutputConnectors )
17012 algorithm
17013
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 613 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
613 ret_0 := stringEq(a_causality, "output");
17014
4/4
✓ Branch 0 taken 89 times.
✓ Branch 1 taken 524 times.
✓ Branch 3 taken 44 times.
✓ Branch 4 taken 45 times.
613 ret_1 := stringEq(a_baseType, "Integer");
17015 613 ret_2 := boolAnd(ret_0, ret_1);
17016 613 ret_3 := boolAnd(a_generateOutputConnectors, ret_2);
17017 613 txt := fun_465(txt, ret_3, a_baseType, a_causality, a_generateOutputConnectors);
17018 then txt;
17019
17020 case ( txt,
17021 _,
17022 _,
17023 _,
17024 _ )
17025 algorithm
17026 19 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.RealOutput"));
17027 then txt;
17028 end match;
17029 end fun_466;
17030
17031 protected function fun_467
17032 input Tpl.Text in_txt;
17033 input Boolean in_mArg;
17034 input String in_a_baseType;
17035 input String in_a_causality;
17036 input Boolean in_a_generateOutputConnectors;
17037
17038 output Tpl.Text out_txt;
17039 algorithm
17040 out_txt :=
17041 match(in_txt, in_mArg, in_a_baseType, in_a_causality, in_a_generateOutputConnectors)
17042 local
17043 Tpl.Text txt;
17044 String a_baseType;
17045 String a_causality;
17046 Boolean a_generateOutputConnectors;
17047 Boolean ret_3;
17048 Boolean ret_2;
17049 Boolean ret_1;
17050 Boolean ret_0;
17051
17052 case ( txt,
17053 false,
17054 a_baseType,
17055 a_causality,
17056 a_generateOutputConnectors )
17057 algorithm
17058
3/4
✓ Branch 0 taken 19 times.
✓ Branch 1 taken 613 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 19 times.
632 ret_0 := stringEq(a_causality, "output");
17059
3/4
✓ Branch 0 taken 526 times.
✓ Branch 1 taken 106 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 526 times.
632 ret_1 := stringEq(a_baseType, "Real");
17060 632 ret_2 := boolAnd(ret_0, ret_1);
17061 632 ret_3 := boolAnd(a_generateOutputConnectors, ret_2);
17062 632 txt := fun_466(txt, ret_3, a_baseType, a_causality, a_generateOutputConnectors);
17063 then txt;
17064
17065 case ( txt,
17066 _,
17067 _,
17068 _,
17069 _ )
17070 algorithm
17071 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.BooleanInput"));
17072 then txt;
17073 end match;
17074 end fun_467;
17075
17076 protected function fun_468
17077 input Tpl.Text in_txt;
17078 input Boolean in_mArg;
17079 input Boolean in_a_generateOutputConnectors;
17080 input String in_a_baseType;
17081 input String in_a_causality;
17082 input Boolean in_a_generateInputConnectors;
17083
17084 output Tpl.Text out_txt;
17085 algorithm
17086 out_txt :=
17087 match(in_txt, in_mArg, in_a_generateOutputConnectors, in_a_baseType, in_a_causality, in_a_generateInputConnectors)
17088 local
17089 Tpl.Text txt;
17090 Boolean a_generateOutputConnectors;
17091 String a_baseType;
17092 String a_causality;
17093 Boolean a_generateInputConnectors;
17094 Boolean ret_3;
17095 Boolean ret_2;
17096 Boolean ret_1;
17097 Boolean ret_0;
17098
17099 case ( txt,
17100 false,
17101 a_generateOutputConnectors,
17102 a_baseType,
17103 a_causality,
17104 a_generateInputConnectors )
17105 algorithm
17106
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 632 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
632 ret_0 := stringEq(a_causality, "input");
17107
4/4
✓ Branch 0 taken 89 times.
✓ Branch 1 taken 543 times.
✓ Branch 3 taken 45 times.
✓ Branch 4 taken 44 times.
632 ret_1 := stringEq(a_baseType, "Boolean");
17108 632 ret_2 := boolAnd(ret_0, ret_1);
17109 632 ret_3 := boolAnd(a_generateInputConnectors, ret_2);
17110 632 txt := fun_467(txt, ret_3, a_baseType, a_causality, a_generateOutputConnectors);
17111 then txt;
17112
17113 case ( txt,
17114 _,
17115 _,
17116 _,
17117 _,
17118 _ )
17119 algorithm
17120 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.IntegerInput"));
17121 then txt;
17122 end match;
17123 end fun_468;
17124
17125 protected function fun_469
17126 input Tpl.Text in_txt;
17127 input Boolean in_mArg;
17128 input String in_a_causality;
17129 input String in_a_baseType;
17130 input Boolean in_a_generateInputConnectors;
17131 input Boolean in_a_generateOutputConnectors;
17132
17133 output Tpl.Text out_txt;
17134 algorithm
17135 out_txt :=
17136 match(in_txt, in_mArg, in_a_causality, in_a_baseType, in_a_generateInputConnectors, in_a_generateOutputConnectors)
17137 local
17138 Tpl.Text txt;
17139 String a_causality;
17140 String a_baseType;
17141 Boolean a_generateInputConnectors;
17142 Boolean a_generateOutputConnectors;
17143 Boolean ret_3;
17144 Boolean ret_2;
17145 Boolean ret_1;
17146 Boolean ret_0;
17147
17148 case ( txt,
17149 false,
17150 a_causality,
17151 a_baseType,
17152 a_generateInputConnectors,
17153 a_generateOutputConnectors )
17154 algorithm
17155
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 632 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
632 ret_0 := stringEq(a_causality, "input");
17156
4/4
✓ Branch 0 taken 89 times.
✓ Branch 1 taken 543 times.
✓ Branch 3 taken 44 times.
✓ Branch 4 taken 45 times.
632 ret_1 := stringEq(a_baseType, "Integer");
17157 632 ret_2 := boolAnd(ret_0, ret_1);
17158 632 ret_3 := boolAnd(a_generateInputConnectors, ret_2);
17159 632 txt := fun_468(txt, ret_3, a_generateOutputConnectors, a_baseType, a_causality, a_generateInputConnectors);
17160 then txt;
17161
17162 case ( txt,
17163 _,
17164 _,
17165 _,
17166 _,
17167 _ )
17168 algorithm
17169 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Modelica.Blocks.Interfaces.RealInput"));
17170 then txt;
17171 end match;
17172 end fun_469;
17173
17174 public function dumpFMIModelVariableCausalityAndBaseType
17175 input Tpl.Text txt;
17176 input String a_causality;
17177 input String a_baseType;
17178 input Boolean a_generateInputConnectors;
17179 input Boolean a_generateOutputConnectors;
17180
17181 output Tpl.Text out_txt;
17182 protected
17183 Boolean ret_3;
17184 Boolean ret_2;
17185 Boolean ret_1;
17186 Boolean ret_0;
17187 algorithm
17188
3/4
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 632 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
640 ret_0 := stringEq(a_causality, "input");
17189
3/4
✓ Branch 0 taken 534 times.
✓ Branch 1 taken 106 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 534 times.
640 ret_1 := stringEq(a_baseType, "Real");
17190 640 ret_2 := boolAnd(ret_0, ret_1);
17191 640 ret_3 := boolAnd(a_generateInputConnectors, ret_2);
17192 640 out_txt := fun_469(txt, ret_3, a_causality, a_baseType, a_generateInputConnectors, a_generateOutputConnectors);
17193 end dumpFMIModelVariableCausalityAndBaseType;
17194
17195 protected function fun_471
17196 input Tpl.Text in_txt;
17197 input Boolean in_mArg;
17198 input String in_a_causality;
17199
17200 output Tpl.Text out_txt;
17201 algorithm
17202 out_txt :=
17203 match(in_txt, in_mArg, in_a_causality)
17204 local
17205 Tpl.Text txt;
17206 String a_causality;
17207
17208 case ( txt,
17209 false,
17210 a_causality )
17211 algorithm
17212 ✗ txt := Tpl.writeStr(txt, a_causality);
17213 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
17214 then txt;
17215
17216 case ( txt,
17217 _,
17218 _ )
17219 then txt;
17220 end match;
17221 end fun_471;
17222
17223 public function dumpFMIModelVariableCausality
17224 input Tpl.Text txt;
17225 input String a_causality;
17226
17227 output Tpl.Text out_txt;
17228 protected
17229 Boolean ret_0;
17230 algorithm
17231 ✗ ret_0 := stringEq(a_causality, "");
17232 ✗ out_txt := fun_471(txt, ret_0, a_causality);
17233 end dumpFMIModelVariableCausality;
17234
17235 protected function fun_473
17236 input Tpl.Text in_txt;
17237 input Boolean in_a_isFixed;
17238
17239 output Tpl.Text out_txt;
17240 algorithm
17241 out_txt :=
17242 match(in_txt, in_a_isFixed)
17243 local
17244 Tpl.Text txt;
17245
17246 case ( txt,
17247 false )
17248 algorithm
17249 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
17250 then txt;
17251
17252 case ( txt,
17253 _ )
17254 algorithm
17255 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
17256 then txt;
17257 end match;
17258 end fun_473;
17259
17260 protected function fun_474
17261 input Tpl.Text in_txt;
17262 input String in_a_causality;
17263 input Boolean in_a_isFixed;
17264
17265 output Tpl.Text out_txt;
17266 algorithm
17267 out_txt :=
17268 match(in_txt, in_a_causality, in_a_isFixed)
17269 local
17270 Tpl.Text txt;
17271 Boolean a_isFixed;
17272
17273 case ( txt,
17274 "parameter",
17275 a_isFixed )
17276 algorithm
17277 ✗ txt := fun_473(txt, a_isFixed);
17278 then txt;
17279
17280 case ( txt,
17281 _,
17282 _ )
17283 then txt;
17284 end match;
17285 end fun_474;
17286
17287 protected function fun_475
17288 input Tpl.Text in_txt;
17289 input Boolean in_a_isFixed;
17290 input Real in_a_startVal;
17291
17292 output Tpl.Text out_txt;
17293 algorithm
17294 out_txt :=
17295 match(in_txt, in_a_isFixed, in_a_startVal)
17296 local
17297 Tpl.Text txt;
17298 Real a_startVal;
17299
17300 case ( txt,
17301 false,
17302 a_startVal )
17303 algorithm
17304 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
17305 ✗ txt := Tpl.writeStr(txt, realString(a_startVal));
17306 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
17307 then txt;
17308
17309 case ( txt,
17310 _,
17311 a_startVal )
17312 algorithm
17313 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
17314 ✗ txt := Tpl.writeStr(txt, realString(a_startVal));
17315 then txt;
17316 end match;
17317 end fun_475;
17318
17319 protected function fun_476
17320 input Tpl.Text in_txt;
17321 input Boolean in_mArg;
17322 input Real in_a_startVal;
17323
17324 output Tpl.Text out_txt;
17325 algorithm
17326 out_txt :=
17327 match(in_txt, in_mArg, in_a_startVal)
17328 local
17329 Tpl.Text txt;
17330 Real a_startVal;
17331
17332 case ( txt,
17333 false,
17334 _ )
17335 then txt;
17336
17337 case ( txt,
17338 _,
17339 a_startVal )
17340 algorithm
17341 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
17342 2 txt := Tpl.writeStr(txt, realString(a_startVal));
17343 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
17344 then txt;
17345 end match;
17346 end fun_476;
17347
17348 protected function fun_477
17349 input Tpl.Text in_txt;
17350 input String in_a_causality;
17351 input Real in_a_startVal;
17352 input Boolean in_a_isFixed;
17353
17354 output Tpl.Text out_txt;
17355 algorithm
17356 out_txt :=
17357 match(in_txt, in_a_causality, in_a_startVal, in_a_isFixed)
17358 local
17359 Tpl.Text txt;
17360 Real a_startVal;
17361 Boolean a_isFixed;
17362 Boolean ret_0;
17363
17364 case ( txt,
17365 "parameter",
17366 a_startVal,
17367 a_isFixed )
17368 algorithm
17369 ✗ txt := fun_475(txt, a_isFixed, a_startVal);
17370 then txt;
17371
17372 case ( txt,
17373 _,
17374 a_startVal,
17375 a_isFixed )
17376 algorithm
17377 2 ret_0 := boolNot(a_isFixed);
17378 2 txt := fun_476(txt, ret_0, a_startVal);
17379 then txt;
17380 end match;
17381 end fun_477;
17382
17383 protected function fun_478
17384 input Tpl.Text in_txt;
17385 input list<Real> in_a_startValue;
17386 input String in_a_causality;
17387 input Boolean in_a_isFixed;
17388
17389 output Tpl.Text out_txt;
17390 algorithm
17391 out_txt :=
17392 match(in_txt, in_a_startValue, in_a_causality, in_a_isFixed)
17393 local
17394 Tpl.Text txt;
17395 String a_causality;
17396 Boolean a_isFixed;
17397 Real i_startVal;
17398
17399 case ( txt,
17400 {},
17401 a_causality,
17402 a_isFixed )
17403 algorithm
17404 3 txt := fun_474(txt, a_causality, a_isFixed);
17405 then txt;
17406
17407 case ( txt,
17408 i_startVal :: _,
17409 a_causality,
17410 a_isFixed )
17411 algorithm
17412 2 txt := fun_477(txt, a_causality, i_startVal, a_isFixed);
17413 then txt;
17414
17415 case ( txt,
17416 _,
17417 _,
17418 _ )
17419 then txt;
17420 end match;
17421 end fun_478;
17422
17423 public function dumpFMI3RealModelVariableStartValue
17424 input Tpl.Text txt;
17425 input String a_causality;
17426 input list<Real> a_startValue;
17427 input Boolean a_isFixed;
17428
17429 output Tpl.Text out_txt;
17430 algorithm
17431 5 out_txt := fun_478(txt, a_startValue, a_causality, a_isFixed);
17432 end dumpFMI3RealModelVariableStartValue;
17433
17434 protected function fun_480
17435 input Tpl.Text in_txt;
17436 input Boolean in_a_isFixed;
17437
17438 output Tpl.Text out_txt;
17439 algorithm
17440 out_txt :=
17441 match(in_txt, in_a_isFixed)
17442 local
17443 Tpl.Text txt;
17444
17445 case ( txt,
17446 false )
17447 algorithm
17448 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
17449 then txt;
17450
17451 case ( txt,
17452 _ )
17453 algorithm
17454 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
17455 then txt;
17456 end match;
17457 end fun_480;
17458
17459 protected function fun_481
17460 input Tpl.Text in_txt;
17461 input String in_a_causality;
17462 input Boolean in_a_isFixed;
17463
17464 output Tpl.Text out_txt;
17465 algorithm
17466 out_txt :=
17467 match(in_txt, in_a_causality, in_a_isFixed)
17468 local
17469 Tpl.Text txt;
17470 Boolean a_isFixed;
17471
17472 case ( txt,
17473 "parameter",
17474 a_isFixed )
17475 algorithm
17476 ✗ txt := fun_480(txt, a_isFixed);
17477 then txt;
17478
17479 case ( txt,
17480 _,
17481 _ )
17482 then txt;
17483 end match;
17484 end fun_481;
17485
17486 protected function fun_482
17487 input Tpl.Text in_txt;
17488 input Boolean in_a_isFixed;
17489 input Integer in_a_startVal;
17490
17491 output Tpl.Text out_txt;
17492 algorithm
17493 out_txt :=
17494 match(in_txt, in_a_isFixed, in_a_startVal)
17495 local
17496 Tpl.Text txt;
17497 Integer a_startVal;
17498
17499 case ( txt,
17500 false,
17501 a_startVal )
17502 algorithm
17503 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
17504 ✗ txt := Tpl.writeStr(txt, intString(a_startVal));
17505 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
17506 then txt;
17507
17508 case ( txt,
17509 _,
17510 a_startVal )
17511 algorithm
17512 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
17513 ✗ txt := Tpl.writeStr(txt, intString(a_startVal));
17514 then txt;
17515 end match;
17516 end fun_482;
17517
17518 protected function fun_483
17519 input Tpl.Text in_txt;
17520 input Boolean in_mArg;
17521 input Integer in_a_startVal;
17522
17523 output Tpl.Text out_txt;
17524 algorithm
17525 out_txt :=
17526 match(in_txt, in_mArg, in_a_startVal)
17527 local
17528 Tpl.Text txt;
17529 Integer a_startVal;
17530
17531 case ( txt,
17532 false,
17533 _ )
17534 then txt;
17535
17536 case ( txt,
17537 _,
17538 a_startVal )
17539 algorithm
17540 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
17541 ✗ txt := Tpl.writeStr(txt, intString(a_startVal));
17542 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
17543 then txt;
17544 end match;
17545 end fun_483;
17546
17547 protected function fun_484
17548 input Tpl.Text in_txt;
17549 input String in_a_causality;
17550 input Integer in_a_startVal;
17551 input Boolean in_a_isFixed;
17552
17553 output Tpl.Text out_txt;
17554 algorithm
17555 out_txt :=
17556 match(in_txt, in_a_causality, in_a_startVal, in_a_isFixed)
17557 local
17558 Tpl.Text txt;
17559 Integer a_startVal;
17560 Boolean a_isFixed;
17561 Boolean ret_0;
17562
17563 case ( txt,
17564 "parameter",
17565 a_startVal,
17566 a_isFixed )
17567 algorithm
17568 ✗ txt := fun_482(txt, a_isFixed, a_startVal);
17569 then txt;
17570
17571 case ( txt,
17572 _,
17573 a_startVal,
17574 a_isFixed )
17575 algorithm
17576 ✗ ret_0 := boolNot(a_isFixed);
17577 ✗ txt := fun_483(txt, ret_0, a_startVal);
17578 then txt;
17579 end match;
17580 end fun_484;
17581
17582 protected function fun_485
17583 input Tpl.Text in_txt;
17584 input list<Integer> in_a_startValue;
17585 input String in_a_causality;
17586 input Boolean in_a_isFixed;
17587
17588 output Tpl.Text out_txt;
17589 algorithm
17590 out_txt :=
17591 match(in_txt, in_a_startValue, in_a_causality, in_a_isFixed)
17592 local
17593 Tpl.Text txt;
17594 String a_causality;
17595 Boolean a_isFixed;
17596 Integer i_startVal;
17597
17598 case ( txt,
17599 {},
17600 a_causality,
17601 a_isFixed )
17602 algorithm
17603 ✗ txt := fun_481(txt, a_causality, a_isFixed);
17604 then txt;
17605
17606 case ( txt,
17607 i_startVal :: _,
17608 a_causality,
17609 a_isFixed )
17610 algorithm
17611 ✗ txt := fun_484(txt, a_causality, i_startVal, a_isFixed);
17612 then txt;
17613
17614 case ( txt,
17615 _,
17616 _,
17617 _ )
17618 then txt;
17619 end match;
17620 end fun_485;
17621
17622 public function dumpFMI3IntegerModelVariableStartValue
17623 input Tpl.Text txt;
17624 input String a_causality;
17625 input list<Integer> a_startValue;
17626 input Boolean a_isFixed;
17627
17628 output Tpl.Text out_txt;
17629 algorithm
17630 ✗ out_txt := fun_485(txt, a_startValue, a_causality, a_isFixed);
17631 end dumpFMI3IntegerModelVariableStartValue;
17632
17633 protected function fun_487
17634 input Tpl.Text in_txt;
17635 input Boolean in_a_isFixed;
17636
17637 output Tpl.Text out_txt;
17638 algorithm
17639 out_txt :=
17640 match(in_txt, in_a_isFixed)
17641 local
17642 Tpl.Text txt;
17643
17644 case ( txt,
17645 false )
17646 algorithm
17647 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
17648 then txt;
17649
17650 case ( txt,
17651 _ )
17652 algorithm
17653 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
17654 then txt;
17655 end match;
17656 end fun_487;
17657
17658 protected function fun_488
17659 input Tpl.Text in_txt;
17660 input String in_a_causality;
17661 input Boolean in_a_isFixed;
17662
17663 output Tpl.Text out_txt;
17664 algorithm
17665 out_txt :=
17666 match(in_txt, in_a_causality, in_a_isFixed)
17667 local
17668 Tpl.Text txt;
17669 Boolean a_isFixed;
17670
17671 case ( txt,
17672 "parameter",
17673 a_isFixed )
17674 algorithm
17675 ✗ txt := fun_487(txt, a_isFixed);
17676 then txt;
17677
17678 case ( txt,
17679 _,
17680 _ )
17681 then txt;
17682 end match;
17683 end fun_488;
17684
17685 protected function fun_489
17686 input Tpl.Text in_txt;
17687 input Boolean in_a_isFixed;
17688 input Boolean in_a_startVal;
17689
17690 output Tpl.Text out_txt;
17691 algorithm
17692 out_txt :=
17693 match(in_txt, in_a_isFixed, in_a_startVal)
17694 local
17695 Tpl.Text txt;
17696 Boolean a_startVal;
17697
17698 case ( txt,
17699 false,
17700 a_startVal )
17701 algorithm
17702 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
17703 ✗ txt := Tpl.writeStr(txt, Tpl.booleanString(a_startVal));
17704 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
17705 then txt;
17706
17707 case ( txt,
17708 _,
17709 a_startVal )
17710 algorithm
17711 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
17712 ✗ txt := Tpl.writeStr(txt, Tpl.booleanString(a_startVal));
17713 then txt;
17714 end match;
17715 end fun_489;
17716
17717 protected function fun_490
17718 input Tpl.Text in_txt;
17719 input Boolean in_mArg;
17720 input Boolean in_a_startVal;
17721
17722 output Tpl.Text out_txt;
17723 algorithm
17724 out_txt :=
17725 match(in_txt, in_mArg, in_a_startVal)
17726 local
17727 Tpl.Text txt;
17728 Boolean a_startVal;
17729
17730 case ( txt,
17731 false,
17732 _ )
17733 then txt;
17734
17735 case ( txt,
17736 _,
17737 a_startVal )
17738 algorithm
17739 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
17740 ✗ txt := Tpl.writeStr(txt, Tpl.booleanString(a_startVal));
17741 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
17742 then txt;
17743 end match;
17744 end fun_490;
17745
17746 protected function fun_491
17747 input Tpl.Text in_txt;
17748 input String in_a_causality;
17749 input Boolean in_a_startVal;
17750 input Boolean in_a_isFixed;
17751
17752 output Tpl.Text out_txt;
17753 algorithm
17754 out_txt :=
17755 match(in_txt, in_a_causality, in_a_startVal, in_a_isFixed)
17756 local
17757 Tpl.Text txt;
17758 Boolean a_startVal;
17759 Boolean a_isFixed;
17760 Boolean ret_0;
17761
17762 case ( txt,
17763 "parameter",
17764 a_startVal,
17765 a_isFixed )
17766 algorithm
17767 ✗ txt := fun_489(txt, a_isFixed, a_startVal);
17768 then txt;
17769
17770 case ( txt,
17771 _,
17772 a_startVal,
17773 a_isFixed )
17774 algorithm
17775 ✗ ret_0 := boolNot(a_isFixed);
17776 ✗ txt := fun_490(txt, ret_0, a_startVal);
17777 then txt;
17778 end match;
17779 end fun_491;
17780
17781 protected function fun_492
17782 input Tpl.Text in_txt;
17783 input list<Boolean> in_a_startValue;
17784 input String in_a_causality;
17785 input Boolean in_a_isFixed;
17786
17787 output Tpl.Text out_txt;
17788 algorithm
17789 out_txt :=
17790 match(in_txt, in_a_startValue, in_a_causality, in_a_isFixed)
17791 local
17792 Tpl.Text txt;
17793 String a_causality;
17794 Boolean a_isFixed;
17795 Boolean i_startVal;
17796
17797 case ( txt,
17798 {},
17799 a_causality,
17800 a_isFixed )
17801 algorithm
17802 ✗ txt := fun_488(txt, a_causality, a_isFixed);
17803 then txt;
17804
17805 case ( txt,
17806 i_startVal :: _,
17807 a_causality,
17808 a_isFixed )
17809 algorithm
17810 ✗ txt := fun_491(txt, a_causality, i_startVal, a_isFixed);
17811 then txt;
17812
17813 case ( txt,
17814 _,
17815 _,
17816 _ )
17817 then txt;
17818 end match;
17819 end fun_492;
17820
17821 public function dumpFMI3BooleanModelVariableStartValue
17822 input Tpl.Text txt;
17823 input String a_causality;
17824 input list<Boolean> a_startValue;
17825 input Boolean a_isFixed;
17826
17827 output Tpl.Text out_txt;
17828 algorithm
17829 ✗ out_txt := fun_492(txt, a_startValue, a_causality, a_isFixed);
17830 end dumpFMI3BooleanModelVariableStartValue;
17831
17832 protected function fun_494
17833 input Tpl.Text in_txt;
17834 input Boolean in_a_isFixed;
17835
17836 output Tpl.Text out_txt;
17837 algorithm
17838 out_txt :=
17839 match(in_txt, in_a_isFixed)
17840 local
17841 Tpl.Text txt;
17842
17843 case ( txt,
17844 false )
17845 algorithm
17846 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
17847 then txt;
17848
17849 case ( txt,
17850 _ )
17851 algorithm
17852 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
17853 then txt;
17854 end match;
17855 end fun_494;
17856
17857 protected function fun_495
17858 input Tpl.Text in_txt;
17859 input String in_a_causality;
17860 input Boolean in_a_isFixed;
17861
17862 output Tpl.Text out_txt;
17863 algorithm
17864 out_txt :=
17865 match(in_txt, in_a_causality, in_a_isFixed)
17866 local
17867 Tpl.Text txt;
17868 Boolean a_isFixed;
17869
17870 case ( txt,
17871 "parameter",
17872 a_isFixed )
17873 algorithm
17874 ✗ txt := fun_494(txt, a_isFixed);
17875 then txt;
17876
17877 case ( txt,
17878 _,
17879 _ )
17880 then txt;
17881 end match;
17882 end fun_495;
17883
17884 protected function fun_496
17885 input Tpl.Text in_txt;
17886 input Boolean in_a_isFixed;
17887 input String in_a_startVal;
17888
17889 output Tpl.Text out_txt;
17890 algorithm
17891 out_txt :=
17892 match(in_txt, in_a_isFixed, in_a_startVal)
17893 local
17894 Tpl.Text txt;
17895 String a_startVal;
17896
17897 case ( txt,
17898 false,
17899 a_startVal )
17900 algorithm
17901 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start=\""));
17902 ✗ txt := Tpl.writeStr(txt, a_startVal);
17903 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\",fixed=false)"));
17904 then txt;
17905
17906 case ( txt,
17907 _,
17908 a_startVal )
17909 algorithm
17910 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = \""));
17911 ✗ txt := Tpl.writeStr(txt, a_startVal);
17912 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
17913 then txt;
17914 end match;
17915 end fun_496;
17916
17917 protected function fun_497
17918 input Tpl.Text in_txt;
17919 input Boolean in_mArg;
17920 input String in_a_startVal;
17921
17922 output Tpl.Text out_txt;
17923 algorithm
17924 out_txt :=
17925 match(in_txt, in_mArg, in_a_startVal)
17926 local
17927 Tpl.Text txt;
17928 String a_startVal;
17929
17930 case ( txt,
17931 false,
17932 _ )
17933 then txt;
17934
17935 case ( txt,
17936 _,
17937 a_startVal )
17938 algorithm
17939 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start=\""));
17940 ✗ txt := Tpl.writeStr(txt, a_startVal);
17941 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\",fixed=false)"));
17942 then txt;
17943 end match;
17944 end fun_497;
17945
17946 protected function fun_498
17947 input Tpl.Text in_txt;
17948 input String in_a_causality;
17949 input String in_a_startVal;
17950 input Boolean in_a_isFixed;
17951
17952 output Tpl.Text out_txt;
17953 algorithm
17954 out_txt :=
17955 match(in_txt, in_a_causality, in_a_startVal, in_a_isFixed)
17956 local
17957 Tpl.Text txt;
17958 String a_startVal;
17959 Boolean a_isFixed;
17960 Boolean ret_0;
17961
17962 case ( txt,
17963 "parameter",
17964 a_startVal,
17965 a_isFixed )
17966 algorithm
17967 ✗ txt := fun_496(txt, a_isFixed, a_startVal);
17968 then txt;
17969
17970 case ( txt,
17971 _,
17972 a_startVal,
17973 a_isFixed )
17974 algorithm
17975 ✗ ret_0 := boolNot(a_isFixed);
17976 ✗ txt := fun_497(txt, ret_0, a_startVal);
17977 then txt;
17978 end match;
17979 end fun_498;
17980
17981 protected function fun_499
17982 input Tpl.Text in_txt;
17983 input list<String> in_a_startValue;
17984 input String in_a_causality;
17985 input Boolean in_a_isFixed;
17986
17987 output Tpl.Text out_txt;
17988 algorithm
17989 out_txt :=
17990 match(in_txt, in_a_startValue, in_a_causality, in_a_isFixed)
17991 local
17992 Tpl.Text txt;
17993 String a_causality;
17994 Boolean a_isFixed;
17995 String i_startVal;
17996
17997 case ( txt,
17998 {},
17999 a_causality,
18000 a_isFixed )
18001 algorithm
18002 ✗ txt := fun_495(txt, a_causality, a_isFixed);
18003 then txt;
18004
18005 case ( txt,
18006 i_startVal :: _,
18007 a_causality,
18008 a_isFixed )
18009 algorithm
18010 ✗ txt := fun_498(txt, a_causality, i_startVal, a_isFixed);
18011 then txt;
18012
18013 case ( txt,
18014 _,
18015 _,
18016 _ )
18017 then txt;
18018 end match;
18019 end fun_499;
18020
18021 public function dumpFMI3StringModelVariableStartValue
18022 input Tpl.Text txt;
18023 input String a_causality;
18024 input list<String> a_startValue;
18025 input Boolean a_isFixed;
18026
18027 output Tpl.Text out_txt;
18028 algorithm
18029 ✗ out_txt := fun_499(txt, a_startValue, a_causality, a_isFixed);
18030 end dumpFMI3StringModelVariableStartValue;
18031
18032 protected function fun_501
18033 input Tpl.Text in_txt;
18034 input Boolean in_mArg;
18035
18036 output Tpl.Text out_txt;
18037 algorithm
18038 out_txt :=
18039 match(in_txt, in_mArg)
18040 local
18041 Tpl.Text txt;
18042
18043 case ( txt,
18044 false )
18045 then txt;
18046
18047 case ( txt,
18048 _ )
18049 algorithm
18050 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
18051 then txt;
18052 end match;
18053 end fun_501;
18054
18055 protected function fun_502
18056 input Tpl.Text in_txt;
18057 input Boolean in_mArg;
18058 input Boolean in_a_isFixed;
18059 input Boolean in_a_hasStartValue;
18060
18061 output Tpl.Text out_txt;
18062 algorithm
18063 out_txt :=
18064 match(in_txt, in_mArg, in_a_isFixed, in_a_hasStartValue)
18065 local
18066 Tpl.Text txt;
18067 Boolean a_isFixed;
18068 Boolean a_hasStartValue;
18069 Boolean ret_2;
18070 Boolean ret_1;
18071 Boolean ret_0;
18072
18073 case ( txt,
18074 false,
18075 a_isFixed,
18076 a_hasStartValue )
18077 algorithm
18078 ret_0 := boolNot(a_hasStartValue);
18079 ret_1 := boolNot(a_isFixed);
18080 ✗ ret_2 := boolAnd(ret_0, ret_1);
18081 ✗ txt := fun_501(txt, ret_2);
18082 then txt;
18083
18084 case ( txt,
18085 _,
18086 _,
18087 _ )
18088 algorithm
18089 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
18090 then txt;
18091 end match;
18092 end fun_502;
18093
18094 protected function fun_503
18095 input Tpl.Text in_txt;
18096 input Boolean in_mArg;
18097 input Real in_a_startValue;
18098 input Boolean in_a_isFixed;
18099 input Boolean in_a_hasStartValue;
18100
18101 output Tpl.Text out_txt;
18102 algorithm
18103 out_txt :=
18104 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18105 local
18106 Tpl.Text txt;
18107 Real a_startValue;
18108 Boolean a_isFixed;
18109 Boolean a_hasStartValue;
18110 Boolean ret_1;
18111 Boolean ret_0;
18112
18113 case ( txt,
18114 false,
18115 _,
18116 a_isFixed,
18117 a_hasStartValue )
18118 algorithm
18119 ✗ ret_0 := boolNot(a_hasStartValue);
18120 ✗ ret_1 := boolAnd(ret_0, a_isFixed);
18121 ✗ txt := fun_502(txt, ret_1, a_isFixed, a_hasStartValue);
18122 then txt;
18123
18124 case ( txt,
18125 _,
18126 a_startValue,
18127 _,
18128 _ )
18129 algorithm
18130 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
18131 ✗ txt := Tpl.writeStr(txt, realString(a_startValue));
18132 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
18133 then txt;
18134 end match;
18135 end fun_503;
18136
18137 protected function fun_504
18138 input Tpl.Text in_txt;
18139 input Boolean in_mArg;
18140 input Real in_a_startValue;
18141 input Boolean in_a_isFixed;
18142 input Boolean in_a_hasStartValue;
18143
18144 output Tpl.Text out_txt;
18145 algorithm
18146 out_txt :=
18147 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18148 local
18149 Tpl.Text txt;
18150 Real a_startValue;
18151 Boolean a_isFixed;
18152 Boolean a_hasStartValue;
18153 Boolean ret_1;
18154 Boolean ret_0;
18155
18156 case ( txt,
18157 false,
18158 a_startValue,
18159 a_isFixed,
18160 a_hasStartValue )
18161 algorithm
18162 ✗ ret_0 := boolNot(a_isFixed);
18163 ✗ ret_1 := boolAnd(a_hasStartValue, ret_0);
18164 ✗ txt := fun_503(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
18165 then txt;
18166
18167 case ( txt,
18168 _,
18169 a_startValue,
18170 _,
18171 _ )
18172 algorithm
18173 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
18174 4 txt := Tpl.writeStr(txt, realString(a_startValue));
18175 then txt;
18176 end match;
18177 end fun_504;
18178
18179 protected function fun_505
18180 input Tpl.Text in_txt;
18181 input Boolean in_mArg;
18182 input Real in_a_startValue;
18183
18184 output Tpl.Text out_txt;
18185 algorithm
18186 out_txt :=
18187 match(in_txt, in_mArg, in_a_startValue)
18188 local
18189 Tpl.Text txt;
18190 Real a_startValue;
18191
18192 case ( txt,
18193 false,
18194 _ )
18195 then txt;
18196
18197 case ( txt,
18198 _,
18199 a_startValue )
18200 algorithm
18201 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
18202 ✗ txt := Tpl.writeStr(txt, realString(a_startValue));
18203 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
18204 then txt;
18205 end match;
18206 end fun_505;
18207
18208 protected function fun_506
18209 input Tpl.Text in_txt;
18210 input String in_a_variabilityCausality;
18211 input Real in_a_startValue;
18212 input Boolean in_a_isFixed;
18213 input Boolean in_a_hasStartValue;
18214
18215 output Tpl.Text out_txt;
18216 algorithm
18217 out_txt :=
18218 match(in_txt, in_a_variabilityCausality, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18219 local
18220 Tpl.Text txt;
18221 Real a_startValue;
18222 Boolean a_isFixed;
18223 Boolean a_hasStartValue;
18224 Boolean ret_2;
18225 Boolean ret_1;
18226 Boolean ret_0;
18227
18228 case ( txt,
18229 "parameter",
18230 a_startValue,
18231 a_isFixed,
18232 a_hasStartValue )
18233 algorithm
18234 4 ret_0 := boolAnd(a_hasStartValue, a_isFixed);
18235 4 txt := fun_504(txt, ret_0, a_startValue, a_isFixed, a_hasStartValue);
18236 then txt;
18237
18238 case ( txt,
18239 "",
18240 a_startValue,
18241 a_isFixed,
18242 a_hasStartValue )
18243 algorithm
18244 9 ret_1 := boolNot(a_isFixed);
18245 9 ret_2 := boolAnd(a_hasStartValue, ret_1);
18246 9 txt := fun_505(txt, ret_2, a_startValue);
18247 then txt;
18248
18249 case ( txt,
18250 _,
18251 _,
18252 _,
18253 _ )
18254 then txt;
18255 end match;
18256 end fun_506;
18257
18258 protected function fun_507
18259 input Tpl.Text in_txt;
18260 input Boolean in_mArg;
18261 input Real in_a_startValue;
18262
18263 output Tpl.Text out_txt;
18264 algorithm
18265 out_txt :=
18266 match(in_txt, in_mArg, in_a_startValue)
18267 local
18268 Tpl.Text txt;
18269 Real a_startValue;
18270
18271 case ( txt,
18272 false,
18273 _ )
18274 then txt;
18275
18276 case ( txt,
18277 _,
18278 a_startValue )
18279 algorithm
18280 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
18281 ✗ txt := Tpl.writeStr(txt, realString(a_startValue));
18282 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
18283 then txt;
18284 end match;
18285 end fun_507;
18286
18287 protected function fun_508
18288 input Tpl.Text in_txt;
18289 input Boolean in_mArg;
18290 input Real in_a_startValue;
18291 input Boolean in_a_isFixed;
18292 input Boolean in_a_hasStartValue;
18293
18294 output Tpl.Text out_txt;
18295 algorithm
18296 out_txt :=
18297 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18298 local
18299 Tpl.Text txt;
18300 Real a_startValue;
18301 Boolean a_isFixed;
18302 Boolean a_hasStartValue;
18303 Boolean ret_1;
18304 Boolean ret_0;
18305
18306 case ( txt,
18307 false,
18308 a_startValue,
18309 a_isFixed,
18310 a_hasStartValue )
18311 algorithm
18312 ✗ ret_0 := boolNot(a_isFixed);
18313 ✗ ret_1 := boolAnd(a_hasStartValue, ret_0);
18314 ✗ txt := fun_507(txt, ret_1, a_startValue);
18315 then txt;
18316
18317 case ( txt,
18318 _,
18319 _,
18320 _,
18321 _ )
18322 algorithm
18323 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
18324 then txt;
18325 end match;
18326 end fun_508;
18327
18328 protected function fun_509
18329 input Tpl.Text in_txt;
18330 input Boolean in_mArg;
18331 input Real in_a_startValue;
18332 input Boolean in_a_isFixed;
18333 input Boolean in_a_hasStartValue;
18334
18335 output Tpl.Text out_txt;
18336 algorithm
18337 out_txt :=
18338 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18339 local
18340 Tpl.Text txt;
18341 Real a_startValue;
18342 Boolean a_isFixed;
18343 Boolean a_hasStartValue;
18344 Boolean ret_2;
18345 Boolean ret_1;
18346 Boolean ret_0;
18347
18348 case ( txt,
18349 false,
18350 a_startValue,
18351 a_isFixed,
18352 a_hasStartValue )
18353 algorithm
18354 ret_0 := boolNot(a_hasStartValue);
18355 ret_1 := boolNot(a_isFixed);
18356 ✗ ret_2 := boolAnd(ret_0, ret_1);
18357 ✗ txt := fun_508(txt, ret_2, a_startValue, a_isFixed, a_hasStartValue);
18358 then txt;
18359
18360 case ( txt,
18361 _,
18362 _,
18363 _,
18364 _ )
18365 algorithm
18366 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
18367 then txt;
18368 end match;
18369 end fun_509;
18370
18371 protected function fun_510
18372 input Tpl.Text in_txt;
18373 input Boolean in_mArg;
18374 input Real in_a_startValue;
18375 input Boolean in_a_isFixed;
18376 input Boolean in_a_hasStartValue;
18377
18378 output Tpl.Text out_txt;
18379 algorithm
18380 out_txt :=
18381 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18382 local
18383 Tpl.Text txt;
18384 Real a_startValue;
18385 Boolean a_isFixed;
18386 Boolean a_hasStartValue;
18387 Boolean ret_1;
18388 Boolean ret_0;
18389
18390 case ( txt,
18391 false,
18392 a_startValue,
18393 a_isFixed,
18394 a_hasStartValue )
18395 algorithm
18396 ✗ ret_0 := boolNot(a_hasStartValue);
18397 ✗ ret_1 := boolAnd(ret_0, a_isFixed);
18398 ✗ txt := fun_509(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
18399 then txt;
18400
18401 case ( txt,
18402 _,
18403 a_startValue,
18404 _,
18405 _ )
18406 algorithm
18407 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
18408 ✗ txt := Tpl.writeStr(txt, realString(a_startValue));
18409 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
18410 then txt;
18411 end match;
18412 end fun_510;
18413
18414 protected function fun_511
18415 input Tpl.Text in_txt;
18416 input Boolean in_mArg;
18417 input Real in_a_startValue;
18418 input Boolean in_a_isFixed;
18419 input Boolean in_a_hasStartValue;
18420
18421 output Tpl.Text out_txt;
18422 algorithm
18423 out_txt :=
18424 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18425 local
18426 Tpl.Text txt;
18427 Real a_startValue;
18428 Boolean a_isFixed;
18429 Boolean a_hasStartValue;
18430 Boolean ret_1;
18431 Boolean ret_0;
18432
18433 case ( txt,
18434 false,
18435 a_startValue,
18436 a_isFixed,
18437 a_hasStartValue )
18438 algorithm
18439 ✗ ret_0 := boolNot(a_isFixed);
18440 ✗ ret_1 := boolAnd(a_hasStartValue, ret_0);
18441 ✗ txt := fun_510(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
18442 then txt;
18443
18444 case ( txt,
18445 _,
18446 a_startValue,
18447 _,
18448 _ )
18449 algorithm
18450 92 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
18451 92 txt := Tpl.writeStr(txt, realString(a_startValue));
18452 then txt;
18453 end match;
18454 end fun_511;
18455
18456 protected function fun_512
18457 input Tpl.Text in_txt;
18458 input String in_a_variabilityCausality;
18459 input Real in_a_startValue;
18460 input Boolean in_a_isFixed;
18461 input Boolean in_a_hasStartValue;
18462
18463 output Tpl.Text out_txt;
18464 algorithm
18465 out_txt :=
18466 match(in_txt, in_a_variabilityCausality, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18467 local
18468 Tpl.Text txt;
18469 Real a_startValue;
18470 Boolean a_isFixed;
18471 Boolean a_hasStartValue;
18472 Boolean ret_0;
18473
18474 case ( txt,
18475 "parameter",
18476 a_startValue,
18477 a_isFixed,
18478 a_hasStartValue )
18479 algorithm
18480 92 ret_0 := boolAnd(a_hasStartValue, a_isFixed);
18481 92 txt := fun_511(txt, ret_0, a_startValue, a_isFixed, a_hasStartValue);
18482 then txt;
18483
18484 case ( txt,
18485 _,
18486 _,
18487 _,
18488 _ )
18489 then txt;
18490 end match;
18491 end fun_512;
18492
18493 public function dumpFMIRealModelVariableStartValue
18494 input Tpl.Text in_txt;
18495 input String in_a_FMUVersion;
18496 input String in_a_variabilityCausality;
18497 input Boolean in_a_hasStartValue;
18498 input Real in_a_startValue;
18499 input Boolean in_a_isFixed;
18500
18501 output Tpl.Text out_txt;
18502 algorithm
18503 out_txt :=
18504 match(in_txt, in_a_FMUVersion, in_a_variabilityCausality, in_a_hasStartValue, in_a_startValue, in_a_isFixed)
18505 local
18506 Tpl.Text txt;
18507 String a_variabilityCausality;
18508 Boolean a_hasStartValue;
18509 Real a_startValue;
18510 Boolean a_isFixed;
18511
18512 case ( txt,
18513 "1.0",
18514 a_variabilityCausality,
18515 a_hasStartValue,
18516 a_startValue,
18517 a_isFixed )
18518 algorithm
18519 13 txt := fun_506(txt, a_variabilityCausality, a_startValue, a_isFixed, a_hasStartValue);
18520 then txt;
18521
18522 case ( txt,
18523 "2.0",
18524 a_variabilityCausality,
18525 a_hasStartValue,
18526 a_startValue,
18527 a_isFixed )
18528 algorithm
18529 516 txt := fun_512(txt, a_variabilityCausality, a_startValue, a_isFixed, a_hasStartValue);
18530 then txt;
18531
18532 case ( txt,
18533 _,
18534 _,
18535 _,
18536 _,
18537 _ )
18538 then txt;
18539 end match;
18540 end dumpFMIRealModelVariableStartValue;
18541
18542 protected function fun_514
18543 input Tpl.Text in_txt;
18544 input Boolean in_mArg;
18545
18546 output Tpl.Text out_txt;
18547 algorithm
18548 out_txt :=
18549 match(in_txt, in_mArg)
18550 local
18551 Tpl.Text txt;
18552
18553 case ( txt,
18554 false )
18555 then txt;
18556
18557 case ( txt,
18558 _ )
18559 algorithm
18560 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
18561 then txt;
18562 end match;
18563 end fun_514;
18564
18565 protected function fun_515
18566 input Tpl.Text in_txt;
18567 input Boolean in_mArg;
18568 input Boolean in_a_isFixed;
18569 input Boolean in_a_hasStartValue;
18570
18571 output Tpl.Text out_txt;
18572 algorithm
18573 out_txt :=
18574 match(in_txt, in_mArg, in_a_isFixed, in_a_hasStartValue)
18575 local
18576 Tpl.Text txt;
18577 Boolean a_isFixed;
18578 Boolean a_hasStartValue;
18579 Boolean ret_2;
18580 Boolean ret_1;
18581 Boolean ret_0;
18582
18583 case ( txt,
18584 false,
18585 a_isFixed,
18586 a_hasStartValue )
18587 algorithm
18588 ret_0 := boolNot(a_hasStartValue);
18589 ret_1 := boolNot(a_isFixed);
18590 ✗ ret_2 := boolAnd(ret_0, ret_1);
18591 ✗ txt := fun_514(txt, ret_2);
18592 then txt;
18593
18594 case ( txt,
18595 _,
18596 _,
18597 _ )
18598 algorithm
18599 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
18600 then txt;
18601 end match;
18602 end fun_515;
18603
18604 protected function fun_516
18605 input Tpl.Text in_txt;
18606 input Boolean in_mArg;
18607 input Integer in_a_startValue;
18608 input Boolean in_a_isFixed;
18609 input Boolean in_a_hasStartValue;
18610
18611 output Tpl.Text out_txt;
18612 algorithm
18613 out_txt :=
18614 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18615 local
18616 Tpl.Text txt;
18617 Integer a_startValue;
18618 Boolean a_isFixed;
18619 Boolean a_hasStartValue;
18620 Boolean ret_1;
18621 Boolean ret_0;
18622
18623 case ( txt,
18624 false,
18625 _,
18626 a_isFixed,
18627 a_hasStartValue )
18628 algorithm
18629 ✗ ret_0 := boolNot(a_hasStartValue);
18630 ✗ ret_1 := boolAnd(ret_0, a_isFixed);
18631 ✗ txt := fun_515(txt, ret_1, a_isFixed, a_hasStartValue);
18632 then txt;
18633
18634 case ( txt,
18635 _,
18636 a_startValue,
18637 _,
18638 _ )
18639 algorithm
18640 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
18641 ✗ txt := Tpl.writeStr(txt, intString(a_startValue));
18642 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
18643 then txt;
18644 end match;
18645 end fun_516;
18646
18647 protected function fun_517
18648 input Tpl.Text in_txt;
18649 input Boolean in_mArg;
18650 input Integer in_a_startValue;
18651 input Boolean in_a_isFixed;
18652 input Boolean in_a_hasStartValue;
18653
18654 output Tpl.Text out_txt;
18655 algorithm
18656 out_txt :=
18657 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18658 local
18659 Tpl.Text txt;
18660 Integer a_startValue;
18661 Boolean a_isFixed;
18662 Boolean a_hasStartValue;
18663 Boolean ret_1;
18664 Boolean ret_0;
18665
18666 case ( txt,
18667 false,
18668 a_startValue,
18669 a_isFixed,
18670 a_hasStartValue )
18671 algorithm
18672 ✗ ret_0 := boolNot(a_isFixed);
18673 ✗ ret_1 := boolAnd(a_hasStartValue, ret_0);
18674 ✗ txt := fun_516(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
18675 then txt;
18676
18677 case ( txt,
18678 _,
18679 a_startValue,
18680 _,
18681 _ )
18682 algorithm
18683 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
18684 ✗ txt := Tpl.writeStr(txt, intString(a_startValue));
18685 then txt;
18686 end match;
18687 end fun_517;
18688
18689 protected function fun_518
18690 input Tpl.Text in_txt;
18691 input Boolean in_mArg;
18692 input Integer in_a_startValue;
18693
18694 output Tpl.Text out_txt;
18695 algorithm
18696 out_txt :=
18697 match(in_txt, in_mArg, in_a_startValue)
18698 local
18699 Tpl.Text txt;
18700 Integer a_startValue;
18701
18702 case ( txt,
18703 false,
18704 _ )
18705 then txt;
18706
18707 case ( txt,
18708 _,
18709 a_startValue )
18710 algorithm
18711 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
18712 ✗ txt := Tpl.writeStr(txt, intString(a_startValue));
18713 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
18714 then txt;
18715 end match;
18716 end fun_518;
18717
18718 protected function fun_519
18719 input Tpl.Text in_txt;
18720 input String in_a_variabilityCausality;
18721 input Integer in_a_startValue;
18722 input Boolean in_a_isFixed;
18723 input Boolean in_a_hasStartValue;
18724
18725 output Tpl.Text out_txt;
18726 algorithm
18727 out_txt :=
18728 match(in_txt, in_a_variabilityCausality, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18729 local
18730 Tpl.Text txt;
18731 Integer a_startValue;
18732 Boolean a_isFixed;
18733 Boolean a_hasStartValue;
18734 Boolean ret_2;
18735 Boolean ret_1;
18736 Boolean ret_0;
18737
18738 case ( txt,
18739 "parameter",
18740 a_startValue,
18741 a_isFixed,
18742 a_hasStartValue )
18743 algorithm
18744 ✗ ret_0 := boolAnd(a_hasStartValue, a_isFixed);
18745 ✗ txt := fun_517(txt, ret_0, a_startValue, a_isFixed, a_hasStartValue);
18746 then txt;
18747
18748 case ( txt,
18749 "",
18750 a_startValue,
18751 a_isFixed,
18752 a_hasStartValue )
18753 algorithm
18754 ✗ ret_1 := boolNot(a_isFixed);
18755 ✗ ret_2 := boolAnd(a_hasStartValue, ret_1);
18756 ✗ txt := fun_518(txt, ret_2, a_startValue);
18757 then txt;
18758
18759 case ( txt,
18760 _,
18761 _,
18762 _,
18763 _ )
18764 then txt;
18765 end match;
18766 end fun_519;
18767
18768 protected function fun_520
18769 input Tpl.Text in_txt;
18770 input Boolean in_mArg;
18771 input Integer in_a_startValue;
18772
18773 output Tpl.Text out_txt;
18774 algorithm
18775 out_txt :=
18776 match(in_txt, in_mArg, in_a_startValue)
18777 local
18778 Tpl.Text txt;
18779 Integer a_startValue;
18780
18781 case ( txt,
18782 false,
18783 _ )
18784 then txt;
18785
18786 case ( txt,
18787 _,
18788 a_startValue )
18789 algorithm
18790 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
18791 ✗ txt := Tpl.writeStr(txt, intString(a_startValue));
18792 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
18793 then txt;
18794 end match;
18795 end fun_520;
18796
18797 protected function fun_521
18798 input Tpl.Text in_txt;
18799 input Boolean in_mArg;
18800 input Integer in_a_startValue;
18801 input Boolean in_a_isFixed;
18802 input Boolean in_a_hasStartValue;
18803
18804 output Tpl.Text out_txt;
18805 algorithm
18806 out_txt :=
18807 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18808 local
18809 Tpl.Text txt;
18810 Integer a_startValue;
18811 Boolean a_isFixed;
18812 Boolean a_hasStartValue;
18813 Boolean ret_1;
18814 Boolean ret_0;
18815
18816 case ( txt,
18817 false,
18818 a_startValue,
18819 a_isFixed,
18820 a_hasStartValue )
18821 algorithm
18822 ✗ ret_0 := boolNot(a_isFixed);
18823 ✗ ret_1 := boolAnd(a_hasStartValue, ret_0);
18824 ✗ txt := fun_520(txt, ret_1, a_startValue);
18825 then txt;
18826
18827 case ( txt,
18828 _,
18829 _,
18830 _,
18831 _ )
18832 algorithm
18833 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
18834 then txt;
18835 end match;
18836 end fun_521;
18837
18838 protected function fun_522
18839 input Tpl.Text in_txt;
18840 input Boolean in_mArg;
18841 input Integer in_a_startValue;
18842 input Boolean in_a_isFixed;
18843 input Boolean in_a_hasStartValue;
18844
18845 output Tpl.Text out_txt;
18846 algorithm
18847 out_txt :=
18848 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18849 local
18850 Tpl.Text txt;
18851 Integer a_startValue;
18852 Boolean a_isFixed;
18853 Boolean a_hasStartValue;
18854 Boolean ret_2;
18855 Boolean ret_1;
18856 Boolean ret_0;
18857
18858 case ( txt,
18859 false,
18860 a_startValue,
18861 a_isFixed,
18862 a_hasStartValue )
18863 algorithm
18864 ret_0 := boolNot(a_hasStartValue);
18865 ret_1 := boolNot(a_isFixed);
18866 ✗ ret_2 := boolAnd(ret_0, ret_1);
18867 ✗ txt := fun_521(txt, ret_2, a_startValue, a_isFixed, a_hasStartValue);
18868 then txt;
18869
18870 case ( txt,
18871 _,
18872 _,
18873 _,
18874 _ )
18875 algorithm
18876 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
18877 then txt;
18878 end match;
18879 end fun_522;
18880
18881 protected function fun_523
18882 input Tpl.Text in_txt;
18883 input Boolean in_mArg;
18884 input Integer in_a_startValue;
18885 input Boolean in_a_isFixed;
18886 input Boolean in_a_hasStartValue;
18887
18888 output Tpl.Text out_txt;
18889 algorithm
18890 out_txt :=
18891 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18892 local
18893 Tpl.Text txt;
18894 Integer a_startValue;
18895 Boolean a_isFixed;
18896 Boolean a_hasStartValue;
18897 Boolean ret_1;
18898 Boolean ret_0;
18899
18900 case ( txt,
18901 false,
18902 a_startValue,
18903 a_isFixed,
18904 a_hasStartValue )
18905 algorithm
18906 ✗ ret_0 := boolNot(a_hasStartValue);
18907 ✗ ret_1 := boolAnd(ret_0, a_isFixed);
18908 ✗ txt := fun_522(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
18909 then txt;
18910
18911 case ( txt,
18912 _,
18913 a_startValue,
18914 _,
18915 _ )
18916 algorithm
18917 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
18918 ✗ txt := Tpl.writeStr(txt, intString(a_startValue));
18919 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
18920 then txt;
18921 end match;
18922 end fun_523;
18923
18924 protected function fun_524
18925 input Tpl.Text in_txt;
18926 input Boolean in_mArg;
18927 input Integer in_a_startValue;
18928 input Boolean in_a_isFixed;
18929 input Boolean in_a_hasStartValue;
18930
18931 output Tpl.Text out_txt;
18932 algorithm
18933 out_txt :=
18934 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18935 local
18936 Tpl.Text txt;
18937 Integer a_startValue;
18938 Boolean a_isFixed;
18939 Boolean a_hasStartValue;
18940 Boolean ret_1;
18941 Boolean ret_0;
18942
18943 case ( txt,
18944 false,
18945 a_startValue,
18946 a_isFixed,
18947 a_hasStartValue )
18948 algorithm
18949 ✗ ret_0 := boolNot(a_isFixed);
18950 ✗ ret_1 := boolAnd(a_hasStartValue, ret_0);
18951 ✗ txt := fun_523(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
18952 then txt;
18953
18954 case ( txt,
18955 _,
18956 a_startValue,
18957 _,
18958 _ )
18959 algorithm
18960 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
18961 2 txt := Tpl.writeStr(txt, intString(a_startValue));
18962 then txt;
18963 end match;
18964 end fun_524;
18965
18966 protected function fun_525
18967 input Tpl.Text in_txt;
18968 input String in_a_variabilityCausality;
18969 input Integer in_a_startValue;
18970 input Boolean in_a_isFixed;
18971 input Boolean in_a_hasStartValue;
18972
18973 output Tpl.Text out_txt;
18974 algorithm
18975 out_txt :=
18976 match(in_txt, in_a_variabilityCausality, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
18977 local
18978 Tpl.Text txt;
18979 Integer a_startValue;
18980 Boolean a_isFixed;
18981 Boolean a_hasStartValue;
18982 Boolean ret_0;
18983
18984 case ( txt,
18985 "parameter",
18986 a_startValue,
18987 a_isFixed,
18988 a_hasStartValue )
18989 algorithm
18990 2 ret_0 := boolAnd(a_hasStartValue, a_isFixed);
18991 2 txt := fun_524(txt, ret_0, a_startValue, a_isFixed, a_hasStartValue);
18992 then txt;
18993
18994 case ( txt,
18995 _,
18996 _,
18997 _,
18998 _ )
18999 then txt;
19000 end match;
19001 end fun_525;
19002
19003 public function dumpFMIIntegerModelVariableStartValue
19004 input Tpl.Text in_txt;
19005 input String in_a_FMUVersion;
19006 input String in_a_variabilityCausality;
19007 input Boolean in_a_hasStartValue;
19008 input Integer in_a_startValue;
19009 input Boolean in_a_isFixed;
19010
19011 output Tpl.Text out_txt;
19012 algorithm
19013 out_txt :=
19014 match(in_txt, in_a_FMUVersion, in_a_variabilityCausality, in_a_hasStartValue, in_a_startValue, in_a_isFixed)
19015 local
19016 Tpl.Text txt;
19017 String a_variabilityCausality;
19018 Boolean a_hasStartValue;
19019 Integer a_startValue;
19020 Boolean a_isFixed;
19021
19022 case ( txt,
19023 "1.0",
19024 a_variabilityCausality,
19025 a_hasStartValue,
19026 a_startValue,
19027 a_isFixed )
19028 algorithm
19029 ✗ txt := fun_519(txt, a_variabilityCausality, a_startValue, a_isFixed, a_hasStartValue);
19030 then txt;
19031
19032 case ( txt,
19033 "2.0",
19034 a_variabilityCausality,
19035 a_hasStartValue,
19036 a_startValue,
19037 a_isFixed )
19038 algorithm
19039 45 txt := fun_525(txt, a_variabilityCausality, a_startValue, a_isFixed, a_hasStartValue);
19040 then txt;
19041
19042 case ( txt,
19043 _,
19044 _,
19045 _,
19046 _,
19047 _ )
19048 then txt;
19049 end match;
19050 end dumpFMIIntegerModelVariableStartValue;
19051
19052 protected function fun_527
19053 input Tpl.Text in_txt;
19054 input Boolean in_mArg;
19055
19056 output Tpl.Text out_txt;
19057 algorithm
19058 out_txt :=
19059 match(in_txt, in_mArg)
19060 local
19061 Tpl.Text txt;
19062
19063 case ( txt,
19064 false )
19065 then txt;
19066
19067 case ( txt,
19068 _ )
19069 algorithm
19070 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
19071 then txt;
19072 end match;
19073 end fun_527;
19074
19075 protected function fun_528
19076 input Tpl.Text in_txt;
19077 input Boolean in_mArg;
19078 input Boolean in_a_isFixed;
19079 input Boolean in_a_hasStartValue;
19080
19081 output Tpl.Text out_txt;
19082 algorithm
19083 out_txt :=
19084 match(in_txt, in_mArg, in_a_isFixed, in_a_hasStartValue)
19085 local
19086 Tpl.Text txt;
19087 Boolean a_isFixed;
19088 Boolean a_hasStartValue;
19089 Boolean ret_2;
19090 Boolean ret_1;
19091 Boolean ret_0;
19092
19093 case ( txt,
19094 false,
19095 a_isFixed,
19096 a_hasStartValue )
19097 algorithm
19098 ret_0 := boolNot(a_hasStartValue);
19099 ret_1 := boolNot(a_isFixed);
19100 1 ret_2 := boolAnd(ret_0, ret_1);
19101 1 txt := fun_527(txt, ret_2);
19102 then txt;
19103
19104 case ( txt,
19105 _,
19106 _,
19107 _ )
19108 algorithm
19109 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
19110 then txt;
19111 end match;
19112 end fun_528;
19113
19114 protected function fun_529
19115 input Tpl.Text in_txt;
19116 input Boolean in_mArg;
19117 input Boolean in_a_startValue;
19118 input Boolean in_a_isFixed;
19119 input Boolean in_a_hasStartValue;
19120
19121 output Tpl.Text out_txt;
19122 algorithm
19123 out_txt :=
19124 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19125 local
19126 Tpl.Text txt;
19127 Boolean a_startValue;
19128 Boolean a_isFixed;
19129 Boolean a_hasStartValue;
19130 Boolean ret_1;
19131 Boolean ret_0;
19132
19133 case ( txt,
19134 false,
19135 _,
19136 a_isFixed,
19137 a_hasStartValue )
19138 algorithm
19139 1 ret_0 := boolNot(a_hasStartValue);
19140 1 ret_1 := boolAnd(ret_0, a_isFixed);
19141 1 txt := fun_528(txt, ret_1, a_isFixed, a_hasStartValue);
19142 then txt;
19143
19144 case ( txt,
19145 _,
19146 a_startValue,
19147 _,
19148 _ )
19149 algorithm
19150 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
19151 ✗ txt := Tpl.writeStr(txt, Tpl.booleanString(a_startValue));
19152 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
19153 then txt;
19154 end match;
19155 end fun_529;
19156
19157 protected function fun_530
19158 input Tpl.Text in_txt;
19159 input Boolean in_mArg;
19160 input Boolean in_a_startValue;
19161 input Boolean in_a_isFixed;
19162 input Boolean in_a_hasStartValue;
19163
19164 output Tpl.Text out_txt;
19165 algorithm
19166 out_txt :=
19167 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19168 local
19169 Tpl.Text txt;
19170 Boolean a_startValue;
19171 Boolean a_isFixed;
19172 Boolean a_hasStartValue;
19173 Boolean ret_1;
19174 Boolean ret_0;
19175
19176 case ( txt,
19177 false,
19178 a_startValue,
19179 a_isFixed,
19180 a_hasStartValue )
19181 algorithm
19182 1 ret_0 := boolNot(a_isFixed);
19183 1 ret_1 := boolAnd(a_hasStartValue, ret_0);
19184 1 txt := fun_529(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
19185 then txt;
19186
19187 case ( txt,
19188 _,
19189 a_startValue,
19190 _,
19191 _ )
19192 algorithm
19193 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
19194 3 txt := Tpl.writeStr(txt, Tpl.booleanString(a_startValue));
19195 then txt;
19196 end match;
19197 end fun_530;
19198
19199 protected function fun_531
19200 input Tpl.Text in_txt;
19201 input Boolean in_mArg;
19202 input Boolean in_a_startValue;
19203
19204 output Tpl.Text out_txt;
19205 algorithm
19206 out_txt :=
19207 match(in_txt, in_mArg, in_a_startValue)
19208 local
19209 Tpl.Text txt;
19210 Boolean a_startValue;
19211
19212 case ( txt,
19213 false,
19214 _ )
19215 then txt;
19216
19217 case ( txt,
19218 _,
19219 a_startValue )
19220 algorithm
19221 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
19222 ✗ txt := Tpl.writeStr(txt, Tpl.booleanString(a_startValue));
19223 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
19224 then txt;
19225 end match;
19226 end fun_531;
19227
19228 protected function fun_532
19229 input Tpl.Text in_txt;
19230 input String in_a_variabilityCausality;
19231 input Boolean in_a_startValue;
19232 input Boolean in_a_isFixed;
19233 input Boolean in_a_hasStartValue;
19234
19235 output Tpl.Text out_txt;
19236 algorithm
19237 out_txt :=
19238 match(in_txt, in_a_variabilityCausality, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19239 local
19240 Tpl.Text txt;
19241 Boolean a_startValue;
19242 Boolean a_isFixed;
19243 Boolean a_hasStartValue;
19244 Boolean ret_2;
19245 Boolean ret_1;
19246 Boolean ret_0;
19247
19248 case ( txt,
19249 "parameter",
19250 a_startValue,
19251 a_isFixed,
19252 a_hasStartValue )
19253 algorithm
19254 4 ret_0 := boolAnd(a_hasStartValue, a_isFixed);
19255 4 txt := fun_530(txt, ret_0, a_startValue, a_isFixed, a_hasStartValue);
19256 then txt;
19257
19258 case ( txt,
19259 "",
19260 a_startValue,
19261 a_isFixed,
19262 a_hasStartValue )
19263 algorithm
19264 2 ret_1 := boolNot(a_isFixed);
19265 2 ret_2 := boolAnd(a_hasStartValue, ret_1);
19266 2 txt := fun_531(txt, ret_2, a_startValue);
19267 then txt;
19268
19269 case ( txt,
19270 _,
19271 _,
19272 _,
19273 _ )
19274 then txt;
19275 end match;
19276 end fun_532;
19277
19278 protected function fun_533
19279 input Tpl.Text in_txt;
19280 input Boolean in_mArg;
19281 input Boolean in_a_startValue;
19282
19283 output Tpl.Text out_txt;
19284 algorithm
19285 out_txt :=
19286 match(in_txt, in_mArg, in_a_startValue)
19287 local
19288 Tpl.Text txt;
19289 Boolean a_startValue;
19290
19291 case ( txt,
19292 false,
19293 _ )
19294 then txt;
19295
19296 case ( txt,
19297 _,
19298 a_startValue )
19299 algorithm
19300 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
19301 ✗ txt := Tpl.writeStr(txt, Tpl.booleanString(a_startValue));
19302 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
19303 then txt;
19304 end match;
19305 end fun_533;
19306
19307 protected function fun_534
19308 input Tpl.Text in_txt;
19309 input Boolean in_mArg;
19310 input Boolean in_a_startValue;
19311 input Boolean in_a_isFixed;
19312 input Boolean in_a_hasStartValue;
19313
19314 output Tpl.Text out_txt;
19315 algorithm
19316 out_txt :=
19317 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19318 local
19319 Tpl.Text txt;
19320 Boolean a_startValue;
19321 Boolean a_isFixed;
19322 Boolean a_hasStartValue;
19323 Boolean ret_1;
19324 Boolean ret_0;
19325
19326 case ( txt,
19327 false,
19328 a_startValue,
19329 a_isFixed,
19330 a_hasStartValue )
19331 algorithm
19332 ✗ ret_0 := boolNot(a_isFixed);
19333 ✗ ret_1 := boolAnd(a_hasStartValue, ret_0);
19334 ✗ txt := fun_533(txt, ret_1, a_startValue);
19335 then txt;
19336
19337 case ( txt,
19338 _,
19339 _,
19340 _,
19341 _ )
19342 algorithm
19343 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
19344 then txt;
19345 end match;
19346 end fun_534;
19347
19348 protected function fun_535
19349 input Tpl.Text in_txt;
19350 input Boolean in_mArg;
19351 input Boolean in_a_startValue;
19352 input Boolean in_a_isFixed;
19353 input Boolean in_a_hasStartValue;
19354
19355 output Tpl.Text out_txt;
19356 algorithm
19357 out_txt :=
19358 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19359 local
19360 Tpl.Text txt;
19361 Boolean a_startValue;
19362 Boolean a_isFixed;
19363 Boolean a_hasStartValue;
19364 Boolean ret_2;
19365 Boolean ret_1;
19366 Boolean ret_0;
19367
19368 case ( txt,
19369 false,
19370 a_startValue,
19371 a_isFixed,
19372 a_hasStartValue )
19373 algorithm
19374 ret_0 := boolNot(a_hasStartValue);
19375 ret_1 := boolNot(a_isFixed);
19376 ✗ ret_2 := boolAnd(ret_0, ret_1);
19377 ✗ txt := fun_534(txt, ret_2, a_startValue, a_isFixed, a_hasStartValue);
19378 then txt;
19379
19380 case ( txt,
19381 _,
19382 _,
19383 _,
19384 _ )
19385 algorithm
19386 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
19387 then txt;
19388 end match;
19389 end fun_535;
19390
19391 protected function fun_536
19392 input Tpl.Text in_txt;
19393 input Boolean in_mArg;
19394 input Boolean in_a_startValue;
19395 input Boolean in_a_isFixed;
19396 input Boolean in_a_hasStartValue;
19397
19398 output Tpl.Text out_txt;
19399 algorithm
19400 out_txt :=
19401 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19402 local
19403 Tpl.Text txt;
19404 Boolean a_startValue;
19405 Boolean a_isFixed;
19406 Boolean a_hasStartValue;
19407 Boolean ret_1;
19408 Boolean ret_0;
19409
19410 case ( txt,
19411 false,
19412 a_startValue,
19413 a_isFixed,
19414 a_hasStartValue )
19415 algorithm
19416 ✗ ret_0 := boolNot(a_hasStartValue);
19417 ✗ ret_1 := boolAnd(ret_0, a_isFixed);
19418 ✗ txt := fun_535(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
19419 then txt;
19420
19421 case ( txt,
19422 _,
19423 a_startValue,
19424 _,
19425 _ )
19426 algorithm
19427 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start="));
19428 ✗ txt := Tpl.writeStr(txt, Tpl.booleanString(a_startValue));
19429 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(",fixed=false)"));
19430 then txt;
19431 end match;
19432 end fun_536;
19433
19434 protected function fun_537
19435 input Tpl.Text in_txt;
19436 input Boolean in_mArg;
19437 input Boolean in_a_startValue;
19438 input Boolean in_a_isFixed;
19439 input Boolean in_a_hasStartValue;
19440
19441 output Tpl.Text out_txt;
19442 algorithm
19443 out_txt :=
19444 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19445 local
19446 Tpl.Text txt;
19447 Boolean a_startValue;
19448 Boolean a_isFixed;
19449 Boolean a_hasStartValue;
19450 Boolean ret_1;
19451 Boolean ret_0;
19452
19453 case ( txt,
19454 false,
19455 a_startValue,
19456 a_isFixed,
19457 a_hasStartValue )
19458 algorithm
19459 ✗ ret_0 := boolNot(a_isFixed);
19460 ✗ ret_1 := boolAnd(a_hasStartValue, ret_0);
19461 ✗ txt := fun_536(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
19462 then txt;
19463
19464 case ( txt,
19465 _,
19466 a_startValue,
19467 _,
19468 _ )
19469 algorithm
19470 9 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
19471 9 txt := Tpl.writeStr(txt, Tpl.booleanString(a_startValue));
19472 then txt;
19473 end match;
19474 end fun_537;
19475
19476 protected function fun_538
19477 input Tpl.Text in_txt;
19478 input String in_a_variabilityCausality;
19479 input Boolean in_a_startValue;
19480 input Boolean in_a_isFixed;
19481 input Boolean in_a_hasStartValue;
19482
19483 output Tpl.Text out_txt;
19484 algorithm
19485 out_txt :=
19486 match(in_txt, in_a_variabilityCausality, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19487 local
19488 Tpl.Text txt;
19489 Boolean a_startValue;
19490 Boolean a_isFixed;
19491 Boolean a_hasStartValue;
19492 Boolean ret_0;
19493
19494 case ( txt,
19495 "parameter",
19496 a_startValue,
19497 a_isFixed,
19498 a_hasStartValue )
19499 algorithm
19500 9 ret_0 := boolAnd(a_hasStartValue, a_isFixed);
19501 9 txt := fun_537(txt, ret_0, a_startValue, a_isFixed, a_hasStartValue);
19502 then txt;
19503
19504 case ( txt,
19505 _,
19506 _,
19507 _,
19508 _ )
19509 then txt;
19510 end match;
19511 end fun_538;
19512
19513 public function dumpFMIBooleanModelVariableStartValue
19514 input Tpl.Text in_txt;
19515 input String in_a_FMUVersion;
19516 input String in_a_variabilityCausality;
19517 input Boolean in_a_hasStartValue;
19518 input Boolean in_a_startValue;
19519 input Boolean in_a_isFixed;
19520
19521 output Tpl.Text out_txt;
19522 algorithm
19523 out_txt :=
19524 match(in_txt, in_a_FMUVersion, in_a_variabilityCausality, in_a_hasStartValue, in_a_startValue, in_a_isFixed)
19525 local
19526 Tpl.Text txt;
19527 String a_variabilityCausality;
19528 Boolean a_hasStartValue;
19529 Boolean a_startValue;
19530 Boolean a_isFixed;
19531
19532 case ( txt,
19533 "1.0",
19534 a_variabilityCausality,
19535 a_hasStartValue,
19536 a_startValue,
19537 a_isFixed )
19538 algorithm
19539 6 txt := fun_532(txt, a_variabilityCausality, a_startValue, a_isFixed, a_hasStartValue);
19540 then txt;
19541
19542 case ( txt,
19543 "2.0",
19544 a_variabilityCausality,
19545 a_hasStartValue,
19546 a_startValue,
19547 a_isFixed )
19548 algorithm
19549 38 txt := fun_538(txt, a_variabilityCausality, a_startValue, a_isFixed, a_hasStartValue);
19550 then txt;
19551
19552 case ( txt,
19553 _,
19554 _,
19555 _,
19556 _,
19557 _ )
19558 then txt;
19559 end match;
19560 end dumpFMIBooleanModelVariableStartValue;
19561
19562 protected function fun_540
19563 input Tpl.Text in_txt;
19564 input Boolean in_mArg;
19565
19566 output Tpl.Text out_txt;
19567 algorithm
19568 out_txt :=
19569 match(in_txt, in_mArg)
19570 local
19571 Tpl.Text txt;
19572
19573 case ( txt,
19574 false )
19575 then txt;
19576
19577 case ( txt,
19578 _ )
19579 algorithm
19580 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
19581 then txt;
19582 end match;
19583 end fun_540;
19584
19585 protected function fun_541
19586 input Tpl.Text in_txt;
19587 input Boolean in_mArg;
19588 input Boolean in_a_isFixed;
19589 input Boolean in_a_hasStartValue;
19590
19591 output Tpl.Text out_txt;
19592 algorithm
19593 out_txt :=
19594 match(in_txt, in_mArg, in_a_isFixed, in_a_hasStartValue)
19595 local
19596 Tpl.Text txt;
19597 Boolean a_isFixed;
19598 Boolean a_hasStartValue;
19599 Boolean ret_2;
19600 Boolean ret_1;
19601 Boolean ret_0;
19602
19603 case ( txt,
19604 false,
19605 a_isFixed,
19606 a_hasStartValue )
19607 algorithm
19608 ret_0 := boolNot(a_hasStartValue);
19609 ret_1 := boolNot(a_isFixed);
19610 ✗ ret_2 := boolAnd(ret_0, ret_1);
19611 ✗ txt := fun_540(txt, ret_2);
19612 then txt;
19613
19614 case ( txt,
19615 _,
19616 _,
19617 _ )
19618 algorithm
19619 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
19620 then txt;
19621 end match;
19622 end fun_541;
19623
19624 protected function fun_542
19625 input Tpl.Text in_txt;
19626 input Boolean in_mArg;
19627 input String in_a_startValue;
19628 input Boolean in_a_isFixed;
19629 input Boolean in_a_hasStartValue;
19630
19631 output Tpl.Text out_txt;
19632 algorithm
19633 out_txt :=
19634 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19635 local
19636 Tpl.Text txt;
19637 String a_startValue;
19638 Boolean a_isFixed;
19639 Boolean a_hasStartValue;
19640 Boolean ret_1;
19641 Boolean ret_0;
19642
19643 case ( txt,
19644 false,
19645 _,
19646 a_isFixed,
19647 a_hasStartValue )
19648 algorithm
19649 ✗ ret_0 := boolNot(a_hasStartValue);
19650 ✗ ret_1 := boolAnd(ret_0, a_isFixed);
19651 ✗ txt := fun_541(txt, ret_1, a_isFixed, a_hasStartValue);
19652 then txt;
19653
19654 case ( txt,
19655 _,
19656 a_startValue,
19657 _,
19658 _ )
19659 algorithm
19660 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start=\""));
19661 ✗ txt := Tpl.writeStr(txt, a_startValue);
19662 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\")"));
19663 then txt;
19664 end match;
19665 end fun_542;
19666
19667 protected function fun_543
19668 input Tpl.Text in_txt;
19669 input Boolean in_mArg;
19670 input String in_a_startValue;
19671 input Boolean in_a_isFixed;
19672 input Boolean in_a_hasStartValue;
19673
19674 output Tpl.Text out_txt;
19675 algorithm
19676 out_txt :=
19677 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19678 local
19679 Tpl.Text txt;
19680 String a_startValue;
19681 Boolean a_isFixed;
19682 Boolean a_hasStartValue;
19683 Boolean ret_1;
19684 Boolean ret_0;
19685
19686 case ( txt,
19687 false,
19688 a_startValue,
19689 a_isFixed,
19690 a_hasStartValue )
19691 algorithm
19692 ✗ ret_0 := boolNot(a_isFixed);
19693 ✗ ret_1 := boolAnd(a_hasStartValue, ret_0);
19694 ✗ txt := fun_542(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
19695 then txt;
19696
19697 case ( txt,
19698 _,
19699 a_startValue,
19700 _,
19701 _ )
19702 algorithm
19703 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = \""));
19704 ✗ txt := Tpl.writeStr(txt, a_startValue);
19705 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
19706 then txt;
19707 end match;
19708 end fun_543;
19709
19710 protected function fun_544
19711 input Tpl.Text in_txt;
19712 input Boolean in_mArg;
19713 input String in_a_startValue;
19714
19715 output Tpl.Text out_txt;
19716 algorithm
19717 out_txt :=
19718 match(in_txt, in_mArg, in_a_startValue)
19719 local
19720 Tpl.Text txt;
19721 String a_startValue;
19722
19723 case ( txt,
19724 false,
19725 _ )
19726 then txt;
19727
19728 case ( txt,
19729 _,
19730 a_startValue )
19731 algorithm
19732 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start=\""));
19733 ✗ txt := Tpl.writeStr(txt, a_startValue);
19734 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\",fixed=false)"));
19735 then txt;
19736 end match;
19737 end fun_544;
19738
19739 protected function fun_545
19740 input Tpl.Text in_txt;
19741 input String in_a_variabilityCausality;
19742 input String in_a_startValue;
19743 input Boolean in_a_isFixed;
19744 input Boolean in_a_hasStartValue;
19745
19746 output Tpl.Text out_txt;
19747 algorithm
19748 out_txt :=
19749 match(in_txt, in_a_variabilityCausality, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19750 local
19751 Tpl.Text txt;
19752 String a_startValue;
19753 Boolean a_isFixed;
19754 Boolean a_hasStartValue;
19755 Boolean ret_2;
19756 Boolean ret_1;
19757 Boolean ret_0;
19758
19759 case ( txt,
19760 "parameter",
19761 a_startValue,
19762 a_isFixed,
19763 a_hasStartValue )
19764 algorithm
19765 ✗ ret_0 := boolAnd(a_hasStartValue, a_isFixed);
19766 ✗ txt := fun_543(txt, ret_0, a_startValue, a_isFixed, a_hasStartValue);
19767 then txt;
19768
19769 case ( txt,
19770 "",
19771 a_startValue,
19772 a_isFixed,
19773 a_hasStartValue )
19774 algorithm
19775 ✗ ret_1 := boolNot(a_isFixed);
19776 ✗ ret_2 := boolAnd(a_hasStartValue, ret_1);
19777 ✗ txt := fun_544(txt, ret_2, a_startValue);
19778 then txt;
19779
19780 case ( txt,
19781 _,
19782 _,
19783 _,
19784 _ )
19785 then txt;
19786 end match;
19787 end fun_545;
19788
19789 protected function fun_546
19790 input Tpl.Text in_txt;
19791 input Boolean in_mArg;
19792 input String in_a_startValue;
19793
19794 output Tpl.Text out_txt;
19795 algorithm
19796 out_txt :=
19797 match(in_txt, in_mArg, in_a_startValue)
19798 local
19799 Tpl.Text txt;
19800 String a_startValue;
19801
19802 case ( txt,
19803 false,
19804 _ )
19805 then txt;
19806
19807 case ( txt,
19808 _,
19809 a_startValue )
19810 algorithm
19811 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start=\""));
19812 ✗ txt := Tpl.writeStr(txt, a_startValue);
19813 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\",fixed=false)"));
19814 then txt;
19815 end match;
19816 end fun_546;
19817
19818 protected function fun_547
19819 input Tpl.Text in_txt;
19820 input Boolean in_mArg;
19821 input String in_a_startValue;
19822 input Boolean in_a_isFixed;
19823 input Boolean in_a_hasStartValue;
19824
19825 output Tpl.Text out_txt;
19826 algorithm
19827 out_txt :=
19828 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19829 local
19830 Tpl.Text txt;
19831 String a_startValue;
19832 Boolean a_isFixed;
19833 Boolean a_hasStartValue;
19834 Boolean ret_1;
19835 Boolean ret_0;
19836
19837 case ( txt,
19838 false,
19839 a_startValue,
19840 a_isFixed,
19841 a_hasStartValue )
19842 algorithm
19843 ✗ ret_0 := boolNot(a_isFixed);
19844 ✗ ret_1 := boolAnd(a_hasStartValue, ret_0);
19845 ✗ txt := fun_546(txt, ret_1, a_startValue);
19846 then txt;
19847
19848 case ( txt,
19849 _,
19850 _,
19851 _,
19852 _ )
19853 algorithm
19854 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=false)"));
19855 then txt;
19856 end match;
19857 end fun_547;
19858
19859 protected function fun_548
19860 input Tpl.Text in_txt;
19861 input Boolean in_mArg;
19862 input String in_a_startValue;
19863 input Boolean in_a_isFixed;
19864 input Boolean in_a_hasStartValue;
19865
19866 output Tpl.Text out_txt;
19867 algorithm
19868 out_txt :=
19869 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19870 local
19871 Tpl.Text txt;
19872 String a_startValue;
19873 Boolean a_isFixed;
19874 Boolean a_hasStartValue;
19875 Boolean ret_2;
19876 Boolean ret_1;
19877 Boolean ret_0;
19878
19879 case ( txt,
19880 false,
19881 a_startValue,
19882 a_isFixed,
19883 a_hasStartValue )
19884 algorithm
19885 ret_0 := boolNot(a_hasStartValue);
19886 ret_1 := boolNot(a_isFixed);
19887 ✗ ret_2 := boolAnd(ret_0, ret_1);
19888 ✗ txt := fun_547(txt, ret_2, a_startValue, a_isFixed, a_hasStartValue);
19889 then txt;
19890
19891 case ( txt,
19892 _,
19893 _,
19894 _,
19895 _ )
19896 algorithm
19897 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(fixed=true)"));
19898 then txt;
19899 end match;
19900 end fun_548;
19901
19902 protected function fun_549
19903 input Tpl.Text in_txt;
19904 input Boolean in_mArg;
19905 input String in_a_startValue;
19906 input Boolean in_a_isFixed;
19907 input Boolean in_a_hasStartValue;
19908
19909 output Tpl.Text out_txt;
19910 algorithm
19911 out_txt :=
19912 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19913 local
19914 Tpl.Text txt;
19915 String a_startValue;
19916 Boolean a_isFixed;
19917 Boolean a_hasStartValue;
19918 Boolean ret_1;
19919 Boolean ret_0;
19920
19921 case ( txt,
19922 false,
19923 a_startValue,
19924 a_isFixed,
19925 a_hasStartValue )
19926 algorithm
19927 ✗ ret_0 := boolNot(a_hasStartValue);
19928 ✗ ret_1 := boolAnd(ret_0, a_isFixed);
19929 ✗ txt := fun_548(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
19930 then txt;
19931
19932 case ( txt,
19933 _,
19934 a_startValue,
19935 _,
19936 _ )
19937 algorithm
19938 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("(start=\""));
19939 ✗ txt := Tpl.writeStr(txt, a_startValue);
19940 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\",fixed=false)"));
19941 then txt;
19942 end match;
19943 end fun_549;
19944
19945 protected function fun_550
19946 input Tpl.Text in_txt;
19947 input Boolean in_mArg;
19948 input String in_a_startValue;
19949 input Boolean in_a_isFixed;
19950 input Boolean in_a_hasStartValue;
19951
19952 output Tpl.Text out_txt;
19953 algorithm
19954 out_txt :=
19955 match(in_txt, in_mArg, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19956 local
19957 Tpl.Text txt;
19958 String a_startValue;
19959 Boolean a_isFixed;
19960 Boolean a_hasStartValue;
19961 Boolean ret_1;
19962 Boolean ret_0;
19963
19964 case ( txt,
19965 false,
19966 a_startValue,
19967 a_isFixed,
19968 a_hasStartValue )
19969 algorithm
19970 ✗ ret_0 := boolNot(a_isFixed);
19971 ✗ ret_1 := boolAnd(a_hasStartValue, ret_0);
19972 ✗ txt := fun_549(txt, ret_1, a_startValue, a_isFixed, a_hasStartValue);
19973 then txt;
19974
19975 case ( txt,
19976 _,
19977 a_startValue,
19978 _,
19979 _ )
19980 algorithm
19981 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = \""));
19982 4 txt := Tpl.writeStr(txt, a_startValue);
19983 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
19984 then txt;
19985 end match;
19986 end fun_550;
19987
19988 protected function fun_551
19989 input Tpl.Text in_txt;
19990 input String in_a_variabilityCausality;
19991 input String in_a_startValue;
19992 input Boolean in_a_isFixed;
19993 input Boolean in_a_hasStartValue;
19994
19995 output Tpl.Text out_txt;
19996 algorithm
19997 out_txt :=
19998 match(in_txt, in_a_variabilityCausality, in_a_startValue, in_a_isFixed, in_a_hasStartValue)
19999 local
20000 Tpl.Text txt;
20001 String a_startValue;
20002 Boolean a_isFixed;
20003 Boolean a_hasStartValue;
20004 Boolean ret_0;
20005
20006 case ( txt,
20007 "parameter",
20008 a_startValue,
20009 a_isFixed,
20010 a_hasStartValue )
20011 algorithm
20012 4 ret_0 := boolAnd(a_hasStartValue, a_isFixed);
20013 4 txt := fun_550(txt, ret_0, a_startValue, a_isFixed, a_hasStartValue);
20014 then txt;
20015
20016 case ( txt,
20017 _,
20018 _,
20019 _,
20020 _ )
20021 then txt;
20022 end match;
20023 end fun_551;
20024
20025 public function dumpFMIStringModelVariableStartValue
20026 input Tpl.Text in_txt;
20027 input String in_a_FMUVersion;
20028 input String in_a_variabilityCausality;
20029 input Boolean in_a_hasStartValue;
20030 input String in_a_startValue;
20031 input Boolean in_a_isFixed;
20032
20033 output Tpl.Text out_txt;
20034 algorithm
20035 out_txt :=
20036 match(in_txt, in_a_FMUVersion, in_a_variabilityCausality, in_a_hasStartValue, in_a_startValue, in_a_isFixed)
20037 local
20038 Tpl.Text txt;
20039 String a_variabilityCausality;
20040 Boolean a_hasStartValue;
20041 String a_startValue;
20042 Boolean a_isFixed;
20043
20044 case ( txt,
20045 "1.0",
20046 a_variabilityCausality,
20047 a_hasStartValue,
20048 a_startValue,
20049 a_isFixed )
20050 algorithm
20051 ✗ txt := fun_545(txt, a_variabilityCausality, a_startValue, a_isFixed, a_hasStartValue);
20052 then txt;
20053
20054 case ( txt,
20055 "2.0",
20056 a_variabilityCausality,
20057 a_hasStartValue,
20058 a_startValue,
20059 a_isFixed )
20060 algorithm
20061 5 txt := fun_551(txt, a_variabilityCausality, a_startValue, a_isFixed, a_hasStartValue);
20062 then txt;
20063
20064 case ( txt,
20065 _,
20066 _,
20067 _,
20068 _,
20069 _ )
20070 then txt;
20071 end match;
20072 end dumpFMIStringModelVariableStartValue;
20073
20074 protected function fun_553
20075 input Tpl.Text in_txt;
20076 input Boolean in_a_hasStartValue;
20077 input list<FMI.TypeDefinitions> in_a_fmiTypeDefinitionsList;
20078 input String in_a_baseType;
20079 input Integer in_a_startValue;
20080
20081 output Tpl.Text out_txt;
20082 algorithm
20083 out_txt :=
20084 match(in_txt, in_a_hasStartValue, in_a_fmiTypeDefinitionsList, in_a_baseType, in_a_startValue)
20085 local
20086 Tpl.Text txt;
20087 list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
20088 String a_baseType;
20089 Integer a_startValue;
20090 String ret_0;
20091
20092 case ( txt,
20093 false,
20094 _,
20095 _,
20096 _ )
20097 then txt;
20098
20099 case ( txt,
20100 _,
20101 a_fmiTypeDefinitionsList,
20102 a_baseType,
20103 a_startValue )
20104 algorithm
20105 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = map_"));
20106 2 ret_0 := FMI.getEnumerationTypeFromTypes(a_fmiTypeDefinitionsList, a_baseType);
20107 2 txt := Tpl.writeStr(txt, ret_0);
20108 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_from_integer("));
20109 2 txt := Tpl.writeStr(txt, intString(a_startValue));
20110 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
20111 then txt;
20112 end match;
20113 end fun_553;
20114
20115 public function dumpFMIEnumerationModelVariableStartValue
20116 input Tpl.Text txt;
20117 input list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
20118 input String a_baseType;
20119 input Boolean a_hasStartValue;
20120 input Integer a_startValue;
20121 input Boolean a_isFixed;
20122
20123 output Tpl.Text out_txt;
20124 algorithm
20125 12 out_txt := fun_553(txt, a_hasStartValue, a_fmiTypeDefinitionsList, a_baseType, a_startValue);
20126 end dumpFMIEnumerationModelVariableStartValue;
20127
20128 protected function fun_555
20129 input Tpl.Text in_txt;
20130 input Boolean in_mArg;
20131 input String in_a_description;
20132
20133 output Tpl.Text out_txt;
20134 algorithm
20135 out_txt :=
20136 match(in_txt, in_mArg, in_a_description)
20137 local
20138 Tpl.Text txt;
20139 String a_description;
20140
20141 case ( txt,
20142 false,
20143 a_description )
20144 algorithm
20145 534 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" \""));
20146 534 txt := Tpl.writeStr(txt, a_description);
20147 534 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
20148 then txt;
20149
20150 case ( txt,
20151 _,
20152 _ )
20153 then txt;
20154 end match;
20155 end fun_555;
20156
20157 public function dumpFMIModelVariableDescription
20158 input Tpl.Text txt;
20159 input String a_description;
20160
20161 output Tpl.Text out_txt;
20162 protected
20163 Boolean ret_0;
20164 algorithm
20165
3/4
✓ Branch 0 taken 106 times.
✓ Branch 1 taken 534 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 106 times.
640 ret_0 := stringEq(a_description, "");
20166 640 out_txt := fun_555(txt, ret_0, a_description);
20167 end dumpFMIModelVariableDescription;
20168
20169 protected function fun_557
20170 input Tpl.Text in_txt;
20171 input Boolean in_mArg;
20172 input Integer in_a_y2Placement;
20173 input Integer in_a_x2Placement;
20174 input Integer in_a_y1Placement;
20175 input Integer in_a_x1Placement;
20176
20177 output Tpl.Text out_txt;
20178 algorithm
20179 out_txt :=
20180 match(in_txt, in_mArg, in_a_y2Placement, in_a_x2Placement, in_a_y1Placement, in_a_x1Placement)
20181 local
20182 Tpl.Text txt;
20183 Integer a_y2Placement;
20184 Integer a_x2Placement;
20185 Integer a_y1Placement;
20186 Integer a_x1Placement;
20187
20188 case ( txt,
20189 false,
20190 _,
20191 _,
20192 _,
20193 _ )
20194 then txt;
20195
20196 case ( txt,
20197 _,
20198 a_y2Placement,
20199 a_x2Placement,
20200 a_y1Placement,
20201 a_x1Placement )
20202 algorithm
20203 19 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" annotation(Placement(transformation(extent={{"));
20204 19 txt := Tpl.writeStr(txt, intString(a_x1Placement));
20205 19 txt := Tpl.writeTok(txt, Tpl.ST_STRING(","));
20206 19 txt := Tpl.writeStr(txt, intString(a_y1Placement));
20207 19 txt := Tpl.writeTok(txt, Tpl.ST_STRING("},{"));
20208 19 txt := Tpl.writeStr(txt, intString(a_x2Placement));
20209 19 txt := Tpl.writeTok(txt, Tpl.ST_STRING(","));
20210 19 txt := Tpl.writeStr(txt, intString(a_y2Placement));
20211 19 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}})))"));
20212 then txt;
20213 end match;
20214 end fun_557;
20215
20216 protected function fun_558
20217 input Tpl.Text in_txt;
20218 input Boolean in_mArg;
20219 input Integer in_a_x1Placement;
20220 input Integer in_a_x2Placement;
20221 input Integer in_a_y1Placement;
20222 input Integer in_a_y2Placement;
20223 input Boolean in_a_generateOutputConnectors;
20224 input String in_a_causality;
20225
20226 output Tpl.Text out_txt;
20227 algorithm
20228 out_txt :=
20229 match(in_txt, in_mArg, in_a_x1Placement, in_a_x2Placement, in_a_y1Placement, in_a_y2Placement, in_a_generateOutputConnectors, in_a_causality)
20230 local
20231 Tpl.Text txt;
20232 Integer a_x1Placement;
20233 Integer a_x2Placement;
20234 Integer a_y1Placement;
20235 Integer a_y2Placement;
20236 Boolean a_generateOutputConnectors;
20237 String a_causality;
20238 Boolean ret_1;
20239 Boolean ret_0;
20240
20241 case ( txt,
20242 false,
20243 a_x1Placement,
20244 a_x2Placement,
20245 a_y1Placement,
20246 a_y2Placement,
20247 a_generateOutputConnectors,
20248 a_causality )
20249 algorithm
20250
3/4
✓ Branch 0 taken 19 times.
✓ Branch 1 taken 613 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 19 times.
632 ret_0 := stringEq(a_causality, "output");
20251 632 ret_1 := boolAnd(a_generateOutputConnectors, ret_0);
20252 632 txt := fun_557(txt, ret_1, a_y2Placement, a_x2Placement, a_y1Placement, a_x1Placement);
20253 then txt;
20254
20255 case ( txt,
20256 _,
20257 a_x1Placement,
20258 a_x2Placement,
20259 a_y1Placement,
20260 a_y2Placement,
20261 _,
20262 _ )
20263 algorithm
20264 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" annotation(Placement(transformation(extent={{"));
20265 8 txt := Tpl.writeStr(txt, intString(a_x1Placement));
20266 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING(","));
20267 8 txt := Tpl.writeStr(txt, intString(a_y1Placement));
20268 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("},{"));
20269 8 txt := Tpl.writeStr(txt, intString(a_x2Placement));
20270 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING(","));
20271 8 txt := Tpl.writeStr(txt, intString(a_y2Placement));
20272 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}})))"));
20273 then txt;
20274 end match;
20275 end fun_558;
20276
20277 public function dumpFMIModelVariablePlacementAnnotation
20278 input Tpl.Text txt;
20279 input Integer a_x1Placement;
20280 input Integer a_x2Placement;
20281 input Integer a_y1Placement;
20282 input Integer a_y2Placement;
20283 input Boolean a_generateInputConnectors;
20284 input Boolean a_generateOutputConnectors;
20285 input String a_causality;
20286
20287 output Tpl.Text out_txt;
20288 protected
20289 Boolean ret_1;
20290 Boolean ret_0;
20291 algorithm
20292
3/4
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 632 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
640 ret_0 := stringEq(a_causality, "input");
20293 640 ret_1 := boolAnd(a_generateInputConnectors, ret_0);
20294 640 out_txt := fun_558(txt, ret_1, a_x1Placement, a_x2Placement, a_y1Placement, a_y2Placement, a_generateOutputConnectors, a_causality);
20295 end dumpFMIModelVariablePlacementAnnotation;
20296
20297 protected function lm_560
20298 input output Tpl.Text txt;
20299 input list<FMI.ModelVariables> items;
20300 input String a_fmiVersion;
20301 input Integer a_what;
20302 input Boolean a_dependent;
20303 input String a_variabilityCausality;
20304 input String a_type;
20305 algorithm
20306
2/2
✓ Branch 0 taken 30540 times.
✓ Branch 1 taken 828 times.
31368 for lstElt_560 in items loop
20307 txt := match lstElt_560
20308 local
20309 FMI.ModelVariables i_fmiModelVariable;
20310
20311 case i_fmiModelVariable
20312 algorithm
20313 30540 txt := dumpVariable(txt, i_fmiModelVariable, a_type, a_variabilityCausality, a_dependent, a_what, a_fmiVersion);
20314 30540 txt := Tpl.nextIter(txt);
20315 then txt;
20316 end match;
20317 end for;
20318 end lm_560;
20319
20320 public function dumpVariables
20321 input Tpl.Text txt;
20322 input list<FMI.ModelVariables> a_fmiModelVariablesList;
20323 input String a_type;
20324 input String a_variabilityCausality;
20325 input Boolean a_dependent;
20326 input Integer a_what;
20327 input String a_fmiVersion;
20328
20329 output Tpl.Text out_txt;
20330 algorithm
20331 828 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
20332 828 out_txt := lm_560(out_txt, a_fmiModelVariablesList, a_fmiVersion, a_what, a_dependent, a_variabilityCausality, a_type);
20333 828 out_txt := Tpl.popIter(out_txt);
20334 end dumpVariables;
20335
20336 protected function fun_562
20337 input Tpl.Text in_txt;
20338 input Boolean in_mArg;
20339 input String in_a_name;
20340
20341 output Tpl.Text out_txt;
20342 algorithm
20343 out_txt :=
20344 match(in_txt, in_mArg, in_a_name)
20345 local
20346 Tpl.Text txt;
20347 String a_name;
20348
20349 case ( txt,
20350 false,
20351 _ )
20352 then txt;
20353
20354 case ( txt,
20355 _,
20356 a_name )
20357 algorithm
20358 1 txt := Tpl.writeStr(txt, a_name);
20359 then txt;
20360 end match;
20361 end fun_562;
20362
20363 protected function fun_563
20364 input Tpl.Text in_txt;
20365 input Boolean in_mArg;
20366 input Real in_a_valueReference;
20367 input String in_a_name;
20368 input Integer in_a_what;
20369
20370 output Tpl.Text out_txt;
20371 algorithm
20372 out_txt :=
20373 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
20374 local
20375 Tpl.Text txt;
20376 Real a_valueReference;
20377 String a_name;
20378 Integer a_what;
20379 Boolean ret_0;
20380
20381 case ( txt,
20382 false,
20383 _,
20384 a_name,
20385 a_what )
20386 algorithm
20387 1 ret_0 := intEq(a_what, 2);
20388 1 txt := fun_562(txt, ret_0, a_name);
20389 then txt;
20390
20391 case ( txt,
20392 _,
20393 a_valueReference,
20394 _,
20395 _ )
20396 algorithm
20397 1 txt := Tpl.writeStr(txt, realString(a_valueReference));
20398 then txt;
20399 end match;
20400 end fun_563;
20401
20402 protected function fun_564
20403 input Tpl.Text in_txt;
20404 input Boolean in_mArg;
20405 input String in_a_name;
20406
20407 output Tpl.Text out_txt;
20408 algorithm
20409 out_txt :=
20410 match(in_txt, in_mArg, in_a_name)
20411 local
20412 Tpl.Text txt;
20413 String a_name;
20414
20415 case ( txt,
20416 false,
20417 _ )
20418 then txt;
20419
20420 case ( txt,
20421 _,
20422 a_name )
20423 algorithm
20424 ✗ txt := Tpl.writeStr(txt, a_name);
20425 then txt;
20426 end match;
20427 end fun_564;
20428
20429 protected function fun_565
20430 input Tpl.Text in_txt;
20431 input Boolean in_mArg;
20432 input Integer in_a_valueReference;
20433 input String in_a_name;
20434 input Integer in_a_what;
20435
20436 output Tpl.Text out_txt;
20437 algorithm
20438 out_txt :=
20439 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
20440 local
20441 Tpl.Text txt;
20442 Integer a_valueReference;
20443 String a_name;
20444 Integer a_what;
20445 Boolean ret_0;
20446
20447 case ( txt,
20448 false,
20449 _,
20450 a_name,
20451 a_what )
20452 algorithm
20453 ✗ ret_0 := intEq(a_what, 2);
20454 ✗ txt := fun_564(txt, ret_0, a_name);
20455 then txt;
20456
20457 case ( txt,
20458 _,
20459 a_valueReference,
20460 _,
20461 _ )
20462 algorithm
20463 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
20464 then txt;
20465 end match;
20466 end fun_565;
20467
20468 protected function fun_566
20469 input Tpl.Text in_txt;
20470 input Boolean in_mArg;
20471 input String in_a_name;
20472
20473 output Tpl.Text out_txt;
20474 algorithm
20475 out_txt :=
20476 match(in_txt, in_mArg, in_a_name)
20477 local
20478 Tpl.Text txt;
20479 String a_name;
20480
20481 case ( txt,
20482 false,
20483 _ )
20484 then txt;
20485
20486 case ( txt,
20487 _,
20488 a_name )
20489 algorithm
20490 ✗ txt := Tpl.writeStr(txt, a_name);
20491 then txt;
20492 end match;
20493 end fun_566;
20494
20495 protected function fun_567
20496 input Tpl.Text in_txt;
20497 input Boolean in_mArg;
20498 input Real in_a_valueReference;
20499 input String in_a_name;
20500 input Integer in_a_what;
20501
20502 output Tpl.Text out_txt;
20503 algorithm
20504 out_txt :=
20505 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
20506 local
20507 Tpl.Text txt;
20508 Real a_valueReference;
20509 String a_name;
20510 Integer a_what;
20511 Boolean ret_0;
20512
20513 case ( txt,
20514 false,
20515 _,
20516 a_name,
20517 a_what )
20518 algorithm
20519 ✗ ret_0 := intEq(a_what, 2);
20520 ✗ txt := fun_566(txt, ret_0, a_name);
20521 then txt;
20522
20523 case ( txt,
20524 _,
20525 a_valueReference,
20526 _,
20527 _ )
20528 algorithm
20529 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
20530 then txt;
20531 end match;
20532 end fun_567;
20533
20534 protected function fun_568
20535 input Tpl.Text in_txt;
20536 input Boolean in_mArg;
20537 input String in_a_name;
20538
20539 output Tpl.Text out_txt;
20540 algorithm
20541 out_txt :=
20542 match(in_txt, in_mArg, in_a_name)
20543 local
20544 Tpl.Text txt;
20545 String a_name;
20546
20547 case ( txt,
20548 false,
20549 _ )
20550 then txt;
20551
20552 case ( txt,
20553 _,
20554 a_name )
20555 algorithm
20556 ✗ txt := Tpl.writeStr(txt, a_name);
20557 then txt;
20558 end match;
20559 end fun_568;
20560
20561 protected function fun_569
20562 input Tpl.Text in_txt;
20563 input Boolean in_mArg;
20564 input Integer in_a_valueReference;
20565 input String in_a_name;
20566 input Integer in_a_what;
20567
20568 output Tpl.Text out_txt;
20569 algorithm
20570 out_txt :=
20571 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
20572 local
20573 Tpl.Text txt;
20574 Integer a_valueReference;
20575 String a_name;
20576 Integer a_what;
20577 Boolean ret_0;
20578
20579 case ( txt,
20580 false,
20581 _,
20582 a_name,
20583 a_what )
20584 algorithm
20585 ✗ ret_0 := intEq(a_what, 2);
20586 ✗ txt := fun_568(txt, ret_0, a_name);
20587 then txt;
20588
20589 case ( txt,
20590 _,
20591 a_valueReference,
20592 _,
20593 _ )
20594 algorithm
20595 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
20596 then txt;
20597 end match;
20598 end fun_569;
20599
20600 protected function fun_570
20601 input Tpl.Text in_txt;
20602 input FMI.ModelVariables in_a_fmiModelVariable;
20603 input Integer in_a_what;
20604
20605 output Tpl.Text out_txt;
20606 algorithm
20607 out_txt :=
20608 match(in_txt, in_a_fmiModelVariable, in_a_what)
20609 local
20610 Tpl.Text txt;
20611 Integer a_what;
20612 Integer i_valueReference_1;
20613 Real i_valueReference;
20614 String i_name;
20615 Boolean ret_3;
20616 Boolean ret_2;
20617 Boolean ret_1;
20618 Boolean ret_0;
20619
20620 case ( txt,
20621 FMI.STRINGVARIABLE(variability = "", causality = "", name = i_name, valueReference = i_valueReference),
20622 a_what )
20623 algorithm
20624 2 ret_0 := intEq(a_what, 1);
20625 2 txt := fun_563(txt, ret_0, i_valueReference, i_name, a_what);
20626 then txt;
20627
20628 case ( txt,
20629 FMI.FMI3STRINGVARIABLE(variability = "", causality = "", name = i_name, valueReference = i_valueReference_1),
20630 a_what )
20631 algorithm
20632 ✗ ret_1 := intEq(a_what, 1);
20633 ✗ txt := fun_565(txt, ret_1, i_valueReference_1, i_name, a_what);
20634 then txt;
20635
20636 case ( txt,
20637 FMI.STRINGVARIABLE(variability = "", causality = "output", name = i_name, valueReference = i_valueReference),
20638 a_what )
20639 algorithm
20640 ✗ ret_2 := intEq(a_what, 1);
20641 ✗ txt := fun_567(txt, ret_2, i_valueReference, i_name, a_what);
20642 then txt;
20643
20644 case ( txt,
20645 FMI.FMI3STRINGVARIABLE(variability = "", causality = "output", name = i_name, valueReference = i_valueReference_1),
20646 a_what )
20647 algorithm
20648 ✗ ret_3 := intEq(a_what, 1);
20649 ✗ txt := fun_569(txt, ret_3, i_valueReference_1, i_name, a_what);
20650 then txt;
20651
20652 case ( txt,
20653 _,
20654 _ )
20655 then txt;
20656 end match;
20657 end fun_570;
20658
20659 protected function fun_571
20660 input Tpl.Text in_txt;
20661 input Boolean in_mArg;
20662 input Integer in_a_what;
20663 input FMI.ModelVariables in_a_fmiModelVariable;
20664
20665 output Tpl.Text out_txt;
20666 algorithm
20667 out_txt :=
20668 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable)
20669 local
20670 Tpl.Text txt;
20671 Integer a_what;
20672 FMI.ModelVariables a_fmiModelVariable;
20673
20674 case ( txt,
20675 false,
20676 _,
20677 _ )
20678 then txt;
20679
20680 case ( txt,
20681 _,
20682 a_what,
20683 a_fmiModelVariable )
20684 algorithm
20685 1282 txt := fun_570(txt, a_fmiModelVariable, a_what);
20686 then txt;
20687 end match;
20688 end fun_571;
20689
20690 protected function fun_572
20691 input Tpl.Text in_txt;
20692 input Boolean in_mArg;
20693 input String in_a_name;
20694
20695 output Tpl.Text out_txt;
20696 algorithm
20697 out_txt :=
20698 match(in_txt, in_mArg, in_a_name)
20699 local
20700 Tpl.Text txt;
20701 String a_name;
20702
20703 case ( txt,
20704 false,
20705 _ )
20706 then txt;
20707
20708 case ( txt,
20709 _,
20710 a_name )
20711 algorithm
20712 31 txt := Tpl.writeStr(txt, a_name);
20713 then txt;
20714 end match;
20715 end fun_572;
20716
20717 protected function fun_573
20718 input Tpl.Text in_txt;
20719 input Boolean in_mArg;
20720 input Real in_a_valueReference;
20721 input String in_a_name;
20722 input Integer in_a_what;
20723
20724 output Tpl.Text out_txt;
20725 algorithm
20726 out_txt :=
20727 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
20728 local
20729 Tpl.Text txt;
20730 Real a_valueReference;
20731 String a_name;
20732 Integer a_what;
20733 Boolean ret_0;
20734
20735 case ( txt,
20736 false,
20737 _,
20738 a_name,
20739 a_what )
20740 algorithm
20741 31 ret_0 := intEq(a_what, 2);
20742 31 txt := fun_572(txt, ret_0, a_name);
20743 then txt;
20744
20745 case ( txt,
20746 _,
20747 a_valueReference,
20748 _,
20749 _ )
20750 algorithm
20751 31 txt := Tpl.writeStr(txt, realString(a_valueReference));
20752 then txt;
20753 end match;
20754 end fun_573;
20755
20756 protected function fun_574
20757 input Tpl.Text in_txt;
20758 input Boolean in_mArg;
20759 input String in_a_name;
20760
20761 output Tpl.Text out_txt;
20762 algorithm
20763 out_txt :=
20764 match(in_txt, in_mArg, in_a_name)
20765 local
20766 Tpl.Text txt;
20767 String a_name;
20768
20769 case ( txt,
20770 false,
20771 _ )
20772 then txt;
20773
20774 case ( txt,
20775 _,
20776 a_name )
20777 algorithm
20778 ✗ txt := Tpl.writeStr(txt, a_name);
20779 then txt;
20780 end match;
20781 end fun_574;
20782
20783 protected function fun_575
20784 input Tpl.Text in_txt;
20785 input Boolean in_mArg;
20786 input Integer in_a_valueReference;
20787 input String in_a_name;
20788 input Integer in_a_what;
20789
20790 output Tpl.Text out_txt;
20791 algorithm
20792 out_txt :=
20793 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
20794 local
20795 Tpl.Text txt;
20796 Integer a_valueReference;
20797 String a_name;
20798 Integer a_what;
20799 Boolean ret_0;
20800
20801 case ( txt,
20802 false,
20803 _,
20804 a_name,
20805 a_what )
20806 algorithm
20807 ✗ ret_0 := intEq(a_what, 2);
20808 ✗ txt := fun_574(txt, ret_0, a_name);
20809 then txt;
20810
20811 case ( txt,
20812 _,
20813 a_valueReference,
20814 _,
20815 _ )
20816 algorithm
20817 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
20818 then txt;
20819 end match;
20820 end fun_575;
20821
20822 protected function fun_576
20823 input Tpl.Text in_txt;
20824 input Boolean in_mArg;
20825 input String in_a_name;
20826
20827 output Tpl.Text out_txt;
20828 algorithm
20829 out_txt :=
20830 match(in_txt, in_mArg, in_a_name)
20831 local
20832 Tpl.Text txt;
20833 String a_name;
20834
20835 case ( txt,
20836 false,
20837 _ )
20838 then txt;
20839
20840 case ( txt,
20841 _,
20842 a_name )
20843 algorithm
20844 ✗ txt := Tpl.writeStr(txt, a_name);
20845 then txt;
20846 end match;
20847 end fun_576;
20848
20849 protected function fun_577
20850 input Tpl.Text in_txt;
20851 input Boolean in_mArg;
20852 input Real in_a_valueReference;
20853 input String in_a_name;
20854 input Integer in_a_what;
20855
20856 output Tpl.Text out_txt;
20857 algorithm
20858 out_txt :=
20859 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
20860 local
20861 Tpl.Text txt;
20862 Real a_valueReference;
20863 String a_name;
20864 Integer a_what;
20865 Boolean ret_0;
20866
20867 case ( txt,
20868 false,
20869 _,
20870 a_name,
20871 a_what )
20872 algorithm
20873 ✗ ret_0 := intEq(a_what, 2);
20874 ✗ txt := fun_576(txt, ret_0, a_name);
20875 then txt;
20876
20877 case ( txt,
20878 _,
20879 a_valueReference,
20880 _,
20881 _ )
20882 algorithm
20883 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
20884 then txt;
20885 end match;
20886 end fun_577;
20887
20888 protected function fun_578
20889 input Tpl.Text in_txt;
20890 input Boolean in_mArg;
20891 input String in_a_name;
20892
20893 output Tpl.Text out_txt;
20894 algorithm
20895 out_txt :=
20896 match(in_txt, in_mArg, in_a_name)
20897 local
20898 Tpl.Text txt;
20899 String a_name;
20900
20901 case ( txt,
20902 false,
20903 _ )
20904 then txt;
20905
20906 case ( txt,
20907 _,
20908 a_name )
20909 algorithm
20910 ✗ txt := Tpl.writeStr(txt, a_name);
20911 then txt;
20912 end match;
20913 end fun_578;
20914
20915 protected function fun_579
20916 input Tpl.Text in_txt;
20917 input Boolean in_mArg;
20918 input Integer in_a_valueReference;
20919 input String in_a_name;
20920 input Integer in_a_what;
20921
20922 output Tpl.Text out_txt;
20923 algorithm
20924 out_txt :=
20925 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
20926 local
20927 Tpl.Text txt;
20928 Integer a_valueReference;
20929 String a_name;
20930 Integer a_what;
20931 Boolean ret_0;
20932
20933 case ( txt,
20934 false,
20935 _,
20936 a_name,
20937 a_what )
20938 algorithm
20939 ✗ ret_0 := intEq(a_what, 2);
20940 ✗ txt := fun_578(txt, ret_0, a_name);
20941 then txt;
20942
20943 case ( txt,
20944 _,
20945 a_valueReference,
20946 _,
20947 _ )
20948 algorithm
20949 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
20950 then txt;
20951 end match;
20952 end fun_579;
20953
20954 protected function fun_580
20955 input Tpl.Text in_txt;
20956 input FMI.ModelVariables in_a_fmiModelVariable;
20957 input Integer in_a_what;
20958
20959 output Tpl.Text out_txt;
20960 algorithm
20961 out_txt :=
20962 match(in_txt, in_a_fmiModelVariable, in_a_what)
20963 local
20964 Tpl.Text txt;
20965 Integer a_what;
20966 Integer i_valueReference_1;
20967 Real i_valueReference;
20968 String i_name;
20969 Boolean ret_3;
20970 Boolean ret_2;
20971 Boolean ret_1;
20972 Boolean ret_0;
20973
20974 case ( txt,
20975 FMI.BOOLEANVARIABLE(variability = "", causality = "", name = i_name, valueReference = i_valueReference),
20976 a_what )
20977 algorithm
20978 62 ret_0 := intEq(a_what, 1);
20979 62 txt := fun_573(txt, ret_0, i_valueReference, i_name, a_what);
20980 then txt;
20981
20982 case ( txt,
20983 FMI.FMI3BOOLEANVARIABLE(variability = "", causality = "", name = i_name, valueReference = i_valueReference_1),
20984 a_what )
20985 algorithm
20986 ✗ ret_1 := intEq(a_what, 1);
20987 ✗ txt := fun_575(txt, ret_1, i_valueReference_1, i_name, a_what);
20988 then txt;
20989
20990 case ( txt,
20991 FMI.BOOLEANVARIABLE(variability = "", causality = "output", name = i_name, valueReference = i_valueReference),
20992 a_what )
20993 algorithm
20994 ✗ ret_2 := intEq(a_what, 1);
20995 ✗ txt := fun_577(txt, ret_2, i_valueReference, i_name, a_what);
20996 then txt;
20997
20998 case ( txt,
20999 FMI.FMI3BOOLEANVARIABLE(variability = "", causality = "output", name = i_name, valueReference = i_valueReference_1),
21000 a_what )
21001 algorithm
21002 ✗ ret_3 := intEq(a_what, 1);
21003 ✗ txt := fun_579(txt, ret_3, i_valueReference_1, i_name, a_what);
21004 then txt;
21005
21006 case ( txt,
21007 _,
21008 _ )
21009 then txt;
21010 end match;
21011 end fun_580;
21012
21013 protected function fun_581
21014 input Tpl.Text in_txt;
21015 input Boolean in_mArg;
21016 input Integer in_a_what;
21017 input FMI.ModelVariables in_a_fmiModelVariable;
21018 input String in_a_variabilityCausality;
21019 input String in_a_type;
21020
21021 output Tpl.Text out_txt;
21022 algorithm
21023 out_txt :=
21024 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_variabilityCausality, in_a_type)
21025 local
21026 Tpl.Text txt;
21027 Integer a_what;
21028 FMI.ModelVariables a_fmiModelVariable;
21029 String a_variabilityCausality;
21030 String a_type;
21031 Boolean ret_2;
21032 Boolean ret_1;
21033 Boolean ret_0;
21034
21035 case ( txt,
21036 false,
21037 a_what,
21038 a_fmiModelVariable,
21039 a_variabilityCausality,
21040 a_type )
21041 algorithm
21042
2/4
✓ Branch 0 taken 1282 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1282 times.
1282 ret_0 := stringEq(a_type, "string");
21043
2/4
✓ Branch 0 taken 1282 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1282 times.
1282 ret_1 := stringEq(a_variabilityCausality, "output");
21044 1282 ret_2 := boolAnd(ret_0, ret_1);
21045 1282 txt := fun_571(txt, ret_2, a_what, a_fmiModelVariable);
21046 then txt;
21047
21048 case ( txt,
21049 _,
21050 a_what,
21051 a_fmiModelVariable,
21052 _,
21053 _ )
21054 algorithm
21055 1282 txt := fun_580(txt, a_fmiModelVariable, a_what);
21056 then txt;
21057 end match;
21058 end fun_581;
21059
21060 protected function fun_582
21061 input Tpl.Text in_txt;
21062 input Boolean in_mArg;
21063 input String in_a_name;
21064
21065 output Tpl.Text out_txt;
21066 algorithm
21067 out_txt :=
21068 match(in_txt, in_mArg, in_a_name)
21069 local
21070 Tpl.Text txt;
21071 String a_name;
21072
21073 case ( txt,
21074 false,
21075 _ )
21076 then txt;
21077
21078 case ( txt,
21079 _,
21080 a_name )
21081 algorithm
21082 43 txt := Tpl.writeStr(txt, a_name);
21083 then txt;
21084 end match;
21085 end fun_582;
21086
21087 protected function fun_583
21088 input Tpl.Text in_txt;
21089 input Boolean in_mArg;
21090 input Real in_a_valueReference;
21091 input String in_a_name;
21092 input Integer in_a_what;
21093
21094 output Tpl.Text out_txt;
21095 algorithm
21096 out_txt :=
21097 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
21098 local
21099 Tpl.Text txt;
21100 Real a_valueReference;
21101 String a_name;
21102 Integer a_what;
21103 Boolean ret_0;
21104
21105 case ( txt,
21106 false,
21107 _,
21108 a_name,
21109 a_what )
21110 algorithm
21111 43 ret_0 := intEq(a_what, 2);
21112 43 txt := fun_582(txt, ret_0, a_name);
21113 then txt;
21114
21115 case ( txt,
21116 _,
21117 a_valueReference,
21118 _,
21119 _ )
21120 algorithm
21121 43 txt := Tpl.writeStr(txt, realString(a_valueReference));
21122 then txt;
21123 end match;
21124 end fun_583;
21125
21126 protected function fun_584
21127 input Tpl.Text in_txt;
21128 input Boolean in_mArg;
21129 input String in_a_name;
21130
21131 output Tpl.Text out_txt;
21132 algorithm
21133 out_txt :=
21134 match(in_txt, in_mArg, in_a_name)
21135 local
21136 Tpl.Text txt;
21137 String a_name;
21138
21139 case ( txt,
21140 false,
21141 _ )
21142 then txt;
21143
21144 case ( txt,
21145 _,
21146 a_name )
21147 algorithm
21148 ✗ txt := Tpl.writeStr(txt, a_name);
21149 then txt;
21150 end match;
21151 end fun_584;
21152
21153 protected function fun_585
21154 input Tpl.Text in_txt;
21155 input Boolean in_mArg;
21156 input Integer in_a_valueReference;
21157 input String in_a_name;
21158 input Integer in_a_what;
21159
21160 output Tpl.Text out_txt;
21161 algorithm
21162 out_txt :=
21163 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
21164 local
21165 Tpl.Text txt;
21166 Integer a_valueReference;
21167 String a_name;
21168 Integer a_what;
21169 Boolean ret_0;
21170
21171 case ( txt,
21172 false,
21173 _,
21174 a_name,
21175 a_what )
21176 algorithm
21177 ✗ ret_0 := intEq(a_what, 2);
21178 ✗ txt := fun_584(txt, ret_0, a_name);
21179 then txt;
21180
21181 case ( txt,
21182 _,
21183 a_valueReference,
21184 _,
21185 _ )
21186 algorithm
21187 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
21188 then txt;
21189 end match;
21190 end fun_585;
21191
21192 protected function fun_586
21193 input Tpl.Text in_txt;
21194 input Boolean in_mArg;
21195 input String in_a_name;
21196
21197 output Tpl.Text out_txt;
21198 algorithm
21199 out_txt :=
21200 match(in_txt, in_mArg, in_a_name)
21201 local
21202 Tpl.Text txt;
21203 String a_name;
21204
21205 case ( txt,
21206 false,
21207 _ )
21208 then txt;
21209
21210 case ( txt,
21211 _,
21212 a_name )
21213 algorithm
21214 ✗ txt := Tpl.writeStr(txt, a_name);
21215 then txt;
21216 end match;
21217 end fun_586;
21218
21219 protected function fun_587
21220 input Tpl.Text in_txt;
21221 input Boolean in_mArg;
21222 input Real in_a_valueReference;
21223 input String in_a_name;
21224 input Integer in_a_what;
21225
21226 output Tpl.Text out_txt;
21227 algorithm
21228 out_txt :=
21229 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
21230 local
21231 Tpl.Text txt;
21232 Real a_valueReference;
21233 String a_name;
21234 Integer a_what;
21235 Boolean ret_0;
21236
21237 case ( txt,
21238 false,
21239 _,
21240 a_name,
21241 a_what )
21242 algorithm
21243 ✗ ret_0 := intEq(a_what, 2);
21244 ✗ txt := fun_586(txt, ret_0, a_name);
21245 then txt;
21246
21247 case ( txt,
21248 _,
21249 a_valueReference,
21250 _,
21251 _ )
21252 algorithm
21253 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
21254 then txt;
21255 end match;
21256 end fun_587;
21257
21258 protected function fun_588
21259 input Tpl.Text in_txt;
21260 input Boolean in_mArg;
21261 input String in_a_name;
21262
21263 output Tpl.Text out_txt;
21264 algorithm
21265 out_txt :=
21266 match(in_txt, in_mArg, in_a_name)
21267 local
21268 Tpl.Text txt;
21269 String a_name;
21270
21271 case ( txt,
21272 false,
21273 _ )
21274 then txt;
21275
21276 case ( txt,
21277 _,
21278 a_name )
21279 algorithm
21280 ✗ txt := Tpl.writeStr(txt, a_name);
21281 then txt;
21282 end match;
21283 end fun_588;
21284
21285 protected function fun_589
21286 input Tpl.Text in_txt;
21287 input Boolean in_mArg;
21288 input Integer in_a_valueReference;
21289 input String in_a_name;
21290 input Integer in_a_what;
21291
21292 output Tpl.Text out_txt;
21293 algorithm
21294 out_txt :=
21295 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
21296 local
21297 Tpl.Text txt;
21298 Integer a_valueReference;
21299 String a_name;
21300 Integer a_what;
21301 Boolean ret_0;
21302
21303 case ( txt,
21304 false,
21305 _,
21306 a_name,
21307 a_what )
21308 algorithm
21309 ✗ ret_0 := intEq(a_what, 2);
21310 ✗ txt := fun_588(txt, ret_0, a_name);
21311 then txt;
21312
21313 case ( txt,
21314 _,
21315 a_valueReference,
21316 _,
21317 _ )
21318 algorithm
21319 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
21320 then txt;
21321 end match;
21322 end fun_589;
21323
21324 protected function fun_590
21325 input Tpl.Text in_txt;
21326 input FMI.ModelVariables in_a_fmiModelVariable;
21327 input Integer in_a_what;
21328
21329 output Tpl.Text out_txt;
21330 algorithm
21331 out_txt :=
21332 match(in_txt, in_a_fmiModelVariable, in_a_what)
21333 local
21334 Tpl.Text txt;
21335 Integer a_what;
21336 Integer i_valueReference_1;
21337 Real i_valueReference;
21338 String i_name;
21339 Boolean ret_3;
21340 Boolean ret_2;
21341 Boolean ret_1;
21342 Boolean ret_0;
21343
21344 case ( txt,
21345 FMI.INTEGERVARIABLE(variability = "", causality = "", name = i_name, valueReference = i_valueReference),
21346 a_what )
21347 algorithm
21348 86 ret_0 := intEq(a_what, 1);
21349 86 txt := fun_583(txt, ret_0, i_valueReference, i_name, a_what);
21350 then txt;
21351
21352 case ( txt,
21353 FMI.FMI3INTEGERVARIABLE(variability = "", causality = "", name = i_name, valueReference = i_valueReference_1),
21354 a_what )
21355 algorithm
21356 ✗ ret_1 := intEq(a_what, 1);
21357 ✗ txt := fun_585(txt, ret_1, i_valueReference_1, i_name, a_what);
21358 then txt;
21359
21360 case ( txt,
21361 FMI.INTEGERVARIABLE(variability = "", causality = "output", name = i_name, valueReference = i_valueReference),
21362 a_what )
21363 algorithm
21364 ✗ ret_2 := intEq(a_what, 1);
21365 ✗ txt := fun_587(txt, ret_2, i_valueReference, i_name, a_what);
21366 then txt;
21367
21368 case ( txt,
21369 FMI.FMI3INTEGERVARIABLE(variability = "", causality = "output", name = i_name, valueReference = i_valueReference_1),
21370 a_what )
21371 algorithm
21372 ✗ ret_3 := intEq(a_what, 1);
21373 ✗ txt := fun_589(txt, ret_3, i_valueReference_1, i_name, a_what);
21374 then txt;
21375
21376 case ( txt,
21377 _,
21378 _ )
21379 then txt;
21380 end match;
21381 end fun_590;
21382
21383 protected function fun_591
21384 input Tpl.Text in_txt;
21385 input Boolean in_mArg;
21386 input Integer in_a_what;
21387 input FMI.ModelVariables in_a_fmiModelVariable;
21388 input String in_a_variabilityCausality;
21389 input String in_a_type;
21390
21391 output Tpl.Text out_txt;
21392 algorithm
21393 out_txt :=
21394 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_variabilityCausality, in_a_type)
21395 local
21396 Tpl.Text txt;
21397 Integer a_what;
21398 FMI.ModelVariables a_fmiModelVariable;
21399 String a_variabilityCausality;
21400 String a_type;
21401 Boolean ret_2;
21402 Boolean ret_1;
21403 Boolean ret_0;
21404
21405 case ( txt,
21406 false,
21407 a_what,
21408 a_fmiModelVariable,
21409 a_variabilityCausality,
21410 a_type )
21411 algorithm
21412
3/4
✓ Branch 0 taken 1282 times.
✓ Branch 1 taken 1282 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1282 times.
2564 ret_0 := stringEq(a_type, "boolean");
21413
2/4
✓ Branch 0 taken 2564 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 2564 times.
2564 ret_1 := stringEq(a_variabilityCausality, "output");
21414 2564 ret_2 := boolAnd(ret_0, ret_1);
21415 2564 txt := fun_581(txt, ret_2, a_what, a_fmiModelVariable, a_variabilityCausality, a_type);
21416 then txt;
21417
21418 case ( txt,
21419 _,
21420 a_what,
21421 a_fmiModelVariable,
21422 _,
21423 _ )
21424 algorithm
21425 1282 txt := fun_590(txt, a_fmiModelVariable, a_what);
21426 then txt;
21427 end match;
21428 end fun_591;
21429
21430 protected function fun_592
21431 input Tpl.Text in_txt;
21432 input Boolean in_mArg;
21433 input String in_a_name;
21434
21435 output Tpl.Text out_txt;
21436 algorithm
21437 out_txt :=
21438 match(in_txt, in_mArg, in_a_name)
21439 local
21440 Tpl.Text txt;
21441 String a_name;
21442
21443 case ( txt,
21444 false,
21445 _ )
21446 then txt;
21447
21448 case ( txt,
21449 _,
21450 a_name )
21451 algorithm
21452 407 txt := Tpl.writeStr(txt, a_name);
21453 then txt;
21454 end match;
21455 end fun_592;
21456
21457 protected function fun_593
21458 input Tpl.Text in_txt;
21459 input Boolean in_mArg;
21460 input Real in_a_valueReference;
21461 input String in_a_name;
21462 input Integer in_a_what;
21463
21464 output Tpl.Text out_txt;
21465 algorithm
21466 out_txt :=
21467 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
21468 local
21469 Tpl.Text txt;
21470 Real a_valueReference;
21471 String a_name;
21472 Integer a_what;
21473 Boolean ret_0;
21474
21475 case ( txt,
21476 false,
21477 _,
21478 a_name,
21479 a_what )
21480 algorithm
21481 407 ret_0 := intEq(a_what, 2);
21482 407 txt := fun_592(txt, ret_0, a_name);
21483 then txt;
21484
21485 case ( txt,
21486 _,
21487 a_valueReference,
21488 _,
21489 _ )
21490 algorithm
21491 407 txt := Tpl.writeStr(txt, realString(a_valueReference));
21492 then txt;
21493 end match;
21494 end fun_593;
21495
21496 protected function fun_594
21497 input Tpl.Text in_txt;
21498 input Boolean in_mArg;
21499 input String in_a_name;
21500
21501 output Tpl.Text out_txt;
21502 algorithm
21503 out_txt :=
21504 match(in_txt, in_mArg, in_a_name)
21505 local
21506 Tpl.Text txt;
21507 String a_name;
21508
21509 case ( txt,
21510 false,
21511 _ )
21512 then txt;
21513
21514 case ( txt,
21515 _,
21516 a_name )
21517 algorithm
21518 4 txt := Tpl.writeStr(txt, a_name);
21519 then txt;
21520 end match;
21521 end fun_594;
21522
21523 protected function fun_595
21524 input Tpl.Text in_txt;
21525 input Boolean in_mArg;
21526 input Integer in_a_valueReference;
21527 input String in_a_name;
21528 input Integer in_a_what;
21529
21530 output Tpl.Text out_txt;
21531 algorithm
21532 out_txt :=
21533 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
21534 local
21535 Tpl.Text txt;
21536 Integer a_valueReference;
21537 String a_name;
21538 Integer a_what;
21539 Boolean ret_0;
21540
21541 case ( txt,
21542 false,
21543 _,
21544 a_name,
21545 a_what )
21546 algorithm
21547 4 ret_0 := intEq(a_what, 2);
21548 4 txt := fun_594(txt, ret_0, a_name);
21549 then txt;
21550
21551 case ( txt,
21552 _,
21553 a_valueReference,
21554 _,
21555 _ )
21556 algorithm
21557 4 txt := Tpl.writeStr(txt, intString(a_valueReference));
21558 then txt;
21559 end match;
21560 end fun_595;
21561
21562 protected function fun_596
21563 input Tpl.Text in_txt;
21564 input Boolean in_mArg;
21565 input String in_a_name;
21566
21567 output Tpl.Text out_txt;
21568 algorithm
21569 out_txt :=
21570 match(in_txt, in_mArg, in_a_name)
21571 local
21572 Tpl.Text txt;
21573 String a_name;
21574
21575 case ( txt,
21576 false,
21577 _ )
21578 then txt;
21579
21580 case ( txt,
21581 _,
21582 a_name )
21583 algorithm
21584 18 txt := Tpl.writeStr(txt, a_name);
21585 then txt;
21586 end match;
21587 end fun_596;
21588
21589 protected function fun_597
21590 input Tpl.Text in_txt;
21591 input Boolean in_mArg;
21592 input Real in_a_valueReference;
21593 input String in_a_name;
21594 input Integer in_a_what;
21595
21596 output Tpl.Text out_txt;
21597 algorithm
21598 out_txt :=
21599 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
21600 local
21601 Tpl.Text txt;
21602 Real a_valueReference;
21603 String a_name;
21604 Integer a_what;
21605 Boolean ret_0;
21606
21607 case ( txt,
21608 false,
21609 _,
21610 a_name,
21611 a_what )
21612 algorithm
21613 18 ret_0 := intEq(a_what, 2);
21614 18 txt := fun_596(txt, ret_0, a_name);
21615 then txt;
21616
21617 case ( txt,
21618 _,
21619 a_valueReference,
21620 _,
21621 _ )
21622 algorithm
21623 18 txt := Tpl.writeStr(txt, realString(a_valueReference));
21624 then txt;
21625 end match;
21626 end fun_597;
21627
21628 protected function fun_598
21629 input Tpl.Text in_txt;
21630 input Boolean in_mArg;
21631 input String in_a_name;
21632
21633 output Tpl.Text out_txt;
21634 algorithm
21635 out_txt :=
21636 match(in_txt, in_mArg, in_a_name)
21637 local
21638 Tpl.Text txt;
21639 String a_name;
21640
21641 case ( txt,
21642 false,
21643 _ )
21644 then txt;
21645
21646 case ( txt,
21647 _,
21648 a_name )
21649 algorithm
21650 1 txt := Tpl.writeStr(txt, a_name);
21651 then txt;
21652 end match;
21653 end fun_598;
21654
21655 protected function fun_599
21656 input Tpl.Text in_txt;
21657 input Boolean in_mArg;
21658 input Integer in_a_valueReference;
21659 input String in_a_name;
21660 input Integer in_a_what;
21661
21662 output Tpl.Text out_txt;
21663 algorithm
21664 out_txt :=
21665 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
21666 local
21667 Tpl.Text txt;
21668 Integer a_valueReference;
21669 String a_name;
21670 Integer a_what;
21671 Boolean ret_0;
21672
21673 case ( txt,
21674 false,
21675 _,
21676 a_name,
21677 a_what )
21678 algorithm
21679 1 ret_0 := intEq(a_what, 2);
21680 1 txt := fun_598(txt, ret_0, a_name);
21681 then txt;
21682
21683 case ( txt,
21684 _,
21685 a_valueReference,
21686 _,
21687 _ )
21688 algorithm
21689 1 txt := Tpl.writeStr(txt, intString(a_valueReference));
21690 then txt;
21691 end match;
21692 end fun_599;
21693
21694 protected function fun_600
21695 input Tpl.Text in_txt;
21696 input FMI.ModelVariables in_a_fmiModelVariable;
21697 input Integer in_a_what;
21698
21699 output Tpl.Text out_txt;
21700 algorithm
21701 out_txt :=
21702 match(in_txt, in_a_fmiModelVariable, in_a_what)
21703 local
21704 Tpl.Text txt;
21705 Integer a_what;
21706 Integer i_valueReference_1;
21707 Real i_valueReference;
21708 String i_name;
21709 Boolean ret_3;
21710 Boolean ret_2;
21711 Boolean ret_1;
21712 Boolean ret_0;
21713
21714 case ( txt,
21715 FMI.REALVARIABLE(variability = "", causality = "", name = i_name, valueReference = i_valueReference),
21716 a_what )
21717 algorithm
21718 814 ret_0 := intEq(a_what, 1);
21719 814 txt := fun_593(txt, ret_0, i_valueReference, i_name, a_what);
21720 then txt;
21721
21722 case ( txt,
21723 FMI.FMI3REALVARIABLE(variability = "", causality = "", name = i_name, valueReference = i_valueReference_1),
21724 a_what )
21725 algorithm
21726 8 ret_1 := intEq(a_what, 1);
21727 8 txt := fun_595(txt, ret_1, i_valueReference_1, i_name, a_what);
21728 then txt;
21729
21730 case ( txt,
21731 FMI.REALVARIABLE(variability = "", causality = "output", name = i_name, valueReference = i_valueReference),
21732 a_what )
21733 algorithm
21734 36 ret_2 := intEq(a_what, 1);
21735 36 txt := fun_597(txt, ret_2, i_valueReference, i_name, a_what);
21736 then txt;
21737
21738 case ( txt,
21739 FMI.FMI3REALVARIABLE(variability = "", causality = "output", name = i_name, valueReference = i_valueReference_1),
21740 a_what )
21741 algorithm
21742 2 ret_3 := intEq(a_what, 1);
21743 2 txt := fun_599(txt, ret_3, i_valueReference_1, i_name, a_what);
21744 then txt;
21745
21746 case ( txt,
21747 _,
21748 _ )
21749 then txt;
21750 end match;
21751 end fun_600;
21752
21753 protected function fun_601
21754 input Tpl.Text in_txt;
21755 input Boolean in_mArg;
21756 input Integer in_a_what;
21757 input FMI.ModelVariables in_a_fmiModelVariable;
21758 input String in_a_variabilityCausality;
21759 input String in_a_type;
21760
21761 output Tpl.Text out_txt;
21762 algorithm
21763 out_txt :=
21764 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_variabilityCausality, in_a_type)
21765 local
21766 Tpl.Text txt;
21767 Integer a_what;
21768 FMI.ModelVariables a_fmiModelVariable;
21769 String a_variabilityCausality;
21770 String a_type;
21771 Boolean ret_2;
21772 Boolean ret_1;
21773 Boolean ret_0;
21774
21775 case ( txt,
21776 false,
21777 a_what,
21778 a_fmiModelVariable,
21779 a_variabilityCausality,
21780 a_type )
21781 algorithm
21782
4/4
✓ Branch 0 taken 2564 times.
✓ Branch 1 taken 1282 times.
✓ Branch 3 taken 1282 times.
✓ Branch 4 taken 1282 times.
3846 ret_0 := stringEq(a_type, "integer");
21783
2/4
✓ Branch 0 taken 3846 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 3846 times.
3846 ret_1 := stringEq(a_variabilityCausality, "output");
21784 3846 ret_2 := boolAnd(ret_0, ret_1);
21785 3846 txt := fun_591(txt, ret_2, a_what, a_fmiModelVariable, a_variabilityCausality, a_type);
21786 then txt;
21787
21788 case ( txt,
21789 _,
21790 a_what,
21791 a_fmiModelVariable,
21792 _,
21793 _ )
21794 algorithm
21795 1282 txt := fun_600(txt, a_fmiModelVariable, a_what);
21796 then txt;
21797 end match;
21798 end fun_601;
21799
21800 protected function fun_602
21801 input Tpl.Text in_txt;
21802 input Boolean in_mArg;
21803 input String in_a_name;
21804
21805 output Tpl.Text out_txt;
21806 algorithm
21807 out_txt :=
21808 match(in_txt, in_mArg, in_a_name)
21809 local
21810 Tpl.Text txt;
21811 String a_name;
21812
21813 case ( txt,
21814 false,
21815 _ )
21816 then txt;
21817
21818 case ( txt,
21819 _,
21820 a_name )
21821 algorithm
21822 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("fmi_input_"));
21823 ✗ txt := Tpl.writeStr(txt, a_name);
21824 then txt;
21825 end match;
21826 end fun_602;
21827
21828 protected function fun_603
21829 input Tpl.Text in_txt;
21830 input Boolean in_mArg;
21831 input String in_a_name;
21832 input Integer in_a_what;
21833
21834 output Tpl.Text out_txt;
21835 algorithm
21836 out_txt :=
21837 match(in_txt, in_mArg, in_a_name, in_a_what)
21838 local
21839 Tpl.Text txt;
21840 String a_name;
21841 Integer a_what;
21842 Boolean ret_0;
21843
21844 case ( txt,
21845 false,
21846 a_name,
21847 a_what )
21848 algorithm
21849 ✗ ret_0 := intEq(a_what, 3);
21850 ✗ txt := fun_602(txt, ret_0, a_name);
21851 then txt;
21852
21853 case ( txt,
21854 _,
21855 a_name,
21856 _ )
21857 algorithm
21858 ✗ txt := Tpl.writeStr(txt, a_name);
21859 then txt;
21860 end match;
21861 end fun_603;
21862
21863 protected function fun_604
21864 input Tpl.Text in_txt;
21865 input Boolean in_mArg;
21866 input Real in_a_valueReference;
21867 input String in_a_name;
21868 input Integer in_a_what;
21869
21870 output Tpl.Text out_txt;
21871 algorithm
21872 out_txt :=
21873 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
21874 local
21875 Tpl.Text txt;
21876 Real a_valueReference;
21877 String a_name;
21878 Integer a_what;
21879 Boolean ret_0;
21880
21881 case ( txt,
21882 false,
21883 _,
21884 a_name,
21885 a_what )
21886 algorithm
21887 ✗ ret_0 := intEq(a_what, 2);
21888 ✗ txt := fun_603(txt, ret_0, a_name, a_what);
21889 then txt;
21890
21891 case ( txt,
21892 _,
21893 a_valueReference,
21894 _,
21895 _ )
21896 algorithm
21897 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
21898 then txt;
21899 end match;
21900 end fun_604;
21901
21902 protected function fun_605
21903 input Tpl.Text in_txt;
21904 input Boolean in_mArg;
21905 input String in_a_name;
21906
21907 output Tpl.Text out_txt;
21908 algorithm
21909 out_txt :=
21910 match(in_txt, in_mArg, in_a_name)
21911 local
21912 Tpl.Text txt;
21913 String a_name;
21914
21915 case ( txt,
21916 false,
21917 _ )
21918 then txt;
21919
21920 case ( txt,
21921 _,
21922 a_name )
21923 algorithm
21924 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("fmi_input_"));
21925 ✗ txt := Tpl.writeStr(txt, a_name);
21926 then txt;
21927 end match;
21928 end fun_605;
21929
21930 protected function fun_606
21931 input Tpl.Text in_txt;
21932 input Boolean in_mArg;
21933 input String in_a_name;
21934 input Integer in_a_what;
21935
21936 output Tpl.Text out_txt;
21937 algorithm
21938 out_txt :=
21939 match(in_txt, in_mArg, in_a_name, in_a_what)
21940 local
21941 Tpl.Text txt;
21942 String a_name;
21943 Integer a_what;
21944 Boolean ret_0;
21945
21946 case ( txt,
21947 false,
21948 a_name,
21949 a_what )
21950 algorithm
21951 ✗ ret_0 := intEq(a_what, 3);
21952 ✗ txt := fun_605(txt, ret_0, a_name);
21953 then txt;
21954
21955 case ( txt,
21956 _,
21957 a_name,
21958 _ )
21959 algorithm
21960 ✗ txt := Tpl.writeStr(txt, a_name);
21961 then txt;
21962 end match;
21963 end fun_606;
21964
21965 protected function fun_607
21966 input Tpl.Text in_txt;
21967 input Boolean in_mArg;
21968 input Integer in_a_valueReference;
21969 input String in_a_name;
21970 input Integer in_a_what;
21971
21972 output Tpl.Text out_txt;
21973 algorithm
21974 out_txt :=
21975 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
21976 local
21977 Tpl.Text txt;
21978 Integer a_valueReference;
21979 String a_name;
21980 Integer a_what;
21981 Boolean ret_0;
21982
21983 case ( txt,
21984 false,
21985 _,
21986 a_name,
21987 a_what )
21988 algorithm
21989 ✗ ret_0 := intEq(a_what, 2);
21990 ✗ txt := fun_606(txt, ret_0, a_name, a_what);
21991 then txt;
21992
21993 case ( txt,
21994 _,
21995 a_valueReference,
21996 _,
21997 _ )
21998 algorithm
21999 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
22000 then txt;
22001 end match;
22002 end fun_607;
22003
22004 protected function fun_608
22005 input Tpl.Text in_txt;
22006 input FMI.ModelVariables in_a_fmiModelVariable;
22007 input Integer in_a_what;
22008
22009 output Tpl.Text out_txt;
22010 algorithm
22011 out_txt :=
22012 match(in_txt, in_a_fmiModelVariable, in_a_what)
22013 local
22014 Tpl.Text txt;
22015 Integer a_what;
22016 Integer i_valueReference_1;
22017 Real i_valueReference;
22018 String i_name;
22019 Boolean ret_1;
22020 Boolean ret_0;
22021
22022 case ( txt,
22023 FMI.STRINGVARIABLE(causality = "input", name = i_name, valueReference = i_valueReference),
22024 a_what )
22025 algorithm
22026 ✗ ret_0 := intEq(a_what, 1);
22027 ✗ txt := fun_604(txt, ret_0, i_valueReference, i_name, a_what);
22028 then txt;
22029
22030 case ( txt,
22031 FMI.FMI3STRINGVARIABLE(causality = "input", name = i_name, valueReference = i_valueReference_1),
22032 a_what )
22033 algorithm
22034 ✗ ret_1 := intEq(a_what, 1);
22035 ✗ txt := fun_607(txt, ret_1, i_valueReference_1, i_name, a_what);
22036 then txt;
22037
22038 case ( txt,
22039 _,
22040 _ )
22041 then txt;
22042 end match;
22043 end fun_608;
22044
22045 protected function fun_609
22046 input Tpl.Text in_txt;
22047 input Boolean in_mArg;
22048 input Integer in_a_what;
22049 input FMI.ModelVariables in_a_fmiModelVariable;
22050 input String in_a_variabilityCausality;
22051 input String in_a_type;
22052
22053 output Tpl.Text out_txt;
22054 algorithm
22055 out_txt :=
22056 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_variabilityCausality, in_a_type)
22057 local
22058 Tpl.Text txt;
22059 Integer a_what;
22060 FMI.ModelVariables a_fmiModelVariable;
22061 String a_variabilityCausality;
22062 String a_type;
22063 Boolean ret_2;
22064 Boolean ret_1;
22065 Boolean ret_0;
22066
22067 case ( txt,
22068 false,
22069 a_what,
22070 a_fmiModelVariable,
22071 a_variabilityCausality,
22072 a_type )
22073 algorithm
22074
3/4
✓ Branch 0 taken 1282 times.
✓ Branch 1 taken 3846 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1282 times.
5128 ret_0 := stringEq(a_type, "real");
22075
2/4
✓ Branch 0 taken 5128 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 5128 times.
5128 ret_1 := stringEq(a_variabilityCausality, "output");
22076 5128 ret_2 := boolAnd(ret_0, ret_1);
22077 5128 txt := fun_601(txt, ret_2, a_what, a_fmiModelVariable, a_variabilityCausality, a_type);
22078 then txt;
22079
22080 case ( txt,
22081 _,
22082 a_what,
22083 a_fmiModelVariable,
22084 _,
22085 _ )
22086 algorithm
22087 3789 txt := fun_608(txt, a_fmiModelVariable, a_what);
22088 then txt;
22089 end match;
22090 end fun_609;
22091
22092 protected function fun_610
22093 input Tpl.Text in_txt;
22094 input Boolean in_mArg;
22095 input String in_a_name;
22096
22097 output Tpl.Text out_txt;
22098 algorithm
22099 out_txt :=
22100 match(in_txt, in_mArg, in_a_name)
22101 local
22102 Tpl.Text txt;
22103 String a_name;
22104
22105 case ( txt,
22106 false,
22107 _ )
22108 then txt;
22109
22110 case ( txt,
22111 _,
22112 a_name )
22113 algorithm
22114 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("fmi_input_"));
22115 ✗ txt := Tpl.writeStr(txt, a_name);
22116 then txt;
22117 end match;
22118 end fun_610;
22119
22120 protected function fun_611
22121 input Tpl.Text in_txt;
22122 input Boolean in_mArg;
22123 input String in_a_name;
22124 input Integer in_a_what;
22125
22126 output Tpl.Text out_txt;
22127 algorithm
22128 out_txt :=
22129 match(in_txt, in_mArg, in_a_name, in_a_what)
22130 local
22131 Tpl.Text txt;
22132 String a_name;
22133 Integer a_what;
22134 Boolean ret_0;
22135
22136 case ( txt,
22137 false,
22138 a_name,
22139 a_what )
22140 algorithm
22141 ✗ ret_0 := intEq(a_what, 3);
22142 ✗ txt := fun_610(txt, ret_0, a_name);
22143 then txt;
22144
22145 case ( txt,
22146 _,
22147 a_name,
22148 _ )
22149 algorithm
22150 ✗ txt := Tpl.writeStr(txt, a_name);
22151 then txt;
22152 end match;
22153 end fun_611;
22154
22155 protected function fun_612
22156 input Tpl.Text in_txt;
22157 input Boolean in_mArg;
22158 input Real in_a_valueReference;
22159 input String in_a_name;
22160 input Integer in_a_what;
22161
22162 output Tpl.Text out_txt;
22163 algorithm
22164 out_txt :=
22165 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
22166 local
22167 Tpl.Text txt;
22168 Real a_valueReference;
22169 String a_name;
22170 Integer a_what;
22171 Boolean ret_0;
22172
22173 case ( txt,
22174 false,
22175 _,
22176 a_name,
22177 a_what )
22178 algorithm
22179 ✗ ret_0 := intEq(a_what, 2);
22180 ✗ txt := fun_611(txt, ret_0, a_name, a_what);
22181 then txt;
22182
22183 case ( txt,
22184 _,
22185 a_valueReference,
22186 _,
22187 _ )
22188 algorithm
22189 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
22190 then txt;
22191 end match;
22192 end fun_612;
22193
22194 protected function fun_613
22195 input Tpl.Text in_txt;
22196 input Boolean in_mArg;
22197 input String in_a_name;
22198
22199 output Tpl.Text out_txt;
22200 algorithm
22201 out_txt :=
22202 match(in_txt, in_mArg, in_a_name)
22203 local
22204 Tpl.Text txt;
22205 String a_name;
22206
22207 case ( txt,
22208 false,
22209 _ )
22210 then txt;
22211
22212 case ( txt,
22213 _,
22214 a_name )
22215 algorithm
22216 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("fmi_input_"));
22217 ✗ txt := Tpl.writeStr(txt, a_name);
22218 then txt;
22219 end match;
22220 end fun_613;
22221
22222 protected function fun_614
22223 input Tpl.Text in_txt;
22224 input Boolean in_mArg;
22225 input String in_a_name;
22226 input Integer in_a_what;
22227
22228 output Tpl.Text out_txt;
22229 algorithm
22230 out_txt :=
22231 match(in_txt, in_mArg, in_a_name, in_a_what)
22232 local
22233 Tpl.Text txt;
22234 String a_name;
22235 Integer a_what;
22236 Boolean ret_0;
22237
22238 case ( txt,
22239 false,
22240 a_name,
22241 a_what )
22242 algorithm
22243 ✗ ret_0 := intEq(a_what, 3);
22244 ✗ txt := fun_613(txt, ret_0, a_name);
22245 then txt;
22246
22247 case ( txt,
22248 _,
22249 a_name,
22250 _ )
22251 algorithm
22252 ✗ txt := Tpl.writeStr(txt, a_name);
22253 then txt;
22254 end match;
22255 end fun_614;
22256
22257 protected function fun_615
22258 input Tpl.Text in_txt;
22259 input Boolean in_mArg;
22260 input Integer in_a_valueReference;
22261 input String in_a_name;
22262 input Integer in_a_what;
22263
22264 output Tpl.Text out_txt;
22265 algorithm
22266 out_txt :=
22267 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
22268 local
22269 Tpl.Text txt;
22270 Integer a_valueReference;
22271 String a_name;
22272 Integer a_what;
22273 Boolean ret_0;
22274
22275 case ( txt,
22276 false,
22277 _,
22278 a_name,
22279 a_what )
22280 algorithm
22281 ✗ ret_0 := intEq(a_what, 2);
22282 ✗ txt := fun_614(txt, ret_0, a_name, a_what);
22283 then txt;
22284
22285 case ( txt,
22286 _,
22287 a_valueReference,
22288 _,
22289 _ )
22290 algorithm
22291 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
22292 then txt;
22293 end match;
22294 end fun_615;
22295
22296 protected function fun_616
22297 input Tpl.Text in_txt;
22298 input FMI.ModelVariables in_a_fmiModelVariable;
22299 input Integer in_a_what;
22300
22301 output Tpl.Text out_txt;
22302 algorithm
22303 out_txt :=
22304 match(in_txt, in_a_fmiModelVariable, in_a_what)
22305 local
22306 Tpl.Text txt;
22307 Integer a_what;
22308 Integer i_valueReference_1;
22309 Real i_valueReference;
22310 String i_name;
22311 Boolean ret_1;
22312 Boolean ret_0;
22313
22314 case ( txt,
22315 FMI.BOOLEANVARIABLE(causality = "input", name = i_name, valueReference = i_valueReference),
22316 a_what )
22317 algorithm
22318 ✗ ret_0 := intEq(a_what, 1);
22319 ✗ txt := fun_612(txt, ret_0, i_valueReference, i_name, a_what);
22320 then txt;
22321
22322 case ( txt,
22323 FMI.FMI3BOOLEANVARIABLE(causality = "input", name = i_name, valueReference = i_valueReference_1),
22324 a_what )
22325 algorithm
22326 ✗ ret_1 := intEq(a_what, 1);
22327 ✗ txt := fun_615(txt, ret_1, i_valueReference_1, i_name, a_what);
22328 then txt;
22329
22330 case ( txt,
22331 _,
22332 _ )
22333 then txt;
22334 end match;
22335 end fun_616;
22336
22337 protected function fun_617
22338 input Tpl.Text in_txt;
22339 input Boolean in_mArg;
22340 input Integer in_a_what;
22341 input FMI.ModelVariables in_a_fmiModelVariable;
22342 input String in_a_variabilityCausality;
22343 input String in_a_type;
22344
22345 output Tpl.Text out_txt;
22346 algorithm
22347 out_txt :=
22348 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_variabilityCausality, in_a_type)
22349 local
22350 Tpl.Text txt;
22351 Integer a_what;
22352 FMI.ModelVariables a_fmiModelVariable;
22353 String a_variabilityCausality;
22354 String a_type;
22355 Boolean ret_2;
22356 Boolean ret_1;
22357 Boolean ret_0;
22358
22359 case ( txt,
22360 false,
22361 a_what,
22362 a_fmiModelVariable,
22363 a_variabilityCausality,
22364 a_type )
22365 algorithm
22366
3/4
✓ Branch 0 taken 5071 times.
✓ Branch 1 taken 3846 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 5071 times.
8917 ret_0 := stringEq(a_type, "string");
22367
3/4
✓ Branch 0 taken 3789 times.
✓ Branch 1 taken 5128 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3789 times.
8917 ret_1 := stringEq(a_variabilityCausality, "input");
22368 8917 ret_2 := boolAnd(ret_0, ret_1);
22369 8917 txt := fun_609(txt, ret_2, a_what, a_fmiModelVariable, a_variabilityCausality, a_type);
22370 then txt;
22371
22372 case ( txt,
22373 _,
22374 a_what,
22375 a_fmiModelVariable,
22376 _,
22377 _ )
22378 algorithm
22379 3789 txt := fun_616(txt, a_fmiModelVariable, a_what);
22380 then txt;
22381 end match;
22382 end fun_617;
22383
22384 protected function fun_618
22385 input Tpl.Text in_txt;
22386 input Boolean in_mArg;
22387 input String in_a_name;
22388
22389 output Tpl.Text out_txt;
22390 algorithm
22391 out_txt :=
22392 match(in_txt, in_mArg, in_a_name)
22393 local
22394 Tpl.Text txt;
22395 String a_name;
22396
22397 case ( txt,
22398 false,
22399 _ )
22400 then txt;
22401
22402 case ( txt,
22403 _,
22404 a_name )
22405 algorithm
22406 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("fmi_input_"));
22407 ✗ txt := Tpl.writeStr(txt, a_name);
22408 then txt;
22409 end match;
22410 end fun_618;
22411
22412 protected function fun_619
22413 input Tpl.Text in_txt;
22414 input Boolean in_mArg;
22415 input String in_a_name;
22416 input Integer in_a_what;
22417
22418 output Tpl.Text out_txt;
22419 algorithm
22420 out_txt :=
22421 match(in_txt, in_mArg, in_a_name, in_a_what)
22422 local
22423 Tpl.Text txt;
22424 String a_name;
22425 Integer a_what;
22426 Boolean ret_0;
22427
22428 case ( txt,
22429 false,
22430 a_name,
22431 a_what )
22432 algorithm
22433 ✗ ret_0 := intEq(a_what, 3);
22434 ✗ txt := fun_618(txt, ret_0, a_name);
22435 then txt;
22436
22437 case ( txt,
22438 _,
22439 a_name,
22440 _ )
22441 algorithm
22442 ✗ txt := Tpl.writeStr(txt, a_name);
22443 then txt;
22444 end match;
22445 end fun_619;
22446
22447 protected function fun_620
22448 input Tpl.Text in_txt;
22449 input Boolean in_mArg;
22450 input Real in_a_valueReference;
22451 input String in_a_name;
22452 input Integer in_a_what;
22453
22454 output Tpl.Text out_txt;
22455 algorithm
22456 out_txt :=
22457 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
22458 local
22459 Tpl.Text txt;
22460 Real a_valueReference;
22461 String a_name;
22462 Integer a_what;
22463 Boolean ret_0;
22464
22465 case ( txt,
22466 false,
22467 _,
22468 a_name,
22469 a_what )
22470 algorithm
22471 ✗ ret_0 := intEq(a_what, 2);
22472 ✗ txt := fun_619(txt, ret_0, a_name, a_what);
22473 then txt;
22474
22475 case ( txt,
22476 _,
22477 a_valueReference,
22478 _,
22479 _ )
22480 algorithm
22481 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
22482 then txt;
22483 end match;
22484 end fun_620;
22485
22486 protected function fun_621
22487 input Tpl.Text in_txt;
22488 input Boolean in_mArg;
22489 input String in_a_name;
22490
22491 output Tpl.Text out_txt;
22492 algorithm
22493 out_txt :=
22494 match(in_txt, in_mArg, in_a_name)
22495 local
22496 Tpl.Text txt;
22497 String a_name;
22498
22499 case ( txt,
22500 false,
22501 _ )
22502 then txt;
22503
22504 case ( txt,
22505 _,
22506 a_name )
22507 algorithm
22508 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("fmi_input_"));
22509 ✗ txt := Tpl.writeStr(txt, a_name);
22510 then txt;
22511 end match;
22512 end fun_621;
22513
22514 protected function fun_622
22515 input Tpl.Text in_txt;
22516 input Boolean in_mArg;
22517 input String in_a_name;
22518 input Integer in_a_what;
22519
22520 output Tpl.Text out_txt;
22521 algorithm
22522 out_txt :=
22523 match(in_txt, in_mArg, in_a_name, in_a_what)
22524 local
22525 Tpl.Text txt;
22526 String a_name;
22527 Integer a_what;
22528 Boolean ret_0;
22529
22530 case ( txt,
22531 false,
22532 a_name,
22533 a_what )
22534 algorithm
22535 ✗ ret_0 := intEq(a_what, 3);
22536 ✗ txt := fun_621(txt, ret_0, a_name);
22537 then txt;
22538
22539 case ( txt,
22540 _,
22541 a_name,
22542 _ )
22543 algorithm
22544 ✗ txt := Tpl.writeStr(txt, a_name);
22545 then txt;
22546 end match;
22547 end fun_622;
22548
22549 protected function fun_623
22550 input Tpl.Text in_txt;
22551 input Boolean in_mArg;
22552 input Integer in_a_valueReference;
22553 input String in_a_name;
22554 input Integer in_a_what;
22555
22556 output Tpl.Text out_txt;
22557 algorithm
22558 out_txt :=
22559 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
22560 local
22561 Tpl.Text txt;
22562 Integer a_valueReference;
22563 String a_name;
22564 Integer a_what;
22565 Boolean ret_0;
22566
22567 case ( txt,
22568 false,
22569 _,
22570 a_name,
22571 a_what )
22572 algorithm
22573 ✗ ret_0 := intEq(a_what, 2);
22574 ✗ txt := fun_622(txt, ret_0, a_name, a_what);
22575 then txt;
22576
22577 case ( txt,
22578 _,
22579 a_valueReference,
22580 _,
22581 _ )
22582 algorithm
22583 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
22584 then txt;
22585 end match;
22586 end fun_623;
22587
22588 protected function fun_624
22589 input Tpl.Text in_txt;
22590 input FMI.ModelVariables in_a_fmiModelVariable;
22591 input Integer in_a_what;
22592
22593 output Tpl.Text out_txt;
22594 algorithm
22595 out_txt :=
22596 match(in_txt, in_a_fmiModelVariable, in_a_what)
22597 local
22598 Tpl.Text txt;
22599 Integer a_what;
22600 Integer i_valueReference_1;
22601 Real i_valueReference;
22602 String i_name;
22603 Boolean ret_1;
22604 Boolean ret_0;
22605
22606 case ( txt,
22607 FMI.INTEGERVARIABLE(causality = "input", name = i_name, valueReference = i_valueReference),
22608 a_what )
22609 algorithm
22610 ✗ ret_0 := intEq(a_what, 1);
22611 ✗ txt := fun_620(txt, ret_0, i_valueReference, i_name, a_what);
22612 then txt;
22613
22614 case ( txt,
22615 FMI.FMI3INTEGERVARIABLE(causality = "input", name = i_name, valueReference = i_valueReference_1),
22616 a_what )
22617 algorithm
22618 ✗ ret_1 := intEq(a_what, 1);
22619 ✗ txt := fun_623(txt, ret_1, i_valueReference_1, i_name, a_what);
22620 then txt;
22621
22622 case ( txt,
22623 _,
22624 _ )
22625 then txt;
22626 end match;
22627 end fun_624;
22628
22629 protected function fun_625
22630 input Tpl.Text in_txt;
22631 input Boolean in_mArg;
22632 input Integer in_a_what;
22633 input FMI.ModelVariables in_a_fmiModelVariable;
22634 input String in_a_variabilityCausality;
22635 input String in_a_type;
22636
22637 output Tpl.Text out_txt;
22638 algorithm
22639 out_txt :=
22640 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_variabilityCausality, in_a_type)
22641 local
22642 Tpl.Text txt;
22643 Integer a_what;
22644 FMI.ModelVariables a_fmiModelVariable;
22645 String a_variabilityCausality;
22646 String a_type;
22647 Boolean ret_2;
22648 Boolean ret_1;
22649 Boolean ret_0;
22650
22651 case ( txt,
22652 false,
22653 a_what,
22654 a_fmiModelVariable,
22655 a_variabilityCausality,
22656 a_type )
22657 algorithm
22658
4/4
✓ Branch 0 taken 6353 times.
✓ Branch 1 taken 6353 times.
✓ Branch 3 taken 1282 times.
✓ Branch 4 taken 5071 times.
12706 ret_0 := stringEq(a_type, "boolean");
22659
3/4
✓ Branch 0 taken 7578 times.
✓ Branch 1 taken 5128 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7578 times.
12706 ret_1 := stringEq(a_variabilityCausality, "input");
22660 12706 ret_2 := boolAnd(ret_0, ret_1);
22661 12706 txt := fun_617(txt, ret_2, a_what, a_fmiModelVariable, a_variabilityCausality, a_type);
22662 then txt;
22663
22664 case ( txt,
22665 _,
22666 a_what,
22667 a_fmiModelVariable,
22668 _,
22669 _ )
22670 algorithm
22671 3789 txt := fun_624(txt, a_fmiModelVariable, a_what);
22672 then txt;
22673 end match;
22674 end fun_625;
22675
22676 protected function fun_626
22677 input Tpl.Text in_txt;
22678 input Boolean in_mArg;
22679 input String in_a_name;
22680
22681 output Tpl.Text out_txt;
22682 algorithm
22683 out_txt :=
22684 match(in_txt, in_mArg, in_a_name)
22685 local
22686 Tpl.Text txt;
22687 String a_name;
22688
22689 case ( txt,
22690 false,
22691 _ )
22692 then txt;
22693
22694 case ( txt,
22695 _,
22696 a_name )
22697 algorithm
22698 15 txt := Tpl.writeTok(txt, Tpl.ST_STRING("fmi_input_"));
22699 15 txt := Tpl.writeStr(txt, a_name);
22700 then txt;
22701 end match;
22702 end fun_626;
22703
22704 protected function fun_627
22705 input Tpl.Text in_txt;
22706 input Boolean in_mArg;
22707 input String in_a_name;
22708 input Integer in_a_what;
22709
22710 output Tpl.Text out_txt;
22711 algorithm
22712 out_txt :=
22713 match(in_txt, in_mArg, in_a_name, in_a_what)
22714 local
22715 Tpl.Text txt;
22716 String a_name;
22717 Integer a_what;
22718 Boolean ret_0;
22719
22720 case ( txt,
22721 false,
22722 a_name,
22723 a_what )
22724 algorithm
22725 15 ret_0 := intEq(a_what, 3);
22726 15 txt := fun_626(txt, ret_0, a_name);
22727 then txt;
22728
22729 case ( txt,
22730 _,
22731 a_name,
22732 _ )
22733 algorithm
22734 15 txt := Tpl.writeStr(txt, a_name);
22735 then txt;
22736 end match;
22737 end fun_627;
22738
22739 protected function fun_628
22740 input Tpl.Text in_txt;
22741 input Boolean in_mArg;
22742 input Real in_a_valueReference;
22743 input String in_a_name;
22744 input Integer in_a_what;
22745
22746 output Tpl.Text out_txt;
22747 algorithm
22748 out_txt :=
22749 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
22750 local
22751 Tpl.Text txt;
22752 Real a_valueReference;
22753 String a_name;
22754 Integer a_what;
22755 Boolean ret_0;
22756
22757 case ( txt,
22758 false,
22759 _,
22760 a_name,
22761 a_what )
22762 algorithm
22763 30 ret_0 := intEq(a_what, 2);
22764 30 txt := fun_627(txt, ret_0, a_name, a_what);
22765 then txt;
22766
22767 case ( txt,
22768 _,
22769 a_valueReference,
22770 _,
22771 _ )
22772 algorithm
22773 15 txt := Tpl.writeStr(txt, realString(a_valueReference));
22774 then txt;
22775 end match;
22776 end fun_628;
22777
22778 protected function fun_629
22779 input Tpl.Text in_txt;
22780 input Boolean in_mArg;
22781 input String in_a_name;
22782
22783 output Tpl.Text out_txt;
22784 algorithm
22785 out_txt :=
22786 match(in_txt, in_mArg, in_a_name)
22787 local
22788 Tpl.Text txt;
22789 String a_name;
22790
22791 case ( txt,
22792 false,
22793 _ )
22794 then txt;
22795
22796 case ( txt,
22797 _,
22798 a_name )
22799 algorithm
22800 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("fmi_input_"));
22801 ✗ txt := Tpl.writeStr(txt, a_name);
22802 then txt;
22803 end match;
22804 end fun_629;
22805
22806 protected function fun_630
22807 input Tpl.Text in_txt;
22808 input Boolean in_mArg;
22809 input String in_a_name;
22810 input Integer in_a_what;
22811
22812 output Tpl.Text out_txt;
22813 algorithm
22814 out_txt :=
22815 match(in_txt, in_mArg, in_a_name, in_a_what)
22816 local
22817 Tpl.Text txt;
22818 String a_name;
22819 Integer a_what;
22820 Boolean ret_0;
22821
22822 case ( txt,
22823 false,
22824 a_name,
22825 a_what )
22826 algorithm
22827 ✗ ret_0 := intEq(a_what, 3);
22828 ✗ txt := fun_629(txt, ret_0, a_name);
22829 then txt;
22830
22831 case ( txt,
22832 _,
22833 a_name,
22834 _ )
22835 algorithm
22836 ✗ txt := Tpl.writeStr(txt, a_name);
22837 then txt;
22838 end match;
22839 end fun_630;
22840
22841 protected function fun_631
22842 input Tpl.Text in_txt;
22843 input Boolean in_mArg;
22844 input Integer in_a_valueReference;
22845 input String in_a_name;
22846 input Integer in_a_what;
22847
22848 output Tpl.Text out_txt;
22849 algorithm
22850 out_txt :=
22851 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
22852 local
22853 Tpl.Text txt;
22854 Integer a_valueReference;
22855 String a_name;
22856 Integer a_what;
22857 Boolean ret_0;
22858
22859 case ( txt,
22860 false,
22861 _,
22862 a_name,
22863 a_what )
22864 algorithm
22865 ✗ ret_0 := intEq(a_what, 2);
22866 ✗ txt := fun_630(txt, ret_0, a_name, a_what);
22867 then txt;
22868
22869 case ( txt,
22870 _,
22871 a_valueReference,
22872 _,
22873 _ )
22874 algorithm
22875 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
22876 then txt;
22877 end match;
22878 end fun_631;
22879
22880 protected function fun_632
22881 input Tpl.Text in_txt;
22882 input FMI.ModelVariables in_a_fmiModelVariable;
22883 input Integer in_a_what;
22884
22885 output Tpl.Text out_txt;
22886 algorithm
22887 out_txt :=
22888 match(in_txt, in_a_fmiModelVariable, in_a_what)
22889 local
22890 Tpl.Text txt;
22891 Integer a_what;
22892 Integer i_valueReference_1;
22893 Real i_valueReference;
22894 String i_name;
22895 Boolean ret_1;
22896 Boolean ret_0;
22897
22898 case ( txt,
22899 FMI.REALVARIABLE(causality = "input", name = i_name, valueReference = i_valueReference),
22900 a_what )
22901 algorithm
22902 45 ret_0 := intEq(a_what, 1);
22903 45 txt := fun_628(txt, ret_0, i_valueReference, i_name, a_what);
22904 then txt;
22905
22906 case ( txt,
22907 FMI.FMI3REALVARIABLE(causality = "input", name = i_name, valueReference = i_valueReference_1),
22908 a_what )
22909 algorithm
22910 ✗ ret_1 := intEq(a_what, 1);
22911 ✗ txt := fun_631(txt, ret_1, i_valueReference_1, i_name, a_what);
22912 then txt;
22913
22914 case ( txt,
22915 _,
22916 _ )
22917 then txt;
22918 end match;
22919 end fun_632;
22920
22921 protected function fun_633
22922 input Tpl.Text in_txt;
22923 input Boolean in_mArg;
22924 input Integer in_a_what;
22925 input FMI.ModelVariables in_a_fmiModelVariable;
22926 input String in_a_variabilityCausality;
22927 input String in_a_type;
22928
22929 output Tpl.Text out_txt;
22930 algorithm
22931 out_txt :=
22932 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_variabilityCausality, in_a_type)
22933 local
22934 Tpl.Text txt;
22935 Integer a_what;
22936 FMI.ModelVariables a_fmiModelVariable;
22937 String a_variabilityCausality;
22938 String a_type;
22939 Boolean ret_2;
22940 Boolean ret_1;
22941 Boolean ret_0;
22942
22943 case ( txt,
22944 false,
22945 a_what,
22946 a_fmiModelVariable,
22947 a_variabilityCausality,
22948 a_type )
22949 algorithm
22950
4/4
✓ Branch 0 taken 10142 times.
✓ Branch 1 taken 6353 times.
✓ Branch 3 taken 5071 times.
✓ Branch 4 taken 5071 times.
16495 ret_0 := stringEq(a_type, "integer");
22951
3/4
✓ Branch 0 taken 11367 times.
✓ Branch 1 taken 5128 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 11367 times.
16495 ret_1 := stringEq(a_variabilityCausality, "input");
22952 16495 ret_2 := boolAnd(ret_0, ret_1);
22953 16495 txt := fun_625(txt, ret_2, a_what, a_fmiModelVariable, a_variabilityCausality, a_type);
22954 then txt;
22955
22956 case ( txt,
22957 _,
22958 a_what,
22959 a_fmiModelVariable,
22960 _,
22961 _ )
22962 algorithm
22963 3789 txt := fun_632(txt, a_fmiModelVariable, a_what);
22964 then txt;
22965 end match;
22966 end fun_633;
22967
22968 protected function fun_634
22969 input Tpl.Text in_txt;
22970 input Boolean in_mArg;
22971 input String in_a_name;
22972
22973 output Tpl.Text out_txt;
22974 algorithm
22975 out_txt :=
22976 match(in_txt, in_mArg, in_a_name)
22977 local
22978 Tpl.Text txt;
22979 String a_name;
22980
22981 case ( txt,
22982 false,
22983 _ )
22984 then txt;
22985
22986 case ( txt,
22987 _,
22988 a_name )
22989 algorithm
22990 ✗ txt := Tpl.writeStr(txt, a_name);
22991 then txt;
22992 end match;
22993 end fun_634;
22994
22995 protected function fun_635
22996 input Tpl.Text in_txt;
22997 input Boolean in_mArg;
22998 input Integer in_a_valueReference;
22999 input String in_a_name;
23000 input Integer in_a_what;
23001
23002 output Tpl.Text out_txt;
23003 algorithm
23004 out_txt :=
23005 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
23006 local
23007 Tpl.Text txt;
23008 Integer a_valueReference;
23009 String a_name;
23010 Integer a_what;
23011 Boolean ret_0;
23012
23013 case ( txt,
23014 false,
23015 _,
23016 a_name,
23017 a_what )
23018 algorithm
23019 ✗ ret_0 := intEq(a_what, 2);
23020 ✗ txt := fun_634(txt, ret_0, a_name);
23021 then txt;
23022
23023 case ( txt,
23024 _,
23025 a_valueReference,
23026 _,
23027 _ )
23028 algorithm
23029 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
23030 then txt;
23031 end match;
23032 end fun_635;
23033
23034 protected function fun_636
23035 input Tpl.Text in_txt;
23036 input FMI.ModelVariables in_a_fmiModelVariable;
23037 input Integer in_a_what;
23038
23039 output Tpl.Text out_txt;
23040 algorithm
23041 out_txt :=
23042 match(in_txt, in_a_fmiModelVariable, in_a_what)
23043 local
23044 Tpl.Text txt;
23045 Integer a_what;
23046 Integer i_valueReference;
23047 String i_name;
23048 Boolean ret_0;
23049
23050 case ( txt,
23051 FMI.FMI3STRINGVARIABLE(causality = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
23052 a_what )
23053 algorithm
23054 ✗ ret_0 := intEq(a_what, 1);
23055 ✗ txt := fun_635(txt, ret_0, i_valueReference, i_name, a_what);
23056 then txt;
23057
23058 case ( txt,
23059 _,
23060 _ )
23061 then txt;
23062 end match;
23063 end fun_636;
23064
23065 protected function fun_637
23066 input Tpl.Text in_txt;
23067 input Boolean in_mArg;
23068 input Integer in_a_what;
23069 input FMI.ModelVariables in_a_fmiModelVariable;
23070
23071 output Tpl.Text out_txt;
23072 algorithm
23073 out_txt :=
23074 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable)
23075 local
23076 Tpl.Text txt;
23077 Integer a_what;
23078 FMI.ModelVariables a_fmiModelVariable;
23079
23080 case ( txt,
23081 false,
23082 _,
23083 _ )
23084 then txt;
23085
23086 case ( txt,
23087 _,
23088 a_what,
23089 a_fmiModelVariable )
23090 algorithm
23091 12 txt := fun_636(txt, a_fmiModelVariable, a_what);
23092 then txt;
23093 end match;
23094 end fun_637;
23095
23096 protected function fun_638
23097 input Tpl.Text in_txt;
23098 input Boolean in_mArg;
23099 input String in_a_name;
23100
23101 output Tpl.Text out_txt;
23102 algorithm
23103 out_txt :=
23104 match(in_txt, in_mArg, in_a_name)
23105 local
23106 Tpl.Text txt;
23107 String a_name;
23108
23109 case ( txt,
23110 false,
23111 _ )
23112 then txt;
23113
23114 case ( txt,
23115 _,
23116 a_name )
23117 algorithm
23118 ✗ txt := Tpl.writeStr(txt, a_name);
23119 then txt;
23120 end match;
23121 end fun_638;
23122
23123 protected function fun_639
23124 input Tpl.Text in_txt;
23125 input Boolean in_mArg;
23126 input Real in_a_valueReference;
23127 input String in_a_name;
23128 input Integer in_a_what;
23129
23130 output Tpl.Text out_txt;
23131 algorithm
23132 out_txt :=
23133 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
23134 local
23135 Tpl.Text txt;
23136 Real a_valueReference;
23137 String a_name;
23138 Integer a_what;
23139 Boolean ret_0;
23140
23141 case ( txt,
23142 false,
23143 _,
23144 a_name,
23145 a_what )
23146 algorithm
23147 ✗ ret_0 := intEq(a_what, 2);
23148 ✗ txt := fun_638(txt, ret_0, a_name);
23149 then txt;
23150
23151 case ( txt,
23152 _,
23153 a_valueReference,
23154 _,
23155 _ )
23156 algorithm
23157 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
23158 then txt;
23159 end match;
23160 end fun_639;
23161
23162 protected function fun_640
23163 input Tpl.Text in_txt;
23164 input FMI.ModelVariables in_a_fmiModelVariable;
23165 input Integer in_a_what;
23166
23167 output Tpl.Text out_txt;
23168 algorithm
23169 out_txt :=
23170 match(in_txt, in_a_fmiModelVariable, in_a_what)
23171 local
23172 Tpl.Text txt;
23173 Integer a_what;
23174 Real i_valueReference;
23175 String i_name;
23176 Boolean ret_0;
23177
23178 case ( txt,
23179 FMI.STRINGVARIABLE(causality = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
23180 a_what )
23181 algorithm
23182 ✗ ret_0 := intEq(a_what, 1);
23183 ✗ txt := fun_639(txt, ret_0, i_valueReference, i_name, a_what);
23184 then txt;
23185
23186 case ( txt,
23187 _,
23188 _ )
23189 then txt;
23190 end match;
23191 end fun_640;
23192
23193 protected function fun_641
23194 input Tpl.Text in_txt;
23195 input Boolean in_mArg;
23196 input Integer in_a_what;
23197 input FMI.ModelVariables in_a_fmiModelVariable;
23198 input String in_a_fmiVersion;
23199
23200 output Tpl.Text out_txt;
23201 algorithm
23202 out_txt :=
23203 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
23204 local
23205 Tpl.Text txt;
23206 Integer a_what;
23207 FMI.ModelVariables a_fmiModelVariable;
23208 String a_fmiVersion;
23209 Boolean ret_0;
23210
23211 case ( txt,
23212 false,
23213 a_what,
23214 a_fmiModelVariable,
23215 a_fmiVersion )
23216 algorithm
23217
2/4
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
12 ret_0 := stringEq(a_fmiVersion, "3.0");
23218 12 txt := fun_637(txt, ret_0, a_what, a_fmiModelVariable);
23219 then txt;
23220
23221 case ( txt,
23222 _,
23223 a_what,
23224 a_fmiModelVariable,
23225 _ )
23226 algorithm
23227 1232 txt := fun_640(txt, a_fmiModelVariable, a_what);
23228 then txt;
23229 end match;
23230 end fun_641;
23231
23232 protected function fun_642
23233 input Tpl.Text in_txt;
23234 input Boolean in_mArg;
23235 input String in_a_name;
23236
23237 output Tpl.Text out_txt;
23238 algorithm
23239 out_txt :=
23240 match(in_txt, in_mArg, in_a_name)
23241 local
23242 Tpl.Text txt;
23243 String a_name;
23244
23245 case ( txt,
23246 false,
23247 _ )
23248 then txt;
23249
23250 case ( txt,
23251 _,
23252 a_name )
23253 algorithm
23254 ✗ txt := Tpl.writeStr(txt, a_name);
23255 then txt;
23256 end match;
23257 end fun_642;
23258
23259 protected function fun_643
23260 input Tpl.Text in_txt;
23261 input Boolean in_mArg;
23262 input Real in_a_valueReference;
23263 input String in_a_name;
23264 input Integer in_a_what;
23265
23266 output Tpl.Text out_txt;
23267 algorithm
23268 out_txt :=
23269 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
23270 local
23271 Tpl.Text txt;
23272 Real a_valueReference;
23273 String a_name;
23274 Integer a_what;
23275 Boolean ret_0;
23276
23277 case ( txt,
23278 false,
23279 _,
23280 a_name,
23281 a_what )
23282 algorithm
23283 ✗ ret_0 := intEq(a_what, 2);
23284 ✗ txt := fun_642(txt, ret_0, a_name);
23285 then txt;
23286
23287 case ( txt,
23288 _,
23289 a_valueReference,
23290 _,
23291 _ )
23292 algorithm
23293 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
23294 then txt;
23295 end match;
23296 end fun_643;
23297
23298 protected function fun_644
23299 input Tpl.Text in_txt;
23300 input FMI.ModelVariables in_a_fmiModelVariable;
23301 input Integer in_a_what;
23302
23303 output Tpl.Text out_txt;
23304 algorithm
23305 out_txt :=
23306 match(in_txt, in_a_fmiModelVariable, in_a_what)
23307 local
23308 Tpl.Text txt;
23309 Integer a_what;
23310 Real i_valueReference;
23311 String i_name;
23312 Boolean ret_0;
23313
23314 case ( txt,
23315 FMI.STRINGVARIABLE(variability = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
23316 a_what )
23317 algorithm
23318 ✗ ret_0 := intEq(a_what, 1);
23319 ✗ txt := fun_643(txt, ret_0, i_valueReference, i_name, a_what);
23320 then txt;
23321
23322 case ( txt,
23323 _,
23324 _ )
23325 then txt;
23326 end match;
23327 end fun_644;
23328
23329 protected function fun_645
23330 input Tpl.Text in_txt;
23331 input Boolean in_mArg;
23332 input Integer in_a_what;
23333 input FMI.ModelVariables in_a_fmiModelVariable;
23334 input String in_a_fmiVersion;
23335
23336 output Tpl.Text out_txt;
23337 algorithm
23338 out_txt :=
23339 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
23340 local
23341 Tpl.Text txt;
23342 Integer a_what;
23343 FMI.ModelVariables a_fmiModelVariable;
23344 String a_fmiVersion;
23345 Boolean ret_0;
23346
23347 case ( txt,
23348 false,
23349 a_what,
23350 a_fmiModelVariable,
23351 a_fmiVersion )
23352 algorithm
23353
3/4
✓ Branch 0 taken 1244 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 12 times.
✓ Branch 4 taken 1232 times.
1244 ret_0 := stringEq(a_fmiVersion, "2.0");
23354 1244 txt := fun_641(txt, ret_0, a_what, a_fmiModelVariable, a_fmiVersion);
23355 then txt;
23356
23357 case ( txt,
23358 _,
23359 a_what,
23360 a_fmiModelVariable,
23361 _ )
23362 algorithm
23363 38 txt := fun_644(txt, a_fmiModelVariable, a_what);
23364 then txt;
23365 end match;
23366 end fun_645;
23367
23368 protected function fun_646
23369 input Tpl.Text in_txt;
23370 input Boolean in_mArg;
23371 input String in_a_fmiVersion;
23372 input Integer in_a_what;
23373 input FMI.ModelVariables in_a_fmiModelVariable;
23374 input String in_a_variabilityCausality;
23375 input String in_a_type;
23376
23377 output Tpl.Text out_txt;
23378 algorithm
23379 out_txt :=
23380 match(in_txt, in_mArg, in_a_fmiVersion, in_a_what, in_a_fmiModelVariable, in_a_variabilityCausality, in_a_type)
23381 local
23382 Tpl.Text txt;
23383 String a_fmiVersion;
23384 Integer a_what;
23385 FMI.ModelVariables a_fmiModelVariable;
23386 String a_variabilityCausality;
23387 String a_type;
23388 Boolean ret_3;
23389 Boolean ret_2;
23390 Boolean ret_1;
23391 Boolean ret_0;
23392
23393 case ( txt,
23394 false,
23395 _,
23396 a_what,
23397 a_fmiModelVariable,
23398 a_variabilityCausality,
23399 a_type )
23400 algorithm
23401
3/4
✓ Branch 0 taken 5071 times.
✓ Branch 1 taken 15213 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 5071 times.
20284 ret_0 := stringEq(a_type, "real");
23402
3/4
✓ Branch 0 taken 15156 times.
✓ Branch 1 taken 5128 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 15156 times.
20284 ret_1 := stringEq(a_variabilityCausality, "input");
23403 20284 ret_2 := boolAnd(ret_0, ret_1);
23404 20284 txt := fun_633(txt, ret_2, a_what, a_fmiModelVariable, a_variabilityCausality, a_type);
23405 then txt;
23406
23407 case ( txt,
23408 _,
23409 a_fmiVersion,
23410 a_what,
23411 a_fmiModelVariable,
23412 _,
23413 _ )
23414 algorithm
23415
3/4
✓ Branch 0 taken 1282 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1244 times.
✓ Branch 4 taken 38 times.
1282 ret_3 := stringEq(a_fmiVersion, "1.0");
23416 1282 txt := fun_645(txt, ret_3, a_what, a_fmiModelVariable, a_fmiVersion);
23417 then txt;
23418 end match;
23419 end fun_646;
23420
23421 protected function fun_647
23422 input Tpl.Text in_txt;
23423 input Boolean in_mArg;
23424 input String in_a_name;
23425
23426 output Tpl.Text out_txt;
23427 algorithm
23428 out_txt :=
23429 match(in_txt, in_mArg, in_a_name)
23430 local
23431 Tpl.Text txt;
23432 String a_name;
23433
23434 case ( txt,
23435 false,
23436 _ )
23437 then txt;
23438
23439 case ( txt,
23440 _,
23441 a_name )
23442 algorithm
23443 ✗ txt := Tpl.writeStr(txt, a_name);
23444 then txt;
23445 end match;
23446 end fun_647;
23447
23448 protected function fun_648
23449 input Tpl.Text in_txt;
23450 input Boolean in_mArg;
23451 input Integer in_a_valueReference;
23452 input String in_a_name;
23453 input Integer in_a_what;
23454
23455 output Tpl.Text out_txt;
23456 algorithm
23457 out_txt :=
23458 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
23459 local
23460 Tpl.Text txt;
23461 Integer a_valueReference;
23462 String a_name;
23463 Integer a_what;
23464 Boolean ret_0;
23465
23466 case ( txt,
23467 false,
23468 _,
23469 a_name,
23470 a_what )
23471 algorithm
23472 ✗ ret_0 := intEq(a_what, 2);
23473 ✗ txt := fun_647(txt, ret_0, a_name);
23474 then txt;
23475
23476 case ( txt,
23477 _,
23478 a_valueReference,
23479 _,
23480 _ )
23481 algorithm
23482 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
23483 then txt;
23484 end match;
23485 end fun_648;
23486
23487 protected function fun_649
23488 input Tpl.Text in_txt;
23489 input FMI.ModelVariables in_a_fmiModelVariable;
23490 input Integer in_a_what;
23491
23492 output Tpl.Text out_txt;
23493 algorithm
23494 out_txt :=
23495 match(in_txt, in_a_fmiModelVariable, in_a_what)
23496 local
23497 Tpl.Text txt;
23498 Integer a_what;
23499 Integer i_valueReference;
23500 String i_name;
23501 Boolean ret_0;
23502
23503 case ( txt,
23504 FMI.FMI3BOOLEANVARIABLE(causality = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
23505 a_what )
23506 algorithm
23507 ✗ ret_0 := intEq(a_what, 1);
23508 ✗ txt := fun_648(txt, ret_0, i_valueReference, i_name, a_what);
23509 then txt;
23510
23511 case ( txt,
23512 _,
23513 _ )
23514 then txt;
23515 end match;
23516 end fun_649;
23517
23518 protected function fun_650
23519 input Tpl.Text in_txt;
23520 input Boolean in_mArg;
23521 input Integer in_a_what;
23522 input FMI.ModelVariables in_a_fmiModelVariable;
23523
23524 output Tpl.Text out_txt;
23525 algorithm
23526 out_txt :=
23527 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable)
23528 local
23529 Tpl.Text txt;
23530 Integer a_what;
23531 FMI.ModelVariables a_fmiModelVariable;
23532
23533 case ( txt,
23534 false,
23535 _,
23536 _ )
23537 then txt;
23538
23539 case ( txt,
23540 _,
23541 a_what,
23542 a_fmiModelVariable )
23543 algorithm
23544 12 txt := fun_649(txt, a_fmiModelVariable, a_what);
23545 then txt;
23546 end match;
23547 end fun_650;
23548
23549 protected function fun_651
23550 input Tpl.Text in_txt;
23551 input Boolean in_mArg;
23552 input String in_a_name;
23553
23554 output Tpl.Text out_txt;
23555 algorithm
23556 out_txt :=
23557 match(in_txt, in_mArg, in_a_name)
23558 local
23559 Tpl.Text txt;
23560 String a_name;
23561
23562 case ( txt,
23563 false,
23564 _ )
23565 then txt;
23566
23567 case ( txt,
23568 _,
23569 a_name )
23570 algorithm
23571 ✗ txt := Tpl.writeStr(txt, a_name);
23572 then txt;
23573 end match;
23574 end fun_651;
23575
23576 protected function fun_652
23577 input Tpl.Text in_txt;
23578 input Boolean in_mArg;
23579 input Real in_a_valueReference;
23580 input String in_a_name;
23581 input Integer in_a_what;
23582
23583 output Tpl.Text out_txt;
23584 algorithm
23585 out_txt :=
23586 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
23587 local
23588 Tpl.Text txt;
23589 Real a_valueReference;
23590 String a_name;
23591 Integer a_what;
23592 Boolean ret_0;
23593
23594 case ( txt,
23595 false,
23596 _,
23597 a_name,
23598 a_what )
23599 algorithm
23600 ✗ ret_0 := intEq(a_what, 2);
23601 ✗ txt := fun_651(txt, ret_0, a_name);
23602 then txt;
23603
23604 case ( txt,
23605 _,
23606 a_valueReference,
23607 _,
23608 _ )
23609 algorithm
23610 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
23611 then txt;
23612 end match;
23613 end fun_652;
23614
23615 protected function fun_653
23616 input Tpl.Text in_txt;
23617 input FMI.ModelVariables in_a_fmiModelVariable;
23618 input Integer in_a_what;
23619
23620 output Tpl.Text out_txt;
23621 algorithm
23622 out_txt :=
23623 match(in_txt, in_a_fmiModelVariable, in_a_what)
23624 local
23625 Tpl.Text txt;
23626 Integer a_what;
23627 Real i_valueReference;
23628 String i_name;
23629 Boolean ret_0;
23630
23631 case ( txt,
23632 FMI.BOOLEANVARIABLE(causality = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
23633 a_what )
23634 algorithm
23635 ✗ ret_0 := intEq(a_what, 1);
23636 ✗ txt := fun_652(txt, ret_0, i_valueReference, i_name, a_what);
23637 then txt;
23638
23639 case ( txt,
23640 _,
23641 _ )
23642 then txt;
23643 end match;
23644 end fun_653;
23645
23646 protected function fun_654
23647 input Tpl.Text in_txt;
23648 input Boolean in_mArg;
23649 input Integer in_a_what;
23650 input FMI.ModelVariables in_a_fmiModelVariable;
23651 input String in_a_fmiVersion;
23652
23653 output Tpl.Text out_txt;
23654 algorithm
23655 out_txt :=
23656 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
23657 local
23658 Tpl.Text txt;
23659 Integer a_what;
23660 FMI.ModelVariables a_fmiModelVariable;
23661 String a_fmiVersion;
23662 Boolean ret_0;
23663
23664 case ( txt,
23665 false,
23666 a_what,
23667 a_fmiModelVariable,
23668 a_fmiVersion )
23669 algorithm
23670
2/4
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
12 ret_0 := stringEq(a_fmiVersion, "3.0");
23671 12 txt := fun_650(txt, ret_0, a_what, a_fmiModelVariable);
23672 then txt;
23673
23674 case ( txt,
23675 _,
23676 a_what,
23677 a_fmiModelVariable,
23678 _ )
23679 algorithm
23680 1232 txt := fun_653(txt, a_fmiModelVariable, a_what);
23681 then txt;
23682 end match;
23683 end fun_654;
23684
23685 protected function fun_655
23686 input Tpl.Text in_txt;
23687 input Boolean in_mArg;
23688 input String in_a_name;
23689
23690 output Tpl.Text out_txt;
23691 algorithm
23692 out_txt :=
23693 match(in_txt, in_mArg, in_a_name)
23694 local
23695 Tpl.Text txt;
23696 String a_name;
23697
23698 case ( txt,
23699 false,
23700 _ )
23701 then txt;
23702
23703 case ( txt,
23704 _,
23705 a_name )
23706 algorithm
23707 1 txt := Tpl.writeStr(txt, a_name);
23708 then txt;
23709 end match;
23710 end fun_655;
23711
23712 protected function fun_656
23713 input Tpl.Text in_txt;
23714 input Boolean in_mArg;
23715 input Real in_a_valueReference;
23716 input String in_a_name;
23717 input Integer in_a_what;
23718
23719 output Tpl.Text out_txt;
23720 algorithm
23721 out_txt :=
23722 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
23723 local
23724 Tpl.Text txt;
23725 Real a_valueReference;
23726 String a_name;
23727 Integer a_what;
23728 Boolean ret_0;
23729
23730 case ( txt,
23731 false,
23732 _,
23733 a_name,
23734 a_what )
23735 algorithm
23736 1 ret_0 := intEq(a_what, 2);
23737 1 txt := fun_655(txt, ret_0, a_name);
23738 then txt;
23739
23740 case ( txt,
23741 _,
23742 a_valueReference,
23743 _,
23744 _ )
23745 algorithm
23746 1 txt := Tpl.writeStr(txt, realString(a_valueReference));
23747 then txt;
23748 end match;
23749 end fun_656;
23750
23751 protected function fun_657
23752 input Tpl.Text in_txt;
23753 input FMI.ModelVariables in_a_fmiModelVariable;
23754 input Integer in_a_what;
23755
23756 output Tpl.Text out_txt;
23757 algorithm
23758 out_txt :=
23759 match(in_txt, in_a_fmiModelVariable, in_a_what)
23760 local
23761 Tpl.Text txt;
23762 Integer a_what;
23763 Real i_valueReference;
23764 String i_name;
23765 Boolean ret_0;
23766
23767 case ( txt,
23768 FMI.BOOLEANVARIABLE(variability = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
23769 a_what )
23770 algorithm
23771 2 ret_0 := intEq(a_what, 1);
23772 2 txt := fun_656(txt, ret_0, i_valueReference, i_name, a_what);
23773 then txt;
23774
23775 case ( txt,
23776 _,
23777 _ )
23778 then txt;
23779 end match;
23780 end fun_657;
23781
23782 protected function fun_658
23783 input Tpl.Text in_txt;
23784 input Boolean in_mArg;
23785 input Integer in_a_what;
23786 input FMI.ModelVariables in_a_fmiModelVariable;
23787 input String in_a_fmiVersion;
23788
23789 output Tpl.Text out_txt;
23790 algorithm
23791 out_txt :=
23792 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
23793 local
23794 Tpl.Text txt;
23795 Integer a_what;
23796 FMI.ModelVariables a_fmiModelVariable;
23797 String a_fmiVersion;
23798 Boolean ret_0;
23799
23800 case ( txt,
23801 false,
23802 a_what,
23803 a_fmiModelVariable,
23804 a_fmiVersion )
23805 algorithm
23806
3/4
✓ Branch 0 taken 1244 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 12 times.
✓ Branch 4 taken 1232 times.
1244 ret_0 := stringEq(a_fmiVersion, "2.0");
23807 1244 txt := fun_654(txt, ret_0, a_what, a_fmiModelVariable, a_fmiVersion);
23808 then txt;
23809
23810 case ( txt,
23811 _,
23812 a_what,
23813 a_fmiModelVariable,
23814 _ )
23815 algorithm
23816 38 txt := fun_657(txt, a_fmiModelVariable, a_what);
23817 then txt;
23818 end match;
23819 end fun_658;
23820
23821 protected function fun_659
23822 input Tpl.Text in_txt;
23823 input Boolean in_mArg;
23824 input String in_a_fmiVersion;
23825 input Integer in_a_what;
23826 input FMI.ModelVariables in_a_fmiModelVariable;
23827 input Boolean in_a_dependent;
23828 input String in_a_variabilityCausality;
23829 input String in_a_type;
23830
23831 output Tpl.Text out_txt;
23832 algorithm
23833 out_txt :=
23834 match(in_txt, in_mArg, in_a_fmiVersion, in_a_what, in_a_fmiModelVariable, in_a_dependent, in_a_variabilityCausality, in_a_type)
23835 local
23836 Tpl.Text txt;
23837 String a_fmiVersion;
23838 Integer a_what;
23839 FMI.ModelVariables a_fmiModelVariable;
23840 Boolean a_dependent;
23841 String a_variabilityCausality;
23842 String a_type;
23843 Boolean ret_4;
23844 Boolean ret_3;
23845 Boolean ret_2;
23846 Boolean ret_1;
23847 Boolean ret_0;
23848
23849 case ( txt,
23850 false,
23851 a_fmiVersion,
23852 a_what,
23853 a_fmiModelVariable,
23854 a_dependent,
23855 a_variabilityCausality,
23856 a_type )
23857 algorithm
23858
3/4
✓ Branch 0 taken 6353 times.
✓ Branch 1 taken 15213 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 6353 times.
21566 ret_0 := stringEq(a_type, "string");
23859
3/4
✓ Branch 0 taken 1282 times.
✓ Branch 1 taken 20284 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1282 times.
21566 ret_1 := stringEq(a_variabilityCausality, "parameter");
23860 21566 ret_2 := boolAnd(ret_1, a_dependent);
23861 21566 ret_3 := boolAnd(ret_0, ret_2);
23862 21566 txt := fun_646(txt, ret_3, a_fmiVersion, a_what, a_fmiModelVariable, a_variabilityCausality, a_type);
23863 then txt;
23864
23865 case ( txt,
23866 _,
23867 a_fmiVersion,
23868 a_what,
23869 a_fmiModelVariable,
23870 _,
23871 _,
23872 _ )
23873 algorithm
23874
3/4
✓ Branch 0 taken 1282 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1244 times.
✓ Branch 4 taken 38 times.
1282 ret_4 := stringEq(a_fmiVersion, "1.0");
23875 1282 txt := fun_658(txt, ret_4, a_what, a_fmiModelVariable, a_fmiVersion);
23876 then txt;
23877 end match;
23878 end fun_659;
23879
23880 protected function fun_660
23881 input Tpl.Text in_txt;
23882 input Boolean in_mArg;
23883 input String in_a_name;
23884
23885 output Tpl.Text out_txt;
23886 algorithm
23887 out_txt :=
23888 match(in_txt, in_mArg, in_a_name)
23889 local
23890 Tpl.Text txt;
23891 String a_name;
23892
23893 case ( txt,
23894 false,
23895 _ )
23896 then txt;
23897
23898 case ( txt,
23899 _,
23900 a_name )
23901 algorithm
23902 ✗ txt := Tpl.writeStr(txt, a_name);
23903 then txt;
23904 end match;
23905 end fun_660;
23906
23907 protected function fun_661
23908 input Tpl.Text in_txt;
23909 input Boolean in_mArg;
23910 input Integer in_a_valueReference;
23911 input String in_a_name;
23912 input Integer in_a_what;
23913
23914 output Tpl.Text out_txt;
23915 algorithm
23916 out_txt :=
23917 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
23918 local
23919 Tpl.Text txt;
23920 Integer a_valueReference;
23921 String a_name;
23922 Integer a_what;
23923 Boolean ret_0;
23924
23925 case ( txt,
23926 false,
23927 _,
23928 a_name,
23929 a_what )
23930 algorithm
23931 ✗ ret_0 := intEq(a_what, 2);
23932 ✗ txt := fun_660(txt, ret_0, a_name);
23933 then txt;
23934
23935 case ( txt,
23936 _,
23937 a_valueReference,
23938 _,
23939 _ )
23940 algorithm
23941 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
23942 then txt;
23943 end match;
23944 end fun_661;
23945
23946 protected function fun_662
23947 input Tpl.Text in_txt;
23948 input FMI.ModelVariables in_a_fmiModelVariable;
23949 input Integer in_a_what;
23950
23951 output Tpl.Text out_txt;
23952 algorithm
23953 out_txt :=
23954 match(in_txt, in_a_fmiModelVariable, in_a_what)
23955 local
23956 Tpl.Text txt;
23957 Integer a_what;
23958 Integer i_valueReference;
23959 String i_name;
23960 Boolean ret_0;
23961
23962 case ( txt,
23963 FMI.FMI3INTEGERVARIABLE(causality = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
23964 a_what )
23965 algorithm
23966 ✗ ret_0 := intEq(a_what, 1);
23967 ✗ txt := fun_661(txt, ret_0, i_valueReference, i_name, a_what);
23968 then txt;
23969
23970 case ( txt,
23971 _,
23972 _ )
23973 then txt;
23974 end match;
23975 end fun_662;
23976
23977 protected function fun_663
23978 input Tpl.Text in_txt;
23979 input Boolean in_mArg;
23980 input Integer in_a_what;
23981 input FMI.ModelVariables in_a_fmiModelVariable;
23982
23983 output Tpl.Text out_txt;
23984 algorithm
23985 out_txt :=
23986 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable)
23987 local
23988 Tpl.Text txt;
23989 Integer a_what;
23990 FMI.ModelVariables a_fmiModelVariable;
23991
23992 case ( txt,
23993 false,
23994 _,
23995 _ )
23996 then txt;
23997
23998 case ( txt,
23999 _,
24000 a_what,
24001 a_fmiModelVariable )
24002 algorithm
24003 12 txt := fun_662(txt, a_fmiModelVariable, a_what);
24004 then txt;
24005 end match;
24006 end fun_663;
24007
24008 protected function fun_664
24009 input Tpl.Text in_txt;
24010 input Boolean in_mArg;
24011 input String in_a_name;
24012
24013 output Tpl.Text out_txt;
24014 algorithm
24015 out_txt :=
24016 match(in_txt, in_mArg, in_a_name)
24017 local
24018 Tpl.Text txt;
24019 String a_name;
24020
24021 case ( txt,
24022 false,
24023 _ )
24024 then txt;
24025
24026 case ( txt,
24027 _,
24028 a_name )
24029 algorithm
24030 ✗ txt := Tpl.writeStr(txt, a_name);
24031 then txt;
24032 end match;
24033 end fun_664;
24034
24035 protected function fun_665
24036 input Tpl.Text in_txt;
24037 input Boolean in_mArg;
24038 input Real in_a_valueReference;
24039 input String in_a_name;
24040 input Integer in_a_what;
24041
24042 output Tpl.Text out_txt;
24043 algorithm
24044 out_txt :=
24045 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
24046 local
24047 Tpl.Text txt;
24048 Real a_valueReference;
24049 String a_name;
24050 Integer a_what;
24051 Boolean ret_0;
24052
24053 case ( txt,
24054 false,
24055 _,
24056 a_name,
24057 a_what )
24058 algorithm
24059 ✗ ret_0 := intEq(a_what, 2);
24060 ✗ txt := fun_664(txt, ret_0, a_name);
24061 then txt;
24062
24063 case ( txt,
24064 _,
24065 a_valueReference,
24066 _,
24067 _ )
24068 algorithm
24069 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
24070 then txt;
24071 end match;
24072 end fun_665;
24073
24074 protected function fun_666
24075 input Tpl.Text in_txt;
24076 input FMI.ModelVariables in_a_fmiModelVariable;
24077 input Integer in_a_what;
24078
24079 output Tpl.Text out_txt;
24080 algorithm
24081 out_txt :=
24082 match(in_txt, in_a_fmiModelVariable, in_a_what)
24083 local
24084 Tpl.Text txt;
24085 Integer a_what;
24086 Real i_valueReference;
24087 String i_name;
24088 Boolean ret_0;
24089
24090 case ( txt,
24091 FMI.INTEGERVARIABLE(causality = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
24092 a_what )
24093 algorithm
24094 ✗ ret_0 := intEq(a_what, 1);
24095 ✗ txt := fun_665(txt, ret_0, i_valueReference, i_name, a_what);
24096 then txt;
24097
24098 case ( txt,
24099 _,
24100 _ )
24101 then txt;
24102 end match;
24103 end fun_666;
24104
24105 protected function fun_667
24106 input Tpl.Text in_txt;
24107 input Boolean in_mArg;
24108 input Integer in_a_what;
24109 input FMI.ModelVariables in_a_fmiModelVariable;
24110 input String in_a_fmiVersion;
24111
24112 output Tpl.Text out_txt;
24113 algorithm
24114 out_txt :=
24115 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
24116 local
24117 Tpl.Text txt;
24118 Integer a_what;
24119 FMI.ModelVariables a_fmiModelVariable;
24120 String a_fmiVersion;
24121 Boolean ret_0;
24122
24123 case ( txt,
24124 false,
24125 a_what,
24126 a_fmiModelVariable,
24127 a_fmiVersion )
24128 algorithm
24129
2/4
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
12 ret_0 := stringEq(a_fmiVersion, "3.0");
24130 12 txt := fun_663(txt, ret_0, a_what, a_fmiModelVariable);
24131 then txt;
24132
24133 case ( txt,
24134 _,
24135 a_what,
24136 a_fmiModelVariable,
24137 _ )
24138 algorithm
24139 1232 txt := fun_666(txt, a_fmiModelVariable, a_what);
24140 then txt;
24141 end match;
24142 end fun_667;
24143
24144 protected function fun_668
24145 input Tpl.Text in_txt;
24146 input Boolean in_mArg;
24147 input String in_a_name;
24148
24149 output Tpl.Text out_txt;
24150 algorithm
24151 out_txt :=
24152 match(in_txt, in_mArg, in_a_name)
24153 local
24154 Tpl.Text txt;
24155 String a_name;
24156
24157 case ( txt,
24158 false,
24159 _ )
24160 then txt;
24161
24162 case ( txt,
24163 _,
24164 a_name )
24165 algorithm
24166 ✗ txt := Tpl.writeStr(txt, a_name);
24167 then txt;
24168 end match;
24169 end fun_668;
24170
24171 protected function fun_669
24172 input Tpl.Text in_txt;
24173 input Boolean in_mArg;
24174 input Real in_a_valueReference;
24175 input String in_a_name;
24176 input Integer in_a_what;
24177
24178 output Tpl.Text out_txt;
24179 algorithm
24180 out_txt :=
24181 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
24182 local
24183 Tpl.Text txt;
24184 Real a_valueReference;
24185 String a_name;
24186 Integer a_what;
24187 Boolean ret_0;
24188
24189 case ( txt,
24190 false,
24191 _,
24192 a_name,
24193 a_what )
24194 algorithm
24195 ✗ ret_0 := intEq(a_what, 2);
24196 ✗ txt := fun_668(txt, ret_0, a_name);
24197 then txt;
24198
24199 case ( txt,
24200 _,
24201 a_valueReference,
24202 _,
24203 _ )
24204 algorithm
24205 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
24206 then txt;
24207 end match;
24208 end fun_669;
24209
24210 protected function fun_670
24211 input Tpl.Text in_txt;
24212 input FMI.ModelVariables in_a_fmiModelVariable;
24213 input Integer in_a_what;
24214
24215 output Tpl.Text out_txt;
24216 algorithm
24217 out_txt :=
24218 match(in_txt, in_a_fmiModelVariable, in_a_what)
24219 local
24220 Tpl.Text txt;
24221 Integer a_what;
24222 Real i_valueReference;
24223 String i_name;
24224 Boolean ret_0;
24225
24226 case ( txt,
24227 FMI.INTEGERVARIABLE(variability = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
24228 a_what )
24229 algorithm
24230 ✗ ret_0 := intEq(a_what, 1);
24231 ✗ txt := fun_669(txt, ret_0, i_valueReference, i_name, a_what);
24232 then txt;
24233
24234 case ( txt,
24235 _,
24236 _ )
24237 then txt;
24238 end match;
24239 end fun_670;
24240
24241 protected function fun_671
24242 input Tpl.Text in_txt;
24243 input Boolean in_mArg;
24244 input Integer in_a_what;
24245 input FMI.ModelVariables in_a_fmiModelVariable;
24246 input String in_a_fmiVersion;
24247
24248 output Tpl.Text out_txt;
24249 algorithm
24250 out_txt :=
24251 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
24252 local
24253 Tpl.Text txt;
24254 Integer a_what;
24255 FMI.ModelVariables a_fmiModelVariable;
24256 String a_fmiVersion;
24257 Boolean ret_0;
24258
24259 case ( txt,
24260 false,
24261 a_what,
24262 a_fmiModelVariable,
24263 a_fmiVersion )
24264 algorithm
24265
3/4
✓ Branch 0 taken 1244 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 12 times.
✓ Branch 4 taken 1232 times.
1244 ret_0 := stringEq(a_fmiVersion, "2.0");
24266 1244 txt := fun_667(txt, ret_0, a_what, a_fmiModelVariable, a_fmiVersion);
24267 then txt;
24268
24269 case ( txt,
24270 _,
24271 a_what,
24272 a_fmiModelVariable,
24273 _ )
24274 algorithm
24275 38 txt := fun_670(txt, a_fmiModelVariable, a_what);
24276 then txt;
24277 end match;
24278 end fun_671;
24279
24280 protected function fun_672
24281 input Tpl.Text in_txt;
24282 input Boolean in_mArg;
24283 input String in_a_fmiVersion;
24284 input Integer in_a_what;
24285 input FMI.ModelVariables in_a_fmiModelVariable;
24286 input Boolean in_a_dependent;
24287 input String in_a_variabilityCausality;
24288 input String in_a_type;
24289
24290 output Tpl.Text out_txt;
24291 algorithm
24292 out_txt :=
24293 match(in_txt, in_mArg, in_a_fmiVersion, in_a_what, in_a_fmiModelVariable, in_a_dependent, in_a_variabilityCausality, in_a_type)
24294 local
24295 Tpl.Text txt;
24296 String a_fmiVersion;
24297 Integer a_what;
24298 FMI.ModelVariables a_fmiModelVariable;
24299 Boolean a_dependent;
24300 String a_variabilityCausality;
24301 String a_type;
24302 Boolean ret_4;
24303 Boolean ret_3;
24304 Boolean ret_2;
24305 Boolean ret_1;
24306 Boolean ret_0;
24307
24308 case ( txt,
24309 false,
24310 a_fmiVersion,
24311 a_what,
24312 a_fmiModelVariable,
24313 a_dependent,
24314 a_variabilityCausality,
24315 a_type )
24316 algorithm
24317
4/4
✓ Branch 0 taken 11424 times.
✓ Branch 1 taken 11424 times.
✓ Branch 3 taken 5071 times.
✓ Branch 4 taken 6353 times.
22848 ret_0 := stringEq(a_type, "boolean");
24318
3/4
✓ Branch 0 taken 2564 times.
✓ Branch 1 taken 20284 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2564 times.
22848 ret_1 := stringEq(a_variabilityCausality, "parameter");
24319 22848 ret_2 := boolAnd(ret_1, a_dependent);
24320 22848 ret_3 := boolAnd(ret_0, ret_2);
24321 22848 txt := fun_659(txt, ret_3, a_fmiVersion, a_what, a_fmiModelVariable, a_dependent, a_variabilityCausality, a_type);
24322 then txt;
24323
24324 case ( txt,
24325 _,
24326 a_fmiVersion,
24327 a_what,
24328 a_fmiModelVariable,
24329 _,
24330 _,
24331 _ )
24332 algorithm
24333
3/4
✓ Branch 0 taken 1282 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1244 times.
✓ Branch 4 taken 38 times.
1282 ret_4 := stringEq(a_fmiVersion, "1.0");
24334 1282 txt := fun_671(txt, ret_4, a_what, a_fmiModelVariable, a_fmiVersion);
24335 then txt;
24336 end match;
24337 end fun_672;
24338
24339 protected function fun_673
24340 input Tpl.Text in_txt;
24341 input Boolean in_mArg;
24342 input String in_a_name;
24343
24344 output Tpl.Text out_txt;
24345 algorithm
24346 out_txt :=
24347 match(in_txt, in_mArg, in_a_name)
24348 local
24349 Tpl.Text txt;
24350 String a_name;
24351
24352 case ( txt,
24353 false,
24354 _ )
24355 then txt;
24356
24357 case ( txt,
24358 _,
24359 a_name )
24360 algorithm
24361 ✗ txt := Tpl.writeStr(txt, a_name);
24362 then txt;
24363 end match;
24364 end fun_673;
24365
24366 protected function fun_674
24367 input Tpl.Text in_txt;
24368 input Boolean in_mArg;
24369 input Integer in_a_valueReference;
24370 input String in_a_name;
24371 input Integer in_a_what;
24372
24373 output Tpl.Text out_txt;
24374 algorithm
24375 out_txt :=
24376 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
24377 local
24378 Tpl.Text txt;
24379 Integer a_valueReference;
24380 String a_name;
24381 Integer a_what;
24382 Boolean ret_0;
24383
24384 case ( txt,
24385 false,
24386 _,
24387 a_name,
24388 a_what )
24389 algorithm
24390 ✗ ret_0 := intEq(a_what, 2);
24391 ✗ txt := fun_673(txt, ret_0, a_name);
24392 then txt;
24393
24394 case ( txt,
24395 _,
24396 a_valueReference,
24397 _,
24398 _ )
24399 algorithm
24400 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
24401 then txt;
24402 end match;
24403 end fun_674;
24404
24405 protected function fun_675
24406 input Tpl.Text in_txt;
24407 input FMI.ModelVariables in_a_fmiModelVariable;
24408 input Integer in_a_what;
24409
24410 output Tpl.Text out_txt;
24411 algorithm
24412 out_txt :=
24413 match(in_txt, in_a_fmiModelVariable, in_a_what)
24414 local
24415 Tpl.Text txt;
24416 Integer a_what;
24417 Integer i_valueReference;
24418 String i_name;
24419 Boolean ret_0;
24420
24421 case ( txt,
24422 FMI.FMI3REALVARIABLE(causality = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
24423 a_what )
24424 algorithm
24425 ✗ ret_0 := intEq(a_what, 1);
24426 ✗ txt := fun_674(txt, ret_0, i_valueReference, i_name, a_what);
24427 then txt;
24428
24429 case ( txt,
24430 _,
24431 _ )
24432 then txt;
24433 end match;
24434 end fun_675;
24435
24436 protected function fun_676
24437 input Tpl.Text in_txt;
24438 input Boolean in_mArg;
24439 input Integer in_a_what;
24440 input FMI.ModelVariables in_a_fmiModelVariable;
24441
24442 output Tpl.Text out_txt;
24443 algorithm
24444 out_txt :=
24445 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable)
24446 local
24447 Tpl.Text txt;
24448 Integer a_what;
24449 FMI.ModelVariables a_fmiModelVariable;
24450
24451 case ( txt,
24452 false,
24453 _,
24454 _ )
24455 then txt;
24456
24457 case ( txt,
24458 _,
24459 a_what,
24460 a_fmiModelVariable )
24461 algorithm
24462 12 txt := fun_675(txt, a_fmiModelVariable, a_what);
24463 then txt;
24464 end match;
24465 end fun_676;
24466
24467 protected function fun_677
24468 input Tpl.Text in_txt;
24469 input Boolean in_mArg;
24470 input String in_a_name;
24471
24472 output Tpl.Text out_txt;
24473 algorithm
24474 out_txt :=
24475 match(in_txt, in_mArg, in_a_name)
24476 local
24477 Tpl.Text txt;
24478 String a_name;
24479
24480 case ( txt,
24481 false,
24482 _ )
24483 then txt;
24484
24485 case ( txt,
24486 _,
24487 a_name )
24488 algorithm
24489 ✗ txt := Tpl.writeStr(txt, a_name);
24490 then txt;
24491 end match;
24492 end fun_677;
24493
24494 protected function fun_678
24495 input Tpl.Text in_txt;
24496 input Boolean in_mArg;
24497 input Real in_a_valueReference;
24498 input String in_a_name;
24499 input Integer in_a_what;
24500
24501 output Tpl.Text out_txt;
24502 algorithm
24503 out_txt :=
24504 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
24505 local
24506 Tpl.Text txt;
24507 Real a_valueReference;
24508 String a_name;
24509 Integer a_what;
24510 Boolean ret_0;
24511
24512 case ( txt,
24513 false,
24514 _,
24515 a_name,
24516 a_what )
24517 algorithm
24518 ✗ ret_0 := intEq(a_what, 2);
24519 ✗ txt := fun_677(txt, ret_0, a_name);
24520 then txt;
24521
24522 case ( txt,
24523 _,
24524 a_valueReference,
24525 _,
24526 _ )
24527 algorithm
24528 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
24529 then txt;
24530 end match;
24531 end fun_678;
24532
24533 protected function fun_679
24534 input Tpl.Text in_txt;
24535 input FMI.ModelVariables in_a_fmiModelVariable;
24536 input Integer in_a_what;
24537
24538 output Tpl.Text out_txt;
24539 algorithm
24540 out_txt :=
24541 match(in_txt, in_a_fmiModelVariable, in_a_what)
24542 local
24543 Tpl.Text txt;
24544 Integer a_what;
24545 Real i_valueReference;
24546 String i_name;
24547 Boolean ret_0;
24548
24549 case ( txt,
24550 FMI.REALVARIABLE(causality = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
24551 a_what )
24552 algorithm
24553 ✗ ret_0 := intEq(a_what, 1);
24554 ✗ txt := fun_678(txt, ret_0, i_valueReference, i_name, a_what);
24555 then txt;
24556
24557 case ( txt,
24558 _,
24559 _ )
24560 then txt;
24561 end match;
24562 end fun_679;
24563
24564 protected function fun_680
24565 input Tpl.Text in_txt;
24566 input Boolean in_mArg;
24567 input Integer in_a_what;
24568 input FMI.ModelVariables in_a_fmiModelVariable;
24569 input String in_a_fmiVersion;
24570
24571 output Tpl.Text out_txt;
24572 algorithm
24573 out_txt :=
24574 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
24575 local
24576 Tpl.Text txt;
24577 Integer a_what;
24578 FMI.ModelVariables a_fmiModelVariable;
24579 String a_fmiVersion;
24580 Boolean ret_0;
24581
24582 case ( txt,
24583 false,
24584 a_what,
24585 a_fmiModelVariable,
24586 a_fmiVersion )
24587 algorithm
24588
2/4
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
12 ret_0 := stringEq(a_fmiVersion, "3.0");
24589 12 txt := fun_676(txt, ret_0, a_what, a_fmiModelVariable);
24590 then txt;
24591
24592 case ( txt,
24593 _,
24594 a_what,
24595 a_fmiModelVariable,
24596 _ )
24597 algorithm
24598 1232 txt := fun_679(txt, a_fmiModelVariable, a_what);
24599 then txt;
24600 end match;
24601 end fun_680;
24602
24603 protected function fun_681
24604 input Tpl.Text in_txt;
24605 input Boolean in_mArg;
24606 input String in_a_name;
24607
24608 output Tpl.Text out_txt;
24609 algorithm
24610 out_txt :=
24611 match(in_txt, in_mArg, in_a_name)
24612 local
24613 Tpl.Text txt;
24614 String a_name;
24615
24616 case ( txt,
24617 false,
24618 _ )
24619 then txt;
24620
24621 case ( txt,
24622 _,
24623 a_name )
24624 algorithm
24625 ✗ txt := Tpl.writeStr(txt, a_name);
24626 then txt;
24627 end match;
24628 end fun_681;
24629
24630 protected function fun_682
24631 input Tpl.Text in_txt;
24632 input Boolean in_mArg;
24633 input Real in_a_valueReference;
24634 input String in_a_name;
24635 input Integer in_a_what;
24636
24637 output Tpl.Text out_txt;
24638 algorithm
24639 out_txt :=
24640 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
24641 local
24642 Tpl.Text txt;
24643 Real a_valueReference;
24644 String a_name;
24645 Integer a_what;
24646 Boolean ret_0;
24647
24648 case ( txt,
24649 false,
24650 _,
24651 a_name,
24652 a_what )
24653 algorithm
24654 ✗ ret_0 := intEq(a_what, 2);
24655 ✗ txt := fun_681(txt, ret_0, a_name);
24656 then txt;
24657
24658 case ( txt,
24659 _,
24660 a_valueReference,
24661 _,
24662 _ )
24663 algorithm
24664 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
24665 then txt;
24666 end match;
24667 end fun_682;
24668
24669 protected function fun_683
24670 input Tpl.Text in_txt;
24671 input FMI.ModelVariables in_a_fmiModelVariable;
24672 input Integer in_a_what;
24673
24674 output Tpl.Text out_txt;
24675 algorithm
24676 out_txt :=
24677 match(in_txt, in_a_fmiModelVariable, in_a_what)
24678 local
24679 Tpl.Text txt;
24680 Integer a_what;
24681 Real i_valueReference;
24682 String i_name;
24683 Boolean ret_0;
24684
24685 case ( txt,
24686 FMI.REALVARIABLE(variability = "parameter", hasStartValue = false, isFixed = false, name = i_name, valueReference = i_valueReference),
24687 a_what )
24688 algorithm
24689 ✗ ret_0 := intEq(a_what, 1);
24690 ✗ txt := fun_682(txt, ret_0, i_valueReference, i_name, a_what);
24691 then txt;
24692
24693 case ( txt,
24694 _,
24695 _ )
24696 then txt;
24697 end match;
24698 end fun_683;
24699
24700 protected function fun_684
24701 input Tpl.Text in_txt;
24702 input Boolean in_mArg;
24703 input Integer in_a_what;
24704 input FMI.ModelVariables in_a_fmiModelVariable;
24705 input String in_a_fmiVersion;
24706
24707 output Tpl.Text out_txt;
24708 algorithm
24709 out_txt :=
24710 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
24711 local
24712 Tpl.Text txt;
24713 Integer a_what;
24714 FMI.ModelVariables a_fmiModelVariable;
24715 String a_fmiVersion;
24716 Boolean ret_0;
24717
24718 case ( txt,
24719 false,
24720 a_what,
24721 a_fmiModelVariable,
24722 a_fmiVersion )
24723 algorithm
24724
3/4
✓ Branch 0 taken 1244 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 12 times.
✓ Branch 4 taken 1232 times.
1244 ret_0 := stringEq(a_fmiVersion, "2.0");
24725 1244 txt := fun_680(txt, ret_0, a_what, a_fmiModelVariable, a_fmiVersion);
24726 then txt;
24727
24728 case ( txt,
24729 _,
24730 a_what,
24731 a_fmiModelVariable,
24732 _ )
24733 algorithm
24734 38 txt := fun_683(txt, a_fmiModelVariable, a_what);
24735 then txt;
24736 end match;
24737 end fun_684;
24738
24739 protected function fun_685
24740 input Tpl.Text in_txt;
24741 input Boolean in_mArg;
24742 input String in_a_fmiVersion;
24743 input Integer in_a_what;
24744 input FMI.ModelVariables in_a_fmiModelVariable;
24745 input Boolean in_a_dependent;
24746 input String in_a_variabilityCausality;
24747 input String in_a_type;
24748
24749 output Tpl.Text out_txt;
24750 algorithm
24751 out_txt :=
24752 match(in_txt, in_mArg, in_a_fmiVersion, in_a_what, in_a_fmiModelVariable, in_a_dependent, in_a_variabilityCausality, in_a_type)
24753 local
24754 Tpl.Text txt;
24755 String a_fmiVersion;
24756 Integer a_what;
24757 FMI.ModelVariables a_fmiModelVariable;
24758 Boolean a_dependent;
24759 String a_variabilityCausality;
24760 String a_type;
24761 Boolean ret_4;
24762 Boolean ret_3;
24763 Boolean ret_2;
24764 Boolean ret_1;
24765 Boolean ret_0;
24766
24767 case ( txt,
24768 false,
24769 a_fmiVersion,
24770 a_what,
24771 a_fmiModelVariable,
24772 a_dependent,
24773 a_variabilityCausality,
24774 a_type )
24775 algorithm
24776
4/4
✓ Branch 0 taken 12706 times.
✓ Branch 1 taken 11424 times.
✓ Branch 3 taken 6353 times.
✓ Branch 4 taken 6353 times.
24130 ret_0 := stringEq(a_type, "integer");
24777
3/4
✓ Branch 0 taken 3846 times.
✓ Branch 1 taken 20284 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3846 times.
24130 ret_1 := stringEq(a_variabilityCausality, "parameter");
24778 24130 ret_2 := boolAnd(ret_1, a_dependent);
24779 24130 ret_3 := boolAnd(ret_0, ret_2);
24780 24130 txt := fun_672(txt, ret_3, a_fmiVersion, a_what, a_fmiModelVariable, a_dependent, a_variabilityCausality, a_type);
24781 then txt;
24782
24783 case ( txt,
24784 _,
24785 a_fmiVersion,
24786 a_what,
24787 a_fmiModelVariable,
24788 _,
24789 _,
24790 _ )
24791 algorithm
24792
3/4
✓ Branch 0 taken 1282 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1244 times.
✓ Branch 4 taken 38 times.
1282 ret_4 := stringEq(a_fmiVersion, "1.0");
24793 1282 txt := fun_684(txt, ret_4, a_what, a_fmiModelVariable, a_fmiVersion);
24794 then txt;
24795 end match;
24796 end fun_685;
24797
24798 protected function fun_686
24799 input Tpl.Text in_txt;
24800 input Boolean in_mArg;
24801 input String in_a_name;
24802
24803 output Tpl.Text out_txt;
24804 algorithm
24805 out_txt :=
24806 match(in_txt, in_mArg, in_a_name)
24807 local
24808 Tpl.Text txt;
24809 String a_name;
24810
24811 case ( txt,
24812 false,
24813 _ )
24814 then txt;
24815
24816 case ( txt,
24817 _,
24818 a_name )
24819 algorithm
24820 ✗ txt := Tpl.writeStr(txt, a_name);
24821 then txt;
24822 end match;
24823 end fun_686;
24824
24825 protected function fun_687
24826 input Tpl.Text in_txt;
24827 input Boolean in_mArg;
24828 input Integer in_a_valueReference;
24829 input String in_a_name;
24830 input Integer in_a_what;
24831
24832 output Tpl.Text out_txt;
24833 algorithm
24834 out_txt :=
24835 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
24836 local
24837 Tpl.Text txt;
24838 Integer a_valueReference;
24839 String a_name;
24840 Integer a_what;
24841 Boolean ret_0;
24842
24843 case ( txt,
24844 false,
24845 _,
24846 a_name,
24847 a_what )
24848 algorithm
24849 ✗ ret_0 := intEq(a_what, 2);
24850 ✗ txt := fun_686(txt, ret_0, a_name);
24851 then txt;
24852
24853 case ( txt,
24854 _,
24855 a_valueReference,
24856 _,
24857 _ )
24858 algorithm
24859 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
24860 then txt;
24861 end match;
24862 end fun_687;
24863
24864 protected function fun_688
24865 input Tpl.Text in_txt;
24866 input FMI.ModelVariables in_a_fmiModelVariable;
24867 input Integer in_a_what;
24868
24869 output Tpl.Text out_txt;
24870 algorithm
24871 out_txt :=
24872 match(in_txt, in_a_fmiModelVariable, in_a_what)
24873 local
24874 Tpl.Text txt;
24875 Integer a_what;
24876 Integer i_valueReference;
24877 String i_name;
24878 Boolean ret_0;
24879
24880 case ( txt,
24881 FMI.FMI3STRINGVARIABLE(causality = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
24882 a_what )
24883 algorithm
24884 ✗ ret_0 := intEq(a_what, 1);
24885 ✗ txt := fun_687(txt, ret_0, i_valueReference, i_name, a_what);
24886 then txt;
24887
24888 case ( txt,
24889 _,
24890 _ )
24891 then txt;
24892 end match;
24893 end fun_688;
24894
24895 protected function fun_689
24896 input Tpl.Text in_txt;
24897 input Boolean in_mArg;
24898 input Integer in_a_what;
24899 input FMI.ModelVariables in_a_fmiModelVariable;
24900
24901 output Tpl.Text out_txt;
24902 algorithm
24903 out_txt :=
24904 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable)
24905 local
24906 Tpl.Text txt;
24907 Integer a_what;
24908 FMI.ModelVariables a_fmiModelVariable;
24909
24910 case ( txt,
24911 false,
24912 _,
24913 _ )
24914 then txt;
24915
24916 case ( txt,
24917 _,
24918 a_what,
24919 a_fmiModelVariable )
24920 algorithm
24921 12 txt := fun_688(txt, a_fmiModelVariable, a_what);
24922 then txt;
24923 end match;
24924 end fun_689;
24925
24926 protected function fun_690
24927 input Tpl.Text in_txt;
24928 input Boolean in_mArg;
24929 input String in_a_name;
24930
24931 output Tpl.Text out_txt;
24932 algorithm
24933 out_txt :=
24934 match(in_txt, in_mArg, in_a_name)
24935 local
24936 Tpl.Text txt;
24937 String a_name;
24938
24939 case ( txt,
24940 false,
24941 _ )
24942 then txt;
24943
24944 case ( txt,
24945 _,
24946 a_name )
24947 algorithm
24948 4 txt := Tpl.writeStr(txt, a_name);
24949 then txt;
24950 end match;
24951 end fun_690;
24952
24953 protected function fun_691
24954 input Tpl.Text in_txt;
24955 input Boolean in_mArg;
24956 input Real in_a_valueReference;
24957 input String in_a_name;
24958 input Integer in_a_what;
24959
24960 output Tpl.Text out_txt;
24961 algorithm
24962 out_txt :=
24963 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
24964 local
24965 Tpl.Text txt;
24966 Real a_valueReference;
24967 String a_name;
24968 Integer a_what;
24969 Boolean ret_0;
24970
24971 case ( txt,
24972 false,
24973 _,
24974 a_name,
24975 a_what )
24976 algorithm
24977 4 ret_0 := intEq(a_what, 2);
24978 4 txt := fun_690(txt, ret_0, a_name);
24979 then txt;
24980
24981 case ( txt,
24982 _,
24983 a_valueReference,
24984 _,
24985 _ )
24986 algorithm
24987 4 txt := Tpl.writeStr(txt, realString(a_valueReference));
24988 then txt;
24989 end match;
24990 end fun_691;
24991
24992 protected function fun_692
24993 input Tpl.Text in_txt;
24994 input FMI.ModelVariables in_a_fmiModelVariable;
24995 input Integer in_a_what;
24996
24997 output Tpl.Text out_txt;
24998 algorithm
24999 out_txt :=
25000 match(in_txt, in_a_fmiModelVariable, in_a_what)
25001 local
25002 Tpl.Text txt;
25003 Integer a_what;
25004 Real i_valueReference;
25005 String i_name;
25006 Boolean ret_0;
25007
25008 case ( txt,
25009 FMI.STRINGVARIABLE(causality = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
25010 a_what )
25011 algorithm
25012 8 ret_0 := intEq(a_what, 1);
25013 8 txt := fun_691(txt, ret_0, i_valueReference, i_name, a_what);
25014 then txt;
25015
25016 case ( txt,
25017 _,
25018 _ )
25019 then txt;
25020 end match;
25021 end fun_692;
25022
25023 protected function fun_693
25024 input Tpl.Text in_txt;
25025 input Boolean in_mArg;
25026 input Integer in_a_what;
25027 input FMI.ModelVariables in_a_fmiModelVariable;
25028 input String in_a_fmiVersion;
25029
25030 output Tpl.Text out_txt;
25031 algorithm
25032 out_txt :=
25033 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
25034 local
25035 Tpl.Text txt;
25036 Integer a_what;
25037 FMI.ModelVariables a_fmiModelVariable;
25038 String a_fmiVersion;
25039 Boolean ret_0;
25040
25041 case ( txt,
25042 false,
25043 a_what,
25044 a_fmiModelVariable,
25045 a_fmiVersion )
25046 algorithm
25047
2/4
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
12 ret_0 := stringEq(a_fmiVersion, "3.0");
25048 12 txt := fun_689(txt, ret_0, a_what, a_fmiModelVariable);
25049 then txt;
25050
25051 case ( txt,
25052 _,
25053 a_what,
25054 a_fmiModelVariable,
25055 _ )
25056 algorithm
25057 1232 txt := fun_692(txt, a_fmiModelVariable, a_what);
25058 then txt;
25059 end match;
25060 end fun_693;
25061
25062 protected function fun_694
25063 input Tpl.Text in_txt;
25064 input Boolean in_mArg;
25065 input String in_a_name;
25066
25067 output Tpl.Text out_txt;
25068 algorithm
25069 out_txt :=
25070 match(in_txt, in_mArg, in_a_name)
25071 local
25072 Tpl.Text txt;
25073 String a_name;
25074
25075 case ( txt,
25076 false,
25077 _ )
25078 then txt;
25079
25080 case ( txt,
25081 _,
25082 a_name )
25083 algorithm
25084 ✗ txt := Tpl.writeStr(txt, a_name);
25085 then txt;
25086 end match;
25087 end fun_694;
25088
25089 protected function fun_695
25090 input Tpl.Text in_txt;
25091 input Boolean in_mArg;
25092 input Real in_a_valueReference;
25093 input String in_a_name;
25094 input Integer in_a_what;
25095
25096 output Tpl.Text out_txt;
25097 algorithm
25098 out_txt :=
25099 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
25100 local
25101 Tpl.Text txt;
25102 Real a_valueReference;
25103 String a_name;
25104 Integer a_what;
25105 Boolean ret_0;
25106
25107 case ( txt,
25108 false,
25109 _,
25110 a_name,
25111 a_what )
25112 algorithm
25113 ✗ ret_0 := intEq(a_what, 2);
25114 ✗ txt := fun_694(txt, ret_0, a_name);
25115 then txt;
25116
25117 case ( txt,
25118 _,
25119 a_valueReference,
25120 _,
25121 _ )
25122 algorithm
25123 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
25124 then txt;
25125 end match;
25126 end fun_695;
25127
25128 protected function fun_696
25129 input Tpl.Text in_txt;
25130 input FMI.ModelVariables in_a_fmiModelVariable;
25131 input Integer in_a_what;
25132
25133 output Tpl.Text out_txt;
25134 algorithm
25135 out_txt :=
25136 match(in_txt, in_a_fmiModelVariable, in_a_what)
25137 local
25138 Tpl.Text txt;
25139 Integer a_what;
25140 Real i_valueReference;
25141 String i_name;
25142 Boolean ret_0;
25143
25144 case ( txt,
25145 FMI.STRINGVARIABLE(variability = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
25146 a_what )
25147 algorithm
25148 ✗ ret_0 := intEq(a_what, 1);
25149 ✗ txt := fun_695(txt, ret_0, i_valueReference, i_name, a_what);
25150 then txt;
25151
25152 case ( txt,
25153 _,
25154 _ )
25155 then txt;
25156 end match;
25157 end fun_696;
25158
25159 protected function fun_697
25160 input Tpl.Text in_txt;
25161 input Boolean in_mArg;
25162 input Integer in_a_what;
25163 input FMI.ModelVariables in_a_fmiModelVariable;
25164 input String in_a_fmiVersion;
25165
25166 output Tpl.Text out_txt;
25167 algorithm
25168 out_txt :=
25169 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
25170 local
25171 Tpl.Text txt;
25172 Integer a_what;
25173 FMI.ModelVariables a_fmiModelVariable;
25174 String a_fmiVersion;
25175 Boolean ret_0;
25176
25177 case ( txt,
25178 false,
25179 a_what,
25180 a_fmiModelVariable,
25181 a_fmiVersion )
25182 algorithm
25183
3/4
✓ Branch 0 taken 1244 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 12 times.
✓ Branch 4 taken 1232 times.
1244 ret_0 := stringEq(a_fmiVersion, "2.0");
25184 1244 txt := fun_693(txt, ret_0, a_what, a_fmiModelVariable, a_fmiVersion);
25185 then txt;
25186
25187 case ( txt,
25188 _,
25189 a_what,
25190 a_fmiModelVariable,
25191 _ )
25192 algorithm
25193 38 txt := fun_696(txt, a_fmiModelVariable, a_what);
25194 then txt;
25195 end match;
25196 end fun_697;
25197
25198 protected function fun_698
25199 input Tpl.Text in_txt;
25200 input Boolean in_mArg;
25201 input String in_a_fmiVersion;
25202 input Integer in_a_what;
25203 input FMI.ModelVariables in_a_fmiModelVariable;
25204 input Boolean in_a_dependent;
25205 input String in_a_variabilityCausality;
25206 input String in_a_type;
25207
25208 output Tpl.Text out_txt;
25209 algorithm
25210 out_txt :=
25211 match(in_txt, in_mArg, in_a_fmiVersion, in_a_what, in_a_fmiModelVariable, in_a_dependent, in_a_variabilityCausality, in_a_type)
25212 local
25213 Tpl.Text txt;
25214 String a_fmiVersion;
25215 Integer a_what;
25216 FMI.ModelVariables a_fmiModelVariable;
25217 Boolean a_dependent;
25218 String a_variabilityCausality;
25219 String a_type;
25220 Boolean ret_4;
25221 Boolean ret_3;
25222 Boolean ret_2;
25223 Boolean ret_1;
25224 Boolean ret_0;
25225
25226 case ( txt,
25227 false,
25228 a_fmiVersion,
25229 a_what,
25230 a_fmiModelVariable,
25231 a_dependent,
25232 a_variabilityCausality,
25233 a_type )
25234 algorithm
25235
3/4
✓ Branch 0 taken 6353 times.
✓ Branch 1 taken 19059 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 6353 times.
25412 ret_0 := stringEq(a_type, "real");
25236
3/4
✓ Branch 0 taken 5128 times.
✓ Branch 1 taken 20284 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 5128 times.
25412 ret_1 := stringEq(a_variabilityCausality, "parameter");
25237 25412 ret_2 := boolAnd(ret_1, a_dependent);
25238 25412 ret_3 := boolAnd(ret_0, ret_2);
25239 25412 txt := fun_685(txt, ret_3, a_fmiVersion, a_what, a_fmiModelVariable, a_dependent, a_variabilityCausality, a_type);
25240 then txt;
25241
25242 case ( txt,
25243 _,
25244 a_fmiVersion,
25245 a_what,
25246 a_fmiModelVariable,
25247 _,
25248 _,
25249 _ )
25250 algorithm
25251
3/4
✓ Branch 0 taken 1282 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1244 times.
✓ Branch 4 taken 38 times.
1282 ret_4 := stringEq(a_fmiVersion, "1.0");
25252 1282 txt := fun_697(txt, ret_4, a_what, a_fmiModelVariable, a_fmiVersion);
25253 then txt;
25254 end match;
25255 end fun_698;
25256
25257 protected function fun_699
25258 input Tpl.Text in_txt;
25259 input Boolean in_mArg;
25260 input String in_a_name;
25261
25262 output Tpl.Text out_txt;
25263 algorithm
25264 out_txt :=
25265 match(in_txt, in_mArg, in_a_name)
25266 local
25267 Tpl.Text txt;
25268 String a_name;
25269
25270 case ( txt,
25271 false,
25272 _ )
25273 then txt;
25274
25275 case ( txt,
25276 _,
25277 a_name )
25278 algorithm
25279 ✗ txt := Tpl.writeStr(txt, a_name);
25280 then txt;
25281 end match;
25282 end fun_699;
25283
25284 protected function fun_700
25285 input Tpl.Text in_txt;
25286 input Boolean in_mArg;
25287 input Integer in_a_valueReference;
25288 input String in_a_name;
25289 input Integer in_a_what;
25290
25291 output Tpl.Text out_txt;
25292 algorithm
25293 out_txt :=
25294 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
25295 local
25296 Tpl.Text txt;
25297 Integer a_valueReference;
25298 String a_name;
25299 Integer a_what;
25300 Boolean ret_0;
25301
25302 case ( txt,
25303 false,
25304 _,
25305 a_name,
25306 a_what )
25307 algorithm
25308 ✗ ret_0 := intEq(a_what, 2);
25309 ✗ txt := fun_699(txt, ret_0, a_name);
25310 then txt;
25311
25312 case ( txt,
25313 _,
25314 a_valueReference,
25315 _,
25316 _ )
25317 algorithm
25318 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
25319 then txt;
25320 end match;
25321 end fun_700;
25322
25323 protected function fun_701
25324 input Tpl.Text in_txt;
25325 input FMI.ModelVariables in_a_fmiModelVariable;
25326 input Integer in_a_what;
25327
25328 output Tpl.Text out_txt;
25329 algorithm
25330 out_txt :=
25331 match(in_txt, in_a_fmiModelVariable, in_a_what)
25332 local
25333 Tpl.Text txt;
25334 Integer a_what;
25335 Integer i_valueReference;
25336 String i_name;
25337 Boolean ret_0;
25338
25339 case ( txt,
25340 FMI.FMI3BOOLEANVARIABLE(causality = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
25341 a_what )
25342 algorithm
25343 ✗ ret_0 := intEq(a_what, 1);
25344 ✗ txt := fun_700(txt, ret_0, i_valueReference, i_name, a_what);
25345 then txt;
25346
25347 case ( txt,
25348 _,
25349 _ )
25350 then txt;
25351 end match;
25352 end fun_701;
25353
25354 protected function fun_702
25355 input Tpl.Text in_txt;
25356 input Boolean in_mArg;
25357 input Integer in_a_what;
25358 input FMI.ModelVariables in_a_fmiModelVariable;
25359
25360 output Tpl.Text out_txt;
25361 algorithm
25362 out_txt :=
25363 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable)
25364 local
25365 Tpl.Text txt;
25366 Integer a_what;
25367 FMI.ModelVariables a_fmiModelVariable;
25368
25369 case ( txt,
25370 false,
25371 _,
25372 _ )
25373 then txt;
25374
25375 case ( txt,
25376 _,
25377 a_what,
25378 a_fmiModelVariable )
25379 algorithm
25380 12 txt := fun_701(txt, a_fmiModelVariable, a_what);
25381 then txt;
25382 end match;
25383 end fun_702;
25384
25385 protected function fun_703
25386 input Tpl.Text in_txt;
25387 input Boolean in_mArg;
25388 input String in_a_name;
25389
25390 output Tpl.Text out_txt;
25391 algorithm
25392 out_txt :=
25393 match(in_txt, in_mArg, in_a_name)
25394 local
25395 Tpl.Text txt;
25396 String a_name;
25397
25398 case ( txt,
25399 false,
25400 _ )
25401 then txt;
25402
25403 case ( txt,
25404 _,
25405 a_name )
25406 algorithm
25407 9 txt := Tpl.writeStr(txt, a_name);
25408 then txt;
25409 end match;
25410 end fun_703;
25411
25412 protected function fun_704
25413 input Tpl.Text in_txt;
25414 input Boolean in_mArg;
25415 input Real in_a_valueReference;
25416 input String in_a_name;
25417 input Integer in_a_what;
25418
25419 output Tpl.Text out_txt;
25420 algorithm
25421 out_txt :=
25422 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
25423 local
25424 Tpl.Text txt;
25425 Real a_valueReference;
25426 String a_name;
25427 Integer a_what;
25428 Boolean ret_0;
25429
25430 case ( txt,
25431 false,
25432 _,
25433 a_name,
25434 a_what )
25435 algorithm
25436 9 ret_0 := intEq(a_what, 2);
25437 9 txt := fun_703(txt, ret_0, a_name);
25438 then txt;
25439
25440 case ( txt,
25441 _,
25442 a_valueReference,
25443 _,
25444 _ )
25445 algorithm
25446 9 txt := Tpl.writeStr(txt, realString(a_valueReference));
25447 then txt;
25448 end match;
25449 end fun_704;
25450
25451 protected function fun_705
25452 input Tpl.Text in_txt;
25453 input FMI.ModelVariables in_a_fmiModelVariable;
25454 input Integer in_a_what;
25455
25456 output Tpl.Text out_txt;
25457 algorithm
25458 out_txt :=
25459 match(in_txt, in_a_fmiModelVariable, in_a_what)
25460 local
25461 Tpl.Text txt;
25462 Integer a_what;
25463 Real i_valueReference;
25464 String i_name;
25465 Boolean ret_0;
25466
25467 case ( txt,
25468 FMI.BOOLEANVARIABLE(causality = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
25469 a_what )
25470 algorithm
25471 18 ret_0 := intEq(a_what, 1);
25472 18 txt := fun_704(txt, ret_0, i_valueReference, i_name, a_what);
25473 then txt;
25474
25475 case ( txt,
25476 _,
25477 _ )
25478 then txt;
25479 end match;
25480 end fun_705;
25481
25482 protected function fun_706
25483 input Tpl.Text in_txt;
25484 input Boolean in_mArg;
25485 input Integer in_a_what;
25486 input FMI.ModelVariables in_a_fmiModelVariable;
25487 input String in_a_fmiVersion;
25488
25489 output Tpl.Text out_txt;
25490 algorithm
25491 out_txt :=
25492 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
25493 local
25494 Tpl.Text txt;
25495 Integer a_what;
25496 FMI.ModelVariables a_fmiModelVariable;
25497 String a_fmiVersion;
25498 Boolean ret_0;
25499
25500 case ( txt,
25501 false,
25502 a_what,
25503 a_fmiModelVariable,
25504 a_fmiVersion )
25505 algorithm
25506
2/4
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
12 ret_0 := stringEq(a_fmiVersion, "3.0");
25507 12 txt := fun_702(txt, ret_0, a_what, a_fmiModelVariable);
25508 then txt;
25509
25510 case ( txt,
25511 _,
25512 a_what,
25513 a_fmiModelVariable,
25514 _ )
25515 algorithm
25516 1232 txt := fun_705(txt, a_fmiModelVariable, a_what);
25517 then txt;
25518 end match;
25519 end fun_706;
25520
25521 protected function fun_707
25522 input Tpl.Text in_txt;
25523 input Boolean in_mArg;
25524 input String in_a_name;
25525
25526 output Tpl.Text out_txt;
25527 algorithm
25528 out_txt :=
25529 match(in_txt, in_mArg, in_a_name)
25530 local
25531 Tpl.Text txt;
25532 String a_name;
25533
25534 case ( txt,
25535 false,
25536 _ )
25537 then txt;
25538
25539 case ( txt,
25540 _,
25541 a_name )
25542 algorithm
25543 3 txt := Tpl.writeStr(txt, a_name);
25544 then txt;
25545 end match;
25546 end fun_707;
25547
25548 protected function fun_708
25549 input Tpl.Text in_txt;
25550 input Boolean in_mArg;
25551 input Real in_a_valueReference;
25552 input String in_a_name;
25553 input Integer in_a_what;
25554
25555 output Tpl.Text out_txt;
25556 algorithm
25557 out_txt :=
25558 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
25559 local
25560 Tpl.Text txt;
25561 Real a_valueReference;
25562 String a_name;
25563 Integer a_what;
25564 Boolean ret_0;
25565
25566 case ( txt,
25567 false,
25568 _,
25569 a_name,
25570 a_what )
25571 algorithm
25572 3 ret_0 := intEq(a_what, 2);
25573 3 txt := fun_707(txt, ret_0, a_name);
25574 then txt;
25575
25576 case ( txt,
25577 _,
25578 a_valueReference,
25579 _,
25580 _ )
25581 algorithm
25582 3 txt := Tpl.writeStr(txt, realString(a_valueReference));
25583 then txt;
25584 end match;
25585 end fun_708;
25586
25587 protected function fun_709
25588 input Tpl.Text in_txt;
25589 input FMI.ModelVariables in_a_fmiModelVariable;
25590 input Integer in_a_what;
25591
25592 output Tpl.Text out_txt;
25593 algorithm
25594 out_txt :=
25595 match(in_txt, in_a_fmiModelVariable, in_a_what)
25596 local
25597 Tpl.Text txt;
25598 Integer a_what;
25599 Real i_valueReference;
25600 String i_name;
25601 Boolean ret_0;
25602
25603 case ( txt,
25604 FMI.BOOLEANVARIABLE(variability = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
25605 a_what )
25606 algorithm
25607 6 ret_0 := intEq(a_what, 1);
25608 6 txt := fun_708(txt, ret_0, i_valueReference, i_name, a_what);
25609 then txt;
25610
25611 case ( txt,
25612 _,
25613 _ )
25614 then txt;
25615 end match;
25616 end fun_709;
25617
25618 protected function fun_710
25619 input Tpl.Text in_txt;
25620 input Boolean in_mArg;
25621 input Integer in_a_what;
25622 input FMI.ModelVariables in_a_fmiModelVariable;
25623 input String in_a_fmiVersion;
25624
25625 output Tpl.Text out_txt;
25626 algorithm
25627 out_txt :=
25628 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
25629 local
25630 Tpl.Text txt;
25631 Integer a_what;
25632 FMI.ModelVariables a_fmiModelVariable;
25633 String a_fmiVersion;
25634 Boolean ret_0;
25635
25636 case ( txt,
25637 false,
25638 a_what,
25639 a_fmiModelVariable,
25640 a_fmiVersion )
25641 algorithm
25642
3/4
✓ Branch 0 taken 1244 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 12 times.
✓ Branch 4 taken 1232 times.
1244 ret_0 := stringEq(a_fmiVersion, "2.0");
25643 1244 txt := fun_706(txt, ret_0, a_what, a_fmiModelVariable, a_fmiVersion);
25644 then txt;
25645
25646 case ( txt,
25647 _,
25648 a_what,
25649 a_fmiModelVariable,
25650 _ )
25651 algorithm
25652 38 txt := fun_709(txt, a_fmiModelVariable, a_what);
25653 then txt;
25654 end match;
25655 end fun_710;
25656
25657 protected function fun_711
25658 input Tpl.Text in_txt;
25659 input Boolean in_mArg;
25660 input String in_a_fmiVersion;
25661 input Integer in_a_what;
25662 input FMI.ModelVariables in_a_fmiModelVariable;
25663 input Boolean in_a_dependent;
25664 input String in_a_variabilityCausality;
25665 input String in_a_type;
25666
25667 output Tpl.Text out_txt;
25668 algorithm
25669 out_txt :=
25670 match(in_txt, in_mArg, in_a_fmiVersion, in_a_what, in_a_fmiModelVariable, in_a_dependent, in_a_variabilityCausality, in_a_type)
25671 local
25672 Tpl.Text txt;
25673 String a_fmiVersion;
25674 Integer a_what;
25675 FMI.ModelVariables a_fmiModelVariable;
25676 Boolean a_dependent;
25677 String a_variabilityCausality;
25678 String a_type;
25679 Boolean ret_5;
25680 Boolean ret_4;
25681 Boolean ret_3;
25682 Boolean ret_2;
25683 Boolean ret_1;
25684 Boolean ret_0;
25685
25686 case ( txt,
25687 false,
25688 a_fmiVersion,
25689 a_what,
25690 a_fmiModelVariable,
25691 a_dependent,
25692 a_variabilityCausality,
25693 a_type )
25694 algorithm
25695
3/4
✓ Branch 0 taken 7635 times.
✓ Branch 1 taken 19059 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7635 times.
26694 ret_0 := stringEq(a_type, "string");
25696
3/4
✓ Branch 0 taken 6410 times.
✓ Branch 1 taken 20284 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 6410 times.
26694 ret_1 := stringEq(a_variabilityCausality, "parameter");
25697 26694 ret_2 := boolNot(a_dependent);
25698 26694 ret_3 := boolAnd(ret_1, ret_2);
25699 26694 ret_4 := boolAnd(ret_0, ret_3);
25700 26694 txt := fun_698(txt, ret_4, a_fmiVersion, a_what, a_fmiModelVariable, a_dependent, a_variabilityCausality, a_type);
25701 then txt;
25702
25703 case ( txt,
25704 _,
25705 a_fmiVersion,
25706 a_what,
25707 a_fmiModelVariable,
25708 _,
25709 _,
25710 _ )
25711 algorithm
25712
3/4
✓ Branch 0 taken 1282 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1244 times.
✓ Branch 4 taken 38 times.
1282 ret_5 := stringEq(a_fmiVersion, "1.0");
25713 1282 txt := fun_710(txt, ret_5, a_what, a_fmiModelVariable, a_fmiVersion);
25714 then txt;
25715 end match;
25716 end fun_711;
25717
25718 protected function fun_712
25719 input Tpl.Text in_txt;
25720 input Boolean in_mArg;
25721 input String in_a_name;
25722
25723 output Tpl.Text out_txt;
25724 algorithm
25725 out_txt :=
25726 match(in_txt, in_mArg, in_a_name)
25727 local
25728 Tpl.Text txt;
25729 String a_name;
25730
25731 case ( txt,
25732 false,
25733 _ )
25734 then txt;
25735
25736 case ( txt,
25737 _,
25738 a_name )
25739 algorithm
25740 ✗ txt := Tpl.writeStr(txt, a_name);
25741 then txt;
25742 end match;
25743 end fun_712;
25744
25745 protected function fun_713
25746 input Tpl.Text in_txt;
25747 input Boolean in_mArg;
25748 input Integer in_a_valueReference;
25749 input String in_a_name;
25750 input Integer in_a_what;
25751
25752 output Tpl.Text out_txt;
25753 algorithm
25754 out_txt :=
25755 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
25756 local
25757 Tpl.Text txt;
25758 Integer a_valueReference;
25759 String a_name;
25760 Integer a_what;
25761 Boolean ret_0;
25762
25763 case ( txt,
25764 false,
25765 _,
25766 a_name,
25767 a_what )
25768 algorithm
25769 ✗ ret_0 := intEq(a_what, 2);
25770 ✗ txt := fun_712(txt, ret_0, a_name);
25771 then txt;
25772
25773 case ( txt,
25774 _,
25775 a_valueReference,
25776 _,
25777 _ )
25778 algorithm
25779 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
25780 then txt;
25781 end match;
25782 end fun_713;
25783
25784 protected function fun_714
25785 input Tpl.Text in_txt;
25786 input FMI.ModelVariables in_a_fmiModelVariable;
25787 input Integer in_a_what;
25788
25789 output Tpl.Text out_txt;
25790 algorithm
25791 out_txt :=
25792 match(in_txt, in_a_fmiModelVariable, in_a_what)
25793 local
25794 Tpl.Text txt;
25795 Integer a_what;
25796 Integer i_valueReference;
25797 String i_name;
25798 Boolean ret_0;
25799
25800 case ( txt,
25801 FMI.FMI3INTEGERVARIABLE(causality = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
25802 a_what )
25803 algorithm
25804 ✗ ret_0 := intEq(a_what, 1);
25805 ✗ txt := fun_713(txt, ret_0, i_valueReference, i_name, a_what);
25806 then txt;
25807
25808 case ( txt,
25809 _,
25810 _ )
25811 then txt;
25812 end match;
25813 end fun_714;
25814
25815 protected function fun_715
25816 input Tpl.Text in_txt;
25817 input Boolean in_mArg;
25818 input Integer in_a_what;
25819 input FMI.ModelVariables in_a_fmiModelVariable;
25820
25821 output Tpl.Text out_txt;
25822 algorithm
25823 out_txt :=
25824 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable)
25825 local
25826 Tpl.Text txt;
25827 Integer a_what;
25828 FMI.ModelVariables a_fmiModelVariable;
25829
25830 case ( txt,
25831 false,
25832 _,
25833 _ )
25834 then txt;
25835
25836 case ( txt,
25837 _,
25838 a_what,
25839 a_fmiModelVariable )
25840 algorithm
25841 12 txt := fun_714(txt, a_fmiModelVariable, a_what);
25842 then txt;
25843 end match;
25844 end fun_715;
25845
25846 protected function fun_716
25847 input Tpl.Text in_txt;
25848 input Boolean in_mArg;
25849 input String in_a_name;
25850
25851 output Tpl.Text out_txt;
25852 algorithm
25853 out_txt :=
25854 match(in_txt, in_mArg, in_a_name)
25855 local
25856 Tpl.Text txt;
25857 String a_name;
25858
25859 case ( txt,
25860 false,
25861 _ )
25862 then txt;
25863
25864 case ( txt,
25865 _,
25866 a_name )
25867 algorithm
25868 2 txt := Tpl.writeStr(txt, a_name);
25869 then txt;
25870 end match;
25871 end fun_716;
25872
25873 protected function fun_717
25874 input Tpl.Text in_txt;
25875 input Boolean in_mArg;
25876 input Real in_a_valueReference;
25877 input String in_a_name;
25878 input Integer in_a_what;
25879
25880 output Tpl.Text out_txt;
25881 algorithm
25882 out_txt :=
25883 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
25884 local
25885 Tpl.Text txt;
25886 Real a_valueReference;
25887 String a_name;
25888 Integer a_what;
25889 Boolean ret_0;
25890
25891 case ( txt,
25892 false,
25893 _,
25894 a_name,
25895 a_what )
25896 algorithm
25897 2 ret_0 := intEq(a_what, 2);
25898 2 txt := fun_716(txt, ret_0, a_name);
25899 then txt;
25900
25901 case ( txt,
25902 _,
25903 a_valueReference,
25904 _,
25905 _ )
25906 algorithm
25907 2 txt := Tpl.writeStr(txt, realString(a_valueReference));
25908 then txt;
25909 end match;
25910 end fun_717;
25911
25912 protected function fun_718
25913 input Tpl.Text in_txt;
25914 input FMI.ModelVariables in_a_fmiModelVariable;
25915 input Integer in_a_what;
25916
25917 output Tpl.Text out_txt;
25918 algorithm
25919 out_txt :=
25920 match(in_txt, in_a_fmiModelVariable, in_a_what)
25921 local
25922 Tpl.Text txt;
25923 Integer a_what;
25924 Real i_valueReference;
25925 String i_name;
25926 Boolean ret_0;
25927
25928 case ( txt,
25929 FMI.INTEGERVARIABLE(causality = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
25930 a_what )
25931 algorithm
25932 4 ret_0 := intEq(a_what, 1);
25933 4 txt := fun_717(txt, ret_0, i_valueReference, i_name, a_what);
25934 then txt;
25935
25936 case ( txt,
25937 _,
25938 _ )
25939 then txt;
25940 end match;
25941 end fun_718;
25942
25943 protected function fun_719
25944 input Tpl.Text in_txt;
25945 input Boolean in_mArg;
25946 input Integer in_a_what;
25947 input FMI.ModelVariables in_a_fmiModelVariable;
25948 input String in_a_fmiVersion;
25949
25950 output Tpl.Text out_txt;
25951 algorithm
25952 out_txt :=
25953 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
25954 local
25955 Tpl.Text txt;
25956 Integer a_what;
25957 FMI.ModelVariables a_fmiModelVariable;
25958 String a_fmiVersion;
25959 Boolean ret_0;
25960
25961 case ( txt,
25962 false,
25963 a_what,
25964 a_fmiModelVariable,
25965 a_fmiVersion )
25966 algorithm
25967
2/4
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
12 ret_0 := stringEq(a_fmiVersion, "3.0");
25968 12 txt := fun_715(txt, ret_0, a_what, a_fmiModelVariable);
25969 then txt;
25970
25971 case ( txt,
25972 _,
25973 a_what,
25974 a_fmiModelVariable,
25975 _ )
25976 algorithm
25977 1232 txt := fun_718(txt, a_fmiModelVariable, a_what);
25978 then txt;
25979 end match;
25980 end fun_719;
25981
25982 protected function fun_720
25983 input Tpl.Text in_txt;
25984 input Boolean in_mArg;
25985 input String in_a_name;
25986
25987 output Tpl.Text out_txt;
25988 algorithm
25989 out_txt :=
25990 match(in_txt, in_mArg, in_a_name)
25991 local
25992 Tpl.Text txt;
25993 String a_name;
25994
25995 case ( txt,
25996 false,
25997 _ )
25998 then txt;
25999
26000 case ( txt,
26001 _,
26002 a_name )
26003 algorithm
26004 ✗ txt := Tpl.writeStr(txt, a_name);
26005 then txt;
26006 end match;
26007 end fun_720;
26008
26009 protected function fun_721
26010 input Tpl.Text in_txt;
26011 input Boolean in_mArg;
26012 input Real in_a_valueReference;
26013 input String in_a_name;
26014 input Integer in_a_what;
26015
26016 output Tpl.Text out_txt;
26017 algorithm
26018 out_txt :=
26019 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
26020 local
26021 Tpl.Text txt;
26022 Real a_valueReference;
26023 String a_name;
26024 Integer a_what;
26025 Boolean ret_0;
26026
26027 case ( txt,
26028 false,
26029 _,
26030 a_name,
26031 a_what )
26032 algorithm
26033 ✗ ret_0 := intEq(a_what, 2);
26034 ✗ txt := fun_720(txt, ret_0, a_name);
26035 then txt;
26036
26037 case ( txt,
26038 _,
26039 a_valueReference,
26040 _,
26041 _ )
26042 algorithm
26043 ✗ txt := Tpl.writeStr(txt, realString(a_valueReference));
26044 then txt;
26045 end match;
26046 end fun_721;
26047
26048 protected function fun_722
26049 input Tpl.Text in_txt;
26050 input FMI.ModelVariables in_a_fmiModelVariable;
26051 input Integer in_a_what;
26052
26053 output Tpl.Text out_txt;
26054 algorithm
26055 out_txt :=
26056 match(in_txt, in_a_fmiModelVariable, in_a_what)
26057 local
26058 Tpl.Text txt;
26059 Integer a_what;
26060 Real i_valueReference;
26061 String i_name;
26062 Boolean ret_0;
26063
26064 case ( txt,
26065 FMI.INTEGERVARIABLE(variability = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
26066 a_what )
26067 algorithm
26068 ✗ ret_0 := intEq(a_what, 1);
26069 ✗ txt := fun_721(txt, ret_0, i_valueReference, i_name, a_what);
26070 then txt;
26071
26072 case ( txt,
26073 _,
26074 _ )
26075 then txt;
26076 end match;
26077 end fun_722;
26078
26079 protected function fun_723
26080 input Tpl.Text in_txt;
26081 input Boolean in_mArg;
26082 input Integer in_a_what;
26083 input FMI.ModelVariables in_a_fmiModelVariable;
26084 input String in_a_fmiVersion;
26085
26086 output Tpl.Text out_txt;
26087 algorithm
26088 out_txt :=
26089 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
26090 local
26091 Tpl.Text txt;
26092 Integer a_what;
26093 FMI.ModelVariables a_fmiModelVariable;
26094 String a_fmiVersion;
26095 Boolean ret_0;
26096
26097 case ( txt,
26098 false,
26099 a_what,
26100 a_fmiModelVariable,
26101 a_fmiVersion )
26102 algorithm
26103
3/4
✓ Branch 0 taken 1244 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 12 times.
✓ Branch 4 taken 1232 times.
1244 ret_0 := stringEq(a_fmiVersion, "2.0");
26104 1244 txt := fun_719(txt, ret_0, a_what, a_fmiModelVariable, a_fmiVersion);
26105 then txt;
26106
26107 case ( txt,
26108 _,
26109 a_what,
26110 a_fmiModelVariable,
26111 _ )
26112 algorithm
26113 38 txt := fun_722(txt, a_fmiModelVariable, a_what);
26114 then txt;
26115 end match;
26116 end fun_723;
26117
26118 protected function fun_724
26119 input Tpl.Text in_txt;
26120 input Boolean in_mArg;
26121 input String in_a_fmiVersion;
26122 input Integer in_a_what;
26123 input FMI.ModelVariables in_a_fmiModelVariable;
26124 input Boolean in_a_dependent;
26125 input String in_a_variabilityCausality;
26126 input String in_a_type;
26127
26128 output Tpl.Text out_txt;
26129 algorithm
26130 out_txt :=
26131 match(in_txt, in_mArg, in_a_fmiVersion, in_a_what, in_a_fmiModelVariable, in_a_dependent, in_a_variabilityCausality, in_a_type)
26132 local
26133 Tpl.Text txt;
26134 String a_fmiVersion;
26135 Integer a_what;
26136 FMI.ModelVariables a_fmiModelVariable;
26137 Boolean a_dependent;
26138 String a_variabilityCausality;
26139 String a_type;
26140 Boolean ret_5;
26141 Boolean ret_4;
26142 Boolean ret_3;
26143 Boolean ret_2;
26144 Boolean ret_1;
26145 Boolean ret_0;
26146
26147 case ( txt,
26148 false,
26149 a_fmiVersion,
26150 a_what,
26151 a_fmiModelVariable,
26152 a_dependent,
26153 a_variabilityCausality,
26154 a_type )
26155 algorithm
26156
4/4
✓ Branch 0 taken 13988 times.
✓ Branch 1 taken 13988 times.
✓ Branch 3 taken 6353 times.
✓ Branch 4 taken 7635 times.
27976 ret_0 := stringEq(a_type, "boolean");
26157
3/4
✓ Branch 0 taken 7692 times.
✓ Branch 1 taken 20284 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7692 times.
27976 ret_1 := stringEq(a_variabilityCausality, "parameter");
26158 27976 ret_2 := boolNot(a_dependent);
26159 27976 ret_3 := boolAnd(ret_1, ret_2);
26160 27976 ret_4 := boolAnd(ret_0, ret_3);
26161 27976 txt := fun_711(txt, ret_4, a_fmiVersion, a_what, a_fmiModelVariable, a_dependent, a_variabilityCausality, a_type);
26162 then txt;
26163
26164 case ( txt,
26165 _,
26166 a_fmiVersion,
26167 a_what,
26168 a_fmiModelVariable,
26169 _,
26170 _,
26171 _ )
26172 algorithm
26173
3/4
✓ Branch 0 taken 1282 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1244 times.
✓ Branch 4 taken 38 times.
1282 ret_5 := stringEq(a_fmiVersion, "1.0");
26174 1282 txt := fun_723(txt, ret_5, a_what, a_fmiModelVariable, a_fmiVersion);
26175 then txt;
26176 end match;
26177 end fun_724;
26178
26179 protected function fun_725
26180 input Tpl.Text in_txt;
26181 input Boolean in_mArg;
26182 input String in_a_name;
26183
26184 output Tpl.Text out_txt;
26185 algorithm
26186 out_txt :=
26187 match(in_txt, in_mArg, in_a_name)
26188 local
26189 Tpl.Text txt;
26190 String a_name;
26191
26192 case ( txt,
26193 false,
26194 _ )
26195 then txt;
26196
26197 case ( txt,
26198 _,
26199 a_name )
26200 algorithm
26201 ✗ txt := Tpl.writeStr(txt, a_name);
26202 then txt;
26203 end match;
26204 end fun_725;
26205
26206 protected function fun_726
26207 input Tpl.Text in_txt;
26208 input Boolean in_mArg;
26209 input Integer in_a_valueReference;
26210 input String in_a_name;
26211 input Integer in_a_what;
26212
26213 output Tpl.Text out_txt;
26214 algorithm
26215 out_txt :=
26216 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
26217 local
26218 Tpl.Text txt;
26219 Integer a_valueReference;
26220 String a_name;
26221 Integer a_what;
26222 Boolean ret_0;
26223
26224 case ( txt,
26225 false,
26226 _,
26227 a_name,
26228 a_what )
26229 algorithm
26230 ✗ ret_0 := intEq(a_what, 2);
26231 ✗ txt := fun_725(txt, ret_0, a_name);
26232 then txt;
26233
26234 case ( txt,
26235 _,
26236 a_valueReference,
26237 _,
26238 _ )
26239 algorithm
26240 ✗ txt := Tpl.writeStr(txt, intString(a_valueReference));
26241 then txt;
26242 end match;
26243 end fun_726;
26244
26245 protected function fun_727
26246 input Tpl.Text in_txt;
26247 input FMI.ModelVariables in_a_fmiModelVariable;
26248 input Integer in_a_what;
26249
26250 output Tpl.Text out_txt;
26251 algorithm
26252 out_txt :=
26253 match(in_txt, in_a_fmiModelVariable, in_a_what)
26254 local
26255 Tpl.Text txt;
26256 Integer a_what;
26257 Integer i_valueReference;
26258 String i_name;
26259 Boolean ret_0;
26260
26261 case ( txt,
26262 FMI.FMI3REALVARIABLE(causality = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
26263 a_what )
26264 algorithm
26265 ✗ ret_0 := intEq(a_what, 1);
26266 ✗ txt := fun_726(txt, ret_0, i_valueReference, i_name, a_what);
26267 then txt;
26268
26269 case ( txt,
26270 _,
26271 _ )
26272 then txt;
26273 end match;
26274 end fun_727;
26275
26276 protected function fun_728
26277 input Tpl.Text in_txt;
26278 input Boolean in_mArg;
26279 input Integer in_a_what;
26280 input FMI.ModelVariables in_a_fmiModelVariable;
26281
26282 output Tpl.Text out_txt;
26283 algorithm
26284 out_txt :=
26285 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable)
26286 local
26287 Tpl.Text txt;
26288 Integer a_what;
26289 FMI.ModelVariables a_fmiModelVariable;
26290
26291 case ( txt,
26292 false,
26293 _,
26294 _ )
26295 then txt;
26296
26297 case ( txt,
26298 _,
26299 a_what,
26300 a_fmiModelVariable )
26301 algorithm
26302 12 txt := fun_727(txt, a_fmiModelVariable, a_what);
26303 then txt;
26304 end match;
26305 end fun_728;
26306
26307 protected function fun_729
26308 input Tpl.Text in_txt;
26309 input Boolean in_mArg;
26310 input String in_a_name;
26311
26312 output Tpl.Text out_txt;
26313 algorithm
26314 out_txt :=
26315 match(in_txt, in_mArg, in_a_name)
26316 local
26317 Tpl.Text txt;
26318 String a_name;
26319
26320 case ( txt,
26321 false,
26322 _ )
26323 then txt;
26324
26325 case ( txt,
26326 _,
26327 a_name )
26328 algorithm
26329 92 txt := Tpl.writeStr(txt, a_name);
26330 then txt;
26331 end match;
26332 end fun_729;
26333
26334 protected function fun_730
26335 input Tpl.Text in_txt;
26336 input Boolean in_mArg;
26337 input Real in_a_valueReference;
26338 input String in_a_name;
26339 input Integer in_a_what;
26340
26341 output Tpl.Text out_txt;
26342 algorithm
26343 out_txt :=
26344 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
26345 local
26346 Tpl.Text txt;
26347 Real a_valueReference;
26348 String a_name;
26349 Integer a_what;
26350 Boolean ret_0;
26351
26352 case ( txt,
26353 false,
26354 _,
26355 a_name,
26356 a_what )
26357 algorithm
26358 92 ret_0 := intEq(a_what, 2);
26359 92 txt := fun_729(txt, ret_0, a_name);
26360 then txt;
26361
26362 case ( txt,
26363 _,
26364 a_valueReference,
26365 _,
26366 _ )
26367 algorithm
26368 92 txt := Tpl.writeStr(txt, realString(a_valueReference));
26369 then txt;
26370 end match;
26371 end fun_730;
26372
26373 protected function fun_731
26374 input Tpl.Text in_txt;
26375 input FMI.ModelVariables in_a_fmiModelVariable;
26376 input Integer in_a_what;
26377
26378 output Tpl.Text out_txt;
26379 algorithm
26380 out_txt :=
26381 match(in_txt, in_a_fmiModelVariable, in_a_what)
26382 local
26383 Tpl.Text txt;
26384 Integer a_what;
26385 Real i_valueReference;
26386 String i_name;
26387 Boolean ret_0;
26388
26389 case ( txt,
26390 FMI.REALVARIABLE(causality = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
26391 a_what )
26392 algorithm
26393 184 ret_0 := intEq(a_what, 1);
26394 184 txt := fun_730(txt, ret_0, i_valueReference, i_name, a_what);
26395 then txt;
26396
26397 case ( txt,
26398 _,
26399 _ )
26400 then txt;
26401 end match;
26402 end fun_731;
26403
26404 protected function fun_732
26405 input Tpl.Text in_txt;
26406 input Boolean in_mArg;
26407 input Integer in_a_what;
26408 input FMI.ModelVariables in_a_fmiModelVariable;
26409 input String in_a_fmiVersion;
26410
26411 output Tpl.Text out_txt;
26412 algorithm
26413 out_txt :=
26414 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
26415 local
26416 Tpl.Text txt;
26417 Integer a_what;
26418 FMI.ModelVariables a_fmiModelVariable;
26419 String a_fmiVersion;
26420 Boolean ret_0;
26421
26422 case ( txt,
26423 false,
26424 a_what,
26425 a_fmiModelVariable,
26426 a_fmiVersion )
26427 algorithm
26428
2/4
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
12 ret_0 := stringEq(a_fmiVersion, "3.0");
26429 12 txt := fun_728(txt, ret_0, a_what, a_fmiModelVariable);
26430 then txt;
26431
26432 case ( txt,
26433 _,
26434 a_what,
26435 a_fmiModelVariable,
26436 _ )
26437 algorithm
26438 1232 txt := fun_731(txt, a_fmiModelVariable, a_what);
26439 then txt;
26440 end match;
26441 end fun_732;
26442
26443 protected function fun_733
26444 input Tpl.Text in_txt;
26445 input Boolean in_mArg;
26446 input String in_a_name;
26447
26448 output Tpl.Text out_txt;
26449 algorithm
26450 out_txt :=
26451 match(in_txt, in_mArg, in_a_name)
26452 local
26453 Tpl.Text txt;
26454 String a_name;
26455
26456 case ( txt,
26457 false,
26458 _ )
26459 then txt;
26460
26461 case ( txt,
26462 _,
26463 a_name )
26464 algorithm
26465 4 txt := Tpl.writeStr(txt, a_name);
26466 then txt;
26467 end match;
26468 end fun_733;
26469
26470 protected function fun_734
26471 input Tpl.Text in_txt;
26472 input Boolean in_mArg;
26473 input Real in_a_valueReference;
26474 input String in_a_name;
26475 input Integer in_a_what;
26476
26477 output Tpl.Text out_txt;
26478 algorithm
26479 out_txt :=
26480 match(in_txt, in_mArg, in_a_valueReference, in_a_name, in_a_what)
26481 local
26482 Tpl.Text txt;
26483 Real a_valueReference;
26484 String a_name;
26485 Integer a_what;
26486 Boolean ret_0;
26487
26488 case ( txt,
26489 false,
26490 _,
26491 a_name,
26492 a_what )
26493 algorithm
26494 4 ret_0 := intEq(a_what, 2);
26495 4 txt := fun_733(txt, ret_0, a_name);
26496 then txt;
26497
26498 case ( txt,
26499 _,
26500 a_valueReference,
26501 _,
26502 _ )
26503 algorithm
26504 4 txt := Tpl.writeStr(txt, realString(a_valueReference));
26505 then txt;
26506 end match;
26507 end fun_734;
26508
26509 protected function fun_735
26510 input Tpl.Text in_txt;
26511 input FMI.ModelVariables in_a_fmiModelVariable;
26512 input Integer in_a_what;
26513
26514 output Tpl.Text out_txt;
26515 algorithm
26516 out_txt :=
26517 match(in_txt, in_a_fmiModelVariable, in_a_what)
26518 local
26519 Tpl.Text txt;
26520 Integer a_what;
26521 Real i_valueReference;
26522 String i_name;
26523 Boolean ret_0;
26524
26525 case ( txt,
26526 FMI.REALVARIABLE(variability = "parameter", hasStartValue = true, name = i_name, valueReference = i_valueReference),
26527 a_what )
26528 algorithm
26529 8 ret_0 := intEq(a_what, 1);
26530 8 txt := fun_734(txt, ret_0, i_valueReference, i_name, a_what);
26531 then txt;
26532
26533 case ( txt,
26534 _,
26535 _ )
26536 then txt;
26537 end match;
26538 end fun_735;
26539
26540 protected function fun_736
26541 input Tpl.Text in_txt;
26542 input Boolean in_mArg;
26543 input Integer in_a_what;
26544 input FMI.ModelVariables in_a_fmiModelVariable;
26545 input String in_a_fmiVersion;
26546
26547 output Tpl.Text out_txt;
26548 algorithm
26549 out_txt :=
26550 match(in_txt, in_mArg, in_a_what, in_a_fmiModelVariable, in_a_fmiVersion)
26551 local
26552 Tpl.Text txt;
26553 Integer a_what;
26554 FMI.ModelVariables a_fmiModelVariable;
26555 String a_fmiVersion;
26556 Boolean ret_0;
26557
26558 case ( txt,
26559 false,
26560 a_what,
26561 a_fmiModelVariable,
26562 a_fmiVersion )
26563 algorithm
26564
3/4
✓ Branch 0 taken 1244 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 12 times.
✓ Branch 4 taken 1232 times.
1244 ret_0 := stringEq(a_fmiVersion, "2.0");
26565 1244 txt := fun_732(txt, ret_0, a_what, a_fmiModelVariable, a_fmiVersion);
26566 then txt;
26567
26568 case ( txt,
26569 _,
26570 a_what,
26571 a_fmiModelVariable,
26572 _ )
26573 algorithm
26574 38 txt := fun_735(txt, a_fmiModelVariable, a_what);
26575 then txt;
26576 end match;
26577 end fun_736;
26578
26579 protected function fun_737
26580 input Tpl.Text in_txt;
26581 input Boolean in_mArg;
26582 input FMI.ModelVariables in_a_fmiModelVariable;
26583 input String in_a_type;
26584 input String in_a_variabilityCausality;
26585 input Boolean in_a_dependent;
26586 input Integer in_a_what;
26587 input String in_a_fmiVersion;
26588
26589 output Tpl.Text out_txt;
26590 algorithm
26591 out_txt :=
26592 match(in_txt, in_mArg, in_a_fmiModelVariable, in_a_type, in_a_variabilityCausality, in_a_dependent, in_a_what, in_a_fmiVersion)
26593 local
26594 Tpl.Text txt;
26595 FMI.ModelVariables a_fmiModelVariable;
26596 String a_type;
26597 String a_variabilityCausality;
26598 Boolean a_dependent;
26599 Integer a_what;
26600 String a_fmiVersion;
26601 Boolean ret_5;
26602 Boolean ret_4;
26603 Boolean ret_3;
26604 Boolean ret_2;
26605 Boolean ret_1;
26606 Boolean ret_0;
26607
26608 case ( txt,
26609 false,
26610 a_fmiModelVariable,
26611 a_type,
26612 a_variabilityCausality,
26613 a_dependent,
26614 a_what,
26615 a_fmiVersion )
26616 algorithm
26617
4/4
✓ Branch 0 taken 15270 times.
✓ Branch 1 taken 13988 times.
✓ Branch 3 taken 7635 times.
✓ Branch 4 taken 7635 times.
29258 ret_0 := stringEq(a_type, "integer");
26618
3/4
✓ Branch 0 taken 8974 times.
✓ Branch 1 taken 20284 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8974 times.
29258 ret_1 := stringEq(a_variabilityCausality, "parameter");
26619 29258 ret_2 := boolNot(a_dependent);
26620 29258 ret_3 := boolAnd(ret_1, ret_2);
26621 29258 ret_4 := boolAnd(ret_0, ret_3);
26622 29258 txt := fun_724(txt, ret_4, a_fmiVersion, a_what, a_fmiModelVariable, a_dependent, a_variabilityCausality, a_type);
26623 then txt;
26624
26625 case ( txt,
26626 _,
26627 a_fmiModelVariable,
26628 _,
26629 _,
26630 _,
26631 a_what,
26632 a_fmiVersion )
26633 algorithm
26634
3/4
✓ Branch 0 taken 1282 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1244 times.
✓ Branch 4 taken 38 times.
1282 ret_5 := stringEq(a_fmiVersion, "1.0");
26635 1282 txt := fun_736(txt, ret_5, a_what, a_fmiModelVariable, a_fmiVersion);
26636 then txt;
26637 end match;
26638 end fun_737;
26639
26640 public function dumpVariable
26641 input Tpl.Text txt;
26642 input FMI.ModelVariables a_fmiModelVariable;
26643 input String a_type;
26644 input String a_variabilityCausality;
26645 input Boolean a_dependent;
26646 input Integer a_what;
26647 input String a_fmiVersion;
26648
26649 output Tpl.Text out_txt;
26650 protected
26651 Boolean ret_4;
26652 Boolean ret_3;
26653 Boolean ret_2;
26654 Boolean ret_1;
26655 Boolean ret_0;
26656 algorithm
26657
3/4
✓ Branch 0 taken 7635 times.
✓ Branch 1 taken 22905 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7635 times.
30540 ret_0 := stringEq(a_type, "real");
26658
3/4
✓ Branch 0 taken 10256 times.
✓ Branch 1 taken 20284 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10256 times.
30540 ret_1 := stringEq(a_variabilityCausality, "parameter");
26659 30540 ret_2 := boolNot(a_dependent);
26660 30540 ret_3 := boolAnd(ret_1, ret_2);
26661 30540 ret_4 := boolAnd(ret_0, ret_3);
26662 30540 out_txt := fun_737(txt, ret_4, a_fmiModelVariable, a_type, a_variabilityCausality, a_dependent, a_what, a_fmiVersion);
26663 end dumpVariable;
26664
26665 protected function lm_739
26666 input output Tpl.Text txt;
26667 input list<FMI.ModelVariables> items;
26668 input String a_fmiInstance;
26669 input String a_fmiGetFunction;
26670 input list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
26671 algorithm
26672
2/2
✓ Branch 0 taken 636 times.
✓ Branch 1 taken 17 times.
653 for lstElt_739 in items loop
26673 txt := match lstElt_739
26674 local
26675 FMI.ModelVariables i_fmiModelVariable;
26676
26677 case i_fmiModelVariable
26678 algorithm
26679 636 txt := dumpOutputGetEnumerationVariable(txt, i_fmiModelVariable, a_fmiTypeDefinitionsList, a_fmiGetFunction, a_fmiInstance);
26680 then txt;
26681 end match;
26682 end for;
26683 end lm_739;
26684
26685 public function dumpOutputGetEnumerationVariables
26686 input Tpl.Text txt;
26687 input list<FMI.ModelVariables> a_fmiModelVariablesList;
26688 input list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
26689 input String a_fmiGetFunction;
26690 input String a_fmiInstance;
26691
26692 output Tpl.Text out_txt;
26693 algorithm
26694 17 out_txt := lm_739(txt, a_fmiModelVariablesList, a_fmiInstance, a_fmiGetFunction, a_fmiTypeDefinitionsList);
26695 end dumpOutputGetEnumerationVariables;
26696
26697 public function dumpOutputGetEnumerationVariable
26698 input Tpl.Text in_txt;
26699 input FMI.ModelVariables in_a_fmiModelVariable;
26700 input list<FMI.TypeDefinitions> in_a_fmiTypeDefinitionsList;
26701 input String in_a_fmiGetFunction;
26702 input String in_a_fmiInstance;
26703
26704 output Tpl.Text out_txt;
26705 algorithm
26706 out_txt :=
26707 match(in_txt, in_a_fmiModelVariable, in_a_fmiTypeDefinitionsList, in_a_fmiGetFunction, in_a_fmiInstance)
26708 local
26709 Tpl.Text txt;
26710 list<FMI.TypeDefinitions> a_fmiTypeDefinitionsList;
26711 String a_fmiGetFunction;
26712 String a_fmiInstance;
26713 Integer i_valueReference_1;
26714 Real i_valueReference;
26715 String i_baseType;
26716 String i_name;
26717 String ret_3;
26718 String ret_2;
26719 String ret_1;
26720 String ret_0;
26721
26722 case ( txt,
26723 FMI.ENUMERATIONVARIABLE(variability = "", causality = "", name = i_name, baseType = i_baseType, valueReference = i_valueReference),
26724 a_fmiTypeDefinitionsList,
26725 a_fmiGetFunction,
26726 a_fmiInstance )
26727 algorithm
26728 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
26729 10 txt := Tpl.writeStr(txt, i_name);
26730 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = map_"));
26731 10 ret_0 := FMI.getEnumerationTypeFromTypes(a_fmiTypeDefinitionsList, i_baseType);
26732 10 txt := Tpl.writeStr(txt, ret_0);
26733 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_from_integers("));
26734 10 txt := Tpl.writeStr(txt, a_fmiGetFunction);
26735 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
26736 10 txt := Tpl.writeStr(txt, a_fmiInstance);
26737 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", {"));
26738 10 txt := Tpl.writeStr(txt, realString(i_valueReference));
26739 10 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs));"));
26740 10 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
26741 then txt;
26742
26743 case ( txt,
26744 FMI.ENUMERATIONVARIABLE(variability = "", causality = "output", name = i_name, baseType = i_baseType, valueReference = i_valueReference),
26745 a_fmiTypeDefinitionsList,
26746 a_fmiGetFunction,
26747 a_fmiInstance )
26748 algorithm
26749 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
26750 ✗ txt := Tpl.writeStr(txt, i_name);
26751 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = map_"));
26752 ✗ ret_1 := FMI.getEnumerationTypeFromTypes(a_fmiTypeDefinitionsList, i_baseType);
26753 ✗ txt := Tpl.writeStr(txt, ret_1);
26754 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("_from_integers("));
26755 ✗ txt := Tpl.writeStr(txt, a_fmiGetFunction);
26756 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
26757 ✗ txt := Tpl.writeStr(txt, a_fmiInstance);
26758 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", {"));
26759 ✗ txt := Tpl.writeStr(txt, realString(i_valueReference));
26760 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs));"));
26761 ✗ txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
26762 then txt;
26763
26764 case ( txt,
26765 FMI.FMI3ENUMERATIONVARIABLE(variability = "", causality = "", name = i_name, baseType = i_baseType, valueReference = i_valueReference_1),
26766 a_fmiTypeDefinitionsList,
26767 a_fmiGetFunction,
26768 a_fmiInstance )
26769 algorithm
26770 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
26771 ✗ txt := Tpl.writeStr(txt, i_name);
26772 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = map_"));
26773 ✗ ret_2 := FMI.getEnumerationTypeFromTypes(a_fmiTypeDefinitionsList, i_baseType);
26774 ✗ txt := Tpl.writeStr(txt, ret_2);
26775 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("_from_integers("));
26776 ✗ txt := Tpl.writeStr(txt, a_fmiGetFunction);
26777 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
26778 ✗ txt := Tpl.writeStr(txt, a_fmiInstance);
26779 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", {"));
26780 ✗ txt := Tpl.writeStr(txt, intString(i_valueReference_1));
26781 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs));"));
26782 ✗ txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
26783 then txt;
26784
26785 case ( txt,
26786 FMI.FMI3ENUMERATIONVARIABLE(variability = "", causality = "output", name = i_name, baseType = i_baseType, valueReference = i_valueReference_1),
26787 a_fmiTypeDefinitionsList,
26788 a_fmiGetFunction,
26789 a_fmiInstance )
26790 algorithm
26791 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
26792 ✗ txt := Tpl.writeStr(txt, i_name);
26793 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("} = map_"));
26794 ✗ ret_3 := FMI.getEnumerationTypeFromTypes(a_fmiTypeDefinitionsList, i_baseType);
26795 ✗ txt := Tpl.writeStr(txt, ret_3);
26796 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("_from_integers("));
26797 ✗ txt := Tpl.writeStr(txt, a_fmiGetFunction);
26798 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
26799 ✗ txt := Tpl.writeStr(txt, a_fmiInstance);
26800 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", {"));
26801 ✗ txt := Tpl.writeStr(txt, intString(i_valueReference_1));
26802 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}, flowStatesInputs));"));
26803 ✗ txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
26804 then txt;
26805
26806 case ( txt,
26807 _,
26808 _,
26809 _,
26810 _ )
26811 then txt;
26812 end match;
26813 end dumpOutputGetEnumerationVariable;
26814
26815 protected function lm_742
26816 input output Tpl.Text txt;
26817 input list<SimCodeVar.SimVar> items;
26818 algorithm
26819
2/2
✓ Branch 0 taken 101 times.
✓ Branch 1 taken 82 times.
183 for lstElt_742 in items loop
26820 txt := match lstElt_742
26821 local
26822 SimCodeVar.SimVar i_var;
26823
26824 case i_var
26825 algorithm
26826 101 txt := ScalarVariableFMU(txt, i_var, "realVarsData");
26827 101 txt := Tpl.nextIter(txt);
26828 then txt;
26829 end match;
26830 end for;
26831 end lm_742;
26832
26833 protected function lm_743
26834 input output Tpl.Text txt;
26835 input list<SimCodeVar.SimVar> items;
26836 algorithm
26837
2/2
✓ Branch 0 taken 101 times.
✓ Branch 1 taken 82 times.
183 for lstElt_743 in items loop
26838 txt := match lstElt_743
26839 local
26840 SimCodeVar.SimVar i_var;
26841
26842 case i_var
26843 algorithm
26844 101 txt := ScalarVariableFMU(txt, i_var, "realVarsData");
26845 101 txt := Tpl.nextIter(txt);
26846 then txt;
26847 end match;
26848 end for;
26849 end lm_743;
26850
26851 protected function lm_744
26852 input output Tpl.Text txt;
26853 input list<SimCodeVar.SimVar> items;
26854 algorithm
26855
2/2
✓ Branch 0 taken 3639 times.
✓ Branch 1 taken 82 times.
3721 for lstElt_744 in items loop
26856 txt := match lstElt_744
26857 local
26858 SimCodeVar.SimVar i_var;
26859
26860 case i_var
26861 algorithm
26862 3639 txt := ScalarVariableFMU(txt, i_var, "realVarsData");
26863 3639 txt := Tpl.nextIter(txt);
26864 then txt;
26865 end match;
26866 end for;
26867 end lm_744;
26868
26869 protected function lm_745
26870 input output Tpl.Text txt;
26871 input list<SimCodeVar.SimVar> items;
26872 algorithm
26873
2/2
✓ Branch 0 taken 248 times.
✓ Branch 1 taken 82 times.
330 for lstElt_745 in items loop
26874 txt := match lstElt_745
26875 local
26876 SimCodeVar.SimVar i_var;
26877
26878 case i_var
26879 algorithm
26880 248 txt := ScalarVariableFMU(txt, i_var, "realVarsData");
26881 248 txt := Tpl.nextIter(txt);
26882 then txt;
26883 end match;
26884 end for;
26885 end lm_745;
26886
26887 protected function lm_746
26888 input output Tpl.Text txt;
26889 input list<SimCodeVar.SimVar> items;
26890 algorithm
26891
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 82 times.
82 for lstElt_746 in items loop
26892 txt := match lstElt_746
26893 local
26894 SimCodeVar.SimVar i_var;
26895
26896 case i_var
26897 algorithm
26898 ✗ txt := ScalarVariableFMU(txt, i_var, "realVarsData");
26899 ✗ txt := Tpl.nextIter(txt);
26900 then txt;
26901 end match;
26902 end for;
26903 end lm_746;
26904
26905 protected function lm_747
26906 input output Tpl.Text txt;
26907 input list<SimCodeVar.SimVar> items;
26908 algorithm
26909
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 82 times.
82 for lstElt_747 in items loop
26910 txt := match lstElt_747
26911 local
26912 SimCodeVar.SimVar i_var;
26913
26914 case i_var
26915 algorithm
26916 ✗ txt := ScalarVariableFMU(txt, i_var, "realVarsData");
26917 ✗ txt := Tpl.nextIter(txt);
26918 then txt;
26919 end match;
26920 end for;
26921 end lm_747;
26922
26923 protected function lm_748
26924 input output Tpl.Text txt;
26925 input list<SimCodeVar.SimVar> items;
26926 algorithm
26927
2/2
✓ Branch 0 taken 2078 times.
✓ Branch 1 taken 82 times.
2160 for lstElt_748 in items loop
26928 txt := match lstElt_748
26929 local
26930 SimCodeVar.SimVar i_var;
26931
26932 case i_var
26933 algorithm
26934 2078 txt := ScalarVariableFMU(txt, i_var, "realParameterData");
26935 2078 txt := Tpl.nextIter(txt);
26936 then txt;
26937 end match;
26938 end for;
26939 end lm_748;
26940
26941 protected function lm_749
26942 input output Tpl.Text txt;
26943 input list<SimCodeVar.SimVar> items;
26944 algorithm
26945
2/2
✓ Branch 0 taken 163 times.
✓ Branch 1 taken 82 times.
245 for lstElt_749 in items loop
26946 txt := match lstElt_749
26947 local
26948 SimCodeVar.SimVar i_var;
26949
26950 case i_var
26951 algorithm
26952 163 txt := ScalarVariableFMU(txt, i_var, "integerVarsData");
26953 163 txt := Tpl.nextIter(txt);
26954 then txt;
26955 end match;
26956 end for;
26957 end lm_749;
26958
26959 protected function lm_750
26960 input output Tpl.Text txt;
26961 input list<SimCodeVar.SimVar> items;
26962 algorithm
26963
2/2
✓ Branch 0 taken 164 times.
✓ Branch 1 taken 82 times.
246 for lstElt_750 in items loop
26964 txt := match lstElt_750
26965 local
26966 SimCodeVar.SimVar i_var;
26967
26968 case i_var
26969 algorithm
26970 164 txt := ScalarVariableFMU(txt, i_var, "integerParameterData");
26971 164 txt := Tpl.nextIter(txt);
26972 then txt;
26973 end match;
26974 end for;
26975 end lm_750;
26976
26977 protected function lm_751
26978 input output Tpl.Text txt;
26979 input list<SimCodeVar.SimVar> items;
26980 algorithm
26981
2/2
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 82 times.
98 for lstElt_751 in items loop
26982 txt := match lstElt_751
26983 local
26984 SimCodeVar.SimVar i_var;
26985
26986 case i_var
26987 algorithm
26988 16 txt := ScalarVariableFMU(txt, i_var, "booleanVarsData");
26989 16 txt := Tpl.nextIter(txt);
26990 then txt;
26991 end match;
26992 end for;
26993 end lm_751;
26994
26995 protected function lm_752
26996 input output Tpl.Text txt;
26997 input list<SimCodeVar.SimVar> items;
26998 algorithm
26999
2/2
✓ Branch 0 taken 195 times.
✓ Branch 1 taken 82 times.
277 for lstElt_752 in items loop
27000 txt := match lstElt_752
27001 local
27002 SimCodeVar.SimVar i_var;
27003
27004 case i_var
27005 algorithm
27006 195 txt := ScalarVariableFMU(txt, i_var, "booleanParameterData");
27007 195 txt := Tpl.nextIter(txt);
27008 then txt;
27009 end match;
27010 end for;
27011 end lm_752;
27012
27013 protected function lm_753
27014 input output Tpl.Text txt;
27015 input list<SimCodeVar.SimVar> items;
27016 algorithm
27017
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 82 times.
85 for lstElt_753 in items loop
27018 txt := match lstElt_753
27019 local
27020 SimCodeVar.SimVar i_var;
27021
27022 case i_var
27023 algorithm
27024 3 txt := ScalarVariableFMU(txt, i_var, "stringVarsData");
27025 3 txt := Tpl.nextIter(txt);
27026 then txt;
27027 end match;
27028 end for;
27029 end lm_753;
27030
27031 protected function lm_754
27032 input output Tpl.Text txt;
27033 input list<SimCodeVar.SimVar> items;
27034 algorithm
27035
2/2
✓ Branch 0 taken 126 times.
✓ Branch 1 taken 82 times.
208 for lstElt_754 in items loop
27036 txt := match lstElt_754
27037 local
27038 SimCodeVar.SimVar i_var;
27039
27040 case i_var
27041 algorithm
27042 126 txt := ScalarVariableFMU(txt, i_var, "stringParameterData");
27043 126 txt := Tpl.nextIter(txt);
27044 then txt;
27045 end match;
27046 end for;
27047 end lm_754;
27048
27049 protected function fun_755
27050 input Tpl.Text in_txt;
27051 input SimCode.SimCode in_a_simCode;
27052
27053 output Tpl.Text out_txt;
27054 algorithm
27055 out_txt :=
27056 match(in_txt, in_a_simCode)
27057 local
27058 Tpl.Text txt;
27059 list<SimCodeVar.SimVar> i_vars_stringParamVars;
27060 list<SimCodeVar.SimVar> i_vars_stringAlgVars;
27061 list<SimCodeVar.SimVar> i_vars_boolParamVars;
27062 list<SimCodeVar.SimVar> i_vars_boolAlgVars;
27063 list<SimCodeVar.SimVar> i_vars_intParamVars;
27064 list<SimCodeVar.SimVar> i_vars_intAlgVars;
27065 list<SimCodeVar.SimVar> i_vars_paramVars;
27066 list<SimCodeVar.SimVar> i_vars_realOptimizeFinalConstraintsVars;
27067 list<SimCodeVar.SimVar> i_vars_realOptimizeConstraintsVars;
27068 list<SimCodeVar.SimVar> i_vars_discreteAlgVars;
27069 list<SimCodeVar.SimVar> i_vars_algVars;
27070 list<SimCodeVar.SimVar> i_vars_derivativeVars;
27071 list<SimCodeVar.SimVar> i_vars_stateVars;
27072 String i_makefileParams_omhome;
27073 String i_s_variableFilter;
27074 String i_s_outputFormat;
27075 String i_s_method;
27076 Real i_s_tolerance;
27077 Real i_s_stepSize;
27078 Real i_s_stopTime;
27079 Real i_s_startTime;
27080 SimCode.SimCode i_simCode;
27081 Tpl.Text txt_1;
27082 Tpl.Text txt_0;
27083
27084 case ( txt,
27085 (i_simCode as SimCode.SIMCODE(modelInfo = SimCode.MODELINFO(functions = _, varInfo = SimCode.VARINFO(numZeroCrossings = _), vars = SimCodeVar.SIMVARS(stateVars = i_vars_stateVars, derivativeVars = i_vars_derivativeVars, algVars = i_vars_algVars, discreteAlgVars = i_vars_discreteAlgVars, realOptimizeConstraintsVars = i_vars_realOptimizeConstraintsVars, realOptimizeFinalConstraintsVars = i_vars_realOptimizeFinalConstraintsVars, paramVars = i_vars_paramVars, intAlgVars = i_vars_intAlgVars, intParamVars = i_vars_intParamVars, boolAlgVars = i_vars_boolAlgVars, boolParamVars = i_vars_boolParamVars, stringAlgVars = i_vars_stringAlgVars, stringParamVars = i_vars_stringParamVars)), simulationSettingsOpt = SOME(SimCode.SIMULATION_SETTINGS(startTime = i_s_startTime, stopTime = i_s_stopTime, stepSize = i_s_stepSize, tolerance = i_s_tolerance, method = i_s_method, outputFormat = i_s_outputFormat, variableFilter = i_s_variableFilter)), makefileParams = SimCodeFunction.MAKEFILE_PARAMS(omhome = i_makefileParams_omhome))) )
27086 algorithm
27087 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27088 "#include \"simulation_data.h\"\n",
27089 "#include \"util/real_array.h\"\n",
27090 "#include \"util/integer_array.h\"\n",
27091 "#include \"util/boolean_array.h\"\n",
27092 "#include \"util/string_array.h\"\n",
27093 "\n",
27094 "OMC_DISABLE_OPT\n",
27095 "\n",
27096 "void "
27097 }, false));
27098 82 txt_0 := CodegenUtilSimulation.modelNamePrefix(Tpl.emptyTxt, i_simCode);
27099 82 txt := CodegenUtil.symbolName(txt, Tpl.textString(txt_0), "read_simulation_info");
27100 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27101 "(SIMULATION_INFO* simulationInfo)\n",
27102 "{\n"
27103 }, true));
27104 82 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
27105 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("simulationInfo->startTime = "));
27106 82 txt := Tpl.writeStr(txt, realString(i_s_startTime));
27107 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27108 ";\n",
27109 "simulationInfo->stopTime = "
27110 }, false));
27111 82 txt := Tpl.writeStr(txt, realString(i_s_stopTime));
27112 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27113 ";\n",
27114 "simulationInfo->stepSize = "
27115 }, false));
27116 82 txt := Tpl.writeStr(txt, realString(i_s_stepSize));
27117 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27118 ";\n",
27119 "simulationInfo->tolerance = "
27120 }, false));
27121 82 txt := Tpl.writeStr(txt, realString(i_s_tolerance));
27122 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27123 ";\n",
27124 "/* Freed in deInitializeDataStruc, like the ones read from the init XML. */\n",
27125 "simulationInfo->solverMethod = GC_strdup(\""
27126 }, false));
27127 82 txt := Tpl.writeStr(txt, i_s_method);
27128 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27129 "\");\n",
27130 "simulationInfo->outputFormat = GC_strdup(\""
27131 }, false));
27132 82 txt := Tpl.writeStr(txt, i_s_outputFormat);
27133 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27134 "\");\n",
27135 "simulationInfo->variableFilter = GC_strdup(\""
27136 }, false));
27137 82 txt := Tpl.writeStr(txt, i_s_variableFilter);
27138 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27139 "\");\n",
27140 "simulationInfo->OPENMODELICAHOME = GC_strdup(\""
27141 }, false));
27142 82 txt := Tpl.writeStr(txt, i_makefileParams_omhome);
27143 82 txt := Tpl.writeTok(txt, Tpl.ST_LINE("\");\n"));
27144 82 txt := Tpl.popBlock(txt);
27145 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27146 "}\n",
27147 "\n",
27148 "void "
27149 }, false));
27150 82 txt_1 := CodegenUtilSimulation.modelNamePrefix(Tpl.emptyTxt, i_simCode);
27151 82 txt := CodegenUtil.symbolName(txt, Tpl.textString(txt_1), "read_input_fmu");
27152 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27153 "(MODEL_DATA* modelData)\n",
27154 "{\n"
27155 }, true));
27156 82 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
27157 82 System.tmpTickReset(1000);
27158 82 txt := Tpl.softNewLine(txt);
27159 82 System.tmpTickResetIndex(0, 2);
27160 82 txt := Tpl.softNewLine(txt);
27161 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27162 82 txt := lm_742(txt, i_vars_stateVars);
27163 82 txt := Tpl.popIter(txt);
27164 82 txt := Tpl.softNewLine(txt);
27165 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27166 82 txt := lm_743(txt, i_vars_derivativeVars);
27167 82 txt := Tpl.popIter(txt);
27168 82 txt := Tpl.softNewLine(txt);
27169 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27170 82 txt := lm_744(txt, i_vars_algVars);
27171 82 txt := Tpl.popIter(txt);
27172 82 txt := Tpl.softNewLine(txt);
27173 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27174 82 txt := lm_745(txt, i_vars_discreteAlgVars);
27175 82 txt := Tpl.popIter(txt);
27176 82 txt := Tpl.softNewLine(txt);
27177 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27178 82 txt := lm_746(txt, i_vars_realOptimizeConstraintsVars);
27179 82 txt := Tpl.popIter(txt);
27180 82 txt := Tpl.softNewLine(txt);
27181 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27182 82 txt := lm_747(txt, i_vars_realOptimizeFinalConstraintsVars);
27183 82 txt := Tpl.popIter(txt);
27184 82 txt := Tpl.softNewLine(txt);
27185 82 System.tmpTickResetIndex(0, 2);
27186 82 txt := Tpl.softNewLine(txt);
27187 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27188 82 txt := lm_748(txt, i_vars_paramVars);
27189 82 txt := Tpl.popIter(txt);
27190 82 txt := Tpl.softNewLine(txt);
27191 82 System.tmpTickResetIndex(0, 2);
27192 82 txt := Tpl.softNewLine(txt);
27193 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27194 82 txt := lm_749(txt, i_vars_intAlgVars);
27195 82 txt := Tpl.popIter(txt);
27196 82 txt := Tpl.softNewLine(txt);
27197 82 System.tmpTickResetIndex(0, 2);
27198 82 txt := Tpl.softNewLine(txt);
27199 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27200 82 txt := lm_750(txt, i_vars_intParamVars);
27201 82 txt := Tpl.popIter(txt);
27202 82 txt := Tpl.softNewLine(txt);
27203 82 System.tmpTickResetIndex(0, 2);
27204 82 txt := Tpl.softNewLine(txt);
27205 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27206 82 txt := lm_751(txt, i_vars_boolAlgVars);
27207 82 txt := Tpl.popIter(txt);
27208 82 txt := Tpl.softNewLine(txt);
27209 82 System.tmpTickResetIndex(0, 2);
27210 82 txt := Tpl.softNewLine(txt);
27211 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27212 82 txt := lm_752(txt, i_vars_boolParamVars);
27213 82 txt := Tpl.popIter(txt);
27214 82 txt := Tpl.softNewLine(txt);
27215 82 System.tmpTickResetIndex(0, 2);
27216 82 txt := Tpl.softNewLine(txt);
27217 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27218 82 txt := lm_753(txt, i_vars_stringAlgVars);
27219 82 txt := Tpl.popIter(txt);
27220 82 txt := Tpl.softNewLine(txt);
27221 82 System.tmpTickResetIndex(0, 2);
27222 82 txt := Tpl.softNewLine(txt);
27223 82 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27224 82 txt := lm_754(txt, i_vars_stringParamVars);
27225 82 txt := Tpl.popIter(txt);
27226 82 txt := Tpl.softNewLine(txt);
27227 82 System.tmpTickResetIndex(0, 2);
27228 82 txt := Tpl.softNewLine(txt);
27229 82 txt := Tpl.popBlock(txt);
27230 82 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
27231 then txt;
27232
27233 case ( txt,
27234 _ )
27235 then txt;
27236 end match;
27237 end fun_755;
27238
27239 public function simulationInitFunction
27240 input Tpl.Text txt;
27241 input SimCode.SimCode a_simCode;
27242 input String a_guid;
27243
27244 output Tpl.Text out_txt;
27245 algorithm
27246 82 out_txt := fun_755(txt, a_simCode);
27247 end simulationInitFunction;
27248
27249 protected function fun_757
27250 input Tpl.Text in_txt;
27251 input Boolean in_a_isReadOnly;
27252
27253 output Tpl.Text out_txt;
27254 algorithm
27255 out_txt :=
27256 match(in_txt, in_a_isReadOnly)
27257 local
27258 Tpl.Text txt;
27259
27260 case ( txt,
27261 false )
27262 algorithm
27263 6834 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
27264 then txt;
27265
27266 case ( txt,
27267 _ )
27268 algorithm
27269 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("1"));
27270 then txt;
27271 end match;
27272 end fun_757;
27273
27274 protected function fun_758
27275 input Tpl.Text in_txt;
27276 input SourceInfo in_a_info;
27277 input String in_a_str;
27278
27279 output Tpl.Text out_txt;
27280 algorithm
27281 out_txt :=
27282 match(in_txt, in_a_info, in_a_str)
27283 local
27284 Tpl.Text txt;
27285 String a_str;
27286 Boolean i_isReadOnly;
27287 Integer i_columnNumberEnd;
27288 Integer i_lineNumberEnd;
27289 Integer i_columnNumberStart;
27290 Integer i_lineNumberStart;
27291 String i_fileName;
27292 String ret_0;
27293
27294 case ( txt,
27295 SOURCEINFO(fileName = i_fileName, lineNumberStart = i_lineNumberStart, columnNumberStart = i_columnNumberStart, lineNumberEnd = i_lineNumberEnd, columnNumberEnd = i_columnNumberEnd, isReadOnly = i_isReadOnly),
27296 a_str )
27297 algorithm
27298 6834 txt := Tpl.writeStr(txt, a_str);
27299 6834 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".filename = \""));
27300 6834 ret_0 := Util.escapeModelicaStringToCString(i_fileName);
27301 6834 txt := Tpl.writeStr(txt, ret_0);
27302 6834 txt := Tpl.writeTok(txt, Tpl.ST_LINE("\";\n"));
27303 6834 txt := Tpl.writeStr(txt, a_str);
27304 6834 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".lineStart = "));
27305 6834 txt := Tpl.writeStr(txt, intString(i_lineNumberStart));
27306 6834 txt := Tpl.writeTok(txt, Tpl.ST_LINE(";\n"));
27307 6834 txt := Tpl.writeStr(txt, a_str);
27308 6834 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".colStart = "));
27309 6834 txt := Tpl.writeStr(txt, intString(i_columnNumberStart));
27310 6834 txt := Tpl.writeTok(txt, Tpl.ST_LINE(";\n"));
27311 6834 txt := Tpl.writeStr(txt, a_str);
27312 6834 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".lineEnd = "));
27313 6834 txt := Tpl.writeStr(txt, intString(i_lineNumberEnd));
27314 6834 txt := Tpl.writeTok(txt, Tpl.ST_LINE(";\n"));
27315 6834 txt := Tpl.writeStr(txt, a_str);
27316 6834 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".colEnd = "));
27317 6834 txt := Tpl.writeStr(txt, intString(i_columnNumberEnd));
27318 6834 txt := Tpl.writeTok(txt, Tpl.ST_LINE(";\n"));
27319 6834 txt := Tpl.writeStr(txt, a_str);
27320 6834 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".readonly = "));
27321 6834 txt := fun_757(txt, i_isReadOnly);
27322 6834 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
27323 then txt;
27324
27325 case ( txt,
27326 _,
27327 _ )
27328 then txt;
27329 end match;
27330 end fun_758;
27331
27332 public function getInfoArgsFMU
27333 input Tpl.Text txt;
27334 input String a_str;
27335 input SourceInfo a_info;
27336
27337 output Tpl.Text out_txt;
27338 algorithm
27339 6834 out_txt := fun_758(txt, a_info, a_str);
27340 end getInfoArgsFMU;
27341
27342 protected function fun_760
27343 input Tpl.Text in_txt;
27344 input String in_a_comment;
27345
27346 output Tpl.Text out_txt;
27347 algorithm
27348 out_txt :=
27349 match(in_txt, in_a_comment)
27350 local
27351 Tpl.Text txt;
27352 String i_comment;
27353 String ret_0;
27354
27355 case ( txt,
27356 "" )
27357 then txt;
27358
27359 case ( txt,
27360 i_comment )
27361 algorithm
27362 5917 ret_0 := Util.escapeModelicaStringToCString(i_comment);
27363 5917 txt := Tpl.writeStr(txt, ret_0);
27364 then txt;
27365 end match;
27366 end fun_760;
27367
27368 public function ScalarVariableFMU
27369 input Tpl.Text in_txt;
27370 input SimCodeVar.SimVar in_a_simVar;
27371 input String in_a_classType;
27372
27373 output Tpl.Text out_txt;
27374 algorithm
27375 out_txt :=
27376 match(in_txt, in_a_simVar, in_a_classType)
27377 local
27378 Tpl.Text txt;
27379 String a_classType;
27380 DAE.Type i_type__;
27381 Boolean i_isFixed;
27382 Option<DAE.Exp> i_nominalValue;
27383 Option<DAE.Exp> i_initialValue;
27384 Option<DAE.Exp> i_maxValue;
27385 Option<DAE.Exp> i_minValue;
27386 String i_displayUnit;
27387 String i_unit;
27388 SimCodeVar.SimVar i_simVar;
27389 SourceInfo i_info;
27390 DAE.ComponentRef i_name;
27391 String i_comment;
27392 Tpl.Text txt_9;
27393 String ret_8;
27394 Tpl.Text txt_7;
27395 Tpl.Text l_attrstr;
27396 Tpl.Text l_infostr;
27397 Tpl.Text l_description;
27398 Integer ret_3;
27399 Tpl.Text l_ci;
27400 Integer ret_1;
27401 Tpl.Text l_valueReference;
27402
27403 case ( txt,
27404 (i_simVar as SimCodeVar.SIMVAR(source = DAE.SOURCE(info = i_info), comment = i_comment, name = i_name, unit = i_unit, displayUnit = i_displayUnit, minValue = i_minValue, maxValue = i_maxValue, initialValue = i_initialValue, nominalValue = i_nominalValue, isFixed = i_isFixed, type_ = i_type__)),
27405 a_classType )
27406 algorithm
27407 6834 ret_1 := System.tmpTick();
27408 6834 l_valueReference := Tpl.writeStr(Tpl.emptyTxt, intString(ret_1));
27409 6834 ret_3 := System.tmpTickIndex(2);
27410 6834 l_ci := Tpl.writeStr(Tpl.emptyTxt, intString(ret_3));
27411 6834 l_description := fun_760(Tpl.emptyTxt, i_comment);
27412 6834 l_infostr := Tpl.writeTok(Tpl.emptyTxt, Tpl.ST_STRING("modelData->"));
27413 6834 l_infostr := Tpl.writeStr(l_infostr, a_classType);
27414 6834 l_infostr := Tpl.writeTok(l_infostr, Tpl.ST_STRING("["));
27415 6834 l_infostr := Tpl.writeText(l_infostr, l_ci);
27416 6834 l_infostr := Tpl.writeTok(l_infostr, Tpl.ST_STRING("].info"));
27417 6834 l_attrstr := Tpl.writeTok(Tpl.emptyTxt, Tpl.ST_STRING("modelData->"));
27418 6834 l_attrstr := Tpl.writeStr(l_attrstr, a_classType);
27419 6834 l_attrstr := Tpl.writeTok(l_attrstr, Tpl.ST_STRING("["));
27420 6834 l_attrstr := Tpl.writeText(l_attrstr, l_ci);
27421 6834 l_attrstr := Tpl.writeTok(l_attrstr, Tpl.ST_STRING("].attribute"));
27422 6834 txt := Tpl.writeText(txt, l_infostr);
27423 6834 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".id = "));
27424 6834 txt := Tpl.writeText(txt, l_valueReference);
27425 6834 txt := Tpl.writeTok(txt, Tpl.ST_LINE(";\n"));
27426 6834 txt := Tpl.writeText(txt, l_infostr);
27427 6834 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".name = \""));
27428 6834 txt_7 := CodegenUtil.crefStrNoUnderscore(Tpl.emptyTxt, i_name);
27429 6834 ret_8 := Util.escapeModelicaStringToCString(Tpl.textString(txt_7));
27430 6834 txt := Tpl.writeStr(txt, ret_8);
27431 6834 txt := Tpl.writeTok(txt, Tpl.ST_LINE("\";\n"));
27432 6834 txt := Tpl.writeText(txt, l_infostr);
27433 6834 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".comment = \""));
27434 6834 txt := Tpl.writeText(txt, l_description);
27435 6834 txt := Tpl.writeTok(txt, Tpl.ST_LINE("\";\n"));
27436 6834 txt_9 := Tpl.writeText(Tpl.emptyTxt, l_infostr);
27437 6834 txt_9 := Tpl.writeTok(txt_9, Tpl.ST_STRING(".info"));
27438 6834 txt := getInfoArgsFMU(txt, Tpl.textString(txt_9), i_info);
27439 6834 txt := Tpl.softNewLine(txt);
27440 6834 txt := DimensionsFMU(txt, i_simVar, a_classType, Tpl.textString(l_ci));
27441 6834 txt := Tpl.softNewLine(txt);
27442 6834 txt := ScalarVariableTypeFMU(txt, Tpl.textString(l_attrstr), i_unit, i_displayUnit, i_minValue, i_maxValue, i_initialValue, i_nominalValue, i_isFixed, i_type__);
27443 then txt;
27444
27445 case ( txt,
27446 _,
27447 _ )
27448 then txt;
27449 end match;
27450 end ScalarVariableFMU;
27451
27452 protected function lm_762
27453 input output Tpl.Text txt;
27454 input list<String> items;
27455 input String a_ci;
27456 input String a_classType;
27457 algorithm
27458
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 8 times.
16 for lstElt_762 in items loop
27459 txt := match lstElt_762
27460 local
27461 Integer x_k0;
27462 String i_d;
27463
27464 case i_d
27465 algorithm
27466 8 x_k0 := Tpl.getIteri_i0(txt);
27467 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("modelData->"));
27468 8 txt := Tpl.writeStr(txt, a_classType);
27469 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
27470 8 txt := Tpl.writeStr(txt, a_ci);
27471 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].dimension.dimensions["));
27472 8 txt := Tpl.writeStr(txt, intString(x_k0));
27473 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].start = "));
27474 8 txt := Tpl.writeStr(txt, i_d);
27475 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
27476 8 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
27477 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("modelData->"));
27478 8 txt := Tpl.writeStr(txt, a_classType);
27479 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
27480 8 txt := Tpl.writeStr(txt, a_ci);
27481 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].dimension.dimensions["));
27482 8 txt := Tpl.writeStr(txt, intString(x_k0));
27483 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].valueReference = -1;"));
27484 8 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
27485 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("modelData->"));
27486 8 txt := Tpl.writeStr(txt, a_classType);
27487 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
27488 8 txt := Tpl.writeStr(txt, a_ci);
27489 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].dimension.dimensions["));
27490 8 txt := Tpl.writeStr(txt, intString(x_k0));
27491 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].type = DIMENSION_BY_START;"));
27492 8 txt := Tpl.nextIter(txt);
27493 then txt;
27494 end match;
27495 end for;
27496 end lm_762;
27497
27498 protected function fun_763
27499 input Tpl.Text in_txt;
27500 input Boolean in_mArg;
27501 input list<String> in_a_dims;
27502 input String in_a_ci;
27503 input String in_a_classType;
27504
27505 output Tpl.Text out_txt;
27506 algorithm
27507 out_txt :=
27508 match(in_txt, in_mArg, in_a_dims, in_a_ci, in_a_classType)
27509 local
27510 Tpl.Text txt;
27511 list<String> a_dims;
27512 String a_ci;
27513 String a_classType;
27514 Integer ret_1;
27515 Integer ret_0;
27516
27517 case ( txt,
27518 false,
27519 a_dims,
27520 a_ci,
27521 a_classType )
27522 algorithm
27523 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("modelData->"));
27524 8 txt := Tpl.writeStr(txt, a_classType);
27525 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
27526 8 txt := Tpl.writeStr(txt, a_ci);
27527 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].dimension.numberOfDimensions = "));
27528 8 ret_0 := listLength(a_dims);
27529 8 txt := Tpl.writeStr(txt, intString(ret_0));
27530 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27531 ";\n",
27532 "modelData->"
27533 }, false));
27534 8 txt := Tpl.writeStr(txt, a_classType);
27535 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
27536 8 txt := Tpl.writeStr(txt, a_ci);
27537 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("].dimension.dimensions = (DIMENSION_ATTRIBUTE*)calloc("));
27538 8 ret_1 := listLength(a_dims);
27539 8 txt := Tpl.writeStr(txt, intString(ret_1));
27540 8 txt := Tpl.writeTok(txt, Tpl.ST_LINE(", sizeof(DIMENSION_ATTRIBUTE));\n"));
27541 8 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
27542 8 txt := lm_762(txt, a_dims, a_ci, a_classType);
27543 8 txt := Tpl.popIter(txt);
27544 then txt;
27545
27546 case ( txt,
27547 _,
27548 _,
27549 _,
27550 _ )
27551 then txt;
27552 end match;
27553 end fun_763;
27554
27555 public function DimensionsFMU
27556 input Tpl.Text in_txt;
27557 input SimCodeVar.SimVar in_a_simVar;
27558 input String in_a_classType;
27559 input String in_a_ci;
27560
27561 output Tpl.Text out_txt;
27562 algorithm
27563 out_txt :=
27564 match(in_txt, in_a_simVar, in_a_classType, in_a_ci)
27565 local
27566 Tpl.Text txt;
27567 String a_classType;
27568 String a_ci;
27569 list<String> i_dims;
27570 Boolean ret_0;
27571
27572 case ( txt,
27573 SimCodeVar.SIMVAR(type_ = DAE.T_ARRAY(ty = _), numArrayElement = i_dims),
27574 a_classType,
27575 a_ci )
27576 algorithm
27577 8 ret_0 := listEmpty(i_dims);
27578 8 txt := fun_763(txt, ret_0, i_dims, a_ci, a_classType);
27579 then txt;
27580
27581 case ( txt,
27582 _,
27583 _,
27584 _ )
27585 then txt;
27586 end match;
27587 end DimensionsFMU;
27588
27589 protected function fun_765
27590 input Tpl.Text in_txt;
27591 input Boolean in_a_bool;
27592
27593 output Tpl.Text out_txt;
27594 algorithm
27595 out_txt :=
27596 match(in_txt, in_a_bool)
27597 local
27598 Tpl.Text txt;
27599
27600 case ( txt,
27601 false )
27602 algorithm
27603 127 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
27604 then txt;
27605
27606 case ( txt,
27607 _ )
27608 algorithm
27609 78 txt := Tpl.writeTok(txt, Tpl.ST_STRING("1"));
27610 then txt;
27611 end match;
27612 end fun_765;
27613
27614 public function scalarValFMU
27615 input Tpl.Text in_txt;
27616 input DAE.Exp in_a_e;
27617 input String in_a_default;
27618
27619 output Tpl.Text out_txt;
27620 algorithm
27621 out_txt :=
27622 match(in_txt, in_a_e, in_a_default)
27623 local
27624 Tpl.Text txt;
27625 String a_default;
27626 DAE.Exp i_first;
27627 Integer i_index;
27628 Boolean i_bool;
27629 String i_string;
27630 Real i_real;
27631 Integer i_integer;
27632 String ret_0;
27633
27634 case ( txt,
27635 DAE.ICONST(integer = i_integer),
27636 _ )
27637 algorithm
27638 760 txt := Tpl.writeStr(txt, intString(i_integer));
27639 then txt;
27640
27641 case ( txt,
27642 DAE.RCONST(real = i_real),
27643 _ )
27644 algorithm
27645 4550 txt := Tpl.writeStr(txt, realString(i_real));
27646 then txt;
27647
27648 case ( txt,
27649 DAE.SCONST(string = i_string),
27650 _ )
27651 algorithm
27652 121 txt := Tpl.writeTok(txt, Tpl.ST_STRING("omc_string_new(\""));
27653 121 ret_0 := Util.escapeModelicaStringToCString(i_string);
27654 121 txt := Tpl.writeStr(txt, ret_0);
27655 121 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\")"));
27656 then txt;
27657
27658 case ( txt,
27659 DAE.BCONST(bool = i_bool),
27660 _ )
27661 algorithm
27662 205 txt := fun_765(txt, i_bool);
27663 then txt;
27664
27665 case ( txt,
27666 DAE.ENUM_LITERAL(index = i_index),
27667 _ )
27668 algorithm
27669 113 txt := Tpl.writeStr(txt, intString(i_index));
27670 then txt;
27671
27672 case ( txt,
27673 DAE.ARRAY(array = i_first :: _),
27674 a_default )
27675 algorithm
27676 3 txt := scalarValFMU(txt, i_first, a_default);
27677 then txt;
27678
27679 case ( txt,
27680 DAE.REDUCTION(expr = i_first),
27681 a_default )
27682 algorithm
27683 2 txt := scalarValFMU(txt, i_first, a_default);
27684 then txt;
27685
27686 case ( txt,
27687 _,
27688 a_default )
27689 algorithm
27690 1277 txt := Tpl.writeStr(txt, a_default);
27691 then txt;
27692 end match;
27693 end scalarValFMU;
27694
27695 public function optInitValFMU
27696 input Tpl.Text in_txt;
27697 input Option<DAE.Exp> in_a_exp;
27698 input String in_a_default;
27699
27700 output Tpl.Text out_txt;
27701 algorithm
27702 out_txt :=
27703 match(in_txt, in_a_exp, in_a_default)
27704 local
27705 Tpl.Text txt;
27706 String a_default;
27707 DAE.Exp i_e;
27708
27709 case ( txt,
27710 SOME(i_e),
27711 a_default )
27712 algorithm
27713 7026 txt := scalarValFMU(txt, i_e, a_default);
27714 then txt;
27715
27716 case ( txt,
27717 _,
27718 a_default )
27719 algorithm
27720 18963 txt := Tpl.writeStr(txt, a_default);
27721 then txt;
27722 end match;
27723 end optInitValFMU;
27724
27725 protected function fun_768
27726 input Tpl.Text in_txt;
27727 input Boolean in_a_isFixed;
27728
27729 output Tpl.Text out_txt;
27730 algorithm
27731 out_txt :=
27732 match(in_txt, in_a_isFixed)
27733 local
27734 Tpl.Text txt;
27735
27736 case ( txt,
27737 false )
27738 algorithm
27739 1258 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
27740 then txt;
27741
27742 case ( txt,
27743 _ )
27744 algorithm
27745 4909 txt := Tpl.writeTok(txt, Tpl.ST_STRING("1"));
27746 then txt;
27747 end match;
27748 end fun_768;
27749
27750 protected function fun_769
27751 input Tpl.Text in_txt;
27752 input Option<DAE.Exp> in_a_nominalValue;
27753
27754 output Tpl.Text out_txt;
27755 algorithm
27756 out_txt :=
27757 match(in_txt, in_a_nominalValue)
27758 local
27759 Tpl.Text txt;
27760
27761 case ( txt,
27762 NONE() )
27763 algorithm
27764 6086 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
27765 then txt;
27766
27767 case ( txt,
27768 _ )
27769 algorithm
27770 81 txt := Tpl.writeTok(txt, Tpl.ST_STRING("1"));
27771 then txt;
27772 end match;
27773 end fun_769;
27774
27775 protected function fun_770
27776 input Tpl.Text in_txt;
27777 input Boolean in_a_isFixed;
27778
27779 output Tpl.Text out_txt;
27780 algorithm
27781 out_txt :=
27782 match(in_txt, in_a_isFixed)
27783 local
27784 Tpl.Text txt;
27785
27786 case ( txt,
27787 false )
27788 algorithm
27789 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
27790 then txt;
27791
27792 case ( txt,
27793 _ )
27794 algorithm
27795 281 txt := Tpl.writeTok(txt, Tpl.ST_STRING("1"));
27796 then txt;
27797 end match;
27798 end fun_770;
27799
27800 protected function fun_771
27801 input Tpl.Text in_txt;
27802 input Boolean in_a_isFixed;
27803
27804 output Tpl.Text out_txt;
27805 algorithm
27806 out_txt :=
27807 match(in_txt, in_a_isFixed)
27808 local
27809 Tpl.Text txt;
27810
27811 case ( txt,
27812 false )
27813 algorithm
27814 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
27815 then txt;
27816
27817 case ( txt,
27818 _ )
27819 algorithm
27820 207 txt := Tpl.writeTok(txt, Tpl.ST_STRING("1"));
27821 then txt;
27822 end match;
27823 end fun_771;
27824
27825 protected function fun_772
27826 input Tpl.Text in_txt;
27827 input Boolean in_a_isFixed;
27828
27829 output Tpl.Text out_txt;
27830 algorithm
27831 out_txt :=
27832 match(in_txt, in_a_isFixed)
27833 local
27834 Tpl.Text txt;
27835
27836 case ( txt,
27837 false )
27838 algorithm
27839 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("0"));
27840 then txt;
27841
27842 case ( txt,
27843 _ )
27844 algorithm
27845 37 txt := Tpl.writeTok(txt, Tpl.ST_STRING("1"));
27846 then txt;
27847 end match;
27848 end fun_772;
27849
27850 protected function fun_773
27851 input Tpl.Text in_txt;
27852 input DAE.Type in_a_type__;
27853 input String in_a_attrstr;
27854 input String in_a_unit;
27855 input String in_a_displayUnit;
27856 input Option<DAE.Exp> in_a_minValue;
27857 input Option<DAE.Exp> in_a_maxValue;
27858 input Option<DAE.Exp> in_a_startValue;
27859 input Option<DAE.Exp> in_a_nominalValue;
27860 input Boolean in_a_isFixed;
27861
27862 output Tpl.Text out_txt;
27863 algorithm
27864 out_txt :=
27865 match(in_txt, in_a_type__, in_a_attrstr, in_a_unit, in_a_displayUnit, in_a_minValue, in_a_maxValue, in_a_startValue, in_a_nominalValue, in_a_isFixed)
27866 local
27867 Tpl.Text txt;
27868 String a_attrstr;
27869 String a_unit;
27870 String a_displayUnit;
27871 Option<DAE.Exp> a_minValue;
27872 Option<DAE.Exp> a_maxValue;
27873 Option<DAE.Exp> a_startValue;
27874 Option<DAE.Exp> a_nominalValue;
27875 Boolean a_isFixed;
27876 DAE.Type i_type__;
27877 DAE.Type i_ty;
27878 list<String> i_names;
27879 Tpl.Text txt_3;
27880 String ret_3;
27881 Integer ret_2;
27882 String ret_1;
27883 String ret_0;
27884
27885 case ( txt,
27886 DAE.T_REAL(varLst = _),
27887 a_attrstr,
27888 a_unit,
27889 a_displayUnit,
27890 a_minValue,
27891 a_maxValue,
27892 a_startValue,
27893 a_nominalValue,
27894 a_isFixed )
27895 algorithm
27896 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING("omc_string_move(&"));
27897 6167 txt := Tpl.writeStr(txt, a_attrstr);
27898 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".unit, omc_string_new(\""));
27899 6167 ret_0 := Util.escapeModelicaStringToCString(a_unit);
27900 6167 txt := Tpl.writeStr(txt, ret_0);
27901 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27902 "\"));\n",
27903 "omc_string_move(&"
27904 }, false));
27905 6167 txt := Tpl.writeStr(txt, a_attrstr);
27906 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".displayUnit, omc_string_new(\""));
27907 6167 ret_1 := Util.escapeModelicaStringToCString(a_displayUnit);
27908 6167 txt := Tpl.writeStr(txt, ret_1);
27909 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27910 "\"));\n",
27911 "put_real_element("
27912 }, false));
27913 6167 txt := optInitValFMU(txt, a_minValue, "-DBL_MAX");
27914 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &"));
27915 6167 txt := Tpl.writeStr(txt, a_attrstr);
27916 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27917 ".min);\n",
27918 "put_real_element("
27919 }, false));
27920 6167 txt := optInitValFMU(txt, a_maxValue, "DBL_MAX");
27921 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &"));
27922 6167 txt := Tpl.writeStr(txt, a_attrstr);
27923 6167 txt := Tpl.writeTok(txt, Tpl.ST_LINE(".max);\n"));
27924 6167 txt := Tpl.writeStr(txt, a_attrstr);
27925 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".fixed = "));
27926 6167 txt := fun_768(txt, a_isFixed);
27927 6167 txt := Tpl.writeTok(txt, Tpl.ST_LINE(";\n"));
27928 6167 txt := Tpl.writeStr(txt, a_attrstr);
27929 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".useNominal = "));
27930 6167 txt := fun_769(txt, a_nominalValue);
27931 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27932 ";\n",
27933 "put_real_element("
27934 }, false));
27935 6167 txt := optInitValFMU(txt, a_nominalValue, "1.0");
27936 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &"));
27937 6167 txt := Tpl.writeStr(txt, a_attrstr);
27938 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27939 ".nominal);\n",
27940 "put_real_element("
27941 }, false));
27942 6167 txt := optInitValFMU(txt, a_startValue, "0.0");
27943 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &"));
27944 6167 txt := Tpl.writeStr(txt, a_attrstr);
27945 6167 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".start);"));
27946 then txt;
27947
27948 case ( txt,
27949 DAE.T_INTEGER(varLst = _),
27950 a_attrstr,
27951 _,
27952 _,
27953 a_minValue,
27954 a_maxValue,
27955 a_startValue,
27956 _,
27957 a_isFixed )
27958 algorithm
27959 289 txt := Tpl.writeTok(txt, Tpl.ST_STRING("put_integer_element("));
27960 289 txt := optInitValFMU(txt, a_minValue, "-LONG_MAX");
27961 289 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &"));
27962 289 txt := Tpl.writeStr(txt, a_attrstr);
27963 289 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27964 ".min);\n",
27965 "put_integer_element("
27966 }, false));
27967 289 txt := optInitValFMU(txt, a_maxValue, "LONG_MAX");
27968 289 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &"));
27969 289 txt := Tpl.writeStr(txt, a_attrstr);
27970 289 txt := Tpl.writeTok(txt, Tpl.ST_LINE(".max);\n"));
27971 289 txt := Tpl.writeStr(txt, a_attrstr);
27972 289 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".fixed = "));
27973 289 txt := fun_770(txt, a_isFixed);
27974 289 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27975 ";\n",
27976 "put_integer_element("
27977 }, false));
27978 289 txt := optInitValFMU(txt, a_startValue, "0");
27979 289 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &"));
27980 289 txt := Tpl.writeStr(txt, a_attrstr);
27981 289 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".start);"));
27982 then txt;
27983
27984 case ( txt,
27985 DAE.T_BOOL(varLst = _),
27986 a_attrstr,
27987 _,
27988 _,
27989 _,
27990 _,
27991 a_startValue,
27992 _,
27993 a_isFixed )
27994 algorithm
27995 211 txt := Tpl.writeStr(txt, a_attrstr);
27996 211 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".fixed = "));
27997 211 txt := fun_771(txt, a_isFixed);
27998 211 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
27999 ";\n",
28000 "put_boolean_element("
28001 }, false));
28002 211 txt := optInitValFMU(txt, a_startValue, "0");
28003 211 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &"));
28004 211 txt := Tpl.writeStr(txt, a_attrstr);
28005 211 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".start);"));
28006 then txt;
28007
28008 case ( txt,
28009 DAE.T_STRING(varLst = _),
28010 a_attrstr,
28011 _,
28012 _,
28013 _,
28014 _,
28015 a_startValue,
28016 _,
28017 _ )
28018 algorithm
28019 129 txt := Tpl.writeTok(txt, Tpl.ST_STRING("omc_string_move((modelica_string*) "));
28020 129 txt := Tpl.writeStr(txt, a_attrstr);
28021 129 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".start.data, "));
28022 129 txt := optInitValFMU(txt, a_startValue, "omc_string_new(\"\")");
28023 129 txt := Tpl.writeTok(txt, Tpl.ST_STRING(");"));
28024 then txt;
28025
28026 case ( txt,
28027 DAE.T_ENUMERATION(names = i_names),
28028 a_attrstr,
28029 _,
28030 _,
28031 a_minValue,
28032 a_maxValue,
28033 a_startValue,
28034 _,
28035 a_isFixed )
28036 algorithm
28037 38 txt := Tpl.writeTok(txt, Tpl.ST_STRING("put_integer_element("));
28038 38 txt := optInitValFMU(txt, a_minValue, "1");
28039 38 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &"));
28040 38 txt := Tpl.writeStr(txt, a_attrstr);
28041 38 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
28042 ".min);\n",
28043 "put_integer_element("
28044 }, false));
28045 38 ret_2 := listLength(i_names);
28046 38 txt := optInitValFMU(txt, a_maxValue, intString(ret_2));
28047 38 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &"));
28048 38 txt := Tpl.writeStr(txt, a_attrstr);
28049 38 txt := Tpl.writeTok(txt, Tpl.ST_LINE(".max);\n"));
28050 38 txt := Tpl.writeStr(txt, a_attrstr);
28051 38 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".fixed = "));
28052 38 txt := fun_772(txt, a_isFixed);
28053 38 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
28054 ";\n",
28055 "put_integer_element("
28056 }, false));
28057 38 txt := optInitValFMU(txt, a_startValue, "0");
28058 38 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", 0, &"));
28059 38 txt := Tpl.writeStr(txt, a_attrstr);
28060 38 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".start);"));
28061 then txt;
28062
28063 case ( txt,
28064 DAE.T_ARRAY(ty = i_ty),
28065 a_attrstr,
28066 a_unit,
28067 a_displayUnit,
28068 a_minValue,
28069 a_maxValue,
28070 a_startValue,
28071 a_nominalValue,
28072 a_isFixed )
28073 algorithm
28074 8 txt := ScalarVariableTypeFMU(txt, a_attrstr, a_unit, a_displayUnit, a_minValue, a_maxValue, a_startValue, a_nominalValue, a_isFixed, i_ty);
28075 then txt;
28076
28077 case ( txt,
28078 i_type__,
28079 _,
28080 _,
28081 _,
28082 _,
28083 _,
28084 _,
28085 _,
28086 _ )
28087 algorithm
28088 ✗ txt_3 := Tpl.writeTok(Tpl.emptyTxt, Tpl.ST_STRING("ScalarVariableTypeFMU: "));
28089 ✗ ret_3 := TypesDump.unparseType(i_type__);
28090 ✗ txt_3 := Tpl.writeStr(txt_3, ret_3);
28091 ✗ txt := CodegenUtil.error(txt, Tpl.sourceInfo("CodegenFMU.tpl", 3927, 16), Tpl.textString(txt_3));
28092 then txt;
28093 end match;
28094 end fun_773;
28095
28096 public function ScalarVariableTypeFMU
28097 input Tpl.Text txt;
28098 input String a_attrstr;
28099 input String a_unit;
28100 input String a_displayUnit;
28101 input Option<DAE.Exp> a_minValue;
28102 input Option<DAE.Exp> a_maxValue;
28103 input Option<DAE.Exp> a_startValue;
28104 input Option<DAE.Exp> a_nominalValue;
28105 input Boolean a_isFixed;
28106 input DAE.Type a_type__;
28107
28108 output Tpl.Text out_txt;
28109 algorithm
28110 6842 out_txt := fun_773(txt, a_type__, a_attrstr, a_unit, a_displayUnit, a_minValue, a_maxValue, a_startValue, a_nominalValue, a_isFixed);
28111 end ScalarVariableTypeFMU;
28112
28113 annotation(__OpenModelica_Interface="codegen_fmu_c");
28114 end CodegenFMU;
28115