From 2d7b8d7543393b2bc2b26fdc5761edf2be4547ed Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.fr>
Date: Wed, 29 Apr 2020 05:59:34 +0000
Subject: [PATCH] v0.2.10.28 CLEAN: minor code revisions in the server file
 (variables renamed) #14

---
 DESCRIPTION           |  2 +-
 NEWS.md               |  2 +-
 inst/ShinyGR/server.R | 18 +++++++++---------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 87a8a82..97a329a 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.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"),
diff --git a/NEWS.md b/NEWS.md
index 539d102..fb1ee1a 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -4,7 +4,7 @@
 
 
 
-### 0.2.10.27 Release Notes (2020-04-29)
+### 0.2.10.28 Release Notes (2020-04-29)
 
 
 #### New features
diff --git a/inst/ShinyGR/server.R b/inst/ShinyGR/server.R
index f9accaa..bb33246 100644
--- a/inst/ShinyGR/server.R
+++ b/inst/ShinyGR/server.R
@@ -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")
-- 
GitLab