From 26987e24b49b7a8b17e5be8eab498e34c4eced21 Mon Sep 17 00:00:00 2001 From: Yves Gouriou <yves.gouriou@ird.fr> Date: Thu, 29 Nov 2007 14:41:48 +0000 Subject: [PATCH] developpement module de correction -continuation --- dev_tsgcor_GUI.m | 57 ++++++++++++++++++++++++++---------------------- tsgqc_GUI.m | 1 + 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/dev_tsgcor_GUI.m b/dev_tsgcor_GUI.m index 6294586..a31f2e0 100644 --- a/dev_tsgcor_GUI.m +++ b/dev_tsgcor_GUI.m @@ -50,10 +50,10 @@ function dev_tsgcor_GUI( hMainFig ) set(0,'Units','normalized'); guiLimits = get(0,'ScreenSize'); guiLimits(1) = guiLimits(1) + 0.05; - guiLimits(2) = guiLimits(2) + 0.1; - guiLimits(3) = guiLimits(3) - 0.15; - guiLimits(4) = guiLimits(4) - 0.25; - + guiLimits(2) = guiLimits(2) + 0.05; + guiLimits(3) = guiLimits(3) - 0.1; + guiLimits(4) = guiLimits(4) - 0.2; + % Create and then hide the GUI as it is being constructed. % -------------------------------------------------------- hChild1Fig = figure(... @@ -305,7 +305,12 @@ sample = dev_diffTsgSample(tsg, psal_smooth, sample, TSG_SAMPLING_TIME); % Tracé % ----- -axes(hPlotAxes(1)); +tsg_plot_SalTsgSample( hMainFig, hPlotAxes ); + +% The callback to detect the mouse motion can be set to on +% -------------------------------------------------------- +set( hChild1Fig, 'Tag', 'ButtonMotionOn'); + % tsg = dev_corMethod1(tsg, sample, dateMin, dateMax, COR_TIME_WINDOWS); @@ -330,7 +335,7 @@ axes(hPlotAxes(1)); zoomAdaptiveDateTicks('off'); case 'off' pan off - set(hQCPushtool, 'Tag', 'off' ); +% set(hQCPushtool, 'Tag', 'off' ); zoom on zoomAdaptiveDateTicks('on'); @@ -354,7 +359,7 @@ axes(hPlotAxes(1)); panAdaptiveDateTicks('off'); case 'off' zoom off - set(hQCPushtool, 'Tag', 'off' ); +% set(hQCPushtool, 'Tag', 'off' ); pan on panAdaptiveDateTicks('on'); @@ -509,41 +514,41 @@ axes(hPlotAxes(1)); % Test if the callback can be activated % ------------------------------------- -% if strcmp( get( hChild1Fig, 'Tag'), 'ButtonMotionOn') + if strcmp( get( hChild1Fig, 'Tag'), 'ButtonMotionOn') % Retrieve named application data % ------------------------------- -% tsg = getappdata( hChild1Fig, 'tsg_data'); + tsg = getappdata( hMainFig, 'tsg_data'); % Get the mouse position % ---------------------- -% point = get(gcf,'CurrentPoint'); + point = get(gcf,'CurrentPoint'); -% if point(1) > .05 && point(2) > .6 && point(1) < .95 && point(2) < .92 + if point(1) > .05 && point(2) > .6 && point(1) < .95 && point(2) < .92 % Get current position of cusor and return its coordinates in % axes with handle h_axes % ----------------------------------------------------------- -% [x, y] = gpos(hPlotAxes(1)); + [x, y] = gpos(hPlotAxes(1)); -% if x > tsg.TIME(1) && x < tsg.TIME(end) + if x > tsg.TIME(1) && x < tsg.TIME(end) -% indCursor = find( tsg.TIME > x); + indCursor = find( tsg.TIME > x); % use sprintf with format instead strcat & num2str but flag % - don't work with 0, eg %+07.4f -% set( hInfoText, 'String',... -% sprintf(['%s - Latitude = %s - Longitude = %s '... -% ' - Salinity = %07.4f - Temperature = %07.4f'],... -% datestr(tsg.TIME(indCursor(1)),'dd/mm/yyyy HH:MM'),... -% dd2dm(tsg.LATITUDE(indCursor(1)),0), ... -% dd2dm(tsg.LONGITUDE(indCursor(1)),1), ... -% tsg.PSAL(indCursor(1)), ... -% tsg.TEMP_TSG(indCursor(1))... -% )); + set( hInfoText, 'String',... + sprintf(['%s - Latitude = %s - Longitude = %s '... + ' - Salinity = %07.4f - Temperature = %07.4f'],... + datestr(tsg.TIME(indCursor(1)),'dd/mm/yyyy HH:MM'),... + dd2dm(tsg.LATITUDE(indCursor(1)),0), ... + dd2dm(tsg.LONGITUDE(indCursor(1)),1), ... + tsg.PSAL(indCursor(1)), ... + tsg.TEMP_TSG(indCursor(1))... + )); -% end -% end -% end + end + end + end end %--------------------------------------------------------------------- diff --git a/tsgqc_GUI.m b/tsgqc_GUI.m index 8fa9b23..6bf087d 100644 --- a/tsgqc_GUI.m +++ b/tsgqc_GUI.m @@ -904,6 +904,7 @@ function tsgqc_GUI function QuitProgram(hObject, eventdata) delete(hMainFig); + % reset Matlab search path to default rmpath( [DEFAULT_PATH_FILE filesep 'tsg_util'] ); rmpath( [DEFAULT_PATH_FILE filesep 'tsg_data'] ); -- GitLab