using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkDriver.Session; using HybirdFrameworkDriver.TcpClient; using log4net; using Service.Ups.Codec; using Service.Ups.Common; namespace Service.Ups.Client; [Scope] public class UpsClient: TcpClient { /// /// 设备编号 /// public string Sn { get; set; } private ILog Log() { var name = "Fire"; ILog logger = LogManager.GetLogger(name); Console.WriteLine(name + "-" + logger.GetHashCode()); return logger; } /// /// /// /// public bool Connect() { base.BaseConnect(); Log().Info("ups connect succeed"); return Connected; } /// ///UPS /// /// /// public void SessionAttr(string sn) { ChannelUtils.AddAttr(Channel, UpsConst.UpsSn, sn); ChannelUtils.AddAttr(Channel, UpsConst.EqmTypeNo, sn); ChannelUtils.AddAttr(Channel, UpsConst.EqmCode, sn); } }