diff --git a/TSGQC_amelioration.xls b/TSGQC_amelioration.xls index e0a531013f70bd481ae4b82c72cc264ca50b9e59..1715d17e42917d732906c7467157dff607602f40 100644 Binary files a/TSGQC_amelioration.xls and b/TSGQC_amelioration.xls differ diff --git a/tsg_data/touc0702.nc b/tsg_data/touc0702.nc index d15ef6c5a3535e5d91918179875a1a1e05756809..b519783eb51ecebd1377f8bc408ae73731c7ef18 100644 Binary files a/tsg_data/touc0702.nc and b/tsg_data/touc0702.nc differ diff --git a/tsg_util/display_QC.m b/tsg_util/display_QC.m index 369f29cf132e94b76d0465dc7fc1205990075eb1..ef9fb4d669a517fbaa7882f4cc0236940968c992 100644 --- a/tsg_util/display_QC.m +++ b/tsg_util/display_QC.m @@ -1,11 +1,10 @@ -function display_QC( hGUI, hAxes ) +function display_QC( hMainFig ) % -% Function to plot the Water Sample measurements +% Function to refresh QC statistic panel % % Input % ----- % hGUI ............... Handel to the user interface -% hAxes .............. Handels to the graphic axes % % Output % ------ @@ -13,26 +12,11 @@ function display_QC( hGUI, hAxes ) % Retrieve named application data % ------------------------------- -tsg = getappdata( hGUI, 'tsg_data'); +tsg = getappdata( hMainFig, 'tsg_data'); % get panel handle % ---------------- -hdlPanel = findobj(hGUI, 'tag', 'TAG_QC_DISPLAY_PANEL'); - -% get color axes and set 'BackgroundColor' properties of panel handle -% give a transparency effect -% ------------------------------------------------------------------- -%bgColor = get(hAxes(1), 'Color'); -%set(hdlPanel, 'BackgroundColor', bgColor); - -% and to his chlidren uicontrol -% ----------------------------- -%set(findobj(get(hdlPanel,'children'),'style','text'),... -% 'BackgroundColor', bgColor) - -% set panel visible -% ----------------- -%set(hdlPanel, 'visible', 'on'); +hdlPanel = findobj(hMainFig, 'tag', 'TAG_QC_DISPLAY_PANEL'); % get list of keys from hashtable tsg.qc.hash, defined inside % tsg_initialisation.m @@ -42,19 +26,19 @@ qc_list = keys(tsg.qc.hash); % iterate (loop) on each key store inside hastable % ------------------------------------------------ for key = qc_list - + % get some values in hashtable % ------------------------------------ code = tsg.qc.hash.(key).code; - + % get the uicontrol handle from tag construct with key % ---------------------------------------------------- - hdlText = findobj(hGUI, 'tag', ['TAG_QC_TEXT_' char(key)]); - + hdlText = findobj(hMainFig, 'tag', ['TAG_QC_TEXT_' char(key)]); + % find number of sample flag with this QC code % -------------------------------------------- ind = find(tsg.SSPS_QC == code); - + % if index empty, no data with this flag, set field to zero (char) % ---------------------------------------------------------------- if isempty(ind) @@ -65,4 +49,5 @@ for key = qc_list end - +drawnow + diff --git a/tsg_util/preferencesForm.m b/tsg_util/preferencesForm.m index 0bb270bd69078a4a5e0e8acc4a16129d18070b2c..c3e04efa7bb7b86d60cb5a70b1c024dce64af69d 100644 --- a/tsg_util/preferencesForm.m +++ b/tsg_util/preferencesForm.m @@ -329,14 +329,17 @@ uiwait(hPreferencesFig); % ------------------- minSpeedQC(hTsgGUI); - % close windows (replace call to uiresume(hHeaderFig)) % ---------------------------------------------------- close(hPreferencesFig); % flushes the event queue and updates the figure window % ----------------------------------------------------- - drawnow; + drawnow; + + % refresh QC statistic panel + % -------------------------- + display_QC( hTsgGUI ); % return with no error code (true) % -------------------------------- diff --git a/tsgqc.m b/tsgqc.m index 2588d3bf5ae79f2b8a06737600c29f5abb695843..5a868890bd04210fa797861ec6f5eb3d780ab640 100644 --- a/tsgqc.m +++ b/tsgqc.m @@ -1232,7 +1232,7 @@ hrbInterpCancel = uicontrol( ... % Update QC statistics % -------------------- - display_QC( hMainFig, hPlotAxes); + display_QC( hMainFig ); % Initialise the popupmenu displaying the parameters that can be % plot @@ -1910,8 +1910,12 @@ hrbInterpCancel = uicontrol( ... % ------------------------------- tsg = getappdata( hMainFig, 'tsg_data'); - PARA = tsg.plot.parameter{1}; + PARA = getParaCorModule( hMainFig ); SAMPLE = tsg.plot.sample; + + % refresh QC statistic panel + % -------------------------- + display_QC( hMainFig ); % Activate right clic context menu on first axes (salinity) % --------------------------------------------------------- @@ -1989,7 +1993,7 @@ hrbInterpCancel = uicontrol( ... % get index on selected zone % --------------------------- ind = find(tsg.DAYD > p1(1,1) & tsg.DAYD < p2(1,1) & ... - tsg.(PARA) > p1(1,2) & tsg.(PARA) < p2(1,2)); + tsg.(PARA{1}) > p1(1,2) & tsg.(PARA{1}) < p2(1,2)); % Keep the information on the indices of the selected zone % -------------------------------------------------------- @@ -1997,7 +2001,7 @@ hrbInterpCancel = uicontrol( ... % Modifiy the QC % -------------- - tsg.([PARA '_QC'])(ind) = tsg.qc.active.Code; + tsg.([PARA{1} '_QC'])(ind) = tsg.qc.active.Code; % put last SSPS_QC in queue (Undo/Redo) % ------------------------------------- @@ -2013,11 +2017,11 @@ hrbInterpCancel = uicontrol( ... % Draw plot 1 of the validation figure % ------------------------------------ - plot_Validation( hMainFig, hPlotAxes, 1, PARA ); + plot_Validation( hMainFig, hPlotAxes, 1, PARA{1} ); % refresh QC statistic panel % -------------------------- - display_QC( hMainFig, hPlotAxes ); + display_QC( hMainFig ); % enable undo menu % ---------------- @@ -2087,7 +2091,7 @@ hrbInterpCancel = uicontrol( ... % Get the parameter (SSPS, SSJT or SSTP) % -------------------------------------- - PARA = tsg.plot.parameter{1}; + PARA = getParaCorModule( hMainFig ); SAMPLE = tsg.plot.sample; % get key and some values in hashtable @@ -2118,7 +2122,7 @@ hrbInterpCancel = uicontrol( ... plot_Correction( hMainFig, hPlotAxes, PARA ); else - tsg.([PARA '_QC'])(tsg.rbboxind) = tsg.qc.active.Code; + tsg.([PARA{1} '_QC'])(tsg.rbboxind) = tsg.qc.active.Code; % Save tsg.SSPS_QC in the application data % ---------------------------------------- @@ -2126,7 +2130,7 @@ hrbInterpCancel = uicontrol( ... % Draw plot 1 of the validation figure % ------------------------------------ - plot_Validation( hMainFig, hPlotAxes, 1, PARA ); + plot_Validation( hMainFig, hPlotAxes, 1, PARA{1} ); end @@ -2135,13 +2139,15 @@ hrbInterpCancel = uicontrol( ... % Update the radio button corresponding to the selected % QC context menu (rbg : RadioButtonGroup) % ----------------------------------------------------- - radioTag = ['TAG_QC_RADIO_' key]; % Build the TAG of the CODE - hbgChildren = get(hbgQc,'Children'); % Get the handles of the rbg - hbgTagCell = get(hbgChildren, 'tag'); % get the TAG of the rbg - ind = strcmp(radioTag, hbgTagCell); % Compare the TAG - hRadioButton = hbgChildren( ind == 1 ); % Get the handle of the button - set(hbgQc, 'SelectedObject', hRadioButton); % Make this button active - +% radioTag = ['TAG_QC_RADIO_' key]; % Build the TAG of the CODE +% hbgChildren = get(hbgQc,'Children'); % Get the handles of the rbg +% hbgTagCell = get(hbgChildren, 'tag'); % get the TAG of the rbg +% ind = strcmp(radioTag, hbgTagCell); % Compare the TAG +% hRadioButton = hbgChildren( ind == 1 ); % Get the handle of the button +% set(hbgQc, 'SelectedObject', hRadioButton); % Make this button active + + display_QC( hMainFig); + setappdata( hMainFig, 'tsg_data', tsg ); end @@ -2910,9 +2916,8 @@ hrbInterpCancel = uicontrol( ... if strcmp(get(hBottleToggletool,'state'), 'on') % Default parameter - % ATTENTION au cas ou (PARA)_CAL existe - A implementer % ----------------------------------------------------- - PARA = tsg.plot.parameter{1}; + PARA = getParaCorModule( hMainFig ); plot_Correction( hMainFig, hPlot, PARA );