Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TSG QC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
US191
TSG QC
Commits
b4f3178b
Commit
b4f3178b
authored
16 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
amélioration du la gestion du zoom et pan
ajout d'un bouton zoon out dans la buttonbar
parent
fde2f4cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tsgqc.m
+163
-80
163 additions, 80 deletions
tsgqc.m
with
163 additions
and
80 deletions
tsgqc.m
+
163
−
80
View file @
b4f3178b
...
...
@@ -303,22 +303,31 @@ hPrintFigPushtool = uipushtool(... % Open Save toolbar button
'Tag'
,
'PUSHTOOL_PRINTFIG'
,
...
'visible'
,
'off'
,
'Enable'
,
'off'
,
...
'ClickedCallback'
,
@
PrintFigMenuCallback
);
hZoomToggletool
=
uitoggletool
(
...
% Open Zoom toolbar button
hZoom
In
Toggletool
=
uitoggletool
(
...
% Open Zoom
In (increase)
toolbar button
'Parent'
,
hToolbar
,
...
'Separator'
,
'on'
,
...
'TooltipString'
,
'Zoom'
,
...
'CData'
,
iconRead
(
fullfile
(
matlabroot
,
...
'/toolbox/matlab/icons/zoom.mat'
)),
...
'TooltipString'
,
'Zoom
In (increase)
'
,
...
'CData'
,
iconRead
(
fullfile
(
matlabroot
,
...
'/toolbox/matlab/icons/zoom
plus
.mat'
)),
...
'HandleVisibility'
,
'on'
,
...
'Tag'
,
'PUSHTOOL_ZOOM'
,
...
'Enable'
,
'off'
,
...
'OffCallback'
,
@
Zoom_OffMenuCallback
,
...
'ONCallback'
,
@
Zoom_OnMenuCallback
);
'Tag'
,
'PUSHTOOL_ZOOM_IN'
,
...
'OnCallback'
,
@
ZoomIn_OnMenuCallback
,
...
'OffCallback'
,
@
ZoomIn_OffMenuCallback
);
hZoomOutToggletool
=
uitoggletool
(
...
% Open Zoom Out (decrease) toolbar button
'Parent'
,
hToolbar
,
...
'Separator'
,
'on'
,
...
'TooltipString'
,
'Zoom Out (decrease)'
,
...
'CData'
,
iconRead
(
fullfile
(
matlabroot
,
...
'/toolbox/matlab/icons/zoomminus.mat'
)),
...
'HandleVisibility'
,
'on'
,
...
'Tag'
,
'PUSHTOOL_ZOOM_OUT'
,
...
'OnCallback'
,
@
ZoomOut_OnMenuCallback
,
...
'OffCallback'
,
@
ZoomOut_OffMenuCallback
);
hPanToggletool
=
uitoggletool
(
...
% Open Pan toolbar button
'Parent'
,
hToolbar
,
...
'TooltipString'
,
'Pan'
,
...
'CData'
,
iconRead
(
fullfile
(
matlabroot
,
...
'/toolbox/matlab/icons/pan.mat'
)),
...
'/toolbox/matlab/icons/pan.mat'
)),
...
'HandleVisibility'
,
'on'
,
...
'Tag'
,
'PUSHTOOL_PAN'
,
...
'Enable'
,
'off'
,
...
...
...
@@ -1158,7 +1167,7 @@ end
set
(
hQCToggletool
,
'state'
,
'off'
);
set
(
hMapToggletool
,
'state'
,
'off'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
);
set
(
hZoomToggletool
,
'state'
,
'off'
);
%
set( hZoomToggletool, 'state', 'off' );
% Open standard dialog box for retrieving files
% ---------------------------------------------
...
...
@@ -1372,7 +1381,8 @@ end
set
(
hPanToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hQCToggletool
,
'enable'
,
'off'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hHeaderPushtool
,
'enable'
,
'off'
);
...
...
@@ -1416,7 +1426,8 @@ end
set
(
hPanToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hQCToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
,
'enable'
,
'off'
);
set
(
hZoomToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hHeaderPushtool
,
'enable'
,
'on'
);
...
...
@@ -1534,7 +1545,9 @@ end
set
(
hPanToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
,
'enable'
,
'off'
);
set
(
hZoomToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
% Get tsg application data
% ------------------------
...
...
@@ -1578,7 +1591,8 @@ end
set
(
hQCToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hPanToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
% Get tsg application data
% ------------------------
...
...
@@ -1682,20 +1696,38 @@ end
end
%% Zoom_OnMenuCallback
%% Zoom
In
_OnMenuCallback
%----------------------------------------------------------------------
% Callback function run when the zoom toggle toolbar is released
% Callback function run when the toolbar zoom in (increase) push button
% is pressed
%----------------------------------------------------------------------
function
Zoom_OnMenuCallback
(
hObject
,
eventdata
)
% cursor back to normal
% ---------------------
set
(
hMainFig
,
'Pointer'
,
'arrow'
);
function
ZoomIn_OnMenuCallback
(
hObject
,
eventdata
)
% Desactivate some toggle buttons, hZoomOutToggletool changed state
% must be call before zoom function because the callback set zoom to
% off
% -------------------------------------------------------------------
set
(
hZoomOutToggletool
,
'state'
,
'off'
);
set
(
hQCToggletool
,
'state'
,
'off'
);
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
);
% Turns off the automatic adaptation of date ticks
% ------------------------------------------------
zoomAdaptiveDateTicks
(
'off'
);
% turns interactive zooming to in (increase)
% ------------------------------------------
set
(
hZoom
,
'direction'
,
'in'
);
% Disallows a zoom operation on the MAP axes objects
% --------------------------------------------------
setAllowAxesZoom
(
hZoom
,
hPlotAxes
(
4
),
false
);
...
...
@@ -1704,45 +1736,83 @@ end
% side effect on another figure
% -------------------------------------------------------------------
set
(
hZoom
,
'enable'
,
'on'
);
%zoom on;
% Set this callback to listen to when a zoom operation finishes
% must be call after enable zoom (bug ?)
% -------------------------------------------------------------
set
(
hZoom
,
'ActionPostCallback'
,
@
ZoomPan_PostCallback
);
end
%% ZoomIn_OffMenuCallback
%----------------------------------------------------------------------
% Callback function run when the toolbar zoom in (increase) push button
% is pressed
%----------------------------------------------------------------------
function
ZoomIn_OffMenuCallback
(
hObject
,
eventdata
)
% Turns on the automatic adaptation of date ticks
% -----------------------------------------------
zoomAdaptiveDateTicks
(
'on'
);
% Desactivate some toggle buttons
% -------------------------------
% disable zoom mode
% -----------------
zoom
off
;
end
%% ZoomOut_OnMenuCallback
%------------------------------------------------------------------------
% Callback function run when the toolbar zoom out (descrease) push button
% is pressed
%------------------------------------------------------------------------
function
ZoomOut_OnMenuCallback
(
hObject
,
eventdata
)
% Desactivate Zoom In Toggle toggle button
% -----------------------------------------
set
(
hZoomInToggletool
,
'state'
,
'off'
);
set
(
hQCToggletool
,
'state'
,
'off'
);
set
(
hPanToggletool
,
'state'
,
'off'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
);
% Hide the map. Otherwise it slows down the zooming
% -------------------------------------------------
set
(
hMapToggletool
,
'state'
,
'off'
);
end
set
(
hMapToggletool
,
'state'
,
'off'
);
%% Zoom_OffMenuCallback
%----------------------------------------------------------------------
% Callback function run when the zoom toggle toolbar is released
%----------------------------------------------------------------------
function
Zoom_OffMenuCallback
(
hObject
,
eventdata
)
% returns a zoom mode object for the figure hMainFig handle
% ---------------------------------------------------------
hZoom
=
zoom
(
hMainFig
);
% turns interactive zooming out (decrease)
% ----------------------------------------
set
(
hZoom
,
'direction'
,
'out'
);
% Disallows a zoom operation on the MAP axes objects
% --------------------------------------------------
setAllowAxesZoom
(
hZoom
,
hPlotAxes
(
4
),
false
);
% turns on interactive zooming (same effect than zoom on) but prevent
% side effect on another figure
% -------------------------------------------------------------------
set
(
hZoom
,
'enable'
,
'on'
);
% Set this callback to listen to when a zoom operation finishes
% -------------------------------------------------------------
set
(
hZoom
,
'ActionPostCallback'
,
@
ZoomPan_PostCallback
);
end
%% ZoomOut_OffMenuCallback
%------------------------------------------------------------------------
% Callback function run when the toolbar zoom out (descrease) push button
% is pressed
%------------------------------------------------------------------------
function
ZoomOut_OffMenuCallback
(
hObject
,
eventdata
)
% turns interactive zooming off
% -----------------------------
zoom
off
;
% Set the right limit and interval to the 3 axes
% ----------------------------------------------
for
iaxe
=
1
:
3
set
(
hPlotAxes
(
iaxe
),
'XTickMode'
,
'auto'
)
datetick
(
hPlotAxes
(
iaxe
),
'x'
,
'keeplimits'
)
end
% Turns off the automatic adaptation of date ticks
% ------------------------------------------------
zoomAdaptiveDateTicks
(
'off'
);
% cursor back to normal, test if it's really necessery
% -----------------------------------------------------
%set(hMainFig, 'Pointer', 'arrow');
end
%% Pan_OnMenuCallback
...
...
@@ -1751,9 +1821,16 @@ end
%----------------------------------------------------------------------
function
Pan_OnMenuCallback
(
hObject
,
eventdata
)
% cursor back to normal
% ---------------------
set
(
hMainFig
,
'Pointer'
,
'arrow'
);
% Desactivate some toggle buttons
% -------------------------------
set
(
hQCToggletool
,
'state'
,
'off'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
);
% Hide the map. Otherwise it slows down the panning
% -------------------------------------------------
set
(
hMapToggletool
,
'state'
,
'off'
);
% Returns a pan mode object for the figure handle
% -----------------------------------------------
...
...
@@ -1767,20 +1844,11 @@ end
% side effect on another figure
% --------------------------------------------------------------
set
(
hPan
,
'enable'
,
'on'
);
% Turns on the automatic adaptation of date ticks
% -----------------------------------------------
panAdaptiveDateTicks
(
'on'
);
% Desactivate some toggle buttons
% -------------------------------
set
(
hQCToggletool
,
'state'
,
'off'
);
set
(
hZoomToggletool
,
'state'
,
'off'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
);
% Hide the map. Otherwise it slows down the panning
% -------------------------------------------------
set
(
hMapToggletool
,
'state'
,
'off'
);
% Set this callback to listen to when a zoom operation finishes
% must be call after enable zoom (bug ?)
% -------------------------------------------------------------
set
(
hPan
,
'ActionPostCallback'
,
@
ZoomPan_PostCallback
);
end
...
...
@@ -1793,18 +1861,25 @@ end
% turns interactive pan off
% -------------------------
pan
off
;
% cursor back to normal, test if it's really necessery
% -----------------------------------------------------
%set(hMainFig, 'Pointer', 'arrow');
end
%% ZoomPan_PostCallback
%------------------------------------------------------------------------
% Callback function run when zoom or pan action finishes: redraw axes
%------------------------------------------------------------------------
function
ZoomPan_PostCallback
(
hObject
,
eventdata
)
% Set the right limit and interval to the 3 axes
% ----------------------------------------------
for
iaxe
=
1
:
3
set
(
hPlotAxes
(
iaxe
),
'XTickMode'
,
'auto'
)
datetick
(
hPlotAxes
(
iaxe
),
'x'
,
'keeplimits'
)
end
% Turns off the automatic adaptation of date ticks
% ------------------------------------------------
panAdaptiveDateTicks
(
'off'
);
end
%% QC_OnMenuCallback ............................... Quality Control Module
...
...
@@ -1820,7 +1895,8 @@ end
% Desactivate toggletools.
% ------------------------
set
(
hZoomToggletool
,
'state'
,
'off'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hPanToggletool
,
'state'
,
'off'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
);
set
(
hCalToggletool
,
'state'
,
'off'
,
'enable'
,
'off'
);
...
...
@@ -2262,7 +2338,8 @@ end
% Desactivate Zoom and Pan toggle buttons
% ---------------------------------------
set
(
hZoomToggletool
,
'state'
,
'off'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
);
set
(
hPanToggletool
,
'state'
,
'off'
);
% Make the earth map visible
...
...
@@ -2306,7 +2383,8 @@ end
% Switch somme buttons
% --------------------
set
(
hQCToggletool
,
'state'
,
'off'
);
set
(
hZoomToggletool
,
'state'
,
'off'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
,
'enable'
,
'on'
);
set
(
hPanToggletool
,
'state'
,
'off'
);
set
(
hMapToggletool
,
'state'
,
'off'
);
set
(
hClimToggletool
,
'state'
,
'off'
,
'enable'
,
'off'
);
...
...
@@ -2356,7 +2434,8 @@ end
% If necessary toggle off some buttons
% ------------------------------------
set
(
hQCToggletool
,
'state'
,
'off'
);
set
(
hZoomToggletool
,
'state'
,
'off'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
);
set
(
hPanToggletool
,
'state'
,
'off'
);
set
(
hMapToggletool
,
'state'
,
'off'
);
set
(
hClimToggletool
,
'enable'
,
'on'
);
...
...
@@ -2401,7 +2480,8 @@ end
% Desactivate somme Toggle button
% -------------------------------
set
(
hZoomToggletool
,
'state'
,
'off'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
);
set
(
hPanToggletool
,
'state'
,
'off'
);
set
(
hQCToggletool
,
'state'
,
'off'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
);
...
...
@@ -2440,7 +2520,8 @@ end
% Desactivate somme Toggle button
% -------------------------------
set
(
hZoomToggletool
,
'state'
,
'off'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
);
set
(
hPanToggletool
,
'state'
,
'off'
);
set
(
hQCToggletool
,
'state'
,
'off'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
);
...
...
@@ -2489,7 +2570,8 @@ end
% Desactivate somme Toggle button
% -------------------------------
set
(
hZoomToggletool
,
'state'
,
'off'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
);
set
(
hPanToggletool
,
'state'
,
'off'
);
set
(
hQCToggletool
,
'state'
,
'off'
);
set
(
hTimelimitToggletool
,
'state'
,
'off'
);
...
...
@@ -2592,7 +2674,8 @@ end
% Desactivate Zoom and Pan functions.
% ----------------------------------
set
(
hZoomToggletool
,
'state'
,
'off'
);
set
(
hZoomInToggletool
,
'state'
,
'off'
);
set
(
hZoomOutToggletool
,
'state'
,
'off'
);
set
(
hQCToggletool
,
'state'
,
'off'
);
set
(
hPanToggletool
,
'state'
,
'off'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment