view m-toolbox/m/gui/gltpda/g_KeepResultCallback.m @ 2:18e956c96a1b database-connection-manager

Add LTPDADatabaseConnectionManager implementation. Matlab code
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Sun, 04 Dec 2011 21:23:09 +0100
parents f0afece42f48
children
line wrap: on
line source

function g_KeepResultCallback(hObject,varargin)
   % Whenever the user clicks on the checkbox to maintain local results.
   
   global selBlocks
   
   switch get(hObject,'Value')
      case 0
         % Cycle to restore proper color
         [meth,clas] = strtok(get_param(gcbh,'Tag'),' ');
         infoObj = eval([clas,'.getInfo(''',getappdata(0,'ltpda_currFunctionName'),''')']);
         switch infoObj.mcategory
            case 'Constructor'
               for kk=1:length(selBlocks)
                  try %#ok<ALIGN>
                     set_param(selBlocks(kk),'Backgroundcolor','green')
                     set_param(selBlocks(kk),'MaskHelp','')
                  catch, end
               end
            case 'Output'
               for kk=1:length(selBlocks)
                  try %#ok<ALIGN>
                     set_param(selBlocks(kk),'Backgroundcolor','lightBlue')
                     set_param(selBlocks(kk),'MaskHelp','')
                  catch, end
               end
            otherwise
               for kk=1:length(selBlocks)
                  try %#ok<ALIGN>
                     set_param(selBlocks(kk),'Backgroundcolor','red')
                     set_param(selBlocks(kk),'MaskHelp','')
                  catch, end
               end
         end
      case 1
         for kk=1:length(selBlocks)
            try %#ok<ALIGN>
               set_param(selBlocks(kk),'Backgroundcolor','magenta');
               set_param(selBlocks(kk),'MaskHelp','probe');
            catch, end
         end
   end
end