I was honestly considering making a mod like this myself but I found this! These additions could be very powerful for flow control for a big distribution network with multiple inputs and outputs. Hopefully the factorio API has the stuff needed to make this work.
Bit of a long post but I feel like fully explaining the idea is better than not. All of the ideas kind of work together but I have written them in order of complexity.
Idea 1
Can you have the flow value output onto the circuit network as an "F" signal?
Idea 2
Can you also make the flow value output negative or positive depending on the direction the fluid is flowing through the pipe? The flow reading direction can be flipped by pressing "R"
(I foresee a possible crash or weird readings if two fluids are in the pipe somehow and it tries to do a calculation if you don't do a check for it)
Here are three images to demonstrate the entire concept:
https://imgur.com/a/dJXctVL
Also notice in the first two images that the flow reading is the same for both directions but the the level in the pipe is different?
This is exactly the kind of situation that would benefit from having the level and flow readings.
"I have 1500 units of fluid moving through the output pipe, but can only maintain a level of 37 even though my storage tank is at 80. The flow readings from the storage tank input pumps add up to 1000. I am losing 500 units overall...my consumption is too high for my fluid bus"
With access to the flow reading, the level reading would become roughly analogous to PSI in vanilla factorio.
Mod pipes with a different storage size will affect this.
Pipe mechanics forum post:
https://forums.factorio.com/viewtopic.php?t=19851
Eg)
Your level reading appears to be a percentage reading based off of the storage size of the pipe.
Indicator Output = (Fluid in pipe/Pipe storage size ) X 100 (AKA percentage full)
For a correct "PSI" reading that is inherently compatible with other mods the formula should be
Indicator Output = Fluid in pipe
All three readings are:
Percentage = (Fluid in pipe/Pipe storage size ) X 100
PSI = Fluid in pipe
Flow = Fluid unit(s)/second
In total you could have 3 circuit network readings:
Percentage = the reading this mod already has
PSI = P signal for fluid in pipe
Flow = F signal for fluid flow (negative or positive)
All three could theoretically be negative. I am not sure if factorio allows for negative PSI in its coding.
IRL the atmosphere has a pressure so a pressure reading from a gauge is actually the difference in pressure from the atmosphere to the gauge.
So sometimes people specify a reading as PSIG, where G indicates it is a gauge reading.
Eg)
The standard atmosphere pressure of earth is 14.69 PSI.
The atmosphere on Venus is 1334 PSI.
A gauge reading on earth that says -2 PSIG is 12.69 PSI Absolute
A gauge reading on venus that says -2 PSIG is 1332 PSI Absolute
If you took an "empty" tank of air from earth that has a PSIG of 0 and brought it to venus it would read -1317.31 PSIG
Idea 3
Time-series graph. This will probably be difficult to implement but it has been done before.
This would only be truly useful if all of the fluid reading are available.
Here is the only example mod I can find:
https://mods.factorio.com/mod/timeseries_fixfor110
This mod is quite old and appears to have issues
This idea would probably be best as an independent mod.
It plots any signal received over time and uses a combinator-like thing to receive signals.
This will probably be very UPS unfriendly so control over how many times the signal value is saved per minute is definitely needed.
And a limit to how far back the data is recorded.
Eg) 1 data point for all of the signals is plotted once every 10 seconds and the history is kept for 1 hour.
At the end of all of this I could make a factory alarms for oil fields that are dry
Predict how long my factory can keep running with current fluid stockpiles
And have alarms for when supply does not meet demand. (If i throw a bunch of speed modules in a refinery and alarms start going off then I know I will have issues)
All of the data manipulation can be done by combinators before being received by the "plotting combinator" for display.
And a couple of balance/UPS ideas
-
I feel like the tech requirement for these should be "fluid handling and "circuit network."
-
The UPS tax for each of these pipes may add up significantly. Instead, I suggest two tiers of indicators which also works into balancing.
Basic and Advanced. Or "Local" and "Remote" indicators, respectively.
The Local indicator has no circuit network capabilities so it does not have unused extra resources. The tech and ingredient requirements are good as-is. Maybe reduce the display options as well. Anything to reduce the overhead while keeping them useful
The Remote indicator has circuit network capabilities, the tech requirement for these should be "fluid handling" and "circuit network," and also takes an arithmetic combinator to craft. If you think it should also take an advanced circuit, or just an advanced circuit without a combinator, then the tech should be "Advanced Electronics" and "circuit network." Fluid handling is already researched by the time you research Advanced Electronics, and even without the combinator the whole point of the Remote indicator is to be used with a circuit network.