[Robast-commits] r852 - branches/robast-1.0/pkg/RobExtremesBuffer
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Nov 6 11:08:29 CET 2015
Author: eugenm123
Date: 2015-11-06 11:08:29 +0100 (Fri, 06 Nov 2015)
New Revision: 852
Modified:
branches/robast-1.0/pkg/RobExtremesBuffer/config.R
branches/robast-1.0/pkg/RobExtremesBuffer/server.R
branches/robast-1.0/pkg/RobExtremesBuffer/utilities.R
Log:
Anzeigen von zu installierenden packeten, wenn diese fehlen. Es wird in die R-Console ausgegeben und die Shiny-App gestoppt.
Modified: branches/robast-1.0/pkg/RobExtremesBuffer/config.R
===================================================================
--- branches/robast-1.0/pkg/RobExtremesBuffer/config.R 2015-11-06 09:31:25 UTC (rev 851)
+++ branches/robast-1.0/pkg/RobExtremesBuffer/config.R 2015-11-06 10:08:29 UTC (rev 852)
@@ -15,4 +15,6 @@
# INTERPOLATION_FILE <- "plotInterpolSimple.R"
-TEST.save.grid <- TRUE
\ No newline at end of file
+TEST.save.grid <- TRUE
+
+REQUIRED_PACKAGES <- c("shiny", "shinyjs", "ROptEst")
\ No newline at end of file
Modified: branches/robast-1.0/pkg/RobExtremesBuffer/server.R
===================================================================
--- branches/robast-1.0/pkg/RobExtremesBuffer/server.R 2015-11-06 09:31:25 UTC (rev 851)
+++ branches/robast-1.0/pkg/RobExtremesBuffer/server.R 2015-11-06 10:08:29 UTC (rev 852)
@@ -1,12 +1,11 @@
-if(!require(shiny)) install.packages("shiny", dep=TRUE)
-#library(shiny)
+source("config.R")
options(shiny.error=NULL)
options(shiny.trace=F)
source("utilities.R")
-source("config.R")
+checkRequiredPackages()
RESET_NOTE_TEXT <- "<strong>Durch aendern der Grid & Familie, gehen alle nicht-gespeicherte Intervalle verloren.</strong>"
DEFAULT_DEGREE_OF_FREEDOM <- 10
@@ -19,7 +18,6 @@
-
shinyServer(function(input, output, session){
######################################################################################
## Set parameters
@@ -248,6 +246,7 @@
######################################################################################
## Save to grid
observe({ # Depends: input${saveGrid, familyName, gridName, editingGrid}, configuration$df, getEditingGrid()
+
if(input$saveGrid){
saveGridToCsv(familyName=isolate(getCurrentFamilyName()),
gridName=isolate(getCurrentGridName()),
@@ -257,6 +256,7 @@
dfs=isolate(configuration$df),
ranges=isolate(configuration$ranges))
+
####################################################
# TEST of saveGridToCsv
####################################################
Modified: branches/robast-1.0/pkg/RobExtremesBuffer/utilities.R
===================================================================
--- branches/robast-1.0/pkg/RobExtremesBuffer/utilities.R 2015-11-06 09:31:25 UTC (rev 851)
+++ branches/robast-1.0/pkg/RobExtremesBuffer/utilities.R 2015-11-06 10:08:29 UTC (rev 852)
@@ -515,3 +515,21 @@
names <- ls(commits.env, all.names=TRUE)
save(list=names, file=HISTORY_COMMITS_FILE, envir=commits.env)
}
+
+
+
+checkRequiredPackages <- function(packages=REQUIRED_PACKAGES) {
+ inQuotes <- function(x) paste("\"", x, "\"", sep="")
+
+ notInstalled <- ! (packages %in% installed.packages())
+ notInstalledPackages <- packages[notInstalled]
+
+ if(length(notInstalledPackages) > 0) {
+ packagesToInstall <- paste(inQuotes(notInstalledPackages), collapse=", ")
+ cat("------------------------------------------------------------------\n")
+ cat(paste("Please run> install.packages(", packagesToInstall, ")\n", sep=""))
+ cat("------------------------------------------------------------------\n")
+
+ stopApp()
+ }
+}
More information about the Robast-commits
mailing list