Space Engineers

Space Engineers

1,108 个评价
Power Graphs
3
5
4
   
奖励
收藏
已收藏
取消收藏
标签: visualization
文件大小
发表于
更新日期
497.113 KB
2018 年 8 月 15 日 下午 11:31
2023 年 1 月 28 日 下午 5:00
53 项改动说明 ( 查看 )

订阅以下载
Power Graphs

描述
This programmable block script uses LCDs to display power statistics over time as graphs.

This script is not currently under active development. New features are unlikely to be added however it will still be updated with fixes if any Space Engineers update happens to break it.

Graph types that can be displayed, not case sensitive:
usage - Total power usage / required power
usageScaled - Same as usage but scaled to the total max required power
battery - Battery charge
batteryIn - Battery input
batteryOut - Battery output
batteryInOut - Combined battery input and output
batteryInOutAuto - Same as batteryInOut but scaled by peak value.
solar - Solar power output / used solar power
reactor - Reactor power output
h2engine - Hydrogen engine power output
wind - Wind turbine power output
storedOxygen - Stored Oxygen*
storedHydrogen - Stored Hydrogen*

* Must be enabled in the configuration (which is in the Custom Data of the program block).

Setup
- First make sure that Ingame Scripts are enabled for your world. This will require Experimental Mode to be turned on in the game settings.
- Once in a world, add the script to a programmable block on the grid you want to monitor.
- Add the name tag (default is [PowerGraph]) into the names of any display blocks you want to show graphs on.
- The displays should automatically start cycling between graphs.
- To show only specific graph types on a display, write the names of the graph types (shown above) that you want into the CustomData of the display block, one type per line.

Configuration
There are additional usage instructions at the beginning of the script text inside the PB. These include how to show graphs on specific screens in multi-screen blocks.

Important! After the program first runs it generates configuration text inside the Custom Data of the programmable block. There are many important configuration options there along with their descriptions. Please read through them as they may be very important for your use case. The script must be recompiled to apply configuration changes.

To reset the saved data of a program block run the script with the argument "resetData" without the quotes.

Timing
By default the script collects data after every update interval (default 60 seconds) up to 100 data points (200 if using long history). At default settings this will give about 1.6 hours of data.
Reducing the update interval (the Data_Update_Interval_In_Seconds setting in the script) will reduce the span of time that a graph covers. For performance reasons values under 10 seconds are not recommended. Using default resolution settings the amount of time covered by a graph on a standard LCD can be calculated as (100 * update interval seconds). Eg: when using an interval of 30 seconds the graph will span 50 minutes.

Sensor LCD Culling
This feature allows the script to only update LCDs when a player is in range of a sensor. It is useful for servers and worlds where players are often not near LCDs since the script then doesn't need to update the displays.
Using sensor LCD culling is recommended for maintaining performace when many script instances are being used.

Help
I installed the script but my screens show nothing!
If you want to display graphs on LCDs that are on connected grids you will need to enable support for this in the script configuration. Look for the option called Display_On_LCDs_Of_Attached_Grids.

I have solar panels/gas tanks but the graph says there are none!
If your solar panels/gas tanks are on a sub-grid (ie. connected via rotors, etc) you will need to enable the option for reading the power of connected grids in the script configuration (which is in the program block Custom Data, not the script code). Look for the lines that start with Include_Data_From_Attached_(Small/Large)_Grids. There are different options for small and large grids. If you also want to read power of grids attached via connectors there are additional options for doing so.

I made changes to the configuration but it doesn't seem to work!
Starting with Power Graphs version 1.8.6 all configuration options have moved to the Custom Data section of the program block. Trying to change the settings inside the script code will not work. Once you have edited the config in Custom Data you will need to recompile the script for the changes to take effect.

Notes / Known Issues
- Pausing the game may record power values of zero unless Zero_Fill_Missing_Values is set to false.
- Enabling long history will use more performance and if using on a server more network bandwidth.

If you still want to use the old bitmap version of the script you can find it here: https://steamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1710076979
616 条留言
Remaarn  [作者] 11 月 16 日 下午 10:07 
@Volg Thank you for your interest, however, as it says in the description this project is not under active development and doesn't receive new features, sorry.
Volg 11 月 16 日 下午 6:19 
on the battery in / out pages could you add the time to full / empty data?

And secondly i want to display the PB status on the second surface "keyboard" and the graphs on the main surface of the PB. the status does display on the keyboard just fine with the current setup, however if i add the display section to the PB's custom data the script just over writes it. you need to add a bit of logic for a custom data section and not delete / over write it if there are graph pages defined there.
Remaarn  [作者] 11 月 7 日 下午 7:59 
@TOM-TOM The script should already handle your scenario just fine so long as you have configured it properly. Please see the Help section in the description above.
TOM-TOM 11 月 7 日 上午 9:58 
If I have solar panels attached to a hinge mounted on a motor on my station, the solar panels are not detected by the script, probably because it's a grid on a sub-grid of the main grid.

So I made this small modification to tell the script to check all grids and sub-grids of sub-grids, without limit.
Frission 11 月 5 日 上午 5:52 
btw, can confirm the h2engine graph works for tracking plasma, thanks <3
Remaarn  [作者] 11 月 4 日 下午 8:15 
@TOM-TOM I'm not sure what behaviour you are expecting but the original function already looks correct to me. All your modification does is remove the ability to configure whether grids connected via Connectors should be included or not. What is the current script doing that doesn't match your expectation?
TOM-TOM 11 月 4 日 下午 6:42 
Hi Remaarn,

Your script works great! I made a modification to the block validation logic (IsValidBlock) so that sub-grids attached via rotors, hinges, pistons, etc., are now properly included, while grids connected only through connectors are ignored. You can see the updated version here: https://pastebin.com/RhwUQQbA
Frission 10 月 20 日 下午 12:16 
I'll give that a check!
Remaarn  [作者] 10 月 19 日 下午 10:02 
@Frission I have no plans to make the script work with any specific mod, however, the main reactor part in that mod appears to be based on a hydrogen engine and so it might already show up on the h2engine graph.
Frission 10 月 19 日 上午 10:23 
Is there any way to get this to track Plasma Generators (from the mod MA Plasma Reactor https://steamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2847666099 ) under reactor data?