classdef janis_gui_RespondToCycle < handle
properties (SetAccess = protected)
Start;
h;
end
methods
function obj = janis_gui_RespondToCycle(validator_obj)
obj.h = waitbar(0, 'Please Wait', 'Name', 'Validation');
posi = get(obj.h,'Position');
posi(4) = posi(4) + 100;
set(obj.h,'Position',posi);
addlistener(validator_obj, 'cycle',@(src,evtdata)handleEvnt(obj,src,evtdata));
obj.Start = tic;
end
function delete(obj)
delete(obj.h);
end
function handleEvnt(obj,src,evtdata)
timer = toc(obj.Start);
obj.h = waitbar(src.actualRound/src.getRoundCount, obj.h, ...
sprintf('Validation Round %d (%d)\n\n Performance:\nThis iteration: %3.1f %% - Mean: %3.1f %%\n\nTime: \nRemaining: %4.0f sec. - Elapsed: %4.0f sec.\n\n',...
src.actualRound, src.getRoundCount, ...
src.classPerformance.LastCorrectRate*100, src.classPerformance.CorrectRate*100, ...
(timer/src.actualRound)*(src.getRoundCount-src.actualRound), timer));
end
end
end