Wireless80211WidgetBand::Wireless80211WidgetBand(QWidget * parent)
    :QSpinBox(parent)
{
    QList<int> channels_a;
    QList<int> channels_b;

    channels_a << 0 << 7 << 8 << 9 << 11 << 12 << 16 << 34 << 36 << 38 << 40 << 42 << 44 << 46 << 48 << 52 << 56 << 60 << 64 << 100 << 104 << 108 << 112 << 116 << 120 << 124 << 128 << 132 << 136 << 140 << 149 << 153 << 157 << 161 << 165 << 183 << 184 << 185 << 187 << 188 << 189 << 192 << 196;
    channels_b << 0 << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12 << 13;

    channels << channels_a << channels_b;

    setBand(Wireless80211WidgetPrivate::AIndex);
}
Ejemplo n.º 2
0
void setTxOn() {

   // Supress TX if menu is active
   if (menu_active) return;

   // Supress TX if TX_delay is active
   if (TX_delay_ms != 0) return;

   // Operate band relays.
   if (bandFlag == 1) {
      setBand();
      bandFlag = 0;
      delay_ms(25);
   }

   if ((keymode != QR) && (band != _UNK)) TX_OUT = 1;
   TX_LED       = 1;
   PWR_LED      = 0;
   tx_lcdFlag   = 1;
   txState      = 1;
   delay_ms(40);
}
Ejemplo n.º 3
0
EqControlsDialog::EqControlsDialog( EqControls *controls ) :
	EffectControlDialog( controls ),
	m_controls( controls )
{
	setAutoFillBackground( true );
	QPalette pal;
	pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "EqLayout1BG" ) );
	setPalette( pal );
	setFixedSize( 500, 500 );
	QGridLayout *mainLayout = new QGridLayout( this );

	EqSpectrumView *inSpec = new EqSpectrumView( &controls->m_inFftBands, this );
	mainLayout->addWidget( inSpec, 0, 1, 1, 8 );
	inSpec->setColor( QColor( 238, 154, 120, 80 ) );

	EqSpectrumView *outSpec = new EqSpectrumView( &controls->m_outFftBands, this );
	outSpec->setColor( QColor( 145, 205, 22, 80 ) );
	mainLayout->addWidget( outSpec, 0, 1, 1, 8 );

	m_parameterWidget = new EqParameterWidget( this , controls );
	mainLayout->addWidget( m_parameterWidget, 0, 1, 1, 8 );

	setBand( 0, &controls->m_hpActiveModel, &controls->m_hpFeqModel, &controls->m_hpResModel, 0, QColor(255 ,255, 255), tr( "HP" ) ,0,0, &controls->m_hp12Model, &controls->m_hp24Model, &controls->m_hp48Model,0,0,0);
	setBand( 1, &controls->m_lowShelfActiveModel, &controls->m_lowShelfFreqModel, &controls->m_lowShelfResModel, &controls->m_lowShelfGainModel, QColor(255 ,255, 255), tr( "Low Shelf" ), &controls->m_lowShelfPeakL , &controls->m_lowShelfPeakR,0,0,0,0,0,0 );
	setBand( 2, &controls->m_para1ActiveModel, &controls->m_para1FreqModel, &controls->m_para1BwModel, &controls->m_para1GainModel, QColor(255 ,255, 255), tr( "Peak 1" ), &controls->m_para1PeakL, &controls->m_para1PeakR,0,0,0,0,0,0 );
	setBand( 3, &controls->m_para2ActiveModel, &controls->m_para2FreqModel, &controls->m_para2BwModel, &controls->m_para2GainModel, QColor(255 ,255, 255), tr( "Peak 2" ), &controls->m_para2PeakL, &controls->m_para2PeakR,0,0,0,0,0,0 );
	setBand( 4, &controls->m_para3ActiveModel, &controls->m_para3FreqModel, &controls->m_para3BwModel, &controls->m_para3GainModel, QColor(255 ,255, 255), tr( "Peak 3" ), &controls->m_para3PeakL, &controls->m_para3PeakR,0,0,0,0,0,0 );
	setBand( 5, &controls->m_para4ActiveModel, &controls->m_para4FreqModel, &controls->m_para4BwModel, &controls->m_para4GainModel, QColor(255 ,255, 255), tr( "Peak 4" ), &controls->m_para4PeakL, &controls->m_para4PeakR,0,0,0,0,0,0 );
	setBand( 6, &controls->m_highShelfActiveModel, &controls->m_highShelfFreqModel, &controls->m_highShelfResModel, &controls->m_highShelfGainModel, QColor(255 ,255, 255), tr( "High Shelf" ), &controls->m_highShelfPeakL, &controls->m_highShelfPeakR,0,0,0,0,0,0 );
	setBand( 7, &controls->m_lpActiveModel, &controls->m_lpFreqModel, &controls->m_lpResModel, 0, QColor(255 ,255, 255), tr( "LP" ) ,0,0,0,0,0, &controls->m_lp12Model, &controls->m_lp24Model, &controls->m_lp48Model);

	EqFader *inGainFader = new EqFader( &controls->m_inGainModel, tr( "In Gain" ), this, &controls->m_inPeakL, &controls->m_inPeakR );
	mainLayout->addWidget( inGainFader, 0, 0 );
	inGainFader->setDisplayConversion( false );
	inGainFader->setHintText( tr( "Gain" ), "dBFS");

	EqFader *outGainFader = new EqFader( &controls->m_outGainModel, tr( "Out Gain" ), this, &controls->m_outPeakL, &controls->m_outPeakR );
	mainLayout->addWidget( outGainFader, 0, 9 );
	outGainFader->setDisplayConversion( false );
	outGainFader->setHintText( tr( "Gain" ), "dBFS" );

	// Gain Fader for each Filter exepts the pass filter
	for( int i = 1; i < m_parameterWidget->bandCount() - 1; i++ )
	{
		EqFader *gainFader = new EqFader( m_parameterWidget->getBandModels( i )->gain, tr( "" ), this,
								   m_parameterWidget->getBandModels( i )->peakL, m_parameterWidget->getBandModels( i )->peakR );
		mainLayout->addWidget( gainFader, 2, i+1 );
		mainLayout->setAlignment( gainFader, Qt::AlignHCenter );
		gainFader->setMinimumHeight(80);
		gainFader->resize(gainFader->width() , 80);
		gainFader->setDisplayConversion( false );
		gainFader->setHintText( tr( "Gain") , "dB");
	}
	
	//Control Button and Knobs for each Band
	for( int i = 0; i < m_parameterWidget->bandCount() ; i++ )
	{
		Knob *resKnob = new Knob( knobBright_26, this );
		mainLayout->setRowMinimumHeight( 4, 33 );
		mainLayout->addWidget( resKnob, 5, i + 1 );
		mainLayout->setAlignment( resKnob, Qt::AlignHCenter );
		resKnob->setVolumeKnob(false);
		resKnob->setModel( m_parameterWidget->getBandModels( i )->res );
		if(i > 1 && i < 6) { resKnob->setHintText( tr( "Bandwidth: " ) , tr( " Octave" ) ); }
		else { resKnob->setHintText( tr( "Resonance : " ) , "" ); }

		Knob *freqKnob = new Knob( knobBright_26, this );
		mainLayout->addWidget( freqKnob, 3, i+1 );
		mainLayout->setAlignment( freqKnob, Qt::AlignHCenter );
		freqKnob->setVolumeKnob( false );
		freqKnob->setModel( m_parameterWidget->getBandModels( i )->freq );
		freqKnob->setHintText( tr( "Frequency:" ), "Hz" );

		// adds the Number Active buttons
		PixmapButton *activeNumButton = new PixmapButton( this, NULL );
		activeNumButton->setCheckable(true);
		activeNumButton->setModel( m_parameterWidget->getBandModels( i )->active );
		QString iconActiveFileName = "bandLabel" + QString::number(i+1) + "on";
		QString iconInactiveFileName = "bandLabel" + QString::number(i+1);
		activeNumButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( iconActiveFileName.toLatin1() ) );
		activeNumButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( iconInactiveFileName.toLatin1() ) );
		mainLayout->addWidget( activeNumButton, 1, i+1 );
		mainLayout->setAlignment( activeNumButton, Qt::AlignHCenter );
		activeNumButton->setModel( m_parameterWidget->getBandModels( i )->active );

		// adds the symbols active buttons
		PixmapButton *activeButton = new PixmapButton( this, NULL );
		activeButton->setCheckable(true);
		activeButton->setModel( m_parameterWidget->getBandModels( i )->active );
		switch (i)
		{
		case 0:
			activeButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveHP" ) );
			activeButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveHPoff" ) );
			break;
		case 1:
			activeButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveLS" ) );
			activeButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveLSoff" ) );
			break;
		case 6:
			activeButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveHS" ) );
			activeButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveHSoff" ) );
			break;
		case 7:
			activeButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveLP" ) );
			activeButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveLPoff" ) );
			break;
		default:
			activeButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "ActivePeak" ) );
			activeButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "ActivePeakoff" ) );
		}

		mainLayout->addWidget( activeButton, 7, i+1 );
		mainLayout->setAlignment( activeButton, Qt::AlignHCenter);
		activeButton->setModel( m_parameterWidget->getBandModels( i )->active );

		// Connects the knobs, Faders and buttons with the curve graphic
		QObject::connect( m_parameterWidget->getBandModels( i )->freq , SIGNAL( dataChanged() ), m_parameterWidget, SLOT ( updateHandle() ) );
		if ( m_parameterWidget->getBandModels( i )->gain ) QObject::connect( m_parameterWidget->getBandModels( i )->gain, SIGNAL( dataChanged() ), m_parameterWidget, SLOT ( updateHandle() ));
		QObject::connect( m_parameterWidget->getBandModels( i )->res, SIGNAL( dataChanged() ), m_parameterWidget , SLOT ( updateHandle() ) );
		QObject::connect( m_parameterWidget->getBandModels( i )->active, SIGNAL( dataChanged() ), m_parameterWidget , SLOT ( updateHandle() ) );

		m_parameterWidget->changeHandle( i );
	}

	// adds the buttons for Spectrum analyser on/off
	PixmapButton *inSpecB = new PixmapButton(this, NULL);
	inSpecB->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveAnalyse" ) );
	inSpecB->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveAnalyseoff" ) );
	inSpecB->setCheckable( true );
	inSpecB->setModel( &controls->m_analyseInModel );

	PixmapButton *outSpecB = new PixmapButton(this, NULL);
	outSpecB->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveAnalyse" ) );
	outSpecB->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "ActiveAnalyseoff" ) );
	outSpecB->setCheckable( true );
	outSpecB->setModel( &controls->m_analyseOutModel );
	mainLayout->addWidget( inSpecB, 1, 0 );
	mainLayout->addWidget( outSpecB, 1, 9 );
	mainLayout->setAlignment( inSpecB, Qt::AlignHCenter );
	mainLayout->setAlignment( outSpecB, Qt::AlignHCenter );

	//hp filter type
	PixmapButton *hp12Button = new PixmapButton( this , NULL );
	hp12Button->setModel( m_parameterWidget->getBandModels( 0 )->hp12 );
	hp12Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "12dB" ) );
	hp12Button->setInactiveGraphic(  PLUGIN_NAME::getIconPixmap( "12dBoff" ) );

	PixmapButton *hp24Button = new PixmapButton( this , NULL );
	hp24Button->setModel(m_parameterWidget->getBandModels( 0 )->hp24 );
	hp24Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "24dB" ) );
	hp24Button->setInactiveGraphic(  PLUGIN_NAME::getIconPixmap( "24dBoff" ) );

	PixmapButton *hp48Button = new PixmapButton( this , NULL );
	hp48Button->setModel( m_parameterWidget->getBandModels(0)->hp48 );
	hp48Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "48dB" ) );
	hp48Button->setInactiveGraphic(  PLUGIN_NAME::getIconPixmap( "48dBoff" ) );

	//LP filter type
	PixmapButton *lp12Button = new PixmapButton( this , NULL );
	mainLayout->addWidget( lp12Button, 2, 1 );
	lp12Button->setModel( m_parameterWidget->getBandModels( 7 )->lp12 );
	lp12Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "12dB" ) );
	lp12Button->setInactiveGraphic(  PLUGIN_NAME::getIconPixmap( "12dBoff" ) );

	PixmapButton *lp24Button = new PixmapButton( this , NULL );
	lp24Button->setModel( m_parameterWidget->getBandModels( 7 )->lp24 );
	lp24Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "24dB" ) );
	lp24Button->setInactiveGraphic(  PLUGIN_NAME::getIconPixmap( "24dBoff" ) );

	PixmapButton *lp48Button = new PixmapButton( this , NULL );
	lp48Button->setModel( m_parameterWidget->getBandModels( 7 )->lp48 );
	lp48Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "48dB" ) );
	lp48Button->setInactiveGraphic(  PLUGIN_NAME::getIconPixmap( "48dBoff" ) );

	// the curve has to change its appearance
	connect( m_parameterWidget->getBandModels( 0 )->hp12 , SIGNAL ( dataChanged() ), m_parameterWidget, SLOT( updateHandle()));
	connect( m_parameterWidget->getBandModels( 0 )->hp24 , SIGNAL ( dataChanged() ), m_parameterWidget, SLOT( updateHandle()));
	connect( m_parameterWidget->getBandModels( 0 )->hp48 , SIGNAL ( dataChanged() ), m_parameterWidget, SLOT( updateHandle()));

	connect( m_parameterWidget->getBandModels( 7 )->lp12 , SIGNAL ( dataChanged() ), m_parameterWidget, SLOT( updateHandle()));
	connect( m_parameterWidget->getBandModels( 7 )->lp24 , SIGNAL ( dataChanged() ), m_parameterWidget, SLOT( updateHandle()));
	connect( m_parameterWidget->getBandModels( 7 )->lp48 , SIGNAL ( dataChanged() ), m_parameterWidget, SLOT( updateHandle()));

	QVBoxLayout *hpGrpBtnLayout = new QVBoxLayout;
	hpGrpBtnLayout->addWidget( hp12Button );
	hpGrpBtnLayout->addWidget( hp24Button );
	hpGrpBtnLayout->addWidget( hp48Button );

	QVBoxLayout *lpGrpBtnLayout = new QVBoxLayout;
	lpGrpBtnLayout->addWidget( lp12Button );
	lpGrpBtnLayout->addWidget( lp24Button );
	lpGrpBtnLayout->addWidget( lp48Button );

	mainLayout->addLayout( hpGrpBtnLayout, 2, 1,  Qt::AlignCenter );
	mainLayout->addLayout( lpGrpBtnLayout, 2, 8,  Qt::AlignCenter );

	automatableButtonGroup *lpBtnGrp = new automatableButtonGroup(this,tr ( "lp grp" ) );
	lpBtnGrp->addButton( lp12Button );
	lpBtnGrp->addButton( lp24Button );
	lpBtnGrp->addButton( lp48Button );
	lpBtnGrp->setModel( &m_controls->m_lpTypeModel, false);

	automatableButtonGroup *hpBtnGrp = new automatableButtonGroup( this, tr( "hp grp" ) );
	hpBtnGrp->addButton( hp12Button );
	hpBtnGrp->addButton( hp24Button );
	hpBtnGrp->addButton( hp48Button );
	hpBtnGrp->setModel( &m_controls->m_hpTypeModel,false);

	mainLayout->setAlignment( Qt::AlignTop );

	for (int i = 0 ; i < 10; i++)
	{
		mainLayout->setColumnMinimumWidth(i, 50);
	}

	mainLayout->setAlignment( inGainFader, Qt::AlignHCenter );
	mainLayout->setAlignment( outGainFader, Qt::AlignHCenter );
	mainLayout->setRowMinimumHeight( 0,200 );
	mainLayout->setRowMinimumHeight( 1, 40 );
	mainLayout->setRowMinimumHeight(6,15);
	mainLayout->setContentsMargins( 0, 11, 0, 0 );
	mainLayout->setAlignment(inSpec, Qt::AlignCenter );
	mainLayout->setAlignment(outSpec, Qt::AlignCenter );

	QLabel *freqLabel = new QLabel( this );
	freqLabel->setText("- " + tr( "Frequency")+ " -" );
	freqLabel->move( 217 , 377 );

	QLabel *resLabel1 = new QLabel( this );
	resLabel1->setText("- " + tr( "Resonance")+ " -" );
	resLabel1->move( 62 , 444 );

	QLabel *resLabel2 = new QLabel( this );
	resLabel2->setText("- " + tr( "Resonance")+ " -" );
	resLabel2->move( 365 , 444 );

	QLabel *bandWidthLabel = new QLabel( this );
	bandWidthLabel->setText("- " + tr( "Bandwidth")+ " -" );
	bandWidthLabel->move( 215 , 444 );

	setLayout(mainLayout);
}
Ejemplo n.º 4
0
void RADIO::setBandFrequency(RADIO_BAND newBand, RADIO_FREQ newFreq) {
  setBand(newBand);
  setFrequency(newFreq);
} // setBandFrequency()
Ejemplo n.º 5
0
Archivo: main.c Proyecto: dl3yc/gHermes
/* ----------------------------------------------------------------------------*/
void buildMainUI() {
    GtkWidget* label;

    mainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title((GtkWindow*)mainWindow,"gHermes");
    gtk_widget_modify_bg(mainWindow,GTK_STATE_NORMAL,&background);
    g_signal_connect(G_OBJECT(mainWindow),"destroy",G_CALLBACK(quit),NULL);

    mainFixed=gtk_fixed_new();
    gtk_widget_modify_bg(mainFixed,GTK_STATE_NORMAL,&background);

    buttonExit = gtk_button_new_with_label ("Quit");
    gtk_widget_modify_bg(buttonExit, GTK_STATE_NORMAL, &buttonBackground);
    label=gtk_bin_get_child((GtkBin*)buttonExit);
    gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &white);
    gtk_widget_set_size_request(GTK_WIDGET(buttonExit),LARGE_BUTTON_WIDTH,BUTTON_HEIGHT);
    g_signal_connect(G_OBJECT(buttonExit),"clicked",G_CALLBACK(exitCallback),NULL);
    gtk_widget_show(buttonExit);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,buttonExit,2,0);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,buttonExit,5,0);
