From 4971c7d95e14bb486953c5bbe84a5c35ea4b91f1 Mon Sep 17 00:00:00 2001 From: Erik Leppo Date: Mon, 2 Dec 2024 10:27:18 -0500 Subject: [PATCH] v2.0.7.9037 - fix: Update Shiny file upload parameter check to use names from config, Issue \#166 --- DESCRIPTION | 2 +- NEWS | 9 ++++- NEWS.md | 9 ++++- NEWS.rmd | 5 +++ inst/shiny-examples/ContDataQC/global.R | 47 ++++++++++++++++--------- 5 files changed, 53 insertions(+), 19 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 202cef2..69b6b62 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ContDataQC Title: Quality Control (QC) of Continous Monitoring Data -Version: 2.0.7.9036 +Version: 2.0.7.9037 Authors@R: c( person("Erik W", "Leppo", email="Erik.Leppo@tetratech.com",role=c("aut","cre")), person("Ann","Roseberry Lincoln", role="ctb"), diff --git a/NEWS b/NEWS index d73516a..3c29910 100644 --- a/NEWS +++ b/NEWS @@ -3,10 +3,17 @@ NEWS-ContDataQC - #> Last Update: 2024-11-14 12:21:43.318815 + #> Last Update: 2024-12-02 10:13:21.357636 # Version History +## v2.0.7.9037 + +2024-12-02 + +- fix: Update Shiny file upload parameter check to use names from + config, Issue \#166 + ## v2.0.7.9036 2024-11-14 diff --git a/NEWS.md b/NEWS.md index d73516a..3c29910 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,10 +3,17 @@ NEWS-ContDataQC - #> Last Update: 2024-11-14 12:21:43.318815 + #> Last Update: 2024-12-02 10:13:21.357636 # Version History +## v2.0.7.9037 + +2024-12-02 + +- fix: Update Shiny file upload parameter check to use names from + config, Issue \#166 + ## v2.0.7.9036 2024-11-14 diff --git a/NEWS.rmd b/NEWS.rmd index d6646a4..6562145 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -21,6 +21,11 @@ cat(paste0("Last Update: ",Sys.time())) # Version History +## v2.0.7.9037 +2024-12-02 + +* fix: Update Shiny file upload parameter check to use names from config, Issue #166 + ## v2.0.7.9036 2024-11-14 diff --git a/inst/shiny-examples/ContDataQC/global.R b/inst/shiny-examples/ContDataQC/global.R index c3bd581..62cb1e7 100644 --- a/inst/shiny-examples/ContDataQC/global.R +++ b/inst/shiny-examples/ContDataQC/global.R @@ -23,7 +23,7 @@ library(shinyalert) # Sys.setenv(PATH = paste(Sys.getenv("PATH"), "C:\\Rtools\\bin", sep = ";")) # Version Number -version <- "2.0.7.9036" +version <- "2.0.7.9037" #Maximum individual file size that can be uploaded is 70 MB options(shiny.maxRequestSize = 70 * 1024^2) @@ -87,21 +87,36 @@ fileParse <- function(inputFile) { #Changes the table's value to "found" if the #parameter is identified - waterTemp <- ifelse("Water.Temp.C" %in% colnames(inputFile), txt_f, txt_nf) - airTemp <- ifelse("Air.Temp.C" %in% colnames(inputFile), txt_f, txt_nf) - waterPressure <- ifelse("Water.P.psi" %in% colnames(inputFile), txt_f, txt_nf) - airPressure <- ifelse("Air.BP.psi" %in% colnames(inputFile), txt_f, txt_nf) - sensorDepth <- ifelse("Sensor.Depth.ft" %in% colnames(inputFile), txt_f, txt_nf) - discharge <- ifelse("Discharge.ft3.s" %in% colnames(inputFile), txt_f, txt_nf) - waterlevel <- ifelse("Water.Level.ft" %in% colnames(inputFile), txt_f, txt_nf) - cond <- ifelse("Conductivity.uS.cm" %in% colnames(inputFile), txt_f, txt_nf) - do <- ifelse("DO.mg.L" %in% colnames(inputFile), txt_f, txt_nf) - do_adj <- ifelse("DO.adj." %in% colnames(inputFile), txt_f, txt_nf) - do_pctsat <- ifelse("DO.pctsat.%" %in% colnames(inputFile), txt_f, txt_nf) - pH <- ifelse("pH.SU" %in% colnames(inputFile), txt_f, txt_nf) - turbidity <- ifelse("Turbidity.NTU" %in% colnames(inputFile), txt_f, txt_nf) - chla <- ifelse("Chlorophylla.g.cm3" %in% colnames(inputFile), txt_f, txt_nf) - + # waterTemp <- ifelse("Water.Temp.C" %in% colnames(inputFile), txt_f, txt_nf) + # airTemp <- ifelse("Air.Temp.C" %in% colnames(inputFile), txt_f, txt_nf) + # waterPressure <- ifelse("Water.P.psi" %in% colnames(inputFile), txt_f, txt_nf) + # airPressure <- ifelse("Air.BP.psi" %in% colnames(inputFile), txt_f, txt_nf) + # sensorDepth <- ifelse("Sensor.Depth.ft" %in% colnames(inputFile), txt_f, txt_nf) + # discharge <- ifelse("Discharge.ft3.s" %in% colnames(inputFile), txt_f, txt_nf) + # waterlevel <- ifelse("Water.Level.ft" %in% colnames(inputFile), txt_f, txt_nf) + # cond <- ifelse("Conductivity.uS.cm" %in% colnames(inputFile), txt_f, txt_nf) + # do <- ifelse("DO.mg.L" %in% colnames(inputFile), txt_f, txt_nf) + # do_adj <- ifelse("DO.adj.mg.L" %in% colnames(inputFile), txt_f, txt_nf) + # do_pctsat <- ifelse("DO.pctsat.percent" %in% colnames(inputFile), txt_f, txt_nf) + # pH <- ifelse("pH.SU" %in% colnames(inputFile), txt_f, txt_nf) + # turbidity <- ifelse("Turbidity.NTU" %in% colnames(inputFile), txt_f, txt_nf) + # chla <- ifelse("Chlorophylla.g.cm3" %in% colnames(inputFile), txt_f, txt_nf) + # 20241202, modify to use values from config + waterTemp <- ifelse(ContData.env$myName.WaterTemp %in% colnames(inputFile), txt_f, txt_nf) + airTemp <- ifelse(ContData.env$myName.AirTemp %in% colnames(inputFile), txt_f, txt_nf) + waterPressure <- ifelse(ContData.env$myName.WaterP %in% colnames(inputFile), txt_f, txt_nf) + airPressure <- ifelse(ContData.env$myName.AirBP %in% colnames(inputFile), txt_f, txt_nf) + sensorDepth <- ifelse(ContData.env$myName.SensorDepth %in% colnames(inputFile), txt_f, txt_nf) + discharge <- ifelse(ContData.env$myName.Discharge %in% colnames(inputFile), txt_f, txt_nf) + waterlevel <- ifelse(ContData.env$myName.WaterLevel %in% colnames(inputFile), txt_f, txt_nf) + cond <- ifelse(ContData.env$myName.Cond %in% colnames(inputFile), txt_f, txt_nf) + do <- ifelse(ContData.env$myName.DO %in% colnames(inputFile), txt_f, txt_nf) + do_adj <- ifelse(ContData.env$myName.DO.adj %in% colnames(inputFile), txt_f, txt_nf) + do_pctsat <- ifelse(ContData.env$myName.DO.pctsat %in% colnames(inputFile), txt_f, txt_nf) + pH <- ifelse(ContData.env$myName.pH %in% colnames(inputFile), txt_f, txt_nf) + turbidity <- ifelse(ContData.env$myName.Turbidity %in% colnames(inputFile), txt_f, txt_nf) + chla <- ifelse(ContData.env$myName.Chlorophylla %in% colnames(inputFile), txt_f, txt_nf) + # salinity not included #Compiles all spreadsheet properties into a single data.frame siteDF <- data.frame(siteID