]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/blob - rpp/rpp/rpp_select_callback_handler.m
Improved documentation on the RPP Target library.
[pes-rpp/rpp-simulink.git] / rpp / rpp / rpp_select_callback_handler.m
1 % Copyright (C) 2013 Czech Technical University in Prague
2 %
3 % Authors:
4 %     - Carlos Jenkins <carlos@jenkins.co.cr>
5 %
6 % This program is free software; you can redistribute it and/or modify
7 % it under the terms of the GNU General Public License as published by
8 % the Free Software Foundation; either version 2 of the License, or
9 % (at your option) any later version.
10 %
11 % This program is distributed in the hope that it will be useful,
12 % but WITHOUT ANY WARRANTY; without even the implied warranty of
13 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 % GNU General Public License for more details.
15 %
16 % You should have received a copy of the GNU General Public License
17 % along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 %
19 % File : rpp_select_callback_handler.m
20 % Abstract:
21 %     RPP Target select callback handler.
22 %
23 %     This callback function is triggered whenever the user selects the target
24 %     in the System Target File Browser. Default values for Simulation and
25 %     configurations parameters are set. Some options are disabled if it is not
26 %     allowed to be changed by user.
27 %
28 % References:
29 %     rtw_ug.pdf p. 1211?
30
31
32 function rpp_select_callback_handler(hDlg, hSrc)
33
34     % Setup the hardware configuration
35     %slConfigUISetVal(hDlg, hSrc, 'ProdHWDeviceType', 'Texas Instruments->TMS570');
36
37     % The target is model reference compliant
38     slConfigUISetVal(hDlg, hSrc, 'ModelReferenceCompliant', 'on');
39     slConfigUISetEnabled(hDlg, hSrc, 'ModelReferenceCompliant', false);
40
41     % Set the target language to C and disable modification
42     slConfigUISetVal(hDlg, hSrc, 'TargetLang', 'C');
43     slConfigUISetEnabled(hDlg, hSrc, 'TargetLang', false);
44
45     % Configure solver
46     slConfigUISetVal(hDlg, hSrc, 'SolverType', 'Fixed-step');
47     slConfigUISetVal(hDlg, hSrc, 'Solver', 'FixedStepDiscrete');
48
49     % Hardware being used is the production hardware
50     slConfigUISetVal(hDlg, hSrc, 'ProdEqTarget', 'on');
51
52     % For real-time builds, we must generate ert_main.c
53     slConfigUISetVal(hDlg, hSrc, 'ERTCustomFileTemplate', 'rpp_file_process.tlc');
54     slConfigUISetVal(hDlg, hSrc, 'GenerateSampleERTMain', 'off');
55     slConfigUISetEnabled(hDlg, hSrc, 'GenerateSampleERTMain', false);
56
57     % Set the TargetLibSuffix
58     slConfigUISetVal(hDlg, hSrc, 'TargetLibSuffix', '.a');
59
60     % Configure PostCodeGen Command to execute
61     % (library code inclusion for compilation)
62     slConfigUISetVal(hDlg, hSrc, 'PostCodeGenCommand', ...
63         'rpp_lib_support(modelName, buildInfo)');
64
65 end
66