Jump to content




Powergraph - displays stored energy with a graph


26 replies to this topic

#1 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 27 February 2016 - 08:38 PM

Do you want to have a quick and easy way to see how much RF or EU you have in your capacitorbank/energy cube/MFSU/energy cell/energy core..... ?
Do you want to see how its gone up and down the last minute, or ten?

Try Powergraph!

Posted Image

Posted Image


Introducing PowergraphMulti

PowergraphMulti is a updated version of Powergraph that supports multiple monitors and energy storage blocks, if you before wanted to use multiple monitors you had to run several copies of Powergraph, but not anymore.

Features!
  • Designed for all monitors from 3*2 and bigger (like the one above). But smaller works.
  • Advanced and normal monitor support.
  • Supports energy storage blocks from several mods.
  • The color of the graph can be changed (requires advanced monitor).
  • Supports adding a one line name at the bottom, with no name added the bottom row will be used by the graph.
  • Configurable update time.
  • PowergraphMulti is designed for using several energy storages and monitors
  • Set text scale / resolution for monitors - Fit more details on a small monitor or make it easier to read from far away!

SimpleMode

With simpleMode (enabled by default) you can just place down the computer and connect the peripherals, run the program and it will hopefully work without any configuration in the program! simpleMode will only take the first monitor and energy storage it finds so if you want to connect multiple energy storages or monitors you still need to configure it. SimpleMode scans for the energy storages listed under "Tested mods and blocks"


Current limitations
  • Screen size to not update automaticly, program restart required. (will probably not be implemented)