#endif

    buttonSetup = gtk_button_new_with_label ("Setup");
    gtk_widget_modify_bg(buttonSetup, GTK_STATE_NORMAL, &buttonBackground);
    label=gtk_bin_get_child((GtkBin*)buttonSetup);
    gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &white);
    gtk_widget_set_size_request(GTK_WIDGET(buttonSetup),LARGE_BUTTON_WIDTH,BUTTON_HEIGHT);
    g_signal_connect(G_OBJECT(buttonSetup),"clicked",G_CALLBACK(setupCallback),NULL);
    gtk_widget_show(buttonSetup);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,buttonSetup,82,0);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,buttonSetup,70,0);
#endif

#ifdef ALEX_TEST
    buttonTest = gtk_button_new_with_label ("Test");
    gtk_widget_modify_bg(buttonTest, GTK_STATE_NORMAL, &buttonBackground);
    label=gtk_bin_get_child((GtkBin*)buttonTest);
    gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &white);
    gtk_widget_set_size_request(GTK_WIDGET(buttonTest),LARGE_BUTTON_WIDTH,BUTTON_HEIGHT);
    g_signal_connect(G_OBJECT(buttonTest),"clicked",G_CALLBACK(testCallback),NULL);
    gtk_widget_show(buttonTest);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,buttonTest,162,0);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,buttonTest,140,0);
