feat: 新增电价参数配置功能

- 在Excel模板中新增电价参数项(默认0.4元/kWh)
- GUI界面显示电价参数,支持从Excel读取
- 核心计算逻辑集成电价参数,为后续经济性分析做准备
- 支持自定义电价或使用默认值
This commit is contained in:
dmy
2026-01-06 11:43:41 +08:00
parent 86e0e21b58
commit c54ad369a4
3 changed files with 27 additions and 2 deletions

15
gui.py
View File

@@ -128,6 +128,21 @@ def index():
pf_str += " (默认)"
params_text.append(pf_str)
# 获取电价
ep = 0.4 # Default
is_default_ep = True
if (
state.get("system_params")
and "electricity_price" in state["system_params"]
):
ep = state["system_params"]["electricity_price"]
is_default_ep = False
ep_str = f"电价: {ep} 元/kWh"
if is_default_ep:
ep_str += " (默认)"
params_text.append(ep_str)
for p in params_text:
ui.chip(p, icon="bolt").props("outline color=primary")