Skip to content

Commit

Permalink
Minor bugfix
Browse files Browse the repository at this point in the history
Remove duplicate `getPropertyGroups` method.

Typo
  • Loading branch information
m053m716 committed Jan 31, 2020
1 parent a77635c commit 1b54ec2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 106 deletions.
2 changes: 1 addition & 1 deletion +nigeLab/@Block/initVideos.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

if ~blockObj.Pars.Video.HasVideo
flag = true;
nigelab.utils.cprintf(fmt,'%s[BLOCK/INITVIDEOS]: ');
nigeLab.utils.cprintf(fmt,'%s[BLOCK/INITVIDEOS]: ');
nigeLab.utils.cprintf(fmt(1:(end-1)),...
'Skipped video initialization (%s)\n',blockObj.Name);
return;
Expand Down
109 changes: 4 additions & 105 deletions +nigeLab/@nigelObj/nigelObj.m
Original file line number Diff line number Diff line change
Expand Up @@ -5050,111 +5050,6 @@ function displayScalarObject(obj,displayType)
disp(footer);
end

% Overload for matlab.mixin.CustomDisplay.getPropertyGroups
function groups = getPropertyGroups(obj,displayType)
%GETPROPERTYGROUPS Overload for returning properties to display
%
% Overload of matlab.mixin.CustomDisplay.getPropertyGroups to
% change default output in Command Window for a scalar nigelObj

if nargin < 2
displayType = 'default';
end

switch lower(displayType)
case {'default','nonscalar'}
groups = [email protected](obj);
case 'scalar'
status_out = obj.getDescriptiveStatus();
pars_out = obj.getDescriptivePars();
switch obj.Type
case 'Block'
data_out = struct(...
'Name',obj.Name,...
'Duration',obj.Duration,...
'NumChannels',obj.NumChannels,...
'NumProbes',obj.NumProbes,...
'SampleRate',obj.SampleRate,...
'RecSystem',obj.RecSystem.Name,...
'User',obj.User);

groups = [...
matlab.mixin.util.PropertyGroup(data_out,...
'<strong>Data</strong>')...
matlab.mixin.util.PropertyGroup(obj.Meta,...
'<strong>Meta</strong>')...
matlab.mixin.util.PropertyGroup(pars_out,...
'<strong>Parameters</strong>')...
matlab.mixin.util.PropertyGroup(status_out,...
'<strong>Status</strong>')...
];
case 'Animal'
data_out = struct;
for i = 1:numel(obj.Children)
% Get rid of any "weird" characters
name = strrep(obj.Children(i).Name,'-','_');
name = strrep(name,' ','_');
name = strrep(name,'+','_');
name = strrep(name,'&','_');
name = strrep(name,'|','_');
if ~regexpi(name,'[a-z]')
name = ['Block_' name];
end
str_view = ...
['<a href="matlab: ' ...
'nigeLab.sounds.play(''pop'',1.5);' ...
'nigeLab.nigelObj.DisplayCurrent(tankObj.' ...
sprintf(['Children(%g).Children(%g),'...
'''simple'');"'], obj.Index,i) '>View</a>'];

data_out.(name) = str_view;
end
groups = [...
matlab.mixin.util.PropertyGroup(data_out,...
'<strong>Data</strong>')...
matlab.mixin.util.PropertyGroup(obj.Meta,...
'<strong>Meta</strong>')...
matlab.mixin.util.PropertyGroup(pars_out,...
'<strong>Parameters</strong>')...
matlab.mixin.util.PropertyGroup(status_out,...
'<strong>Status</strong>')
];
case 'Tank'
data_out = struct;
for i = 1:numel(obj.Children)
name = strrep(obj.Children(i).Name,'-','_');
name = strrep(name,' ','_');
if ~regexpi(name,'[a-z]')
name = ['Animal_' name];
end
str_view = ...
['<a href="matlab: ' ...
'nigeLab.sounds.play(''pop'',1.5);' ...
'nigeLab.nigelObj.DisplayCurrent(tankObj.' ...
sprintf('Children(%g),''simple'');"',i) ...
'>View</a>'];
data_out.(name) = str_view;
end
groups = [...
matlab.mixin.util.PropertyGroup(data_out,...
'<strong>Data</strong>')...
matlab.mixin.util.PropertyGroup(obj.Meta,...
'<strong>Meta</strong>')...
matlab.mixin.util.PropertyGroup(pars_out,...
'<strong>Parameters</strong>')...
matlab.mixin.util.PropertyGroup(status_out,...
'<strong>Status</strong>')
];
otherwise
groups = [email protected](obj);
end

otherwise
error(['nigeLab:' mfilename ':BadType'],...
'Unexpected case: %s',displayType);
end
end

% Return `Substruct` array indices to "Methods" subscripts
function [methodSubs,methodName,methodOutputs,methodInputs] = findMethodSubsIndices(obj,S)
%FINDMETHODSUBSINDICES Return array indices to methods subscripts
Expand Down Expand Up @@ -5447,8 +5342,12 @@ function displayScalarObject(obj,displayType)
case 'Animal'
data_out = struct;
for i = 1:numel(obj.Children)
% Get rid of any "weird" characters
name = strrep(obj.Children(i).Name,'-','_');
name = strrep(name,' ','_');
name = strrep(name,'+','_');
name = strrep(name,'&','_');
name = strrep(name,'|','_');
if ~regexpi(name,'[a-z]')
name = ['Block_' name];
end
Expand Down

0 comments on commit 1b54ec2

Please sign in to comment.