using Autofac; using HybirdFrameworkCore.Autofac; using Service.Ammeter.Msg; using Service.FireControl.Msg; using Service.Plc.Client; namespace Service.FireControl.Client; public class AmmeterMgr { public static ACMeters ACMeters = new ACMeters(); public static AmmeterClient? AmmeterClient { get; set; } #region MyRegion public static void Init() { if (AmmeterClient == null) { AmmeterClient = AppInfo.Container.Resolve(); } Task.Run(() => AmmeterClient.Connect()); } /// /// 写 /// /// public static bool ResettingOn() { if (AmmeterClient != null) { return AmmeterClient.WriteValue(ACMeters.ActiveTotalEnergy); } return false; } #endregion }