From e2cf0a01610ff2f333a15c39b12f194dcee5207d Mon Sep 17 00:00:00 2001 From: taoye Date: Thu, 19 May 2022 13:29:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=82=92=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BPASmartClient.MorkF/Control_MorkF.cs | 793 ++++++++++++--------- BPASmartClient.MorkF/OrderLocInfo.cs | 2 +- BPASmartClient.ViewModel/DebugViewModel.cs | 53 ++ BPASmartClient/Control/DebugView.xaml | 45 ++ BPASmartClient/Control/DebugView.xaml.cs | 30 + BPASmartClient/DeviceInfo.xml | 30 +- BPASmartClient/MainWindow.xaml | 8 +- 7 files changed, 592 insertions(+), 369 deletions(-) create mode 100644 BPASmartClient.ViewModel/DebugViewModel.cs create mode 100644 BPASmartClient/Control/DebugView.xaml create mode 100644 BPASmartClient/Control/DebugView.xaml.cs diff --git a/BPASmartClient.MorkF/Control_MorkF.cs b/BPASmartClient.MorkF/Control_MorkF.cs index 321e375e..51d6a30b 100644 --- a/BPASmartClient.MorkF/Control_MorkF.cs +++ b/BPASmartClient.MorkF/Control_MorkF.cs @@ -9,6 +9,7 @@ using BPASmartClient.Model.PLC; using BPA.Models; using static BPASmartClient.EventBus.EventBus; + namespace BPASmartClient.MorkF { public class Control_MorkF : BaseDevice @@ -17,29 +18,217 @@ namespace BPASmartClient.MorkF GVL_MorkF morkF = new GVL_MorkF();//全局对象声明 public StirFryBom stirFryBom = new StirFryBom();//创建获取流程的对象 - //public bool ProcessError { get; set; }//流程错误 + List resultorder = new List();//调试变量 + public static readonly object taskLock = new object(); /// /// 入口 /// public override void DoMain() { + CommandRegist();//调试 ServerInit(); DataParse();//数据解析 - ThreadManage.GetInstance().StartLong(new Action(() => + MessageLog.GetInstance.Show("MORKF 设备初始化完成"); + } + #region 调试代码 + public void CommandRegist() + { + ActionManage.GetInstance.Register(PLCInite, "InitCommand"); + ActionManage.GetInstance.Register(InitialData, "SimultaorOrder"); + ActionManage.GetInstance.Register(TakePot, "TakePot"); + ActionManage.GetInstance.Register(TakePotReset, "TakePotReset"); + ActionManage.GetInstance.Register(TakeOff, "TakeOff"); + ActionManage.GetInstance.Register(OneBlock, "OneBlock"); + ActionManage.GetInstance.Register(TwoBlock, "TwoBlock"); + ActionManage.GetInstance.Register(ThreeBlock, "ThreeBlock"); + ActionManage.GetInstance.Register(OverTurnOff, "OverTurnOff"); + ActionManage.GetInstance.Register(OverOneBlock, "OverOneBlock"); + ActionManage.GetInstance.Register(OverTwoBlock, "OverTwoBlock"); + ActionManage.GetInstance.Register(OverThreeBlock, "OverThreeBlock"); + ActionManage.GetInstance.Register(OverGoOn, "OverGoOn"); + ActionManage.GetInstance.Register(OverGoDown, "OverGoDown"); + ActionManage.GetInstance.Register(ShreddCabbage, "ShreddCabbage"); + ActionManage.GetInstance.Register(FryPork, "FryPork"); + ActionManage.GetInstance.Register(XingBaoGu, "XingBaoGu"); + } + /// + /// 手撕包菜流程 + /// + public void ShreddCabbage() + { + if (stirFryBom.StirFryActions.Count > 0) { - IsHealth = true; - ReadData(); - Thread.Sleep(10); - }), "ReadPLCData"); - ThreadManage.GetInstance().StartLong(new Action(() => + stirFryBom.StirFryActions.Clear(); + } + //流程 + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T1, RobotActions = new List() { StirFryRobotAction.清洗槽取锅 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T2, PotActions = new List() { StirFryPotAction.中火持续, StirFryPotAction.加油, StirFryPotAction.搅拌臂下位, StirFryPotAction.低速旋转 }, During = 25 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T3, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T5, PotActions = new List() { StirFryPotAction.搅拌臂下位, StirFryPotAction.大火持续, StirFryPotAction.低速旋转 }, During = 5 }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6, PotActions = new List() { StirFryPotAction.快速旋转 }, During = 50 }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T7, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T4, RobotActions = new List() { StirFryRobotAction.加入A料 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T5, PotActions = new List() { StirFryPotAction.大火持续, StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 25 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T7, RobotActions = new List() { StirFryRobotAction.加入B料 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T5, PotActions = new List() { StirFryPotAction.大火持续, StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 15 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T8, RobotActions = new List() { StirFryRobotAction.加入C料 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T9, PotActions = new List() { StirFryPotAction.大火持续, StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 55 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T10, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T11, RobotActions = new List() { StirFryRobotAction.灶取锅 } }); + } + /// + /// 盐煎肉流程 + /// + public void FryPork() + { + if (stirFryBom.StirFryActions.Count > 0) { - MainTask(); - Thread.Sleep(10); - }), "MainTask"); + stirFryBom.StirFryActions.Clear(); + } + //流程 + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T1, RobotActions = new List() { StirFryRobotAction.清洗槽取锅 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T2, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.搅拌臂下位, StirFryPotAction.低速旋转 }, During = 15 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T3, PotActions = new List() { StirFryPotAction.加油, StirFryPotAction.停止火力 }, During = 19 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T4, PotActions = new List() { StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T5, RobotActions = new List() { StirFryRobotAction.加入A料 } }); + + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6, PotActions = new List() { StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 20 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T7, PotActions = new List() { StirFryPotAction.停止火力 }, During = 35 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T8, PotActions = new List() { StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位, } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T9, RobotActions = new List() { StirFryRobotAction.加入B料 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T10, PotActions = new List() { StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 22 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T11, PotActions = new List() { StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T12, RobotActions = new List() { StirFryRobotAction.加入C料 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T13, PotActions = new List() { StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 70 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T14, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T15, RobotActions = new List() { StirFryRobotAction.灶取锅 } }); + } + /// + /// 酱烧杏鲍菇流程 + /// + public void XingBaoGu() + { + if (stirFryBom.StirFryActions.Count > 0) + { + stirFryBom.StirFryActions.Clear(); + } + //流程 + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T1, RobotActions = new List() { StirFryRobotAction.清洗槽取锅 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T2, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.搅拌臂下位, StirFryPotAction.低速旋转 }, During = 5 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T3, PotActions = new List() { StirFryPotAction.加油 }, During = 12 }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T4, PotActions = new List() { StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T5, RobotActions = new List() { StirFryRobotAction.加入A料 } }); - MessageLog.GetInstance.Show("MORKF 设备初始化完成"); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6, PotActions = new List() { StirFryPotAction.搅拌臂下位, StirFryPotAction.低速旋转 }, During = 25 }); + + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T7, PotActions = new List() { StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T8, RobotActions = new List() { StirFryRobotAction.加入B料 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T9, PotActions = new List() { StirFryPotAction.搅拌臂下位, StirFryPotAction.低速旋转 }, During = 30 }); + + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T10, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T11, RobotActions = new List() { StirFryRobotAction.灶取锅 } }); + } + public void TakePot() + { + + WriteData("M14.0", true); } + public void TakePotReset() + { + + WriteData("M14.0", false); + } + public void TakeOff() + { + WriteData("M4.0", new bool[] { false, false, false, false, false, false, false, false });//0000 0001 + } + + public void OneBlock() + { + //WriteData("M13.1", true); + // WriteData("M4.0", new bool[] { true, false, false, false, false, false, false, false });//0000 0001 + //WriteData("M0.7", false);//无订单关闭抽风机 + WriteData("M13.0", true); + + } + public void TwoBlock() + { + //WriteData("M13.1", false); + WriteData("M4.0", new bool[] { false, true, false, false, false, false, false, false });//0000 0001 + + } + public void ThreeBlock() + { + // WriteData("M4.0", new bool[] { true, true, false, false, false, false, false, false });//0000 0001 + WriteData("M4.0", new bool[] { false, true, true, false, false, false, false, false }); + } + public void OverTurnOff() + { + WriteData("M7.0", true); + } + public void OverOneBlock() + { + WriteData("M7.1", true); + } + public void OverTwoBlock() + { + WriteData("M7.2", true); + } + public void OverThreeBlock() + { + WriteData("M7.3", true); + } + public void OverGoOn() + { + WriteData("M8.0", true); + } + + public void OverGoDown() + { + WriteData("M8.2", true); + } + public void FlowInite() + { + + } + /// + /// 订单初始化 + /// + private void InitialData() + { + ////模拟流程 + //if (stirFryBom.StirFryActions.Count > 0) + //{ + // stirFryBom.StirFryActions.Clear(); + //} + ////流程 + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T1, RobotActions = new List() { StirFryRobotAction.清洗槽取锅 } }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T2, PotActions = new List() { StirFryPotAction.停止火力 }, During = 3 }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T3, PotActions = new List() { StirFryPotAction.加油, StirFryPotAction.停止火力 }, During = 3 }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T4, PotActions = new List() { StirFryPotAction.搅拌臂下位, StirFryPotAction.停止火力, StirFryPotAction.低速旋转 }, During = 15 }); + + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T5, RobotActions = new List() { StirFryRobotAction.加入A料, }, PotActions = new List() { StirFryPotAction.停止旋转 } }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6, PotActions = new List() { StirFryPotAction.快速旋转, StirFryPotAction.停止火力 }, During = 5 }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T7, RobotActions = new List() { StirFryRobotAction.加入B料, }, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转 } }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T8, PotActions = new List() { StirFryPotAction.快速旋转, StirFryPotAction.停止火力 }, During = 5 }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T9, RobotActions = new List() { StirFryRobotAction.加入C料, }, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转 } }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T10, PotActions = new List() { StirFryPotAction.快速旋转, StirFryPotAction.停止火力 }, During = 3 }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T11, PotActions = new List() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } }); + //stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T12, RobotActions = new List() { StirFryRobotAction.灶取锅 } }); + //队列 + string subId = Guid.NewGuid().ToString(); + morkF.TakeMaterialQueue.Enqueue(new OrderLocInfo() { SuborderId = subId, MaterialLoc = 1 });//A料 + morkF.TakeMaterialQueue.Enqueue(new OrderLocInfo() { SuborderId = subId, MaterialLoc = 2 });//B料 + morkF.TakeMaterialQueue.Enqueue(new OrderLocInfo() { SuborderId = subId, MaterialLoc = 3 });//C料 + morkF.TakePlateQueue.Enqueue(new OrderLocInfo() { SuborderId = subId }); + resultorder.AddRange(new int[] { 1, 2, 3 }); + } + #endregion + public override void ResetProgram() { morkF = null; @@ -51,8 +240,7 @@ namespace BPASmartClient.MorkF /// public override void ReadData() { - //ThreadManage.GetInstance().StartLong(new Action(() => - //{ + GetStatus("M0.1", new Action((bools) => { Initing = bools[0]; @@ -83,12 +271,11 @@ namespace BPASmartClient.MorkF { morkF.PutPotToKitchenComlete = bools[1]; morkF.TakeMaterialComplete = bools[2]; + morkF.FallMaterialComplete = bools[3]; morkF.PlaceRinseTableComplete = bools[5]; morkF.RoobotIdle = bools[6]; })); - // Thread.Sleep(500); - //}), "ReadPLCData"); } private void ServerInit() { @@ -185,13 +372,11 @@ namespace BPASmartClient.MorkF } } + //根据ID 查找对应制作流程 } }); } - - - //} /// /// 主任务 @@ -211,7 +396,7 @@ namespace BPASmartClient.MorkF morkF.ProcessExcuteLock = true; Task.Run(new Action(() => { - if (!morkF.RoobotIdle && morkF.InitialComplete && morkF.TakeMaterialQueue.Count > 0 && morkF.TakePlateQueue.Count > 0) + if (!morkF.RoobotIdle && morkF.InitialComplete && morkF.TakeMaterialQueue.Count > 0) { foreach (var res in stirFryBom.StirFryActions)//遍历所有流程 { @@ -226,21 +411,23 @@ namespace BPASmartClient.MorkF case StirFryRobotAction.清洗槽取锅: TakePotTask();//执行取锅操作 break; - case StirFryRobotAction.取A料: + case StirFryRobotAction.加入A料: TakeBurdenATask();//执行取A料操作 break; case StirFryRobotAction.加入B料: - TakeBurdenBTask();//执行取B料操作 + // TakeBurdenBTask();//执行取B料操作 + TakeBurdenATask();//执行取B料操作 break; case StirFryRobotAction.加入C料: - TakeBurdenCTask();//执行取C料操作 + //TakeBurdenCTask();//执行取C料操作 + TakeBurdenATask();//执行取C料操作 break; case StirFryRobotAction.灶取锅: OutDishTask();//执行出餐操作 CleanPotTask();//洗锅操作 break; } - // Task.Delay(2000).Wait();//单一操作延时 + } })); @@ -267,8 +454,11 @@ namespace BPASmartClient.MorkF case StirFryPotAction.小火持续: KitchenAdjustGears(1); break; + case StirFryPotAction.中火持续: + KitchenAdjustGears(5); + break; case StirFryPotAction.大火持续: - KitchenAdjustGears(3); + KitchenAdjustGears(6); break; case StirFryPotAction.停止火力: KitchenAdjustGears(0);//关闭灶加热 @@ -283,18 +473,18 @@ namespace BPASmartClient.MorkF TurnMachineGearsControl(1);//执行搅拌臂速度1挡操作 break; case StirFryPotAction.快速旋转: - TurnMachineGearsControl(3);//执行搅拌臂速度3挡操作 + TurnMachineGearsControl(2);//执行搅拌臂速度3挡操作 break; case StirFryPotAction.停止旋转: TurnMachineGearsControl(0);//执行搅拌臂速度0挡操作 break; } - // Task.Delay(2000).Wait();//单一操作延时 } })); - Task.WhenAll(taskRobot, taskPot);//等待所有线程结束 - Task.Delay(res.During).Wait();//当前流程延迟 + Task.WhenAll(taskRobot, taskPot).Wait();//等待所有线程结束 + Task.Delay(res.During * 1000).Wait();//当前流程延迟 } + morkF.OutMealComplete = true; } else { @@ -328,20 +518,38 @@ namespace BPASmartClient.MorkF private void TurntableControl() { //正常轮询 + //if (morkF.TakeMaterialQueue.Count > 0 && !morkF.TurnTableLock) + //{ + // var result = orderMaterialDelivery.BatchingInfo.Where(p => p.BatchingId == morkF.TakeMaterialQueue.ElementAt(0).BatchingId).ToList(); + + // if (result != null) + // { + // if (ushort.TryParse(result[0].BatchingLoc, out ushort loc)) + // { + // TurnMaterialStore(loc); + // MessageLog.GetInstance.Show($"转台转到【{loc}】位置"); + // morkF.TurnTableLock = true; //取料完成后置false + // } + // } + // else MessageLog.GetInstance.Show("未找到可用的物料信息"); + //} + + //调试代码 if (morkF.TakeMaterialQueue.Count > 0 && !morkF.TurnTableLock) { - var result = orderMaterialDelivery.BatchingInfo.Where(p => p.BatchingId == morkF.TakeMaterialQueue.ElementAt(0).BatchingId).ToList(); - if (result != null) + // var result = orderMaterialDelivery.BatchingInfo.Where(p => p.BatchingId == morkF.TakeMaterialQueue.ElementAt(0).BatchingId).ToList(); + if (resultorder != null) { - if (ushort.TryParse(result[0].BatchingLoc, out ushort loc)) - { - TurnMaterialStore(loc); - MessageLog.GetInstance.Show($"转台转到【{loc}】位置"); - morkF.TurnTableLock = true; //取料完成后置false - } + + TurnMaterialStore(resultorder[0]); + MessageLog.GetInstance.Show($"转台转到【{resultorder[0]}】位置"); + resultorder.RemoveAt(0); + morkF.TurnTableLock = true; //取料完成后置false + } else MessageLog.GetInstance.Show("未找到可用的物料信息"); } + } @@ -360,142 +568,118 @@ namespace BPASmartClient.MorkF morkF.CurrentOrderId = order.SuborderId; morkF.TakePlateLock = true; //订单完成后置false morkF.OutMealComplete = false; - OrderChange(morkF.CurrentOrderId, ORDER_STATUS.COOKING); + // OrderChange(morkF.CurrentOrderId, ORDER_STATUS.COOKING); MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】执行取碗控制"); } - - } - else - { - MessageLog.GetInstance.ShowEx($"订单【{ morkF.CurrentOrderId}】取碗失败"); - } - } /// /// 取锅到灶台 /// /// - private async void TakePotTask() + private void TakePotTask() { - - if (morkF.TakePlateQueue.Count > 0) + while (!(!morkF.CleanModule && !morkF.KitchenOneStatus && morkF.CleanComplete))//等待清洗1准备就绪 { - while (!(!morkF.CleanModule && morkF.CleanComplete && !morkF.KitchenOneStatus))//等待清洗1准备就绪 - { - Task.Delay(5).Wait(); - } - while (morkF.RoobotIdle)//等待机器人空闲 - { - Task.Delay(5).Wait(); - } - TakePotToKitchen(); - // morkF.TakePotLock = true; //订单完成后置false - EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M1.5", Value = false });//清洗模组1完成复位 - MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】执行取锅到灶台控制"); - while (!morkF.PutPotToKitchenComlete) - { - Task.Delay(5).Wait(); - } - morkF.PotInPlace = morkF.PutPotToKitchenComlete;//锅到位 - + Task.Delay(5).Wait(); + } + while (morkF.RoobotIdle)//等待机器人空闲 + { + Task.Delay(5).Wait(); + } + TakePotToKitchen(); + WriteData("M1.5", false);//清洗模组1完成复位 + MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】执行取锅到灶台控制"); + while (!morkF.PutPotToKitchenComlete) + { + Task.Delay(5).Wait(); } + morkF.PotInPlace = morkF.PutPotToKitchenComlete;//锅到位 + WriteData("M14.0", false);//机器人取锅完成复位 + + Thread.Sleep(2000); + + + + } + /// + /// 转台复位 + /// + /// + public void TurnReset(int loc) + { + switch (loc) + { + case 1: WriteData("M13.0", false); break; + case 2: WriteData("M13.1", false); break; + case 3: WriteData("M13.2", false); break; + case 4: WriteData("M13.3", false); break; + case 5: WriteData("M13.4", false); break; + } } /// /// 取素菜A料 /// private void TakeBurdenATask() { - if (morkF.TakeMaterialQueue.Count > 0) + int loc = 0; + while (morkF.RoobotIdle || !morkF.PotInPlace || !morkF.MaterialArriveComplete)//等待机器人空闲以及锅到位 { - TurnUpStatusDetect(); - //while (!morkF.TurnMachineUpComplete)//等待翻转机上升完成以及取料完成 - //{ - // Task.Delay(5).Wait(); - //} - //EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.1", Value = false });//翻转机上升完成复位 - //MessageLog.GetInstance.Show($"翻转机上升执行完成"); - while (morkF.RoobotIdle || !morkF.PotInPlace)//等待机器人空闲以及锅到位 - { - Task.Delay(5).Wait(); - } - if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order)) - { - int loc = order.MaterialLoc; - TakeBurden(loc); - //morkF.TakeVegALock = true;//订单完成置false - // morkF.AllowTakeMaterial = false; + Task.Delay(5).Wait(); + } + if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order)) + { + loc = order.MaterialLoc; + TakeBurden(loc); + TurnReset(loc);//转台复位 - MessageLog.GetInstance.Show($"订单【{ order.SuborderId},执行取A料"); - } - //等待取料完成 - while (!morkF.TakeMaterialComplete) - { - Task.Delay(5).Wait(); - } - //转台互锁解除 - if (morkF.TurnTableLock) - { - morkF.TurnTableLock = false; - } + MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,执行到转台{loc}位置取料"); } + //等待取料完成 + while (!morkF.TakeMaterialComplete) + { + Task.Delay(5).Wait(); + } + WriteData("M14.1", false);//机器人取料完成复位 + morkF.TurnTableLock = false;//转台互锁解除 + while (!morkF.FallMaterialComplete)//等待倒料完成 + { + Task.Delay(5).Wait(); + } + MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,转台{loc}配料倒料完成"); + } - ///// - ///// 取荤菜A料 - ///// - //private void TakeBurdenATask() - //{ - // if (!morkF.RoobotIdle && morkF.PotInPlace && morkF.TurnMachineUpComplete && morkF.TakeVegALock && !morkF.TakeMeatALock && morkF.AllowTakeMaterial&& morkF.TakeMaterialQueue.Count > 0) - // { - // if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order)) - // { - // int loc = 0; - // TakeBurden(loc); - // morkF.TakeMeatALock = true;//订单完成置false - // morkF.AllowTakeMaterial = false; - // MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,,翻转机上升完成,执行取荤菜A控制"); - // } - // } - //} /// /// 取素菜B料 /// private void TakeBurdenBTask() { - if (morkF.TakeMaterialQueue.Count > 0) + while (morkF.RoobotIdle || !morkF.PotInPlace || !morkF.MaterialArriveComplete)//等待机器人空闲以及锅到位 { - TurnUpStatusDetect(); - //while (!morkF.TurnMachineUpComplete)//等待翻转机上升完成以及取料完成 - //{ - // Task.Delay(5).Wait(); - //} - //EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.1", Value = false });//翻转机上升完成复位 - //MessageLog.GetInstance.Show($"翻转机上升执行完成"); - while (morkF.RoobotIdle || !morkF.PotInPlace)//等待机器人空闲以及锅到位 - { - Task.Delay(5).Wait(); - } - if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order)) - { - int loc = order.MaterialLoc; - TakeBurden(loc); - //morkF.TakeVegBLock = true;//订单完成置false - //morkF.AllowTakeMaterial = false; - MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,,翻转机上升完成,执行取素菜B控制"); - } - //等待取料完成 - while (!morkF.TakeMaterialComplete) - { - Task.Delay(5).Wait(); - } - //转台互锁解除 - if (morkF.TurnTableLock) - { - morkF.TurnTableLock = false; - } + Task.Delay(5).Wait(); } + if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order)) + { + int loc = order.MaterialLoc; + TakeBurden(loc); + TurnReset(loc);//转台复位 + MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,执行取B料"); + } + //等待取料完成 + while (!morkF.TakeMaterialComplete) + { + Task.Delay(5).Wait(); + } + + WriteData("M14.1", false);//机器人取料完成复位 + morkF.TurnTableLock = false;//转台互锁解除 + while (!morkF.FallMaterialComplete)//等待倒料完成 + { + Task.Delay(5).Wait(); + } + MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,B料倒料完成"); } /// /// 取调味品C料 @@ -503,114 +687,47 @@ namespace BPASmartClient.MorkF /// private void TakeBurdenCTask() { - if (morkF.TakeMaterialQueue.Count > 0) + while (morkF.RoobotIdle || !morkF.PotInPlace || !morkF.MaterialArriveComplete)//等待机器人空闲以及锅到位 { - TurnUpStatusDetect(); - //while (!morkF.TurnMachineUpComplete)//等待翻转机上升完成以及取料完成 - //{ - // Task.Delay(5).Wait(); - //} - //EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.1", Value = false });//翻转机上升完成复位 - //MessageLog.GetInstance.Show($"翻转机上升执行完成"); - while (morkF.RoobotIdle || !morkF.PotInPlace)//等待机器人空闲以及锅到位 - { - Task.Delay(5).Wait(); - } - if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order)) - { - int loc = order.MaterialLoc; - TakeBurden(loc); - //morkF.TakeBurdenCLcok = true;//订单完成置false - //morkF.AllowTakeMaterial = false; - //morkF.TakeAllBurdenComplete = false; - MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,,翻转机上升完成,执行取调味品C料控制"); - } - //等待取料完成 - while (!morkF.TakeMaterialComplete) - { - Task.Delay(5).Wait(); - } - //转台互锁解除 - if (morkF.TurnTableLock) - { - morkF.TurnTableLock = false; - } + Task.Delay(5).Wait(); } - } - /// - /// 开始烹饪 - /// - /// - private void StartCookingTask() - { - if (morkF.InitialComplete && morkF.TakeMaterialQueue.Count > 0 && morkF.PutPotToKitchenComlete && !morkF.CookingLock) + if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order)) { - MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】开始烹饪"); - morkF.CookingLock = true; - morkF.PotInPlace = morkF.PutPotToKitchenComlete;//锅到位 - Task.Run(new Action(() => - { - KitchenAdjustGears(3); - Task.Delay(1000).Wait(); //大火加热1s - AddOil();//注油 - KitchenAdjustGears(2); - Task.Delay(2000).Wait(); //中火2s - TurnDownStatusDetect();//翻转机下降及检测 - KitchenAdjustGears(1);//灶台1挡 - TurnMachineGearsControl(1);//翻炒机1挡 - Task.Delay(2000).Wait(); - TurnMachineGearsControl(0);//关闭翻炒机 - TurnUpStatusDetect();//翻转机上升及检测 - TurnDownStatusDetect();//翻转机下降及检测 - KitchenAdjustGears(3);//灶台3挡 - TurnMachineGearsControl(3);//翻炒机3挡 - Task.Delay(2000).Wait();//葱姜蒜断生 - KitchenAdjustGears(1);//灶台1挡 - TurnMachineGearsControl(0);//关闭翻炒机 - TurnUpStatusDetect();//翻转机上升及检测 - TurnDownStatusDetect();//翻转机下降及检测 - KitchenAdjustGears(3);//灶台3挡 - TurnMachineGearsControl(3);//翻炒机3挡 - Task.Delay(2000).Wait();//B料断生 - KitchenAdjustGears(1);//灶台1挡 - TurnMachineGearsControl(0);//关闭翻炒机 - TurnUpStatusDetect();//翻转机上升及检测 - TurnDownStatusDetect();//翻转机下降及检测 - KitchenAdjustGears(2);//灶台3挡 - TurnMachineGearsControl(3);//翻炒机3挡 - Task.Delay(2000).Wait();//煸炒入味 - KitchenAdjustGears(0);//灶台0挡 - TurnMachineGearsControl(0);//关闭翻炒机 - TurnMachineOrientControl("Top");//翻转机上升 - while (!morkF.TurnMachineUpComplete) - { - Task.Delay(5).Wait(); - } - EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.1", Value = false }); - morkF.CookingComplete = true; //烹饪完成 - MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】烹饪完成"); - })); + int loc = order.MaterialLoc; + TakeBurden(loc); + TurnReset(loc);//转台复位 + MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,执行取C料"); } + MessageLog.GetInstance.ShowEx($"剩余配料数量{morkF.TakeMaterialQueue.Count}"); + //等待取料完成 + while (!morkF.TakeMaterialComplete) + { + Task.Delay(5).Wait(); + } + WriteData("M14.1", false);//机器人取料完成复位 + morkF.TurnTableLock = false;//转台互锁解除 + while (!morkF.FallMaterialComplete) + { + Task.Delay(5).Wait(); + } + MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,C料倒料完成"); + //} } - /// /// 出餐 /// private void OutDishTask() { - TurnUpStatusDetect(); - //while (!morkF.TurnMachineUpComplete)//等待翻转机上升完成以及取料完成 - //{ - // Task.Delay(5).Wait(); - //} - //EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.1", Value = false });//翻转机上升完成复位 - //MessageLog.GetInstance.Show($"翻转机上升执行完成"); while (morkF.RoobotIdle || morkF.CleanModule || !morkF.ProvidePlateComplete)//等待条件满足 { Task.Delay(5).Wait(); } + if (morkF.TakePlateQueue.Count == 0) + { + WriteData("M0.7", false);//无订单关闭抽风机 + } RobotOutMeal(); - EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M1.2", Value = false });//供盘复位 + WriteData("M1.2", false);//供盘复位 MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】正在出餐"); } @@ -621,18 +738,16 @@ namespace BPASmartClient.MorkF private void CleanPotTask() { + while (!morkF.PlaceRinseTableComplete || morkF.CleanModule) { Task.Delay(5).Wait(); } - OrderChange(morkF.CurrentOrderId, ORDER_STATUS.COMPLETED_COOK); MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】出餐完成"); - CleanModuleControl("Start"); - morkF.OutMealComplete = true; - Task.Delay(5000).Wait(); - CleanModuleControl("Stop"); - + WriteData("M14.2", false);//机器人出餐完成复位 + //OrderChange(morkF.CurrentOrderId, ORDER_STATUS.COMPLETED_COOK); + CleanModuleControl("Start"); } /// /// 任务复位重启 @@ -665,28 +780,15 @@ namespace BPASmartClient.MorkF /// public void TurnDownStatusDetect() { - //if (ProcessError) - //{ - // return; - //} - if (morkF.PotInPlace) - { - //等待取料完成 - while (!morkF.TakeMaterialComplete) - { - Task.Delay(5).Wait(); - } - TurnMachineOrientControl("Down"); - - while (!morkF.TurnMachineDownComplete)//等待翻转机下降完成 - { - Task.Delay(5).Wait(); - } - EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.3", Value = false });//复位 + TurnMachineOrientControl("Down"); - - MessageLog.GetInstance.Show($"翻转机下降完成"); + while (!morkF.TurnMachineDownComplete)//等待翻转机下降完成 + { + Task.Delay(5).Wait(); } + WriteData("M8.3", false);//下降完成复位 + MessageLog.GetInstance.Show($"翻转机下降完成"); + } /// @@ -694,20 +796,18 @@ namespace BPASmartClient.MorkF /// public void TurnUpStatusDetect() { - //if (ProcessError) - //{ - // return; - //} - if (morkF.PotInPlace) + while (morkF.RoobotIdle)//机器人忙碌 { - TurnMachineOrientControl("Top");//翻转机上升 - while (!morkF.TurnMachineUpComplete || !morkF.TakeMaterialComplete)//等待翻转机上升完成以及取料完成 - { - Task.Delay(5).Wait(); - } - EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.1", Value = false }); - MessageLog.GetInstance.Show("翻转机上升完成"); + Task.Delay(5).Wait(); + } + TurnMachineOrientControl("Top");//翻转机上升 + while (!morkF.TurnMachineUpComplete)//等待翻转机上升完成以及取料完成 + { + Task.Delay(5).Wait(); } + WriteData("M8.1", false);//上升完成复位 + MessageLog.GetInstance.Show("翻转机上升完成"); + } private void GetStatus(string key, Action action) { @@ -730,47 +830,47 @@ namespace BPASmartClient.MorkF /// public void KitchenAdjustGears(int number) { - //if (ProcessError) - //{ - // return; - //} - if (morkF.PotInPlace) + while (!morkF.PotInPlace) { - switch (number) - { - case 0: - WriteData("352", new bool[] { false, false, false, false, false, false, false, false });//0000 0000 - break; - case 1: - WriteData("352", new bool[] { true, false, false, false, false, false, false, false });//0000 0001 - break; - case 2: - WriteData("352", new bool[] { false, true, false, false, false, false, false, false });//0000 0010 - break; - case 3: - WriteData("352", new bool[] { true, true, false, false, false, false, false, false });//0000 0011 - break; - case 4: - WriteData("352", new bool[] { false, false, true, false, false, false, false, false });//0000 0100 - break; - case 5: - WriteData("352", new bool[] { true, false, true, false, false, false, false, false });//0000 0101 - break; - case 6: - WriteData("352", new bool[] { false, true, true, false, false, false, false, false });//0000 0110 - break; - case 7: - WriteData("352", new bool[] { true, true, true, false, false, false, false, false });//0000 0111 - break; - case 8: - WriteData("355", new bool[] { false, false, false, true, false, false, false, false });//0000 1000 - break; - case 9: - WriteData("352", new bool[] { true, false, false, true, false, false, false, false });//0000 1001 - break; - } - MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】,加热档位调至{number}挡"); + Task.Delay(5).Wait(); + } + + switch (number) + { + case 0: + WriteData("M4.0", new bool[] { false, false, false, false, false, false, false, false });//0000 0000 + break; + case 1: + WriteData("M4.0", new bool[] { true, false, false, false, false, false, false, false });//0000 0001 + break; + case 2: + WriteData("M4.0", new bool[] { false, true, false, false, false, false, false, false });//0000 0010 + break; + case 3: + WriteData("M4.0", new bool[] { true, true, false, false, false, false, false, false });//0000 0011 + break; + case 4: + WriteData("M4.0", new bool[] { false, false, true, false, false, false, false, false });//0000 0100 + break; + case 5: + WriteData("M4.0", new bool[] { true, false, true, false, false, false, false, false });//0000 0101 + break; + case 6: + WriteData("M4.0", new bool[] { false, true, true, false, false, false, false, false });//0000 0110 + break; + case 7: + WriteData("M4.0", new bool[] { true, true, true, false, false, false, false, false });//0000 0111 + break; + case 8: + WriteData("M4.0", new bool[] { false, false, false, true, false, false, false, false });//0000 1000 + break; + case 9: + WriteData("M4.0", new bool[] { true, false, false, true, false, false, false, false });//0000 1001 + break; + } + MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】,加热档位调至{number}挡"); + } public void TurnMaterialStore(int loc) { @@ -793,6 +893,11 @@ namespace BPASmartClient.MorkF break; } + } + public void PLCInite() + { + WriteData("M0.0", true); + } /// /// 供盘启动 @@ -820,20 +925,20 @@ namespace BPASmartClient.MorkF /// public void AddOil() { - //if (ProcessError) - //{ - // return; - //} - if (morkF.PotInPlace) + while (!morkF.PotInPlace) { - WriteData("M2.7", true); - MessageLog.GetInstance.Show("开始注油"); - while (!morkF.FallOilComplete) - { - Task.Delay(5).Wait(); - } - MessageLog.GetInstance.Show("注油完成"); + Task.Delay(5).Wait(); + } + + WriteData("M2.7", true);//加油 + WriteData("M0.7",true);//打开抽风机 + MessageLog.GetInstance.Show("开始注油"); + while (!morkF.FallOilComplete) + { + Task.Delay(5).Wait(); } + MessageLog.GetInstance.Show("注油完成"); + } /// /// 翻转机方向控制 @@ -854,36 +959,18 @@ namespace BPASmartClient.MorkF /// public void TurnMachineGearsControl(int gear) { - //if (gear != 0) - //{ - // while (!morkF.TurnMachineDownComplete)//等待翻转机下降完成 - // { - // Task.Delay(5).Wait(); - // } - // EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.3", Value = false });//复位 - // MessageLog.GetInstance.Show($"翻转机下降完成"); - //} - //if (ProcessError) - //{ - // return; - //} - if (morkF.PotInPlace) - { - //while (!morkF.TurnMachineDownComplete)//等待翻转机下降完成 - //{ - // Task.Delay(5).Wait(); - //} - //EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.3", Value = false });//复位 - switch (gear) - { - case 0: WriteData("M7.0", true); Task.Delay(1000).Wait(); break;//关闭翻炒机 - case 1: WriteData("M7.1", true); break;//翻炒机1挡 - case 2: WriteData("M7.2", true); break;//翻炒机2挡 - case 3: WriteData("M7.3", true); break;//翻炒机3挡 - } - - MessageLog.GetInstance.Show($"翻转机档位调至{gear}挡"); + while (!morkF.PotInPlace) + { + Task.Delay(5).Wait(); + } + switch (gear) + { + case 0: WriteData("M7.0", true); Task.Delay(1000).Wait(); break;//关闭翻炒机 + case 1: WriteData("M7.1", true); break;//翻炒机1挡 + case 2: WriteData("M7.2", true); break;//翻炒机2挡 + case 3: WriteData("M7.3", true); break;//翻炒机3挡 } + MessageLog.GetInstance.Show($"翻转机档位调至{gear}挡"); } /// /// 取A,B,C料 diff --git a/BPASmartClient.MorkF/OrderLocInfo.cs b/BPASmartClient.MorkF/OrderLocInfo.cs index 0b1813e5..d39a8a4e 100644 --- a/BPASmartClient.MorkF/OrderLocInfo.cs +++ b/BPASmartClient.MorkF/OrderLocInfo.cs @@ -9,7 +9,7 @@ namespace BPASmartClient.MorkF internal class OrderLocInfo { public string SuborderId { get; set; } - public ushort MaterialLoc { get; set; } + public ushort MaterialLoc { get; set; }//物料位置 public ushort RecipeNumber { get; set; } public int BatchingId { get; set; } } diff --git a/BPASmartClient.ViewModel/DebugViewModel.cs b/BPASmartClient.ViewModel/DebugViewModel.cs new file mode 100644 index 00000000..48ed633f --- /dev/null +++ b/BPASmartClient.ViewModel/DebugViewModel.cs @@ -0,0 +1,53 @@ +using BPASmartClient.Helper; +using Microsoft.Toolkit.Mvvm.ComponentModel; +using Microsoft.Toolkit.Mvvm.Input; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.ViewModel +{ + public class DebugViewModel : ObservableObject + { + public RelayCommand PlcInite { get; set; } + public RelayCommand SimulateOrder { get; set; } + public RelayCommand TakePot { get; set; } + public RelayCommand TakePotReset { get; set; } + public RelayCommand TempTurnOff { get; set; } + public RelayCommand OneBlock { get; set; } + public RelayCommand TwoBlock { get; set; } + public RelayCommand ThreeBlock { get; set; } + + public RelayCommand OverTurnOff { get; set; } + public RelayCommand OverOneBlock { get; set; } + public RelayCommand OverTwoBlock { get; set; } + public RelayCommand OverThreeBlock { get; set; } + public RelayCommand OverGoOn { get; set; } + public RelayCommand OverGoDown { get; set; } + public RelayCommand ShreddCabbage { get; set; } + public RelayCommand FryPork { get; set; } + public RelayCommand XingBaoGu { get; set; } + public DebugViewModel() + { + PlcInite = new RelayCommand(() => { ActionManage.GetInstance.Send("InitCommand"); }); + SimulateOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("SimultaorOrder"); }); + TakePot = new RelayCommand(() => { ActionManage.GetInstance.Send("TakePot"); }); + TakePotReset = new RelayCommand(() => { ActionManage.GetInstance.Send("TakePotReset"); }); + TempTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("TakeOff"); }); + OneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OneBlock"); }); + TwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("TwoBlock"); }); + ThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("ThreeBlock"); }); + OverTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTurnOff"); }); + OverOneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverOneBlock"); }); + OverTwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTwoBlock"); }); + OverThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverThreeBlock"); }); + OverGoOn = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoOn"); }); + OverGoDown = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoDown"); }); + ShreddCabbage = new RelayCommand(() => { ActionManage.GetInstance.Send("ShreddCabbage"); }); + FryPork = new RelayCommand(() => { ActionManage.GetInstance.Send("FryPork"); }); + XingBaoGu = new RelayCommand(() => { ActionManage.GetInstance.Send("XingBaoGu"); }); + } + } +} diff --git a/BPASmartClient/Control/DebugView.xaml b/BPASmartClient/Control/DebugView.xaml new file mode 100644 index 00000000..bc6da3aa --- /dev/null +++ b/BPASmartClient/Control/DebugView.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BPASmartClient/Control/DebugView.xaml.cs b/BPASmartClient/Control/DebugView.xaml.cs new file mode 100644 index 00000000..f6cc6e51 --- /dev/null +++ b/BPASmartClient/Control/DebugView.xaml.cs @@ -0,0 +1,30 @@ +using BPASmartClient.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BPASmartClient.Control +{ + /// + /// DebugView.xaml 的交互逻辑 + /// + public partial class DebugView : UserControl + { + public DebugView() + { + InitializeComponent(); + this.DataContext = new DebugViewModel(); + } + } +} diff --git a/BPASmartClient/DeviceInfo.xml b/BPASmartClient/DeviceInfo.xml index 89e636c8..4e3a74e6 100644 --- a/BPASmartClient/DeviceInfo.xml +++ b/BPASmartClient/DeviceInfo.xml @@ -1,6 +1,6 @@  - - - - - - - 192.168.1.11 - 508 - M,M550.0,16;M,M0.3,3;M,M100.0,16;M,M235.0,1;M,M102.0,7;M,M103.0,6;VW,VW372,1 - - - - + diff --git a/BPASmartClient/MainWindow.xaml b/BPASmartClient/MainWindow.xaml index 52bd20cc..c9ffbf27 100644 --- a/BPASmartClient/MainWindow.xaml +++ b/BPASmartClient/MainWindow.xaml @@ -13,7 +13,7 @@ Height="800" AllowsTransparency="True" Background="{x:Null}" - Topmost="True" + Topmost="False" WindowStartupLocation="CenterScreen" WindowStyle="None" mc:Ignorable="d"> @@ -82,6 +82,12 @@ FontSize="12" Header="阿里连接维护" Tag="DataVView" /> + +