diff --git a/@tsg_nc/tsg_platform.csv b/@tsg_nc/tsg_platform.csv index dac665372d61b318d4f4924ff13a0974e52bb1f0..a35749fbd8292556b335461d588d2a694502fda4 100644 --- a/@tsg_nc/tsg_platform.csv +++ b/@tsg_nc/tsg_platform.csv @@ -1,5 +1,7 @@ -% tsg_platform.csv: 14 members & 0 lines with data; VERSION = 1.4840 +% tsg_platform.csv: 15 members & 2 lines with data; VERSION = 1.4840 % % id;PLATFORM_NAME;SHIP_CALL_SIGN;SHIP_MMSI;PROJECT_NAME;TYPE_TSG;NUMBER_TSG;TYPE_TINT;NUMBER_TINT;SAMPLING_PERIOD;SSPS_DEPH;SSPS_DEPH_MIN;SSPS_DEPH_MAX;SSTP_DEPH;SSTP_DEPH_MIN;SSTP_DEPH_MAX;DATE_TSG;endl -char;char;char;char;char;char;char;char;char;integer;integer;float;float;float;float;float;float;float +char;char;char;char;char;char;char;char;char;integer;integer;float;float;float;float;float;float;float +#;PACIFIC ISLANDER 2;;;;;;;;;8;6.000000;10.000000;NaN;NaN;NaN;;# +#;Atalante;;;;;;;;;3;2.600000;3.400000;3.000000;2.600000;2.600000;;# diff --git a/ReleaseNotes b/ReleaseNotes index 198c4274e76319b99ab91f7d243cb1c3c0076379..9b1126e8e0751d8d7ecc241e9e2e5de1d19b7b69 100644 --- a/ReleaseNotes +++ b/ReleaseNotes @@ -2,6 +2,7 @@ Release notes TSG-QC jacques.grelet@ird.fr v1.48.4 (2018-06-27) ++ Add Menus in map for user interaction (Map resolution, border and patch) + Add duplicate QC button for SSPS or SSTP in QC mode + Improve zoom mode. Tested under R2013/2014 and 2017) - tsg.qc.active.Code is set now with the function get_active_QC. Fixes the diff --git a/tsgqc.m b/tsgqc.m index 3a975e4b7baf0ae92b87750e1426dcd7d02926ad..012c945433c1bda32644b892822eeefe7cc59c23 100644 --- a/tsgqc.m +++ b/tsgqc.m @@ -743,14 +743,14 @@ hPlotAxes(3) = axes('Parent', hPlotsPanel, 'Visible', 'off',... 'box', 'on', 'Units', 'normalized', 'Tag', 'TAG_AXES_3', ... 'HandleVisibility','on', 'Position',[.05, .02, .93, .27]); -% The map will be plot a new figure +% The map will be plot a new figure % --------------------------------- hMapFig = figure(... 'BackingStore','off',... 'Name', 'TSG SHIP TRACK', ... 'NumberTitle', 'off', ... 'Resize', 'on', ... - 'Menubar','figure', ... + 'Menubar','none', ... 'Toolbar', 'none', ... 'Tag', 'MAP_FIGURE', ... 'Visible','off',... @@ -760,6 +760,112 @@ hMapFig = figure(... 'Position',[0.17, 0.05, .8, .44],... 'Color', get(0, 'DefaultUIControlBackgroundColor')); +% display map menus +% ----------------- +hMapResolutionMenu = uimenu(... + 'Parent', hMapFig,... + 'HandleVisibility', handleVisibility,... + 'Label', 'Map'); + +uimenu(hMapResolutionMenu,'Label','Low',... + 'Checked','off',... + 'Tag','TAG_UIMENU_MAP_RESOLUTION_1',... + 'Enable', 'on',... + 'Callback', {@mapResolutionCallback, 1}); + +uimenu(hMapResolutionMenu,'Label','Medium',... + 'Checked','off',... + 'Tag','TAG_UIMENU_MAP_RESOLUTION_2',... + 'Enable', 'on',... + 'Callback', {@mapResolutionCallback, 2}); + +uimenu(hMapResolutionMenu,'Label','Intermediate',... + 'Checked','off',... + 'Tag','TAG_UIMENU_MAP_RESOLUTION_3',... + 'Enable', 'on',... + 'Callback', {@mapResolutionCallback, 3}); + +uimenu(hMapResolutionMenu,'Label','High',... + 'Checked','off',... + 'Tag','TAG_UIMENU_MAP_RESOLUTION_4',... + 'Enable', 'on',... + 'Callback', {@mapResolutionCallback, 4}); + +% set 'checked' property to 'on' for current map resolution +% ------------------------------------------------------------ +hdl = flip(findobj( '-regexp', 'tag', 'TAG_UIMENU_MAP_RESOLUTION_')); +set(hdl(tsg.preference.map_resolution), 'checked', 'on'); + +hMapBorderMenu = uimenu(... + 'Parent', hMapFig,... + 'HandleVisibility', handleVisibility,... + 'Label', 'Border'); + +uimenu(hMapBorderMenu,'Label','0',... + 'Checked','off',... + 'Tag','TAG_UIMENU_MAP_BORDER_1',... + 'Enable', 'on',... + 'Callback', {@mapDynaBorderCallback, 0}); + +uimenu(hMapBorderMenu,'Label','1',... + 'Checked','off',... + 'Tag','TAG_UIMENU_MAP_BORDER_2',... + 'Enable', 'on',... + 'Callback', {@mapDynaBorderCallback, 1}); + +uimenu(hMapBorderMenu,'Label','2',... + 'Checked','off',... + 'Tag','TAG_UIMENU_MAP_BORDER_3',... + 'Enable', 'on',... + 'Callback', {@mapDynaBorderCallback, 2}); + +uimenu(hMapBorderMenu,'Label','5',... + 'Checked','off',... + 'Tag','TAG_UIMENU_MAP_BORDER_4',... + 'Enable', 'on',... + 'Callback', {@mapDynaBorderCallback, 5}); + +uimenu(hMapBorderMenu,'Label','10',... + 'Checked','off',... + 'Tag','TAG_UIMENU_MAP_BORDER_5',... + 'Enable', 'on',... + 'Callback', {@mapDynaBorderCallback, 10}); + +uimenu(hMapBorderMenu,'Label','15',... + 'Checked','off',... + 'Tag','TAG_UIMENU_MAP_BORDER_6',... + 'Enable', 'on',... + 'Callback', {@mapDynaBorderCallback, 15}); + +% set 'checked' property to 'on' for current map resolution +% ------------------------------------------------------------ +hdl = flip(findobj( '-regexp', 'tag', 'TAG_UIMENU_MAP_BORDER_')); +set(hdl(tsg.preference.map_border_value), 'checked', 'on'); + +hMapPatchMenu = uimenu(hMapFig,'Label','Type', ... + 'Tag', 'TAG_UIMENU_MAP_PATCH'); + +% preset map menu with 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}); + hPlotAxes(4) = axes(... % the axes for plotting ship track map 'Parent', hMapFig, ... 'Units', 'normalized', ... @@ -1876,10 +1982,6 @@ end set( hPanToggletool, 'state', 'off' ); set( hTimelimitToggletool, 'state', 'off' ); - % Hide the map. Otherwise it slows down the zooming - % ------------------------------------------------- - % set( hMapToggletool, 'state', 'off' ); - % returns a zoom mode object for the figure hMainFig handle % --------------------------------------------------------- hZoom = zoom(hMainFig); @@ -1915,7 +2017,7 @@ end % Set map with border and save tsg % -------------------------------- - tsg.preference.map_border = 0; + %tsg.preference.map_border = 0; setappdata( hMainFig, 'tsg_data', tsg ); end @@ -1947,10 +2049,6 @@ end set( hPanToggletool, 'state', 'off' ); set( hTimelimitToggletool, 'state', 'off' ); - % Hide the map. Otherwise it slows down the zooming - % ------------------------------------------------- - % set( hMapToggletool, 'state', 'off' ); - % returns a zoom mode object for the figure hMainFig handle % --------------------------------------------------------- hZoom = zoom(hMainFig); @@ -2008,7 +2106,6 @@ end % ------------------------------------------------------------------ tsg.preference.map_border = ... str2double(tsg.preference.map_border_string(tsg.preference.map_border_value)); - % tsg.preference.map_border setappdata( hMainFig, 'tsg_data', tsg ); % returns the plot to its initial zoom setting and desactivate zoom @@ -3485,6 +3582,83 @@ end aboutDialog(hMainFig, DEFAULT_PATH_FILE); end +%% Map menus +% ----------- + function mapResolutionCallback(src, evnt, resolution) + + % set map resolution + % ------------------ + tsg.preference.map_resolution = resolution; + + % Save the modifications for use new setting + % ----------------------------------------- + setappdata( hMainFig, 'tsg_data', tsg); + + % redraw map + % ------------------------------------------ + erase_Line( hPlotAxes, 4 ); + plot_map(hMainFig, hPlotAxes); + end + + function mapPatchMenuCallback(src, evnt, patch) + + if patch + % find map with patch submenu and set 'checked' property to 'off' + % ------------------------------------------------------------ + hdl = findobj( '-regexp', 'tag', 'TAG_UIMENU_MAP_WITHOUT_PATCH'); + set(hdl, 'checked', 'off'); + + % set current climato submenu checked + % ----------------------------------- + set(src, 'checked', 'on'); + + % set tsg.preference for next use + % ------------------------------------------------ + tsg.preference.map_patch_value = 2; + + else + hdl = findobj( '-regexp', 'tag', 'TAG_UIMENU_MAP_WITH_PATCH'); + set(hdl, 'checked', 'off'); + + % set current climato submenu checked + % ----------------------------------- + set(src, 'checked', 'on'); + + % set tsg.preference for next use + % ------------------------------------------------ + tsg.preference.map_patch_value = 1; + end + + % Save the modifications for use new setting + % ----------------------------------------- + setappdata( hMainFig, 'tsg_data', tsg); + + % redraw map + % ------------------------------------------ + erase_Line( hPlotAxes, 4 ); + plot_map(hMainFig, hPlotAxes); + + end + +%% function mapDynaBorderCallback +% -------------------------------- + function mapDynaBorderCallback(src, evnt, border) + + hdl = findobj( '-regexp', 'tag', 'TAG_UIMENU_MAP_BORDER_'); + set(hdl, 'Checked', 'off'); + set(src, 'Checked', 'on'); + + % change the map border from menu on map + % -------------------------------------- + tsg.preference.map_border = border; + setappdata( hMainFig, 'tsg_data', tsg); + + % redraw map + % ------------------------------------------ + erase_Line( hPlotAxes, 4 ); + plot_map(hMainFig, hPlotAxes); + end + %% HeaderMenuCallback % ------------------------------------------------------------------- % Callback function run when the headerForm tool bar item is selected