|
|
|
@ -23,6 +23,8 @@ using LiveCharts.Defaults;
|
|
|
|
|
using Aucma.Core.SheetMetal.Business;
|
|
|
|
|
using static Aucma.Core.SheetMetal.Business.SheetMetalPlanTaskHandle;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using NetTaste;
|
|
|
|
|
using Aucma.Core.HwPLc;
|
|
|
|
|
/*
|
|
|
|
|
* 首页信息
|
|
|
|
|
*
|
|
|
|
@ -46,7 +48,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
|
|
|
|
|
TypeName="自动"
|
|
|
|
|
}};
|
|
|
|
|
public Func<double, string> Formatter { get; set; }
|
|
|
|
|
|
|
|
|
|
public HwPLc.PlcModel obj = null;
|
|
|
|
|
#region 构造函数
|
|
|
|
|
public IndexPageViewModel()
|
|
|
|
|
{
|
|
|
|
@ -68,7 +70,20 @@ namespace Aucma.Core.SheetMetal.ViewModels
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
|
//_taskHandle.SendPlanTaskToDevice();
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
|
|
|
|
obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldTypePlc1"));
|
|
|
|
|
if (obj!=null)
|
|
|
|
|
{
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
_taskHandle.ReadDeviceComplate_WB(obj);
|
|
|
|
|
_taskHandle.ReadDeviceComplate_BB(obj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
@ -188,13 +203,13 @@ namespace Aucma.Core.SheetMetal.ViewModels
|
|
|
|
|
#region 加载DataGrid数据
|
|
|
|
|
private async Task LoadData()
|
|
|
|
|
{
|
|
|
|
|
string productLineCode = Appsettings.app("StoreInfo", "ProductLineCode");
|
|
|
|
|
var list = await _taskExecutionPlanInfoServices.QueryAsync(d => d.ProductLineCode.Contains(productLineCode));
|
|
|
|
|
string productLineCode = Appsettings.app("StationInfo", "ProductLineCode");
|
|
|
|
|
string stationCode = Appsettings.app("StationInfo", "StationCode");
|
|
|
|
|
var list = await _taskExecutionPlanInfoServices.QueryAsync(d => d.ProductLineCode.Contains(stationCode));
|
|
|
|
|
if (list == null) return;
|
|
|
|
|
var execList = list.OrderBy(d => d.ExecuteOrder);
|
|
|
|
|
int i = 1;
|
|
|
|
|
string planType = string.Empty;
|
|
|
|
|
|
|
|
|
|
foreach (var item in execList)
|
|
|
|
|
{
|
|
|
|
|
TaskExecModel task = new TaskExecModel();
|
|
|
|
|