Skip to content
Snippets Groups Projects
tsgqc.m 110 KiB
Newer Older
    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');
    
  end

%% QuitMenuCallback
  % -----------------------------------------------------------------
  % 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'];

    % set tsg.levitus empty before save preferences in mat file
    % ---------------------------------------------------------
    tsg.levitus = [];

    % save preference mat file
    % ------------------------
    save( config_file, 'tsg');

    % 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');
      
      if strcmp(selection, 'Yes')
        
        % call File/Save Menu Callback before before quit
        % -----------------------------------------------
        SaveMenuCallback;
             
      end
      
      % quit program
      % ------------
      quitProgram(hMainFig, DEFAULT_PATH_FILE);
      
    else
      selection = ...
        questdlg(['Quit ' get(hMainFig, 'Name') '?'],...
        ['Quit ' get(hMainFig, 'Name') '?'],...
        'Yes', 'No', 'Yes');
      if strcmp(selection, 'No')
        return;
      else
        quitProgram(hMainFig, DEFAULT_PATH_FILE);
      end
    end

  end

% ----------------
end