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.
41 lines
943 B
41 lines
943 B
using Autofac;
|
|
using HybirdFrameworkCore.Autofac;
|
|
using Service.PlcAfrica.Msg;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Service.PlcAfrica.Client
|
|
{
|
|
public class PlcAfricaMgr
|
|
{
|
|
public static PlcAfricaClient? PlcAfricaClient;
|
|
public static PlcAfricaMsg PlcAfricaMsg = new PlcAfricaMsg();
|
|
|
|
/// <summary>
|
|
/// 数据有效时间。单位秒
|
|
/// </summary>
|
|
static int DataTimeSeconds = 20;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 数据刷新时间
|
|
/// </summary>
|
|
public static DateTime DataValidityTime = DateTime.Now;
|
|
|
|
public static void PlcInit()
|
|
{
|
|
if (PlcAfricaClient == null)
|
|
{
|
|
PlcAfricaClient = AppInfo.Container.Resolve<PlcAfricaClient>();
|
|
}
|
|
|
|
Task.Run(() => PlcAfricaClient.Connect());
|
|
}
|
|
}
|
|
}
|