2023-05-22 18:32:18 +08:00
|
|
|
|
using Aitex.Core.RT.OperationCenter;
|
|
|
|
|
using MECF.Framework.UI.Client.ClientBase;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2023-05-24 13:17:09 +08:00
|
|
|
|
using System.Globalization;
|
2023-05-22 18:32:18 +08:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2023-05-24 13:17:09 +08:00
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using System.Windows.Media;
|
2023-05-22 18:32:18 +08:00
|
|
|
|
|
|
|
|
|
namespace MECF.Framework.UI.Client.TrayThickness.HistoryData
|
|
|
|
|
{
|
|
|
|
|
public class HistoryDataViewModel : UiViewModelBase, ISupportMultipleSystem
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
HistoryCoatingSqlHelp HistoryCoatingSqlHelp=new HistoryCoatingSqlHelp();
|
|
|
|
|
public List<CoatingData> CoatingData { get; set; } = new List<CoatingData>();
|
|
|
|
|
public HistoryDataViewModel()
|
|
|
|
|
{
|
|
|
|
|
QueryUpdate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnActivate()
|
|
|
|
|
{
|
|
|
|
|
QueryUpdate();
|
|
|
|
|
}
|
|
|
|
|
private void QueryUpdate()
|
|
|
|
|
{
|
|
|
|
|
CoatingData = HistoryCoatingSqlHelp.QueryUpdate();
|
|
|
|
|
Refresh();
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-05-24 13:17:09 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 检测厚度是否大于最大值
|
|
|
|
|
/// </summary>
|
|
|
|
|
class ColorConverter : IMultiValueConverter
|
|
|
|
|
{
|
|
|
|
|
public object Convert(object[] value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (value[0] == null || value[1] == null)
|
|
|
|
|
{
|
|
|
|
|
return new SolidColorBrush(Colors.Black);
|
|
|
|
|
}
|
|
|
|
|
double _current;
|
|
|
|
|
if (!double.TryParse(value[0].ToString(), out _current))
|
|
|
|
|
return new SolidColorBrush(Colors.Red);
|
|
|
|
|
double _max;
|
|
|
|
|
if (!double.TryParse(value[1].ToString(), out _max))
|
|
|
|
|
return new SolidColorBrush(Colors.Black);
|
|
|
|
|
|
|
|
|
|
if (_current > _max)
|
|
|
|
|
{
|
|
|
|
|
return new SolidColorBrush(Colors.Red);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return new SolidColorBrush(Colors.Black);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
return new SolidColorBrush(Colors.Red);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-05-22 18:32:18 +08:00
|
|
|
|
}
|