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

add print/saveas menu on map with jpeg, png and epsc format

parent 5b1e87a7
No related branches found
No related tags found
No related merge requests found
TSG-QC Release notes
Contact: jacques.grelet@ird.fr
v1.48.5rc3 (2018-09-12)
v1.48.5rc4 (2018-09-12)
+ add 'debug' command line argument option
+ remove tsg_icon from matlabpath at the end of program tsgqc
+ swap and improve error message in read_Climatology function
......@@ -9,6 +9,7 @@ v1.48.5rc3 (2018-09-12)
+ remove/comment set(hAxes(PlotNum), 'YLimMode', 'auto'); in plot_Tsg.m
+ add print preview and print menu command on map
+ add hypertext link in Command Window to download climatology file when is missing
+ add print/saveas menu on map with jpeg, png and epsc format
v1.48.5rc2 (2018-09-06)
+ regression on labview read file: the use of lat_dec and lon_dec by default
......
......@@ -98,7 +98,11 @@ if ~isempty( ind )
% plot climatology mean contour if available
% ------------------------------------------
hdl = findobj( '-regexp', 'tag', 'PUSHTOOL_CLIM');
if strcmp(get(hdl, 'state'), 'on')
% plot climato on map only when the main pushtool button climato is
% selected
% -----------------------------------------------------------------
if strcmp(get(hdl, 'state'), 'on')
climato = tsg.levitus.data.(['WOA_MEAN_' tsg.plot.sample]);
% get last selected climatology structure
s = get(findobj('Tag', 'TAG_UIMENU_CLIMATO_MAIN'), 'Userdata');
......@@ -124,7 +128,7 @@ if ~isempty( ind )
lat = LATX(indLat);
% plot 2D climatogogy on map
if tsg.preference.map_climatology
if strcmp(tsg.preference.map_climatology, 'on')
m_pcolor(lon, lat, climato(indLat, indLon));
shading flat;
%colormap(m_colmap('jet','step',10));
......@@ -132,6 +136,8 @@ if ~isempty( ind )
else
colorbar('off');
end
else
colorbar('off');
end
% select map type and resolution
......@@ -254,7 +260,7 @@ if ~isempty( ind )
% Write title
% -----------
if tsg.preference.map_climatology % if climato selected on 2D map
if strcmp(tsg.preference.map_climatology, 'on') % if climato selected on 2D map
climato_title = sprintf(' - climatology: %s %s', tsg.levitus.version,...
tsg.levitus.type);
else
......
......@@ -169,7 +169,7 @@ return
preference.map_border_string = {'0','1','2','5','10','15'};
preference.map_border_value = 4;
preference.map_border = 5; % default
preference.map_climatology = 0;
preference.map_climatology = 'off';
preference.plot_connected_string = {'none', '-', '--', ':', '-.'};
preference.plot_connected_value = 1; % 0, line not connected
% QC test
......
......@@ -44,7 +44,7 @@ global DEBUGGING
% 0.90x -> 1.0RCx
% -------------------------------------------------------------------
VERSION = 1.485; % -> 1.44
CHAR_VERSION = '1.48.5RC3';
CHAR_VERSION = '1.48.5RC4';
DATE_VERSION = '10/09/2018';
% netcdf file version, see DATA FORMAT TSG document:
......@@ -801,6 +801,32 @@ uimenu(hMapResolutionMenu,'Label','High',...
hdl = flipud(findobj( '-regexp', 'tag', 'TAG_UIMENU_MAP_RESOLUTION_'));
set(hdl(tsg.preference.map_resolution), 'checked', 'on');
% display map Type menu
% ---------------------
hMapPatchMenu = uimenu(hMapFig,'Label','Type', ...
'Tag', 'TAG_UIMENU_MAP_PATCH');
% preset map patch menu from preference
if tsg.preference.map_patch_value == 2
chk_with_patch = 'on';
chk_without_patch = 'off';
else
chk_with_patch = 'off';
chk_without_patch = 'on';
end
uimenu(hMapPatchMenu,'Label','Map without patch (faster)',...
'Checked',chk_without_patch,...
'Tag','TAG_UIMENU_MAP_WITHOUT_PATCH',...
'Enable', 'on',...
'Callback', {@mapPatchMenuCallback, 0});
uimenu(hMapPatchMenu,'Label','Map with patch (slower)',...
'Checked',chk_with_patch,...
'Tag','TAG_UIMENU_MAP_WITH_PATCH',...
'Enable', 'on',...
'Callback', {@mapPatchMenuCallback, 1});
% display map Border menu
% ------------------------
hMapBorderMenu = uimenu(...
......@@ -849,57 +875,16 @@ uimenu(hMapBorderMenu,'Label','15',...
hdl = flipud(findobj( '-regexp', 'tag', 'TAG_UIMENU_MAP_BORDER_'));
set(hdl(tsg.preference.map_border_value), 'checked', 'on');
% map Type menu
% --------------
hMapPatchMenu = uimenu(hMapFig,'Label','Type', ...
'Tag', 'TAG_UIMENU_MAP_PATCH');
% preset map patch menu from preference
if tsg.preference.map_patch_value == 2
chk_with_patch = 'on';
chk_without_patch = 'off';
else
chk_with_patch = 'off';
chk_without_patch = 'on';
end
uimenu(hMapPatchMenu,'Label','Map without patch (faster)',...
'Checked',chk_without_patch,...
'Tag','TAG_UIMENU_MAP_WITHOUT_PATCH',...
'Enable', 'on',...
'Callback', {@mapPatchMenuCallback, 0});
uimenu(hMapPatchMenu,'Label','Map with patch (slower)',...
'Checked',chk_with_patch,...
'Tag','TAG_UIMENU_MAP_WITH_PATCH',...
'Enable', 'on',...
'Callback', {@mapPatchMenuCallback, 1});
% map Climatology menu
% --------------------
hMapClimatologyMenu = uimenu(hMapFig,'Label','Climatology', ...
'Tag', 'TAG_UIMENU_MAP_CLIMATOLOGY');
% preset map climatology menu from preference
if tsg.preference.map_climatology == 1
chk_with_climatology = 'on';
chk_without_climatology = 'off';
else
chk_with_climatology = 'off';
chk_without_climatology = 'on';
end
uimenu(hMapClimatologyMenu,'Label','Map with surface climatology',...
'Checked', chk_with_climatology,...
'Checked', tsg.preference.map_climatology,...
'Tag','TAG_UIMENU_MAP_CLIMATOLOGY_WITH',...
'Enable', 'on',...
'Callback', {@mapClimatologyCallback, 1});
% uimenu(hMapClimatologyMenu,'Label','Map without surface climatology',...
% 'Checked', chk_without_climatology,...
% 'Tag','TAG_UIMENU_MAP_CLIMATOLOGY_WITHOUT',...
% 'Enable', 'on',...
% 'Callback', {@mapClimatologyCallback, 0});
'Callback', {@mapClimatologyCallback});
% map Print menu
% --------------------
......@@ -915,6 +900,10 @@ uimenu(hMapPrintMenu,'Label','Print',...
'Accelerator','P',...
'Callback', {@mapPrintCallback});
uimenu(hMapPrintMenu,'Label','Save as',...
'Tag','TAG_UIMENU_MAP_PRINT_SAVEAS',...
'Callback', {@mapSaveAsCallback});
% set map axes
% ------------
hPlotAxes(4) = axes(... % the axes for plotting ship track map
......@@ -3712,7 +3701,7 @@ end
end
%% function mapDynaBorderCallback
% function mapDynaBorderCallback
% --------------------------------
function mapDynaBorderCallback(src, evnt, border)
......@@ -3731,21 +3720,32 @@ end
plot_map(hMainFig, hPlotAxes);
end
% display 2D climatology on map if pushbutton climato is on
% ---------------------------------------------------------
function mapClimatologyCallback(src, evnt, climato)
hdl = findobj( '-regexp', 'tag', 'TAG_UIMENU_MAP_CLIMATOLOGY_');
set(hdl, 'Checked', 'off');
set(src, 'Checked', 'on');
if strcmp(get(src, 'checked'), 'on')
set(src, 'checked', 'off')
tsg.preference.map_climatology = 'off';
elseif strcmp(get(hClimToggletool, 'state'), 'on')
set(src, 'Checked', 'on');
% change the map 2D climatology from menu on map
% --------------------------------------
tsg.preference.map_climatology = 'on';
else
set(src, 'Checked', 'off');
end
% change the map 2D climatology from menu on map
% --------------------------------------
tsg.preference.map_climatology = climato;
% save tsg.preference.map_climatology
% -----------------------------------
setappdata( hMainFig, 'tsg_data', tsg);
% redraw map
% ------------------------------------------
erase_Line( hPlotAxes, 4 );
plot_map(hMainFig, hPlotAxes);
end
% print map figure from menu
......@@ -3754,10 +3754,17 @@ end
printdlg(get(hPlotAxes(4),'parent'));
end
function mapPrintPreviewCallback(src, evnt)
function mapPrintPreviewCallback(src, evnt)
printpreview(get(hPlotAxes(4),'parent'));
end
function mapSaveAsCallback(src, evnt)
[file, path] = uiputfile({'*.jpeg';'*.png';'*.epsc'});
saveas(get(hPlotAxes(4),'parent'), fullfile(path,file));
fprintf(1, 'Save figure map as %s\n', fullfile(path,file));
end
%% HeaderMenuCallback
% -------------------------------------------------------------------
% Callback function run when the headerForm tool bar item is selected
......
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