diff --git a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs
index 2f3d542..a22d5aa 100644
--- a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs
+++ b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs
@@ -89,8 +89,15 @@ namespace Aucma.Core.SheetMetal.ViewModels
});
AddSelectData();//添加下拉菜单
- RefreshHourAmount();//小时产量
- RefreshMaterialStats();//型号产量
+ Task.Run(() =>
+ {
+ while (true)
+ {
+ RefreshHourAmount();//小时产量
+ RefreshMaterialStats();//型号产量
+ Thread.Sleep(20000);
+ }
+ });
//——测试——
//InitEveryDayMethod();//小时产量
//InitExecMethod();//执行列表
@@ -109,8 +116,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
RefreshHourAmount();//小时产量
RefreshMaterialStats();//型号产量
- // RefreshHourAmountChart();//小时产量
- // RefreshMaterialChart();//型号产量
+
return Task.CompletedTask;
}
#endregion
@@ -774,7 +780,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
///
/// 日产量柱状图X轴日期
///
- private List productionHourList;
+ private List productionHourList = new List();
public List ProductionHourList
{
@@ -802,7 +808,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
///
/// 型号统计柱状图x轴物料类型
///
- private List materialNameList;
+ private List materialNameList = new List();
public List MaterialNameList
{
@@ -959,14 +965,12 @@ namespace Aucma.Core.SheetMetal.ViewModels
string stationCode = Appsettings.app("StationInfo", "StationCode");
var hourAmount = _sysUserInfoServices.GetSheetMetaHourData(stationCode).Result;
App.Current.Dispatcher.Invoke((Action)(() =>
- {
-
-
+ {
if (hourAmount != null)
- {
- if (Achievement.Count != 0) Achievement.Clear();
+ {
+ Achievement.Clear();
+ ProductionHourList.Clear();
- ProductionHourList = new List();
ChartValues hourAchievement1 = new ChartValues();
ChartValues hourAchievement2 = new ChartValues();
int hour = 0;
@@ -1008,36 +1012,6 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
#endregion
- #region 更新小时产量统计
- ///
- /// 更新小时产量统计
- ///
- private void RefreshHourAmountChart()
- {
- //获取小时产量
- string stationCode = Appsettings.app("StationInfo", "StationCode");
- var hourAmount = _sysUserInfoServices.GetSheetMetaHourData(stationCode).Result;
- App.Current.Dispatcher.Invoke((Action)(() =>
- {
-
- if (hourAmount != null)
- {
- int hour = 0;
-
- for (int i = 0; i < hourAmount.Count; i++)
- {
- Achievement[0].Values[i] =
- new ObservablePoint(hour, Convert.ToDouble(hourAmount[i].FrontPlateAmount));
-
- Achievement[1].Values[i] =
- new ObservablePoint(hour, Convert.ToDouble(hourAmount[i].RearPanelAmount));
- hour++;
- }
- }
- }));
- }
- #endregion
-
#region 刷新物料型号统计
///
/// 刷新物料型号统计
@@ -1052,15 +1026,15 @@ namespace Aucma.Core.SheetMetal.ViewModels
if (sheetMetalTypeList != null)
{
+
#region 按类型统计
ChartValues achievement1 = new ChartValues();
ChartValues achievement2 = new ChartValues();
- if (ModelStatistics.Count != 0)
- {
- ModelStatistics.Clear();
- }
+
+ ModelStatistics.Clear();
+ MaterialNameList.Clear();
- MaterialNameList = new List();
+
foreach (var item in sheetMetalTypeList)
{
achievement1.Add(Convert.ToInt32(item.FrontPlateAmount));
@@ -1093,6 +1067,38 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
#endregion
+
+ #region 弃用--更新小时产量统计
+ ///
+ /// 更新小时产量统计
+ ///
+ //private void RefreshHourAmountChart()
+ //{
+ // //获取小时产量
+ // string stationCode = Appsettings.app("StationInfo", "StationCode");
+ // var hourAmount = _sysUserInfoServices.GetSheetMetaHourData(stationCode).Result;
+ // App.Current.Dispatcher.Invoke((Action)(() =>
+ // {
+
+ // if (hourAmount != null)
+ // {
+ // int hour = 0;
+
+ // for (int i = 0; i < hourAmount.Count; i++)
+ // {
+ // Achievement[0].Values[i] =
+ // new ObservablePoint(hour, Convert.ToDouble(hourAmount[i].FrontPlateAmount));
+
+ // Achievement[1].Values[i] =
+ // new ObservablePoint(hour, Convert.ToDouble(hourAmount[i].RearPanelAmount));
+ // hour++;
+ // }
+ // }
+ // }));
+ //}
+ #endregion
+
+
#region 刷新物料型号统计
///
/// 刷新物料型号统计
diff --git a/Aucma.Core.SheetMetal/config/App.Ini b/Aucma.Core.SheetMetal/config/App.Ini
index f41dabd..a1c7342 100644
--- a/Aucma.Core.SheetMetal/config/App.Ini
+++ b/Aucma.Core.SheetMetal/config/App.Ini
@@ -1,3 +1,14 @@
[system]
ExecState=1
searchItems=101%102%103%104%12133%%%%%%%%%%%%%%
+ProductlineCode=CX_02
+#λ
+StationCode=1000
+#
+TeamCode=
+#
+TeamName=
+#û
+Account=
+#õ¼ɼϢѯչʾǰ߲ҰŰõİ
+TeamConfig=XKBJ