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


fe=fei;
MOG=zeros(4,17);
DEF=zeros(10,1);
P_PID=[1,0.1;1,0.1;0.25,0.05;10,0.5;0,0;0,0;0,0];
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.D.','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');
text(0.17,0.75,'Pas','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_PID(1,1)=K;');
sdk='0.1';           
MOG(1,2)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.25 0.6 0.1 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b',...
	'string',sdk,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold',...
	'callback','sdk=get(MOG(1,2),''string'');dK=str2num(sdk);P_PID(1,2)=dK;');    
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_PID(2,1)=Ti;');
sdti='0.1';           
MOG(1,4)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.25 0.5 0.1 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b',...
	'string',sdti,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
	'callback','sdti=get(MOG(1,4),''string'');dTi=str2num(sdti);P_PID(2,2)=dTi;');
sltd='Td (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';           
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'');Td=str2num(std);P_PID(3,1)=Td;');
sdtd='0.05';           
MOG(1,6)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.25 0.4 0.1 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b',...
	'string',sdtd,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold',...
	'callback','sdtd=get(MOG(1,6),''string'');dTd=str2num(sdtd);P_PID(3,2)=dTd;');
slkd='Kd';           
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='10';           
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'');Kd=str2num(skd);P_PID(4,1)=Kd;');
sdkd='0.5';           
MOG(1,8)=uicontrol(gcf,'style','edit',...
    'unit','normalized',...
	'position',[0.25 0.3 0.1 0.05],...
    'backgroundcolor','y',...
	'foregroundcolor','b',...
	'string',sdkd,'fontunits','normalized','fontsize',0.5,...
    'fontweight','bold',...
	'callback','sdkd=get(MOG(1,8),''string'');dKd=str2num(sdkd);P_PID(4,2)=dKd;');
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'');DEF(4)=synchro;');   
synchro=get(MOG(1,15),'Value');
DEF(4)=synchro;
sk=get(MOG(1,1),'string');
P_PID(1,1)=str2num(sk);
sdk=get(MOG(1,2),'string');
P_PID(1,2)=str2num(sdk);
sti=get(MOG(1,3),'string');
P_PID(2,1)=str2num(sti);
sdti=get(MOG(1,4),'string');
P_PID(2,2)=str2num(sdti);
std=get(MOG(1,5),'string');
P_PID(3,1)=str2num(std);
sdtd=get(MOG(1,6),'string');
P_PID(3,2)=str2num(sdtd);
skd=get(MOG(1,7),'string');
P_PID(4,1)=str2num(skd);
sdkd=get(MOG(1,8),'string');
P_PID(4,2)=str2num(sdtd);
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_PID]=test_param(MOG,DEF,P_PID);');
%*************** 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(DEF)');   
    

Contact us