Newer
Older
% Write a .TSG (ascii) file
% --------------------------
Yves Gouriou
committed
error = writeAsciiTsg(hMainFig, strcat(pathName, fileName));
% Pointer reset to arrow
% ----------------------
set( hMainFig, 'Pointer', 'arrow' );
% enable Quality Control mode
% ---------------------------
hdl_pushtool = findobj('Tag', 'QC');
set(hdl_pushtool, 'Enable', 'on');
% Set MouseMotion 'on'
% --------------------
set( hMainFig, 'WindowButtonMotionFcn', @MouseMotion);
% Check for .TSG writing error - must to be rewriting
% Because of the 'return' - These line must be at the end
% --------------------------------------------------------
warning('tsgqc:SaveMenuCallback', ...
'TSG no ouput: %s %s', pathName, fileName);
return;
end
end
%% ExportSampleCallback
% -------------------------------------------------------------------
% Callback function run when the Export menu item is selected
% -------------------------------------------------------------------
function ExportSampleCallback(hObject, eventdata)
% Retrieve named application data
% -------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
% Desactivate MouseMotion 'off'
% ----------------------------
set( hMainFig, 'WindowButtonMotionFcn', []);
% Open standard dialog box for saving files
% -----------------------------------------
[fileName, pathName, filterindex] = uiputfile('*.spl', ...
'Save file name', strcat(tsg.file.name, '.spl'));
% if user press cancel button, all var are set to zero
% ----------------------------------------------------
if filterindex == 0
% Pointer set to watch during reading and plotting
% ------------------------------------------------
set( hMainFig, 'Pointer', 'watch' );
% Write a .SPL (ascii) file
% --------------------------
error = writeAsciiSample(hMainFig, strcat(pathName, fileName));
% Pointer reset to arrow
% ----------------------
set( hMainFig, 'Pointer', 'arrow' );
% enable Quality Control mode
% ---------------------------
hdl_pushtool = findobj('Tag', 'QC');
set(hdl_pushtool, 'Enable', 'on');
% Set MouseMotion 'on'
% --------------------
set( hMainFig, 'WindowButtonMotionFcn', @MouseMotion);
% Check for .TSG writing error - must to be rewriting
% Because of the 'return' - These line must be at the end
% --------------------------------------------------------
if error == -1
warning('tsgqc:SaveMenuCallback', ...
'TSG no ouput: %s %s', pathName, fileName);
return;
end
end
%% UndoMenuCallback
% -----------------------------------------------------------------------
% Callback function run when the Edit/Undo menu item is selected (Ctrl+Z)
% -----------------------------------------------------------------------
function UndoMenuCallback(hObject, eventdata)
% Undo module not yet implemented
% -------------------------------
% msgbox('Undo module not yet implemented', 'modal');
tsg.queue = undo(tsg.queue);
tsg.SSPS_QC = get(tsg.queue);
% Make the Salinity, temperature and velocity plot
% ------------------------------------------------
plot_SalTempVel( hMainFig, hPlotAxes );
end
%% RedoMenuCallback
% -----------------------------------------------------------------------
% Callback function run when the Edit/Redo menu item is selected (Ctrl+R)
% -----------------------------------------------------------------------
function RedoMenuCallback(hObject, eventdata)
% Redo module not yet implemented
% -------------------------------
msgbox('Redo module not yet implemented', 'modal');
%% QuitMapCallback
% -----------------------------------------------------------------
% Callback function run when the Quit Map Figure item is selected
% -----------------------------------------------------------------
function QuitMapCallback(hObject, eventdata)
% Make the earth map invisible
% ----------------------------
set(hMapToggletool, 'state', 'off' );
% -----------------------------------------------------------------
% Callback function run when the Quit menu item is selected
% -----------------------------------------------------------------
function QuitMenuCallback(hObject, eventdata)
% save config mat file in prefdir
% -------------------------------
config_file = [prefdir, filesep, tsgqcname, '.mat'];
% save preference mat file
% ------------------------
preference = tsg.preference;
save( config_file, 'preference');
% If the data have been modified and not save, the program
% ask to save the data
% --------------------------------------------------------
if strcmp( get( hSaveMenu, 'UserData' ), 'on')
selection = ...
questdlg('The file has been modified. Do you want to save it ?',...
'Save before Quit?',...
'Yes', 'No', 'Yes');
% call File/Save Menu Callback before before quit
% -----------------------------------------------
SaveMenuCallback;
quitProgram(DEFAULT_PATH_FILE, hMainFig, hMapFig);
else
selection = ...
questdlg(['Quit ' get(hMainFig, 'Name') '?'],...
['Quit ' get(hMainFig, 'Name') '?'],...
'Yes', 'No', 'Yes');
if strcmp(selection, 'No')
return;
else
quitProgram(DEFAULT_PATH_FILE, hMainFig, hMapFig);