Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: RstoxFramework
Version: 4.2.0-9007
Date: 2026-01-21
Date: 2026-01-24
Title: The Engine of StoX
Authors@R: c(
person(given = "Arne Johannes",
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# RstoxFramework v4.2.0-9007 (2025-01-12)
* Fixed bug with function input drop-down lists, which were not showing any content when functionInputs were from a different StoX model.
* Fixed bug where links to external (non Rstox) packages did not work in the GUI.
* Fixed bug in Bootstrap() when UseOutputData was TRUE, in which case the stored output file was not found.
* Added message recommending to use the OutputVariables if not given in Bootstrap().
* Fixed bug where a process was shown as terminal (bold face) even if it was used in a later model.
Expand Down
2 changes: 1 addition & 1 deletion R/Data.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#' @param Application A single string naming the application used when saving the project. Defaulted to R.version.string.
#' @param argumentFilePaths A nested list of paths to argument files of a model, as returned from \code{getArgumentFilePaths}. This is used to speed up some functions.
#' @param only.valid Logical: If TRUE subset function arguments (inputs and parameters) to only those to be shown as a consequence of argument hierarchy (e.g., one argument being irrelevant for a specific setting of another).
#' @param returnProcessTable Logical: If TRUE return the process table (much used in functions used by the GUI).
#' @param returnProcessTable Logical: If TRUE return the process table of the specified model (much used in functions used by the GUI). If NULL returns the process table of all models.
#' @param applyBackwardCompatibility Logical: If TRUE apply backward compatibility actions when running \code{readProjectDescription}.
#' @param Seed The seed, given as a single integer.
#'
Expand Down
47 changes: 36 additions & 11 deletions R/Framework.R
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,7 @@ writeActiveProcessIDFromTable <- function(projectPath, activeProcessIDTable) {
#'
resetModel <- function(projectPath, modelName, processID = NULL, processDirty = FALSE, shift = 0, returnProcessTable = FALSE, delete = c("memory", "text"), deleteCurrent = FALSE, purgeOutputFiles = FALSE, argumentFilePaths = NULL, processTable = NULL) {


# Get the process ID to reset the model to:
#processTable <- readProcessIndexTable(projectPath, modelName)
if(!length(processTable)) {
Expand Down Expand Up @@ -1828,13 +1829,25 @@ resetModel <- function(projectPath, modelName, processID = NULL, processDirty =
output <- list(
activeProcess = getActiveProcess(projectPath = projectPath, modelName = modelName)
)
if(returnProcessTable) {
output <- c(
list(processTable = getProcessTable(projectPath = projectPath, modelName = modelName, argumentFilePaths = argumentFilePaths)),
output
)


# Return all models if returnProcessTable = TRUE or the specified modelsif returnProcessTable is empty:
if(!length(returnProcessTable)) {
processTable <- getProcessTable(projectPath = projectPath, modelName = NULL, argumentFilePaths = argumentFilePaths)
}
else if(isTRUE(returnProcessTable)) {
processTable <- getProcessTable(projectPath = projectPath, modelName = modelName, argumentFilePaths = argumentFilePaths)
}
else if(!isFALSE(returnProcessTable)) {
stop("returnProcessTable must be a logical or NULL.")
}

output <- c(
list(processTable = processTable),
output
)


return(output)
}
}
Expand Down Expand Up @@ -1942,14 +1955,23 @@ resetModel <- function(projectPath, modelName, processID = NULL, processDirty =
output <- list(
activeProcess = getActiveProcess(projectPath = projectPath, modelName = modelName)
)
if(returnProcessTable) {
output <- c(
#list(processTable = getProcessTable(projectPath = projectPath, modelName = modelName)),
list(processTable = getProcessTable(projectPath = projectPath, modelName = NULL)),
output
)

# Return all models if returnProcessTable = TRUE or the specified modelsif returnProcessTable is empty:
if(!length(returnProcessTable)) {
processTable <- getProcessTable(projectPath = projectPath, modelName = NULL)
}
else if(isTRUE(returnProcessTable)) {
processTable <- getProcessTable(projectPath = projectPath, modelName = modelName)
}
else if(!isFALSE(returnProcessTable)) {
stop("returnProcessTable must be a logical or NULL.")
}

output <- c(
list(processTable = processTable),
output
)

#output <- list(
# if(returnProcessTable) processTable = getProcessTable(projectPath = projectPath, modelName = modelName),
# activeProcess = getActiveProcess(projectPath = projectPath, modelName = modelName)
Expand All @@ -1961,6 +1983,9 @@ resetModel <- function(projectPath, modelName, processID = NULL, processDirty =






# (1a) argumentFile:
# Every process argument (one of processName, functionName, processParameters, processData, functionInputs and functionParameters) is written as an argumentFile.
#
Expand Down
66 changes: 65 additions & 1 deletion R/Routes.R
Original file line number Diff line number Diff line change
Expand Up @@ -888,10 +888,12 @@ getProcessPropertySheet <- function(projectPath, modelName, processID, argumentF
#processTable <- getProcessTable(projectPath = projectPath, modelName = modelName, beforeProcessID = processID)
#processTable <- scanForModelError(projectPath = projectPath, modelName = modelName, beforeProcessID = processID)


if(!length(processTable)) {
processTable <- scanForModelError(projectPath = projectPath, modelName = NULL, beforeProcessID = processID, argumentFilePaths = argumentFilePaths)
}


#thisProcessIndex <- which(processTable$processID == processID)
#processTable <- processTable[seq_len(thisProcessIndex), ]
functionInputNames <- names(functionInputs)
Expand Down Expand Up @@ -1312,7 +1314,7 @@ setProcessPropertyValue <- function(groupName, name, value, projectPath, modelNa
delete = c("memory", if(!hasUseOutputData(projectPath, modelName, processID)) "text"),
deleteCurrent = TRUE,
processTable = processTable,
returnProcessTable = TRUE
returnProcessTable = NULL
)$processTable
}

Expand Down Expand Up @@ -1444,11 +1446,73 @@ getObjectHelpAsHtml <- function(packageName, objectName) {
html <- getRstoxFrameworkDefinitions("objectHelp")[[objectName]]
}

# If the html is mepty, try to get the documentation live:
if(!length(html)) {
html <- getHtmlHelp(objectName, packageName)
}

# Return the objectDocumentation:
return(html)
}


# Function to get a single html for a function not in the Rstox packages:
getHtmlHelp <- function(objectName, packageName, stylesheet = "") {

# Get the documentation of the package:
db <- tools::Rd_db(packageName)

# Get the links of the package:
Links <- tools::findHTMLlinks(pkgDir = find.package(packageName))

# Write the help to file as html and read back:
objectName.Rd <- paste0(objectName, ".Rd")
# If the objectName.Rd is not present, find the link:
if(! objectName.Rd %in% names(db)) {
if(objectName %in% names(Links)) {
objectName <- basename( tools::file_path_sans_ext(Links[objectName]) )
objectName.Rd <- paste0(objectName, ".Rd")
}
else {
warning("")
}
}


# Return empty string if the function
if(! objectName.Rd %in% names(db)) {
return("")
}

#print(objectName.Rd)

# Write to a temporary file
outfile <- tempfile(fileext = ".html")
tools::Rd2HTML(
db[[objectName.Rd]],
out = outfile,
package = packageName,
Links = Links,
stylesheet = stylesheet
)
html <- paste(readLines(outfile), collapse="\n")

# This hack was needed as of R 4.1 or something, where the links all of a sudden were with "help" instead of "html":
html <- gsub("/help/", "/html/", html)

# Add the index links of the Rstox packages:
html <- gsub(
"href=\"00Index.html\">Index",
paste0("href=\"../../", packageName, "/html/00Index.html\">Index"),
html
)

unlink(outfile, force = TRUE)

return(html)
}




#'
Expand Down
Binary file modified inst/extdata/functionArguments.rds
Binary file not shown.
Binary file modified inst/test/tobis_20_depth.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion inst/versions/OfficialRstoxFrameworkVersions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ StoX RstoxFramework Dependencies OptionalDependencies Official Date
4.2.0-9001 4.2.0-9004 RstoxBase_2.2.0-9007,RstoxData_2.2.0-9006 RstoxFDA_1.7.0-9999 FALSE 2025-11-03
4.2.0-9002 4.2.0-9005 RstoxBase_2.2.0-9008,RstoxData_2.2.0-9007 RstoxFDA_1.7.0-9999 FALSE 2025-12-03
4.2.0-9003 4.2.0-9006 RstoxBase_2.2.0-9008,RstoxData_2.2.0-9010 RstoxFDA_1.7.0-9999 FALSE 2025-12-16
4.2.0-9004 4.2.0-9007 RstoxBase_2.2.0-9009,RstoxData_2.2.0-9011 RstoxFDA_1.7.0-9999 FALSE 2026-01-21
4.2.0-9004 4.2.0-9007 RstoxBase_2.2.0-9009,RstoxData_2.2.0-9011 RstoxFDA_1.7.0-9999 FALSE 2026-01-24
2 changes: 1 addition & 1 deletion man/expandProcess.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/general_arguments.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/prependProcess.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/resetModel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading