Browse Source

煮面机流程修改

master
pry 1 year ago
parent
commit
cae9181627
3 changed files with 88 additions and 52 deletions
  1. +63
    -39
      BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs
  2. +13
    -1
      BPASmartClient.MorkSUpgradedVer/GVL_MorkSUpgradedVer.cs
  3. +12
    -12
      BPASmartClient/App.config

+ 63
- 39
BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs View File

@@ -22,6 +22,7 @@ using BPASmartClient.Model.小炒机;
using BPA.Models;
using System.Windows.Forms;
using System.Media;
//using BPA.Helper;

namespace BPASmartClient.MorkSUpgradedVer
{
@@ -200,6 +201,7 @@ namespace BPASmartClient.MorkSUpgradedVer
{
if (obj is bool[] bools && bools.Length > 0 && bools.Length <= 7)
{
Initing = !bools[0];
mORKS.InitComplete = bools[0];
mORKS.MoveScrewRodInitCom = bools[1];
mORKS.SacrificialVesselInitCom = bools[2];
@@ -208,13 +210,13 @@ namespace BPASmartClient.MorkSUpgradedVer
mORKS.RobotInitCom = bools[5];
mORKS.SiloInitCom = bools[6];

alarm.DeviceNoInit = mORKS.InitComplete;
alarm.MoveScrewRodNoInit = mORKS.MoveScrewRodInitCom;
alarm.SacrificialVesselNoInit = mORKS.SacrificialVesselInitCom;
alarm.CylinderNoInit = mORKS.CylinderInitCom;
alarm.NoodleCookerNoInit = mORKS.NoodleCookerInitCom;
alarm.RobotNoInit = mORKS.RobotInitCom;
alarm.SiloNoInit = mORKS.SiloInitCom;
alarm.DeviceNoInit = !mORKS.InitComplete;
alarm.MoveScrewRodNoInit = !mORKS.MoveScrewRodInitCom;
alarm.SacrificialVesselNoInit = !mORKS.SacrificialVesselInitCom;
alarm.CylinderNoInit = !mORKS.CylinderInitCom;
alarm.NoodleCookerNoInit = !mORKS.NoodleCookerInitCom;
alarm.RobotNoInit = !mORKS.RobotInitCom;
alarm.SiloNoInit = !mORKS.SiloInitCom;
}
}));

@@ -284,12 +286,23 @@ namespace BPASmartClient.MorkSUpgradedVer
{
if (obj is ushort[] ushorts && ushorts.Length > 0 && ushorts.Length <= 1)
{
mORKS.CookNoodleCom[0] = ushorts[0].GetBitValue(1);
mORKS.CookNoodleCom[1] = ushorts[0].GetBitValue(2);
mORKS.CookNoodleCom[2] = ushorts[0].GetBitValue(3);
mORKS.CookNoodleCom[3] = ushorts[0].GetBitValue(4);
mORKS.CookNoodleCom[4] = ushorts[0].GetBitValue(5);
mORKS.CookNoodleCom[5] = ushorts[0].GetBitValue(6);
var tt = ushorts.UshortsToBytes(true).BytesToUshorts();

for (byte i = 0; i < 6; i++)
{
if (RTrig.GetInstance($"CookNoodleCom{i + 1}").Start(tt[0].GetBitValue((byte)(i + 1))))
{
if (!string.IsNullOrEmpty(mORKS.CookNodelId[i]))
mORKS.CookNoodleCom[i] = true;
}
}

//mORKS.CookNoodleCom[0] = tt[0].GetBitValue(1);
//mORKS.CookNoodleCom[1] = tt[0].GetBitValue(2);
//mORKS.CookNoodleCom[2] = tt[0].GetBitValue(3);
//mORKS.CookNoodleCom[3] = tt[0].GetBitValue(4);
//mORKS.CookNoodleCom[4] = tt[0].GetBitValue(5);
//mORKS.CookNoodleCom[5] = tt[0].GetBitValue(6);
mORKS.Heating = ushorts[0].GetBitValue(15);
mORKS.TemperatureReaches = ushorts[0].GetBitValue(16);

@@ -306,6 +319,10 @@ namespace BPASmartClient.MorkSUpgradedVer
}

}));

mORKS.TakeBowlTaskCount = mORKS.TakeBowlTask.Count;
mORKS.RBTakeNoodleTaskCount = mORKS.RBTakeNoodleTask.Count;

}

