You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AUCMA_SCADA/Aucma.Core.DoorFoam/ViewModels/RealTimePageViewModel.cs

163 lines
4.0 KiB
C#

using CommunityToolkit.Mvvm.ComponentModel;
using LiveCharts.Wpf;
using LiveCharts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace Aucma.Core.DoorFoam.ViewModels
{
public partial class RealTimePageViewModel : ObservableObject
{
public RealTimePageViewModel()
{
InitEveryDayMethodAsync();
}
/// <summary>
/// 获取今天的数据
/// </summary>
/// <returns></returns>
private void InitEveryDayMethodAsync()
{
ChartValues<double> achievement = new ChartValues<double>();
Random random = new Random();
for (int i = 0; i < 2; i++)
{
achievement.Add(random.Next(0, 50));
}
ModelStatistics.Add(new ColumnSeries()
{
DataLabels = true,
Title = "型号",
Values = achievement,
Fill = new SolidColorBrush(Color.FromRgb(15, 209, 226)),
Foreground = Brushes.White,
FontSize = 18
});
MaterialNameList = new List<string>()
{
"BCD-287CHN",
"BCD-287CHN"
};
}
#region 扫描信息
#region 物料条码
private string _stationName;
public string StationName
{
get { return _stationName; }
set
{
_stationName = value;
SetProperty(ref _stationName, value);
}
}
#endregion
#region 物料名称
private string _materialName;
public string MaterialName
{
get { return _materialName; }
set
{
_materialName = value;
SetProperty(ref _materialName, value);
}
}
#endregion
#region 订单信息
private string _orderNo;
public string OrderNo
{
get { return _orderNo; }
set
{
_orderNo = value;
SetProperty(ref _orderNo, value);
}
}
#endregion
#region 开始时间
private string _beginTime;
public string BeginTime
{
get { return _beginTime; }
set
{
_beginTime = value;
SetProperty(ref _beginTime, value);
}
}
#endregion
#endregion
#region 当日产量
#region 日产量柱状图X轴日期
/// <summary>
/// 日产量柱状图X轴日期
/// </summary>
private List<string> productionHourList;
public List<string> ProductionHourList
{
get { return productionHourList; }
set { productionHourList = value; }
}
#endregion
/// <summary>
/// 日产量柱状图
/// </summary>
private SeriesCollection achievement = new SeriesCollection();
public SeriesCollection Achievement
{
get { return achievement; }
set { achievement = value; }
}
#endregion
#region 型号统计
#region 型号统计柱状图x轴物料类型
/// <summary>
/// 型号统计柱状图x轴物料类型
/// </summary>
private List<string> materialNameList;
public List<string> MaterialNameList
{
get { return materialNameList; }
set { materialNameList = value; }
}
#endregion
#region 型号统计柱状图
/// <summary>
/// 型号统计柱状图
/// </summary>
private SeriesCollection modelStatistics = new SeriesCollection();
public SeriesCollection ModelStatistics
{
get { return modelStatistics; }
set { modelStatistics = value; }
}
#endregion
#endregion
}
}