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_pir1.m
function [MOG,DEF,P_PIR,fe]=def_param_pir1(fei)


fe=fei;
MOG=zeros(4,17);
DEF=zeros(10,1);
P_PIR=[1,1,0.25,5,1e-3,250,zeros(1,5000)];
P_PIR(7)=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,'P.I.R.','color','b',...
    'fontunits','normalized','fontsize',0.03,...
    'fontweight','bold',...
    'horizontalalignment','left',...
    'verticalalignment','middle');
text(0.02,0.75,'Valeurs','color','b',...
    'fontunits','normalized','fontsize',0.03,...
    'fontweight','bold',...
    'horizontalalignment','left',...
    'verticalalignment','middle');

slk='K';           
MOG(2,1)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.02 0.6 0.1 0.05],...
    'backgroundcolor','y',...
	 'foregroundcolor','b','string',slk,...
     'fontunits','normalized','fontsize',0.5,'fontweight','bold');
sk='1';           
MOG(1,1)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.14 0.6 0.1 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b',...
    'string',sk,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold',...
	'callback','sk=get(MOG(1,1),''string'');K=str2num(sk);P_PIR(1)=K;');
   
slti='Ti (s)';           
MOG(2,2)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.02 0.5 0.1 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b','string',slti,...
    'fontunits','normalized','fontsize',0.5,'fontweight','bold');
sti='1';           
MOG(1,3)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.14 0.5 0.1 0.05],...
    'backgroundcolor','y',...
	 'foregroundcolor','b',...
    'string',sti,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
	'callback','sti=get(MOG(1,3),''string'');Ti=str2num(sti);P_PIR(2)=Ti;');

sltd='retard T (s)';           
MOG(2,3)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.02 0.4 0.1 0.05],...
    'backgroundcolor','y',...
	 'foregroundcolor','b','string',sltd,...
     'fontunits','normalized','fontsize',0.5,'fontweight','bold');
std='0.25';    
text(0.155,0.375,'(T limit  5000*T_E)','color','b',...
    'fontunits','normalized','fontsize',0.03,...
    'fontweight','bold','horizontalalignment','left',...
    'verticalalignment','middle','interpreter','Tex');
MOG(1,5)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.14 0.4 0.1 0.05],...
    'backgroundcolor','y',...
	 'foregroundcolor','b',...
	'string',std,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold',...
	'callback','std=get(MOG(1,5),''string'');Retard=str2num(std);P_PIR(3)=Retard;');
slkd='alpha';           
MOG(2,4)=uicontrol(gcf,'style','text',...
    'unit','normalized',...
	'position',[0.02 0.3 0.1 0.05],...
    'backgroundcolor','y',...
	 'foregroundcolor','b','string',slkd,...
     'fontunits','normalized','fontsize',0.5,'fontweight','bold');
skd='5';           
MOG(1,7)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.14 0.3 0.1 0.05],...
    'backgroundcolor','y',...
	 'foregroundcolor','b',...
	'string',skd,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold',...
	'callback','skd=get(MOG(1,7),''string'');alpha=str2num(skd);P_PIR(4)=alpha;');

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;
sk=get(MOG(1,1),'string');
P_PIR(1)=str2num(sk);
sti=get(MOG(1,3),'string');
P_PIR(2)=str2num(sti);
std=get(MOG(1,5),'string');
P_PIR(3)=str2num(std);
skd=get(MOG(1,7),'string');
P_PIR(4)=str2num(skd);
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_PIR]=test_param_pir1(MOG,DEF,P_PIR);');

%
%
%*************** 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_pir1(DEF)');   
    

Contact us