-
Notifications
You must be signed in to change notification settings - Fork 0
/
pcssp_add_paths.m
40 lines (30 loc) · 1.25 KB
/
pcssp_add_paths.m
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
36
37
38
39
40
function pcssp_add_paths()
%% Script to setup paths for pcssp
%% close sldd's, if any
Simulink.data.dictionary.closeAll('-discard');
thispath = fileparts(mfilename('fullpath'));
addpath(genpath(fullfile(thispath,'configurations')));
addpath(genpath(fullfile(thispath,'src' )));
addpath(genpath(fullfile(thispath,'templates')));
addpath(genpath(fullfile(thispath,'testing')));
addpath(genpath(fullfile(thispath,'tools')));
addpath(thispath);
corepath = fullfile(thispath,'scdds-core' );
run(fullfile(corepath,'scdds_core_paths'));
%% Set paths for generated code and cache files
% set code generation and cache file location
gencodes = fullfile(fileparts(mfilename('fullpath')),'gencodes');
if ~logical(exist(gencodes,'dir'))
fprintf('folder %s does not exist, generating it',gencodes);
mkdir(gencodes);
end
fprintf('setting Simulink Cache and CodeGen folders in %s\n',gencodes)
CacheFolder = fullfile(gencodes,'CacheFolder');
CodeGenFolder = fullfile(gencodes,'CodeGenFolder');
pause(2); % keep this here because matlab is black magic
Simulink.fileGenControl('set',...
'CacheFolder',CacheFolder,...
'CodeGenFolder',CodeGenFolder,...
'createdir',true, ...
'CodeGenFolderStructure',Simulink.filegen.CodeGenFolderStructure.ModelSpecific);
end