Core::IUAVGadget* ScopeGadgetFactory::createGadget(QWidget *parent)
{
    ScopeGadgetWidget* gadgetWidget = new ScopeGadgetWidget(parent);
    connect(this,SIGNAL(onStartPlotting()), gadgetWidget, SLOT(startPlotting()));
    connect(this,SIGNAL(onStopPlotting()), gadgetWidget, SLOT(stopPlotting()));
    return new ScopeGadget(QString("ScopeGadget"), gadgetWidget, parent);
}
Beispiel #2
0
ScopeGadgetWidget::ScopeGadgetWidget(QWidget *parent) : QwtPlot(parent)
{
	setMouseTracking(true);
//	canvas()->setMouseTracking(true);

    //Setup the timer that replots data
    replotTimer = new QTimer(this);
    connect(replotTimer, SIGNAL(timeout()), this, SLOT(replotNewData()));

    // Listen to telemetry connection/disconnection events, no point in
    // running the scopes if we are not connected and not replaying logs.
    // Also listen to disconnect actions from the user
    Core::ConnectionManager *cm = Core::ICore::instance()->connectionManager();
    connect(cm, SIGNAL(deviceAboutToDisconnect()), this, SLOT(stopPlotting()));
    connect(cm, SIGNAL(deviceConnected(QIODevice*)), this, SLOT(startPlotting()));

    m_csvLoggingStarted=0;
    m_csvLoggingEnabled=0;
    m_csvLoggingHeaderSaved=0;
    m_csvLoggingDataSaved=0;
    m_csvLoggingDataUpdated=0;
    m_csvLoggingNameSet=0;
    m_csvLoggingConnected=0;
    m_csvLoggingNewFileOnConnect=0;
    m_csvLoggingPath = QString("./csvlogging/");
    m_csvLoggingStartTime = QDateTime::currentDateTime();

    //Listen to autopilot connection events
    connect(cm, SIGNAL(deviceAboutToDisconnect()), this, SLOT(csvLoggingDisconnect()));
    connect(cm, SIGNAL(deviceConnected(QIODevice*)), this, SLOT(csvLoggingConnect()));
}
Beispiel #3
0
void LoggingGadgetWidget::setPlugin(LoggingPlugin * p)
{
    loggingPlugin = p;
    connect(p,SIGNAL(stateChanged(QString)),this,SLOT(stateChanged(QString)));
    connect(m_logging->playButton,SIGNAL(clicked()),p->getLogfile(),SLOT(resumeReplay()));
    connect(m_logging->playButton, SIGNAL(clicked()), scpPlugin, SLOT(startPlotting()));
    connect(m_logging->pauseButton,SIGNAL(clicked()),p->getLogfile(),SLOT(pauseReplay()));
    connect(m_logging->pauseButton, SIGNAL(clicked()), scpPlugin, SLOT(stopPlotting()));
    connect(m_logging->playbackSpeedSpinBox,SIGNAL(valueChanged(double)),p->getLogfile(),SLOT(setReplaySpeed(double)));
    connect(m_logging->jumpToTimeSpinBox,SIGNAL(valueChanged(double)),p->getLogfile(),SLOT(setReplayTime(double)));

    void pauseReplay();
    void resumeReplay();
}