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

Added trajectoryOutput window to the gui package.

parent 13556816
No related branches found
No related tags found
No related merge requests found
function [] = trajectoryOutput(pCallbacks)
%TRAJECTORY Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
%% Initialize required variables
windowTitle = [ 'ARTOA4 - Float ' num2str(artoaWorkspace.float.floatname) ' - Trajectory' ];
availableCallbacks = { ...
'CloseRequestFcn', ...
'buttonDeleteSingle', ...
'buttonDeleteAll', ...
'checkboxMercator', ...
'checkboxTrackVisible', ...
'buttonTrackInfos', ...
'buttonVelocities', ...
'tableGeneratedTracksSelect' ...
};
for i = 1:length(availableCallbacks) % check if a callback is undefined
if ~isfield(pCallbacks, availableCallbacks{i})
pCallbacks.(availableCallbacks{i}) = @(~, ~) false;
end
end
%% Initialize trajectory output gui
artoaGui.figures.trajectoryOutput = figure( ...
'Name', windowTitle, ...
'NumberTitle', 'off', ...'MenuBar','none', ...
'Units', 'characters' ...
);
artoaGui.trajectoryOutput = struct();
set( ...
artoaGui.figures.trajectoryOutput, ...
'CloseRequestFcn', ...
pCallbacks.CloseRequestFcn ...
);
%% Setup axes
artoaGui.figures.trajectoryOutput.CurrentAxes = axes();
artoaGui.figures.trajectoryOutput.CurrentAxes.Position = [.1 .1 .55 .85];
titleVal = [ ...
'Project: ' artoaWorkspace.float.projectname ...
' - Float ID: ' num2str(artoaWorkspace.float.floatname) ...
' - Cycle: ' num2str(artoaWorkspace.float.cycle(1)) ...
' - Trajectory' ...
];
titleHandle = title(artoaGui.figures.trajectoryOutput.CurrentAxes, titleVal, 'FontSize', 10);
xlabel('Longitude');
ylabel('Latitude');
grid(artoaGui.figures.trajectoryOutput.CurrentAxes, 'on');
% save axes handle
artoaGui.trajectoryOutput.axesTrajectoryOutput = artoaGui.figures.trajectoryOutput.CurrentAxes;
%% Generate controls
%% Track list frame
artoaGui.trajectoryOutput.frameTrackList = uipanel( ...
'Title', 'Generated tracks', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
'Position', [.675, .675, .3, .3] ...
);
columns = { ...
'', ...
'No.', ...
'Soundspeed Method' ...
};
artoaGui.trajectoryOutput.tableTrackList = uitable( ...
artoaGui.trajectoryOutput.frameTrackList, ...
'Units', 'normalized', ...
'Position', [.05, .05, .9, .9], ...
'Data', cell(1, length(columns)), ...
'ColumnName', columns, ...
'ColumnEditable', false, ...
'ColumnWidth', {20, 30, 110}, ...
'CellSelectionCallback', pCallbacks.tableGeneratedTracksSelect, ...%pCallbacks.tableSoundSourceOffsetsSelection,... %@(app,event) disp(num2str(event.Indices)) ...
'CellEditCallback', '' ...%pCallbacks.tableSoundSourceOffsetsEdit ...
);
clear columns;
%% Control buttons frame
artoaGui.trajectoryOutput.frameControlsButtons = uipanel( ...
'Title', 'Controls', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
'Position', [.675 .05 .3 .15] ...
);
artoaGui.trajectoryOutput.buttonDeleteSingle = uicontrol( ...
'Parent', artoaGui.trajectoryOutput.frameControlsButtons, ...
'String', 'Delete selected', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [.1 .6 .8 .3], ...
'CallBack', pCallbacks.buttonDeleteSingle ...
);
artoaGui.trajectoryOutput.buttonDeleteAll = uicontrol( ...
'Parent', artoaGui.trajectoryOutput.frameControlsButtons, ...
'String', 'Delete all', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [.1 .1 .8 .3], ...
'CallBack', pCallbacks.buttonDeleteAll ...
);
%% Generic options
artoaGui.trajectoryOutput.frameGenericOptions = uipanel( ...
'Title', 'Options', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
'Position', [.675 .55 .3 .1] ...
);
artoaGui.trajectoryOutput.checkboxUpdateTrackParameterWindow = uicontrol( ...
'Parent', artoaGui.trajectoryOutput.frameGenericOptions, ...
'String', 'Update track parameter on selection', ...
'Tooltip', 'If checked the track parameter of the selected trajectory will be restored in the track parameter window.', ...
'Style', 'CheckBox', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [.1 .8 .8 .175], ...
'CallBack', pCallbacks.checkboxUpdateTrackParameterWindow ...
);
%% Display options
artoaGui.trajectoryOutput.frameDisplayOptions = uipanel( ...
'Title', 'Display options', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
'Position', [.675 .25 .3 .25] ...
);
artoaGui.trajectoryOutput.checkboxMercator = uicontrol( ...
'Parent', artoaGui.trajectoryOutput.frameDisplayOptions, ...
'String', 'Mercator projection', ...
'Style', 'CheckBox', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [.1 .8 .8 .175], ...
'CallBack', pCallbacks.checkboxMercator ...
);
artoaGui.trajectoryOutput.buttonTrackInfos = uicontrol( ...
'Parent', artoaGui.trajectoryOutput.frameDisplayOptions, ...
'String', 'Track infos', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [.1 .4 .8 .175], ...
'CallBack', pCallbacks.buttonTrackInfos ...
);
artoaGui.trajectoryOutput.buttonVelocities = uicontrol( ...
'Parent', artoaGui.trajectoryOutput.frameDisplayOptions, ...
'String', 'Velocities', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [.1 .2 .8 .175], ...
'CallBack', pCallbacks.buttonVelocities ...
);
end
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