1 地震仪告警记录中故障次数隐藏;电力载波机和光电交换机的供电状态隐藏; 2 除漏水和保护板事件的数据按照浮点数解析,别的按照整数解析; 3 解决TCP Server和Client存在的问题,包括无法监测到客户端连接,无法监测到服务端断开等问题;
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
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 JiangsuEarthquake.Common.ValueToBrushConvert
|
|
{
|
|
public class ValueToBrushConvertBoosterStationCurrent : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
double number = ConvertToDouble(value);
|
|
if (number > ConvertToDouble(parameter) || number < 0)
|
|
{
|
|
return new SolidColorBrush(Colors.Red); // 返回大于某个值的颜色
|
|
}
|
|
else
|
|
{
|
|
return new SolidColorBrush(Colors.White); // 返回默认颜色或背景色
|
|
}
|
|
}
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return new SolidColorBrush(Colors.Green); // 返回默认颜色或背景色
|
|
}
|
|
|
|
|
|
private double ConvertToDouble(object value)
|
|
{
|
|
double d;
|
|
double.TryParse(value.ToString(), out d);
|
|
return d;
|
|
}
|
|
}
|
|
}
|