Skip to content

Commit

Permalink
fbcheck for sbase test v.0.02
Browse files Browse the repository at this point in the history
  • Loading branch information
CIP-RIU committed May 28, 2018
1 parent 41caa3e commit b264111
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
24 changes: 9 additions & 15 deletions R/fbcheck_server_sbase.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
18 changes: 9 additions & 9 deletions R/fbcheck_ui_sbase.R
Original file line number Diff line number Diff line change
Expand Up @@ -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('<div style="float: right; margin: 0 5px 5px 10px;">'),
# shiny::actionLink('exportButton_sbase', 'Download data'),
# HTML('</div>'),
Expand All @@ -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('<div style="float: right; margin: 0 5px 5px 10px;">'),
shiny::downloadLink('downloadData', 'Download'),
# HTML('<div style="float: right; margin: 0 5px 5px 10px;">'),
# shiny::actionLink('exportButton_fbapp_sbase', 'Download data'),
# HTML('</div>')#,
HTML('</div>'),
# )
#),

Expand Down Expand Up @@ -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}'))

)

Expand Down

0 comments on commit b264111

Please sign in to comment.