Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OK. Working Visual Studio means I could actually compile and test this before sending the pull request. You do not want to know what I had to do to get that build environment set up.
When mining using ORS, if there's insufficient storage for the output product, I refund the fraction of the power that wasn't used. I also made the power usage gui element smooth out a bit for situations where the miner is racing the refinery.
When refining using the ISRU, if no output material was able to be stored, I refund all of the source materials and megajoules. Gui elements in the context menu properly display power usage and conversion rates.
When both ORS mining AND ISRU refining are active and competing for insufficient power, mining seems to get priority until the resource is full, at which point it'll start refunding power. The ISRU then has some power left when its turn comes around, and removes some of the base resource to produce whatever. On the next tick, mining isn't full anymore, so it'll use a fraction of a tick of power to top off, leaving the ISRU with a fraction of the power for the tick to do a small amount of conversion. At this point it's steady state until the ISRU's output products are full, at which point they'll both stop using power with their tanks completely full, and megajoules will begin to accumulate again.
Thus, a ship with an ISRU and an aluminum hybrid rocket on mun, with an un-upgraded 6.25m fission reactor and generator, can now (eventually) refuel by leaving the mining and electrolysis options turned on at the same time.