porisius / FicsitRemoteMonitoring

54 stars 12 forks source link

Underclocked production numbers are not correct #36

Closed featheredtoast closed 1 year ago

featheredtoast commented 1 year ago

Found an issue with underclocked machines reporting incorrect CurrentConsumed/CurrentProd numbers.

EG: manufacturer here is reporting correct MaxConsumed/MaxProd numbers, but incorrect Current* numbers, which is also reporting a ProdPercent/ConsPercent of over 100%.

(This affects GetProdStats as well.)

{
      "building":"Manufacturer",
      "location":{
         "x":-47887.464844,"y":228504.71875,"z":7234.810547,
         "rotation":45
      },
      "Recipe":"Alternate: Radio Control System",
      "production":[
         {
            "Name":"Radio Control Unit",
            "CurrentProd":4.5,
            "MaxProd":2.5,
            "ProdPercent":179.899994,
            "Inventory":0
         }
      ],
      "ingredients":[
         {
            "Name":"Crystal Oscillator",
            "CurrentConsumed":1.5,
            "MaxConsumed":0.8,
            "ConsPercent":179.899994,
            "Inventory":100
         },         {
            "Name":"Circuit Board",
            "CurrentConsumed":15.0,
            "MaxConsumed":8.3,
            "ConsPercent":179.899994,
            "Inventory":200
         },         {
            "Name":"Aluminum Casing",
            "CurrentConsumed":90.0,
            "MaxConsumed":50.0,
            "ConsPercent":179.899994,
            "Inventory":168
         },         {
            "Name":"Rubber",
            "CurrentConsumed":45.0,
            "MaxConsumed":25.0,
            "ConsPercent":179.899994,
            "Inventory":200
         }
      ],
      "ManuSpeed":55.599998,
      "IsConfigured":true,
      "IsProducing":true,
      "IsPaused":false,
      "CircuitID": 83
}

Screenshot of affected manufacturer for reference:

image

porisius commented 1 year ago

That means getProdStats is off too... okay

Told you, ya find another one.

porisius commented 1 year ago

Run this in the chat bar...

/frmdebug getFactory

It will only return the first one it finds, but it's the output from the BP nodes before they are calculated

porisius commented 1 year ago

image

porisius commented 1 year ago

0.8.20 is live. Please confirm overclocked values as well please. It LGTM, but you've been better about finding inaccuracies.

featheredtoast commented 1 year ago

LGTM too, thank you! 👍

porisius commented 1 year ago

It was that Get Current Potential was not calculating into the consumption rates.

I'm going to try to get better about saying what the fix was.