#include <string.h>
#include "new_menu.h"
+#include "noise_menu.h"
#include <wdsp.h>
double nb_lead_time = 0.001;
double nb_transition_time = 0.001;
double nb_threshold_value = 18.0;
+int nb2_mode = 0; // 0, 1, 2, 3, 4
-void update_nb() {
- SetEXTANBHangtime(0, nb_lag_time);
- SetEXTANBAdvtime(0, nb_lead_time);
- SetEXTANBTau(0, nb_transition_time);
- SetEXTANBThreshold(0, nb_threshold_value);
-}
void nb_changed() {
update_nb();
}
nb_changed();
}
+static void nb2_mode_changed_cb(GtkWidget *widget, gpointer data) {
+ nb2_mode = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
+ nb_changed();
+}
+
void nb_menu(GtkWidget *parent) {
parent_window = parent;
gtk_grid_attach(GTK_GRID(grid),nb_threshold_value_b,1,4,1,1);
g_signal_connect(nb_threshold_value_b,"value_changed",G_CALLBACK(nb_threshold_value_changed_cb),NULL);
+ GtkWidget *nb2_mode_b=gtk_spin_button_new_with_range(0, 5, 1);
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(nb2_mode_b),(int)nb2_mode);
+ gtk_widget_show(nb2_mode_b);
+ gtk_grid_attach(GTK_GRID(grid),nb2_mode_b,1,5,1,1);
+ g_signal_connect(nb2_mode_b,"value_changed",G_CALLBACK(nb2_mode_changed_cb),NULL);
+
gtk_container_add(GTK_CONTAINER(content),grid);
sub_menu=dialog;
gtk_widget_show_all(dialog);
*/
extern void nb_menu(GtkWidget *parent);
-extern void update_nb();
+
+extern double nb_lag_time;
+extern double nb_lead_time;
+extern double nb_transition_time;
+extern double nb_threshold_value;
+extern int nb2_mode;
return FALSE;
}
+void update_nb() {
+ SetEXTANBHangtime(active_receiver->id, nb_lag_time);
+ SetEXTANBAdvtime(active_receiver->id, nb_lead_time);
+ SetEXTANBTau(active_receiver->id, nb_transition_time);
+ SetEXTANBThreshold(active_receiver->id, nb_threshold_value);
+}
+
+void update_nb2() {
+ SetEXTNOBMode(active_receiver->id, nb2_mode);
+
+ SetEXTNOBHangtime(active_receiver->id, nb_lag_time);
+ SetEXTNOBAdvtime(active_receiver->id, nb_lead_time);
+ SetEXTNOBTau(active_receiver->id, nb_transition_time);
+ SetEXTNOBThreshold(active_receiver->id, nb_threshold_value);
+}
+
void set_noise() {
update_nb();
+ update_nb2();
SetEXTANBRun(active_receiver->id, active_receiver->nb);
SetEXTNOBRun(active_receiver->id, active_receiver->nb2);
extern void update_noise();
extern void set_noise();
+extern void update_nb();
#include "filter.h"
#include "main.h"
#include "mode.h"
+#include "nb_menu.h"
#include "new_menu.h"
#include "new_protocol.h"
#include "old_protocol.h"
// RX and TX calibration
long long calibration = 0LL;
-// nb values defined in nb_menu.c
-extern double nb_lag_time;
-extern double nb_lead_time;
-extern double nb_transition_time;
-extern double nb_threshold_value;
-
/*
#ifdef GPIO
static GtkWidget *encoders;
if (value)
nb_threshold_value = atof(value);
+ value = getProperty("nb2_mode");
+ if (value)
+ nb2_mode = atoi(value);
+
g_mutex_unlock(&property_mutex);
}
setProperty("nb_lead_time", value);
sprintf(value, "%f", nb_transition_time);
setProperty("nb_transition_time", value);
- sprintf(value, "%f", nb_threshold_value);
+ sprintf(value, "%f", (nb_threshold_value/0.165));
setProperty("nb_threshold_value", value);
+ sprintf(value, "%d", nb2_mode);
+ setProperty("nb2_mode", value);
+
saveProperties(property_path);
g_mutex_unlock(&property_mutex);
}