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

Use new annual climatology WOA01 NetCDF file, download it from:

ftp://ftp.ifremer.fr/ifremer/ird/us191/oceano/lib/matlab/woa01_annual_surf.nc
add some code for undo/paste in QC mode, dosn't work at this time
parent 181c39ab
No related branches found
No related tags found
No related merge requests found
......@@ -94,8 +94,8 @@ tsg_initialisation(hMainFig)
% -------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
%% Construct the Menu
% -----------------
%% Construct Menu File
% -------------------
hFileMenu = uimenu(...
'Parent', hMainFig,...
'HandleVisibility','callback',...
......@@ -123,23 +123,23 @@ hQuitMenu = uimenu(...
'HandleVisibility','callback',...
'Callback',@QuitMenuCallback);
% Edit menu with Undo/Redo submenu
% --------------------------------
%% Construct Menu Edit with Undo/Redo submenu
% --------------------------------------------
hEditMenu = uimenu(hMainFig,'Label','Edit');
uimenu(hEditMenu,'Label','Undo',...
'Accelerator','Z',...
'Tag','Undo',...
'Tag','UIMENU_UNDO',...
'Enable', 'off',...
'Callback',@UndoMenuCallback);
uimenu(hEditMenu,'Label','Redo',...
'Accelerator','R',...
'Tag','Redo',...
'Tag','UIMENU_REDO',...
'Enable', 'off',...
'Callback',@RedoMenuCallback);
%% Construct the Toolbar
% -----------------
% ---------------------
hToolbar = uitoolbar(... % Toolbar for Open and Print buttons
'Parent',hMainFig, ...
'HandleVisibility','on');
......@@ -473,7 +473,7 @@ hbgQc = uibuttongroup(...
'FontSize', tsg.fontSize-1, ...
'Fontweight', 'bold', ...
'tag', 'TAG_QC_DISPLAY_PANEL',...
'HandleVisibility','on',...
'HandleVisibility','off',...
'Visible', 'on',...
'BorderType', 'etchedin',...
'Position', [.0, .71, .15, .25]);
......@@ -512,8 +512,8 @@ for i=1:numel(qc_list)
% ---------------------------------------------------------
if strcmp( state, 'on')
% add menu to uicontextmenu
% -------------------------
% add menu to hQcCmenu uicontextmenu
% ----------------------------------
uimenu(...
'Parent', hQcCmenu,...
'HandleVisibility','on', ...
......@@ -521,8 +521,8 @@ for i=1:numel(qc_list)
'ForegroundColor', color,...
'Callback', {@Qc, key});
% add button QC on hbgQc Button group
% -----------------------------------
% add button QC to hbgQc uibuttongroup
% ------------------------------------
uicontrol(...
'Parent', hbgQc,...
'Style', 'radiobutton',...
......@@ -861,7 +861,11 @@ hetDateMax = uicontrol( ...
% Desactive clic mouse menu (zoom) on first axes (salinity)
% ----------------------------------------------------------
set(hPlotAxes(1),'ButtonDownFcn', []);
% % No selection on uibuttongroup QC
% % --------------------------------
% set(hbgQc,'SelectedObject',[]);
% cursor back to normal
% ---------------------
set(hMainFig,'Pointer','arrow');
......@@ -879,6 +883,11 @@ hetDateMax = uicontrol( ...
set(hZoomToggletool, 'state', 'off' );
set(hPanToggletool, 'state', 'off' );
% % Activate previously radiobutton selected on uibuttongroup QC
% % ------------------------------------------------------------
% tmp = get(hbgQc,'Userdata');
% set(hbgQc,'SelectedObject',tmp);
% Activate right clic context menu on first axes (salinity)
% ---------------------------------------------------------
set(hPlotAxes(1),'UIContextMenu', hQcCmenu);
......@@ -891,6 +900,8 @@ hetDateMax = uicontrol( ...
% ---------------------------------
set( hMainFig, 'Pointer', 'crosshair');
% Active keyPress/release callback in QC mode for PAN and Zoom
% ------------------------------------------------------------
%set( hMainFig, 'KeyReleaseFcn', @QC_keyReleaseCallback);
......@@ -948,46 +959,27 @@ hetDateMax = uicontrol( ...
% -------------------------------------------------------------
set( hSaveMenu, 'UserData', 'on' );
% refresh QC statistic panel
% --------------------------
display_QC( hMainFig, hPlotAxes );
% store QC in queue object, for undo
% ----------------------------------
tsg.queue = push(tsg.queue, tsg.SSPS_QC);
% Save the modifications
% ----------------------
setappdata( hMainFig, 'tsg_data', tsg);
% refresh QC statistic panel
% --------------------------
display_QC( hMainFig, hPlotAxes );
% enable undo menu
% ----------------
set(findobj('tag','UIMENU_UNDO'),'enable','on');
% enable ButtonMotion on main fig after select QC area
% ----------------------------------------------------
set( hMainFig, 'WindowButtonMotionFcn', @MouseMotion);
end
% -------------------------------------------------------------
% nested function on keypress when QC selected
% -------------------------------------------------------------
% function QC_keyReleaseCallback(gcbo, evnt)
% out = sprintf('Character: %c\nKey: %s\n',evnt.Character,evnt.Key);
% disp(out)
% if strcmp(evnt.Key, 'control')
% panState = get(hZoomToggletool, 'state');
% if strcmp(panState, 'on')
% set(hZoomToggletool, 'state', 'off' );
% set(hQCToggletool, 'state', 'on' );
% else
% set(hZoomToggletool, 'state', 'on' );
% end
% end
% set( hMainFig, 'KeyReleaseFcn', @QC_keyReleaseCallback);
% end
% -------------------------------------------------------------
% nested function on keyRelease when QC selected
% -------------------------------------------------------------
% function QC_keyReleaseCallback(gcbo, event)
% if strcmp(event.Key, 'control')
% set(hPanToggletool, 'state', 'off' );
% end
% end
end
%% Qc context menu selected
......@@ -1024,11 +1016,15 @@ hetDateMax = uicontrol( ...
% ---------------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
% Retrieve the Kye frome the active RadioButton
% ---------------------------------------------
% Retrieve the key from the active RadioButton
% --------------------------------------------
rbTag = get(eventdata.NewValue,'Tag');
key = strrep(rbTag, 'TAG_QC_RADIO_', '');
% store his handle to uibuttongroup userdata
% ------------------------------------------
set(hbgQc,'Userdata', eventdata.NewValue);
% get key and some values in hashtable
% ------------------------------------
code = get(tsg.qc.hash, key, 'code');
......@@ -1389,11 +1385,11 @@ end
% Read Climatology
% ----------------
if isempty( tsg.levitus.data)
levitus = read_file_woa01( 'woa01an.nc' );
levitus = read_file_woa01( 'woa01_annual_surf.nc' );
if ~isstruct(levitus)
errordlg({'NetCDF climatology file not present in you path',...
'Check your matlab path or download it from',...
'ftp://ftp.ifremer.fr/ifremer/ird/us191/oceano/lib/matlab/woa01an.nc'},...
'ftp://ftp.ifremer.fr/ifremer/ird/us191/oceano/lib/matlab/woa01_annual_surf.nc'},...
'NetCDF climatology file access error');
return;
else
......@@ -1601,8 +1597,15 @@ end
% Undo module not yet implemented
% -------------------------------
msgbox('Undo module not yet implemented', 'modal');
% msgbox('Undo module not yet implemented', 'modal');
tsg.queue = undo(tsg.queue);
tsg.SSPS_QC = get(tsg.queue);
% Make the Salinity, temperature and velocity plot
% ------------------------------------------------
plot_SalTempVel( hMainFig, hPlotAxes );
end
%% RedoMenuCallback
......
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