Browse Source

冒菜出餐更改

master
taoye 2 years ago
parent
commit
e0c48b5aad
5 changed files with 419 additions and 219 deletions
  1. +1
    -1
      HBLConsole.Factory/SimpleFactory.cs
  2. +12
    -6
      HBLConsole.GVL/InternetInfo.cs
  3. +394
    -210
      HBLConsole.MORKM/Control_MORKM.cs
  4. +11
    -1
      HBLConsole.MORKM/GVL_MORKM.cs
  5. +1
    -1
      HBLConsole.MainConsole/Main.cs

+ 1
- 1
HBLConsole.Factory/SimpleFactory.cs View File

@@ -139,7 +139,7 @@ namespace HBLConsole.Factory
control?.Init();
//ActionManage.GetInstance.Register(new Action<object>((o) => { control?.DataParse(o); }), "DataParse");
ActionManage.GetInstance.Register(new Action(() => { control?.ConnectOk(); }), $"{GeneralConfig.DeviceType.ToString()}/ConnectOk");
ActionManage.GetInstance.Register(new Action<object>((o) => { control?.SimOrder(o); }), "SimOrder");
ActionManage.GetInstance.Register(new Action<object>((o) => { control?.SimOrder(o); }), "SimOrder");//模拟订单委托注册
ActionManage.GetInstance.Register(new Action<object>((o) => { control?.IotBroadcast(o); }), "IotBroadcast");
ConnectHelper.GetInstance.Init();
ActionManage.GetInstance.Send("监控数据初始化");


+ 12
- 6
HBLConsole.GVL/InternetInfo.cs View File

@@ -11,6 +11,8 @@ using System.Threading;
using HBLConsole.Service;
using BPA.ApolloClient;
using BPA.Message;
using Com.Ctrip.Framework.Apollo;
using Com.Ctrip.Framework.Apollo.Logging;

namespace HBLConsole.GVL
{
@@ -51,12 +53,16 @@ namespace HBLConsole.GVL
deviceId = int.Parse(System.Configuration.ConfigurationManager.AppSettings["deviceId"]);

IConfigurationBuilder configurationBuilder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory());
configurationBuilder.AddApolloConfiguration(p =>
{
p.AppId = "dev1_order";
p.MetaServer = apolloUri;
p.Namespaces = new List<string>() { "DEV.Config" };
});
LogManager.UseConsoleLogging(LogLevel.Info);
var apolloBuilder = configurationBuilder.AddApollo(new ApolloOptions { AppId = "dev1_order", MetaServer = "http://111.9.47.105:28080/" });
apolloBuilder.AddDefault();
apolloBuilder.AddNamespace("DEV.Config");
//configurationBuilder.AddApolloConfiguration(p =>
//{
// p.AppId = "dev1_order";
// p.MetaServer = apolloUri;
// p.Namespaces = new List<string>() { "DEV.Config" };
//});
IConfiguration config = configurationBuilder.Build();
var mqttBroker = config.GetSection("BrokerHostSettings");
MQTT_Config = mqttBroker.Value.FromJSON<MQTT_Entity>();


+ 394
- 210
HBLConsole.MORKM/Control_MORKM.cs View File

