diff --git a/tsg_util/plot_SalTempVel.m b/tsg_util/plot_SalTempVel.m index 2c2a8eab29ad1530af77e26a0b35fbde758e3c26..8bb112cd7039c4df01661518005588f04b50f023 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 d897b02b645ff66ccc49152d2b476edda0d9985b..b4b4c3bcff73f63d27c67fa3aa39467454ee03fc 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);