Code covered by the BSD License  

Highlights from
Logiciels temps réel

Logiciels temps réel

by

 

Real-time software concerning the domains of the signal processing, feedback and regulation

def_param_RdeP.m
function [MOG,DEF,P_RdeP,fe]=def_param_RdeP(fei)


fe=fei;
MOG=zeros(4,17);
DEF=zeros(10,1);
NUM=[1 1];
DEN=[0.1 1];
H=tf(NUM,DEN);
Hd=c2d(H,1/fe,'tustin');
[NUMZ,DENZ]=tfdata(Hd,'v');
P_RdeP=[NUM;DEN;NUMZ;DENZ];
figure(1)
e=ecran;
set(gcf,'position',e)
set(gcf,'unit','normalized','color','w')
grid off
set(gca,'xcolor','w','ycolor','w')
pause(0.1)
text(0.05,0.85,'R(p)','color','b',...
    'fontunits','normalized','fontsize',0.03,...
    'fontweight','bold',...
    'horizontalalignment','left',...
    'verticalalignment','middle');

MOG(2,1)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.02 0.8 0.5 0.05],...
    'backgroundcolor','w',...
	'foregroundcolor','b',...
    'string','Dfinition des coefficients du numrateur',...
    'fontunits','normalized','fontsize',0.5,'fontweight','bold');
 MOG(2,2)=uicontrol(gcf,'style','text',...
     'unit','normalized',...
	'position',[0.02 0.75 0.5 0.05],...
    'backgroundcolor','w',...
	'foregroundcolor','b','string',...
     'Exemple : NUM=[1,1]',...
     'fontunits','normalized','fontsize',0.5,'fontweight','bold'); 
sn='NUM=[1,1]';    
MOG(1,1)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.02 0.7 0.5 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b',...
    'string',sn,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold',...
	'callback','sn=get(MOG(1,1),''string'');');
MOG(2,3)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.02 0.65 0.5 0.05],...
    'backgroundcolor','w',...
	 'foregroundcolor','b',...
     'string','Dfinition des coefficients du dnominateur',...
     'fontunits','normalized','fontsize',0.5,'fontweight','bold');
 MOG(2,4)=uicontrol(gcf,'style','text',...
     'unit','normalized',...
	'position',[0.02 0.6 0.5 0.05],...
    'backgroundcolor','w',...
	 'foregroundcolor','b','string',...
      'Exemple : DEN=[0.1,1]',...
      'fontunits','normalized','fontsize',0.5,'fontweight','bold'); 
sd='DEN=[0.1,1]'; 
MOG(1,2)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.02 0.55 0.5 0.05],...
    'backgroundcolor','y',...
	 'foregroundcolor','b',...
	'string',sd,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold');   
sf='Fe (Hz)';           
MOG(2,5)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.02 0.2 0.1 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b','string',sf,...
    'fontunits','normalized','fontsize',0.5,'fontweight','bold');
sfe=num2str(fe);           
MOG(1,9)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
    'position',[0.14 0.2 0.21 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b',...
	'string',sfe,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold',...
	'callback','sfe=get(MOG(1,9),''string'');fe=str2num(sfe);DEF(1)=1/fe;');
text(0.6,0.85,'ENREGISTREMENT',...
    'color','b','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold',...
    'horizontalalignment','left',...
    'verticalalignment','middle','interpreter','Tex')
sve='Ve';
MOG(2,6)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.6 0.65 0.05 0.05],...
	'foregroundcolor','b','string',sve,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold');
MOG(1,10)=uicontrol(gcf,'style','checkbox',...
    'unit','normalized',...
	'position',[0.66 0.65 0.05 0.05],...
    'Max',1,'Min',0,...
    'callback','pve=get(MOG(1,10),''Value'');');    
svs='Vs';
MOG(2,7)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.8 0.65 0.05 0.05],...
	'foregroundcolor','b','string',svs,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold');
MOG(1,11)=uicontrol(gcf,'style','checkbox',...
    'unit','normalized',...
	'position',[0.86 0.65 0.05 0.05],...
    'Max',1,'Min',0,...
    'callback','pvs=get(MOG(1,11),''Value'');');  
se='E';
MOG(2,8)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.6 0.55 0.05 0.05],...
	 'foregroundcolor','b','string',se,'fontunits','normalized','fontsize',0.5,...
     'fontweight','bold');
MOG(1,12)=uicontrol(gcf,'style','checkbox',...
    'unit','normalized',...
    'position',[0.66 0.55 0.05 0.05],...
    'Max',1,'Min',0,...
    'callback','pe=get(MOG(1,12),''Value'');');    
sec='Ec';
MOG(2,9)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.8 0.55 0.05 0.05],...
	'foregroundcolor','b','string',sec,'fontunits','normalized','fontsize',0.5,...
     'fontweight','bold');
MOG(1,13)=uicontrol(gcf,'style','checkbox',...
    'unit','normalized',...
	'position',[0.86 0.55 0.05 0.05],...
    'Max',1,'Min',0,...
    'callback','pec=get(MOG(1,13),''Value'');');   
sd='Dure (s)';           
MOG(2,10)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.6 0.45 0.2 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b','string',sd,...
    'fontunits','normalized','fontsize',0.5,'fontweight','bold');
text(0.6,0.4,'100 000 points maximum',...
    'fontunits','normalized','fontsize',0.027,'fontweight','bold','color','r')      
sduree='1';           
MOG(1,14)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.85 0.45 0.1 0.05],...
    'backgroundcolor','y',...
	 'foregroundcolor','b',...
	'string',sduree,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
	'callback','sduree=get(MOG(1,14),''string'');D=str2num(sduree);DEF(2)=D;');
text(0.6,0.35,'SYNCHRONISATION','color','b','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold','horizontalalignment','left',...
    'verticalalignment','middle')
MOG(1,15)=uicontrol(gcf,'style','checkbox',...
    'unit','normalized',...
	'position',[0.86 0.35 0.05 0.05],...
    'Max',1,'Min',0,...
     'callback','synchro=get(MOG(1,15),''Value'');');   
synchro=get(MOG(1,15),'Value');
DEF(4)=synchro;
sfe=get(MOG(1,9),'string');
fe=str2num(sfe);
te=1/fe;
DEF(1)=te;
pve=get(MOG(1,10),'Value');
pvs=get(MOG(1,11),'Value');
pe=get(MOG(1,12),'Value');
pec=get(MOG(1,13),'Value');
courbes=pve+2*pvs+2^2*pe+2^3*pec;
DEF(7)=courbes;
sd=get(MOG(1,14),'string');
duree=str2num(sd);
N=round(duree/te);
DEF(3)=N;
    
%**************** Bouton "OK" de validation
boutonok=uicontrol(gcf,'style','push',...
    'unit','normalized',...
	'position',[0.8 0.05 0.1 0.05],...
	'string','OK','foregroundcolor','r',...
    'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
    'callback','[MOG,DEF,P_RdeP]=test_param_RdeP(MOG,DEF,P_RdeP);');
%*************** bouton "FIN" : sortie du logiciel    
boutonfin=uicontrol(gcf,'style','push',...
    'unit','normalized',...
	'position',[0.1 0.05 0.1 0.05],...
	 'string','FIN','foregroundcolor','r',...
     'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
     'callback','fin;liste_logiciels');
 boutonschema=uicontrol(gcf,'style','push',...
     'unit','normalized',...
	'position',[0.5 0.05 0.1 0.05],...
	'string','MONTAGE','foregroundcolor','r',...
    'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
    'callback','schema_anal_RdeP(DEF)');   
    

Contact us