-
Notifications
You must be signed in to change notification settings - Fork 11
feat: add log-points for NCA user input changes #1221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
41b9403
5922af8
7ce0384
ef5b7de
4a4b92d
91ca90b
47f533b
550e0bb
b378504
1227387
dacc0c2
893084b
2f0b9d8
2a347e1
1cb6244
07a2d6e
0d78d95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -258,6 +258,10 @@ settings_server <- function(id, data, adnca_data, settings_override) { | |
| # A guard flag prevents infinite observer loops. | ||
| updating_filters <- reactiveVal(FALSE) | ||
|
|
||
| # Guard to suppress log noise during initial data load / settings restore. | ||
| # Set to TRUE after the first analyte cascade completes. | ||
| filters_initialized <- reactiveVal(FALSE) | ||
|
|
||
| # settings_override is consumed once during the first cascade after | ||
| # settings upload. After that, pending_settings is set to NULL so | ||
| # subsequent user-driven changes are not overridden by stale values. | ||
|
|
@@ -299,7 +303,14 @@ settings_server <- function(id, data, adnca_data, settings_override) { | |
| req(data(), input$select_analyte) | ||
| if (updating_filters()) return() | ||
| updating_filters(TRUE) | ||
| on.exit(updating_filters(FALSE)) | ||
| on.exit({ | ||
| updating_filters(FALSE) | ||
| if (!filters_initialized()) filters_initialized(TRUE) | ||
| }) | ||
|
|
||
| if (filters_initialized()) { | ||
| log_info("Analyte selection changed: ", paste(input$select_analyte, collapse = ", ")) | ||
| } | ||
|
|
||
| settings <- .consume_settings() | ||
|
|
||
|
|
@@ -335,6 +346,10 @@ settings_server <- function(id, data, adnca_data, settings_override) { | |
| updating_filters(TRUE) | ||
| on.exit(updating_filters(FALSE)) | ||
|
|
||
| if (filters_initialized()) { | ||
| log_info("Specimen selection changed: ", paste(input$select_pcspec, collapse = ", ")) | ||
| } | ||
|
|
||
| settings <- .consume_settings() | ||
|
|
||
| all_analyte <- unique(data()$PARAM) %>% na.omit() | ||
|
|
@@ -356,6 +371,25 @@ settings_server <- function(id, data, adnca_data, settings_override) { | |
| .update_profile(settings) | ||
| }) | ||
|
|
||
| # Log profile, method, and min half-life points changes | ||
| observeEvent(input$select_profile, { | ||
| if (filters_initialized()) { | ||
| log_info("NCA profile changed: ", paste(input$select_profile, collapse = ", ")) | ||
| } | ||
| }, ignoreInit = TRUE) | ||
|
|
||
| observeEvent(input$method, { | ||
| if (filters_initialized()) { | ||
| log_info("Extrapolation method changed: ", input$method) | ||
| } | ||
| }, ignoreInit = TRUE) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The analyte, specimen, and profile observers already guard against this with observeEvent(input$method, {
if (filters_initialized()) {
log_info("Extrapolation method changed: ", input$method)
}
}, ignoreInit = TRUE)
observeEvent(input$min_hl_points, {
if (filters_initialized()) {
log_info("Min. half-life points changed: ", input$min_hl_points)
}
}, ignoreInit = TRUE)If logging during settings restore is intentional, add a comment noting that. |
||
|
|
||
| observeEvent(input$min_hl_points, { | ||
| if (filters_initialized()) { | ||
| log_info("Min. half-life points changed: ", input$min_hl_points) | ||
| } | ||
| }, ignoreInit = TRUE) | ||
|
|
||
| # Include keyboard limits for the settings GUI display | ||
|
|
||
| # Keyboard limits for the setting thresholds | ||
|
|
@@ -365,6 +399,19 @@ settings_server <- function(id, data, adnca_data, settings_override) { | |
| limit_input_value(input, session, "LAMZSPN_threshold", min = 0, lab = "LAMZSPN") | ||
| limit_input_value(input, session, "min_hl_points", max = 10, min = 2, lab = "Min. HL Points") | ||
|
|
||
| # Log flag rule changes | ||
| lapply(c("R2ADJ", "R2", "AUCPEO", "AUCPEP", "LAMZSPN"), function(flag) { | ||
| rule_id <- paste0(flag, "_rule") | ||
| threshold_id <- paste0(flag, "_threshold") | ||
| observeEvent(input[[rule_id]], { | ||
| state <- if (input[[rule_id]]) "enabled" else "disabled" | ||
| log_info("Flag rule ", flag, " ", state) | ||
| }, ignoreInit = TRUE) | ||
| observeEvent(input[[threshold_id]], { | ||
| log_info("Flag rule ", flag, " threshold changed: ", input[[threshold_id]]) | ||
| }, ignoreInit = TRUE) | ||
| }) | ||
|
|
||
| # Reactive value to store the partial intervals data table | ||
| # Define the parameters that can be used for partial area calculations | ||
| PARTIAL_INT_PARAMS <- metadata_nca_parameters %>% | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.