12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading.Tasks;
- namespace Edge.Core.IndustryStandardInterface.PhotoVoltaicInverter
- {
- public interface IPhotoVoltaicInverterHandler
- {
- public event EventHandler OnDeviceError;
- public IEnumerable<InverterDevice> GetDevices();
- public Task<InverterDeviceRealTimeData> ReadRealTimeDataAsync(byte deviceSlaveAddress);
- //public Task<object> RawSendOutgoingQueryMessageAsync(byte deviceSlaveAddress, FunctionCodeEnum functionCode, int startingRegAddress, byte noOfRegAddress);
- }
- public class InverterDeviceRealTimeData
- {
- //public InverterDevice Device { get; set; }
- //public byte[] DeviceTypeCode { get; set; }
- public decimal 日有功发电量 { get; set; }
- public decimal 日无功发电量 { get; set; }
- /// <summary>
- /// kWh
- /// </summary>
- public decimal 总发电量 { get; set; }
- /// <summary>
- /// hour
- /// </summary>
- public decimal 总运行时间 { get; set; }
- /// <summary>
- ///
- /// </summary>
- public decimal 机内空气温度 { get; set; }
- public string Description { get; set; }
- public string ToLogString()
- {
- return $"日有功发电量(kWh): {this.日有功发电量}, 日无功发电量(kWh): {this.日无功发电量}, 总发电量(kWh): {this.总发电量}, 总运行时间(hour): {this.总运行时间}, 机内空气温度(C): {this.机内空气温度}";
- }
- }
- public class InverterDevice
- {
- public InverterDevice(string name, byte slaveAddress)
- {
- this.Name = name;
- this.SlaveAddress = slaveAddress;
- }
- public string Name { get; private set; }
- public bool IsOnline { get; set; }
- public byte SlaveAddress { get; private set; }
- /// <summary>
- /// 设备类型码
- /// read by register address 5000
- /// </summary>
- //public byte[] DeviceTypeCode { get; set; }
- /// <summary>
- /// SN 序列号
- /// read by register address 4990
- /// </summary>
- //public string DeviceSN { get; set; }
- /// <summary>
- /// used for track the last received message which for caculate the offline state of this device.
- /// </summary>
- public DateTime? LastIncomingMessageReceivedTime { get; set; }
- public string Description { get; set; }
- }
- }
|