1.Common增加ColorConverter_IsTestOK

This commit is contained in:
HCL 2023-07-04 15:55:32 +08:00
parent 0dbfa3758f
commit 8f41b72d85
3 changed files with 36 additions and 0 deletions

View File

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.ServiceModel;
using Aitex.Core.Common;
using Aitex.Core.Common.DeviceData;
using Aitex.Sorter.Common;
using MECF.Framework.Common.Device.Bases;
using MECF.Framework.Common.Equipment;

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;
namespace Aitex.Core.UI.Converters
{
/// <summary>
/// 输入数值检测
/// </summary>
public class ColorConverter_IsTestOK : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null || value.ToString().Length == 0)
return new SolidColorBrush(Colors.Gray);
if (value.ToString() == "OK")
return new SolidColorBrush(Colors.Green);
else if (value.ToString() == "NG")
return new SolidColorBrush(Colors.MediumVioletRed);
else
return new SolidColorBrush(Colors.Gray);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}

View File

@ -324,6 +324,7 @@
<Compile Include="Converters\BoolSensorConverter.cs" />
<Compile Include="Converters\BoolVisibilityConverter.cs" />
<Compile Include="Converters\CenterBorderGapMaskConverter.cs" />
<Compile Include="Converters\ColorConverter_IsTestOK.cs" />
<Compile Include="Converters\ColorToBrushConverter.cs" />
<Compile Include="Converters\EngModeToBdColorConverter.cs" />
<Compile Include="Converters\EngModeToBdThicknessConverter.cs" />