diff --git a/BPASmartClient.Business/BPASmartClient.Business.csproj b/BPASmartClient.Business/BPASmartClient.Business.csproj index 0d95c75a..2e3b76f8 100644 --- a/BPASmartClient.Business/BPASmartClient.Business.csproj +++ b/BPASmartClient.Business/BPASmartClient.Business.csproj @@ -8,6 +8,7 @@ + diff --git a/BPASmartClient.Business/InternetInfo.cs b/BPASmartClient.Business/InternetInfo.cs index 09634dfa..0fe24295 100644 --- a/BPASmartClient.Business/InternetInfo.cs +++ b/BPASmartClient.Business/InternetInfo.cs @@ -8,7 +8,7 @@ using System.IO; using Microsoft.Extensions.Configuration; using System.Threading; using BPA.Helper; -using BPASmartClient.Message; + using BPA.ApolloClient; using BPA.ApolloClient.Options; using Com.Ctrip.Framework.Apollo; diff --git a/BPASmartClient.Business/LocalMqtt.cs b/BPASmartClient.Business/LocalMqtt.cs index 74bc1c42..a629d7a9 100644 --- a/BPASmartClient.Business/LocalMqtt.cs +++ b/BPASmartClient.Business/LocalMqtt.cs @@ -1,5 +1,5 @@ using BPA.Message; -using BPASmartClient.MQTT; +using BPA.Communication; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace BPASmartClient.Business { - public class LocalMqtt + public class LocalMqtt { private volatile static LocalMqtt _Instance; public static LocalMqtt GetInstance => _Instance ?? (_Instance = new LocalMqtt()); @@ -20,7 +20,7 @@ namespace BPASmartClient.Business /// SendScreenDataModel MqttPushs = new SendScreenDataModel(); - MQTTProxy mQTTProxy = new MQTTProxy(); + MqttHelper mQTTProxy = new MqttHelper(); ScreenDeviceType LocDeviceType; @@ -33,25 +33,32 @@ namespace BPASmartClient.Business { MqttPushs.Name = DeviceType; LocDeviceType = DeviceType; - mQTTProxy.Connected = new Action(() => + mQTTProxy.ConnectOk = new Action(() => { - mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(DeviceType)) ; - + mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(DeviceType)); + }); MQTT_IP = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_IP"].ToString(); MQTT_PORT = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_Port"].ToString(); MQTT_USERNAME = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_User"].ToString(); MQTT_PASSWORD = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_Password"].ToString(); - mQTTProxy.Connect(MQTT_USERNAME, MQTT_PASSWORD, MQTT_IP, int.Parse(MQTT_PORT), $"{DeviceType}_设备监听数据{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");//"10.2.1.254""admin", "public" + mQTTProxy.Connect(new BPA.Communication.Base.ConfigurationOptions() + { + UserName = MQTT_USERNAME, + Password = MQTT_PASSWORD, + IpAddress = MQTT_IP, + Port = int.Parse(MQTT_PORT), + ClientId = $"{DeviceType}_设备监听数据{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}" + }); } public void Start() { - + } - + /// /// MQTT消息推送 diff --git a/BPASmartClient.Business/MainConsole.cs b/BPASmartClient.Business/MainConsole.cs index 97f05915..92281cfe 100644 --- a/BPASmartClient.Business/MainConsole.cs +++ b/BPASmartClient.Business/MainConsole.cs @@ -1,5 +1,4 @@ -using BPASmartClient.Message; -using HBLConsole.Communication; + using System; using System.Collections.Generic; using System.Linq; diff --git a/BPASmartClient.Business/Plugin/ConfigMgr.cs b/BPASmartClient.Business/Plugin/ConfigMgr.cs index c19ff67a..9686a1a6 100644 --- a/BPASmartClient.Business/Plugin/ConfigMgr.cs +++ b/BPASmartClient.Business/Plugin/ConfigMgr.cs @@ -1,7 +1,7 @@ using BPA.ApolloClient; using BPA.Message; using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model; using Microsoft.Extensions.Configuration; using Newtonsoft.Json; diff --git a/BPASmartClient.Business/Plugin/DeviceMgr.cs b/BPASmartClient.Business/Plugin/DeviceMgr.cs index d84a8ebf..e943ee05 100644 --- a/BPASmartClient.Business/Plugin/DeviceMgr.cs +++ b/BPASmartClient.Business/Plugin/DeviceMgr.cs @@ -3,7 +3,7 @@ using BPASmartClient.Device; using BPA.Helper; using BPASmartClient.Http; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.小炒机; using BPASmartClient.Model.调酒机; diff --git a/BPASmartClient.Business/Plugin/MQTTMgr.cs b/BPASmartClient.Business/Plugin/MQTTMgr.cs index f7c00bcd..b0a45fe6 100644 --- a/BPASmartClient.Business/Plugin/MQTTMgr.cs +++ b/BPASmartClient.Business/Plugin/MQTTMgr.cs @@ -1,8 +1,7 @@ using BPA.Message; using BPA.Helper; -using BPASmartClient.Message; -using BPASmartClient.MQTT; -using HBLConsole.Communication; + +using BPA.Communication; using Microsoft.Extensions.Configuration; using System; using System.Collections.Concurrent; @@ -29,7 +28,8 @@ namespace BPASmartClient.Business //消息缓存 private ConcurrentQueue msg = new ConcurrentQueue(); //MQTT 代理 - private MQTTProxy mqttProxy = new MQTTProxy(); + private MqttHelper mqttProxy = new MqttHelper(); + //消息处理者 private List messageRecives = new List(); @@ -43,28 +43,29 @@ namespace BPASmartClient.Business running = true; //主题初始化 TopicDefine.GetInstance().Initialize(Plugin.GetInstance().GetPlugin().GetDevices()); - //MQTT 连接成功 - mqttProxy.Connected = new Action(() => - { - mqttProxy.Subscrib(TopicDefine.GetInstance().SubscribTopics.ToArray()); - }); - //MQTT 连接成功 - mqttProxy.LostConnect = new Action(() => + + mqttProxy.ConnectOk = () => { mqttProxy.Subscrib(TopicDefine.GetInstance().SubscribTopics.ToArray()); - }); + }; + //MQTT 数据接收 - mqttProxy.MessageRecive = new Action((message) => - { - msg.Enqueue(message); - }); + mqttProxy.MessageRecive = s => { msg.Enqueue(s); }; + var MqttServerConfig = Plugin.GetInstance().GetPlugin().MQTT_Config; var MqttServerAccount = Plugin.GetInstance().GetPlugin().Mqtt_Account; var deviceConfig = Plugin.GetInstance().GetPlugin().deviceConfigModelJsons; - string deviceId = deviceConfig[0].deviceModels[0].DeviceId; + string deviceId = deviceConfig[0].deviceModels[0].DeviceId; clientId = Plugin.GetInstance().GetPlugin().ClientId; //MQTT 初始化 - mqttProxy.Connect(MqttServerAccount.UserName, MqttServerAccount.Password, MqttServerConfig.Host, MqttServerConfig.Port, "ClientId:" + clientId + "DeviceId:" + deviceId + Guid.NewGuid().ToString()); + mqttProxy.Connect(new BPA.Communication.Base.ConfigurationOptions() + { + UserName = MqttServerAccount.UserName, + Password = MqttServerAccount.Password, + IpAddress = MqttServerConfig.Host, + Port = MqttServerConfig.Port, + ClientId = $"ClientId-[{clientId}]-DeviceId-[{deviceId}]-{Guid.NewGuid()}" + }); ThreadManage.GetInstance().Start(() => { @@ -88,7 +89,7 @@ namespace BPASmartClient.Business } Thread.Sleep(50); } - }, "MQTT 消息处理", true); + }, "MQTT 消息处理", isRestart: true); } /// @@ -115,7 +116,7 @@ namespace BPASmartClient.Business public void Dispose() { running = false; - mqttProxy.CloseConnect(); + mqttProxy.Dispose(); messageRecives.Clear(); } diff --git a/BPASmartClient.Business/Plugin/OrderProxy.cs b/BPASmartClient.Business/Plugin/OrderProxy.cs index be39f559..f23a5761 100644 --- a/BPASmartClient.Business/Plugin/OrderProxy.cs +++ b/BPASmartClient.Business/Plugin/OrderProxy.cs @@ -6,7 +6,7 @@ using BPASmartClient.Device; using BPA.Helper; using BPASmartClient.Http; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.小炒机; using BPASmartClient.Model.调酒机; @@ -18,7 +18,7 @@ using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; - +using static BPA.Helper.EventBus; namespace BPASmartClient.Business { @@ -136,7 +136,7 @@ namespace BPASmartClient.Business } }); - EventBus.EventBus.GetInstance().Subscribe(0, OrderStatusChangedHandle); + EventBus.GetInstance().Subscribe(0, OrderStatusChangedHandle); } private void StartTargetDeviceOrderJob(int deviceId) @@ -164,7 +164,7 @@ namespace BPASmartClient.Business } Thread.Sleep(50); } - }, $"MQTT 订单接收处理-设备[{deviceId}]", true); + }, $"MQTT 订单接收处理-设备[{deviceId}]", isRestart: true); } public void OrderStatusChangedHandle(IEvent @event, EventCallBackHandle callBack) diff --git a/BPASmartClient.CustomResource/Pages/Model/AlarmTest.cs b/BPASmartClient.CustomResource/Pages/Model/AlarmTest.cs index 6befd7fd..5369cd45 100644 --- a/BPASmartClient.CustomResource/Pages/Model/AlarmTest.cs +++ b/BPASmartClient.CustomResource/Pages/Model/AlarmTest.cs @@ -28,8 +28,8 @@ namespace BPASmartClient.CustomResource.Pages.Model private AlarmTest() { } - public static ObservableCollection Alarms { get; set; } = new ObservableCollection(); - public static List HistoryAlarms { get; set; } = new List(); + public static ObservableCollection Alarms { get; set; } = new(); + public static List HistoryAlarms { get; set; } = new(); static ConcurrentDictionary flagbit = new ConcurrentDictionary(); static ConcurrentDictionary delays = new ConcurrentDictionary(); public static Action AddAction { get; set; } @@ -94,7 +94,7 @@ namespace BPASmartClient.CustomResource.Pages.Model /// 报警信息 private static void AddAlarm(object value, string AlarmInfo, AlarmLevel alarmLevel) { - Alarm tempAlarm = new Alarm() + BPASmartClient.Model.Alarm tempAlarm = new BPASmartClient.Model.Alarm() { NumId = Alarms.Count + 1, Date = DateTime.Now.ToString("yyyy/MM/dd"), @@ -104,8 +104,8 @@ namespace BPASmartClient.CustomResource.Pages.Model Time = DateTime.Now.ToString("HH:mm:ss"), }; - var res = Sqlite.GetInstance.Base.Add(tempAlarm); - Sqlite.GetInstance.Save(); + var res = Sqlite.GetInstance.Base.Add(tempAlarm); + Sqlite.GetInstance.Save(); if (Alarms.FirstOrDefault(p => p.Info == AlarmInfo) == null) { diff --git a/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs b/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs index 62cb05f1..99fded33 100644 --- a/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs +++ b/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs @@ -35,7 +35,7 @@ namespace BPASmartClient.CustomResource.Pages.Model public ObservableCollection userLogs { get; set; } = new(); - public ObservableCollection alarmLogs { get; set; } = new(); + public ObservableCollection alarmLogs { get; set; } = new(); public ObservableCollection recipeLogs { get; set; } = new(); @@ -43,7 +43,7 @@ namespace BPASmartClient.CustomResource.Pages.Model { Sqlite.GetInstance.Save(); Sqlite.GetInstance.Save(); - Sqlite.GetInstance.Save(); + Sqlite.GetInstance.Save(); Sqlite.GetInstance.Save(); } @@ -122,7 +122,7 @@ namespace BPASmartClient.CustomResource.Pages.Model lock (alarmlock) { AlarmID++; - Alarm alarmLog = new Alarm() + BPASmartClient.Model.Alarm alarmLog = new BPASmartClient.Model.Alarm() { NumId = AlarmID, Date = DateTime.Now.ToString("yyyy-MM-dd"), @@ -131,7 +131,7 @@ namespace BPASmartClient.CustomResource.Pages.Model Value = AlarmNumber, Grade = (level) + "" }; - Sqlite.GetInstance.Base.Add(alarmLog); + Sqlite.GetInstance.Base.Add(alarmLog); Application.Current.Dispatcher.Invoke(new Action(() => { alarmLogs.Insert(0, alarmLog); })); AlarmLog?.Invoke(info); } diff --git a/BPASmartClient.CustomResource/Pages/Model/VoiceAPI.cs b/BPASmartClient.CustomResource/Pages/Model/VoiceAPI.cs index a7577d0d..06e910fc 100644 --- a/BPASmartClient.CustomResource/Pages/Model/VoiceAPI.cs +++ b/BPASmartClient.CustomResource/Pages/Model/VoiceAPI.cs @@ -1,4 +1,4 @@ -using BPASmartClient.Message; + using System; using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs index 8d2af99e..25ca9ba5 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs @@ -7,7 +7,7 @@ using BPA.Helper; using System.Collections.Concurrent; using System.Collections.ObjectModel; using System.Windows; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.CustomResource.Pages.Model; using BPASmartClient.Model; using Google.Protobuf.WellKnownTypes; diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs index 95fa78b3..dd339929 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs @@ -7,7 +7,7 @@ using System.Windows; using BPASmartClient.CustomResource.Pages.Model; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.CustomResource.Pages.ViewModel { diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs index 4b6336fe..09eed3ef 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs @@ -12,7 +12,7 @@ using BPASmartClient.CustomResource.Pages.Model; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.CustomResource.Pages.ViewModel { diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs index fde837e7..54ecd1ee 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using BPA.Helper; using System.Collections.ObjectModel; using BPASmartClient.CustomResource.Pages.Enums; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.CustomResource.Pages.Model; using BPASmartClient.Nfc; using System.Threading; diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs index 4d231c80..7edbd228 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using BPASmartClient.CustomResource.Pages.Model; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.CustomResource.Pages.ViewModel { diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/RecipeCompleteViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/RecipeCompleteViewModel.cs index 7f4ac8e8..8d9f5cb9 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/RecipeCompleteViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/RecipeCompleteViewModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; using BPASmartClient.CustomResource.Pages.Model; using System.Windows; diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/ReportViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/ReportViewModel.cs index 7664c7b5..04b53b14 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/ReportViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/ReportViewModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using BPA.Helper; using System.Collections.ObjectModel; using BPASmartClient.CustomResource.Pages.Model; -using Microsoft.Toolkit.Mvvm.Input; + using System.Diagnostics; using System.IO; diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs index 83c07336..8ba9c21d 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; using BPASmartClient.CustomResource.Pages.Model; using System.Windows; diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs index 3fa25b92..65bd6e89 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.CustomResource.Pages.View; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs index aafd7b72..d6770c26 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs @@ -7,7 +7,7 @@ using BPA.Helper; using System.Collections.ObjectModel; using BPASmartClient.CustomResource.Pages.Model; using System.Windows; -using Microsoft.Toolkit.Mvvm.Input; + using BPA.Helper; namespace BPASmartClient.CustomResource.Pages.ViewModel diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/UserManageViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/UserManageViewModel.cs index 943f03a6..56b6195b 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/UserManageViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/UserManageViewModel.cs @@ -2,7 +2,7 @@ using BPASmartClient.CustomResource.Pages.Enums; using BPASmartClient.CustomResource.Pages.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using Newtonsoft.Json; using System; using System.Collections.Generic; diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs index c894ff0f..b056bf27 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.CustomResource.UserControls; using BPASmartClient.CustomResource.UserControls.MessageShow; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.DRCoffee/CoffeeMachine.cs b/BPASmartClient.DRCoffee/CoffeeMachine.cs index b02ae71f..7329ddb2 100644 --- a/BPASmartClient.DRCoffee/CoffeeMachine.cs +++ b/BPASmartClient.DRCoffee/CoffeeMachine.cs @@ -1,7 +1,6 @@ using BPASmartClient.DRCoffee; using BPA.Helper; -using BPASmartClient.Message; using BPASmartClient.Model; using BPASmartClient.Model.咖啡机.Enum; using BPASmartClient.Peripheral; @@ -9,7 +8,7 @@ using BPASmartClient.SerialPort; using System; using System.Collections.Generic; using System.Threading; - +using static BPA.Helper.EventBus; namespace BPASmartClient.DRCoffee { @@ -147,7 +146,7 @@ namespace BPASmartClient.DRCoffee if (((DrCoffeeStatus)status["CoffeeStatus"]) == DrCoffeeStatus.Running && package.Status != DrCoffeeStatus.Running) { status["CoffeeStatus"] = package.Status; - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CoffeEndCookEvent() { DeviceId = DeviceId }); + EventBus.GetInstance().Publish(new DRCoffee_CoffeEndCookEvent() { DeviceId = DeviceId }); } else status["CoffeeStatus"] = package.Status; status["CoffeeAppStatus"] = package.ApplicationStatus; @@ -180,27 +179,27 @@ namespace BPASmartClient.DRCoffee commProxy.SetDataStorage(dataStorage); //咖博士咖啡机制作 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - try - { - free = true; - Thread.Sleep(200); - drinksOrder.CommCmd = DrCoffeeCommCmd.饮品制作指令; - drinksOrder.DrinksCode = ((DRCoffee_MakeCoffeeEvent)@event).DrinkCode; - commProxy.SendData(DrCoffee.Packe(drinksOrder)); - Thread.Sleep(200); - free = false; - MessageLog.GetInstance.Show($"咖啡机: 制作咖啡指令"); - } - catch (Exception ex) - { - MessageLog.GetInstance.ShowEx($"BPASmartClient.DRCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); - } - }); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + try + { + free = true; + Thread.Sleep(200); + drinksOrder.CommCmd = DrCoffeeCommCmd.饮品制作指令; + drinksOrder.DrinksCode = ((DRCoffee_MakeCoffeeEvent)@event).DrinkCode; + commProxy.SendData(DrCoffee.Packe(drinksOrder)); + Thread.Sleep(200); + free = false; + MessageLog.GetInstance.Show($"咖啡机: 制作咖啡指令"); + } + catch (Exception ex) + { + MessageLog.GetInstance.ShowEx($"BPASmartClient.DRCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); + } + }); //咖博士咖啡机取消制作咖啡 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { try { @@ -220,23 +219,23 @@ namespace BPASmartClient.DRCoffee }); //咖博士咖啡机模式设置 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - try - { - free = true; - Thread.Sleep(200); - drinksOrder.CommCmd = ((DRCoffee_CoffeeCommCmdEvent)@event).CommCmd; - commProxy.SendData(DrCoffee.Packe(drinksOrder)); - Thread.Sleep(200); - free = false; - MessageLog.GetInstance.Show($"咖啡机: 咖啡模式设置指令"); - } - catch (Exception ex) - { - MessageLog.GetInstance.ShowEx($"BPASmartClient.DRCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); - } - }); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + try + { + free = true; + Thread.Sleep(200); + drinksOrder.CommCmd = ((DRCoffee_CoffeeCommCmdEvent)@event).CommCmd; + commProxy.SendData(DrCoffee.Packe(drinksOrder)); + Thread.Sleep(200); + free = false; + MessageLog.GetInstance.Show($"咖啡机: 咖啡模式设置指令"); + } + catch (Exception ex) + { + MessageLog.GetInstance.ShowEx($"BPASmartClient.DRCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); + } + }); InitStatus(); //测试 Start(); diff --git a/BPASmartClient.DRCoffee/CommandHandler.cs b/BPASmartClient.DRCoffee/CommandHandler.cs index d10f64ae..c20c55ee 100644 --- a/BPASmartClient.DRCoffee/CommandHandler.cs +++ b/BPASmartClient.DRCoffee/CommandHandler.cs @@ -1,5 +1,6 @@  +using BPA.Helper; using BPASmartClient.Model; using BPASmartClient.Model.咖啡机.Enum; using BPASmartClient.SerialPort; @@ -9,10 +10,10 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using static BPA.Helper.EventBus; - -namespace BPASmartClient.DRCoffee -{ +namespace BPASmartClient.DRCoffee +{ /// /// 指令封装 /// @@ -35,9 +36,9 @@ namespace BPASmartClient.DRCoffee cmdAsk = DrCoffee.Packe(package); drinksOrder.CommCmd = DrCoffeeCommCmd.饮品制作指令; - EventBus.EventBus.GetInstance().Subscribe(0,MakeCoffeeEventHandle); - EventBus.EventBus.GetInstance().Subscribe(0, CancelMakeCoffeeEventHandle); - EventBus.EventBus.GetInstance().Subscribe(0, CoffeeCommCmdEventHandle); + EventBus.GetInstance().Subscribe(0, MakeCoffeeEventHandle); + EventBus.GetInstance().Subscribe(0, CancelMakeCoffeeEventHandle); + EventBus.GetInstance().Subscribe(0, CoffeeCommCmdEventHandle); } diff --git a/BPASmartClient.Device/AlarmHelper.cs b/BPASmartClient.Device/AlarmHelper.cs index 03b382b5..5caa3664 100644 --- a/BPASmartClient.Device/AlarmHelper.cs +++ b/BPASmartClient.Device/AlarmHelper.cs @@ -1,5 +1,4 @@ using BPA.Helper; -using BPASmartClient.Message; using BPASmartClient.Model; using System; using System.Collections.Concurrent; @@ -12,8 +11,8 @@ namespace BPASmartClient.Device { public class AlarmHelper { - public List Alarms { get; set; } = new List(); - public List HistoryAlarms { get; set; } = new List(); + public List Alarms { get; set; } = new(); + public List HistoryAlarms { get; set; } = new(); ConcurrentDictionary flagbit = new ConcurrentDictionary(); ConcurrentDictionary delays = new ConcurrentDictionary(); public Action AddAction { get; set; } @@ -55,7 +54,7 @@ namespace BPASmartClient.Device /// 报警信息 private void AddAlarm(object value, string AlarmInfo, AlarmLevel alarmLevel) { - Alarm tempAlarm = new Alarm() + BPASmartClient.Model.Alarm tempAlarm = new BPASmartClient.Model.Alarm() { NumId = Alarms.Count + 1, Date = DateTime.Now.ToString("yyyy/MM/dd"), @@ -65,8 +64,8 @@ namespace BPASmartClient.Device Time = DateTime.Now.ToString("HH:mm:ss"), }; - var res = Sqlite.GetInstance.Base.Add(tempAlarm); - Sqlite.GetInstance.Save(); + var res = Sqlite.GetInstance.Base.Add(tempAlarm); + Sqlite.GetInstance.Save(); if (Alarms.FirstOrDefault(p => p.Info == AlarmInfo) == null) { diff --git a/BPASmartClient.FoodStationTest/ViewModel/BomOfMaterialViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/BomOfMaterialViewModel.cs index 0ef1aa6a..9e5a3707 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/BomOfMaterialViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/BomOfMaterialViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model; using BPASmartClient.FoodStationTest.Model.Bom; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/ChangeDeviceNameViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/ChangeDeviceNameViewModel.cs index e6537e38..bf815e0f 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/ChangeDeviceNameViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/ChangeDeviceNameViewModel.cs @@ -2,7 +2,7 @@ using BPASmartClient.FoodStationTest.Model; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/DeviceListViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/DeviceListViewModel.cs index 1461b0ee..fc4b610f 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/DeviceListViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/DeviceListViewModel.cs @@ -2,7 +2,7 @@ using BPASmartClient.FoodStationTest.View; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; namespace BPASmartClient.FoodStationTest.ViewModel diff --git a/BPASmartClient.FoodStationTest/ViewModel/DeviceMaterialParViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/DeviceMaterialParViewModel.cs index 44ab5123..5a14cd9a 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/DeviceMaterialParViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/DeviceMaterialParViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.FoodStationTest.Model; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/ManualCommViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/ManualCommViewModel.cs index f4835060..69ddf520 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/ManualCommViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/ManualCommViewModel.cs @@ -1,6 +1,6 @@ using BPASmartClient.FoodStationTest.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/ManualControlViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/ManualControlViewModel.cs index 4dc0a480..0ac18020 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/ManualControlViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/ManualControlViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.FoodStationTest.Model; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.ObjectModel; using System.ComponentModel; diff --git a/BPASmartClient.FoodStationTest/ViewModel/ManualFlowViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/ManualFlowViewModel.cs index f99ddcc8..8199436c 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/ManualFlowViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/ManualFlowViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model; using BPASmartClient.FoodStationTest.Model.HK_PLC; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.ComponentModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/NewLocalRecipeViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/NewLocalRecipeViewModel.cs index 1cd3e5fd..c641b919 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/NewLocalRecipeViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/NewLocalRecipeViewModel.cs @@ -4,7 +4,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.FoodStationTest.Model; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/NewMaterialViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/NewMaterialViewModel.cs index 9d16b541..c357f5a8 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/NewMaterialViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/NewMaterialViewModel.cs @@ -2,7 +2,7 @@ using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/NewRecipeViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/NewRecipeViewModel.cs index f519f7e7..59aaedd4 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/NewRecipeViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/NewRecipeViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.FoodStationTest.Model; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/RecipeControlViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/RecipeControlViewModel.cs index 0a0878ad..1ad7926b 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/RecipeControlViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/RecipeControlViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Concurrent; using System.Collections.ObjectModel; diff --git a/BPASmartClient.FoodStationTest/ViewModel/RecipeInfosViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/RecipeInfosViewModel.cs index 3e64bdb4..8104d9a4 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/RecipeInfosViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/RecipeInfosViewModel.cs @@ -1,7 +1,7 @@ using BPASmartClient.FoodStationTest.Model; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/RecipeReceiveViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/RecipeReceiveViewModel.cs index 7c8a4a47..92360610 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/RecipeReceiveViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/RecipeReceiveViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model; using BPASmartClient.FoodStationTest.View; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/RecipeSettingsViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/RecipeSettingsViewModel.cs index ac01b0a6..c00b8c09 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/RecipeSettingsViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/RecipeSettingsViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model; using BPASmartClient.FoodStationTest.View; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/SelectRecipesViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/SelectRecipesViewModel.cs index 94ef09eb..ceb1ef74 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/SelectRecipesViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/SelectRecipesViewModel.cs @@ -1,7 +1,7 @@ using BPASmartClient.FoodStationTest.Model; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/SiemensRecipeReceiveViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/SiemensRecipeReceiveViewModel.cs index 98de545a..935dea8c 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/SiemensRecipeReceiveViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/SiemensRecipeReceiveViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.FoodStationTest.Model; using BPASmartClient.FoodStationTest.View; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/StockBinRawMaterialViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/StockBinRawMaterialViewModel.cs index 87723520..a1decd33 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/StockBinRawMaterialViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/StockBinRawMaterialViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model; using BPASmartClient.FoodStationTest.Model.RawMaterial; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.ObjectModel; using System.Linq; diff --git a/BPASmartClient.FoodStationTest/ViewModel/SystemParViewModel.cs b/BPASmartClient.FoodStationTest/ViewModel/SystemParViewModel.cs index 85cc3430..a57d4e5c 100644 --- a/BPASmartClient.FoodStationTest/ViewModel/SystemParViewModel.cs +++ b/BPASmartClient.FoodStationTest/ViewModel/SystemParViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model.HK_PLC; using BPASmartClient.FoodStationTest.Model.Par; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.FoodStationTest.ViewModel { diff --git a/BPASmartClient.GSIceCream/CommandHandler.cs b/BPASmartClient.GSIceCream/CommandHandler.cs index a669db55..9ce2bc85 100644 --- a/BPASmartClient.GSIceCream/CommandHandler.cs +++ b/BPASmartClient.GSIceCream/CommandHandler.cs @@ -1,7 +1,8 @@  +using BPA.Helper; using BPASmartClient.GSIceCream; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.冰淇淋.Enum; using BPASmartClient.SerialPort; @@ -11,7 +12,7 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; - +using static BPA.Helper.EventBus; namespace BPASmartClient.DRCoffee { @@ -34,8 +35,8 @@ namespace BPASmartClient.DRCoffee this.commProxy = commProxy; ICMSG_Heart_DW heartDW = new ICMSG_Heart_DW(); cmdHeartDW = IcPack.StructureToByte(heartDW); - EventBus.EventBus.GetInstance().Subscribe(0, ModeSetEventHandle); - EventBus.EventBus.GetInstance().Subscribe(0,DischargeEventHandle); + EventBus.GetInstance().Subscribe(0, ModeSetEventHandle); + EventBus.GetInstance().Subscribe(0, DischargeEventHandle); } /// /// 发送心跳 diff --git a/BPASmartClient.GSIceCream/IceCreamMachine.cs b/BPASmartClient.GSIceCream/IceCreamMachine.cs index a8267cc2..a85ff268 100644 --- a/BPASmartClient.GSIceCream/IceCreamMachine.cs +++ b/BPASmartClient.GSIceCream/IceCreamMachine.cs @@ -1,6 +1,6 @@  using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.冰淇淋.Enum; using BPASmartClient.Peripheral; @@ -9,7 +9,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading; - +using static BPA.Helper.EventBus; using static BPASmartClient.GSIceCream.MessageDefine; namespace BPASmartClient.GSIceCream @@ -176,7 +176,7 @@ namespace BPASmartClient.GSIceCream private void ProcessHeart(ICMSG_Heart_UP heartUpMsg) { - + IsConnected = OnLine; status["IceCreamIsConnected"] = OnLine; status["IceCreamCurrentMode"] = heartUpMsg.MS; @@ -253,7 +253,7 @@ namespace BPASmartClient.GSIceCream commProxy = new SerialPortClient(communicationPar.SerialPort, (BaudRates)communicationPar.BaudRate); commProxy.SetDataStorage(dataStorage); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { try { @@ -272,7 +272,7 @@ namespace BPASmartClient.GSIceCream }); //广深冰淇淋机打料 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { try { diff --git a/BPASmartClient.GSIceCream/MorkIStatus.cs b/BPASmartClient.GSIceCream/MorkIStatus.cs index 6ba08fcf..1bd89b74 100644 --- a/BPASmartClient.GSIceCream/MorkIStatus.cs +++ b/BPASmartClient.GSIceCream/MorkIStatus.cs @@ -1,6 +1,6 @@ using BPASmartClient.GSIceCream; using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model.冰淇淋.Enum; using System; using System.Collections.Generic; diff --git a/BPASmartClient.Helper/ActionManage.cs b/BPASmartClient.Helper/ActionManage.cs index f406b589..97f176e2 100644 --- a/BPASmartClient.Helper/ActionManage.cs +++ b/BPASmartClient.Helper/ActionManage.cs @@ -7,7 +7,7 @@ using System.Collections.Concurrent; using System.Reflection.Metadata; using System.Threading; using System.Reflection; -using BPASmartClient.Message; + namespace BPASmartClient.Helper { diff --git a/BPASmartClient.Helper/ExcelHelper.cs b/BPASmartClient.Helper/ExcelHelper.cs index 96cbdd49..4c1384b7 100644 --- a/BPASmartClient.Helper/ExcelHelper.cs +++ b/BPASmartClient.Helper/ExcelHelper.cs @@ -1,4 +1,4 @@ -using BPASmartClient.Message; + using System; using System.Collections.Generic; using System.Data; diff --git a/BPASmartClient.Helper/SystemHelper.cs b/BPASmartClient.Helper/SystemHelper.cs index 5233db44..9d2fb39e 100644 --- a/BPASmartClient.Helper/SystemHelper.cs +++ b/BPASmartClient.Helper/SystemHelper.cs @@ -1,4 +1,4 @@ -using BPASmartClient.Message; + using IWshRuntimeLibrary; using Microsoft.Win32; using System; diff --git a/BPASmartClient.Helper/ThreadManage.cs b/BPASmartClient.Helper/ThreadManage.cs index c16fb029..988cf204 100644 --- a/BPASmartClient.Helper/ThreadManage.cs +++ b/BPASmartClient.Helper/ThreadManage.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using System.Collections.Concurrent; using System.Diagnostics; using System.Threading; -using BPASmartClient.Message; + namespace BPASmartClient.Helper { diff --git a/BPASmartClient.IceMaker/IceMakerMachine.cs b/BPASmartClient.IceMaker/IceMakerMachine.cs index 1bc4e81a..23a91f8e 100644 --- a/BPASmartClient.IceMaker/IceMakerMachine.cs +++ b/BPASmartClient.IceMaker/IceMakerMachine.cs @@ -31,32 +31,32 @@ namespace BPASmartClient.IceMaker Thread.Sleep(1000); }), $"设备[{DeviceId}]制冰机读取线程", true); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - if (@event == null) return; - iceMakerHelper.StartCook(); - }); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - if (@event == null) return; - iceMakerHelper.EndCook(); - }); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + if (@event == null) return; + iceMakerHelper.StartCook(); + }); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + if (@event == null) return; + iceMakerHelper.EndCook(); + }); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; iceMakerHelper.pump(); }); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - if (@event == null) return; - iceMakerHelper.Standby(); - }); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - if (@event == null) return; - iceMakerHelper.PowerOn(); - }); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + if (@event == null) return; + iceMakerHelper.Standby(); + }); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + if (@event == null) return; + iceMakerHelper.PowerOn(); + }); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; var parm = @event as SetIceNumber; diff --git a/BPASmartClient.IoT/DataVClient.cs b/BPASmartClient.IoT/DataVClient.cs index 02a0c5c7..a6ed1064 100644 --- a/BPASmartClient.IoT/DataVClient.cs +++ b/BPASmartClient.IoT/DataVClient.cs @@ -5,7 +5,7 @@ using BPASmartClient.Business; using BPASmartClient.Device; using BPA.Helper; using BPASmartClient.IoT.Model; -using BPASmartClient.Message; + using BPASmartDatavDeviceClient.IoT; using System; using System.Collections.Generic; diff --git a/BPASmartClient.IoT/Model/FileUpload.cs b/BPASmartClient.IoT/Model/FileUpload.cs index 6d63042b..43a299ab 100644 --- a/BPASmartClient.IoT/Model/FileUpload.cs +++ b/BPASmartClient.IoT/Model/FileUpload.cs @@ -1,5 +1,5 @@ using BPA.Helper; -using BPASmartClient.Message; + using BPASmartDatavDeviceClient.IoT; using DataVAPI.Tool.IOT; using System; diff --git a/BPASmartClient.JAKA/JakaMachine.cs b/BPASmartClient.JAKA/JakaMachine.cs index ecd81444..40f2e018 100644 --- a/BPASmartClient.JAKA/JakaMachine.cs +++ b/BPASmartClient.JAKA/JakaMachine.cs @@ -41,31 +41,31 @@ namespace BPASmartClient.JAKA - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - if (@event == null) return; - var par = @event as WriteJaka; - switch (par?.TagName) - { - case "Power_On": - jaKaHelper.Power_On(); - break; - case "Enable_robot": - jaKaHelper.Enable_robot(); - break; - case "Set_RobotAO1": - if (par?.Value is int intvalue) jaKaHelper.Set_RobotAO1(intvalue); - break; - case "JaKaProgramName": - if (par?.Value is string stringvalue) jaKaHelper.JaKaProgramName(stringvalue); - break; - case "JakaDOutput": - if (par?.Value is bool DO_value && par?.DO_Index is int DO_Index) jaKaHelper.Set_RobotDO(DO_Index, DO_value); - break; - default: - break; - } - }); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + if (@event == null) return; + var par = @event as WriteJaka; + switch (par?.TagName) + { + case "Power_On": + jaKaHelper.Power_On(); + break; + case "Enable_robot": + jaKaHelper.Enable_robot(); + break; + case "Set_RobotAO1": + if (par?.Value is int intvalue) jaKaHelper.Set_RobotAO1(intvalue); + break; + case "JaKaProgramName": + if (par?.Value is string stringvalue) jaKaHelper.JaKaProgramName(stringvalue); + break; + case "JakaDOutput": + if (par?.Value is bool DO_value && par?.DO_Index is int DO_Index) jaKaHelper.Set_RobotDO(DO_Index, DO_value); + break; + default: + break; + } + }); } //public override void ReadData(string address) diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/BomOfMaterialViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/BomOfMaterialViewModel.cs index b336689d..cc46e8c1 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/BomOfMaterialViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/BomOfMaterialViewModel.cs @@ -5,7 +5,7 @@ using BPA.Helper; using BPASmartClient.JXJFoodBigStation.Model; using BPASmartClient.JXJFoodBigStation.Model.HK_PLC; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/ChangeDeviceNameViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/ChangeDeviceNameViewModel.cs index 6bca3216..42bea97a 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/ChangeDeviceNameViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/ChangeDeviceNameViewModel.cs @@ -1,7 +1,7 @@ using BPASmartClient.CustomResource.Pages.Model; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Linq; diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/DeviceManageViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/DeviceManageViewModel.cs index f37dbeca..69630969 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/DeviceManageViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/DeviceManageViewModel.cs @@ -3,7 +3,7 @@ using BPA.Helper; using BPASmartClient.JXJFoodBigStation.Model; using BPASmartClient.JXJFoodBigStation.View; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/HKPlcCommMonitorViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/HKPlcCommMonitorViewModel.cs index b9dd29f9..6c8c6310 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/HKPlcCommMonitorViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/HKPlcCommMonitorViewModel.cs @@ -2,7 +2,7 @@ using BPASmartClient.JXJFoodBigStation.Model; using BPASmartClient.JXJFoodBigStation.Model.HK_PLC; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/HardwareStatusViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/HardwareStatusViewModel.cs index f5525632..c109f661 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/HardwareStatusViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/HardwareStatusViewModel.cs @@ -8,7 +8,7 @@ using System.Collections.Concurrent; using System.Collections.ObjectModel; using System.Windows; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.JXJFoodBigStation.Model; using BPASmartClient.JXJFoodBigStation.View; using System.Windows.Forms; diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs index ccecfc12..7c70df92 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs @@ -6,7 +6,7 @@ using BPASmartClient.JXJFoodBigStation.Model; using BPASmartClient.JXJFoodBigStation.Model.HK_PLC; using BPASmartClient.JXJFoodBigStation.Model.Siemens; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs index 9b404aa3..a3970fb1 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using BPA.Helper; using System.Collections.ObjectModel; -using Microsoft.Toolkit.Mvvm.Input; + using BPA.Helper; using BPASmartClient.JXJFoodBigStation.Model; using BPASmartClient.CustomResource.Pages.Model; diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs index 2c39fc17..776bf485 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs @@ -8,7 +8,7 @@ using System.Collections.Concurrent; using System.Collections.ObjectModel; using System.Windows; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.JXJFoodBigStation.Model; using BPASmartClient.JXJFoodBigStation.View; using BPASmartClient.CustomResource.UserControls; diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs index c5ebd32e..79264462 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs @@ -6,7 +6,7 @@ using BPASmartClient.JXJFoodBigStation.Model; using BPASmartClient.JXJFoodBigStation.Model.Siemens; using BPASmartClient.JXJFoodBigStation.View; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/SelectRecipesViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/SelectRecipesViewModel.cs index 7c60998e..ac07886c 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/SelectRecipesViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/SelectRecipesViewModel.cs @@ -2,7 +2,7 @@ using BPA.Helper; using BPASmartClient.JXJFoodBigStation.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/SiemensRecipeSendDownViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/SiemensRecipeSendDownViewModel.cs index d567f1b5..60a0bfc7 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/SiemensRecipeSendDownViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/SiemensRecipeSendDownViewModel.cs @@ -2,7 +2,7 @@ using BPASmartClient.JXJFoodBigStation.Model; using BPASmartClient.JXJFoodBigStation.Model.Siemens; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/StockBinRawMaterialViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/StockBinRawMaterialViewModel.cs index 55a6f9c4..eb6c2dba 100644 --- a/BPASmartClient.JXJFoodBigStation/ViewModel/StockBinRawMaterialViewModel.cs +++ b/BPASmartClient.JXJFoodBigStation/ViewModel/StockBinRawMaterialViewModel.cs @@ -5,7 +5,7 @@ using BPA.Helper; using BPASmartClient.JXJFoodBigStation.Model; using BPASmartClient.JXJFoodBigStation.Model.HK_PLC; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ActionMenu.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ActionMenu.cs index e364507c..85f52f2f 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ActionMenu.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ActionMenu.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.JXJFoodSmallStation.Model { diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/BomOfMaterialViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/BomOfMaterialViewModel.cs index d6fa2688..fa7b1bb4 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/BomOfMaterialViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/BomOfMaterialViewModel.cs @@ -6,7 +6,7 @@ using BPASmartClient.JXJFoodSmallStation.Model; using BPASmartClient.JXJFoodSmallStation.Model.Bom; using BPASmartClient.JXJFoodSmallStation.Model.HK_PLC; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/ChangeDeviceNameViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/ChangeDeviceNameViewModel.cs index 928ce5cd..0b3877f2 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/ChangeDeviceNameViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/ChangeDeviceNameViewModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using BPA.Helper; using BPASmartClient.JXJFoodSmallStation.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.CustomResource.Pages.Model; namespace BPASmartClient.JXJFoodSmallStation.ViewModel diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceListViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceListViewModel.cs index 8816b176..464c513c 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceListViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceListViewModel.cs @@ -8,7 +8,7 @@ using System.Collections.Concurrent; using System.Collections.ObjectModel; using System.Windows; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.JXJFoodSmallStation.View; using BPASmartClient.JXJFoodSmallStation.Model; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceMaterialParViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceMaterialParViewModel.cs index 6243e1ae..a2581980 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceMaterialParViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceMaterialParViewModel.cs @@ -7,7 +7,7 @@ using BPA.Helper; using System.Collections.ObjectModel; using BPASmartClient.JXJFoodSmallStation.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.CustomResource.UserControls; using System.Diagnostics; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/HardwareStatusViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/HardwareStatusViewModel.cs index 63037652..0821a1f2 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/HardwareStatusViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/HardwareStatusViewModel.cs @@ -8,7 +8,7 @@ using System.Collections.Concurrent; using System.Collections.ObjectModel; using System.Windows; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.JXJFoodSmallStation.Model; namespace BPASmartClient.JXJFoodSmallStation.ViewModel diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualCommViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualCommViewModel.cs index 9d49b13b..a8c8df6e 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualCommViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualCommViewModel.cs @@ -7,7 +7,7 @@ using BPA.Helper; using System.Collections.ObjectModel; using BPASmartClient.JXJFoodSmallStation.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.CustomResource.UserControls; using System.Diagnostics; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualControlViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualControlViewModel.cs index a64b1bc9..4369b966 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualControlViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualControlViewModel.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using BPA.Helper; using System.Collections.ObjectModel; -using Microsoft.Toolkit.Mvvm.Input; + using BPA.Helper; using BPASmartClient.JXJFoodSmallStation.Model; using System.Threading; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs index 7dba9642..1e48242b 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs @@ -7,7 +7,7 @@ using BPA.Helper; using System.Collections.ObjectModel; using BPASmartClient.JXJFoodSmallStation.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.CustomResource.UserControls; using System.Diagnostics; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs index 8a67378d..3a234205 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs @@ -7,7 +7,7 @@ using BPA.Helper; using System.Collections.ObjectModel; using BPASmartClient.JXJFoodSmallStation.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.CustomResource.UserControls; using System.Diagnostics; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewMaterialViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewMaterialViewModel.cs index eaf0d5a8..6449fc7b 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewMaterialViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewMaterialViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.JXJFoodSmallStation.Model; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs index d4fe7204..50799f8b 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using BPA.Helper; using System.Collections.ObjectModel; -using Microsoft.Toolkit.Mvvm.Input; + using BPA.Helper; using BPASmartClient.JXJFoodSmallStation.Model; using BPASmartClient.CustomResource.Pages.Model; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeControlViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeControlViewModel.cs index 4844459a..ee128dbc 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeControlViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeControlViewModel.cs @@ -8,7 +8,7 @@ using System.Collections.Concurrent; using System.Collections.ObjectModel; using System.Windows; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.JXJFoodSmallStation.Model; using System.Threading; using BPASmartClient.CustomResource.Pages.Model; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs index 60396b28..7cf00dba 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using BPA.Helper; using System.Collections.ObjectModel; -using Microsoft.Toolkit.Mvvm.Input; + using BPA.Helper; using BPASmartClient.JXJFoodSmallStation.Model; using BPASmartClient.CustomResource.Pages.Model; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs index fae6079f..f2d77d2d 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs @@ -8,7 +8,7 @@ using System.Collections.Concurrent; using System.Collections.ObjectModel; using System.Windows; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.JXJFoodSmallStation.Model; using BPASmartClient.JXJFoodSmallStation.View; using BPASmartClient.CustomResource.UserControls; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeSettingsViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeSettingsViewModel.cs index d4a303c3..b452f419 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeSettingsViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeSettingsViewModel.cs @@ -8,7 +8,7 @@ using System.Collections.Concurrent; using System.Collections.ObjectModel; using System.Windows; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.JXJFoodSmallStation.Model; using BPASmartClient.JXJFoodSmallStation.View; using BPASmartClient.CustomResource.UserControls; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/RobotViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/RobotViewModel.cs index fdad0ae3..9521020a 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/RobotViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/RobotViewModel.cs @@ -7,7 +7,7 @@ using BPA.Helper; using System.Collections.ObjectModel; using BPASmartClient.JXJFoodSmallStation.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.CustomResource.UserControls; using System.Diagnostics; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/SelectRecipesViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/SelectRecipesViewModel.cs index 59f04a78..ab620067 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/SelectRecipesViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/SelectRecipesViewModel.cs @@ -3,7 +3,7 @@ using BPA.Helper; using BPASmartClient.JXJFoodSmallStation.Model; using BPASmartClient.JXJFoodSmallStation.Model.Siemens; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/SiemensRecipeReceiveViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/SiemensRecipeReceiveViewModel.cs index 4baa8748..ce1bad1d 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/SiemensRecipeReceiveViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/SiemensRecipeReceiveViewModel.cs @@ -8,7 +8,7 @@ using System.Collections.Concurrent; using System.Collections.ObjectModel; using System.Windows; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.JXJFoodSmallStation.Model; using BPASmartClient.JXJFoodSmallStation.View; using BPASmartClient.CustomResource.UserControls; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/StockBinRawMaterialViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/StockBinRawMaterialViewModel.cs index 33c3a0e2..7339c679 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/StockBinRawMaterialViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/StockBinRawMaterialViewModel.cs @@ -5,7 +5,7 @@ using BPA.Helper; using BPASmartClient.JXJFoodSmallStation.Model; using BPASmartClient.JXJFoodSmallStation.Model.RawMaterial; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/SystemParViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/SystemParViewModel.cs index e278e2d4..f59c6d5b 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/SystemParViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/SystemParViewModel.cs @@ -7,7 +7,7 @@ using BPA.Helper; using System.Collections.ObjectModel; using BPASmartClient.JXJFoodSmallStation.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.CustomResource.UserControls; using System.Diagnostics; diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/WindSendParViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/WindSendParViewModel.cs index b4e87868..dd8f5916 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/WindSendParViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/WindSendParViewModel.cs @@ -7,7 +7,7 @@ using BPA.Helper; using System.Collections.ObjectModel; using BPASmartClient.JXJFoodSmallStation.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.CustomResource.UserControls; using System.Diagnostics; diff --git a/BPASmartClient.Juicer/JuicerMachine.cs b/BPASmartClient.Juicer/JuicerMachine.cs index 610dd621..6f26cf60 100644 --- a/BPASmartClient.Juicer/JuicerMachine.cs +++ b/BPASmartClient.Juicer/JuicerMachine.cs @@ -3,7 +3,7 @@ using BPA.Helper; using BPASmartClient.Model; using BPASmartClient.Peripheral; using BPASmartClient.SerialPort; - +using static BPA.Helper.EventBus; namespace BPASmartClient.Juicer { @@ -32,7 +32,7 @@ namespace BPASmartClient.Juicer Thread.Sleep(1000); }), $"设备[{DeviceId}]果汁机读取线程", true); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; var par = @event as WriteJuicer; diff --git a/BPASmartClient.KHKJ/KHKJMachine.cs b/BPASmartClient.KHKJ/KHKJMachine.cs index 1defebb6..d29fb990 100644 --- a/BPASmartClient.KHKJ/KHKJMachine.cs +++ b/BPASmartClient.KHKJ/KHKJMachine.cs @@ -1,5 +1,5 @@ using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.SerialPort; using System; using System.Collections.Generic; diff --git a/BPASmartClient.KLMCoffee/CoffeeMachine.cs b/BPASmartClient.KLMCoffee/CoffeeMachine.cs index 99cf8a7d..59ce892b 100644 --- a/BPASmartClient.KLMCoffee/CoffeeMachine.cs +++ b/BPASmartClient.KLMCoffee/CoffeeMachine.cs @@ -1,7 +1,7 @@  using BPA.Helper; using BPASmartClient.KLMCoffee.Protocal; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.咖啡机.Enum; using BPASmartClient.Peripheral; @@ -12,7 +12,7 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; - +using static BPA.Helper.EventBus; namespace BPASmartClient.KLMCoffee { @@ -112,7 +112,7 @@ namespace BPASmartClient.KLMCoffee { byte item = dataStorage.GetData(); List data = new List() { item }; - if (Encoding.ASCII.GetString(data.ToArray()) == ":") + if (Encoding.ASCII.GetString(data.ToArray()) == ":") { temp.Add(item); while (dataStorage.GetSize() < 32) { Thread.Sleep(5); } @@ -127,7 +127,7 @@ namespace BPASmartClient.KLMCoffee //帧尾 //if (Encoding.ASCII.GetString(vs.ToArray()).ToLower() == "\\r\\n" || Encoding.ASCII.GetString(vs.ToArray()).ToLower() == "\r\n") var package = Encoding.ASCII.GetString(temp.ToArray()); - if(package.Contains("\\r\\n")) + if (package.Contains("\\r\\n")) { ProcessMsg(package); } @@ -147,10 +147,10 @@ namespace BPASmartClient.KLMCoffee if (systemStatus != null) { status["CoffeeIsConnected"] = OnLine; - if((K95SysTemStatus)status["CoffeeStatus"] == K95SysTemStatus.正在制作咖啡&&systemStatus.temStatus != K95SysTemStatus.正在制作咖啡) + if ((K95SysTemStatus)status["CoffeeStatus"] == K95SysTemStatus.正在制作咖啡 && systemStatus.temStatus != K95SysTemStatus.正在制作咖啡) { status["CoffeeStatus"] = systemStatus.temStatus; - EventBus.EventBus.GetInstance().Publish(new KLMCoffee_CoffeEndCookEvent { DeviceId = DeviceId }); + EventBus.GetInstance().Publish(new KLMCoffee_CoffeEndCookEvent { DeviceId = DeviceId }); } else status["CoffeeStatus"] = systemStatus.temStatus; status["CoffeedrinkType"] = systemStatus.drinkType; @@ -187,64 +187,64 @@ namespace BPASmartClient.KLMCoffee commProxy.SetDataStorage(dataStorage); //伽乐美咖啡机制作 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - try - { - free = true; - Thread.Sleep(300); - K95deFaultCoffeeEnum K95Code = (K95deFaultCoffeeEnum)((KLMCoffee_MakeCoffeeEvent)@event).KLMDrinkFaultCode; - //byte[] data = command.ReturnsCommandData(K95CommandEnum.配方咖啡制作.GetString(), new RecipeModel().Packe(((KLMCoffee_MakeCoffeeEvent)@event).DrinkCode)); - byte[] data = command.ReturnsCommandData(K95CommandEnum.咖啡制作.GetString(), K95Code.GetString()); - commProxy.SendData(data); - MessageLog.GetInstance.Show($"制作{K95Code}数据发送完成"); - Thread.Sleep(200); - free = false; - } - catch (Exception ex) - { - MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); - } - }); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + try + { + free = true; + Thread.Sleep(300); + K95deFaultCoffeeEnum K95Code = (K95deFaultCoffeeEnum)((KLMCoffee_MakeCoffeeEvent)@event).KLMDrinkFaultCode; + //byte[] data = command.ReturnsCommandData(K95CommandEnum.配方咖啡制作.GetString(), new RecipeModel().Packe(((KLMCoffee_MakeCoffeeEvent)@event).DrinkCode)); + byte[] data = command.ReturnsCommandData(K95CommandEnum.咖啡制作.GetString(), K95Code.GetString()); + commProxy.SendData(data); + MessageLog.GetInstance.Show($"制作{K95Code}数据发送完成"); + Thread.Sleep(200); + free = false; + } + catch (Exception ex) + { + MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); + } + }); //伽乐美咖啡机取消制作咖啡 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - try - { - free = true; - Thread.Sleep(200); - byte[] data = command.ReturnsCancelMake(); - commProxy.SendData(data); - Thread.Sleep(200); - free = false; - } - catch (Exception ex) - { - MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); - } - }); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + try + { + free = true; + Thread.Sleep(200); + byte[] data = command.ReturnsCancelMake(); + commProxy.SendData(data); + Thread.Sleep(200); + free = false; + } + catch (Exception ex) + { + MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); + } + }); //伽乐美咖啡机清洗冲泡器 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - try - { - free = true; - Thread.Sleep(200); - byte[] data = command.ReturnsWashCPJ(); - commProxy.SendData(data); - Thread.Sleep(200); - free = false; - } - catch (Exception ex) - { - MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); - } - }); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + try + { + free = true; + Thread.Sleep(200); + byte[] data = command.ReturnsWashCPJ(); + commProxy.SendData(data); + Thread.Sleep(200); + free = false; + } + catch (Exception ex) + { + MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); + } + }); //伽乐美咖啡机放杯确认 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { try { @@ -263,26 +263,26 @@ namespace BPASmartClient.KLMCoffee //伽乐美咖啡机清洗奶沫器 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - try - { - free = true; - Thread.Sleep(200); - byte[] data = command.ReturnsWashNMJ(); - commProxy.SendData(data); - Thread.Sleep(200); - free = false; - } - catch (Exception ex) - { - MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); - } - }); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + try + { + free = true; + Thread.Sleep(200); + byte[] data = command.ReturnsWashNMJ(); + commProxy.SendData(data); + Thread.Sleep(200); + free = false; + } + catch (Exception ex) + { + MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); + } + }); //伽乐美咖啡机清洗奶沫器确认 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { try { diff --git a/BPASmartClient.Lebai/LebaiRobot.cs b/BPASmartClient.Lebai/LebaiRobot.cs index 75e93903..fe73a251 100644 --- a/BPASmartClient.Lebai/LebaiRobot.cs +++ b/BPASmartClient.Lebai/LebaiRobot.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using Lebai.SDK; using Lebai.SDK.Dtos; using Robotc; -using BPASmartClient.Message; + using BPA.Helper; using TaskStatus = Lebai.SDK.Dtos.TaskStatus; using BPASmartClient.Peripheral; @@ -16,6 +16,7 @@ using BPASmartClient.Peripheral; using BPASmartClient.Model; using BPASmartClient.LebaiRobot; using BPASmartClient.Model.乐白机器人; +using static BPA.Helper.EventBus; namespace BPASmartClient.Lebai { @@ -48,7 +49,7 @@ namespace BPASmartClient.Lebai status["RobotIsConnected"] = LebaiHelper.GetInstance().IsConnected; status["RobotOK"] = LebaiHelper.GetInstance().GetValueAsync().Ok; status["RobotValue"] = LebaiHelper.GetInstance().GetValueAsync().Value; - if (LebaiHelper.GetInstance().robotData != null) status["RobotMode"] =(ELebaiRModel)LebaiHelper.GetInstance().robotData.RobotMode.Mode; + if (LebaiHelper.GetInstance().robotData != null) status["RobotMode"] = (ELebaiRModel)LebaiHelper.GetInstance().robotData.RobotMode.Mode; status["RobotValue1"] = LebaiHelper.GetInstance().GetValueAsync(1).Value; status["LeibaiGetTcpInput"] = LebaiHelper.GetInstance().GetTcpInput(0); status["LeibaiGetInput1"] = LebaiHelper.GetInstance().GetInput(0); @@ -68,12 +69,12 @@ namespace BPASmartClient.Lebai public override void Init() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { }); //获取机器人信号 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is LebaiRobot_GetInputEvent getInput) @@ -82,7 +83,7 @@ namespace BPASmartClient.Lebai } }); //获取Tcp信号 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is LebaiRobot_GetTCPInputEvent getTCPInput) @@ -91,7 +92,7 @@ namespace BPASmartClient.Lebai } }); //机器人输入信号 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is LebaiRobot_SetValueEvent SetValueEvent) @@ -100,7 +101,7 @@ namespace BPASmartClient.Lebai } }); //控制机器人 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is LebaiRobot_LebaiControlEvent lebaiControlEvent) @@ -132,7 +133,7 @@ namespace BPASmartClient.Lebai } }); //选择机器人场景 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is LebaiRobot_LebaiSenceEvent lebaiSenceEvent) @@ -141,12 +142,12 @@ namespace BPASmartClient.Lebai } }); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is LebaiRobot_SetOutPutEvent lebaiOutputEvent) { - LebaiHelper.GetInstance().SetOutput(lebaiOutputEvent.Value,lebaiOutputEvent.Pin); + LebaiHelper.GetInstance().SetOutput(lebaiOutputEvent.Value, lebaiOutputEvent.Pin); } }); @@ -157,8 +158,8 @@ namespace BPASmartClient.Lebai public override void WriteData(string address, object value) { - + } - + } } diff --git a/BPASmartClient.LebaiRobot/LebaiHelper.cs b/BPASmartClient.LebaiRobot/LebaiHelper.cs index 95e100ca..7576755d 100644 --- a/BPASmartClient.LebaiRobot/LebaiHelper.cs +++ b/BPASmartClient.LebaiRobot/LebaiHelper.cs @@ -1,5 +1,5 @@ using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model; using Lebai.SDK; using Lebai.SDK.Dtos; diff --git a/BPASmartClient.MCU/MCUMachine.cs b/BPASmartClient.MCU/MCUMachine.cs index 538d9eca..48630299 100644 --- a/BPASmartClient.MCU/MCUMachine.cs +++ b/BPASmartClient.MCU/MCUMachine.cs @@ -1,9 +1,10 @@  +using BPA.Helper; using BPASmartClient.Model.PLC; using BPASmartClient.Model.单片机; using BPASmartClient.Peripheral; using BPASmartClient.SerialPort; - +using static BPA.Helper.EventBus; namespace BPASmartClient.MCU { @@ -15,7 +16,7 @@ namespace BPASmartClient.MCU { mCUSerialHelper.Open(communicationPar.SerialPort, communicationPar.BaudRate); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; var par = @event as ReadMcu; @@ -25,7 +26,7 @@ namespace BPASmartClient.MCU } }); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; var par = @event as WriteMcu; diff --git a/BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs b/BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs index 1a9a4ec2..b082b973 100644 --- a/BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs +++ b/BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs @@ -1,11 +1,12 @@ using BPASmartClient.Peripheral; using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Modbus; using BPASmartClient.Model; using BPASmartClient.Model.PLC; +using static BPA.Helper.EventBus; namespace BPASmartClient.PLC { @@ -71,7 +72,7 @@ namespace BPASmartClient.PLC //写入数据 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; var par = @event as WriteModel; diff --git a/BPASmartClient.MilkTeaCube/MilkTeaCubeMachine.cs b/BPASmartClient.MilkTeaCube/MilkTeaCubeMachine.cs index bad4f9a2..24f2d641 100644 --- a/BPASmartClient.MilkTeaCube/MilkTeaCubeMachine.cs +++ b/BPASmartClient.MilkTeaCube/MilkTeaCubeMachine.cs @@ -4,52 +4,51 @@ using BPASmartClient.Modbus; using BPA.Helper; using System.Threading; using BPASmartClient.Model.̲ζħ; - - +using static BPA.Helper.EventBus; namespace BPASmartClient.MilkTeaCube { - public class MilkTeaCubeMachine: BasePeripheral + public class MilkTeaCubeMachine : BasePeripheral { - public ModbusTcp modbus =new ModbusTcp(); - public override void Init() + public ModbusTcp modbus = new ModbusTcp(); + public override void Init() { modbus.ModbusTcpConnect(communicationPar.IPAddress); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) - { - if (@event == null) return; - var par = @event as MilkTea_MakeMilkTeaEvent; - switch (par?.TagName) - { - case "Start": - modbus.Write("LB14", true); - Thread.Sleep(200); - modbus.Write("LB14", false); + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + { + if (@event == null) return; + var par = @event as MilkTea_MakeMilkTeaEvent; + switch (par?.TagName) + { + case "Start": + modbus.Write("LB14", true); + Thread.Sleep(200); + modbus.Write("LB14", false); - break; - case "ParameterSet": - modbus.Write("LB14", false); - Thread.Sleep(500); - modbus.Write("LW1001", par.MilkTeaKind[0]); - modbus.Write("LW1003", par.MilkTeaKind[1]); - modbus.Write("LW1004", par.MilkTeaKind[2]); - modbus.Write("LW1005", par.MilkTeaKind[3]); - modbus.Write("LW1006", par.MilkTeaKind[4]); - modbus.Write("LW1007", par.MilkTeaKind[5]); - modbus.Write("LW1008", par.MilkTeaKind[6]); - modbus.Write("LW1009", par.MilkTeaKind[7]); - modbus.Write("LW1010", par.MilkTeaKind[8]); - modbus.Write("LW1011", par.MilkTeaKind[9]); - modbus.Write("LW1012", par.MilkTeaKind[10]); - modbus.Write("LW1013", par.MilkTeaKind[11]); - break; - case "StartSignReset": - modbus.Write("LB14", false); - break; - default: - break; - } - }); + break; + case "ParameterSet": + modbus.Write("LB14", false); + Thread.Sleep(500); + modbus.Write("LW1001", par.MilkTeaKind[0]); + modbus.Write("LW1003", par.MilkTeaKind[1]); + modbus.Write("LW1004", par.MilkTeaKind[2]); + modbus.Write("LW1005", par.MilkTeaKind[3]); + modbus.Write("LW1006", par.MilkTeaKind[4]); + modbus.Write("LW1007", par.MilkTeaKind[5]); + modbus.Write("LW1008", par.MilkTeaKind[6]); + modbus.Write("LW1009", par.MilkTeaKind[7]); + modbus.Write("LW1010", par.MilkTeaKind[8]); + modbus.Write("LW1011", par.MilkTeaKind[9]); + modbus.Write("LW1012", par.MilkTeaKind[10]); + modbus.Write("LW1013", par.MilkTeaKind[11]); + break; + case "StartSignReset": + modbus.Write("LB14", false); + break; + default: + break; + } + }); ThreadManage.GetInstance().StartLong(new Action(() => { IsConnected = modbus.Connected; diff --git a/BPASmartClient.MilkWithTea/MainWindow.xaml.cs b/BPASmartClient.MilkWithTea/MainWindow.xaml.cs index e6e093f2..f2a56017 100644 --- a/BPASmartClient.MilkWithTea/MainWindow.xaml.cs +++ b/BPASmartClient.MilkWithTea/MainWindow.xaml.cs @@ -4,7 +4,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.Device; using BPA.Helper; using BPASmartClient.IoT; -using BPASmartClient.Message; + using BPASmartClient.Peripheral; using BPASmartClient.ViewModel; using Newtonsoft.Json; diff --git a/BPASmartClient.MilkWithTea/ViewModel/MainControlViewModel.cs b/BPASmartClient.MilkWithTea/ViewModel/MainControlViewModel.cs index 2d503e0c..caab85c8 100644 --- a/BPASmartClient.MilkWithTea/ViewModel/MainControlViewModel.cs +++ b/BPASmartClient.MilkWithTea/ViewModel/MainControlViewModel.cs @@ -1,7 +1,7 @@  global using CommunityToolkit.Mvvm.Input; using BPA.Helper; -using BPASmartClient.Message; + namespace BPASmartClient.MilkWithTea.ViewModel { @@ -176,7 +176,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel }), "AddOrder"); - EventBus.EventBus.GetInstance().Subscribe(0, OrderStatusChangedHandle); + EventBus.GetInstance().Subscribe(0, OrderStatusChangedHandle); ActionManage.GetInstance.Register(new Action((o)=> { @@ -194,7 +194,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel } - private void OrderStatusChangedHandle(IEvent @event, EventBus.EventBus.EventCallBackHandle callBack) + private void OrderStatusChangedHandle(IEvent @event, EventBus.EventCallBackHandle callBack) { OrderStatusChangedEvent orderStatusChange = @event as OrderStatusChangedEvent; int index = Array.FindIndex(orderStatusLists.ToArray(), p => p.OrderPush.SuborderId == orderStatusChange.SubOrderId); diff --git a/BPASmartClient.MilkWithTea/ViewModel/PatrameterSettiongViewModel.cs b/BPASmartClient.MilkWithTea/ViewModel/PatrameterSettiongViewModel.cs index ec2d7c33..783a64c9 100644 --- a/BPASmartClient.MilkWithTea/ViewModel/PatrameterSettiongViewModel.cs +++ b/BPASmartClient.MilkWithTea/ViewModel/PatrameterSettiongViewModel.cs @@ -1,5 +1,5 @@ using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model; using CommunityToolkit.Mvvm.Input; using Newtonsoft.Json; diff --git a/BPASmartClient.MorkBF/Control_MorkBF.cs b/BPASmartClient.MorkBF/Control_MorkBF.cs index 7f3f5161..ac6b74d1 100644 --- a/BPASmartClient.MorkBF/Control_MorkBF.cs +++ b/BPASmartClient.MorkBF/Control_MorkBF.cs @@ -4,7 +4,7 @@ using BPASmartClient.Business; using BPASmartClient.Device; using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.大炒; using BPASmartClient.MorkBF.Model; @@ -58,7 +58,7 @@ namespace BPASmartClient.MorkBF private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -73,7 +73,7 @@ namespace BPASmartClient.MorkBF private void ServerInit() { //物料信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -83,7 +83,7 @@ namespace BPASmartClient.MorkBF }); //配方数据信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is RecipeBomEvent recipe) diff --git a/BPASmartClient.MorkF/Control_MorkF.cs b/BPASmartClient.MorkF/Control_MorkF.cs index 9c345806..a5285771 100644 --- a/BPASmartClient.MorkF/Control_MorkF.cs +++ b/BPASmartClient.MorkF/Control_MorkF.cs @@ -4,7 +4,7 @@ using BPA.Message.Enum; using BPASmartClient.Device; using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.PLC; using BPA.Models; @@ -2257,7 +2257,7 @@ namespace BPASmartClient.MorkF private void ServerInit() { //物料信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -2268,7 +2268,7 @@ namespace BPASmartClient.MorkF }); //配方数据信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is RecipeBomEvent recipe) @@ -2277,7 +2277,7 @@ namespace BPASmartClient.MorkF } }); //小炒流程信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callback) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callback) { if (@event == null) return; if (@event is StirFryGoodsEvent stirFry) @@ -2432,7 +2432,7 @@ namespace BPASmartClient.MorkF /// private void OrderChange(string Id , string goodName, ORDER_STATUS oRDER_STATUS,int deviceId) { - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, GoodName = goodName,DeviceId = deviceId, SubOrderId =Id }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, GoodName = goodName,DeviceId = deviceId, SubOrderId =Id }); } /// @@ -2445,7 +2445,7 @@ namespace BPASmartClient.MorkF // return; //} - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) diff --git a/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs index 2a9fcf4c..e1876535 100644 --- a/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.Device; using BPA.Helper; using BPASmartClient.MorkF.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.MorkF/ViewModel/LocalMenuViewModel.cs b/BPASmartClient.MorkF/ViewModel/LocalMenuViewModel.cs index 2113abfe..6008cfd3 100644 --- a/BPASmartClient.MorkF/ViewModel/LocalMenuViewModel.cs +++ b/BPASmartClient.MorkF/ViewModel/LocalMenuViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.Model.小炒机; using BPASmartClient.MorkF.Model; using BPASmartClient.ViewModel; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.MorkF/ViewModel/MaterialCalibrationViewModel.cs b/BPASmartClient.MorkF/ViewModel/MaterialCalibrationViewModel.cs index d866bc71..5f5ce179 100644 --- a/BPASmartClient.MorkF/ViewModel/MaterialCalibrationViewModel.cs +++ b/BPASmartClient.MorkF/ViewModel/MaterialCalibrationViewModel.cs @@ -2,7 +2,7 @@ using BPASmartClient.MorkF.Model; using Google.Protobuf.WellKnownTypes; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Linq; diff --git a/BPASmartClient.MorkM/Control_MORKM.cs b/BPASmartClient.MorkM/Control_MORKM.cs index 24d076a5..b2f12992 100644 --- a/BPASmartClient.MorkM/Control_MORKM.cs +++ b/BPASmartClient.MorkM/Control_MORKM.cs @@ -145,7 +145,7 @@ namespace BPASmartClient.MorkM ///// public void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -386,13 +386,13 @@ namespace BPASmartClient.MorkM { values.Add(2);//分 values.Add(0);//秒 - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = $"VW{ 116 + (loc * 6) }", Value = values.ToArray() }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = $"VW{ 116 + (loc * 6) }", Value = values.ToArray() }); } else //荤菜 { values.Add(4);//分 values.Add(0);//秒 - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = $"VW{ 116 + (loc * 6) }", Value = values.ToArray() }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = $"VW{ 116 + (loc * 6) }", Value = values.ToArray() }); } @@ -777,7 +777,7 @@ namespace BPASmartClient.MorkM public void CookComplete() { ////ModbusTcpHelper.GetInstance.Write((ushort)ModbusTcpHelper.GetInstance.GetBoolAddress("M0.6"), WriteType.Coils, true); - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = "M0.6", Value = true }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = "M0.6", Value = true }); } /// @@ -786,13 +786,13 @@ namespace BPASmartClient.MorkM public void AddSoup() { ////ModbusTcpHelper.GetInstance.Write((ushort)ModbusTcpHelper.GetInstance.GetBoolAddress("M0.7"), WriteType.Coils, true); - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = "M0.7", Value = true }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = "M0.7", Value = true }); } private void ServerInit() { //物料信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -803,7 +803,7 @@ namespace BPASmartClient.MorkM //配方数据信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is RecipeBomEvent recipe) @@ -852,7 +852,7 @@ namespace BPASmartClient.MorkM } private void WriteData(string address, object value) { - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); } public override void ResetProgram() { @@ -881,7 +881,7 @@ namespace BPASmartClient.MorkM goodName = res.MorkOrder.GoodsName; SortNum = res.MorkOrder.SortNum.ToString(); } - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); } diff --git a/BPASmartClient.MorkM/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkM/ViewModel/DebugViewModel.cs index a2891180..990dffc9 100644 --- a/BPASmartClient.MorkM/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkM/ViewModel/DebugViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.Model; using BPASmartClient.MorkM.Model; using BPASmartClient.MorkM.View; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.MorkM/ViewModel/SimOrderConfitViewModel.cs b/BPASmartClient.MorkM/ViewModel/SimOrderConfitViewModel.cs index a625df3c..7e1ecf50 100644 --- a/BPASmartClient.MorkM/ViewModel/SimOrderConfitViewModel.cs +++ b/BPASmartClient.MorkM/ViewModel/SimOrderConfitViewModel.cs @@ -2,7 +2,7 @@ using BPASmartClient.Model; using BPASmartClient.MorkM.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Linq; diff --git a/BPASmartClient.MorkMOC/Control_MorkMOC.cs b/BPASmartClient.MorkMOC/Control_MorkMOC.cs index 0039208d..73f14073 100644 --- a/BPASmartClient.MorkMOC/Control_MorkMOC.cs +++ b/BPASmartClient.MorkMOC/Control_MorkMOC.cs @@ -32,7 +32,7 @@ namespace BPASmartClient.MorkMOC private void ServerInit() { //物料信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -42,7 +42,7 @@ namespace BPASmartClient.MorkMOC }); //配方数据信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is RecipeBomEvent recipe) @@ -54,7 +54,7 @@ namespace BPASmartClient.MorkMOC private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -94,7 +94,7 @@ namespace BPASmartClient.MorkMOC var res = morkMoc.doOrderEvents.FirstOrDefault(p => p.MorkOrder.SuborderId == subid); string goodName = string.Empty; string SortNum = string.Empty; - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = res.MorkOrder.SortNum.ToString(), GoodName = res.MorkOrder.GoodsName, diff --git a/BPASmartClient.MorkMV1/Control_MorkMV1.cs b/BPASmartClient.MorkMV1/Control_MorkMV1.cs index a5fe5ecd..236428d9 100644 --- a/BPASmartClient.MorkMV1/Control_MorkMV1.cs +++ b/BPASmartClient.MorkMV1/Control_MorkMV1.cs @@ -8,7 +8,7 @@ using BPASmartClient.Peripheral; using BPA.Helper; using System.Threading; -using BPASmartClient.Message; + using BPA.Message; using System.Linq; using BPASmartClient.Model.PLC; @@ -106,7 +106,7 @@ namespace BPASmartClient.MorkMV1 private void ServerInit() { //物料信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -116,7 +116,7 @@ namespace BPASmartClient.MorkMV1 }); //配方数据信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is RecipeBomEvent recipe) @@ -140,7 +140,7 @@ namespace BPASmartClient.MorkMV1 } if (!string.IsNullOrEmpty(goodName) && !string.IsNullOrEmpty(SortNum)) { - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); var index = DataServer.GetInstance.morkS.MakeOrder.FindIndex(p => p.SortNum == SortNum); if (index >= 0 && index < DataServer.GetInstance.morkS.MakeOrder.Count) { @@ -334,7 +334,7 @@ namespace BPASmartClient.MorkMV1 /// private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -838,7 +838,7 @@ namespace BPASmartClient.MorkMV1 private void WriteData(string address, object value) { - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); } /// @@ -914,7 +914,7 @@ namespace BPASmartClient.MorkMV1 public override void SimOrder() { - EventBus.EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event != null && @event is MorksSimorderModel msm) { diff --git a/BPASmartClient.MorkMV1/GlobalUsing.cs b/BPASmartClient.MorkMV1/GlobalUsing.cs index 631505a7..ea1dff3f 100644 --- a/BPASmartClient.MorkMV1/GlobalUsing.cs +++ b/BPASmartClient.MorkMV1/GlobalUsing.cs @@ -8,7 +8,7 @@ global using BPASmartClient.Peripheral; global global using BPA.Helper; global using System.Threading; -global using BPASmartClient.Message; +global global using BPA.Message; global using System.Linq; global using BPASmartClient.Model.PLC; diff --git a/BPASmartClient.MorkMV1/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkMV1/ViewModel/DebugViewModel.cs index 66458a25..f28f4676 100644 --- a/BPASmartClient.MorkMV1/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkMV1/ViewModel/DebugViewModel.cs @@ -6,11 +6,11 @@ using System.Threading.Tasks; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.MorkMV1.Model; using System.Windows; -using BPASmartClient.Message; + namespace BPASmartClient.MorkMV1.ViewModel { diff --git a/BPASmartClient.MorkMV1/ViewModel/ParSetViewModel.cs b/BPASmartClient.MorkMV1/ViewModel/ParSetViewModel.cs index 0c865ca9..0358bd06 100644 --- a/BPASmartClient.MorkMV1/ViewModel/ParSetViewModel.cs +++ b/BPASmartClient.MorkMV1/ViewModel/ParSetViewModel.cs @@ -8,7 +8,7 @@ using BPA.Helper; using BPASmartClient.Model; using BPASmartClient.MorkMV1.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.MorkMV1.ViewModel { diff --git a/BPASmartClient.MorkMW/Control_MorkMW.cs b/BPASmartClient.MorkMW/Control_MorkMW.cs index 35921ad6..e87daed6 100644 --- a/BPASmartClient.MorkMW/Control_MorkMW.cs +++ b/BPASmartClient.MorkMW/Control_MorkMW.cs @@ -57,7 +57,7 @@ namespace BPASmartClient.MorkMW private void ServerInit() { //䷽Ϣ - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MorkMWGoodsEvent recipe) @@ -348,7 +348,7 @@ namespace BPASmartClient.MorkMW public override void SimOrder() { - EventBus.EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event != null && @event is MorkMWSimOrder order) @@ -386,14 +386,14 @@ namespace BPASmartClient.MorkMW /// private void WriteData(string address, object value) { - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); } /// /// ݽ /// public void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event != null && @event is DoOrderEvent order) @@ -437,7 +437,7 @@ namespace BPASmartClient.MorkMW SortNum = res.MorkOrder.SortNum.ToString(); } - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); } catch (Exception) { diff --git a/BPASmartClient.MorkMW/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkMW/ViewModel/DebugViewModel.cs index ec886bf1..8e3fa178 100644 --- a/BPASmartClient.MorkMW/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkMW/ViewModel/DebugViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.Model; using BPASmartClient.Model.订单; using BPASmartClient.MorkMW.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Linq; diff --git a/BPASmartClient.MorkS/Control_Morks.cs b/BPASmartClient.MorkS/Control_Morks.cs index ec9f9714..fa6fede7 100644 --- a/BPASmartClient.MorkS/Control_Morks.cs +++ b/BPASmartClient.MorkS/Control_Morks.cs @@ -8,7 +8,7 @@ using BPASmartClient.Peripheral; using BPA.Helper; using System.Threading; -using BPASmartClient.Message; + using BPA.Message; using System.Linq; using BPASmartClient.Model.PLC; @@ -104,7 +104,7 @@ namespace BPASmartClient.MorkS private void ServerInit() { //物料信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -114,7 +114,7 @@ namespace BPASmartClient.MorkS }); //配方数据信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is RecipeBomEvent recipe) @@ -144,7 +144,7 @@ namespace BPASmartClient.MorkS //SortNum = mORKS.doe[subid].MorkOrder.SortNum.ToString(); if (!string.IsNullOrEmpty(goodName) && !string.IsNullOrEmpty(SortNum)) { - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); var index = DataServer.GetInstance.morkS.MakeOrder.FindIndex(p => p.SortNum == SortNum); if (index >= 0 && index < DataServer.GetInstance.morkS.MakeOrder.Count) { @@ -325,7 +325,7 @@ namespace BPASmartClient.MorkS /// private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -749,7 +749,7 @@ namespace BPASmartClient.MorkS private void WriteData(string address, object value) { - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); } /// @@ -910,7 +910,7 @@ namespace BPASmartClient.MorkS public override void SimOrder() { - EventBus.EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event != null && @event is MorksSimorderModel msm) { diff --git a/BPASmartClient.MorkS/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkS/ViewModel/DebugViewModel.cs index 6023904d..0dc55ecd 100644 --- a/BPASmartClient.MorkS/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkS/ViewModel/DebugViewModel.cs @@ -6,11 +6,11 @@ using System.Threading.Tasks; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.MorkS.Model; using System.Windows; -using BPASmartClient.Message; + namespace BPASmartClient.MorkS.ViewModel { diff --git a/BPASmartClient.MorkS/ViewModel/ParSetViewModel.cs b/BPASmartClient.MorkS/ViewModel/ParSetViewModel.cs index 8df7f2f8..3528cbff 100644 --- a/BPASmartClient.MorkS/ViewModel/ParSetViewModel.cs +++ b/BPASmartClient.MorkS/ViewModel/ParSetViewModel.cs @@ -9,7 +9,7 @@ using BPA.Helper; using BPASmartClient.Model; using BPASmartClient.MorkS.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using Org.BouncyCastle.Utilities; namespace BPASmartClient.MorkS.ViewModel diff --git a/BPASmartClient.MorkS/VoiceAPI.cs b/BPASmartClient.MorkS/VoiceAPI.cs index 9608396e..12ff63aa 100644 --- a/BPASmartClient.MorkS/VoiceAPI.cs +++ b/BPASmartClient.MorkS/VoiceAPI.cs @@ -1,4 +1,4 @@ -//using BPASmartClient.Message; +// //using System; //using System.Collections.Concurrent; //using System.Collections.Generic; diff --git a/BPASmartClient.MorkS3/Control_Morks.cs b/BPASmartClient.MorkS3/Control_Morks.cs index d899280d..698ba3a4 100644 --- a/BPASmartClient.MorkS3/Control_Morks.cs +++ b/BPASmartClient.MorkS3/Control_Morks.cs @@ -8,7 +8,7 @@ using BPASmartClient.Peripheral; using BPA.Helper; using System.Threading; -using BPASmartClient.Message; + using BPA.Message; using System.Linq; using BPASmartClient.Model.PLC; @@ -103,7 +103,7 @@ namespace BPASmartClient.MorkS3 private void ServerInit() { //物料信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -113,7 +113,7 @@ namespace BPASmartClient.MorkS3 }); //配方数据信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is RecipeBomEvent recipe) @@ -137,7 +137,7 @@ namespace BPASmartClient.MorkS3 SortNum = res.MorkOrder.SortNum.ToString(); } - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); var index = DataServer.GetInstance.morkS.MakeOrder.FindIndex(p => p.SortNum == SortNum); if (index >= 0 && index < DataServer.GetInstance.morkS.MakeOrder.Count) @@ -327,7 +327,7 @@ namespace BPASmartClient.MorkS3 /// private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -714,7 +714,7 @@ namespace BPASmartClient.MorkS3 private void WriteData(string address, object value) { - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); } /// @@ -864,7 +864,7 @@ namespace BPASmartClient.MorkS3 public override void SimOrder() { - EventBus.EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event != null && @event is MorksSimorderModel msm) { diff --git a/BPASmartClient.MorkS3/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkS3/ViewModel/DebugViewModel.cs index 29ee3374..e09cc384 100644 --- a/BPASmartClient.MorkS3/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkS3/ViewModel/DebugViewModel.cs @@ -6,11 +6,11 @@ using System.Threading.Tasks; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.MorkS3.Model; using System.Windows; -using BPASmartClient.Message; + namespace BPASmartClient.MorkS3.ViewModel { diff --git a/BPASmartClient.MorkS3/ViewModel/ParSetViewModel.cs b/BPASmartClient.MorkS3/ViewModel/ParSetViewModel.cs index d46e178e..1a52ad60 100644 --- a/BPASmartClient.MorkS3/ViewModel/ParSetViewModel.cs +++ b/BPASmartClient.MorkS3/ViewModel/ParSetViewModel.cs @@ -8,7 +8,7 @@ using BPA.Helper; using BPASmartClient.Model; using BPASmartClient.MorkS3.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.MorkS3.ViewModel { diff --git a/BPASmartClient.MorkS3/VoiceAPI.cs b/BPASmartClient.MorkS3/VoiceAPI.cs index 6b4e057c..c1cf23c0 100644 --- a/BPASmartClient.MorkS3/VoiceAPI.cs +++ b/BPASmartClient.MorkS3/VoiceAPI.cs @@ -1,4 +1,4 @@ -using BPASmartClient.Message; + using System; using System.Collections.Generic; using System.Linq; diff --git a/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer - 复制.cs b/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer - 复制.cs index 8b0c121d..447f4756 100644 --- a/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer - 复制.cs +++ b/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer - 复制.cs @@ -8,7 +8,7 @@ // //using BPA.Helper; //using System.Threading; -//using BPASmartClient.Message; +// //using BPA.Message; //using System.Linq; //using BPASmartClient.Model.PLC; @@ -104,7 +104,7 @@ // private void ServerInit() // { // //物料信息 -// EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) +// EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) // { // if (@event == null) return; // if (@event is MaterialDeliveryEvent material) @@ -114,7 +114,7 @@ // }); // //配方数据信息 -// EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) +// EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) // { // if (@event == null) return; // if (@event is RecipeBomEvent recipe) @@ -143,7 +143,7 @@ // // SortNum = mORKS.doe[subid].MorkOrder.SortNum.ToString(); // if (!string.IsNullOrEmpty(goodName) && !string.IsNullOrEmpty(SortNum)) // { -// EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); +// EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); // var index = DataServer.GetInstance.morkS.MakeOrder.FindIndex(p => p.SortNum == SortNum); // if (index >= 0 && index < DataServer.GetInstance.morkS.MakeOrder.Count) // { @@ -193,7 +193,7 @@ // // SortNum = res.MorkOrder.SortNum.ToString(); // //} -// //EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); +// //EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); // //var index = DataServer.GetInstance.morkS.MakeOrder.FindIndex(p => p.SortNum == SortNum); // //if (index >= 0 && index < DataServer.GetInstance.morkS.MakeOrder.Count) @@ -393,7 +393,7 @@ // /// // private void DataParse() // { -// EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) +// EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) // { // if (@event == null) return; // if (@event is DoOrderEvent order) @@ -779,7 +779,7 @@ // private void WriteData(string address, object value) // { -// EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); +// EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); // } // /// @@ -847,7 +847,7 @@ // public override void SimOrder() // { -// EventBus.EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) +// EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) // { // if (@event != null && @event is MorksSimorderModel msm) // { diff --git a/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs b/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs index 64fd7de5..2bdaea8e 100644 --- a/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs +++ b/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs @@ -8,7 +8,7 @@ using BPASmartClient.Peripheral; using BPA.Helper; using System.Threading; -using BPASmartClient.Message; + using BPA.Message; using System.Linq; using BPASmartClient.Model.PLC; @@ -104,7 +104,7 @@ namespace BPASmartClient.MorkSUpgradedVer private void ServerInit() { //物料信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -114,7 +114,7 @@ namespace BPASmartClient.MorkSUpgradedVer }); //配方数据信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is RecipeBomEvent recipe) @@ -143,7 +143,7 @@ namespace BPASmartClient.MorkSUpgradedVer // SortNum = mORKS.doe[subid].MorkOrder.SortNum.ToString(); if (!string.IsNullOrEmpty(goodName) && !string.IsNullOrEmpty(SortNum)) { - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); var index = DataServer.GetInstance.morkS.MakeOrder.FindIndex(p => p.SortNum == SortNum); if (index >= 0 && index < DataServer.GetInstance.morkS.MakeOrder.Count) { @@ -193,7 +193,7 @@ namespace BPASmartClient.MorkSUpgradedVer // SortNum = res.MorkOrder.SortNum.ToString(); //} - //EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + //EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); //var index = DataServer.GetInstance.morkS.MakeOrder.FindIndex(p => p.SortNum == SortNum); //if (index >= 0 && index < DataServer.GetInstance.morkS.MakeOrder.Count) @@ -393,7 +393,7 @@ namespace BPASmartClient.MorkSUpgradedVer /// private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -812,7 +812,7 @@ namespace BPASmartClient.MorkSUpgradedVer private void WriteData(string address, object value) { - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); } /// @@ -880,7 +880,7 @@ namespace BPASmartClient.MorkSUpgradedVer public override void SimOrder() { - EventBus.EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event != null && @event is MorksSimorderModel msm) { diff --git a/BPASmartClient.MorkSUpgradedVer/GlobalUsing.cs b/BPASmartClient.MorkSUpgradedVer/GlobalUsing.cs index f14ef59d..01f8a5af 100644 --- a/BPASmartClient.MorkSUpgradedVer/GlobalUsing.cs +++ b/BPASmartClient.MorkSUpgradedVer/GlobalUsing.cs @@ -8,7 +8,7 @@ global using BPASmartClient.Peripheral; global global using BPA.Helper; global using System.Threading; -global using BPASmartClient.Message; +global global using BPA.Message; global using System.Linq; global using BPASmartClient.Model.PLC; diff --git a/BPASmartClient.MorkSUpgradedVer/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkSUpgradedVer/ViewModel/DebugViewModel.cs index 73516285..26f2cd8a 100644 --- a/BPASmartClient.MorkSUpgradedVer/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkSUpgradedVer/ViewModel/DebugViewModel.cs @@ -6,11 +6,11 @@ using System.Threading.Tasks; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.MorkSUpgradedVer.Model; using System.Windows; -using BPASmartClient.Message; + namespace BPASmartClient.MorkSUpgradedVer.ViewModel { diff --git a/BPASmartClient.MorkSUpgradedVer/ViewModel/ParSetViewModel.cs b/BPASmartClient.MorkSUpgradedVer/ViewModel/ParSetViewModel.cs index 02059990..f43ed8a2 100644 --- a/BPASmartClient.MorkSUpgradedVer/ViewModel/ParSetViewModel.cs +++ b/BPASmartClient.MorkSUpgradedVer/ViewModel/ParSetViewModel.cs @@ -8,7 +8,7 @@ using BPA.Helper; using BPASmartClient.Model; using BPASmartClient.MorkSUpgradedVer.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.MorkSUpgradedVer.ViewModel { diff --git a/BPASmartClient.MorkT.Lebai.JC/Control_MORKJC2.cs b/BPASmartClient.MorkT.Lebai.JC/Control_MORKJC2.cs index cf22c209..8145957b 100644 --- a/BPASmartClient.MorkT.Lebai.JC/Control_MORKJC2.cs +++ b/BPASmartClient.MorkT.Lebai.JC/Control_MORKJC2.cs @@ -14,7 +14,7 @@ using BPASmartClient.Model.咖啡机.Enum; using BPASmartClient.Model; -using BPASmartClient.Message; + using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.单片机; @@ -59,7 +59,7 @@ namespace BPASmartClient.MorkTLebaiJC private void serverInit() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -71,7 +71,7 @@ namespace BPASmartClient.MorkTLebaiJC private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -178,7 +178,7 @@ namespace BPASmartClient.MorkTLebaiJC DateTime delayTimeOut_Juice; public override void MainTask() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (morkTLebaiJC.IsHaveCoffeeCup) morkTLebaiJC.MakeCoffeeEnd = true; @@ -251,7 +251,7 @@ namespace BPASmartClient.MorkTLebaiJC /// private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) { - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); } /// /// 验证商品是做的某种饮料 diff --git a/BPASmartClient.MorkT.Lebai.JC/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkT.Lebai.JC/ViewModel/DebugViewModel.cs index 8f2d6118..cca39553 100644 --- a/BPASmartClient.MorkT.Lebai.JC/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkT.Lebai.JC/ViewModel/DebugViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.DRCoffee; using BPASmartClient.GSIceCream; using BPA.Helper; using BPASmartClient.LebaiRobot; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.冰淇淋.Enum; @@ -13,7 +13,7 @@ using BPASmartClient.Model.单片机; using BPASmartClient.Model.单片机.Enum; using BPASmartClient.Model.咖啡机.Enum; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -44,7 +44,7 @@ namespace BPASmartClient.MorkTLebaiJC.ViewModel; /// private void Button_RobotControl(object o) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); } #endregion @@ -111,15 +111,15 @@ namespace BPASmartClient.MorkTLebaiJC.ViewModel; private void Button_MakeCoffee() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee)}); + EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee)}); } private void Button_StopMakeCoffe() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); + EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); } private void Button_CoffeeModeSet() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd)}); + EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd)}); } #endregion diff --git a/BPASmartClient.MorkT.Lebai.JC/ViewModel/MonitorViewModel.cs b/BPASmartClient.MorkT.Lebai.JC/ViewModel/MonitorViewModel.cs index f854f4db..93f64ee0 100644 --- a/BPASmartClient.MorkT.Lebai.JC/ViewModel/MonitorViewModel.cs +++ b/BPASmartClient.MorkT.Lebai.JC/ViewModel/MonitorViewModel.cs @@ -50,7 +50,7 @@ namespace BPASmartClient.MorkTLebaiJC.ViewModel }); ThreadManage.GetInstance().StartLong(new Action(() => { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> + EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> { if(res != null&& res.Length>0&& res[0] is bool b) { @@ -58,7 +58,7 @@ namespace BPASmartClient.MorkTLebaiJC.ViewModel } }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (res) => { if (res != null && res.Length > 0 && res[0] is bool b) { @@ -66,7 +66,7 @@ namespace BPASmartClient.MorkTLebaiJC.ViewModel } }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 3 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 3 }, (res) => { if (res != null && res.Length > 0 && res[0] is bool b) { diff --git a/BPASmartClient.MorkT/Control_MorkT.cs b/BPASmartClient.MorkT/Control_MorkT.cs index b14c0306..20a5a38f 100644 --- a/BPASmartClient.MorkT/Control_MorkT.cs +++ b/BPASmartClient.MorkT/Control_MorkT.cs @@ -6,7 +6,7 @@ using BPASmartClient.GSIceCream; using BPA.Helper; using BPASmartClient.Lebai; using BPASmartClient.LebaiRobot; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.乐白机器人.Enum; @@ -43,13 +43,13 @@ namespace BPASmartClient.MorkT IsHealth = true; ServerInit(); DataParse(); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (morkT.MakeCoffeeOrder != null) morkT.MakeCoffeeOrder.OrderStatus = 1; }); int i = 0; - EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); + EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); PreventSleep.SleepControl(true);//防止电脑休眠 MessageLog.GetInstance.Show("MORKT 设备初始化完成"); } @@ -79,10 +79,10 @@ namespace BPASmartClient.MorkT // if ((ELebaiRModel)peripheralStatus["RobotMode"] == ELebaiRModel.空闲状态) // { // MessageLog.GetInstance.Show("机器人开始自嗨!"); - // EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); - // EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_自嗨 }); + // EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); + // EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_自嗨 }); // Wait(); - // EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + // EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); // Thread.Sleep(50); // } //} @@ -90,7 +90,7 @@ namespace BPASmartClient.MorkT #region morkt流程 if (morkT.waitMorkOrder != null)//更新订单取走状态 { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (o) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (o) => { if (o != null && o.Length > 0 && o[0] is bool res) { @@ -104,7 +104,7 @@ namespace BPASmartClient.MorkT }); } MakeCoffeeProcess(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 }, (o) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 }, (o) => { if (o != null && o.Length > 0 && o[0] is bool resultValue) { @@ -271,7 +271,7 @@ namespace BPASmartClient.MorkT private void ServerInit() { //物料信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -281,7 +281,7 @@ namespace BPASmartClient.MorkT }); //配方数据信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is RecipeBomEvent recipe) @@ -296,7 +296,7 @@ namespace BPASmartClient.MorkT /// private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -383,7 +383,7 @@ namespace BPASmartClient.MorkT /// private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) { - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); } private void Wait(int value = 101) @@ -417,10 +417,10 @@ namespace BPASmartClient.MorkT DeviceProcessLogShow($"开始制作 [咖啡] 订单[{orderLoc.SortNum}]"); GetAndCheeckCoffe(orderLoc);//取咖啡杯 if (!morkT.GetCoffeeCup) return; - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_接咖啡后回原点 }); //接咖啡后回原点 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_接咖啡后回原点 }); //接咖啡后回原点 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); - EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() {DeviceId = DeviceId, DrinkCode = (BPASmartClient.Model.咖啡机.Enum.DrCoffeeDrinksCode)int.Parse(orderLoc.Loc) });//接咖啡控制 + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() {DeviceId = DeviceId, DrinkCode = (BPASmartClient.Model.咖啡机.Enum.DrCoffeeDrinksCode)int.Parse(orderLoc.Loc) });//接咖啡控制 DeviceProcessLogShow($"发送咖啡机制作{orderLoc.Loc}!"); morkT.IsCoffeeMake = true; morkT.MakeCoffeeOrder = orderLoc; } @@ -452,9 +452,9 @@ namespace BPASmartClient.MorkT /// private void DoCoffeeQC(OrderLocInfo order) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取咖啡出餐 }); //SENCE_取咖啡出餐 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取咖啡出餐 }); //SENCE_取咖啡出餐 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); //订单状态改变:完成 OrderChange(order.SuborderId, ORDER_STATUS.COMPLETED_COOK); morkT.waitMorkOrder = order; @@ -469,14 +469,14 @@ namespace BPASmartClient.MorkT /// private void GetAndCheeckCoffe(OrderLocInfo order) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 },(o)=>{ }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 },(o)=>{ }); OrderChange(order.SuborderId, ORDER_STATUS.COOKING); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取咖啡杯 }); //SENCE_取咖啡杯 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取咖啡杯 }); //SENCE_取咖啡杯 Wait(); - // EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_COFFEE });//落碗控制 - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, Value = true, Pin = 1 }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 1 }, (o) => + // EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_COFFEE });//落碗控制 + EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, Value = true, Pin = 1 }); + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 1 }, (o) => { //if (o != null && o.Length > 0 && o[0] is bool resultValue) //{ @@ -485,14 +485,14 @@ namespace BPASmartClient.MorkT }); Thread.Sleep(500); DeviceProcessLogShow("尝试取咖啡杯!"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); int count = 1; bool result = true; p: - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_咖啡杯检测 }); //SENCE_咖啡杯检测 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_咖啡杯检测 }); //SENCE_咖啡杯检测 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent { DeviceId = DeviceId, Pin = 1 }, (o)=> + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent { DeviceId = DeviceId, Pin = 1 }, (o)=> { if (o != null && o.Length > 0 && o[0] is bool resultValue) { @@ -506,17 +506,17 @@ namespace BPASmartClient.MorkT { //退出循环回到初始位置 DeviceProcessLogShow($"执行{count}次取咖啡杯,仍为成功,订单默认废弃,机器人回到初始位置!"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_咖啡杯回原点 }); //SENCE_咖啡杯回原点 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_咖啡杯回原点 }); //SENCE_咖啡杯回原点 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); morkT.GetCoffeeCup = false; return; } DeviceProcessLogShow("执行二次取咖啡杯"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_二次取咖啡杯 }); //SENCE_二次取咖啡杯 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_二次取咖啡杯 }); //SENCE_二次取咖啡杯 Wait(); - EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_COFFEE });//落碗控制 - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_COFFEE });//落碗控制 + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); count++; goto p; } @@ -548,7 +548,7 @@ namespace BPASmartClient.MorkT if (peripheralStatus.ContainsKey("IceCreamCurrentMode")) { - if ((MORKI_MODE)peripheralStatus["IceCreamCurrentMode"] != MORKI_MODE.制冷模式) EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); + if ((MORKI_MODE)peripheralStatus["IceCreamCurrentMode"] != MORKI_MODE.制冷模式) EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); } if (peripheralStatus.ContainsKey("IceCreamCXB")) @@ -556,7 +556,7 @@ namespace BPASmartClient.MorkT if ((byte)peripheralStatus["IceCreamCXB"] >= 86 && morkT.morkOrderPushesIceCream.Count > 0)//成型比大于86才可以制作 { bool result = true; - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => { if (res[0] is bool resultValue) { @@ -601,10 +601,10 @@ namespace BPASmartClient.MorkT private void GetIceCreamCup() { MessageLog.GetInstance.Show("准备开始制作冰淇淋"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取冰淇淋杯 }); //SENCE_取冰淇淋杯 + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取冰淇淋杯 }); //SENCE_取冰淇淋杯 Wait(); - EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制 + EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制 Thread.Sleep(500); DeviceProcessLogShow("尝试取冰淇淋杯!"); @@ -617,12 +617,12 @@ namespace BPASmartClient.MorkT { int count = 2; bool result = true; - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); p: - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_冰淇淋杯检测 }); //SENCE_冰淇淋杯检测 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_冰淇淋杯检测 }); //SENCE_冰淇淋杯检测 Wait(); Thread.Sleep(500); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { if (o != null && o.Length > 0 && o[0] is SignalResult res) { @@ -637,11 +637,11 @@ namespace BPASmartClient.MorkT //while ((ELebaiRModel)peripheralStatus["RobotMode"] !=ELebaiRModel.空闲状态) //{ - // EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }); + // EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }); // Thread.Sleep(500); //} - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent { DeviceId = DeviceId, Pin = 1 }, (o) => + EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent { DeviceId = DeviceId, Pin = 1 }, (o) => { if (o != null && o.Length > 0 && o[0] is bool resultValue) { @@ -654,17 +654,17 @@ namespace BPASmartClient.MorkT { //退出循环回到初始位置 DeviceProcessLogShow($"执行{count}次取冰淇淋杯,仍未成功,订单默认废弃,机器人回到初始位置!"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_冰淇淋杯回原点 }); //SENCE_冰淇淋杯回原点 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_冰淇淋杯回原点 }); //SENCE_冰淇淋杯回原点 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 },(o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 },(o) => { }); morkT.GetIceCreamCup = false; return; } DeviceProcessLogShow($"执行{count}次取冰淇淋杯!"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_二次取冰淇淋杯 }); //SENCE_二次取冰淇淋杯 - EventBus.EventBus.GetInstance().Equals(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_二次取冰淇淋杯 }); //SENCE_二次取冰淇淋杯 + EventBus.GetInstance().Equals(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); count++; goto p; } @@ -679,28 +679,28 @@ namespace BPASmartClient.MorkT private void GetIceCream(OrderLocInfo order) { //制冷模式 - EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); + EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); OrderChange(order.SuborderId, ORDER_STATUS.COOKING); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_接1号冰淇淋 }); //SENCE_接1号冰淇淋 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_接1号冰淇淋 }); //SENCE_接1号冰淇淋 Wait(); bool doItResult = true; //出料 - //EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true }); + //EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true }); //Thread.Sleep(500); - //EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false }); - //EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, bDO = true ,pin = 1}); + //EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false }); + //EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, bDO = true ,pin = 1}); //Thread.Sleep(500); - //EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, bDO = false, pin = 1 }); + //EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, bDO = false, pin = 1 }); //Thread.Sleep(500); - //EventBus.EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 });//冰淇淋出料 + //EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 });//冰淇淋出料 //DeviceProcessLogShow("开始等待6s"); //Thread.Sleep(5000); //出料 - EventBus.EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId }, (o) => + EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId }, (o) => { doItResult = (bool)o[0]; }); @@ -721,7 +721,7 @@ namespace BPASmartClient.MorkT } IceCreamCookCheck(); } - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); } /// @@ -733,7 +733,7 @@ namespace BPASmartClient.MorkT bool resultValue = true; while (resultValue) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 }, (res) => { if (res[0] is bool b) { @@ -743,9 +743,9 @@ namespace BPASmartClient.MorkT Thread.Sleep(500); } - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_放冰淇淋位置 }); //SENCE_放冰淇淋位置 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_放冰淇淋位置 }); //SENCE_放冰淇淋位置 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); //订单状态改变:完成 OrderChange(order.SuborderId, ORDER_STATUS.COMPLETED_COOK); morkT.waitMorkOrder = order; @@ -765,7 +765,7 @@ namespace BPASmartClient.MorkT while (!result) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => { if (res[0] is bool resultValue) { @@ -780,7 +780,7 @@ namespace BPASmartClient.MorkT if (DateTime.Now.Subtract(beginTime).TotalSeconds > 5) { DeviceProcessLogShow("超时未出料,重新发送打料指令"); - EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent() { DeviceId = DeviceId, Mode = MORKI_MODE.打料 }); + EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent() { DeviceId = DeviceId, Mode = MORKI_MODE.打料 }); beginTime = DateTime.Now; retry--; } diff --git a/BPASmartClient.MorkT/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkT/ViewModel/DebugViewModel.cs index 838e1b02..af6d1688 100644 --- a/BPASmartClient.MorkT/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkT/ViewModel/DebugViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.DRCoffee; using BPASmartClient.GSIceCream; using BPA.Helper; using BPASmartClient.LebaiRobot; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.冰淇淋.Enum; @@ -13,7 +13,7 @@ using BPASmartClient.Model.单片机; using BPASmartClient.Model.单片机.Enum; using BPASmartClient.Model.咖啡机.Enum; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -44,7 +44,7 @@ namespace BPASmartClient.MorkT.ViewModel; /// private void Button_RobotControl(object o) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); } #endregion @@ -111,15 +111,15 @@ namespace BPASmartClient.MorkT.ViewModel; private void Button_MakeCoffee() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee)}); + EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee)}); } private void Button_StopMakeCoffe() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); + EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); } private void Button_CoffeeModeSet() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd)}); + EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd)}); } #endregion diff --git a/BPASmartClient.MorkT/ViewModel/MonitorViewModel.cs b/BPASmartClient.MorkT/ViewModel/MonitorViewModel.cs index b19180d2..d2e7de4c 100644 --- a/BPASmartClient.MorkT/ViewModel/MonitorViewModel.cs +++ b/BPASmartClient.MorkT/ViewModel/MonitorViewModel.cs @@ -50,7 +50,7 @@ namespace BPASmartClient.MorkT.ViewModel }); ThreadManage.GetInstance().StartLong(new Action(() => { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> + EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> { if(res != null&& res.Length>0&& res[0] is bool b) { @@ -58,7 +58,7 @@ namespace BPASmartClient.MorkT.ViewModel } }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (res) => { if (res != null && res.Length > 0 && res[0] is bool b) { @@ -66,7 +66,7 @@ namespace BPASmartClient.MorkT.ViewModel } }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 3 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 3 }, (res) => { if (res != null && res.Length > 0 && res[0] is bool b) { diff --git a/BPASmartClient.MorkTM/Control_MorkTM.cs b/BPASmartClient.MorkTM/Control_MorkTM.cs index 1b91f308..15992f20 100644 --- a/BPASmartClient.MorkTM/Control_MorkTM.cs +++ b/BPASmartClient.MorkTM/Control_MorkTM.cs @@ -3,7 +3,7 @@ using BPA.Message.Enum; using BPASmartClient.Device; using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.PLC; using BPASmartClient.MorkTM; @@ -91,7 +91,7 @@ namespace BPASmartClient.MorkTM private void ServerInit() { //物料信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -101,7 +101,7 @@ namespace BPASmartClient.MorkTM }); //配方数据信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is RecipeBomEvent recipe) @@ -112,7 +112,7 @@ namespace BPASmartClient.MorkTM } private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if(@event == null) return; if(@event is DoOrderEvent order) @@ -146,7 +146,7 @@ namespace BPASmartClient.MorkTM var res = morkTM.doOrderEvents.FirstOrDefault(p => p.MorkOrder.SuborderId == subid); string goodName = string.Empty; string SortNum = string.Empty; - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = res.MorkOrder. SortNum.ToString(), GoodName = res.MorkOrder.GoodsName, @@ -422,7 +422,7 @@ namespace BPASmartClient.MorkTM private void WriteData(string address, object value) { - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); } private void GetStatus(string key, Action action) diff --git a/BPASmartClient.MorkTM/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkTM/ViewModel/DebugViewModel.cs index 8ba8e21f..e256aa51 100644 --- a/BPASmartClient.MorkTM/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkTM/ViewModel/DebugViewModel.cs @@ -1,5 +1,5 @@ using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.MorkTM/ViewModel/RecipeViewModel.cs b/BPASmartClient.MorkTM/ViewModel/RecipeViewModel.cs index 5aae8164..a0103b8c 100644 --- a/BPASmartClient.MorkTM/ViewModel/RecipeViewModel.cs +++ b/BPASmartClient.MorkTM/ViewModel/RecipeViewModel.cs @@ -1,6 +1,6 @@ using BPASmartClient.MorkTM; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using Model; using Newtonsoft.Json; using System; diff --git a/BPASmartClient.MorkTSingle/Control_MORKJC.cs b/BPASmartClient.MorkTSingle/Control_MORKJC.cs index 09c477ac..5c31a059 100644 --- a/BPASmartClient.MorkTSingle/Control_MORKJC.cs +++ b/BPASmartClient.MorkTSingle/Control_MORKJC.cs @@ -18,7 +18,7 @@ using BPASmartClient.Model.PLC; using BPASmartClient.Model.单片机; using BPASmartClient.Business; using BPASmartClient.KLMCoffee.Protocal; -using BPASmartClient.Message; + namespace BPASmartClient.MorkTSingle { /* @@ -49,7 +49,7 @@ namespace BPASmartClient.MorkTSingle private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) { - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); } //private SerialPortClient commProxy; @@ -141,7 +141,7 @@ namespace BPASmartClient.MorkTSingle } private void serverInit() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -153,7 +153,7 @@ namespace BPASmartClient.MorkTSingle private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -242,7 +242,7 @@ namespace BPASmartClient.MorkTSingle { if (!GVL_MORKJC.CoffeeKind) { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { bFirstTrig_Coffee = false; morkT.MakeCoffeeFinish = true; @@ -250,7 +250,7 @@ namespace BPASmartClient.MorkTSingle } else { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { bFirstTrig_Coffee = false; morkT.MakeCoffeeFinish = true; @@ -286,7 +286,7 @@ namespace BPASmartClient.MorkTSingle } public override void SimOrder() { - EventBus.EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) { string guid = Guid.NewGuid().ToString(); if (@event != null && @event is MorkTSimOrder msm) diff --git a/BPASmartClient.MorkTSingle/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkTSingle/ViewModel/DebugViewModel.cs index f28daddc..82fb0488 100644 --- a/BPASmartClient.MorkTSingle/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkTSingle/ViewModel/DebugViewModel.cs @@ -2,7 +2,7 @@ using BPASmartClient.Device; using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.冰淇淋.Enum; @@ -10,7 +10,7 @@ using BPASmartClient.Model.单片机; using BPASmartClient.Model.单片机.Enum; using BPASmartClient.Model.咖啡机.Enum; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.MorkT_BarCounter/Control_MorkT_BarCounter.cs b/BPASmartClient.MorkT_BarCounter/Control_MorkT_BarCounter.cs index d898be71..93e27518 100644 --- a/BPASmartClient.MorkT_BarCounter/Control_MorkT_BarCounter.cs +++ b/BPASmartClient.MorkT_BarCounter/Control_MorkT_BarCounter.cs @@ -14,7 +14,7 @@ using BPASmartClient.Model.咖啡机.Enum; using BPASmartClient.Model; -using BPASmartClient.Message; + using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.单片机; using BPASmartClient.Model.PLC; @@ -70,7 +70,7 @@ namespace BPASmartClient.MorkT_BarCounter private void serverInit() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -82,7 +82,7 @@ namespace BPASmartClient.MorkT_BarCounter private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -202,7 +202,7 @@ namespace BPASmartClient.MorkT_BarCounter DateTime delayTimeOut_MilkTea; public override void MainTask() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (morkT.IsHaveCoffeeCup && morkT.MakeCoffeeEnd != true) morkT.MakeCoffeeEnd = true; @@ -259,7 +259,7 @@ namespace BPASmartClient.MorkT_BarCounter /// private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) { - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); } /// /// 验证商品是做的某种饮料 @@ -662,7 +662,7 @@ namespace BPASmartClient.MorkT_BarCounter private void WritePLCData(string address, object value) { - EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); + EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value }); } private void GetStatus(string key, Action action) { @@ -786,14 +786,14 @@ namespace BPASmartClient.MorkT_BarCounter })); #endregion #region 单片机状态 - EventBus.EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput0" }); - EventBus.EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput1" }); - EventBus.EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput2" }); - EventBus.EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput3" }); - EventBus.EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput4" }); - EventBus.EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput5" }); - EventBus.EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput6" }); - EventBus.EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput7" }); + EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput0" }); + EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput1" }); + EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput2" }); + EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput3" }); + EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput4" }); + EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput5" }); + EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput6" }); + EventBus.GetInstance().Publish(new ReadMcu() { DeviceId = DeviceId, ReadPar = 0, TagName = "SCChipGetInput7" }); GetStatus("SCChipIsConnect", new Action((o) => { if (o is bool b) @@ -889,7 +889,7 @@ namespace BPASmartClient.MorkT_BarCounter public override void SimOrder() { - EventBus.EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) { string guid = Guid.NewGuid().ToString(); if (@event != null && @event is MorkTSimOrder msm) diff --git a/BPASmartClient.MorkT_BarCounter/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkT_BarCounter/ViewModel/DebugViewModel.cs index 9cd34736..0ab0ee3c 100644 --- a/BPASmartClient.MorkT_BarCounter/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkT_BarCounter/ViewModel/DebugViewModel.cs @@ -4,7 +4,7 @@ using BPASmartClient.DRCoffee; using BPA.Helper; using BPASmartClient.LebaiRobot; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.冰淇淋.Enum; @@ -14,7 +14,7 @@ using BPASmartClient.Model.咖啡机.Enum; using BPASmartClient.Model.奶茶味魔方; using BPASmartClient.Model.电夹爪; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.MorkT_BarCounter/ViewModel/TestViewModel.cs b/BPASmartClient.MorkT_BarCounter/ViewModel/TestViewModel.cs index 7057cd7d..19a8fb07 100644 --- a/BPASmartClient.MorkT_BarCounter/ViewModel/TestViewModel.cs +++ b/BPASmartClient.MorkT_BarCounter/ViewModel/TestViewModel.cs @@ -4,7 +4,7 @@ using BPASmartClient.DRCoffee; using BPA.Helper; using BPASmartClient.LebaiRobot; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.冰淇淋.Enum; @@ -12,7 +12,7 @@ using BPASmartClient.Model.单片机; using BPASmartClient.Model.单片机.Enum; using BPASmartClient.Model.咖啡机.Enum; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -45,12 +45,12 @@ namespace BPASmartClient.MorkT_BarCounter.ViewModel; /// private void Button_RobotControl(object o) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); } private void Button_RobotDoutput() { bool DO_Value =int.Parse(Robot_DOutput_Value) == 0; - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { Pin = int.Parse(Robot_DOutput_Pin), Value = DO_Value }); + EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { Pin = int.Parse(Robot_DOutput_Pin), Value = DO_Value }); } public string Robot_TCPDI0 { get { return _robot_TCPDI0; } set { _robot_TCPDI0 = value;OnPropertyChanged(); } } private string _robot_TCPDI0; @@ -252,15 +252,15 @@ namespace BPASmartClient.MorkT_BarCounter.ViewModel; private void Button_MakeCoffee() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee) }); + EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee) }); } private void Button_StopMakeCoffe() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); + EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); } private void Button_CoffeeModeSet() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd) }); + EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd) }); } #endregion diff --git a/BPASmartClient.MorkT_Container/Control_MorkT_Container.cs b/BPASmartClient.MorkT_Container/Control_MorkT_Container.cs index a77ca440..a72e6e89 100644 --- a/BPASmartClient.MorkT_Container/Control_MorkT_Container.cs +++ b/BPASmartClient.MorkT_Container/Control_MorkT_Container.cs @@ -14,7 +14,7 @@ using BPASmartClient.Model.咖啡机.Enum; using BPASmartClient.Model; -using BPASmartClient.Message; + using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.单片机; using BPASmartClient.Model.PLC; @@ -48,7 +48,7 @@ namespace BPASmartClient.MorkT_Container private void serverInit() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -59,7 +59,7 @@ namespace BPASmartClient.MorkT_Container } private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -127,7 +127,7 @@ namespace BPASmartClient.MorkT_Container { if (morkTLebaiJC.morkOrderPushesCoffee.Count > 0 && morkTLebaiJC.IsHaveCoffeeCup) { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (morkTLebaiJC.IsHaveCoffeeCup && morkTLebaiJC.MakeCoffeeEnd != true) { @@ -161,7 +161,7 @@ namespace BPASmartClient.MorkT_Container /// private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) { - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); } /// /// 验证商品是做的某种饮料 @@ -184,7 +184,7 @@ namespace BPASmartClient.MorkT_Container Thread.Sleep(5); } - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); } /// /// 乐白的场景 @@ -252,7 +252,7 @@ namespace BPASmartClient.MorkT_Container { outCupCheck = false; OrderChange(morkTLebaiJC.morkOrderPushesCoffee.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); int resultTakeCup = takeCup(); if (resultTakeCup == 1) { @@ -360,11 +360,11 @@ namespace BPASmartClient.MorkT_Container nCnt++; Sence(GVL_MorkT.攀华_二次取杯); Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); Sence(GVL_MorkT.攀华_落杯); Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); } Thread.Sleep(100); } @@ -461,7 +461,7 @@ namespace BPASmartClient.MorkT_Container public override void SimOrder() { - EventBus.EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(0, delegate (IEvent @event, EventCallBackHandle callBackHandle) { string guid = Guid.NewGuid().ToString(); if (@event != null && @event is MorkTSimOrder msm) diff --git a/BPASmartClient.MorkT_Container/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkT_Container/ViewModel/DebugViewModel.cs index 8ff1a054..18c314bb 100644 --- a/BPASmartClient.MorkT_Container/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkT_Container/ViewModel/DebugViewModel.cs @@ -4,7 +4,7 @@ using BPASmartClient.DRCoffee; using BPA.Helper; using BPASmartClient.LebaiRobot; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.冰淇淋.Enum; @@ -12,7 +12,7 @@ using BPASmartClient.Model.单片机; using BPASmartClient.Model.单片机.Enum; using BPASmartClient.Model.咖啡机.Enum; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -45,14 +45,14 @@ namespace BPASmartClient.MorkT_Container.ViewModel; /// private void Button_RobotControl(object o) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); } private void Button_RobotDoutput() { bool DO_Value =int.Parse(Robot_DOutput_Value) == 0; - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { Pin = int.Parse(Robot_DOutput_Pin), Value = DO_Value }); + EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { Pin = int.Parse(Robot_DOutput_Pin), Value = DO_Value }); } public bool Robot_TCPDI0 { get { return _robot_TCPDI0; } set { _robot_TCPDI0 = value;OnPropertyChanged(); } } private bool _robot_TCPDI0; @@ -264,15 +264,15 @@ namespace BPASmartClient.MorkT_Container.ViewModel; private void Button_MakeCoffee() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee) }); + EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee) }); } private void Button_StopMakeCoffe() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); + EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); } private void Button_CoffeeModeSet() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd) }); + EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd) }); } #endregion diff --git a/BPASmartClient.MorkT_HQ/Control_MorkTHQ.cs b/BPASmartClient.MorkT_HQ/Control_MorkTHQ.cs index 36925570..3befebcc 100644 --- a/BPASmartClient.MorkT_HQ/Control_MorkTHQ.cs +++ b/BPASmartClient.MorkT_HQ/Control_MorkTHQ.cs @@ -8,7 +8,7 @@ using BPA.Helper; using BPASmartClient.KLMCoffee.Protocal; using BPASmartClient.Lebai; using BPASmartClient.LebaiRobot; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.冰淇淋.Enum; @@ -42,13 +42,13 @@ namespace BPASmartClient.MorkTHQ IsHealth = true; ServerInit(); DataParse(); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (morkT.MakeCoffeeOrder != null) morkT.MakeCoffeeOrder.OrderStatus = 1; }); int i = 0; - EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); + EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); MessageLog.GetInstance.Show("MORKT 设备初始化完成"); @@ -250,7 +250,7 @@ namespace BPASmartClient.MorkTHQ private void ServerInit() { //物料信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -260,7 +260,7 @@ namespace BPASmartClient.MorkTHQ }); //配方数据信息 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is RecipeBomEvent recipe) @@ -275,7 +275,7 @@ namespace BPASmartClient.MorkTHQ /// private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -373,7 +373,7 @@ namespace BPASmartClient.MorkTHQ private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) { - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); } private void Wait(int value = 101) @@ -408,10 +408,10 @@ namespace BPASmartClient.MorkTHQ DeviceProcessLogShow($"开始制作 [咖啡] 订单[{orderLoc.SortNum}]"); GetAndCheeckCoffe(orderLoc);//取咖啡杯 if (!morkT.GetCoffeeCup) return; - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10051}); //接咖啡后回原点 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10051}); //接咖啡后回原点 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); - EventBus.EventBus.GetInstance().Publish(new KLMCoffee_MakeCoffeeEvent() {DeviceId = DeviceId, DrinkCode = (Model.咖啡机.Enum.DrinkType)int.Parse(orderLoc.Loc) });//接咖啡控制 + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new KLMCoffee_MakeCoffeeEvent() {DeviceId = DeviceId, DrinkCode = (Model.咖啡机.Enum.DrinkType)int.Parse(orderLoc.Loc) });//接咖啡控制 DeviceProcessLogShow($"发送咖啡机制作{orderLoc.Loc}!"); morkT.IsCoffeeMake = true; morkT.MakeCoffeeOrder = orderLoc; } @@ -444,9 +444,9 @@ namespace BPASmartClient.MorkTHQ /// private void DoCoffeeQC(OrderLocInfo order) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10052 }); //SENCE_取咖啡出餐 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10052 }); //SENCE_取咖啡出餐 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); //订单状态改变:完成 OrderChange(order.SuborderId, ORDER_STATUS.COMPLETED_COOK); morkT.waitMorkOrder = order; @@ -461,12 +461,12 @@ namespace BPASmartClient.MorkTHQ /// private void GetAndCheeckCoffe(OrderLocInfo order) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 },(o)=>{ }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 },(o)=>{ }); OrderChange(order.SuborderId, ORDER_STATUS.COOKING); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10031 }); //SENCE_取咖啡杯 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10031 }); //SENCE_取咖啡杯 Wait(); Thread.Sleep(500); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); morkT.GetCoffeeCup = true; DeviceProcessLogShow("取咖啡杯完成"); @@ -493,7 +493,7 @@ namespace BPASmartClient.MorkTHQ { if (peripheralStatus.ContainsKey("IceCreamCurrentMode")) { - if ((MORKI_MODE)peripheralStatus["IceCreamCurrentMode"] != MORKI_MODE.制冷模式) EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); + if ((MORKI_MODE)peripheralStatus["IceCreamCurrentMode"] != MORKI_MODE.制冷模式) EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); } if (peripheralStatus.ContainsKey("IceCreamCXB")) @@ -501,7 +501,7 @@ namespace BPASmartClient.MorkTHQ if ((byte)peripheralStatus["IceCreamCXB"] >= 86 && morkT.morkOrderPushesIceCream.Count > 0)//成型比大于86才可以制作 { bool result = true; - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => { if (res[0] is bool resultValue) { @@ -544,8 +544,8 @@ namespace BPASmartClient.MorkTHQ private void GetIceCreamCup() { MessageLog.GetInstance.Show("准备开始制作冰淇淋"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10032 }); //SENCE_取冰淇淋杯 + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10032 }); //SENCE_取冰淇淋杯 Wait(); Thread.Sleep(500); DeviceProcessLogShow("尝试取冰淇淋杯!"); @@ -559,12 +559,12 @@ namespace BPASmartClient.MorkTHQ { int count = 2; bool result = true; - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); p: - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10034 }); //SENCE_冰淇淋杯检测 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10034 }); //SENCE_冰淇淋杯检测 Wait(); Thread.Sleep(500); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { if (o != null && o.Length > 0 && o[0] is SignalResult res) { @@ -579,11 +579,11 @@ namespace BPASmartClient.MorkTHQ //while ((ELebaiRModel)peripheralStatus["RobotMode"] !=ELebaiRModel.空闲状态) //{ - // EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }); + // EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }); // Thread.Sleep(500); //} - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent { DeviceId = DeviceId, Pin = 1 }, (o) => + EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent { DeviceId = DeviceId, Pin = 1 }, (o) => { if (o != null && o.Length > 0 && o[0] is bool resultValue) { @@ -596,17 +596,17 @@ namespace BPASmartClient.MorkTHQ { //退出循环回到初始位置 DeviceProcessLogShow($"执行{count}次取冰淇淋杯,仍未成功,订单默认废弃,机器人回到初始位置!"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10049 }); //SENCE_冰淇淋杯回原点 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10049 }); //SENCE_冰淇淋杯回原点 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 },(o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 },(o) => { }); morkT.GetIceCreamCup = false; return; } DeviceProcessLogShow($"执行{count}次取冰淇淋杯!"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10036 }); //SENCE_二次取冰淇淋杯 - EventBus.EventBus.GetInstance().Equals(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10036 }); //SENCE_二次取冰淇淋杯 + EventBus.GetInstance().Equals(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); count++; goto p; } @@ -621,24 +621,24 @@ namespace BPASmartClient.MorkTHQ private void GetIceCream(OrderLocInfo order) { //制冷模式 - //EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent {DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); + //EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent {DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); OrderChange(order.SuborderId, ORDER_STATUS.COOKING); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10055 }); //SENCE_接1号冰淇淋 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10055 }); //SENCE_接1号冰淇淋 Wait(); bool doItResult = true; ////出料 - //EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true }); + //EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true }); //Thread.Sleep(500); - //EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false }); + //EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false }); //Thread.Sleep(500); - //EventBus.EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 });//冰淇淋出料 + //EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 });//冰淇淋出料 //DeviceProcessLogShow("开始等待6s"); //Thread.Sleep(5000); // 出料 - EventBus.EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId }, (o) => + EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId }, (o) => { doItResult = (bool)o[0]; }); @@ -659,7 +659,7 @@ namespace BPASmartClient.MorkTHQ } IceCreamCookCheck(); } - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); } /// @@ -671,7 +671,7 @@ namespace BPASmartClient.MorkTHQ bool resultValue = true; while (resultValue) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 }, (res) => { if (res[0] is bool b) { @@ -681,9 +681,9 @@ namespace BPASmartClient.MorkTHQ Thread.Sleep(500); } - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10056 }); //SENCE_放冰淇淋位置 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10056 }); //SENCE_放冰淇淋位置 Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); //订单状态改变:完成 OrderChange(order.SuborderId, ORDER_STATUS.COMPLETED_COOK); morkT.waitMorkOrder = order; @@ -703,7 +703,7 @@ namespace BPASmartClient.MorkTHQ while (!result) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => { if (res[0] is bool resultValue) { @@ -718,7 +718,7 @@ namespace BPASmartClient.MorkTHQ if (DateTime.Now.Subtract(beginTime).TotalSeconds > 5) { DeviceProcessLogShow("超时未出料,重新发送打料指令"); - EventBus.EventBus.GetInstance().Publish( new GSIceCream_ModeSetEvent() { DeviceId =DeviceId, Mode = MORKI_MODE.打料 }); + EventBus.GetInstance().Publish( new GSIceCream_ModeSetEvent() { DeviceId =DeviceId, Mode = MORKI_MODE.打料 }); beginTime = DateTime.Now; retry--; } @@ -739,7 +739,7 @@ namespace BPASmartClient.MorkTHQ if(morkT.morkOrderPushesJuice.TryDequeue(out OrderLocInfo order)) { OrderChange(order.SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 11111 });//SENCE_取果汁杯位置 + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 11111 });//SENCE_取果汁杯位置 int JuicerNum1 = int.Parse(order.Loc); switch (JuicerNum1) { @@ -752,10 +752,10 @@ namespace BPASmartClient.MorkTHQ { morkT.JuicerNum = 0x01; } - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接1号果汁位置 }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接1号果汁位置 }); Wait(); break; case 53: @@ -767,10 +767,10 @@ namespace BPASmartClient.MorkTHQ { morkT.JuicerNum = 0x03; } - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接2号果汁位置 }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接2号果汁位置 }); Wait(); break; case 54: @@ -782,10 +782,10 @@ namespace BPASmartClient.MorkTHQ { morkT.JuicerNum = 0x05; } - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接3号果汁位置 }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接3号果汁位置 }); Wait(); break; case 55: @@ -797,18 +797,18 @@ namespace BPASmartClient.MorkTHQ { morkT.JuicerNum = 0x07; } - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接4号果汁位置 }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接4号果汁位置 }); Wait(); break; default: morkT.JuicerNum = 0x00; - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接1号果汁位置 }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接1号果汁位置 }); Wait(); break; } @@ -818,7 +818,7 @@ namespace BPASmartClient.MorkTHQ if (devStatus1.IndexOf("0") == 1 && devStatus2 == 0) { - EventBus.EventBus.GetInstance().Publish(new WriteJuicer() { Value = morkT.JuicerNum }); + EventBus.GetInstance().Publish(new WriteJuicer() { Value = morkT.JuicerNum }); Thread.Sleep(100); devStatusBy = GetDeviceStatus("GetDeviceStatus"); while (!(devStatusBy[1] == 0)) @@ -833,7 +833,7 @@ namespace BPASmartClient.MorkTHQ } devStatusBy = GetDeviceStatus("GetDeviceStatus"); Thread.Sleep(5000); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_放果汁杯位置后回原点 }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_放果汁杯位置后回原点 }); Wait(); OrderChange(order.SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); diff --git a/BPASmartClient.MorkT_HQ/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkT_HQ/ViewModel/DebugViewModel.cs index 5fea7e9a..ba9fe968 100644 --- a/BPASmartClient.MorkT_HQ/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkT_HQ/ViewModel/DebugViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.DRCoffee; using BPASmartClient.GSIceCream; using BPA.Helper; using BPASmartClient.LebaiRobot; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.冰淇淋.Enum; @@ -13,7 +13,7 @@ using BPASmartClient.Model.单片机; using BPASmartClient.Model.单片机.Enum; using BPASmartClient.Model.咖啡机.Enum; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -49,11 +49,11 @@ namespace BPASmartClient.MorkTHQ.ViewModel private void Button_SetValue() { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }); + EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }); } private void Button_RobotControl(object o) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); } #endregion @@ -124,7 +124,7 @@ namespace BPASmartClient.MorkTHQ.ViewModel private void Button_MakeIceCream() { - EventBus.EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId }); + EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId }); } private void Button_SetIceCreamModel() { @@ -182,15 +182,15 @@ namespace BPASmartClient.MorkTHQ.ViewModel private void Button_MakeCoffee() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee)}); + EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee)}); } private void Button_StopMakeCoffe() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); + EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); } private void Button_CoffeeModeSet() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd)}); + EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd)}); } #endregion @@ -219,20 +219,20 @@ namespace BPASmartClient.MorkTHQ.ViewModel private void Button_CupControl(object CupType) { - EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent() { DeviceId = DeviceId, Cup = (IC_CUP)Enum.Parse(typeof(IC_CUP), CupType.ToString()) }); + EventBus.GetInstance().Publish(new SCChip_TakeCupEvent() { DeviceId = DeviceId, Cup = (IC_CUP)Enum.Parse(typeof(IC_CUP), CupType.ToString()) }); } private void Button_SCChipRefrigeration() { - EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true }); + EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true }); Thread.Sleep(500); - EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false }); + EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false }); } private void Button_SCChipDischarge() { - EventBus.EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 }); + EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 }); } #endregion @@ -292,7 +292,7 @@ namespace BPASmartClient.MorkTHQ.ViewModel } private void MakeJuiceEvent(byte b) { - EventBus.EventBus.GetInstance().Publish(new WriteJuicer { DeviceId = DeviceId, Value = b }); + EventBus.GetInstance().Publish(new WriteJuicer { DeviceId = DeviceId, Value = b }); } #endregion diff --git a/BPASmartClient.MorkT_HQ/ViewModel/MonitorViewModel.cs b/BPASmartClient.MorkT_HQ/ViewModel/MonitorViewModel.cs index b86d2a85..a7730b77 100644 --- a/BPASmartClient.MorkT_HQ/ViewModel/MonitorViewModel.cs +++ b/BPASmartClient.MorkT_HQ/ViewModel/MonitorViewModel.cs @@ -50,7 +50,7 @@ namespace BPASmartClient.MorkTHQ.ViewModel }); ThreadManage.GetInstance().StartLong(new Action(() => { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> + EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> { if(res != null&& res.Length>0&& res[0] is bool b) { @@ -58,7 +58,7 @@ namespace BPASmartClient.MorkTHQ.ViewModel } }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (res) => { if (res != null && res.Length > 0 && res[0] is bool b) { @@ -66,7 +66,7 @@ namespace BPASmartClient.MorkTHQ.ViewModel } }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 3 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 3 }, (res) => { if (res != null && res.Length > 0 && res[0] is bool b) { diff --git a/BPASmartClient.Morkt.JAKA.JC/Control_MORKJC.cs b/BPASmartClient.Morkt.JAKA.JC/Control_MORKJC.cs index 89a2773e..574a8441 100644 --- a/BPASmartClient.Morkt.JAKA.JC/Control_MORKJC.cs +++ b/BPASmartClient.Morkt.JAKA.JC/Control_MORKJC.cs @@ -16,7 +16,7 @@ using BPASmartClient.Model; using BPASmartClient.Model.PLC; using BPASmartClient.Model.单片机; -using BPASmartClient.Message; + namespace BPASmartClient.MorktJAKAJC { @@ -37,7 +37,7 @@ namespace BPASmartClient.MorktJAKAJC private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) { - EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); + EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); } public override void DoMain() { @@ -52,7 +52,7 @@ namespace BPASmartClient.MorktJAKAJC private void serverInit() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; if (@event is MaterialDeliveryEvent material) @@ -64,7 +64,7 @@ namespace BPASmartClient.MorktJAKAJC private void DataParse() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) { if (@event == null) return; if (@event is DoOrderEvent order) @@ -178,7 +178,7 @@ namespace BPASmartClient.MorktJAKAJC bool pickUpHotWaterHaveCup = false; public override void MainTask() { - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (morkTJakaJC.IsHaveCoffeeCup) morkTJakaJC.MakeCoffeeEnd = true; diff --git a/BPASmartClient.Morkt.JAKA.JC/ViewModel/DebugViewModel.cs b/BPASmartClient.Morkt.JAKA.JC/ViewModel/DebugViewModel.cs index e70de08a..d51b3c72 100644 --- a/BPASmartClient.Morkt.JAKA.JC/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.Morkt.JAKA.JC/ViewModel/DebugViewModel.cs @@ -5,7 +5,7 @@ using BPASmartClient.DRCoffee; using BPASmartClient.GSIceCream; using BPA.Helper; using BPASmartClient.LebaiRobot; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.乐白机器人; using BPASmartClient.Model.冰淇淋.Enum; @@ -13,7 +13,7 @@ using BPASmartClient.Model.单片机; using BPASmartClient.Model.单片机.Enum; using BPASmartClient.Model.咖啡机.Enum; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -44,7 +44,7 @@ namespace BPASmartClient.MorkTJAKAJC.ViewModel; /// private void Button_RobotControl(object o) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); + EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() }); } #endregion @@ -113,15 +113,15 @@ namespace BPASmartClient.MorkTJAKAJC.ViewModel; private void Button_MakeCoffee() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee)}); + EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee)}); } private void Button_StopMakeCoffe() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); + EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId }); } private void Button_CoffeeModeSet() { - EventBus.EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd)}); + EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd)}); } #endregion diff --git a/BPASmartClient.Morkt.JAKA.JC/ViewModel/MonitorViewModel.cs b/BPASmartClient.Morkt.JAKA.JC/ViewModel/MonitorViewModel.cs index d8647cc5..951ffd96 100644 --- a/BPASmartClient.Morkt.JAKA.JC/ViewModel/MonitorViewModel.cs +++ b/BPASmartClient.Morkt.JAKA.JC/ViewModel/MonitorViewModel.cs @@ -50,7 +50,7 @@ namespace BPASmartClient.MorkTJAKAJC.ViewModel }); ThreadManage.GetInstance().StartLong(new Action(() => { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> + EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> { if(res != null&& res.Length>0&& res[0] is bool b) { @@ -58,7 +58,7 @@ namespace BPASmartClient.MorkTJAKAJC.ViewModel } }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (res) => { if (res != null && res.Length > 0 && res[0] is bool b) { @@ -66,7 +66,7 @@ namespace BPASmartClient.MorkTJAKAJC.ViewModel } }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 3 }, (res) => + EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 3 }, (res) => { if (res != null && res.Length > 0 && res[0] is bool b) { diff --git a/BPASmartClient.RobotGripper/RobotGripperMachine.cs b/BPASmartClient.RobotGripper/RobotGripperMachine.cs index b61848dd..e960ce99 100644 --- a/BPASmartClient.RobotGripper/RobotGripperMachine.cs +++ b/BPASmartClient.RobotGripper/RobotGripperMachine.cs @@ -2,22 +2,22 @@ using System; using BPASmartClient.Peripheral; using BPASmartClient.SerialPort; using BPASmartClient.Model.צ; - - +using static BPA.Helper.EventBus; +using BPA.Helper; namespace BPASmartClient.RobotGripper { - public class RobotGripperMachine:BasePeripheral + public class RobotGripperMachine : BasePeripheral { RobotGripperHelper machineHelper = new RobotGripperHelper(); public override void Init() { machineHelper.Open(communicationPar.SerialPort, communicationPar.BaudRate); - EventBus.EventBus.GetInstance().Subscribe(DeviceId,delegate(IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; var par = @event as WriteGripper; - switch (par?.TagName) + switch (par?.TagName) { case "PWMControl": machineHelper.Write(Convert.ToByte(par?.CH_Number), Convert.ToString(par?.PWMOutput)); diff --git a/BPASmartClient.SCChip/CommandHandler.cs b/BPASmartClient.SCChip/CommandHandler.cs index 39abfa27..dbe39404 100644 --- a/BPASmartClient.SCChip/CommandHandler.cs +++ b/BPASmartClient.SCChip/CommandHandler.cs @@ -1,6 +1,7 @@  -using BPASmartClient.Message; + +using BPA.Helper; using BPASmartClient.Model.单片机; using BPASmartClient.Model.单片机.Enum; using BPASmartClient.SCChip; @@ -12,10 +13,10 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Threading.Tasks; - +using static BPA.Helper.EventBus; namespace BPASmartClient.SCChip -{ +{ /// /// 指令封装 /// @@ -30,12 +31,12 @@ namespace BPASmartClient.SCChip internal void Init(SerialPortClient commProxy) { this.commProxy = commProxy; - EventBus.EventBus.GetInstance().Subscribe(0,TakeCupEventHandle); - EventBus.EventBus.GetInstance().Subscribe(0, MakeIceCreamEventHandle); - EventBus.EventBus.GetInstance().Subscribe(0, StopMakeIceCreamEventHandle); - EventBus.EventBus.GetInstance().Subscribe(0, RotorSwitchEventHandle); - EventBus.EventBus.GetInstance().Subscribe(0, ArticleExitsEventHandle); - EventBus.EventBus.GetInstance().Subscribe(0, ArticleDistEventHandle); + EventBus.GetInstance().Subscribe(0, TakeCupEventHandle); + EventBus.GetInstance().Subscribe(0, MakeIceCreamEventHandle); + EventBus.GetInstance().Subscribe(0, StopMakeIceCreamEventHandle); + EventBus.GetInstance().Subscribe(0, RotorSwitchEventHandle); + EventBus.GetInstance().Subscribe(0, ArticleExitsEventHandle); + EventBus.GetInstance().Subscribe(0, ArticleDistEventHandle); } private void ArticleDistEventHandle(IEvent @event, EventCallBackHandle callBack) diff --git a/BPASmartClient.SCChip/ICChipMachine.cs b/BPASmartClient.SCChip/ICChipMachine.cs index b97ea244..73ae6acf 100644 --- a/BPASmartClient.SCChip/ICChipMachine.cs +++ b/BPASmartClient.SCChip/ICChipMachine.cs @@ -1,6 +1,6 @@  using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.单片机; using BPASmartClient.Model.单片机.Enum; @@ -265,7 +265,7 @@ namespace BPASmartClient.SCChip commProxy.SetDataStorage(dataStorage); //STM32F103RCT6单片机下杯 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { try { @@ -309,7 +309,7 @@ namespace BPASmartClient.SCChip }); //STM32F103RCT6单片机舵机打料 - EventBus.EventBus.GetInstance().Subscribe(DeviceId,delegate (IEvent @event,EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId,delegate (IEvent @event,EventCallBackHandle callBack) { try { @@ -398,7 +398,7 @@ namespace BPASmartClient.SCChip }); //STM32F103RCT6单片机舵机打开或者关闭 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { try { @@ -413,7 +413,7 @@ namespace BPASmartClient.SCChip }); //STM32F103RCT6单片机控制冰淇淋机器转 - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { try { diff --git a/BPASmartClient.SmallBatchingSystem/Models/BaseModel.cs b/BPASmartClient.SmallBatchingSystem/Models/BaseModel.cs index f870101a..ff65b3b8 100644 --- a/BPASmartClient.SmallBatchingSystem/Models/BaseModel.cs +++ b/BPASmartClient.SmallBatchingSystem/Models/BaseModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.SmallBatchingSystem { diff --git a/BPASmartClient.SmallBatchingSystem/ViewModels/GrindArenaceousViewModel.cs b/BPASmartClient.SmallBatchingSystem/ViewModels/GrindArenaceousViewModel.cs index 47cac564..6cb3a347 100644 --- a/BPASmartClient.SmallBatchingSystem/ViewModels/GrindArenaceousViewModel.cs +++ b/BPASmartClient.SmallBatchingSystem/ViewModels/GrindArenaceousViewModel.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Microsoft.Toolkit.Mvvm.Input; + using BPA.Helper; using System.Collections.ObjectModel; using BPASmartClient.CustomResource.Pages.Model; diff --git a/BPASmartClient.SmallBatchingSystem/ViewModels/NewOutletViewModel.cs b/BPASmartClient.SmallBatchingSystem/ViewModels/NewOutletViewModel.cs index dccec88f..bf23fe6e 100644 --- a/BPASmartClient.SmallBatchingSystem/ViewModels/NewOutletViewModel.cs +++ b/BPASmartClient.SmallBatchingSystem/ViewModels/NewOutletViewModel.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using BPA.Helper; using BPASmartClient.SmallBatchingSystem.Views; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.SmallBatchingSystem.ViewModels { diff --git a/BPASmartClient.SmallBatchingSystem/ViewModels/NewRecipeViewModel.cs b/BPASmartClient.SmallBatchingSystem/ViewModels/NewRecipeViewModel.cs index 053e8ff1..e7182de9 100644 --- a/BPASmartClient.SmallBatchingSystem/ViewModels/NewRecipeViewModel.cs +++ b/BPASmartClient.SmallBatchingSystem/ViewModels/NewRecipeViewModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; using BPA.Helper; diff --git a/BPASmartClient.SmallBatchingSystem/ViewModels/NewSiloViewModel.cs b/BPASmartClient.SmallBatchingSystem/ViewModels/NewSiloViewModel.cs index 4c5e5b0c..ec3b17ea 100644 --- a/BPASmartClient.SmallBatchingSystem/ViewModels/NewSiloViewModel.cs +++ b/BPASmartClient.SmallBatchingSystem/ViewModels/NewSiloViewModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPA.Helper; namespace BPASmartClient.SmallBatchingSystem.ViewModels diff --git a/BPASmartClient.SmallBatchingSystem/ViewModels/OutletManagementViewModel.cs b/BPASmartClient.SmallBatchingSystem/ViewModels/OutletManagementViewModel.cs index 7d0c09f6..5084903b 100644 --- a/BPASmartClient.SmallBatchingSystem/ViewModels/OutletManagementViewModel.cs +++ b/BPASmartClient.SmallBatchingSystem/ViewModels/OutletManagementViewModel.cs @@ -8,7 +8,7 @@ using BPA.Helper; using BPASmartClient.CustomResource.Pages.Model; using BPASmartClient.SmallBatchingSystem.Views; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.SmallBatchingSystem.ViewModels { diff --git a/BPASmartClient.SmallBatchingSystem/ViewModels/RecipeControlViewModel.cs b/BPASmartClient.SmallBatchingSystem/ViewModels/RecipeControlViewModel.cs index 4e2ff4e0..9c92429f 100644 --- a/BPASmartClient.SmallBatchingSystem/ViewModels/RecipeControlViewModel.cs +++ b/BPASmartClient.SmallBatchingSystem/ViewModels/RecipeControlViewModel.cs @@ -6,7 +6,7 @@ using System.Text; using System.Threading.Tasks; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.SmallBatchingSystem.Views; using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.CustomResource.UserControls; diff --git a/BPASmartClient.SmallBatchingSystem/ViewModels/RecipeViewModel.cs b/BPASmartClient.SmallBatchingSystem/ViewModels/RecipeViewModel.cs index 7c537fd5..03349639 100644 --- a/BPASmartClient.SmallBatchingSystem/ViewModels/RecipeViewModel.cs +++ b/BPASmartClient.SmallBatchingSystem/ViewModels/RecipeViewModel.cs @@ -10,7 +10,7 @@ using BPASmartClient.CustomResource.UserControls; using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.SmallBatchingSystem.Views; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.SmallBatchingSystem.ViewModels { diff --git a/BPASmartClient.SmallBatchingSystem/ViewModels/SiloManagementViewModel.cs b/BPASmartClient.SmallBatchingSystem/ViewModels/SiloManagementViewModel.cs index 179ea43d..8d256d45 100644 --- a/BPASmartClient.SmallBatchingSystem/ViewModels/SiloManagementViewModel.cs +++ b/BPASmartClient.SmallBatchingSystem/ViewModels/SiloManagementViewModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using BPASmartClient.SmallBatchingSystem.Views; using System.Collections.ObjectModel; using BPA.Helper; diff --git a/BPASmartClient.ViewModel/AdminstratorsViewModel.cs b/BPASmartClient.ViewModel/AdminstratorsViewModel.cs index 81c41359..3a59ff85 100644 --- a/BPASmartClient.ViewModel/AdminstratorsViewModel.cs +++ b/BPASmartClient.ViewModel/AdminstratorsViewModel.cs @@ -1,6 +1,6 @@ using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Linq; diff --git a/BPASmartClient.ViewModel/AlarmViewModel.cs b/BPASmartClient.ViewModel/AlarmViewModel.cs index 23ae3ae7..f2ee54c6 100644 --- a/BPASmartClient.ViewModel/AlarmViewModel.cs +++ b/BPASmartClient.ViewModel/AlarmViewModel.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; using System.Windows; using System.Threading; diff --git a/BPASmartClient.ViewModel/DebugViewModel.cs b/BPASmartClient.ViewModel/DebugViewModel.cs index 660e57df..92944aaa 100644 --- a/BPASmartClient.ViewModel/DebugViewModel.cs +++ b/BPASmartClient.ViewModel/DebugViewModel.cs @@ -1,6 +1,6 @@ using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Linq; diff --git a/BPASmartClient.ViewModel/DeviceMonitorViewModel.cs b/BPASmartClient.ViewModel/DeviceMonitorViewModel.cs index 29283eb5..9e942c05 100644 --- a/BPASmartClient.ViewModel/DeviceMonitorViewModel.cs +++ b/BPASmartClient.ViewModel/DeviceMonitorViewModel.cs @@ -10,7 +10,7 @@ using System.IO; using Newtonsoft.Json; using BPASmartClient.Model; using System.Reflection; -using Microsoft.Toolkit.Mvvm.Input; + using System.Windows; using BPASmartClient.Business; diff --git a/BPASmartClient.ViewModel/FoodMenuViewModel.cs b/BPASmartClient.ViewModel/FoodMenuViewModel.cs index ca00b776..37e9b1bb 100644 --- a/BPASmartClient.ViewModel/FoodMenuViewModel.cs +++ b/BPASmartClient.ViewModel/FoodMenuViewModel.cs @@ -2,7 +2,7 @@ using BPASmartClient.Model; using BPASmartClient.Model.小炒机; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.ViewModel/LogOrAlarmIOTViewModel.cs b/BPASmartClient.ViewModel/LogOrAlarmIOTViewModel.cs index 32fddd35..1b8d27c3 100644 --- a/BPASmartClient.ViewModel/LogOrAlarmIOTViewModel.cs +++ b/BPASmartClient.ViewModel/LogOrAlarmIOTViewModel.cs @@ -5,7 +5,7 @@ using BPA.Helper; using BPASmartClient.IoT; using DataVAPI.Tool.IOT; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.ViewModel/LogOrAlarmViewModel.cs b/BPASmartClient.ViewModel/LogOrAlarmViewModel.cs index 876ab5e5..b4860588 100644 --- a/BPASmartClient.ViewModel/LogOrAlarmViewModel.cs +++ b/BPASmartClient.ViewModel/LogOrAlarmViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/BPASmartClient.ViewModel/LogViewModel.cs b/BPASmartClient.ViewModel/LogViewModel.cs index 326f93e3..f2a57eac 100644 --- a/BPASmartClient.ViewModel/LogViewModel.cs +++ b/BPASmartClient.ViewModel/LogViewModel.cs @@ -1,10 +1,10 @@ using BPASmartClient.Business; using BPA.Helper; using BPASmartClient.IoT; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using Microsoft.Win32; using System; using System.Collections.Generic; diff --git a/BPASmartClient.ViewModel/MainViewModel.cs b/BPASmartClient.ViewModel/MainViewModel.cs index ddea9e09..8c5e6a6c 100644 --- a/BPASmartClient.ViewModel/MainViewModel.cs +++ b/BPASmartClient.ViewModel/MainViewModel.cs @@ -1,9 +1,9 @@ using BPASmartClient.Business; using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Linq; diff --git a/BPASmartClient.ViewModel/NewShopWindowModel.cs b/BPASmartClient.ViewModel/NewShopWindowModel.cs index b6c189d4..ec6bb72b 100644 --- a/BPASmartClient.ViewModel/NewShopWindowModel.cs +++ b/BPASmartClient.ViewModel/NewShopWindowModel.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using Microsoft.Toolkit.Mvvm.Messaging; using System.Windows; using System.IO; diff --git a/BPASmartClient.ViewModel/OrderListDialogViewModel.cs b/BPASmartClient.ViewModel/OrderListDialogViewModel.cs index d6676ede..03ac522c 100644 --- a/BPASmartClient.ViewModel/OrderListDialogViewModel.cs +++ b/BPASmartClient.ViewModel/OrderListDialogViewModel.cs @@ -7,7 +7,7 @@ using BPA.Message.Enum; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using Microsoft.Toolkit.Mvvm.Messaging; namespace BPASmartClient.ViewModel @@ -95,7 +95,7 @@ namespace BPASmartClient.ViewModel DoOrderEvent de = new DoOrderEvent(); de.DeviceId = int.Parse(item.DeviceId); de.MorkOrder = mo.OrderPush; - EventBus.EventBus.GetInstance().Publish(de); + EventBus.GetInstance().Publish(de); }*/ } } diff --git a/BPASmartClient.ViewModel/OrderStatusViewModel.cs b/BPASmartClient.ViewModel/OrderStatusViewModel.cs index f7e2c771..34fb42d2 100644 --- a/BPASmartClient.ViewModel/OrderStatusViewModel.cs +++ b/BPASmartClient.ViewModel/OrderStatusViewModel.cs @@ -95,10 +95,10 @@ namespace BPASmartClient.ViewModel }), "AddOrder"); - EventBus.EventBus.GetInstance().Subscribe(0, OrderStatusChangedHandle); + EventBus.GetInstance().Subscribe(0, OrderStatusChangedHandle); } - private static void OrderStatusChangedHandle(IEvent @event, EventBus.EventBus.EventCallBackHandle callBack) + private static void OrderStatusChangedHandle(IEvent @event, EventBus.EventCallBackHandle callBack) { OrderStatusChangedEvent orderStatusChange = @event as OrderStatusChangedEvent; int index = Array.FindIndex(orderStatusLists.ToArray(), p => p.OrderPush.SuborderId == orderStatusChange.SubOrderId); diff --git a/BPASmartClient.ViewModel/ShopDeviceConfigViewModel.cs b/BPASmartClient.ViewModel/ShopDeviceConfigViewModel.cs index edace7b6..69ed8af5 100644 --- a/BPASmartClient.ViewModel/ShopDeviceConfigViewModel.cs +++ b/BPASmartClient.ViewModel/ShopDeviceConfigViewModel.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System.Collections.ObjectModel; using System.ComponentModel; using System.Runtime.CompilerServices; diff --git a/BPASmartClient.ViewModel/SystemSetViewModel.cs b/BPASmartClient.ViewModel/SystemSetViewModel.cs index 45d2914d..00d90003 100644 --- a/BPASmartClient.ViewModel/SystemSetViewModel.cs +++ b/BPASmartClient.ViewModel/SystemSetViewModel.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + namespace BPASmartClient.ViewModel { diff --git a/BPASmartClient/App.xaml.cs b/BPASmartClient/App.xaml.cs index 802c62ad..80c5585b 100644 --- a/BPASmartClient/App.xaml.cs +++ b/BPASmartClient/App.xaml.cs @@ -3,7 +3,7 @@ using BPA.Message.Enum; using BPASmartClient.CustomResource; using BPASmartClient.CustomResource.Pages.Model; using BPA.Helper; -using BPASmartClient.Message; + using BPASmartClient.Model; using System; using System.Collections.Generic; diff --git a/BPASmartClient/MainWindow.xaml.cs b/BPASmartClient/MainWindow.xaml.cs index 419513cf..10e4f9ed 100644 --- a/BPASmartClient/MainWindow.xaml.cs +++ b/BPASmartClient/MainWindow.xaml.cs @@ -7,7 +7,7 @@ using BPASmartClient.Device; using BPA.Helper; using BPASmartClient.IoT; -using BPASmartClient.Message; + using BPASmartClient.Model; using BPASmartClient.Model.冰淇淋.Enum; using BPASmartClient.Model.咖啡机.Enum; diff --git a/FryPot_DosingSystem/ViewModel/AdministratorLoginViewModel.cs b/FryPot_DosingSystem/ViewModel/AdministratorLoginViewModel.cs index 5b4aa0e4..a04f9e06 100644 --- a/FryPot_DosingSystem/ViewModel/AdministratorLoginViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/AdministratorLoginViewModel.cs @@ -2,7 +2,7 @@ using BPA.Helper; using FryPot_DosingSystem.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using Newtonsoft.Json; using System; using System.Collections.ObjectModel; diff --git a/FryPot_DosingSystem/ViewModel/CopyInfoViewModel.cs b/FryPot_DosingSystem/ViewModel/CopyInfoViewModel.cs index 2e3b23f3..2b06ac01 100644 --- a/FryPot_DosingSystem/ViewModel/CopyInfoViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/CopyInfoViewModel.cs @@ -1,7 +1,7 @@  using BPA.Helper; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Linq; diff --git a/FryPot_DosingSystem/ViewModel/DebugViewModel.cs b/FryPot_DosingSystem/ViewModel/DebugViewModel.cs index 198c780d..c2b5cec2 100644 --- a/FryPot_DosingSystem/ViewModel/DebugViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/DebugViewModel.cs @@ -1,7 +1,7 @@ using BPA.Helper; using FryPot_DosingSystem.Control; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/FryPot_DosingSystem/ViewModel/DeviceListViewModel.cs b/FryPot_DosingSystem/ViewModel/DeviceListViewModel.cs index e010ea3f..5a8c0f0c 100644 --- a/FryPot_DosingSystem/ViewModel/DeviceListViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/DeviceListViewModel.cs @@ -3,7 +3,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow; using BPA.Helper; using FryPot_DosingSystem.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs b/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs index ce0e81e0..300e5d3c 100644 --- a/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs @@ -4,7 +4,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow; using BPA.Helper; using FryPot_DosingSystem.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/FryPot_DosingSystem/ViewModel/LabelPrintViewModel.cs b/FryPot_DosingSystem/ViewModel/LabelPrintViewModel.cs index efa91a84..6977aa85 100644 --- a/FryPot_DosingSystem/ViewModel/LabelPrintViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/LabelPrintViewModel.cs @@ -1,5 +1,5 @@ using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Linq; diff --git a/FryPot_DosingSystem/ViewModel/LogViewModel.cs b/FryPot_DosingSystem/ViewModel/LogViewModel.cs index b93fd53b..f37f79eb 100644 --- a/FryPot_DosingSystem/ViewModel/LogViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/LogViewModel.cs @@ -1,4 +1,4 @@ -using BPASmartClient.Message; + using FryPot_DosingSystem.Model; using BPA.Helper; using System; diff --git a/FryPot_DosingSystem/ViewModel/MainViewModel.cs b/FryPot_DosingSystem/ViewModel/MainViewModel.cs index de570274..461a193d 100644 --- a/FryPot_DosingSystem/ViewModel/MainViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/MainViewModel.cs @@ -4,7 +4,7 @@ using FryPot_DosingSystem.Control; using FryPot_DosingSystem.Model; using FryPot_DosingSystem.View; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/FryPot_DosingSystem/ViewModel/NewFryPotMaterialViewModel.cs b/FryPot_DosingSystem/ViewModel/NewFryPotMaterialViewModel.cs index acfe80a5..749751e5 100644 --- a/FryPot_DosingSystem/ViewModel/NewFryPotMaterialViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/NewFryPotMaterialViewModel.cs @@ -4,7 +4,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow; using BPA.Helper; using FryPot_DosingSystem.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Linq; diff --git a/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs b/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs index 7d3ff61e..60c1e819 100644 --- a/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs @@ -4,7 +4,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow; using BPA.Helper; using FryPot_DosingSystem.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs b/FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs index 91fecced..3dfc93e3 100644 --- a/FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs @@ -1,10 +1,10 @@ using BPASmartClient.CustomResource.UserControls; using BPASmartClient.CustomResource.UserControls.MessageShow; using BPA.Helper; -using BPASmartClient.Message; + using FryPot_DosingSystem.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs b/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs index 25354232..3c996ef9 100644 --- a/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs @@ -5,7 +5,7 @@ using BPA.Helper; using FryPot_DosingSystem.Model; using FryPot_DosingSystem.View; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/FryPot_DosingSystem/ViewModel/SqliteDataViewModel.cs b/FryPot_DosingSystem/ViewModel/SqliteDataViewModel.cs index b642c53e..b77268d6 100644 --- a/FryPot_DosingSystem/ViewModel/SqliteDataViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/SqliteDataViewModel.cs @@ -1,7 +1,7 @@ using BPA.Helper; using FryPot_DosingSystem.FryPotStatus; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/FryPot_DosingSystem/ViewModel/UserManageViewModel.cs b/FryPot_DosingSystem/ViewModel/UserManageViewModel.cs index fa160125..5930f449 100644 --- a/FryPot_DosingSystem/ViewModel/UserManageViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/UserManageViewModel.cs @@ -2,7 +2,7 @@ using BPASmartClient.CustomResource.Pages.Enums; using BPASmartClient.CustomResource.Pages.Model; using BPA.Helper; -using Microsoft.Toolkit.Mvvm.Input; + using Newtonsoft.Json; using System; using System.Collections.Generic;