Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnerds committed Jul 1, 2024
2 parents 493b331 + 7428eca commit d9c410b
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 52 deletions.
4 changes: 2 additions & 2 deletions fvsOL/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: fvsOL
Title: Forest Vegetation Simulator
Version: 2024.04.01
Version: 2024.07.01
Authors@R: c(person("Nicholas", "Crookston", email = "[email protected]",
role = c("aut")),
person("FVS", "Staff", email = "[email protected]",
Expand All @@ -15,5 +15,5 @@ Depends:
Suggests: rgdal (>= 1.5-23), nlme (>= 3.1-140)
License: MIT
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Encoding: UTF-8
42 changes: 18 additions & 24 deletions fvsOL/R/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -944,64 +944,58 @@ cat("selectdbtables\n")
# Throw up warning, then have first table selection in level that threw error remain selected
while(length(tables)>1)
{
if(length(tables)==2 && "FVS_Cases" %in% tables) break
# if(length(tables)==2 && "FVS_Cases" %in% tables) break
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary")) break
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary_East")) break
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary_Metric")) break
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary2")) break
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary2_East")) break
if(length(tables)==2 && (tables[1] == "CmpCompute" && tables[2] == "CmpSummary2_Metric")) break
'%notin%' = Negate('%in%')
if (any(tables %in% globals$simLvl)) {
if (any(tables %in% globals$simLvl) || (any(tables %in% globals$simLvl) && "FVS_Cases" %in% tables)) {
session$sendCustomMessage(type = "infomessage",
message = paste0("This composite table combination in not allowed"))
tables <- tables[1]
globals$tableMessage=TRUE
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
selected=tables)
updateSelectInput(session, "selectdbtables", selected = tables)

}
if (any(tables %in% globals$stdLvl) && any(tables %notin% globals$stdLvl)) {
selection = tables
if ("FVS_Cases" %in% tables) selection = tables[-which(tables == "FVS_Cases")]
if (any(tables %in% globals$stdLvl) && any(selection %notin% globals$stdLvl)) {
session$sendCustomMessage(type = "infomessage",
message = paste0("Stand-level tables can only be combined with other stand-level tables"))
tables <- tables[1]
globals$tableMessage=TRUE
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
selected=tables)
updateSelectInput(session, "selectdbtables", selected = tables)
}
if (any(tables %in% globals$specLvl) && any(tables %notin% globals$specLvl)) {
if (any(tables %in% globals$specLvl) && any(selection %notin% globals$specLvl)) {
session$sendCustomMessage(type = "infomessage",
message = paste0("Species-level tables can only be combined with other species-level tables"))
tables <- tables[1]
globals$tableMessage=TRUE
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
selected=tables)
updateSelectInput(session, "selectdbtables", selected = tables)
}
# DBH-class tables cannot be combined with any other table
if (any(tables %in% globals$dClsLvl)) {
if (length(selection) < 1 && any(selection %in% globals$dClsLvl)) {
session$sendCustomMessage(type = "infomessage",
message = paste0("DBH-class tables cannot be combined with any other tables"))
tables <- tables[1]
globals$tableMessage=TRUE
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
selected=tables)
updateSelectInput(session, "selectdbtables", selected = tables)
}
# HT-class tables cannot be combined with any other table
if (any(tables %in% globals$htClsLvl)) {
if (length(selection) < 1 && any(selection %in% globals$htClsLvl)) {
session$sendCustomMessage(type = "infomessage",
message = paste0("HT-class tables cannot be combined with any other tables"))
tables <- tables[1]
globals$tableMessage=TRUE
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
selected=tables)
updateSelectInput(session, "selectdbtables", selected = tables)
}
# tree-level tables cannot be combined with any other table
if (any(tables %in% globals$treeLvl)) {
if (length(selection) < 1 && any(selection %in% globals$treeLvl)) {
session$sendCustomMessage(type = "infomessage",
message = paste0("Tree-level tables cannot be combined with any other tables"))
tables <- tables[1]
globals$tableMessage=TRUE
updateSelectInput(session, "selectdbtables", choices=as.list(globals$tbsFinal),
selected=tables)
updateSelectInput(session, "selectdbtables", selected = tables)
}
break
}
Expand Down Expand Up @@ -1496,7 +1490,7 @@ cat ("cmd=",cmd,"\n")
updateSelectInput(session, "plotType",selected="scat") else
if (length(intersect(c("StdStk","CmpStdStk","StdStk_East",
"CmpStdStk_East","StdStk_Metric","CmpStdStk_Metric"),names(dat))))
updateSelectInput(session, "plotType",selected="bar") else
updateSelectInput(session, "plotType",selected="bar") else
updateSelectInput(session, "plotType",selected="line")
iprg = iprg+1
setProgress(message = "Loading selection widgets", detail = "", value = iprg)
Expand All @@ -1512,7 +1506,7 @@ cat ("cmd=",cmd,"\n")
"StdStk","StdStk_East","StdStk_Metric","CmpStdStk","CmpStdStk_East",
"CmpStdStk_Metric"),names(dat))))
cho[isel] else cho
updateSelectInput(session, "year", choices=as.list(cho), selected=sel)
updateSelectInput(session, "year", choices=as.list(cho), selected=cho[1])
}
globals$exploreChoices$year = cho
if (is.null(mdat$Species))
Expand Down
Binary file modified fvsOL/inst/extdata/databaseDescription.xlsx
Binary file not shown.
5 changes: 1 addition & 4 deletions fvsOL/parms/basekeys.kwd
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ f3v{ws}:{blank}
f3v{cr sw sp sf lp bp}:{blank}
f3v{ne ls cs sn}:{blank}

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

