From 86e646cf528c8181b284d39ca8284acf9bfafd7d Mon Sep 17 00:00:00 2001 From: "dadi.zhao" Date: Fri, 11 Aug 2023 06:28:22 +0100 Subject: [PATCH 1/3] fix UI issue --- src/ext/matlabbatch/cfg_ui.m | 16 +++++++------- src/ext/matlabbatch/cfg_ui_util.m | 35 ++++--------------------------- 2 files changed, 12 insertions(+), 39 deletions(-) diff --git a/src/ext/matlabbatch/cfg_ui.m b/src/ext/matlabbatch/cfg_ui.m index e0242f5e1..4ee2380f2 100644 --- a/src/ext/matlabbatch/cfg_ui.m +++ b/src/ext/matlabbatch/cfg_ui.m @@ -20,7 +20,7 @@ % % See also: GUIDE, GUIDATA, GUIHANDLES % -% This code is part of a batch job configuration system for MATLAB. See +% This code is part of a batch job configuration system for MATLAB. See % help matlabbatch % for a general overview. %_______________________________________________________________________ @@ -309,7 +309,7 @@ function local_showjob(obj,cjob) set(findobj(handles.cfg_ui,'-regexp', 'Tag','.*File(Run)|(RunSerial)$'),'Enable','on'); else set(findobj(handles.cfg_ui,'-regexp', 'Tag','.*File(Run)|(RunSerial)$'),'Enable','off'); -end +end local_showmod(obj); % -------------------------------------------------------------------- @@ -378,7 +378,7 @@ function local_showvaledit(obj) ciid = {udmodlist.cjob udmodlist.id{cmod} udmodule.id{citem}}; end; contents = cellfun(@(c)subsref(c, substruct('{}',{citem})), udmodule.contents, 'UniformOutput', false); -sout = cat(2, udmodlist.sout(1:cmod-1)); +sout = cat(2, udmodlist.sout{1:cmod-1}); cfg_ui_util('showvaledit', fig, ciid, contents, sout, dflag, [], @()local_valedit_update(obj)); drawnow; @@ -564,7 +564,7 @@ function cfg_ui_CloseRequestFcn(hObject, eventdata, handles) end; % --- Outputs from this function are returned to the command line. -function varargout = cfg_ui_OutputFcn(hObject, eventdata, handles) +function varargout = cfg_ui_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB @@ -612,7 +612,7 @@ function MenuFileLoad_Callback(hObject, eventdata, handles) catch l = lasterror; errordlg(l.message,'Error loading job', 'modal'); - end + end set(handles.modlist, 'userdata', udmodlist); set(handles.module, 'userdata', []); local_showjob(hObject); @@ -815,7 +815,7 @@ function MenuViewUpdateView_Callback(hObject, eventdata, handles) % This function seems to be called on startup without guidata - do nothing % there -if ~isempty(handles) +if ~isempty(handles) local_setmenu(handles.cfg_ui, [], @local_AddMod, true); udmodlist = get(handles.modlist,'Userdata'); if isstruct(udmodlist) @@ -872,7 +872,7 @@ function MenuViewShowCode_Callback(hObject, eventdata, handles) ctxt = uicontrol('Parent',fg, 'Style','listbox', 'Units','normalized', 'Position',[0 0 1 1], 'FontName','FixedWidth','Tag',[mfilename 'ShowCodeList']); else figure(fg); - ctxt = findobj(fg,'Tag',[mfilename 'ShowCodeList']); + ctxt = findobj(fg,'Tag',[mfilename 'ShowCodeList']); end um = uicontextmenu; um1 = uimenu('Label','Copy', 'Callback',@(ob,ev)local_ShowCode_Copy(ob,ev,ctxt), 'Parent',um); @@ -1044,7 +1044,7 @@ function MenuFileMultiBatch_Callback(hObject, eventdata, handles) udmodlist = get(handles.modlist,'userdata'); cjob = udmodlist.cjob; -if cfg_util('isjob_id', cjob) +if cfg_util('isjob_id', cjob) njob = cfg_util('clonejob', cjob); cfg_ui_multibatch(njob); end diff --git a/src/ext/matlabbatch/cfg_ui_util.m b/src/ext/matlabbatch/cfg_ui_util.m index efbe9959d..d0858dec3 100644 --- a/src/ext/matlabbatch/cfg_ui_util.m +++ b/src/ext/matlabbatch/cfg_ui_util.m @@ -4,7 +4,7 @@ % module or data summary. It also handles all value display and editing for % a particular item. % -% This code is part of a batch job configuration system for MATLAB. See +% This code is part of a batch job configuration system for MATLAB. See % help matlabbatch % for a general overview. %_______________________________________________________________________ @@ -102,21 +102,12 @@ case {'showitem'} % [contents, namestr, datastr] = cfg_ui_util('showitem', ciid, dflag) [ciid, dflag] = deal(varargin{1:2}); - if isstruct(ciid) - [id, stop, contents] = ... - cfg_util('listmod', ciid(:),... - cfg_findspec({{'hidden',false}}), ... - cfg_tropts({{'hidden', true}},1,1,1,1,dflag), ... - {'name','val','labels','values','class','level', ... - 'all_set','all_set_item','num','preview'}); - else - [id, stop, contents] = ... + [id, stop, contents] = ... cfg_util('listmod', ciid{:},... cfg_findspec({{'hidden',false}}), ... cfg_tropts({{'hidden', true}},1,1,1,1,dflag), ... {'name','val','labels','values','class','level', ... 'all_set','all_set_item','num','preview'}); - end contents = cellfun(@(c)subsref(c, substruct('{}',{1})), contents, 'UniformOutput', false); [namestr, datastr] = cfg_ui_util('showitemstr', contents, dflag); varargout{1} = contents; @@ -125,39 +116,21 @@ case {'showmod'} % [id, namestr, datastr, contents] = cfg_ui_util('showmod', cmid, dflag) [cmid, dflag] = deal(varargin{1:2}); - if isstruct(cmid) - [id, stop, contents] = ... - cfg_util('listmod', cmid(:), [],... - cfg_findspec({{'hidden',false}}), ... - cfg_tropts({{'hidden', true}},1,Inf,1,Inf,dflag), ... - {'name','val','labels','values','class','level', ... - 'all_set','all_set_item','num','preview'}); - else - [id, stop, contents] = ... + [id, stop, contents] = ... cfg_util('listmod', cmid{:}, [],... cfg_findspec({{'hidden',false}}), ... cfg_tropts({{'hidden', true}},1,Inf,1,Inf,dflag), ... {'name','val','labels','values','class','level', ... 'all_set','all_set_item','num','preview'}); - end if isempty(id) || ~cfg_util('isitem_mod_id', id{1}) % Module not found without hidden flag % Try to list top level entry of module anyway, but not module items. - if isstruct(cmid) - [id, stop, contents] = ... - cfg_util('listmod', cmid(:), [],... - cfg_findspec({}), ... - cfg_tropts({{'hidden', true}},1,1,1,1,dflag), ... - {'name','val','labels','values','class','level', ... - 'all_set','all_set_item','preview'}); - else - [id, stop, contents] = ... + [id, stop, contents] = ... cfg_util('listmod', cmid{:}, [],... cfg_findspec({}), ... cfg_tropts({{'hidden', true}},1,1,1,1,dflag), ... {'name','val','labels','values','class','level', ... 'all_set','all_set_item','preview'}); - end end; namestr = cell(1,numel(id)); datastr = cell(1,numel(id)); From 34063960f230dd008b47c4b5e7d5102abf7da0c5 Mon Sep 17 00:00:00 2001 From: Dominik Bach Date: Fri, 11 Aug 2023 22:19:32 +0200 Subject: [PATCH 2/3] fix issue 508 --- src/pspm_cfg/pspm_cfg_run_pp_heart_data.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pspm_cfg/pspm_cfg_run_pp_heart_data.m b/src/pspm_cfg/pspm_cfg_run_pp_heart_data.m index 211ea563e..a2fef5ada 100644 --- a/src/pspm_cfg/pspm_cfg_run_pp_heart_data.m +++ b/src/pspm_cfg/pspm_cfg_run_pp_heart_data.m @@ -49,7 +49,7 @@ opt.channel_action = channel_action; % call function - [sts, winfo] = pspm_ecg2hb(fn, chan, opt); + [sts, winfo] = pspm_convert_ecg2hb(fn, chan, opt); case 'ecg2hb_amri' opt = pp_field.opt; opt.channel_action = channel_action; @@ -77,7 +77,7 @@ opt.channel_action = channel_action; % call ecg2hb - [sts, winfo] = pspm_ecg2hb(fn, chan, opt); + [sts, winfo] = pspm_convert_ecg2hb(fn, chan, opt); if sts ~= -1 From 72150d004f3b310eb3c2a9b1648c5745ffd1b41a Mon Sep 17 00:00:00 2001 From: "teddy.chao" Date: Fri, 11 Aug 2023 22:35:22 +0100 Subject: [PATCH 3/3] update names --- src/pspm_convert_gaze_distance.m | 2 +- src/pspm_ecg_editor.m | 2 +- test/pspm_butter_test.m | 6 +++--- test/pspm_convert_ecg2hb_amri_test.m | 4 ++-- test/pspm_filtfilt_test.m | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pspm_convert_gaze_distance.m b/src/pspm_convert_gaze_distance.m index de08ee600..550aa6981 100644 --- a/src/pspm_convert_gaze_distance.m +++ b/src/pspm_convert_gaze_distance.m @@ -122,7 +122,7 @@ end sts = 1; return -%% CODE SAME AS IN pspm_pixel2unit +%% CODE SAME AS IN pspm_convert_pixel2unit function out = pixel_conversion(data, screen_length, interest_range) length_per_pixel = screen_length ./ (diff(interest_range) + 1); % baseline data in pixels wrt. the range (i.e. pixels of interest) diff --git a/src/pspm_ecg_editor.m b/src/pspm_ecg_editor.m index e075a882d..8ae78a7ff 100644 --- a/src/pspm_ecg_editor.m +++ b/src/pspm_ecg_editor.m @@ -6,7 +6,7 @@ % [sts, R] = pspm_ecg_editor(pt) % [sts, R] = pspm_ecg_editor(fn, channel, options) % ● Arguments -% pt: A struct() from pspm_ecg2hb detection. +% pt: A struct() from pspm_convert_ecg2hb detection. % fn: A file to data file containing the ecg channel to be edited % channel: Channel id of ecg channel in the data file % ┌──options: A struct() of options diff --git a/test/pspm_butter_test.m b/test/pspm_butter_test.m index e232583e2..96ec130bd 100644 --- a/test/pspm_butter_test.m +++ b/test/pspm_butter_test.m @@ -1,7 +1,7 @@ classdef pspm_butter_test < matlab.unittest.TestCase % ● Description - % unittest class for the pspm_hb2hp function - % ● Authorship + % unittest class for the pspm_butter function + % ● History % (C) 2019 Ivan Rojkov (University of Zurich) methods (Test) function invalid_input(this) @@ -18,4 +18,4 @@ function invalid_input(this) this.verifyWarning(@() pspm_butter(1,1), 'ID:toolbox_missing'); end end -end \ No newline at end of file +end diff --git a/test/pspm_convert_ecg2hb_amri_test.m b/test/pspm_convert_ecg2hb_amri_test.m index 61c4a6c70..a429a87e4 100644 --- a/test/pspm_convert_ecg2hb_amri_test.m +++ b/test/pspm_convert_ecg2hb_amri_test.m @@ -1,6 +1,6 @@ classdef pspm_convert_ecg2hb_amri_test < pspm_testcase -% PSPM_ECG2HB_AMRI_TEST -% unittest class for the pspm_ecg2hb_amri function +% PSPM_CONVERT_ECG2HB_AMRI_TEST +% unittest class for the pspm_convert_ecg2hb_amri function %__________________________________________________________________________ % PsPM TestEnvironment % (C) 2019 Eshref Yozdemir (University of Zurich) diff --git a/test/pspm_filtfilt_test.m b/test/pspm_filtfilt_test.m index 49a5bb82f..9c9a91ec7 100644 --- a/test/pspm_filtfilt_test.m +++ b/test/pspm_filtfilt_test.m @@ -1,6 +1,6 @@ classdef pspm_filtfilt_test < matlab.unittest.TestCase % ● Description - % unittest class for the pspm_hb2hp function + % unittest class for the pspm_filtfilt function % ● Authorship % (C) 2019 Ivan Rojkov (University of Zurich) methods (Test) @@ -11,4 +11,4 @@ function invalid_input(this) this.verifyWarning(@() pspm_filtfilt([1:10],[1:20],[1:10]), 'ID:invalid_input'); end end -end \ No newline at end of file +end