-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmac_file_process.tlc
35 lines (27 loc) · 1.03 KB
/
mac_file_process.tlc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
%selectfile NULL_FILE
%assign ert_mainC = LibCreateSourceFile("Source", "Custom", "ert_main")
%assign ::modelName = CompiledModel.Name
%assign ::solverMode = CompiledModel.FixedStepOpts.SolverMode
%assign ::fundamentalStepSize = CompiledModel.FundamentalStepSize
%assign ::numSampleTimes = CompiledModel.NumSynchronousSampleTimes
%assign ::extMode = CompiledModel.ConfigSet.ExtMode
%% parse sample times and offsets
%assign j = 0
%foreach i = CompiledModel.NumSampleTimes
%if CompiledModel.SampleTime[i].Asynchronous == "no"
%assign ::sampleTime%<j> = CompiledModel.SampleTime[i].PeriodAndOffset[0]
%assign ::offset%<j> = CompiledModel.SampleTime[i].PeriodAndOffset[1]
%assign j = j+1
%endif
%endforeach
%include "ert_mac_main.tlc"
%<DisableGenerateExampleMain()>
%openfile buff
%<generateDeclarations()>
%closefile buff
%<LibSetSourceFileSection(ert_mainC, "Declarations", buff)>
%openfile buff
%<generateRtOneStep()>
%<generateMain()>
%closefile buff
%<LibSetSourceFileSection(ert_mainC, "Functions", buff)>