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

test_parametres.m
function y=test_parametres(x,FA,FP,Amin,Amax)

ecran=get(0,'screensize');
switch x
case 'PL'
    y=(FA>FP)&(Amax>Amin);
    if ~y
        [son,fs,b]=wavread([pwd,'\signal_erreur']);
        sound(son,fs,b)
        figure(2)
        set(gcf,'position',[ecran(3)/2,ecran(4)/2,ecran(3)/2,ecran(4)/2],'color','w','unit','normalized')
        set(gca,'xcolor','w','ycolor','w')
        text(0.5,0.9,'ERREUR !','color','r','fontunits','normalized','fontsize',0.06,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','middle')
        text(0.1,0.8,'Il faut que :','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.7,'F_A > F_P','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.6,'et','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.5,'A_{MAX} > A_{min}','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
            %'horizontalalignment','center','verticalalignment','left')
        bouton4=uicontrol(gcf,'style','push','unit','normalized',...
		'position',[0.75 0.3 0.05 0.05],...
	          'string','OK','callback','delete(gcf)');
      end;
  case 'PH'
      y=(FA<FP)&(Amax>Amin);
    if ~y
        [son,fs,b]=wavread([pwd,'\signal_erreur']);
        sound(son,fs,b)
        figure(2)
        set(gcf,'position',[ecran(3)/2,ecran(4)/2,ecran(3)/2,ecran(4)/2],'color','w','unit','normalized')
        set(gca,'xcolor','w','ycolor','w')
        text(0.5,0.9,'ERREUR !','color','r','fontunits','normalized','fontsize',0.06,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','middle')
        text(0.1,0.8,'Il faut que :','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.7,'F_A < F_P','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.6,'et','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.5,'A_{MAX} > A_{min}','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
            %'horizontalalignment','center','verticalalignment','left')
        bouton4=uicontrol(gcf,'style','push','unit','normalized',...
		'position',[0.75 0.3 0.05 0.05],...
	          'string','OK','callback','delete(gcf)');
      end;
  case 'PB'
      y=(FA(1)<FP(1))&(FP(1)<FP(2))&(FP(2)<FA(2))&(Amax>Amin);
    if ~y
        [son,fs,b]=wavread([pwd,'\signal_erreur']);
        sound(son,fs,b)
        figure(2)
        set(gcf,'position',[ecran(3)/2,ecran(4)/2,ecran(3)/2,ecran(4)/2],'color','w','unit','normalized')
        set(gca,'xcolor','w','ycolor','w')
        text(0.5,0.9,'ERREUR !','color','r','fontunits','normalized','fontsize',0.06,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','middle')
        text(0.1,0.8,'Il faut que :','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.7,'F_A ^-< F_P ^-<F_P ^+<F_A^ +','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.6,'et','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.5,'A_{MAX} > A_{min}','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
            %'horizontalalignment','center','verticalalignment','left')
        bouton4=uicontrol(gcf,'style','push','unit','normalized',...
		'position',[0.75 0.3 0.05 0.05],...
	          'string','OK','callback','delete(gcf)');
      else
          foa=sqrt(FA(1)*FA(2));
          fop=sqrt(FP(1)*FP(2));
          y=(abs(foa-fop)/fop<=1e-2);
          if ~y
            [son,fs,b]=wavread([pwd,'\signal_erreur']);
            sound(son,fs,b)
            figure(2)
            set(gcf,'position',[ecran(3)/2,ecran(4)/2,ecran(3)/2,ecran(4)/2],'color','w','unit','normalized')
            set(gca,'xcolor','w','ycolor','w')
            text(0.5,0.9,'ATTENTION !','color','r','fontunits','normalized','fontsize',0.06,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','middle')
            text(0.1,0.8,'Filtre non symtrique :','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
            text(0.2,0.7,'Ecart entre \surd F_A ^-*F_A ^+  et \surd F_P ^-*F_P ^+','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
            text(0.2,0.6,'suprieur  1 %','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')        
            bouton5=uicontrol(gcf,'style','push','unit','normalized',...
		    'position',[0.75 0.3 0.05 0.05],...
	          'string','OK','callback','delete(gcf)');
         end;
      end;
  case 'RB'
        y=(FP(1)<FA(1))&(FA(1)<FA(2))&(FA(2)<FP(2))&(Amax>Amin);
    if ~y
        [son,fs,b]=wavread([pwd,'\signal_erreur']);
        sound(son,fs,b)
        figure(2)
        set(gcf,'position',[ecran(3)/2,ecran(4)/2,ecran(3)/2,ecran(4)/2],'color','w','unit','normalized')
        set(gca,'xcolor','w','ycolor','w')
        text(0.5,0.9,'ERREUR !','color','r','fontunits','normalized','fontsize',0.06,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','middle')
        text(0.1,0.8,'Il faut que :','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.7,'F_A ^-< F_P ^-<F_P ^+<F_A^ +','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.6,'et','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
        text(0.2,0.5,'A_{MAX} > A_{min}','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
            %'horizontalalignment','center','verticalalignment','left')
        bouton4=uicontrol(gcf,'style','push','unit','normalized',...
		'position',[0.75 0.3 0.05 0.05],...
	          'string','OK','callback','delete(gcf)');
      else
          foa=sqrt(FA(1)*FA(2));
          fop=sqrt(FP(1)*FP(2));
          y=(abs(foa-fop)/fop<=1e-2);
          if ~y
            [son,fs,b]=wavread([pwd,'\signal_erreur']);
            sound(son,fs,b)
            figure(2)
            set(gcf,'position',[ecran(3)/2,ecran(4)/2,ecran(3)/2,ecran(4)/2],'color','w','unit','normalized')
            set(gca,'xcolor','w','ycolor','w')
            text(0.5,0.9,'ATTENTION !','color','r','fontunits','normalized','fontsize',0.06,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','middle')
            text(0.1,0.8,'Filtre non symtrique :','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
            text(0.2,0.7,'Ecart entre \surd F_A ^-*F_A ^+  et \surd F_P ^-*F_P ^+','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')
            text(0.2,0.6,'suprieur  1 %','color','k','fontunits','normalized','fontsize',0.05,'fontweight','bold')
           % 'horizontalalignment','center','verticalalignment','left')        
            bouton5=uicontrol(gcf,'style','push','unit','normalized',...
		    'position',[0.75 0.3 0.05 0.05],...
	          'string','OK','callback','delete(gcf)');
         end;
      end;
  end;      

Contact us