#include "diabolo.h" #include "bolo.h" #include "acqui.h" #include "carte_acqui.h" #include "trace_tout.h" #include "synchro.h" //---------------------------------- fenetre : lit_fifo ----------------------------------- void montracen_tout(int fen,int n,double x,util_trace_tout *SS); void exec_trace_tout(int fen,int item,double valeur,...) { int i,j; double x,c1,c2; static int scan_tt; util_trace_tout *SS; SS=infos(fen)->util; switch(item) { case fermeture : for(j=0;j<8;j++) if(gg->trace_tout[j]==fen) {gg->trace_tout[j]=0;} free(SS); break; case ouverture : for(j=0;j<8;j++) if(gg->trace_tout[j]==0) {gg->trace_tout[j]=fen;break;} SS=malloc(sizeof(util_trace_tout)); infos(fen)->util=SS; graph->ymin=-120; graph->ymax=120; graph->ypas=20; graph->xmax=500; graph->xpas=50; graph->taille_graduations=8; for(j=0;jf1[j]=0; for(j=0;jf2[j]=0; for(j=0;jy[j]=0; case t_moyenne : case t_moyenne+1000 : case t_fmini : case t_fmini+1000 : case t_fmaxi : case t_fmaxi+1000 : SS->moyenne=litD(fen,t_moyenne,0L);if(SS->moyenne<1) SS->moyenne=1; SS->ipas=0; SS->fmini=litD(fen,t_fmini,0L); SS->fmaxi=litD(fen,t_fmaxi,0L); for(j=0;jf1[j]=0; c1=2*3.14*SS->fmini*gg->periode_echantillonage; c1=c1/(1+c1); c2=2*3.14*SS->fmaxi*gg->periode_echantillonage; c2=c2/(1+c2); printf("c1=%g c2=%g \n",c1,c2); case t_bolo_couleur : case t_bolo_couleur+1 : case t_bolo_couleur+2 : case t_bolo_couleur+3 : case t_bolo_couleur+4 : case t_bolo_couleur+5 : case t_bolo_couleur+6 : case t_bolo_couleur+7 : case t_bolo_couleur+8 : case t_bolo_couleur+9 : for(i=0;ibolo_couleur[i]=litD(fen,t_bolo_couleur+i,0L)-1; if( (SS->bolo_couleur[i]<1) ou (SS->bolo_couleur[i]>nb_max_trace) ) SS->bolo_couleur[i]=0; printf(" i=%d bolo=%d ",i,SS->bolo_couleur[i]); } printf("\n"); break; break; case t_raz : gg->temps_origine=gg->periode_echantillonage*(double)gg->temps_cntl; //break; case t_efface : efface(fen); break; case tache_de_fond : selectgra(fen); c1=2*3.14*SS->fmini*gg->periode_echantillonage; if(c1>0) c1=c1/(1+c1); c2=2*3.14*SS->fmaxi*gg->periode_echantillonage; if(c2>0) c2=c2/(1+c2); for(j=0;jf1[j]= (1-c1) * SS->f1[j] + c1 * xbol(j); SS->f2[j]= (1-c2) * SS->f2[j] + c2 * xbol(j); SS->y[j]+=SS->f2[j]-SS->f1[j]; } SS->ipas--; if(SS->ipas<=0) { SS->ipas=SS->moyenne; if(SS->moyenne) for(j=0;jy[j]=SS->y[j]/(double)SS->moyenne; // printf("trace_tout un point \n"); x=gg->periode_echantillonage*(double)gg->temps_cntl-gg->temps_origine; if(scan_tt != ( (gg->don.sync[sync_subscan]!=0) et (gg->don.sync[sync_scan]!=0) ) ) { if(scan_tt) rectangle(fen,x,graph->ymin,x,graph->ymax,rouge); // trace le segment x1,y1 - x2,y2 else rectangle(fen,x,graph->ymin,x,graph->ymax,bleu); // trace le segment x1,y1 - x2,y2 scan_tt = ( (gg->don.sync[sync_subscan]!=0) et (gg->don.sync[sync_scan]!=0) ) ; } montracen_tout(fen,nb_max_trace,x,SS); if(!(graph->scroll_courbe) && litD(fen,t_retour,0L) && ( (xxmin) ou (x>graph->xmax) )) { graph->xmax-=graph->xmin;graph->xmin=0; gg->temps_origine=gg->periode_echantillonage*(double)gg->temps_cntl; x=0; } for(j=0;jy[j]=0; } default : break; } } void montracen_tout(int fen,int n,double x,util_trace_tout *SS) { int i; double yy[max_couleur]; for(i=0;ibolo_couleur[i]>=1) && (SS->bolo_couleur[i]y[SS->bolo_couleur[i]-1]; else yy[i]=0; } tracen(fen,max_couleur,x,yy); // printf("0=%g 1=%g 2=%g \n",yy[0],yy[1],yy[2]); }