From c0694e0a96a61f39bb411d58c40174f99e11a551 Mon Sep 17 00:00:00 2001 From: Jacques Grelet <jacques.grelet@ird.fr> Date: Thu, 17 Jan 2008 15:57:58 +0000 Subject: [PATCH] =?UTF-8?q?joute=20une=20fonction=20d'affichache=20des=20s?= =?UTF-8?q?tatistiques=20sur=20les=20codes=20de=20qualit=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsg_util/plot_SalTempVel.m | 24 +++++--------- tsgqc_GUI.m | 64 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 17 deletions(-) diff --git a/tsg_util/plot_SalTempVel.m b/tsg_util/plot_SalTempVel.m index 2c2a8ea..8bb112c 100644 --- a/tsg_util/plot_SalTempVel.m +++ b/tsg_util/plot_SalTempVel.m @@ -53,22 +53,12 @@ for i=1:numel(qc_list) strcat('.', color)); end end -% ind = find(tsg.SSPS_QC == tsg.qc.Code.GOOD ); -% plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... -% strcat('.',tsg.qc.Color.GOOD)); -% -% ind = find(tsg.SSPS_QC == tsg.qc.Code.PROBABLY_GOOD ); -% plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... -% strcat('.',tsg.qc.Color.PROBABLY_GOOD)); -% -% ind = find(tsg.SSPS_QC == tsg.qc.Code.PROBABLY_BAD ); -% plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... -% strcat('.',tsg.qc.Color.PROBABLY_BAD)); -% -% ind = find(tsg.SSPS_QC == tsg.qc.Code.BAD ); -% plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... -% strcat('.',tsg.qc.Color.BAD)); -hold off; + +hold off; + +% refresh QC statistic panel +% -------------------------- +display_QC( hTsgGUI, hAxes ); % set HandleVisibility 'On' to 'Callback' on first axes % ----------------------------------------------------- @@ -88,7 +78,7 @@ datetick(hAxes(3), 'x'); % Write some 'Y' label % ------------------ set(get(hAxes(1), 'Ylabel'), 'String', 'Salinity'); -set(get(hAxes(2), 'Ylabel'), 'String', 'Temperature (°C)'); +set(get(hAxes(2), 'Ylabel'), 'String', 'Temperature (�C)'); set(get(hAxes(3), 'Ylabel'), 'String', 'Ship Velocity (knots)'); % Make the axes visible diff --git a/tsgqc_GUI.m b/tsgqc_GUI.m index d897b02..b4b4c3b 100644 --- a/tsgqc_GUI.m +++ b/tsgqc_GUI.m @@ -456,6 +456,63 @@ for i=1:numel(qc_list) end end +%% Construct display Quality codes +% -------------------------------- +hQcPanel = uipanel(... + 'Parent', hMainFig, ... + 'tag', 'TAG_QC_DISPLAY_PANEL',... + 'HandleVisibility','on',... + 'Visible', 'off',... + 'BorderType', 'none',... + 'Position', [.85, .75, .1, .15]); + +% iterate (loop) on each key store inside hastable +% ------------------------------------------------ +for i=1:numel(qc_list) + + % get key and some values in hashtable + % ------------------------------------ + key = qc_list{i}; + label = get(tsg.qc.hash, key, 'label'); + color = get(tsg.qc.hash, key, 'color'); + state = get(tsg.qc.hash, key, 'state'); + + % construct context menu with only code set to 'on' (valid) + % --------------------------------------------------------- + if strcmp( state, 'on') + + % add text QC display label + % ------------------------- + uicontrol(... + 'Parent', hQcPanel,... + 'Style', 'text',... + 'Units', 'normalized', ... + 'Style', 'Text', ... + 'Fontsize', 11, ... + 'HorizontalAlignment', 'left', ... + 'HandleVisibility','on', ... + 'String', label,... + 'ForegroundColor', color,... + 'Position', [.1, .9-i*.12, .5, 0.12]); + + % add edit QC display + % ------------------- + uicontrol(... + 'Parent', hQcPanel,... + 'Style', 'text',... + 'Units', 'normalized', ... + 'Style', 'Text', ... + 'Fontsize', 11, ... + 'HorizontalAlignment', 'right', ... + 'HandleVisibility','on', ... + 'String', 'N/A',... + 'ForegroundColor', color,... + 'Tag', ['TAG_QC_TEXT_' key],... + 'Position', [.7, .9-i*.12, .3, 0.12]); + end +end + + % ------------------------- % Callbacks for tsgcqc_GUI % ------------------------ @@ -736,6 +793,9 @@ end axes(hPlotAxes(1)); hold on color = ['.' tsg.qc.active.Color]; + + % plot selected data with selected code + % -------------------------------------- plot(tsg.DAYD(ind), tsg.SSPS(ind), color ); hold off @@ -747,6 +807,10 @@ end % ---------------------- setappdata( hMainFig, 'tsg_data', tsg); + % refresh QC statistic panel + % -------------------------- + display_QC( hMainFig, hPlotAxes ); + % enable ButtonMotion on main fig after select QC area % ---------------------------------------------------- set( hMainFig, 'WindowButtonMotionFcn', @MouseMotion); -- GitLab