Skip to content

Commit

Permalink
set validity limits for geotechnical parameters and fix table model
Browse files Browse the repository at this point in the history
  • Loading branch information
giadasan committed Jul 5, 2024
1 parent 3772926 commit 2f4594b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion agrolib/soilWidget/soilWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ void Crit3DSoilWidget::setDbSoil(QSqlDatabase dbOpened, QString soilCode)
// load default geotechnics parameters (not mandatory)
if (! loadGeotechnicsParameters(dbSoil, geotechnicsClassList, errorStr))
{
QMessageBox::warning(nullptr, "Warning", "loadGeotechnicsParameters\n" + errorStr);
QMessageBox::warning(nullptr, "Warning", "Failed to load geotecnical parameters for slope stability: missing reference db");
}

// read soil list
Expand Down
6 changes: 3 additions & 3 deletions agrolib/soilWidget/tabHorizons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ bool TabHorizons::checkDepths()
for (int horizonNum = 0; horizonNum<tableDb->rowCount(); horizonNum++)
{
//except first row
if ( horizonNum > 0)
if (horizonNum > 0)
{
if (mySoil->horizon[unsigned(horizonNum)].dbData.upperDepth != mySoil->horizon[horizonNum-1].dbData.lowerDepth)
{
Expand Down Expand Up @@ -366,12 +366,12 @@ bool TabHorizons::checkHorizonData(int horizonNum)
tableDb->item(horizonNum,9)->setBackground(Qt::red);
}

if (dbData->effectiveCohesion != NODATA && (dbData->effectiveCohesion < 0))
if (dbData->effectiveCohesion != NODATA && (dbData->effectiveCohesion < 0 || dbData->effectiveCohesion > 110))
{
tableDb->item(horizonNum,10)->setBackground(Qt::red);
}

if (dbData->frictionAngle != NODATA && (dbData->frictionAngle < 0))
if (dbData->frictionAngle != NODATA && (dbData->frictionAngle < 0 || dbData->frictionAngle > 50))
{
tableDb->item(horizonNum,11)->setBackground(Qt::red);
}
Expand Down

0 comments on commit 2f4594b

Please sign in to comment.