From d5aedcfc6e3664af94f2cf87149da9a65d598858 Mon Sep 17 00:00:00 2001 From: yahaha Date: Sat, 19 Nov 2022 17:29:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA=E3=80=82?= =?UTF-8?q?=20=E8=8F=9C=E5=93=81=E5=BA=93=E5=9D=90=E6=A0=87=E7=B3=BB?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=8D=95=E4=BE=8B=E6=A8=A1=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BPASmartClient.MorkF/Control_MorkF.cs | 26 ++++++++++++------- .../Model/MaterialCoordinate.cs | 11 ++++---- BPASmartClient.MorkF/Model/MaterialSurplus.cs | 3 ++- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/BPASmartClient.MorkF/Control_MorkF.cs b/BPASmartClient.MorkF/Control_MorkF.cs index 28b26e12..64b09331 100644 --- a/BPASmartClient.MorkF/Control_MorkF.cs +++ b/BPASmartClient.MorkF/Control_MorkF.cs @@ -767,6 +767,7 @@ namespace BPASmartClient.MorkF { if (!ml_morkf.InitialComplete) { + MessageLog.GetInstance.Show("电磁阀启停出错,菜品库未初始化"); return; } @@ -781,6 +782,7 @@ namespace BPASmartClient.MorkF { if (!ml_morkf.InitialComplete) { + MessageLog.GetInstance.Show("爪子去到1号位出错,菜品库未初始化"); return false; } @@ -806,6 +808,7 @@ namespace BPASmartClient.MorkF { if (!ml_morkf.InitialComplete) { + MessageLog.GetInstance.Show("爪子去到2号位出错,菜品库未初始化"); return false; } @@ -831,6 +834,7 @@ namespace BPASmartClient.MorkF { if (!ml_morkf.InitialComplete) { + MessageLog.GetInstance.Show("爪子去到3号位出错,菜品库未初始化"); return false; } @@ -856,6 +860,7 @@ namespace BPASmartClient.MorkF { if (!ml_morkf.InitialComplete) { + MessageLog.GetInstance.Show("1号测距出错,菜品库未初始化"); return false; } @@ -870,6 +875,7 @@ namespace BPASmartClient.MorkF { if (!ml_morkf.InitialComplete) { + MessageLog.GetInstance.Show("2号测距出错,菜品库未初始化"); return false; } @@ -884,6 +890,7 @@ namespace BPASmartClient.MorkF { if (!ml_morkf.InitialComplete) { + MessageLog.GetInstance.Show("3号测距出错,菜品库未初始化"); return false; } @@ -959,6 +966,7 @@ namespace BPASmartClient.MorkF { if (!ml_morkf.InitialComplete) { + MessageLog.GetInstance.Show($"机械臂移动出错,菜品库未初始化"); return false; } @@ -1231,10 +1239,11 @@ namespace BPASmartClient.MorkF //判断是否初始化 if(!ml_morkf.InitialComplete) { + MessageLog.GetInstance.Show("更新菜品库存量出错,菜品库未初始化"); return false; } - foreach(var item in MaterialCoordinate.dicNoMaterialCoordinate) + foreach(var item in MaterialCoordinate.GetInstance().dicNoMaterialCoordinate) { //设置到抓菜处 if (!SetArmPosition(item.Value.X, item.Value.Y)) @@ -1418,6 +1427,7 @@ namespace BPASmartClient.MorkF { //指定位置菜品减一 MaterialSurplusOperation.GetInstance().ReduceSurplus(materialOperation.materialInfo.Loc); + SaveMaterialData(); } } @@ -2234,8 +2244,6 @@ namespace BPASmartClient.MorkF StirArmGoOrigin(i); MessageLog.GetInstance.Show($"菜品{res.GoodName}完成"); - - } catch (Exception ex) { @@ -2265,9 +2273,9 @@ namespace BPASmartClient.MorkF { if(materialOperationQuenes.Count > 0) { - //判断是否初始化与是否在工作中 - if (ml_morkf.InitialComplete && !ml_morkf.MaterailIsWorking) - { + ////判断是否初始化与是否在工作中 + //if (ml_morkf.InitialComplete && !ml_morkf.MaterailIsWorking) + //{ //待菜品库操作列出队列 if (materialOperationQuenes.TryDequeue(out var res)) { @@ -2279,7 +2287,7 @@ namespace BPASmartClient.MorkF //}),"菜品库操作"); GetMaterailTest(res); } - } + //} } } @@ -2351,9 +2359,9 @@ namespace BPASmartClient.MorkF try { - if(MaterialCoordinate.dicNoMaterialCoordinate.ContainsKey(no)) + if(MaterialCoordinate.GetInstance().dicNoMaterialCoordinate.ContainsKey(no)) { - coordinate = MaterialCoordinate.dicNoMaterialCoordinate[no]; + coordinate = MaterialCoordinate.GetInstance().dicNoMaterialCoordinate[no]; return true; } else diff --git a/BPASmartClient.MorkF/Model/MaterialCoordinate.cs b/BPASmartClient.MorkF/Model/MaterialCoordinate.cs index 5b00b0a1..11f50db7 100644 --- a/BPASmartClient.MorkF/Model/MaterialCoordinate.cs +++ b/BPASmartClient.MorkF/Model/MaterialCoordinate.cs @@ -1,4 +1,5 @@ -using System; +using BPA.Helper; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,12 +7,12 @@ using System.Threading.Tasks; namespace BPASmartClient.MorkF.Model { - internal class MaterialCoordinate + internal class MaterialCoordinate : Singleton { - public static List MLNumberList = new List() { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16" + public List MLNumberList = new List() { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16" , "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27" }; - public static List MLCoordinateList = new List() + public List MLCoordinateList = new List() { new Coordinate() { X = 34500, Y = 0 }, new Coordinate() { X = 34500, Y = 9000 } , new Coordinate() { X = 34500, Y = 0 } , //第1层 new Coordinate(){ X = 34500,Y=0} , new Coordinate() { X = 34500, Y = 83000 }, new Coordinate(){ X = 34500,Y=0}, //第1层 new Coordinate(){ X = 34500,Y=0} , new Coordinate() { X = 34500, Y = 0 }, new Coordinate(){ X = 34500,Y=0}, //第1层 @@ -40,7 +41,7 @@ namespace BPASmartClient.MorkF.Model /// /// 每个取菜点的编号与坐标字典 /// - public static Dictionary dicNoMaterialCoordinate { get; set; } = new Dictionary(); + public Dictionary dicNoMaterialCoordinate { get; set; } = new Dictionary(); //{ // {"A1",new Coordinate(){ X = 34500,Y=0} }, // {"A2",new Coordinate(){ X = 34500,Y=9000} }, diff --git a/BPASmartClient.MorkF/Model/MaterialSurplus.cs b/BPASmartClient.MorkF/Model/MaterialSurplus.cs index 494110b8..f323ca9c 100644 --- a/BPASmartClient.MorkF/Model/MaterialSurplus.cs +++ b/BPASmartClient.MorkF/Model/MaterialSurplus.cs @@ -86,7 +86,8 @@ namespace BPASmartClient.MorkF { foreach(MaterialInfo material in materials) { - surplus += int.Parse(material.Qty.ToString()); + //surplus += int.Parse(material.Qty.ToString()); + surplus += Convert.ToInt32(material.Qty); } return true; }