예제 #1
0
파일: grabspot.c 프로젝트: airween/tlf
double grab_next(void) {
    extern int trx_control;
    extern float freq;

    static int dir = 1;		/* start scanning up */

    spot *data;

    if (!trx_control) {
	return 0;   // no trx control
    }

    data = bandmap_next(dir, (unsigned int)(freq * 1000));

    if (data == NULL) {		/* nothing in that direction */
				/* try other one */
	dir = 1 - dir;
	data = bandmap_next(dir, (unsigned int)(freq * 1000));
    }

    if (data == NULL) {
	return 0;
    }

    return execute_grab(data);
}
예제 #2
0
파일: grabspot.c 프로젝트: wildj79/tlf
void grab_next(void)
{
    extern char hiscall[];
    extern char mode[];
    extern int cqmode;
    extern int trx_control;

    extern float mem;
    extern float freq;

#ifdef HAVE_LIBHAMLIB
    extern freq_t outfreq;
#else
    extern int outfreq;
#endif

    static int dir = 1;		/* start scanning up */

    spot *data;

    if (trx_control == 0)
	return;

    data = bandmap_next( dir, (unsigned int)(freq*1000) );

    if (data == NULL) {		/* nothing in that direction */
				/* try other one */
	dir = 1 - dir;
	data = bandmap_next( dir, (unsigned int)(freq*1000));
    }

    if (data != NULL) {

	outfreq = data -> freq;
	outfreq -= fldigi_get_carrier();
	send_bandswitch( (int) outfreq );

	strcpy( hiscall, data->call );

	showinfo( getctydata( hiscall ) );
	searchlog( hiscall );

	/* if in CQ mode switch to S&P and remember QRG */
	if (cqmode == CQ) {
	    cqmode = S_P;
	    strcpy(mode, "S&P     ");
	    mem = freq;
	    mvprintw(14, 68, "MEM: %7.1f", mem);
	}

	refreshp();

	g_free( data->call );
	g_free( data );
    }
}