diff --git a/BPASmartClient.Device/BaseDevice.cs b/BPASmartClient.Device/BaseDevice.cs
index 6f085378..1487cdc3 100644
--- a/BPASmartClient.Device/BaseDevice.cs
+++ b/BPASmartClient.Device/BaseDevice.cs
@@ -127,6 +127,22 @@ namespace BPASmartClient.Device
}
}
}
+ ///
+ /// 多设备分开写控制
+ ///
+ ///
+ ///
+ public void WriteControlExact(string address, object value,int i)
+ {
+ if (peripherals != null)
+ {
+ if (peripherals.Count > i)
+ {
+ peripherals.ElementAt(i).WriteData(address, value);
+ }
+ }
+ }
+
///
/// 设备过程日志显示
diff --git a/BPASmartClient.MilkWithTea/View/RecipeConfige.xaml.cs b/BPASmartClient.MilkWithTea/View/RecipeConfige.xaml.cs
index abaf3f39..8b7e2679 100644
--- a/BPASmartClient.MilkWithTea/View/RecipeConfige.xaml.cs
+++ b/BPASmartClient.MilkWithTea/View/RecipeConfige.xaml.cs
@@ -43,6 +43,8 @@ namespace BPASmartClient.MilkWithTea.View
private void Button_Click(object sender, RoutedEventArgs e)
{
this.Close();
+
+
}
@@ -69,7 +71,7 @@ namespace BPASmartClient.MilkWithTea.View
private bool IsMouseOverTarget(Visual target, GetPositionDelegate getPosition)
{
Rect bounds = VisualTreeHelper.GetDescendantBounds(target);
- Point mousePos = getPosition((IInputElement)target);
+ Point mousePos = getPosition((IInputElement)target);
return bounds.Contains(mousePos);
}
diff --git a/BPASmartClient.MorkBF/BPASmartClient.MorkBF.csproj b/BPASmartClient.MorkBF/BPASmartClient.MorkBF.csproj
new file mode 100644
index 00000000..7b8b195f
--- /dev/null
+++ b/BPASmartClient.MorkBF/BPASmartClient.MorkBF.csproj
@@ -0,0 +1,17 @@
+
+
+
+ net6.0-windows
+ enable
+ true
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.MorkBF/Class1.cs b/BPASmartClient.MorkBF/Class1.cs
new file mode 100644
index 00000000..cb4f64cb
--- /dev/null
+++ b/BPASmartClient.MorkBF/Class1.cs
@@ -0,0 +1,8 @@
+using System;
+
+namespace BPASmartClient.MorkBF
+{
+ public class Class1
+ {
+ }
+}
diff --git a/BPASmartClient.MorkBF/Control_MorkBF.cs b/BPASmartClient.MorkBF/Control_MorkBF.cs
new file mode 100644
index 00000000..04cdf982
--- /dev/null
+++ b/BPASmartClient.MorkBF/Control_MorkBF.cs
@@ -0,0 +1,136 @@
+using BPA.Message.Enum;
+using BPASmartClient.Device;
+using BPASmartClient.EventBus;
+using BPASmartClient.Helper;
+using BPASmartClient.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using static BPASmartClient.EventBus.EventBus;
+
+namespace BPASmartClient.MorkBF
+{
+ public class Control_MorkBF : BaseDevice
+ {
+ GVL_MorkBF morkBF = new GVL_MorkBF();
+
+ public override DeviceClientType DeviceType => DeviceClientType.MORKCS;
+
+ public override void DoMain()
+ {
+ CommandRegist();//调试
+ ServerInit();
+ DataParse();//数据解析
+ DeviceProcessLogShow("MORKF 设备初始化完成");
+ }
+
+ private void DataParse()
+ {
+ EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle)
+ {
+ if (@event == null) return;
+ if (@event is DoOrderEvent order)
+ {
+ if (order.MorkOrder.GoodBatchings == null) return;
+ OrderCount++;
+ DeviceProcessLogShow($"接收到{OrderCount}次订单");
+
+
+
+ }
+
+ });
+ }
+
+ private void ServerInit()
+ {
+ //物料信息
+ EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
+ {
+ if (@event == null) return;
+ if (@event is MaterialDeliveryEvent material)
+ {
+ orderMaterialDelivery = material.orderMaterialDelivery;
+
+ }
+ });
+
+ //配方数据信息
+ EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
+ {
+ if (@event == null) return;
+ if (@event is RecipeBomEvent recipe)
+ {
+ recipeBoms = recipe.recipeBoms;
+ }
+ });
+ }
+ ///
+ /// 调试
+ ///
+ ///
+ private void CommandRegist()
+ {
+
+ }
+
+ public override void MainTask()
+ {
+ if(morkBF.FirePan1_Order.Count == 0&&!morkBF.FirePan1_Busy)
+ {
+ ThreadManage.GetInstance().Start(FirePot1_Process, "炒锅1主进程");
+ }
+
+ if (morkBF.FirePan2_Order.Count == 0 && !morkBF.FirePan2_Busy)
+ {
+ ThreadManage.GetInstance().Start(FirePot2_Process, "炒锅2主进程");
+ }
+ }
+
+ private void FirePot1_Process()
+ {
+ morkBF.FirePan1_Busy = true;
+ morkBF.FirePan1_Date = DateTime.Now;
+ while (morkBF.FirePan1_Date.AddMinutes(1)> DateTime.Now)
+ {
+ Thread.Sleep(500);
+ }
+ ThreadManage.GetInstance().StopTask("炒锅1主进程");
+ }
+
+ private void FirePot2_Process()
+ {
+ morkBF.FirePan2_Busy = true;
+ morkBF.FirePan2_Date = DateTime.Now;
+ while (morkBF.FirePan2_Date.AddMinutes(1) > DateTime.Now)
+ {
+ Thread.Sleep(500);
+ }
+ ThreadManage.GetInstance().StopTask("炒锅2主进程");
+ }
+
+ public override void ReadData()
+ {
+
+ }
+
+ public override void ResetProgram()
+ {
+ morkBF = null;
+ morkBF = new GVL_MorkBF();
+ }
+
+ public override void SimOrder()
+ {
+
+ }
+
+ public override void Stop()
+ {
+
+ }
+ }
+}
diff --git a/BPASmartClient.MorkBF/GVL_MorkBF.cs b/BPASmartClient.MorkBF/GVL_MorkBF.cs
new file mode 100644
index 00000000..0dedfe7a
--- /dev/null
+++ b/BPASmartClient.MorkBF/GVL_MorkBF.cs
@@ -0,0 +1,33 @@
+using BPASmartClient.MorkBF.Model;
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.MorkBF
+{
+ internal class GVL_MorkBF
+ {
+ ///
+ /// 炒锅1订单队列
+ ///
+ public ConcurrentQueue FirePan1_Order { get; set; } = new ConcurrentQueue();
+ ///
+ /// 炒锅2订单队列
+ ///
+ public ConcurrentQueue FirePan2_Order { get; set; } = new ConcurrentQueue();
+ ///
+ /// 炒锅1忙碌
+ ///
+ public bool FirePan1_Busy = false;
+ ///
+ /// 炒锅2忙碌
+ ///
+ public bool FirePan2_Busy = false;
+
+ public DateTime FirePan1_Date;
+ public DateTime FirePan2_Date;
+ }
+}
diff --git a/BPASmartClient.MorkBF/Model/BF_Food.cs b/BPASmartClient.MorkBF/Model/BF_Food.cs
new file mode 100644
index 00000000..6891c445
--- /dev/null
+++ b/BPASmartClient.MorkBF/Model/BF_Food.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.MorkBF.Model
+{
+ public class BF_Food
+ {
+ ///
+ /// 菜品名称
+ ///
+ public string FoodName { get; set; }
+ ///
+ /// 菜品ID
+ ///
+ public string FoodID { get; set; }
+
+ }
+
+ public class BF_PotAction
+ {
+ ///
+ /// 步骤
+ ///
+ public int FryTime
+ {
+ get;
+ set;
+ }
+ ///
+ /// 时间
+ ///
+ public int During
+ {
+ get;
+ set;
+ }
+ ///
+ /// 动作
+ ///
+ public string Actions
+ {
+ get;
+ set;
+ }
+ ///
+ /// 调料
+ ///
+ public List SeasoningLists
+ {
+ get;
+ set;
+ }
+ ///
+ /// 菜品
+ ///
+ public List MaterialLists
+ {
+ get;
+ set;
+ }
+ }
+}
diff --git a/BPASmartClient.MorkBF/OrderLocInfo.cs b/BPASmartClient.MorkBF/OrderLocInfo.cs
new file mode 100644
index 00000000..00aed4ba
--- /dev/null
+++ b/BPASmartClient.MorkBF/OrderLocInfo.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.MorkBF
+{
+ internal class OrderLocInfo
+ {
+ }
+}
diff --git a/BPASmartClient.MorkBF/VIew/DebugView.xaml b/BPASmartClient.MorkBF/VIew/DebugView.xaml
new file mode 100644
index 00000000..f05554f1
--- /dev/null
+++ b/BPASmartClient.MorkBF/VIew/DebugView.xaml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.MorkBF/VIew/DebugView.xaml.cs b/BPASmartClient.MorkBF/VIew/DebugView.xaml.cs
new file mode 100644
index 00000000..bfd73890
--- /dev/null
+++ b/BPASmartClient.MorkBF/VIew/DebugView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace BPASmartClient.MorkBF.VIew
+{
+ ///
+ /// DebugView.xaml 的交互逻辑
+ ///
+ public partial class DebugView : UserControl
+ {
+ public DebugView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/BPASmartClient.MorkBF/VIew/FoodManagerView.xaml b/BPASmartClient.MorkBF/VIew/FoodManagerView.xaml
new file mode 100644
index 00000000..d5c0a00e
--- /dev/null
+++ b/BPASmartClient.MorkBF/VIew/FoodManagerView.xaml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.MorkBF/VIew/FoodManagerView.xaml.cs b/BPASmartClient.MorkBF/VIew/FoodManagerView.xaml.cs
new file mode 100644
index 00000000..6978bf31
--- /dev/null
+++ b/BPASmartClient.MorkBF/VIew/FoodManagerView.xaml.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace BPASmartClient.MorkBF.VIew
+{
+ ///
+ /// FoodManagerView.xaml 的交互逻辑
+ ///
+ public partial class FoodManagerView : Window
+ {
+ public FoodManagerView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/BPASmartClient.MorkF/Control_MorkF.cs b/BPASmartClient.MorkF/Control_MorkF.cs
index 4b4ac915..5c847986 100644
--- a/BPASmartClient.MorkF/Control_MorkF.cs
+++ b/BPASmartClient.MorkF/Control_MorkF.cs
@@ -36,8 +36,6 @@ namespace BPASmartClient.MorkF
{
#region 设备控制
ActionManage.GetInstance.Register(PLCInite, "InitCommand");
- ActionManage.GetInstance.Register(FoodPlcInite, "FoodPlcInite");
- ActionManage.GetInstance.Register(InitialData, "SimultaorOrder");
ActionManage.GetInstance.Register(StartOrder, "StartOrder");
ActionManage.GetInstance.Register(StartLocalOrder, "StartLocalOrder");
#endregion
@@ -45,7 +43,6 @@ namespace BPASmartClient.MorkF
#region 菜品库
ActionManage.GetInstance.Register(FoodLibInit, "FoodLibInit");
ActionManage.GetInstance.Register(Electromagnetism, "Electromagnetism");
- ActionManage.GetInstance.Register(Electromagnetism, "Electromagnetism");
ActionManage.GetInstance.Register(GetDistance_1, "GetDistance_1");
ActionManage.GetInstance.Register(GetDistance_2, "GetDistance_2");
ActionManage.GetInstance.Register(GetDistance_3, "GetDistance_3");
@@ -78,38 +75,53 @@ namespace BPASmartClient.MorkF
}
#region 菜品库
-
+ ///
+ /// 菜品库数据写入
+ ///
+ ///
+ ///
+ private void MaterailLibrary_Write(string address,object value)
+ {
+ WriteControlExact(address, value, 1);
+ }
+ ///
+ /// 菜品库初始化
+ ///
public void FoodLibInit()
{
- WriteControl("", true);
+ MaterailLibrary_Write("", true);
}
+ ///
+ /// 电磁阀启停
+ ///
+ ///
public void Electromagnetism(object o)
{
if (o == null) return;
if (o is List bs && bs.Count == 1)
{
- WriteControl("", bs[0]);
+ MaterailLibrary_Write("", bs[0]);
}
}
public void GetDistance_1()
{
- WriteControl("", true);
+ MaterailLibrary_Write("", true);
}
public void GetDistance_2()
{
- WriteControl("", true);
+ MaterailLibrary_Write("", true);
}
public void GetDistance_3()
{
- WriteControl("", true);
+ MaterailLibrary_Write("", true);
}
public void PawTurnFront()
{
- WriteControl("", true);
+ MaterailLibrary_Write("", true);
}
public void PawTurnBack()
{
- WriteControl("", true);
+ MaterailLibrary_Write("", true);
}
///
/// 设定机械臂的位置
@@ -118,10 +130,12 @@ namespace BPASmartClient.MorkF
///
public void SetArmPosition(int X, int y)
{
- WriteControl("", true);
+ MaterailLibrary_Write("", true);
}
#endregion
+
+
///
/// 出调料
///
@@ -131,9 +145,9 @@ namespace BPASmartClient.MorkF
if (o == null) return;
if (o is List ints && ints.Count == 2)
{
- WriteControl(morkF.PassWayValue[ints[0]], (ushort)ints[1]);//写入通道值
+ FirePot1_Write(morkF.PassWayValue[ints[0]], (ushort)ints[1]);//写入通道值
Thread.Sleep(400);
- WriteControl(morkF.StartPassWay[ints[0]], true);//开启通道
+ FirePot1_Write(morkF.StartPassWay[ints[0]], true);//开启通道
Thread.Sleep(400);
}
}
@@ -144,43 +158,51 @@ namespace BPASmartClient.MorkF
{
foreach (SeasoningList seasoning in seasoningLists)
{
- WriteControl(morkF.PassWayValue[seasoning.Loc], (ushort)seasoning.Qty);
+ FirePot1_Write(morkF.PassWayValue[seasoning.Loc], (ushort)seasoning.Qty);
Thread.Sleep(300);
}
foreach (SeasoningList seasoning in seasoningLists)
{
- WriteControl(morkF.StartPassWay[seasoning.Loc], true);
+ FirePot1_Write(morkF.StartPassWay[seasoning.Loc], true);
Thread.Sleep(300);
}
}
#region 炒锅1
+ private void FirePot1_Write(string address,object value)
+ {
+ WriteControlExact(address, value, 0);
+ }
///
/// 复位
///
public void Plc1Reset()
{
- StopFire();
- Thread.Sleep(200);
- StopStir();
- Thread.Sleep(200);
- WriteControl("LB5", false);
- Thread.Sleep(200);
- WriteControl("LB3", false);
- Thread.Sleep(200);
- WriteControl("LB6", false);
- Thread.Sleep(200);
- WriteControl("LB7", false);
- Thread.Sleep(200);
- WriteControl("LB4", false);
- Thread.Sleep(200);
- WriteControl("LB53", false);
- foreach (var item in morkF.StartPassWay.Values)
+ ThreadManage.GetInstance().Start(new Action(() =>
{
+ StopFire();
Thread.Sleep(200);
- WriteControl(item, false);
- }
+ StopStir();
+ Thread.Sleep(200);
+ FirePot1_Write("LB5", false);
+ Thread.Sleep(200);
+ FirePot1_Write("LB3", false);
+ Thread.Sleep(200);
+ FirePot1_Write("LB6", false);
+ Thread.Sleep(200);
+ FirePot1_Write("LB7", false);
+ Thread.Sleep(200);
+ FirePot1_Write("LB4", false);
+ Thread.Sleep(200);
+ FirePot1_Write("LB53", false);
+ foreach (var item in morkF.StartPassWay.Values)
+ {
+ Thread.Sleep(200);
+ FirePot1_Write(item, false);
+ }
+ }),"炒锅1初始化");
+
}
//加油
public void AddOil()
@@ -190,50 +212,50 @@ namespace BPASmartClient.MorkF
//加热启动
public void StartFire()
{
- WriteControl("LB1", true);
+ FirePot1_Write("LB1", true);
Thread.Sleep(200);
}
//加热停止
public void StopFire()
{
- WriteControl("LB1", false);
+ FirePot1_Write("LB1", false);
Thread.Sleep(200);
}
//搅拌启动
public void StartStir()
{
- WriteControl("LB2", true);
+ FirePot1_Write("LB2", true);
Thread.Sleep(200);
}
//搅拌启停止
public void StopStir()
{
- WriteControl("LB2", false);
+ FirePot1_Write("LB2", false);
Thread.Sleep(200);
}
//倒菜
public void OutFood()
{
- WriteControl("LB3", true);
+ FirePot1_Write("LB3", true);
MessageLog.GetInstance.Show("倒菜启动");
while (!morkF.FryPot1_MaterialIntoPot)
{
Thread.Sleep(200);
}
- WriteControl("LB3", false);
+ FirePot1_Write("LB3", false);
Thread.Sleep(200);
MessageLog.GetInstance.Show("倒菜完成");
}
//搅拌臂去原点位
public void StirArmGoOrigin()
{
- WriteControl("LB5", true);
+ FirePot1_Write("LB5", true);
MessageLog.GetInstance.Show("搅拌臂去原点位");
while (!morkF.ArmOnOrigin)
{
Thread.Sleep(200);
}
- WriteControl("LB5", false);
+ FirePot1_Write("LB5", false);
Thread.Sleep(200);
MessageLog.GetInstance.Show("搅拌臂到达原点位");
@@ -244,14 +266,14 @@ namespace BPASmartClient.MorkF
{
if (!morkF.ArmOnWorking)
{
- WriteControl("LB6", true);
+ FirePot1_Write("LB6", true);
MessageLog.GetInstance.Show("搅拌臂去工作位");
while (!morkF.ArmOnWorking)
{
Thread.Sleep(200);
}
- WriteControl("LB6", false);
+ FirePot1_Write("LB6", false);
Thread.Sleep(200);
MessageLog.GetInstance.Show("搅拌臂到达工作位");
}
@@ -260,16 +282,16 @@ namespace BPASmartClient.MorkF
//HBOT放盒子到位
public void HBOTGoWork()
{
- WriteControl("LB7", true);
+ FirePot1_Write("LB7", true);
Thread.Sleep(400);
- WriteControl("LB7", false);
+ FirePot1_Write("LB7", false);
}
//出餐启动
public void OutMeal()
{
- WriteControl("LB4", true);
+ FirePot1_Write("LB4", true);
Thread.Sleep(200);
- WriteControl("LB4", false);
+ FirePot1_Write("LB4", false);
}
//加热挡位设定
public void SetFire(object o)
@@ -277,7 +299,7 @@ namespace BPASmartClient.MorkF
if (o == null) return;
if (o is List ints && ints.Count == 1)
{
- WriteControl("LW14", (ushort)ints[0]);
+ FirePot1_Write("LW14", (ushort)ints[0]);
Thread.Sleep(200);
}
@@ -293,8 +315,9 @@ namespace BPASmartClient.MorkF
if (o == null) return;
if (o is List ints && ints.Count == 1)
{
- WriteControl("LW15", (ushort)ints[0]);
+ FirePot1_Write("LW15", (ushort)ints[0]);
Thread.Sleep(200);
+
}
}
@@ -302,33 +325,7 @@ namespace BPASmartClient.MorkF
- ///
- /// 订单初始化
- ///
- private void InitialData()
- {
- string subId = Guid.NewGuid().ToString();
- //单个订单
- //string subId = Guid.NewGuid().ToString();
- //morkF.TakeMaterialQueue.Enqueue(new OrderLocInfo() { SuborderId = subId, MaterialLoc = new List() { 1 } });//A料
- //morkF.TakeMaterialQueue.Enqueue(new OrderLocInfo() { SuborderId = subId, MaterialLoc = new List() { 2 } });//B料
- //morkF.TakeMaterialQueue.Enqueue(new OrderLocInfo() { SuborderId = subId, MaterialLoc = new List() { 3 } });//C料
- //morkF.TakePlateQueue.Enqueue(new OrderLocInfo() { SuborderId = subId });
- //resultorder.AddRange(new int[] { 1, 2, 3 });
-
- //for (int i = 0; i < morkF.listStirBom.Count; i++)
- //{
- // morkF.TakeMaterialQueue.Enqueue(new OrderLocInfo() { SuborderId = subId+i, MaterialLoc = new List() { 1 } });//A料
- // morkF.TakeMaterialQueue.Enqueue(new OrderLocInfo() { SuborderId = subId+i, MaterialLoc = new List() { 2 } });//B料
- // morkF.TakeMaterialQueue.Enqueue(new OrderLocInfo() { SuborderId = subId+i, MaterialLoc = new List() { 3 } });//C料
- // morkF.TakePlateQueue.Enqueue(new OrderLocInfo() { SuborderId = subId+i });
- // //resultorder.AddRange(new int[] { 1, 2, 3 });
- //}
-
-
-
- }
-
+
///
/// 本地菜单下单
///
@@ -852,15 +849,15 @@ namespace BPASmartClient.MorkF
action((bool[])peripheralStatus[key]);//获取PLC指定地址的状态值
}
}
- ///
- /// 写数据
- ///
- ///
- ///
- private void WriteData(string address, object value)
- {
- EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value });
- }
+ /////
+ ///// 写数据
+ /////
+ /////
+ /////
+ //private void WriteData(string address, object value)
+ //{
+ // EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value });
+ //}
///
/// 炒锅初始化
@@ -868,21 +865,15 @@ namespace BPASmartClient.MorkF
public void PLCInite()
{
- WriteData("LB0", true);
+ FirePot1_Write("LB0", true);
while(!morkF.FryPot1_InitialComplete)
{
Thread.Sleep(500);
}
- WriteData("LB0", false);
+ FirePot1_Write("LB0", false);
}
- ///
- /// 菜品库初始化
- ///
- public void FoodPlcInite()
- {
- WriteData("", true);
- }
+
///
@@ -898,98 +889,98 @@ namespace BPASmartClient.MorkF
private void morkSim(object o)
{
- if (o == null) return;
- if(o is List ins)
- {
- ThreadManage.GetInstance().Start(new Action(() =>
- {
- if (morkF.FryPot1_InitialComplete && morkF.AutoMode)//初始化完成&&自动模式&& 锅在原点位置
- {
- if (!morkF.ArmOnWorking)//搅拌臂是否在工作位
- {
- StirArmGoWork();
-
- while (!morkF.ArmOnWorking)
- {
- Thread.Sleep(500);
- }
- OutSeasoning(new List { 1, 100 });//加油500g
- while (!morkF.PassWay1_1Compelete)
- {
- Thread.Sleep(1000);
- }
- WriteControl(morkF.StartPassWay[ 1], false);//开启通道关闭
- Thread.Sleep(500);
- SetFire(new List { ins[1] });//加热三档
-
- StartFire();//开始加热
- Thread.Sleep(500);
- SetStir(new List { ins[2] });//搅拌二挡
- Thread.Sleep(500);
- StartStir();//开始搅拌
- Thread.Sleep(ins[0]*1000);//加热10s
-
- OutSeasoning(new List { 11, 30 });//加调料1 50g
- Thread.Sleep(400);
- OutSeasoning(new List { 12, 30 });//加调料2 30g
- while (!morkF.PassWay1_11Compelete&& !morkF.PassWay1_12Compelete)
- {
- Thread.Sleep(1000);
- }
+ //if (o == null) return;
+ //if(o is List ins)
+ //{
+ // ThreadManage.GetInstance().Start(new Action(() =>
+ // {
+ // if (morkF.FryPot1_InitialComplete && morkF.AutoMode)//初始化完成&&自动模式&& 锅在原点位置
+ // {
+ // if (!morkF.ArmOnWorking)//搅拌臂是否在工作位
+ // {
+ // StirArmGoWork();
+
+ // while (!morkF.ArmOnWorking)
+ // {
+ // Thread.Sleep(500);
+ // }
+ // OutSeasoning(new List { 1, 100 });//加油500g
+ // while (!morkF.PassWay1_1Compelete)
+ // {
+ // Thread.Sleep(1000);
+ // }
+ // WriteControlExact(morkF.StartPassWay[ 1], false);//开启通道关闭
+ // Thread.Sleep(500);
+ // SetFire(new List { ins[1] });//加热三档
+
+ // StartFire();//开始加热
+ // Thread.Sleep(500);
+ // SetStir(new List { ins[2] });//搅拌二挡
+ // Thread.Sleep(500);
+ // StartStir();//开始搅拌
+ // Thread.Sleep(ins[0]*1000);//加热10s
+
+ // OutSeasoning(new List { 11, 30 });//加调料1 50g
+ // Thread.Sleep(400);
+ // OutSeasoning(new List { 12, 30 });//加调料2 30g
+ // while (!morkF.PassWay1_11Compelete&& !morkF.PassWay1_12Compelete)
+ // {
+ // Thread.Sleep(1000);
+ // }
- WriteControl(morkF.StartPassWay[11], false);//开启通道关闭
- Thread.Sleep(500);
- WriteControl(morkF.StartPassWay[12], false);//开启通道信号关闭
+ // WriteControlExact(morkF.StartPassWay[11], false);//开启通道关闭
+ // Thread.Sleep(500);
+ // WriteControlExact(morkF.StartPassWay[12], false);//开启通道信号关闭
- Thread.Sleep(500);
-
- OutFood();//倒菜品1
- while (!morkF.FryPot1_MaterialIntoPot)//菜品1倒菜完成
- {
- Thread.Sleep(500);
- }
- WriteControl("LB53", false);
- Thread.Sleep(500);
- SetFire(new List { ins[4] });//菜品1加热档
- Thread.Sleep(500);
- SetStir(new List() { ins[5] });//菜品1搅拌挡
- Thread.Sleep(ins[3]*1000);//菜品1炒制时间
-
- OutSeasoning(new List {3, 8 });//加调料3 20g
- while (!morkF.PassWay1_3Compelete)
- {
- Thread.Sleep(1000);
- }
- WriteControl(morkF.StartPassWay[3], false);//开启通道信号关闭
- Thread.Sleep(500);
- OutFood();//倒菜菜品2
- while (!morkF.FryPot1_MaterialIntoPot)//菜品2倒菜完成
- {
- Thread.Sleep(500);
- }
- WriteControl("LB53", false);
- Thread.Sleep(500);
- SetFire(new List { ins[7] });//菜品2加热档
- Thread.Sleep(500);
- SetStir(new List() { ins[8] });//菜品2搅拌挡
- Thread.Sleep(ins[6] * 1000);//菜品2炒制时间
-
-
-
- StopStir();//停止搅拌
- Thread.Sleep(500);
- StopFire();//停止加热
- Thread.Sleep(2000);
- StirArmGoOrigin();//搅拌臂回原点位
- }
- }
- }), "模拟炒锅1订单");
- }
+ // Thread.Sleep(500);
+
+ // OutFood();//倒菜品1
+ // while (!morkF.FryPot1_MaterialIntoPot)//菜品1倒菜完成
+ // {
+ // Thread.Sleep(500);
+ // }
+ // WriteControlExact("LB53", false);
+ // Thread.Sleep(500);
+ // SetFire(new List { ins[4] });//菜品1加热档
+ // Thread.Sleep(500);
+ // SetStir(new List() { ins[5] });//菜品1搅拌挡
+ // Thread.Sleep(ins[3]*1000);//菜品1炒制时间
+
+ // OutSeasoning(new List {3, 8 });//加调料3 20g
+ // while (!morkF.PassWay1_3Compelete)
+ // {
+ // Thread.Sleep(1000);
+ // }
+ // WriteControlExact(morkF.StartPassWay[3], false);//开启通道信号关闭
+ // Thread.Sleep(500);
+ // OutFood();//倒菜菜品2
+ // while (!morkF.FryPot1_MaterialIntoPot)//菜品2倒菜完成
+ // {
+ // Thread.Sleep(500);
+ // }
+ // WriteControlExact("LB53", false);
+ // Thread.Sleep(500);
+ // SetFire(new List { ins[7] });//菜品2加热档
+ // Thread.Sleep(500);
+ // SetStir(new List() { ins[8] });//菜品2搅拌挡
+ // Thread.Sleep(ins[6] * 1000);//菜品2炒制时间
+
+
+
+ // StopStir();//停止搅拌
+ // Thread.Sleep(500);
+ // StopFire();//停止加热
+ // Thread.Sleep(2000);
+ // StirArmGoOrigin();//搅拌臂回原点位
+ // }
+ // }
+ // }), "模拟炒锅1订单");
+ //}
}
diff --git a/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs
index e0012c74..2d398acc 100644
--- a/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs
+++ b/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs
@@ -170,7 +170,6 @@ namespace BPASmartClient.MorkF.ViewModel
{
#region 设备控制
PlcInite = new RelayCommand(() => { ActionManage.GetInstance.Send("InitCommand"); });
- FoodPlcInite = new RelayCommand(() => { ActionManage.GetInstance.Send("FoodPlcInite"); });
Plc1Reset = new RelayCommand(() => { ActionManage.GetInstance.Send("Plc1Reset"); });
StartOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("StartOrder", FoodMenuID); });
StartLocalOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("StartLocalOrder"); });
diff --git a/BPASmartClient/BPASmartClient.csproj b/BPASmartClient/BPASmartClient.csproj
index a942c4cd..20441fba 100644
--- a/BPASmartClient/BPASmartClient.csproj
+++ b/BPASmartClient/BPASmartClient.csproj
@@ -29,6 +29,7 @@
+
diff --git a/SmartClient.sln b/SmartClient.sln
index 356c5e03..69fbd772 100644
--- a/SmartClient.sln
+++ b/SmartClient.sln
@@ -172,6 +172,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkMOC", "B
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmart.MenuLoad", "BPASmart.MenuLoad\BPASmart.MenuLoad.csproj", "{7A7547D3-F2EF-4DA4-AD45-D1B49210082B}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkBF", "BPASmartClient.MorkBF\BPASmartClient.MorkBF.csproj", "{CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -1626,6 +1628,26 @@ Global
{7A7547D3-F2EF-4DA4-AD45-D1B49210082B}.Release|x64.Build.0 = Release|Any CPU
{7A7547D3-F2EF-4DA4-AD45-D1B49210082B}.Release|x86.ActiveCfg = Release|Any CPU
{7A7547D3-F2EF-4DA4-AD45-D1B49210082B}.Release|x86.Build.0 = Release|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Debug|ARM.Build.0 = Debug|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Debug|x64.Build.0 = Debug|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Debug|x86.Build.0 = Debug|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Release|ARM.ActiveCfg = Release|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Release|ARM.Build.0 = Release|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Release|ARM64.Build.0 = Release|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Release|x64.ActiveCfg = Release|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Release|x64.Build.0 = Release|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Release|x86.ActiveCfg = Release|Any CPU
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1705,6 +1727,7 @@ Global
{BA588F22-87FB-4124-AF62-CA8DC492ED7D} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{7A7547D3-F2EF-4DA4-AD45-D1B49210082B} = {06F0B369-0483-46DD-82D2-70431FB505C1}
+ {CD0FBCF1-9C49-4032-96AD-B9E25F86F2A7} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}