void SVITransitionAnimation::forceEnd(){

		if( mInterpolator != NULL )
			mInterpolator->forceEnd();
		
		//2012-04-09 [email protected]
		//to avoid illusion of previous transition scene.
		processEnd();				
		
		//stopCaptureSlide();

		//if(mEffector!=NULL){			
		//	mEffector->cancelAnimation();
		//	mEffector->removeNslide();			
		//}
	}
	void SVITransitionAnimation::update(SVIUInt& time) {
		updateInfo(time);

		if( getStatus() == ANIMATING ) {
			if( !mIsTransition ) {
				LOGE("transition didn't occur!!!");
				if(mToSlide != NULL) {
					mToSlide->removeAnimation();
				}
				return;
			}
			else {
				if( SVIAnimation::isEnd(time) ) {
					processEnd();
				}
			}
		}
	}
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 ) ) );
    }
//    */
}