www.pudn.com > Closid30.rar > CLWIMPD.M, change:1999-02-01,size:9675b


% clwimpd 
% 
% Open window for import of data 
 
% Functions called: clsetcol,cldatimp 
 
% 27-04-1996; originally named 'cliddat' 
% (c) Paul Van den Hof 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update: 19-05-1998 
%              01-02-1999: reordering edit-fields  
 
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=[z(3)-410 z(4)-420 360 390]; 
 
% Open window: 
clfgdat=figure('Menubar','none','Color',frmcol,... 
   'pos',posfgm,... 
   'Numbertitle','off','Name',['Data import'],... 
   'Resize','off'); 
%   'uni','nor','pos',[ 0.4879    0.1888    0.45    0.7],... 
 
% Construct frame for data 
frdatx=0.01;frdaty=0.01; 
frdatpos=[frdatx frdaty+0.41 .98 .57; 
          frdatx+0.04 frdaty+0.91 .90 .06];      % "Data" 
typdatpos=[frdatx+0.51 frdaty+0.85 .18 .06;...   % "Input" 
           frdatx+0.70 frdaty+0.85 .25 .06;... 
           frdatx+0.51 frdaty+0.77 .18 .06;...   % "Output" 
           frdatx+0.70 frdaty+0.77 .25 .06;...   
           frdatx+0.01 frdaty+0.68 .20 .06;...   % "Title" 
           frdatx+0.23 frdaty+0.68 .72 .06;... 
           frdatx+0.01 frdaty+0.59 .20 .06;...   % "Range" 
           frdatx+0.23 frdaty+0.59 .25 .06;... 
           frdatx+0.02 frdaty+0.01 .30 .06;...   % "IMPORT" 
           frdatx+0.35 frdaty+0.01 .30 .06;...   % "HELP" 
           frdatx+0.68 frdaty+0.01 .30 .06;...   % "CLOSE" 
           frdatx+0.01 frdaty+0.85 .20 .06;...   % "Refer.1" 
           frdatx+0.23 frdaty+0.85 .25 .06;... 
           frdatx+0.01 frdaty+0.77 .20 .06;...   % "Refer.2" 
           frdatx+0.23 frdaty+0.77 .25 .06;... 
           frdatx+0.01 frdaty+0.50 .20 .08;...   % "Sampling time" 
           frdatx+0.23 frdaty+0.50 .25 .06;... 
           frdatx+0.51 frdaty+0.50 .18 .08;...   % "Starting time" 
           frdatx+0.70 frdaty+0.50 .25 .06;... 
           frdatx+0.51 frdaty+0.59 .18 .06;...   % "File" 
           frdatx+0.70 frdaty+0.59 .25 .06]; 
frdat=zeros(23,1); 
frdat(1)=uicontrol(clfgdat,'style','frame','uni','nor',... 
   'pos',frdatpos(1,:),'Back',frmcol); 
frdat(2)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',frdatpos(2,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','DATA IMPORT'); 
frdat(14)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',typdatpos(12,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Refer.1'); 
frdat(15)=uicontrol(clfgdat,'style','edit','uni','nor',... 
   'pos',typdatpos(13,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,... 
   'String',' r1'); 
frdat(16)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',typdatpos(14,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Refer.2'); 
frdat(17)=uicontrol(clfgdat,'style','edit','uni','nor',... 
   'pos',typdatpos(15,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,... 
   'String',' r2'); 
frdat(3)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',typdatpos(1,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Input'); 
frdat(4)=uicontrol(clfgdat,'style','edit','uni','nor',... 
   'pos',typdatpos(2,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,... 
   'String',' u'); 
frdat(5)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',typdatpos(3,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Output'); 
frdat(6)=uicontrol(clfgdat,'style','edit','uni','nor',... 
   'pos',typdatpos(4,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,... 
   'String',' y'); 
frdat(7)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',typdatpos(5,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Title','Value',0); 
frdat(8)=uicontrol(clfgdat,'style','edit','uni','nor',... 
   'pos',typdatpos(6,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,... 
   'String',''); 
frdat(9)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',typdatpos(7,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Range','Value',0); 
frdat(10)=uicontrol(clfgdat,'style','edit','uni','nor',... 
   'pos',typdatpos(8,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,... 
   'String',''); 
frdat(22)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',typdatpos(20,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','File'); 
frdat(23)=uicontrol(clfgdat,'style','edit','uni','nor',... 
   'pos',typdatpos(21,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,... 
   'String',''); 
frdat(18)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',typdatpos(16,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Sampling time'); 
frdat(19)=uicontrol(clfgdat,'style','edit','uni','nor',... 
   'pos',typdatpos(17,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,... 
   'String',''); 
frdat(20)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',typdatpos(18,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Starting time'); 
frdat(21)=uicontrol(clfgdat,'style','edit','uni','nor',... 
   'pos',typdatpos(19,:),'horiz','left',... 
   'Back',edicol,'Fore',edtcol,... 
   'String',''); 
frdat(11)=uicontrol(clfgdat,'style','push','uni','nor',... 
   'pos',typdatpos(9,:),... 
   'Back',pshcol,'Fore',pstcol,... 
   'String','IMPORT','Value',0); 
