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.
42 lines
1.1 KiB
42 lines
1.1 KiB
1 week ago
|
using HybirdFrameworkCore.Autofac.Attribute;
|
||
|
using Service.UpsAfrica.Msg;
|
||
|
using HybirdFrameworkCore.Autofac;
|
||
|
using Autofac;
|
||
|
|
||
|
|
||
|
namespace Service.UpsAfrica.Client;
|
||
|
|
||
|
[Scope]
|
||
|
public class UpsAfricaMgr
|
||
|
{
|
||
|
public static UpsAfricaClient? UpsAfricaClient;
|
||
|
public static readonly UpsIndex30 UpsIndex30 = new UpsIndex30();
|
||
|
public static readonly UpsIndex40 UpsIndex40 = new UpsIndex40();
|
||
|
public static readonly UpsIndex50 UpsIndex50 = new UpsIndex50();
|
||
|
public static readonly UpsIndex60 UpsIndex60 = new UpsIndex60();
|
||
|
public static readonly UpsIndexA0 UpsIndexA0 = new UpsIndexA0();
|
||
|
public static readonly UpsIndexC0 UpsIndexC0 = new UpsIndexC0();
|
||
|
|
||
|
/// <summary>
|
||
|
/// 数据有效时间。单位秒
|
||
|
/// </summary>
|
||
|
static int DataTimeSeconds = 20;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/// <summary>
|
||
|
/// 数据刷新时间
|
||
|
/// </summary>
|
||
|
public static DateTime DataValidityTime = DateTime.Now;
|
||
|
|
||
|
public static void UpsInit()
|
||
|
{
|
||
|
if (UpsAfricaClient == null)
|
||
|
{
|
||
|
UpsAfricaClient = AppInfo.Container.Resolve<UpsAfricaClient>();
|
||
|
}
|
||
|
|
||
|
Task.Run(() => UpsAfricaClient.Connect());
|
||
|
}
|
||
|
}
|