Commit aa6dccd0 authored by unknown's avatar unknown
Browse files

v0.1.6.8 bug fixed when zoom after changing snow model on plot to see the last...

v0.1.6.8 bug fixed when zoom after changing snow model on plot to see the last simulation in ShinyGR
Showing with 15 additions and 5 deletions
+15 -5
Package: airGRteaching Package: airGRteaching
Type: Package Type: Package
Title: Tools to Simplify the Use of the airGR Hydrological Package for Education (Including a Shiny Interface) Title: Tools to Simplify the Use of the airGR Hydrological Package for Education (Including a Shiny Interface)
Version: 0.1.6.7 Version: 0.1.6.8
Date: 2017-09-27 Date: 2017-09-28
Authors@R: c(person("Olivier", "Delaigue", role = c("aut", "cre"), email = "airGR@irstea.fr"), person("Laurent", "Coron", role = c("aut")), person("Pierre", "Brigode", role = c("aut")), person("Guillaume", "Thirel", role = c("ctb"))) Authors@R: c(person("Olivier", "Delaigue", role = c("aut", "cre"), email = "airGR@irstea.fr"), person("Laurent", "Coron", role = c("aut")), person("Pierre", "Brigode", role = c("aut")), person("Guillaume", "Thirel", role = c("ctb")))
Depends: airGR (>= 1.0.9.43) Depends: airGR (>= 1.0.9.43)
Imports: xts, dygraphs (>= 1.1.1.4), shiny, plotrix, markdown Imports: xts, dygraphs (>= 1.1.1.4), shiny, plotrix, markdown
......
...@@ -25,15 +25,16 @@ if (getRversion() >= "2.15.1") { ...@@ -25,15 +25,16 @@ if (getRversion() >= "2.15.1") {
} }
StrName <- "(.*)(GR)(\\d{1})(\\D{1})" StrName <- "(.*)(GR)(\\d{1})(\\D{1})"
NameModel <- gsub(StrName, "\\2\\3\\4", x)
TimeUnitFR <- gsub(StrName, "\\4", x) TimeUnitFR <- gsub(StrName, "\\4", x)
TimeUnit <- switch(TimeUnitFR, H = "hour", J = "day", M = "month", A = "year") TimeUnit <- switch(TimeUnitFR, H = "hour", J = "day", M = "month", A = "year")
TimeLag <- switch(TimeUnit, "hour" = 3600, "day" = 3600*24, "month" = 3600*24*31, "year" = 366) TimeLag <- switch(TimeUnit, "hour" = 3600, "day" = 3600*24, "month" = 3600*24*31, "year" = 366)
NbParam <- gsub(StrName, "\\3", x) NbParam <- gsub(StrName, "\\3", x)
isCN <- grepl("CemaNeige" , x) isCN <- grepl("CemaNeige" , x)
res <- list(TypeModel = x, NbParam = as.numeric(NbParam), res <- list(TypeModel = x, NameModel = NameModel, CemaNeige = isCN,
TimeUnit = TimeUnit, TimeLag = TimeLag, NbParam = as.numeric(NbParam),
CemaNeige = isCN) TimeUnit = TimeUnit, TimeLag = TimeLag)
return(res) return(res)
} }
......
...@@ -137,6 +137,15 @@ shinyServer(function(input, output, session) { ...@@ -137,6 +137,15 @@ shinyServer(function(input, output, session) {
if (length(.GlobalEnv$.ShinyGR.hist[[1]]$Qsim) != length(.GlobalEnv$.ShinyGR.hist[[2]]$Qsim)) { if (length(.GlobalEnv$.ShinyGR.hist[[1]]$Qsim) != length(.GlobalEnv$.ShinyGR.hist[[2]]$Qsim)) {
OBSold <- getPrep()$OBS OBSold <- getPrep()$OBS
OBSold$TypeModel <- .GlobalEnv$.ShinyGR.hist[[1]]$TypeModel OBSold$TypeModel <- .GlobalEnv$.ShinyGR.hist[[1]]$TypeModel
if (.TypeModelGR(OBSold)$CemaNeige & !.TypeModelGR(getPrep()$OBS)$CemaNeige) { # present: No CemaNeige ; old: CemaNeige
OBSold <- ObsGR(ObsBV = get(input$Dataset), HydroModel = .TypeModelGR(OBSold)$NameModel,
CemaNeige = .TypeModelGR(OBSold)$CemaNeige,
Precip = .ShinyGR.args$Precip, PotEvap = .ShinyGR.args$PotEvap,
Qobs = get(input$Dataset), TempMean = .ShinyGR.args$TempMean,
ZInputs = .ShinyGR.args$ZInputs, HypsoData = .ShinyGR.args$HypsoData,
NLayers = .ShinyGR.args$NLayers)
}
SIMold <- SimGR(ObsGR = OBSold, SIMold <- SimGR(ObsGR = OBSold,
Param = .GlobalEnv$.ShinyGR.hist[[1]]$Param, Param = .GlobalEnv$.ShinyGR.hist[[1]]$Param,
WupPer = substr(getPrep()$WUPPER, 1, 10), WupPer = substr(getPrep()$WUPPER, 1, 10),
......
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