void UnStabilizator::setShiftXYAngle(double shX, double shY, double shAngle) { shiftX = shX; shiftY = shY; shiftAngle = shAngle; saveParams(); }
//lleva dentro el istrainingReady void SVMachine::train(){ // std::cout << "I'm training with the SVMachine" << std::endl; C_nFeatures=C_trainingSet[0].getNFeatures(); trainByQuadraticProgramming(); saveParams(); }
void KArtsModule::save() { if (configChanged) { configChanged = false; saveParams(); restartServer(); updateWidgets(); } emit changed( false ); }
int KArtsModule::userSavedChanges() { int reply; if (!configChanged) return KMessageBox::Yes; QString question = i18n("The settings have changed since the last time " "you restarted the sound server.\n" "Do you want to save them?"); QString caption = i18n("Save Sound Server Settings?"); reply = KMessageBox::questionYesNo(this, question, caption,KStdGuiItem::save(),KStdGuiItem::discard()); if ( reply == KMessageBox::Yes) { configChanged = false; saveParams(); } return reply; }
void Stage0::saveValuesToStage() { saveParams(); std::vector<bool> checkedECs; checkedECs.reserve(allECTypes.size()); for(int i = 0; i < (int) allECTypes.size(); i++) { if(ui.listWidget_ECTypes->item(i)->checkState() == Qt::Checked) { checkedECs.push_back(true); } else { checkedECs.push_back(false); } } // copyTransformed(newEcs, // controller->stage0.initialECTypes, // ManagedFuzzyDataController::getSpecByECType // ); controller->stage0.checkedECTypes = checkedECs; }
void Advanced::prepareUi() { Selection *s = new Selection(this); connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openRaster())); connect(ui->actionSave_Reprojection, SIGNAL(triggered()), this, SLOT(saveReprojection())); connect(ui->actionSelection_Screen, SIGNAL(triggered()), s, SLOT(showSelection())); connect(ui->actionSelection_Screen, SIGNAL(triggered()), this, SLOT(close())); connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(close())); connect(ui->actionLoad_Projection_Info, SIGNAL(triggered()), this, SLOT(loadParams())); connect(ui->actionSave_Projection_Info, SIGNAL(triggered()), this, SLOT(saveParams())); connect(ui->actionToggle_Preview, SIGNAL(triggered()), this, SLOT(togglePreview())); connect(ui->actionAbout_dRasterBlaster, SIGNAL(triggered()), s, SLOT(about())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), s, SLOT(aboutQt())); connect(ui->actionEdit_Author, SIGNAL(triggered()), s, SLOT(showEditAuthor())); connect(ui->actionUser_Guide, SIGNAL(triggered()), s, SLOT(showUserGuide())); connect(ui->fillEnable, SIGNAL(stateChanged(int)), this, SLOT(fillEnable(int))); connect(ui->noDataValueEnable, SIGNAL(stateChanged(int)), this, SLOT(noDataEnable(int))); //Validators QIntValidator *intValid = new QIntValidator(this); intValid->setBottom(0); QDoubleValidator *doubleValid = new QDoubleValidator(this); doubleValid->setNotation(QDoubleValidator::StandardNotation); doubleValid->setBottom(0.0); ui->Rows->setValidator(intValid); ui->Cols->setValidator(intValid); ui->FillValue->setValidator(intValid); ui->noDataValue->setValidator(intValid); ui->pixelSize->setValidator(doubleValid); //projections p; //p.callGenerate(_UTM); //ui->tabProjectionInfo->setLayout(p.projVLayout); }
/** * @function main */ int main( int argc, char* argv[] ) { // Initialize, in case user does not enter values of e1 and e2 double a, b, c, e1, e2, px,py,pz,ra,pa,ya; a = 0.1; b = 0.1; c = 0.1; e1= 1.0; e2 = 1.0; px = 0; py = 0; pz = 0; ra = 0; pa = 0; ya = 0; gFilename = std::string("omp_result.txt"); int v; while( (v=getopt(argc, argv, "a:b:c:e:f:x:y:z:r:p:q:n:h")) != -1 ) { switch(v) { case 'h': { printf("Executable to evaluate downsampling effect in one single sample \n"); printf("Usage: ./Executable -a -b -c -e -f -x -y -z -r -p -q -n output_filename.txt \n"); return 0; } break; case 'a' : { a = atof(optarg); } break; case 'b' : { b = atof(optarg); } break; case 'c' : { c = atof(optarg); } break; case 'x' : { px = atof(optarg); } break; case 'y' : { py = atof(optarg); } break; case 'z' : { pz = atof(optarg); } break; case 'r' : { ra = atof(optarg); } break; case 'p' : { pa = atof(optarg); } break; case 'q' : { ya = atof(optarg); } break; case 'e' : { e1 = atof(optarg); } break; case 'f' : { e2 = atof(optarg); } break; case 'n' : { gFilename.assign( optarg ); } break; } // switch end } struct timespec start, finish; double dt; clock_gettime(CLOCK_MONOTONIC, &start); std::ofstream output( gFilename.c_str(), std::ofstream::out ); SQ_parameters par, par_res; evaluated_sqs es; gD = 0; // Create perfect pointcloud pcl::PointCloud<PointT>::Ptr input( new pcl::PointCloud<PointT>() ); pcl::PointCloud<PointT>::Ptr down( new pcl::PointCloud<PointT>() ); // Dimensions par.dim[0] = a; par.dim[1] = b; par.dim[2] = c; // Translation par.trans[0] = px; par.trans[1] = py; par.trans[2] = pz; // Rotation par.rot[0] = ra; par.rot[1] = pa; par.rot[2] = ya; // E parameters par.e[0] = e1; par.e[1] = e2; // Store original data output_sq base; base.par = par; base.er_r = 0; base.er_g = 0; base.t = 0; base.er_v = 0; base.er_e1 = 0; base.er_e2 = 0; saveParams( output, base.par, 0, 0, 0, 0, 0, 0 ); // 1. Generate clean pointcloud input = sampleSQ_uniform<PointT>( par ); // Loop double xer_e1, xer_e2, vc, vr, xer_v; struct timespec ts, tf; double elapsed; double er_g, er_r, er_d; for( int i = 1; i < gnD; ++i ) { gD = 0 + gdD*i; if( gD == 0 ) { down = input; } else { down = downsampling( input, gD ); } // Try it out with methods clock_gettime(CLOCK_MONOTONIC, &ts); es.minimize( down, par_res, er_g, er_r, er_d, SQ_FX_RADIAL ); clock_gettime(CLOCK_MONOTONIC, &tf); error_metric<PointT>( par_res,input, er_g, er_r, er_d ); elapsed = (tf.tv_sec - ts.tv_sec); elapsed += (tf.tv_nsec - ts.tv_nsec) / 1000000000.0; xer_e1 = fabs(base.par.e[0] - par_res.e[0]); xer_e2 = fabs(base.par.e[1] - par_res.e[1]); vc = volSQ(par_res.dim[0], par_res.dim[1], par_res.dim[2], par_res.e[0], par_res.e[1]); vr = volSQ(base.par.dim[0],base.par.dim[1],base.par.dim[2], base.par.e[0], base.par.e[1] ); xer_v = (vc - vr)/vr*100.0; output << down->points.size() << std::endl; saveParams( output, par_res, elapsed, er_g, er_r, xer_e1, xer_e2, xer_v); } clock_gettime(CLOCK_MONOTONIC, &finish); dt = (finish.tv_sec - start.tv_sec); dt += (finish.tv_nsec - start.tv_nsec) / 1000000000.0; printf("* Total time: %f \n", dt ); output.close(); return 0; }
/************************************************* Function: OnBnClickedButtonSave Desc: Input: Return: SUCCESS 成功 FAIL 失败 **************************************************/ void CDialogSetting::OnBnClickedButtonSave() { CString str; c_Brightness.GetLBText(c_Brightness.GetCurSel(),str); //setCStringToConfig("CAMS","Brightness",strText); //CString str = getCStringFromConfig("CAMS","Brightness"); BYTE brightness = _ttoi(_T(str)); //CString strText; c_Contrast.GetLBText(c_Contrast.GetCurSel(),str); //setCStringToConfig("CAMS","Contrast",strText); //str = getCStringFromConfig("CAMS","Contrast"); BYTE contrast = _ttoi(_T(str)); //CString strText; c_Sharpness.GetLBText(c_Sharpness.GetCurSel(),str); //setCStringToConfig("CAMS","Sharpness",strText); //str = getCStringFromConfig("CAMS","Sharpness"); BYTE sharpness = _ttoi(_T(str)); //CString strText; c_Saturation.GetLBText(c_Saturation.GetCurSel(),str); //setCStringToConfig("CAMS","Saturation",strText); //str = getCStringFromConfig("CAMS","Saturation"); BYTE saturation = _ttoi(_T(str)); //CString strText; c_ExpMode.GetLBText(c_ExpMode.GetCurSel(),str); //setCStringToConfig("CAMS","ExposureMode",strText); //str = getCStringFromConfig("CAMS","ExposureMode"); BYTE exposuremode; if(str == "手动曝光") exposuremode = 0; else if(str == "自动曝光") exposuremode = 1; else exposuremode = 0; //CString strText; c_ExpTime.GetLBText(c_ExpTime.GetCurSel(),str); //setCStringToConfig("CAMS","ExposureTime",strText); //str = getCStringFromConfig("CAMS","ExposureTime"); int exposuretime = _ttoi(_T(str)); //CString strText; c_DayNight.GetLBText(c_DayNight.GetCurSel(),str); //setCStringToConfig("CAMS","DayNight",strText); //str = getCStringFromConfig("CAMS","DayNight"); BYTE daynight; if(str == "白天") daynight = 0; else if(str == "夜晚") daynight = 1; else if(str == "自动") daynight = 2; else if(str == "定时") daynight = 3; else if(str == "报警输入触发") daynight = 4; else daynight = 0; saveParams(brightness,contrast,sharpness,saturation,exposuremode,exposuretime,daynight); }
UnStabilizator::~UnStabilizator() { saveParams(); }
void MouseConfig::applySettings() { saveParams(); }