diff --git a/BPASmartClient.JAKA/JakaMachine.cs b/BPASmartClient.JAKA/JakaMachine.cs
index a93c39cb..e45b477d 100644
--- a/BPASmartClient.JAKA/JakaMachine.cs
+++ b/BPASmartClient.JAKA/JakaMachine.cs
@@ -17,18 +17,22 @@ namespace BPASmartClient.JAKA
ThreadManage.GetInstance().StartLong(new Action(() =>
{
IsConnected = jaKaHelper.IsConnected;
- if (!IsConnected) IsWork = false;
- while (IsConnected)
+ if (!IsConnected)
+ {
+ IsWork = false;
+ }
+ if (IsConnected)
{
IsWork = true;
if (status != null)
{
- SetStatus("GetProgramStatus", (int)jaKaHelper.GetProgramStatus());
- SetStatus("Get_RobotAO1", jaKaHelper.Get_RobotAO1());
- SetStatus("Get_RobotDI0", jaKaHelper.Get_RobotDI(0));
- SetStatus("Get_RobotDI1", jaKaHelper.Get_RobotDI(1));
- SetStatus("Get_RobotDI2", jaKaHelper.Get_RobotDI(2));
- SetStatus("Get_RobotDI3", jaKaHelper.Get_RobotDI(3));
+ SetStatus("Get_JakaRobotProgramStatus", (int)jaKaHelper.GetProgramStatus());
+ SetStatus("Get_JakaRobotAO1", Convert.ToInt32(jaKaHelper.Get_RobotAO1()));
+ SetStatus("Get_JakaRobotDI0", jaKaHelper.Get_RobotDI(0));
+ SetStatus("Get_JakaRobotDI1", jaKaHelper.Get_RobotDI(1));
+ SetStatus("Get_JakaRobotDI2", jaKaHelper.Get_RobotDI(2));
+ SetStatus("Get_JakaRobotDI3", jaKaHelper.Get_RobotDI(3));
+ SetStatus("Get_JakaRobotDI5", jaKaHelper.Get_RobotDI(5));
}
Thread.Sleep(500);
}
diff --git a/BPASmartClient.JXJFoodBigStation/Model/GVL_BigStation.cs b/BPASmartClient.JXJFoodBigStation/Model/GVL_BigStation.cs
index 6e2d1570..476ffcf6 100644
--- a/BPASmartClient.JXJFoodBigStation/Model/GVL_BigStation.cs
+++ b/BPASmartClient.JXJFoodBigStation/Model/GVL_BigStation.cs
@@ -47,6 +47,8 @@ namespace BPASmartClient.JXJFoodBigStation.Model
/// 是否处于手动下发配方
///
public static bool IsUseLocalRecipe { get; set; } = false;
+
+ public static bool BarrelWasherSign { get; set; }
///
/// 订单请求
///
diff --git a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs
index 74f34914..aa60f2d7 100644
--- a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs
+++ b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs
@@ -64,6 +64,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
{
HK_PLC_S7.Write("DB99.DBW2.0",Convert.ToInt16(recipe.TrayCode));
HK_PLC_S7.Write("DB99.DBW4.0", Convert.ToInt16(recipe.TrayCode));
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{recipe.RecipeCode},托盘编号DB99.DBW2.0:{recipe.TrayCode},下发完成");
for (int barrel = 1; barrel < 6; barrel++)
{
if (barrel != 3)//桶的编号不为3 只为1,2,4,5号桶
diff --git a/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs b/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
index 843db9cb..52566728 100644
--- a/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
+++ b/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
@@ -261,28 +261,28 @@ namespace BPASmartClient.JXJFoodBigStation.Model
{
foreach (var data in LocalRecipes)
{
- if (LocalRecipeQueue1.Count == 0 && !LocalRecipeQueue2.Contains(data.RecipeCode) && !LocalRecipeQueue3.Contains(data.RecipeCode) && !LocalRecipeQueue4.Contains(data.RecipeCode))
+ if (LocalRecipeQueue1.Count == 0 && !LocalRecipeQueue2.Contains(data.RecipeCode) && !LocalRecipeQueue3.Contains(data.RecipeCode) && !LocalRecipeQueue4.Contains(data.RecipeCode) && HKDevice.PlcRead.IsAllowIssueRecipe1)
{
if (!(LocalRecipeQueue1.Contains(data.RecipeCode)))
{
LocalRecipeQueue1.Enqueue(data.RecipeCode);
}
}
- else if (LocalRecipeQueue2.Count == 0 && !LocalRecipeQueue1.Contains(data.RecipeCode) && !LocalRecipeQueue3.Contains(data.RecipeCode) && !LocalRecipeQueue4.Contains(data.RecipeCode))
+ else if (LocalRecipeQueue2.Count == 0 && !LocalRecipeQueue1.Contains(data.RecipeCode) && !LocalRecipeQueue3.Contains(data.RecipeCode) && !LocalRecipeQueue4.Contains(data.RecipeCode) && HKDevice.PlcRead.IsAllowIssueRecipe2)
{
if (!(LocalRecipeQueue2.Contains(data.RecipeCode)))
{
LocalRecipeQueue2.Enqueue(data.RecipeCode);
}
}
- else if (LocalRecipeQueue3.Count == 0 && !LocalRecipeQueue1.Contains(data.RecipeCode) && !LocalRecipeQueue2.Contains(data.RecipeCode) && !LocalRecipeQueue4.Contains(data.RecipeCode))
+ else if (LocalRecipeQueue3.Count == 0 && !LocalRecipeQueue1.Contains(data.RecipeCode) && !LocalRecipeQueue2.Contains(data.RecipeCode) && !LocalRecipeQueue4.Contains(data.RecipeCode) && HKDevice.PlcRead.IsAllowIssueRecipe3)
{
if (!(LocalRecipeQueue3.Contains(data.RecipeCode)))
{
LocalRecipeQueue3.Enqueue(data.RecipeCode);
}
}
- else if (LocalRecipeQueue4.Count == 0 && !LocalRecipeQueue1.Contains(data.RecipeCode) && !LocalRecipeQueue2.Contains(data.RecipeCode) && !LocalRecipeQueue3.Contains(data.RecipeCode))
+ else if (LocalRecipeQueue4.Count == 0 && !LocalRecipeQueue1.Contains(data.RecipeCode) && !LocalRecipeQueue2.Contains(data.RecipeCode) && !LocalRecipeQueue3.Contains(data.RecipeCode) && HKDevice.PlcRead.IsAllowIssueRecipe4)
{
if (!(LocalRecipeQueue4.Contains(data.RecipeCode)))
{
@@ -297,6 +297,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model
LocalRecipeQueue2.Clear();
LocalRecipeQueue3.Clear();
LocalRecipeQueue4.Clear();
+ GVL_BigStation.BarrelWasherSign = false;
GVL_BigStation.Recipe1DosingStatus = 0;
GVL_BigStation.Recipe2DosingStatus = 0;
GVL_BigStation.Recipe3DosingStatus = 0;
@@ -340,20 +341,43 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (HKDevice.PlcRead.IsAllowIssueRecipe1 && GVL_BigStation.Recipe1DosingStatus == 0 && Inplace)//配方1是否允许下发配发
{
- HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.3", true);
- GVL_BigStation.Recipe1DosingStatus = 1;
- MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
+ if (LocalRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ if (!GVL_BigStation.BarrelWasherSign)
+ {
+ GVL_BigStation.BarrelWasherSign = true;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+
+ HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.3", true);
+ GVL_BigStation.Recipe1DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
+ }
+ }
+ else
+ {
+ HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.3", true);
+ GVL_BigStation.Recipe1DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
+ }
}
if (HKDevice.PlcRead.ReceiveFinishRecipe1 && GVL_BigStation.Recipe1DosingStatus == 1)
{
- GVL_BigStation.Recipe1DosingStatus = 2;
HKDevice.HK_PLC_S7.Write("DB99.DBX0.3", false);
StockBinParReset();
+ GVL_BigStation.Recipe1DosingStatus = 2;
MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},PLC接收配方完成");
}
if (GVL_BigStation.Recipe1DosingStatus == 2 && HKDevice.PlcRead.Recipe1DosingFinish)
{
+ if (LocalRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ GVL_BigStation.BarrelWasherSign = false;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", false);//洗桶复位
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},洗桶信号复位");
+ }
GVL_BigStation.Recipe1DosingStatus = 3;
switch (trayCode)
{
@@ -480,10 +504,27 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (HKDevice.PlcRead.IsAllowIssueRecipe2 && GVL_BigStation.Recipe2DosingStatus == 0 &&Inplace)//配方2是否允许下发配发
{
- HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.4", true);
- GVL_BigStation.Recipe2DosingStatus = 1;
- MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成");
+ if (LocalRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ if (!GVL_BigStation.BarrelWasherSign)
+ {
+ GVL_BigStation.BarrelWasherSign = true;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+
+ HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.4", true);
+ GVL_BigStation.Recipe2DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成");
+ }
+ }
+ else
+ {
+ HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.4", true);
+ GVL_BigStation.Recipe2DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成");
+ }
}
if (HKDevice.PlcRead.ReceiveFinishRecipe2 && GVL_BigStation.Recipe2DosingStatus == 1)
{
@@ -494,6 +535,12 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (GVL_BigStation.Recipe2DosingStatus == 2 && HKDevice.PlcRead.Recipe2DosingFinish)
{
+ if (LocalRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ GVL_BigStation.BarrelWasherSign = false;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", false);//洗桶复位
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},洗桶信号复位");
+ }
switch (trayCode)
{
case 1:
@@ -620,10 +667,27 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (HKDevice.PlcRead.IsAllowIssueRecipe3 && GVL_BigStation.Recipe3DosingStatus == 0 && Inplace)//配方3是否允许下发配发
{
- HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.5", true);
- GVL_BigStation.Recipe3DosingStatus = 1;
- MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成");
+ if (LocalRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ if (!GVL_BigStation.BarrelWasherSign)
+ {
+ GVL_BigStation.BarrelWasherSign = true;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+
+ HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.5", true);
+ GVL_BigStation.Recipe3DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成");
+ }
+ }
+ else
+ {
+ HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.5", true);
+ GVL_BigStation.Recipe3DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成");
+ }
}
if (HKDevice.PlcRead.ReceiveFinishRecipe3 && GVL_BigStation.Recipe3DosingStatus == 1)
{
@@ -634,6 +698,12 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (HKDevice.PlcRead.Recipe3DosingFinish && GVL_BigStation.Recipe3DosingStatus == 2)
{
+ if (LocalRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ GVL_BigStation.BarrelWasherSign = false;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", false);//洗桶复位
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},洗桶信号复位");
+ }
switch (trayCode)
{
case 1:
@@ -761,10 +831,27 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (HKDevice.PlcRead.IsAllowIssueRecipe4 && GVL_BigStation.Recipe4DosingStatus == 0 && Inplace)//配方4是否允许下发配发
{
- HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.6", true);
- GVL_BigStation.Recipe4DosingStatus = 1;
- MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成");
+ if (LocalRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ if (!GVL_BigStation.BarrelWasherSign)
+ {
+ GVL_BigStation.BarrelWasherSign = true;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+
+ HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.6", true);
+ GVL_BigStation.Recipe4DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成");
+ }
+ }
+ else
+ {
+ HKDevice.StockBinPar(LocalRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.6", true);
+ GVL_BigStation.Recipe4DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成");
+ }
}
if (HKDevice.PlcRead.ReceiveFinishRecipe4 && GVL_BigStation.Recipe4DosingStatus == 1)
{
@@ -775,6 +862,12 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (GVL_BigStation.Recipe4DosingStatus == 2 && HKDevice.PlcRead.Recipe4DosingFinish)
{
+ if (LocalRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ GVL_BigStation.BarrelWasherSign = false;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", false);//洗桶复位
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},洗桶信号复位");
+ }
switch (trayCode)
{
case 1:
@@ -875,7 +968,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model
{
foreach (var data in SiemensRecipes)
{
- if (SiemensRecipeQueue1.Count == 0 && !SiemensRecipeQueue2.Contains(data.RecipeCode) && !SiemensRecipeQueue3.Contains(data.RecipeCode) && !SiemensRecipeQueue4.Contains(data.RecipeCode))
+ if (SiemensRecipeQueue1.Count == 0 && !SiemensRecipeQueue2.Contains(data.RecipeCode) && !SiemensRecipeQueue3.Contains(data.RecipeCode) && !SiemensRecipeQueue4.Contains(data.RecipeCode) && HKDevice.PlcRead.IsAllowIssueRecipe1)
{
if (!(SiemensRecipeQueue1.Contains(data.RecipeCode)))
{
@@ -910,7 +1003,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
}
}
- else if (SiemensRecipeQueue2.Count == 0 && !SiemensRecipeQueue1.Contains(data.RecipeCode) && !SiemensRecipeQueue3.Contains(data.RecipeCode) && !SiemensRecipeQueue4.Contains(data.RecipeCode))
+ else if (SiemensRecipeQueue2.Count == 0 && !SiemensRecipeQueue1.Contains(data.RecipeCode) && !SiemensRecipeQueue3.Contains(data.RecipeCode) && !SiemensRecipeQueue4.Contains(data.RecipeCode) && HKDevice.PlcRead.IsAllowIssueRecipe2)
{
if (!(SiemensRecipeQueue2.Contains(data.RecipeCode)))
{
@@ -945,7 +1038,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
}
}
- else if (SiemensRecipeQueue3.Count == 0 && !SiemensRecipeQueue1.Contains(data.RecipeCode) && !SiemensRecipeQueue2.Contains(data.RecipeCode) && !SiemensRecipeQueue4.Contains(data.RecipeCode))
+ else if (SiemensRecipeQueue3.Count == 0 && !SiemensRecipeQueue1.Contains(data.RecipeCode) && !SiemensRecipeQueue2.Contains(data.RecipeCode) && !SiemensRecipeQueue4.Contains(data.RecipeCode) && HKDevice.PlcRead.IsAllowIssueRecipe3)
{
if (!(SiemensRecipeQueue3.Contains(data.RecipeCode)))
{
@@ -980,7 +1073,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
}
}
- else if (SiemensRecipeQueue4.Count == 0 && !SiemensRecipeQueue1.Contains(data.RecipeCode) && !SiemensRecipeQueue2.Contains(data.RecipeCode) && !SiemensRecipeQueue3.Contains(data.RecipeCode))
+ else if (SiemensRecipeQueue4.Count == 0 && !SiemensRecipeQueue1.Contains(data.RecipeCode) && !SiemensRecipeQueue2.Contains(data.RecipeCode) && !SiemensRecipeQueue3.Contains(data.RecipeCode) && HKDevice.PlcRead.IsAllowIssueRecipe4)
{
if (!(SiemensRecipeQueue4.Contains(data.RecipeCode)))
{
@@ -1023,6 +1116,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model
SiemensRecipeQueue2.Clear();
SiemensRecipeQueue3.Clear();
SiemensRecipeQueue4.Clear();
+ GVL_BigStation.BarrelWasherSign = false;
GVL_BigStation.Recipe1DosingStatus = 0;
GVL_BigStation.Recipe2DosingStatus = 0;
GVL_BigStation.Recipe3DosingStatus = 0;
@@ -1057,14 +1151,16 @@ namespace BPASmartClient.JXJFoodBigStation.Model
MessageNotify.GetInstance.ShowRunLog($"AGV未到达工站前,未给plc下发配方,取消订单:{code}");
}
GVL_BigStation.Recipe1DosingStatus = 0;
- SiemensRecipeQueue1.TryDequeue(out code);
- SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX320.2", false);
SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", true);
- MessageNotify.GetInstance.ShowRunLog($"队列1,西门子取消订单完成,订单号:{code}");
+ while (SiemensDevice.Siemens_PLC_S7.Read("DB2301.DBX320.2") == false )
+ {
+ SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", false);
+ SiemensRecipeQueue1.TryDequeue(out code);
+ MessageNotify.GetInstance.ShowRunLog($"队列1,西门子取消订单完成,订单号:{code}");
+ }
}
if (SiemensRecipeQueue2.Contains(code))
{
- GVL_BigStation.Recipe2DosingStatus = 0;
App.Current.Dispatcher.Invoke(() =>
{
Json.Data.Recipes.RemoveAt(index);
@@ -1080,10 +1176,13 @@ namespace BPASmartClient.JXJFoodBigStation.Model
MessageNotify.GetInstance.ShowRunLog($"AGV未到达工站前,未给plc下发配方,取消订单:{code}");
}
GVL_BigStation.Recipe2DosingStatus = 0;
- SiemensRecipeQueue2.TryDequeue(out code);
- SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX320.2", false);
SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", true);
- MessageNotify.GetInstance.ShowRunLog($"队列2,西门子取消订单完成,订单号:{code}");
+ while (SiemensDevice.Siemens_PLC_S7.Read("DB2301.DBX320.2") == false)
+ {
+ SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", false);
+ SiemensRecipeQueue2.TryDequeue(out code);
+ MessageNotify.GetInstance.ShowRunLog($"队列2,西门子取消订单完成,订单号:{code}");
+ }
}
if (SiemensRecipeQueue3.Contains(code))
{
@@ -1102,11 +1201,14 @@ namespace BPASmartClient.JXJFoodBigStation.Model
{
MessageNotify.GetInstance.ShowRunLog($"AGV未到达工站前,未给plc下发配方,取消订单:{code}");
}
- GVL_BigStation.Recipe3DosingStatus = 0;
- SiemensRecipeQueue3.TryDequeue(out code);
- SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX320.2", false);
+ GVL_BigStation.Recipe3DosingStatus = 0;
SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", true);
- MessageNotify.GetInstance.ShowRunLog($"队列3,西门子取消订单完成,订单号:{code}");
+ while (SiemensDevice.Siemens_PLC_S7.Read("DB2301.DBX320.2") == false)
+ {
+ SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", false);
+ SiemensRecipeQueue3.TryDequeue(out code);
+ MessageNotify.GetInstance.ShowRunLog($"队列3,西门子取消订单完成,订单号:{code}");
+ }
}
if (SiemensRecipeQueue4.Contains(code))
{
@@ -1126,10 +1228,13 @@ namespace BPASmartClient.JXJFoodBigStation.Model
MessageNotify.GetInstance.ShowRunLog($"AGV未到达工站前,未给plc下发配方,取消订单:{code}");
}
GVL_BigStation.Recipe4DosingStatus = 0;
- SiemensRecipeQueue4.TryDequeue(out code);
- SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX320.2", false);
SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", true);
- MessageNotify.GetInstance.ShowRunLog($"队列4,西门子取消订单完成,订单号:{code}");
+ while (SiemensDevice.Siemens_PLC_S7.Read("DB2301.DBX320.2") == false)
+ {
+ SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", false);
+ SiemensRecipeQueue4.TryDequeue(out code);
+ MessageNotify.GetInstance.ShowRunLog($"队列4,西门子取消订单完成,订单号:{code}");
+ }
}
GVL_BigStation.Order_Cancel = false;
GVL_BigStation.Order_CancelRecipeCode = "";
@@ -1149,19 +1254,24 @@ namespace BPASmartClient.JXJFoodBigStation.Model
{
MessageNotify.GetInstance.ShowRunLog($"订单取消异常,订单号:{GVL_BigStation.Order_CancelRecipeCode}");
}
-
GVL_BigStation.Order_Cancel = false;
GVL_BigStation.Order_CancelRecipeCode = "";
- SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX320.2", false);
SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", true);
+ while (SiemensDevice.Siemens_PLC_S7.Read("DB2301.DBX320.2") == false)
+ {
+ SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", false);
+ }
}
}
else
{
GVL_BigStation.Order_Cancel = false;
GVL_BigStation.Order_CancelRecipeCode = "";
- SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX320.2", false);
SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", true);
+ while (SiemensDevice.Siemens_PLC_S7.Read("DB2301.DBX320.2") == false)
+ {
+ SiemensDevice.Siemens_PLC_S7.Write("DB2301.DBX330.1", false);
+ }
MessageNotify.GetInstance.ShowRunLog($"西门子取消订单,但未找到订单:{GVL_BigStation.Order_CancelRecipeCode}");
}
}
@@ -1180,7 +1290,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model
switch (trayCode)
{
case 1:
- Inplace = HKDevice.PlcRead.Tray1InPlace;
+ Inplace = HKDevice.PlcRead.Tray1InPlace;//上位机给plc发送AGV到位信号,plc固定托盘后反馈托盘是否到位
break;
case 2:
Inplace = HKDevice.PlcRead.Tray2InPlace;
@@ -1199,16 +1309,31 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (HKDevice.PlcRead.IsAllowIssueRecipe1 && GVL_BigStation.Recipe1DosingStatus == 0 && Inplace)//配方1是否允许下发配发
{
- GVL_BigStation.DosingRecipe1Time = DateTime.Now;
- HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
- if (SiemensRecipes.ElementAt(index).IsWashingBarrel)
+
+ if (SiemensRecipes.ElementAt(index).IsWashingBarrel)
{
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
- MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+ if (!GVL_BigStation.BarrelWasherSign)
+ {
+ GVL_BigStation.BarrelWasherSign = true;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+
+ GVL_BigStation.DosingRecipe1Time = DateTime.Now;
+ HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.3", true);
+ GVL_BigStation.Recipe1DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
+ }
+ }
+ else
+ {
+ GVL_BigStation.DosingRecipe1Time = DateTime.Now;
+ HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.3", true);
+ GVL_BigStation.Recipe1DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
}
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.3", true);
- GVL_BigStation.Recipe1DosingStatus = 1;
- MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
+
}
if (HKDevice.PlcRead.ReceiveFinishRecipe1 && GVL_BigStation.Recipe1DosingStatus == 1)
{
@@ -1219,6 +1344,12 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (GVL_BigStation.Recipe1DosingStatus == 2 && HKDevice.PlcRead.Recipe1DosingFinish)
{
+ if (SiemensRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ GVL_BigStation.BarrelWasherSign = false;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", false);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},洗桶复位");
+ }
GVL_BigStation.Recipe1DosingFinish = true;
GVL_BigStation.Recipe1DosingStatus = 3;
MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配料完成");
@@ -1350,28 +1481,47 @@ namespace BPASmartClient.JXJFoodBigStation.Model
default:
break;
}
- if (HKDevice.PlcRead.IsAllowIssueRecipe2 && GVL_BigStation.Recipe2DosingStatus == 0 && Inplace)//配方2是否允许下发配发
+ if (HKDevice.PlcRead.IsAllowIssueRecipe2 && GVL_BigStation.Recipe2DosingStatus == 0 && Inplace )//配方2是否允许下发配发
{
- GVL_BigStation.DosingRecipe2Time = DateTime.Now;
- HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
if (SiemensRecipes.ElementAt(index).IsWashingBarrel)
{
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
- MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+ if (!GVL_BigStation.BarrelWasherSign)
+ {
+ GVL_BigStation.BarrelWasherSign = true;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+
+ GVL_BigStation.DosingRecipe2Time = DateTime.Now;
+ HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.4", true);
+ GVL_BigStation.Recipe2DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
+ }
+ }
+ else
+ {
+ GVL_BigStation.DosingRecipe2Time = DateTime.Now;
+ HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.4", true);
+ GVL_BigStation.Recipe2DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
}
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.4", true);
- GVL_BigStation.Recipe2DosingStatus = 1;
- MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
}
if (HKDevice.PlcRead.ReceiveFinishRecipe2 && GVL_BigStation.Recipe2DosingStatus == 1)
{
- GVL_BigStation.Recipe2DosingStatus = 2;
HKDevice.HK_PLC_S7.Write("DB99.DBX0.4", false);
StockBinParReset();
+ GVL_BigStation.Recipe2DosingStatus = 2;
MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},PLC接收配方完成");
}
if (GVL_BigStation.Recipe2DosingStatus == 2 && HKDevice.PlcRead.Recipe2DosingFinish)
{
+ if (SiemensRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ GVL_BigStation.BarrelWasherSign = false;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", false);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},洗桶复位");
+ }
GVL_BigStation.Recipe2DosingFinish = true;
GVL_BigStation.Recipe2DosingStatus = 3;
MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配料完成");
@@ -1505,26 +1655,44 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (HKDevice.PlcRead.IsAllowIssueRecipe3 && GVL_BigStation.Recipe3DosingStatus == 0 && Inplace)//配方3是否允许下发配发
{
- GVL_BigStation.DosingRecipe3Time = DateTime.Now;
- HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
if (SiemensRecipes.ElementAt(index).IsWashingBarrel)
{
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
- MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+ if (!GVL_BigStation.BarrelWasherSign)//其他配方在洗桶时,等待其他配方洗完,在发送数据
+ {
+ GVL_BigStation.BarrelWasherSign = true;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+ GVL_BigStation.DosingRecipe3Time = DateTime.Now;
+ HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.5", true);
+ GVL_BigStation.Recipe3DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
+ }
+ }
+ else
+ {
+ GVL_BigStation.DosingRecipe3Time = DateTime.Now;
+ HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.5", true);
+ GVL_BigStation.Recipe3DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
}
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.5", true);
- GVL_BigStation.Recipe3DosingStatus = 1;
- MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
}
if (HKDevice.PlcRead.ReceiveFinishRecipe3 && GVL_BigStation.Recipe3DosingStatus == 1)
{
- GVL_BigStation.Recipe3DosingStatus = 2;
HKDevice.HK_PLC_S7.Write("DB99.DBX0.5", false);
StockBinParReset();
+ GVL_BigStation.Recipe3DosingStatus = 2;
MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},PLC接收配方完成");
}
if (HKDevice.PlcRead.Recipe3DosingFinish && GVL_BigStation.Recipe3DosingStatus == 2)
{
+ if (SiemensRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ GVL_BigStation.BarrelWasherSign = false;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", false);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},洗桶复位");
+ }
GVL_BigStation.Recipe3DosingFinish = true;
GVL_BigStation.Recipe3DosingStatus = 3;
MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配料完成");
@@ -1658,16 +1826,28 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (HKDevice.PlcRead.IsAllowIssueRecipe4 && GVL_BigStation.Recipe4DosingStatus == 0 && Inplace)//配方4是否允许下发配发
{
- GVL_BigStation.DosingRecipe4Time = DateTime.Now;
- HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
if (SiemensRecipes.ElementAt(index).IsWashingBarrel)
{
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
- MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+ if (!GVL_BigStation.BarrelWasherSign)//其他配方在洗桶时,等待其他配方洗完,在发送数据
+ {
+ GVL_BigStation.BarrelWasherSign = true;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", true);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},订单类型为洗桶");
+ GVL_BigStation.DosingRecipe4Time = DateTime.Now;
+ HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.6", true);
+ GVL_BigStation.Recipe4DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
+ }
+ }
+ else
+ {
+ GVL_BigStation.DosingRecipe4Time = DateTime.Now;
+ HKDevice.StockBinPar(SiemensRecipes.ElementAt(index));
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.6", true);
+ GVL_BigStation.Recipe4DosingStatus = 1;
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
}
- HKDevice.HK_PLC_S7.Write("DB99.DBX0.6", true);
- GVL_BigStation.Recipe4DosingStatus = 1;
- MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成");
}
if (HKDevice.PlcRead.ReceiveFinishRecipe4 && GVL_BigStation.Recipe4DosingStatus == 1)
{
@@ -1678,6 +1858,12 @@ namespace BPASmartClient.JXJFoodBigStation.Model
}
if (GVL_BigStation.Recipe4DosingStatus == 2 && HKDevice.PlcRead.Recipe4DosingFinish)
{
+ if (SiemensRecipes.ElementAt(index).IsWashingBarrel)
+ {
+ GVL_BigStation.BarrelWasherSign = false;
+ HKDevice.HK_PLC_S7.Write("DB99.DBX0.1", false);//洗桶
+ MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},洗桶复位");
+ }
GVL_BigStation.Recipe1DosingFinish = true;
GVL_BigStation.Recipe4DosingStatus = 3;
MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配料完成");
@@ -1803,8 +1989,8 @@ namespace BPASmartClient.JXJFoodBigStation.Model
RawMaterialsInfo.Add(new RawMaterial() { RawMaterialName = "0005", RawMaterialLocation = 3 });//榨菜丁
RawMaterialsInfo.Add(new RawMaterial() { RawMaterialName = "0018", RawMaterialLocation = 4 });//炸豌豆
RawMaterialsInfo.Add(new RawMaterial() { RawMaterialName = "0019", RawMaterialLocation = 5 });//高水分糍粑海椒
- RawMaterialsInfo.Add(new RawMaterial() { RawMaterialName = "0033", RawMaterialLocation = 6 });//辣豆瓣*/
- /*RawMaterialsInfo.Add(new RawMaterial() { RawMaterialName = "0030", RawMaterialLocation = 11 });//备用生姜
+ RawMaterialsInfo.Add(new RawMaterial() { RawMaterialName = "0033", RawMaterialLocation = 6 });//辣豆瓣
+ RawMaterialsInfo.Add(new RawMaterial() { RawMaterialName = "0030", RawMaterialLocation = 11 });//备用生姜
RawMaterialsInfo.Add(new RawMaterial() { RawMaterialName = "0012", RawMaterialLocation = 12 });//豆豉细粒*/
foreach (var material in RawMaterialsInfo)
{
diff --git a/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeData.cs b/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeData.cs
index 873e398e..dc05bc4f 100644
--- a/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeData.cs
+++ b/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeData.cs
@@ -28,8 +28,18 @@ namespace BPASmartClient.JXJFoodBigStation.Model
public int TrayCode { get { return _mTrayCode; } set { _mTrayCode = value; OnPropertyChanged(); } }
private int _mTrayCode;
+ ///
+ /// 配方类型是否为洗桶
+ ///
+ public string OrderType { get { return _mOrderType; } set { _mOrderType = value; OnPropertyChanged(); } }
+ private string _mOrderType;
+
+ ///
+ /// 配方类型是否为洗桶
+ ///
public bool IsWashingBarrel { get { return _mIsWashingBarrel; } set { _mIsWashingBarrel = value; OnPropertyChanged(); } }
private bool _mIsWashingBarrel;
+
///
/// 原料数据
///
diff --git a/BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml b/BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml
index 63e35bc1..0d22968d 100644
--- a/BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml
+++ b/BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml
@@ -289,8 +289,8 @@
+
-
diff --git a/BPASmartClient.JXJFoodBigStation/View/RecipeReceiveView.xaml b/BPASmartClient.JXJFoodBigStation/View/RecipeReceiveView.xaml
index ef78e4b8..1c3603c8 100644
--- a/BPASmartClient.JXJFoodBigStation/View/RecipeReceiveView.xaml
+++ b/BPASmartClient.JXJFoodBigStation/View/RecipeReceiveView.xaml
@@ -226,36 +226,116 @@
Margin="5">
-
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+ Text="配方编号:" />
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+ Grid.RowSpan="8"
+ Grid.ColumnSpan="2"
+ Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png"
+ Stretch="Fill" />
+ Grid.Row="0"
+ Grid.ColumnSpan="2"
+ FontSize="14"
+ Margin="5,0,0,0"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Foreground="#FF2AB2E7"
+ Text="配方信息" />
+ Grid.Row="1"
+ Grid.Column="0"
+ Margin="2,5,0,0"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ FontSize="12"
+ Foreground="#FF2AB2E7"
+ Text="配方名称:" />
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
{
Json.Data.Recipes.Clear();
+ GVL_BigStation.SiemensSendRecipeStatus = 0;
});
ThreadManage.GetInstance().StartLong(new Action(() =>
{
diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs
index 34da58d1..9c1ecc13 100644
--- a/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs
+++ b/BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs
@@ -11,6 +11,8 @@ using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.JXJFoodBigStation.Model.Siemens;
using System.Windows.Forms;
+using BPASmartClient.CustomResource.UserControls;
+using BPASmartClient.CustomResource.UserControls.MessageShow;
namespace BPASmartClient.JXJFoodBigStation.ViewModel
{
@@ -29,7 +31,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
RecipeName = rm.RecipeName;
RecipeCode = rm.RecipeCode;
TrayCode = rm.TrayCode;
-
+ IsWashingBarrel = rm.IsWashingBarrel;
foreach (var item in rm.RawMaterial)
{
item.RawMaterialCount = (short)Array.FindIndex(ProcessControl.GetInstance.RawMaterialsInfo.ToArray(), p => p.RawMaterialName == item.RawMaterialName);
@@ -65,8 +67,18 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeCode == recipeCode);
if (res == null)
{
- Json.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode, RawMaterial= RawMaterialsInfo,RecipeName=RecipeName,TrayCode=TrayCode});
+ if (IsWashingBarrel)
+ {
+ Json.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode,RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel });
+ if (RawMaterialsInfo.Count > 0)
+ NoticeDemoViewModel.OpenMsg(EnumPromptType.Info, App.MainWindow, "提示", $"订单类型为洗桶,不保存原料信息");
+ }
+ else
+ {
+ Json.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode, RawMaterial = RawMaterialsInfo, RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel });
+ }
Json.Save();
+ NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"配方保存完成");
}
else
{
@@ -88,15 +100,16 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
}
bom.RecipeName = RecipeName;
bom.TrayCode = TrayCode;
+ bom.IsWashingBarrel = IsWashingBarrel;
+ if (IsWashingBarrel)
+ {
+ bom.RawMaterial.Clear();
+ }
Json.Save();
ActionManage.GetInstance.Send("CloseRecipeInfosView");
}
});
- ClearRawMaterial = new RelayCommand(() => {
- RawMaterialsInfo.Clear();
- });
-
RemoveRecipe = new RelayCommand((index) => {
var res = RawMaterialsInfo.FirstOrDefault(p => p.RawMaterialCount == index);
if (res != null)
@@ -114,16 +127,16 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
public int SelectIndex { get { return _mSelectIndex; } set { _mSelectIndex = value; OnPropertyChanged(); } }
private int _mSelectIndex;
-
+ public bool IsWashingBarrel { get { return _mIsWashingBarrel; } set { _mIsWashingBarrel = value; OnPropertyChanged(); } }
+ private bool _mIsWashingBarrel;
+
public RelayCommand ReturnPage { get; set; }
public RelayCommand AddRecipe { get; set; }
public RelayCommand Comfirm { get; set; }
- public RelayCommand ClearRawMaterial { get; set; }
-
public RelayCommand RemoveRecipe { get; set; }
public ObservableCollection RawMaterialsInfo { get; set; } = new ObservableCollection() ;
diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/SiemensRecipeSendDownViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/SiemensRecipeSendDownViewModel.cs
index bb7da1f3..fd2f38f0 100644
--- a/BPASmartClient.JXJFoodBigStation/ViewModel/SiemensRecipeSendDownViewModel.cs
+++ b/BPASmartClient.JXJFoodBigStation/ViewModel/SiemensRecipeSendDownViewModel.cs
@@ -17,7 +17,6 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
public ObservableCollection Recipes { get; set; } = Json.Data.Recipes;
public SiemensRecipeSendDownViewModel()
{
-
}
}
}
diff --git a/BPASmartClient.JXJFoodBigStation/ViewModel/StockBinRawMaterialViewModel.cs b/BPASmartClient.JXJFoodBigStation/ViewModel/StockBinRawMaterialViewModel.cs
index ba4fdc95..f5ade366 100644
--- a/BPASmartClient.JXJFoodBigStation/ViewModel/StockBinRawMaterialViewModel.cs
+++ b/BPASmartClient.JXJFoodBigStation/ViewModel/StockBinRawMaterialViewModel.cs
@@ -34,6 +34,10 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
SaveRawMaterialPara = new RelayCommand(() =>
{
Json.Save();
+ foreach (var item in Json.Data.RawMaterial)
+ {
+ MessageNotify.GetInstance.ShowUserLog($"料仓位置:"+ item.RawMaterialLocation+ ",物料编码:" + item.RawMaterialName);
+ }
MessageNotify.GetInstance.ShowUserLog($"原料与料仓对应关系保存成功");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"原料与料仓对应关系保存成功");
});
diff --git a/BPASmartClient.JXJFoodSmallStation/App.xaml.cs b/BPASmartClient.JXJFoodSmallStation/App.xaml.cs
index 1015cbd3..191917d2 100644
--- a/BPASmartClient.JXJFoodSmallStation/App.xaml.cs
+++ b/BPASmartClient.JXJFoodSmallStation/App.xaml.cs
@@ -138,7 +138,13 @@ namespace BPASmartClient.JXJFoodSmallStation
AssemblyName = "BPASmartClient.JXJFoodSmallStation",
ToggleWindowPath = "View.SystemParView"
});
-
+ ParSet.Add(new SubMenumodel()
+ {
+ SubMenuName = "原料与料仓对应设置",
+ SubMenuPermission = new Permission[] { Permission.管理员 },
+ AssemblyName = "BPASmartClient.JXJFoodSmallStation",
+ ToggleWindowPath = "View.StockBinRawMaterialView"
+ });
MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "",
diff --git a/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj b/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj
index 113ea061..17229774 100644
--- a/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj
+++ b/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj
@@ -32,6 +32,9 @@
Code
+
+ Code
+
@@ -57,6 +60,10 @@
$(DefaultXamlRuntime)
Designer
+
+ $(DefaultXamlRuntime)
+ Designer
+
$(DefaultXamlRuntime)
Designer
diff --git a/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs b/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs
index 5625b98f..6e50873a 100644
--- a/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs
+++ b/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs
@@ -142,6 +142,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
/// 系统运行状态
///
public static bool SystemRunStatus { get; set; } = false;
+ ///
+ /// 系统运行状态
+ ///
+ public static int Time { get; set; } = 1000;
#endregion
}
}
diff --git a/BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/PlcReadAddressDB3.cs b/BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/PlcReadAddressDB3.cs
new file mode 100644
index 00000000..ec42c683
--- /dev/null
+++ b/BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/PlcReadAddressDB3.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
+{
+ public class PlcReadAddressDB3
+ {
+ public bool[] VarBool { get; set; } =new bool[17];
+ public Single[] BarrelPos { get; set; } = new Single[8];
+ public bool[] IsAllowDosing { get; set; } = new bool[8];
+ }
+}
diff --git a/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs b/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs
index ae9b499f..bf45b196 100644
--- a/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs
+++ b/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs
@@ -1,6 +1,7 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodSmallStation.Model.HK_PLC;
+using BPASmartClient.JXJFoodSmallStation.Model.RawMaterial;
using BPASmartClient.JXJFoodSmallStation.Model.Siemens;
using BPASmartClient.JXJFoodSmallStation.Model.WindSend;
using BPASmartClient.Modbus;
@@ -30,6 +31,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
/// 原料的名称和料仓的位置对应
///
public Dictionary RawMaterialsNamePos = new Dictionary();
+ public ObservableCollection RawMaterialsInfo => Json.Data.rawMaterialStockBin;
///
/// 配方队列
///
@@ -51,7 +53,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
public void Init()
{
testData();
- for (int i = 0; i < 16; i++)
+ /*for (int i = 0; i < 16; i++)
{
if (DeviceInquire.GetInstance.GetDevice(i).DeviceName != null)
{
@@ -60,7 +62,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
RawMaterialsNamePos.Add(DeviceInquire.GetInstance.GetDevice(i).DeviceName, (short)DeviceInquire.GetInstance.GetDevice(i).deviceStatus.DeviceNum);
}
}
- }
+ }*/
ActionManage.GetInstance.CancelRegister("SiemensRecipeRecive");
ActionManage.GetInstance.Register(new Action
$(DefaultXamlRuntime)
+
+ $(DefaultXamlRuntime)
+
diff --git a/BPASmartClient.MorkT_BarCounter/Control_MorkT_BarCounter.cs b/BPASmartClient.MorkT_BarCounter/Control_MorkT_BarCounter.cs
index 70cf8a2f..10b33a97 100644
--- a/BPASmartClient.MorkT_BarCounter/Control_MorkT_BarCounter.cs
+++ b/BPASmartClient.MorkT_BarCounter/Control_MorkT_BarCounter.cs
@@ -20,6 +20,9 @@ using BPASmartClient.Model.单片机;
using BPASmartClient.Model.PLC;
using BPASmartClient.DRCoffee;
using BPASmartClient.LebaiRobot;
+using BPASmartClient.RobotGripper;
+using BPASmartClient.Model.电夹爪;
+using BPASmartClient.Model.奶茶味魔方;
namespace BPASmartClient.MorkT_BarCounter
{
@@ -42,7 +45,7 @@ namespace BPASmartClient.MorkT_BarCounter
private string mainMaterialLoc;
public override global::BPA.Message.Enum.DeviceClientType DeviceType { get { return BPA.Message.Enum.DeviceClientType.MORKT; } }
- GVL_MorkT morkTLebaiJC =new GVL_MorkT();
+ GVL_MorkT morkT =new GVL_MorkT();
///
/// 果汁机做法,true:热饮,false:冷饮
///
@@ -113,47 +116,49 @@ namespace BPASmartClient.MorkT_BarCounter
{
case GOODS_TYPE.COFFEE:
- if (morkTLebaiJC.morkOrderPushesCoffee.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
+ if (morkT.morkOrderPushesCoffee.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
{
- morkTLebaiJC.morkOrderPushesCoffee.Enqueue(new OrderLocInfo()
+ morkT.morkOrderPushesCoffee.Enqueue(new OrderLocInfo()
{
SuborderId = order.MorkOrder.SuborderId,
BatchingId = res.BatchingId,
Loc = ushort.Parse( mainMaterialLoc),
GoodName = order.MorkOrder.GoodsName,
});
- }
- break;
- case GOODS_TYPE.JUICE:
-
- if (morkTLebaiJC.morkOrderPushesJuicer.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
- {
- morkTLebaiJC.morkOrderPushesJuicer.Enqueue(new OrderLocInfo()
+ morkT.morkOrderPushesAll.Enqueue(new OrderLocInfo()
{
SuborderId = order.MorkOrder.SuborderId,
BatchingId = res.BatchingId,
Loc = ushort.Parse(mainMaterialLoc),
GoodName = order.MorkOrder.GoodsName,
- makeID = order.MorkOrder.MakeID,
});
+
}
break;
- case GOODS_TYPE.TEA:
- if (morkTLebaiJC.morkOrderPushesTea.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
+ //case GOODS_TYPE.JUICE:
+ // if (morkTLebaiJC.morkOrderPushesJuicer.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
+ // {
+ // morkTLebaiJC.morkOrderPushesJuicer.Enqueue(new OrderLocInfo()
+ // {
+ // SuborderId = order.MorkOrder.SuborderId,
+ // BatchingId = res.BatchingId,
+ // Loc = ushort.Parse(mainMaterialLoc),
+ // GoodName = order.MorkOrder.GoodsName,
+ // makeID = order.MorkOrder.MakeID,
+ // });
+ // }
+ // break;
+ case GOODS_TYPE.MilkTea:
+ if (morkT.morkOrderPushesMilkTea.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
{
- morkTLebaiJC.morkOrderPushesTea.Enqueue(new OrderLocInfo()
+ morkT.morkOrderPushesMilkTea.Enqueue(new OrderLocInfo()
{
SuborderId = order.MorkOrder.SuborderId,
BatchingId = res.BatchingId,
Loc = ushort.Parse(mainMaterialLoc),
GoodName = order.MorkOrder.GoodsName,
});
- }
- break;
- case GOODS_TYPE.WATER:
- if (morkTLebaiJC.morkOrderPushesWater.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
- {
- morkTLebaiJC.morkOrderPushesWater.Enqueue(new OrderLocInfo()
+ morkT.morkOrderPushesAll.Enqueue(new OrderLocInfo()
{
SuborderId = order.MorkOrder.SuborderId,
BatchingId = res.BatchingId,
@@ -162,6 +167,18 @@ namespace BPASmartClient.MorkT_BarCounter
});
}
break;
+ //case GOODS_TYPE.WATER:
+ // if (morkTLebaiJC.morkOrderPushesWater.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
+ // {
+ // morkTLebaiJC.morkOrderPushesWater.Enqueue(new OrderLocInfo()
+ // {
+ // SuborderId = order.MorkOrder.SuborderId,
+ // BatchingId = res.BatchingId,
+ // Loc = ushort.Parse(mainMaterialLoc),
+ // GoodName = order.MorkOrder.GoodsName,
+ // });
+ // }
+ // break;
case GOODS_TYPE.NEITHER:
DeviceProcessLogShow("未知的商品类型");
break;
@@ -174,88 +191,63 @@ namespace BPASmartClient.MorkT_BarCounter
///
/// 将空杯放好到接饮料的地方的标志位
///
- private bool bFirstTrig_TeaWater = false;
+ private bool bFirstTrig_MilkTea = false;
private bool bFirstTrig_Coffee = false;
- private bool bFirstTrig_Juice = false;
///
/// 延迟的超时时间
///
- DateTime delayTimeOut_Water;
DateTime delayTimeOut_Coffee;
- DateTime delayTimeOut_Juice;
+ DateTime delayTimeOut_MilkTea;
public override void MainTask()
{
EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
- if (morkTLebaiJC.IsHaveCoffeeCup && morkTLebaiJC.MakeCoffeeEnd != true)
- morkTLebaiJC.MakeCoffeeEnd = true;
+ if (morkT.IsHaveCoffeeCup && morkT.MakeCoffeeEnd != true)
+ morkT.MakeCoffeeEnd = true;
+ bFirstTrig_Coffee = false;
});
- if (morkTLebaiJC.IsHaveCoffeeCup && morkTLebaiJC.MakeCoffeeEnd != true)
+ if (morkT.IsHaveCoffeeCup && morkT.MakeCoffeeEnd != true)
{
if (!bFirstTrig_Coffee)
{
bFirstTrig_Coffee = true;
delayTimeOut_Coffee = DateTime.Now;
}
- else if (DateTime.Now.Subtract(delayTimeOut_Coffee).TotalSeconds > 18 && bFirstTrig_Coffee == true)
+ else if (DateTime.Now.Subtract(delayTimeOut_Coffee).TotalSeconds > 180 && bFirstTrig_Coffee == true)
{
DeviceProcessLogShow("接咖啡超时,接咖啡结束,等待取咖啡");
bFirstTrig_Coffee = false;
- if (morkTLebaiJC.IsHaveCoffeeCup)
- morkTLebaiJC.MakeCoffeeEnd = true;
+ if (morkT.IsHaveCoffeeCup)
+ morkT.MakeCoffeeEnd = true;
}
}
-
- if (morkTLebaiJC.IsHaveJuiceCup && morkTLebaiJC.MakeJuiceEnd != true)
+ if (morkT.IsHaveTeaMilkTeaCup && morkT.MakeMilkTeaEnd != true)
{
- var Juicestate = GetStatus("GetDeviceStatus");
- if (Juicestate != null)
- {
- if (Juicestate.Length > 0)
- {
- var Juicestate1 = Convert.ToString(Juicestate[0], 2);
- var Juicestate2 = Juicestate[1];
- if (Juicestate1.IndexOf("0") == 1 && Juicestate2 == 0)
- {
- morkTLebaiJC.MakeJuiceEnd = true;
- bFirstTrig_Juice = false;
- }
- }
- }
- if (!morkTLebaiJC.MakeJuiceEnd)
+ if (!bFirstTrig_MilkTea)
{
- //若无状态返回 则加延迟
- if (!bFirstTrig_Juice)
- {
- bFirstTrig_Juice = true;
- delayTimeOut_Juice = DateTime.Now;
- }
- else if (DateTime.Now.Subtract(delayTimeOut_Juice).TotalSeconds > 3 && bFirstTrig_Juice == true)
- {
- DeviceProcessLogShow("接果汁超时,接果汁结束,等待取果汁");
- bFirstTrig_Juice = false;
- morkTLebaiJC.MakeJuiceEnd = true;
- }
+ bFirstTrig_MilkTea = true;
+ delayTimeOut_MilkTea = DateTime.Now;//开启接水信号后,记录当前时间
}
- }
- if (morkTLebaiJC.IsHaveTeaWaterCup && morkTLebaiJC.MakeTeaEnd != true)
- {
- if (!bFirstTrig_TeaWater)
+ else if (DateTime.Now.Subtract(delayTimeOut_MilkTea).TotalSeconds >= 180 && bFirstTrig_MilkTea == true)//接水超过50s后,启动接水完成标志,开启接水程序
{
- bFirstTrig_TeaWater = true;
- delayTimeOut_Water = DateTime.Now;//开启接水信号后,记录当前时间
+ DeviceProcessLogShow("接茶或水延迟时间结束");
+ morkT.MakeMilkTeaEnd = true;
}
- else if (DateTime.Now.Subtract(delayTimeOut_Water).TotalSeconds >= 5 && bFirstTrig_TeaWater == true)//接水超过50s后,启动接水完成标志,开启接水程序
+ if ( GetStatus("Get_MilkTeaCubeStatus") == true)
{
- DeviceProcessLogShow("接茶或水延迟时间结束");
- bFirstTrig_TeaWater = false;
- morkTLebaiJC.MakeTeaEnd = true;
+ while(GetStatus("Get_MilkTeaCubeDosingStatus") == true)
+ {
+ if (morkT.IsHaveTeaMilkTeaCup && morkT.MakeMilkTeaEnd != true)
+ {
+ morkT.MakeMilkTeaEnd = true;
+ bFirstTrig_MilkTea = false;
+ new MilkTea_MakeMilkTeaEvent() { DeviceId = DeviceId, TagName = "StartSignReset" }.Publish();
+ }
+ }
}
}
DoCoffee();
- DoJuice();
- DoBoiledTea();
- DoBoiledWater();
+ DoMilkTea();
}
///
@@ -278,18 +270,6 @@ namespace BPASmartClient.MorkT_BarCounter
return GOODS_TYPE.NEITHER;
}
///
- /// 乐白的场景结束等待
- ///
- ///
- private void Wait(int value = 101)
- {
- while (!((bool)peripheralStatus["RobotOK"] && (int)peripheralStatus["RobotValue"] == value))
- {
- Thread.Sleep(5);
- }
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- }
- ///
/// 乐白的场景
///
///
@@ -318,7 +298,6 @@ namespace BPASmartClient.MorkT_BarCounter
return default;
}
int[] devStatusBy = new int[2] { 0, 0 };
- bool outCupCheck = false;//放纸杯位置有无判断
///
/// 传感器的输入信号 0:无意义 1:有信号 2:无信号 3:信号不正确
///
@@ -330,7 +309,7 @@ namespace BPASmartClient.MorkT_BarCounter
///
private bool IsMakeCoffee()
{
- bool bMake = (IsHealth && morkTLebaiJC.morkOrderPushesCoffee.Count > 0 && !morkTLebaiJC.IsHaveCoffeeCup) ? true : false;
+ bool bMake = (IsHealth && morkT.morkOrderPushesCoffee.Count > 0 && !morkT.IsHaveCoffeeCup && morkT.morkOrderPushesAll.ElementAt(0).SuborderId == morkT.morkOrderPushesCoffee.ElementAt(0).SuborderId) ? true : false;
return bMake;
}
///
@@ -339,16 +318,16 @@ namespace BPASmartClient.MorkT_BarCounter
///
private bool IsMakeJuice()
{
- bool bMake = (IsHealth && morkTLebaiJC.morkOrderPushesJuicer.Count > 0 && !morkTLebaiJC.IsHaveJuiceCup) ? true : false;
+ bool bMake = (IsHealth && morkT.morkOrderPushesJuicer.Count > 0 && !morkT.IsHaveJuiceCup && morkT.morkOrderPushesAll.ElementAt(0).SuborderId == morkT.morkOrderPushesCoffee.ElementAt(0).SuborderId) ? true : false;
return bMake;
}
///
/// 判断是否有茶订单
///
///
- private bool IsMakeTeaWater()
+ private bool IsMakeMilkTea()
{
- bool bMake = (IsHealth && morkTLebaiJC.morkOrderPushesTea.Count > 0 && !morkTLebaiJC.IsHaveTeaWaterCup) ? true : false;
+ bool bMake = (IsHealth && morkT.morkOrderPushesMilkTea.Count > 0 && !morkT.IsHaveTeaMilkTeaCup && morkT.morkOrderPushesAll.ElementAt(0).SuborderId == morkT.morkOrderPushesMilkTea.ElementAt(0).SuborderId) ? true : false;
return bMake;
}
///
@@ -357,7 +336,7 @@ namespace BPASmartClient.MorkT_BarCounter
///
private bool IsMakeWater()
{
- bool bMake = (IsHealth && morkTLebaiJC.morkOrderPushesWater.Count > 0 && !morkTLebaiJC.IsHaveTeaWaterCup) ? true : false;
+ bool bMake = (IsHealth && morkT.morkOrderPushesWater.Count > 0 && !morkT.IsHaveTeaMilkTeaCup) ? true : false;
return bMake;
}
///
@@ -367,83 +346,19 @@ namespace BPASmartClient.MorkT_BarCounter
{
if (IsMakeCoffee())
{
- PickUpCoffee();//接咖啡
- morkTLebaiJC.IsHaveCoffeeCup = true;
- }
- else if(morkTLebaiJC.MakeCoffeeEnd)
- {
- try
- {
- PutCoffeeCup();
- morkTLebaiJC.MakeCoffeeEnd = false;
- morkTLebaiJC.IsHaveCoffeeCup = false;
- morkTLebaiJC.morkOrderPushesCoffee.TryDequeue(out OrderLocInfo orderLoc);
- }
- catch (Exception ex)
- {
- MessageLog.GetInstance.ShowEx(ex.ToString());
- }
- }
- }
- private void DoJuice()
- {
- if (IsMakeJuice())
- {
- switch (morkTLebaiJC.morkOrderPushesJuicer.ElementAt(0).makeID)
- {
- case "1":
- GuMake = true;
- IsAddIce = false;
- break;
- case "2":
- GuMake = false;
- IsAddIce = false;
- break;
- case "3":
- GuMake = false;
- IsAddIce = true;
- break;
- default:
- break;
- }
- PickUpJuicer();
- morkTLebaiJC.IsHaveJuiceCup = true;
- }
- else if (morkTLebaiJC.MakeJuiceEnd)
- {
- try
- {
- Thread.Sleep(5000);//延迟五秒,防止饮料口滴饮料
- putJuice();
- morkTLebaiJC.IsHaveJuiceCup = false;
- morkTLebaiJC.MakeJuiceEnd = false;
- morkTLebaiJC.morkOrderPushesJuicer.TryDequeue(out OrderLocInfo orderLoc);
- }
- catch (Exception ex)
- {
- MessageLog.GetInstance.ShowEx(ex.ToString());
- }
- }
- }
- public bool DoTeaOrWater;
- private void DoBoiledTea()
- {
- if (IsMakeTeaWater())
- {
- PickUpTea();
- morkTLebaiJC.IsHaveTeaWaterCup = true;
- DoTeaOrWater = true;
+ Discharge_Control(Kind.咖啡);//接咖啡
+ morkT.IsHaveCoffeeCup = true;
}
- else if (morkTLebaiJC.MakeTeaEnd && morkTLebaiJC.morkOrderPushesTea.Count > 0 && DoTeaOrWater)
+ else if(morkT.MakeCoffeeEnd)
{
try
{
- PutWaterCup();
- OrderChange(morkTLebaiJC.morkOrderPushesTea.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE);
- DeviceProcessLogShow("-------------茶 制作完成------------");
- morkTLebaiJC.IsHaveTeaWaterCup = false;
- morkTLebaiJC.MakeTeaEnd = false;
- morkTLebaiJC.morkOrderPushesTea.TryDequeue(out OrderLocInfo orderLoc);
+ PutCup(Kind.咖啡);
+ DeviceProcessLogShow("-------------咖啡制作完成------------");
+ morkT.MakeCoffeeEnd = false;
+ morkT.IsHaveCoffeeCup = false;
+ morkT.morkOrderPushesCoffee.TryDequeue(out OrderLocInfo orderLoc);
+ morkT.morkOrderPushesAll.TryDequeue(out OrderLocInfo orderLoc1);
}
catch (Exception ex)
{
@@ -451,24 +366,23 @@ namespace BPASmartClient.MorkT_BarCounter
}
}
}
- private void DoBoiledWater()
+ private void DoMilkTea()
{
- if (IsMakeWater())
+ if (IsMakeMilkTea())
{
- PickUpWater();
- morkTLebaiJC.IsHaveTeaWaterCup = true;
- DoTeaOrWater = false;
+ Discharge_Control(Kind.奶茶);//接咖啡
+ morkT.IsHaveTeaMilkTeaCup = true;
}
- else if (morkTLebaiJC.MakeTeaEnd && morkTLebaiJC.morkOrderPushesWater.Count > 0 && DoTeaOrWater == false)
+ else if (morkT.MakeMilkTeaEnd && morkT.morkOrderPushesMilkTea.Count > 0)
{
try
{
- PutWaterCup();
- OrderChange(morkTLebaiJC.morkOrderPushesWater.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE);
- DeviceProcessLogShow("-------------开水 制作完成------------");
- morkTLebaiJC.IsHaveTeaWaterCup = false;
- morkTLebaiJC.MakeTeaEnd = false;
- morkTLebaiJC.morkOrderPushesWater.TryDequeue(out OrderLocInfo orderLoc);
+ PutCup(Kind.奶茶);
+ DeviceProcessLogShow("-------------奶茶制作完成------------");
+ morkT.IsHaveTeaMilkTeaCup = false;
+ morkT.MakeMilkTeaEnd = false;
+ morkT.morkOrderPushesMilkTea.TryDequeue(out OrderLocInfo orderLoc);
+ morkT.morkOrderPushesAll.TryDequeue(out OrderLocInfo orderLoc1);
}
catch (Exception ex)
{
@@ -477,326 +391,140 @@ namespace BPASmartClient.MorkT_BarCounter
}
}
-
#region 做咖啡流程
///
- /// 接咖啡
+ /// 出料控制
///
- private void PickUpCoffee()
+ private void Discharge_Control(Kind kind)
{
- if (!morkTLebaiJC.IsHaveCoffeeCup)
+ if (!morkT.IsHaveCoffeeCup)
{
- outCupCheck = false;
- OrderChange(morkTLebaiJC.morkOrderPushesCoffee.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
- int resultTakeCup = takeCup();
- if (resultTakeCup == 1)
+ if (kind == Kind.咖啡)
{
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.机器人安全位);
- //Wait();
-
- WritePLCData("",2);//将轴移动到接咖啡的位置
- DeviceProcessLogShow("伺服电机移动到接咖啡的位置");
-
- DeviceProcessLogShow("咖啡杯取杯完成");
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接咖啡);
- //Wait();
- new DRCoffee_MakeCoffeeEvent() { DrinkCode = (DrCoffeeDrinksCode)(morkTLebaiJC.morkOrderPushesCoffee.ElementAt(0).Loc)}.Publish(); //接咖啡控制 //DrCoffeeDrinksCode.热水
+ OrderChange(morkT.morkOrderPushesCoffee.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
}
else
{
- /*DeviceProcessLogShow("取杯失败 回到初始位,请及时处理!!");
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.机器人初始位);
- //Wait();*/
+ OrderChange(morkT.morkOrderPushesMilkTea.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
}
- }
- }
- ///
- /// 咖啡杯接好,放咖啡杯
- ///
- private void PutCoffeeCup()
- {
- while (GetStatus("RobotValue1"))//判断放杯位置是否有物品
- {
- if (!outCupCheck)
- DeviceProcessLogShow("成品处有纸杯存在,请取走!!");
- outCupCheck = true;
- }
- outCupCheck = false;
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.机器人安全位);
- //Wait();
-
- WritePLCData("", 2);//将轴移动到接咖啡的位置
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.放咖啡杯);
- //Wait();
- OrderChange(morkTLebaiJC.morkOrderPushesCoffee.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE);
- DeviceProcessLogShow($"-------------{morkTLebaiJC.morkOrderPushesCoffee.ElementAt(0).GoodName}制作完成------------");
- }
- #endregion
- #region 做开水流程
- ///
- /// 接开水
- ///
- private void PickUpWater()
- {
- #region 接水流程
- if (!morkTLebaiJC.IsHaveTeaWaterCup)
- {
- OrderChange(morkTLebaiJC.morkOrderPushesWater.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
int resultTakeCup = takeCup();
if (resultTakeCup == 1)
{
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接开水);
- //Wait();
- Output(false, 1);
- Output(false, 0);
- Thread.Sleep(100);
- Output(true, 0);
- Thread.Sleep(3000);
- Output(false, 0);
- Thread.Sleep(100);
+ if (kind == Kind.咖啡)
+ {
+ new WriteJaka() { DeviceId =DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_取杯位_接咖啡位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_取杯位_接咖啡位));
+
+ new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)(morkT.morkOrderPushesCoffee.ElementAt(0).Loc) }.Publish(); //控制咖啡出料
+
+ //new WriteGripper() { TagName = "PWMControl", CH_Number = "0", PWMOutput = "500" }.Publish();//夹爪的幅度控制
+
+ //new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接咖啡_初始位 }.Publish();
+ //Wait(int.Parse(JakaModel.SENCE_接咖啡_初始位));
- Output(false, 1);
- Thread.Sleep(100);
- Output(true, 1);
- Thread.Sleep(500);
- Output(false, 1);
+ //DeviceProcessLogShow("接咖啡杯动作完成");
+ }
+ else
+ {
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_取杯位_接奶茶位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_取杯位_接奶茶位));
+ while (GetStatus("Get_MilkTeaCubeStatus") == false)
+ {
+ new MilkTea_MakeMilkTeaEvent() { DeviceId = DeviceId, TagName = "ParameterSet", MilkTeaKind = GVL_MorkT.MilkTeaCHValue }.Publish(); //写入奶茶参数
+ new MilkTea_MakeMilkTeaEvent() { DeviceId = DeviceId, TagName = "Start" }.Publish();
+ break;
+ }
+ //new WriteGripper() { TagName = "PWMControl", CH_Number = "0", PWMOutput = "500" }.Publish();//夹爪的幅度控制
+
+ //new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接奶茶_初始位 }.Publish();
+ //Wait(int.Parse(JakaModel.SENCE_接奶茶_初始位));
+
+ //DeviceProcessLogShow("接奶茶杯动作完成");
+ }
}
else
{
- return;
+ DeviceProcessLogShow("取杯失败 回到初始位,请及时处理!!");
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_异常回初始位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_异常回初始位));
}
}
- #endregion
}
- #endregion
- #region 做茶流程
- ///
- /// 做茶
- ///
- private void PickUpTea()
+ public bool outCupCheck;
+ private void PutCup(Kind res)
{
- #region 接茶流程
- if (!morkTLebaiJC.IsHaveTeaWaterCup)
+ //new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish();
+ //Wait(int.Parse(JakaModel.SENCE_初始位));
+
+ //new WriteGripper() { TagName = "PWMControl", CH_Number = "0", PWMOutput = "500" }.Publish();//夹爪的幅度控制
+
+ //new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish();
+ //Wait(int.Parse(JakaModel.SENCE_初始位_放杯位检测));
+
+ //while (GetStatus("Get_JakaRobotDI0"))//判断放杯位置是否有物品
+ //{
+ // if (!outCupCheck)
+ // DeviceProcessLogShow("成品处有纸杯存在,请取走!!");
+ // outCupCheck = true;
+ //}
+ //outCupCheck = false;
+ if (res == Kind.咖啡)
{
- OrderChange(morkTLebaiJC.morkOrderPushesTea.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
- int resultTakeCup = takeCup();
- if (resultTakeCup == 1)
- {
- DeviceProcessLogShow("取茶杯完成");
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接茶叶);
- //Wait();
+ //new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放杯位检测_接咖啡 }.Publish();
+ //Wait(int.Parse(JakaModel.SENCE_放杯位检测_接咖啡));
- new WriteMcu() { TagName = "ServoControl", Address = "1", Value = 90 }.Publish();
- Thread.Sleep(1000);
- new WriteMcu() { TagName = "ServoControl", Address = "1", Value = 150 }.Publish();
- Thread.Sleep(1000);
- new WriteMcu() { TagName = "ServoControl", Address = "1", Value = 90 }.Publish();
+ //new WriteGripper() { TagName = "PWMControl", CH_Number = "0", PWMOutput = "1300" }.Publish();//夹爪的幅度控制
- Thread.Sleep(3000);
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接茶水);
- //Wait();
- Output(false, 1);
- Output(false, 0);
- Thread.Sleep(100);
- Output(true, 0);
- Thread.Sleep(3000);
- Output(false, 0);
- Thread.Sleep(100);
+ //new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放杯位检测_接咖啡 }.Publish();
+ //Wait(int.Parse(JakaModel.SENCE_接咖啡_放杯位));
+
+ //new WriteGripper() { TagName = "PWMControl", CH_Number = "0", PWMOutput = "500" }.Publish();//夹爪的幅度控制
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_接咖啡位_放咖啡位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_接咖啡位_放咖啡位));
+
+ //new WriteGripper() { DeviceId = DeviceId, TagName = "PWMControl", CH_Number = "0", PWMOutput = "0500" }.Publish();//夹爪的幅度控制
+ //new WriteJaka() { DeviceId = DeviceId, TagName = "JakaDOutput", Value = true, DO_Index = 1 }.Publish();
- Output(false, 1);
- Thread.Sleep(100);
- Output(true, 1);
- Thread.Sleep(500);
- Output(false, 1);
- morkTLebaiJC.IsHaveTeaWaterCup = true;
- }
- else
- {
- return;
- }
}
- #endregion
- }
- ///
- /// 放水杯流程
- ///
- private void PutWaterCup()
- {
- while (GetStatus("RobotValue1"))//判断放杯位置是否有物品
+ else
{
- if (!outCupCheck)
- DeviceProcessLogShow("成品处有纸杯存在,请取走!!");
- outCupCheck = true;
- }
- outCupCheck = false;
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.放水杯);
- }
+ //new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放杯位检测_接咖啡 }.Publish();
+ //Wait(int.Parse(JakaModel.SENCE_放杯位检测_接奶茶));
- #endregion
- #region 做果汁流程
- ///
- /// 果汁机控制信号
- ///
- private byte JuicerNum;
+ //new WriteGripper() { TagName = "PWMControl", CH_Number = "0", PWMOutput = "1300" }.Publish();//夹爪的幅度控制
- private void getIce()
- {
- IsAddIceNow = IsAddIce;
- if (IsAddIce)
- {
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.取杯位_机器人安全位);
- //Wait();
+ //new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放杯位检测_接咖啡 }.Publish();
+ //Wait(int.Parse(JakaModel.SENCE_接奶茶_放杯位));
- WritePLCData("",3);//将模组移动到接冰的位置
+ //new WriteGripper() { TagName = "PWMControl", CH_Number = "0", PWMOutput = "500" }.Publish();//夹爪的幅度控制
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接冰块);
- //Wait();
- if (Math.Pow(1, GetStatus("GetMakeIceDeviceStatus")) == 0)//制冰机在待机状态才可以制作冰
- {
- new StartMakeIce() { }.Publish();
- }
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接冰_机器人安全位);
- //Wait();
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_等奶茶_接奶茶位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_等奶茶_接奶茶位));
+
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_接奶茶位_放奶茶位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_接奶茶位_放奶茶位));
+
+ //new WriteGripper() { DeviceId = DeviceId, TagName = "PWMControl", CH_Number = "0", PWMOutput = "500" }.Publish();//夹爪的幅度控制
+ //new WriteJaka() { DeviceId = DeviceId, TagName = "JakaDOutput", Value = true, DO_Index = 1 }.Publish();
}
- }
- ///
- /// 当前订单是否加冰
- ///
- private bool IsAddIceNow = false;
- private int JuiceCH;
- ///
- /// 接果汁
- ///
- private void PickUpJuicer()
- {
- #region 接果汁流程
- if (!morkTLebaiJC.IsHaveJuiceCup)
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_放杯位_初始位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_放杯位_初始位));
+ if (GetStatus("Get_JakaRobotDI5"))
{
- OrderChange(morkTLebaiJC.morkOrderPushesJuicer.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
- int resultTakeCup = takeCup();
- JuiceCH = morkTLebaiJC.morkOrderPushesJuicer.ElementAt(0).Loc;
- if (resultTakeCup == 1)
- {
- getIce();
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.机器人安全位);
- //Wait();
- WritePLCData("", 3);//将模组移动到接冰的位置
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接果汁过渡位);
- //Wait();
- switch (JuiceCH)
- {
- case 52:
- if (GuMake)
- JuicerNum = 0x00;
- else
- JuicerNum = 0x01;
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接果汁1);
- //Wait();
- break;
- case 53:
- if (GuMake)
- JuicerNum = 0x02;
- else
- JuicerNum = 0x03;
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接果汁2);
- //Wait();
- break;
- case 54:
- if (GuMake)
- JuicerNum = 0x04;
- else
- JuicerNum = 0x05;
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接果汁3);
- //Wait();
- break;
- case 55:
- if (GuMake)
- JuicerNum = 0x06;
- else
- JuicerNum = 0x07;
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接果汁4);
- //Wait();
- break;
- default:
- JuicerNum = 0x00;
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.接果汁1);
- //Wait();
- break;
- }
- new WriteJuicer() { Value = JuicerNum }.Publish();
- morkTLebaiJC.IsHaveJuiceCup = true;
- }
- else
- {
- return;
- }
+ DeviceProcessLogShow("放杯完成,杯子感应器但仍有信号");
}
- #endregion
- }
- ///
- /// 取接好果汁杯
- ///
- private void putJuice()
- {
- while (GetStatus("RobotValue1"))//判断放杯位置是否有物品
+ if (res == Kind.咖啡)
{
- if (!outCupCheck)
- DeviceProcessLogShow("成品处有纸杯存在,请取走!!");
- outCupCheck = true;
+ OrderChange(morkT.morkOrderPushesCoffee.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE);
+ DeviceProcessLogShow($"-------------{morkT.morkOrderPushesCoffee.ElementAt(0).GoodName}制作完成------------");
}
- outCupCheck = false;
- switch (JuiceCH)
+ else
{
- case 52:
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.放果汁杯1);
- //Wait();
- break;
- case 53:
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.放果汁杯2);
- //Wait();
- break;
- case 54:
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.放果汁杯3);
- //Wait();
- break;
- case 55:
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.放果汁杯4);
- //Wait();
- break;
- default:
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.放果汁杯1);
- //Wait();
- break;
+ OrderChange(morkT.morkOrderPushesMilkTea.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE);
+ DeviceProcessLogShow($"-------------{morkT.morkOrderPushesMilkTea.ElementAt(0).GoodName}制作完成------------");
}
- OrderChange(morkTLebaiJC.morkOrderPushesJuicer.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE);
- DeviceProcessLogShow($"-------------{morkTLebaiJC.morkOrderPushesJuicer.ElementAt(0).GoodName}果汁 制作完成------------");
}
#endregion
-
///
/// 取杯的次数
///
@@ -809,96 +537,124 @@ namespace BPASmartClient.MorkT_BarCounter
{
try
{
- nCnt = 0;
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.机器人初始位);
- //Wait();
+ // new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish();
+ // Wait(int.Parse(JakaModel.SENCE_初始位));
+
+ // new WriteGripper() { TagName = "PWMControl", CH_Number = "0", PWMOutput = "500" }.Publish();//夹爪的幅度控制
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.机器人安全位);
- //Wait();
+ //p: new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_落杯 }.Publish();
+ // Wait(int.Parse(JakaModel.SENCE_落杯));
- WritePLCData("", 1);
+ // new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_取杯位检测_取杯位 }.Publish();
+ // Wait(int.Parse(JakaModel.SENCE_初始位_取杯位检测));
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.取纸杯);
- //Wait();
+ // if (!GetStatus("Get_JakaRobotDI0"))
+ // goto p;
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.取纸杯检测);
- //Wait();
- nCnt++;
- Thread.Sleep(2000);
- while (!GetStatus("GetInput")) //读取传感器的值
+ // new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_取杯位检测_取杯位 }.Publish();
+ // Wait(int.Parse(JakaModel.SENCE_取杯位检测_取杯位));
+
+ // new WriteGripper() { TagName = "PWMControl", CH_Number = "0", PWMOutput = "1300" }.Publish();//夹爪的幅度控制
+ // Thread.Sleep(2000);
+ // while (!GetStatus("Get_JakaRobotDI0")) //读取传感器的值
+ // {
+ // new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_异常回初始位 }.Publish();
+ // Wait(int.Parse(JakaModel.SENCE_异常回初始位));
+ // return 2;
+ // }
+ bool test1 = false;
+ if (test1)
{
- if (nCnt > 3)
- {
- nCnt = 0;
- DeviceProcessLogShow("三次取杯失败,回原点");
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.机器人安全位);
- //Wait();
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.机器人初始位);
- //Wait();
- return 2;
- }
- else
+ #region 第一种取杯方式
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_初始位));
+
+ new WriteGripper() { DeviceId = DeviceId, TagName = "PWMControl", CH_Number = "0", PWMOutput = "1350" }.Publish();//夹爪的幅度控制
+
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位_取杯位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_初始位_取杯位));
+
+ int cnt = 0;
+ new WriteGripper() { DeviceId = DeviceId, TagName = "PWMControl", CH_Number = "0", PWMOutput = "1350" }.Publish();//夹爪的幅度控制
+
+ p: new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_落杯 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_落杯));
+ cnt = cnt + 1;
+ if (!GetStatus("Get_JakaRobotDI6"))
{
- nCnt++;
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.二次取杯);
- //Wait();
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.取纸杯检测);
- //Wait();
+ if (cnt < 3)
+ goto p;
+ else
+ {
+ return 2;
+ }
}
- Thread.Sleep(1000);
- }
- new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
- Sence(GVL_MorkT.取杯位_机器人安全位);
- //Wait();
- return 1;
- }
- catch (Exception ex)
- {
- DeviceProcessLogShow(ex.ToString());
- }
- return 2;
- }
- ///
- /// 放杯
- ///
- /// 0:无意义 1:放杯成功 2:执行失败(传感器还有信号) 3:放杯异常
- private int putCup()
- {
- try
- {
- if (GetStatus("GetInput2")) return 2;
- Sence(GVL_MorkT.JUICE_放杯);
- //Wait();
- new LebaiRobot_SetValueEvent() { RobotSetValue = 1 }.Publish();
- Sence(GVL_MorkT.JUICE_放杯检测);
- //Wait();
- new LebaiRobot_SetValueEvent() { RobotSetValue = 1 }.Publish();
- if (GetStatus("GetInput2"))
- {
return 1;
+ #endregion
}
else
{
- return 3;
+ #region 第二种取杯方式
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_初始位));
+
+ //new WriteJaka() { DeviceId = DeviceId, TagName = "JakaDOutput", Value = false, DO_Index = 1 }.Publish();
+
+ //new WriteGripper() { DeviceId = DeviceId, TagName = "PWMControl", CH_Number = "0", PWMOutput = "1350" }.Publish();//夹爪的幅度控制
+
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位_取杯位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_初始位_取杯位));
+
+ int cnt = 0;
+ p: new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_落杯 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_落杯));
+ cnt = cnt + 1;
+ if (!GetStatus("Get_JakaRobotDI5"))
+ {
+ if (cnt < 3)
+ goto p;
+ else
+ {
+ return 2;
+ }
+ }
+ Thread.Sleep(2000);
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_取杯位_取杯放杯检测位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_取杯位_取杯放杯检测位));
+
+ //new WriteJaka() { DeviceId = DeviceId, TagName = "JakaDOutput", Value = true, DO_Index = 1 }.Publish();
+ //Thread.Sleep(2000);
+ //new WriteJaka() { DeviceId = DeviceId, TagName = "JakaDOutput", Value = false, DO_Index = 1 }.Publish();
+ //new WriteGripper() { DeviceId = DeviceId, TagName = "PWMControl", CH_Number = "0", PWMOutput = "1200" }.Publish();//夹爪的幅度控制
+ //Thread.Sleep(2000);
+ //new WriteGripper() { DeviceId = DeviceId, TagName = "PWMControl", CH_Number = "0", PWMOutput = "1350" }.Publish();//夹爪的幅度控制
+
+ new WriteJaka() { DeviceId = DeviceId, TagName = "JaKaProgramName", Value = JakaModel.SENCE_取杯放杯检测位_取杯位 }.Publish();
+ JakaWait(int.Parse(JakaModel.SENCE_取杯放杯检测位_取杯位));
+
+ return 1;
+
+ #endregion
}
}
catch (Exception ex)
{
DeviceProcessLogShow(ex.ToString());
- return 0;
}
+ return 2;
}
public void SimOrder(T simOrder)
{
+ }
+ private void JakaWait(int value)
+ {
+ while (!((GetStatus("Get_JakaRobotAO1") == value) && GetStatus("Get_JakaRobotProgramStatus") == 0))//判断文件是否已经执行结束 且 文件末端变量值==文件名
+ {
+ int a = GetStatus("Get_JakaRobotAO1");
+ int b = GetStatus("Get_JakaRobotProgramStatus");
+ Thread.Sleep(5);
+ }
}
#region PLC 控制函数
@@ -924,49 +680,49 @@ namespace BPASmartClient.MorkT_BarCounter
{
if (o is bool b)
{
- morkTLebaiJC.RobotIsConnected = b;
+ morkT.RobotIsConnected = b;
}
}));
GetStatus("RobotMode", new Action((o) =>
{
if (o is ELebaiRModel eLebaiRModel)
{
- morkTLebaiJC.RobotMode = eLebaiRModel;
+ morkT.RobotMode = eLebaiRModel;
}
}));
GetStatus("LeibaiGetTcpInput", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.RobotGetTcpInput = b;
+ morkT.RobotGetTcpInput = b;
}
}));
GetStatus("LeibaiGetInput1", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.RobotGetInput0 = b;
+ morkT.RobotGetInput0 = b;
}
}));
GetStatus("LeibaiGetInput2", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.RobotGetInput1 = b;
+ morkT.RobotGetInput1 = b;
}
}));
GetStatus("LeibaiGetInput3", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.RobotGetInput2 = b;
+ morkT.RobotGetInput2 = b;
}
}));
GetStatus("LeibaiGetInput4", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.RobotGetInput3 = b;
+ morkT.RobotGetInput3 = b;
}
}));
@@ -976,14 +732,14 @@ namespace BPASmartClient.MorkT_BarCounter
{
if (o is bool bt)
{
- morkTLebaiJC.IceMakerConnect = bt;
+ morkT.IceMakerConnect = bt;
}
}));
GetStatus("MakeIceDeviceStatus", new Action((o) =>
{
if (o is byte bt)
{
- morkTLebaiJC.IceMakerState = bt;
+ morkT.IceMakerState = bt;
}
}));
#endregion
@@ -992,7 +748,7 @@ namespace BPASmartClient.MorkT_BarCounter
{
if (o is bool b)
{
- morkTLebaiJC.CoffeeIsConnected = b;
+ morkT.CoffeeIsConnected = b;
}
}));
@@ -1000,7 +756,7 @@ namespace BPASmartClient.MorkT_BarCounter
{
if (o is DrCoffeeStatus coffeeStatus)
{
- morkTLebaiJC.DrCoffeeStatus = coffeeStatus;
+ morkT.DrCoffeeStatus = coffeeStatus;
}
}));
@@ -1008,7 +764,7 @@ namespace BPASmartClient.MorkT_BarCounter
{
if (o is DrCoffeeAppStatus appStatus)
{
- morkTLebaiJC.CoffeeAppStatus = appStatus;
+ morkT.CoffeeAppStatus = appStatus;
}
}));
@@ -1016,14 +772,14 @@ namespace BPASmartClient.MorkT_BarCounter
{
if (o is DrCoffeeWarning coffeeWarning)
{
- morkTLebaiJC.CoffeeWarning = coffeeWarning;
+ morkT.CoffeeWarning = coffeeWarning;
}
}));
GetStatus("CoffeeFault", new Action((o) =>
{
if (o is DrCoffeeFault coffeeFault)
{
- morkTLebaiJC.CaffeeFault = coffeeFault;
+ morkT.CaffeeFault = coffeeFault;
}
}));
#endregion
@@ -1040,63 +796,63 @@ namespace BPASmartClient.MorkT_BarCounter
{
if (o is bool b)
{
- morkTLebaiJC.SCChipIsConnect = b;
+ morkT.SCChipIsConnect = b;
}
}));
GetStatus("SCChipGetInput0", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.SCChipInput0 = b;
+ morkT.SCChipInput0 = b;
}
}));
GetStatus("SCChipGetInput1", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.SCChipInput1 = b;
+ morkT.SCChipInput1 = b;
}
}));
GetStatus("SCChipGetInput2", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.SCChipInput2 = b;
+ morkT.SCChipInput2 = b;
}
}));
GetStatus("SCChipGetInput3", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.SCChipInput3 = b;
+ morkT.SCChipInput3 = b;
}
}));
GetStatus("SCChipGetInput4", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.SCChipInput4 = b;
+ morkT.SCChipInput4 = b;
}
}));
GetStatus("SCChipGetInput5", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.SCChipInput5 = b;
+ morkT.SCChipInput5 = b;
}
}));
GetStatus("SCChipGetInput6", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.SCChipInput6 = b;
+ morkT.SCChipInput6 = b;
}
}));
GetStatus("SCChipGetInput7", new Action((o) =>
{
if (o is bool b)
{
- morkTLebaiJC.SCChipInput7 = b;
+ morkT.SCChipInput7 = b;
}
}));
@@ -1106,14 +862,14 @@ namespace BPASmartClient.MorkT_BarCounter
{
if (o is bool b)
{
- morkTLebaiJC.JuicerConnected = b;
+ morkT.JuicerConnected = b;
}
}));
GetStatus("GetJuicerDeviceStatus", new Action((o) =>
{
if (o is int[] b)
{
- morkTLebaiJC.JuicerState = b;
+ morkT.JuicerState = b;
}
}));
#endregion
@@ -1139,19 +895,19 @@ namespace BPASmartClient.MorkT_BarCounter
DeviceProcessLogShow("----开始模拟订单----");
if (msm.OrderNum == 1)
{
- morkTLebaiJC.morkOrderPushesCoffee.Enqueue(new OrderLocInfo() { Loc =(ushort)msm.DrinkCode, SuborderId = guid, GoodName="模拟咖啡订单" });
+ morkT.morkOrderPushesCoffee.Enqueue(new OrderLocInfo() { Loc =(ushort)msm.DrinkCode, SuborderId = guid, GoodName="模拟咖啡订单" });
}
else if (msm.OrderNum == 2)
{
- morkTLebaiJC.morkOrderPushesJuicer.Enqueue(new OrderLocInfo() { Loc = (ushort) (msm.JuiceList + 51), makeID = msm.JuiceMakeID, SuborderId = guid, GoodName = "模拟果汁订单" });
+ morkT.morkOrderPushesJuicer.Enqueue(new OrderLocInfo() { Loc = (ushort) (msm.JuiceList + 51), makeID = msm.JuiceMakeID, SuborderId = guid, GoodName = "模拟果汁订单" });
}
else if (msm.OrderNum == 3)
{
- morkTLebaiJC.morkOrderPushesTea.Enqueue(new OrderLocInfo() { SuborderId = guid, GoodName = "模拟茶水订单" });
+ morkT.morkOrderPushesMilkTea.Enqueue(new OrderLocInfo() { SuborderId = guid, GoodName = "模拟茶水订单" });
}
else if (msm.OrderNum == 4)
{
- morkTLebaiJC.morkOrderPushesWater.Enqueue(new OrderLocInfo() { SuborderId = guid, GoodName = "模拟开水订单" });
+ morkT.morkOrderPushesWater.Enqueue(new OrderLocInfo() { SuborderId = guid, GoodName = "模拟开水订单" });
}
}
});
diff --git a/BPASmartClient.MorkT_BarCounter/GVL_MorkT.cs b/BPASmartClient.MorkT_BarCounter/GVL_MorkT.cs
index f531c404..af1ebad6 100644
--- a/BPASmartClient.MorkT_BarCounter/GVL_MorkT.cs
+++ b/BPASmartClient.MorkT_BarCounter/GVL_MorkT.cs
@@ -71,6 +71,13 @@ namespace BPASmartClient.MorkT_BarCounter
public const int JUICE_放杯 = 20120;
public const int JUICE_放杯检测 = 20120;
#endregion
+
+
+ ///
+ ///
+ /// 咖啡订单队列
+ ///
+ public ConcurrentQueue morkOrderPushesAll = new ConcurrentQueue();
///
///
/// 咖啡订单队列
@@ -99,18 +106,25 @@ namespace BPASmartClient.MorkT_BarCounter
public bool MakeJuiceEnd = false;
///
- /// 做茶订单队列
+ /// 出果汁完成,是否去取果汁
///
- public ConcurrentQueue morkOrderPushesTea = new ConcurrentQueue();
+ public static ushort[] MilkTeaCHValue = new ushort[12] {200,200,200,200,200,200,200,200,200,200,200,200 };
///
- /// 接水口是否有茶水杯
+ /// 做茶订单队列
///
- public bool IsHaveTeaWaterCup = false;
+ public ConcurrentQueue morkOrderPushesMilkTea = new ConcurrentQueue();
///
- /// 水已经接完,是否去取水杯
+ /// 接奶茶口是否有奶茶杯
///
- public bool MakeTeaEnd = false;
+ public bool IsHaveTeaMilkTeaCup = false;
+ ///
+ /// 奶茶做完成
+ ///
+ public bool MakeMilkTeaEnd = false;
+ public static bool DI0 = false;
+ public static bool DI1 = false;
+ public static bool DI2 = false;
///
/// 做开水订单队列
///
diff --git a/BPASmartClient.MorkT_BarCounter/PolymerBatching.cs b/BPASmartClient.MorkT_BarCounter/PolymerBatching.cs
index bf1d9f48..8c918a32 100644
--- a/BPASmartClient.MorkT_BarCounter/PolymerBatching.cs
+++ b/BPASmartClient.MorkT_BarCounter/PolymerBatching.cs
@@ -19,15 +19,15 @@ namespace BPASmartClient.MorkT_BarCounter
///
/// 果汁
///
- JUICE,
+ //JUICE,
///
/// 茶水
///
- TEA,
+ MilkTea,
///
/// 水
///
- WATER,
+ //WATER,
///
/// 杯子
///
@@ -42,10 +42,10 @@ namespace BPASmartClient.MorkT_BarCounter
internal class PolymerBatching
{
- internal const string Juicer_MAIN_BATCHIN1_LOC = "52";
- internal const string Juicer_MAIN_BATCHIN2_LOC = "53";
- internal const string Juicer_MAIN_BATCHIN3_LOC = "54";
- internal const string Juicer_MAIN_BATCHIN4_LOC = "55";
+ //internal const string Juicer_MAIN_BATCHIN1_LOC = "52";
+ //internal const string Juicer_MAIN_BATCHIN2_LOC = "53";
+ //internal const string Juicer_MAIN_BATCHIN3_LOC = "54";
+ //internal const string Juicer_MAIN_BATCHIN4_LOC = "55";
//internal const string Juicer_MAIN_BATCHIN5_LOC = "56";
//internal const string Juicer_MAIN_BATCHIN6_LOC = "57";
//internal const string Juicer_MAIN_BATCHIN7_LOC = "58";
@@ -80,12 +80,11 @@ namespace BPASmartClient.MorkT_BarCounter
{"24",GOODS_TYPE.COFFEE},
{"25",GOODS_TYPE.COFFEE},
{ COFFEE_HOLDER_LOC,GOODS_TYPE.CUP},
- {"56",GOODS_TYPE.TEA },
- {"61",GOODS_TYPE.WATER },
- {Juicer_MAIN_BATCHIN1_LOC,GOODS_TYPE.JUICE},
- {Juicer_MAIN_BATCHIN2_LOC,GOODS_TYPE.JUICE},
- {Juicer_MAIN_BATCHIN3_LOC,GOODS_TYPE.JUICE},
- {Juicer_MAIN_BATCHIN4_LOC,GOODS_TYPE.JUICE},
+ {"60",GOODS_TYPE.MilkTea },
+ //{Juicer_MAIN_BATCHIN1_LOC,GOODS_TYPE.JUICE},
+ //{Juicer_MAIN_BATCHIN2_LOC,GOODS_TYPE.JUICE},
+ //{Juicer_MAIN_BATCHIN3_LOC,GOODS_TYPE.JUICE},
+ //{Juicer_MAIN_BATCHIN4_LOC,GOODS_TYPE.JUICE},
//{Juicer_MAIN_BATCHIN5_LOC,GOODS_TYPE.JUICE},
//{Juicer_MAIN_BATCHIN6_LOC,GOODS_TYPE.JUICE},
//{Juicer_MAIN_BATCHIN7_LOC,GOODS_TYPE.JUICE},
diff --git a/BPASmartClient.MorkT_BarCounter/View/DebugView.xaml b/BPASmartClient.MorkT_BarCounter/View/DebugView.xaml
index 673ac70c..618a5389 100644
--- a/BPASmartClient.MorkT_BarCounter/View/DebugView.xaml
+++ b/BPASmartClient.MorkT_BarCounter/View/DebugView.xaml
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm="clr-namespace:BPASmartClient.MorkT_BarCounter.ViewModel"
mc:Ignorable="d"
- Name="调试界面"
+ Name="测试界面"
d:DesignHeight="500" d:DesignWidth="1000" Unloaded="Dubug_Unloaded">
@@ -18,422 +18,100 @@
-
+
-
-
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TCP DI:
- DI0
-
-
-
-
- DI:
- DI0
- DI1
- DI2
- DI3
-
-
-
-
- DO:
-
- DO0
- DO1
- DO2
- DO3
-
-
- true
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 连接状态:
-
-
-
-
-
- DI:
- DI0
- DI1
- DI2
- DI3
- DI4
- DI5
- DI6
- DI7
-
-
-
-
-
-
-
-
-
- DO输出
-
- DO0
- DO1
- DO2
- DO3
- DO4
- DO5
- DO6
- DO7
-
-
- True
- False
-
-
-
-
-
-
- 舵机控制
-
- 舵机1
- 舵机2
- 舵机3
- 舵机4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 果汁:
-
-
-
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 咖啡:
-
-
-
-
-
-
- 果汁:
-
- 饮品1
- 饮品2
- 饮品3
- 饮品4
-
-
- 热饮
- 常温
- 冷饮
-
-
-
-
-
-
- 开水:
-
-
-
-
-
- 茶水:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 连接状态:
-
-
-
-
-
-
-
-
-
-
-
-
- 设备状态:
-
-
-
-
-
-
-
-
-
- 控制:
-
-
-
-
-
-
- 出冰时间:
-
- s
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 咖啡机状态
-
- 应用状态
-
- 告警信息
-
- 故障信息
-
-
-
-
- 饮品
-
-
-
-
-
-
-
- 模式
-
-
-
-
-
-
+
+ 机器人执行程序:
+
+
+
+
+ 咖啡机执行程序:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 通道1的值:
+
+
+
+ 通道2的值:
+
+
+
+ 通道3的值:
+
+
+
+ 通道4的值:
+
+
+
+ 通道5的值:
+
+
+
+ 通道6的值:
+
+
+
+ 通道7的值:
+
+
+
+ 通道8的值:
+
+
+
+ 通道9的值:
+
+
+
+ 通道10的值:
+
+
+
+ 通道11的值:
+
+
+
+ 通道12的值:
+
+
+
+ 味魔方执行程序:
+
+
+
+
+
+
+
+ 电爪执行程序:
+
+
+
diff --git a/BPASmartClient.MorkT_BarCounter/View/TestView.xaml b/BPASmartClient.MorkT_BarCounter/View/TestView.xaml
new file mode 100644
index 00000000..2d68b53a
--- /dev/null
+++ b/BPASmartClient.MorkT_BarCounter/View/TestView.xaml
@@ -0,0 +1,439 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TCP DI:
+ DI0
+
+
+
+
+ DI:
+ DI0
+ DI1
+ DI2
+ DI3
+
+
+
+
+ DO:
+
+ DO0
+ DO1
+ DO2
+ DO3
+
+
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 连接状态:
+
+
+
+
+
+ DI:
+ DI0
+ DI1
+ DI2
+ DI3
+ DI4
+ DI5
+ DI6
+ DI7
+
+
+
+
+
+
+
+
+
+ DO输出
+
+ DO0
+ DO1
+ DO2
+ DO3
+ DO4
+ DO5
+ DO6
+ DO7
+
+
+ True
+ False
+
+
+
+
+
+
+ 舵机控制
+
+ 舵机1
+ 舵机2
+ 舵机3
+ 舵机4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 果汁:
+
+
+
+
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 咖啡:
+
+
+
+
+
+
+ 果汁:
+
+ 饮品1
+ 饮品2
+ 饮品3
+ 饮品4
+
+
+ 热饮
+ 常温
+ 冷饮
+
+
+
+
+
+
+ 开水:
+
+
+
+
+
+ 茶水:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 连接状态:
+
+
+
+
+
+
+
+
+
+
+
+
+ 设备状态:
+
+
+
+
+
+
+
+
+
+ 控制:
+
+
+
+
+
+
+ 出冰时间:
+
+ s
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 咖啡机状态
+
+ 应用状态
+
+ 告警信息
+
+ 故障信息
+
+
+
+
+ 饮品
+
+
+
+
+
+
+
+ 模式
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.MorkT_BarCounter/View/TestView.xaml.cs b/BPASmartClient.MorkT_BarCounter/View/TestView.xaml.cs
new file mode 100644
index 00000000..c2b2314c
--- /dev/null
+++ b/BPASmartClient.MorkT_BarCounter/View/TestView.xaml.cs
@@ -0,0 +1,37 @@
+using BPASmartClient.Helper;
+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.MorkT_BarCounter.View
+{
+ ///
+ /// DebugView.xaml 的交互逻辑
+ ///
+ public partial class TestView : UserControl
+ {
+ public TestView()
+ {
+ InitializeComponent();
+ }
+
+ private void Dubug_Unloaded(object sender, RoutedEventArgs e)
+ {
+ ThreadManage.GetInstance().StopTask("MorkT-状态刷新");
+ ThreadManage.GetInstance().StopTask("MorkT-传感器监视");
+
+ }
+ }
+
+}
diff --git a/BPASmartClient.MorkT_BarCounter/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkT_BarCounter/ViewModel/DebugViewModel.cs
index 8cc3f0d7..c49d316d 100644
--- a/BPASmartClient.MorkT_BarCounter/ViewModel/DebugViewModel.cs
+++ b/BPASmartClient.MorkT_BarCounter/ViewModel/DebugViewModel.cs
@@ -11,6 +11,8 @@ using BPASmartClient.Model.冰淇淋.Enum;
using BPASmartClient.Model.单片机;
using BPASmartClient.Model.单片机.Enum;
using BPASmartClient.Model.咖啡机.Enum;
+using BPASmartClient.Model.奶茶味魔方;
+using BPASmartClient.Model.电夹爪;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
@@ -19,368 +21,70 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
namespace BPASmartClient.MorkT_BarCounter.ViewModel;
- public class DebugViewModel : ObservableObject
+public class DebugViewModel : ObservableObject
+{
+ public DebugViewModel()
{
-
- #region 乐白机器人
- ///
- /// 乐白机器人连接状态
- ///
- public string RobotConnected { get { return _robotConnected; } set { _robotConnected = value; OnPropertyChanged(); } }
- private string _robotConnected { get; set; }
- ///
- /// 乐白机器人的模式状态
- ///
- public string RobotMode { get { return _robotMode; } set { _robotMode = value; OnPropertyChanged(); } }
- private string _robotMode { get; set; }
- ///
- /// 机器人控制指令
- ///
- public RelayCommand Button_RobotControlCommand { get; set; }
-
- public RelayCommand Robot_DOutput { get; set; }
- ///
- /// 机器人控制
- ///
- ///
- private void Button_RobotControl(object o)
- {
- EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() });
- }
- private void Button_RobotDoutput()
+ RobotControlCommand = new RelayCommand(() =>
{
- bool DO_Value =int.Parse(Robot_DOutput_Value) == 0;
- EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { Pin = int.Parse(Robot_DOutput_Pin), Value = DO_Value });
- }
- public string Robot_TCPDI0 { get { return _robot_TCPDI0; } set { _robot_TCPDI0 = value;OnPropertyChanged(); } }
- private string _robot_TCPDI0;
-
- public string Robot_DI0 { get { return _robot_DI0; } set { _robot_DI0 = value; OnPropertyChanged(); } }
- private string _robot_DI0;
- public string Robot_DI1 { get { return _robot_DI1; } set { _robot_DI1 = value; OnPropertyChanged(); } }
- private string _robot_DI1;
- public string Robot_DI2 { get { return _robot_DI2; } set { _robot_DI2 = value; OnPropertyChanged(); } }
- private string _robot_DI2;
- public string Robot_DI3 { get { return _robot_DI3; } set { _robot_DI3 = value; OnPropertyChanged(); } }
- private string _robot_DI3;
-
-
- public string Robot_DOutput_Pin { get { return _robot_DOutput_Pin; } set { _robot_DOutput_Pin = value; OnPropertyChanged(); } }
- private string _robot_DOutput_Pin { get; set; }
- public string Robot_DOutput_Value { get { return _robot_DOutput_Valuet; } set { _robot_DOutput_Valuet = value; OnPropertyChanged(); } }
- private string _robot_DOutput_Valuet { get; set; }
- #endregion
- #region 单片机
- public string MCUConnected { get { return _mcuConnected; } set { _mcuConnected = value; OnPropertyChanged(); } }
- private string _mcuConnected { get; set; }
-
- public string MCUDI0 { get { return _mCUDI0; } set { _mCUDI0 = value; OnPropertyChanged(); } }
- private string _mCUDI0 { get; set; }
- public string MCUDI1 { get { return _mCUDI1; } set { _mCUDI1 = value; OnPropertyChanged(); } }
- private string _mCUDI1 { get; set; }
- public string MCUDI2 { get { return _mCUDI2; } set { _mCUDI2 = value; OnPropertyChanged(); } }
- private string _mCUDI2 { get; set; }
- public string MCUDI3 { get { return _mCUDI3; } set { _mCUDI3 = value; OnPropertyChanged(); } }
- private string _mCUDI3 { get; set; }
- public string MCUDI4 { get { return _mCUDI4; } set { _mCUDI4 = value; OnPropertyChanged(); } }
- private string _mCUDI4 { get; set; }
- public string MCUDI5 { get { return _mCUDI5; } set { _mCUDI5 = value; OnPropertyChanged(); } }
- private string _mCUDI5 { get; set; }
- public string MCUDI6 { get { return _mCUDI6; } set { _mCUDI6 = value; OnPropertyChanged(); } }
- private string _mCUDI6 { get; set; }
- public string MCUDI7 { get { return _mCUDI7; } set { _mCUDI7 = value; OnPropertyChanged(); } }
- private string _mCUDI7 { get; set; }
-
- public RelayCommand Button_MCUOuputCommand { get; set; }
- public RelayCommand Button_MCUDOuputCommand { get; set; }
-
- public int MCU_PWM_CH { get { return _choosePWM; } set { _choosePWM = value; OnPropertyChanged(); } }
- private int _choosePWM = 1;
- public int PWMInputNumber { get { return _pwmInputNumber; } set { _pwmInputNumber = value; OnPropertyChanged(); } }
- private int _pwmInputNumber = 1;
+ new WriteJaka() { DeviceId = 126, TagName = "JaKaProgramName", Value = JakaRobotProgram }.Publish();
- private int[] DICH { get { return _diCH; } set { _diCH = value; OnPropertyChanged(); } }
- private int[] _diCH = new int[8];
-
- public int MCU_DO_CH { get { return _mcuDO_CH; } set { _mcuDO_CH = value; OnPropertyChanged(); } }
- private int _mcuDO_CH = 1;
- public bool MCU_DO_Value { get { return _mcu_DO_Valuer; } set { _mcu_DO_Valuer = value; OnPropertyChanged(); } }
- private bool _mcu_DO_Valuer = true;
-
- private void Button_McuPWMOutput()
+ });
+ CoffeeControlCommand = new RelayCommand(() =>
{
- string sChoosePWM = Convert.ToString(MCU_PWM_CH + 1);
- new WriteMcu() { TagName = "ServoControl", Address = sChoosePWM, Value = PWMInputNumber }.Publish();
- }
- private void Button_McuDOutput()
+ new DRCoffee_MakeCoffeeEvent() { DeviceId = 126, DrinkCode = (DrCoffeeDrinksCode)(CoffeeKind) }.Publish();
+ });
+ MikeTeaCupControlCommand = new RelayCommand(() =>
{
- string sChooseDO = Convert.ToString(MCU_DO_CH + 1);
- new WriteMcu() { TagName = "OutputControl", Address = sChooseDO, Value = MCU_DO_Value }.Publish();
- }
- #endregion
- #region 果汁机
- ///
- /// 果汁机的连接状态
- ///
- public string JuicerConnected { get { return _JuicerConnected; } set { _JuicerConnected = value; OnPropertyChanged(); } }
- private string _JuicerConnected { get; set; }
-
- public string JuiceState_Heating { get { return _juiceState_Heating; } set { _juiceState_Heating = value;OnPropertyChanged(); } }
- public string _juiceState_Heating { get; set; }
- public string JuiceState_Cooling { get { return _juiceState_Cooling; } set { _juiceState_Cooling = value; OnPropertyChanged(); } }
- public string _juiceState_Cooling { get; set; }
- public string JuiceState_LackOfWater { get { return _juiceState_LackOfWater; } set { _juiceState_LackOfWater = value; OnPropertyChanged(); } }
- public string _juiceState_LackOfWater { get; set; }
- public string JuiceState_ChildLocks { get { return _juiceState_ChildLocks; } set { _juiceState_ChildLocks = value; OnPropertyChanged(); } }
- public string _juiceState_ChildLocks { get; set; }
- public string JuiceState_Using { get { return _juiceState_Using; } set { _juiceState_Using = value; OnPropertyChanged(); } }
- public string _juiceState_Using { get; set; }
-
- public string MakeJuice_Index { get { return _makeJuice_Index; } set { _makeJuice_Index = value; OnPropertyChanged(); } }
- public string _makeJuice_Index { get; set; }
-
- public RelayCommand Button_MakeJuiceCommand { get; set; }
-
- public void Button_MakeJuice()
+ new MilkTea_MakeMilkTeaEvent() { DeviceId = 126, TagName = "ParameterSet", MilkTeaKind = GVL_MorkT.MilkTeaCHValue }.Publish(); //写入奶茶参数
+ new MilkTea_MakeMilkTeaEvent() { DeviceId = 126, TagName = "Start" }.Publish();
+ });
+ GripperControlCommand = new RelayCommand(() =>
{
- new WriteJuicer() { Value = MakeJuice_Index }.Publish();
- }
- #endregion
- #region 制冰机
- public string IceMakerConnect { get { return _iceMakerConnect; } set { _iceMakerConnect = value;OnPropertyChanged(); } }
- private string _iceMakerConnect { get; set; }
- public string IceMakerState { get { return _iceMakerState; } set { _iceMakerState = value; OnPropertyChanged(); } }
- private string _iceMakerState { get; set; }
- public int IceMaker_IceTime { get { return _iceMaker_IceTime; } set { _iceMaker_IceTime = value; OnPropertyChanged(); } }
- private int _iceMaker_IceTime = 3;
-
- #region 订单模拟
- public RelayCommand SimOrderMakeCoffee { get; set; }
- public RelayCommand SimOrderMakeJuice { get; set; }
- public RelayCommand SimOrderMakeTea { get; set; }
- public RelayCommand SimOrderMakeWater { get; set; }
-
- public int SimOrder_JuiceList { get { return _simOrder_JuiceList; } set { _simOrder_JuiceList = value; OnPropertyChanged(); } }
- public int _simOrder_JuiceList { get; set; }
- public string SimOrder_JuiceMakeID { get { return _simOrder_JuiceMakeID; } set { _simOrder_JuiceMakeID = value; OnPropertyChanged(); } }
- public string _simOrder_JuiceMakeID { get; set; }
- #endregion
-
- public RelayCommand IceMaker_BtnPowerOn { get; set; }
- public RelayCommand IceMaker_BtnStandby { get; set;}
- public RelayCommand IceMaker_BtnPump { get; set;}
-
- public RelayCommand IceMaker_BtnStart { get; set; }
- public RelayCommand IceMaker_BtnEnd { get; set; }
- public RelayCommand IceMaker_BtnSetIceTime { get; set; }
-
- private void IceMaker_BtnPowerOnCommand()
- {
- new PowerOnMakeIce().Publish();
- }
- private void IceMaker_BtnStandbyCommand()
- {
- new StandbyMakeIce().Publish();
- }
- private void IceMaker_BtnPumpCommand()
- {
- new PumpMakeIce().Publish();
- }
- private void IceMaker_BtnStartCommand()
- {
- new StartMakeIce().Publish();
- }
- private void IceMaker_BtnEndCommand()
- {
- new StopMakeIce().Publish();
- }
- private void IceMaker_BtnSetIceTimeCommand()
- {
- new SetIceNumber{ Value= IceMaker_IceTime }.Publish();
- }
- #endregion
- #region 咖啡机
- ///
- /// 咖啡机连接状态
- ///
- public string CoffeeConnected { get { return _coffeeConnected; } set { _coffeeConnected = value; OnPropertyChanged(); } }
- private string _coffeeConnected { get; set; }
- ///
- /// 咖啡机状态
- ///
- public string CoffeeStatus { get { return _coffeeStatus; } set { _coffeeStatus = value; OnPropertyChanged(); } }
- private string _coffeeStatus { get; set; }
- ///
- /// 应用状态
- ///
- public string AppStatus { get { return _appStatus; } set { _appStatus = value; OnPropertyChanged(); } }
- private string _appStatus { get; set; }
- ///
- /// 告警
- ///
- public string Warning { get { return _warning; } set { _warning = value; OnPropertyChanged(); } }
- public string _warning { get; set; }
- ///
- /// 故障信息
- ///
- public string CaffeeFault { get { return _caffeeFault; } set { _caffeeFault = value; OnPropertyChanged(); } }
- public string _caffeeFault { get; set; }
-
- public List Coffees { get; set; } = new List();
- public string SelectedCoffee { get { return _selectedCoffee; } set { _selectedCoffee = value; OnPropertyChanged(); } }
- public string _selectedCoffee { get; set; }
-
- public List CoffeeCmds { get; set; } = new List();
- public string SelectedCoffeeCmd { get; set; }
-
-
- public string SimOrderCoffeeList { get { return _simOrderCoffeeList; } set { _simOrderCoffeeList = value; OnPropertyChanged(); } }
- public string _simOrderCoffeeList { get; set; }
-
- ///
- /// 制作咖啡
- ///
- public RelayCommand Button_MakeCoffeeCommand { get; set; }
- ///
- /// 停止制作咖啡
- ///
- public RelayCommand Button_StopMakeCoffeCommand { get; set; }
- ///
- /// 咖啡模式设置
- ///
- public RelayCommand Button_CoffeeModeSetCommand { get; set; }
-
- private void Button_MakeCoffee()
- {
- EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee) });
- }
- private void Button_StopMakeCoffe()
- {
- EventBus.EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId });
- }
- private void Button_CoffeeModeSet()
- {
- EventBus.EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd) });
- }
-
- #endregion
- ///
- /// 设备ID
- ///
- public int DeviceId { get; set; }
- ///
- /// 设备数据
- ///
- public ObservableCollection variableMonitors { get; set; }
-
- public DebugViewModel()
- {
- SimOrderMakeCoffee = new RelayCommand(() =>
- {
- new MorkTSimOrder() { OrderNum = 1, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SimOrderCoffeeList) }.Publish();
- });
- SimOrderMakeJuice = new RelayCommand(() =>
- {
- new MorkTSimOrder() { OrderNum = 2, JuiceList = SimOrder_JuiceList, JuiceMakeID = SimOrder_JuiceMakeID }.Publish();
- });
- SimOrderMakeTea = new RelayCommand(() =>
+ string value = GripperProgam + "";
+ if (value.Length == 1)
{
- new MorkTSimOrder() { OrderNum = 3 }.Publish();
- });
- SimOrderMakeWater = new RelayCommand(() =>
- {
- new MorkTSimOrder() { OrderNum = 4 }.Publish();
- });
- Button_RobotControlCommand = new RelayCommand(Button_RobotControl);
- Robot_DOutput = new RelayCommand(Button_RobotDoutput);
-
- Button_MakeCoffeeCommand = new RelayCommand(Button_MakeCoffee);
- Button_StopMakeCoffeCommand = new RelayCommand(Button_StopMakeCoffe);
- Button_CoffeeModeSetCommand = new RelayCommand(Button_CoffeeModeSet);
-
- Button_MCUOuputCommand = new RelayCommand(Button_McuPWMOutput);
- Button_MCUDOuputCommand = new RelayCommand(Button_McuDOutput);
-
- Button_MakeJuiceCommand = new RelayCommand(Button_MakeJuice);
-
- IceMaker_BtnPowerOn = new RelayCommand(IceMaker_BtnPowerOnCommand);
- IceMaker_BtnStandby = new RelayCommand(IceMaker_BtnStandbyCommand);
- IceMaker_BtnPump = new RelayCommand(IceMaker_BtnPumpCommand);
- IceMaker_BtnStart = new RelayCommand(IceMaker_BtnStartCommand);
- IceMaker_BtnEnd = new RelayCommand(IceMaker_BtnEndCommand);
- IceMaker_BtnSetIceTime = new RelayCommand(IceMaker_BtnSetIceTimeCommand);
-
- foreach (DrCoffeeDrinksCode code in Enum.GetValues(typeof(DrCoffeeDrinksCode)))
+ value = "000" + value;
+ }
+ else if (value.Length == 2)
{
- Coffees.Add(code.ToString());
+ value = "00" + value;
}
- SelectedCoffee = Coffees[0];
- SimOrderCoffeeList = Coffees[0];
- foreach (DrCoffeeCommCmd code in Enum.GetValues(typeof(DrCoffeeCommCmd)))
+ else if (value.Length == 3)
{
- CoffeeCmds.Add(code.ToString());
+ value = "0" + value;
}
- SelectedCoffeeCmd = CoffeeCmds[0];
-
- Plugin.GetInstance()?.GetPlugin()?.GetDevices().ForEach(device =>
+ else
{
- if (device.Name == "MorkT") DeviceId = device.DeviceId
- ;
- });
- ThreadManage.GetInstance().StartLong(new Action(() =>
+ value = "1350";
+ }
+ new WriteGripper() { DeviceId = 126, TagName = "PWMControl", CH_Number = "0", PWMOutput = value }.Publish();//夹爪的幅度控制
+ });
+ MikeTeaCupSetParCommand = new RelayCommand(() =>
+ {
+ for (int i = 0; i < 12; i++)
{
- variableMonitors = Plugin.GetInstance()?.GetPlugin()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors;
- if (variableMonitors != null && variableMonitors.Count > 0)
- {
- #region 机器人
- RobotConnected = variableMonitors.FirstOrDefault(p => p.Notes == "机器人连接状态").CurrentValue == "True" ? "已连接" : "未连接";
- RobotMode = variableMonitors.FirstOrDefault(p => p.Notes == "机器人状态").CurrentValue;
- Robot_TCPDI0 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人TCP输入状态").CurrentValue;
- Robot_DI0 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入0状态").CurrentValue;
- Robot_DI1 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入1状态").CurrentValue;
- Robot_DI2 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入2状态").CurrentValue;
- Robot_DI3 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入3状态").CurrentValue;
-
- #endregion
-
- #region 咖啡机
- CoffeeConnected = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
- CoffeeStatus = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机状态").CurrentValue;
- AppStatus = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机应用状态").CurrentValue;
- Warning = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机告警").CurrentValue;
- CaffeeFault = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机故障").CurrentValue;
- #endregion
-
- #region 单片机
- MCUConnected = variableMonitors.FirstOrDefault(p => p.Notes == "单片机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
- MCUDI0 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入0状态").CurrentValue;
- MCUDI1 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入1状态").CurrentValue;
- MCUDI2 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入2状态").CurrentValue;
- MCUDI3 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入3状态").CurrentValue;
- MCUDI4 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入4状态").CurrentValue;
- MCUDI5 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入5状态").CurrentValue;
- MCUDI6 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入6状态").CurrentValue;
- MCUDI7 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入7状态").CurrentValue;
- #endregion
-
- #region 制冰机
- IceMakerConnect = variableMonitors.FirstOrDefault(p => p.Notes == "制冰机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
- IceMakerState = variableMonitors.FirstOrDefault(p => p.Notes == "制冰机设备状态").CurrentValue;
- #endregion
-
-
- #region 果汁机
- JuicerConnected = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
- JuiceState_Heating = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机制热").CurrentValue;
- JuiceState_Cooling = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机制冷").CurrentValue;
- JuiceState_LackOfWater = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机缺水").CurrentValue;
- JuiceState_ChildLocks = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机童锁").CurrentValue;
- JuiceState_Using = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机使用").CurrentValue;
-
- #endregion
- }
- Thread.Sleep(500);
- }), "MorkT-状态刷新");
- }
+ GVL_MorkT.MilkTeaCHValue[i] = (ushort)CH_Value[i];
+ }
+ });
}
+ public int JakaRobotProgram { get { return _JakaRobotProgram; } set { _JakaRobotProgram = value; OnPropertyChanged(); } }
+ private int _JakaRobotProgram { get; set; }
+ public RelayCommand RobotControlCommand { get; set; }
+ public RelayCommand MikeTeaCupSetParCommand { get; set; }
+ public int CoffeeKind { get { return _CoffeeKind; } set { _CoffeeKind = value; OnPropertyChanged(); } }
+ private int _CoffeeKind { get; set; }
+ public RelayCommand CoffeeControlCommand { get; set; }
+
+ public int MilkTeaCub { get { return _MilkTeaCub; } set { _MilkTeaCub = value; OnPropertyChanged(); } }
+ private int _MilkTeaCub { get; set; }
+ public RelayCommand MikeTeaCupControlCommand { get; set; }
+ public int GripperProgam { get { return _GripperProgam; } set { _GripperProgam = value; OnPropertyChanged(); } }
+ private int _GripperProgam { get; set; }
+
+ public int[] CH_Value { get { return _CH_Value; } set { _CH_Value = value; OnPropertyChanged(); } }
+ private int[] _CH_Value { get; set; } = new int[12] {200,200,200,200,200,200,200,200,200,200,200,200 };
+
+ public RelayCommand GripperControlCommand { get; set; }
+}
diff --git a/BPASmartClient.MorkT_BarCounter/ViewModel/TestViewModel.cs b/BPASmartClient.MorkT_BarCounter/ViewModel/TestViewModel.cs
new file mode 100644
index 00000000..194eb312
--- /dev/null
+++ b/BPASmartClient.MorkT_BarCounter/ViewModel/TestViewModel.cs
@@ -0,0 +1,386 @@
+using BPASmartClient.Business;
+using BPASmartClient.Device;
+using BPASmartClient.DRCoffee;
+using BPASmartClient.EventBus;
+using BPASmartClient.Helper;
+using BPASmartClient.LebaiRobot;
+using BPASmartClient.Message;
+using BPASmartClient.Model;
+using BPASmartClient.Model.乐白机器人;
+using BPASmartClient.Model.冰淇淋.Enum;
+using BPASmartClient.Model.单片机;
+using BPASmartClient.Model.单片机.Enum;
+using BPASmartClient.Model.咖啡机.Enum;
+using Microsoft.Toolkit.Mvvm.ComponentModel;
+using Microsoft.Toolkit.Mvvm.Input;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Threading;
+namespace BPASmartClient.MorkT_BarCounter.ViewModel;
+ public class TestViewModel : ObservableObject
+ {
+
+ #region 乐白机器人
+ ///
+ /// 乐白机器人连接状态
+ ///
+ public string RobotConnected { get { return _robotConnected; } set { _robotConnected = value; OnPropertyChanged(); } }
+ private string _robotConnected { get; set; }
+ ///
+ /// 乐白机器人的模式状态
+ ///
+ public string RobotMode { get { return _robotMode; } set { _robotMode = value; OnPropertyChanged(); } }
+ private string _robotMode { get; set; }
+ ///
+ /// 机器人控制指令
+ ///
+ public RelayCommand Button_RobotControlCommand { get; set; }
+
+ public RelayCommand Robot_DOutput { get; set; }
+ ///
+ /// 机器人控制
+ ///
+ ///
+ private void Button_RobotControl(object o)
+ {
+ EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() });
+ }
+ private void Button_RobotDoutput()
+ {
+ bool DO_Value =int.Parse(Robot_DOutput_Value) == 0;
+ EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { Pin = int.Parse(Robot_DOutput_Pin), Value = DO_Value });
+ }
+ public string Robot_TCPDI0 { get { return _robot_TCPDI0; } set { _robot_TCPDI0 = value;OnPropertyChanged(); } }
+ private string _robot_TCPDI0;
+
+ public string Robot_DI0 { get { return _robot_DI0; } set { _robot_DI0 = value; OnPropertyChanged(); } }
+ private string _robot_DI0;
+ public string Robot_DI1 { get { return _robot_DI1; } set { _robot_DI1 = value; OnPropertyChanged(); } }
+ private string _robot_DI1;
+ public string Robot_DI2 { get { return _robot_DI2; } set { _robot_DI2 = value; OnPropertyChanged(); } }
+ private string _robot_DI2;
+ public string Robot_DI3 { get { return _robot_DI3; } set { _robot_DI3 = value; OnPropertyChanged(); } }
+ private string _robot_DI3;
+
+
+ public string Robot_DOutput_Pin { get { return _robot_DOutput_Pin; } set { _robot_DOutput_Pin = value; OnPropertyChanged(); } }
+ private string _robot_DOutput_Pin { get; set; }
+ public string Robot_DOutput_Value { get { return _robot_DOutput_Valuet; } set { _robot_DOutput_Valuet = value; OnPropertyChanged(); } }
+ private string _robot_DOutput_Valuet { get; set; }
+ #endregion
+ #region 单片机
+ public string MCUConnected { get { return _mcuConnected; } set { _mcuConnected = value; OnPropertyChanged(); } }
+ private string _mcuConnected { get; set; }
+
+ public string MCUDI0 { get { return _mCUDI0; } set { _mCUDI0 = value; OnPropertyChanged(); } }
+ private string _mCUDI0 { get; set; }
+ public string MCUDI1 { get { return _mCUDI1; } set { _mCUDI1 = value; OnPropertyChanged(); } }
+ private string _mCUDI1 { get; set; }
+ public string MCUDI2 { get { return _mCUDI2; } set { _mCUDI2 = value; OnPropertyChanged(); } }
+ private string _mCUDI2 { get; set; }
+ public string MCUDI3 { get { return _mCUDI3; } set { _mCUDI3 = value; OnPropertyChanged(); } }
+ private string _mCUDI3 { get; set; }
+ public string MCUDI4 { get { return _mCUDI4; } set { _mCUDI4 = value; OnPropertyChanged(); } }
+ private string _mCUDI4 { get; set; }
+ public string MCUDI5 { get { return _mCUDI5; } set { _mCUDI5 = value; OnPropertyChanged(); } }
+ private string _mCUDI5 { get; set; }
+ public string MCUDI6 { get { return _mCUDI6; } set { _mCUDI6 = value; OnPropertyChanged(); } }
+ private string _mCUDI6 { get; set; }
+ public string MCUDI7 { get { return _mCUDI7; } set { _mCUDI7 = value; OnPropertyChanged(); } }
+ private string _mCUDI7 { get; set; }
+
+ public RelayCommand Button_MCUOuputCommand { get; set; }
+ public RelayCommand Button_MCUDOuputCommand { get; set; }
+
+ public int MCU_PWM_CH { get { return _choosePWM; } set { _choosePWM = value; OnPropertyChanged(); } }
+ private int _choosePWM = 1;
+ public int PWMInputNumber { get { return _pwmInputNumber; } set { _pwmInputNumber = value; OnPropertyChanged(); } }
+ private int _pwmInputNumber = 1;
+
+ private int[] DICH { get { return _diCH; } set { _diCH = value; OnPropertyChanged(); } }
+ private int[] _diCH = new int[8];
+
+ public int MCU_DO_CH { get { return _mcuDO_CH; } set { _mcuDO_CH = value; OnPropertyChanged(); } }
+ private int _mcuDO_CH = 1;
+ public bool MCU_DO_Value { get { return _mcu_DO_Valuer; } set { _mcu_DO_Valuer = value; OnPropertyChanged(); } }
+ private bool _mcu_DO_Valuer = true;
+
+ private void Button_McuPWMOutput()
+ {
+ string sChoosePWM = Convert.ToString(MCU_PWM_CH + 1);
+ new WriteMcu() { TagName = "ServoControl", Address = sChoosePWM, Value = PWMInputNumber }.Publish();
+ }
+ private void Button_McuDOutput()
+ {
+ string sChooseDO = Convert.ToString(MCU_DO_CH + 1);
+ new WriteMcu() { TagName = "OutputControl", Address = sChooseDO, Value = MCU_DO_Value }.Publish();
+ }
+ #endregion
+ #region 果汁机
+ ///
+ /// 果汁机的连接状态
+ ///
+ public string JuicerConnected { get { return _JuicerConnected; } set { _JuicerConnected = value; OnPropertyChanged(); } }
+ private string _JuicerConnected { get; set; }
+
+ public string JuiceState_Heating { get { return _juiceState_Heating; } set { _juiceState_Heating = value;OnPropertyChanged(); } }
+ public string _juiceState_Heating { get; set; }
+ public string JuiceState_Cooling { get { return _juiceState_Cooling; } set { _juiceState_Cooling = value; OnPropertyChanged(); } }
+ public string _juiceState_Cooling { get; set; }
+ public string JuiceState_LackOfWater { get { return _juiceState_LackOfWater; } set { _juiceState_LackOfWater = value; OnPropertyChanged(); } }
+ public string _juiceState_LackOfWater { get; set; }
+ public string JuiceState_ChildLocks { get { return _juiceState_ChildLocks; } set { _juiceState_ChildLocks = value; OnPropertyChanged(); } }
+ public string _juiceState_ChildLocks { get; set; }
+ public string JuiceState_Using { get { return _juiceState_Using; } set { _juiceState_Using = value; OnPropertyChanged(); } }
+ public string _juiceState_Using { get; set; }
+
+ public string MakeJuice_Index { get { return _makeJuice_Index; } set { _makeJuice_Index = value; OnPropertyChanged(); } }
+ public string _makeJuice_Index { get; set; }
+
+ public RelayCommand Button_MakeJuiceCommand { get; set; }
+
+ public void Button_MakeJuice()
+ {
+ new WriteJuicer() { Value = MakeJuice_Index }.Publish();
+ }
+ #endregion
+ #region 制冰机
+ public string IceMakerConnect { get { return _iceMakerConnect; } set { _iceMakerConnect = value;OnPropertyChanged(); } }
+ private string _iceMakerConnect { get; set; }
+ public string IceMakerState { get { return _iceMakerState; } set { _iceMakerState = value; OnPropertyChanged(); } }
+ private string _iceMakerState { get; set; }
+ public int IceMaker_IceTime { get { return _iceMaker_IceTime; } set { _iceMaker_IceTime = value; OnPropertyChanged(); } }
+ private int _iceMaker_IceTime = 3;
+
+ #region 订单模拟
+ public RelayCommand SimOrderMakeCoffee { get; set; }
+ public RelayCommand SimOrderMakeJuice { get; set; }
+ public RelayCommand SimOrderMakeTea { get; set; }
+ public RelayCommand SimOrderMakeWater { get; set; }
+
+ public int SimOrder_JuiceList { get { return _simOrder_JuiceList; } set { _simOrder_JuiceList = value; OnPropertyChanged(); } }
+ public int _simOrder_JuiceList { get; set; }
+ public string SimOrder_JuiceMakeID { get { return _simOrder_JuiceMakeID; } set { _simOrder_JuiceMakeID = value; OnPropertyChanged(); } }
+ public string _simOrder_JuiceMakeID { get; set; }
+ #endregion
+
+ public RelayCommand IceMaker_BtnPowerOn { get; set; }
+ public RelayCommand IceMaker_BtnStandby { get; set;}
+ public RelayCommand IceMaker_BtnPump { get; set;}
+
+ public RelayCommand IceMaker_BtnStart { get; set; }
+ public RelayCommand IceMaker_BtnEnd { get; set; }
+ public RelayCommand IceMaker_BtnSetIceTime { get; set; }
+
+ private void IceMaker_BtnPowerOnCommand()
+ {
+ new PowerOnMakeIce().Publish();
+ }
+ private void IceMaker_BtnStandbyCommand()
+ {
+ new StandbyMakeIce().Publish();
+ }
+ private void IceMaker_BtnPumpCommand()
+ {
+ new PumpMakeIce().Publish();
+ }
+ private void IceMaker_BtnStartCommand()
+ {
+ new StartMakeIce().Publish();
+ }
+ private void IceMaker_BtnEndCommand()
+ {
+ new StopMakeIce().Publish();
+ }
+ private void IceMaker_BtnSetIceTimeCommand()
+ {
+ new SetIceNumber{ Value= IceMaker_IceTime }.Publish();
+ }
+ #endregion
+ #region 咖啡机
+ ///
+ /// 咖啡机连接状态
+ ///
+ public string CoffeeConnected { get { return _coffeeConnected; } set { _coffeeConnected = value; OnPropertyChanged(); } }
+ private string _coffeeConnected { get; set; }
+ ///
+ /// 咖啡机状态
+ ///
+ public string CoffeeStatus { get { return _coffeeStatus; } set { _coffeeStatus = value; OnPropertyChanged(); } }
+ private string _coffeeStatus { get; set; }
+ ///
+ /// 应用状态
+ ///
+ public string AppStatus { get { return _appStatus; } set { _appStatus = value; OnPropertyChanged(); } }
+ private string _appStatus { get; set; }
+ ///
+ /// 告警
+ ///
+ public string Warning { get { return _warning; } set { _warning = value; OnPropertyChanged(); } }
+ public string _warning { get; set; }
+ ///
+ /// 故障信息
+ ///
+ public string CaffeeFault { get { return _caffeeFault; } set { _caffeeFault = value; OnPropertyChanged(); } }
+ public string _caffeeFault { get; set; }
+
+ public List Coffees { get; set; } = new List();
+ public string SelectedCoffee { get { return _selectedCoffee; } set { _selectedCoffee = value; OnPropertyChanged(); } }
+ public string _selectedCoffee { get; set; }
+
+ public List CoffeeCmds { get; set; } = new List();
+ public string SelectedCoffeeCmd { get; set; }
+
+
+ public string SimOrderCoffeeList { get { return _simOrderCoffeeList; } set { _simOrderCoffeeList = value; OnPropertyChanged(); } }
+ public string _simOrderCoffeeList { get; set; }
+
+ ///
+ /// 制作咖啡
+ ///
+ public RelayCommand Button_MakeCoffeeCommand { get; set; }
+ ///
+ /// 停止制作咖啡
+ ///
+ public RelayCommand Button_StopMakeCoffeCommand { get; set; }
+ ///
+ /// 咖啡模式设置
+ ///
+ public RelayCommand Button_CoffeeModeSetCommand { get; set; }
+
+ private void Button_MakeCoffee()
+ {
+ EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee) });
+ }
+ private void Button_StopMakeCoffe()
+ {
+ EventBus.EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId });
+ }
+ private void Button_CoffeeModeSet()
+ {
+ EventBus.EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd) });
+ }
+
+ #endregion
+ ///
+ /// 设备ID
+ ///
+ public int DeviceId { get; set; }
+ ///
+ /// 设备数据
+ ///
+ public ObservableCollection variableMonitors { get; set; }
+
+ public TestViewModel()
+ {
+ SimOrderMakeCoffee = new RelayCommand(() =>
+ {
+ new MorkTSimOrder() { OrderNum = 1, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SimOrderCoffeeList) }.Publish();
+ });
+ SimOrderMakeJuice = new RelayCommand(() =>
+ {
+ new MorkTSimOrder() { OrderNum = 2, JuiceList = SimOrder_JuiceList, JuiceMakeID = SimOrder_JuiceMakeID }.Publish();
+ });
+ SimOrderMakeTea = new RelayCommand(() =>
+ {
+ new MorkTSimOrder() { OrderNum = 3 }.Publish();
+ });
+ SimOrderMakeWater = new RelayCommand(() =>
+ {
+ new MorkTSimOrder() { OrderNum = 4 }.Publish();
+ });
+ Button_RobotControlCommand = new RelayCommand(Button_RobotControl);
+ Robot_DOutput = new RelayCommand(Button_RobotDoutput);
+
+ Button_MakeCoffeeCommand = new RelayCommand(Button_MakeCoffee);
+ Button_StopMakeCoffeCommand = new RelayCommand(Button_StopMakeCoffe);
+ Button_CoffeeModeSetCommand = new RelayCommand(Button_CoffeeModeSet);
+
+ Button_MCUOuputCommand = new RelayCommand(Button_McuPWMOutput);
+ Button_MCUDOuputCommand = new RelayCommand(Button_McuDOutput);
+
+ Button_MakeJuiceCommand = new RelayCommand(Button_MakeJuice);
+
+ IceMaker_BtnPowerOn = new RelayCommand(IceMaker_BtnPowerOnCommand);
+ IceMaker_BtnStandby = new RelayCommand(IceMaker_BtnStandbyCommand);
+ IceMaker_BtnPump = new RelayCommand(IceMaker_BtnPumpCommand);
+ IceMaker_BtnStart = new RelayCommand(IceMaker_BtnStartCommand);
+ IceMaker_BtnEnd = new RelayCommand(IceMaker_BtnEndCommand);
+ IceMaker_BtnSetIceTime = new RelayCommand(IceMaker_BtnSetIceTimeCommand);
+
+ foreach (DrCoffeeDrinksCode code in Enum.GetValues(typeof(DrCoffeeDrinksCode)))
+ {
+ Coffees.Add(code.ToString());
+ }
+ SelectedCoffee = Coffees[0];
+ SimOrderCoffeeList = Coffees[0];
+ foreach (DrCoffeeCommCmd code in Enum.GetValues(typeof(DrCoffeeCommCmd)))
+ {
+ CoffeeCmds.Add(code.ToString());
+ }
+ SelectedCoffeeCmd = CoffeeCmds[0];
+
+ Plugin.GetInstance()?.GetPlugin()?.GetDevices().ForEach(device =>
+ {
+ if (device.Name == "MorkT") DeviceId = device.DeviceId
+ ;
+ });
+ ThreadManage.GetInstance().StartLong(new Action(() =>
+ {
+ variableMonitors = Plugin.GetInstance()?.GetPlugin()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors;
+ if (variableMonitors != null && variableMonitors.Count > 0)
+ {
+ #region 机器人
+ RobotConnected = variableMonitors.FirstOrDefault(p => p.Notes == "机器人连接状态").CurrentValue == "True" ? "已连接" : "未连接";
+ RobotMode = variableMonitors.FirstOrDefault(p => p.Notes == "机器人状态").CurrentValue;
+ Robot_TCPDI0 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人TCP输入状态").CurrentValue;
+ Robot_DI0 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入0状态").CurrentValue;
+ Robot_DI1 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入1状态").CurrentValue;
+ Robot_DI2 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入2状态").CurrentValue;
+ Robot_DI3 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入3状态").CurrentValue;
+
+ #endregion
+
+ #region 咖啡机
+ CoffeeConnected = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
+ CoffeeStatus = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机状态").CurrentValue;
+ AppStatus = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机应用状态").CurrentValue;
+ Warning = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机告警").CurrentValue;
+ CaffeeFault = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机故障").CurrentValue;
+ #endregion
+
+ #region 单片机
+ MCUConnected = variableMonitors.FirstOrDefault(p => p.Notes == "单片机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
+ MCUDI0 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入0状态").CurrentValue;
+ MCUDI1 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入1状态").CurrentValue;
+ MCUDI2 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入2状态").CurrentValue;
+ MCUDI3 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入3状态").CurrentValue;
+ MCUDI4 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入4状态").CurrentValue;
+ MCUDI5 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入5状态").CurrentValue;
+ MCUDI6 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入6状态").CurrentValue;
+ MCUDI7 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入7状态").CurrentValue;
+ #endregion
+
+ #region 制冰机
+ IceMakerConnect = variableMonitors.FirstOrDefault(p => p.Notes == "制冰机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
+ IceMakerState = variableMonitors.FirstOrDefault(p => p.Notes == "制冰机设备状态").CurrentValue;
+ #endregion
+
+
+ #region 果汁机
+ JuicerConnected = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
+ JuiceState_Heating = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机制热").CurrentValue;
+ JuiceState_Cooling = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机制冷").CurrentValue;
+ JuiceState_LackOfWater = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机缺水").CurrentValue;
+ JuiceState_ChildLocks = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机童锁").CurrentValue;
+ JuiceState_Using = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机使用").CurrentValue;
+
+ #endregion
+ }
+ Thread.Sleep(500);
+ }), "MorkT-状态刷新");
+ }
+ }
+
diff --git a/BPASmartClient.MorkT_Container/Control_MorkT_Container.cs b/BPASmartClient.MorkT_Container/Control_MorkT_Container.cs
index a34ebd62..b51c2cfb 100644
--- a/BPASmartClient.MorkT_Container/Control_MorkT_Container.cs
+++ b/BPASmartClient.MorkT_Container/Control_MorkT_Container.cs
@@ -284,7 +284,7 @@ namespace BPASmartClient.MorkT_Container
Sence(GVL_MorkT.攀华_放杯);
Wait();
- while (!morkTLebaiJC.RobotGetInput0)
+ if (!morkTLebaiJC.RobotGetInput0)
{
DeviceProcessLogShow("咖啡杯未安全放置在放杯位");
}
diff --git a/BPASmartClient.Morkt.JAKA.JC/Control_MORKJC.cs b/BPASmartClient.Morkt.JAKA.JC/Control_MORKJC.cs
index 0bb1e825..d5ec18bd 100644
--- a/BPASmartClient.Morkt.JAKA.JC/Control_MORKJC.cs
+++ b/BPASmartClient.Morkt.JAKA.JC/Control_MORKJC.cs
@@ -386,8 +386,8 @@ namespace BPASmartClient.MorktJAKAJC
if (resultTakeCup == 1)
{
DeviceProcessLogShow("咖啡杯取杯完成");
- new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接咖啡 }.Publish();
- Wait(int.Parse(JakaModel.SENCE_接咖啡));
+ new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_取杯位_接咖啡 }.Publish();
+ Wait(int.Parse(JakaModel.SENCE_取杯位_接咖啡));
new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); //接咖啡控制 //DrCoffeeDrinksCode.热水
are.WaitOne(1000 * 180);
@@ -401,8 +401,8 @@ namespace BPASmartClient.MorktJAKAJC
}
private void PutCoffeeCup()
{
- new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放咖啡杯 }.Publish();
- Wait(int.Parse(JakaModel.SENCE_放咖啡杯));
+ new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接咖啡_放咖啡杯 }.Publish();
+ Wait(int.Parse(JakaModel.SENCE_接咖啡_放咖啡杯));
int resultputCup = putCup();
if (resultputCup == 1)
{
@@ -735,8 +735,8 @@ namespace BPASmartClient.MorktJAKAJC
Thread.Sleep(100);
new WriteJaka() { TagName = "Set_RobotAO1", Value = 0 }.Publish();
Wait(0);
- new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_取杯 }.Publish();
- Wait(int.Parse(JakaModel.SENCE_取杯));
+ new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_取杯位检测_取杯位 }.Publish();
+ Wait(int.Parse(JakaModel.SENCE_取杯位检测_取杯位));
//取杯到位,使用落杯器
new WriteJaka() { TagName = "JakaDOutput", DO_Index = 1, Value = true }.Publish();
if (sensor_Sign(1)==1 )
@@ -768,8 +768,8 @@ namespace BPASmartClient.MorktJAKAJC
Thread.Sleep(100);
new WriteJaka() { TagName = "JakaDOutput", DO_Index = 0, Value = true }.Publish();
Thread.Sleep(100);
- new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_取杯 }.Publish();
- Wait(int.Parse(JakaModel.SENCE_取杯));
+ new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_取杯位检测_取杯位 }.Publish();
+ Wait(int.Parse(JakaModel.SENCE_取杯位检测_取杯位));
getCup_cnt = getCup_cnt + 1;
Thread.Sleep(100);
new WriteJaka() { TagName = "JakaDOutput", DO_Index = 0, Value = false }.Publish();
diff --git a/BPASmartClient.RobotGripper/BPASmartClient.RobotGripper.csproj b/BPASmartClient.RobotGripper/BPASmartClient.RobotGripper.csproj
new file mode 100644
index 00000000..e7b2574f
--- /dev/null
+++ b/BPASmartClient.RobotGripper/BPASmartClient.RobotGripper.csproj
@@ -0,0 +1,15 @@
+
+
+
+ net6.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.RobotGripper/RobotGripperMachine.cs b/BPASmartClient.RobotGripper/RobotGripperMachine.cs
new file mode 100644
index 00000000..7a55e09a
--- /dev/null
+++ b/BPASmartClient.RobotGripper/RobotGripperMachine.cs
@@ -0,0 +1,50 @@
+using System;
+using BPASmartClient.Peripheral;
+using BPASmartClient.SerialPort;
+using BPASmartClient.Model.צ;
+using static BPASmartClient.EventBus.EventBus;
+using BPASmartClient.EventBus;
+
+namespace BPASmartClient.RobotGripper
+{
+ public class RobotGripperMachine:BasePeripheral
+ {
+ RobotGripperHelper machineHelper = new RobotGripperHelper();
+ public override void Init()
+ {
+ machineHelper.Open(communicationPar.SerialPort, communicationPar.BaudRate);
+ EventBus.EventBus.GetInstance().Subscribe(DeviceId,delegate(IEvent @event, EventCallBackHandle callBack)
+ {
+ if (@event == null) return;
+ var par = @event as WriteGripper;
+ switch (par?.TagName)
+ {
+ case "PWMControl":
+ machineHelper.Write(Convert.ToByte(par?.CH_Number), Convert.ToString(par?.PWMOutput));
+ break;
+ default:
+ break;
+ }
+ });
+ }
+ public override void Start()
+ {
+
+ }
+
+ public override void Stop()
+ {
+ machineHelper.Stop(communicationPar.SerialPort);
+ }
+
+ public override void WriteData(string address, object value)
+ {
+
+ }
+
+ protected override void InitStatus()
+ {
+
+ }
+ }
+}
diff --git a/BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1ViewModel.cs b/BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1ViewModel.cs
index 8566b80a..832ee997 100644
--- a/BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1ViewModel.cs
+++ b/BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1ViewModel.cs
@@ -62,7 +62,7 @@ namespace BPASmartClient.ScreenLib
if (Main.GetInstance.mqttDatasDic.ContainsKey(type))
{
ScreenModelSplitMeals modelMaxWok = Main.GetInstance.mqttDatasDic[type] as ScreenModelSplitMeals;
- if (modelMaxWok != null && modelMaxWok.Alarm != null)
+ if (modelMaxWok != null && modelMaxWok.Alarm != null)
modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
ViewData = modelMaxWok;
diff --git a/BPASmartClient.ScreenLib/总监视大屏/ScreenALLControlViewModel.cs b/BPASmartClient.ScreenLib/总监视大屏/ScreenALLControlViewModel.cs
index 7af35177..8b1a29b1 100644
--- a/BPASmartClient.ScreenLib/总监视大屏/ScreenALLControlViewModel.cs
+++ b/BPASmartClient.ScreenLib/总监视大屏/ScreenALLControlViewModel.cs
@@ -236,6 +236,7 @@ namespace BPASmartClient.ScreenLib
string str = JsonConvert.SerializeObject(_Statsall?.OrderByDescending(k => k.Count)?.ToList());
StatsCountAll= JsonConvert.DeserializeObject>(str);
}
+ //假数据
}));
Thread.Sleep(1000);
}), $"{DateTime.Now},线程服务");
diff --git a/BPASmartClient.SerialPort/RobotGripperHelper.cs b/BPASmartClient.SerialPort/RobotGripperHelper.cs
new file mode 100644
index 00000000..9e285a25
--- /dev/null
+++ b/BPASmartClient.SerialPort/RobotGripperHelper.cs
@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.IO;
+using System.IO.Ports;
+using System.Threading;
+using System.Collections.Concurrent;
+using BPASmartClient.Message;
+using BPASmartClient.Helper;
+
+namespace BPASmartClient.SerialPort
+{
+ public class RobotGripperHelper
+ {
+
+ private System.IO.Ports.SerialPort comPort = new System.IO.Ports.SerialPort();
+ public bool IsOpen => comPort.IsOpen;
+
+ public bool Open(string portName, int baudRate)
+ {
+ if (!System.IO.Ports.SerialPort.GetPortNames().Contains(portName))
+ {
+ MessageLog.GetInstance.Show($"{portName} 串口不存在");
+ }
+ if (!comPort.IsOpen)
+ {
+ comPort.PortName = portName;
+ comPort.BaudRate = baudRate;
+ comPort.DataBits = 8;
+ comPort.Parity = Parity.None;
+ comPort.StopBits = StopBits.One;
+ /*comPort.ReadTimeout = 1000;
+ comPort.WriteTimeout = 1000;*/
+ //comPort.RtsEnable = true; //设置为 true后会读取不到数据
+ comPort.DtrEnable = true;//获取或设置一个值,该值在串行通信过程中启用数据终端就绪 (DTR) 信号。
+ //comPort.RtsEnable = true;//获取或设置一个值,该值指示在串行通信中是否启用请求发送 (RTS) 信号
+ try
+ {
+ comPort.Open();
+ }
+ catch (Exception ex)
+ {
+ MessageLog.GetInstance.ShowEx(ex.ToString());
+ }
+ }
+ /* ThreadManage.GetInstance().StartLong(new Action(() =>
+ {
+
+ Thread.Sleep(5000);
+ }), $"开启电爪设备通讯", true);*/
+ MessageLog.GetInstance.Show($"{portName} 串口打开成功");
+ return comPort.IsOpen;
+ }
+ public bool Stop(string portName)
+ {
+ comPort.Close();
+ MessageLog.GetInstance.Show($"{portName} 串口关闭成功");
+ return comPort.IsOpen;
+ }
+ ///
+ /// 舵机控制 #000P1300T1000!
+ ///
+ /// 通道号 0 - 5
+ /// 夹爪幅度 0500 - 2500
+ /// 夹爪时间 0000-9999
+ public void Write(byte index,string value,string time ="1000")
+ {
+ byte[] PwmNumber = Encoding.ASCII.GetBytes(value);
+ byte[] Times = Encoding.ASCII.GetBytes(time);
+ //byte[] buffers = new byte[15] { 0x23, 0x30, 0x30, 0x30, 0x50, PwmNumber[0], PwmNumber[1], PwmNumber[2], PwmNumber[3], 0x54, Times[0], Times[1], Times[2], Times[3], 0x21 };
+ byte[] buffers = new byte[15] { 0x23, 0x30, 0x30, 0x30, 0x50, 0x31, 0x30, 0x35,0x30, 0x54, 0x31,0x30,0x30,0x30, 0x21 };
+ if (IsOpen) comPort.Write(buffers, 0, buffers.Length);
+ }
+ }
+}
diff --git a/DosingSystem/App.xaml.cs b/DosingSystem/App.xaml.cs
index b051e05c..292ba878 100644
--- a/DosingSystem/App.xaml.cs
+++ b/DosingSystem/App.xaml.cs
@@ -56,7 +56,7 @@ namespace BPASmartClient.DosingSystem
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
- Json.Save();
+ Json.Save();
Json.Save();
Json.Save();
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.LogSave();
@@ -290,7 +290,7 @@ namespace BPASmartClient.DosingSystem
private void DataInit()
{
//Config.GetInstance.Init();
- Json.Read();
+ Json.Read();
Json.Read();
Json.Read();
}
diff --git a/DosingSystem/Model/DeviceInquire.cs b/DosingSystem/Model/DeviceInquire.cs
index bcd7e89b..cdbe12db 100644
--- a/DosingSystem/Model/DeviceInquire.cs
+++ b/DosingSystem/Model/DeviceInquire.cs
@@ -177,12 +177,13 @@ namespace BPASmartClient.DosingSystem
Ping myPing = new Ping();
myPing.PingCompleted += new PingCompletedEventHandler(_myPing_PingCompleted);
myPing.SendAsync(item, 1000, null);
+
});
}
private void _myPing_PingCompleted(object sender, PingCompletedEventArgs e)
{
- if (e.Reply.Status == IPStatus.Success)
+ if (e.Reply != null && e.Reply.Status == IPStatus.Success)
{
string ip = e.Reply.Address.ToString();
if (!DeviceLists.ContainsKey(ip))
@@ -208,13 +209,13 @@ namespace BPASmartClient.DosingSystem
BottomDeviceCurrentStatuses.Add(new DeviceCurrentStatus() { DeviceName = DeviceName });
- for (int i = 0; i < Json.Data.Recipes.Count; i++)
+ for (int i = 0; i < Json.Data.Recipes.Count; i++)
{
- for (int m = 0; m < Json.Data.Recipes.ElementAt(i).RawMaterials.Count; m++)
+ for (int m = 0; m < Json.Data.Recipes.ElementAt(i).RawMaterials.Count; m++)
{
- if (Json.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp == ip)
+ if (Json.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp == ip)
{
- Json.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName;
+ Json.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName;
}
}
}
@@ -278,7 +279,11 @@ namespace BPASmartClient.DosingSystem
}
else IPQueues.Enqueue(e.Reply.Address.ToString());
}
- else IPQueues.Enqueue(e.Reply.Address.ToString());
+ else
+ {
+ if(e.Reply !=null)
+ IPQueues.Enqueue(e.Reply.Address.ToString());
+ }
}
}
diff --git a/DosingSystem/Model/par/LocaPar.cs b/DosingSystem/Model/par/LocalRecipe.cs
similarity index 93%
rename from DosingSystem/Model/par/LocaPar.cs
rename to DosingSystem/Model/par/LocalRecipe.cs
index 992f898f..8b5cc4ae 100644
--- a/DosingSystem/Model/par/LocaPar.cs
+++ b/DosingSystem/Model/par/LocalRecipe.cs
@@ -9,7 +9,7 @@ using BPASmartClient.Model;
namespace BPASmartClient.DosingSystem
{
- public class LocaPar
+ public class LocalRecipe
{
public ObservableCollection Recipes { get; set; } = new ObservableCollection();
diff --git a/DosingSystem/View/NewRecipeView.xaml.cs b/DosingSystem/View/NewRecipeView.xaml.cs
index 4e8e1be4..b2d9eefa 100644
--- a/DosingSystem/View/NewRecipeView.xaml.cs
+++ b/DosingSystem/View/NewRecipeView.xaml.cs
@@ -26,7 +26,7 @@ namespace BPASmartClient.DosingSystem.View
this.btClose.Click += (o, e) => { this.Close(); };
this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); };
ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "CloseNewRecipeView", true);
- this.Unloaded += (o, s) => { Json.Save(); };
+ this.Unloaded += (o, s) => { Json.Save(); };
}
private void cb_SelectionChanged(object sender, SelectionChangedEventArgs e)
diff --git a/DosingSystem/View/RecipeSettingsView.xaml.cs b/DosingSystem/View/RecipeSettingsView.xaml.cs
index 55bf6e65..fe2f5a1d 100644
--- a/DosingSystem/View/RecipeSettingsView.xaml.cs
+++ b/DosingSystem/View/RecipeSettingsView.xaml.cs
@@ -30,7 +30,7 @@ namespace BPASmartClient.DosingSystem.View
private void RecipeSettingsView_Unloaded(object sender, RoutedEventArgs e)
{
- Json.Save();
+ Json.Save();
}
//public static void SetAlignment()
diff --git a/DosingSystem/ViewModel/ChangeDeviceNameViewModel.cs b/DosingSystem/ViewModel/ChangeDeviceNameViewModel.cs
index c5a76db4..614de6ed 100644
--- a/DosingSystem/ViewModel/ChangeDeviceNameViewModel.cs
+++ b/DosingSystem/ViewModel/ChangeDeviceNameViewModel.cs
@@ -38,11 +38,11 @@ namespace BPASmartClient.DosingSystem.ViewModel
res.RawMaterialName = DeviceName;
DeviceInquire.GetInstance.devices.ElementAt(index).DeviceName = DeviceName;
DeviceInquire.GetInstance.GetDevice(IpAddress).SetDeviceName(DeviceName);//设置PLC名称
- for (int i = 0; i < Json.Data.Recipes.Count; i++)
+ for (int i = 0; i < Json.Data.Recipes.Count; i++)
{
- for (int m = 0; m < Json.Data.Recipes.ElementAt(i).RawMaterials.Count; m++)
+ for (int m = 0; m < Json.Data.Recipes.ElementAt(i).RawMaterials.Count; m++)
{
- Json.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName;
+ Json.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName;
}
}
ActionManage.GetInstance.Send("ChangeDeviceNameViewClose");
diff --git a/DosingSystem/ViewModel/NewRecipeViewModel.cs b/DosingSystem/ViewModel/NewRecipeViewModel.cs
index cb6f474b..54da0130 100644
--- a/DosingSystem/ViewModel/NewRecipeViewModel.cs
+++ b/DosingSystem/ViewModel/NewRecipeViewModel.cs
@@ -37,7 +37,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
RawMaterials.Add(item);
}
RecipCode = rm.RecipCode;
- Index = Array.FindIndex(Json.Data.Recipes.ToArray(), p => p.RecipeName == RecipeName);
+ Index = Array.FindIndex(Json.Data.Recipes.ToArray(), p => p.RecipeName == RecipeName);
}
}), "Details", true);
@@ -82,17 +82,17 @@ namespace BPASmartClient.DosingSystem.ViewModel
}
//编辑配方
- if (Index >= 0 && Index < Json.Data.Recipes.Count)
+ if (Index >= 0 && Index < Json.Data.Recipes.Count)
{
- var res = Array.FindIndex(Json.Data.Recipes.ToArray(), p => p.RecipeName == RecipeName);
+ var res = Array.FindIndex(Json.Data.Recipes.ToArray(), p => p.RecipeName == RecipeName);
if (res >= 0 && res != Index)
{
ErrorInfo = "配方名称已经存在!";
MessageNotify.GetInstance.ShowDialog("配方名称已经存在!", DialogType.Warning);
return;
}
- Json.Data.Recipes.ElementAt(Index).RecipeName = RecipeName;
- Json.Data.Recipes.ElementAt(Index).RawMaterials.Clear();
+ Json.Data.Recipes.ElementAt(Index).RecipeName = RecipeName;
+ Json.Data.Recipes.ElementAt(Index).RawMaterials.Clear();
RawMaterials.ToList()?.ForEach(item =>
{
var res = DeviceInquire.GetInstance.devices.FirstOrDefault(p => p.DeviceName == item.RawMaterialName);
@@ -105,14 +105,14 @@ namespace BPASmartClient.DosingSystem.ViewModel
{
item.RawMaterialSource = 0;
}
- Json.Data.Recipes.ElementAt(Index).RawMaterials.Add(item);
+ Json.Data.Recipes.ElementAt(Index).RawMaterials.Add(item);
});
- Json.Save();
+ Json.Save();
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"{RecipeName} 配方编辑完成");
}
else //新建配方
{
- if (Json.Data.Recipes.FirstOrDefault(p => p.RecipeName == RecipeName) != null)
+ if (Json.Data.Recipes.FirstOrDefault(p => p.RecipeName == RecipeName) != null)
{
ErrorInfo = "配方名称已存在!";
MessageNotify.GetInstance.ShowDialog("配方名称已经存在!", DialogType.Warning);
@@ -133,12 +133,12 @@ namespace BPASmartClient.DosingSystem.ViewModel
}
TempRawMaterials.Add(item);
});
- Json.Data.Recipes.Add(new RecipeModel()
+ Json.Data.Recipes.Add(new RecipeModel()
{
RecipeName = RecipeName,
RawMaterials = TempRawMaterials,
});
- Json.Save();
+ Json.Save();
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"新建配方成功!");
}
ActionManage.GetInstance.Send("CloseNewRecipeView");
@@ -177,9 +177,9 @@ namespace BPASmartClient.DosingSystem.ViewModel
var dates = date.Split("-").ToList();
StringBuilder sb = new StringBuilder();
dates?.ForEach((item) => { sb.Append(item); });
- Json.Data.Recipes.Add(new RecipeModel()
+ Json.Data.Recipes.Add(new RecipeModel()
{
- SerialNum = Json.Data.Recipes.Count + 1,
+ SerialNum = Json.Data.Recipes.Count + 1,
RawMaterials = RawMaterials,
RecipCode = sb.ToString(),
RecipeName = RecipeName,
diff --git a/DosingSystem/ViewModel/RecipeControlViewModel.cs b/DosingSystem/ViewModel/RecipeControlViewModel.cs
index 0198a7da..41efb490 100644
--- a/DosingSystem/ViewModel/RecipeControlViewModel.cs
+++ b/DosingSystem/ViewModel/RecipeControlViewModel.cs
@@ -45,7 +45,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
await Task.Factory.StartNew(new Action(() =>
{
Recipes.ElementAt(index).IsEnable = true;
- Json.Data.Recipes.ElementAt(index).IsEnable = true;
+ Json.Data.Recipes.ElementAt(index).IsEnable = true;
Recipes.ElementAt(index).Are.Set();
App.Current.Dispatcher.Invoke(new Action(() => { recipeProcesses.Clear(); }));
SiemensDevice.GetInstance.MySiemens.Write("M10.5", true);
@@ -89,7 +89,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
}
Recipes.ElementAt(index).IsEnable = false;
- Json.Data.Recipes.ElementAt(index).IsEnable = false;
+ Json.Data.Recipes.ElementAt(index).IsEnable = false;
}
MessageNotify.GetInstance.ShowUserLog($"下发工单 {Recipes.ElementAt(index).RecipeName}");
RecipeNames.Enqueue(deviceName);
@@ -124,7 +124,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
#region 配方下发到PLC操作相关
//配方数据写入到输送机
- var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeName == CurrentRecipeName);
+ var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeName == CurrentRecipeName);
/*List recipeData = new List();*/
List BarrelNum = new List();
if (res != null)
@@ -574,7 +574,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
else
{
int a1 = Array.FindIndex(DeviceInquire.GetInstance.devices.ToArray(), p => p.DeviceNum == cnt);
- Location1 = Array.FindIndex(Recipes.ElementAt(i).RawMaterials.ToArray(), p => p.RawMaterialName == DeviceInquire.GetInstance.devices.ElementAt(a1).DeviceName && p.Loc == barrel);
+ Location1 = Array.FindIndex(Recipes.ElementAt(i).RawMaterials.ToArray(), p => p.RawMaterialName == DeviceInquire.GetInstance.devices.ElementAt(a1).DeviceName && p.Loc == barrel);
}
if (Location1 >= 0)
{
@@ -654,7 +654,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
int recipIndex = Array.FindIndex(Recipes.ToArray(), p => p.RecipeName == CurrentRecipeName);
App.Current.Dispatcher.Invoke(new Action(() => { recipeProcesses.Clear(); }));
Recipes.ElementAt(recipIndex).IsEnable = true;
- Json.Data.Recipes.ElementAt(recipIndex).IsEnable = true;
+ Json.Data.Recipes.ElementAt(recipIndex).IsEnable = true;
Recipes.ElementAt(recipIndex).Are.Set();
Thread.Sleep(100);
}
@@ -672,7 +672,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
public BPARelayCommand CancelRecipeCommand { get; set; }
- public static ObservableCollection Recipes { get; set; } = Json.Data.Recipes;
+ public static ObservableCollection Recipes { get; set; } = Json.Data.Recipes;
public static string CurrentRecipeName { get { return _RecipeName; } set { _RecipeName = value; OnStaticPropertyChanged(); } }
private static string _RecipeName;
diff --git a/DosingSystem/ViewModel/RecipeSettingsViewModel.cs b/DosingSystem/ViewModel/RecipeSettingsViewModel.cs
index 903a0212..7e97422b 100644
--- a/DosingSystem/ViewModel/RecipeSettingsViewModel.cs
+++ b/DosingSystem/ViewModel/RecipeSettingsViewModel.cs
@@ -24,7 +24,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
{
public RecipeSettingsViewModel()
{
- Recipes = Json.Data.Recipes;
+ Recipes = Json.Data.Recipes;
NewMaterital = new BPARelayCommand(() =>
{
@@ -39,7 +39,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
});
SaveRecipe = new BPARelayCommand(() =>
{
- Json.Save();
+ Json.Save();
MessageNotify.GetInstance.ShowUserLog("保存配方");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方保存成功!");
});
@@ -49,11 +49,11 @@ namespace BPASmartClient.DosingSystem.ViewModel
{
if (MessageNotify.GetInstance.ShowDialog($"是否删除【{o.ToString()}】配方,删除后数据将永久丢失!无法找回", DialogType.Warning))
{
- var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeName == o.ToString());
+ var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeName == o.ToString());
if (res.IsEnable)
{
- if (res != null) Json.Data.Recipes.Remove(res);
- Json.Save();
+ if (res != null) Json.Data.Recipes.Remove(res);
+ Json.Save();
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方删除成功!");
MessageNotify.GetInstance.ShowUserLog($"删除配方 {res.RecipeName}");
}
@@ -69,7 +69,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
{
if (!string.IsNullOrEmpty(o?.ToString()))
{
- var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeName == o.ToString());
+ var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeName == o.ToString());
if (res != null)
{
NewRecipeView nrv = new NewRecipeView();
diff --git a/SmartClient.sln b/SmartClient.sln
index 2dd4ef5d..f075fdb1 100644
--- a/SmartClient.sln
+++ b/SmartClient.sln
@@ -202,7 +202,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DosingSystem
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "设备监控", "设备监控", "{106E84C1-CAC5-4F14-9E31-201D3202C9FD}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MaxWokControl", "BPASmartClient.MaxWokControl\BPASmartClient.MaxWokControl.csproj", "{888382C0-6750-4E81-BED3-0F38775DCCCB}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MaxWokControl", "BPASmartClient.MaxWokControl\BPASmartClient.MaxWokControl.csproj", "{888382C0-6750-4E81-BED3-0F38775DCCCB}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkS3", "BPASmartClient.MorkS3\BPASmartClient.MorkS3.csproj", "{B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.RobotGripper", "BPASmartClient.RobotGripper\BPASmartClient.RobotGripper.csproj", "{5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MilkTeaCube", "BPASmartClient.MilkTeaCube\BPASmartClient.MilkTeaCube.csproj", "{915F0718-B7AC-428D-ACD5-7DAACC28539F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1898,6 +1904,66 @@ Global
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|x64.Build.0 = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|x86.ActiveCfg = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|x86.Build.0 = Release|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Debug|ARM.Build.0 = Debug|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Debug|x64.Build.0 = Debug|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Debug|x86.Build.0 = Debug|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Release|ARM.ActiveCfg = Release|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Release|ARM.Build.0 = Release|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Release|ARM64.Build.0 = Release|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Release|x64.ActiveCfg = Release|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Release|x64.Build.0 = Release|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Release|x86.ActiveCfg = Release|Any CPU
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}.Release|x86.Build.0 = Release|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Debug|ARM.Build.0 = Debug|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Debug|x64.Build.0 = Debug|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Debug|x86.Build.0 = Debug|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Release|ARM.ActiveCfg = Release|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Release|ARM.Build.0 = Release|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Release|ARM64.Build.0 = Release|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Release|x64.ActiveCfg = Release|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Release|x64.Build.0 = Release|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Release|x86.ActiveCfg = Release|Any CPU
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}.Release|x86.Build.0 = Release|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Debug|ARM.Build.0 = Debug|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Debug|x64.Build.0 = Debug|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Debug|x86.Build.0 = Debug|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Release|ARM.ActiveCfg = Release|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Release|ARM.Build.0 = Release|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Release|ARM64.Build.0 = Release|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Release|x64.ActiveCfg = Release|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Release|x64.Build.0 = Release|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Release|x86.ActiveCfg = Release|Any CPU
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1992,6 +2058,9 @@ Global
{B79914B9-3A81-426B-88FF-8ABAF5C92AB5} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{106E84C1-CAC5-4F14-9E31-201D3202C9FD} = {7BE13E55-D8B1-4232-AE63-8BF122633297}
{888382C0-6750-4E81-BED3-0F38775DCCCB} = {106E84C1-CAC5-4F14-9E31-201D3202C9FD}
+ {B38F72AE-3C15-4C4E-A47E-DB2B9B318F02} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
+ {5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
+ {915F0718-B7AC-428D-ACD5-7DAACC28539F} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}