//---------------------------------------------------------------------------
void JrkPlotDialog::onFinished(int)
{
    if(plot_timer->isActive())
        on_stopButton_clicked();

    //qDebug("JrkPlotDialog::onFinished");
}
Ejemplo n.º 2
0
void MainWindow::on_resetButton_clicked()
{
    on_stopButton_clicked();
    usleep(10000);
    core->reset();
    showInfo();
}
Ejemplo n.º 3
0
void MainWindow::createActions()
{
    m_playPauseAction = new QAction( tr( "Play\\Pause" ), this );
    connect( m_playPauseAction, SIGNAL( triggered() ),
             this, SLOT( on_startPauseButton_clicked() ) );

    m_stopAction = new QAction( tr( "Stop" ), this );
    connect( m_stopAction, SIGNAL( triggered() ),
             this, SLOT( on_stopButton_clicked() ) );

    m_muteAction = new QAction( tr( "Mute" ), this );
    connect( m_muteAction, SIGNAL( triggered() ),
             this, SLOT( on_soundButton_clicked() ) );

    m_backAction = new QAction( tr( "Back" ), this );
    connect( m_backAction, SIGNAL( triggered() ),
             this, SLOT( on_backButton_clicked() ) );

    m_nextAction = new QAction( tr( "Next" ), this );
    connect( m_nextAction, SIGNAL( triggered() ),
             this, SLOT( on_nextButton_clicked() ) );

    m_minimizeAction = new QAction( tr( "Mi&nimize" ), this );
    connect( m_minimizeAction, SIGNAL( triggered() ),
             this, SLOT( hide() ) );

    m_maximizeAction = new QAction( tr( "Ma&ximize" ), this );
    connect( m_maximizeAction, SIGNAL( triggered() ),
             this, SLOT( showMaximized() ) );
}
Ejemplo n.º 4
0
void MainWindow::stopRecordingCall()
{
  // If we are recording a call, consider this the equivalent of hitting
  // the "stop" button.
  if (myGst->currentlyRecordingCall())
  {
    on_stopButton_clicked();
  }
}
Ejemplo n.º 5
0
int DriveWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: statusChanged((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 1: on_maxSpeedSlider_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 2: on_maxSpeedBox_valueChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 3: on_inStrafeModeBox_clicked(); break;
        case 4: on_stallCurrentBox_valueChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 5: on_directionDivisorBox_valueChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 6: on_useCurveBox_clicked(); break;
        case 7: on_dirScaleBox_valueChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 8: on_speedScaleBox_valueChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 9: on_pwmModeBox_clicked(); break;
        case 10: on_joystickDevName_currentIndexChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 11: on_reopenJsButton_clicked(); break;
        case 12: on_rescanJsButton_clicked(); break;
        case 13: on_joystickProfileBox_currentIndexChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 14: on_enableWatchdogBox_clicked(); break;
        case 15: on_sendCmdButton_clicked(); break;
        case 16: on_startTimingButton_clicked(); break;
        case 17: on_stopButton_clicked(); break;
        case 18: on_sendNumbersButton_clicked(); break;
        case 19: on_sendTestMsg_clicked(); break;
        case 20: gotWirelessMessage((*reinterpret_cast< QByteArray(*)>(_a[1]))); break;
        case 21: gotMotorStatusUpdate((*reinterpret_cast< QByteArray(*)>(_a[1]))); break;
        case 22: gotWatchdogTimeout((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 23: strafeModeChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 24: slowModeButtonToggled(); break;
        case 25: sendMessageTimer(); break;
        case 26: timingTimeout(); break;
        case 27: gotPassthroughMessage((*reinterpret_cast< QByteArray(*)>(_a[1]))); break;
        case 28: gotTimeoutData((*reinterpret_cast< QByteArray(*)>(_a[1]))); break;
        case 29: gotMotorCurrentData((*reinterpret_cast< QByteArray(*)>(_a[1]))); break;
        case 30: gotRoverDataErrorCount((*reinterpret_cast< QByteArray(*)>(_a[1]))); break;
        case 31: on_getCurrentButton_clicked(); break;
        default: ;
        }
        _id -= 32;
    }
    return _id;
}
Ejemplo n.º 6
0
int Schachuhr::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: on_stopButton_clicked(); break;
        case 1: on_quitButton_clicked(); break;
        case 2: on_clearButton_clicked(); break;
        case 3: on_player2Button_clicked(); break;
        case 4: on_player1Button_clicked(); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
//---------------------------------------------------------------------------
void JrkPlotDialog::on_settingsButton_clicked()
{
    bool running = plot_timer->isActive();
    bool changed = false;

    if(running)
        plot_timer->stop();

    JrkPlotSettingsDialog dlg(this);
    if(dlg.exec() == QDialog::Accepted)
        changed = true;

    if(running) {
        if(changed)
            on_stopButton_clicked(); // reset
        else
            plot_timer->start(); // continue
    }
}
Ejemplo n.º 8
0
ControlBar::ControlBar( QWidget* parent )
	: QToolBar( parent )
	, _startButton( new QPushButton( "Start", this ) )
	, _stopButton( new QPushButton( "Stop", this ) )
	, _beltSelector( new QSpinBox( this ) )
{
	setMinimumSize( 200, 46 );
	setFloatable( false );
	setMovable( false );

	addWidget( _startButton );
	addWidget( _stopButton );
	addWidget( _beltSelector );

	_stopButton->setEnabled( false );

	bool ok;
	ok = connect( _startButton, SIGNAL( clicked() ), SLOT( on_startButton_clicked() ) );
	Q_ASSERT( ok );

	ok = connect( _stopButton, SIGNAL( clicked() ), SLOT( on_stopButton_clicked() ) );
	Q_ASSERT( ok );
}
Ejemplo n.º 9
0
void MainWindow::slotReceiveData(const QByteArray &data)
{
    QString text( data );

    if ( text == QString( "DADA01" ) ) {
        on_startPauseButton_clicked();
    } else if ( text == QString( "DADA02" ) ) {
        on_stopButton_clicked();
    } else if ( text == QString( "DADA03" ) ) {
        on_backButton_clicked();
    } else if ( text == QString( "DADA04" ) ) {
        on_nextButton_clicked();
    } else if ( text == QString( "DADA05" ) ) {
        on_soundButton_clicked();
    } else if ( text == QString( "DADA06" ) ) {
        on_volumeUpButton_clicked();
    } else if ( text == QString( "DADA07" ) ) {
        on_volumeDownButton_clicked();
    } else {
        QString message( "Error: unknown command from the COM-port" );
        QMessageBox::information( this, tr( "Error" ), message );
    }
}
Ejemplo n.º 10
0
//---------------------------------------------------------------------------
void JrkPlotDialog::run(void)
{
    if(!plot_timer->isActive())
        on_stopButton_clicked();
}
Ejemplo n.º 11
0
void MainWindow::callOptionDialog (QVector<ConsoleInterface::optionDialogEntry> * options,bool * ret)
{
if (options->isEmpty()) return;

QVectorIterator<ConsoleInterface::optionDialogEntry> it(*options);

QDialog * d = new QDialog(this);

d->setModal(true);

QVBoxLayout * dbl = new QVBoxLayout();
d->setLayout(dbl);

QList <QWidget * > ents;

QHBoxLayout * sl;
QLabel * l;
QLineEdit * lew;
QCheckBox * chw;
QComboBox * cbl;

for(int i=0;i< (*options).size();i++)
{
sl = new QHBoxLayout();
l = new QLabel(d);
l->setText(it.next().text);
sl->addWidget(l);

if((*options)[i].type == ConsoleInterface::OPT_DEC)
{
    lew = new QLineEdit(d);
    lew->setValidator(new QIntValidator( d ));
    QString s;
    s.setNum((*options)[i].valueInt);
    lew->setText(s);
    sl->addWidget(lew);
    ents.append(lew);
}

if((*options)[i].type == ConsoleInterface::OPT_HEX)
{
    lew = new QLineEdit(d);
    lew->setValidator(new QRegExpValidator(QRegExp("([A-Fa-f0-9][A-Fa-f0-9])+"),d));
    QString s;
    s.setNum((*options)[i].valueInt,16);
    lew->setText(s);
    sl->addWidget(lew);
    ents.append(lew);
}

if((*options)[i].type == ConsoleInterface::OPT_STR)
{
    lew = new QLineEdit(d);
    lew->setValidator(NULL);
    QString s = (*options)[i].valueStr;
    lew->setText(s);
    sl->addWidget(lew);
    ents.append(lew);
}


if((*options)[i].type == ConsoleInterface::OPT_CHK)
{
    chw = new QCheckBox(d);
    chw->setChecked((*options)[i].valueInt == 0 ? false : true);
    sl->addWidget(chw);
    ents.append(chw);
}


if((*options)[i].type == ConsoleInterface::OPT_LIST)
{
cbl = new QComboBox(d);
cbl->addItems((*options)[i].variants);
sl->addWidget(cbl);
ents.append(cbl);
}




dbl->addLayout(sl);


}


QHBoxLayout * hbl = new QHBoxLayout(d);

QPushButton * obOK = new QPushButton(tr("OK"),d);
QPushButton * obCancel = new QPushButton(tr("Cancel"),d);
QPushButton * obAbort = new QPushButton(tr("Abort"),d);

connect(obOK,SIGNAL(clicked()),d,SLOT(accept()));
connect(obCancel,SIGNAL(clicked()),d,SLOT(reject()));
connect(obAbort,SIGNAL(clicked()),d,SLOT(reject()));
connect(obAbort,SIGNAL(clicked()),this,SLOT(on_stopButton_clicked()),Qt::QueuedConnection);

hbl->addStretch(10);
hbl->addWidget(obOK);
hbl->addWidget(obCancel);
hbl->addWidget(obAbort);

dbl->addLayout(hbl);


if(d->exec()==QDialog::Accepted)
{

    for(int i=0;i< (*options).size();i++)
    {
        if((*options)[i].type == ConsoleInterface::OPT_DEC)
        {
            (*options)[i].valueInt  = dynamic_cast<QLineEdit*>(ents[i])->text().toInt();
        }

        if((*options)[i].type == ConsoleInterface::OPT_HEX)
        {
            (*options)[i].valueInt  = dynamic_cast<QLineEdit*>(ents[i])->text().toInt(0,16);
        }

        if((*options)[i].type == ConsoleInterface::OPT_STR)
        {
            QString t =  dynamic_cast<QLineEdit*>(ents[i])->text();
            (*options)[i].valueStr  = t;
        }


        if((*options)[i].type == ConsoleInterface::OPT_CHK)
        {
            (*options)[i].valueInt  = dynamic_cast<QCheckBox*>(ents[i])->isChecked();
        }


        if((*options)[i].type == ConsoleInterface::OPT_LIST)
        {
            (*options)[i].valueInt  = dynamic_cast<QComboBox*>(ents[i])->currentIndex();
        }
    }

*ret =true;
}
else
{
*ret =false;
}



delete d;
}
Ejemplo n.º 12
0
void MainWindow::stopPlaying()
{
  // For now, this will be identical to hitting the "stop" button, although
  // it might be more akin to "pause"...
  on_stopButton_clicked();
}