@@ -373,7 +373,7 @@ namespace HBLConsole.MORKM
mORKS.TakeBowlId = orderLocInfo.SuborderId;
TakeBowlControl(orderLocInfo.Loc);
SetRecipeNumber(orderLocInfo.RecipeNumber);
SimpleFactory.GetInstance.OrderChanged(mORKS.TakeBowlId, ORDER_STATUS.COOKING);
// SimpleFactory.GetInstance.OrderChanged(mORKS.TakeBowlId, ORDER_STATUS.COOKING);
MessageLog.GetInstance.Show($"订单【{ mORKS.TakeBowlId}】执行取碗控制,位置:[{orderLocInfo.Loc}]");
}
mORKS.TakeBowlInterlock = true;
@@ -469,16 +469,20 @@ namespace HBLConsole.MORKM
//取面控制
if (mORKS.AllowRun && mORKS.RobotIdle && !mORKS.Feeding && !mORKS.RobotTaskInterlock && mORKS.AllowTakeNoodle && mORKS.TurntableMoveInPlace && !mORKS.TakeNoodleInterlock && !mORKS.OutNoodleing && mORKS.RBTakeNoodleTask.Count > 0)
{

int loc = Array.FindIndex(mORKS.NoodleCookerStatus, p => p == false);//查找煮面炉空闲位置
if (loc >= 0 && loc <= 5)
{

if (mORKS.RBTakeNoodleTask.TryDequeue(out OrderLocInfo orderLocInfo))
{
mORKS.CookNodelId[loc] = orderLocInfo.SuborderId;

// mORKS.CookNodelId[loc] = orderLocInfo.SuborderId;
mORKS.orderLocInfos[loc] = orderLocInfo;
SetFallNoodleLoc((ushort)(loc + 1));
//机器人开始取面
RobotTakeNoodle();
SimpleFactory.GetInstance.OrderChanged(orderLocInfo.SuborderId, ORDER_STATUS.COOKING);
// SimpleFactory.GetInstance.OrderChanged(orderLocInfo.SuborderId, ORDER_STATUS.COOKING);
MessageLog.GetInstance.Show($"订单【{orderLocInfo.SuborderId}】,机器人倒面至【{loc + 1}】号煮面栏");

//写入煮面时间
@@ -490,6 +494,7 @@ namespace HBLConsole.MORKM
mORKS.TakeNoodleInterlock = true;
}
}

}
}

