Skip to content
Snippets Groups Projects
Commit e0a8716f authored by leprob001's avatar leprob001
Browse files

Added pan using mouse wheel in TOA plot. z enables zoom, p enables pan in the TOA plot as well.

parent 79fbc6dd
No related branches found
No related tags found
No related merge requests found
183
\ No newline at end of file
184
\ No newline at end of file
function [] = onKeyDown(~, keyData)
%ONMOUSEWHEELFCN Summary of this function goes here
% Detailed explanation goes here
global artoaGui;
hManager = uigetmodemanager(artoaGui.figures.editTimeOfArrival);
if strcmp(keyData.Key, 'z')
z = zoom;
if strcmp(z.Enable, 'on')
% does not work because matlab disables all interaction callbacks
% during zoom or pan mode
zoom off;
else
zoom on;
end
end
if strcmp(keyData.Key, 'p')
p = pan;
if strcmp(p.Enable, 'on')
% does not work because matlab disables all interaction callbacks
% during zoom or pan mode
pan off;
else
pan on;
end
end
if ~artoa.data.hasMember(artoaGui, 'editTimeOfArrival')
return;
end
if ~isempty(keyData.Key) & strcmp(keyData.Key, 'shift')
artoaGui.editTimeOfArrival.keyShiftDown = true;
end
end
function [] = onKeyUp(~, keyData)
%ONMOUSEWHEELFCN Summary of this function goes here
% Detailed explanation goes here
global artoaGui;
if ~artoa.data.hasMember(artoaGui, 'editTimeOfArrival')
return;
end
if ~isempty(keyData.Key) & strcmp(keyData.Key, 'shift')
artoaGui.editTimeOfArrival.keyShiftDown = false;
end
end
function [] = onMouseWheelFcn(~, callbackData)
%ONMOUSEWHEELFCN Summary of this function goes here
% Detailed explanation goes here
global artoaGui;
if ~artoa.data.hasMember(artoaGui, 'editTimeOfArrival', 'keyShiftDown') ...
| (artoaGui.editTimeOfArrival.keyShiftDown == false)
verticalFactor = 0.1;
artoaGui.editTimeOfArrival.axesScatterTimeOfArrival.YLim = ...
artoaGui.editTimeOfArrival.axesScatterTimeOfArrival.YLim ...
- (diff(artoaGui.editTimeOfArrival.axesScatterTimeOfArrival.YLim) * verticalFactor * callbackData.VerticalScrollCount);
elseif artoaGui.editTimeOfArrival.keyShiftDown
horizontalFactor = 0.1;
artoaGui.editTimeOfArrival.axesScatterTimeOfArrival.XLim = ...
artoaGui.editTimeOfArrival.axesScatterTimeOfArrival.XLim ...
- - (diff(artoaGui.editTimeOfArrival.axesScatterTimeOfArrival.XLim) * horizontalFactor * callbackData.VerticalScrollCount);
end
end
......@@ -12,7 +12,10 @@ windowTitle = [ 'ARTOA4 - Float ' num2str(artoaWorkspace.float.floatname) ' - Ti
artoaGui.figures.editTimeOfArrival = figure( ...
'Name', windowTitle, ...
'NumberTitle', 'off' ...
'NumberTitle', 'off', ...
'WindowScrollWheelFcn', @artoa.controller.edit.timeOfArrival.onMouseWheelFcn, ...
'KeyReleaseFcn', @artoa.controller.edit.timeOfArrival.onKeyUp, ...
'KeyPressFcn', @artoa.controller.edit.timeOfArrival.onKeyDown ...
);
addToolbarExplorationButtons(artoaGui.figures.editTimeOfArrival);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment