using Quartz;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WIDESEA_WCS.WCSClient;
|
|
namespace WIDESEA_WCS
|
{
|
/// <summary>
|
/// 链条机
|
/// </summary>
|
[DisallowConcurrentExecution]
|
public class PipelineJob : IJob
|
{
|
public Task Execute(IJobExecutionContext context)
|
{
|
try
|
{
|
var client = context.JobDetail.JobDataMap.Get("JobParams") as PLCClient;
|
if (client == null)
|
{
|
return Task.CompletedTask;
|
}
|
|
//自动重连
|
if (!client.IsConnected)
|
{
|
client.Connect();
|
return Task.CompletedTask;
|
}
|
|
DoAction(client);
|
}
|
catch { }
|
return Task.CompletedTask;
|
}
|
|
private void DoAction(PLCClient client)
|
{
|
throw new NotImplementedException();
|
}
|
}
|
}
|