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

affich_enregistrement_sa_num.m
set_param(gcs,'SimulationCommand','WriteDataLogs');
tinit=max(y2.time);
DEF(10)=tinit;
bloc_pat=[get_param(gcs,'name'),'/patience'];
k=find((y2.signals.values==1)&(y2.time>tinit))
while(length(k)<DEF(3)-1)&& strcmp(get_param(bloc_pat,'foregroundcolor'),'red')
pause(DEF(2)/10)
set_param(gcs,'SimulationCommand','WriteDataLogs');
k=find((y2.signals.values==1)&(y2.time>tinit));
end;
if strcmp(get_param(bloc_pat,'foregroundcolor'),'red')
    pause(DEF(1))
    set_param(gcs,'SimulationCommand','WriteDataLogs') 
    x_num=v.signals.values;
    valide=y2.signals.values;
    x_anal=vanal.signals.values;
    tnum=y2.time;
    tanal=vanal.time;
    k=find((valide==1)&(tnum>tinit));
    k=[min(k)-1;k(1:end-1)];
    tnum=tnum(k);
    tmin=min(tnum);
    tmax=max(tnum);
    kanal=find((tanal>=tmin)&(tanal<=tmax));
    figure(2)
    hold on
    coul='krgb';
    c=DEF(7);
    test1=(c==1)|(c==3)|(c==5)|(c==7)|(c==9)|(c==11)|(c==13)|(c==15);
    test2=(c==2)|(c==3)|(c==6)|(c==7)|(c==10)|(c==11)|(c==14)|(c==15);
    test3=(c==4)|(c==5)|(c==6)|(c==7)|(c==12)|(c==13)|(c==14)|(c==15);
    test4=(c==8)|(c==9)|(c==10)|(c==11)|(c==12)|(c==13)|(c==14)|(c==15);
    M=[];
% stem pour signaux numriques
% plot pour signaux analogiques
    if test1
        stem(tnum-tmin,x_num(k,1),'linestyle','none',...
            'markerfacecolor',coul(1),'markeredgecolor',coul(1))
        plot(tanal(kanal)-tmin,x_anal(kanal,1),coul(1))
        M=[M;'V_E';'V_E'];
    end;
    if test2
        stem(tnum-tmin,x_num(k,2),'linestyle','none',...
            'markerfacecolor',coul(2),'markeredgecolor',coul(2))
        plot(tanal(kanal)-tmin,x_anal(kanal,2),coul(2))
        M=[M;'V_S';'V_S'];
    end;
% stairs pour signaux chantillonns bloqus
    if test3
        stairs(tnum-tmin,x_num(k,3),coul(3))
        M=[M;'E  '];
            
    end;
    if test4
        stairs(tnum-tmin,x_num(k,4),coul(4))
       M=[M;'E_C'];
    end;
    legend(M)
    xlabel(['t  (s)'])    
    ylabel('(V)')  
end;
DEF(10)=max(y2.time);
NOM=[get_param(gcs,'name'),'/Correcteur'];
BLOC=[NOM,'/Bloc_synchro/Constant6'];
set_param(BLOC,'value','1')
pause(DEF(1))
set_param(BLOC,'value','0')
pause(DEF(1))

Contact us