using BPA.Message;
using BPA.Models;
using BPASmartClient.Device;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BPASmartClient.MorkF
{
internal class GVL_MorkF
{
///
/// 小炒队列
///
public ConcurrentQueue StirFryGoodsQuenes { get; set; } = new ConcurrentQueue();
public bool IsAuto = true;
#region 炒锅
///
/// 炒锅上一次搅拌档位
///
public int Stir { set; get; }
///
/// 炒锅上一次火力
///
public int Fire { get; set; }
///
/// 炒锅是否在工作状态中
///
public bool FryWorking { get; set; }
///
/// 炒锅自动模式
///
[VariableMonitor("炒锅1锅低温度", "VW120", "160")]
public bool AutoMode { get; set; }
///
/// 炒锅1初始化完成
///
public bool FryPot1_InitialComplete { get; set; }
///
/// 炒锅1允许HBOT放盒
///
public bool FryPot1_HOBTPut { get; set; }
///
/// 炒锅1允许HBOT取盒
///
public bool FryPot1_HOBTGet { get; set; }
///
/// 往炒锅倒菜完成
///
public bool FryPot1_MaterialIntoPot { get; set; }
///
/// 出餐完成
///
public bool OutFoodCompelete { get; set; }
///
/// 允许出餐倒菜
///
public bool CanOutFood { get; set; }
///
/// 窗口取餐完成
///
public bool GetFoodCompelete { set; get; }
///
/// 允许倒洗锅水
///
public bool CanOutPotWashingWater { get; set; }
///
/// 搅拌臂在原点位
///
public bool ArmOnOrigin { get; set; }
///
/// 搅拌臂在工作位
///
public bool ArmOnWorking { get; set; }
///
/// 锅在原点位
///
public bool PotOnOrigin { get; set; }
///
/// 获取菜品是否完成
///
public bool GetMaterialComplete { get; set; }
#endregion
#region 炒锅大屏相关
///
/// 异常订单数量统计
///
public int orderAbnormalCount { get; set; } = 0;
///
/// 订单数量统计
///
public int orderCount { get; set; } = 0;
///
/// 当前炒制菜品
///
public string GoodName { get; set; }
///
/// 当前任务
///
public string Task { get; set; }
///
/// 当前加热档位
///
public string FireNow { get; set; }
///
/// 搅拌档位
///
public string StirNow { get; set; }
///
/// 炒锅当前锅底温度
///
public string TempNow { get; set; }
///
/// 当前炒锅进展
///
public List processModels { get; set; } = new List();
public void UpdateProcess(PotActions potActions)
{
switch (potActions.Actions)
{
case nameof(StirFryPotActionEnum.搅拌臂炒制位):
//设置为开始
SetState(0);
Task = "开始";
break;
case nameof(StirFryPotActionEnum.加热开启):
Task = "热油";
//设置为热油
SetState(1);
break;
///以下为不处理,炒制菜品可能为热油阶段,不处理,取原料可能在开启后立即开始
case nameof(StirFryPotActionEnum.取原料):
case nameof(StirFryPotActionEnum.炒制菜品):
break;
case nameof(StirFryPotActionEnum.设置搅拌挡位1):
StirNow = "1";
break;
case nameof(StirFryPotActionEnum.设置搅拌挡位2):
StirNow = "2";
break;
case nameof(StirFryPotActionEnum.设置搅拌挡位3):
StirNow = "3";
break;
case nameof(StirFryPotActionEnum.关闭搅拌):
StirNow = "0";
break;
case nameof(StirFryPotActionEnum.设置加热挡位1):
TempNow = "60";
FireNow = "1";
break;
case nameof(StirFryPotActionEnum.设置加热挡位2):
TempNow = "100";
FireNow = "2";
break;
case nameof(StirFryPotActionEnum.设置加热挡位3):
TempNow = "120";
FireNow = "3";
break;
case nameof(StirFryPotActionEnum.设置加热挡位4):
TempNow = "150";
FireNow = "4";
break;
case nameof(StirFryPotActionEnum.设置加热挡位5):
TempNow = "200";
FireNow = "5";
break;
case nameof(StirFryPotActionEnum.设置加热挡位6):
TempNow = "250";
FireNow = "6";
break;
case nameof(StirFryPotActionEnum.设置加热挡位7):
TempNow = "300";
FireNow = "7";
break;
case nameof(StirFryPotActionEnum.设置加热挡位8):
TempNow = "350";
FireNow = "8";
break;
case nameof(StirFryPotActionEnum.设置加热挡位9):
TempNow = "400";
FireNow = "9";
break;
case nameof(StirFryPotActionEnum.设置加热挡位10):
TempNow = "500";
FireNow = "10";
break;
///以下为待定
case nameof(StirFryPotActionEnum.停止加热):
break;
case nameof(StirFryPotActionEnum.开启搅拌):
break;
case nameof(StirFryPotActionEnum.道菜启动):
case nameof(StirFryPotActionEnum.加调料):
Task = "炒制";
//设置为炒制
SetState(2);
break;
case nameof(StirFryPotActionEnum.出餐启动):
Task = "出餐";
SetState(3);
break;
///设置为结束
case nameof(StirFryPotActionEnum.搅拌臂原点位):
case nameof(StirFryPotActionEnum.洗锅):
Task = "完成";
SetState(4);
break;
default:
break;
}
}
private void SetState(int c)
{
for (int i = 0; i < processModels.Count; i++)
{
if (i == c)
{
processModels[i].Status = ProcessStatus.正在执行;
}
else if (i < c) processModels[i].Status = ProcessStatus.执行完成;
else if (i > c) processModels[i].Status = ProcessStatus.未执行;
}
}
public void ScreenInit()
{
Task = "准备";
processModels.Clear();
//初始化进度列表
processModels.Add(new ProcessModel() { Id = 1, Name = "开始", Status = ProcessStatus.未执行 });
processModels.Add(new ProcessModel() { Id = 2, Name = "热油", Status = ProcessStatus.未执行 });
processModels.Add(new ProcessModel() { Id = 3, Name = "炒制", Status = ProcessStatus.未执行 });
processModels.Add(new ProcessModel() { Id = 4, Name = "出餐", Status = ProcessStatus.未执行 });
processModels.Add(new ProcessModel() { Id = 5, Name = "完成", Status = ProcessStatus.未执行 });
}
public void ScreenClear()
{
processModels.Clear();
Task = string.Empty;
GoodName = string.Empty;
}
#endregion
#region 调料通道
public bool PassWay1_1Compelete { get; set; }
public bool PassWay1_2Compelete { get; set; }
public bool PassWay1_3Compelete { get; set; }
public bool PassWay1_4Compelete { get; set; }
public bool PassWay1_5Compelete { get; set; }
public bool PassWay1_6Compelete { get; set; }
public bool PassWay1_7Compelete { get; set; }
public bool PassWay1_8Compelete { get; set; }
public bool PassWay1_9Compelete { get; set; }
public bool PassWay1_10Compelete { get; set; }
public bool PassWay1_11Compelete { get; set; }
public bool PassWay1_12Compelete { get; set; }
public bool PassWay1_13Compelete { get; set; }
public bool PassWay1_14Compelete { get; set; }
public Dictionary PassWay1_Compelete = new Dictionary();
#endregion
public GVL_MorkF()
{
PassWay1_Compelete.Add(1,PassWay1_1Compelete);
PassWay1_Compelete.Add(2,PassWay1_2Compelete);
PassWay1_Compelete.Add(3,PassWay1_3Compelete);
PassWay1_Compelete.Add(4,PassWay1_4Compelete);
PassWay1_Compelete.Add(5,PassWay1_5Compelete);
PassWay1_Compelete.Add(6,PassWay1_6Compelete);
PassWay1_Compelete.Add(7,PassWay1_7Compelete);
PassWay1_Compelete.Add(8,PassWay1_8Compelete);
PassWay1_Compelete.Add(9,PassWay1_9Compelete);
PassWay1_Compelete.Add(10,PassWay1_10Compelete);
PassWay1_Compelete.Add(11,PassWay1_11Compelete);
PassWay1_Compelete.Add(12,PassWay1_12Compelete);
PassWay1_Compelete.Add(13,PassWay1_13Compelete);
PassWay1_Compelete.Add(14,PassWay1_14Compelete);
////初始化进度列表
//ScreenInit();
}
///
/// 订单取配料队列
///
public ConcurrentQueue TakeMaterialQueue = new ConcurrentQueue();
///
/// 订单供盘队列
///
public ConcurrentQueue TakePlateQueue = new ConcurrentQueue();
#region 单口锅逻辑变量
///
/// 订单唯一ID
///
public string CurrentOrderId { get; set; }
#endregion
public Dictionary StartPassWay { get; set; } = new Dictionary()
{
{1,"LB24" },
{2,"LB25" },
{3,"LB26" },
{4,"LB27" },
{5,"LB28" },
{6,"LB29" },
{7,"LB30" },
{8,"LB31" },
{9,"LB32" },
{10,"LB33" },
{11,"LB34" },
{12,"LB35" },
{13,"LB36" },
{14,"LB37" },
};
public Dictionary PassWayValue { get; set; } = new Dictionary()
{
{1,"LW0" },
{2,"LW1" },
{3,"LW2" },
{4,"LW3" },
{5,"LW4" },
{6,"LW5" },
{7,"LW6" },
{8,"LW7" },
{9,"LW8" },
{10,"LW9" },
{11,"LW10" },
{12,"LW11" },
{13,"LW12" },
{14,"LW13" },
};
}
}