www.pudn.com > Closid30.rar > Clw2simp.m, change:1999-02-01,size:6174b


%function clw2simp 
% clw2simp 
% 
% Construct window for importing (C times) sensitivity function 
% as a first step in the two-stage identification method. 
 
% Functions called: clsetcol,clximp 
 
% 10-05-1996 (originally named cl2simp) 
% (c) Paul Van den Hof, Edwin van Donkelaar 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update: 19-05-1998 
%              01-02-1999: reordering edit-fields in import window 
 
global CLIDscrz 
 
% Colors 
[frmcol,txtcol,edicol,pshcol,radcol,axscol,c7,c8,c9,c10,... 
modcol,edtcol,pubcol,putcol,chbcol,chtcol,txbcol,pstcol]=clsetcol; 
 
% Determine size and position of window 
z=CLIDscrz; 
posfgm=[45 z(4)-360 370 320]; 
 
%Determine whether to look for S or CS: 
opt=get(findobj('tag','CLINPUTSIGNAL'),'userdata'); 
if opt==2 
  str1='CS'; 
  str2='r2'; 
else 
  str1='S'; 
  if opt==1 
    str2='r1'; 
  elseif opt==3 
    str2='[r1 + C r2]'; 
  elseif opt==4 
    str2='[u + C y]'; 
  end 
end 
 
% Open window: 
clfgyui=figure('Menubar','none','Color',frmcol,... 
   'pos',posfgm,... 
   'Numbertitle','off','Name',['Simulate with imported ' str1],... 
   'Resize','on','TAG','CLIMPFAC'); 
 
% Construct frame for estimate sensitivity function S 
fryuix=0.01;fryuiy=0.01; 
fryuipos=[fryuix fryuiy .98 .7; 
          fryuix+0.06 fryuiy+0.50 .88 .08];       % "Give S"    
typyuipos =[fryuix+0.01 fryuiy+0.39 .20 .08;...   % "S" 
            fryuix+0.23 fryuiy+0.42 .25 .07;...   %  
            fryuix+0.01 fryuiy+0.27 .20 .08;...   % "Format"  
            fryuix+0.23 fryuiy+0.29 .72 .08;... 
            fryuix+0.02 fryuiy+0.12 .30 .08;...   % "IMPORT" 
            fryuix+0.34 fryuiy+0.12 .30 .08;...   % "HELP" 
            fryuix+0.66 fryuiy+0.12 .30 .08;...   % "CLOSE" 
            fryuix+0.55 fryuiy+0.39 .10 .08;...   % "File S" 
            fryuix+0.70 fryuiy+0.42 .25 .07]; 
 
% Accompanying text 
uicontrol(clfgyui,'style','text','uni','nor',... 
          'pos',[0.01 0.86 0.97 0.075],'back',txbcol,'fore',txtcol,... 
          'string','SIGNALS TO BE CONSTRUCTED') ; 
uicontrol(clfgyui,'style','text','uni','nor',... 
          'pos',[0.05 0.79 0.6 0.06],'back',frmcol,'Fore',txtcol,... 
          'hori','left','string',['ID-input: x = ' str1 ' ' str2]); 
uicontrol(clfgyui,'style','text','uni','nor',... 
          'pos',[0.05 0.72 0.6 0.06],'back',frmcol,'Fore',txtcol,... 
          'hori','left','string','ID-output: z = y') ; 
uicontrol(clfgyui,'style','text','uni','nor',... 
          'pos',[0.05 0.65 0.75 0.06],'back',frmcol,'Fore',txtcol,... 
          'hori','left',... 
          'string',['Unknown: ' str1]) ; 
 
fryui=zeros(17,1); 
fryui(1)=uicontrol(clfgyui,'style','frame','uni','nor',... 
   'pos',fryuipos(1,:),'Back',frmcol,'fore',frmcol); 
