-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added delete shoreline functionality
- Loading branch information
1 parent
9d57ee4
commit bb3cf69
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
function CSPGdeleteShoreline(handles) | ||
|
||
CSPloadPaths | ||
data = get(handles.oblq_image,'UserData'); | ||
data_plan = get(handles.plan_image,'UserData'); | ||
fileparts = CSPparseFilename(data.fname); | ||
site = fileparts.site; | ||
|
||
%First check that a shoreline exists | ||
if isempty(data_plan.sl)||~isfield(data_plan,'sl') | ||
warning('No shoreline exists to save!') | ||
else | ||
button = questdlg('Are you sure you want to delete this shoreline from the database?','Delete Shoreline?','Yes','No','No'); | ||
switch button | ||
case 'Yes' | ||
savedir = [shoreline_path filesep fileparts.site filesep fileparts.year filesep]; | ||
savefname = strrep(data.fname,'snap','shoreline'); | ||
savefname = strrep(savefname,'timex','shoreline'); | ||
savefname = strrep(savefname,'.jpg','.mat'); | ||
delete(fullfile(savedir,savefname)) | ||
disp('Shoreline deleted from DB!') | ||
end | ||
end | ||
|