Skip to content

Commit

Permalink
Update GUI tags
Browse files Browse the repository at this point in the history
  • Loading branch information
teddychao committed Sep 23, 2024
1 parent f06895c commit f521d9c
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 50 deletions.
Binary file modified src/pspm_data_editor.fig
Binary file not shown.
34 changes: 17 additions & 17 deletions src/pspm_data_editor.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function pspm_data_editor_OpeningFcn(hObject, ~, handles, varargin)
end
sts = -1;
pspm_ui(hObject, handles, 'data_editor');
handles.UIDataEditor.HandleVisibility = settings.handle;
handles.pspm_data_editor.HandleVisibility = settings.handle;
if get(handles.rbInterpolate, 'Value')
set(handles.cbInterpolate, 'Enable', 'on');
handles.output_type = 'interpolate';
Expand All @@ -90,9 +90,9 @@ function pspm_data_editor_OpeningFcn(hObject, ~, handles, varargin)
handles.input_mode = '';
handles.input_file = '';
handles.output_file = '';
set(handles.UIDataEditor, 'WindowButtonDownFcn', @buttonDown_Callback);
set(handles.UIDataEditor, 'WindowButtonUpFcn', @buttonUp_Callback);
set(handles.UIDataEditor, 'WindowButtonMotionFcn', @buttonMotion_Callback);
set(handles.pspm_data_editor, 'WindowButtonDownFcn', @buttonDown_Callback);
set(handles.pspm_data_editor, 'WindowButtonUpFcn', @buttonUp_Callback);
set(handles.pspm_data_editor, 'WindowButtonMotionFcn', @buttonMotion_Callback);
if numel(varargin) > 1 && isstruct(varargin{2}) % load options
handles.options = varargin{2};
handles.options = pspm_options(handles.options, 'data_editor');
Expand Down Expand Up @@ -140,7 +140,7 @@ function pspm_data_editor_OpeningFcn(hObject, ~, handles, varargin)
Add_Epochs(hObject, handles)
end
end
uiwait(handles.UIDataEditor);
uiwait(handles.pspm_data_editor);



Expand Down Expand Up @@ -233,7 +233,7 @@ function loadFromFile(hObject, file)
[~, infos, data] = pspm_load_data(file); % load file
channels = cellfun(@(x) {x.header.chantype,x.header.units}, data, 'UniformOutput', 0);
set(handles.edOpenFilePath, 'String', file);
corder = get(handles.UIDataEditor, 'defaultAxesColorOrder'); % format channels
corder = get(handles.pspm_data_editor, 'defaultAxesColorOrder'); % format channels
cl = length(corder)-2;
disp_names = cell(numel(channels), 1);
for i = 1:numel(channels)
Expand Down Expand Up @@ -297,7 +297,7 @@ function AddPlot(hObject, chan_id, action)
end
np = get(handles.axData, 'NextPlot');
set(handles.axData, 'NextPlot', action);
corder = get(handles.UIDataEditor, 'defaultAxesColorOrder');
corder = get(handles.pspm_data_editor, 'defaultAxesColorOrder');
cl = length(corder)-2;
m = floor((chan_id-0.1)/cl);
color = corder(chan_id - m*cl, :);
Expand Down Expand Up @@ -502,11 +502,11 @@ function lbEpochs_CreateFcn(hObject, ~, ~)
set(hObject,'BackgroundColor','white');
end

