function time = getBladedTime(fullFile)
% getBladedTime 

%   Project: IMPACT
%   Title of Code: getBladedTime
%   Relevant additional documentation:
%   Developer: Carlos Gonzalez
%   External Dependencies: NA
%
%   Disclaimer
%   CAUTION: It is strongly recommended that changes to this code
%   should be avoided without first consulting with authors.


try
    fid = fopen(fullFile);
    if fid == -1
        errordlgMLS(sprintf('Cannot open file %s.',fullFile));
        time = [];
        return
    end
    time = getBladedTime_true(fid);
    fclose(fid);
catch
    fclose(fid);
    errordlgMLS(sprintf('An error occurred when reading %s', fullFile));
    time = [];
    return
end




function time = getBladedTime_true(fid)

while 1
    tline = lower(fgetl(fid));
    if ~ischar(tline)
        break;
    end
    if strfind(tline, 'ndimens')
        tline = strrep(tline, 'ndimens', '');
        ndimens = sscanf(tline, '%d');
        tline = lower(fgetl(fid));
        tline = strrep(tline, 'dimens', '');
        nInt = sscanf(tline, '%d');
        nInt = nInt(end);
    end
    if strfind(tline, 'step')
        tline = strrep(tline, 'step', '');
        step =  sscanf(tline, '%f');
        time = nInt*step;
    end
end

