From 34cd227f1a0bfbb715d9c360dc80491cdc50538e Mon Sep 17 00:00:00 2001 From: Delaigue Olivier <olivier.delaigue@irstea.fr> Date: Tue, 14 Apr 2020 17:00:46 +0200 Subject: [PATCH] v0.2.10.12 BUG: Event date used to display the model diagram is trunced to the begin of the month in the GUI when GR2M is used #14 --- DESCRIPTION | 2 +- NEWS.md | 2 +- inst/ShinyGR/server.R | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 70f369e..3f365d0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: airGRteaching Type: Package Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included) -Version: 0.2.10.11 +Version: 0.2.10.12 Date: 2020-04-14 Authors@R: c( person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"), diff --git a/NEWS.md b/NEWS.md index 9d48fef..a3bed4b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ -### 0.2.10.11 Release Notes (2020-04-14) +### 0.2.10.12 Release Notes (2020-04-14) #### New features diff --git a/inst/ShinyGR/server.R b/inst/ShinyGR/server.R index d2d5756..1c00aed 100644 --- a/inst/ShinyGR/server.R +++ b/inst/ShinyGR/server.R @@ -846,10 +846,17 @@ shinyServer(function(input, output, session) { # OutputsModel2 <- c(OutputsModel2, Qobs = list(getSim()$SIM$Qobs[IndPlot])) # OutputsModel2 <- getData()$OutputsModel + if (input$HydroModel == "GR2M") { + dd <- trunc(input$Period, units = "months") + dateEvent <- trunc(input$Event, units = "months") + } else { + dd <- trunc(input$Period, units = "days") + dateEvent <- trunc(input$Event, units = "months") + } par(getPlotPar()$par) try(.DiagramGR(OutputsModel = getData()$OutputsModel, Param = getSim()$PARAM, - SimPer = input$Period, EventDate = input$Event, + SimPer = dd, EventDate = dateEvent, HydroModel = input$HydroModel, CemaNeige = input$SnowModel == "CemaNeige"), silent = TRUE) }, bg = "transparent") -- GitLab