function UIDataEditor_CreateFcn(~, ~, ~)
function pspm_data_editor_CreateFcn(~, ~, ~)
% Feature
% Executes during object creation, after setting all properties.
% Variables
% hObject handle to UIDataEditor (see GCBO)
% hObject handle to pspm_data_editor (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

Expand Down Expand Up @@ -923,7 +923,7 @@ function pbApply_Callback(hObject, ~, handles)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if CreateOutput(hObject) == 1
uiresume(handles.UIDataEditor);
uiresume(handles.pspm_data_editor);
end

function pbCancel_Callback(hObject, ~, handles)
Expand All @@ -935,8 +935,8 @@ function pbCancel_Callback(hObject, ~, handles)
% handles structure with handles and user data (see GUIDATA)
handles.output = {};
guidata(hObject, handles);
if isfield(handles, 'UIDataEditor')
uiresume(handles.UIDataEditor);
if isfield(handles, 'pspm_data_editor')
uiresume(handles.pspm_data_editor);
end

function cbInterpolate_Callback(hObject, ~, ~)
Expand Down Expand Up @@ -964,18 +964,18 @@ function ppOutput_CreateFcn(hObject, ~, ~)
set(hObject,'BackgroundColor','white');
end

function UIDataEditor_CloseRequestFcn(hObject, ~, handles)
function pspm_data_editor_CloseRequestFcn(hObject, ~, handles)
% Feature
% Executes when user attempts to close UIDataEditor.
% Executes when user attempts to close pspm_data_editor.
% Variables
% hObject handle to UIDataEditor (see GCBO)
% hObject handle to pspm_data_editor (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint
% delete(hObject) closes the figure
handles.output = {};
if isfield(handles, 'UIDataEditor')
uiresume(handles.UIDataEditor);
if isfield(handles, 'pspm_data_editor')
uiresume(handles.pspm_data_editor);
end
delete(hObject);

Expand Down
Binary file modified src/pspm_display.fig
Binary file not shown.
16 changes: 4 additions & 12 deletions src/pspm_display.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ function pspm_display_OpeningFcn(hObject, ~, handles, varargin)
% Update handles structure
guidata(hObject, handles);

handles.UIDisplay.HandleVisibility = settings.handle;
handles.pspm_display.HandleVisibility = settings.handle;

% UIWAIT makes pspm_display wait for user response (see UIRESUME)
%uiwait(handles.UIDisplay);
%uiwait(handles.pspm_display);

end

Expand Down Expand Up @@ -529,7 +529,6 @@ function exit_Callback(~, ~, handles)
% hObject handle to exit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles.UIDisplay.HandleVisibility = 'off';
close(gcbf);
end

Expand Down Expand Up @@ -696,14 +695,8 @@ function edit_y_max_CreateFcn(hObject, ~, ~)
%% pp_plot

function pp_plot(handles)
handles.UIDisplay.HandleVisibility = 'callback';
global settings;
if isempty(settings)
pspm_init;
end

% ---header----------------------------------------------------------------

global settings
% handles.name ... filename
% prop... struct with fields
% .wave (channel number)
Expand Down Expand Up @@ -906,11 +899,10 @@ function pp_plot(handles)
set(handles.edit_y_max,'String',num2str(y(2)))
set(handles.edit_start_x,'String',num2str(x(1)))
set(handles.edit_winsize_x,'String',num2str(x(2)))
handles.UIDisplay.HandleVisibility = settings.handle;
end

% --- Executes when pspm_display is resized.
function UIDisplay_ResizeFcn(~, ~, ~)
function pspm_display_ResizeFcn(~, ~, ~)
% hObject handle to pspm_display (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Expand Down
Binary file modified src/pspm_ecg_editor.fig
Binary file not shown.
39 changes: 18 additions & 21 deletions src/pspm_ecg_editor.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
end
sts = -1;

% Last Modified by GUIDE v2.5 12-Aug-2024 13:35:41
% Last Modified by GUIDE v2.5 23-Sep-2024 11:21:03

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
Expand Down Expand Up @@ -165,10 +165,8 @@ function pspm_ecg_editor_OpeningFcn(hObject, eventdata, handles, varargin)
set(handles.edtUpperLimit, 'String', num2str(handles.plot.limits.upper));
set(handles.edtLowerLimit, 'String', num2str(handles.plot.limits.lower));
% -------------------------------------------------------------------------
handles.UIEcgEditor.HandleVisibility = settings.handle;
% -------------------------------------------------------------------------
% UIWAIT makes pspm_ecg2hb_qc wait for user response (see UIRESUME)
uiwait(handles.UIEcgEditor);
uiwait(handles.pspm_ecg_editor);
% -------------------------------------------------------------------------

% --- Outputs from this function are returned to the command line.
Expand Down Expand Up @@ -211,7 +209,7 @@ function togg_add_Callback(hObject, eventdata, handles)
exitModus;
else
handles.edit_mode = 'add_qrs';
set(handles.UIEcgEditor,'Pointer','crosshair');
set(handles.pspm_ecg_editor,'Pointer','crosshair');
guidata(hObject, handles);
end

Expand All @@ -229,7 +227,7 @@ function togg_remove_Callback(hObject, eventdata, handles)
exitModus;
else
handles.edit_mode = 'remove_qrs';
set(handles.UIEcgEditor,'Pointer','crosshair');
set(handles.pspm_ecg_editor,'Pointer','crosshair');
guidata(hObject, handles);
end
% -------------------------------------------------------------------------
Expand Down Expand Up @@ -698,9 +696,9 @@ function update_selected(hObject, handles)
end
end

% --- Executes when user attempts to close UIEcgEditor.
function UIEcgEditor_CloseRequestFcn(hObject, eventdata, handles)
% hObject handle to UIEcgEditor (see GCBO)
% --- Executes when user attempts to close pspm_ecg_editor.
function pspm_ecg_editor_CloseRequestFcn(hObject, eventdata, handles)
% hObject handle to pspm_ecg_editor (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

Expand All @@ -714,9 +712,9 @@ function UIEcgEditor_CloseRequestFcn(hObject, eventdata, handles)
% delete(hObject);


% --- Executes on key press with focus on UIEcgEditor and none of its controls.
function UIEcgEditor_KeyPressFcn(hObject, eventdata, handles)
% hObject handle to UIEcgEditor (see GCBO)
% --- Executes on key press with focus on pspm_ecg_editor and none of its controls.
function pspm_ecg_editor_KeyPressFcn(hObject, eventdata, handles)
% hObject handle to pspm_ecg_editor (see GCBO)
% eventdata structure with the following fields (see MATLAB.UI.FIGURE)
% Key: name of the key that was pressed, in lower case
% Character: character interpretation of the key(s) that was pressed
Expand All @@ -729,14 +727,14 @@ function UIEcgEditor_KeyPressFcn(hObject, eventdata, handles)
% -------------------------------------------------------------------------
function exitModus()
handles = guidata(gca);
set(handles.UIEcgEditor, 'Pointer', 'Arrow');
set(handles.pspm_ecg_editor, 'Pointer', 'Arrow');
handles.edit_mode = '';
guidata(gca, handles);

% --- Executes on mouse press over figure background, over a disabled or
% --- inactive control, or over an axes background.
function UIEcgEditor_WindowButtonDownFcn(hObject, eventdata, handles)
% hObject handle to UIEcgEditor (see GCBO)
function pspm_ecg_editor_WindowButtonDownFcn(hObject, eventdata, handles)
% hObject handle to pspm_ecg_editor (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if strcmpi(handles.edit_mode,'remove_qrs')
Expand Down Expand Up @@ -1367,8 +1365,8 @@ function rbHideArtefactEvents_Callback(hObject, eventdata, handles)

% --- Executes on mouse press over figure background, over a disabled or
% --- inactive control, or over an axes background.
function UIEcgEditor_WindowButtonUpFcn(hObject, eventdata, handles)
% hObject handle to UIEcgEditor (see GCBO)
function pspm_ecg_editor_WindowButtonUpFcn(hObject, eventdata, handles)
% hObject handle to pspm_ecg_editor (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
pt = get(handles.axes, 'CurrentPoint');
Expand Down Expand Up @@ -1479,8 +1477,8 @@ function UIEcgEditor_WindowButtonUpFcn(hObject, eventdata, handles)


% --- Executes on mouse motion over figure - except title and menu.
function UIEcgEditor_WindowButtonMotionFcn(hObject, eventdata, handles)
% hObject handle to UIEcgEditor (see GCBO)
function pspm_ecg_editor_WindowButtonMotionFcn(hObject, eventdata, handles)
% hObject handle to pspm_ecg_editor (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if handles.draw_selection
Expand Down Expand Up @@ -1584,5 +1582,4 @@ function UIEcgEditor_WindowButtonMotionFcn(hObject, eventdata, handles)
end
stem_handles(k) = -1;
end

end
end
Binary file modified src/pspm_review.fig
Binary file not shown.

0 comments on commit f521d9c

Please sign in to comment.