www.pudn.com > Closid30.rar > Clwcopmb.m, change:1998-09-17,size:4884b


function clwcopmb(option) 
% function clwcopmb(option) 
% 
% Opens window to copy estimated objects to a plant models  
% on the model board. 
%  
% OPTION indicates the identification method being used as 
% 1   Two-stage: 
% 2   Indirect: 
% 3   Tailor-made: 
% 4   IV: 
% 5   Coprime factors: 
% 6   Dual-Youla: Get dual-Youla R factor as selected model from 
%        Ljung ident toolbox and convert it to the plant model P 
% 7   Non-parametric: 
 
% Functions called: clmodcop 
 
% 14-06-1996 (formerly named clyuexp.m) 
% (c) Douwe de Vries, Paul Van den Hof 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update: 19-05-1998 
%              17-09-1998 Closing identification windows when copying to  
%                         model board 
 
% Globals 
global CLIDmnum 
 
% Colors 
[frmcol,txtcol,edicol,pshcol,radcol,axscol,c7,c8,c9,c10,... 
modcol,edtcol,pubcol,putcol,chbcol,chtcol,txbcol,pstcol]=clsetcol; 
 
% Options 
strmnum=num2str(CLIDmnum(1,option)+1); 
 
if option==1 
  dftitle=['twost' strmnum]; 
  sthead=['COPY gets one highlighted model in the ',... 
          'IDENT model board and copies it ',... 
          'to the CLOSID model board.']; 
elseif option==2 
  dftitle=['ind' strmnum]; 
  sthead=['COPY gets one highlighted model in the ',... 
          'IDENT model board and converts it to an ',... 
          'open-loop plant model on the CLOSID model board']; 
elseif option==3 
  dftitle=['tailr' strmnum]; 
  sthead=['Estimated plant model is transferred to the model board']; 
elseif option==4 
   dftitle=['IV' strmnum]; 
   sthead=['IV-estimated plant model is copied to the model board']; 
elseif option==5   
  dftitle=['cf' strmnum]; 
  if get(findobj('tag','CLIDENT'),'value')==3 
    sthead=['COPY gets one highlighted (1x2)-model in the ',... 
          'IDENT model board and converts it to an ',... 
          'open-loop plant model on the CLOSID model board']; 
  elseif get(findobj('tag','CLIDENT'),'value')==2 
    sthead=['COPY copies the estimated plant model ',... 
            'to the CLOSID model board']; 
  end 
elseif option==6 
  dftitle=['youla' strmnum]; 
  sthead=['COPY gets one highlighted model in the',... 
          'IDENT model board and converts it to a',... 
          'plant model on the CLOSID model board']; 
elseif option==7 
   dftitle=['nonpr' strmnum]; 
   sthead=['Nonparametric plant model is copied to the model board']; 
else 
   return 
end 
 
% Open window 
posfgm=[50 50 250 260]; 
clfgyue=figure('Menubar','none','Color',frmcol,... 
   'pos',posfgm,'Numbertitle','off','Name',['Copy to model board'],... 
   'Resize','on'); 
 
% Construct frame 
fryuex=0.01;fryuey=0.01; 
fryuepos=[fryuex fryuey .98 .98; 
          fryuex+0.04 fryuey+0.85 .90 .10;        % "NOTE" 
          fryuex+0.04 fryuey+0.40 .90 .42];       % sthead 
typyuepos =[fryuex+0.01 fryuey+0.25 .40 .10;...   % "Model P" 
            fryuex+0.42 fryuey+0.25 .54 .10;... 
            fryuex+0.02 fryuey+0.02 .45 .12;...   % "COPY" 
            fryuex+0.34 fryuey+0.02 .30 .12;...   % "HELP" 
            fryuex+0.51 fryuey+0.02 .45 .12];     % "CLOSE" 
 
fryue=zeros(8,1); 
fryue(1)=uicontrol(clfgyue,'style','frame','uni','nor',... 
   'pos',fryuepos(1,:),'Back',frmcol); 
fryue(2)=uicontrol(clfgyue,'style','text','uni','nor',... 
   'pos',fryuepos(3,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String',sthead); 
fryue(3)=uicontrol(clfgyue,'style','text','uni','nor',... 
   'pos',typyuepos(1,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Plant model G'); 
fryue(4)=uicontrol(clfgyue,'style','edit','uni','nor',... 
   'pos',typyuepos(2,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,... 
   'String',dftitle); 
fryue(5)=uicontrol(clfgyue,'style','push','uni','nor',... 
   'pos',typyuepos(3,:),... 
   'Back',pshcol,'Fore',pstcol,... 
   'String','COPY','Value',0); 
fryue(7)=uicontrol(clfgyue,'style','push','uni','nor',... 
   'pos',typyuepos(5,:),... 
   'Back',pshcol,'Fore',pstcol,... 
   'String','CANCEL','Value',0); 
fryue(8)=uicontrol(clfgyue,'style','text','uni','nor',... 
   'pos',fryuepos(2,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','NOTE'); 
 
% Put handles in userdata of figure 
r=length(fryue); 
us=zeros(r,1); 
us(:,1)=fryue; 
set(clfgyue,'Userdata',us); 
 
% CALLBACKS 
 
% copy 
%set(fryue(5),'callb',... 
%   ['opt=get(findobj(''tag'',''CLMAINPOPIDENT''),''value'');'... 
%     'clmodcop(opt-1); clear opt;']); 
set(fryue(5),'callb',... 
   ['opt=get(findobj(''tag'',''CLMAINPOPIDENT''),''value'');'... 
    'clmodcop(opt-1);'... 
	'close(findobj(''tag'',''CLIDWINDOW''));'... 
	'if opt==8, close(findobj(''tag'',''SPECESTWIN''));end;'... 
    'close(gcf); opt=findobj(''TAG'',''CLMAINPOPIDENT'');'... 
	'set(opt,''Userdata'',0);set(opt,''Value'',1);clear opt']); 
% cancel 
stclose='close(gcf);'; 
set(fryue(7),'callb',stclose);