Skip to content

Commit 9fc0c35

Browse files
committed
fix cplugin URI and add setup.Calculator fun
1 parent 3ccd311 commit 9fc0c35

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

Diff for: NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export(install_github.Design)
2020
export(install_github.Model)
2121
export(installed.Designs)
2222
export(installed.Models)
23+
export(setup.Calculator)
2324
export(setup.Model)
2425
export(startCalculators)
2526
export(stopCalculators)

Diff for: R/install.R

+15-3
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ setup.Model <- function(model, edit.script=FALSE) {
155155
attr(node,"command") <- normalizePath(script)
156156
cplugin = file.path(FUNZ_HOME,"plugins","calc",paste0(model,".cplugin.jar"))
157157
if (file.exists(cplugin))
158-
attr(node,"cplugin") <- normalizePath(cplugin)
158+
attr(node,"cplugin") <- paste0("file:/",normalizePath(cplugin))
159159
}
160160
if (isTRUE(node == "[ comment ]")) {
161161
node <- NA
@@ -169,7 +169,7 @@ setup.Model <- function(model, edit.script=FALSE) {
169169
attr(node,"command") <- normalizePath(script)
170170
cplugin = file.path(FUNZ_HOME,"plugins","calc",paste0(model,".cplugin.jar"))
171171
if (file.exists(cplugin))
172-
attr(node,"cplugin") <- normalizePath(cplugin)
172+
attr(node,"cplugin") <- paste0("file:/",normalizePath(cplugin))
173173
}
174174
calculator.xml$CALCULATOR[[i+1]] <- node
175175
names(calculator.xml$CALCULATOR)[[i+1]] <- "CODE"
@@ -183,6 +183,18 @@ setup.Model <- function(model, edit.script=FALSE) {
183183

184184
}
185185

186+
#' Setup calculators in calculator.xml file.
187+
#'
188+
#' @export
189+
#' @examples
190+
#' \dontrun{
191+
#' setup.Calculator()
192+
#' }
193+
setup.Calculator <- function() {
194+
message(paste0("The calculator.xml file is now opened in the editor: ",file.path(FUNZ_HOME,"calculator.xml")))
195+
utils::file.edit(file.path(FUNZ_HOME,"calculator.xml"))
196+
}
197+
186198
#' Install Funz model plugin from central GitHub repository.
187199
#'
188200
#' @param model model to install.
@@ -241,7 +253,7 @@ install.Model <- function(model,force=F, edit.script=FALSE) {
241253
#' @examples
242254
#' installed.Designs()
243255
installed.Designs <- function() {
244-
.env$.jclassFunz$getDesignList()
256+
Funz:::.env$.jclassFunz$getDesignList()
245257
}
246258

247259
#' List available designs from Funz GitHub repository

Diff for: man/setup.Calculator.Rd

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)