0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 function varargout = getBuiltinModelSearchPaths(varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 % Get a list of user model directories
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 prefs = getappdata(0, 'LTPDApreferences');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 % support the old stand-alone built-in models directories
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 searchPaths = prefs.getModelsPrefs.getSearchPaths;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 paths = {};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 for kk=0:searchPaths.size-1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 paths = [paths {char(searchPaths.get(kk))}];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 % and add the new extension modules built-in models
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 searchPaths = prefs.getExtensionsPrefs.getSearchPaths;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 for kk=0:searchPaths.size-1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 paths = [paths {fullfile(char(searchPaths.get(kk)), 'models')}];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 % Always look in the system directory
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 loc = mfilename('fullpath');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 idx = strfind(loc, filesep);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 loc = loc(1:idx(end));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 loc = fullfile(loc, '..', '..', '..', 'm', 'built_in_models');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 paths = [reshape(paths, 1, []) {loc}];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 varargout{1} = paths;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 end |