123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
-
- using EVCB_OCPP.Packet.Messages.Basic;
- using EVCB_OCPP.WSServer.Dto;
- namespace EVCB_OCPP.WSServer.Service.WsService
- {
- public class WsClientData : WsSession
- { /// <summary>
- /// 根據unique id來儲存.取出OCPP Request
- /// </summary>
- public Queue queue = new Queue();
- public EVCB_OCPP20.Packet.Messages.Basic.Queue queue20 = new EVCB_OCPP20.Packet.Messages.Basic.Queue();
- public bool? IsPending { set; get; }
- public bool IsCheckIn { set; get; } = false;
- public string ChargeBoxId { set; get; }
- public Guid CustomerId { get; set; }
- public string MachineId { set; get; }
- public bool ISOCPP20 { set; get; }
- public bool ResetSecurityProfile { set; get; }
- public bool IsAC { set; get; } = true;
- #region Billing
- public Dictionary<string, string> UserPrices { set; get; } = new Dictionary<string, string>();
- public Dictionary<string, string> UserDisplayPrices { set; get; } = new Dictionary<string, string>();
- public List<ChargingPrice> ChargingPrices { set; get; }
- /// <summary>
- /// 電樁顯示費率
- /// </summary>
- public string DisplayPrice { set; get; }
- /// <summary>
- /// 充電費率 以小時計費
- /// </summary>
- public decimal ChargingFeebyHour { set; get; }
- /// <summary>
- /// 停車費率 以小時計費
- /// </summary>
- public decimal ParkingFee { set; get; }
- /// <summary>
- /// 電樁是否計費
- /// </summary>
- public bool IsBilling { set; get; }
- /// <summary>
- /// 收費方式 1: 以度計費 2:以小時計費
- /// </summary>
- public int BillingMethod { set; get; }
- /// <summary>
- /// 電樁適用幣別
- /// </summary>
- public string Currency { get; internal set; }
- #endregion
- public string CustomerName { get; set; }
- public string StationId { set; get; }
- public event EventHandler<string> m_ReceiveData;
- public WsClientData()
- {
- ChargeBoxId = SessionID;
- MachineId = SessionID;
- }
- /// <summary>
- /// Sends the raw binary data to client.
- /// </summary>
- /// <param name="data">The data.</param>
- /// <param name="offset">The offset.</param>
- /// <param name="length">The length.</param>
- public void SendRawData(byte[] data, int offset, int length)
- {
- Send(data, offset, length);
- }
- internal override void HandleReceivedData(string msg)
- {
- m_ReceiveData?.Invoke(this, msg);
- }
- }
- }
|