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.

37 lines
829 B

using HybirdFrameworkCore.Autofac;
using Service.Ups.Msg;
using Autofac;
5 months ago
using HybirdFrameworkCore.Autofac.Attribute;
namespace Service.Ups;
5 months ago
[Scope]
public class UpsMgr
{
public static UpsClient? UpsClient;
public static readonly UpsTelemetering UpsTelemetering = new UpsTelemetering();
public static readonly UpsRemoteComm UpsRemoteComm = new UpsRemoteComm();
/// <summary>
/// 数据有效时间。单位秒
/// </summary>
static int DataTimeSeconds = 20;
5 months ago
/// <summary>
/// 数据刷新时间
/// </summary>
public static DateTime DataValidityTime = DateTime.Now;
public static void UpsInit()
{
if (UpsClient == null)
{
UpsClient = AppInfo.Container.Resolve<UpsClient>();
}
Task.Run(() => UpsClient.Connect());
}
}