Skip to content

EU Chart_EN

MIAOKATZE edited this page Jul 13, 2026 · 2 revisions

EU Chart

1. Function Overview

The EU Chart is the core feature of Tab 1 on the Network Info Panel, used to visualize wireless grid energy trends. It simultaneously displays the grid energy level and the EU/t change rate via a dual Y-axis chart, and supports switching between 8 time windows for different time spans.

Network Info Panel EU Chart Network all-weather monitoring illustration
  • Located on Tab 1 of the Network Info Panel (default tab)
  • Dual Y-axis: left axis = grid energy, right axis = EU/t change rate
  • Supports 8 time windows: 5 minutes / 1 hour / 8 hours / 24 hours / 7 days / 1 month (28 d) / 3 months (84 d) / 1 year (336 d)
  • Brief area shows current energy, average EU/t, realtime EU/t, and grid status, scientific notation by default
  • Uses Fritsch-Carlson monotone cubic Hermite spline for smooth rendering

Module Relationship: The EU Chart is the Tab 1 feature of the Network Info Panel. For the block crafting, extender panel stitching, multi-panel sharing, and other general mechanisms, see 03 Network Info Panel.

2. Dual Y-Axis

The EU Chart uses a dual Y-axis design to display two types of data simultaneously:

Axis Data Color Description
Left Grid Energy Blue Current wireless grid energy level
Right EU/t Rate Orange Energy change rate per tick, reflecting charge/discharge trend

Design Note: The EU/t rate line color (orange) matches the AE Chart's change-rate line color, allowing players to form consistent color recognition across different tabs.

3. 8 Time Windows

The EU Chart supports 8 time windows, each being a 61-point FIFO:

Window Sample Count Sample Interval Total Duration Description
5 minutes 61 100 ticks (5 s) 300 s Raw sampling
1 hour 61 1200 ticks (60 s) 3600 s Inflow from 5m means
8 hours 61 9600 ticks (480 s) 28800 s Inflow from 1h means
24 hours 61 28800 ticks (1440 s) 86400 s Inflow from 8h means
7 days 61 201600 ticks (10080 s) 604800 s Inflow from 24h means
1 month (28 d) 61 806400 ticks (40320 s) 2419200 s Inflow from 7d means
3 months (84 d) 61 2419200 ticks (120960 s) 7257600 s Inflow from 1M means
1 year (336 d) 61 9676800 ticks (483840 s) 29030400 s Inflow from 3M means

Inflow Count Chain (Natural Ratio)

The 8 time windows are triggered via a nested count chain with non-uniform ratios, derived naturally from the duration ratio of adjacent windows:

  • 5m → 1h: Every 12 5m samples triggers 1 1h sample (3600s / 300s = 12)
  • 1h → 8h: Every 8 1h samples triggers 1 8h sample (28800s / 3600s = 8)
  • 8h → 24h: Every 3 8h samples triggers 1 24h sample (86400s / 28800s = 3)
  • 24h → 7d: Every 7 24h samples triggers 1 7d sample (604800s / 86400s = 7)
  • 7d → 1M: Every 4 7d samples triggers 1 1M sample (2419200s / 604800s = 4, 1M=28d)
  • 1M → 3M: Every 3 1M samples triggers 1 3M sample (7257600s / 2419200s = 3, 3M=84d)
  • 3M → 1Y: Every 4 3M samples triggers 1 1Y sample (29030400s / 7257600s = 4, 1Y=336d≈11 months)

The count chain ratio is 12 → 8 → 3 → 7 → 4 → 3 → 4 (5m → 1h → 8h → 24h → 7d → 1M → 3M → 1Y).

Natural Ratio Meaning: The "inflow trigger count" of each window equals the duration ratio of adjacent windows, so data flows naturally from short windows to long windows; the ratio is not a single uniform value but derived from duration ratios. All windows are 61-point FIFOs that drop oldest when full, no manual cleanup needed. Average/rate fields take the mean on inflow; instantaneous fields (eu/timeMs/tick) take the snapshot value.

4. Brief Area Data

