diff --git a/ReleaseNotes b/ReleaseNotes index 5289101be37c0efa64dd80256ca5a9ff2093232c..6ea69c95635f2b1dda88d8feef106875bb475b96 100644 --- a/ReleaseNotes +++ b/ReleaseNotes @@ -1,6 +1,11 @@ Release notes TSG-QC jacques.grelet@ird.fr +v1.45.0 (2016-05-05) + - add an icon to plot ship track with Google Earth using KML Toolbox: + http://www.mathworks.com/matlabcentral/fileexchange/34694-kml-toolbox + - add an option/preference to display positions in DD°MM.SS or decimal + v1.44.2 (2016-04-20) - move hardcoded constants in preferenceForm (jgrelet): tsg.cst.TSG_WS_TIMEDIFF, tsg.SSPS_STDMAX and tsg.cst.TSG_DT_SMOOTH diff --git a/tsg_icon/Google-Earth-icon.gif b/tsg_icon/Google-Earth-icon.gif new file mode 100644 index 0000000000000000000000000000000000000000..acc42c10f67d55a2e812d641420cd0c358814906 Binary files /dev/null and b/tsg_icon/Google-Earth-icon.gif differ diff --git a/tsg_util/preferencesForm.m b/tsg_util/preferencesForm.m index 7ee13b434c179a57a5e1c7cfb13acedfa434ce73..01965abf8bc5d5808473b0de4029f205df36bc2e 100644 --- a/tsg_util/preferencesForm.m +++ b/tsg_util/preferencesForm.m @@ -501,7 +501,7 @@ uicontrol(... 'Style', 'Text', 'Fontsize', tsg.fontSize, 'FontWeight', 'bold',... 'HorizontalAlignment', 'Left', ... 'Position',[left, bottom, 2*length, height], ... - 'String', 'Formats used for date'); + 'String', 'Formats used for date and positions'); bottom = bottom - inc_y - height; if bottom < .1 @@ -566,6 +566,30 @@ if bottom < .1 left = left + inc_x; end +% display positions format +% ------------------------ +uicontrol(... + 'Parent', hPreferencesFig, ... + 'Units', 'normalized', ... + 'Style', 'Text', 'Fontsize', tsg.fontSize-1, 'HorizontalAlignment', 'left', ... + 'Position',[left, bottom, length, height], ... + 'TooltipString', 'Formats used for positions, DD°MM.SS or decimal', ... + 'String', 'Positions format'); + +% display positions format +% ------------------------ +uicontrol(... + 'Parent', hPreferencesFig, ... + 'Units', 'normalized', 'Style', 'popupmenu', ... + 'Fontsize', tsg.fontSize-2, 'BackgroundColor', 'w', ... + 'HorizontalAlignment', 'right', ... + 'Position', [left + length, bottom, length, height], ... + 'TooltipString', 'Formats used for positions', ... + 'String', tsg.preference.positions_format_string, ... + 'Value', tsg.preference.positions_format_value, ... + 'Tag', 'PREFERENCES_POSITIONS_FORMAT'); + + % goto next column % ---------------- bottom = 0.95; @@ -770,6 +794,8 @@ uiwait(hPreferencesFig); get(prefs.PREFERENCES_PLOT_CONNECTED_LINE, 'value'); tsg.preference.map_resolution = ... get(prefs.PREFERENCES_MAP_RESOLUTION, 'value'); + tsg.preference.positions_format_value = ... + get(prefs.PREFERENCES_POSITIONS_FORMAT, 'value'); % QC Tests tsg.preference.flow_min_string = ... get(prefs.PREFERENCES_FLOW_MIN, 'string'); diff --git a/tsg_util/tsg_preferences.m b/tsg_util/tsg_preferences.m index 0c5962b9f8327d6f0df058c9f92672d2e305f1ad..04eb35d93906de85a86512150a5d94386d9b1744 100644 --- a/tsg_util/tsg_preferences.m +++ b/tsg_util/tsg_preferences.m @@ -160,6 +160,8 @@ set(hTsgGUI,'Pointer','arrow'); % ----------------------------------------- preference.date_format_variable = 'yyyymmddHHMMSS'; preference.date_format_attribute = 'yyyymmddHHMMSS'; + preference.positions_format_string = {'DD°MM.SS', '+-DD.CCCC'}; + preference.positions_format_value = 1; % use in tsg-average by tsg.cst.TSG_DT_SMOOTH % this value in in minute diff --git a/tsgqc.m b/tsgqc.m index 3f22daf636a1dff0235ac1b58c689e73d9253fc3..58c7b674cd1ff372c9faf2930068645c74208956 100644 --- a/tsgqc.m +++ b/tsgqc.m @@ -11,7 +11,7 @@ function tsgqc( varargin ) % This file is part of tsgqc. % % TSG-QC is free software; you can redistribute it and/or modify -% it under the terms of the GNU General Public License as published by +% it under the terms of the GNU General Public License as publDisplayished by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % @@ -38,9 +38,9 @@ global GOSUD_FORMAT_VERSION % version number, may be used to initialize some files when it change % 0.90x -> 1.0RCx % ------------------------------------------------------------------- -VERSION = 1.442; % -> 1.44 -CHAR_VERSION = '1.442'; -DATE_VERSION = 'jan 20 2016'; +VERSION = 1.450; % -> 1.44 +CHAR_VERSION = '1.450'; +DATE_VERSION = 'july 5 2016'; % netcdf file version, see DATA FORMAT TSG document: % CORTSG_format_gosud.doc @@ -472,7 +472,7 @@ hTimelimitToggletool = uitoggletool(... 'OnCallback', @SelectTime_OnMenuCallback); hMapToggletool = uitoggletool(... % Open Map toolbar button 'Parent',hToolbar,... - 'TooltipString','Map and ship track',... + 'TooltipString','Display ship track with m_map',... 'Separator', 'on', ... 'CData',iconRead(... [DEFAULT_PATH_FILE 'tsg_icon' filesep 'mapicon.mat']),... @@ -482,6 +482,15 @@ hMapToggletool = uitoggletool(... % Open Map toolbar button 'Enable', 'off',... 'OffCallback', @Map_OffMenuCallback,... 'OnCallback', @Map_OnMenuCallback); +hGoogleEarthPushtool = uipushtool(... % Open Google Earth and plot track + 'Parent',hToolbar,... + 'TooltipString','Display ship track with Google Earth',... + 'CData',iconRead(... + [DEFAULT_PATH_FILE 'tsg_icon' filesep 'Google-Earth-icon.gif']),... + 'HandleVisibility','on', ... + 'Tag','PUSHTOOL_GOOGLEARTH',... + 'Enable', 'off',... + 'ClickedCallback', @GoogleEarthMenuCallback); hClimToggletool = uitoggletool(... % Open Climatology toolbar button 'Parent',hToolbar,... 'TooltipString','Climatology',... @@ -549,6 +558,7 @@ hReportPushtool = uipushtool(... % Open Report saving button 'Enable', 'off',... 'ClickedCallback', @ReportMenuCallback); + %% Dynamic text area % ----------------------------------------------------------------------- % Dynamic text area that displays the loaded filename, date, position and @@ -2477,9 +2487,15 @@ hrbInterpCancel = uicontrol( ... % --------------------------------------------------------- set( hInfoDateText, 'String',... datestr(tsg.DAYD(indCursor),'dd/mm/yyyy HH:MM')); + if tsg.preference.positions_format_value == 1 set( hInfoLatText, 'String', dd2dm(tsg.LATX(indCursor), 0) ); set( hInfoLongText, 'String', ... dd2dm(mod(tsg.LONX(indCursor) + 180, 360) - 180, 1) ); + else + set( hInfoLatText, 'String', tsg.LATX(indCursor) ); + set( hInfoLongText, 'String', ... + mod(tsg.LONX(indCursor) + 180, 360) - 180 ); + end if ~isempty(tsg.SSPS) set( hInfoSSPSText, 'String', tsg.SSPS(indCursor) ); end @@ -3406,6 +3422,27 @@ end end +%% GoogleEarthMenuCallback +% ------------------------------------------------------------------- +% Callback function run when the Google Earth tool bar item is selected +% ------------------------------------------------------------------- + function GoogleEarthMenuCallback(hObject, eventdata) + + % Get tsg application data + % ------------------------ + tsg = getappdata( hMainFig, 'tsg_data' ); + + % call KML Toolbox functions + % -------------------------- + k = kml(tsg.CYCLE_MESURE); + + % Color value format must be passed as a character array according + % to the format string 'AABBGGRR', eg: red = 'FF0000FF' + k.plot(tsg.LONX,tsg.LATX, 'linewidth', 2, 'linecolor', 'FF0000FF'); + k.run; + + end + %% SaveMenuCallback % ------------------------------------------------------------------- % Callback function run when the Save menu item is selected