@@ -500,267 +505,446 @@ namespace HBLConsole.MORKM
{
if (mORKS.AllowFallNoodle && mORKS.RobotTaskInterlock && !mORKS.TakeNoodleInterlock && mORKS.RobotIdle && !mORKS.TakeMealDetect)
{
int loc = Array.FindIndex(mORKS.CookNodelId, p => p == mORKS.IngredientsCompleteId && p.Length > 0);

int loc = 0;
mORKS.exlusion = false;
//int loc = Array.FindIndex(mORKS.CookNodelId, p => p == mORKS.IngredientsCompleteId && p.Length > 0);
if (Array.FindLastIndex(mORKS.orderLocInfos, p => p != null && p.SuborderId == mORKS.IngredientsCompleteId && p.SuborderId.Length > 0) == -1)
{
loc = -1;
}
else
{
if (mORKS.orderLocInfos[Array.FindLastIndex(mORKS.orderLocInfos, p => p != null && p.SuborderId == mORKS.IngredientsCompleteId && p.SuborderId.Length > 0)].Loc % 2 != 0 && mORKS.orderLocInfos[Array.FindIndex(mORKS.orderLocInfos, p => p != null && p.SuborderId == mORKS.IngredientsCompleteId && p.SuborderId.Length > 0)].Loc % 2 != 0 && Array.FindLastIndex(mORKS.orderLocInfos, p => p != null && p.SuborderId == mORKS.IngredientsCompleteId && p.SuborderId.Length > 0) != Array.FindIndex(mORKS.orderLocInfos, p => p != null && p.SuborderId == mORKS.IngredientsCompleteId && p.SuborderId.Length > 0))
{
loc = Array.FindIndex(mORKS.orderLocInfos, p => p != null && p.SuborderId == mORKS.IngredientsCompleteId && p.SuborderId.Length > 0);
mORKS.AllMeat = true;
}
else
{
if (mORKS.Count > 0)
{
loc = Array.FindLastIndex(mORKS.orderLocInfos, p => p != null && p.SuborderId == mORKS.IngredientsCompleteId && p.SuborderId.Length > 0);
}
else
{
loc = Array.FindIndex(mORKS.orderLocInfos, p => p != null && p.SuborderId == mORKS.IngredientsCompleteId && p.SuborderId.Length > 0);
}
}
}
// int locLast= Array.FindLastIndex(mORKS.orderLocInfos, p => p.SuborderId == mORKS.IngredientsCompleteId && p.SuborderId.Length > 0);
//string[] number = Array.FindAll(mORKS.CookNodelId, p => p == mORKS.IngredientsCompleteId && p.Length > 0);

//List<int> list = new List<int>();//存储位置信息
//for (int i = 0; i < mORKS.CookNodelId.Length; i++)
//{
// if ((mORKS.CookNodelId[i] == mORKS.IngredientsCompleteId) && mORKS.CookNodelId[i].Length > 0)
// {
// list.Add(i);
// }
//}
//for (int j = 0; j < list.Count; j++)
//{
// if (list[j] >= 0 && list[j] <= 5)
// {
// if (mORKS.CookNoodlesComplete[list[j]])
// {
// SetTakeNoodleLoc((ushort)(list[j] + 1));
// RobotOutMeal();
// CookNoodleStatusReset((ushort)(list[j] + 1));
// ResetAllowFallNoodle();
// mORKS.OutMealId = mORKS.IngredientsCompleteId;
// mORKS.CookNodelId[list[j]] = string.Empty;
// MessageLog.GetInstance.Show($"{list[j] + 1}号位置出餐控制");
// mORKS.OutNoodleing = true;
// }
// }
//}

//if (mORKS.CookNodelId.GetIndex(mORKS.OutMealId) < 0)
//{
// mORKS.IngredientsCompleteId = string.Empty;
// CookComplete();//告诉机器人冒菜已经煮完
//}
//-----------------------------------------------------------------------//
if (loc >= 0 && loc <= 5)
{
if (mORKS.CookNoodlesComplete[loc])
{
SetTakeNoodleLoc((ushort)(loc + 1));
RobotOutMeal();
CookNoodleStatusReset((ushort)(loc + 1));
ResetAllowFallNoodle();
mORKS.OutMealId = mORKS.IngredientsCompleteId;
mORKS.IngredientsCompleteId = string.Empty;
mORKS.CookNodelId[loc] = string.Empty;

if (mORKS.CookNodelId.GetIndex(mORKS.OutMealId) < 0)

if (mORKS.orderLocInfos[loc].Loc % 2 == 0)//素
{
SetTakeNoodleLoc((ushort)(loc + 1));
RobotOutMeal();
CookNoodleStatusReset((ushort)(loc + 1));
// ResetAllowFallNoodle();
mORKS.OutMealId = mORKS.IngredientsCompleteId;
// mORKS.CookNodelId[loc] = string.Empty;
mORKS.orderLocInfos[loc] = null;
mORKS.Count++;
MessageLog.GetInstance.Show($"{loc + 1}号位置出餐控制");
mORKS.OutNoodleing = true;
mORKS.Num = 0;
foreach (var item in mORKS.orderLocInfos)
{
if (item != null)
{
if (item.SuborderId == mORKS.OutMealId)
{
mORKS.Num++;
}
}

}
if (mORKS.Num != 0)
Thread.Sleep(3000);
}
else if (mORKS.Count > 0&&mORKS.orderLocInfos[loc].Loc % 2 != 0)//荤
{
SetTakeNoodleLoc((ushort)(loc + 1));
RobotOutMeal();
CookNoodleStatusReset((ushort)(loc + 1));
// ResetAllowFallNoodle();
mORKS.OutMealId = mORKS.IngredientsCompleteId;
// mORKS.CookNodelId[loc] = string.Empty;
mORKS.orderLocInfos[loc] = null;
mORKS.Count++;
MessageLog.GetInstance.Show($"{loc + 1}号位置出餐控制");
mORKS.OutNoodleing = true;
//Thread.Sleep(3000);
//------------------------//
mORKS.Num = 0;
foreach (var item in mORKS.orderLocInfos)
{
if (item != null)
{
if (item.SuborderId == mORKS.OutMealId)
{
mORKS.Num++;
}
}

}
if (mORKS.Num == 0)
{

CookComplete(); //告诉机器人冒菜已经煮完
ResetAllowFallNoodle();
mORKS.exlusion = true;
mORKS.Count = 0;
mORKS.IngredientsCompleteId = string.Empty;
mORKS.TakeBowlId = string.Empty;
mORKS.TakeBowlInterlock = false;
//IsAddSoup();//判断是否加汤
}
}
else
{
if (mORKS.AllMeat)
{
SetTakeNoodleLoc((ushort)(loc + 1));
RobotOutMeal();
CookNoodleStatusReset((ushort)(loc + 1));
// ResetAllowFallNoodle();
mORKS.OutMealId = mORKS.IngredientsCompleteId;
// mORKS.CookNodelId[loc] = string.Empty;
mORKS.orderLocInfos[loc] = null;
// mORKS.Count++;
MessageLog.GetInstance.Show($"{loc + 1}号位置出餐控制");
mORKS.OutNoodleing = true;

mORKS.Num = 0;
foreach (var item in mORKS.orderLocInfos)
{
if (item != null)
{
if (item.SuborderId == mORKS.OutMealId)
{
mORKS.Num++;
}
}

}
if (mORKS.Num != 0)
Thread.Sleep(3000);
}
else
{
mORKS.Count++;
mORKS.OutMealId = mORKS.IngredientsCompleteId;
}

}
mORKS.Num = 0;
foreach (var item in mORKS.orderLocInfos)
{
if (item != null)
{
if (item.SuborderId == mORKS.OutMealId)
{
mORKS.Num++;
}
}

}
if (mORKS.Num == 0&&mORKS.exlusion==false)
{

CookComplete(); //告诉机器人冒菜已经煮完
ResetAllowFallNoodle();
mORKS.AllMeat = false;
mORKS.Count = 0;
mORKS.IngredientsCompleteId = string.Empty;
mORKS.TakeBowlId = string.Empty;
mORKS.TakeBowlInterlock = false;
//IsAddSoup();//判断是否加汤
}

MessageLog.GetInstance.Show($"{loc + 1}号位置出餐控制");
mORKS.OutNoodleing = true;

}

}
}
}