/// <summary>
@@ -406,7 +423,6 @@ namespace BPASmartClient.MorkSUpgradedVer
{
if (mORKS.AllowRun && mORKS.TakeBowlTask.Count > 0 && !mORKS.DropBowlMechanismStatus && !mORKS.TakeBowlInterlock)
{
DeviceProcessLogShow("开始取碗流程");
ushort BowLoc = 0;
var res = orderMaterialDelivery?.BatchingInfo?.Where(p => p.BatchingId == mORKS.TakeBowlTask.ElementAt(0).BatchingId).ToList();
if (res == null || res?.Count == 0)
@@ -419,12 +435,12 @@ namespace BPASmartClient.MorkSUpgradedVer
{
if (ushort.TryParse(item.BatchingLoc, out ushort loc))
{
if (loc == 10 && !mORKS.SmallBowlYesOrNoCheck)
if (loc == 10 && mORKS.SmallBowlYesOrNoCheck)
{
BowLoc = loc;
break;
}
else if (loc == 11 && !mORKS.LargeBowYesOrNoCheck)
else if (loc == 11 && mORKS.LargeBowYesOrNoCheck)
{
BowLoc = loc;
break;
@@ -491,7 +507,7 @@ namespace BPASmartClient.MorkSUpgradedVer
{
if (!mORKS.TurntableLowPosition)
{
//WriteData("M32.7", false);
//WriteData("M32.7", false); 定位完成复位
DeviceProcessLogShow($"执行了转台启动互锁信号复位");
}
TurntableStart(loc);
@@ -518,7 +534,7 @@ namespace BPASmartClient.MorkSUpgradedVer
//转台到位检测
if (RTrig.GetInstance("TurntableInPlace").Start(mORKS.SiloInPlace && mORKS.CurrentLoc == mORKS.CurrentFeedbackLoc))
{
mORKS.CurrentLoc = 0;
mORKS.TurntableInterlock = false;
DeviceProcessLogShow("转台到位检测");
}
@@ -544,25 +560,31 @@ namespace BPASmartClient.MorkSUpgradedVer
//取面控制
if (mORKS.AllowRun && mORKS.RobotStatus && !mORKS.Feeding && !mORKS.RobotTaskInterlock && mORKS.AllowTakeNoodle && mORKS.SiloInPlace && !mORKS.TakeNoodleInterlock && mORKS.RBTakeNoodleTask.Count > 0)
{
int loc = Array.FindIndex(mORKS.NoodleCookerStatus, p => p == false);//查找煮面炉空闲位置
if (loc >= 0 && loc <= 5)
if (mORKS.CurrentLoc == mORKS.CurrentFeedbackLoc)
{
if (!Json<MorksPar>.Data.parSets.ElementAt(loc).IsShield)//检查该煮面篮是否被屏蔽
int loc = Array.FindIndex(mORKS.NoodleCookerStatus, p => p == false);//查找煮面炉空闲位置
if (loc >= 0 && loc <= 5)
{
if (mORKS.RBTakeNoodleTask.TryDequeue(out OrderLocInfo orderLocInfo))
if (!Json<MorksPar>.Data.parSets.ElementAt(loc).IsShield)//检查该煮面篮是否被屏蔽
{
mORKS.CookNodelId[loc] = orderLocInfo.SuborderId;
mORKS.NoodleCookerStatus[loc] = true;
SetFallNoodleLoc((ushort)(loc + 1));
//机器人开始取面
OrderChange(orderLocInfo.SuborderId, ORDER_STATUS.COOKING);
DeviceProcessLogShow($"订单【{orderLocInfo.SuborderId}】,机器人倒面至【{loc + 1}】号煮面栏");
//写入煮面时间
List<ushort> values = new List<ushort>();
values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Minute);
values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Second);
WriteData($"VW{320 + (loc * 4)}", values.ToArray());
mORKS.TakeNoodleInterlock = true;
if (mORKS.RBTakeNoodleTask.TryDequeue(out OrderLocInfo orderLocInfo))
{
//写入煮面时间
List<ushort> values = new List<ushort>();
values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Minute);
values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Second);
WriteData($"VW{324 + (loc * 4)}", values.ToArray());

mORKS.CurrentLoc = 0;
mORKS.CookNodelId[loc] = orderLocInfo.SuborderId;
mORKS.NoodleCookerStatus[loc] = true;
SetFallNoodleLoc((ushort)(loc + 1));
//机器人开始取面
OrderChange(orderLocInfo.SuborderId, ORDER_STATUS.COOKING);
DeviceProcessLogShow($"订单【{orderLocInfo.SuborderId}】,机器人倒面至【{loc + 1}】号煮面栏");

mORKS.TakeNoodleInterlock = true;
}
}
}
}
@@ -583,15 +605,16 @@ namespace BPASmartClient.MorkSUpgradedVer
{
SetTakeNoodleLoc((ushort)(loc + 1));
mORKS.NoodleCookerStatus[loc] = false;
WriteData($"VW260", 0);//设置出汤时间
OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_COOK);
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】制作完成");
WriteData($"VW260", (ushort)0);//设置出汤时间
OrderChange(mORKS.IngredientsCompleteId, ORDER_STATUS.COMPLETED_COOK);
DeviceProcessLogShow($"订单【{mORKS.IngredientsCompleteId}】制作完成");
mORKS.CookCompleteFlatBit = true;
mORKS.OutMealId = mORKS.IngredientsCompleteId;
mORKS.OutMealName = mORKS.IngredientsCompleteName;
mORKS.IngredientsCompleteId = string.Empty;
mORKS.CookNodelId[loc] = string.Empty;
DeviceProcessLogShow($"{loc + 1} 号位置出餐控制,订单ID:{mORKS.OutMealId}");
mORKS.CookNoodleCom[loc] = false;
}
}
}
@@ -614,10 +637,11 @@ namespace BPASmartClient.MorkSUpgradedVer
}

