porisius / FicsitRemoteMonitoring

54 stars 12 forks source link

Normalize units for liquid+gas between extractors and factory calls #28

Closed featheredtoast closed 1 year ago

featheredtoast commented 1 year ago

Would it also be possible to normalize units between getExtractors and getFactory calls? It'd make it possible to add and compute these numbers up nicely.

getExtractor is returning m3

Examples note production is a rate of 120:

"building":"Resource Well Extractor",
      "location":{
         "x":218169.40625,"y":137548.90625,"z":-209.025772,
         "rotation":240
      },
      "Recipe":"Nitrogen Gas",
      "production":[
         {
            "Name":"Nitrogen Gas",
            "CurrentProd":120.0,
            "MaxProd":120.0,
            "ProdPercent":"100.0"
         }
      ],
      "ManuSpeed":1.0,
      "IsConfigured":true,
      "IsProducing":true,
      "IsPaused":false,
      "CircuitID":0

getFactory (both production and consumption) is using a unit that is x1000 of m3: note consumption is 37500.0

      "building":"Blender",
      "location":{
         "x":151600.0,"y":202700.0,"z":-5300.0,
         "rotation":0
      },
      "Recipe":"Fused Modular Frame",
      "production":[
         {
            "Name":"Fused Modular Frame",
            "CurrentProd":1.5,
            "MaxProd":1.5,
            "ProdPercent":100.0
         }
      ],
      "ingredients":[
         {
            "Name":"Heavy Modular Frame",
            "CurrentConsumed":1.5,
            "MaxConsumed":1.5,
            "ConsPercent":100.0
         },         {
            "Name":"Aluminum Casing",
            "CurrentConsumed":75.0,
            "MaxConsumed":75.0,
            "ConsPercent":100.0
         },         {
            "Name":"Nitrogen Gas",
            "CurrentConsumed":37500.0,
            "MaxConsumed":37500.0,
            "ConsPercent":100.0
         }
      ],
      "ManuSpeed":1.0,
      "IsConfigured":true,
      "IsProducing":true,
      "IsPaused":false,
      "CircuitID": 83

Here's a battery blender for comparison on liquid production - note - water, sulfuric acid, and alumina solution are all x1000 of the units displayed in game:

"building":"Blender",
      "location":{
         "x":21200.0,"y":15900.0,"z":24700.015625,
         "rotation":0
      },
      "Recipe":"Battery",
      "production":[
         {
            "Name":"Battery",
            "CurrentProd":20.0,
            "MaxProd":20.0,
            "ProdPercent":100.0
         },         {
            "Name":"Water",
            "CurrentProd":30000.0,
            "MaxProd":30000.0,
            "ProdPercent":100.0
         }
      ],
      "ingredients":[
         {
            "Name":"Sulfuric Acid",
            "CurrentConsumed":50000.0,
            "MaxConsumed":50000.0,
            "ConsPercent":100.0
         },         {
            "Name":"Alumina Solution",
            "CurrentConsumed":40000.0,
            "MaxConsumed":40000.0,
            "ConsPercent":100.0
         },         {
            "Name":"Aluminum Casing",
            "CurrentConsumed":20.0,
            "MaxConsumed":20.0,
            "ConsPercent":100.0
         }
      ],
      "ManuSpeed":1.0,
      "IsConfigured":true,
      "IsProducing":true,
      "IsPaused":false,
      "CircuitID": 83
featheredtoast commented 1 year ago

Last patch fixed this :tada: