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

Added generic function to clear the selection in an edit window.

parent a516f9a4
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ function [] = applyStatusToAllPointsExceptDeleted(pStatus)
% pStatusCode (int) The status code that will be applied to the
% selected data.
global artoaWorkspace;
global artoaWorkspace artoaGui;
%% Set selection
artoaWorkspace.editPressure.selectedPoints = (artoaWorkspace.statusPressure ~= 2);
......@@ -17,8 +17,9 @@ artoaWorkspace.statusPressure(artoaWorkspace.editPressure.selectedPoints) = pSta
%% Update gui
artoa.controller.edit.updateAvailablePlots();
%% Remove the selected points from workspace
artoaWorkspace.editPressure = rmfield(artoaWorkspace.editPressure, 'selectedPoints');
[artoaGui.editPressure, artoaWorkspace.editPressure] = ...
artoa.controller.edit.clearSelection(artoaGui.editPressure, artoaWorkspace.editPressure);
end
......@@ -25,11 +25,9 @@ artoaWorkspace.statusPressure(artoaWorkspace.editPressure.selectedPoints) = pSta
%% Update gui
artoa.controller.edit.updateAvailablePlots();
delete(artoaGui.editPressure.selectedPolygon);
artoaGui.editPressure = rmfield(artoaGui.editPressure, 'selectedPolygon');
%% Remove the polygon field from workspace
artoaWorkspace.editPressure = rmfield(artoaWorkspace.editPressure, 'selectedPoints');
[artoaGui.editPressure, artoaWorkspace.editPressure] = ...
artoa.controller.edit.clearSelection(artoaGui.editPressure, artoaWorkspace.editPressure);
end
......@@ -6,7 +6,7 @@ function [] = applyStatusToAllPointsExceptDeleted(pStatus)
% pStatusCode (int) The status code that will be applied to the
% selected data.
global artoaWorkspace;
global artoaWorkspace artoaGui;
%% Set selection
artoaWorkspace.editTemperature.selectedPoints = (artoaWorkspace.statusTemperature ~= 2);
......@@ -17,8 +17,8 @@ artoaWorkspace.statusTemperature(artoaWorkspace.editTemperature.selectedPoints)
%% Update gui
artoa.controller.edit.updateAvailablePlots();
%% Remove the selected points from workspace
artoaWorkspace.editTemperature = rmfield(artoaWorkspace.editTemperature, 'selectedPoints');
[artoaGui.editTemperature, artoaWorkspace.editTemperature] = ...
artoa.controller.edit.clearSelection(artoaGui.editTemperature, artoaWorkspace.editTemperature);
end
......@@ -25,11 +25,9 @@ artoaWorkspace.statusTemperature(artoaWorkspace.editTemperature.selectedPoints)
%% Update gui
artoa.controller.edit.updateAvailablePlots();
delete(artoaGui.editTemperature.selectedPolygon);
artoaGui.editTemperature = rmfield(artoaGui.editTemperature, 'selectedPolygon');
%% Remove the polygon field from workspace
artoaWorkspace.editTemperature = rmfield(artoaWorkspace.editTemperature, 'selectedPoints');
[artoaGui.editTemperature, artoaWorkspace.editTemperature] = ...
artoa.controller.edit.clearSelection(artoaGui.editTemperature, artoaWorkspace.editTemperature);
end
......@@ -24,12 +24,9 @@ end
artoaWorkspace.toaData.status(artoaWorkspace.editTimeOfArrival.selectedPoints) = pStatusCode;
%% Update gui
artoa.controller.edit.timeOfArrival.plot();
delete(artoaGui.editTimeOfArrival.selectedPolygon);
artoaGui.editTimeOfArrival = rmfield(artoaGui.editTimeOfArrival, 'selectedPolygon');
%% Remove the polygon field from workspace
artoaWorkspace.editTimeOfArrival = rmfield(artoaWorkspace.editTimeOfArrival, 'selectedPoints');
artoa.controller.edit.updateAvailablePlots();
[artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival] = ...
artoa.controller.edit.clearSelection(artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival);
end
function [guiHandle, workspaceStruct] = clearSelection(pGuiHandle, pWorkspaceStruct)
%CLEARSELECTION If the fields in the given parameters are available, they will be deleted.
%
guiHandle = pGuiHandle;
workspaceStruct = pWorkspaceStruct;
%% Remove polygon from gui
if isfield(guiHandle, 'selectedPolygon')
delete(guiHandle.selectedPolygon);
guiHandle = rmfield(guiHandle, 'selectedPolygon');
end
%% Remove the polygon field from workspace
if (isfield(workspaceStruct, 'selectedPoints'))
workspaceStruct = rmfield(workspaceStruct, 'selectedPoints');
end
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