Skip to content

Commit cc7071b

Browse files
committed
Merge branch 'main' of https://github.com/USDAForestService/ForestVegetationSimulator-Interface into open-source-release
2 parents 122d057 + ee9b3ea commit cc7071b

43 files changed

Lines changed: 5703 additions & 5013 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Comment line are preceeded by hash symbol
2-
# Each line is a file pattern followed by one or more owners.
3-
4-
# Default repo owners take precdence, unless subsequent match
5-
* @mshettles @DavidLRfs @wagnerds
1+
# Comment line are preceeded by hash symbol
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# Default repo owners take precdence, unless subsequent match
5+
* @mshettles @DavidLRfs @wagnerds

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
.RData
3+
.Rhistory
4+
.Rproj.user/*
5+
BuildfvsOL.R
6+
ForestVegetationSimulator-Interface.Rproj
7+
fvsOL/.Rhistory
8+
fvsOL/LaunchFVS.R
9+
build_fvsOL.R
10+
fvsOL/data/fvsOnlineHelpRender.RData
11+
fvsOL/data/prms.RData
12+
fvsOL/launch.R
13+
fvsOL/NAMESPACE
14+
rFVS/NAMESPACE
15+
rFVS/rFVSmadeTag
16+
fvsOL/fvsOLmadeTag
17+
fvsOL/man/*
18+
rFVS/man/*
19+
*.gz
20+
.Rproj.user
Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
1-
(function() {
2-
3-
// This recieves messages of type "dialogContentUpdate" from the server.
4-
Shiny.addCustomMessageHandler("dialogContentUpdate",
5-
function(data) {
6-
$('#' + data.id).find(".modal-body").html(data.message);
7-
}
8-
);
9-
10-
// This recieves messages of type "infomessage" from the server.
11-
Shiny.addCustomMessageHandler("infomessage",
12-
function(message) { alert(message); }
13-
);
14-
15-
// Refocus "eltid"
16-
Shiny.addCustomMessageHandler("refocus",
17-
function(eltid) { document.getElementById(eltid).focus(); }
18-
);
19-
20-
21-
// This gets the cursor postion from eltid
22-
Shiny.addCustomMessageHandler("getStart",
23-
function(eltid)
24-
{
25-
if (document.getElementById(eltid))
26-
{
27-
document.getElementById(eltid).onmouseout = function()
28-
{
29-
Shiny.onInputChange("selectionStart", document.getElementById(eltid).selectionStart);
30-
Shiny.onInputChange("selectionEnd", document.getElementById(eltid).selectionEnd);
31-
}
32-
}
33-
}
34-
);
35-
36-
// This will attempt to open a new tab with the provided URL
37-
// add: session$sendCustomMessage(type = "openURL",url) anywhere in the server code.
38-
Shiny.addCustomMessageHandler("openURL",
39-
function (url) { window.open(url); }
40-
);
41-
42-
// This will close the window, it causes onSessionEnded to be called as well.
43-
// add: session$sendCustomMessage(type = "closeWindow"," ") anywhere in the server code.
44-
Shiny.addCustomMessageHandler("closeWindow",
45-
function (dummy) { window.close(); }
46-
);
47-
48-
// this function load causes a shiny variable "signalClosing" to be set to 1 if the
49-
// browser is being closed for any reason. NB: return null will suppress the "do you
50-
// really want to exit" dialog automatically created by the browser.
51-
window.onbeforeunload = function(e)
52-
{
53-
Shiny.onInputChange("signalClosing", 1);
54-
return null;
55-
};
56-
57-
58-
59-
})();
60-
61-
1+
(function() {
2+
3+
// This recieves messages of type "dialogContentUpdate" from the server.
4+
Shiny.addCustomMessageHandler("dialogContentUpdate",
5+
function(data) {
6+
$('#' + data.id).find(".modal-body").html(data.message);
7+
}
8+
);
9+
10+
// This recieves messages of type "infomessage" from the server.
11+
Shiny.addCustomMessageHandler("infomessage",
12+
function(message) { alert(message); }
13+
);
14+
15+
// Refocus "eltid"
16+
Shiny.addCustomMessageHandler("refocus",
17+
function(eltid) { document.getElementById(eltid).focus(); }
18+
);
19+
20+
21+
// This gets the cursor postion from eltid
22+
Shiny.addCustomMessageHandler("getStart",
23+
function(eltid)
24+
{
25+
if (document.getElementById(eltid))
26+
{
27+
document.getElementById(eltid).onmouseout = function()
28+
{
29+
Shiny.onInputChange("selectionStart", document.getElementById(eltid).selectionStart);
30+
Shiny.onInputChange("selectionEnd", document.getElementById(eltid).selectionEnd);
31+
}
32+
}
33+
}
34+
);
35+
36+
// This will attempt to open a new tab with the provided URL
37+
// add: session$sendCustomMessage(type = "openURL",url) anywhere in the server code.
38+
Shiny.addCustomMessageHandler("openURL",
39+
function (url) { window.open(url); }
40+
);
41+
42+
// This will close the window, it causes onSessionEnded to be called as well.
43+
// add: session$sendCustomMessage(type = "closeWindow"," ") anywhere in the server code.
44+
Shiny.addCustomMessageHandler("closeWindow",
45+
function (dummy) { window.close(); }
46+
);
47+
48+
// this function load causes a shiny variable "signalClosing" to be set to 1 if the
49+
// browser is being closed for any reason. NB: return null will suppress the "do you
50+
// really want to exit" dialog automatically created by the browser.
51+
window.onbeforeunload = function(e)
52+
{
53+
Shiny.onInputChange("signalClosing", 1);
54+
return null;
55+
};
56+
57+
58+
59+
})();
60+
61+

FVSPrjBldr/prjListEmail.R

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,81 @@
1-
prjListEmail <- function (queryEmail,ndays=60,sendEmail=TRUE)
2-
{
3-
## This funciton needs to be customized a noted below!
4-
5-
# Send an Email of the projects associated with an email address
6-
# to the email address. The Email address must be a match (case insensitive)
7-
# to the one sepecified when the project was created.
8-
9-
trim <- function (x) gsub("^\\s+|\\s+$","",x)
10-
11-
if (missing(queryEmail)) stop("queryEmail must be specified")
12-
# insure a single token, no blanks
13-
queryEmail = scan(text=queryEmail,what="character",quiet=TRUE)
14-
if (length(queryEmail) > 1) stop ("queryEmail string contains white space")
15-
16-
workDirs = list.dirs("/home/shiny/FVSwork",recursive = FALSE)
17-
ids = lapply(workDirs,function (x)
18-
{
19-
fn = paste0(x,"/projectId.txt")
20-
id = NULL
21-
if (file.exists(fn))
22-
{
23-
id = scan(file=fn,what="character",
24-
sep="\n",quiet=TRUE)
25-
if (!is.null(id))
26-
{
27-
info = file.info(x)
28-
attr(id,"ctime") = info[1,"ctime"]
29-
info = file.info(fn)
30-
attr(id,"mtime") = info[1,"mtime"]
31-
}
32-
}
33-
id
34-
})
35-
##The following line needs to be edited and uncommented to replace the
36-
##base web address string in the substitution
37-
names (ids) = sub("/home/shiny/FVSwork",
38-
"https://charcoal2.cnre.vt.edu/FVSwork",workDirs)
39-
40-
rptFile = tempfile()
41-
con = file(rptFile,"w")
42-
43-
cat (file=con,"To:",queryEmail,"\n")
44-
cat (file=con,"Subject: FVSOnline projects at Virginia Tech\n")
45-
cat (file=con,"\n Projects and links for Email:",queryEmail,"\n")
46-
nprjs = 0
47-
for (i in 1:length(ids))
48-
{
49-
id = unlist(ids[i])
50-
nam = names(ids[i])
51-
if (is.null(id)) next
52-
email = trim(scan(text=id[1],what="character",quiet=TRUE)[2])
53-
if (tolower(email) == tolower(queryEmail))
54-
{
55-
nprjs = nprjs+1
56-
cat (file=con,"\n",id[1],"\n",id[2],"\n")
57-
tt = format(attr(ids[i][[1]],"ctime"),usetz=TRUE)
58-
cat (file=con," created at = ",tt,"\n")
59-
tt = format(attr(ids[i][[1]],"mtime"),usetz=TRUE)
60-
cat (file=con," last modified= ",tt,"\n")
61-
tt = format(attr(ids[i][[1]],"mtime")+(86400*ndays),usetz=TRUE)#86400=seconds/day
62-
cat (file=con," auto removal = ",tt,"\n")
63-
cat (file=con," project link = ",nam,"\n")
64-
}
65-
}
66-
67-
if (nprjs == 0) cat (file=con,"\n There are no projects under this Email address.\n")
68-
if (nprjs == 1) cat (file=con,"\n There is one project under this Email address.\n")
69-
if (nprjs > 1) cat (file=con,"\n There are",nprjs,
70-
"projects under this Email address.\n")
71-
close(con)
72-
73-
##Edit and uncomment the mailCmd as necessary for a given installation
74-
mailCmd = paste('ssmtp -t < ',rptFile)
75-
76-
if (sendEmail) system (mailCmd) else system(paste("cat",rptFile))
77-
unlink (rptFile)
78-
nprjs
79-
}
80-
81-
1+
prjListEmail <- function (queryEmail,ndays=60,sendEmail=TRUE)
2+
{
3+
## This funciton needs to be customized a noted below!
4+
5+
# Send an Email of the projects associated with an email address
6+
# to the email address. The Email address must be a match (case insensitive)
7+
# to the one sepecified when the project was created.
8+
9+
trim <- function (x) gsub("^\\s+|\\s+$","",x)
10+
11+
if (missing(queryEmail)) stop("queryEmail must be specified")
12+
# insure a single token, no blanks
13+
queryEmail = scan(text=queryEmail,what="character",quiet=TRUE)
14+
if (length(queryEmail) > 1) stop ("queryEmail string contains white space")
15+
16+
workDirs = list.dirs("/home/shiny/FVSwork",recursive = FALSE)
17+
ids = lapply(workDirs,function (x)
18+
{
19+
fn = paste0(x,"/projectId.txt")
20+
id = NULL
21+
if (file.exists(fn))
22+
{
23+
id = scan(file=fn,what="character",
24+
sep="\n",quiet=TRUE)
25+
if (!is.null(id))
26+
{
27+
info = file.info(x)
28+
attr(id,"ctime") = info[1,"ctime"]
29+
info = file.info(fn)
30+
attr(id,"mtime") = info[1,"mtime"]
31+
}
32+
}
33+
id
34+
})
35+
##The following line needs to be edited and uncommented to replace the
36+
##base web address string in the substitution
37+
names (ids) = sub("/home/shiny/FVSwork",
38+
"https://charcoal2.cnre.vt.edu/FVSwork",workDirs)
39+
40+
rptFile = tempfile()
41+
con = file(rptFile,"w")
42+
43+
cat (file=con,"To:",queryEmail,"\n")
44+
cat (file=con,"Subject: FVSOnline projects at Virginia Tech\n")
45+
cat (file=con,"\n Projects and links for Email:",queryEmail,"\n")
46+
nprjs = 0
47+
for (i in 1:length(ids))
48+
{
49+
id = unlist(ids[i])
50+
nam = names(ids[i])
51+
if (is.null(id)) next
52+
email = trim(scan(text=id[1],what="character",quiet=TRUE)[2])
53+
if (tolower(email) == tolower(queryEmail))
54+
{
55+
nprjs = nprjs+1
56+
cat (file=con,"\n",id[1],"\n",id[2],"\n")
57+
tt = format(attr(ids[i][[1]],"ctime"),usetz=TRUE)
58+
cat (file=con," created at = ",tt,"\n")
59+
tt = format(attr(ids[i][[1]],"mtime"),usetz=TRUE)
60+
cat (file=con," last modified= ",tt,"\n")
61+
tt = format(attr(ids[i][[1]],"mtime")+(86400*ndays),usetz=TRUE)#86400=seconds/day
62+
cat (file=con," auto removal = ",tt,"\n")
63+
cat (file=con," project link = ",nam,"\n")
64+
}
65+
}
66+
67+
if (nprjs == 0) cat (file=con,"\n There are no projects under this Email address.\n")
68+
if (nprjs == 1) cat (file=con,"\n There is one project under this Email address.\n")
69+
if (nprjs > 1) cat (file=con,"\n There are",nprjs,
70+
"projects under this Email address.\n")
71+
close(con)
72+
73+
##Edit and uncomment the mailCmd as necessary for a given installation
74+
mailCmd = paste('ssmtp -t < ',rptFile)
75+
76+
if (sendEmail) system (mailCmd) else system(paste("cat",rptFile))
77+
unlink (rptFile)
78+
nprjs
79+
}
80+
81+

0 commit comments

Comments
 (0)