taoye 2 years ago
parent
commit
6d0667320f
3 changed files with 138 additions and 5 deletions
  1. +60
    -3
      BPASmartClient.MorkBF/Control_MorkBF.cs
  2. +49
    -0
      BPASmartClient.MorkBF/Model/DataReport.cs
  3. +29
    -2
      BPASmartClient.MorkF/Control_MorkF.cs

+ 60
- 3
BPASmartClient.MorkBF/Control_MorkBF.cs View File

@@ -23,6 +23,7 @@ namespace BPASmartClient.MorkBF
public class Control_MorkBF : BaseDevice
{
GVL_MorkBF morkBF = new GVL_MorkBF();
DataReport dataReport = new DataReport();

public override DeviceClientType DeviceType => DeviceClientType.MORKCS;

@@ -549,6 +550,23 @@ namespace BPASmartClient.MorkBF
}
}), 1);

GetStatus("VW2250", new Action<object>((o) =>
{
if (o == null) return;
if (o is int[] values && values.Length == 1)
{
dataReport.FirePot1_PotState = values[0];
}
}), 1);
GetStatus("VW2350", new Action<object>((o) =>
{
if (o == null) return;
if (o is int[] values && values.Length == 1)
{
dataReport.FirePot2_PotState = values[0];
}
}), 1);

}

public override void ResetProgram()
@@ -1104,9 +1122,10 @@ namespace BPASmartClient.MorkBF
StatsCount = statsModels,
MaxWok_Dishes_1 = "满汉全席",
MaxWok_Dishes_2 = "海鲜大餐",
MaxWok_Task_1 = "无",
MaxWok_Task_2 = "无",
MaxWok_Process_1 = new List<ProcessModel>(),
MaxWok_Task_1 = ((PotState)dataReport.FirePot1_PotState).ToString(),
MaxWok_Task_2 = ((PotState)dataReport.FirePot2_PotState).ToString(),
MaxWok_Process_1 = SetFirePotPorcess(new Random().Next(0,11)),
MaxWok_Process_2 = SetFirePotPorcess(new Random().Next(0, 11)),
MaxWok_HeatGear_1 = morkBF.FirePot1_FireGear.ToString(),
MaxWok_HeatGear_2 = morkBF.FirePot2_FireGear.ToString(),
MaxWok_StirGear_1 = morkBF.FirePot1_StirGear.ToString(),
@@ -1127,5 +1146,43 @@ namespace BPASmartClient.MorkBF
}), "大屏数据上报");
}

private List<ProcessModel> SetFirePotPorcess(int potState)
{
if (potState > 0)
{
if(potState <=3)
{
SetState(2);
}
else if(potState>3&&potState < 9) SetState(3);
else if(potState == 9) SetState(4);
else if (potState == 10) SetState(5);
}
else
{
foreach(var item in dataReport.processModels)
{
item.Status = ProcessStatus.未执行;
}
}
return dataReport.processModels;


}

public void SetState(int c )
{
for (int i = 0; i < dataReport.processModels.Count; i++)
{
if (i == c)
{
dataReport.processModels[i].Status = ProcessStatus.正在执行;
}
else if( i<c) dataReport.processModels[i].Status = ProcessStatus.执行完成;
else if (i > c ) dataReport.processModels[i].Status = ProcessStatus.未执行;
}
}
}
}

+ 49
- 0
BPASmartClient.MorkBF/Model/DataReport.cs View File

@@ -0,0 +1,49 @@
using BPA.Message;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkBF.Model
{
public class DataReport
{
/// <summary>
/// 炒锅1工艺状态
/// </summary>
public int FirePot1_PotState { get; set; } = 0;
/// <summary>
/// 炒锅2工艺状态
/// </summary>
public int FirePot2_PotState { get; set; } = 0;

public List<ProcessModel> processModels = new List<ProcessModel>();

public DataReport()
{
processModels.Add( new ProcessModel() { Id = 0, Name = "开始", Status = ProcessStatus.未执行 });
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.未执行 });

}
}

public enum PotState
{
无任务=0,
炒锅预热中 =1,
开始抽油=2,
油预热中=3,
荤菜炒制中 =4,
调料炒制中=5,
素菜炒制中=6,
辅料炒制中=7,
关火焖制中=8,
炒制完成=9,
出餐完成=10,
}
}

+ 29
- 2
BPASmartClient.MorkF/Control_MorkF.cs View File

@@ -154,6 +154,8 @@ namespace BPASmartClient.MorkF
//FoodLibInit();
Task2ReadMaterialData();

