From 9864465054d5d83c056fcc4f7bc0446205c08550 Mon Sep 17 00:00:00 2001 From: Jacques Grelet <jacques.grelet@ird.fr> Date: Mon, 22 Nov 2010 19:54:53 +0000 Subject: [PATCH] When read a .tsgqc file, if exist read Labview configuration file .ini to get metadata --- tsg_io/readAsciiTsg.m | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tsg_io/readAsciiTsg.m b/tsg_io/readAsciiTsg.m index de117b7..bfe6321 100644 --- a/tsg_io/readAsciiTsg.m +++ b/tsg_io/readAsciiTsg.m @@ -166,6 +166,35 @@ automaticQC( hMainFig ); tsg.file.type = 'ASCII'; +% check if .ini file exist in data +% -------------------------------- +file_ini = fullfile(tsg.file.pathstr, strcat(tsg.file.name, '.ini')); + +% check if filename exist and should be open in read mode +% ------------------------------------------------------- +file_ini_id = fopen(file_ini, 'r'); + +if (file_ini_id ~= -1) + + % display information on command window + % -------------------------------------- + fprintf('\n...reading %s : ', file_ini); + + % Save the data in the application GUI + % ------------------------------------ + setappdata( hMainFig, 'tsg_data', tsg ); + + % read .ini file + % -------------- + readTsgIniLabview(hMainFig, file_ini_id); + + % Get the tsg struct from the application GUI + % ------------------------------------------- + tsg = getappdata( hMainFig, 'tsg_data'); + +end + + % Save the data in the application GUI % ------------------------------------ setappdata( hMainFig, 'tsg_data', tsg ); -- GitLab