function resetscalevalues(hFig)
%RESETSCALEVALUES Reset scale values to 1.
%   RESETSCALEVALUES(hFig) resets the scale values to 1.  It is
%   called before a filter is designed or imported.

%   Thomas A. Bryan
%   Copyright 1988-2000 The MathWorks, Inc.
%   $Revision: 1.1 $  $Date: 2000/06/15 20:04:54 $ 

% Get the user data
ud = get(hFig,'Userdata');

% Early return if quantized does not exist.
if ~ud.flags.fdqexists
  return
end

tempqfilt = gettempqfilt(ud);

% Set the scale values to 1 in tempqfilt, refqfilt, and ud.filter if
% it is a qfilt
wrn = warning('off');
if isa(ud.filter,'qfilt')
  scale = scalevalues(ud.filter);
  tempqfilt = ud.filter;
  ud.specs.quantize.refqfilt = qfilt;
else
  scale = 1;
end


ud.specs.quantize.tempqfilt = set(tempqfilt,'scalevalues',scale);
ud.specs.quantize.refqfilt  = set(ud.specs.quantize.refqfilt,...
    'scalevalues',scale);
% Set the value in the scale values edit box to scale
set(ud.h.quantize_params.qfiltobjs.scalevalues,'string',mat2str(scale));

warning(wrn)

% Set the user data.
set(hFig,'Userdata',ud);
