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_num.m
function [MOG,DEF,NC,DC,fe]=def_param_num(fei)


fe=fei;
MOG=zeros(4,17);
DEF=zeros(10,1);
NC='[1]';
DC='[1]';
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)
s='Paramtres';
text(0.5,0.95,s,'color','r','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold',...
    'horizontalalignment','center',...
    'verticalalignment','middle');
text(0.05,0.85,'Correcteur','color','b','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold',...
    'horizontalalignment','left',...
    'verticalalignment','middle');
snum='Numrateur : exemple [1 1]';           
MOG(2,1)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.02 0.7 0.35 0.05],...
    'backgroundcolor','y',...
	 'foregroundcolor','b',...
     'string',snum,'fontunits','normalized','fontsize',0.5,...
     'fontweight','bold');
MOG(1,1)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.02 0.6 0.35 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b',...
    'string',NC,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
	'callback','NC=get(MOG(1,1),''string'');');   
sden='Dnominateur : exemple [1 -1]';           
MOG(2,2)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.02 0.5 0.35 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b',...
    'string',sden,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold');
MOG(1,3)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.02 0.4 0.35 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b',...
	'string',DC,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold',...
	'callback','DC=get(MOG(1,3),''string'');');
sf='Fe (Hz)';           
MOG(2,5)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.02 0.3 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.3 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;DEF(8)=DEF(1)/100;');

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');
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;
snc=get(MOG(1,1),'string');
NC=str2num(snc);
sdc=get(MOG(1,3),'string');
DC=str2num(sdc);
sfe=get(MOG(1,9),'string');
fe=str2num(sfe);
te=1/fe;
DEF(1)=te;
DEF(8)=te/100;
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+1;
    
%**************** 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,NC,DC]=test_param_num(MOG,DEF,NC,DC);');
%*************** 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(DEF)');
    

Contact us