Skip to content

Commit d9c410b

Browse files
committed
2 parents 493b331 + 7428eca commit d9c410b

File tree

7 files changed

+39
-52
lines changed

7 files changed

+39
-52
lines changed

fvsOL/DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: fvsOL
22
Title: Forest Vegetation Simulator
3-
Version: 2024.04.01
3+
Version: 2024.07.01
44
Authors@R: c(person("Nicholas", "Crookston", email = "[email protected]",
55
role = c("aut")),
66
person("FVS", "Staff", email = "[email protected]",
@@ -15,5 +15,5 @@ Depends:
1515
Suggests: rgdal (>= 1.5-23), nlme (>= 3.1-140)
1616
License: MIT
1717
Roxygen: list(markdown = TRUE)
18-
RoxygenNote: 7.2.3
18+
RoxygenNote: 7.3.1
1919
Encoding: UTF-8

fvsOL/R/server.R

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -944,64 +944,58 @@ cat("selectdbtables\n")
944944
# Throw up warning, then have first table selection in level that threw error remain selected
945945
while(length(tables)>1)
946946
{
947-
if(length(tables)==2 && "FVS_Cases" %in% tables) break
947+
# if(length(tables)==2 && "FVS_Cases" %in% tables) break
948948
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary")) break
949949
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary_East")) break
950950
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary_Metric")) break
951951
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary2")) break
952952
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary2_East")) break
953953
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary2_Metric")) break
954954
'%notin%' = Negate('%in%')
955-
if (any(tables %in% globals$simLvl)) {
955+
if (any(tables %in% globals$simLvl) || (any(tables %in% globals$simLvl) && "FVS_Cases" %in% tables)) {
956956
session$sendCustomMessage(type = "infomessage",
957957
message = paste0("This composite table combination in not allowed"))
958958
tables <- tables[1]
959-
globals$tableMessage=TRUE
960-
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
961-
selected=tables)
959+
updateSelectInput(session, "selectdbtables", selected = tables)
960+
962961
}
963-
if (any(tables %in% globals$stdLvl) && any(tables %notin% globals$stdLvl)) {
962+
selection = tables
963+
if ("FVS_Cases" %in% tables) selection = tables[-which(tables == "FVS_Cases")]
964+
if (any(tables %in% globals$stdLvl) && any(selection %notin% globals$stdLvl)) {
964965
session$sendCustomMessage(type = "infomessage",
965966
message = paste0("Stand-level tables can only be combined with other stand-level tables"))
966967
tables <- tables[1]
967-
globals$tableMessage=TRUE
968-
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
969-
selected=tables)
968+
updateSelectInput(session, "selectdbtables", selected = tables)
970969
}
971-
if (any(tables %in% globals$specLvl) && any(tables %notin% globals$specLvl)) {
970+
if (any(tables %in% globals$specLvl) && any(selection %notin% globals$specLvl)) {
972971
session$sendCustomMessage(type = "infomessage",
973972
message = paste0("Species-level tables can only be combined with other species-level tables"))
974973
tables <- tables[1]
975-
globals$tableMessage=TRUE
976-
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
977-
selected=tables)
974+
updateSelectInput(session, "selectdbtables", selected = tables)
978975
}
979976
# DBH-class tables cannot be combined with any other table
980-
if (any(tables %in% globals$dClsLvl)) {
977+
if (length(selection) < 1 && any(selection %in% globals$dClsLvl)) {
981978
session$sendCustomMessage(type = "infomessage",
982979
message = paste0("DBH-class tables cannot be combined with any other tables"))
983980
tables <- tables[1]
984981
globals$tableMessage=TRUE
985-
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
986-
selected=tables)
982+
updateSelectInput(session, "selectdbtables", selected = tables)
987983
}
988984
# HT-class tables cannot be combined with any other table
989-
if (any(tables %in% globals$htClsLvl)) {
985+
if (length(selection) < 1 && any(selection %in% globals$htClsLvl)) {
990986
session$sendCustomMessage(type = "infomessage",
991987
message = paste0("HT-class tables cannot be combined with any other tables"))
992988
tables <- tables[1]
993989
globals$tableMessage=TRUE
994-
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
995-
selected=tables)
990+
updateSelectInput(session, "selectdbtables", selected = tables)
996991
}
997992
# tree-level tables cannot be combined with any other table
998-
if (any(tables %in% globals$treeLvl)) {
993+
if (length(selection) < 1 && any(selection %in% globals$treeLvl)) {
999994
session$sendCustomMessage(type = "infomessage",
1000995
message = paste0("Tree-level tables cannot be combined with any other tables"))
1001996
tables <- tables[1]
1002997
globals$tableMessage=TRUE
1003-
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
1004-
selected=tables)
998+
updateSelectInput(session, "selectdbtables", selected = tables)
1005999
}
10061000
break
10071001
}
@@ -1496,7 +1490,7 @@ cat ("cmd=",cmd,"\n")
14961490
updateSelectInput(session, "plotType",selected="scat") else
14971491
if (length(intersect(c("StdStk","CmpStdStk","StdStk_East",
14981492
"CmpStdStk_East","StdStk_Metric","CmpStdStk_Metric"),names(dat))))
1499-
updateSelectInput(session, "plotType",selected="bar") else
1493+
updateSelectInput(session, "plotType",selected="bar") else
15001494
updateSelectInput(session, "plotType",selected="line")
15011495
iprg = iprg+1
15021496
setProgress(message = "Loading selection widgets", detail = "", value = iprg)
@@ -1512,7 +1506,7 @@ cat ("cmd=",cmd,"\n")
15121506
"StdStk","StdStk_East","StdStk_Metric","CmpStdStk","CmpStdStk_East",
15131507
"CmpStdStk_Metric"),names(dat))))
15141508
cho[isel] else cho
1515-
updateSelectInput(session, "year", choices=as.list(cho), selected=sel)
1509+
updateSelectInput(session, "year", choices=as.list(cho), selected=cho[1])
15161510
}
15171511
globals$exploreChoices$year = cho
15181512
if (is.null(mdat$Species))
8 Bytes
Binary file not shown.

