添加项目文件。
This commit is contained in:
43
OrpaonEMS.Model/ConfigDbData.cs
Normal file
43
OrpaonEMS.Model/ConfigDbData.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.Model
|
||||
{
|
||||
[Table(Name = "ConfigDbData")]
|
||||
public class ConfigDbData
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键 自增主键
|
||||
/// </summary>
|
||||
[Column(IsPrimary = true, IsIdentity = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称信息
|
||||
/// </summary>
|
||||
[Column(Name = "Name", IsNullable = false, StringLength = 50)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分类
|
||||
/// </summary>
|
||||
[Column(Name = "Category", IsNullable = false, StringLength = 20)]
|
||||
public string Category { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 值和数据
|
||||
/// </summary>
|
||||
[Column(Name = "Value", IsNullable = false, StringLength = 30)]
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Column(DbType = "datetime",CanUpdate =true)]
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
53
OrpaonEMS.Model/DataLogFile.cs
Normal file
53
OrpaonEMS.Model/DataLogFile.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件信息
|
||||
/// </summary>
|
||||
public class DataLogFile:BindableBase
|
||||
{
|
||||
|
||||
private ObservableCollection<DataLogFile> _SubFiles;
|
||||
/// <summary>
|
||||
/// 子文件信息
|
||||
/// </summary>
|
||||
public ObservableCollection<DataLogFile> SubFiles
|
||||
{
|
||||
get { return _SubFiles; }
|
||||
set
|
||||
{
|
||||
_SubFiles = value;
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private string _Ico;
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
public string Ico
|
||||
{
|
||||
get { return _Ico; }
|
||||
set { _Ico = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
|
||||
private string _Content;
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
public string Content
|
||||
{
|
||||
get { return _Content; }
|
||||
set { _Content = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
131
OrpaonEMS.Model/ESData.cs
Normal file
131
OrpaonEMS.Model/ESData.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
using CsvHelper.Configuration.Attributes;
|
||||
using System;
|
||||
|
||||
namespace OrpaonEMS.Model
|
||||
{
|
||||
public class ESData
|
||||
{
|
||||
/// <summary>
|
||||
/// //////////////////////////////////BMS数据///////////////////////////////////////////////
|
||||
/// </summary>
|
||||
|
||||
[Name("电池簇电流值")]
|
||||
public double BmsCur { get; set; }
|
||||
|
||||
[Name("电池簇电压")]
|
||||
public double BmsVol { get; set; }
|
||||
|
||||
[Name("电池簇总SOC")]
|
||||
public double BmsSOC { get; set; }
|
||||
|
||||
[Name("电池簇总SOH")]
|
||||
public double BmsSOH { get; set; }
|
||||
|
||||
[Name("电池簇总SOE")]
|
||||
public double BmsSOE { get; set; }
|
||||
|
||||
[Name("电池最高温度")]
|
||||
public double BmsMaxBatTemp { get; set; }
|
||||
|
||||
[Name("电池最低温度")]
|
||||
public double BmsMinBatTemp { get; set; }
|
||||
|
||||
[Name("累计充电电量")]
|
||||
public double BmsAccCharg { get; set; }
|
||||
|
||||
[Name("累计放电电量")]
|
||||
public double BmsAccDisCharg { get; set; }
|
||||
|
||||
[Name("最大允许放电功率")]
|
||||
public double BmsMaxDisChargePowerCell { get; set; }
|
||||
|
||||
[Name("最大允许充电功率")]
|
||||
public double BmsMaxChargePowerCell { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// //////////////////////////////////PCS数据///////////////////////////////////////////////
|
||||
/// </summary>
|
||||
|
||||
|
||||
[Name("储能PCS的实时功率")]
|
||||
public double PcsPower { get; set; }
|
||||
|
||||
[Name("Pcs当前的指令")]
|
||||
public double PcsCurCmdPw { get; set; }
|
||||
|
||||
[Name("PcsA相电压")]
|
||||
public double PcsAVol { get; set; }
|
||||
|
||||
[Name("PcsB相电压")]
|
||||
public double PcsBVol { get; set; }
|
||||
|
||||
[Name("PcsC相电压")]
|
||||
public double PcsCVol { get; set; }
|
||||
|
||||
[Name("PcsA相电流")]
|
||||
public double PcsACur { get; set; }
|
||||
|
||||
[Name("PcsB相电流")]
|
||||
public double PcsBCur { get; set; }
|
||||
|
||||
[Name("PcsC相电流")]
|
||||
public double PcsCCur { get; set; }
|
||||
|
||||
[Name("PCS的状态信息")]
|
||||
public string PcsStateMsg { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
//[Name("xxx")]
|
||||
//public double xxx { get; set; }
|
||||
|
||||
[Name("时间")]
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
36
OrpaonEMS.Model/Enums/ElePVEnum.cs
Normal file
36
OrpaonEMS.Model/Enums/ElePVEnum.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.Model.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// 削峰填谷的状态
|
||||
/// </summary>
|
||||
public enum ElePVEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// 尖峰模式
|
||||
/// </summary>
|
||||
[Description("尖峰模式")]
|
||||
TopPeak = 1,
|
||||
/// <summary>
|
||||
/// 峰模式
|
||||
/// </summary>
|
||||
[Description("峰价模式")]
|
||||
Peak = 2,
|
||||
/// <summary>
|
||||
/// 谷模式
|
||||
/// </summary>
|
||||
[Description("谷价模式")]
|
||||
Valley = 3,
|
||||
/// <summary>
|
||||
/// 平模式
|
||||
/// </summary>
|
||||
[Description("平价模式")]
|
||||
Flat = 4
|
||||
}
|
||||
}
|
||||
14
OrpaonEMS.Model/Enums/MasterSlaveLinkState.cs
Normal file
14
OrpaonEMS.Model/Enums/MasterSlaveLinkState.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.Model.Enums
|
||||
{
|
||||
public enum MasterSlaveLinkState:byte
|
||||
{
|
||||
OK=1,
|
||||
NG=2,
|
||||
}
|
||||
}
|
||||
58
OrpaonEMS.Model/Enums/SwitchEm.cs
Normal file
58
OrpaonEMS.Model/Enums/SwitchEm.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.Model.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// 开关的状态
|
||||
/// </summary>
|
||||
public enum SwitchEm
|
||||
{
|
||||
/// <summary>
|
||||
/// 开
|
||||
/// </summary>
|
||||
On = 1,
|
||||
/// <summary>
|
||||
/// 关
|
||||
/// </summary>
|
||||
Off = 2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开关故障的状态
|
||||
/// </summary>
|
||||
public enum SwitchErr
|
||||
{
|
||||
/// <summary>
|
||||
/// 正常
|
||||
/// </summary>
|
||||
OK = 1,
|
||||
/// <summary>
|
||||
/// 出错
|
||||
/// </summary>
|
||||
NG = 2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开关的状态信息
|
||||
/// </summary>
|
||||
public enum SwitchStateInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 开
|
||||
/// </summary>
|
||||
On = 1,
|
||||
/// <summary>
|
||||
/// 关
|
||||
/// </summary>
|
||||
Off = 2,
|
||||
/// <summary>
|
||||
/// 报错
|
||||
/// </summary>
|
||||
Err = 3
|
||||
}
|
||||
|
||||
}
|
||||
123
OrpaonEMS.Model/HourData.cs
Normal file
123
OrpaonEMS.Model/HourData.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
|
||||
namespace OrpaonEMS.Model
|
||||
{
|
||||
[Table(Name = "HourData")]
|
||||
[Index("uk_CreateTime", "CreateTime", false)]
|
||||
[Index("uk_HourInfo", "HourInfo", false)]
|
||||
[Index("uk_WorkDay", "WorkDay", false)]
|
||||
[Index("uk_Month", "Month", false)]
|
||||
public class HourData:BindableBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键 自增主键
|
||||
/// </summary>
|
||||
[Column(IsPrimary = true, IsIdentity = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 小时信息
|
||||
/// </summary>
|
||||
[Column(Name = "HourInfo", IsNullable = false)]
|
||||
public int HourInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工作日
|
||||
/// 20240408
|
||||
/// </summary>
|
||||
[Column(Name = "WorkDay", IsNullable = false)]
|
||||
public int WorkDay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 月份
|
||||
/// 202404
|
||||
/// </summary>
|
||||
[Column(Name = "Month", IsNullable = false)]
|
||||
public int Month { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 年
|
||||
/// 2024
|
||||
/// </summary>
|
||||
[Column(Name = "Year", IsNullable = false)]
|
||||
public int Year { get; set; }
|
||||
|
||||
|
||||
/////////////////////////////////光伏放电数据//////////////////////////////////////
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 光伏小时点位数据
|
||||
/// </summary>
|
||||
[Column(Name = "SolarHourPointValue")]
|
||||
public double SolarHourPointValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 光伏小时统计充电电量
|
||||
/// </summary>
|
||||
[Column(Name = "SolarHourCharg")]
|
||||
public double SolarHourCharg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 光伏小时统计收益
|
||||
/// </summary>
|
||||
[Column(Name = "SolarHourRevenue")]
|
||||
public double SolarHourRevenue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 光伏电价
|
||||
/// </summary>
|
||||
[Column(Name = "SolarElePrice")]
|
||||
public double SolarElePrice { get; set; }
|
||||
|
||||
|
||||
/////////////////////////////////储能放电数据//////////////////////////////////////
|
||||
|
||||
/// <summary>
|
||||
/// 储能小时点位数据-充电
|
||||
/// </summary>
|
||||
[Column(Name = "EsHourPointChargValue")]
|
||||
public double EsHourPointChargValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 储能小时点位数据-放电
|
||||
/// </summary>
|
||||
[Column(Name = "EsHourPointDisChargValue")]
|
||||
public double EsHourPointDisChargValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 储能小时统计充电电量
|
||||
/// </summary>
|
||||
[Column(Name = "EsHourCharg")]
|
||||
public double EsHourCharg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 储能小时统计放电电量
|
||||
/// </summary>
|
||||
[Column(Name = "EsHourDisCharg")]
|
||||
public double EsHourDisCharg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 储能小时统计收益
|
||||
/// </summary>
|
||||
[Column(Name = "EsHourRevenue")]
|
||||
public double EsHourRevenue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 储能实时电价
|
||||
/// </summary>
|
||||
[Column(Name = "EsElePrice")]
|
||||
public double EsElePrice { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Column(DbType = "datetime", ServerTime = DateTimeKind.Local)]
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
71
OrpaonEMS.Model/MasterSlave/ClientInfo.cs
Normal file
71
OrpaonEMS.Model/MasterSlave/ClientInfo.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.Model.MasterSlave
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户端的信息
|
||||
/// 通信的消息实体
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ClientInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前的站号
|
||||
/// </summary>
|
||||
public ushort Station { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大充电功率
|
||||
/// </summary>
|
||||
public double MaxChargPw { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大放电功率
|
||||
/// </summary>
|
||||
public double MaxDisChargPw { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前Soc
|
||||
/// </summary>
|
||||
public double SOC { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前的动作指令数据
|
||||
/// </summary>
|
||||
public double CurActionCmdPw { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前的状态
|
||||
/// </summary>
|
||||
public string SysState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否可以放电
|
||||
/// </summary>
|
||||
public bool IsDisCharg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否可以充电
|
||||
/// </summary>
|
||||
public bool IsCharg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 液冷的状态
|
||||
/// </summary>
|
||||
public bool CoolState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前SoE
|
||||
/// </summary>
|
||||
public double SOE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前SoE
|
||||
/// </summary>
|
||||
public double SOH { get; set; }
|
||||
}
|
||||
}
|
||||
79
OrpaonEMS.Model/MasterSlave/DistClient.cs
Normal file
79
OrpaonEMS.Model/MasterSlave/DistClient.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using OrpaonEMS.Model.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.Model.MasterSlave
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户端信息
|
||||
/// </summary>
|
||||
public class DistClient
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前客户端是不是本机
|
||||
/// </summary>
|
||||
public bool IsSelf { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主题
|
||||
/// </summary>
|
||||
public string Topic { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 通信连接状态
|
||||
///// </summary>
|
||||
//public MasterSlaveLinkState MasterSlaveLinkState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务侧和客户端连接状态模型
|
||||
/// </summary>
|
||||
public EMSServerConState EMSSocketServerConState { get; set; }=new EMSServerConState();
|
||||
|
||||
///// <summary>
|
||||
///// 最新的更新时间
|
||||
///// </summary>
|
||||
//public DateTime LastDatetime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户端信息
|
||||
/// 通信的实体
|
||||
/// </summary>
|
||||
public ClientInfo? ClientInfo { get; set; }=new ClientInfo();
|
||||
|
||||
/// <summary>
|
||||
/// 服务器侧给的指令
|
||||
/// 因为服务给每个客户端的发送的指令不一样(可能每个客户端的能力不一样那个),所以给到每个客户端命令都要单独一个
|
||||
/// </summary>
|
||||
public ServerCmd ServerCmd { get; set; }=new ServerCmd();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否可以参与发电
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsCanDisCharg()
|
||||
{
|
||||
if (EMSSocketServerConState.ConResult && ClientInfo.IsDisCharg)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否可以参与充电
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsCanCharg()
|
||||
{
|
||||
if (EMSSocketServerConState.ConResult && ClientInfo.IsCharg)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
212
OrpaonEMS.Model/MasterSlave/EMSClientConState.cs
Normal file
212
OrpaonEMS.Model/MasterSlave/EMSClientConState.cs
Normal file
@@ -0,0 +1,212 @@
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
|
||||
namespace OrpaonEMS.Model.MasterSlave
|
||||
{
|
||||
/// <summary>
|
||||
/// EMS Client连接状态模型
|
||||
/// 发送和接受的状态必须是OK的才能运行,否则停机
|
||||
/// 连接的状态必须是OK才能运行,否则停机
|
||||
/// </summary>
|
||||
public class EMSClientConState:BindableBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 声明委托对象-判定跟EMS连接失败时触发事件
|
||||
/// </summary>
|
||||
public event EventHandler<EMSConErrEventArgs> EMSClientConErrEventHandler;
|
||||
|
||||
/// <summary>
|
||||
/// 周期读取定时器
|
||||
/// 周期发送到SignaIR Hub中
|
||||
/// </summary>
|
||||
private System.Timers.Timer? timer { get; set; }
|
||||
|
||||
public EMSClientConState()
|
||||
{
|
||||
timer = new System.Timers.Timer(1000);
|
||||
timer.Elapsed -= CycleCheck;
|
||||
timer.Elapsed += CycleCheck;
|
||||
timer.AutoReset = true;
|
||||
timer.Enabled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 循环判定连接状态
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void CycleCheck(object? sender, ElapsedEventArgs e)
|
||||
{
|
||||
timer.Enabled = false;
|
||||
|
||||
//连接状态出错,立刻停止
|
||||
if (!ClientState)
|
||||
{
|
||||
Msg = "连接出现错误";
|
||||
ConResult = false;
|
||||
//EMSClientConErrEventHandler(this, new EMSConErrEventArgs() { Msg = "连接出现错误" });
|
||||
timer.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ClientSendState == false || TimeIsOk(ClientSendTime) == false)
|
||||
{
|
||||
Msg = "发送数据出现错误";
|
||||
ConResult = false;
|
||||
//EMSClientConErrEventHandler(this, new EMSConErrEventArgs() { Msg = "发送数据出现错误" });
|
||||
timer.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ClientRecvState == false || TimeIsOk(ClientRecvTime) == false)
|
||||
{
|
||||
Msg = "接受数据出现错误";
|
||||
ConResult = false;
|
||||
//EMSClientConErrEventHandler(this, new EMSConErrEventArgs() { Msg = "接受数据出现错误" });
|
||||
timer.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Msg = "";
|
||||
ConResult = true;
|
||||
timer.Enabled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通信的消息
|
||||
/// </summary>
|
||||
private string Msg { get; set; }=string.Empty;
|
||||
|
||||
private bool _ConResult = true;
|
||||
/// <summary>
|
||||
/// 整体的通信状态结果
|
||||
/// </summary>
|
||||
public bool ConResult
|
||||
{
|
||||
get { return _ConResult; }
|
||||
set
|
||||
{
|
||||
|
||||
//if (_ConResult != value)//触发一次
|
||||
//{
|
||||
// //暂时的逻辑不需要触发事件了,由外部的函数获取这个状态判断信息
|
||||
// //EMSClientConErrEventHandler(this, new EMSConErrEventArgs() { Msg = Msg, Result = value });
|
||||
// _ConResult = value;
|
||||
//}
|
||||
//Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff")} -通信结果:{value}");
|
||||
_ConResult = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private bool _ClientState;
|
||||
/// <summary>
|
||||
/// 通信连接状态
|
||||
/// 来自通信的事件触发方法
|
||||
/// </summary>
|
||||
public bool ClientState
|
||||
{
|
||||
get { return _ClientState; }
|
||||
set { _ClientState = value; }
|
||||
}
|
||||
|
||||
|
||||
private bool _ClientSendState;
|
||||
/// <summary>
|
||||
/// Client 发送数据的状态
|
||||
/// </summary>
|
||||
public bool ClientSendState
|
||||
{
|
||||
get { return _ClientSendState; }
|
||||
set
|
||||
{
|
||||
_ClientSendState = value;
|
||||
ClientSendTime = DateTime.Now;
|
||||
if (value)
|
||||
{
|
||||
ClientSendStateMsg = "正常";
|
||||
}
|
||||
else
|
||||
{
|
||||
ClientSendStateMsg = "失败";
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送数据的时间
|
||||
/// </summary>
|
||||
private DateTime ClientSendTime { get; set; } = DateTime.Now;
|
||||
|
||||
|
||||
private string _ClientSendStateMsg;
|
||||
/// <summary>
|
||||
/// Client 发送数据的状态 消息
|
||||
/// </summary>
|
||||
public string ClientSendStateMsg
|
||||
{
|
||||
get { return _ClientSendStateMsg; }
|
||||
set { _ClientSendStateMsg = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
|
||||
private bool _ClientRecvState;
|
||||
/// <summary>
|
||||
/// Client 接受数据的状态
|
||||
/// </summary>
|
||||
public bool ClientRecvState
|
||||
{
|
||||
get { return _ClientRecvState; }
|
||||
set
|
||||
{
|
||||
_ClientRecvState = value;
|
||||
ClientRecvTime = DateTime.Now;
|
||||
if (value)
|
||||
{
|
||||
ClientRecvStateMsg = "正常";
|
||||
}
|
||||
else
|
||||
{
|
||||
ClientRecvStateMsg = "失败";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string _ClientRecvStateMsg;
|
||||
/// <summary>
|
||||
/// Client 接受数据的状态 消息
|
||||
/// </summary>
|
||||
public string ClientRecvStateMsg
|
||||
{
|
||||
get { return _ClientRecvStateMsg; }
|
||||
set { _ClientRecvStateMsg = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///接受数据的时间
|
||||
/// </summary>
|
||||
private DateTime ClientRecvTime { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 判断时间是否OK
|
||||
/// 基于现在的时间
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool TimeIsOk(DateTime dateTime)
|
||||
{
|
||||
//大于1秒代表通信失败
|
||||
if ((DateTime.Now - dateTime).TotalSeconds > 1.5)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
OrpaonEMS.Model/MasterSlave/EMSConErrEventArgs.cs
Normal file
21
OrpaonEMS.Model/MasterSlave/EMSConErrEventArgs.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.Model.MasterSlave
|
||||
{
|
||||
public class EMSConErrEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// 消息
|
||||
/// </summary>
|
||||
public string Msg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// EMS连接结果
|
||||
/// </summary>
|
||||
public bool Result { get; set; }
|
||||
}
|
||||
}
|
||||
209
OrpaonEMS.Model/MasterSlave/EMSServerConState.cs
Normal file
209
OrpaonEMS.Model/MasterSlave/EMSServerConState.cs
Normal file
@@ -0,0 +1,209 @@
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
|
||||
namespace OrpaonEMS.Model.MasterSlave
|
||||
{
|
||||
public class EMSServerConState:BindableBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 声明委托对象-判定跟EMS连接失败时触发事件
|
||||
/// </summary>
|
||||
public event EventHandler<EMSConErrEventArgs> EMSServerConErrEventHandler;
|
||||
|
||||
/// <summary>
|
||||
/// 周期读取定时器
|
||||
/// 周期发送到SignaIR Hub中
|
||||
/// </summary>
|
||||
private System.Timers.Timer? timer { get; set; }
|
||||
|
||||
public EMSServerConState()
|
||||
{
|
||||
timer = new System.Timers.Timer(1000);
|
||||
timer.Elapsed -= CycleCheck;
|
||||
timer.Elapsed += CycleCheck;
|
||||
timer.AutoReset = true;
|
||||
timer.Enabled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 循环判定连接状态
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void CycleCheck(object? sender, ElapsedEventArgs e)
|
||||
{
|
||||
timer.Enabled = false;
|
||||
|
||||
//连接状态出错,立刻停止
|
||||
if (!ServerState)
|
||||
{
|
||||
Msg = "连接出现错误";
|
||||
ConResult = false;
|
||||
//EMSServerConErrEventHandler(this, new EMSConErrEventArgs() { Msg = "连接出现错误" });
|
||||
timer.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ServerSendState == false || TimeIsOk(ServerSendTime) == false)
|
||||
{
|
||||
Msg = "发送数据出现错误";
|
||||
ConResult = false;
|
||||
//EMSServerConErrEventHandler(this, new EMSConErrEventArgs() { Msg = "发送数据出现错误" });
|
||||
timer.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ServerRecvState == false || TimeIsOk(ServerRecvTime) == false)
|
||||
{
|
||||
Msg = "接受数据出现错误";
|
||||
ConResult = false;
|
||||
//EMSServerConErrEventHandler(this, new EMSConErrEventArgs() { Msg = "接受数据出现错误" });
|
||||
timer.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Msg = "";
|
||||
ConResult = true;
|
||||
timer.Enabled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通信的消息
|
||||
/// </summary>
|
||||
private string Msg { get; set; } = string.Empty;
|
||||
|
||||
private bool _ConResult = true;
|
||||
/// <summary>
|
||||
/// 整体的通信状态结果
|
||||
/// </summary>
|
||||
public bool ConResult
|
||||
{
|
||||
get { return _ConResult; }
|
||||
set
|
||||
{
|
||||
|
||||
//if (_ConResult != value)//触发一次
|
||||
//{
|
||||
// //暂时的逻辑不需要触发事件了,由外部的函数获取这个状态判断信息
|
||||
// //EMSServerConErrEventHandler(this, new EMSConErrEventArgs() { Msg = Msg, Result = value });
|
||||
// _ConResult = value;
|
||||
//}
|
||||
//Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff")} -通信结果:{value}");
|
||||
_ConResult = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private bool _ServerState;
|
||||
/// <summary>
|
||||
/// 通信连接状态
|
||||
/// 来自通信的事件触发方法
|
||||
/// </summary>
|
||||
public bool ServerState
|
||||
{
|
||||
get { return _ServerState; }
|
||||
set { _ServerState = value; }
|
||||
}
|
||||
|
||||
|
||||
private bool _ServerSendState;
|
||||
/// <summary>
|
||||
/// Server 发送数据的状态
|
||||
/// </summary>
|
||||
public bool ServerSendState
|
||||
{
|
||||
get { return _ServerSendState; }
|
||||
set
|
||||
{
|
||||
_ServerSendState = value;
|
||||
ServerSendTime = DateTime.Now;
|
||||
if (value)
|
||||
{
|
||||
ServerSendStateMsg = "正常";
|
||||
}
|
||||
else
|
||||
{
|
||||
ServerSendStateMsg = "失败";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string _ServerSendStateMsg = "失败";
|
||||
/// <summary>
|
||||
/// Server 发送数据的状态 消息
|
||||
/// </summary>
|
||||
public string ServerSendStateMsg
|
||||
{
|
||||
get { return _ServerSendStateMsg; }
|
||||
set { _ServerSendStateMsg = value;RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 发送数据的时间
|
||||
/// </summary>
|
||||
private DateTime ServerSendTime { get; set; } = DateTime.Now;
|
||||
|
||||
|
||||
private bool _ServerRecvState;
|
||||
/// <summary>
|
||||
/// Server 接受数据的状态
|
||||
/// </summary>
|
||||
public bool ServerRecvState
|
||||
{
|
||||
get { return _ServerRecvState; }
|
||||
set
|
||||
{
|
||||
_ServerRecvState = value;
|
||||
ServerRecvTime = DateTime.Now;
|
||||
if (value)
|
||||
{
|
||||
ServerRecvStateMsg = "正常";
|
||||
}
|
||||
else
|
||||
{
|
||||
ServerRecvStateMsg = "失败";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string _ServerRecvStateMsg = "失败";
|
||||
/// <summary>
|
||||
/// Server 接受数据的状态 消息
|
||||
/// </summary>
|
||||
public string ServerRecvStateMsg
|
||||
{
|
||||
get { return _ServerRecvStateMsg; }
|
||||
set { _ServerRecvStateMsg = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///接受数据的时间
|
||||
/// </summary>
|
||||
private DateTime ServerRecvTime { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 判断时间是否OK
|
||||
/// 基于现在的时间
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool TimeIsOk(DateTime dateTime)
|
||||
{
|
||||
//大于1秒代表通信失败
|
||||
if ((DateTime.Now - dateTime).TotalSeconds > 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
71
OrpaonEMS.Model/MasterSlave/ServerCmd.cs
Normal file
71
OrpaonEMS.Model/MasterSlave/ServerCmd.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.Model.MasterSlave
|
||||
{
|
||||
/// <summary>
|
||||
/// 服务端发送指令数据
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ServerCmd : BindableBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 站号
|
||||
/// </summary>
|
||||
public ushort Station { get; set; }
|
||||
|
||||
private string _CmdType;
|
||||
/// <summary>
|
||||
/// 指令类型
|
||||
/// 充电:charg
|
||||
/// 放电:discharg
|
||||
/// </summary>
|
||||
public string CmdType
|
||||
{
|
||||
get { return _CmdType; }
|
||||
set { _CmdType = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// 指令类型
|
||||
///// 充电:charg
|
||||
///// 放电:discharg
|
||||
///// </summary>
|
||||
//public string CmdType { get; set; }=string.Empty;
|
||||
|
||||
|
||||
private double _CmdPw;
|
||||
/// <summary>
|
||||
/// 功率指令
|
||||
/// </summary>
|
||||
public double CmdPw
|
||||
{
|
||||
get { return _CmdPw; }
|
||||
set { _CmdPw = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PCS指令
|
||||
/// 开和关
|
||||
/// </summary>
|
||||
public bool PcsOnOffCmd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 液冷指令
|
||||
/// 开和关
|
||||
/// </summary>
|
||||
public bool CoolOnOffCmd { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 其他指令
|
||||
///// Json信息解析
|
||||
///// </summary>
|
||||
//public string? OtherCmd { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
41
OrpaonEMS.Model/MqttConfig.cs
Normal file
41
OrpaonEMS.Model/MqttConfig.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Mqtt Config
|
||||
/// </summary>
|
||||
public class MqttConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Ip地址
|
||||
/// </summary>
|
||||
public string IP { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 端口号
|
||||
/// </summary>
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Client
|
||||
/// </summary>
|
||||
public string ClientId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User
|
||||
/// </summary>
|
||||
public string User { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Pwd
|
||||
/// </summary>
|
||||
public string Pwd { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
15
OrpaonEMS.Model/OrpaonEMS.Model.csproj
Normal file
15
OrpaonEMS.Model/OrpaonEMS.Model.csproj
Normal file
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CsvHelper" Version="32.0.3" />
|
||||
<PackageReference Include="Prism.Core" Version="8.1.97" />
|
||||
<PackageReference Include="Prism.DryIoc" Version="8.1.97" />
|
||||
<PackageReference Include="FreeSql" Version="3.2.820" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
64
OrpaonEMS.Model/PeakValleyConfig.cs
Normal file
64
OrpaonEMS.Model/PeakValleyConfig.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using OrpaonEMS.Model.Enums;
|
||||
namespace OrpaonEMS.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 削峰填谷配置
|
||||
/// </summary>
|
||||
[Table(Name = "PeakValleyConfig")]
|
||||
public class PeakValleyConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
[Column(IsPrimary = true, IsIdentity = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启用
|
||||
/// </summary>
|
||||
public bool Enable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
[Column(Name = "StartTime", IsNullable = false, StringLength = 6)]
|
||||
public string StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
[Column(Name = "EndTime", IsNullable = false, StringLength = 6)]
|
||||
public string EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电价类型/尖峰电价 平段电价 峰段电价 谷段电价
|
||||
/// </summary>
|
||||
[Column(MapType = typeof(string))]
|
||||
public ElePVEnum ElePV { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称(元)
|
||||
/// </summary>
|
||||
public double Price { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// ///////////////////////////////////////////导航属性///////////////////////////////////////////////////////
|
||||
///// </summary>
|
||||
|
||||
////电价
|
||||
//public long? ElePriceId { get; set; }
|
||||
//public ElePrice ElePrice { get; set; }
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 两个具体的配置 分别是报警和警告
|
||||
///// </summary>
|
||||
//public ICollection<ToleranceConfig> ToleranceConfigs { get; set; }
|
||||
}
|
||||
}
|
||||
178
OrpaonEMS.Model/YuPuHourData.cs
Normal file
178
OrpaonEMS.Model/YuPuHourData.cs
Normal file
@@ -0,0 +1,178 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
|
||||
namespace OrpaonEMS.Model
|
||||
{
|
||||
[Table(Name = "YuPuHourData")]
|
||||
[Index("uk_CreateTimeYuPu", "CreateTime", false)]
|
||||
[Index("uk_HourInfoYuPu", "HourInfo", false)]
|
||||
[Index("uk_WorkDaYuPuy", "WorkDay", false)]
|
||||
[Index("uk_MonthYuPu", "Month", false)]
|
||||
public class YuPuHourData : BindableBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键 自增主键
|
||||
/// </summary>
|
||||
[Column(IsPrimary = true, IsIdentity = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 小时信息
|
||||
/// </summary>
|
||||
[Column(Name = "HourInfo", IsNullable = false)]
|
||||
public int HourInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工作日
|
||||
/// 20240408
|
||||
/// </summary>
|
||||
[Column(Name = "WorkDay", IsNullable = false)]
|
||||
public int WorkDay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 月份
|
||||
/// 202404
|
||||
/// </summary>
|
||||
[Column(Name = "Month", IsNullable = false)]
|
||||
public int Month { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 年
|
||||
/// 2024
|
||||
/// </summary>
|
||||
[Column(Name = "Year", IsNullable = false)]
|
||||
public int Year { get; set; }
|
||||
|
||||
/////////////////////////////////光伏放电税务大楼//////////////////////////////////////
|
||||
|
||||
/// <summary>
|
||||
/// 光伏到税务大楼小时点位数据
|
||||
/// </summary>
|
||||
[Column(Name = "SolarTaxHourPointValue")]
|
||||
public double SolarTaxHourPointValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 光伏到税务大楼小时统计充电电量
|
||||
/// </summary>
|
||||
[Column(Name = "SolarHourCharg")]
|
||||
public double SolarTaxHourCharg { get; set; }
|
||||
|
||||
|
||||
/////////////////////////////////光伏放电管理大楼//////////////////////////////////////
|
||||
|
||||
/// <summary>
|
||||
/// 光伏到管理大楼小时点位数据
|
||||
/// </summary>
|
||||
[Column(Name = "SolarManageHourPointValue")]
|
||||
public double SolarManageHourPointValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 光伏到管理大楼小时统计充电电量
|
||||
/// </summary>
|
||||
[Column(Name = "SolarManageHourCharg")]
|
||||
public double SolarManageHourCharg { get; set; }
|
||||
|
||||
/////////////////////////////////储能到管理大楼//////////////////////////////////////
|
||||
|
||||
/// <summary>
|
||||
/// 储能小时点位数据-充电
|
||||
/// </summary>
|
||||
[Column(Name = "EsManageHourPointChargValue")]
|
||||
public double EsManageHourPointChargValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 储能小时点位数据-放电
|
||||
/// </summary>
|
||||
[Column(Name = "EsManageHourPointDisChargValue")]
|
||||
public double EsManageHourPointDisChargValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 储能小时统计充电电量
|
||||
/// </summary>
|
||||
[Column(Name = "EsManageHourCharg")]
|
||||
public double EsManageHourCharg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 储能小时统计放电电量
|
||||
/// </summary>
|
||||
[Column(Name = "EsManageHourDisCharg")]
|
||||
public double EsManageHourDisCharg { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////光伏放电数据//////////////////////////////////////
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 光伏小时点位数据
|
||||
///// </summary>
|
||||
//[Column(Name = "SolarHourPointValue")]
|
||||
//public double SolarHourPointValue { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 光伏小时统计充电电量
|
||||
///// </summary>
|
||||
//[Column(Name = "SolarHourCharg")]
|
||||
//public double SolarHourCharg { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 光伏小时统计收益
|
||||
///// </summary>
|
||||
//[Column(Name = "SolarHourRevenue")]
|
||||
//public double SolarHourRevenue { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 光伏电价
|
||||
///// </summary>
|
||||
//[Column(Name = "SolarElePrice")]
|
||||
//public double SolarElePrice { get; set; }
|
||||
|
||||
|
||||
///////////////////////////////////储能放电数据//////////////////////////////////////
|
||||
|
||||
///// <summary>
|
||||
///// 储能小时点位数据-充电
|
||||
///// </summary>
|
||||
//[Column(Name = "EsHourPointChargValue")]
|
||||
//public double EsHourPointChargValue { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 储能小时点位数据-放电
|
||||
///// </summary>
|
||||
//[Column(Name = "EsHourPointDisChargValue")]
|
||||
//public double EsHourPointDisChargValue { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 储能小时统计充电电量
|
||||
///// </summary>
|
||||
//[Column(Name = "EsHourCharg")]
|
||||
//public double EsHourCharg { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 储能小时统计放电电量
|
||||
///// </summary>
|
||||
//[Column(Name = "EsHourDisCharg")]
|
||||
//public double EsHourDisCharg { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 储能小时统计收益
|
||||
///// </summary>
|
||||
//[Column(Name = "EsHourRevenue")]
|
||||
//public double EsHourRevenue { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 储能实时电价
|
||||
///// </summary>
|
||||
//[Column(Name = "EsElePrice")]
|
||||
//public double EsElePrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Column(DbType = "datetime", ServerTime = DateTimeKind.Local)]
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
70
OrpaonEMS.Model/YuPuPeakValleyConfig.cs
Normal file
70
OrpaonEMS.Model/YuPuPeakValleyConfig.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using OrpaonEMS.Model.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// yupU 临时设置削峰填谷配置
|
||||
/// </summary>
|
||||
[Table(Name = "YuPuPeakValleyConfig")]
|
||||
public class YuPuPeakValleyConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
[Column(IsPrimary = true, IsIdentity = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启用
|
||||
/// </summary>
|
||||
public bool Enable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
[Column(Name = "StartTime", IsNullable = false, StringLength = 6)]
|
||||
public string StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
[Column(Name = "EndTime", IsNullable = false, StringLength = 6)]
|
||||
public string EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电价类型/尖峰电价 平段电价 峰段电价 谷段电价
|
||||
/// </summary>
|
||||
[Column(MapType = typeof(string))]
|
||||
public ElePVEnum ElePV { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称(元)
|
||||
/// </summary>
|
||||
public double Price { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// ///////////////////////////////////////////导航属性///////////////////////////////////////////////////////
|
||||
///// </summary>
|
||||
|
||||
////电价
|
||||
//public long? ElePriceId { get; set; }
|
||||
//public ElePrice ElePrice { get; set; }
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 两个具体的配置 分别是报警和警告
|
||||
///// </summary>
|
||||
//public ICollection<ToleranceConfig> ToleranceConfigs { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user