X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=mainwindow.cpp;h=50847e2ac1268108b48ee1a0945c28966a39fcda;hp=d85c0a40e46e0604690cb62ab6ea5eefec04d11a;hb=274d4f133825cddfc6a42438dd47899db20c7d97;hpb=2953961c06ff9e758035ba3cd67220568bd01710 diff --git a/mainwindow.cpp b/mainwindow.cpp index d85c0a40..50847e2a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -28,6 +28,8 @@ extern "C" { #include "mainwindow.h" #include "ui_mainwindow.h" +#include "samplingbar.h" +#include "sigview.h" extern "C" { /* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */ @@ -44,6 +46,14 @@ MainWindow::MainWindow(QWidget *parent) : ui(new Ui::MainWindow) { ui->setupUi(this); + + _sampling_bar = new SamplingBar(this); + connect(_sampling_bar, SIGNAL(run_stop()), this, + SLOT(run_stop())); + addToolBar(_sampling_bar); + + view = new SigView(session, this); + ui->verticalLayout->addWidget(view); } MainWindow::~MainWindow() @@ -64,3 +74,10 @@ void MainWindow::on_actionAbout_triggered() About dlg(this); dlg.exec(); } + +void MainWindow::run_stop() +{ + session.start_capture( + _sampling_bar->get_selected_device(), + _sampling_bar->get_sample_rate()); +}