using Quartz;
|
using System;
|
using System.Threading;
|
using System.Threading.Tasks;
|
using WIDESEA_WCS.Jobs;
|
using WIDESEA_WCS.SchedulerExecute.AGV;
|
|
namespace WIDESEA_WCS
|
{
|
[DisallowConcurrentExecution]
|
/// <summary>
|
/// 负极设备与AGV交互
|
/// </summary>
|
public class AgvAndEquiWorkFJJob : JobBase, IJob
|
{
|
private static int lockObj1 = 0;
|
public Task Execute(IJobExecutionContext context)
|
{
|
try
|
{
|
|
var executeLog = ExecuteJob(context, () => Run(context));
|
}
|
catch (Exception)
|
{
|
|
}
|
return Task.FromResult(string.Empty);
|
}
|
public string Run(IJobExecutionContext context)
|
{
|
if (lockObj1 == 0)
|
{
|
try
|
{
|
lockObj1 = 1;
|
AGVSchedulerExecute.AgvAndEquiWorkFJ();//负极设备与AGV交互
|
}
|
catch (Exception ex)
|
{
|
lockObj1 = 0;
|
throw new Exception(ex.Message);
|
}
|
}
|
|
return string.Empty;
|
}
|
}
|
}
|