From 40c7cec92f6692d56dd975cf9c558375f385a20d Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.fr>
Date: Wed, 29 Apr 2020 08:06:59 +0000
Subject: [PATCH] v0.2.10.32 UPDATE: all parameter units are now surrounded by
 brackets in the subtitle of the exported diagram plot of the GUI #14

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

diff --git a/DESCRIPTION b/DESCRIPTION
index a52e1fc..9caeb49 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.31
+Version: 0.2.10.32
 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 65ab846..0250695 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -4,7 +4,7 @@
 
 
 
-### 0.2.10.31 Release Notes (2020-04-29)
+### 0.2.10.32 Release Notes (2020-04-29)
 
 
 #### New features
diff --git a/inst/ShinyGR/server.R b/inst/ShinyGR/server.R
index 0facdd1..9702259 100644
--- a/inst/ShinyGR/server.R
+++ b/inst/ShinyGR/server.R
@@ -973,10 +973,12 @@ shinyServer(function(input, output, session) {
         ParamTitle <- c(ParamTitle, "C1", "C2")
         ParamUnits <- c(ParamUnits,  "", "mm/°C/%s")
       }
-      ParamTitle <- paste(ParamTitle, paste(getSim()$PARAM, sprintf(ParamUnits, getPrep()$TMGR$TimeUnit)), sep = " = ", collapse = ", ")
       if (input$HydroModel == "GR2M") {
-        ParamTitle <- gsub("\\[-\\].*", "[-]", ParamTitle)
+        ParamUnits <- gsub("\\[-\\].*", "", ParamUnits)
       }
+      ParamUnits <- sprintf("[%s]", ParamUnits)
+      ParamUnits <- gsub("\\[\\]", "[-]", ParamUnits)
+      ParamTitle <- paste(ParamTitle, paste(getSim()$PARAM, sprintf(ParamUnits, getPrep()$TMGR$TimeUnit)), sep = " = ", collapse = ", ")
       ParamTitle <- gsub(" ,", ",", ParamTitle)
       PngTitle <- sprintf("%s - %s/%s\n%s\n%s", input$Dataset,
                           input$HydroModel, ifelse(input$SnowModel == "CemaNeige", "CemaNeige", "No snow model"),
-- 
GitLab