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