信息栏增加异常显示红色

This commit is contained in:
sc committed 2025-07-16 00:58:14 +08:00
commit 2148bb0b9d
3 files changed
+46 -31

No files matched your search

+42 -28
View File
@@ -1,37 +1,38 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommonServiceLocator;
using CommunityToolkit.Mvvm.ComponentModel;
using CommonServiceLocator;
using System.Windows.Threading;
using static DyeingComputer.UserClass.SqliteHelper;
using System.Data;
using System.Collections.ObjectModel;
using DyeingComputer.View;
using System.Windows;
using CommunityToolkit.Mvvm.Input;
using DyeingComputer.Properties;
using DyeingComputer.UserClass;
using System.Reflection;
using System.Windows.Documents;
using System.Runtime.CompilerServices;
using DyeingComputer.View;
using Microsoft.Win32;
using NModbus;
using NModbus.Serial;
using System.IO.Ports;
using OpenTK.Graphics.ES11;
using DyeingComputer.Properties;
using Microsoft.Win32;
using static DyeingComputer.Windows.ViewStep;
using System.Windows.Media;
using System.Runtime.Remoting.Channels;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Data;
using System.Diagnostics.Eventing.Reader;
using System.Drawing;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Remoting.Channels;
using System.Text;
using System.Threading;
using TouchSocket.Sockets;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Input;
using CommunityToolkit.Mvvm.Input;
using System.Windows.Media;
using System.Windows.Threading;
using TouchSocket.Sockets;
using static DyeingComputer.UserClass.SqliteHelper;
using static DyeingComputer.Windows.ViewStep;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
namespace DyeingComputer.ViewModel
@@ -61,6 +62,8 @@ namespace DyeingComputer.ViewModel
public class MainWindowViewModel : ViewModelBase
{
System.Windows.Media.Brush Status_red = new SolidColorBrush() { Color = System.Windows.Media.Color.FromArgb(255, 255, 0, 0) };
System.Windows.Media.Brush Status_Black = new SolidColorBrush() { Color = System.Windows.Media.Color.FromArgb(255, 0, 0, 0) };
private static SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly static string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
private readonly string ChartAdress = Environment.CurrentDirectory + "\\DataBase\\Chart.db"; //数据库路径
@@ -116,6 +119,16 @@ namespace DyeingComputer.ViewModel
OnPropertyChanged("Link_bool");
}
}
System.Windows.Media.Brush Status_str_coloer;
public System.Windows.Media.Brush Status_Str_coloer
{
get => Status_str_coloer;
set
{
Status_str_coloer = value;
OnPropertyChanged("Status_Str_coloer");
}
}
public string work_Temp; //显示温度
public string Work_Temp //通知UI控件参数改变
{
@@ -414,15 +427,16 @@ namespace DyeingComputer.ViewModel
IO_view();
TechnologicalProcess_view();
if (errTabler.Rows.Count!=0)
if (errTabler.Rows.Count != 0)
{
Status_Str = ERRinf.ERRinf_r(errTabler);
Alert_red = true;
Alert_bell = true;
Status_Str_coloer = Status_red;
}
else { Status_Str_coloer = Status_Black; }
Updata_dtd("3001", Alert_red);
Updata_dtd("3001", Alert_red);
Updata_dtd("3003", Alert_yellow);
Updata_dtd("3004", Alert_bell);