]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blob - rpp/rpp/rpp_select_callback_handler.m
Change license to MIT
[jenkicar/rpp-simulink.git] / rpp / rpp / rpp_select_callback_handler.m
1 % Copyright (C) 2013-2014 Czech Technical University in Prague
2 %
3 % Authors:
4 %     - Carlos Jenkins <carlos@jenkins.co.cr>
5 %
6 % Permission is hereby granted, free of charge, to any person
7 % obtaining a copy of this software and associated documentation
8 % files (the "Software"), to deal in the Software without
9 % restriction, including without limitation the rights to use,
10 % copy, modify, merge, publish, distribute, sublicense, and/or sell
11 % copies of the Software, and to permit persons to whom the
12 % Software is furnished to do so, subject to the following
13 % conditions:
14
15 % The above copyright notice and this permission notice shall be
16 % included in all copies or substantial portions of the Software.
17
18 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 % EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20 % OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 % NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 % HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 % WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 % FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 % OTHER DEALINGS IN THE SOFTWARE.
26 %
27 % File : rpp_select_callback_handler.m
28 % Abstract:
29 %     RPP Target select callback handler.
30 %
31 %     This callback function is triggered whenever the user selects the target
32 %     in the System Target File Browser. Default values for Simulation and
33 %     configurations parameters are set. Some options are disabled if it is not
34 %     allowed to be changed by user.
35 %
36 % References:
37 %     rtw_ug.pdf p. 1211?
38
39
40 function rpp_select_callback_handler(hDlg, hSrc)
41
42     % The target is model reference compliant
43     slConfigUISetVal(hDlg, hSrc, 'ModelReferenceCompliant', 'on');
44     slConfigUISetEnabled(hDlg, hSrc, 'ModelReferenceCompliant', false);
45
46     % Set the target language to C and disable modification
47     slConfigUISetVal(hDlg, hSrc, 'TargetLang', 'C');
48     slConfigUISetEnabled(hDlg, hSrc, 'TargetLang', false);
49
50     % Configure solver
51     slConfigUISetVal(hDlg, hSrc, 'SolverType', 'Fixed-step');
52     slConfigUISetVal(hDlg, hSrc, 'Solver', 'FixedStepDiscrete');
53
54     % Hardware being used is the production hardware
55     slConfigUISetVal(hDlg, hSrc, 'ProdEqTarget', 'on');
56
57     % For real-time builds, we must generate ert_main.c
58     slConfigUISetVal(hDlg, hSrc, 'ERTCustomFileTemplate', 'rpp_file_process.tlc');
59     slConfigUISetVal(hDlg, hSrc, 'GenerateSampleERTMain', 'off');
60     slConfigUISetEnabled(hDlg, hSrc, 'GenerateSampleERTMain', false);
61
62     % Set the TargetLibSuffix
63     slConfigUISetVal(hDlg, hSrc, 'TargetLibSuffix', '.a');
64
65     % Interface
66     slConfigUISetVal(hDlg, hSrc, 'ExtModeMexArgs', ['1 ''ttyUSB0'' 115200']);
67
68     % Configure PostCodeGen Command to execute
69     % (library code inclusion for compilation)
70     %% Note: No longer needed with static library
71     %% Leaving here for future reference.
72     %%slConfigUISetVal(hDlg, hSrc, 'PostCodeGenCommand', ...
73     %%    'rpp_lib_support(modelName, buildInfo)');
74
75 end