since the step attenuator also are not treated like this.
LOCALCW_INCLUDE=LOCALCW
# uncomment the line below for SoapySDR
-SOAPYSDR_INCLUDE=SOAPYSDR
+#SOAPYSDR_INCLUDE=SOAPYSDR
# uncomment the line to below include support for sx1509 i2c expander
#SX1509_INCLUDE=sx1509
$(CONTROLLER2_OPTIONS) $(AUDIO_OPTIONS) \
-D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION)
-LIBS=-lm -lwdsp -lpthread $(AUDIO_LIBS) $(USBOZY_LIBS) $(GTKLIBS) $(SOAPYSDRLIBS) $(STEMLAB_LIBS) $(MIDI_LIBS)
+LIBS= -lm -lwdsp -lpthread $(AUDIO_LIBS) $(USBOZY_LIBS) $(GTKLIBS) $(SOAPYSDRLIBS) $(STEMLAB_LIBS) $(MIDI_LIBS)
INCLUDES=$(GTKINCLUDES)
COMPILE=$(CC) $(CFLAGS) $(OPTIONS) $(INCLUDES)
}
}
-void send_eq(int s, int rxeq, int txeq) {
- // inform client about RX/TX equalizer status
- // NOT-YET
-}
-
void send_noise(int s,int rx,int nb,int nb2,int nr,int nr2,int anf,int snb) {
NOISE_COMMAND command;
g_print("send_noise rx=%d nb=%d nb2=%d nr=%d nr2=%d anf=%d snb=%d\n",rx,nb,nb2,nr,nr2,anf,snb);
extern void send_attenuation(int s,int rx,int attenuation);
extern void send_squelch(int s,int rx,int enable,int squelch);
extern void send_noise(int s,int rx,int nb,int nb2,int nr,int nr2,int anf,int snb);
-extern void send_eq(int s, int rxeq, int txeq);
extern void send_band(int s,int rx,int band);
extern void send_mode(int s,int rx,int mode);
extern void send_filter(int s,int rx,int filter);
void update_eq() {
#ifdef CLIENT_SERVER
if(radio_is_remote) {
- send_eq(client_socket,enable_rx_eq, enable_tx_equalizer);
+ //
+ // insert here any function to inform the client of equalizer setting
+ // changes, if this becomes part of the protocol
+ //
} else {
#endif
set_eq();
int ext_set_alex_attenuation(void *data) {
int val=GPOINTER_TO_INT(data);
- BAND *band=band_get_band(vfo[VFO_A].band);
- // store changed attenuation in "band" info
- band->alexAttenuation=val;
- set_alex_attenuation();
+ set_alex_attenuation(val);
return 0;
}
FILTER* band_filters=filters[entry->mode];
FILTER* band_filter=&band_filters[entry->filter];
set_filter(active_receiver,band_filter->low,band_filter->high);
+ if(active_receiver->id==0) {
+ set_alex_rx_antenna();
+ set_alex_tx_antenna();
+ // set_alex_attenuation(band->alexAttenuation); // nowhere maintained
+ }
}
setFrequency(f);
- // defer set_alex.. until here since setFrequency sets the VFO.band
- set_alex_rx_antenna();
- set_alex_tx_antenna();
- set_alex_attenuation();
g_idle_add(ext_vfo_update,NULL);
}
set = 1;
if(active_receiver->id==0) {
set_alex_rx_antenna(band->alexRxAntenna);
set_alex_tx_antenna(band->alexTxAntenna);
- set_alex_attenuation(band->alexAttenuation);
+ // set_alex_attenuation(band->alexAttenuation); // nowhere maintained
}
}
}
int binaural=0;
int mic_linein=0;
-int linein_gain=16; // 0..31
+//
+// linein_gain = 0...31 maps onto -34.5dB ... +12 dB
+// (in 1.5 dB steps), and 0 dB corresponds to linein_gain=23
+//
+int linein_gain=23;
int mic_boost=0;
int mic_bias_enabled=0;
int mic_ptt_enabled=0;
//
// For HPSDR, only receiver[0]->alex_attenuation has an effect
-// Set this from the attenuation stored "per band"
//
-void set_alex_attenuation() {
- BAND *band;
- switch (protocol) {
- case ORIGINAL_PROTOCOL:
- band=band_get_band(vfo[VFO_A].band);
- receiver[0]->alex_attenuation=band->alexAttenuation;
- break;
- case NEW_PROTOCOL:
- band=band_get_band(vfo[VFO_A].band);
- receiver[0]->alex_attenuation=band->alexAttenuation;
- schedule_high_priority();
- break;
- }
+void set_alex_attenuation(int v) {
+ receiver[0]->alex_attenuation=v;
+ if(protocol==NEW_PROTOCOL) {
+ schedule_high_priority();
+ }
}
void radioRestoreState() {
extern void set_attenuation(int value);
extern void set_alex_rx_antenna(void);
extern void set_alex_tx_antenna(void);
-extern void set_alex_attenuation(void);
+extern void set_alex_attenuation(int v);
extern int isTransmitting();
filter_board_changed();
}
- //
- // This should not be necessary HERE
- //
- if(filter_board==ALEX || filter_board==APOLLO || filter_board==CHARLY25) {
+ if(filter_board==ALEX || filter_board==APOLLO) {
+ BAND *band=band_get_current_band();
+ // mode and filters have nothing to do with the filter board
+ //BANDSTACK_ENTRY* entry=bandstack_entry_get_current();
+ //setFrequency(entry->frequency);
+ //setMode(entry->mode);
+ //set_mode(active_receiver,entry->mode);
+ //FILTER* band_filters=filters[entry->mode];
+ //FILTER* band_filter=&band_filters[entry->filter];
+ //set_filter(active_receiver,band_filter->low,band_filter->high);
+ if(active_receiver->id==0) {
set_alex_rx_antenna();
set_alex_tx_antenna();
- set_alex_attenuation();
+ //set_alex_attenuation(band->alexAttenuation); // nowhere maintained
+ }
}
att_type_changed();
}
BAND *b=band_get_band(vfo[rx->id].band);
rx->alex_antenna=b->alexRxAntenna;
- rx->alex_attenuation=b->alexAttenuation;
+ //rx->alex_attenuation=b->alexAttenuation; // nowhere maintained
rx->agc=AGC_MEDIUM;
rx->agc_gain=80.0;
#include "receiver.h"
#include "sliders.h"
#include "new_protocol.h"
-#include "vfo.h"
static GtkWidget *parent_window=NULL;
static GtkWidget *menu_b=NULL;
}
static void alex_att_cb(GtkWidget *widget, gpointer data) {
- BAND *band;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
- // store value in the "band" info
- band=band_get_band(vfo[VFO_A].band);
- band->alexAttenuation=GPOINTER_TO_INT(data);
- set_alex_attenuation();
+ set_alex_attenuation((intptr_t) data);
update_att_preamp();
}
}
#ifdef USBOZY
(protocol==ORIGINAL_PROTOCOL && device == DEVICE_OZY) ||
#endif
- (protocol==NEW_PROTOCOL && device == NEW_DEVICE_ATLAS)) {
+ (protocol==NEW_PROTOCOL && device == NEW_DEVICE_ATLAS)) {
GtkWidget *preamp_b=gtk_check_button_new_with_label("Preamp");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (preamp_b), active_receiver->preamp);
gtk_grid_attach(GTK_GRID(grid),preamp_b,x,4,1,1);
if (filter_board == ALEX && active_receiver->adc == 0
&& ((protocol==ORIGINAL_PROTOCOL && device != DEVICE_ORION2) || (protocol==NEW_PROTOCOL && device != NEW_DEVICE_ORION2))) {
+ //
+ // The "Alex ATT" value is stored in receiver[0] no matter how the ADCs are selected
+ //
GtkWidget *alex_att_label=gtk_label_new(NULL);
gtk_label_set_markup(GTK_LABEL(alex_att_label), "<b>Alex Attenuator</b>");
gtk_grid_attach(GTK_GRID(grid), alex_att_label, x, 5, 1, 1);
gchar button_text[] = "xx dB";
sprintf(button_text, "%d dB", i*10);
GtkWidget *alex_att_b=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(last_alex_att_b), button_text);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(alex_att_b), active_receiver->alex_attenuation == i);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(alex_att_b), receiver[0]->alex_attenuation == i);
gtk_grid_attach(GTK_GRID(grid), alex_att_b, x, 6 + i, 1, 1);
g_signal_connect(alex_att_b, "toggled", G_CALLBACK(alex_att_cb), GINT_TO_POINTER(i));
last_alex_att_b = alex_att_b;
// this button is only valid for the first receiver
// store attenuation, such that in meter.c the correct level is displayed
adc_attenuation[active_receiver->adc] = 12*val;
- BAND* band = band_get_band(vfo[VFO_A].band);
- band->alexAttenuation=val;
- set_alex_attenuation();
+ set_alex_attenuation(val);
} else {
// always show "0 dB" on the button if the second RX is active
if (val != 0) {
switch(id) {
case 0:
bandstack->current_entry=vfo[id].bandstack;
+ // set_alex_attenuation(band->alexAttenuation); // nowhere maintained
receiver_vfo_changed(receiver[0]);
break;
case 1:
}
break;
}
- set_alex_attenuation();
set_alex_rx_antenna();
if(can_transmit) {
switch(id) {
case 0:
bandstack->current_entry=vfo[id].bandstack;
+ // set_alex_attenuation(band->alexAttenuation); // nowhere maintained
receiver_vfo_changed(receiver[0]);
break;
case 1:
}
set_alex_rx_antenna();
- set_alex_attenuation();
if(can_transmit) {
set_alex_tx_antenna();
tx_set_mode(transmitter,get_tx_mode());
receiver_vfo_changed(receiver[1]);
}
set_alex_rx_antenna();
- set_alex_attenuation();
if(can_transmit) {
set_alex_tx_antenna();
tx_set_mode(transmitter,get_tx_mode());
vfo[VFO_A].rit=vfo[VFO_B].rit;
receiver_vfo_changed(receiver[0]);
set_alex_rx_antenna();
- set_alex_attenuation();
if(can_transmit) {
set_alex_tx_antenna();
tx_set_mode(transmitter,get_tx_mode());
receiver_vfo_changed(receiver[1]);
}
set_alex_rx_antenna();
- set_alex_attenuation();
if(can_transmit) {
set_alex_tx_antenna();
tx_set_mode(transmitter,get_tx_mode());