RealTimePlotWindow::RealTimePlotWindow(QWidget *parent) :
    QMainWindow(parent),
    keyCounter(0),
    wait(0),
    MPS(0),
   // dialogWindow(0),
    measurementState(false),
    triger(false),
    ui(new Ui::RealTimePlotWindow)
{
    ui->setupUi(this);

    setWindowTitle("SkateboardAnalyzer v0.5 measuring");
    setWindowIcon(QIcon(":/skate"));

    //--------------SETS VARIABLES--------------//
    dialogWindow = new DialogWindow(this);
    instValWindow = new instValuesWindow(this);
    saveGraphWindow = new SaveGraphWindow(this);

    timer = new QTimer(this);
    timer->start(200);

    instValues = new QVector<double> (10);

    //---------------------------------------------------//
    //-----------------CONNECTS--------------------------//
    //---------------------------------------------------//
    //buttons
  //  connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(close()));
    connect(ui->terminalButton, SIGNAL(clicked()), SLOT(onTerminalButton()));
    connect(ui->instantValuesButton, SIGNAL(clicked()), SLOT(onInstButton()));

    connect(ui->stopButton, SIGNAL(clicked()), SLOT(onStopButton()));
    connect(ui->startButton, SIGNAL(clicked()), SLOT(onStartButton()));

    connect(saveGraphWindow, SIGNAL(putGraphsAsPNG(QString)),this, SLOT(saveAsPNG(QString)));
    connect(saveGraphWindow, SIGNAL(putGraphsAsBMP(QString)),this, SLOT(saveAsBMP(QString)));
    connect(saveGraphWindow, SIGNAL(putGraphsAsPDF(QString)),this, SLOT(saveAsPDF(QString)));
    connect(saveGraphWindow, SIGNAL(putGraphsAsJPG(QString)),this, SLOT(saveAsJPG(QString)));

    connect(ui->saveGraphButton, SIGNAL(clicked()), SLOT(onSaveGraphButton()));

    //dialog window
    connect(dialogWindow, SIGNAL(dataAvaible(QByteArray)), this, SLOT(dataAvaible(QByteArray)));
    //timers
    connect(timer, SIGNAL(timeout()), this, SLOT(onTimer()));


    //--------------ON PLOTS-----------------//
     ui->accPlot->replot();
     ui->gyroPlot->replot();
     startGraph(ui->accPlot, ui->gyroPlot/*, ui->an_gyroPlot*/);
}
示例#2
0
void AVTDShowGraph::CaptureLive(int theIndex, unsigned theInputPinNumber)
{
    _myAVTCameraIndex = theIndex;
    destroyFilterGraph();
    if (createFilterGraph(0, theInputPinNumber)) {
        startGraph();
        this->m_fstartGraph = true;
    } else {
        destroyFilterGraph();
        AC_ERROR << "Unable to build Filter Graph";
    }
}