%% save
%    save the settigns to the object properties, check to ensure
%    that user input validates.
% inputs:
%   object:Settings - current object
% outputs:
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function err = save(object)
msg = []    ;
err = 0;
if isempty(str2num(get(object.count_text,'String')))
    msg = [msg get(object.count_text,'String') ' is not a valid number'];
    err = 1;
else
    object.counter_trials = str2num(get(object.count_text,'String'));
end

if isempty(str2num(get(object.range_text,'String')))
    msg = [msg sprintf('\n') get(object.count_text,'String') ' is not a valid number'];
    err = 1;
else
    object.counter_range = str2num(get(object.range_text,'String'));
end
object.pvs_includes = get(object.include_text,'String');

if (get(object.except_check,'value') == get(object.except_check,'Max'))
    object.except = true;
else
    object.except = false;
end

if err
    msgbox(msg);
end
end

