gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
+ int row=0;
+ int col=0;
+
GtkWidget *close_b=gtk_button_new_with_label("Close");
g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
+ gtk_grid_attach(GTK_GRID(grid),close_b,col,row,1,1);
+
+ row++;
+ col=0;
+/*
GtkWidget *discovery_b=gtk_button_new_with_label("Discovery");
g_signal_connect (discovery_b, "pressed", G_CALLBACK(discovery_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),discovery_b,0,1,1,1);
+ gtk_grid_attach(GTK_GRID(grid),discovery_b,col,row,1,1);
+ col++;
+*/
GtkWidget *exit_b=gtk_button_new_with_label("Exit");
g_signal_connect (exit_b, "pressed", G_CALLBACK(exit_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),exit_b,1,1,1,1);
+ gtk_grid_attach(GTK_GRID(grid),exit_b,col,row,1,1);
+
+ col++;
GtkWidget *reboot_b=gtk_button_new_with_label("Reboot");
g_signal_connect (reboot_b, "pressed", G_CALLBACK(reboot_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),reboot_b,2,1,1,1);
+ gtk_grid_attach(GTK_GRID(grid),reboot_b,col,row,1,1);
+
+ col++;
GtkWidget *shutdown_b=gtk_button_new_with_label("Shutdown");
g_signal_connect (shutdown_b, "pressed", G_CALLBACK(shutdown_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),shutdown_b,3,1,1,1);
+ gtk_grid_attach(GTK_GRID(grid),shutdown_b,col,row,1,1);
gtk_container_add(GTK_CONTAINER(content),grid);
if(!locked) {
if(vfo[id].ctun) {
vfo[id].ctun_frequency=vfo[id].ctun_frequency+hz;
- if(round) {
+ if(round && (vfo[id].mode!=modeCWL && vfo[id].mode!=modeCWU)) {
vfo[id].ctun_frequency=((vfo[id].ctun_frequency+(step/2))/step)*step;
}
} else {
vfo[id].frequency=vfo[id].frequency-hz;
- if(round) {
+ if(round && (vfo[id].mode!=modeCWL && vfo[id].mode!=modeCWU)) {
vfo[id].frequency=((vfo[id].frequency-(step/2))/step)*step;
}
}
// A and B increment and decrement together
if(vfo[sid].ctun) {
vfo[sid].ctun_frequency=vfo[sid].ctun_frequency+hz;
- if(round) {
+ if(round && (vfo[id].mode!=modeCWL && vfo[id].mode!=modeCWU)) {
vfo[sid].ctun_frequency=((vfo[sid].ctun_frequency+(step/2))/step)*step;
}
} else {
vfo[sid].frequency=vfo[sid].frequency-hz;
- if(round) {
+ if(round && (vfo[id].mode!=modeCWL && vfo[id].mode!=modeCWU)) {
vfo[sid].frequency=((vfo[sid].frequency-(step/2))/step)*step;
}
}
// A increments and B decrements or A decrments and B increments
if(vfo[sid].ctun) {
vfo[sid].ctun_frequency=vfo[sid].ctun_frequency-hz;
- if(round) {
+ if(round && (vfo[id].mode!=modeCWL && vfo[id].mode!=modeCWU)) {
vfo[sid].ctun_frequency=((vfo[sid].ctun_frequency-(step/2))/step)*step;
}
} else {
vfo[sid].frequency=vfo[sid].frequency+hz;
- if(round) {
+ if(round && (vfo[id].mode!=modeCWL && vfo[id].mode!=modeCWU)) {
vfo[sid].ctun_frequency=((vfo[sid].ctun_frequency+(step/2))/step)*step;
}
}
void vfo_move_to(long long hz) {
// hz is the offset from the min frequency
int id=active_receiver->id;
- long long offset=(hz/step)*step;
+ long long offset=hz;
long long half=(long long)(active_receiver->sample_rate/2);
long long f=vfo[id].frequency-half+offset;
long long diff;
g_print("vfo_move_to: id=%d hz=%lld f=%lld\n",id,hz,f);
+ if(vfo[id].mode!=modeCWL && vfo[id].mode!=modeCWU) {
+ offset=(hz/step)*step;
+ }
if(!locked) {
if(vfo[id].ctun) {
diff=f-vfo[id].ctun_frequency;