diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 74e28f14..3a22c32c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,4 +1,4 @@ -name: Build, Test, and Push Docker Image +name: Docker on: push: diff --git a/README.md b/README.md index 4b816ea6..50ebc158 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,18 @@ --- + +[](https://www.gnu.org/licenses/gpl-3.0) +[](https://www.researchgate.net/publication/278769168_ForeFire_open-source_code_for_wildland_fire_spread_models) + [](https://github.com/forefireAPI/forefire/actions/workflows/main.yml) [](https://github.com/forefireAPI/forefire/actions/workflows/macos.yml) -[](https://www.gnu.org/licenses/gpl-3.0) +[](https://github.com/forefireAPI/forefire/actions/workflows/docker.yml) +[](https://forefire.readthedocs.io/en/latest/?badge=latest) + +[](https://github.com/forefireAPI/forefire/pkgs/container/forefire)   -[](https://forefire.readthedocs.io/en/latest/?badge=latest) -[](https://www.researchgate.net/publication/278769168_ForeFire_open-source_code_for_wildland_fire_spread_models) **ForeFire** is an open-source **wildfire simulation engine** written in C++. Developed by CNRS at the [Université de Corse Pascal Paoli](https://www.univ-corse.fr/), it is used for research and operational forecasting. The engine implements various fire behavior models and enables high-fidelity coupled fire-atmosphere simulations, aiming to improve wildfire prediction and understanding for complex environments. @@ -80,9 +85,11 @@ The easiest way to get started is often using Docker and the interactive console This server provides a graphical user interface that you can access on your browser at http://localhost:8000/ 6. Run your first simulation - - Run the command `include[real_case.ff]` - - Then press Refresh Map - + + In ForeFire, running a simulation and viewing the result are separate commands. The UI guides you through this process. + - **Step 1: Run the simulation script.** In the command input box, type `include[real_case.ff]` and click the **`Send`** button. The simulation will run on the server. + - **Step 2: View the result.** After the command finishes, click the **`Refresh Map`** button to load the simulation results onto the map. + You should see a simulation running in the Aullène region of Corsica. **This confirms your Docker setup is working!** Check the full documentation for more details on this example ## Build from source diff --git a/docs/source/_static/images/gui_real_case_ff.jpg b/docs/source/_static/images/gui_real_case_ff.jpg index 47628313..b2442405 100644 Binary files a/docs/source/_static/images/gui_real_case_ff.jpg and b/docs/source/_static/images/gui_real_case_ff.jpg differ diff --git a/docs/source/getting_started/quickstart.rst b/docs/source/getting_started/quickstart.rst index 6c57a130..2a575b13 100644 --- a/docs/source/getting_started/quickstart.rst +++ b/docs/source/getting_started/quickstart.rst @@ -66,9 +66,11 @@ Steps 8. **Run a Simulation:** - * In the web console's command input box, type: `include[real_case.ff]` and press Enter or click Send. - * Click the "Refresh Map" button. + In ForeFire, running a simulation and viewing the result are separate commands. The UI guides you through this. + * **Step 1: Run the simulation script.** In the command input box, type `include[real_case.ff]` and click the **`Send`** button. The simulation will run on the server. + * **Step 2: View the result.** After the command finishes, click the **`Refresh Map`** button to load the simulation results onto the map. + You should see a simulation running in the Aullène region of Corsica. .. image:: /_static/images/gui_real_case_ff.jpg diff --git a/src/HttpCommandServer.hpp b/src/HttpCommandServer.hpp index 29a4b97f..5708462a 100644 --- a/src/HttpCommandServer.hpp +++ b/src/HttpCommandServer.hpp @@ -291,12 +291,14 @@ namespace http_command { return buildResponse("200 OK", "text/html; charset=UTF-8", body); } else { if (!fileExists(path)) { - cout << "File not found: " << path << std::endl; if (const char* ffHome = std::getenv("FOREFIREHOME")) { std::string altPath = std::string(ffHome) +"/tools/htdocs/"+ path; - if (fileExists(altPath)) + if (fileExists(altPath)){ path = altPath; + } + } else { + cout << "FOREFIREHOME not set. File not found: " << path << std::endl; } } if (fileExists(path)) { diff --git a/tools/htdocs/index.html b/tools/htdocs/index.html index c26ce5fd..0b16b192 100644 --- a/tools/htdocs/index.html +++ b/tools/htdocs/index.html @@ -7,165 +7,17 @@ -