]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/blob - rpp/rpp/rpp_select_callback_handler.m
Merge branch 'maint-rm48' into rm48/master
[pes-rpp/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 % This document contains proprietary information belonging to Czech
7 % Technical University in Prague. Passing on and copying of this
8 % document, and communication of its contents is not permitted
9 % without prior written authorization.
10 %
11 % File : rpp_select_callback_handler.m
12 % Abstract:
13 %     RPP Target select callback handler.
14 %
15 %     This callback function is triggered whenever the user selects the target
16 %     in the System Target File Browser. Default values for Simulation and
17 %     configurations parameters are set. Some options are disabled if it is not
18 %     allowed to be changed by user.
19 %
20 % References:
21 %     rtw_ug.pdf p. 1211?
22
23
24 function rpp_select_callback_handler(hDlg, hSrc)
25
26     % Setup the hardware configuration
27     %slConfigUISetVal(hDlg, hSrc, 'ProdHWDeviceType', 'Texas Instruments->RM48');
28
29     % The target is model reference compliant
30     slConfigUISetVal(hDlg, hSrc, 'ModelReferenceCompliant', 'on');
31     slConfigUISetEnabled(hDlg, hSrc, 'ModelReferenceCompliant', false);
32
33     % Set the target language to C and disable modification
34     slConfigUISetVal(hDlg, hSrc, 'TargetLang', 'C');
35     slConfigUISetEnabled(hDlg, hSrc, 'TargetLang', false);
36
37     % Configure solver
38     slConfigUISetVal(hDlg, hSrc, 'SolverType', 'Fixed-step');
39     slConfigUISetVal(hDlg, hSrc, 'Solver', 'FixedStepDiscrete');
40
41     % Hardware being used is the production hardware
42     slConfigUISetVal(hDlg, hSrc, 'ProdEqTarget', 'on');
43
44     % For real-time builds, we must generate ert_main.c
45     slConfigUISetVal(hDlg, hSrc, 'ERTCustomFileTemplate', 'rpp_file_process.tlc');
46     slConfigUISetVal(hDlg, hSrc, 'GenerateSampleERTMain', 'off');
47     slConfigUISetEnabled(hDlg, hSrc, 'GenerateSampleERTMain', false);
48
49     % Set the TargetLibSuffix
50     slConfigUISetVal(hDlg, hSrc, 'TargetLibSuffix', '.a');
51
52     % Interface
53     slConfigUISetVal(hDlg, hSrc, 'ExtModeMexArgs', ['1 ''ttyUSB0'' 115200']);
54
55     % Configure PostCodeGen Command to execute
56     % (library code inclusion for compilation)
57     %% Note: No longer needed with static library
58     %% Leaving here for future reference.
59     %%slConfigUISetVal(hDlg, hSrc, 'PostCodeGenCommand', ...
60     %%    'rpp_lib_support(modelName, buildInfo)');
61
62 end