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


function clwcfimx 
% clwcfimx 
% 
% Construct window for importing coprime factorizations of 
% auxiliary model for coprime factor identification. 
 
% Functions called: clsetcol,clximp 
 
% 10-05-1996  (originally named clcfimp) 
% (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 minor corrections on window layout 
 
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]; 
 
% Open window: 
clfgyui=figure('Menubar','none','Color',frmcol,... 
   'pos',posfgm,... 
   'Numbertitle','off','Name',['SIMULATE WITH IMPORTED Gx'],... 
   'Resize','on','TAG','CLIMPFAC'); 
 
% Construct frame for Import Factorizations 
fryuix=0.01;fryuiy=0.01; 
fryuipos=[fryuix fryuiy .98 .7; 
          fryuix+0.06 fryuiy+0.53 .88 .08];       % "Give Gx"    
typyuipos =[fryuix+0.01 fryuiy+0.41 .22 .08;...   % "Auxil. model" 
            fryuix+0.25 fryuiy+0.44 .25 .06;...   %  
            fryuix+0.01 fryuiy+0.30 .20 .08;...   % "Format"  
            fryuix+0.25 fryuiy+0.31 .70 .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.41 .10 .08;...   % "File Auxil." 
            fryuix+0.70 fryuiy+0.44 .25 .06]; 
 
% Accompanying text 
uicontrol(clfgyui,'style','text','uni','nor',... 
          'pos',[0.01 0.9 0.97 0.075],'back',txbcol,'fore',txtcol,... 
          'string','SIGNALS TO BE CONSTRUCTED') ; 
uicontrol(clfgyui,'style','text','uni','nor',... 
          'pos',[0.05 0.83 0.80 0.07],'back',frmcol,'Fore',txtcol,... 
     'hori','left','string','ID-input x = inv(Dx +C Nx)[u + C y]') ; 
uicontrol(clfgyui,'style','text','uni','nor',... 
          'pos',[0.05 0.76 0.80 0.07],'back',frmcol,'Fore',txtcol,... 
          'hori','left','string','ID-output: z = [y ; u]') ; 
uicontrol(clfgyui,'style','text','uni','nor',... 
          'pos',[0.05 0.69 0.80 0.07],'back',frmcol,'Fore',txtcol,... 
          'hori','left','string','Aux.variables: Gx = Nx/Dx') ; 
 
fryui=zeros(17,1); 
fryui(1)=uicontrol(clfgyui,'style','frame','uni','nor',... 
   'pos',fryuipos(1,:),'Back',frmcol,'fore',frmcol); 
 
fryui20=uicontrol(clfgyui,'style','frame','uni','nor',... 
        'pos',[fryuix fryuiy+0.27 0.98 0.36],... 
         'back',frmcol); 
 
fryui(2)=uicontrol(clfgyui,'style','text','uni','nor',... 
   'pos',fryuipos(2,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','GIVE Gx'); 
fryui(3)=uicontrol(clfgyui,'style','text','uni','nor',... 
   'pos',typyuipos(1,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Auxil.model','Value',1); 
fryui(4)=uicontrol(clfgyui,'style','edit','uni','nor',... 
   'pos',typyuipos(2,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,'tag','VARNAME',... 
   '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 model format choice 
fryui(5)=uicontrol(clfgyui,'style','text','uni','nor',... 
   'pos',typyuipos(3,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Format'); 
stringyuix='from model board|[numx;denx]|[Ax Bx;Cx Dx]|[numNx;denNx;numDx;denDx]|[Andx Bndx;Cndx Dndx]'; 
fryui(6)=uicontrol(clfgyui,'style','popup','uni','nor',... 
   'String',stringyuix,'Back',pubcol,'Fore',putcol,... 
   '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.03 .97 .06],... 
      'back',txbcol,'Fore',txtcol,... 
      'string','Choose Gx, 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')==1 
  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~=1,'... 
   '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 HELP-key 
set(fryui(12),'callb','hthelp(''clcfimpx.htm'')'); 
 
% Handling CONSTRUCT-key: data is directly transferred to object in main window 
set(fryui(11),'callb',... 
   ['eval(clximp(''start'',''Gx''),''clerrdia(''''ERROR IMP. AUXIL. MODEL: cannot locate variable'''',1)''),'... 
    'clsigcon(2);']);