Procházet zdrojové kódy

增加初始化失败日志输出。

菜品库坐标系改为单例模式。
样式分支
yahaha před 2 roky
rodič
revize
d5aedcfc6e
3 změnil soubory, kde provedl 25 přidání a 15 odebrání
  1. +17
    -9
      BPASmartClient.MorkF/Control_MorkF.cs
  2. +6
    -5
      BPASmartClient.MorkF/Model/MaterialCoordinate.cs
  3. +2
    -1
      BPASmartClient.MorkF/Model/MaterialSurplus.cs

+ 17
- 9
BPASmartClient.MorkF/Control_MorkF.cs Zobrazit soubor

@@ -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


+ 6
- 5
BPASmartClient.MorkF/Model/MaterialCoordinate.cs Zobrazit soubor

@@ -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<MaterialCoordinate>
{
public static List<string> MLNumberList = new List<string>() { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"
public List<string> MLNumberList = new List<string>() { "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<Coordinate> MLCoordinateList = new List<Coordinate>()
public List<Coordinate> MLCoordinateList = new List<Coordinate>()
{ 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
/// <summary>
/// 每个取菜点的编号与坐标字典
/// </summary>
public static Dictionary<string, Coordinate> dicNoMaterialCoordinate { get; set; } = new Dictionary<string, Coordinate>();
public Dictionary<string, Coordinate> dicNoMaterialCoordinate { get; set; } = new Dictionary<string, Coordinate>();
//{
// {"A1",new Coordinate(){ X = 34500,Y=0} },
// {"A2",new Coordinate(){ X = 34500,Y=9000} },


+ 2
- 1
BPASmartClient.MorkF/Model/MaterialSurplus.cs Zobrazit soubor

@@ -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;
}


Načítá se…
Zrušit
Uložit