#include #include "globdef.h" #include "uidef.h" #include "fft1def.h" #include "fft2def.h" #include "fft3def.h" #include "sigdef.h" #include "screendef.h" #include "seldef.h" #include "thrdef.h" extern int wg_old_y1; extern int wg_old_y2; extern int wg_old_x1; extern int wg_old_x2; void txtest_init(void) { int i, j, k; float t1; int pnts_per_seg; txtest_decayfac1=fft1_blocktime; txtest_decayfac2=1-txtest_decayfac1; txtest_no_of_segs=(fft1_last_point-fft1_first_point)*fft1_hz_per_point/600; if(txtest_no_of_segs >= screen_width) { lirerr(1159); return; } for(i=0; i fft1_last_point) txtest_no_of_segs--; if(txtest_no_of_segs < 0) { txtest_no_of_segs=0; } else { if( txtest_first_xpix+(txtest_no_of_segs-1)*txtest_pixinc >= wg.xright) { txtest_no_of_segs=0; } } txtest_yfac=wg_yfac_power*wg.spek_avgnum; if(genparm[FIRST_FFT_SINPOW] != 0) { t1=0; for(i=0; i2*mix1_size) { mix1_flag=1; z=&txtest_power[txtest_spek_p0]; old_fft1_nx=fft1_nx; old_fft1_px=fft1_px; mix1_point[0]=txtest_first_point; for(i=0; i= mix1_size/5) { timf3_float[2*k]*=mix1_win[k]; timf3_float[2*k+1]*=mix1_win[k]; timf3_float[2*j]*=mix1_win[k]; timf3_float[2*j+1]*=mix1_win[k]; j++; k--; } } else { if(mix1_interleave_points == 0) { ia=0; ib=mix1_size; } else { ia=0; ib=mix1_new_points+1; } } pwr2=0; pwr1=0; for(j=ia; j=wg.spek_avgnum) { txtest_spek_no=0; txtest_spek_p0=0; } make_txtest_wide_spectra(); sc[SC_SHOW_FFT1]++; lir_sem_post(SEM_SCREEN); } // Here we do the mouse actions that affect the wide graph. // Currently only the waterfall memory area may become re-allocated if(mouse_task!=-1) { k=mouse_task&GRAPH_MASK; if( k > MAX_WIDEBAND_GRAPHS) { set_button_states(); if(mouse_active_flag == 0) { switch (k) { case FREQ_GRAPH: mouse_on_freq_graph(); break; } if(mouse_active_flag == 0)lirerr(18877); } if(numinput_flag==0)current_mouse_activity(); if( (numinput_flag&DATA_READY_PARM) != 0) { par_from_keyboard_routine(); par_from_keyboard_routine=NULL; mouse_active_flag=0; numinput_flag=0; leftpressed=BUTTON_IDLE; } if(mouse_active_flag == 0) { mouse_task=-1; } } } } if(thread_command_flag[THREAD_TXTEST]==THRFLAG_IDLE) { // The wideband dsp thread is running and it puts out // the waterfall graph. Stop it now. thread_command_flag[THREAD_WIDEBAND_DSP]=THRFLAG_IDLE; while(thread_status_flag[THREAD_WIDEBAND_DSP]!=THRFLAG_IDLE) { lir_sleep(25000); } thread_status_flag[THREAD_TXTEST]=THRFLAG_IDLE; while(thread_command_flag[THREAD_TXTEST] == THRFLAG_IDLE) { lir_sleep(10000); fft1_px = fft1_pb; } thread_command_flag[THREAD_WIDEBAND_DSP]=THRFLAG_ACTIVE; lir_sleep(1000); wg_old_x1=wg.xleft; wg_old_x2=wg.xright; wg_old_y1=wg.ytop; wg_old_y2=wg.ybottom; make_wide_graph(TRUE); if(kill_all_flag) goto txtest_exit; goto restart; } txtest_exit:; thread_status_flag[THREAD_TXTEST]=THRFLAG_RETURNED; while(thread_command_flag[THREAD_TXTEST] != THRFLAG_NOT_ACTIVE) { lir_sleep(1000); } }