#endif
#endif

/*
    buttonTest = gtk_button_new_with_label ("DBTest");
    gtk_widget_modify_bg(buttonTest, GTK_STATE_NORMAL, &buttonBackground);
    label=gtk_bin_get_child((GtkBin*)buttonTest);
    gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &white);
    gtk_widget_set_size_request(GTK_WIDGET(buttonTest),LARGE_BUTTON_WIDTH,BUTTON_HEIGHT);
    g_signal_connect(G_OBJECT(buttonTest),"clicked",G_CALLBACK(dbTestCallback),NULL);
    gtk_widget_show(buttonTest);
    gtk_fixed_put((GtkFixed*)mainFixed,buttonTest,140,0);
*/

    // add the vfo window
    gtk_widget_show(vfoWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,vfoWindow,164,0);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,vfoWindow,210,0);
#endif

    // add the meter window
    gtk_widget_show(meterWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,meterWindow,878,0);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,meterWindow,1015,0);
#endif
    // add the mic_meter window
    gtk_widget_show(mic_meterWindow);
    gtk_fixed_put((GtkFixed*)mainFixed,mic_meterWindow,1015,80);

    // add the band window
    gtk_widget_show(bandWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,bandWindow,1,23);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,bandWindow,5,25);
#endif

    // add the mode window
    gtk_widget_show(modeWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,modeWindow,1,135);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,modeWindow,5,150);
