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
Type: Package
Title: Tools to Simplify the Use of the airGR Hydrological Package for Education (Including a Shiny Interface)
Version: 0.1.6.7
Date: 2017-09-27
Version: 0.1.6.8
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")))
Depends: airGR (>= 1.0.9.43)
Imports: xts, dygraphs (>= 1.1.1.4), shiny, plotrix, markdown
......
......@@ -25,15 +25,16 @@ if (getRversion() >= "2.15.1") {
}
StrName <- "(.*)(GR)(\\d{1})(\\D{1})"
NameModel <- gsub(StrName, "\\2\\3\\4", x)
TimeUnitFR <- gsub(StrName, "\\4", x)
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)
NbParam <- gsub(StrName, "\\3", x)
isCN <- grepl("CemaNeige" , x)
res <- list(TypeModel = x, NbParam = as.numeric(NbParam),
TimeUnit = TimeUnit, TimeLag = TimeLag,
CemaNeige = isCN)
res <- list(TypeModel = x, NameModel = NameModel, CemaNeige = isCN,
NbParam = as.numeric(NbParam),
TimeUnit = TimeUnit, TimeLag = TimeLag)
return(res)
}
......
......@@ -137,6 +137,15 @@ shinyServer(function(input, output, session) {
if (length(.GlobalEnv$.ShinyGR.hist[[1]]$Qsim) != length(.GlobalEnv$.ShinyGR.hist[[2]]$Qsim)) {
OBSold <- getPrep()$OBS
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,
Param = .GlobalEnv$.ShinyGR.hist[[1]]$Param,
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