示例#1
0
void MainWindow::SetConnects()
{
	connect( actionNew_File, SIGNAL(triggered()), this, SLOT(NewFileSlot()) );
	connect( actionOpen_File, SIGNAL(triggered()), this, SLOT(OpenFileSlot()) );
	connect( actionRecent_Files, SIGNAL(triggered()), this, SLOT(OpenFileSlot()) );
	connect( actionSave, SIGNAL(triggered()), this, SLOT(SaveSlot()) );
	connect( actionSave_As, SIGNAL(triggered()), this, SLOT(SaveAsSlot()) );
	connect( actionExit, SIGNAL(triggered()), this, SLOT(ExitSlot()) );
	connect( actionUndo, SIGNAL(triggered()), this, SLOT(UndoSlot()) );
	connect( actionRecover, SIGNAL(triggered()), this, SLOT(RecoverSlot()) );
	connect( actionCut, SIGNAL(triggered()), this, SLOT(CutSlot()) );
	connect( actionCopy, SIGNAL(triggered()), this, SLOT(CopySlot()) );
	connect( actionPast, SIGNAL(triggered()), this, SLOT(PastSlot()) );
	connect( actionClose, SIGNAL(triggered()), this, SLOT(CloseSlot()) );
	connect( actionClose_All_Windows, SIGNAL(triggered()), this, SLOT(CloseAllWindowSlot()) );
	//connect( actionTile, SIGNAL(triggered()), this, SLOT(TileWidowsSlot()) );
	//connect( actionStack, SIGNAL(triggered()), this, SLOT(StackUpWindowsSlot()) );
	connect( actionNext_Window, SIGNAL(triggered()), this, SLOT(NextWindowSlot()) );
	connect( actionPrevious_Window, SIGNAL(triggered()), this, SLOT(PreviousWindowsSlot()) );
	connect( actionAbout, SIGNAL(triggered()), this, SLOT(AboutSlot()) );
	connect( actionAbout_Qt, SIGNAL(triggered()), this, SLOT(AboutQtSlot()) );
	
}
示例#2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //create the modulators, varicode encoder pipe, and serial ppt
    varicodepipeencoder = new VariCodePipeEncoder(this);
    audiomskmodulator = new AudioMskModulator(this);
    ddsmskmodulator = new DDSMSKModulator(this);
    serialPPT = new SerialPPT(this);

    //create settings dialog. only some modulator settings are held atm.
    settingsdialog = new SettingsDialog(this);

    //create the demodulator
    audiomskdemodulator = new AudioMskDemodulator(this);

    //create a udp socket and a varicode decoder pipe
    udpsocket = new QUdpSocket(this);
    varicodepipedecoder = new VariCodePipeDecoder(this);

    //create a beacon handler
    beaconhandler = new BeaconHandler(this);

    //create somthing to rewrite text in the tx window
    textreplacement = new TextReplacement(this);
    textreplacement->setPlainTextEdit(ui->inputwidget);

    //create a webscraper
    webscraper = new WebScraper(this);
    webscraper->setTextReplacementMap(textreplacement->textmap);

    //default sink is the varicode input of the console
    audiomskdemodulator->ConnectSinkDevice(ui->console->varicodeconsoledevice);

    //console setup
    ui->console->setEnabled(true);
    ui->console->setLocalEchoEnabled(true);

    //statusbar setup
    freqlabel = new QLabel();
    ebnolabel = new QLabel();
    ui->statusBar->addPermanentWidget(new QLabel());
    ui->statusBar->addPermanentWidget(freqlabel);
    ui->statusBar->addPermanentWidget(ebnolabel);

    //led setup
    ui->ledvolume->setLED(QIcon::Off);
    ui->ledsignal->setLED(QIcon::Off);

    //connections
    connect(audiomskdemodulator, SIGNAL(Plottables(double,double,double)),              this,SLOT(PlottablesSlot(double,double,double)));
    connect(audiomskdemodulator, SIGNAL(SignalStatus(bool)),                            this,SLOT(SignalStatusSlot(bool)));
    connect(audiomskdemodulator, SIGNAL(WarningTextSignal(QString)),                    this,SLOT(WarningTextSlot(QString)));
    connect(audiomskdemodulator, SIGNAL(EbNoMeasurmentSignal(double)),                  this,SLOT(EbNoSlot(double)));
    connect(audiomskdemodulator, SIGNAL(PeakVolume(double)),                            this, SLOT(PeakVolumeSlot(double)));
    connect(audiomskdemodulator, SIGNAL(OrgOverlapedBuffer(QVector<double>)),           ui->spectrumdisplay,SLOT(setFFTData(QVector<double>)));
    connect(audiomskdemodulator, SIGNAL(Plottables(double,double,double)),              ui->spectrumdisplay,SLOT(setPlottables(double,double,double)));
    connect(audiomskdemodulator, SIGNAL(SampleRateChanged(double)),                     ui->spectrumdisplay,SLOT(setSampleRate(double)));
    connect(audiomskdemodulator, SIGNAL(ScatterPoints(QVector<cpx_type>)),              ui->scatterplot,SLOT(setData(QVector<cpx_type>)));
    connect(ui->spectrumdisplay, SIGNAL(CenterFreqChanged(double)),                     audiomskdemodulator,SLOT(CenterFreqChangedSlot(double)));
    connect(ui->action_About,    SIGNAL(triggered()),                                   this, SLOT(AboutSlot()));
    connect(audiomskdemodulator, SIGNAL(SignalStatus(bool)),                            beaconhandler,SLOT(SignalStatus(bool)));

    //load settings
    QSettings settings("Jontisoft", "JMSK");
    ui->comboBoxafc->setCurrentIndex(settings.value("comboBoxafc",0).toInt());
    ui->comboBoxsql->setCurrentIndex(settings.value("comboBoxsql",0).toInt());
    ui->comboBoxbps->setCurrentIndex(settings.value("comboBoxbps",0).toInt());
    ui->comboBoxlbw->setCurrentIndex(settings.value("comboBoxlbw",0).toInt());
    ui->comboBoxdisplay->setCurrentIndex(settings.value("comboBoxdisplay",0).toInt());
    ui->actionConnectToUDPPort->setChecked(settings.value("actionConnectToUDPPort",false).toBool());
    ui->actionRawOutput->setChecked(settings.value("actionRawOutput",false).toBool());
    double tmpfreq=settings.value("freq_center",1000).toDouble();
    ui->inputwidget->setPlainText(settings.value("inputwidget","").toString());

    //set audio msk demodulator settings and start
    on_comboBoxafc_currentIndexChanged(ui->comboBoxafc->currentText());
    on_comboBoxsql_currentIndexChanged(ui->comboBoxsql->currentText());
    on_comboBoxbps_currentIndexChanged(ui->comboBoxbps->currentText());
    on_comboBoxlbw_currentIndexChanged(ui->comboBoxlbw->currentText());
    on_comboBoxdisplay_currentIndexChanged(ui->comboBoxdisplay->currentText());
    on_actionConnectToUDPPort_toggled(ui->actionConnectToUDPPort->isChecked());
    audiomskdemodulatorsettings.freq_center=tmpfreq;
    audiomskdemodulator->setSettings(audiomskdemodulatorsettings);
    audiomskdemodulator->start();