fryui(2)=uicontrol(clfgyui,'style','text','uni','nor',... 
   'pos',fryuipos(2,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String',['GIVE ' str1]); 
fryui(3)=uicontrol(clfgyui,'style','text','uni','nor',... 
   'pos',typyuipos(1,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String',str1,'Value',1); 
fryui(4)=uicontrol(clfgyui,'style','edit','uni','nor',... 
   'pos',typyuipos(2,:),'tag','VARNAME','horiz','left',... 
   'Back',edicol,'Fore',edtcol,... 
   'String',''); 
 
fryui(14)=uicontrol(clfgyui,'style','text','uni','nor',... 
   'pos',typyuipos(8,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','File'); 
fryui(15)=uicontrol(clfgyui,'style','edit','uni','nor',... 
   'pos',typyuipos(9,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,'tag','FILENAME',... 
   'String',''); 
 
%Construct Pop-up menu for auxiliary S format choice 
fryui(5)=uicontrol(clfgyui,'style','text','uni','nor',... 
   'pos',typyuipos(3,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Format'); 
stringyuix='[num;den]|[A B;C D]|from ident model board'; 
fryui(6)=uicontrol(clfgyui,'style','popup','uni','nor',... 
   'Back',pubcol,'Fore',putcol,'String',stringyuix,... 
   'pos',typyuipos(4,:)); 
 
fryui(11)=uicontrol(clfgyui,'style','push','uni','nor',... 
   'pos',typyuipos(5,:),... 
   'Back',pshcol,'Fore',pstcol,... 
   'String','CONSTRUCT','Value',0); 
fryui(12)=uicontrol(clfgyui,'style','push','uni','nor',... 
   'pos',typyuipos(6,:),... 
   'Back',pshcol,'Fore',pstcol,... 
   'String','HELP','Value',0); 
fryui(13)=uicontrol(clfgyui,'style','push','uni','nor',... 
   'pos',typyuipos(7,:),... 
   'Back',pshcol,'Fore',pstcol,... 
   'String','CLOSE','Value',0); 
 
 
% Construct message line at the bottom of the figure 
fryui18=uicontrol(clfgyui,'style','text','uni','nor',... 
     'pos',[fryuix+0.01 fryuiy+0.04 .97 .06],... 
      'back',txbcol,'Fore',txtcol,... 
      'string','Choose transfer function then push construct button.',... 
      'tag','YUIMPMESSAGE'); 
% 
% Make editable text for variable name and file name noneditable 
% in case input from SITB model board. 
if get(fryui(6),'value')==3 
  set(fryui(4),'style','text','back',c8,'string',' '); 
  set(fryui(15),'style','text','back',c8,'string',' '); 
end 
% Set corresponding callback of the format pop-up menu 
set(fryui(6),'callb',... 
 ['form=get(gco,''value'');'... 
 'global CLIDcols; edicol=CLIDcols(3,:); c8=CLIDcols(8,:);'... 
 'if form~=3,'... 
   'set(findobj(''tag'',''VARNAME''),''style'',''edit'',''back'',edicol,''string'','' '');'... 
   'set(findobj(''tag'',''FILENAME''),''style'',''edit'',''back'',edicol,''string'','' '');'... 
 'else,'... 
   'set(findobj(''tag'',''VARNAME''),''style'',''text'',''back'',c8,''string'','' '');'... 
   'set(findobj(''tag'',''FILENAME''),''style'',''text'',''back'',c8,''string'','' '');'... 
 'end; clear form; clear CLIDcols;']); 
% 
% Put handles in userdata of figure 
r=length(fryui); 
us=zeros(r,1); 
us(:,1)=fryui; 
set(clfgyui,'Userdata',us); 
 
% Handling CLOSE-key 
strclose='close(gcf);'; 
set(fryui(13),'callb',strclose); 
 
% Handling IMPORT-key: data is directly transferred to object  
% in main window 
set(fryui(11),'callb',... 
   ['eval(clximp(''start'',''Sx''),''clerrdia(''''ERROR IMPORTING S: cannot locate variable'''',1)'');'... 
    'clsigcon(1);']); 
 
% Handling HELP-key 
set(fryui(12),'callb','hthelp(''cl2simps.htm'')');