You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
868 B

4 months ago
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<AmmeterClient>();
}
Task.Run(() => AmmeterClient.Connect());
}
/// <summary>
/// 写
/// </summary>
/// <returns></returns>
public static bool ResettingOn()
{
if (AmmeterClient != null)
{
return AmmeterClient.WriteValue(ACMeters.ActiveTotalEnergy);
}
return false;
}
#endregion
}