From 34e8b213a6ab5708dad484b49bd9afc9ac78a4be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com>
Date: Thu, 20 Oct 2022 17:54:06 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=B6=88=E6=81=AF=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Converters/ForegroundConverter.cs | 35 +++
.../Converters/StatusIconConverter.cs | 48 ++++
.../Pages/Enums/Status.cs | 15 ++
.../Model/{MessageLog.cs => MessageNotify.cs} | 8 +-
.../Pages/ViewModel/NfcSetViewModel.cs | 4 +-
.../Pages/ViewModel/RunLogViewModel.cs | 2 +-
.../Pages/ViewModel/UserLogViewModel.cs | 2 +-
.../RecDictionarys/GlobalStyle.xaml | 128 +++++++++
BPASmartClient.DosingProject/App.xaml.cs | 4 +-
.../Model/ProcessControl.cs | 24 +-
.../Model/RawMaterial/DeviceInquire.cs | 18 +-
.../ViewModel/NewMaterialViewModel.cs | 4 +-
.../ViewModel/RecipeControlViewModel.cs | 6 +-
.../ViewModel/RecipeReceiveViewModel.cs | 6 +-
.../ViewModel/RecipeSettingsViewModel.cs | 8 +-
.../SiemensRecipeReceiveViewModel.cs | 2 +-
BPASmartClient.JXJFoodBigStation/App.xaml.cs | 4 +-
.../Model/HK_PLC/HKDeviceStatus.cs | 4 +-
.../Model/ProcessControl.cs | 8 +-
.../ViewModel/RecipeReceiveViewModel.cs | 2 +-
.../App.xaml.cs | 4 +-
.../Model/HK_PLC/HKDeviceStatus.cs | 16 +-
.../Model/ProcessControl.cs | 76 +++---
.../Model/RawMaterial/DeviceInquire.cs | 10 +-
.../ViewModel/NewMaterialViewModel.cs | 4 +-
.../ViewModel/RecipeControlViewModel.cs | 6 +-
.../ViewModel/RecipeReceiveViewModel.cs | 6 +-
.../ViewModel/RecipeSettingsViewModel.cs | 8 +-
.../SiemensRecipeReceiveViewModel.cs | 2 +-
.../Services/Control.cs | 4 +-
BPASmartClient.ZhuoDian/App.xaml.cs | 2 +-
DosingSystem/App.xaml.cs | 15 +-
.../BPASmartClient.DosingSystem.csproj | 5 +-
DosingSystem/Model/DeviceInquire.cs | 25 +-
DosingSystem/Model/DevicePar.cs | 15 --
DosingSystem/Model/par/DevicePar.cs | 44 ++++
.../Model/{ => par}/DeviceParModel.cs | 0
DosingSystem/Model/{ => par}/LocaPar.cs | 0
DosingSystem/View/CommParSetView.xaml | 45 ++++
DosingSystem/View/CommParSetView.xaml.cs | 28 ++
.../ViewModel/ChangeDeviceNameViewModel.cs | 3 +-
DosingSystem/ViewModel/CommparSetViewModel.cs | 48 ++++
DosingSystem/ViewModel/DeviceListViewModel.cs | 2 +-
.../ViewModel/DeviceMaterialParViewModel.cs | 3 +-
.../ViewModel/HardwareStatusViewModel.cs | 2 +-
.../ViewModel/ManualControlViewModel.cs | 8 +-
.../ViewModel/NewMaterialViewModel.cs | 7 +-
DosingSystem/ViewModel/NewRecipeViewModel.cs | 2 +-
.../ViewModel/RecipeControlViewModel.cs | 9 +-
.../ViewModel/RecipeSettingsViewModel.cs | 10 +-
FryPot_DosingSystem/App.xaml.cs | 4 +-
FryPot_DosingSystem/Control/DeviceOperate.cs | 30 +--
.../Control/DosingLogicControl.cs | 244 +++++++++---------
.../ViewModel/NewRecipeViewModel.cs | 18 +-
54 files changed, 714 insertions(+), 323 deletions(-)
create mode 100644 BPASmartClient.CustomResource/Converters/ForegroundConverter.cs
create mode 100644 BPASmartClient.CustomResource/Converters/StatusIconConverter.cs
create mode 100644 BPASmartClient.CustomResource/Pages/Enums/Status.cs
rename BPASmartClient.CustomResource/Pages/Model/{MessageLog.cs => MessageNotify.cs} (95%)
delete mode 100644 DosingSystem/Model/DevicePar.cs
create mode 100644 DosingSystem/Model/par/DevicePar.cs
rename DosingSystem/Model/{ => par}/DeviceParModel.cs (100%)
rename DosingSystem/Model/{ => par}/LocaPar.cs (100%)
create mode 100644 DosingSystem/View/CommParSetView.xaml
create mode 100644 DosingSystem/View/CommParSetView.xaml.cs
create mode 100644 DosingSystem/ViewModel/CommparSetViewModel.cs
diff --git a/BPASmartClient.CustomResource/Converters/ForegroundConverter.cs b/BPASmartClient.CustomResource/Converters/ForegroundConverter.cs
new file mode 100644
index 00000000..0297db72
--- /dev/null
+++ b/BPASmartClient.CustomResource/Converters/ForegroundConverter.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Data;
+using System.Windows.Data;
+using System.Globalization;
+using System.Windows.Media;
+
+namespace BPASmartClient.CustomResource.Converters
+{
+ public class ForegroundConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ SolidColorBrush returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 204, 255));
+ if (value != null)
+ {
+ if (value.ToString() == "等待配料")
+ returnValue = new SolidColorBrush(Color.FromArgb(255, 236, 187, 17));//黄 FFECBB11
+ else if (value.ToString() == "正在配料")
+ returnValue = new SolidColorBrush(Color.FromArgb(255, 22, 219, 234));//篮 FF16DBEA
+ else if (value.ToString() == "配料完成")
+ returnValue = new SolidColorBrush(Color.FromArgb(255, 43, 208, 111));//绿 FF2BD06F
+ }
+ return returnValue;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/BPASmartClient.CustomResource/Converters/StatusIconConverter.cs b/BPASmartClient.CustomResource/Converters/StatusIconConverter.cs
new file mode 100644
index 00000000..9961f850
--- /dev/null
+++ b/BPASmartClient.CustomResource/Converters/StatusIconConverter.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Data;
+using System.Windows.Data;
+using System.Globalization;
+using System.Text.RegularExpressions;
+using BPASmartClient.CustomResource.Pages.Enums;
+
+namespace BPASmartClient.CustomResource.Converters
+{
+ public class StatusIconConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null)
+ {
+ if (value.ToString() == Status.等待配料.ToString())
+ return Regex.Unescape(StringToUnicode(""));
+ else if (value.ToString() == Status.正在配料.ToString())
+ return Regex.Unescape(StringToUnicode(""));
+ else if (value.ToString() == Status.配料完成.ToString())
+ return Regex.Unescape(StringToUnicode(""));
+ }
+ return value;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// 字符串转为UniCode码字符串
+ ///
+ public static string StringToUnicode(string s)
+ {
+ if (!string.IsNullOrEmpty(s))
+ {
+ //这里把格式 转为 \ue625
+ return s.Replace(@"", @"\u").Replace(";", "");
+ }
+ return s;
+ }
+ }
+}
diff --git a/BPASmartClient.CustomResource/Pages/Enums/Status.cs b/BPASmartClient.CustomResource/Pages/Enums/Status.cs
new file mode 100644
index 00000000..c8b8b437
--- /dev/null
+++ b/BPASmartClient.CustomResource/Pages/Enums/Status.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.CustomResource.Pages.Enums
+{
+ public enum Status
+ {
+ 等待配料,
+ 正在配料,
+ 配料完成
+ }
+}
diff --git a/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs b/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
similarity index 95%
rename from BPASmartClient.CustomResource/Pages/Model/MessageLog.cs
rename to BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
index cd9263f6..e1325b1a 100644
--- a/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
@@ -12,15 +12,15 @@ using BPASmartClient.CustomResource.Pages.View;
namespace BPASmartClient.CustomResource.Pages.Model
{
- public class MessageLog
+ public class MessageNotify
{
- private volatile static MessageLog _Instance;
- public static MessageLog GetInstance => _Instance ??= new MessageLog();
+ private volatile static MessageNotify _Instance;
+ public static MessageNotify GetInstance => _Instance ??= new MessageNotify();
public static readonly object runLock = new object();
public static readonly object userlock = new object();
public static readonly object alarmlock = new object();
- private MessageLog() { }
+ private MessageNotify() { }
public Action UserLog { get; set; }
diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs
index 98808520..b1c059d1 100644
--- a/BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs
+++ b/BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs
@@ -75,7 +75,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
});
Config.GetInstance.SaveUser();
Info = $"Info:ID {CardNum} 添加成功;";
- MessageLog.GetInstance.ShowRunLog($" ID {CardNum} 用户添加成功");
+ MessageNotify.GetInstance.ShowRunLog($" ID {CardNum} 用户添加成功");
Thread.Sleep(1000);
ActionManage.GetInstance.Send("Exit");
}
@@ -96,7 +96,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
Global.userManager.userInfos.Remove(res);
Config.GetInstance.SaveUser();
Info = $"Info:ID {CardNum} 注销成功;";
- MessageLog.GetInstance.ShowRunLog($"ID {CardNum} 用户注销成功");
+ MessageNotify.GetInstance.ShowRunLog($"ID {CardNum} 用户注销成功");
Thread.Sleep(1000);
ActionManage.GetInstance.Send("Exit");
}
diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs
index fafff930..b8ac842a 100644
--- a/BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs
+++ b/BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs
@@ -121,6 +121,6 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
public ObservableCollection HistoryRunLog { get; set; } = new ObservableCollection();
- public ObservableCollection Log { get; set; } = MessageLog.GetInstance.runLogs;
+ public ObservableCollection Log { get; set; } = MessageNotify.GetInstance.runLogs;
}
}
diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs
index 227c127f..233491d9 100644
--- a/BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs
+++ b/BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs
@@ -17,7 +17,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
public UserLogViewModel()
{
Sqlite.GetInstance.Save();
- UserLogs = MessageLog.GetInstance.userLogs;
+ UserLogs = MessageNotify.GetInstance.userLogs;
SwitchCommand = new RelayCommand(() =>
{
if (ButContent == "历史日志")
diff --git a/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml b/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml
index 8b6a4b0d..325c7d39 100644
--- a/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml
+++ b/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml
@@ -15,4 +15,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BPASmartClient.DosingProject/App.xaml.cs b/BPASmartClient.DosingProject/App.xaml.cs
index c3fd67e9..a2a10e74 100644
--- a/BPASmartClient.DosingProject/App.xaml.cs
+++ b/BPASmartClient.DosingProject/App.xaml.cs
@@ -32,7 +32,7 @@ namespace BPASmartClient.DosingProject
var res = lv.ShowDialog();
if (res != null && res == true)
{
- MessageLog.GetInstance.ShowUserLog("用户登录");
+ MessageNotify.GetInstance.ShowUserLog("用户登录");
mv.Show();
}
else
@@ -44,7 +44,7 @@ namespace BPASmartClient.DosingProject
{
base.OnExit(e);
Json.Save();
- MessageLog.GetInstance.LogSave();
+ MessageNotify.GetInstance.LogSave();
ThreadManage.GetInstance().Dispose();
}
diff --git a/BPASmartClient.DosingProject/Model/ProcessControl.cs b/BPASmartClient.DosingProject/Model/ProcessControl.cs
index 125670fa..a094bbb5 100644
--- a/BPASmartClient.DosingProject/Model/ProcessControl.cs
+++ b/BPASmartClient.DosingProject/Model/ProcessControl.cs
@@ -56,7 +56,7 @@ namespace BPASmartClient.DosingHKProject.Model
if (HKDevice.IsConnected)
{
HKDevice.Init();
- MessageLog.GetInstance.ShowUserLog("海科plc连接成功,并初始化完成");
+ MessageNotify.GetInstance.ShowUserLog("海科plc连接成功,并初始化完成");
}
}
catch(Exception ex)
@@ -346,7 +346,7 @@ namespace BPASmartClient.DosingHKProject.Model
{
HKDevice.HK_PLC_S7.Write("DB2.DBX3.0", false);
HKDevice.HK_PLC_S7.Write("DB2.DBX3.1", false);
- MessageLog.GetInstance.ShowRunLog($"下料桶堵料,线体不运行");
+ MessageNotify.GetInstance.ShowRunLog($"下料桶堵料,线体不运行");
cnt_sensor8++;
}
else
@@ -437,7 +437,7 @@ namespace BPASmartClient.DosingHKProject.Model
if (GVL_SmallStation.GetInstance.AllowDosing_Pos[0])
{
int res = 1;
- MessageLog.GetInstance.ShowRunLog($"配方:{recipeName},1号桶,{res}料仓,允许配料");
+ MessageNotify.GetInstance.ShowRunLog($"配方:{recipeName},1号桶,{res}料仓,允许配料");
if (res > 0 )
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == res);
@@ -448,13 +448,13 @@ namespace BPASmartClient.DosingHKProject.Model
GVL_SmallStation.GetInstance.StockInIsWork = (int)res;
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
- MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},1号桶,{(int)res}号仓,配料完成");
+ MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},1号桶,{(int)res}号仓,配料完成");
}
}
else if(RTrig.GetInstance("DB3.DBX50.1").Start(HKDevice.HK_PLC_S7.Read("DB3.DBX50.1")))
{
var res = HKDevice.HK_PLC_S7.Read("DB3.DBD14");
- MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{res}料仓,允许配料");
+ MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -465,13 +465,13 @@ namespace BPASmartClient.DosingHKProject.Model
GVL_SmallStation.GetInstance.StockInIsWork = (int)loc;
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
- MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{(int)loc}号仓,配料完成");
+ MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{(int)loc}号仓,配料完成");
}
}
else if (RTrig.GetInstance("DB3.DBX50.2").Start(HKDevice.HK_PLC_S7.Read("DB3.DBX50.2")))
{
var res = HKDevice.HK_PLC_S7.Read("DB3.DBD18");
- MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{res}料仓,允许配料");
+ MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -482,13 +482,13 @@ namespace BPASmartClient.DosingHKProject.Model
GVL_SmallStation.GetInstance.StockInIsWork = (int)loc;
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
- MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{(int)loc}号仓,配料完成");
+ MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{(int)loc}号仓,配料完成");
}
}
else if (RTrig.GetInstance("DB3.DBX50.3").Start(HKDevice.HK_PLC_S7.Read("DB3.DBX50.3")))
{
var res = HKDevice.HK_PLC_S7.Read("DB3.DBD22");
- MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{res}料仓,允许配料");
+ MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{res}料仓,允许配料");
if (res > 0 && res is float loc)
{
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
@@ -499,7 +499,7 @@ namespace BPASmartClient.DosingHKProject.Model
GVL_SmallStation.GetInstance.StockInIsWork = (int)loc;
}
GVL_SmallStation.GetInstance.DosingTray1 = true;
- MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{(int)loc}号仓,配料完成");
+ MessageNotify.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{(int)loc}号仓,配料完成");
}
}
if (GVL_SmallStation.GetInstance.DosingTray1)
@@ -508,7 +508,7 @@ namespace BPASmartClient.DosingHKProject.Model
{
if (RTrig.GetInstance("GetDeviceRunStatus").Start(DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3))
{
- MessageLog.GetInstance.ShowRunLog($"柔性味魔方,托盘1,配方:{recipeName},{i}号仓,配料完成");
+ MessageNotify.GetInstance.ShowRunLog($"柔性味魔方,托盘1,配方:{recipeName},{i}号仓,配料完成");
int res = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i);
RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).Laying_Off_Weight = DeviceInquire.GetInstance.GetDevice(i).deviceStatus.CutWeightFeedback;
DeviceInquire.GetInstance.GetDevice(i).StatusReset();
@@ -527,7 +527,7 @@ namespace BPASmartClient.DosingHKProject.Model
if (RTrig.GetInstance("配方配料完成").Start(HKDevice.HK_PLC_S7.Read("DB3.DBX1.1")) && (GVL_SmallStation.GetInstance.WindSendDosingFinish || !GVL_SmallStation.GetInstance.IsUseWindSend))
{
var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeCode == code);
- MessageLog.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成");
+ MessageNotify.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成");
App.Current.Dispatcher.Invoke(() =>
{
Json.Data.Recipes.Remove(res);
diff --git a/BPASmartClient.DosingProject/Model/RawMaterial/DeviceInquire.cs b/BPASmartClient.DosingProject/Model/RawMaterial/DeviceInquire.cs
index c4ff9f55..4f4b33ef 100644
--- a/BPASmartClient.DosingProject/Model/RawMaterial/DeviceInquire.cs
+++ b/BPASmartClient.DosingProject/Model/RawMaterial/DeviceInquire.cs
@@ -307,13 +307,13 @@ namespace BPASmartClient.DosingHKProject.Model
deviceStatus.DeviceNum = (ushort)this.modbusTcp.ReadShort(DeviceAddress.DeviceNum);//获取设备编号
deviceStatus.DeviceAlarmCode = (ushort)this.modbusTcp.ReadShort(DeviceAddress.DeviceAlarmCode);//获取设备故障编码
- AlarmHelper.Alarm.EStop1 = deviceStatus.DeviceAlarmCode.Get16bitValue(1);
- AlarmHelper.Alarm.Servo = deviceStatus.DeviceAlarmCode.Get16bitValue(2);
- AlarmHelper.Alarm.Inverter = deviceStatus.DeviceAlarmCode.Get16bitValue(3);
- AlarmHelper.Alarm.EStop2 = deviceStatus.DeviceAlarmCode.Get16bitValue(7);
- AlarmHelper.Alarm.SiloUpperLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(8);
- AlarmHelper.Alarm.SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9);
- AlarmHelper.Alarm.EStop1 = true;
+ AlarmHelper.GetInstance(DeviceName).EStop1 = deviceStatus.DeviceAlarmCode.Get16bitValue(1);
+ AlarmHelper.GetInstance(DeviceName).Servo = deviceStatus.DeviceAlarmCode.Get16bitValue(2);
+ AlarmHelper.GetInstance(DeviceName).Inverter = deviceStatus.DeviceAlarmCode.Get16bitValue(3);
+ AlarmHelper.GetInstance(DeviceName).EStop2 = deviceStatus.DeviceAlarmCode.Get16bitValue(7);
+ AlarmHelper.GetInstance(DeviceName).SiloUpperLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(8);
+ AlarmHelper.GetInstance(DeviceName).SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9);
+ AlarmHelper.GetInstance(DeviceName).EStop1 = true;
Thread.Sleep(10);
}), $"{DeviceName} 开始监听", true);
}
@@ -342,7 +342,7 @@ namespace BPASmartClient.DosingHKProject.Model
{
modbusTcp.SetReal(DeviceAddress.WeightSet, Value);//写入配方量
modbusTcp.Write(DeviceAddress.Start, (ushort)1);//设备启动写入
- MessageLog.GetInstance.ShowRunLog($"开始配料");
+ MessageNotify.GetInstance.ShowRunLog($"开始配料");
//配料设备参数写入
var res = Json.Data.deviceParModels.FirstOrDefault(p => p.MaterialName == DeviceName);
if (res != null)
@@ -355,7 +355,7 @@ namespace BPASmartClient.DosingHKProject.Model
modbusTcp.SetUint(DeviceAddress.SiloUpperLimitWeight, (uint)res.SiloUpperLimitWeight);
modbusTcp.SetUint(DeviceAddress.LowerLimitWeightOfSilo, (uint)res.LowerLimitWeightOfSilo);
modbusTcp.SetUint(DeviceAddress.StirringSpeed, (uint)res.StirringSpeed * 100);
- MessageLog.GetInstance.ShowRunLog($"参数下发完成");
+ MessageNotify.GetInstance.ShowRunLog($"参数下发完成");
}
}
}
diff --git a/BPASmartClient.DosingProject/ViewModel/NewMaterialViewModel.cs b/BPASmartClient.DosingProject/ViewModel/NewMaterialViewModel.cs
index 3f2d4df8..226e3360 100644
--- a/BPASmartClient.DosingProject/ViewModel/NewMaterialViewModel.cs
+++ b/BPASmartClient.DosingProject/ViewModel/NewMaterialViewModel.cs
@@ -37,7 +37,7 @@ public class NewMaterialViewModel:ObservableObject
var res = Materials.FirstOrDefault(p=>p.RawMaterialId == id);
Materials.Remove(res);
Json.Save();
- MessageLog.GetInstance.ShowUserLog($"删除原料--{res.RawMaterialName}");
+ MessageNotify.GetInstance.ShowUserLog($"删除原料--{res.RawMaterialName}");
}
}
@@ -52,7 +52,7 @@ public class NewMaterialViewModel:ObservableObject
if(Json.Data.LocalMaterails.FirstOrDefault(p=>p.RawMaterialName == MaterialName) != null) { ErrorInfo = "本地原料名称重复";return ;}
Json.Data.LocalMaterails.Add(new RawMaterialModel { RawMaterialName = MaterialName, RawMaterialId = Guid.NewGuid().ToString() , RawMaterialSource = 0 });
Json.Save();
- MessageLog.GetInstance.ShowUserLog($"添加原料--{MaterialName}");
+ MessageNotify.GetInstance.ShowUserLog($"添加原料--{MaterialName}");
});
}
}
diff --git a/BPASmartClient.DosingProject/ViewModel/RecipeControlViewModel.cs b/BPASmartClient.DosingProject/ViewModel/RecipeControlViewModel.cs
index ba12aa85..9530d1a4 100644
--- a/BPASmartClient.DosingProject/ViewModel/RecipeControlViewModel.cs
+++ b/BPASmartClient.DosingProject/ViewModel/RecipeControlViewModel.cs
@@ -35,7 +35,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
{
Recipes.ElementAt(index).IsEnable = false;
}
- MessageLog.GetInstance.ShowUserLog($"下发工单 { Recipes.ElementAt(index).RecipeName}");
+ MessageNotify.GetInstance.ShowUserLog($"下发工单 { Recipes.ElementAt(index).RecipeName}");
devices.Enqueue(deviceName);
var res = Recipes.FirstOrDefault(p => p.RecipeName == deviceName);
UserTreeWait.Add(new RecipeModel { RecipeName = deviceName, RawMaterials = res.RawMaterials });
@@ -43,7 +43,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方下发成功!");
- MessageLog.GetInstance.ShowUserLog($"下发工单 {Guid.NewGuid().ToString()}");
+ MessageNotify.GetInstance.ShowUserLog($"下发工单 {Guid.NewGuid().ToString()}");
});
ChangeRecipeStateCommand = new RelayCommand