/// <summary>
/// 信号检测
/// </summary>
private void SingleDetect()
{
//允许倒面信号检测
if (RTrig.GetInstance("AllowFallNoodle").Start(mORKS.AllowFallNoodle))
/// <summary>
/// 信号检测
/// </summary>
private void SingleDetect()
{
mORKS.IngredientsCompleteId = mORKS.TakeBowlId;
mORKS.TakeBowlId = string.Empty;
MessageLog.GetInstance.Show($"碗到位,允许到面,{mORKS.IngredientsCompleteId}");
mORKS.TakeBowlInterlock = false;
}
//允许倒面信号检测
if (RTrig.GetInstance("AllowFallNoodle").Start(mORKS.AllowFallNoodle))
{
mORKS.IngredientsCompleteId = mORKS.TakeBowlId;
// mORKS.TakeBowlId = string.Empty;
MessageLog.GetInstance.Show("碗到位,允许到面");
//MessageLog.GetInstance.Show($"碗到位,允许到面,{mORKS.IngredientsCompleteId}");
// mORKS.TakeBowlInterlock = false;
}

//出餐完成信号检测
if (RTrig.GetInstance("CompleteChange").Start(mORKS.RbOutMealComplete))
{
SimpleFactory.GetInstance.OrderChanged(mORKS.OutMealId, ORDER_STATUS.COMPLETED_COOK);
MessageLog.GetInstance.Show($"订单【{mORKS.OutMealId}】制作完成");
mORKS.OutNoodleing = false;
}
//出餐完成信号检测
if (RTrig.GetInstance("CompleteChange").Start(mORKS.RbOutMealComplete))
{
// SimpleFactory.GetInstance.OrderChanged(mORKS.OutMealId, ORDER_STATUS.COMPLETED_COOK);
MessageLog.GetInstance.Show($"订单【{mORKS.OutMealId}】制作完成");
mORKS.OutNoodleing = false;
}

//取餐完成逻辑处理
if (DelayRTrig.GetInstance("CompleteChange1").Start(mORKS.RbOutMealComplete && !mORKS.TakeMealDetect, 2))
{
SimpleFactory.GetInstance.OrderChanged(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
MessageLog.GetInstance.Show($"订单【{mORKS.OutMealId}】取餐完成");
ResetCookComplete();
mORKS.OutMealId = string.Empty;
}
//取餐完成逻辑处理
if (DelayRTrig.GetInstance("CompleteChange1").Start(mORKS.RbOutMealComplete && !mORKS.TakeMealDetect, 2))
{
// SimpleFactory.GetInstance.OrderChanged(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
MessageLog.GetInstance.Show($"订单【{mORKS.OutMealId}】取餐完成");
ResetCookComplete();
mORKS.OutMealId = string.Empty;
}

//机器人取面完成信号检测
if (RTrig.GetInstance("TakeNoodleComplete").Start(mORKS.RbTakeNoodleComplete))
{
mORKS.TakeNoodleInterlock = false;
mORKS.AllowTakeNoodle = false;
mORKS.TurntableInterlock = false;
MessageLog.GetInstance.Show("机器人取面完成信号检测");
TakeNoodleCompleteReset();
}
//机器人取面完成信号检测
if (RTrig.GetInstance("TakeNoodleComplete").Start(mORKS.RbTakeNoodleComplete))
{
mORKS.TakeNoodleInterlock = false;
mORKS.AllowTakeNoodle = false;
mORKS.TurntableInterlock = false;
MessageLog.GetInstance.Show("机器人取面完成信号检测");
TakeNoodleCompleteReset();
}

//转台到位检测
//if (RTrig.GetInstance("TurntableInPlace").Start(mORKS.TurntableMoveInPlace))
//{
// mORKS.TurntableInterlock = false;
//}
//转台到位检测
//if (RTrig.GetInstance("TurntableInPlace").Start(mORKS.TurntableMoveInPlace))
//{
// mORKS.TurntableInterlock = false;
//}

int OutMealRequstCount = mORKS.CookNoodlesComplete.Where(p => p == true).ToList().Count;
int mlCount = mORKS.NoodleCookerStatus.Where(p => p == true).ToList().Count;
mORKS.RobotTaskInterlock = OutMealRequstCount > 0 && mORKS.AllowFallNoodle && (mlCount >= 2 || mORKS.RBTakeNoodleTask.Count == 0);
}
int OutMealRequstCount = mORKS.CookNoodlesComplete.Where(p => p == true).ToList().Count;
int mlCount = mORKS.NoodleCookerStatus.Where(p => p == true).ToList().Count;
mORKS.RobotTaskInterlock = OutMealRequstCount > 0 && mORKS.AllowFallNoodle && (mlCount >=2 || mORKS.RBTakeNoodleTask.Count == 0);
}


#region PLC 控制函数
#region PLC 控制函数

/// <summary>
/// 写入配方数据到 PLC
/// </summary>
private void WriteRecipeBoms()
{
List<ushort> recipeBoms = new List<ushort>();
if (Json<BatchingInfoPar>.Data.recipeBoms == null) return;
foreach (var item in Json<BatchingInfoPar>.Data.recipeBoms.RecipeIds)
/// <summary>
/// 写入配方数据到 PLC
/// </summary>
private void WriteRecipeBoms()
{
foreach (var rec in item.Recipes)
List<ushort> recipeBoms = new List<ushort>();
if (Json<BatchingInfoPar>.Data.recipeBoms == null) return;
foreach (var item in Json<BatchingInfoPar>.Data.recipeBoms.RecipeIds)
{
recipeBoms.Add((ushort)rec);
foreach (var rec in item.Recipes)
{
recipeBoms.Add((ushort)rec);
}
}
}
if (recipeBoms.Count > 0)
{
if (ModbusTcpHelper.GetInstance.Write(1100, WriteType.HoldingRegisters, recipeBoms.ToArray()))
if (recipeBoms.Count > 0)
{
MessageLog.GetInstance.Show("成功写入配方数据");
if (ModbusTcpHelper.GetInstance.Write(1100, WriteType.HoldingRegisters, recipeBoms.ToArray()))
{
MessageLog.GetInstance.Show("成功写入配方数据");
}
}
else { MessageLog.GetInstance.Show("配方数据为空"); }
}
else { MessageLog.GetInstance.Show("配方数据为空"); }
}

/// <summary>
/// 转台移动
/// </summary>
//private void MoveTurntable()
//{
// //ModbusTcpHelper.GetInstance.Write(325, WriteType.Coils, true);
//}

/// <summary>
/// 取面完成复位
/// </summary>
private void TakeNoodleCompleteReset()
{
ModbusTcpHelper.GetInstance.Write(1124, WriteType.Coils, false);
}
/// <summary>
/// 转台移动
/// </summary>
//private void MoveTurntable()
//{
// //ModbusTcpHelper.GetInstance.Write(325, WriteType.Coils, true);
//}

/// <summary>
/// 指定煮面口状态复位
/// </summary>
/// <param name="num"></param>
private void CookNoodleStatusReset(int num)
{
if (num >= 1 && num <= 6)
/// <summary>
/// 取面完成复位
/// </summary>
private void TakeNoodleCompleteReset()
{
ushort addRess = (ushort)(1136 + num - 1);
ModbusTcpHelper.GetInstance.Write(addRess, WriteType.Coils, false);
MessageLog.GetInstance.Show($"{num}号煮面口占用复位");
ModbusTcpHelper.GetInstance.Write(1124, WriteType.Coils, false);
}

}

/// <summary>
/// 写配方编号
/// </summary>
/// <param name="num"></param>
private void SetRecipeNumber(ushort num)
{
ModbusTcpHelper.GetInstance.Write(100, WriteType.HoldingRegisters, num);
}

/// <summary>
/// 启动转台
/// </summary>
/// <param name="loc"></param>
private void TurntableStart(ushort loc)
{
mORKS.CurrentLoc = loc;
mORKS.TurntableInterlock = true;
mORKS.TurntableLocLists.Add(loc);
ModbusTcpHelper.GetInstance.Write(101, WriteType.HoldingRegisters, loc);
ModbusTcpHelper.GetInstance.Write(325, WriteType.Coils, true);
}
/// <summary>
/// 指定煮面口状态复位
/// </summary>
/// <param name="num"></param>
private void CookNoodleStatusReset(int num)
{
if (num >= 1 && num <= 6)
{
ushort addRess = (ushort)(1136 + num - 1);
ModbusTcpHelper.GetInstance.Write(addRess, WriteType.Coils, false);
MessageLog.GetInstance.Show($"{num}号煮面口占用复位");
}

/// <summary>
/// 设置倒面位置
/// </summary>
/// <param name="loc"></param>
private void SetFallNoodleLoc(ushort loc)
{
ModbusTcpHelper.GetInstance.Write(102, WriteType.HoldingRegisters, loc);
}
}

/// <summary>
/// 设置取面位置
/// </summary>
/// <param name="loc"></param>
private void SetTakeNoodleLoc(ushort loc)
{
ModbusTcpHelper.GetInstance.Write(103, WriteType.HoldingRegisters, loc);
}
/// <summary>
/// 写配方编号
/// </summary>
/// <param name="num"></param>
private void SetRecipeNumber(ushort num)
{
ModbusTcpHelper.GetInstance.Write(100, WriteType.HoldingRegisters, num);
}

/// <summary>
/// 取碗控制
/// </summary>
/// <param name="loc"></param>
private void TakeBowlControl(ushort loc)
{
if (loc == 10)//小碗
/// <summary>
/// 启动转台
/// </summary>
/// <param name="loc"></param>
private void TurntableStart(ushort loc)
{
ModbusTcpHelper.GetInstance.Write(321, WriteType.Coils, true);
mORKS.CurrentLoc = loc;
mORKS.TurntableInterlock = true;
mORKS.TurntableLocLists.Add(loc);
ModbusTcpHelper.GetInstance.Write(101, WriteType.HoldingRegisters, loc);
ModbusTcpHelper.GetInstance.Write(325, WriteType.Coils, true);
}
else if (loc == 11)//大碗

/// <summary>
/// 设置倒面位置
/// </summary>
/// <param name="loc"></param>
private void SetFallNoodleLoc(ushort loc)
{
ModbusTcpHelper.GetInstance.Write(322, WriteType.Coils, true);
ModbusTcpHelper.GetInstance.Write(102, WriteType.HoldingRegisters, loc);
}
}

/// <summary>
/// 机器人取面
/// </summary>
private void RobotTakeNoodle()
{
ModbusTcpHelper.GetInstance.Write(323, WriteType.Coils, true);
}
/// <summary>
/// 设置取面位置
/// </summary>
/// <param name="loc"></param>
private void SetTakeNoodleLoc(ushort loc)
{
ModbusTcpHelper.GetInstance.Write(103, WriteType.HoldingRegisters, loc);
}

/// <summary>
/// 机器人取餐
/// </summary>
private void RobotOutMeal()
{
ModbusTcpHelper.GetInstance.Write(324, WriteType.Coils, true);
var result = ModbusTcpHelper.GetInstance.Read(324, ReadType.Coils);
if (result is bool res)
while (!res)
/// <summary>
/// 取碗控制
/// </summary>
/// <param name="loc"></param>
private void TakeBowlControl(ushort loc)
{
if (loc == 10)//小碗
{
ModbusTcpHelper.GetInstance.Write(324, WriteType.Coils, true);
ModbusTcpHelper.GetInstance.Write(321, WriteType.Coils, true);
}
}
else if (loc == 11)//大碗
{
ModbusTcpHelper.GetInstance.Write(322, WriteType.Coils, true);
}
}

/// <summary>
/// 制作完成信号复位
/// </summary>
private void ResetCookComplete()
{
ModbusTcpHelper.GetInstance.Write(1126, WriteType.Coils, false);
}
/// <summary>
/// 机器人取面
/// </summary>
private void RobotTakeNoodle()
{
ModbusTcpHelper.GetInstance.Write(323, WriteType.Coils, true);
}

