function floatDialogCallback(subCallback, hObjCLI, hDlg, tag)
%

%   Copyright 2016 The MathWorks, Inc.

    switch lower(subCallback)
        case {'fptolerance'}
            setfptolerance(hObjCLI, hDlg, tag);
    end
end

function setfptolerance(hObjCLI, hDlg, tag)
   switch tag
      case {'ConfigSet_HDLCoder_TestBenchPanel_FPToleranceScheme'}
         val = hDlg.getWidgetValue(tag);
         switch val
            case 0 % {'relative'}
                hObjCLI.FPToleranceStrategy = 'Relative';
            case 1 % {'ulp'}
                hObjCLI.FPToleranceStrategy = 'Ulp';
         end
      case {'ConfigSet_HDLCoder_TestBenchPanel_FPToleranceValue'}
         val = str2double(hDlg.getWidgetValue(tag));
         hObjCLI.FPToleranceValue = val;
         if val < 0
            error(message('HDLShared:CLI:missingparametervalue', 'Floating Point Tolerance'));
         end
   end
end

% LocalWords:  fptolerance FP ulp
