aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2014-10-16 10:55:20 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2014-10-16 10:55:20 +0200
commit27a6c4418ec39c473e02fefa062b1e077553525e (patch)
tree5811001dde348f2d7a6ad5f131f8a56bbdbef96f
parent520cd0fcea385454460b3958ce864828f0ae6542 (diff)
Fix saving summary files
-rw-r--r--GNUmakefile5
-rw-r--r--NEWS.md2
-rw-r--r--inst/GUI/gmkin.R28
3 files changed, 28 insertions, 7 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 913585f..ad02272 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -19,6 +19,7 @@ SDDIR ?= $(RFSVN)/www/gmkin_static
pkgfiles = NEWS \
data/* \
DESCRIPTION \
+ inst/GUI/gmkin.R \
inst/staticdocs/README \
man/* \
NAMESPACE \
@@ -76,6 +77,10 @@ move-sd:
r-forge: sd move-sd
cd $(RFSVN) && svn commit -m 'update gmkin static documentation from github repository'
+release: build
+ cp $(TGZ) $(RFSVN)/www/repo/src/contrib; scp $(TGZ) qnap:projects/gmkin
+ @echo Now build gmkin on windows and copy the zip to the repo
+
clean:
$(RM) -r $(PKGNAME).Rcheck/
$(RM) vignettes/*.R
diff --git a/NEWS.md b/NEWS.md
index 9f8da9d..061c158 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -4,6 +4,8 @@
- Prevent loading old gmkin workspace files created with mkin < 0.9-32 as they do not load properly
+- Fix saving summary files. They were all saved under the same name without a warning
+
# CHANGES in gmkin VERSION 0.5-4
## BUG FIXES
diff --git a/inst/GUI/gmkin.R b/inst/GUI/gmkin.R
index 9a19732..7932331 100644
--- a/inst/GUI/gmkin.R
+++ b/inst/GUI/gmkin.R
@@ -270,7 +270,8 @@ configure_fit_handler = function(h, ...) {
show_plot("Initial", default = TRUE)
oldwidth <<- options()$width
options(width = 90)
- svalue(f.gg.summary) <- c("<pre>", capture.output(stmp), "</pre>")
+ svalue(f.gg.summary.filename) <<- ""
+ svalue(f.gg.summary.listing) <<- c("<pre>", capture.output(stmp), "</pre>")
options(width = oldwidth)
svalue(center) <- 3
}
@@ -764,7 +765,8 @@ run_fit <- function() {
svalue(f.gg.opts.st) <- ftmp$solution_type
svalue(f.gg.opts.weight) <- ftmp$weight.ini
f.gg.parms[,] <- get_Parameters(stmp, TRUE)
- svalue(f.gg.summary) <- c("<pre>", capture.output(stmp), "</pre>")
+ svalue(f.gg.summary.filename) <<- paste(ftmp$ds$title, "_", ftmp$mkinmod$name, ".txt", sep = "")
+ svalue(f.gg.summary.listing) <<- c("<pre>", capture.output(stmp), "</pre>")
}
ds.i <- m.i <- "1"
f.cur <- "0"
@@ -930,15 +932,26 @@ f.gg.opts.maxit.modFit <- gedit("auto", label = "maxit.modFit",
# Summary {{{3
oldwidth <- options()$width
options(width = 90)
-summaryfile <- paste(ds[[ds.cur]]$title, "_", m[[m.cur]]$name, ".txt", sep = "")
f.gg.summary <- ggroup(label = "Summary", cont = f.gn, horizontal = FALSE)
f.gg.summary.topline <- ggroup(cont = f.gg.summary, horizontal = TRUE)
-f.gg.summary.filename <- gedit(summaryfile, width = 50, cont = f.gg.summary.topline)
+f.gg.summary.filename <- gedit(paste(ds[[ds.cur]]$title, "_", m[[m.cur]]$name,
+ ".txt", sep = ""),
+ width = 50, cont = f.gg.summary.topline)
f.gg.summary.savebutton <- gbutton("Save summary", cont = f.gg.summary.topline,
handler = function(h, ...) {
- capture.output(stmp, file = summaryfile)
+ filename <- svalue(f.gg.summary.filename)
+ if (file.exists(filename))
+ {
+ gconfirm(paste("File", filename, "exists. Overwrite?"),
+ parent = w,
+ handler = function(h, ...) {
+ capture.output(stmp, file = filename)
+ })
+ } else {
+ capture.output(stmp, file = filename)
+ }
})
-f.gg.summary <- ghtml(c("<pre>", capture.output(stmp), "</pre>"),
+f.gg.summary.listing <- ghtml(c("<pre>", capture.output(stmp), "</pre>"),
cont = f.gg.summary, label = "Summary")
options(width = oldwidth)
@@ -979,7 +992,8 @@ update_plotting_and_fitting <- function() {
# Summary
oldwidth <<- options()$width
options(width = 90)
- svalue(f.gg.summary) <- c("<pre>", capture.output(stmp), "</pre>")
+ svalue(f.gg.summary.filename) <<- paste(ftmp$ds$title, "_", ftmp$mkinmod$name, ".txt", sep = "")
+ svalue(f.gg.summary.listing) <<- c("<pre>", capture.output(stmp), "</pre>")
options(width = oldwidth)
# Plot options

Contact - Imprint