fvsOL/parms/basekeys.kwd

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,7 @@ f3v{ws}:{blank}
264264
f3v{cr sw sp sf lp bp}:{blank}
265265
f3v{ne ls cs sn}:{blank}
266266

267-
f4{ne ls cs}:{numberBox Minimum top diameter inside bark}
268-
//f4{sn}:{noInput Minimum top diameter can not be changed in Southern US}
269-
f4:{numberBox Minimum top diameter outside bark}
267+
f4:{numberBox Minimum top diameter}
270268
f4v{ni ie em bm ec kt wc pn ca}:{blank}
271269
f4v{so ut tt ak ws ci nc}:{blank}
272270
f4v{cr sw sp sf lp bp}:{blank}
@@ -372,7 +370,6 @@ f3v{ut tt ci}:{blank}
372370
f3v{so ak nc bp}:{blank}
373371

374372
f4:{numberBox Minimum top diameter}
375-
//f4{sn}:{noInput Minimum top diameter can not be changed in Southern US}
376373
f4v{cr sw sp sf lp}:{blank}
377374
f4v{ni ie em ws bm ec kt wc pn ca}:{blank}
378375
f4v{so ut tt ak ci nc bp}:{blank}

fvsOL/parms/modifiers.prm

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ softwoods and 12.0" for hardwoods. The default pulpwood minimum DBH is 4.0" for
1414
hardwoods and softwoods.
1515

1616
The default minimum top diameter for sawlogs is 7.0" for softwoods and 9.0"
17-
for hardwoods. These values are fixed. Changing them will cause an error.}
17+
for hardwoods.}
1818