//start modulator setup. the modulator is new and is and add on.

    //connections for replacing text
    connect(audiomskmodulator,SIGNAL(statechanged(bool)),textreplacement,SLOT(onstatechange(bool)));
    connect(ddsmskmodulator,SIGNAL(statechanged(bool)),textreplacement,SLOT(onstatechange(bool)));

    //connect the encoder to the text widget. the text encoder to the modulator gets done later
    varicodepipeencoder->ConnectSourceDevice(ui->inputwidget->textinputdevice);

    //always connected
    //connect(ui->actionTXRX,SIGNAL(triggered(bool)),ui->inputwidget,SLOT(reset()));//not needed
    connect(ui->actionIdleTX,SIGNAL(triggered(bool)),ui->inputwidget->textinputdevice,SLOT(setIdle_on_eof(bool)));
    connect(ui->actionClearTXWindow,SIGNAL(triggered(bool)),ui->inputwidget,SLOT(clear()));
    connect(ui->actionBeacon,SIGNAL(triggered(bool)),beaconhandler,SLOT(StartStop(bool)));

    //set modulator settings and connections

    settingsdialog->populatesettings();
    modulatordevicetype=settingsdialog->modulatordevicetype;
    connectmodulatordevice(modulatordevicetype);
    setSerialUser(modulatordevicetype);

    //set audio msk modulator settings
    audiomskmodulatorsettings.freq_center=settingsdialog->audiomskmodulatorsettings.freq_center;//this is the only one that gets set
    audiomskmodulatorsettings.secondsbeforereadysignalemited=settingsdialog->audiomskmodulatorsettings.secondsbeforereadysignalemited;//well there is two now
    ui->inputwidget->textinputdevice->preamble1=settingsdialog->Preamble1;
    ui->inputwidget->textinputdevice->preamble2=settingsdialog->Preamble2;
    ui->inputwidget->textinputdevice->postamble=settingsdialog->Postamble;
    ui->inputwidget->reset();
    serialPPT->setPPT(ui->actionTXRX->isChecked());
    audiomskmodulator->setSettings(audiomskmodulatorsettings);

    //set JDDS msk modulator settings
    ddsmskmodulatorsettings.fb=audiomskmodulatorsettings.fb;
    ddsmskmodulatorsettings.freq_center=audiomskmodulatorsettings.freq_center;
    ddsmskmodulatorsettings.secondsbeforereadysignalemited=audiomskmodulatorsettings.secondsbeforereadysignalemited;
    ddsmskmodulator->setSettings(ddsmskmodulatorsettings);

    //set beacon handler settings
    beaconhandlersettings.beaconminidle=settingsdialog->beaconminidle;
    beaconhandlersettings.beaconmaxidle=settingsdialog->beaconmaxidle;
    beaconhandler->setSettings(beaconhandlersettings);

    //load scrapings to the webscraper and start the scraper
    webscraper->setScrapeMap(settingsdialog->scrapemapcontainer);
    if(settingsdialog->scrapeingenabled)webscraper->start();

//--end modulator setup


}