Skip to content
Snippets Groups Projects
Commit 87d81cf8 authored by Ruben Heinrich's avatar Ruben Heinrich
Browse files

[base] Added logfile parameter for OGS6 objects

parent b2dba87e
No related branches found
No related tags found
1 merge request!6Merge branch 7 fixed functionality into master
...@@ -24,9 +24,9 @@ OGS6 <- R6::R6Class("OGS6", ...@@ -24,9 +24,9 @@ OGS6 <- R6::R6Class("OGS6",
test_mode = FALSE) { test_mode = FALSE) {
# Basic validation # Basic validation
assertthat::assert_that(assertthat::is.string(sim_name))
assertthat::assert_that(assertthat::is.number(sim_id)) assertthat::assert_that(assertthat::is.number(sim_id))
self$sim_name <- sim_name
self$sim_path <- sim_path self$sim_path <- sim_path
if(!test_mode){ if(!test_mode){
...@@ -198,6 +198,16 @@ OGS6 <- R6::R6Class("OGS6", ...@@ -198,6 +198,16 @@ OGS6 <- R6::R6Class("OGS6",
return(invisible(flag)) return(invisible(flag))
}, },
#'print_log
#'@description Prints logfile to console (if it exists)
print_log = function(){
if(!is.null(self$logfile)){
writeLines(readLines(self$logfile))
}else{
cat("There is no logfile associated with this OGS6 object.\n")
}
},
#'@description #'@description
#'Clears components from the OGS6 object #'Clears components from the OGS6 object
#'@param which character: The names of the components (all by default). #'@param which character: The names of the components (all by default).
...@@ -240,9 +250,14 @@ OGS6 <- R6::R6Class("OGS6", ...@@ -240,9 +250,14 @@ OGS6 <- R6::R6Class("OGS6",
active = list( active = list(
#'@field sim_name #'@field sim_name
#'Getter for OGS6 private parameter '.sim_name' #'Access to private parameter '.sim_name'
sim_name = function() { sim_name = function(value) {
private$.sim_name if(missing(value)) {
private$.sim_name
}else{
assertthat::assert_that(assertthat::is.string(value))
private$.sim_name <- value
}
}, },
#'@field sim_id #'@field sim_id
...@@ -262,6 +277,17 @@ OGS6 <- R6::R6Class("OGS6", ...@@ -262,6 +277,17 @@ OGS6 <- R6::R6Class("OGS6",
} }
}, },
#'@field logfile
#'Access to private parameter '.logfile'
logfile = function(value) {
if(missing(value)) {
private$.logfile
}else{
assertthat::assert_that(assertthat::is.string(value))
private$.logfile <- value
}
},
#'@field ogs_bin_path #'@field ogs_bin_path
#'Getter for OGS6 private parameter '.ogs_bin_path' #'Getter for OGS6 private parameter '.ogs_bin_path'
ogs_bin_path = function() { ogs_bin_path = function() {
...@@ -448,6 +474,8 @@ OGS6 <- R6::R6Class("OGS6", ...@@ -448,6 +474,8 @@ OGS6 <- R6::R6Class("OGS6",
.sim_path = NULL, .sim_path = NULL,
.ogs_bin_path = NULL, .ogs_bin_path = NULL,
.logfile = NULL,
#.gml parameters #.gml parameters
.gml = NULL, .gml = NULL,
......
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