diff --git a/tsg_io/readAsciiTsg.m b/tsg_io/readAsciiTsg.m index 69ec00f9382dc9b0bae1d85c712e8012b5b1fc69..de3d134b60c22fbce963672f277e74e0c0594003 100644 --- a/tsg_io/readAsciiTsg.m +++ b/tsg_io/readAsciiTsg.m @@ -14,6 +14,21 @@ function [error] = readAsciiTsg( hMainFig, filename ) % % $Id$ +% use waitbar per default +% ---------------------- +wbool = true; + +% update waitbar title with Tex mode disable +% ------------------------------------------ +if wbool + %set(0,'DefaulttextInterpreter','none') + msg = sprintf('Loading file %s. Please wait...', filename); + wb = waitbar(0, msg); + hchild = get(wb,'children'); + htitle = get(hchild,'title'); + set(htitle,'Interpreter','None'); +end + % Get the data from the application GUI % ------------------------------------- tsg = getappdata( hMainFig, 'tsg_data'); @@ -96,15 +111,12 @@ while ~OK end end -% Builld the format depending on the header parameters +% Build the format depending on the header parameters % 1 - Decimate the HEADER - The 7th first parameters are always % %HEADER YEAR MNTH DAYX hh mm ss % 2 - The 6 Date and time parametes are read in %d % ------------------------------------------------------------- -format = '%d %d %d %d %d %d'; -for i = 7 : nHeader - format = [format ' %f']; -end +format = strcat('%d %d %d %d %d %d', repmat(' %f', 1, nHeader - 6)); % Read the data in a cell % ----------------------- @@ -114,6 +126,18 @@ cellData = textscan( fid, format ); % --------------------------- s = cell2struct(cellData, header, 2); +% get the number of line read +% ---------------------------- +nlines = length(s.YEAR); + +% moves the waitbar cursor +% ------------------------ +for i=1 : nlines + if wbool && (mod(i, 100) == 0) + waitbar( i/nlines, wb); + end +end + clear cellData % Date (y m d h m s) in the first 6 elements in data @@ -142,7 +166,7 @@ for i = 7 : nHeader else tsg.(char(header(i))) = s.(char(header(i))); end - + end % populate tsg.file structure @@ -168,7 +192,7 @@ if (file_ini_id ~= -1) % display information on command window % -------------------------------------- - fprintf('\n...reading %s : ', file_ini); + fprintf('\n...reading %s : %s lines', file_ini, nlines - 1); % Save the data in the application GUI % ------------------------------------ @@ -197,6 +221,12 @@ fclose( fid ); % ------------------------------------ t = toc; fprintf('...done (%6.2f sec).\n\n',t); +% Close waitbar +% ------------- +if wbool + close(wb) +end + % Everything OK % ------------- error = 1; diff --git a/tsg_util/aboutDialog.m b/tsg_util/aboutDialog.m index 10772ba82c45dcf63862b2f476305044be3b361b..d0a2e5c9f6a604a1ecf8a3317f8f262affb284e3 100644 --- a/tsg_util/aboutDialog.m +++ b/tsg_util/aboutDialog.m @@ -65,13 +65,15 @@ hRightPanel = uipanel( ... 'ButtonDownFcn', @quitAboutCallback); % display info in botom panel +msg = sprintf( 'TSGQC Version : %s - GOSUD format: %s', ... + tsg.preference.char_version, tsg.FORMAT_VERSION) uicontrol('Parent', hBottomPanel, ... 'Style','text',... 'FontSize', 14, ... 'Units','normalized',... 'Position',[.1 .1 .9 .5],... 'FontWeight','bold',... - 'String',strcat('TSGQC Version : ', ' ', tsg.preference.char_version),... + 'String', msg,... 'HorizontalAlignment','center'); % display info in right panel diff --git a/tsgqc.m b/tsgqc.m index 23a25921ec6275d1ea926dac965c96bf4b0536b6..7359f6117ca5d5cc11c296ee7e3c0b267c039606 100644 --- a/tsgqc.m +++ b/tsgqc.m @@ -37,8 +37,8 @@ global GOSUD_FORMAT_VERSION % version number, may be used to initialize some files when it change % 0.90x -> 1.0RCx % ------------------------------------------------------------------- -VERSION = 1.3; % -> 1.3 -CHAR_VERSION = '1.3'; +VERSION = 1.301; % -> 1.3 +CHAR_VERSION = '1.301'; % netcdf file version, see DATA FORMAT TSG document: % CORTSG_format_gosud.doc