post-kerbin-mining-corporation/DynamicBatteryStorage

Investigate incorrect reported consumption totals.

ChrisAdderley opened this issue · 4 comments

Moved to issue from #39 .

Hi,

KSP version: 1.7.3.2594
Mod List:

  1. Dynamic Battery Storage dev build (at Commit a85c269)
  2. ModuleManager 4.0.2
  3. RemoteTech 1.9.3

Please see the replication steps below for this issue.

  1. Create Sandbox Game and go to VAB
  2. Build 1 Probe OKTO, 4 OX-STAT solar panels, 1 Z-200 battery and 1 Comm-16 (extended state)
    craft
  3. Save and launch this vessel
  4. Open DBS window and observe the inconsistent readings
    2

This issue does not happen on DBS 2.0.5 and RemoteTech 1.9.3.

My guess is I did something wrong on RemoteTech support configuration because it appears that the transmitter consumption rate is counted towards the total generation rate, instead of total consumption rate

Ah this might be the problem then. It's not totally clear to me in your PR, but the convention is that consumption is a negative value.
(basically, setting consumer and producer flags tell the UI what to do, the actual behind the scenes plugin works in total flow rates, which can be dynamic and change between producing and consuming)

Hi,

Yes, I forgot to multiply the consumption output by -1.0.

Kindly assist to change this in your codebase to return -1.0*consumerAmount;

With this change, DBS will report correct total generation and consumption amounts.

Resolved and released in 2.0.6