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 GetDevices(); public Task ReadRealTimeDataAsync(byte deviceSlaveAddress); //public Task 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; } /// /// kWh /// public decimal 总发电量 { get; set; } /// /// hour /// public decimal 总运行时间 { get; set; } /// /// /// 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; } /// /// 设备类型码 /// read by register address 5000 /// //public byte[] DeviceTypeCode { get; set; } /// /// SN 序列号 /// read by register address 4990 /// //public string DeviceSN { get; set; } /// /// used for track the last received message which for caculate the offline state of this device. /// public DateTime? LastIncomingMessageReceivedTime { get; set; } public string Description { get; set; } } }