Commit de7d3405 authored by unknown's avatar unknown
Browse files

v0.1.11.26 calibration button now disable until a dataset, a model or a parameter is changed

parent f686d602
Package: airGRteaching
Type: Package
Title: Tools to Simplify the Use of the airGR Hydrological Package for Education (Including a Shiny Interface)
Version: 0.1.11.25
Date: 2018-02-01
Version: 0.1.11.26
Date: 2018-02-07
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: devtools, dygraphs (>= 1.1.1.4), markdown, plotrix, shiny, shinyjs, xts
......
......@@ -49,9 +49,9 @@ shinyServer(function(input, output, session) {
## Enable or disable automatic calibration (if there is Qobs or not)
isQobs <- !all(is.na(PREP$Qobs[PREP$InputsModel$Dates >= input$Period[1] & PREP$InputsModel$Dates <= input$Period[2]]))
if (isQobs | input$Period[1L] != input$Period[2L]) {
shinyjs::enable("CalButton")
}
# if ( isQobs | input$Period[1L] != input$Period[2L]) {
# shinyjs::enable("CalButton")
# }
if (!isQobs | input$Period[1L] == input$Period[2L]) {
shinyjs::disable("CalButton")
}
......@@ -99,22 +99,24 @@ shinyServer(function(input, output, session) {
}
updateActionButton(session, inputId = "CalButton", label = "Model calibrated", icon = icon("check"))
CAL_click$valueButton <- 1
## Enable caliration
if (input$Period[1L] != input$Period[2L]) {
shinyjs::enable("CalButton")
}
shinyjs::disable("CalButton")
## Enable calibration
# if (input$Period[1L] != input$Period[2L]) {
# lapply(getInputs(), shinyjs::enable)
# shinyjs::enable("CalButton")
# }
}, priority = +20)
## Manual calibration
observeEvent({input$Dataset ; input$HydroModel ; input$SnowModel ;
input$X1 ; input$X2 ; input$X3 ; input$X4 ; input$X5 ; input$X6 ; input$C1 ; input$C2 ;
input$TypeCrit ; input$Period}, {
CAL_click$valueButton <- CAL_click$valueButton - 1
CAL_click$valueButton <- CAL_click$valueButton - 1
CAL_click$valueButton <- ifelse(CAL_click$valueButton < -1, -1, CAL_click$valueButton)
if (CAL_click$valueButton < 0) {
updateActionButton(session, inputId = "CalButton", label = "Run", icon = icon("refresh"))
shinyjs::enable("CalButton")
}
## Enable all inputs except automatic calibration
......@@ -122,7 +124,7 @@ shinyServer(function(input, output, session) {
lapply(getInputs(), shinyjs::enable)
}
})
## --------------- Simulation
......
Markdown is supported
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