更改初版

This commit is contained in:
2025-12-25 11:13:13 +08:00
parent 51e4d5add4
commit 7c001e6396
15 changed files with 1450 additions and 100 deletions

View File

@@ -0,0 +1,145 @@
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrpaonEMS.App.Models
{
/// <summary>
/// 控制参数配置值
/// </summary>
public class ControlConfigValue : BindableBase
{
/// <summary>
/// 实例化函数
/// </summary>
public ControlConfigValue()
{
SolarToEsAsFullSoc = 97;
Master_ToSlaveByMasterSoc = 5;
Master_ToSlaveBySlaveSoc = 15;
Master_SolarToSlaveEsFullByMasterSoc = 95;
Slave_ToMasterBySlaveSoc = 5;
Slave_ToMasterByMasterSoc = 15;
Slave_SolarToMasterEsFullBySlaverSoc = 95;
NightMaster_ToMasterFullSoc = 98;
NightSlave_ToSlaveFullSoc = 98;
DisChargeModel = new List<DisChargeModelItem>();
SelectedDisChargeModel = 1;
}
private double _SolarToEsAsFullSoc;
/// <summary>
/// 光伏给储能充电 作为满的比值
/// 90-97
/// </summary>
public double SolarToEsAsFullSoc
{
get { return _SolarToEsAsFullSoc; }
set { _SolarToEsAsFullSoc = value; RaisePropertyChanged(); }
}
private double _Master_ToSlaveByMasterSoc;
/// <summary>
/// Master模式切换到Slave模式时MasterSOC的阈值
/// </summary>
public double Master_ToSlaveByMasterSoc
{
get { return _Master_ToSlaveByMasterSoc; }
set { _Master_ToSlaveByMasterSoc = value; RaisePropertyChanged(); }
}
private double _Master_ToSlaveBySlaveSoc;
/// <summary>
/// Master模式切换到Slave模式时Slave SOC的阀值
/// 两个同时考虑
/// </summary>
public double Master_ToSlaveBySlaveSoc
{
get { return _Master_ToSlaveBySlaveSoc; }
set { _Master_ToSlaveBySlaveSoc = value; RaisePropertyChanged(); }
}
private double _Master_SolarToSlaveEsFullByMasterSoc;
/// <summary>
/// Master模式光伏给从储能充满了是否切换到Slave模式但是此时需要判断主储能MasterSOC是否满了主储能也满的话也无法接收光伏的电否则不切换
/// 主要考虑尽可能的不浪费光伏的电,主从储能只要有余量就要接受光伏的电,也要防止频繁的切换
/// < SolarToEsAsFullSoc
/// </summary>
public double Master_SolarToSlaveEsFullByMasterSoc
{
get { return _Master_SolarToSlaveEsFullByMasterSoc; }
set { _Master_SolarToSlaveEsFullByMasterSoc = value; RaisePropertyChanged(); }
}
private double _Slave_ToMasterBySlaveSoc;
/// <summary>
/// Slave模式切换到Master模式时SOC的阀值
/// 两个同时考虑
/// </summary>
public double Slave_ToMasterBySlaveSoc
{
get { return _Slave_ToMasterBySlaveSoc; }
set { _Slave_ToMasterBySlaveSoc = value; RaisePropertyChanged(); }
}
private double _Slave_ToMasterByMasterSoc;
/// <summary>
/// Slave模式切换到Master模式时SOC的阀值
/// 两个同时考虑
/// </summary>
public double Slave_ToMasterByMasterSoc
{
get { return _Slave_ToMasterByMasterSoc; }
set { _Slave_ToMasterByMasterSoc = value; RaisePropertyChanged(); }
}
private double _Slave_SolarToMasterEsFullBySlaverSoc;
/// <summary>
/// Slave模式光伏给主储能充满了是否切换到Master模式但是此时需要判断从储能SOC是否满了从储能也满的话也无法接收光伏的电否则不切换
/// 主要考虑尽可能的不浪费光伏的电,主从储能只要有余量就要接受光伏的电,也要防止频繁的切换
/// < SolarToEsAsFullSoc
/// </summary>
public double Slave_SolarToMasterEsFullBySlaverSoc
{
get { return _Slave_SolarToMasterEsFullBySlaverSoc; }
set { _Slave_SolarToMasterEsFullBySlaverSoc = value; RaisePropertyChanged(); }
}
private double _NightMaster_ToMasterFullSoc;
/// <summary>
/// 晚上,主储能充满的标志,也是切换到从储能的控制标志
/// </summary>
public double NightMaster_ToMasterFullSoc
{
get { return _NightMaster_ToMasterFullSoc; }
set { _NightMaster_ToMasterFullSoc = value; RaisePropertyChanged(); }
}
private double _NightSlave_ToSlaveFullSoc;
/// <summary>
/// 晚上,从储能充满的标志,也是切换到主储能的控制标志
/// </summary>
public double NightSlave_ToSlaveFullSoc
{
get { return _NightSlave_ToSlaveFullSoc; }
set { _NightSlave_ToSlaveFullSoc = value; RaisePropertyChanged(); }
}
private List<DisChargeModelItem> _DisChargeModel;
public List<DisChargeModelItem> DisChargeModel
{
get { return _DisChargeModel; }
set { _DisChargeModel = value; RaisePropertyChanged(); }
}
private int _SelectedDisChargeModel;
public int SelectedDisChargeModel
{
get { return _SelectedDisChargeModel; }
set { _SelectedDisChargeModel = value; RaisePropertyChanged(); }
}
}
}

View File

@@ -0,0 +1,10 @@
using System;
namespace OrpaonEMS.App.Models
{
public class DisChargeModelItem
{
public int Model { get; set; }
public string DisChargeTime { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.System.Power;
namespace OrpaonEMS.App.Models
{
/// <summary>
/// 放电时间模型
/// 7、8月份11点放电
/// 其他月份8点开始放点
/// </summary>
public class DischargeTimeModel
{
public DischargeTimeModel(DisChargeType disChargeType)
{
CurDisChargeType = disChargeType;
}
/// <summary>
/// 当前放电时间
/// </summary>
public DateTime CurDischargeTime { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 8, 0, 0);
/// <summary>
/// 可以放电吗?
/// </summary>
/// <returns></returns>
public bool IsCanDischarge()
{
DateTime currentTime = DateTime.Now;
DateTime curDischargeTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, CurDischargeTime.Hour, 0, 0);
// Check if current time is after the configured discharge time
if (currentTime.TimeOfDay >= curDischargeTime.TimeOfDay)
{
return true;
}
// Not yet time to discharge
return false;
}
private DisChargeType _CurDisChargeType;
/// <summary>
/// 当前放电模式
/// </summary>
public DisChargeType CurDisChargeType
{
get { return _CurDisChargeType; }
set
{
_CurDisChargeType = value;
}
}
}
/// <summary>
/// 放电类型
/// </summary>
public enum DisChargeType
{
/// <summary>
/// 放电模式A
/// </summary>
DischargeA = 1,
/// <summary>
/// 放电模式B
/// </summary>
DischargeB = 2,
}
}