/** show frequency and frequency memory if rig control is active */ void show_freq(void) { extern int use_rxvt; extern int showfreq; extern int showscore_flag; extern float mem; extern int trx_control; extern float freq; if (trx_control == 1) { if (use_rxvt == 0) attron(COLOR_PAIR(C_LOG) | A_BOLD); else attron(COLOR_PAIR(C_LOG)); if ((showfreq == 0) || (showscore_flag == 1)) mvprintw(13, 68, "TRX: %7.1f", freq); if (mem > 0.0) mvprintw(14, 68, "MEM: %7.1f", mem); else mvprintw(14, 68, " "); if ((showfreq == 1) && (showscore_flag == 0)) { freq_display(); } } }
void change_freq(void) { extern float freq; extern int trx_control; int brkflg = 0; int x; if (trx_control == 0) return; curs_set(0); while (1) { freq_display(); if (get_outfreq() == 0) { x = key_get(); int deltaf = 0; switch (x) { // Up arrow, raise frequency by 100 Hz. case KEY_UP: { deltaf = 100; break; } // Down arrow, lower frequency by 100 Hz. case KEY_DOWN: { deltaf = -100; break; } // Right arrow, raise frequency by 20 Hz. case KEY_RIGHT: { deltaf = 20; break; } // Left arrow, lower frequency by 20 Hz. case KEY_LEFT: { deltaf = -20; break; } // <Page-Up>, raise frequency by 500 Hz. case KEY_PPAGE: { deltaf = 500; break; } // <Page-Down>, lower frequency by 500 Hz. case KEY_NPAGE: { deltaf = -500; break; } default: { brkflg = 1; break; } } if (deltaf) { set_outfreq(freq * 1000 + deltaf); } } if (brkflg == 1) { brkflg = 0; break; } freq_display(); time_update(); usleep(100 * 1000); } curs_set(1); }
void change_freq (void) { extern float freq; extern int trx_control; #ifdef HAVE_LIBHAMLIB extern freq_t outfreq; #else extern int outfreq; #endif int brkflg = 0; int x; if (trx_control == 0) return; curs_set(0); while (1) { freq_display(); if (outfreq == 0) { x = onechar(); switch (x) { case 152:{ //up #ifdef HAVE_LIBHAMLIB outfreq = (freq_t) (freq * 1000); #else outfreq = (int) (freq * 1000); #endif outfreq += 100; break; } case 153:{ //down #ifdef HAVE_LIBHAMLIB outfreq = (freq_t) (freq * 1000); #else outfreq = (int) (freq * 1000); #endif outfreq -= 100; break; } case 154:{ //right #ifdef HAVE_LIBHAMLIB outfreq = (freq_t) (freq * 1000); #else outfreq = (int) (freq * 1000); #endif outfreq += 20; break; } case 155:{ //left #ifdef HAVE_LIBHAMLIB outfreq = (freq_t) (freq * 1000); #else outfreq = (int) (freq * 1000); #endif outfreq -= 20; break; } case 156:{ //left #ifdef HAVE_LIBHAMLIB outfreq = (freq_t) (freq * 1000); #else outfreq = (int) (freq * 1000); #endif outfreq += 500; break; } case 157:{ //left #ifdef HAVE_LIBHAMLIB outfreq = (freq_t) (freq * 1000); #else outfreq = (int) (freq * 1000); #endif outfreq -= 500; break; } default:{ brkflg = 1; break; } } } if (brkflg == 1) { brkflg = 0; break; } freq_display(); time_update(); usleep(100000); } curs_set(1); }