Commit 723c0460 authored by Colin Eles's avatar Colin Eles
Browse files

latest updates of getting code ready for release

git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/trunk/TableTool@6231 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
parent b9fa73e5
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
%% check_output_consistent
%   checks if the block has the correct number of outputs based on the
%   output mode, checks that the outputs names are compatible witht the
%   matlab spec for naming variables.
% inputs:
%   object:GUI - gui object
% outputs:
%   result:boolean - true if table consistent, false if not.
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function result = check_output_consistent( object )
@@ -23,7 +31,7 @@ end

for i=1:size(output_table,2)
    if (~strcmp(output_block_types{i},output_table{i}))
        result = false
        result = false;
        return;
    end
end
+9 −0
Original line number Diff line number Diff line
%% multi_select_call
%   called whenever a user selects an output mode, one versus multi
% inputs: 
%   object:GUI - GUI handle
%   src - calling object
%   event - event data
% outputs: 
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = multi_select_call(object,src,event)
label = get(src,'Label');
% determine which label the user clicked on
if strcmp(label,'Multiple Outputs')
    object.multi_mode = 1;
else
+9 −3
Original line number Diff line number Diff line
%% redo_call
%   called when user selects redo, calls undomanager and performs action
% inputs:
%   object - GUI object
%   src - source object
%   event - event data
% outputs:
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = redo_call(object,src,event)
@@ -17,8 +25,7 @@ else
        case 3
            recalled_data.grid.pb_delete_call(recalled_data.grid.delete_cell_pb,1);
        case 4
            
            %recalled_data.cell.pb_call(recalled_data.cell.grid_pb,1);
            % readd grid deleted with undo
            recalled_data.cell.subgrid = recalled_data.grid;
            recalled_data.cell.subgrid = recalled_data.grid;
            recalled_data.cell.pb_flag = 0;
@@ -29,7 +36,6 @@ else
                recalled_data.grid.rGrid.refresh;
            end
            object.reset_wh();
            %gui.draw_grid2(gui.Grid2);
            object.draw_allgrids(1);
            
            
+4 −11
Original line number Diff line number Diff line
@@ -28,30 +28,23 @@ if(~isempty(unicode2native(event.Character)))
            end
        end
    end
    %if time > 0.2
    
    %uicontrol(object.function_name_control);
    
    % hack because api does not update the string field of
    % textbox until after it loses focus. temporarily focus on
    % label, read string, refocus on textbox.
    uicontrol(object.name_label);
        
    
    undo_data.action = 1;
    undo_data.grid = [];
    undo_data.cell = src;
    undo_data.text = get(src,'String');
    undo_data.subgrid = []
    undo_data.subgrid = [];
    
    object.undo_man.new_state(undo_data);
    %end
    tic;

    uicontrol(src);
    figure(object.fig);

    %end
    
    object.update_undoredo
    
    
+10 −12
Original line number Diff line number Diff line
%% undo_call
%   called when user selects undo, calls undomanager and performs action
% inputs:
%   object - GUI object
%   src - source object
%   event - event data
% outputs:
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = undo_call(object,src,event)
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here

object.undo_man
recalled_data = object.undo_man.undo;
if isempty(recalled_data);
@@ -24,7 +31,6 @@ else
                recalled_data.grid.rGrid.refresh;
            end
            object.reset_wh();
            %gui.draw_grid2(gui.Grid2);
            object.draw_allgrids(1);
            object.undo_man.search_replace(1,recalled_data.subgrid,recalled_data.cell.cond);
            set(recalled_data.grid.delete_cell_pb,'Enable','on');
@@ -34,7 +40,6 @@ else
            recalled_data.cell.subgrid = [];
            recalled_data.cell.pb_flag = 1;
            object.reset_wh();
            %gui.draw_grid2(gui.Grid2);
            object.draw_allgrids(1);
            
        case 5 % deleting last cell in grid
@@ -47,26 +52,19 @@ else
                recalled_data.grid.rGrid.refresh;
            end
            object.reset_wh();
            %gui.draw_grid2(gui.Grid2);
            object.draw_allgrids(1);
            %             object.undo_call([],[]);
            
            recalled_data.grid.cells = [recalled_data.grid.cells recalled_data.subgrid];
            recalled_data.grid.num_cells = recalled_data.grid.num_cells + 1;
            % refresh the rGrid so that a new results cell is created
            if(~isempty(recalled_data.grid.rGrid))
                recalled_data.grid.rGrid.refresh;
            end
            object.reset_wh();
            %gui.draw_grid2(gui.Grid2);
            object.draw_allgrids(1);
            set(recalled_data.grid.delete_cell_pb,'Enable','on');
    end
end
% object.setData(recalled_data);
% object.set_command_pos;
%             object.reset_wh();
%             object.draw_allgrids(0);


object.update_undoredo
end
Loading