diff --git a/.Rbuildignore b/.Rbuildignore old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/DESCRIPTION b/DESCRIPTION old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/NAMESPACE b/NAMESPACE old mode 100644 new mode 100755 diff --git a/R/data_pvs.R b/R/data_pvs.R old mode 100644 new mode 100755 diff --git a/R/fbcheck_server.R b/R/fbcheck_server.R old mode 100644 new mode 100755 diff --git a/R/fbcheck_server_sbase.R b/R/fbcheck_server_sbase.R old mode 100644 new mode 100755 index 325e92b..83ee139 --- a/R/fbcheck_server_sbase.R +++ b/R/fbcheck_server_sbase.R @@ -50,9 +50,18 @@ fbcheck_server_sbase <- function(input, output, session, values) { file_fbapp <- input$file_fbapp_sbase if (is.null(file_fbapp)) return(NULL) dt <- readr::read_csv(file_fbapp$datapath) + + if(!is.element("plot_name", names(dt))){ + shinysky::showshinyalert(session, "alert_fbapp_warning_sbase", paste("ERROR: The file imported does not has 'plot_name' header."), styleclass = "danger") + } else if(nrow(dt)==1){ + shinysky::showshinyalert(session, "alert_fbapp_warning_sbase", paste("ERROR: Your data file has only one row of data. Please upload the right one. "), styleclass = "danger") + } else { + hot_bdata <- fbapp2hidap(dt) + } + #dt <- readr::read_csv(file ="D:\\HIDAP_DOCUMENTATION_AND_EXAMPLES\\HIDAP-SweetPotatoBase\\FieldBookApp\\formato para subir a la base de datos\\fbapp_trial1_sbase_bryanEllerbrock.csv") # Data wrangling ---------------------------------------------------------- - hot_bdata <- fbapp2hidap(dt) + #} hot_bdata @@ -101,6 +110,21 @@ fbcheck_server_sbase <- function(input, output, session, values) { ) } }) + #### temp + + + + # output$tbl <- renderTable({ + # rv$data + # }) + + + + ### end temp + + + + #Return the type of crop in Minimal sheet hot_crop_sbase <- reactive({ @@ -142,6 +166,8 @@ fbcheck_server_sbase <- function(input, output, session, values) { DF = values[["hot_btable_fbapp_sbase"]] } + + # if(input$calculate_sbase>0){ # # DF <- values[["hot_btable_fbapp_sbase"]] @@ -149,6 +175,9 @@ fbcheck_server_sbase <- function(input, output, session, values) { # #DF <- temp # } + print("print DF") + print(DF) + print("end d") if(!is.null(DF)){ @@ -234,13 +263,38 @@ fbcheck_server_sbase <- function(input, output, session, values) { content = function(con) { path <- fbglobal::get_base_dir() #print(path) + shiny::withProgress(message = 'Downloading file', value = 0, { + + incProgress(1/6, detail = paste("Reading HIDAP data...")) path <- file.path(path,"hot_fieldbook_sbase.rds") + + #print(path) DF <- readRDS(path) + + incProgress(2/6, detail = paste("Formatting hidap file...")) + fb<- hidap2fbApp(fieldbook = DF) + + incProgress(3/6, detail = paste("Downloading FieldBookApp-SPBase file...")) + + incProgress(4/6, detail = paste("Refreshing HIDAP...")) + + Sys.sleep(3) + incProgress(5/6, detail = paste("Refreshing HIDAP...")) + write.csv(fb, con,row.names = FALSE) + + incProgress(6/6, detail = paste("Refreshing HIDAP...")) + Sys.sleep(5) + shinyjs::js$downloadData() + }) + + } ) } + + diff --git a/R/fbcheck_ui.R b/R/fbcheck_ui.R old mode 100644 new mode 100755 diff --git a/R/fbcheck_ui_sbase.R b/R/fbcheck_ui_sbase.R old mode 100644 new mode 100755 index bdb4dab..5beef62 --- a/R/fbcheck_ui_sbase.R +++ b/R/fbcheck_ui_sbase.R @@ -11,6 +11,8 @@ fbcheck_ui_sbase <- function(type="tab", title="Data Quality and Processing", na #begin data_processing tabItem shinydashboard::tabItem(tabName = name, h2(title), + shinyjs::useShinyjs(), + shinyjs::extendShinyjs(text = "shinyjs.downloadData = function() { location.reload(); }"), # shinyWidgets::awesomeRadio(inputId = "fbdesign_dsource_sbase", # label = "Select data source", choices = c("HIDAP", @@ -47,7 +49,7 @@ fbcheck_ui_sbase <- function(type="tab", title="Data Quality and Processing", na shiny::fileInput(inputId = "file_fbapp_sbase", label = "Choose CSV File", multiple = FALSE, accept = c("text/csv","text/comma-separated-values,text/plain", ".csv")), - + #actionButton('reset', 'Reset Input'), HTML('
'), shiny::downloadLink('downloadData', 'Download'), @@ -75,7 +77,7 @@ fbcheck_ui_sbase <- function(type="tab", title="Data Quality and Processing", na # HTML('
'), # shiny::actionLink('exportButton', 'Download data'), # HTML('
'), - shinysky::shinyalert("alert_fb_warning_sbase", FALSE, auto.close.after = 4), + shinysky::shinyalert("alert_fbapp_warning_sbase", FALSE, auto.close.after = 4), # conditionalPanel( # condition = "input.fbdesign_dsource_sbase == 'HIDAP'", diff --git a/R/trait_function.R b/R/trait_function.R old mode 100644 new mode 100755 diff --git a/R/utils.R b/R/utils.R old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/data/selcriteria.rda b/data/selcriteria.rda old mode 100644 new mode 100755 diff --git a/fbcheck.Rproj b/fbcheck.Rproj old mode 100644 new mode 100755 diff --git a/inst/app/app.R b/inst/app/app.R old mode 100644 new mode 100755 diff --git a/inst/app_fbcheck/PTYL200211_CHIARA.xlsx b/inst/app_fbcheck/PTYL200211_CHIARA.xlsx old mode 100644 new mode 100755 diff --git a/inst/app_fbcheck/app.R b/inst/app_fbcheck/app.R old mode 100644 new mode 100755 diff --git a/inst/app_fbcheck/table_dictionary_potato.rda b/inst/app_fbcheck/table_dictionary_potato.rda old mode 100644 new mode 100755 diff --git a/inst/app_fbcheck/table_dictionary_sweetpotato.rda b/inst/app_fbcheck/table_dictionary_sweetpotato.rda old mode 100644 new mode 100755 diff --git a/inst/crop_ontology/potato/dictionary/table_dictionary_potato.rda b/inst/crop_ontology/potato/dictionary/table_dictionary_potato.rda old mode 100644 new mode 100755 diff --git a/inst/crop_ontology/sweetpotato/dictionary/table_dictionary_sweetpotato.rda b/inst/crop_ontology/sweetpotato/dictionary/table_dictionary_sweetpotato.rda old mode 100644 new mode 100755 diff --git a/man/fbapp2hidap.Rd b/man/fbapp2hidap.Rd old mode 100644 new mode 100755 diff --git a/man/fbcheck_server.Rd b/man/fbcheck_server.Rd old mode 100644 new mode 100755 diff --git a/man/fbcheck_server_sbase.Rd b/man/fbcheck_server_sbase.Rd old mode 100644 new mode 100755 diff --git a/man/fbcheck_ui.Rd b/man/fbcheck_ui.Rd old mode 100644 new mode 100755 diff --git a/man/fbcheck_ui_sbase.Rd b/man/fbcheck_ui_sbase.Rd old mode 100644 new mode 100755 diff --git a/man/form_checker.Rd b/man/form_checker.Rd old mode 100644 new mode 100755 diff --git a/man/form_parameters.Rd b/man/form_parameters.Rd old mode 100644 new mode 100755 diff --git a/man/get.fb.param.Rd b/man/get.fb.param.Rd old mode 100644 new mode 100755 diff --git a/man/get_pvs_param.Rd b/man/get_pvs_param.Rd old mode 100644 new mode 100755 diff --git a/man/hidap2fbApp.Rd b/man/hidap2fbApp.Rd old mode 100644 new mode 100755 diff --git a/man/out_form_table.Rd b/man/out_form_table.Rd old mode 100644 new mode 100755 diff --git a/man/rhandsontable_update.Rd b/man/rhandsontable_update.Rd old mode 100644 new mode 100755 diff --git a/man/scale_trait.Rd b/man/scale_trait.Rd old mode 100644 new mode 100755 diff --git a/man/selcriteria.Rd b/man/selcriteria.Rd old mode 100644 new mode 100755 diff --git a/man/split_tidy_form.Rd b/man/split_tidy_form.Rd old mode 100644 new mode 100755 diff --git a/man/trait_type.Rd b/man/trait_type.Rd old mode 100644 new mode 100755 diff --git a/man/x_form.Rd b/man/x_form.Rd old mode 100644 new mode 100755 diff --git a/man/x_values.Rd b/man/x_values.Rd old mode 100644 new mode 100755 diff --git a/tests/testthat.R b/tests/testthat.R old mode 100644 new mode 100755 diff --git a/tests/testthat/excel/F7_OneEmptyForm_QUILCAS.xlsx b/tests/testthat/excel/F7_OneEmptyForm_QUILCAS.xlsx old mode 100644 new mode 100755 diff --git a/tests/testthat/excel/PTPVS032013_Jumla_exp3.xlsx b/tests/testthat/excel/PTPVS032013_Jumla_exp3.xlsx old mode 100644 new mode 100755 diff --git a/tests/testthat/excel/PTPVS032013_Jumla_exp3_NA_character.xlsx b/tests/testthat/excel/PTPVS032013_Jumla_exp3_NA_character.xlsx old mode 100644 new mode 100755 diff --git a/tests/testthat/excel/PTPVS032013_Jumla_exp3_VACIO.xlsx b/tests/testthat/excel/PTPVS032013_Jumla_exp3_VACIO.xlsx old mode 100644 new mode 100755 diff --git a/tests/testthat/excel/PTPVS112016_CANAYPATA_exp1.xlsx b/tests/testthat/excel/PTPVS112016_CANAYPATA_exp1.xlsx old mode 100644 new mode 100755 diff --git a/tests/testthat/excel/PTPVS112016_PMVL_exp1PEREZparacorrer - Copy.xlsx b/tests/testthat/excel/PTPVS112016_PMVL_exp1PEREZparacorrer - Copy.xlsx old mode 100644 new mode 100755 diff --git a/tests/testthat/excel/genetic_design/LXT/PTYield072013_CIPSRM_exp2.-.Copy.xlsx b/tests/testthat/excel/genetic_design/LXT/PTYield072013_CIPSRM_exp2.-.Copy.xlsx old mode 100644 new mode 100755 diff --git a/tests/testthat/excel/genetic_design/LXT/~$PTYield072013_CIPSRM_exp2.-.Copy.xlsx b/tests/testthat/excel/genetic_design/LXT/~$PTYield072013_CIPSRM_exp2.-.Copy.xlsx old mode 100644 new mode 100755 diff --git a/tests/testthat/excel/missingval_form18.xlsx b/tests/testthat/excel/missingval_form18.xlsx old mode 100644 new mode 100755 diff --git a/tests/testthat/test_organoleptic.R b/tests/testthat/test_organoleptic.R old mode 100644 new mode 100755