bool CSisr::saveConfs(std::string path) { const char* fname = path.c_str(); saveConf(fname, _lowD, _highD, _confs, _kConfs, cv::Mat(), _matPCA); return true; }
void MidiWindow::getNewNoteValue(int channel, int note, int velocity) { if(isLearning) { learningNote->setValue(note); learningNote = NULL; isLearning = false; ui->btnSwitchDisplay->setEnabled(true); ui->btnSceneNext->setEnabled(true); ui->btnSceneBack->setEnabled(true); ui->btnTransitionUp->setEnabled(true); ui->btnTransitionDown->setEnabled(true); } else { if(note == ui->spinSwitchDisplay->value()) { emit switchDisplay(); } else if(note == ui->spinSceneNext->value()) { emit sceneUp(); } else if(note == ui->spinSceneBack->value()) { emit sceneDown(); } else if(note == ui->spinTransitionUp->value()) { emit transitionUp(); } else if(note == ui->spinTransitionDown->value()) { emit transitionDown(); } } saveConf(); }
a2a::~a2a() { saveConf(); delete ui; }
void Shadow::on_btnSubmit_clicked() { saveConf(); QStringList args; QString argsStr; std::string stdStrargs; QString execFile; // = "./hello"; #ifdef Q_OS_WIN32 execFile = "shadowCore.exe"; #endif #ifdef Q_OS_LINUX execFile = "./shadowCore"; #endif QStringList b = ui->inputImg->toPlainText().split("\n"); args.append(b); QString tmp; //light x tmp.clear(); tmp.append(LX); tmp.append(strPlusScroll(ui->lightX->text())); args << tmp; //light y tmp.clear(); tmp.append(LY); tmp.append(strPlusScroll(ui->lightY->text())); args<<tmp; tmp.clear(); tmp.append(WALL); tmp.append(strPlusScroll(ui->wall->text())); args<<tmp; tmp.clear();tmp.append(ATTEN);tmp.append(ui->attenuator->text());args<<tmp; tmp.clear();tmp.append(FN);tmp.append(ui->outfilename->text());args<<tmp; tmp.clear();tmp.append(OUTPUT);tmp.append(ui->outputDir->text());args<<tmp; tmp.clear();tmp.append(PY);tmp.append(ui->padding->text());args<<tmp; tmp.clear();tmp.append(ORIFILE);tmp.append(ui->oriFile->text());args<<tmp; int scale = ui->scale->text().toInt(); tmp.clear();tmp.append(SCALE);tmp.append(QString::number(scale));args<<tmp; //argsStr = args.join(" "); //stdStrargs = argsStr.toStdString(); //const char* charArgs = stdStrargs.c_str(); QProcess* process = new QProcess(); process->start(execFile,args); process->waitForStarted(); process->waitForFinished(); QString strResult = QString::fromLocal8Bit(process->readAllStandardOutput()); QString strError = QString::fromLocal8Bit(process->readAllStandardError()); strResult.append(strError); //ui->coreOutput->setText(strResult); ui->coreOutput->append(strResult); //QMessageBox megBox(this); //megBox.setText(strResult); //megBox.exec(); //WinExec(charArgs,1); }
ConfigurationWindow::ConfigurationWindow(const configurations &config) : m_config(config) { QGroupBox *configGroup = new QGroupBox(tr("Configuration")); QLabel *serverLabel = new QLabel(tr("CAE file path:")); caeFilePathTextEdit = new QTextEdit(QString(config.caeFilePath.c_str())); caeFilePathTextEdit->setEnabled(false); caeFilePathTextEdit->setFixedHeight(25); QHBoxLayout *filePathLayout = new QHBoxLayout; filePathLayout->addWidget(serverLabel); filePathLayout->addWidget(caeFilePathTextEdit); QLabel *abaqusBatPathLabel = new QLabel(tr("Abaqus.bat path:")); abaqusBatPathTextEdit = new QTextEdit(QString(config.abaqusBatPath.c_str())); abaqusBatPathTextEdit->setFixedHeight(25); QHBoxLayout *abaqusBatPathLayout = new QHBoxLayout; abaqusBatPathLayout->addWidget(abaqusBatPathLabel); abaqusBatPathLayout->addWidget(abaqusBatPathTextEdit); QLabel *openModelScriptPathLabel = new QLabel(tr("Prepare model script path:")); openModelScriptPathTextEdit = new QTextEdit(QString(config.openModelScriptPath.c_str())); openModelScriptPathTextEdit->setFixedHeight(25); QHBoxLayout *openModelScriptPathLayout = new QHBoxLayout; openModelScriptPathLayout->addWidget(openModelScriptPathLabel); openModelScriptPathLayout->addWidget(openModelScriptPathTextEdit); QLabel *runForGenomeScriptPathLabel = new QLabel(tr("Run for genome script path:")); runForGenomeScriptPathTextEdit = new QTextEdit(QString(config.runForGenomeScriptPath.c_str())); runForGenomeScriptPathTextEdit->setFixedHeight(25); QHBoxLayout *runForGenomeScriptPathLayout = new QHBoxLayout; runForGenomeScriptPathLayout->addWidget(runForGenomeScriptPathLabel); runForGenomeScriptPathLayout->addWidget(runForGenomeScriptPathTextEdit); QLabel *netSizeLabel = new QLabel(tr("Optimization net size:")); optimizationNetSizeTextEdit = new QTextEdit(QString::number(config.optimizationNetSize)); optimizationNetSizeTextEdit->setFixedHeight(25); QHBoxLayout *netSizeLayout = new QHBoxLayout; netSizeLayout->addWidget(netSizeLabel); netSizeLayout->setSpacing(1); netSizeLayout->addWidget(optimizationNetSizeTextEdit); QLabel *meshSizeLabel = new QLabel(tr("Mesh size:")); meshSizeTextEdit = new QTextEdit(QString::number(config.meshSize)); meshSizeTextEdit->setFixedHeight(25); QHBoxLayout *meshSizeLayout = new QHBoxLayout; meshSizeLayout->addWidget(meshSizeLabel); meshSizeLayout->addWidget(meshSizeTextEdit); meshSizeLayout->setSizeConstraint(QLayout::SetMaximumSize); QVBoxLayout *configLayout = new QVBoxLayout; configLayout->addLayout(filePathLayout); configLayout->addLayout(abaqusBatPathLayout); configLayout->addLayout(openModelScriptPathLayout); configLayout->addLayout(runForGenomeScriptPathLayout); configLayout->addLayout(netSizeLayout); configLayout->addLayout(meshSizeLayout); configGroup->setLayout(configLayout); configGroup->adjustSize(); QPushButton *saveButton = new QPushButton(tr("Continue")); connect(saveButton, SIGNAL(clicked()), this, SLOT(saveConf())); QHBoxLayout *buttonsLayout = new QHBoxLayout; buttonsLayout->addStretch(1); buttonsLayout->addWidget(saveButton); QHBoxLayout *horizontalLayout = new QHBoxLayout; horizontalLayout->addWidget(configGroup); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(horizontalLayout); mainLayout->setSpacing(1); mainLayout->addStretch(1); mainLayout->addLayout(buttonsLayout); mainLayout->setGeometry(QRect(10,10,500,300)); setLayout(mainLayout); setWindowTitle(tr("Config Dialog")); }