Code Monkey home page Code Monkey logo

Comments (12)

ChrisAdderley avatar ChrisAdderley commented on August 14, 2024

Important to note that there's no such thing as a dynamic module in stock or anything I support at the moment.... so this is the first instance of that.

Let's leave this ticket open until we are sure the integration is complete.

from dynamicbatterystorage.

blackliner avatar blackliner commented on August 14, 2024

Not the module is dynamic, but it is both a producer AND consumer of EC. Without the second change, my stuff won't be able to be considered as a consumer.

from dynamicbatterystorage.

ChrisAdderley avatar ChrisAdderley commented on August 14, 2024

Dynamic in this context = can be producer or consumer.

from dynamicbatterystorage.

ChrisAdderley avatar ChrisAdderley commented on August 14, 2024

So just to verify this concept works for you... I've reduced the size of the interface somewhat. Handlers are now defined on a per-module basis rather than a large blob of consumers and a large blob of producers. Here's the one for RB:

https://github.com/ChrisAdderley/DynamicBatteryStorage/blob/feature/dynamic/Source/DynamicBatteryStorage/Handlers/RealBatteryPowerHandlers.cs

The GetPower() method now just reports the power delta, so negative if consuming, positive if producing, and the rest.
It's now up to anyone writing support configs to just implement the methods in the template class for their own class.

https://github.com/ChrisAdderley/DynamicBatteryStorage/blob/feature/dynamic/Source/DynamicBatteryStorage/Handlers/PowerHandler.cs

This will be in the next released version but will need a bunch of testing so that might be a while.

from dynamicbatterystorage.

blackliner avatar blackliner commented on August 14, 2024

Wow, nice job. I am currently in Spain for work, so I don't have access to my PC. But what I can see from my phone: I like :-)

Are your NFT handlers still WIP? Because I think your consumers will need to negate their power.

Again, thanks for the work, I am sorry I use DBS and now you have to maintain it :-) but I think it is a very important mod! The whole concept should also work for any massless resource, right? ;-)

from dynamicbatterystorage.

ChrisAdderley avatar ChrisAdderley commented on August 14, 2024

Yes... this hasn't even been built yet haha.

from dynamicbatterystorage.

ChrisAdderley avatar ChrisAdderley commented on August 14, 2024

I'll probably deploy this as a new release in the next week - I'd appreciate if you could test your the implementation before then :)

from dynamicbatterystorage.

blackliner avatar blackliner commented on August 14, 2024

I'll try to get some PC time today or tomorrow.

Need to look at the sign for power again, somehow your debug window shows a negative value if a RealBattery is producing EC.

from dynamicbatterystorage.

blackliner avatar blackliner commented on August 14, 2024

Hi Chris,
i am thinking of switching from PartModules to a VesselModule, since the way i am balancing the load between the batteries is already (sortof) centralized. How could we enable DBS to support that? Would it work without PartModules at all? Or what is your expirience, should i stick with PartModules for the batteries and do an additional loadBalancer_VesselModule?

Cheers Flo

from dynamicbatterystorage.

ChrisAdderley avatar ChrisAdderley commented on August 14, 2024

Need to look at the sign for power again, somehow your debug window shows a negative value if a RealBattery is producing EC.

I merged your PR on this which flipped the sign, which is it?

i am thinking of switching from PartModules to a VesselModule, since the way i am balancing the load between the batteries is already (sortof) centralized. How could we enable DBS to support that? Would it work without PartModules at all? Or what is your expirience, should i stick with PartModules for the batteries and do an additional loadBalancer_VesselModule?

Easiest way to do this is have your VesselModule balance the load and inform the batteries what they should produce, then DBS looks at that information

from dynamicbatterystorage.

blackliner avatar blackliner commented on August 14, 2024

Thank you, i am still at figuring out a good way to do this. I came to that idea because someone made a PR to support RealFuels. The PR made no sense, but then the idea came for "dumb" tanks and a smart VM.

For the issue with the sign, i am currently testing it, should have something in a few minutes... and here we go: https://i.imgur.com/hSRTvIE.jpg

  • i am displaying the public double lastECpower; negative means discharging
  • my -15 EC/s are reported as +15EC/s via GetPower by * -1 because DBS is assuming positive = producer (right?)
  • do i miss public override bool IsProducer() in my powerhandler?

from dynamicbatterystorage.

blackliner avatar blackliner commented on August 14, 2024

https://i.imgur.com/Rm9zwAb.jpg

here RealBattery is "consuming" 3.6 EC/s, getPower does a -3.6 out of it, and you show it in the producers tab. So i think i need the isProducer() -> PR'ing right away -> #7

from dynamicbatterystorage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.