添加项目文件。
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user