From 8300e545030e3fa6b1389e74565cc4e1a0685a12 Mon Sep 17 00:00:00 2001 From: Erik Leppo Date: Mon, 4 Nov 2024 13:25:16 -0500 Subject: [PATCH] v2.0.7.9035 - refactor: Add pop up on HOBOware reformat for date time conversion - Success and failure --- DESCRIPTION | 2 +- NEWS | 9 +++++- NEWS.md | 9 +++++- NEWS.rmd | 6 ++++ inst/shiny-examples/ContDataQC/global.R | 2 +- inst/shiny-examples/ContDataQC/server.R | 38 +++++++++++++++++++++++++ 6 files changed, 62 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index bb2dec8..1d6433f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ContDataQC Title: Quality Control (QC) of Continous Monitoring Data -Version: 2.0.7.9034 +Version: 2.0.7.9035 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 15c3625..32ba7e8 100644 --- a/NEWS +++ b/NEWS @@ -3,10 +3,17 @@ NEWS-ContDataQC - #> Last Update: 2024-10-18 09:53:59.053843 + #> Last Update: 2024-11-04 13:25:07.843989 # Version History +## v2.0.7.9035 + +2024-11-04 + +- refactor: Add pop up on HOBOware reformat for date time conversion + - Success and failure + ## v2.0.7.9034 2024-10-18 diff --git a/NEWS.md b/NEWS.md index 15c3625..32ba7e8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,10 +3,17 @@ NEWS-ContDataQC - #> Last Update: 2024-10-18 09:53:59.053843 + #> Last Update: 2024-11-04 13:25:07.843989 # Version History +## v2.0.7.9035 + +2024-11-04 + +- refactor: Add pop up on HOBOware reformat for date time conversion + - Success and failure + ## v2.0.7.9034 2024-10-18 diff --git a/NEWS.rmd b/NEWS.rmd index 6d03fc8..d35ec5a 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -21,6 +21,12 @@ cat(paste0("Last Update: ",Sys.time())) # Version History +## v2.0.7.9035 +2024-11-04 + +* refactor: Add pop up on HOBOware reformat for date time conversion + + Success and failure + ## v2.0.7.9034 2024-10-18 diff --git a/inst/shiny-examples/ContDataQC/global.R b/inst/shiny-examples/ContDataQC/global.R index e7232b1..0a20b89 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.9034" +version <- "2.0.7.9035" #Maximum individual file size that can be uploaded is 70 MB options(shiny.maxRequestSize = 70 * 1024^2) diff --git a/inst/shiny-examples/ContDataQC/server.R b/inst/shiny-examples/ContDataQC/server.R index c54271d..0f4a083 100644 --- a/inst/shiny-examples/ContDataQC/server.R +++ b/inst/shiny-examples/ContDataQC/server.R @@ -564,6 +564,11 @@ shinyServer(function(input, output, session) { message("File Name Vector") message(fileNameVector) + #~~~ + # testing, 2024-11-04 + # test after, too much to check before + #~~~ + #Changes the status bar to say that aggregation is occurring incProgress(0, detail = paste("Format Hobo ", length(fileNameVector), " files")) @@ -582,6 +587,39 @@ shinyServer(function(input, output, session) { ) # formatHOBO ~ END )## consoleRow ~ END + #~~~ + # testing, 2024-11-04 + df_test <- utils::read.delim(file.path("HOBO", fileNameVector) + , skip = 0 + , header = TRUE + , sep = "," + , check.names = FALSE + , stringsAsFactors = FALSE) + # pop up + na_date <- is.na(df_test[,ContData.env$myName.DateTime]) + if (any(na_date)) { + # pop up + n_na <- sum(na_date) + msg <- paste0("Some 'Date Time' records did not convert!\n\n" + , n_na, " / ", nrow(df_test), " records converted to 'NA'.\n\n" + , "The user specified format '" + , HOBO_DateFormat_User + , "' " + , "did not match the data.\n\n" + , "Try another format and/or check your data in Notepad " + , "(or other similar text editor). " + , "Avoid Excel as it doesn't show dates or times 'as is'.") + } else { + msg <- "Date Time converted without issues." + }## IF ~ any NA in datetime + shinyalert::shinyalert(title = "HOBOware Date Time Conversion" + , text = msg + , type = "info" + , closeOnEsc = TRUE + , closeOnClickOutside = TRUE) + validate(msg) + #~~~ + #Appends the R console output generated from that input file to the #console output data.frame consoleRow <- data.frame(consoleRow)