#endif

    // add the filter window
    gtk_widget_show(filterWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,filterWindow,1,225);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,filterWindow,5,250);
#endif

    // add the audio window
    gtk_widget_show(audioWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,audioWindow,1,370);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,audioWindow,5,400);
#endif

    // add the agc window
    gtk_widget_show(agcWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,agcWindow,1,437);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,agcWindow,5,475);
#endif

    // add the preamp window
    gtk_widget_show(preampWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,preampWindow,1,483);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,preampWindow,5,525);
#endif

    // add the zoom window
    gtk_widget_show(zoomWindow);
    gtk_fixed_put((GtkFixed*)mainFixed,zoomWindow,1020,525);

    // add the volume window
    gtk_widget_show(volumeWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,volumeWindow,164,483);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,volumeWindow,5,575);
#endif

    // add the keyer window
    gtk_widget_show(keyerWindow);
    gtk_fixed_put((GtkFixed*)mainFixed,keyerWindow,210,525);

    // add the receiver window
    gtk_widget_show(receiverWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,receiverWindow,254,483);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,receiverWindow,5,635);
#endif


    // add the display window
    gtk_widget_show(displayWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,displayWindow,164,40);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,displayWindow,210,120);
#endif


    // add the bandscope display

    // add the transmit window
    gtk_widget_show(transmitWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,transmitWindow,344,483);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,transmitWindow,210,625);
