Skip to content
Snippets Groups Projects
Unverified Commit 0ce6dcf5 authored by Todor Kondic's avatar Todor Kondic
Browse files

app: extract button writes config

parent eb3f25c3
No related branches found
No related tags found
No related merge requests found
......@@ -125,7 +125,7 @@ rt_input <- function(input_rt,input_unit,width=NUM_INP_WIDTH,height=NUM_INP_HEIG
}
##'@export
rev2list <- function(rv) {
## Take reactive values structure and convert them to nested
## lists.
......@@ -133,6 +133,7 @@ rev2list <- function(rv) {
rv else lapply(shiny::reactiveValuesToList(rv),rev2list)
}
##' @export
list2rev <- function(lst) {
## Take nested named list and create reactive values from it.
if (class(lst)[[1]] != "list")
......
......@@ -57,6 +57,7 @@ future::plan('multiprocess',workers=4)
```{r, context='setup', echo=F}
def_state <- new_state()
rv_state <- list2rev(def_state)
```
# Configuration {.tabset}
......@@ -368,7 +369,13 @@ shinyscreen::rt_input(input_rt = "plot_rt_max",
## Report
```{r, echo=F}
shiny::textInput(inputId = "rep_aut", label = "Report author", value = def_state$conf$report$author)
shiny::textInput(inputId = "rep_tit", label = "Report title", value = def_state$conf$report$title)
```
# Extract Data and Prescreen
<details><summary>Extract spectra from data files.</summary>
After Shinyscreen is configured, the compound and setid lists loaded, it
......@@ -398,6 +405,14 @@ def_ord_summ <- shinyscreen:::dtable("Column names"=ord_nms,"Direction"=ord_asc)
```
```{r, include="false", context='server'}
observeEvent(input$extract,{
tmp <- rev2list(rv_state)
fn_c_state <- file.path(tmp$conf$project,
shinyscreen:::FN_CONF)
yaml::write_yaml(x=tmp$conf,file=fn_c_state)
message("(extract) Config written to ", fn_c_state)
})
output$order_summ <- rhandsontable::renderRHandsontable(rhandsontable::rhandsontable(def_ord_summ,
manualRowMove = T))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment