using Autofac.Core;
|
using HslCommunication;
|
using HslCommunication.Core;
|
using Microsoft.VisualBasic.FileIO;
|
using Quartz;
|
using SixLabors.ImageSharp.PixelFormats;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Linq;
|
using System.Reflection;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WIDESEAWCS_Communicator;
|
using WIDESEAWCS_Core.Helper;
|
using WIDESEAWCS_QuartzJob;
|
using WIDESEAWCS_QuartzJob.DeviceBase;
|
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
|
|
namespace WIDESEAWCS_Tasks
|
{
|
[DisallowConcurrentExecution]
|
public class TestJob : JobBase, IJob
|
{
|
public TestJob()
|
{
|
}
|
|
public Task Execute(IJobExecutionContext context)
|
{
|
|
bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
|
if (flag && value != null)
|
{
|
if(value is CommonStackerCrane)
|
{
|
CommonStackerCrane device = (CommonStackerCrane)value;
|
try
|
{
|
//Example
|
//device.GetValue //读取
|
//device.SetValue //写入
|
// _taskService.Repository //仓储层,进行数据库访问
|
|
WriteInfo(device.DeviceName, "infoLog");
|
|
WriteDebug(device.DeviceName, "debugLog");
|
}
|
catch (Exception ex)
|
{
|
WriteError(device.DeviceName, "错误", ex);
|
}
|
}
|
}
|
|
return Task.CompletedTask;
|
}
|
}
|
|
|
}
|