Commit 2d7b8d75 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v0.2.10.28 CLEAN: minor code revisions in the server file (variables renamed) #14

Showing with 11 additions and 11 deletions
+11 -11
Package: airGRteaching
Type: Package
Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included)
Version: 0.2.10.27
Version: 0.2.10.28
Date: 2020-04-29
Authors@R: c(
person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"),
......
......@@ -4,7 +4,7 @@
### 0.2.10.27 Release Notes (2020-04-29)
### 0.2.10.28 Release Notes (2020-04-29)
#### New features
......
......@@ -217,13 +217,13 @@ shinyServer(function(input, output, session) {
## Simulated flows computation
PREP <- getPrep()$PREP
if (input$HydroModel == "GR2M") {
dd <- trunc(input$Period, units = "months")
SimPer <- trunc(input$Period, units = "months")
} else {
dd <- trunc(input$Period, units = "days")
SimPer <- trunc(input$Period, units = "days")
}
SIM <- SimGR(PrepGR = PREP, Param = PARAM,
WupPer = substr(getPrep()$WUPPER, 1, 10),
SimPer = c(substr(dd[1], 1, 10), substr(dd[2], 1, 10)),
SimPer = c(substr(SimPer[1], 1, 10), substr(SimPer[2], 1, 10)),
verbose = FALSE)
## Criteria computation
......@@ -296,14 +296,14 @@ shinyServer(function(input, output, session) {
CemaNeige = input$SnowModel == "CemaNeige")
}
if (input$HydroModel == "GR2M") {
dd <- trunc(input$Period, units = "months")
SimPer <- trunc(input$Period, units = "months")
} else {
dd <- trunc(input$Period, units = "days")
SimPer <- trunc(input$Period, units = "days")
}
SIMold <- SimGR(PrepGR = OBSold,
Param = .GlobalEnv$.ShinyGR.hist[[1]]$Param,
WupPer = substr(getPrep()$WUPPER, 1, 10),
SimPer = substr(c(dd[1], dd[2]), 1, 10),
SimPer = substr(c(SimPer[1], SimPer[2]), 1, 10),
verbose = FALSE)
if (!getPrep()$isUngauged) {
InputsCritMultiold <- CreateInputsCrit(FUN_CRIT = CRIT_opt$Crit,
......@@ -867,16 +867,16 @@ shinyServer(function(input, output, session) {
# OutputsModel2 <- getData()$OutputsModel
# dateEvent <- trunc(input$Event, units = ifelse(input$HydroModel == "GR2M", "months", "days"))
if (input$HydroModel == "GR2M") {
dd <- trunc(input$Period, units = "months")
SimPer <- trunc(input$Period, units = "months")
dateEvent <- trunc(input$EventGR2M, units = "months")
} else {
dd <- trunc(input$Period, units = "days")
SimPer <- trunc(input$Period, units = "days")
dateEvent <- trunc(input$Event, units = "days")
}
par(getPlotPar()$par)
try(.DiagramGR(OutputsModel = getData()$OutputsModel, Param = getSim()$PARAM,
SimPer = dd, EventDate = dateEvent,
SimPer = SimPer, EventDate = dateEvent,
HydroModel = input$HydroModel, CemaNeige = input$SnowModel == "CemaNeige"),
silent = TRUE)
}, bg = "transparent")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment