|
|
|
@ -56,7 +56,7 @@ namespace Admin.Core.Tasks
|
|
|
|
|
public async Task Execute(IJobExecutionContext context)
|
|
|
|
|
{
|
|
|
|
|
await ExecuteJob(context, async () => await OldBoxFoamDataRun(context));//发泡线
|
|
|
|
|
await ExecuteJob(context, async () => await OldBoxFoamStoreDataRun(context));
|
|
|
|
|
//await ExecuteJob(context, async () => await OldBoxFoamStoreDataRun(context));
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 发泡线
|
|
|
|
@ -377,127 +377,152 @@ namespace Admin.Core.Tasks
|
|
|
|
|
|
|
|
|
|
public async Task OldBoxFoamData()
|
|
|
|
|
{
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldTypePlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
var list = await _oldBoxFoamDataServices.QueryAsync();
|
|
|
|
|
int i = list.Count();
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
|
var list =await _oldBoxFoamDataServices.QueryAsync();
|
|
|
|
|
int i= list.Count();
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
UpdateRealOldBoxFoamData(item);
|
|
|
|
|
i--;
|
|
|
|
|
if (i == 0)
|
|
|
|
|
{
|
|
|
|
|
UpdateRealOldBoxFoamData(obj, item);
|
|
|
|
|
i--;
|
|
|
|
|
if (i == 0)
|
|
|
|
|
{
|
|
|
|
|
List<OldBoxFoamData> old = await _oldBoxFoamDataServices.QueryAsync();
|
|
|
|
|
RefreshOldBoxFoamDataDelegateEvent?.Invoke(old);
|
|
|
|
|
}
|
|
|
|
|
List<OldBoxFoamData> old = await _oldBoxFoamDataServices.QueryAsync();
|
|
|
|
|
RefreshOldBoxFoamDataDelegateEvent?.Invoke(old);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async void UpdateRealOldBoxFoamData(PlcModel obj, OldBoxFoamData item)
|
|
|
|
|
private async void UpdateRealOldBoxFoamData(OldBoxFoamData item)
|
|
|
|
|
{
|
|
|
|
|
if (item.ObjId==1)
|
|
|
|
|
{
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3140")}{obj.plc.ReadString("D3141")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y0F0"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y0F1"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y110"))
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldTypePlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3140")}{obj.plc.ReadString("D3141")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y0F0"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y0F1"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y110"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.ObjId == 2)
|
|
|
|
|
{
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3142")}{obj.plc.ReadString("D3141")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y0F5"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y0F6"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y111"))
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldTypePlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3142")}{obj.plc.ReadString("D3141")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y0F5"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y0F6"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y111"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.ObjId == 3)
|
|
|
|
|
{
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3142")}{obj.plc.ReadString("D3143")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y0FA"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y0FB"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y112"))
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldTypePlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3142")}{obj.plc.ReadString("D3143")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y0FA"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y0FB"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y112"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.ObjId == 4)
|
|
|
|
|
{
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3144")}{obj.plc.ReadString("D3145")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y100"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y101"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y113"))
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldTypePlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3144")}{obj.plc.ReadString("D3145")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y100"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y101"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y113"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.ObjId == 5)
|
|
|
|
|
{
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3150")}{obj.plc.ReadString("D3151")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y105"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y106"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y114"))
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldTypePlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3150")}{obj.plc.ReadString("D3151")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y105"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y106"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y114"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.ObjId == 6)
|
|
|
|
|
{
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3152")}{obj.plc.ReadString("D3143")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y10A"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y10B"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y115"))
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldTypePlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
string type = $"{obj.plc.ReadString("D3152")}{obj.plc.ReadString("D3143")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
if (obj.plc.ReadBool("Y10A"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y10B"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y115"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixtureboxtype = "停止";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|