Esempio n. 1
0
void evitementObstacle(InfoMvt *infoMvt) {
    if (getDistance(!(infoMvt->sensMvt)) > DISTANCE_PROXIMITE) { // On peut manœvrer
        // On recule, on se tourne de 90° et on avance
        //        Angle currentAlpha = getAlphaAbs();

        sendDelta(-DISTANCE_EVITEMENT);
        sendAlpha(90);
        if (getDistance(infoMvt->sensMvt) > DISTANCE_PROXIMITE) {
            sendDelta(+DISTANCE_EVITEMENT);
        } else {
            // On est un peu coinsé !
        }
    } else {
        // On tourne sur place
        sendAlpha(45);
        if (getDistance(infoMvt->sensMvt) > DISTANCE_PROXIMITE) {
            pause_ms(1000);
        }
    }
}
Esempio n. 2
0
void IsoSurfaceDialog::extractAlpha(QColor color)
{
    emit sendAlpha(color.alpha());
}
Esempio n. 3
0
/*!
 * \brief MainWindow::MainWindow
 * \param parent
 */
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent),
      ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ui->stopButton->hide();

    ui->qwtPlot->setTitle("Error");
    ui->qwtPlot->setAxisTitle(ui->qwtPlot->xBottom, "Epoch");
    ui->qwtPlot->setAxisTitle(ui->qwtPlot->yLeft,"Error");
    ui->qwtPlot->setAxisAutoScale( ui->qwtPlot->xBottom, true );
    ui->qwtPlot->setAxisAutoScale( ui->qwtPlot->yLeft, true );
    ui->stopButton->setVisible( false );
    ui->saveButton->setVisible( false );
    zoom = new QwtPlotZoomer(ui->qwtPlot->canvas());
    zoom->setRubberBandPen(QPen(Qt::white));
    QPen pen = QPen( Qt::red );
    curve.setRenderHint( QwtPlotItem::RenderAntialiased );
    curve.setPen( pen );
    curve.attach( ui->qwtPlot );
    sendAlpha();

    // INFO connect ui to mainwindow
    {
        QObject::connect( ui->saveImageButton, SIGNAL( clicked() ),
                          this, SLOT( saveImage() ) );
       QObject::connect( ui->inputOpenButton, SIGNAL( clicked() ),
                          this, SLOT( openInputFile() ) );
        QObject::connect( ui->saveButton, SIGNAL( clicked() ),
                          this, SLOT( openOutputFile() ) );
        QObject::connect( ui->startButton, SIGNAL( clicked() ),
                          this, SLOT( start() ) );
        QObject::connect( ui->startButton, SIGNAL( clicked( bool ) ),
                          ui->stopButton, SLOT( setVisible(bool) ) );
        QObject::connect( ui->alphaMantiss, SIGNAL( valueChanged( double ) ),
                          this, SLOT( sendAlpha() ) );
        QObject::connect( ui->alphaDegree, SIGNAL( valueChanged( int ) ),
                          this, SLOT( sendAlpha() ) );
    }

    // INFO connectio ui to ui
    {
        QObject::connect(ui->startButton,SIGNAL(clicked()),ui->stopButton,SLOT(show()));
    }
//    /* INFO connection ui to facade
    {
        QObject::connect( ui->stopButton, SIGNAL( clicked() ),
                          &Facade::getInstance(), SLOT( stopProcess() ) );

        QObject::connect( ui->maxEpoch, SIGNAL( valueChanged(int) ),
                          &Facade::getInstance(), SLOT( setMaxNumberOfEpoh(int) ) );

        QObject::connect( ui->numberOfNeurons, SIGNAL( valueChanged(int) ),
                          &Facade::getInstance(), SLOT( setNumberOfNeurons(int) ) );

    }
//    */
//    /* INFO connection facade to ui
    {
        QObject::connect( &Facade::getInstance(), SIGNAL( processEnd() ),
                          ui->startButton, SLOT( show() ) );
        QObject::connect( &Facade::getInstance(), SIGNAL( processEnd() ),
                          ui->saveButton, SLOT( show() ) );
        QObject::connect( &Facade::getInstance(), SIGNAL( processEnd() ),
                          ui->stopButton, SLOT( hide() ) );
    }
//    */
//    /* INFO connection facade to main window
    {
//        QObject::connect( &Facade::getInstance(), SIGNAL( sendInitialLayerInfo(LayerDescription)),
//                          this, SLOT( setInitialLayerInfo( LayerDescription ) ) );
        QObject::connect( &Facade::getInstance(), SIGNAL( processEnd() ),
                          this, SLOT( displayResults() ) );
    }
//    */
//    /* INFO connection main window to facade
    {
        QObject::connect( this, SIGNAL( setInputFileName(QString) ),
                          &Facade::getInstance(), SLOT( setInputFileName(QString) ) );
        QObject::connect( this, SIGNAL( setOutputFileName(QString) ),
                          &Facade::getInstance(), SLOT( setOutputFileName(QString) ) );
        QObject::connect( this, SIGNAL( setAlpha( double ) ),
                          &Facade::getInstance(), SLOT( setAlhpa( double ) ) );
    }
//    */
}