change - 修改图标显示

dev
liuwf 1 year ago
parent 771cf621f8
commit c815ab1bb3

@ -202,7 +202,7 @@
"EquipName": "泡前库Plc",
"PlcType": "Siemens",
"Enabled": true,
"IP": "127.0.0.1",
"IP": "10.10.93.41",
"Port": 102
},
{
@ -210,16 +210,16 @@
"EquipName": "foamLine1Plc",
"PlcType": "Siemens",
"Enabled": true,
"IP": "127.0.0.1",
"Port": 103
"IP": "10.10.93.21",
"Port": 102
},
{
"Id": 3,
"EquipName": "foamLine2Plc",
"PlcType": "Siemens",
"Enabled": true,
"IP": "127.0.0.1",
"Port": 104
"IP": "10.10.93.1",
"Port": 102
},
{
"Id": 4,

@ -54,6 +54,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
System.Timers.Timer timer = new System.Timers.Timer(1000 * 1);//界面刷新定时器
private readonly IBaseBomInfoServices? _baseBomInfoServices;
private OffLineBusiness offLineBusiness = OffLineBusiness.Instance;
private static double aaa = 100.0;
int a = 0;
public IndexPageViewModel()
{
@ -63,6 +64,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
InitEveryDayMethod();
// 刷新界面信息
RefreshPageListen();
}
@ -270,6 +272,9 @@ namespace Aucma.Core.ProductOffLine.ViewModels
/// <param name="e"></param>
public void RefreshPage(object source, System.Timers.ElapsedEventArgs e)
{
InitEveryDayMethod();
if (OffLineBusiness.TempOffLineInfo1.ProductRefreshFlag == true)
{
ModelToPage(OffLineBusiness.TempOffLineInfo1);
@ -308,53 +313,69 @@ namespace Aucma.Core.ProductOffLine.ViewModels
private async void InitEveryDayMethod()
{
LoadData();
List<WorkTime> listTime = await _baseBomInfoServices.getWorkTime();
if (listTime == null) return;
// var aa =_offLineInfoServices.Query(x=>x.ProductScanTime>= listTime[0].startTime && x.ProductScanTime<= listTime[11].startTime)
// List<dynamic> hourAmount = _offLineInfoServices.QueryCharts1("CX_01");
List<Admin.Core.Model.ViewModels.ChartsByTime> list = await _offLineInfoServices.QueryCharts(listTime[0].startTime, listTime[11].startTime);
if (list == null) return;
var hourList = list.Where(x => int.Parse(x.hour) >= listTime[0].startTime.Hour && int.Parse(x.hour) <= listTime[11].startTime.Hour && x.productLineCode.Equals("CX_02"));
List<string> xList = new List<string>();
ChartValues<double> achievement2 = new ChartValues<double>();
foreach (var item in hourList)
{
xList.Add(item.hour);
achievement2.Add(item.Amount);
}
//for (int i = 0; i < 12; i++)
//{
// // xList.Add(list[i].time.Substring(11, 2) + ":00");
// achievement2.Add(list[i].Amount);
//}
var column2 = new ColumnSeries();
column2.DataLabels = true;
column2.Title = "产量";
column2.Values = achievement2;
column2.Foreground = Brushes.White;
Achievement.Add(column2);
ProductionHourList = xList;
ChartValues<double> achievement = new ChartValues<double>();
Random random = new Random();
for (int i = 0; i < 5; i++)
await App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
achievement.Add(random.Next(60, 100));
}
LoadData();
List<WorkTime> listTime = _baseBomInfoServices.getWorkTime().Result;
if (listTime == null) return;
// var aa =_offLineInfoServices.Query(x=>x.ProductScanTime>= listTime[0].startTime && x.ProductScanTime<= listTime[11].startTime)
// List<dynamic> hourAmount = _offLineInfoServices.QueryCharts1("CX_01");
List<Admin.Core.Model.ViewModels.ChartsByTime> list = _offLineInfoServices.QueryCharts(listTime[0].startTime, listTime[11].startTime).Result;
if (list == null) return;
var hourList = list.Where(x => int.Parse(x.hour) >= listTime[0].startTime.Hour && int.Parse(x.hour) <= listTime[11].startTime.Hour && x.productLineCode.Equals("CX_02"));
List<string> xList = new List<string>();
ChartValues<int> achievement2 = new ChartValues<int>();
foreach (var item in hourList)
{
xList.Add(item.hour);
achievement2.Add(item.Amount);
}
var column = new ColumnSeries();
column.DataLabels = true;
column.Title = "型号";
column.Values = achievement;
column.Foreground = Brushes.White;
ModelStatistics.Add(column);
MaterialNameList = new List<string>()
var column2 = new ColumnSeries();
column2.DataLabels = true;
column2.Title = "产量";
column2.Values = achievement2;
column2.Foreground = Brushes.White;
// Achievement.Clear();
//Achievement.Add(column2);
if (Achievement.Count > 0)
{
for (int i = 0; i < hourList.Count(); i++)
{
Achievement.FirstOrDefault().Values[i] = hourList.ElementAt(i).Amount;
}
}
else
{
Achievement.Add(column2);
}
ProductionHourList = xList;
ChartValues<double> achievement = new ChartValues<double>();
Random random = new Random();
for (int i = 0; i < 5; i++)
{
achievement.Add(random.Next(60, 100));
}
var column = new ColumnSeries();
column.DataLabels = true;
column.Title = "型号";
column.Values = achievement;
column.Foreground = Brushes.White;
ModelStatistics.Clear();
MaterialNameList = null;
ModelStatistics.Add(column);
MaterialNameList = new List<string>()
{
"SC-230,11W/H成品",
"SC-439箱体",
@ -362,9 +383,10 @@ namespace Aucma.Core.ProductOffLine.ViewModels
"SC-439背板",
"SC-439VAM,元气森林,C",
};
}
}));
}
//private async void InitEveryDayMethod()
//{
// LoadData();

@ -244,7 +244,7 @@
<TextBlock Text="当日小时产量统计" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" >
<lvc:CartesianChart Series="{Binding Achievement, UpdateSourceTrigger=PropertyChanged}" >
<lvc:CartesianChart Series="{Binding Achievement, UpdateSourceTrigger=PropertyChanged}" DisableAnimations="True">
<lvc:CartesianChart.AxisX>
<lvc:Axis Labels="{Binding ProductionHourList}" FontSize="15">

Loading…
Cancel
Save