Newer
Older
function updateSampleQC( hTsgGUI, PARA )
Yves Gouriou
committed
%
% Update the QC code for WS and EXT samples
%
% Input
% hTsgGui ........... Handle of the main GUI project
% ind ............... Indices of the QC modified in tsg.SSPS_SPL
%
% Ouput
% Date are updated throught the setappdata MAtlab function
%
% Get the tsgstructure from the application
% -----------------------------------------
tsg = getappdata( hTsgGUI, 'tsg_data');
% Update WS QC
% ------------
ind = 1: length( tsg.([PARA '_SPL_TYPE']));
indWS = strmatch( 'WS', tsg.([PARA '_SPL_TYPE']), 'exact');
Yves Gouriou
committed
if ~isempty(indWS)
tsg.([PARA '_WS_QC'])(tsg.INDICE_SPL(indWS)) = tsg.([PARA '_SPL_QC'])(indWS);
Yves Gouriou
committed
end
% Update EXT QC - No SSJT parameter for EXT sample.
% -------------------------------------------------
PARA_UPDATE = 'SSPS';
if strcmp( PARA, 'SSJT' )
PARA_UPDATE = 'SSTP';
tsg.SSTP_SPL_QC = tsg.SSJT_SPL_QC;
end
indEXT = setxor(ind, indWS);
Yves Gouriou
committed
if ~isempty(indEXT)
tsg.([PARA_UPDATE '_EXT_QC'])(tsg.INDICE_SPL(indEXT)) = ...
tsg.([PARA '_SPL_QC'])(indEXT);
Yves Gouriou
committed
end
% update the tsg structure in the application
% -------------------------------------------
setappdata( hTsgGUI, 'tsg_data', tsg );
end