void registry_write_real_ext(std::string key, std::string name, int x) { open_ini(); regIni.write(CurrRoot+"\\"+key, name, x); save_ini(); }
void qtvplugin_grid::on_pushButton_add_mark_clicked() { if (!m_pVi) return; QString strMarkerName = QString("geomarker%1").arg(m_nInstance); layer_interface * pif = m_pVi->layer(strMarkerName); save_ini(); int tp = ui->combox_type->currentIndex(); QString strAll = ui->plainTextEdit_markcmd->toPlainText(); QStringList strLines = strAll.split("\n",QString::SkipEmptyParts); int c = 0; bool bLatFirst = ui->radioButton_latfirst->isChecked(); QMap<QString, QVariant> map_multi; foreach (QString str, strLines) { QString strRegWest = QString("([%1])+").arg(ui->lineEdit_west_spliter->text()); QString strRegsout = QString("([%1])+").arg(ui->lineEdit_south_spliter->text()); int latNG = 1, lonNG = 1; if (str.indexOf(QRegExp(strRegWest))>=0) lonNG=-1; if (str.indexOf(QRegExp(strRegsout))>=0) latNG=-1; QStringList lst = str.split(QRegExp("([^0123456789.-])+"),QString::SkipEmptyParts); double lat = 0, lon = 0; if (lst.size()==6) { lat = lst.first().toDouble(); lst.pop_front(); lat += lst.first().toDouble() /60.0; lst.pop_front(); lat += lst.first().toDouble() /3600.0; lst.pop_front(); lon = lst.first().toDouble(); lst.pop_front(); lon += lst.first().toDouble() /60.0; lst.pop_front(); lon += lst.first().toDouble() /3600.0; } else if (lst.size()==4) { lat = lst.first().toDouble(); lst.pop_front(); lat += lst.first().toDouble() /60.0; lst.pop_front(); lon = lst.first().toDouble(); lst.pop_front(); lon += lst.first().toDouble() /60.0; } else if (lst.size()==2) { lat = lst.first().toDouble(); lst.pop_front(); lon = lst.first().toDouble(); } else { // QMessageBox::warning( // this, // tr("Error LLA formar"), // tr("lat lon must have same element nums.") // ); // break; continue; } if (bLatFirst==false) { double tmp = lat; lat = lon; lon = tmp; } lat *= latNG; lon *= lonNG; if (tp==0) { QMap<QString, QVariant> inPara, outPara; inPara["function"] = "update_point"; inPara["name"] = QString("%1_%2").arg(get_name()).arg(m_nMarks); inPara["lat"] = lat; inPara["lon"] = lon; //inPara["color_pen"] = "0,0,255,128"; //inPara["color_brush"] = "0,0,0,64"; //inPara["width"] = "7"; //inPara["height"] = "7"; //inPara["type"] = 1; outPara = pif->call_func(inPara); inPara.clear(); inPara["function"] = "update_props"; inPara["name"] = QString("%1_%2").arg(get_name()).arg(m_nMarks); inPara["POS"] = QString("%1,%2").arg(lat).arg(lon); ++m_nMarks; outPara = pif->call_func(inPara); } else { map_multi[QString("lat%1").arg(c)] = lat; map_multi[QString("lon%1").arg(c)] = lon; ++c; } }
void registry_write_string_ext(std::string key, std::string name, std::string str) { open_ini(); regIni.write(CurrRoot+"\\"+key, name, str); save_ini(); }
void qtvplugin_grid::on_checkBox_measure_clicked(bool acti) { save_ini(); m_bActive = acti; m_pVi->updateLayerGridView(); }