Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
variables.jl 2.13 KiB
### PersefoneDesktop - a GUI to the Persefone model of agriculture and ecosystems
###
### This file contains all global variables and Observables.
###


## GUI variables

global model = nothing
global runsimulation = () -> nothing
global newsimulation = () -> nothing
global timer = nothing
global mapimage = nothing
global plotimage = nothing

const configfile = Observable("guiparams.toml")
const launching = Observable(false)
const running = Observable(false)
const ticks = Observable(0)
const date = Observable(today())
const progress = Observable(0.0)
const delay = Observable(0.5)
const runbuttontext = Observable(">>")
const runbuttontip = Observable("Run")


## configuration parameters

const userconfigfile = Observable("userconfig.toml") #XXX not yet needed
const outdir = Observable("persefone_output")
const csvoutput = Observable(false)
const loglevel = Observable("warn")
const processors = Observable(1)
const seed = Observable(2)
const startdateday = Observable(1)
const startdatemonth = Observable(1)
const startdateyear = Observable(2021)
const enddateday = Observable(31)
const enddatemonth = Observable(12)
const enddateyear = Observable(2022)
const region = Observable("Jena")
const farmmodel = Observable("BasicFarmer")
const species = Observable("Skylark")
#const targetspecies = Observable() #TODO not sure how to configure a list?
const cropmodel = Observable("ALMaSS") #XXX alternatives not yet implemented


## the property list passed to QML

global guiproperties =
    ["launching" => launching,
     "running" => running,
     "ticks" => ticks,
     "date" => date,
     "delay" => delay,
     "progress" => progress,
     "runbuttontext" => runbuttontext,
     "runbuttontip" => runbuttontip,
     "userconfigfile" => userconfigfile,
     "outdir" => outdir,
     "csvoutput" => csvoutput,
     "loglevel" => loglevel,
     "processors" => processors,
     "seed" => seed,
     "startdateday" => startdateday,
     "startdatemonth" => startdatemonth,
     "startdateyear" => startdateyear,
     "enddateday" => enddateday,
     "enddatemonth" => enddatemonth,
     "enddateyear" => enddateyear,
     "region" => region,
     "cropmodel" => cropmodel]