Skip to content

Commit

Permalink
fix hecras parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
vcloarec committed Nov 16, 2023
1 parent a24b4c5 commit bc00fe9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/core/GIS/private/reosgriddedrainfallrenderer_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class ReosGriddedRainfallRasterProvider_p : public QgsRasterDataProvider
QString description() const override {return QString();}

// QgsRasterDataProvider interface
QString htmlMetadata() override {return QString();}
QString htmlMetadata() const override {return QString();}
QString lastErrorTitle() override {return QString();}
QString lastError() override {return QString();}
Qgis::DataType sourceDataType( int ) const override {return Qgis::DataType::Float64;}
Expand Down
30 changes: 18 additions & 12 deletions src/simulationEngines/hecras/reoshecrasproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ bool ReosHecRasProject::parseProjectFile()
planFile.remove( QStringLiteral( "Plan File=" ) );
mPlans.insert( planFile, ReosHecRasPlan( projectDir.filePath( mProjectName + '.' + planFile ) ) );
if ( !mPlans.value( planFile ).isValid() )
return false;
mPlans.remove( planFile );
}

if ( line.startsWith( QStringLiteral( "Unsteady File=" ) ) )
Expand All @@ -150,7 +150,7 @@ bool ReosHecRasProject::parseProjectFile()
flowFile.remove( QStringLiteral( "Unsteady File=" ) );
mFlows.insert( flowFile, ReosHecRasFlow( projectDir.filePath( mProjectName + '.' + flowFile ) ) );
if ( !mFlows.value( flowFile ).isValid() )
return false;
mFlows.remove( flowFile );
}

if ( line.startsWith( QStringLiteral( "Current Plan=" ) ) )
Expand Down Expand Up @@ -331,7 +331,13 @@ bool ReosHecRasGeometry::parseGeometryFile()
if ( mTerrainFileName.contains( QStringLiteral( "\\" ) ) )
mTerrainFileName.replace( QLatin1String( "\\" ), QString( '/' ) );

mTerrainFileName = geomFileInfo.dir().filePath( mTerrainFileName );
QFileInfo terrainFileInfo( mTerrainFileName );
if ( !terrainFileInfo.isFile() || !terrainFileInfo.exists() )
mTerrainFileName = geomFileInfo.dir().filePath( mTerrainFileName );

terrainFileInfo = QFileInfo( mTerrainFileName );
if ( !terrainFileInfo.isFile() )
mTerrainFileName = geomFileInfo.dir().path() + QStringLiteral( "/Terrain/Terrain.hdf" );
}
}
else
Expand Down Expand Up @@ -1364,16 +1370,16 @@ QString ReosHecRasGeometry::BoundaryCondition::id() const
}


ReosDssPath ReosHecRasFlow::BoundaryFlow::buildDssFlowRatePath(const ReosHecRasPlan& plan) const
ReosDssPath ReosHecRasFlow::BoundaryFlow::buildDssFlowRatePath( const ReosHecRasPlan &plan ) const
{
ReosDssPath path;
path.setGroup(QStringLiteral("BCLINE"));
path.setVersion(plan.shortIdentifier());
path.setParameter(QStringLiteral("FLOW"));
path.setTimeInterval(plan.outputInterval());
ReosDssPath path;
path.setGroup( QStringLiteral( "BCLINE" ) );
path.setVersion( plan.shortIdentifier() );
path.setParameter( QStringLiteral( "FLOW" ) );
path.setTimeInterval( plan.outputInterval() );

const QString location = area() + QStringLiteral(": ") + boundaryConditionLine();
path.setLocation(location);
const QString location = area() + QStringLiteral( ": " ) + boundaryConditionLine();
path.setLocation( location );

return path;
return path;
}

0 comments on commit bc00fe9

Please sign in to comment.