diff --git a/tsg_util/plot_map.m b/tsg_util/plot_map.m index 601776476df412e66a5f290360a6f8ce18762769..3066913c93447d5249d467ee79467ce4155051ce 100644 --- a/tsg_util/plot_map.m +++ b/tsg_util/plot_map.m @@ -12,11 +12,11 @@ function plot_map(hTsgGUI, hPlotAxes) % Library : 'M_MAP' % % TO DO -% note that a decimal degree notation is used, so that a longitude of 120° +% note that a decimal degree notation is used, so that a longitude of 120� % 30'W is specified as -120.5 % % PROBLEM NOT YET RESOLVED -% Does M_MAP use 0-360° or -180°-180° covention ? +% Does M_MAP use 0-360� or -180�-180� covention ? % % $Id$ @@ -52,18 +52,32 @@ if ~isempty( ind ) % Use of Mercator projection % -------------------------- - %m_proj('Mercator','lat',[-70 70],'long',[-180 180]); m_proj('Mercator','lat',[latMin latMax],'long',[lonMin lonMax]); - % detailed coast lines - % m_gshhs_i('patch',[.7 .7 .7]); + switch tsg.preference.map_resolution - % Less detailed coast lines - %m_gshhs_l('patch',[.7 .7 .7]); + case 1 + % Low-resolution coast lines + % -------------------------- + m_coast('patch',[.7 .7 .7], 'TAG', 'TAG_PLOT4_LINE_COAST'); - % Lesser detailed coast lines - % ---------------------------- - m_coast('patch',[.7 .7 .7], 'TAG', 'TAG_PLOT4_LINE_COAST'); + case 2 + % Medium-resolution coast lines + % ----------------------------- + m_gshhs_l('patch',[.7 .7 .7], 'TAG', 'TAG_PLOT4_LINE_COAST'); + + case 3 + % High-resolution coast lines + % ---------------------------- + m_gshhs_i('patch',[.7 .7 .7], 'TAG', 'TAG_PLOT4_LINE_COAST'); + + otherwise + tsg.preference.map_resolution=1; + % Low-resolution coast lines + % -------------------------- + m_coast('patch',[.7 .7 .7], 'TAG', 'TAG_PLOT4_LINE_COAST'); + + end %m_grid('box','fancy','tickdir','in', ... % 'ytick', [-70:20:70],... @@ -74,7 +88,7 @@ if ~isempty( ind ) % Plot the ship track - Check if LAT-LON in deg-decimal % ----------------------------------------------------- %m_line(tsg.LONX,tsg.LATX, 'TAG', 'TAG_PLOT4_LINE_SHIPTRACK', 'marker','.','markersize',3,'color','b'); -% m_line(tsg.LONX,tsg.LATX, 'LineStyle', 'none', 'marker','*','markersize',2,'color','b'); + % m_line(tsg.LONX,tsg.LATX, 'LineStyle', 'none', 'marker','*','markersize',2,'color','b'); % Plot using QC % ------------- diff --git a/tsg_util/preferencesForm.m b/tsg_util/preferencesForm.m index c3e04efa7bb7b86d60cb5a70b1c024dce64af69d..7332bdf907449f30d2c47e114343eaa8831c126d 100644 --- a/tsg_util/preferencesForm.m +++ b/tsg_util/preferencesForm.m @@ -16,6 +16,10 @@ error = -1; % ------------------------------------- tsg = getappdata(hTsgGUI, 'tsg_data'); +% disable ship speed test +% ----------------------- +tsg.preference.ship_speed_test=1; + % set default uicontrol size % -------------------------- height = 0.03; @@ -248,6 +252,38 @@ if bottom < .1 left = left + inc_x; end +% display map resolution text +% ----------------------------- +uicontrol(... + 'Parent', hPreferencesFig, ... + 'Units', 'normalized', ... + 'Style', 'Text', ... + 'Fontsize', tsg.fontSize-1, ... + 'HorizontalAlignment', 'left', ... + 'Position',[left, bottom, length, height], ... + 'TooltipString', 'select map resolution', ... + 'String', 'Map Resolution'); + +% display map resolution uicontrol +% -------------------------------- +uicontrol(... + 'Parent', hPreferencesFig, ... + 'Units', 'normalized', ... + 'BackgroundColor', 'w', ... + 'Style', 'popupmenu', ... + 'Fontsize', tsg.fontSize-2, ... + 'HorizontalAlignment', 'right', ... + 'Position', [left + length, bottom, length, height], ... + 'String', tsg.preference.map_resolution_string, ... + 'Value', tsg.preference.map_resolution, ... + 'Tag', 'PREFERENCES_MAP_RESOLUTION'); + +bottom = bottom - inc_y - height; +if bottom < .1 + bottom = 0.95; + left = left + inc_x; +end + % CONTINUE PUSH BUTTON % -------------------- % The Continue (valid) button @@ -316,7 +352,9 @@ uiwait(hPreferencesFig); get(prefs.PREFERENCES_PLOT_CONNECTED_LINE, 'value'); tsg.preference.coeff_type_value = ... get(prefs.PREFERENCES_COEFF_TYPE, 'value'); - + tsg.preference.map_resolution = ... + get(prefs.PREFERENCES_MAP_RESOLUTION, 'value'); + % Save tsg structure % ------------------ setappdata(hTsgGUI, 'tsg_data', tsg); diff --git a/tsg_util/tsg_preferences.m b/tsg_util/tsg_preferences.m index 456edd2738e1ec02352b00d73512721871c5f78d..61c320a8059ec36078edb4497d1a43e4e535ddad 100644 --- a/tsg_util/tsg_preferences.m +++ b/tsg_util/tsg_preferences.m @@ -143,6 +143,8 @@ end preference.plot_connected_value = 1; % 0, line not connected preference.coeff_type_string = {'use A-D', 'use G-J'}; preference.coeff_type_value = 2; + preference.map_resolution_string = {'low','medium','high'}; + preference.map_resolution = 1; % save preference struct to 'prefdir.mat' file % --------------------------------------------- diff --git a/tsgqc.m b/tsgqc.m index f4a1868dd701d953f8b5622695caf04a107fc5db..e2f3ef230f18c477cfa1c77a1922cf499c7ba374 100644 --- a/tsgqc.m +++ b/tsgqc.m @@ -2868,6 +2868,8 @@ hrbInterpCancel = uicontrol( ... % ------------------------------------------------------------------- function PreferencesMenuCallback(hObject, eventdata) + oldmapres=tsg.preference.map_resolution; + % call preferences form function % ------------------------------ if( preferencesForm(hMainFig) ) @@ -2878,13 +2880,16 @@ hrbInterpCancel = uicontrol( ... SelectParameter(pmhPara(1),[],1); end - % Update the map if visible and ship speed QC has been applied - % ------------------------------------------------------------ - if (strcmp( get(hMapFig,'visible'), 'on') == 1 & tsg.preference.ship_speed_test == 2) + % Update the map (if visible) if ship speed QC has been applied + % or map resolution has been changed + % ------------------------------------------------------------- + if (strcmp( get(hMapFig,'visible'), 'on') == 1 & ... + (tsg.preference.ship_speed_test == 2 | ... + tsg.preference.map_resolution ~= oldmapres)) erase_Line( hPlotAxes, 4 ); plot_map( hMainFig, hPlotAxes); end - + end end