Skip to content
Snippets Groups Projects
Commit 9c1df630 authored by Federico Felici's avatar Federico Felici
Browse files

Working version for Detachment Control

parent 32b7c0de
No related branches found
No related tags found
No related merge requests found
......@@ -175,7 +175,26 @@ classdef SCDclass_expcode
rtwbuild(mynodeslx{1});
end
end
function set_cache_folder(obj)
%% Set Cache Folder for experimental code (avoid conflicts with other tmp files)
CacheFolder = fullfile(fileparts(mfilename('fullpath')),'..','..',...
'gencodes',sprintf('CacheFolder-%d',obj.maincode));
fprintf('Setting Simulink Cache folder to %s\n',CacheFolder)
Simulink.fileGenControl('set',...
'CacheFolder',CacheFolder,...
'createdir',true);
end
function set_codegen_folder(obj)
CodeGenFolder = fullfile(fileparts(mfilename('fullpath')),'..','..',...
'gencodes',sprintf('CodeGenFolder-%d',obj.maincode));
fprintf(' ...Setting code generation folder to %s\n',CodeGenFolder)
Simulink.fileGenControl('set',...
'CodeGenFolder',CodeGenFolder,...
'createdir',true);
end
end
methods
......@@ -421,14 +440,10 @@ classdef SCDclass_expcode
obj.buildworkspacesimstruct;
obj.buildworkspacetpstruct;
%% Set Cache Folder for experimental code (avoid conflicts with other tmp files)
CacheFolder = fullfile(fileparts(mfilename('fullpath')),'..','..',...
'gencodes',sprintf('CacheFolder-%d',obj.maincode));
fprintf('Setting Simulink Cache folder to %s\n',CacheFolder)
Simulink.fileGenControl('set',...
'CacheFolder',CacheFolder,...
'createdir',true);
% Set cache and codegen folders
SCDclass_expcode.setcachefolder(expcode);
SCDclass_expcode.setcodegenfolder(expcode);
end
function actualize(obj, shot, varargin)
......@@ -591,14 +606,8 @@ classdef SCDclass_expcode
return
end
% set CodeGen folder for this expcode (allows fast rebuilding)
CodeGenFolder = fullfile(fileparts(mfilename('fullpath')),'..','..',...
'gencodes',sprintf('CodeGenFolder-%d',obj.maincode));
fprintf(' ...Setting code generation folder to %s\n',CodeGenFolder)
Simulink.fileGenControl('set',...
'CodeGenFolder',CodeGenFolder,...
'createdir',true);
% set CodeGen folder for this expcode (allows fast rebuilding)
SCDclass_expcode.set_cogegen_colder(obj.maincode)
% check env variable
assert(~isempty(getenv('RTCCODE_LIBPATH')),'RTCCODE_LIBPATH environment variable needs to be defined to compile');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment