diff --git a/+neurostim/cic.m b/+neurostim/cic.m index 74f806ed..0792378d 100644 --- a/+neurostim/cic.m +++ b/+neurostim/cic.m @@ -579,13 +579,21 @@ function restoreTextPrefs(c) - - - function newOrder = order(c,varargin) - % pluginOrder = c.order([plugin1] [,plugin2] [,...]) - % Returns pluginOrder when no input is given. - % Inputs: lists name of plugins in the order they are requested - % to be executed in. + function newOrder = setPluginOrder(c,varargin) + % Set and return pluginOrder. + % + % pluginOrder = c.setPluginOrder([plugin1] [,plugin2] [,...]) + % + % Inputs: + % A list of plugin names in the order they are requested to + % be executed in. + % + % If called with no arguments, the plugin order will be reset + % to the default order, i.e., the order in which plugins were + % added to cic. + % + % Output: + % A list of plugin names reflecting the new plugin order. %If there is an existing order, preserve it, unless an empty %vector has been supplied (to clear it back to default order) @@ -954,7 +962,7 @@ function run(c,block1,varargin) end %% Set up order and blocks - order(c,c.pluginOrder); + setPluginOrder(c,c.pluginOrder); setupExperiment(c,block1,varargin{:}); % Force adaptive plugins assigned directly to parameters into @@ -1790,9 +1798,9 @@ function handleAdaptives(c) % the block design object(s) instead. This ensures the adaptive % plugins are updated correctly (by the block object(s)). - plgs = c.order; % *all* plugins + plgs = {c.pluginOrder.name}; % *all* plugins for ii = 1:numel(plgs) - plg = plgs{ii}; + plg = plgs{ii}; prms = prmsByClass(c.(plg),'neurostim.plugins.adaptive'); if isempty(prms) % no adaptive plugins/parameters diff --git a/demos/noiseGridDemo.m b/demos/noiseGridDemo.m index 1ccf548f..dd2132e0 100644 --- a/demos/noiseGridDemo.m +++ b/demos/noiseGridDemo.m @@ -122,7 +122,7 @@ function noiseGridDemo(varargin) myBlock.nrRepeats=10; %% Run the experiment. -c.order('disk','grid'); %Ignore this for now - we hope to remove the need for this. +c.setPluginOrder('disk','grid'); %Ignore this for now - we hope to remove the need for this. c.subject = 'easyD'; c.run(myBlock); diff --git a/demos/noiseHexGridDemo.m b/demos/noiseHexGridDemo.m index 72f6b860..4f412d4e 100644 --- a/demos/noiseHexGridDemo.m +++ b/demos/noiseHexGridDemo.m @@ -35,7 +35,7 @@ myBlock.nrRepeats = 10; % Run the experiment. -c.order('fix','noise'); +c.setPluginOrder('fix','noise'); c.subject = 'easyD'; c.run(myBlock); end diff --git a/demos/noiseRadialGridDemo.m b/demos/noiseRadialGridDemo.m index bbe7dfa9..3a85ac45 100644 --- a/demos/noiseRadialGridDemo.m +++ b/demos/noiseRadialGridDemo.m @@ -43,7 +43,7 @@ myBlock.nrRepeats=10; %% Run the experiment. -c.order('fix','grid'); %Ignore this for now - we hope to remove the need for this. +c.setPluginOrder('fix','grid'); %Ignore this for now - we hope to remove the need for this. c.subject = 'easyD'; c.run(myBlock); diff --git a/demos/saccadeIntanDemo.m b/demos/saccadeIntanDemo.m index 704b7fd6..2e218e08 100644 --- a/demos/saccadeIntanDemo.m +++ b/demos/saccadeIntanDemo.m @@ -155,6 +155,6 @@ function saccadeIntanDemo(varargin) myBlock=block('myBlock',myDesign); %Create a block of trials using the factorial. Type "help neurostim/block" for more options. myBlock.nrRepeats=1; %% Make sure the plugins are in the right order -c.order(['eye'],['saccade'],['sound'],['soundFeedback'],['mcc'],['fix'],['target'],['estim'],['estim2'],['intan']); %#ok +c.setPluginOrder(['eye'],['saccade'],['sound'],['soundFeedback'],['mcc'],['fix'],['target'],['estim'],['estim2'],['intan']); %#ok %% Run it c.run(myBlock); diff --git a/demos/scripting.m b/demos/scripting.m index fa1ad065..749f8d71 100644 --- a/demos/scripting.m +++ b/demos/scripting.m @@ -75,6 +75,6 @@ function respondMouse(c) myBlock=neurostim.block('MyBlock',d); myBlock.nrRepeats=5; myBlock.randomization='RANDOMWITHREPLACEMENT'; -c.order('fix','gabor'); +c.setPluginOrder('fix','gabor'); c.run(myBlock); end \ No newline at end of file diff --git a/demos/textureDemo.m b/demos/textureDemo.m index bd68be29..db5f4adf 100644 --- a/demos/textureDemo.m +++ b/demos/textureDemo.m @@ -113,7 +113,7 @@ function textureDemo(varargin) blk.nrRepeats = 10; % now run the experiment... -% c.order('texture'); +% c.setPluginOrder('texture'); c.subject = 'demo'; c.paradigm = 'textureDemo'; c.run(blk);