change-门体发泡数据刷新闪烁修复

dev
liuwf 1 year ago
parent 24178b588f
commit d6081be29c

@ -26,6 +26,7 @@ using NPOI.SS.Formula.Functions;
using Microsoft.Extensions.FileSystemGlobbing.Internal;
using System.Text.RegularExpressions;
using System.Windows.Controls;
using System.Threading;
namespace Aucma.Core.DoorFoam.ViewModels
{
@ -48,6 +49,16 @@ namespace Aucma.Core.DoorFoam.ViewModels
MvCodeHelper.DoorReceiveCodeDelegateEvent += OnLoadPlanData;
OnLoadPlanData("B24010181060282920001");
Task.Run(() =>
{
Thread.Sleep(2000);
while(true)
{
InitEveryDayMethodAsync();//刷新型号统计图表
Thread.Sleep(1000);
}
});
}
/// <summary>
/// 获取今天的数据
@ -63,7 +74,7 @@ namespace Aucma.Core.DoorFoam.ViewModels
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
ModelStatistics.Clear();
// ModelStatistics.Clear();
if (info != null)
{
@ -77,8 +88,7 @@ namespace Aucma.Core.DoorFoam.ViewModels
MaterialNameList.Add(FormatMaterialType(groupItem.MaterialName));
}
}
ModelStatistics.Add(new ColumnSeries()
ColumnSeries column = new ColumnSeries()
{
DataLabels = true,
Title = "型号",
@ -86,7 +96,19 @@ namespace Aucma.Core.DoorFoam.ViewModels
Fill = new SolidColorBrush(Color.FromRgb(15, 209, 226)),
Foreground = Brushes.White,
FontSize = 18
});
};
if (ModelStatistics.Count > 0)
{
for(int i = 0; i < achievement.Count; i++)
{
ModelStatistics.FirstOrDefault().Values[i] = achievement[i];
}
}
else
{
ModelStatistics.Add(column);
}
}));

@ -90,7 +90,7 @@
<StackPanel>
<DataGrid Grid.Row="0" ItemsSource="{Binding DoorFoamMachineDataGrid_Left}" Background="#00000000"
ColumnHeaderHeight="35" Height="{Binding Path=ActualHeight, ElementName=ScanPanel}"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0" FontSize="25"
RowHeight="42" AutoGenerateColumns="False" RowHeaderWidth="0" FontSize="25"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White">
@ -116,7 +116,7 @@
<StackPanel >
<DataGrid Grid.Row="0" ItemsSource="{Binding DoorFoamMachineDataGrid_Right}" Background="#00000000"
ColumnHeaderHeight="35" Height="{Binding Path=ActualHeight, ElementName=ScanPanel}"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0" FontSize="25"
RowHeight="42" AutoGenerateColumns="False" RowHeaderWidth="0" FontSize="25"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White">

@ -169,7 +169,7 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<UniformGrid Grid.Row="0">
<lvc:CartesianChart Series="{Binding ModelStatistics, UpdateSourceTrigger=PropertyChanged}">
<lvc:CartesianChart Series="{Binding ModelStatistics, UpdateSourceTrigger=PropertyChanged}" DisableAnimations="True">
<lvc:CartesianChart.AxisX>
<lvc:Axis Labels="{Binding MaterialNameList}" FontSize="15">
<lvc:Axis.Separator>

Loading…
Cancel
Save