/// <summary>
/// 复位允许取面信号
/// </summary>
private void ResetAllowFallNoodle()
{
ModbusTcpHelper.GetInstance.Write(1123, WriteType.Coils, false);
}
/// <summary>
/// 机器人取餐
/// </summary>
private void RobotOutMeal()
{
ModbusTcpHelper.GetInstance.Write(324, WriteType.Coils, true);
var result = ModbusTcpHelper.GetInstance.Read(324, ReadType.Coils);
if (result is bool res)
while (!res)
{
ModbusTcpHelper.GetInstance.Write(324, WriteType.Coils, true);
}
}

/// <summary>
/// 设备初始化
/// </summary>
public async void DeviceInit()
{
ModbusTcpHelper.GetInstance.Write(320, WriteType.Coils, true);
await Task.Delay(1000);
ModbusTcpHelper.GetInstance.Write(320, WriteType.Coils, false);
/// <summary>
/// 制作完成信号复位
/// </summary>
private void ResetCookComplete()
{
ModbusTcpHelper.GetInstance.Write(1126, WriteType.Coils, false);
}

}
/// <summary>
/// 复位允许取面信号
/// </summary>
private void ResetAllowFallNoodle()
{
ModbusTcpHelper.GetInstance.Write(1123, WriteType.Coils, false);
}

/// <summary>
/// 制作完成,允许机器人往外推碗
/// </summary>
public void CookComplete()
{
ModbusTcpHelper.GetInstance.Write((ushort)ModbusTcpHelper.GetInstance.GetBoolAddress("M0.6"), WriteType.Coils, true);
}
/// <summary>
/// 设备初始化
/// </summary>
public async void DeviceInit()
{
ModbusTcpHelper.GetInstance.Write(320, WriteType.Coils, true);
await Task.Delay(1000);
ModbusTcpHelper.GetInstance.Write(320, WriteType.Coils, false);

}

/// <summary>
/// 制作完成,允许机器人往外推碗
/// </summary>
public void CookComplete()
{
ModbusTcpHelper.GetInstance.Write((ushort)ModbusTcpHelper.GetInstance.GetBoolAddress("M0.6"), WriteType.Coils, true);
}

/// <summary>
/// 是否加汤
/// </summary>
public void IsAddSoup()
{
ModbusTcpHelper.GetInstance.Write((ushort)ModbusTcpHelper.GetInstance.GetBoolAddress("M0.7"), WriteType.Coils, true);
}
#endregion

/// <summary>
/// 是否加汤
/// </summary>
public void IsAddSoup()
{
ModbusTcpHelper.GetInstance.Write((ushort)ModbusTcpHelper.GetInstance.GetBoolAddress("M0.7"), WriteType.Coils, true);
}
#endregion


}

}

}


+ 11
- 1
HBLConsole.MORKM/GVL_MORKM.cs View File

@@ -331,7 +331,7 @@ namespace HBLConsole.MORKM
/// 煮面口对应的订单ID
/// </summary>
public string[] CookNodelId = new string[6] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, };
public OrderLocInfo[] orderLocInfos = new OrderLocInfo[6] { null,null,null,null,null,null};
/// <summary>
/// 出餐订单ID
/// </summary>
@@ -348,6 +348,16 @@ namespace HBLConsole.MORKM
[VariableMonitor("转台当前启动位置")]
public ushort CurrentLoc { get; set; } = 0;

//public ConcurrentQueue<OrderLocInfo> MeatDish{ get; set; }//荤菜

//public ConcurrentQueue<OrderLocInfo> VegetablesDish { get; set; }//素菜

public int Num { get; set; } //记录同一个订单是否所有配菜均已出锅

public int Count { get; set; }

public bool exlusion { get; set; } //互斥
public bool AllMeat { get; set; }
#endregion
}
}

+ 1
- 1
HBLConsole.MainConsole/Main.cs View File

@@ -44,7 +44,7 @@ namespace HBLConsole.MainConsole
Json<KeepDataBase>.Data.parSets.Add(new ParSet()
{
CheckBoxContext = $"煮面口{i + 1}屏蔽",
Minute = 0,
Minute = 1,
Second = 0,
IsShield = false,
TextBlockContext = $"煮面口{i + 1}时间设定"


Loading…
Cancel
Save