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 ...@@ -175,7 +175,26 @@ classdef SCDclass_expcode
rtwbuild(mynodeslx{1}); rtwbuild(mynodeslx{1});
end end
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 end
methods methods
...@@ -421,14 +440,10 @@ classdef SCDclass_expcode ...@@ -421,14 +440,10 @@ classdef SCDclass_expcode
obj.buildworkspacesimstruct; obj.buildworkspacesimstruct;
obj.buildworkspacetpstruct; obj.buildworkspacetpstruct;
%% Set Cache Folder for experimental code (avoid conflicts with other tmp files) % Set cache and codegen folders
CacheFolder = fullfile(fileparts(mfilename('fullpath')),'..','..',... SCDclass_expcode.setcachefolder(expcode);
'gencodes',sprintf('CacheFolder-%d',obj.maincode)); SCDclass_expcode.setcodegenfolder(expcode);
fprintf('Setting Simulink Cache folder to %s\n',CacheFolder)
Simulink.fileGenControl('set',...
'CacheFolder',CacheFolder,...
'createdir',true);
end end
function actualize(obj, shot, varargin) function actualize(obj, shot, varargin)
...@@ -591,14 +606,8 @@ classdef SCDclass_expcode ...@@ -591,14 +606,8 @@ classdef SCDclass_expcode
return return
end end
% set CodeGen folder for this expcode (allows fast rebuilding) % set CodeGen folder for this expcode (allows fast rebuilding)
CodeGenFolder = fullfile(fileparts(mfilename('fullpath')),'..','..',... SCDclass_expcode.set_cogegen_colder(obj.maincode)
'gencodes',sprintf('CodeGenFolder-%d',obj.maincode));
fprintf(' ...Setting code generation folder to %s\n',CodeGenFolder)
Simulink.fileGenControl('set',...
'CodeGenFolder',CodeGenFolder,...
'createdir',true);
% check env variable % check env variable
assert(~isempty(getenv('RTCCODE_LIBPATH')),'RTCCODE_LIBPATH environment variable needs to be defined to compile'); 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