From b26411100389148d04c98b5339a6056ec634d0df Mon Sep 17 00:00:00 2001 From: CIP-RIU Date: Mon, 28 May 2018 18:03:23 +0000 Subject: [PATCH] fbcheck for sbase test v.0.02 --- R/fbcheck_server_sbase.R | 24 +++++++++--------------- R/fbcheck_ui_sbase.R | 18 +++++++++--------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/R/fbcheck_server_sbase.R b/R/fbcheck_server_sbase.R index b37e820..325e92b 100644 --- a/R/fbcheck_server_sbase.R +++ b/R/fbcheck_server_sbase.R @@ -142,33 +142,27 @@ fbcheck_server_sbase <- function(input, output, session, values) { DF = values[["hot_btable_fbapp_sbase"]] } - if(input$calculate_sbase>0){ + # if(input$calculate_sbase>0){ + # + # DF <- values[["hot_btable_fbapp_sbase"]] + # DF <- rhandsontable_update(DF) + # #DF <- temp + # } - DF <- values[["hot_btable_fbapp_sbase"]] - DF <- rhandsontable_update(DF) - #DF <- temp - } - - #print("print DF") - #print(DF) if(!is.null(DF)){ #dsource <- hot_formatFile_sbase() #if(dsource=="FieldBookApp-SPBase") dsource <- 2 dsource <- 2 - traits <- traittools::get_trait_fb(DF, dsource = dsource) #print(traits) - - ##begin fbglobal - path <- fbglobal::get_base_dir() + path <- fbglobal::get_base_dir() ##begin fbglobal #print(path) path <- file.path(path,"hot_fieldbook_sbase.rds") #print(path) saveRDS(DF, path) #enf fbglobal - #print("checking with crop ontology") crop <- hot_crop_sbase() #trait_dict <- get_crop_ontology(crop = crop,trial = trial) @@ -239,9 +233,9 @@ fbcheck_server_sbase <- function(input, output, session, values) { }, content = function(con) { path <- fbglobal::get_base_dir() - print(path) + #print(path) path <- file.path(path,"hot_fieldbook_sbase.rds") - print(path) + #print(path) DF <- readRDS(path) fb<- hidap2fbApp(fieldbook = DF) write.csv(fb, con,row.names = FALSE) diff --git a/R/fbcheck_ui_sbase.R b/R/fbcheck_ui_sbase.R index 5006a5c..bdb4dab 100644 --- a/R/fbcheck_ui_sbase.R +++ b/R/fbcheck_ui_sbase.R @@ -25,7 +25,7 @@ fbcheck_ui_sbase <- function(type="tab", title="Data Quality and Processing", na # condition = "input.fbdesign_dsource_sbase == 'HIDAP'", # # try(shinyFiles::shinyFilesButton('file_sbase', 'File select', 'Please select a file',FALSE)), - shiny::actionButton("calculate_sbase", "Calculate",icon("play-circle-o")), + # shiny::actionButton("calculate_sbase", "Calculate",icon("play-circle-o")), # HTML('
'), # shiny::actionLink('exportButton_sbase', 'Download data'), # HTML('
'), @@ -48,10 +48,10 @@ 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")), + + HTML('
'), shiny::downloadLink('downloadData', 'Download'), - # HTML('
'), - # shiny::actionLink('exportButton_fbapp_sbase', 'Download data'), - # HTML('
')#, + HTML('
'), # ) #), @@ -86,17 +86,17 @@ fbcheck_ui_sbase <- function(type="tab", title="Data Quality and Processing", na #conditionalPanel( # condition = "input.fbdesign_dsource_sbase == 'FieldBookApp-SPBase'", - - box(rHandsontableOutput("hot_btable_fbapp_sbase",height = "1400px",width = "1000px"), + + box(rHandsontableOutput("hot_btable_fbapp_sbase",height = "100%",width = "100%"), height = "3400px",width ="2400px"), #), # ), tags$style(type='text/css', "#file_sbase { width:150px; margin-top: 25px;}"), - tags$style(HTML('#file_sbase {background-color:#0099cc; color: #ffffff}')), - tags$style(type='text/css', "#calculate_sbase { width:150px; margin-top: 25px;}"), - tags$style(HTML('#calculate_sbase {background-color:#21b073; color: #ffffff}')) + tags$style(HTML('#file_sbase {background-color:#0099cc; color: #ffffff}'))#, + #tags$style(type='text/css', "#calculate_sbase { width:150px; margin-top: 25px;}"), + #tags$style(HTML('#calculate_sbase {background-color:#21b073; color: #ffffff}')) )