5656 properties (GetAccess = public ,SetAccess = protected )
5757 Fields cell = nigeLab.nigelObj.Default(' Fields' ) % Specific things to record
5858 FieldType cell = nigeLab.nigelObj.Default(' FieldType' ) % "Types" corresponding to Fields elements
59- FolderIdentifier char % '.nigelBlock', '.nigelAnimal', or '.nigelTank'
6059 IDInfo (1 ,1 ) struct % Struct parsed from ID file
6160 HasParsFile (1 ,1 ) logical = false % Flag --> True if _Pars.mat exists
6261 HasParsInit (1 ,1 ) struct % Flag struct --> .param is True if obj.updateParams('param') has been run
7372
7473 % DEPENDENT,PUBLIC
7574 properties (Dependent ,Access = public )
76- File char % Full file of _Block.mat, _Animal.mat, or _Tank.mat file
77- GUI nigeLab.libs.DashBoard % Handle to nigeLab.libs.DashBoard GUI (nigelObj.nigelDash method)
78- Input char % Path to input file or folder
79- Name char % Name of the obj (char array)
80- OnRemote (1 ,1 )logical % Is this object running a job on remote worker?
81- Output char % Path to output folder (same as .Paths.SaveLoc)
82- Pars (1 ,1 )struct % Parameters struct
83- Paths (1 ,1 )struct % Detailed paths specifications
84- ShortFile char % Shortened filename
85- SortGUI nigeLab.Sort % Handle to nigeLab.Sort GUI (nigelObj.Sort method)
86- Type char % 'Block', 'Animal' or 'Tank'
75+ File char % Full file of _Block.mat, _Animal.mat, or _Tank.mat file
76+ FolderIdentifier char % '.nigelBlock', '.nigelAnimal', or '.nigelTank'
77+ Input char % Path to input file or folder
78+ Name char % Name of the obj (char array)
79+ OnRemote (1 ,1 ) logical % Is this object running a job on remote worker?
80+ Output char % Path to output folder (same as .Paths.SaveLoc)
81+ Pars (1 ,1 ) struct % Parameters struct
82+ Paths (1 ,1 ) struct % Detailed paths specifications
83+ ShortFile char % Shortened filename
84+ Type char % 'Block', 'Animal' or 'Tank'
8785 end
8886
8987 % DEPENDENT,PUBLIC/PROTECTED
115113 OutPrompt char % To print for output path prompts
116114 end
117115
116+ % DEPENDENT,TRANSIENT,PUBLIC (GUI)
117+ properties (Dependent ,Transient ,Access = public )
118+ GUI nigeLab.libs.DashBoard % Handle to nigeLab.libs.DashBoard GUI (nigelObj.nigelDash method)
119+ SortGUI nigeLab.Sort % Handle to nigeLab.Sort GUI (nigelObj.Sort method)
120+ end
121+
118122 % DEPENDENT,TRANSIENT,SETOBSERVABLE,PUBLIC (Children Objects)
119123 properties (Dependent ,Transient ,SetObservable ,Access = public )
120124 Children % Array of "child" objects
358362 end
359363 end
360364
361- % Set these after parsing <'Name',value> so they cannot be
362- % overwritten manually by accident, or set to different values.
363- obj.FolderIdentifier = sprintf(' .nigel%s ' ,obj .Type);
364-
365365 % Check for input passed via subclass constructor
366366 if isstruct(inPath ) % Then this came from loadobj
367367 obj_ = inPath ;
@@ -695,6 +695,21 @@ function delete(obj)
695695 end
696696 end
697697
698+ % [DEPENDENT] Get method for .FolderIdentifier (.nigelFile)
699+ function value = get .FolderIdentifier(obj )
700+ % GET.FOLDERIDENTIFIER Returns .nigel[Type] char array
701+ %
702+ % value = get(obj,'FolderIdentifier');
703+ % --> value is either '.nigelBlock', '.nigelAnimal', or
704+ % '.nigelTank'
705+
706+ if isempty(obj .Type)
707+ value = ' .nigelFile' ;
708+ return ;
709+ end
710+ value = sprintf(' .nigel%s ' ,obj .Type);
711+ end
712+
698713 % [DEPENDENT] Get method for .FileExt (recording file type)
699714 function value = get .FileExt(obj )
700715 % GET.FILEEXT Returns char array of file extension
@@ -1599,7 +1614,37 @@ function getdisp(obj)
15991614 if ~ischar(value )
16001615 return ;
16011616 end
1602- [obj .Output,~ ,obj .FolderIdentifier]=fileparts(value );
1617+ [path ,f ,e ]=fileparts(value );
1618+ fparts = strsplit(f ,' _' );
1619+
1620+ if ismember(fparts{end },{' Block' ,' Animal' ,' Tank' })
1621+ obj.Type = fparts{end };
1622+ obj.Output = path ;
1623+ else
1624+ p = nigeLab .utils.shortenedPath(path );
1625+ nigeLab .utils.cprintf(' Errors*' ,...
1626+ ' [SET.FILE]: Bad File name (%s /%s )\n ' ,p ,[f e ]);
1627+ return ;
1628+ end
1629+
1630+ end
1631+
1632+ % [DEPENDENT] Set method for .FolderIdentifier (.nigelFile)
1633+ function set .FolderIdentifier(obj ,value )
1634+ % SET.FOLDERIDENTIFIER Sets .nigelFile char array
1635+ %
1636+ % set(obj,'FolderIdentifier','.nigelTank');
1637+ % --> Set folder identifier for 'Tank' type nigelObj
1638+
1639+ if isempty(value )
1640+ return ;
1641+ elseif ~ischar(value )
1642+ return ;
1643+ end
1644+ value = strrep(value ,' .nigel' ,' ' );
1645+ if ismember(value ,{' Block' ,' Animal' ,' Tank' })
1646+ set(obj ,' Type' ,value );
1647+ end
16031648 end
16041649
16051650 % [DEPENDENT] Set method for .FileExt (recording binary)
@@ -1629,14 +1674,14 @@ function getdisp(obj)
16291674
16301675 if isempty(value )
16311676 if ~isempty(obj .GUIContainer)
1632- obj .GUIContainer( : ) = []; % Remove handle association
1677+ obj.GUIContainer = nigeLab .libs.DashBoard.empty();
16331678 end
16341679 obj.IsDashOpen = false ; % Set flag to false
16351680 else
16361681 if obj .IsDashOpen
16371682 obj.IsDashOpen = isvalid(value );
16381683 if ~obj .IsDashOpen
1639- value = [] ;
1684+ value = nigeLab .libs.DashBoard.empty() ;
16401685 end
16411686 % Store association to handle object
16421687 obj.GUIContainer = value ;
@@ -2142,7 +2187,7 @@ function getdisp(obj)
21422187
21432188 for i = 1 : numel(obj )
21442189 if isempty(value )
2145- obj(i ).SortGUIContainer( : ) = [] ; % Remove handle association
2190+ obj(i ).SortGUIContainer = nigeLab .Sort.empty() ; % Remove handle association
21462191 if obj(i ).IsDashOpen % Make sure Dash is un-hidden
21472192 visible = obj(i ).GUI.Visible;
21482193 if strcmpi(visible ,' off' )
@@ -2188,7 +2233,7 @@ function getdisp(obj)
21882233
21892234 if ~ischar(value )
21902235 error([' nigeLab:' mfilename ' :BadClass' ],...
2191- ' nigelObj.Type must be char' );
2236+ ' [SET.TYPE]: nigelObj.Type must be char' );
21922237 end
21932238
21942239 if ~ismember(value ,{' Block' ,' Animal' ,' Tank' })
@@ -2197,7 +2242,7 @@ function getdisp(obj)
21972242 value = strrep(class(obj ),' nigeLab.' ,' ' );
21982243 if ~ismember(value ,{' Block' ,' Animal' ,' Tank' ,' nigelObj' })
21992244 error([' nigeLab:' mfilename ' :BadType' ],...
2200- [' Unexpected Type: %s\n ' ...
2245+ [' [SET.TYPE]: Unexpected Type: %s\n ' ...
22012246 ' \t -->\t Must be: '' Block,'' '' Animal,'' or '' Tank'' ' ],...
22022247 value );
22032248 end
0 commit comments