frdat(12)=uicontrol(clfgdat,'style','push','uni','nor',... 
   'pos',typdatpos(10,:),... 
   'Back',pshcol,'Fore',pstcol,... 
   'String','HELP','Value',0); 
frdat(13)=uicontrol(clfgdat,'style','push','uni','nor',... 
   'pos',typdatpos(11,:),... 
   'Back',pshcol,'Fore',pstcol,... 
   'String','CLOSE','Value',0); 
 
% Show block diagram of closed-loop configuration 
frblkx=0.02;frblky=0.10; 
frblkpos=[frblkx frblky .96 .30; 
          frblkx+0.23 frblky+0.25 .50 .04;      % "Configuration" 
          frblkx+0.02 frblky .92 .26;           % Axes 
          frblkx+0.248 frblky+0.154 .10 .04;    % "G" 
          frblkx+0.116 frblky+0.154 .10 .04;    % "C" 
          frblkx+0.87 frblky+0.13 0.06 0.04;    % "y" 
          frblkx+0.50 frblky+0.13 0.06 0.04;    % "u" 
          frblkx+0.03 frblky+0.13 0.06 0.04;    % "r2" 
          frblkx+0.45 frblky+0.19 0.06 0.04;   % "r1" 
          frblkx+0.08 frblky+0.09 0.03 0.03;   % "+" 
          frblkx+0.43 frblky+0.09 0.03 0.03;   % "+" 
          frblkx+0.435 frblky+0.132 0.03 0.03];   % "+" 
frblk=zeros(8,1); 
frblk(1)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',frblkpos(2,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','Configuration'); 
axblk=zeros(1,1); 
axblk(1)=axes('uni','nor','pos',frblkpos(3,:),'Box','on','nextplot','add',... 
   'xlim',[0.05 0.95],'ylim',[0.25 1],'vis','off'); 
plot([0.6 0.75 0.75 0.6 0.6],[0.5 0.5 0.7 0.7 0.5],'color',txtcol); 
plot([0.25 0.4 0.4 0.25 0.25],[0.5 0.5 0.7 0.7 0.5],'color',txtcol); 
%plot([0.5 0.85 0.15],0.6*[1 1 1],'yo'); 
plot([0.5 0.85 0.15],0.6*[1 1 1],'o','color',txtcol); 
plot([0.05 0.13],[0.6 0.6],'color',txtcol); 
plot([0.17 0.25],[0.6 0.6],'color',txtcol); 
plot([0.4 0.48],[0.6 0.6],'color',txtcol); 
plot([0.52 0.6],[0.6 0.6],'color',txtcol); 
plot([0.75 0.83],[0.6 0.6],'color',txtcol); 
plot([0.87 0.95],[0.6 0.6],'color',txtcol); 
plot([0.15 0.85],[0.3 0.3],'color',txtcol); 
plot([0.15 0.15],[0.3 0.58],'color',txtcol); 
plot([0.85 0.85],[0.3 0.58],'color',txtcol); 
plot([0.5 0.5],[0.62 0.80],'color',txtcol); 
plot([0.16 0.18],[0.54 0.54],'color',txtcol); 
fill([0.25 0.4 0.4 0.25 0.25]',[0.5 0.5 0.7 0.7 0.5]',txbcol,... 
   'edgecolor',txtcol); 
fill([0.60 0.75 0.75 0.60 0.60]',[0.5 0.5 0.7 0.7 0.5]',txbcol,... 
   'edgecolor',txtcol); 
text(.325,0.6,'C','color',txtcol,'hor','cen','ver','mid',... 
   'fontweight','bold'); 
text(.675,0.6,'G','color',txtcol,'hor','cen','ver','mid',... 
   'fontweight','bold'); 
frblk(2)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',frblkpos(6,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','y'); 
frblk(3)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',frblkpos(7,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','u'); 
frblk(4)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',frblkpos(8,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','r2'); 
frblk(5)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',frblkpos(9,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','r1'); 
frblk(6)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',frblkpos(10,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','+'); 
 frblk(7)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',frblkpos(11,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','+'); 
 frblk(8)=uicontrol(clfgdat,'style','text','uni','nor',... 
   'pos',frblkpos(12,:),... 
   'Back',txbcol,'Fore',txtcol,... 
   'String','+'); 
    
% Draw the figure 
drawnow 
 
% Put handles in userdata of figure 
us=zeros(length(frdat),1); 
us(:,1)=frdat; 
set(clfgdat,'Userdata',us); 
 
 
% CALLBACKS 
 
% exit 
strclose=['close(gcf);h=findobj(''TAG'',''CLMAINPOPDATA'');'... 
   'set(h,''value'',1);clear h']; 
set(frdat(13),'callb',strclose); 
 
% import: data is directly transferred to object in main window 
set(frdat(11),'callb',... 
   ['eval(cldatimp(''start''),''clerrdia(''''ERROR IMPORTING DATA: cannot locate variable'''',1)'')']); 
 
% help-button 
set(frdat(12),'callb',['hthelp(''cldatimp.htm'')']); 
 
clear c9  frdat pshcol typdatpos  clfgdat frdatpos 
clear axblk edicol  frdatx us axscol frblk frdaty 
clear c10  frblkpos frmcol radcol c7 frblkx h  
clear strclose c8 frblky  modcol txtcol posfgm edtcol 
clear chbcol chtcol pstcol putcol txbcol z CLIDscrz	pubcol