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

acquisition_signal.m
function [MOG,DEF,x,X,K]=acquisition_signal(MOGi,DEFi)

% 
%   DEF : matrice 8 lignes 1 colonne contenant les paramtres
%         caractristiques du signal (ils ne sont pas tous dfinis)
%           DEF(1) = 
%           DEF(2) = 
%           DEF(3) = level (niveau de synchronisation)
%           DEF(4) = sens (+1 = croissant ; -1 = dcroissant)
%           DEF(5) = 
%           DEF(6) = synchro
%           DEF(7) = N
%           DEF(8) = nb_voies; 
%           DEF(9)=m
%           DEF(10)=te
%           DEF(11)=etude

synchro=DEFi(6);
nb_voies=DEFi(8);
m=DEFi(9);
te=DEFi(10);
etude=DEFi(11);
MOG=MOGi;
x=zeros(2^m,nb_voies);
X=x;
K=0:1:2^m-1;
boutonok=0;
DEF=[0;0;0;1;0;synchro;2^m;nb_voies;m;te;etude];
level=DEF(3);
levels=num2str(level);
sens=DEF(4);
senss=num2str(sens);
switch synchro
        case 2
            MOG(2,1)=uicontrol(gcf,'style','text','unit','normalized',...
                'position',[0.6 0.8 0.3 0.05],'backgroundcolor','w',...
	           'foregroundcolor','b','string','Niveau (V)',...
               'fontunits','normalized','fontsize',0.6,'fontweight','bold');
            MOG(1,1)=uicontrol(gcf,'style','edit','unit','normalized',...
                'position',[0.6 0.75 0.3 0.05],'backgroundcolor','y',...
                'foregroundcolor','b','max',1,...
                'string',levels,...
               'fontunits','normalized','fontsize',0.6,'fontweight','bold',...
                'callback','levels=get(MOG(1,1),''string'');level=str2num(levels);DEF(3)=level;');
            MOG(2,2)=uicontrol(gcf,'style','text','unit','normalized',...
                'position',[0.6 0.7 0.3 0.05],'backgroundcolor','w',...
	           'foregroundcolor','b','string','Sens (1 = / ; -1 = \ )',...
               'fontunits','normalized','fontsize',0.6,'fontweight','bold');
            MOG(1,2)=uicontrol(gcf,'style','edit','unit','normalized',...
                'position',[0.6 0.65 0.3 0.05],'backgroundcolor','y',...
                'foregroundcolor','b','max',1,...
                'string',senss,...
               'fontunits','normalized','fontsize',0.6,'fontweight','bold',...
                'callback','senss=get(MOG(1,2),''string'');sens=str2num(senss);DEF(4)=sens;');
        case 3
            sens=0;
            DEF(4)=0;
end;
    boutonok=uicontrol(gcf,'style','push','unit','normalized',...
		'position',[0.6 0.1 0.1 0.1],...
	    'string','OK','foregroundcolor','r',...
               'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
        'callback','delete(gcf);[x,DEF]=signal_acquis(DEF);');
    

Contact us