#endif

    // add the subrx window
    gtk_widget_show(subrxWindow);
#ifdef NETBOOK
    gtk_fixed_put((GtkFixed*)mainFixed,subrxWindow,616,483);
#else
    gtk_fixed_put((GtkFixed*)mainFixed,subrxWindow,710,575);
#endif

#ifdef NETBOOK
    gtk_widget_set_size_request(GTK_WIDGET(mainFixed),1024,576);
#else
    gtk_widget_set_size_request(GTK_WIDGET(mainFixed),1180,700);
#endif
    gtk_widget_show(mainFixed);
    gtk_container_add(GTK_CONTAINER(mainWindow), mainFixed);

    //gtk_window_set_position((GtkWindow*)mainWindow,GTK_WIN_POS_MOUSE);
    gtk_window_move((GtkWindow*)mainWindow,mainRootX,mainRootY);

    gtk_widget_show(mainWindow);
  

    // set the band
    if(displayHF) {
        setBand(band);
    } else {
        setBand(xvtr_band);
    }

    // get the display and meter running
    newSpectrumUpdate();
    newMeterUpdate();
    //newBandscopeUpdate();
}
Ejemplo n.º 6
0
/* ----------------------------------------------------------------------------*/
int remoteSetBand(gpointer *data) {
    int band=*(int*)data;
    setBand(band);
    free(data);
    return 0;
}
Ejemplo n.º 7
0
/* ----------------------------------------------------------------------------*/
void selectBand(GtkWidget* widget) {
    GtkWidget* label;
    BANDSTACK_ENTRY* entry;
    XVTR_ENTRY* xvtr_entry;
    int current;

    resetSubRx();

    if(currentBandButton) {
        label=gtk_bin_get_child((GtkBin*)currentBandButton);
        gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &black);
        gtk_widget_modify_fg(label, GTK_STATE_PRELIGHT, &white);
    }
    label=gtk_bin_get_child((GtkBin*)widget);
    gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &buttonSelected);
    gtk_widget_modify_fg(label, GTK_STATE_PRELIGHT, &buttonSelected);

    //save current
    if(currentBandButton) {
        if(displayHF) {
            currentHFButton=currentBandButton;
            current=bandstack[band].current_entry;
            entry=&bandstack[band].entry[current];
            entry->frequencyA=frequencyA;
            entry->mode=mode;
            entry->filter=filter;
            entry->var1Low=filterVar1Low;
            entry->var1High=filterVar1High;
            entry->var2Low=filterVar2Low;
            entry->var2High=filterVar2High;
            entry->step=frequencyIncrement;
            entry->preamp=preamp;
            entry->spectrumHigh=spectrumMAX;
            entry->spectrumLow=spectrumMIN;
            entry->spectrumStep=spectrumSTEP;
            entry->waterfallHigh=waterfallHighThreshold;
            entry->waterfallLow=waterfallLowThreshold;
        } else {
            currentXVTRButton=currentBandButton;
            xvtr_entry=&xvtr[xvtr_band];
            xvtr_entry->rxFrequency=frequencyA;
            xvtr_entry->txFrequency=frequencyB;
            xvtr_entry->mode=mode;
            xvtr_entry->filter=filter;
            xvtr_entry->var1Low=filterVar1Low;
            xvtr_entry->var1High=filterVar1High;
            xvtr_entry->var2Low=filterVar2Low;
            xvtr_entry->var2High=filterVar2High;
            xvtr_entry->step=frequencyIncrement;
            xvtr_entry->preamp=preamp;
            xvtr_entry->spectrumHigh=spectrumMAX;
            xvtr_entry->spectrumLow=spectrumMIN;
            xvtr_entry->spectrumStep=spectrumSTEP;
            xvtr_entry->waterfallHigh=waterfallHighThreshold;
            xvtr_entry->waterfallLow=waterfallLowThreshold;
        }
    }

    if(widget==buttonBand14) {
        // XVTR / HF
        displayHF=!displayHF;
        if(displayHF) {
            currentBandButton=NULL;
            setHFTitles();
            setBand(band);
            //selectBand(currentHFButton);
        } else {
            currentBandButton=NULL;
            setXVTRTitles();
            setBand(xvtr_band);
            //selectBand(currentXVTRButton);
        }
    } else {
        if(displayHF) {
            setLOFrequency(0LL);
            if(currentBandButton==widget) {
                bandstack[band].current_entry++;
                if(bandstack[band].current_entry>=bandstack[band].entries) {
                    bandstack[band].current_entry=0;
                }
            } else {
                currentBandButton=widget;
                if(widget==buttonBand1) {
                    band=band160;
                } else if(widget==buttonBand2) {
                    band=band80;
                } else if(widget==buttonBand3) {
                    band=band60;
                } else if(widget==buttonBand4) {
                    band=band40;
                } else if(widget==buttonBand5) {
                    band=band30;
                } else if(widget==buttonBand6) {
                    band=band20;
                } else if(widget==buttonBand7) {
                    band=band17;
                } else if(widget==buttonBand8) {
                    band=band15;
                } else if(widget==buttonBand9) {
                    band=band12;
                } else if(widget==buttonBand10) {
                    band=band10;
                } else if(widget==buttonBand11) {
                    band=band6;
                } else if(widget==buttonBand12) {
                    band=bandGen;
                } else if(widget==buttonBand13) {
                    band=bandWWV;
                } else if(widget==buttonBand14) {
                    band=bandXVTR;
                }
            }

            current=bandstack[band].current_entry;
            entry=&bandstack[band].entry[current];

            {
                int *m=malloc(sizeof(int));
                *m=entry->mode;
                setMode(m);
            }
            filterVar1Low=entry->var1Low;
            filterVar1High=entry->var1High;
            filterVar2Low=entry->var2Low;
            filterVar2High=entry->var2High;
            setFilter(entry->filter);
            {
                long long *f=malloc(sizeof(long long));
                *f=entry->frequencyA;
                setAFrequency(f);
            }
            setIncrement(entry->step);

            //setPreamp(entry->preamp);
            forcePreamp(entry->preamp);

            spectrumMAX=entry->spectrumHigh;
            spectrumMIN=entry->spectrumLow;
            spectrumSTEP=entry->spectrumStep;
            waterfallHighThreshold=entry->waterfallHigh;
            waterfallLowThreshold=entry->waterfallLow;
        } else {
            currentBandButton=widget;

            if(widget==buttonBand1) {
                xvtr_band=band160;
            } else if(widget==buttonBand2) {
                xvtr_band=band80;
            } else if(widget==buttonBand3) {
                xvtr_band=band60;
            } else if(widget==buttonBand4) {
                xvtr_band=band40;
            } else if(widget==buttonBand5) {
                xvtr_band=band30;
            } else if(widget==buttonBand6) {
                xvtr_band=band20;
            } else if(widget==buttonBand7) {
                xvtr_band=band17;
            } else if(widget==buttonBand8) {
                xvtr_band=band15;
            } else if(widget==buttonBand9) {
                xvtr_band=band12;
            } else if(widget==buttonBand10) {
                xvtr_band=band10;
            } else if(widget==buttonBand11) {
                xvtr_band=band6;
            } else if(widget==buttonBand12) {
                xvtr_band=bandGen;
            }

            xvtr_entry=&xvtr[xvtr_band];
            {
                int *m=malloc(sizeof(int));
                *m=xvtr_entry->mode;
                setMode(m);
            }
            filterVar1Low=xvtr_entry->var1Low;
            filterVar1High=xvtr_entry->var1High;
            filterVar2Low=xvtr_entry->var2Low;
            filterVar2High=xvtr_entry->var2High;
            setFilter(xvtr_entry->filter);
            setLOFrequency(xvtr_entry->rxFrequencyLO);
            {
                long long *f=malloc(sizeof(long long));
                *f=xvtr_entry->rxFrequency;
                setAFrequency(f);
            }
            setIncrement(xvtr_entry->step);

            //setPreamp(xvtr_entry->preamp);
            forcePreamp(xvtr_entry->preamp);

            spectrumMAX=xvtr_entry->spectrumHigh;
            spectrumMIN=xvtr_entry->spectrumLow;
            spectrumSTEP=xvtr_entry->spectrumStep;
            waterfallHighThreshold=xvtr_entry->waterfallHigh;
            waterfallLowThreshold=xvtr_entry->waterfallLow;

        }
    }
}