The brief area shows the following key data:

Data Item Calculation Description
Current Energy Real-time read Current wireless grid energy level
Average EU/t First-last delta Based on the 61-point window's first and last sample delta (300s window)
Realtime EU/t Latest 2-point slope Instantaneous change rate from the latest 2 samples
Grid Status Four-branch logic Calculating / Silent / Long-Term Silent / Normal (see 09 Grid Status Mechanism)

First-Last Delta Method: Average EU/t = (last energy - first energy) / (last tick - first tick), computed over the 61-point FIFO window. This smooths short-term fluctuations and reflects the overall trend. Uses BigDecimal precise division (6 decimals, HALF_UP) to avoid precision loss when converting BigInteger to double.

5. Spline Curve

The trend line uses the Fritsch-Carlson monotone cubic Hermite spline:

  • Algorithm: The monotoneCubicPath method implements the Fritsch-Carlson monotone cubic Hermite spline
  • Monotonicity: Preserves monotonicity, avoids overshoot
  • Endpoint handling: Natural first/last derivatives, no [0,1] hard clamp
  • Smoothing parameter: 0-12
smoothing Segments Description
0 1 segment Linear (no smoothing)
1-12 smoothing × 2 + 2 segments (4-26) Smooth curve, segments increase with smoothing

6. Display Modes

The brief area supports 3 display modes:

Mode Name Display Example
0 Normal 1,234,567
1 Scientific 1.23E6
2 Metric 1.23K

From v1.5.17 the default is 1 (Scientific). If an old save already has displayMode explicitly stored, the stored value is used; new/unset panels default to scientific.

Metric mode details: Main display call points use 2 decimals (e.g. 1.23K, 999.00); axis Y tick labels keep no decimals (e.g. 1K) to avoid long labels; negative numbers uniformly use prefix minus (-1.23K). In scientific mode, small values (< 10000.0) auto-fallback to normal display.

7. Configuration

All configuration items for the EU Chart (with defaults and ranges):

Config Type / Default Range Description
trackingWindow int 0-7 Time window (0=5m / 1=1h / 2=8h / 3=24h / 4=7d / 5=1M / 6=3M / 7=1Y)
trendLineSmoothing int = 2 0-12 Spline smoothing
trendLineThickness int = 3 - Trend line width (glLineWidth)
displayMode int = 1 0-2 Display mode (0=Normal / 1=Scientific / 2=Metric); default 1 from v1.5.17
chartBorderThickness int = 3 1-8 Chart border width
chartBackgroundColor String = "" - Chart background color (empty = no fill)
screenBackgroundColor String - Screen background color (empty = no fill)
briefRatio int = 28 10-80 Brief font ratio (getBriefFontScale()=briefRatio/20.0)
showBriefEnergy boolean - Brief energy toggle
showBriefStatus boolean - Brief status toggle
showChartEnergy boolean - Chart energy curve toggle
showChartStatus boolean - Chart EU/t curve toggle
energyAxisMin / Max String - Energy Y-axis range (empty = auto, with 10% padding)
eutAxisMin / Max String - EU/t Y-axis range (empty = auto, with 10% padding)

8. Usage Guide

  1. Step 1: Craft and place the Network Info Panel in the world (see 03 Network Info Panel for crafting)
  2. Step 2: Right-click to open the GUI; the EU Chart tab (Tab 1) is shown by default
  3. Step 3: Switch between the 8 time windows (5m / 1h / 8h / 24h / 7d / 1M / 3M / 1Y) in the GUI
  4. Step 4: Configure trend line smoothing, display mode, Y-axis range, colors, etc.
  5. Step 5: View the dual Y-axis chart and brief area data to observe grid energy trends and charge/discharge status

9. Color Constants

Color constants used by the EU Chart:

Element Color Value Color Description
Energy line 0x1F6FFF Blue Left-axis energy trend line
EU/t line 0xFF7A18 Orange Right-axis EU/t rate trend line
Axes 0x4E5964 Dark gray Chart axis lines
Ticks 0x6A7680 Gray Axis tick labels

Clone this wiki locally