%% %% linux_ert_target_generate_main.tlc %% %% description: %% TLC script which generates ert_main function according %% to the number of model tasks and bitrates. %% %% date: 2nd Feb 2009 %% %% author: Lukas Hamacek %% e-mail: hamacl1@fel.cvut.cz %% Department of Control Engineering %% Faculty of Electrical Engineering %% Czech Technical University in Prague %% %% modifications: %% 2009/2/2 - Lukas Hamacek %% creation of the file %% %% 2009/4/18 - Lukas Hamacek %% asynchronous sample times checked and removed from generation %% %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% = CompiledModel.SampleTime[i].PeriodAndOffset[0] %assign ::offset% = CompiledModel.SampleTime[i].PeriodAndOffset[1] %assign j = j+1 %endif %endforeach %% Single-tasking /% %if solverMode == "SingleTasking" %/ /% %include "linux_ert_target_singletasking_main.tlc" %/ /% %else %/ %% Multi-tasking %include "linux_ert_target_multitasking_main.tlc" /% %endif %/ %openfile buff % %closefile buff % %openfile buff % % %closefile buff % %% [EOF] linux_ert_target_generate_main.tlc