1919
description{ni ie kt em}:
2020
{Change the merchantability limits for board-foot volume and cubic foot volume
@@ -72,15 +72,13 @@ f3v{ws}:{blank}
7272
f3v{cr sw sp sf lp bp}:{blank}
7373
f3v{ne ls cs sn}:{blank}
7474

75-
f4:{numberBox Minimum top diameter inside bark}
76-
f4{sn}:{noInput Minimum top diameter can not be changed in Southern US}
75+
f4:{numberBox Minimum top diameter}
7776
f4v{ni ie em bm ec kt wc pn ca oc op}:{blank}
7877
f4v{so ut tt ak ws ci nc}:{blank}
7978
f4v{cr sw sp sf lp bp}:{blank}
80-
f4v{ls ne cs}:{blank}
79+
f4v{ls ne cs sn}:{blank}
8180

8281
f5:{numberBox Stump height}
83-
f5{sn}:{noInput Stump height is 1 ft and can not be changed in Southern US}
8482
f5v:{blank}
8583

8684
f6:{numberBox Form class}
@@ -133,13 +131,11 @@ f8v{ut tt ci}:{blank}
133131
f8v{so ak nc}:{blank}
134132

135133
f9:{numberBox Minimum top diameter}
136-
f9{sn}:{noInput Minimum top diameter can not be changed in Southern US}
137134
f9v{ni ie em ws bm ec kt wc pn ca oc op}:{blank}
138135
f9v{so ut tt ak ci nc}:{blank}
139-
f9v{ls ne cs cr sw sp sf lp bp}:{blank}
136+
f9v{ls ne cs cr sw sp sf lp bp sn}:{blank}
140137

141138
f10:{numberBox Stump height (feet)}
142-
f10{sn}:{noInput Stump height is 1 ft and can not be changed in Southern US}
143139
f10v:{blank}
144140

145141
f11:{numberBox Form class}

rFVS/DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package: rFVS
22
Title: Interface functions for the Forest Vegetation Simulator
3-
Version: 2023.02.01
3+
Version: 2024.07.01
44
Authors@R: person("Nicholas", "Crookston", email = "[email protected]",
55
role = c("aut", "cre"))
66
Description: Provides a set of R functions that interface with the
77
Forest Vegetation Simulator when it is run as a shared libray.
88
Depends: R (>= 4.0.0)
99
License: MIT
1010
Roxygen: list(markdown = TRUE)
11-
RoxygenNote: 7.2.3
11+
RoxygenNote: 7.3.1

rFVS/R/fvsAddActivity.R

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ function(year,activity,parms=NULL)
3434
BASE_SETPTHIN= 248,BASE_PRUNE = 249,BASE_COMPRESS= 250,BASE_FERTILIZ= 260,
3535
ESTB_TALLY = 427,ESTB_TALLYONE= 428,ESTB_TALLYTWO= 429,ESTB_PLANT = 430,
3636
ESTB_NATURAL = 431,ESTB_ADDTREES= 432,ESTB_STOCKADJ= 440,ESTB_HTADJ = 442,
37-
BASE_RESETAGE= 443,ESTB_SPROUT = 450,ESTB_NATURAL = 490,ESTB_BURNPREP= 491,
38-
ESTB_MECHPREP= 493,COVR_COVER = 900,MIST_MISTMULT=2001,MIST_MISTPREF=2002,
39-
MIST_MISTMORT=2003,MIST_MISTHMOD=2004,MIST_MISTGMOD=2005,MIST_MISTPINF=2006,
40-
MIST_MISTABLE=2007,FIRE_SALVSP =2501,FIRE_SOILHEAT=2503,FIRE_BURNREPT=2504,
41-
FIRE_MOISTURE=2505,FIRE_SIMFIRE =2506,FIRE_FLAMEADJ=2507,FIRE_POTFIRE =2508,
42-
FIRE_SNAGOUT =2512,FIRE_FUELOUT =2515,FIRE_SALVAGE =2520,FIRE_FUELINIT=2521,
43-
FIRE_SNAGINIT=2522,FIRE_PILEBURN=2523,FIRE_FUELTRET=2525,FIRE_FUELREPT=2527,
44-
FIRE_MORTREPT=2528,FIRE_DROUGHT =2529,FIRE_FUELMOVE=2530,FIRE_FUELMODL=2538,
45-
FIRE_DEFULMOD=2539,FIRE_CARBREPT=2544,FIRE_CARBCUT =2545,FIRE_CANFPROF=2547,
46-
FIRE_FUELFOTO=2548,FIRE_FIRECALC=2549,FIRE_FMODLIST=2550,FIRE_DWDVLOUT=2551,
47-
FIRE_DWDCVOUT=2552,FIRE_FUELSOFT=2553,ECON_PRETEND =2605,ECON_SEVSTART=2606,
48-
ECON_SPECCST =2607,ECON_SPECRVN =2608,ECON_STRTECON=2609)
37+
BASE_RESETAGE= 443,ESTB_SPROUT = 450,ESTB_BURNPREP= 491,ESTB_MECHPREP= 493,
38+
COVR_COVER = 900,MIST_MISTMULT=2001,MIST_MISTPREF=2002,MIST_MISTMORT=2003,
39+
MIST_MISTHMOD=2004,MIST_MISTGMOD=2005,MIST_MISTPINF=2006,MIST_MISTABLE=2007,
40+
FIRE_SALVSP =2501,FIRE_SOILHEAT=2503,FIRE_BURNREPT=2504,FIRE_MOISTURE=2505,
41+
FIRE_SIMFIRE =2506,FIRE_FLAMEADJ=2507,FIRE_POTFIRE =2508,FIRE_SNAGOUT =2512,
42+
FIRE_FUELOUT =2515,FIRE_SALVAGE =2520,FIRE_FUELINIT=2521,FIRE_SNAGINIT=2522,
43+
FIRE_PILEBURN=2523,FIRE_FUELTRET=2525,FIRE_FUELREPT=2527,FIRE_MORTREPT=2528,
44+
FIRE_DROUGHT =2529,FIRE_FUELMOVE=2530,FIRE_FUELMODL=2538,FIRE_DEFULMOD=2539,
45+
FIRE_CARBREPT=2544,FIRE_CARBCUT =2545,FIRE_CANFPROF=2547,FIRE_FUELFOTO=2548,
46+
FIRE_FIRECALC=2549,FIRE_FMODLIST=2550,FIRE_DWDVLOUT=2551,FIRE_DWDCVOUT=2552,
47+
FIRE_FUELSOFT=2553,ECON_PRETEND =2605,ECON_SEVSTART=2606,ECON_SPECCST =2607,
48+
ECON_SPECRVN =2608,ECON_STRTECON=2609)
4949

5050
if (missing(year) & missing(activity)) return (activities)
5151

0 commit comments

Comments
 (0)