USFS-PNW / Fia-Biosum-Manager

User interface and main code repository for Biosum
http://biosum.info/
Other
3 stars 3 forks source link

PROCESSOR: Add option to trigger additional CPA from FVS_COMPUTE flags #295

Closed lbross closed 1 year ago

lbross commented 1 year ago

The current implementation charges the additional CPA when harvest occurs regardless of whether the additional CPA was actually incurred. It supports manually assigning the additional CPA to a database table but this is often untenable due to large volumes. This enhancement will allow FVS to indicate if an additional cost was incurred for a given plot/rx/rxcycle. The inactive stands processing will be modified to be controlled by the same FVS_COMPUTE flags.

sebbusby commented 1 year ago

Validated using the Douglas Cty project, Processor is correctly using flags in the FVS_COMPUTE table to assign additional harvest costs. Awesome addition!

jsfried commented 1 year ago

@lbross Can the tab in processor be relabled Additional CPA (instead of Supplemental Harvest Costs, a label we’ve retired)?

jsfried commented 1 year ago

Name (of cost component) leading with a numeral is not allowed by error message does not explain that. Leading with an underscore- a supposedly allowable character, yields this error: image

lbross commented 1 year ago

Good catch on Supplemental Harvest Costs vs Additional CPA. I identified that tab in the requirements but unfortunately missed it in the implementation. Could I get some more information on the cost component name error? Where did you enter the invalid name? For rx-associated CPA this happens in the Rx screens but for Processor scenario-level components it happens on the Processor screen. Should I restrict the name to 8 letters only? I think this is in the documentation, but is apparently not enforced in the UI.

jsfried commented 1 year ago

@lbross OK, yes that is confusing. I entered the name in the dialog presented in the Processor Supplemental Harvest Costs tab when you click on the button to add a scenario level CPA. In this dialog it IS restricted to 8 letters and no special chars etc and can't start with a digit but the guidance displayed in the error dialog is not complete and a leading underscore presents an !!Error!! I guess it really does not need to be restricted to FVS compatibility rules because a scenario level cost can be labeled any which way that Access (and soon SQLite) will accept, right?

lbross commented 1 year ago

A scenario-level cost can have any label that Access/SQLite support. Unfortunately the error message you shared with the underscore leading the column name is generated by the database and there is no way for me to intercept it. I can only be proactive on the front-end and disallow a leading underscore. I will add this to the list of input edits for this field.

jsfried commented 1 year ago

And maybe we update the docs to say lead with a letter!

lbross commented 1 year ago

No argument from me on the docs. I updated the error message to inform that underscores and numbers can't be used in the first position. I assume neither of these is critical enough to generate a new .msi that is different from the one you are already using? They'll be sitting there waiting for v5.10.2.