//取餐完成逻辑处理
if (Delay.GetInstance("CompleteChange1").Start(!mORKS.DiningComplete, 1) && mORKS.CookCompleteFlatBit == true)
if (RTrig.GetInstance("CompleteChange1").Start(mORKS.DiningComplete) && mORKS.CookCompleteFlatBit == true)
{
OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成");
WriteData("M10.1", false);
mORKS.CookCompleteFlatBit = false;
mORKS.OutMealId = string.Empty;
mORKS.OutMealName = string.Empty;
@@ -721,7 +745,7 @@ namespace BPASmartClient.MorkSUpgradedVer
private void SetTakeNoodleLoc(ushort loc)
{
if (loc >= 1 && loc <= 6)
WriteData($"M16.{loc - 1}", true);
WriteData($"M15.{loc - 1}", true);
}




+ 13
- 1
BPASmartClient.MorkSUpgradedVer/GVL_MorkSUpgradedVer.cs View File

@@ -78,6 +78,18 @@ namespace BPASmartClient.MorkSUpgradedVer
/// </summary>
[VariableMonitor("制作完成标志")]
public bool CookCompleteFlatBit { get; set; }

/// <summary>
/// 取碗任务数量
/// </summary>
[VariableMonitor("取碗任务数量")]
public int TakeBowlTaskCount { get; set; }

/// <summary>
/// 取面任务数量
/// </summary>
[VariableMonitor("取面任务数量")]
public int RBTakeNoodleTaskCount { get; set; }
#endregion

#region 列表数据
@@ -108,7 +120,7 @@ namespace BPASmartClient.MorkSUpgradedVer
public string TakeBowName { get; set; } = string.Empty;

/// <summary>
/// 配料完成订单ID
/// 允许倒面位置ID
/// </summary>
public string IngredientsCompleteId { get; set; } = string.Empty;
/// <summary>


+ 12
- 12
BPASmartClient/App.config View File

@@ -4,12 +4,12 @@

<!--通用配置-->
<!--<add key="ClientId" value="43"/>-->
<add key="IsEnableTest" value="true"/>
<add key="IsEnableTest" value="false"/>

<!--测试环境-->
<add key="apollouri" value="http://10.2.1.21:28080/"/>
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/>
<add key="AppId" value="test1_HostComputer"/>
<add key ="Namespaces" value="DEV.test1.Config"/>
<add key ="Namespaces" value="DEV.test1.Config"/>-->

<!--开发环境-->
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/>
@@ -17,9 +17,9 @@
<add key ="Namespaces" value="DEV.Config"/>-->

<!--正式环境-->
<!--<add key="apollouri" value="http://47.108.65.220:28080/"/>
<add key="apollouri" value="http://47.108.65.220:28080/"/>
<add key="appid" value="hostcomputer"/>
<add key ="namespaces" value="test1.config"/>-->
<add key ="namespaces" value="test1.config"/>

<!--阿里云上报启动方式:API 或者 LOCAL-->
<!--API :通过客户端ID,调用接口查询“设备连接信息”-->
@@ -29,7 +29,7 @@
<add key="DeviceName" value="qsqdzklb"/>
<add key="DeviceSecret" value="e2b300892c3e21469c8dc6c7c5c4430d"/>
<add key="PasswordBox" value="6WrKhYmTIhLV7g24jIH/lg=="/>

<!--外设配置-->
<add key="COM_Coffee" value="COM3"/>
@@ -39,12 +39,12 @@
<add key="IceCream_CXB_Threshold" value="90"/>
<add key="COM_ICChip" value="COM6"/>
<add key="BAUD_IChip" value="9600"/>
<!--大屏MQTT-->
<add key="MQTT_DevieScreem_IP" value="171.221.208.23"/>
<add key="MQTT_DevieScreem_Port" value="11883"/>
<add key="MQTT_DevieScreem_User" value="admin"/>
<add key="MQTT_DevieScreem_Password" value="public1"/>
<!--大屏MQTT-->
<add key="MQTT_DevieScreem_IP" value="171.221.208.23"/>
<add key="MQTT_DevieScreem_Port" value="11883"/>
<add key="MQTT_DevieScreem_User" value="admin"/>
<add key="MQTT_DevieScreem_Password" value="public1"/>


</appSettings>

Loading…
Cancel
Save