@@ -4839,8 +4839,7 @@ bool Project::setActiveStateWithCriteria(bool isActive)
48394839 return false ;
48404840 }
48414841
4842- bool isSelect = false ;
4843- DialogSelectionMeteoPoint dialogPointSelection (isActive, isSelect, meteoPointsDbHandler);
4842+ DialogSelectionMeteoPoint dialogPointSelection (" Active" , isActive, meteoPointsDbHandler);
48444843 if (dialogPointSelection.result () != QDialog::Accepted)
48454844 return false ;
48464845
@@ -6238,10 +6237,10 @@ void Project::getMeteoPointsCurrentValues(std::vector<float> &validValues)
62386237}
62396238
62406239
6241- bool Project::setSelectedStatePointList (QString fileName)
6240+ bool Project::setSelectedStatePointList (QString fileName, bool isSelect, bool isShowVariable )
62426241{
62436242 QList<QString> pointList = readListSingleColumn (fileName, errorString);
6244- if (! selectPointList (pointList))
6243+ if (! selectPointList (pointList, isSelect, isShowVariable ))
62456244 {
62466245 logWarning (" No points to select." );
62476246 return false ;
@@ -6251,47 +6250,46 @@ bool Project::setSelectedStatePointList(QString fileName)
62516250}
62526251
62536252
6254- bool Project::selectPointList (const QList<QString> &pointList)
6253+ bool Project::selectPointList (const QList<QString> &pointList, bool isSelect, bool isShowVariable )
62556254{
62566255 if (pointList.size () == 0 )
62576256 return false ;
62586257
6259- int nrValidPoints = 0 ;
6258+ int nrPoints = 0 ;
62606259 for (int i = 0 ; i < meteoPoints.size (); i++)
62616260 {
62626261 if (pointList.contains (QString::fromStdString (meteoPoints[i].id )))
62636262 {
6264- meteoPoints[i].selected = true ;
6265- nrValidPoints++;
6263+ if (! isShowVariable || ! isEqual (meteoPoints[i].currentValue , NODATA))
6264+ {
6265+ meteoPoints[i].selected = isSelect;
6266+ ++nrPoints;
6267+ }
62666268 }
62676269 }
62686270
6269- return (nrValidPoints > 0 );
6271+ return (nrPoints > 0 );
62706272}
62716273
62726274
6273- bool Project::setSelectedStateWithCriteria ()
6275+ bool Project::setSelectedStateWithCriteria (bool isSelect, bool isShowVariable )
62746276{
62756277 if (! meteoPointsLoaded)
62766278 {
62776279 logError (ERROR_STR_MISSING_DB);
62786280 return false ;
62796281 }
62806282
6281- bool isActive = false ;
6282- bool isSelect = true ;
6283- DialogSelectionMeteoPoint dialogPointSelection (isActive, isSelect, meteoPointsDbHandler);
6283+ DialogSelectionMeteoPoint dialogPointSelection (" Select" , isSelect, meteoPointsDbHandler);
62846284 if (dialogPointSelection.result () != QDialog::Accepted)
6285- {
62866285 return false ;
6287- }
62886286
62896287 QString selection = dialogPointSelection.getSelection ();
62906288 QString operation = dialogPointSelection.getOperation ();
62916289 QString item = dialogPointSelection.getItem ();
62926290
62936291 QString condition;
6294- QList<QString> selectedPointsList ;
6292+ QList<QString> pointsList ;
62956293
62966294 if (operation == " Like" )
62976295 {
@@ -6304,7 +6302,7 @@ bool Project::setSelectedStateWithCriteria()
63046302
63056303 if (selection != " DEM distance [m]" )
63066304 {
6307- if (! meteoPointsDbHandler->getPointListWithCriteria (selectedPointsList , condition))
6305+ if (! meteoPointsDbHandler->getPointListWithCriteria (pointsList , condition))
63086306 {
63096307 logError (meteoPointsDbHandler->getErrorString ());
63106308 return false ;
@@ -6331,41 +6329,41 @@ bool Project::setSelectedStateWithCriteria()
63316329 {
63326330 if (isEqual (distance, item.toFloat ()))
63336331 {
6334- selectedPointsList .append (QString::fromStdString (meteoPoints[i].id ));
6332+ pointsList .append (QString::fromStdString (meteoPoints[i].id ));
63356333 }
63366334 }
63376335 else if (operation == " !=" )
63386336 {
63396337 if (! isEqual (distance, item.toFloat ()))
63406338 {
6341- selectedPointsList .append (QString::fromStdString (meteoPoints[i].id ));
6339+ pointsList .append (QString::fromStdString (meteoPoints[i].id ));
63426340 }
63436341 }
63446342 else if (operation == " >" )
63456343 {
63466344 if (distance > item.toFloat ())
63476345 {
6348- selectedPointsList .append (QString::fromStdString (meteoPoints[i].id ));
6346+ pointsList .append (QString::fromStdString (meteoPoints[i].id ));
63496347 }
63506348 }
63516349 else if (operation == " <" )
63526350 {
63536351 if (distance < item.toFloat ())
63546352 {
6355- selectedPointsList .append (QString::fromStdString (meteoPoints[i].id ));
6353+ pointsList .append (QString::fromStdString (meteoPoints[i].id ));
63566354 }
63576355 }
63586356 }
63596357 closeProgressBar ();
63606358 }
63616359
6362- if (selectedPointsList .isEmpty ())
6360+ if (pointsList .isEmpty ())
63636361 {
63646362 logWarning (" No point matches your requirements." );
63656363 return false ;
63666364 }
63676365
6368- if (! selectPointList (selectedPointsList ))
6366+ if (! selectPointList (pointsList, isSelect, isShowVariable ))
63696367 {
63706368 logWarning (" No points to select" );
63716369 return false ;
0 commit comments