gtk_grid_attach(GTK_GRID(grid),adc0_antenna_combo_box,1,1,1,1);
}
- g_print("tx_antennas=%d\n",radio->info.soapy.tx_antennas);
- if(radio->info.soapy.tx_antennas>0) {
- GtkWidget *antenna_label=gtk_label_new("TX Antenna:");
- gtk_grid_attach(GTK_GRID(grid),antenna_label,0,2,1,1);
- dac0_antenna_combo_box=gtk_combo_box_text_new();
-
- for(i=0;i<radio->info.soapy.tx_antennas;i++) {
- gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(dac0_antenna_combo_box),NULL,radio->info.soapy.tx_antenna[i]);
+ if(can_transmit) {
+ g_print("tx_antennas=%d\n",radio->info.soapy.tx_antennas);
+ if(radio->info.soapy.tx_antennas>0) {
+ GtkWidget *antenna_label=gtk_label_new("TX Antenna:");
+ gtk_grid_attach(GTK_GRID(grid),antenna_label,0,2,1,1);
+ dac0_antenna_combo_box=gtk_combo_box_text_new();
+
+ for(i=0;i<radio->info.soapy.tx_antennas;i++) {
+ gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(dac0_antenna_combo_box),NULL,radio->info.soapy.tx_antenna[i]);
+ }
+
+ gtk_combo_box_set_active(GTK_COMBO_BOX(dac0_antenna_combo_box),dac[0].antenna);
+ g_signal_connect(dac0_antenna_combo_box,"changed",G_CALLBACK(dac0_antenna_cb),&dac[0]);
+ gtk_grid_attach(GTK_GRID(grid),dac0_antenna_combo_box,1,2,1,1);
}
-
- gtk_combo_box_set_active(GTK_COMBO_BOX(dac0_antenna_combo_box),dac[0].antenna);
- g_signal_connect(dac0_antenna_combo_box,"changed",G_CALLBACK(dac0_antenna_cb),&dac[0]);
- gtk_grid_attach(GTK_GRID(grid),dac0_antenna_combo_box,1,2,1,1);
}
}
snd_pcm_sframes_t delay;
long rc;
long trim;
- int mode=transmitter->mode;
+ int mode=modeUSB;
+ if(can_transmit) {
+ mode=transmitter->mode;
+ }
//
// We have to stop the stream here if a CW side tone may occur.
// This might cause underflows, but we cannot use audio_write
int supported_receivers;
int supported_transmitters;
int adcs;
+ int dacs;
double frequency_min;
double frequency_max;
union {
} network;
#ifdef SOAPYSDR
struct soapy {
+ char version[128];
int rtlsdr_count;
int sample_rate;
size_t rx_channels;
break;
#ifdef SOAPYSDR
case SOAPYSDR_PROTOCOL:
- sprintf(text,"%s SOAPY_SDR v%d.%d.%d USB",
- d->name,d->software_version/100,(d->software_version%100)/10,d->software_version%10);
+ sprintf(text,"%s (Protocol SOAPY_SDR %s) on USB",d->name,d->info.soapy.version);
break;
#endif
#ifdef STEMLAB_DISCOVERY
#ifdef PURESIGNAL
int ext_tx_set_ps(void *data) {
- int state=(GPOINTER_TO_INT(data)
- tx_set_ps(transmitter, state);
+ if(can_tranmit) {
+ int state=(GPOINTER_TO_INT(data)
+ tx_set_ps(transmitter, state);
+ }
return 0;
}
#endif
}
int ext_set_compression(void *data) {
- set_compression(transmitter);
+ if(can_transmit) {
+ set_compression(transmitter);
+ }
return 0;
}
#ifdef PURESIGNAL
int ext_ps_update(void *data) {
- if(transmitter->puresignal==0) {
- tx_set_ps(transmitter,1);
- } else {
- tx_set_ps(transmitter,0);
+ if(can_transmit) {
+ if(transmitter->puresignal==0) {
+ tx_set_ps(transmitter,1);
+ } else {
+ tx_set_ps(transmitter,0);
+ }
}
return 0;
}
#endif
int ext_two_tone(void *data) {
- int state=transmitter->twotone?0:1;
- tx_set_twotone(transmitter,state);
+ if(can_transmit) {
+ int state=transmitter->twotone?0:1;
+ tx_set_twotone(transmitter,state);
+ }
return 0;
}
}
int ext_split_update(void *data) {
- split=split==1?0:1;
- if(split) {
- tx_set_mode(transmitter,vfo[VFO_B].mode);
- } else {
- tx_set_mode(transmitter,vfo[VFO_A].mode);
- }
+ if(can_transmit) {
+ split=split==1?0:1;
+ if(split) {
+ tx_set_mode(transmitter,vfo[VFO_B].mode);
+ } else {
+ tx_set_mode(transmitter,vfo[VFO_A].mode);
+ }
vfo_update();
+ }
return 0;
}
//
enum MIDIaction {
ACTION_NONE=0, // No-Op (unassigned key)
- AGC, // AGC level
+ MIDI_AGC, // AGC level
AGCATTACK, // AGC ATTACK (cycle fast/med/slow etc.)
ATT, // Step attenuator or Programmable attenuator
AF_GAIN, // AF gain
BAND_DOWN, // cycle through bands downwards
BAND_UP, // cycle through bands upwards
COMPRESS, // TX compressor value
- CTUN, // CTUN on/off
+ MIDI_CTUN, // CTUN on/off
FILTER_UP, // cycle through filters upwards
FILTER_DOWN, // cycle through filters downwards
MIC_VOLUME, // MIC gain
- LOCK, // disable frequency changes
+ MIDI_LOCK, // disable frequency changes
MODE_UP, // cycle through modes upwards
MODE_DOWN, // cycle through modes downwards
- MOX, // toggle "mox" state
- NB, // cycle through NoiseBlanker states (none, NB, NB2)
- NR, // cycle through NoiseReduction states (none, NR, NR2)
+ MIDI_MOX, // toggle "mox" state
+ MIDI_NB, // cycle through NoiseBlanker states (none, NB, NB2)
+ MIDI_NR, // cycle through NoiseReduction states (none, NR, NR2)
PRE, // preamp on/off
PAN_HIGH, // "high" value of current panadapter
PAN_LOW, // "low" value of current panadapter
- PS, // PURESIGNAL on/off
- RIT_CLEAR, // clear RIT value
+ MIDI_PS, // PURESIGNAL on/off
+ MIDI_RIT_CLEAR, // clear RIT value
RIT_VAL, // change RIT value
- SPLIT, // Split on/off
+ MIDI_SPLIT, // Split on/off
SWAP_VFO, // swap VFO A/B frequency
- TUNE, // toggle "tune" state
+ MIDI_TUNE, // toggle "tune" state
TX_DRIVE, // RF output power
VFO, // change VFO frequency
VFO_A2B, // VFO A -> B
const char *str;
} ActionTable[] = {
{ AF_GAIN, "AFGAIN"},
- { AGC, "AGC"},
+ { MIDI_AGC, "AGC"},
{ AGCATTACK, "AGCATTACK"},
{ ATT, "ATT"},
{ BAND_DOWN, "BANDDOWN"},
{ BAND_UP, "BANDUP"},
{ COMPRESS, "COMPRESS"},
- { CTUN, "CTUN"},
+ { MIDI_CTUN, "CTUN"},
{ FILTER_DOWN, "FILTERDOWN"},
{ FILTER_UP, "FILTERUP"},
- { LOCK, "LOCK"},
+ { MIDI_LOCK, "LOCK"},
{ MIC_VOLUME, "MICGAIN"},
{ MODE_DOWN, "MODEDOWN"},
{ MODE_UP, "MODEUP"},
- { MOX, "MOX"},
- { NB, "NOISEBLANKER"},
- { NR, "NOISEREDUCTION"},
+ { MIDI_MOX, "MOX"},
+ { MIDI_NB, "NOISEBLANKER"},
+ { MIDI_NR, "NOISEREDUCTION"},
{ PAN_HIGH, "PANHIGH"},
{ PAN_LOW, "PANLOW"},
{ PRE, "PREAMP"},
- { PS, "PURESIGNAL"},
- { RIT_CLEAR, "RITCLEAR"},
+ { MIDI_PS, "PURESIGNAL"},
+ { MIDI_RIT_CLEAR,"RITCLEAR"},
{ RIT_VAL, "RITVAL"},
- { SPLIT, "SPLIT"},
+ { MIDI_SPLIT, "SPLIT"},
{ SWAP_VFO, "SWAPVFO"},
- { TUNE, "TUNE"},
+ { MIDI_TUNE, "TUNE"},
{ TX_DRIVE, "RFPOWER"},
{ VFO, "VFO"},
{ VFO_A2B, "VFOA2B"},
g_idle_add(ext_vfo_step, GINT_TO_POINTER(val));
}
break;
- case TUNE: // only key supported
+ case MIDI_TUNE: // only key supported
if (type == MIDI_KEY) {
new = !tune;
g_idle_add(ext_tune_update, GINT_TO_POINTER(new));
}
break;
- case MOX: // only key supported
+ case MIDI_MOX: // only key supported
if (type == MIDI_KEY) {
new = !mox;
g_idle_add(ext_mox_update, GINT_TO_POINTER(new));
*dp=dnew;
g_idle_add(ext_set_mic_gain, (gpointer) dp);
break;
- case AGC: // knob or wheel supported
+ case MIDI_AGC: // knob or wheel supported
if (type == MIDI_KNOB) {
dnew = -20.0 + 1.4*val;
} else if (type == MIDI_WHEEL) {
}
}
break;
- case RIT_CLEAR: // only key supported
+ case MIDI_RIT_CLEAR: // only key supported
if (type == MIDI_KEY) {
// this clears the RIT value and disables RIT
vfo[active_receiver->id].rit = new;
if (filter_board == ALEX && active_receiver->adc == 0) {
new=active_receiver->alex_attenuation + 1;
if (new > 3) new=0;
- g_idle_add(ext_set_alex_attenuation, GINT_TO_PONTER(new));
+ g_idle_add(ext_set_alex_attenuation, GINT_TO_POINTER(new));
g_idle_add(ext_update_att_preamp, NULL);
}
break;
if (dnew > 0.5) transmitter->compressor=1;
g_idle_add(ext_set_compression, NULL);
break;
- case NB:
+ case MIDI_NB:
// cycle through NoiseBlanker settings
if (active_receiver->nb) {
active_receiver->nb = 0;
}
g_idle_add(ext_vfo_update, NULL);
break;
- case NR:
+ case MIDI_NR:
// cycle through NoiseReduction settings
if (active_receiver->nr) {
active_receiver->nr = 0;
vox_enabled = !vox_enabled;
g_idle_add(ext_vfo_update, NULL);
break;
- case CTUN:
+ case MIDI_CTUN:
// toggle CTUN
new=active_receiver->id;
if(!vfo[new].ctun) {
set_offset(active_receiver,vfo[new].offset);
g_idle_add(ext_vfo_update, NULL);
break;
- case PS:
+ case MIDI_PS:
#ifdef PURESIGNAL
// toggle PURESIGNAL
new=!(transmitter->puresignal);
g_idle_add(ext_tx_set_ps,GINT_TO_POINTER(new));
#endif
break;
- case SPLIT:
+ case MIDI_SPLIT:
// toggle split mode
if(!split) {
split=1;
case VFO_B2A:
g_idle_add(ext_vfo_b_to_a, NULL);
break;
- case LOCK:
+ case MIDI_LOCK:
locked=!locked;
g_idle_add(ext_vfo_update, NULL);
break;
double meter_calibration=0.0;
double display_calibration=0.0;
+int can_transmit=0;
+
void reconfigure_radio() {
int i;
int y;
}
}
- reconfigure_transmitter(transmitter,rx_height);
+ if(can_transmit) {
+ reconfigure_transmitter(transmitter,rx_height);
+ }
}
int rc;
+ switch(radio->protocol) {
+ case ORIGINAL_PROTOCOL:
+ case NEW_PROTOCOL:
+ can_transmit=1;
+ break;
+#ifdef SOAPYSDR
+ case SOAPYSDR_PROTOCOL:
+ can_transmit=(radio->info.soapy.tx_channels!=0);
+ break;
+#endif
+ }
+
+ g_print("start_radio: can_transmit=%d tx_channels=%d\n",can_transmit,radio->info.soapy.tx_channels);
+
#ifdef MIDI
MIDIstartup();
#endif
active_receiver=receiver[0];
//fprintf(stderr,"Create transmitter\n");
- transmitter=create_transmitter(CHANNEL_TX, buffer_size, fft_size, updates_per_second, display_width, tx_height);
- transmitter->x=0;
- transmitter->y=VFO_HEIGHT;
- //gtk_fixed_put(GTK_FIXED(fixed),transmitter->panel,0,VFO_HEIGHT);
+ if(can_transmit) {
+ transmitter=create_transmitter(CHANNEL_TX, buffer_size, fft_size, updates_per_second, display_width, tx_height);
+ transmitter->x=0;
+ transmitter->y=VFO_HEIGHT;
#ifdef PURESIGNAL
- tx_set_ps_sample_rate(transmitter,protocol==NEW_PROTOCOL?192000:active_receiver->sample_rate);
- receiver[PS_TX_FEEDBACK]=create_pure_signal_receiver(PS_TX_FEEDBACK, buffer_size,protocol==ORIGINAL_PROTOCOL?active_receiver->sample_rate:192000,display_width);
- receiver[PS_RX_FEEDBACK]=create_pure_signal_receiver(PS_RX_FEEDBACK, buffer_size,protocol==ORIGINAL_PROTOCOL?active_receiver->sample_rate:192000,display_width);
- SetPSHWPeak(transmitter->id, protocol==ORIGINAL_PROTOCOL? 0.4067 : 0.2899);
+ tx_set_ps_sample_rate(transmitter,protocol==NEW_PROTOCOL?192000:active_receiver->sample_rate);
+ receiver[PS_TX_FEEDBACK]=create_pure_signal_receiver(PS_TX_FEEDBACK, buffer_size,protocol==ORIGINAL_PROTOCOL?active_receiver->sample_rate:192000,display_width);
+ receiver[PS_RX_FEEDBACK]=create_pure_signal_receiver(PS_RX_FEEDBACK, buffer_size,protocol==ORIGINAL_PROTOCOL?active_receiver->sample_rate:192000,display_width);
+ SetPSHWPeak(transmitter->id, protocol==ORIGINAL_PROTOCOL? 0.4067 : 0.2899);
#endif
+ }
#ifdef AUDIO_WATERFALL
audio_waterfall=audio_waterfall_init(200,100);
launch_rigctl();
}
- calcDriveLevel();
-
- if(transmitter->puresignal) {
- tx_set_ps(transmitter,transmitter->puresignal);
+ if(can_transmit) {
+ calcDriveLevel();
+ if(transmitter->puresignal) {
+ tx_set_ps(transmitter,transmitter->puresignal);
+ }
}
if(protocol==NEW_PROTOCOL) {
if(protocol==SOAPYSDR_PROTOCOL) {
RECEIVER *rx=receiver[0];
soapy_protocol_create_receiver(rx);
- if(transmitter!=NULL) {
+ if(can_transmit) {
soapy_protocol_create_transmitter(transmitter);
soapy_protocol_set_tx_antenna(transmitter,dac[0].antenna);
for(int i=0;i<radio->info.soapy.tx_gains;i++) {
}
void setMox(int state) {
+ if(!can_transmit) return;
vox_cancel(); // remove time-out
if(mox!=state) {
if (state && vox) {
void setTune(int state) {
int i;
+ if(!can_transmit) return;
+
// if state==tune, this function is a no-op
if(tune!=state) {
// the alex_antenna an the adc
receiver_save_state(receiver[PS_RX_FEEDBACK]);
#endif
- transmitter_save_state(transmitter);
+ if(can_transmit) {
+ transmitter_save_state(transmitter);
+ }
#ifdef FREEDV
freedv_save_state();
#endif
extern double meter_calibration;
extern double display_calibration;
+extern int can_transmit;
+
extern void reconfigure_radio();
extern void start_radio();
//extern void init_radio();
gtk_grid_attach(GTK_GRID(grid),agc,col,row,1,1);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(agc),adc[0].agc);
g_signal_connect(agc,"toggled",G_CALLBACK(agc_changed_cb),&adc[0]);
- col++;
+ row++;
}
row=temp_row;
- if(radio->info.soapy.tx_gains>0) {
- col=2;
- GtkWidget *tx_gain=gtk_label_new("Tx Gains:");
- gtk_grid_attach(GTK_GRID(grid),tx_gain,col,row,1,1);
- row++;
+ if(can_transmit) {
+ if(radio->info.soapy.tx_gains>0) {
+ col=2;
+ GtkWidget *tx_gain=gtk_label_new("Tx Gains:");
+ gtk_grid_attach(GTK_GRID(grid),tx_gain,col,row,1,1);
+ row++;
+ }
}
temp_row=row;
row=temp_row;
- for(i=0;i<radio->info.soapy.tx_gains;i++) {
- col=2;
- GtkWidget *tx_gain_label=gtk_label_new(radio->info.soapy.tx_gain[i]);
- gtk_grid_attach(GTK_GRID(grid),tx_gain_label,col,row,1,1);
- col++;
- SoapySDRRange range=radio->info.soapy.tx_range[i];
- if(range.step==0.0) {
- range.step=1.0;
+ if(can_transmit) {
+ for(i=0;i<radio->info.soapy.tx_gains;i++) {
+ col=2;
+ GtkWidget *tx_gain_label=gtk_label_new(radio->info.soapy.tx_gain[i]);
+ gtk_grid_attach(GTK_GRID(grid),tx_gain_label,col,row,1,1);
+ col++;
+ SoapySDRRange range=radio->info.soapy.tx_range[i];
+ if(range.step==0.0) {
+ range.step=1.0;
+ }
+ GtkWidget *tx_gain_b=gtk_spin_button_new_with_range(range.minimum,range.maximum,range.step);
+ gtk_widget_set_name (tx_gain_b, radio->info.soapy.tx_gain[i]);
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(tx_gain_b),(double)dac[0].tx_gain[i]);
+ gtk_grid_attach(GTK_GRID(grid),tx_gain_b,col,row,1,1);
+ g_signal_connect(tx_gain_b,"value_changed",G_CALLBACK(tx_gain_value_changed_cb),&dac[0]);
+ row++;
}
- GtkWidget *tx_gain_b=gtk_spin_button_new_with_range(range.minimum,range.maximum,range.step);
- gtk_widget_set_name (tx_gain_b, radio->info.soapy.tx_gain[i]);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(tx_gain_b),(double)dac[0].tx_gain[i]);
- gtk_grid_attach(GTK_GRID(grid),tx_gain_b,col,row,1,1);
- g_signal_connect(tx_gain_b,"value_changed",G_CALLBACK(tx_gain_value_changed_cb),&dac[0]);
- row++;
}
}
size_t rx_rates_length, tx_rates_length, rx_gains_length, tx_gains_length, ranges_length, rx_antennas_length, tx_antennas_length, rx_bandwidth_length, tx_bandwidth_length;
int i;
SoapySDRKwargs args={};
- int version=0;
+ int software_version=0;
int rtlsdr_val=0;
+ char fw_version[64];
+ char gw_version[64];
+ char hw_version[64];
+ char p_version[64];
fprintf(stderr,"soapy_discovery: get_info: %s\n", driver);
+ strcpy(fw_version,"");
+ strcpy(gw_version,"");
+ strcpy(hw_version,"");
+ strcpy(p_version,"");
+
SoapySDRKwargs_set(&args, "driver", driver);
if(strcmp(driver,"rtlsdr")==0) {
char count[16];
}
SoapySDRDevice *sdr = SoapySDRDevice_make(&args);
SoapySDRKwargs_clear(&args);
- version=0;
+ software_version=0;
char *driverkey=SoapySDRDevice_getDriverKey(sdr);
fprintf(stderr,"DriverKey=%s\n",driverkey);
for(i=0;i<info.size;i++) {
fprintf(stderr,"soapy_discovery: hardware info key=%s val=%s\n",info.keys[i], info.vals[i]);
if(strcmp(info.keys[i],"firmwareVersion")==0) {
- version+=atoi(info.vals[i])*100;
+ strcpy(fw_version,info.vals[i]);
+ }
+ if(strcmp(info.keys[i],"gatewareVersion")==0) {
+ strcpy(gw_version,info.vals[i]);
+ software_version=(int)(atof(info.vals[i])*100.0);
}
if(strcmp(info.keys[i],"hardwareVersion")==0) {
- version+=atoi(info.vals[i])*10;
+ strcpy(hw_version,info.vals[i]);
}
if(strcmp(info.keys[i],"protocolVersion")==0) {
- version+=atoi(info.vals[i]);
+ strcpy(p_version,info.vals[i]);
}
}
discovered[devices].supported_receivers=rx_channels;
discovered[devices].supported_transmitters=tx_channels;
discovered[devices].adcs=rx_channels;
+ discovered[devices].dacs=tx_channels;
discovered[devices].status=STATE_AVAILABLE;
- discovered[devices].software_version=version;
+ discovered[devices].software_version=software_version;
discovered[devices].frequency_min=ranges[0].minimum;
discovered[devices].frequency_max=ranges[0].maximum;
discovered[devices].info.soapy.sample_rate=sample_rate;
} else {
discovered[devices].info.soapy.rtlsdr_count=0;
}
+ if(strcmp(driver,"lime")==0) {
+ sprintf(discovered[devices].info.soapy.version,"fw=%s gw=%s hw=%s p=%s", fw_version, gw_version, hw_version, p_version);
+ } else {
+ strcpy(discovered[devices].info.soapy.version,"");
+ }
discovered[devices].info.soapy.rx_channels=rx_channels;
discovered[devices].info.soapy.rx_gains=rx_gains_length;
discovered[devices].info.soapy.rx_gain=rx_gains;
}
SoapySDRKwargs_clear(&args);
- if(transmitter->local_microphone) {
- if(audio_open_input()!=0) {
- fprintf(stderr,"audio_open_input failed\n");
- transmitter->local_microphone=0;
+ if(can_transmit) {
+ if(transmitter->local_microphone) {
+ if(audio_open_input()!=0) {
+ fprintf(stderr,"audio_open_input failed\n");
+ transmitter->local_microphone=0;
+ }
}
}
tx->iq_output_rate=radio_sample_rate;
tx->buffer_size=1024;
tx->output_samples=1024*(tx->iq_output_rate/tx->mic_sample_rate);
+ tx->pixels=width*8; // to allow 384k to 24k conversion
break;
#endif
vfo[i].band=band20;
vfo[i].bandstack=0;
- vfo[i].frequency=14010000;
+ if(radio->protocol==SOAPYSDR_PROTOCOL) {
+ vfo[i].frequency=144010000;
+ } else {
+ vfo[i].frequency=14010000;
+ }
vfo[i].mode=modeCWU;
vfo[i].filter=6;
vfo[i].lo=0;
receiver_vfo_changed(receiver[id]);
BAND *band=band_get_band(vfo[id].band);
set_alex_rx_antenna(band->alexRxAntenna);
- set_alex_tx_antenna(band->alexTxAntenna);
+ if(can_transmit) {
+ set_alex_tx_antenna(band->alexTxAntenna);
+ }
set_alex_attenuation(band->alexAttenuation);
receiver_vfo_changed(receiver[0]);
break;
break;
}
- if(split) {
- tx_set_mode(transmitter,vfo[VFO_B].mode);
- } else {
- tx_set_mode(transmitter,vfo[VFO_A].mode);
+ if(can_transmit) {
+ if(split) {
+ tx_set_mode(transmitter,vfo[VFO_B].mode);
+ } else {
+ tx_set_mode(transmitter,vfo[VFO_A].mode);
+ }
+ //
+ // If the band has changed, it is necessary to re-calculate
+ // the drive level. Furthermore, possibly the "PA disable"
+ // status has changed.
+ //
+ calcDriveLevel(); // sends HighPrio packet if in new protocol
}
- //
- // If the band has changed, it is necessary to re-calculate
- // the drive level. Furthermore, possibly the "PA disable"
- // status has changed.
- //
- calcDriveLevel(); // sends HighPrio packet if in new protocol
if (protocol == NEW_PROTOCOL) {
schedule_general();
}
break;
}
- if(split) {
- tx_set_mode(transmitter,vfo[VFO_B].mode);
- } else {
- tx_set_mode(transmitter,vfo[VFO_A].mode);
+ if(can_transmit) {
+ if(split) {
+ tx_set_mode(transmitter,vfo[VFO_B].mode);
+ } else {
+ tx_set_mode(transmitter,vfo[VFO_A].mode);
+ }
}
//
// I do not think the band can change within this function.
}
break;
}
- if(split) {
- tx_set_mode(transmitter,vfo[VFO_B].mode);
- } else {
- tx_set_mode(transmitter,vfo[VFO_A].mode);
+ if(can_transmit) {
+ if(split) {
+ tx_set_mode(transmitter,vfo[VFO_B].mode);
+ } else {
+ tx_set_mode(transmitter,vfo[VFO_A].mode);
+ }
}
//
// changing modes may change BFO frequency
if(receivers==2) {
receiver_vfo_changed(receiver[1]);
}
- if(split) {
- tx_set_mode(transmitter,vfo[VFO_B].mode);
+ if(can_transmit) {
+ if(split) {
+ tx_set_mode(transmitter,vfo[VFO_B].mode);
+ }
}
g_idle_add(ext_vfo_update,NULL);
}
vfo[VFO_A].rit_enabled=vfo[VFO_B].rit_enabled;
vfo[VFO_A].rit=vfo[VFO_B].rit;
receiver_vfo_changed(receiver[0]);
- if(!split) {
- tx_set_mode(transmitter,vfo[VFO_B].mode);
+ if(can_transmit) {
+ if(!split) {
+ tx_set_mode(transmitter,vfo[VFO_B].mode);
+ }
}
g_idle_add(ext_vfo_update,NULL);
}
if(receivers==2) {
receiver_vfo_changed(receiver[1]);
}
- if(split) {
- tx_set_mode(transmitter,vfo[VFO_B].mode);
- } else {
- tx_set_mode(transmitter,vfo[VFO_A].mode);
+ if(can_transmit) {
+ if(split) {
+ tx_set_mode(transmitter,vfo[VFO_B].mode);
+ } else {
+ tx_set_mode(transmitter,vfo[VFO_A].mode);
+ }
}
g_idle_add(ext_vfo_update,NULL);
}
// Since we can now change it by a MIDI controller,
// we should display the compressor (level)
//
- cairo_move_to(cr, 400, 50);
- if (transmitter->compressor) {
- sprintf(temp_text,"CMPR %d dB",(int) transmitter->compressor_level);
- cairo_set_source_rgb(cr, 1.0, 1.0, 0.0);
- cairo_show_text(cr, temp_text);
- } else {
- cairo_set_source_rgb(cr, 0.7, 0.7, 0.7);
- cairo_show_text(cr, "CMPR OFF");
- }
+ if(can_transmit) {
+ cairo_move_to(cr, 400, 50);
+ if (transmitter->compressor) {
+ sprintf(temp_text,"CMPR %d dB",(int) transmitter->compressor_level);
+ cairo_set_source_rgb(cr, 1.0, 1.0, 0.0);
+ cairo_show_text(cr, temp_text);
+ } else {
+ cairo_set_source_rgb(cr, 0.7, 0.7, 0.7);
+ cairo_show_text(cr, "CMPR OFF");
+ }
+ }
cairo_move_to(cr, 500, 50);
if(diversity_enabled) {
cairo_show_text(cr, "Split");
#ifdef PURESIGNAL
- cairo_move_to(cr, 105, 50);
- if(transmitter->puresignal) {
- cairo_set_source_rgb(cr, 1.0, 1.0, 0.0);
- } else {
- cairo_set_source_rgb(cr, 0.7, 0.7, 0.7);
+ if(can_transmit) {
+ cairo_move_to(cr, 105, 50);
+ if(transmitter->puresignal) {
+ cairo_set_source_rgb(cr, 1.0, 1.0, 0.0);
+ } else {
+ cairo_set_source_rgb(cr, 0.7, 0.7, 0.7);
+ }
+ cairo_show_text(cr, "PS");
}
- cairo_show_text(cr, "PS");
#endif