Example #1
0
/*!
 * \brief MainWindow::openFile
 */
void MainWindow::openInputFile()
{
    const QString fileName = QFileDialog::getOpenFileName( this, tr("Open data file"), "", tr("Data files (*.dat)"));
    if(fileName.isNull()) return;
    ui->currentFileName->setText( fileName );
    emit setInputFileName( fileName );
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ReadImage::readFilterParameters(AbstractFilterParametersReader* reader, int index)
{
  reader->openFilterGroup(this, index);
  setInputFileName( reader->readString( "InputFileName", getInputFileName() ) );
  setDataContainerName( reader->readString( "DataContainerName", getDataContainerName() ) );
  setCellAttributeMatrixName( reader->readString( "CellAttributeMatrixName", getCellAttributeMatrixName() ) );
  setImageDataArrayName( reader->readString( "ImageDataArrayName", getImageDataArrayName() ) );
  reader->closeFilterGroup();
}
Example #3
0
Translator::Translator(std::string fname)
{
	setInputFileName(fname);
}
Example #4
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 ) ) );
    }
//    */
}