ScreenDataServer();

//读取坐标系
MaterialCoordinate materialCoordinate = ReadMaterialCoordinate();
if(materialCoordinate != null)
@@ -2350,11 +2352,35 @@ namespace BPASmartClient.MorkF

private void ScreenDataServer()
{
LocalMqtt.GetInstance.Init(ScreenDeviceType.炒);
LocalMqtt.GetInstance.Init(ScreenDeviceType.炒);
ThreadManage.GetInstance().StartLong(new Action(() =>
{
List<StatsModel> statsModels = new List<StatsModel>();
statsModels.Add(new StatsModel() { Name = "帝王蟹", Count = 666 });
int i = new Random().Next(0, 100);
List<ProcessModel> processModels= new List<ProcessModel>();
switch ((i / 5) % 6)
{
case 0:
processModels = new List<ProcessModel>() { new ProcessModel() { Id = 1, Name = "启动", Status = ProcessStatus.正在执行 }, new ProcessModel() { Id = 1, Name = "热油", Status = ProcessStatus.未执行 }, new ProcessModel() { Id = 1, Name = "炒制", Status = ProcessStatus.未执行 }, new ProcessModel() { Id = 1, Name = "出餐", Status = ProcessStatus.未执行 }, new ProcessModel() { Id = 1, Name = "结束", Status = ProcessStatus.未执行 } };
break;
case 1:
processModels = new List<ProcessModel>() { new ProcessModel() { Id = 1, Name = "启动", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "热油", Status = ProcessStatus.正在执行 }, new ProcessModel() { Id = 1, Name = "炒制", Status = ProcessStatus.未执行 }, new ProcessModel() { Id = 1, Name = "出餐", Status = ProcessStatus.未执行 }, new ProcessModel() { Id = 1, Name = "结束", Status = ProcessStatus.未执行 } };
break;
case 2:
processModels = new List<ProcessModel>() { new ProcessModel() { Id = 1, Name = "启动", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "热油", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "炒制", Status = ProcessStatus.正在执行 }, new ProcessModel() { Id = 1, Name = "出餐", Status = ProcessStatus.未执行 }, new ProcessModel() { Id = 1, Name = "结束", Status = ProcessStatus.未执行 } };
break;
case 3:
processModels = new List<ProcessModel>() { new ProcessModel() { Id = 1, Name = "启动", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "热油", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "炒制", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "出餐", Status = ProcessStatus.正在执行 }, new ProcessModel() { Id = 1, Name = "结束", Status = ProcessStatus.未执行 } };
break;
case 4:
processModels = new List<ProcessModel>() { new ProcessModel() { Id = 1, Name = "启动", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "热油", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "炒制", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "出餐", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "结束", Status = ProcessStatus.正在执行 } };
break;
case 5:
processModels = new List<ProcessModel>() { new ProcessModel() { Id = 1, Name = "启动", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "热油", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "炒制", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "出餐", Status = ProcessStatus.执行完成 }, new ProcessModel() { Id = 1, Name = "结束", Status = ProcessStatus.执行完成 } };
break;
default: break;
}
ScreenModelMinWok maxWok = new ScreenModelMinWok
{
IsRun = new Random().Next(0, 2) == 0 ? IsRun.运行 : IsRun.停止, //设备是否运行
@@ -2368,7 +2394,8 @@ namespace BPASmartClient.MorkF
MinWok_Dishes_2 = "海鲜大餐",
MinWok_Task_1 = "炒制菜品",//当前任务
MinWok_Task_2 = "热油", //当前任务
MinWok_Process_1 = new List<ProcessModel>(), //炒锅当前任务流程
//MinWok_Process_1 = new List<ProcessModel>() { new ProcessModel() { Id = 1, Name = "启动", Status = ProcessStatus.正在执行 }, new ProcessModel() { Id = 1, Name = "热油", Status = ProcessStatus.未执行 }, new ProcessModel() { Id = 1, Name = "炒制", Status = ProcessStatus.未执行 }, new ProcessModel() { Id = 1, Name = "出餐", Status = ProcessStatus.未执行 }, new ProcessModel() { Id = 1, Name = "结束", Status = ProcessStatus.未执行 } },
MinWok_Process_1 = processModels, //炒锅当前任务流程
MinWok_Process_2 = new List<ProcessModel>(), //炒锅当前任务流程
MinWok_HeatGear_1 = new Random().Next(0, 5).ToString(), //炒锅加热档位
MinWok_HeatGear_2 = new Random().Next(0, 5).ToString(), //炒锅加热档位


Loading…
Cancel
Save