f4:{numberBox Minimum top diameter}
//f4{sn}:{noInput Minimum top diameter can not be changed in Southern US}
f4v{cr sw sp sf lp}:{blank}
f4v{ni ie em ws bm ec kt wc pn ca}:{blank}
f4v{so ut tt ak ci nc bp}:{blank}
Expand Down
12 changes: 4 additions & 8 deletions fvsOL/parms/modifiers.prm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ softwoods and 12.0" for hardwoods. The default pulpwood minimum DBH is 4.0" for
hardwoods and softwoods.

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

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

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

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

f6:{numberBox Form class}
Expand Down Expand Up @@ -133,13 +131,11 @@ f8v{ut tt ci}:{blank}
f8v{so ak nc}:{blank}

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

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

f11:{numberBox Form class}
Expand Down
4 changes: 2 additions & 2 deletions rFVS/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: rFVS
Title: Interface functions for the Forest Vegetation Simulator
Version: 2023.02.01
Version: 2024.07.01
Authors@R: person("Nicholas", "Crookston", email = "[email protected]",
role = c("aut", "cre"))
Description: Provides a set of R functions that interface with the
Forest Vegetation Simulator when it is run as a shared libray.
Depends: R (>= 4.0.0)
License: MIT
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
24 changes: 12 additions & 12 deletions rFVS/R/fvsAddActivity.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ function(year,activity,parms=NULL)
BASE_SETPTHIN= 248,BASE_PRUNE = 249,BASE_COMPRESS= 250,BASE_FERTILIZ= 260,
ESTB_TALLY = 427,ESTB_TALLYONE= 428,ESTB_TALLYTWO= 429,ESTB_PLANT = 430,
ESTB_NATURAL = 431,ESTB_ADDTREES= 432,ESTB_STOCKADJ= 440,ESTB_HTADJ = 442,
BASE_RESETAGE= 443,ESTB_SPROUT = 450,ESTB_NATURAL = 490,ESTB_BURNPREP= 491,
ESTB_MECHPREP= 493,COVR_COVER = 900,MIST_MISTMULT=2001,MIST_MISTPREF=2002,
MIST_MISTMORT=2003,MIST_MISTHMOD=2004,MIST_MISTGMOD=2005,MIST_MISTPINF=2006,
MIST_MISTABLE=2007,FIRE_SALVSP =2501,FIRE_SOILHEAT=2503,FIRE_BURNREPT=2504,
FIRE_MOISTURE=2505,FIRE_SIMFIRE =2506,FIRE_FLAMEADJ=2507,FIRE_POTFIRE =2508,
FIRE_SNAGOUT =2512,FIRE_FUELOUT =2515,FIRE_SALVAGE =2520,FIRE_FUELINIT=2521,
FIRE_SNAGINIT=2522,FIRE_PILEBURN=2523,FIRE_FUELTRET=2525,FIRE_FUELREPT=2527,
FIRE_MORTREPT=2528,FIRE_DROUGHT =2529,FIRE_FUELMOVE=2530,FIRE_FUELMODL=2538,
FIRE_DEFULMOD=2539,FIRE_CARBREPT=2544,FIRE_CARBCUT =2545,FIRE_CANFPROF=2547,
FIRE_FUELFOTO=2548,FIRE_FIRECALC=2549,FIRE_FMODLIST=2550,FIRE_DWDVLOUT=2551,
FIRE_DWDCVOUT=2552,FIRE_FUELSOFT=2553,ECON_PRETEND =2605,ECON_SEVSTART=2606,
ECON_SPECCST =2607,ECON_SPECRVN =2608,ECON_STRTECON=2609)
BASE_RESETAGE= 443,ESTB_SPROUT = 450,ESTB_BURNPREP= 491,ESTB_MECHPREP= 493,
COVR_COVER = 900,MIST_MISTMULT=2001,MIST_MISTPREF=2002,MIST_MISTMORT=2003,
MIST_MISTHMOD=2004,MIST_MISTGMOD=2005,MIST_MISTPINF=2006,MIST_MISTABLE=2007,
FIRE_SALVSP =2501,FIRE_SOILHEAT=2503,FIRE_BURNREPT=2504,FIRE_MOISTURE=2505,
FIRE_SIMFIRE =2506,FIRE_FLAMEADJ=2507,FIRE_POTFIRE =2508,FIRE_SNAGOUT =2512,
FIRE_FUELOUT =2515,FIRE_SALVAGE =2520,FIRE_FUELINIT=2521,FIRE_SNAGINIT=2522,
FIRE_PILEBURN=2523,FIRE_FUELTRET=2525,FIRE_FUELREPT=2527,FIRE_MORTREPT=2528,
FIRE_DROUGHT =2529,FIRE_FUELMOVE=2530,FIRE_FUELMODL=2538,FIRE_DEFULMOD=2539,
FIRE_CARBREPT=2544,FIRE_CARBCUT =2545,FIRE_CANFPROF=2547,FIRE_FUELFOTO=2548,
FIRE_FIRECALC=2549,FIRE_FMODLIST=2550,FIRE_DWDVLOUT=2551,FIRE_DWDCVOUT=2552,
FIRE_FUELSOFT=2553,ECON_PRETEND =2605,ECON_SEVSTART=2606,ECON_SPECCST =2607,
ECON_SPECRVN =2608,ECON_STRTECON=2609)

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

Expand Down

0 comments on commit d9c410b

Please sign in to comment.