Discerning true initial status of control valves
As far as I can tell, it's not possible to determine the actual setting/status of a control valve whenever a fixed status is specified for that valve.
For example, you have an FCV with an initial setting of 1000, but that same valve is specified with a status of OPEN. Asking getlinkvalue() for the INITSETTING will return 0.0, because the open status has wiped out the initial setting and replaced it with the value of MISSING, and the toolkit returns 0.0 in that case. You can't use the status of OPEN as a reliable clue, because the toolkit returns OPEN both where a status of OPEN is explicitly specified (and the initial setting is wiped out), or where no initial status is specified (where the initial setting is whatever is specified).
This could be corrected, I think, by having getlinkvalue() return a value of MISSING (instead of 0.0), whenever the initial status is actually MISSING.
I wouldn't be surprised if this isn't thought to be a good solution, because it changes the current behavior of getlinkvalue(). Any opinions? A different approach would seem to involve more changes to behavior, however. Note that the toolkit include file already includes a definition for EN_MISSING, though I'm not sure what that use case was.
We're running into this problem as well, a little bit of background information on this issue https://github.com/OpenWaterAnalytics/EPANET/issues/583#issuecomment-583850008
One suggestion that Lew gave was checking the headloss along the valve https://www.openepanet.org/Topic/21960/link-status-values-and-cv-status
Though having a way to check the status and setting reliably from the toolkit would be beneficial
-- cc @neslerel