From ef0dc4d45270ff50694a8fde53f4f52d7616dea9 Mon Sep 17 00:00:00 2001
From: Daniel Vedder <daniel.vedder@idiv.de>
Date: Fri, 6 Sep 2024 10:21:09 +0200
Subject: [PATCH] Fixed a bug in map loading, bumped to v0.2.1
---
Manifest.toml | 4 ++--
Project.toml | 2 +-
src/GUI.jl | 8 ++++----
src/logic.jl | 3 +--
4 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/Manifest.toml b/Manifest.toml
index 4ce8180..428f68b 100644
--- a/Manifest.toml
+++ b/Manifest.toml
@@ -1239,9 +1239,9 @@ version = "4.1.6+0"
[[deps.OpenSSL_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
-git-tree-sha1 = "a028ee3cb5641cccc4c24e90c36b0a4f7707bdf5"
+git-tree-sha1 = "1b35263570443fdd9e76c76b7062116e2f374ab8"
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
-version = "3.0.14+0"
+version = "3.0.15+0"
[[deps.OpenSpecFun_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"]
diff --git a/Project.toml b/Project.toml
index ee77cc4..eedbd3e 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,7 +1,7 @@
name = "PersefoneDesktop"
uuid = "78b50b3d-c6fc-409a-aced-ad0772f04556"
authors = ["Daniel Vedder <daniel.vedder@idiv.de>"]
-version = "0.2.0"
+version = "0.2.1"
[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
diff --git a/src/GUI.jl b/src/GUI.jl
index be70fbc..2ed0468 100644
--- a/src/GUI.jl
+++ b/src/GUI.jl
@@ -3,15 +3,13 @@
### This file links the QML UI designs to the underlying model.
###
-
function loadsimulation(filename)
- global model, landcovermap
+ global model
@emit showSplash()
fn = convert(filename, String)
startswith(fn, "file://") && (fn = fn[8:end])
running[] = false
model = loadmodelobject(fn)
- landcovermap = rotr90(load(@param(world.landcovermap)))
date[] = model.date
progress[] = (date[]-@param(core.startdate)) /
(@param(core.enddate)-@param(core.startdate))
@@ -58,7 +56,9 @@ function render_map(screen)
launching[] && return display(screen, Figure().scene) # blank screen at launch
println("Updating map")
if isnothing(mapimage)
- landcover = rotr90(load(joinpath(@param(world.mapdirectory), @param(world.landcovermap))))
+ landcover = rotr90(load(joinpath(pkgdir(@__MODULE__),
+ @param(world.mapdirectory),
+ @param(world.landcovermap))))
mapimage = Figure()
ax = Axis(mapimage[1,1])
hidedecorations!(ax)
diff --git a/src/logic.jl b/src/logic.jl
index b8795ec..729f105 100644
--- a/src/logic.jl
+++ b/src/logic.jl
@@ -4,7 +4,7 @@
###
@resumable function createlaunchfunction()
- global model, landcovermap
+ global model
running[] = false
progress[] = 0.0
@yield 1
@@ -13,7 +13,6 @@
model.date -= Day(1)
Persefone.outputdata(model, true) # record data before run starts
model.date += Day(1)
- landcovermap = rotr90(load(joinpath(@param(world.mapdirectory), @param(world.landcovermap))))
date[] = model.date
launching[] = false
end
--
GitLab