]> rtime.felk.cvut.cz Git - ert_linux.git/blob - ert_linux/ert_linux_file_process.tlc
3f61f51f0b2faf65d3498e10ad2d3a93064be126
[ert_linux.git] / ert_linux / ert_linux_file_process.tlc
1 %%
2 %% linux_ert_target_generate_main.tlc
3 %%
4 %% description:
5 %%  TLC script which generates ert_main function according
6 %%  to the number of model tasks and bitrates.
7 %%
8 %% date: 2nd Feb 2009
9 %%
10 %% author: Lukas Hamacek
11 %% e-mail: hamacl1@fel.cvut.cz
12 %% Department of Control Engineering
13 %% Faculty of Electrical Engineering
14 %% Czech Technical University in Prague
15 %%
16 %% modifications:
17 %%  2009/2/2 - Lukas Hamacek
18 %%      creation of the file
19 %%
20 %%  2009/4/18 - Lukas Hamacek
21 %%      asynchronous sample times checked and removed from generation
22 %%
23
24 %assign ert_mainC = LibCreateSourceFile("Source", "Custom", "ert_main")
25
26 %assign ::modelName = CompiledModel.Name
27 %assign ::solverMode = CompiledModel.FixedStepOpts.SolverMode
28 %assign ::fundamentalStepSize = CompiledModel.FundamentalStepSize
29 %assign ::numSampleTimes = CompiledModel.NumSynchronousSampleTimes
30 %assign ::extMode = CompiledModel.ConfigSet.ExtMode
31
32 %% parse sample times and offsets
33 %assign j = 0
34 %foreach i = CompiledModel.NumSampleTimes
35     %if CompiledModel.SampleTime[i].Asynchronous == "no"
36         %assign ::sampleTime%<j> = CompiledModel.SampleTime[i].PeriodAndOffset[0]
37         %assign ::offset%<j> = CompiledModel.SampleTime[i].PeriodAndOffset[1]
38         %assign j = j+1
39     %endif
40 %endforeach
41
42 %% Single-tasking
43 /% %if solverMode == "SingleTasking" %/
44 /%     %include "linux_ert_target_singletasking_main.tlc" %/
45 /% %else %/
46 %% Multi-tasking
47     %include "ert_linux_multitasking_main.tlc"
48 /% %endif %/
49
50 %openfile buff
51 %<generateDeclarations()>
52 %closefile buff
53 %<LibSetSourceFileSection(ert_mainC, "Declarations", buff)>
54
55 %openfile buff
56 %<generateRtOneStep()>
57 %<generateMain()>
58 %closefile buff
59 %<LibSetSourceFileSection(ert_mainC, "Functions", buff)>
60
61 %% [EOF] linux_ert_target_generate_main.tlc