Skip to content

Commit

Permalink
fixed double insert bug
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp committed Nov 4, 2019
1 parent 7fbaf66 commit 2e71bc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions emgEventsManageTool.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
'Callback', @previousChannel);

vars.btnReset = uicontrol('Style', 'pushbutton', 'String', 'Reset',...
'TooltipString', 'Reset events',...
'TooltipString', 'Reset events for selected channel',...
'Position', [500 60 75 20],...
'Callback', @reset);

Expand Down Expand Up @@ -371,7 +371,7 @@ function instOnEvent(hObject, ~)
set(hObject, 'enable', 'on');

if(~isempty(vars.highlightPoint))
vars.events(vars.channelNum).onSets = sort([vars.events(vars.channelNum).onSets;round(vars.highlightPoint(1) .* vars.fs)]);
vars.events(vars.channelNum).onSets = uniquetol(sort([vars.events(vars.channelNum).onSets;round(vars.highlightPoint(1) .* vars.fs)]));
vars.numOnsets = length(vars.events(vars.channelNum).onSets);
vars.highlightPoint = [];
vars.selectedEvent = [];
Expand All @@ -385,7 +385,7 @@ function instOffEvent(hObject, ~)
set(hObject, 'enable', 'on');

if(~isempty(vars.highlightPoint))
vars.events(vars.channelNum).offSets = sort([vars.events(vars.channelNum).offSets;round(vars.highlightPoint(1) .* vars.fs)]);
vars.events(vars.channelNum).offSets = uniquetol(sort([vars.events(vars.channelNum).offSets;round(vars.highlightPoint(1) .* vars.fs)]));
vars.numOffsets = length(vars.events(vars.channelNum).offSets);
vars.highlightPoint = [];
vars.selectedEvent = [];
Expand Down

0 comments on commit 2e71bc9

Please sign in to comment.