Tested mods and blocks
First, note that many blocks will not work with pure Computercraft, many of them will need one of the extra peripherals mods! (don't know witch)
The following mods and blocks should work with correct configuration, other blocks may or may not work, try it.
  • Energy Cell (Thermal Expansion)
  • Capacitor Bank (Ender IO)
  • Energy Core (Draconic Evolution) (connect to an energy pylon)
  • Batbox/MFE/MFSU (Industrial Craft 2) (Only with peripheral proxy from OpenPeripherals)
  • Energy Cube and Induction storage (Mekanism)
  • lv/mv/hv Capacitor (Immersive Engineering)
  • Reactor and Turbine (Big Reactors)
The following mods and blocks are known to not work
  • no currently known

Configuring program settings
Spoiler

License
MIT-license

Download
pastebin get 9KpbFEqb powergraphMulti

Updates
6 March 2016: Bug fix and added support for IC2 EU storage

9 April 2016: Added PowergraphMulti

28 May 2016: Added ability to set text scale for monitors in powergraphMulti

10 August 2016: Small update to support Mekansim energy cubes and induction storage

24 January 2017: Added simpleMode

26 January 2017: Added support for BigReactors

10 November 2017: Added support for reading energy information using Plethora for increased peripheral support (looks for the existence of getMetadata().energy.capacity and getMetadata().energy.stored in the wrapped peripheral.)


Open for suggestions for new features.

Edited by Stekeblad, 10 November 2017 - 10:45 PM.


#2 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 28 February 2016 - 02:13 PM

Your image hasn't posted properly.

Also, change "not so good" to "current limitations" it reads better

as for multi monitor support, put them all in a table and put your monitor interactions in a loop.

Edited by Lupus590, 28 February 2016 - 02:15 PM.


#3 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 29 February 2016 - 12:07 PM

Thanks, the Image looked like it worked in two different browsers then I posted it, updated the post. I also changed to current limitations as you suggested.

Is multi monitor support a function that many users want?
It would probably needs some bigger changes to support multiple monitors of different sizes, easiest right now is to run several copies of the program configured to use different monitors.

#4 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 02 March 2016 - 02:38 PM

Added License information and pasted a copy of the settings part of the program

#5 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 02 March 2016 - 04:58 PM

You can detect if the monitor changes shape with os.pullEvent("monitor_resize")

#6 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 02 March 2016 - 05:20 PM

I know I can detect montior resize but I don't feel like it is something needed. A quick restart of the program and its working. (ctrl+t, arrow up, enter or ctrl+r if running as startup)

#7 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 06 March 2016 - 05:26 PM

Fixed Image that seems to break after a short time, hope it works now.

Fixed a bug and added support for Industrial craft EU

I also took a look at monitor resize-ing and multi-monitor support but decided to not implement it, if I add support for multiple monitors I have so many features that I can think off and would like to add that it will not be the powergraph I want anymore. (And probably to difficult for me to do right now). Powergraph is made to be a short program that displays the power of a storage as a graph (currently ~175 lines). If someone want a multi-monitor version he or she is free to create one based on my code.

Edited by Stekeblad, 06 March 2016 - 05:28 PM.


#8 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 09 April 2016 - 04:59 PM

Added support for multiple monitors/energy storages!

Download PowergraphMulti if you want to test it, no changes in old Powergraph.

#9 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 28 May 2016 - 07:07 PM

Small update for PowergraphMulti: You can now set text scale for every monitor-battery pair. You can have bigger text on monitors far away and more details on a small one.

#10 augiteSoul

  • Members
  • 31 posts
  • LocationSomewhere in France

Posted 29 May 2016 - 01:53 PM

How do you set it? (with modems? monitors?)

#11 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 30 May 2016 - 10:48 AM

View PostaugiteSoul, on 29 May 2016 - 01:53 PM, said:

How do you set it? (with modems? monitors?)

You need a monitor to display the graph on and a energy storage to watch (tested with Thermal Expansion, Ender IO and Industrial Craft), you connect the energy storage and monitor to the computer by placing them next to the computer or using modems.

How you configure the program settings is in the spoilers in the first post and in the code.

Little example for PowergraphMulti
You have an advanced computer and monitor and want to monitor the energy in your Ender IO capacitor bank. The monitor is on top of the computer and the capacitor bank is connected to the computer using wired modems. Then you turn on the modem the bank gets a name displayed in your chat, something like tile_blockcapacitorbank_name_0
You like the color blue and want your graph to have that color.

The configuration will then look like this:
  -- Seconds between checking stored energy
  -- and updating monitors (default: 5)
local updateInterval = 5

local dataTable = {
  {
	monitor = "top",
	energy = "tile_blockcapacitorbank_name_0",
	blitColor = "b"
  }
}
...

Then you run PowergraphMulti for the first time it will see their is no configuration and open itself to be edited.

If you still don't understand, reply and I will try to help you.

#12 augiteSoul

  • Members
  • 31 posts
  • LocationSomewhere in France

Posted 30 May 2016 - 02:42 PM

View PostStekeblad, on 30 May 2016 - 10:48 AM, said:

View PostaugiteSoul, on 29 May 2016 - 01:53 PM, said:

How do you set it? (with modems? monitors?)

You need a monitor to display the graph on and a energy storage to watch (tested with Thermal Expansion, Ender IO and Industrial Craft), you connect the energy storage and monitor to the computer by placing them next to the computer or using modems.

How you configure the program settings is in the spoilers in the first post and in the code.

Little example for PowergraphMulti
You have an advanced computer and monitor and want to monitor the energy in your Ender IO capacitor bank. The monitor is on top of the computer and the capacitor bank is connected to the computer using wired modems. Then you turn on the modem the bank gets a name displayed in your chat, something like tile_blockcapacitorbank_name_0
You like the color blue and want your graph to have that color.

The configuration will then look like this:
  -- Seconds between checking stored energy
  -- and updating monitors (default: 5)
local updateInterval = 5

local dataTable = {
  {
	monitor = "top",
	energy = "tile_blockcapacitorbank_name_0",
	blitColor = "b"
  }
}
...

Then you run PowergraphMulti for the first time it will see their is no configuration and open itself to be edited.

If you still don't understand, reply and I will try to help you.

I'll try it and I will edit this post to say if it worked.
EDIT: Not working, will put code and screens here.

Edited by augiteSoul, 30 May 2016 - 02:53 PM.


#13 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 09 August 2016 - 11:12 PM

small update adding support for mekanism energy cubes and induction storage multi block

#14 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 24 January 2017 - 04:31 PM

Updated!
There is now a setting called simpleMode that is enabled by default. Use it then you only have one monitor and energy storage you want to monitor, you only need to connect the energy storage and monitor to the computer by wired modems or placing them next to it and then run the program. If the energy storage is one of the tested once it will work directly.

#15 TheRockettek

  • Members
  • 547 posts
  • LocationRem is best girl

Posted 24 January 2017 - 04:41 PM

erm the max storage for big reactors turbines and reactors is 10million rf reguardless

#16 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 25 January 2017 - 06:47 AM

They always have 10 million but because they don't have a type of maxEnergy function I need to write extra code to detect if it is a reactor or turbine and set a variable. I can probably write some code for it but currently they don't work. I have a idea I can test later.

#17 TheRockettek

  • Members
  • 547 posts
  • LocationRem is best girl

Posted 25 January 2017 - 07:22 AM

Well
You can do peripheral.getType() and I thought it returns like bigreators-reactor or -turbine

#18 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 26 January 2017 - 06:55 PM

I made some testing, for me a reactor has a storage of 10 million but a turbine only has 1 million. I believed they both had 10 million RF storage... I even tested in two different modpacks and one of them with default config. Both had big reactors 0.4.3A (currently latest for 1.7.10).

View PostTheRockettek, on 25 January 2017 - 07:22 AM, said:

Well
You can do peripheral.getType() and I thought it returns like bigreators-reactor or -turbine
Getting the name of the blocks is not difficult, place down a modem, turn it on and write down the name. To handle it like I currently to with IC2 and Mekanism the peripheral is already wrapped then I check if it supports functions to get stored/max RF.

EnderIO and Thermal expansion for example has the functions getEnergyStored and getMaxEnergyStored. Then I added support for mekanism I took a more general approach and instead of looking for "Energy Cube" I checked for the functions getEnergy and getMaxEnergy. Note: getEnergy not getEnergyStored

For the reactors and turbines I was testing for a function they had in common and getEnergyStored and created my own getMaxEnergyStored that returned 10 million. Then they don't even have the same storage capacity and I can't call a function for it I will take a specific approach and test for something very unique for each of them, like getControlRodLevel and getBladeEfficiency.

---------------------------------------------
Support for Big Reactors turbine and reactor is now implemented and should work.

#19 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 10 November 2017 - 10:51 PM

New update! If you play with Plethora you should be able to get energy information of blocks. Not much testing done yet but you can for example connect a Thermal Expansion energy cell and Powergraph will be able to work with it. (Energy cells is not a valid peripheral without Plethora)

#20 Purple

  • Members
  • 115 posts
  • LocationAlone in the dark, looking at the pretty lights with dreams of things I can not have.

Posted 29 October 2020 - 02:39 PM

Is there a way I can get this working on 14.4 given that plethora is not updated yet?





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users