|
|
|
@ -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>
|
|
|
|
|
/// 发泡线
|
|
|
|
@ -415,15 +415,22 @@ namespace Admin.Core.Tasks
|
|
|
|
|
{
|
|
|
|
|
item.Fixturestatus = "停止";
|
|
|
|
|
}
|
|
|
|
|
item.Production = obj.plc.ReadInt16("D181");
|
|
|
|
|
item.CuringTimeSettingValue = obj.plc.ReadInt16("D910").ToString();
|
|
|
|
|
item.ActualValue = obj.plc.ReadInt16("T3").ToString();
|
|
|
|
|
item.UpdatedTime = DateTime.Now;
|
|
|
|
|
}
|
|
|
|
|
var objProduction = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
|
|
|
|
|
if (objProduction == null) {
|
|
|
|
|
item.Production = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item.Production = obj.plc.ReadInt16("D181");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.ObjId == 2)
|
|
|
|
|
{
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
@ -441,15 +448,23 @@ namespace Admin.Core.Tasks
|
|
|
|
|
{
|
|
|
|
|
item.Fixturestatus = "停止";
|
|
|
|
|
}
|
|
|
|
|
item.Production = obj.plc.ReadInt16("D183");
|
|
|
|
|
item.CuringTimeSettingValue = obj.plc.ReadInt16("D912").ToString();
|
|
|
|
|
item.ActualValue = obj.plc.ReadInt16("T13").ToString();
|
|
|
|
|
item.UpdatedTime = DateTime.Now;
|
|
|
|
|
}
|
|
|
|
|
var objProduction = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
|
|
|
|
|
if (objProduction == null)
|
|
|
|
|
{
|
|
|
|
|
item.Production = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item.Production = obj.plc.ReadInt16("D183");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.ObjId == 3)
|
|
|
|
|
{
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc3"));
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
@ -467,20 +482,34 @@ namespace Admin.Core.Tasks
|
|
|
|
|
{
|
|
|
|
|
item.Fixturestatus = "停止";
|
|
|
|
|
}
|
|
|
|
|
item.Production = obj.plc.ReadInt16("D184");
|
|
|
|
|
item.CuringTimeSettingValue = obj.plc.ReadInt16("D912").ToString();
|
|
|
|
|
item.ActualValue = obj.plc.ReadInt16("T23").ToString();
|
|
|
|
|
item.UpdatedTime = DateTime.Now;
|
|
|
|
|
}
|
|
|
|
|
var objProduction = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
|
|
|
|
|
if (objProduction == null)
|
|
|
|
|
{
|
|
|
|
|
item.Production = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item.Production = obj.plc.ReadInt16("D184");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.ObjId == 4)
|
|
|
|
|
{
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc4"));
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
string type = $"{obj.plc.ReadInt16("D3144")}{obj.plc.ReadInt16("D3145")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
item.CuringTimeSettingValue = obj.plc.ReadInt16("D913").ToString();
|
|
|
|
|
item.ActualValue = obj.plc.ReadInt16("T33").ToString();
|
|
|
|
|
item.UpdatedTime = DateTime.Now;
|
|
|
|
|
}
|
|
|
|
|
var objStatus = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
|
|
|
|
|
if (objStatus != null) {
|
|
|
|
|
if (obj.plc.ReadBool("Y100"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixturestatus = "手动";
|
|
|
|
@ -494,54 +523,66 @@ namespace Admin.Core.Tasks
|
|
|
|
|
item.Fixturestatus = "停止";
|
|
|
|
|
}
|
|
|
|
|
item.Production = obj.plc.ReadInt16("D185");
|
|
|
|
|
item.CuringTimeSettingValue = obj.plc.ReadInt16("D913").ToString();
|
|
|
|
|
item.ActualValue = obj.plc.ReadInt16("T33").ToString();
|
|
|
|
|
item.UpdatedTime = DateTime.Now;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.ObjId == 5)
|
|
|
|
|
{
|
|
|
|
|
//var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc5"));
|
|
|
|
|
//if (obj == null) { return; }
|
|
|
|
|
//if (obj.plc.IsConnected)
|
|
|
|
|
//{
|
|
|
|
|
// string type = $"{obj.plc.ReadInt16("D3150")}{obj.plc.ReadInt16("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 = "停止";
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
string type = $"{obj.plc.ReadInt16("D3150")}{obj.plc.ReadInt16("D3151")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
item.CuringTimeSettingValue = obj.plc.ReadInt16("D913").ToString();
|
|
|
|
|
item.ActualValue = obj.plc.ReadInt16("T43").ToString();
|
|
|
|
|
item.UpdatedTime = DateTime.Now;
|
|
|
|
|
}
|
|
|
|
|
var objStatus = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
|
|
|
|
|
if (objStatus != null)
|
|
|
|
|
{
|
|
|
|
|
if (obj.plc.ReadBool("Y105"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixturestatus = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y106"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixturestatus = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y114"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixturestatus = "停止";
|
|
|
|
|
}
|
|
|
|
|
item.Production = obj.plc.ReadInt16("D186");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.ObjId == 6)
|
|
|
|
|
{
|
|
|
|
|
//var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc5"));
|
|
|
|
|
//if (obj == null) { return; }
|
|
|
|
|
//if (obj.plc.IsConnected)
|
|
|
|
|
//{
|
|
|
|
|
// string type = $"{obj.plc.ReadInt16("D3152")}{obj.plc.ReadInt16("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 = "停止";
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc1"));
|
|
|
|
|
if (obj == null) { return; }
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
string type = $"{obj.plc.ReadInt16("D3152")}{obj.plc.ReadInt16("D3143")}";
|
|
|
|
|
item.Fixtureboxtype = type;
|
|
|
|
|
item.ActualValue = obj.plc.ReadInt16("T53").ToString();
|
|
|
|
|
item.UpdatedTime = DateTime.Now;
|
|
|
|
|
}
|
|
|
|
|
var objStatus = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldMelsecPlc2"));
|
|
|
|
|
if (objStatus != null)
|
|
|
|
|
{
|
|
|
|
|
if (obj.plc.ReadBool("Y10A"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixturestatus = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y10B"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixturestatus = "手动";
|
|
|
|
|
}
|
|
|
|
|
if (obj.plc.ReadBool("Y115"))
|
|
|
|
|
{
|
|
|
|
|
item.Fixturestatus = "停止";
|
|
|
|
|
}
|
|
|
|
|
item.Production = obj.plc.ReadInt16("D187");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool result = await _oldBoxFoamDataServices.UpdateAsync(item);
|
|
|
|
|