From fa92389a58b5133952319e64e966872d51d34f36 Mon Sep 17 00:00:00 2001 From: NXX <447201003@qq> Date: Wed, 6 Jul 2022 09:47:28 +0800 Subject: [PATCH 1/7] morkTM --- BPASmartClient.MorkT/Control_MorkT.cs | 28 +++++++++---------- .../ViewModel/DebugViewModel.cs | 4 +-- BPASmartClient.MorkTM/Control_MorkTM.cs | 8 +++++- BPASmartClient/MainWindow.xaml | 4 +-- SmartClient.sln | 23 +++++++++++++++ 5 files changed, 48 insertions(+), 19 deletions(-) diff --git a/BPASmartClient.MorkT/Control_MorkT.cs b/BPASmartClient.MorkT/Control_MorkT.cs index d9f7bd61..c4ee4d6e 100644 --- a/BPASmartClient.MorkT/Control_MorkT.cs +++ b/BPASmartClient.MorkT/Control_MorkT.cs @@ -76,21 +76,21 @@ namespace BPASmartClient.MorkT public override void MainTask() { - if (morkTime.AddMinutes(Global.TimeInterval).Minute == DateTime.Now.Minute) - { - morkTime = DateTime.Now; - 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_自嗨 }); - Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); - Thread.Sleep(50); - } + //if (morkTime.AddMinutes(Global.TimeInterval).Minute == DateTime.Now.Minute) + //{ + // morkTime = DateTime.Now; + // 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_自嗨 }); + // Wait(); + // EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); + // Thread.Sleep(50); + // } - } - else if (morkTime.AddMinutes(Global.TimeInterval) < DateTime.Now) morkTime = DateTime.Now; + //} + //else if (morkTime.AddMinutes(Global.TimeInterval) < DateTime.Now) morkTime = DateTime.Now; #region morkt流程 //if (morkT.waitMorkOrder != null)//更新订单取走状态 //{ diff --git a/BPASmartClient.MorkT/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkT/ViewModel/DebugViewModel.cs index a460bf13..affaa52b 100644 --- a/BPASmartClient.MorkT/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkT/ViewModel/DebugViewModel.cs @@ -244,9 +244,9 @@ namespace BPASmartClient.MorkT.ViewModel //EventBus.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.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, Value = true, Pin = 1 }); Thread.Sleep(500); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, bDO = false, pin = 1 }); + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, Value = false, Pin = 1 }); } diff --git a/BPASmartClient.MorkTM/Control_MorkTM.cs b/BPASmartClient.MorkTM/Control_MorkTM.cs index 30dfb988..c4d43d15 100644 --- a/BPASmartClient.MorkTM/Control_MorkTM.cs +++ b/BPASmartClient.MorkTM/Control_MorkTM.cs @@ -158,7 +158,13 @@ namespace BPASmartClient.MorkTM public override void SimOrder() { - throw new NotImplementedException(); + ActionManage.GetInstance.Register(new Action((o) => + { + if (o is string goodName) + { + + } + }), ""); } public override void Stop() diff --git a/BPASmartClient/MainWindow.xaml b/BPASmartClient/MainWindow.xaml index 5a7f237d..4f4b055e 100644 --- a/BPASmartClient/MainWindow.xaml +++ b/BPASmartClient/MainWindow.xaml @@ -55,7 +55,7 @@ + Visibility="Visible">