Skip to content
Snippets Groups Projects
Commit 351edfab authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

move QC display uicontrol on same loop than context menu

add internal counter inside loop to uicontrol positionning
change uipanel QC display position
parent 9ae2e669
No related branches found
No related tags found
No related merge requests found
......@@ -419,7 +419,17 @@ hPlotAxes(4) = axes(... % the axes for plotting ship track map
'Position',[.05, .05, .9, .9]);
%% Construct the context menu for the Quality control codes
% Construct display Quality codes panel
% -------------------------------------
hQcPanel = uipanel(...
'Parent', hMainFig, ...
'tag', 'TAG_QC_DISPLAY_PANEL',...
'HandleVisibility','on',...
'Visible', 'off',...
'BorderType', 'none',...
'Position', [.85, .80, .1, .13]);
% Construct the context menu for the Quality control codes
% -------------------------------------------------------
hQcCmenu = uicontextmenu(...
'Parent', hMainFig, ...
......@@ -430,6 +440,10 @@ hQcCmenu = uicontextmenu(...
% -----------------------------------------------------------
qc_list = get(tsg.qc.hash);
% internal loop count with state to on
% ------------------------------------
count = 0;
% iterate (loop) on each key store inside hastable
% ------------------------------------------------
for i=1:numel(qc_list)
......@@ -453,36 +467,9 @@ for i=1:numel(qc_list)
'Label', label,...
'ForegroundColor', color,...
'Callback', {@Qc, key});
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
% -------------------------
% add text QC display label on hQcPanel
% ------------------------------------
uicontrol(...
'Parent', hQcPanel,...
'Style', 'text',...
......@@ -493,10 +480,10 @@ for i=1:numel(qc_list)
'HandleVisibility','on', ...
'String', label,...
'ForegroundColor', color,...
'Position', [.1, .9-i*.12, .5, 0.12]);
'Position', [.1, .9-count*.12, .7, 0.12]);
% add edit QC display
% -------------------
% add text QC display statistic on hQcPanel
% -----------------------------------------
uicontrol(...
'Parent', hQcPanel,...
'Style', 'text',...
......@@ -508,7 +495,11 @@ for i=1:numel(qc_list)
'String', 'N/A',...
'ForegroundColor', color,...
'Tag', ['TAG_QC_TEXT_' key],...
'Position', [.7, .9-i*.12, .3, 0.12]);
'Position', [.7, .9-count*.12, .25, 0.12]);
% increment count
% ---------------
count = count + 1;
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment