|
|
|
@ -21,6 +21,8 @@ using SlnMesnac.Common;
|
|
|
|
|
using HslCommunication.Profinet.GE;
|
|
|
|
|
using static System.Net.Mime.MediaTypeNames;
|
|
|
|
|
using Application = System.Windows.Application;
|
|
|
|
|
using LiveCharts;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
|
|
namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
{
|
|
|
|
@ -125,8 +127,8 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 完成率
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string compleRoution;
|
|
|
|
|
public string CompleRoution
|
|
|
|
|
public decimal compleRoution;
|
|
|
|
|
public decimal CompleRoution
|
|
|
|
|
{
|
|
|
|
|
get { return compleRoution; }
|
|
|
|
|
set { compleRoution = value; RaisePropertyChanged(nameof(CompleRoution)); }
|
|
|
|
@ -154,6 +156,33 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 日产量柱状图X轴日期
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 日产量柱状图X轴日期
|
|
|
|
|
/// </summary>
|
|
|
|
|
private List<string> productionHourList = new List<string>();
|
|
|
|
|
|
|
|
|
|
public List<string> ProductionHourList
|
|
|
|
|
{
|
|
|
|
|
get { return productionHourList; }
|
|
|
|
|
set { productionHourList = value; }
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 型号统计柱状图
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 型号统计柱状图
|
|
|
|
|
/// </summary>
|
|
|
|
|
private SeriesCollection achievement = new SeriesCollection();
|
|
|
|
|
|
|
|
|
|
public SeriesCollection Achievement
|
|
|
|
|
{
|
|
|
|
|
get { return achievement; }
|
|
|
|
|
set { achievement = value; }
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 事件定义
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -169,8 +198,7 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
|
|
|
|
|
public ProdMgmtViewModel()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StartProdPlanCommand = new RelayCommand<string>(obj => StartProdPlan(obj));
|
|
|
|
|
StopProdPlanCommand = new RelayCommand<string>(obj => StopProdPlan(obj));
|
|
|
|
|
_logger = App.ServiceProvider.GetService<ILogger<ProdMgmtViewModel>>();
|
|
|
|
@ -192,8 +220,12 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
|
_prodCompletionBusiness.PrintMessageToListBoxEvent += PrintMessageToListBox;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// _prodCompletionBusiness.Init();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
RefreChart();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void test()
|
|
|
|
@ -219,7 +251,7 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
PlanAmount = Convert.ToInt32(prodPlan.PlanAmount);
|
|
|
|
|
ComplateAmout = Convert.ToInt32(prodPlan.CompleteAmount);
|
|
|
|
|
DiffAmount = Convert.ToInt32(prodPlan.PlanAmount) - Convert.ToInt32(prodPlan.CompleteAmount);
|
|
|
|
|
CompleRoution = "50";
|
|
|
|
|
CompleRoution = Math.Round((prodPlan.CompleteAmount / prodPlan.PlanAmount) * 100, 2);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -230,7 +262,7 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
PlanAmount = 0;
|
|
|
|
|
ComplateAmout = 0;
|
|
|
|
|
DiffAmount = 0;
|
|
|
|
|
CompleRoution = string.Empty;
|
|
|
|
|
CompleRoution = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -402,5 +434,14 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 刷新产量统计图表
|
|
|
|
|
/// </summary>
|
|
|
|
|
private async void RefreChart()
|
|
|
|
|
{
|
|
|
|
|
ProductionHourList = new List<string>() {"8:00","9:00","10:00","11:00","12:00","13:00", "14:00", "15:00", "16:00", "17:00","18:00","19:00","20:00" };
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|