From bc00fe978dd87c1b486b1095da0af5a0f1804fec Mon Sep 17 00:00:00 2001 From: vcloarec Date: Wed, 15 Nov 2023 21:47:28 -0400 Subject: [PATCH 1/5] fix hecras parsing --- .../private/reosgriddedrainfallrenderer_p.h | 2 +- .../hecras/reoshecrasproject.cpp | 30 +++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/core/GIS/private/reosgriddedrainfallrenderer_p.h b/src/core/GIS/private/reosgriddedrainfallrenderer_p.h index c3d0222d..bf927f3d 100644 --- a/src/core/GIS/private/reosgriddedrainfallrenderer_p.h +++ b/src/core/GIS/private/reosgriddedrainfallrenderer_p.h @@ -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;} diff --git a/src/simulationEngines/hecras/reoshecrasproject.cpp b/src/simulationEngines/hecras/reoshecrasproject.cpp index e49cfea8..1c13ef0b 100644 --- a/src/simulationEngines/hecras/reoshecrasproject.cpp +++ b/src/simulationEngines/hecras/reoshecrasproject.cpp @@ -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=" ) ) ) @@ -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=" ) ) ) @@ -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 @@ -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; } From 3a1832d0e4e3b074c105d53508d9d295c98d4743 Mon Sep 17 00:00:00 2001 From: vcloarec Date: Thu, 16 Nov 2023 08:21:49 -0400 Subject: [PATCH 2/5] deactivate CI test .. --- windows/build_tests_REOS.bat | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/windows/build_tests_REOS.bat b/windows/build_tests_REOS.bat index 409288cf..8c4a078c 100644 --- a/windows/build_tests_REOS.bat +++ b/windows/build_tests_REOS.bat @@ -22,8 +22,8 @@ set PATH=%PATH%;%REOS_INSTALL%\bin set PATH=%PATH%;%OSGEO4W_ROOT%\apps\Qt5\bin; set GDAL_DATA=%REOS_INSTALL%\share\gdal cd %REOS_BUILDING% -ctest -C %BUILD_TYPE% -VV --output-on-failure -if %ERRORLEVEL% NEQ 0 exit %ERRORLEVEL% +rem ctest -C %BUILD_TYPE% -VV --output-on-failure +rem if %ERRORLEVEL% NEQ 0 exit %ERRORLEVEL% endlocal rem Now we copy Qt files @@ -40,17 +40,17 @@ copy /v /y %OSGEO4W_ROOT%\apps\Qt5\translations\qtbase_it.qm %REOS_INSTALL%\i18n copy /v /y %OSGEO4W_ROOT%\apps\Qt5\translations\qtbase_es.qm %REOS_INSTALL%\i18n\qtbase_es.qm copy /v /y %OSGEO4W_ROOT%\apps\Qt5\translations\qtbase_fr.qm %REOS_INSTALL%\i18n\qtbase_fr.qm -echo "///////////////////// Test launch Lekan application, start it and wait 30s -start %REOS_INSTALL%\bin\Lekan.exe test -ping -n 30 127.0.0.1 -tasklist /fi "ImageName eq Lekan.exe" /fo csv 2>NUL | find /I "Lekan.exe">NUL -if %ERRORLEVEL% NEQ 0 ( -echo "///////////////////// Test launch Lekan application fails -exit %ERRORLEVEL% - ) else ( -echo "///////////////////// Test launch Lekan application success -taskkill /F /IM Lekan.exe - ) +rem echo "///////////////////// Test launch Lekan application, start it and wait 30s +rem start %REOS_INSTALL%\bin\Lekan.exe test +rem ping -n 30 127.0.0.1 +rem tasklist /fi "ImageName eq Lekan.exe" /fo csv 2>NUL | find /I "Lekan.exe">NUL +rem if %ERRORLEVEL% NEQ 0 ( +rem echo "///////////////////// Test launch Lekan application fails +rem exit %ERRORLEVEL% +rem ) else ( +rem echo "///////////////////// Test launch Lekan application success +rem taskkill /F /IM Lekan.exe +rem ) echo on From 337cac61ed9b53a5202701ff6b09b728f1d90834 Mon Sep 17 00:00:00 2001 From: vcloarec Date: Thu, 16 Nov 2023 22:20:23 -0400 Subject: [PATCH 3/5] HEC-RAS fix write flow file --- src/simulationEngines/hecras/reoshecrasproject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/simulationEngines/hecras/reoshecrasproject.cpp b/src/simulationEngines/hecras/reoshecrasproject.cpp index 1c13ef0b..18b43290 100644 --- a/src/simulationEngines/hecras/reoshecrasproject.cpp +++ b/src/simulationEngines/hecras/reoshecrasproject.cpp @@ -1051,6 +1051,8 @@ bool ReosHecRasFlow::applyBoudaryFlow( const QList &flows ) } else if ( inputLine.startsWith( QStringLiteral( "DSS File=" ) ) || inputLine.startsWith( QStringLiteral( "Use DSS=" ) ) ) continue; + else + outputStream << inputLine << "\r\n"; } else if ( inputLine.startsWith( QStringLiteral( "Precipitation Mode=" ) ) ) From 2c12e3d3ed6012a1157285c51b457806902ce0ab Mon Sep 17 00:00:00 2001 From: vcloarec Date: Thu, 16 Nov 2023 22:23:07 -0400 Subject: [PATCH 4/5] fix osgeo dependencies --- windows/osgeo_dependencies_bin.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/windows/osgeo_dependencies_bin.txt b/windows/osgeo_dependencies_bin.txt index baa65026..60396fc2 100644 --- a/windows/osgeo_dependencies_bin.txt +++ b/windows/osgeo_dependencies_bin.txt @@ -44,9 +44,8 @@ ogdi.dll openjp2.dll parquet.dll poppler.dll -proj_9_0.dll -proj_9_1.dll proj_9_2.dll +proj_9_3.dll spatialindex-64.dll spatialite.dll sqlite3.dll From 8dc6d62444df163aa37e3d49e1446aa86e747e76 Mon Sep 17 00:00:00 2001 From: vcloarec Date: Thu, 16 Nov 2023 22:23:24 -0400 Subject: [PATCH 5/5] reactivate CI test --- windows/build_tests_REOS.bat | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/windows/build_tests_REOS.bat b/windows/build_tests_REOS.bat index 8c4a078c..409288cf 100644 --- a/windows/build_tests_REOS.bat +++ b/windows/build_tests_REOS.bat @@ -22,8 +22,8 @@ set PATH=%PATH%;%REOS_INSTALL%\bin set PATH=%PATH%;%OSGEO4W_ROOT%\apps\Qt5\bin; set GDAL_DATA=%REOS_INSTALL%\share\gdal cd %REOS_BUILDING% -rem ctest -C %BUILD_TYPE% -VV --output-on-failure -rem if %ERRORLEVEL% NEQ 0 exit %ERRORLEVEL% +ctest -C %BUILD_TYPE% -VV --output-on-failure +if %ERRORLEVEL% NEQ 0 exit %ERRORLEVEL% endlocal rem Now we copy Qt files @@ -40,17 +40,17 @@ copy /v /y %OSGEO4W_ROOT%\apps\Qt5\translations\qtbase_it.qm %REOS_INSTALL%\i18n copy /v /y %OSGEO4W_ROOT%\apps\Qt5\translations\qtbase_es.qm %REOS_INSTALL%\i18n\qtbase_es.qm copy /v /y %OSGEO4W_ROOT%\apps\Qt5\translations\qtbase_fr.qm %REOS_INSTALL%\i18n\qtbase_fr.qm -rem echo "///////////////////// Test launch Lekan application, start it and wait 30s -rem start %REOS_INSTALL%\bin\Lekan.exe test -rem ping -n 30 127.0.0.1 -rem tasklist /fi "ImageName eq Lekan.exe" /fo csv 2>NUL | find /I "Lekan.exe">NUL -rem if %ERRORLEVEL% NEQ 0 ( -rem echo "///////////////////// Test launch Lekan application fails -rem exit %ERRORLEVEL% -rem ) else ( -rem echo "///////////////////// Test launch Lekan application success -rem taskkill /F /IM Lekan.exe -rem ) +echo "///////////////////// Test launch Lekan application, start it and wait 30s +start %REOS_INSTALL%\bin\Lekan.exe test +ping -n 30 127.0.0.1 +tasklist /fi "ImageName eq Lekan.exe" /fo csv 2>NUL | find /I "Lekan.exe">NUL +if %ERRORLEVEL% NEQ 0 ( +echo "///////////////////// Test launch Lekan application fails +exit %ERRORLEVEL% + ) else ( +echo "///////////////////// Test launch Lekan application success +taskkill /F /IM Lekan.exe + ) echo on