function vals = get_specvals(hFig,frame)
%GETSPEC_VALS   Get values from ud for the freq or mag specs.
%
%   Inputs:
%     hFig     - figure handle of the GUI
%     frame    - string indicating which frame to work on, freq. or mag.
%
%   Outputs:
%     vals - structure with values of the freq, mag or freqmag specs from ud:
%     vals.units = string with units from popup
%     vals.data  = actual numerical specs
%     vals.fs    = sampling frequency value (when applicable)

%   Author(s): R. Losada
%   Copyright 1988-2000 The MathWorks, Inc.
%   $Revision: 1.6 $  $Date: 2000/06/13 21:23:11 $ 

% Get userdata
ud = get(hFig,'userdata');

% Get current filter type, method and order mode
filterType = ud.specs.design.type;
method = ud.specs.design.method;
filterOrder = ud.specs.design.order.calc;
window = ud.specs.design.window;

% Determine the specs mode on the fly, this value is not stored in ud
specs_mode = determine_specsmode(frame,method,filterOrder,window);

% Get the structure of values
valsstruct = getfield(ud.specs.design,frame,filterType);

vals.data = getfield(valsstruct,specs_mode);

% Get the units from ud
vals.units = getfield(valsstruct,'units');

% Get Fs when it's there and units are not normalized
Fsstr = 'fs';
if isfield(valsstruct,Fsstr),  
    vals.fs = getfield(valsstruct,Fsstr);
end    


% [EOF - get_specvals.m]

