www.pudn.com > Closid30.rar > Cldrgdat.m, change:1998-09-16,size:2808b


% Cldrgdat 
% 
% M-file taking care of dragging and dropping data set icons on 
% working and validation data icons. 
 
% This m-file uses gui-handling routines from the SITB (following the 
% same spirit as the SITB-routine idmwwb.m). 
% 
% 13-09-1998 
% (c) Paul Van den Hof 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update:    16-09-1998   
 
global CLIDmeth CLIDmods CLIDevas 
 
seltyp=get(gcf,'Selectiontype'); 
curo=iduigco; 
if strcmp(get(curo,'type'),'text')|strcmp(get(curo,'type'),'line') 
   cura=get(curo,'parent'); 
elseif strcmp(get(curo,'type'),'axes') 
   cura=curo; 
else 
%   iduistat('Click acknowledged. No action invoked.'); 
   return 
end 
% 
usd=get(cura,'tag'); 
if isempty(usd)  
   return 
%elseif  strcmp(usd,'expor') 
%   iduistat('Drag data/model icon here to export it to workspace.') 
%   return 
%elseif  strcmp(usd,'ltivi') 
%   iduistat('Drag model icon here to study it in a LTI Viewer.') 
%   return 
%elseif  strcmp(usd,'seles') 
%   iduistat('Drag data icon here to select it as working data.') 
%   return 
%elseif  strcmp(usd,'selva') 
%   iduistat('Drag data icon here to select it as validation data.') 
%   return 
%elseif  strcmp(usd,'waste')&strcmp(seltyp,'normal') 
%   iduistat(['Drag data/model icon here to delete it. Double click ',... 
%             '(right mouse button) to open can.']) 
%   return 
end 
% 
%line=findobj(cura,'type','line'); 
%if strcmp(get(line(1),'vis'),'off') 
%  iduistat('Empty icon. No action invoked.') 
%  return 
%end 
axtype=usd(7:10); 
if strcmp(seltyp,'normal') 
  if ~strcmp(axtype,'DATA') 
    return 
  end 
  set(cura,'units','pixels') 
  axpos=get(cura,'pos'); 
  dragrect(axpos) 
  set(cura,'units','norm') 
  new=idmhit('axes'); 
  tagnew=get(new,'tag'); 
  tagn=tagnew(7:10); 
  if cura~=new, 
% 
%    disp('new axis accepted') 
% 
    if ~strcmp(tagn,'DATE') & ~strcmp(tagn,'DATV') 
	  return 
	end 
% find ordering number of 'old' axis and copy the appropriate data: 
    numb=find(CLIDmods(4,:)==cura); 
	numb=numb(1); 
 
% check if there is no identification window open: 
    for k=1:size(CLIDmeth,2) 
      if findobj('name',CLIDmeth{k})  
        clerrdia(['ERROR: Close identification window before '... 
	              'reselecting working/validation data'],1) 
		return 
      end 
	end 
% 
 	if strcmp(tagn,'DATE') 
% check if there is a change: 
      if numb==CLIDmods(58,1) 
	    return 
	  end 
	  clobjins(numb,'datw') 
	elseif strcmp(tagn,'DATV') 
% check if there is a change: 
	  if numb==CLIDmods(59,1) 
	    return 
	  end 
% 
	  clobjins(numb,'datv') 
% update the data-dependent model evaluation views 
      for k=3:4, 
        if ~isempty(findobj('name',CLIDevas{k})) 
          clplotev(k,'all') 
        end 
      end 
	end 
  end 
end