void Environment::readCommandLineArgs(const KCmdLineArgs * args) { if ( args->isSet("country-code") ) setLocalCountryCode( args->getOption("country-code") ); if ( args->isSet("area-code") ) setLocalAreaCode( args->getOption("area-code") ); if ( args->isSet("phonebook-name") ) setPhoneBookName( args->getOption("phonebook-name" ) ); if ( args->isSet("output-file") ) setOutputFileName( args->getOption("output-file") ); if ( args->isSet("netnumbers-file") ) setNetNumbersFile( args->getOption("netnumbers-file") ); m_WriteToConfig = args->isSet("write-to-config"); }
void Environment::readFromConfigFile() { KConfigGroup configG = m_Config->group("kfffeed"); QString entry = configG.readEntry("country-code"); if ( ! entry.isEmpty()) setLocalCountryCode( entry ); entry = configG.readEntry("area-code"); if ( ! entry.isEmpty()) setLocalAreaCode( entry ); entry = configG.readEntry("phonebook-name"); if ( ! entry.isEmpty()) setPhoneBookName( entry ); entry = configG.readEntry("output-file"); if ( ! entry.isEmpty()) setOutputFileName( entry ); entry = configG.readEntry("netnumbers-file"); if ( ! entry.isEmpty()) setNetNumbersFile( entry ); }
//------------------------------------------------------------------------------ bool MzIDIO::insertMZIDValues(boost::unordered_map<PercolatorOutFeatures, string, PercolatorOutFeatures> &pout_values, vector <string> &filenames, bool multiplemzidfiles) { ifstream fpr; ofstream fpw; ostream *wout; string mzidname,s1,psmid; int i1,vi1,n,xmlindent; n=0; psmid=""; try { for (vi1=0; vi1<filenames.size(); vi1++) { mzidname=boost::lexical_cast<boost::filesystem::path>(filenames[vi1]).stem().string(); if (!multiplemzidfiles) mzidname=""; fpr.open(filenames[vi1].c_str()); if (outputfileending.length()>0) { fpw.open(setOutputFileName(filenames[vi1]).c_str()); wout=&fpw; } else wout=&cout; while (getline(fpr,s1)) { if (s1.find(MZID_PARAM::END_INSERT_TAG)!=string::npos) { if (psmid.length()==0) THROW_ERROR_VALUE(PRINT_TEXT::BAD_XML,filenames[vi1]); for (i1=0; i1<ARRAYSIZE(MZID_PARAM::ELEMENT_DATA::ELEMENTS); i1++) { if (pout_values.find(PercolatorOutFeatures(mzidname,psmid,i1))==pout_values.end()) continue; n++; switch (MZID_PARAM::ELEMENT_DATA::ELEMENTS[i1]) { case MZID_PARAM::CVPARAM: { *wout << boost::format(MZID_PARAM::CVPARAM_TAG) % string(xmlindent,' ') % MZID_PARAM::ELEMENT_DATA::ACCESSIONS[i1] % MZID_PARAM::ELEMENT_DATA::CVREFS[i1] % MZID_PARAM::ELEMENT_DATA::NAMES[i1] % pout_values[PercolatorOutFeatures(mzidname,psmid,i1)]; break; } case MZID_PARAM::USERPARAM: { *wout << boost::format(MZID_PARAM::USERPARAM_TAG) % string(xmlindent,' ') % MZID_PARAM::ELEMENT_DATA::NAMES[i1] % pout_values[PercolatorOutFeatures(mzidname,psmid,i1)]; break; } } pout_values.erase(PercolatorOutFeatures(mzidname,psmid,i1)); } psmid=""; } xmlindent=s1.find_first_not_of(" "); *wout << s1 << endl; if (s1.find(MZID_PARAM::PSMID_TAG)!=string::npos && s1.find(MZID_PARAM::START_INSERT_TAG)!=string::npos) { i1=s1.find(MZID_PARAM::PSMID_TAG)+strlen(MZID_PARAM::PSMID_TAG); psmid=s1.substr(i1,s1.find("\"",i1)-i1); } } fpr.close(); fpw.close(); } clog << boost::format(PRINT_TEXT::INSERTED) % n << endl; for (boost::unordered_map<PercolatorOutFeatures, string, PercolatorOutFeatures>::iterator it=pout_values.begin(); it!=pout_values.end(); it++) cerr << boost::format(PRINT_TEXT::PSM_NOT_ENTERED) % it->first.filename % it->first.psmid << endl; return true; } catch (exception &e) { cerr << e.what() << endl; fpr.close(); fpw.close(); return false; } }
void vpr_set_output_file_name(enum e_output_files ename, const char *name, const char* default_name) { setOutputFileName(ename, name, default_name); }
/*! * \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 ) ) ); } // */ }
/*! * \brief MainWindow::openOutputFile */ void MainWindow::openOutputFile() { const QString fileName = QFileDialog::getOpenFileName( this, tr("Open result file"), "", tr("Result files (*.res)")); if(fileName.isNull()) return; emit setOutputFileName( fileName ); }