From eae7ee6b6ea928a79c7f21974b8f492b0ed7143f Mon Sep 17 00:00:00 2001 From: c vw Date: Tue, 1 Jun 2021 16:36:30 +0200 Subject: [PATCH] Prepearing for merge --- toolbar.c | 4 ++++ tx_menu.c | 4 +++- tx_panadapter.c | 5 ++--- vfo.c | 38 +++++++++++++++----------------------- vfo_menu.c | 1 + zoompan.c | 4 ++-- 6 files changed, 27 insertions(+), 29 deletions(-) diff --git a/toolbar.c b/toolbar.c index 6727192..fce5c88 100644 --- a/toolbar.c +++ b/toolbar.c @@ -91,6 +91,10 @@ static gboolean rit_timer_cb(gpointer data) { static gboolean xit_timer_cb(gpointer data) { int i=GPOINTER_TO_INT(data); + // + // In most operations, one want to move XIT faster than RIT + // therefore take 10 times the RIT value for XIT + // transmitter->xit+=(10*i*rit_increment); if(transmitter->xit>10000) transmitter->xit=10000; if(transmitter->xit<-10000) transmitter->xit=-10000; diff --git a/tx_menu.c b/tx_menu.c index 868b020..040643e 100644 --- a/tx_menu.c +++ b/tx_menu.c @@ -219,9 +219,11 @@ static gboolean emp_cb (GtkWidget *widget, gpointer data) { return FALSE; } +/* static void tune_value_changed_cb(GtkWidget *widget, gpointer data) { setTuneDrive(gtk_range_get_value(GTK_RANGE(tune_scale))); } +*/ void tx_menu(GtkWidget *parent) { int i; @@ -271,7 +273,7 @@ void tx_menu(GtkWidget *parent) { input=gtk_combo_box_text_new(); for(i=0;imicrophone_name!=NULL) { if(strcmp(transmitter->microphone_name,input_devices[i].name)==0) { gtk_combo_box_set_active(GTK_COMBO_BOX(input),i); diff --git a/tx_panadapter.c b/tx_panadapter.c index 59d9eed..2174604 100644 --- a/tx_panadapter.c +++ b/tx_panadapter.c @@ -352,6 +352,7 @@ void tx_panadapter_update(TRANSMITTER *tx) { cairo_set_line_width(cr, 1.0); cairo_stroke(cr); +/* #ifdef GPIO if(controller==CONTROLLER1 && tx->dialog == NULL) { char text[64]; @@ -377,7 +378,7 @@ void tx_panadapter_update(TRANSMITTER *tx) { } } #endif - +*/ #ifdef PURESIGNAL if(tx->puresignal) { @@ -417,7 +418,6 @@ void tx_panadapter_update(TRANSMITTER *tx) { } cairo_move_to(cr,10,15); cairo_show_text(cr, text); - // // Since colour is already red, no special // action for "high SWR" warning @@ -440,7 +440,6 @@ void tx_panadapter_update(TRANSMITTER *tx) { cairo_show_text(cr, text); */ } - // // If the SWR protection has been triggered, display message for three seconds // diff --git a/vfo.c b/vfo.c index c78418f..7935ff7 100644 --- a/vfo.c +++ b/vfo.c @@ -64,8 +64,8 @@ static int my_height; static GtkWidget *vfo_panel; static cairo_surface_t *vfo_surface = NULL; -int steps[]={1,10,25,50,100,250,500,1000,5000,9000,10000,100000,250000,500000,1000000,0}; -char *step_labels[]={"1Hz","10Hz","25Hz","50Hz","100Hz","250Hz","500Hz","1kHz","5kHz","9kHz","10kHz","100kHz","250KHz","500KHz","1MHz",0}; +int steps[]={1,10,25,50,100,250,500,1000,5000,9000,10000,100000,250000,500000,1000000}; +char *step_labels[]={"1Hz","10Hz","25Hz","50Hz","100Hz","250Hz","500Hz","1kHz","5kHz","9kHz","10kHz","100kHz","250KHz","500KHz","1MHz"}; static GtkWidget* menu=NULL; static GtkWidget* band_menu=NULL; @@ -692,7 +692,6 @@ void vfo_step(int steps) { #ifdef CLIENT_SERVER if(radio_is_remote) { - //send_vfo_step(client_socket,id,steps); update_vfo_step(id,steps); return; } @@ -1078,12 +1077,12 @@ void vfo_update() { long long af = vfo[0].ctun ? vfo[0].ctun_frequency : vfo[0].frequency; long long bf = vfo[1].ctun ? vfo[1].ctun_frequency : vfo[1].frequency; - if(vfo[0].entering_frequency) { - af=vfo[0].entered_frequency; - } - if(vfo[1].entering_frequency) { - bf=vfo[1].entered_frequency; - } + if(vfo[0].entering_frequency) { + af=vfo[0].entered_frequency; + } + if(vfo[1].entering_frequency) { + bf=vfo[1].entered_frequency; + } #if 0 // @@ -1117,6 +1116,7 @@ void vfo_update() { int oob=0; if (can_transmit) oob=transmitter->out_of_band; + sprintf(temp_text,"VFO A: %0lld.%06lld",af/(long long)1000000,af%(long long)1000000); if(txvfo == 0 && (isTransmitting() || oob)) { if (oob) sprintf(temp_text,"VFO A: Out of band"); @@ -1298,10 +1298,12 @@ void vfo_update() { } cairo_show_text(cr, "DIV"); - int s=0; - while(steps[s]!=step && steps[s]!=0) { - s++; - } + int s; + for(s=0;s=STEPS) s=0; + sprintf(temp_text,"Step %s",step_labels[s]); cairo_move_to(cr, 400, 15); cairo_set_source_rgb(cr, 1.0, 1.0, 0.0); @@ -1379,16 +1381,6 @@ fprintf(stderr,"vfo_update: no surface!\n"); } } -/* -static gboolean -vfo_step_select_cb (GtkWidget *widget, - gpointer data) -{ - step=steps[(int)data]; - g_idle_add(ext_vfo_update,NULL); -} -*/ - static gboolean vfo_press_event_cb (GtkWidget *widget, GdkEventButton *event, diff --git a/vfo_menu.c b/vfo_menu.c index b7d4760..49c4c39 100644 --- a/vfo_menu.c +++ b/vfo_menu.c @@ -58,6 +58,7 @@ static void cleanup() { gtk_widget_destroy(dialog); dialog=NULL; sub_menu=NULL; + active_menu=NO_MENU; } } diff --git a/zoompan.c b/zoompan.c index d83b607..2052e48 100644 --- a/zoompan.c +++ b/zoompan.c @@ -96,7 +96,7 @@ g_print("zoom_value_changed_cb\n"); } void set_zoom(int rx,double value) { -g_print("set_zoom: %f\n",value); +//g_print("set_zoom: %f\n",value); receiver[rx]->zoom=value; if(display_zoompan) { gtk_range_set_value (GTK_RANGE(zoom_scale),receiver[rx]->zoom); @@ -145,7 +145,7 @@ g_print("remote_set_zoom: EXIT\n"); } void update_zoom(double zoom) { -g_print("update_zoom: %f\n",zoom); +//g_print("update_zoom: %f\n",zoom); int z=active_receiver->zoom+(int)zoom; if(z>MAX_ZOOM) z=MAX_ZOOM; if(z<1) z=1; -- 2.45.2