diff --git a/BPASmart.ConfigurationSoftware/BPASmart.ConfigurationSoftware.csproj b/BPASmart.ConfigurationSoftware/BPASmart.ConfigurationSoftware.csproj
index 190af161..f442881c 100644
--- a/BPASmart.ConfigurationSoftware/BPASmart.ConfigurationSoftware.csproj
+++ b/BPASmart.ConfigurationSoftware/BPASmart.ConfigurationSoftware.csproj
@@ -20,7 +20,7 @@
-
+
diff --git a/BPASmart.PageLoad/BPASmart.PageLoad.csproj b/BPASmart.PageLoad/BPASmart.PageLoad.csproj
index 729ab884..53196873 100644
--- a/BPASmart.PageLoad/BPASmart.PageLoad.csproj
+++ b/BPASmart.PageLoad/BPASmart.PageLoad.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/BPASmart.Server/BPASmart.Server.csproj b/BPASmart.Server/BPASmart.Server.csproj
index ce7c3363..c47c5a34 100644
--- a/BPASmart.Server/BPASmart.Server.csproj
+++ b/BPASmart.Server/BPASmart.Server.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/BPASmart.VariableManager/BPASmart.VariableManager.csproj b/BPASmart.VariableManager/BPASmart.VariableManager.csproj
index c633d45b..caac5a94 100644
--- a/BPASmart.VariableManager/BPASmart.VariableManager.csproj
+++ b/BPASmart.VariableManager/BPASmart.VariableManager.csproj
@@ -30,7 +30,7 @@
-
+
diff --git a/BPASmartClient.Business/BPASmartClient.Business.csproj b/BPASmartClient.Business/BPASmartClient.Business.csproj
index 25dfbd1c..0d77ddd4 100644
--- a/BPASmartClient.Business/BPASmartClient.Business.csproj
+++ b/BPASmartClient.Business/BPASmartClient.Business.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
index 609d0a2a..86047719 100644
--- a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
+++ b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
@@ -409,7 +409,7 @@
-
+
diff --git a/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs b/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
index f0688f09..4e15c59e 100644
--- a/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
@@ -81,7 +81,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
catch (Exception)
{
- // throw;
+ // throw;
}
}
}
@@ -109,34 +109,40 @@ namespace BPASmartClient.CustomResource.Pages.Model
public bool ShowDialog(string info, DialogType dialogType = DialogType.Information)
{
- PromptView PV = new PromptView();
- PV.TextBlockInfo = info;
- switch (dialogType)
+ bool result = false;
+ Application.Current.Dispatcher.Invoke(() =>
{
- case DialogType.Warning:
- PV.TextBlockIcon = "";
- PV.TextBlockForeground = Brushes.Yellow;
- PV.infoType.Text = "警告:";
- //PV.Cancel.Visibility = Visibility.Collapsed;
- break;
- case DialogType.Error:
- PV.TextBlockIcon = "";
- PV.TextBlockForeground = Brushes.Red;
- PV.infoType.Text = "错误:";
- //PV.Cancel.Visibility = Visibility.Collapsed;
- break;
- case DialogType.Information:
- PV.TextBlockIcon = "";
- PV.TextBlockForeground = Brushes.DeepSkyBlue;
- PV.infoType.Text = "提示:";
- //PV.Cancel.Visibility = Visibility.Visible;
- break;
- default:
- break;
- }
- PV.infoType.Foreground = PV.TextBlockForeground;
- var res = PV.ShowDialog();
- return res == null ? false : (bool)res;
+ PromptView PV = new PromptView();
+ PV.TextBlockInfo = info;
+ switch (dialogType)
+ {
+ case DialogType.Warning:
+ PV.TextBlockIcon = "";
+ PV.TextBlockForeground = Brushes.Yellow;
+ PV.infoType.Text = "警告:";
+ //PV.Cancel.Visibility = Visibility.Collapsed;
+ break;
+ case DialogType.Error:
+ PV.TextBlockIcon = "";
+ PV.TextBlockForeground = Brushes.Red;
+ PV.infoType.Text = "错误:";
+ //PV.Cancel.Visibility = Visibility.Collapsed;
+ break;
+ case DialogType.Information:
+ PV.TextBlockIcon = "";
+ PV.TextBlockForeground = Brushes.DeepSkyBlue;
+ PV.infoType.Text = "提示:";
+ //PV.Cancel.Visibility = Visibility.Visible;
+ break;
+ default:
+ break;
+ }
+ PV.infoType.Foreground = PV.TextBlockForeground;
+
+ var res = PV.ShowDialog();
+ result = res == null ? false : (bool)res;
+ });
+ return result;
}
}
diff --git a/BPASmartClient.CustomResource/UserControls/ConveyBelt2.xaml b/BPASmartClient.CustomResource/UserControls/ConveyBelt2.xaml
index 79e65167..55ea5e43 100644
--- a/BPASmartClient.CustomResource/UserControls/ConveyBelt2.xaml
+++ b/BPASmartClient.CustomResource/UserControls/ConveyBelt2.xaml
@@ -83,7 +83,7 @@
Duration="0:0:20" />
-
+
@@ -96,6 +96,7 @@
Duration="0:0:20" />
+
100)
{
pathFigure.StartPoint = new Point(0, 35 + (BeltHeight - 100) / 2);
- pathFigure.Segments.Add(new LineSegment(new Point(BeltWidth - 10, 35 + (BeltHeight - 100)/2), true));
+ pathFigure.Segments.Add(new LineSegment(new Point(BeltWidth - 10, 35 + (BeltHeight - 100) / 2), true));
}
else
{
@@ -74,7 +89,7 @@ namespace BPASmartClient.CustomResource.UserControls
{
this.recDown.Margin = new Thickness(0, BeltHeight - 20, 0, 0);
}
- else
+ else
{
this.recDown.Margin = new Thickness(0, 80, 0, 0);
}
@@ -115,15 +130,29 @@ namespace BPASmartClient.CustomResource.UserControls
private static void OnDirectionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
-
- if ((d as ConveyBelt2)?.BeltDirection == 0)
- {
- VisualStateManager.GoToState(d as ConveyBelt2, "RightState", false);
- }
- else
+ string status = "Stop";
+ if ((d as ConveyBelt2).IsRun)
{
- VisualStateManager.GoToState(d as ConveyBelt2, "LeftState", false);
+ if ((d as ConveyBelt2)?.BeltDirection == 0)
+ {
+ VisualStateManager.GoToState(d as ConveyBelt2, "RightState", false);
+ return;
+ }
+ else
+ {
+ VisualStateManager.GoToState(d as ConveyBelt2, "LeftState", false);
+ return;
+ }
}
+ VisualStateManager.GoToState(d as ConveyBelt2, status, false);
+ //if ((d as ConveyBelt2)?.BeltDirection == 0)
+ //{
+ // VisualStateManager.GoToState(d as ConveyBelt2, "RightState", false);
+ //}
+ //else
+ //{
+ // VisualStateManager.GoToState(d as ConveyBelt2, "LeftState", false);
+ //}
}
}
diff --git a/BPASmartClient.DosingSystemSingle/App.xaml b/BPASmartClient.DosingSystemSingle/App.xaml
index 7fb508f6..49315c62 100644
--- a/BPASmartClient.DosingSystemSingle/App.xaml
+++ b/BPASmartClient.DosingSystemSingle/App.xaml
@@ -1,4 +1,5 @@
-
-
+
diff --git a/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs b/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs
index a35d57c1..090121ed 100644
--- a/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs
+++ b/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs
@@ -170,7 +170,8 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
///
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料
///
- public int RecipeStatusIDTray2 { get; set; } = 0;
+ public int[] RecipeProcessStatus { get; set; } = new int[5] { 0, 0, 0, 0, 0 };
+
[VarComm("Global", "当前配方正在配料位置")]
///
diff --git a/BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKDeviceStatus.cs b/BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKDeviceStatus.cs
index f03fda0e..f90bd07f 100644
--- a/BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKDeviceStatus.cs
+++ b/BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKDeviceStatus.cs
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
using BPASmartClient.S7Net;
using BPASmartClient.CustomResource.Pages.Model;
using System.Threading;
+using System.Collections.ObjectModel;
namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
@@ -188,5 +189,41 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
}
}
}
+
+ public void IssueRecipeToPlc(ObservableCollection rawMaterials,int recipeLoction)
+ {
+ if (IsConnected)
+ {
+ ushort barrel1 = 0;
+ ushort barrel2 = 0;
+ ushort barrel3 = 0;
+ foreach (var item in rawMaterials)
+ {
+ switch (item.RawMaterialBarrelNum)
+ {
+ case 1:
+ barrel1 = barrel1.SetBitValue((byte)item.RawMaterialLocation, true);
+ break;
+ case 2:
+ barrel2 = barrel2.SetBitValue((byte)item.RawMaterialLocation, true);
+ break;
+ case 3:
+ barrel3 = barrel3.SetBitValue((byte)item.RawMaterialLocation, true);
+ break;
+ default:
+ break;
+ }
+ }
+ string AddresBarrel1 = "DB4.DBW" + (12 + (recipeLoction - 1) * 6);
+ string AddresBarrel2 = "DB4.DBW" + (14 + (recipeLoction - 1) * 6);
+ string AddresBarrel3 = "DB4.DBW" + (16 + (recipeLoction - 1) * 6);
+ HK_PLC_S7.Write(AddresBarrel1, barrel1);
+ HK_PLC_S7.Write(AddresBarrel2, barrel2);
+ HK_PLC_S7.Write(AddresBarrel3, barrel3);
+ MessageNotify.GetInstance.ShowRunLog($"配方下发,plc配方位置{recipeLoction},桶1料仓配料{barrel1.ToBinString}");
+ MessageNotify.GetInstance.ShowRunLog($"配方下发,plc配方位置{recipeLoction},桶2料仓配料{barrel1.ToBinString}");
+ MessageNotify.GetInstance.ShowRunLog($"配方下发,plc配方位置{recipeLoction},桶3料仓配料{barrel1.ToBinString}");
+ }
+ }
}
-}
+}
\ No newline at end of file
diff --git a/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs b/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs
index 258093e6..863094fb 100644
--- a/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs
+++ b/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs
@@ -38,8 +38,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
/// 配方队列
///
public ConcurrentQueue RecipeQueueTray1 = new ConcurrentQueue();
+
public ConcurrentQueue RecipeQueueTray2 = new ConcurrentQueue();
+
+
public SiemensDeviceStatus SiemensDevice = new SiemensDeviceStatus();
public HKDeviceStatus HKDevice = new HKDeviceStatus();
public WindSendDeviceStatus WindSendDevice = new WindSendDeviceStatus();
diff --git a/BPASmartClient.JakaRobot/JaKaHelper.cs b/BPASmartClient.JakaRobot/JaKaHelper.cs
index 85c0ce2f..046ccc43 100644
--- a/BPASmartClient.JakaRobot/JaKaHelper.cs
+++ b/BPASmartClient.JakaRobot/JaKaHelper.cs
@@ -1,5 +1,7 @@
using BPASmartClient.Helper;
using BPASmartClient.Message;
+using System.Net;
+using System.Net.NetworkInformation;
using System.Text;
namespace BPASmartClient.JakaRobot
@@ -60,7 +62,7 @@ namespace BPASmartClient.JakaRobot
//public const string SENCE_初始位 = "20000";
#endregion
- private int rshd = -1;
+ public int rshd = -1;
private bool login = false;
///
@@ -74,49 +76,124 @@ namespace BPASmartClient.JakaRobot
public bool IsIdle { get; set; } = false;
public bool IsConnected { get { return login; } }
public bool IsDeviceFirstInit { get; set; }
+ private string IpAddress { get; set; }
+ private bool IsPingOk { get; set; }
+
+ public void Conn(string ip)
+ {
+ jakaAPI.create_handler(ip.ToCharArray(), ref rshd);
+ login = true;
+ }
public void Connect(string ip)
{
- bool ErrorFlag = false;
- ThreadManage.GetInstance().StartLong(new Action(() =>
+ MessageLog.GetInstance.Show("节卡机器人连接中。。。。。");
+ IpAddress = ip;
+ Task.Factory.StartNew(() =>
{
- if (rshd == -1 || login == false)
+ while (!IsPingOk)
{
- try
- {
- jakaAPI.create_handler(ip.ToCharArray(), ref rshd);
- login = true;
- }
- catch (Exception ex)
- {
- if (!ErrorFlag)
- {
- MessageLog.GetInstance.ShowEx(ex.ToString());
- ErrorFlag = true;
- login = false;
- }
- Thread.Sleep(3000);
- }
+ Ping myPing = new Ping();
+ myPing.PingCompleted += new PingCompletedEventHandler(_myPing_PingCompleted);
+ myPing.SendAsync(IpAddress, 1000, null);
+ Thread.Sleep(3000);
}
- if (login && IsDeviceFirstInit==false)
+ });
+
+
+ //bool ErrorFlag = false;
+ //ThreadManage.GetInstance().StartLong(new Action(() =>
+ //{
+ // if (rshd == -1 || login == false)
+ // {
+ // try
+ // {
+ // jakaAPI.create_handler(ip.ToCharArray(), ref rshd);
+ // login = true;
+ // }
+ // catch (Exception ex)
+ // {
+ // if (!ErrorFlag)
+ // {
+ // MessageLog.GetInstance.ShowEx(ex.ToString());
+ // ErrorFlag = true;
+ // login = false;
+ // }
+ // Thread.Sleep(3000);
+ // }
+ // }
+ // if (login && IsDeviceFirstInit == false)
+ // {
+ // try
+ // {
+ // Power_On();//打开机器人电源
+ // Thread.Sleep(1000);
+ // Enable_robot();//机器人上使能
+ // IsDeviceFirstInit = true;
+ // MessageLog.GetInstance.Show("机器人已上电使能");
+ // }
+ // catch (Exception ex)
+ // {
+ // MessageLog.GetInstance.ShowEx("机器人未完成上电和使能");
+ // }
+ // }
+ // Thread.Sleep(5000);
+ //}), $"节卡机器人连接", true);
+
+ }
+
+ private void _myPing_PingCompleted(object sender, PingCompletedEventArgs e)
+ {
+ if (e.Reply != null && e.Reply.Status == IPStatus.Success)
+ {
+ IsPingOk = true;
+ MessageLog.GetInstance.Show("节卡机器人物理网络准备就绪");
+ Thread.Sleep(3000);
+ bool ErrorFlag = false;
+ ThreadManage.GetInstance().StartLong(new Action(() =>
{
- try
+ if (rshd == -1 || login == false)
{
- Power_On();//打开机器人电源
- Thread.Sleep(1000);
- Enable_robot();//机器人上使能
- IsDeviceFirstInit = true;
- MessageLog.GetInstance.Show("机器人已上电使能");
+ try
+ {
+ int result = jakaAPI.create_handler(IpAddress.ToCharArray(), ref rshd);
+ login = true;
+ MessageLog.GetInstance.Show($"节卡机器人创建连接成功,句柄:{rshd},返回值:{result}");
+ }
+ catch (Exception ex)
+ {
+ if (!ErrorFlag)
+ {
+ MessageLog.GetInstance.ShowEx(ex.ToString());
+ ErrorFlag = true;
+ login = false;
+ }
+ Thread.Sleep(3000);
+ }
}
- catch (Exception ex)
+ if (login && IsDeviceFirstInit == false)
{
- MessageLog.GetInstance.ShowEx("机器人未完成上电和使能");
+ try
+ {
+ MessageLog.GetInstance.Show("节卡机器人打开电源准备");
+ Thread.Sleep(2000);
+ Power_On();//打开机器人电源
+ Thread.Sleep(1000);
+ MessageLog.GetInstance.Show("节卡机器人上使能准备");
+ Enable_robot();//机器人上使能
+ IsDeviceFirstInit = true;
+ MessageLog.GetInstance.Show("机器人已上电使能");
+ }
+ catch (Exception ex)
+ {
+ MessageLog.GetInstance.ShowEx("机器人未完成上电和使能");
+ }
}
- }
- Thread.Sleep(5000);
- }), $"节卡机器人连接", true);
-
+ Thread.Sleep(5000);
+ }), $"节卡机器人连接", true);
+ }
}
+
public void Power_On()
{
if (login)
@@ -129,10 +206,10 @@ namespace BPASmartClient.JakaRobot
{
MessageLog.GetInstance.ShowEx(ave.ToString());
}
- //catch (Exception ex)
- //{
- // MessageLog.GetInstance.ShowEx(ex.ToString());
- //}
+ catch (Exception ex)
+ {
+ MessageLog.GetInstance.ShowEx(ex.ToString());
+ }
}
else
{
@@ -324,8 +401,8 @@ namespace BPASmartClient.JakaRobot
{
try
{
- //加载
- p: file = Programname.ToCharArray();
+ //加载
+ p: file = Programname.ToCharArray();
MessageLog.GetInstance.Show($"调用文件名:{Programname}");
status = new JKTYPE.ProgramState();
jakaAPI.get_program_state(ref rshd, ref status);
diff --git a/BPASmartClient.Model/GlobalFoodMenu.cs b/BPASmartClient.Model/GlobalFoodMenu.cs
deleted file mode 100644
index 73bdd544..00000000
--- a/BPASmartClient.Model/GlobalFoodMenu.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace BPASmartClient.Model
-{
- public class GlobalFoodMenu
- {
- public static ObservableCollection LocalFoodMenus = new ObservableCollection();
- }
-}
diff --git a/BPASmartClient.Model/小炒机/MaterialAndFryingTime.cs b/BPASmartClient.Model/小炒机/MaterialAndFryingTime.cs
new file mode 100644
index 00000000..dba43182
--- /dev/null
+++ b/BPASmartClient.Model/小炒机/MaterialAndFryingTime.cs
@@ -0,0 +1,15 @@
+using BPA.Models;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.Model.小炒机
+{
+ public class MaterialAndFryingTime
+ {
+ public Dictionary> materials { get; set; } = new Dictionary>();
+ }
+}
diff --git a/BPASmartClient.MorkBF/BPASmartClient.MorkBF.csproj b/BPASmartClient.MorkBF/BPASmartClient.MorkBF.csproj
index 14337820..163b8885 100644
--- a/BPASmartClient.MorkBF/BPASmartClient.MorkBF.csproj
+++ b/BPASmartClient.MorkBF/BPASmartClient.MorkBF.csproj
@@ -13,6 +13,7 @@
+
diff --git a/BPASmartClient.MorkBF/Control_MorkBF.cs b/BPASmartClient.MorkBF/Control_MorkBF.cs
index d720c09a..a87d88f7 100644
--- a/BPASmartClient.MorkBF/Control_MorkBF.cs
+++ b/BPASmartClient.MorkBF/Control_MorkBF.cs
@@ -9,6 +9,7 @@ using BPASmartClient.Model;
using BPASmartClient.Model.大炒;
using BPASmartClient.MorkBF.Model;
using BPASmartClient.MorkBF.ViewModel;
+using BPASmartClient.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -36,14 +37,14 @@ namespace BPASmartClient.MorkBF
MonitorViewModel.DeviceId = DeviceId;
ActionManage.GetInstance.Register(new Action(() =>
{
- GlobalFoodMenu.LocalFoodMenus.Clear();
- if (BPASmartClient.Helper.Json.Data.FryPotMessage.Count > 0)
- {
- foreach (var item in BPASmartClient.Helper.Json.Data.FryPotMessage)
- {
- GlobalFoodMenu.LocalFoodMenus.Add(new FoodMenuModel { GoodKey = item.GoodKey, GoodName = item.GoodName });
- }
- }
+ //GlobalFoodMenu.LocalFoodMenus.Clear();
+ //if (BPASmartClient.Helper.Json.Data.FryPotMessage.Count > 0)
+ //{
+ // foreach (var item in BPASmartClient.Helper.Json.Data.FryPotMessage)
+ // {
+ // GlobalFoodMenu.LocalFoodMenus.Add(new FoodMenuModel { GoodKey = item.GoodKey, GoodName = item.GoodName });
+ // }
+ //}
}), "更新菜单");
CommandRegist();//调试
ServerInit();
@@ -1022,7 +1023,7 @@ namespace BPASmartClient.MorkBF
WorkStatus_1 = morkBF.FryPan1_TemperatureNow > 0 ? WorkStatus.工作 : WorkStatus.待机,
WorkStatus_2 = morkBF.FryPan2_TemperatureNow > 0 ? WorkStatus.工作 : WorkStatus.待机,
RobotStatu = WorkStatus.工作,
- Alarm = new List(),
+ Alarm = new List(),
FailuresCount = 0,
StatsCount = statsModels,
MaxWok_Dishes_1 = "满汉全席",
diff --git a/BPASmartClient.MorkF/BPASmartClient.MorkF.csproj b/BPASmartClient.MorkF/BPASmartClient.MorkF.csproj
index d4750439..ac69f6eb 100644
--- a/BPASmartClient.MorkF/BPASmartClient.MorkF.csproj
+++ b/BPASmartClient.MorkF/BPASmartClient.MorkF.csproj
@@ -18,6 +18,7 @@
+
diff --git a/BPASmartClient.MorkF/Control_MorkF.cs b/BPASmartClient.MorkF/Control_MorkF.cs
index 2d687cdf..db339e8e 100644
--- a/BPASmartClient.MorkF/Control_MorkF.cs
+++ b/BPASmartClient.MorkF/Control_MorkF.cs
@@ -1,4 +1,5 @@
using BPA.Message;
+using System;
using BPA.Message.Enum;
using BPASmartClient.Device;
using BPASmartClient.EventBus;
@@ -16,6 +17,8 @@ using System.Windows.Documents;
using BPASmartClient.Business;
using Microsoft.CodeAnalysis;
using BPASmartClient.MorkF.ViewModel;
+using BPASmartClient.ViewModel;
+using System.Windows;
namespace BPASmartClient.MorkF
{
@@ -35,7 +38,7 @@ namespace BPASmartClient.MorkF
///
/// 菜品库while循环最大sleep次数
///
- private const int materialSleepCount = 900;
+ private const int materialSleepCount = 600;
///
/// 菜品库while循环每次sleep时间
@@ -50,40 +53,40 @@ namespace BPASmartClient.MorkF
///
/// 菜品盒下移高度,相对于坐标系
///
- private const int materialBoxHigh = 4080;
+ //private const int materialBoxHigh = 4080;
- //菜品库出餐高度
- private const int materialHigh = 33000;
+ ////菜品库出餐高度
+ //private const int materialHigh = 33000;
- //传感器到菜品库的高度(坐标系)
- private const int materialLaserHigh = 34500;
+ ////传感器到菜品库的高度(坐标系)
+ //private const int materialLaserHigh = 34500;
///
/// 菜品盒坐标系高度
///
- private const int materialBoxHeight = 9500;
+ private const int materialBoxHeight = 9700;
//传感器1到菜品库的高度(厘米)
- private const int materialLaserHighCM_1 = 22;
+ //private const int materialLaserHighCM_1 = 22;
- //传感器2到菜品库的高度(厘米)
- private const int materialLaserHighCM_2 = 27;
+ ////传感器2到菜品库的高度(厘米)
+ //private const int materialLaserHighCM_2 = 27;
- //传感器3到菜品库的高度(厘米)
- private const int materialLaserHighCM_3 = 31;
+ ////传感器3到菜品库的高度(厘米)
+ //private const int materialLaserHighCM_3 = 31;
///
/// 传感器到隔板的距离(坐标系)
///
private const int clapboardLaserHigh = 10000;
- //炒锅1倒菜的xy坐标
- private const int materialPutPositionXFry1 = 70000;
- private const int materialPutPositionYFry1 = 40000;
+ ////炒锅1倒菜的xy坐标
+ //private const int materialPutPositionXFry1 = 70000;
+ //private const int materialPutPositionYFry1 = 40000;
- //炒锅2倒菜的xy坐标
- private const int materialPutPositionXFry2 = 70000;
- private const int materialPutPositionYFry2 = 40000;
+ ////炒锅2倒菜的xy坐标
+ //private const int materialPutPositionXFry2 = 70000;
+ //private const int materialPutPositionYFry2 = 40000;
//菜品库机械爪放置菜品距离
private const int materialToFryDistance = 10000;
@@ -146,7 +149,7 @@ namespace BPASmartClient.MorkF
///
/// 告警列表
///
- private List alarmModel = new List();
+ private List alarmModel = new List();
///
///
@@ -201,7 +204,7 @@ namespace BPASmartClient.MorkF
MaterialCoordinate.GetInstance().frying2 = materialCoordinate.frying2;
MaterialCoordinate.GetInstance().materialHeight = materialCoordinate.materialHeight;
MaterialCoordinate.GetInstance().MaterialOneX = materialCoordinate.MaterialOneX;
- MaterialCoordinate.GetInstance().MaterialTwoX = materialCoordinate.MaterialTwoX;
+ MaterialCoordinate.GetInstance().MaterialTwoX = materialCoordinate.MaterialTwoX;
MaterialCoordinate.GetInstance().MaterialThreeX = materialCoordinate.MaterialThreeX;
}
////菜品库编号与坐标系对象存储
@@ -346,7 +349,15 @@ namespace BPASmartClient.MorkF
ml_morkf.PawArrivePortThree = bools[2];
}
}), 2);
-
+ //获取爪子伸出退回到位
+ GetStatus("M10.6", new Action
/// 电磁阀启停:true:启动。false:停止。
- public void PawExtend()
+ public bool PawExtend()
{
if (!ml_morkf.InitialComplete)
{
MessageLog.GetInstance.ShowEx("爪子伸出错误,菜品库未初始化");
- return;
+ return false;
}
-
+ Thread.Sleep(500);
MaterailLibrary_Write("M0.6", true);
- //等待爪子伸出延时4s
- Thread.Sleep(6000);
+ for (int i = 0; i < materialSleepCount && !ml_morkf.PawOutComplete; i++)//潘华小炒没有夹爪到位功能
+ {
+ Thread.Sleep(materialSleepTime);
+ if (i >= materialSleepCount - 1)
+ {
+ MessageLog.GetInstance.ShowEx("爪子伸出超时");
+ return false;
+ }
+ }
+ return true;
+ ////等待爪子伸出延时4s
+ //Thread.Sleep(6000);
}
///
/// 爪子收缩
///
/// 电磁阀启停:true:启动。false:停止。
- public void PawShrink()
+ public bool PawShrink()
{
if (!ml_morkf.InitialComplete)
{
MessageLog.GetInstance.ShowEx("爪子伸出错误,菜品库未初始化");
- return;
+ return false;
}
MaterailLibrary_Write("M0.7", true);
+ Thread.Sleep(500);
+ for (int i = 0; i < materialSleepCount && !ml_morkf.PawInComplete; i++)//潘华小炒没有夹爪到位功能
+ {
+ Thread.Sleep(materialSleepTime);
+ if (i >= materialSleepCount - 1)
+ {
+ MessageLog.GetInstance.ShowEx("爪子伸出超时");
+ return false;
+ }
+ }
+ return true;
//等待爪子收缩延时4s
- Thread.Sleep(6000);
+ //Thread.Sleep(6000);
}
///
/// 电磁阀启停
@@ -1033,6 +1076,10 @@ namespace BPASmartClient.MorkF
Thread.Sleep(materialSleepTime);
if (i >= materialSleepCount - 1)
{
+ if (i == 10)
+ {
+ MaterailLibrary_Write("M1.0", true);
+ }
MessageLog.GetInstance.ShowEx("爪子去到1号位超时");
return false;
}
@@ -1063,6 +1110,10 @@ namespace BPASmartClient.MorkF
Thread.Sleep(materialSleepTime);
if (i >= materialSleepCount - 1)
{
+ if (i == 10)
+ {
+ MaterailLibrary_Write("M1.1", true);
+ }
MessageLog.GetInstance.ShowEx("爪子去到2号位超时");
return false;
}
@@ -1090,10 +1141,14 @@ namespace BPASmartClient.MorkF
for (int i = 0; i < materialSleepCount && !ml_morkf.PawArrivePortThree; i++)
{
Thread.Sleep(materialSleepTime);
+ if(i == 30)
+ {
+ MaterailLibrary_Write("M1.2", true);
+ }
if (i >= materialSleepCount - 1)
{
MessageLog.GetInstance.ShowEx("爪子去到3号位超时");
- return false;
+
}
}
if (!ml_morkf.PawPositon_3)
@@ -1243,6 +1298,12 @@ namespace BPASmartClient.MorkF
return false;
}
+ if (x>212000|| y >240000)
+ {
+ MessageLog.GetInstance.ShowEx("机械臂移动超出范围");
+ return false;
+ }
+
//取反
x = 0 - Math.Abs(x);
y = 0 - Math.Abs(y);
@@ -1285,7 +1346,7 @@ namespace BPASmartClient.MorkF
//MessageLog.GetInstance.Show("机械臂移动操作完成");
- Thread.Sleep(500);
+ Thread.Sleep(300);
return true;
}
@@ -1374,9 +1435,9 @@ namespace BPASmartClient.MorkF
Thread.Sleep(1000);
//获取传感器的距离,转换成坐标系的点
- //int laserHigh = ml_morkf.LaserDistance;
+ int laserHigh = ml_morkf.LaserDistance;
- int laserHigh = 400;
+
//秦工要求读取后置0
WriteDistance(0);
@@ -1396,7 +1457,7 @@ namespace BPASmartClient.MorkF
}
//设置到传感器感应的距离处
- if (!SetArmPosition(x, y))
+ if (!SetArmPosition(x - moveX, y))
{
return false;
}
@@ -1414,7 +1475,11 @@ namespace BPASmartClient.MorkF
}
//伸出爪子
- PawExtend();
+ if (!PawExtend())
+ {
+ return false;
+ }
+
//移动前开启电磁阀
Electromagnetism(new List { false });
@@ -1461,16 +1526,18 @@ namespace BPASmartClient.MorkF
return false;
}
- WriteSpeed(50000);
+ WriteSpeed(50000);//移动速度
//ThreadManage.GetInstance().Start(new Action(() =>
//{
// //收缩爪子
// PawShrink();
//}), "GetMaterialPawShrink");
- PawShrink();
+
+ //收缩爪子
+ if (!PawShrink()) return false;
//判断炒锅是否可以放盒
- for (int i = 0; materialSleepCount > i && !morkFs[fryIndex].FryPot1_HOBTPut; i++)
+ for (int i = 0; materialSleepCount > i && !morkFs[fryNum].FryPot1_HOBTPut; i++)
{
Thread.Sleep(materialSleepTime);
if (i >= materialSleepCount - 1)
@@ -1520,8 +1587,12 @@ namespace BPASmartClient.MorkF
return false;
}
+
//伸出爪子
- PawExtend();
+ if (!PawExtend())
+ {
+ return false;
+ }
Thread.Sleep(300);
@@ -1530,7 +1601,7 @@ namespace BPASmartClient.MorkF
Thread.Sleep(300);
//收缩爪子
- PawShrink();
+ if (!PawShrink()) return false;
//设置到炒锅i出菜处
if (!SetArmPosition(x + materialToFryDistance, y))
@@ -1578,10 +1649,13 @@ namespace BPASmartClient.MorkF
Electromagnetism(new List { true });
//爪子收回
- PawShrink();
+ if (!PawShrink())
+ {
+ return false;
+ }
//爪子去2号点位
- if(!PawToPoint2())
+ if (!PawToPoint2())
{
return false;
}
@@ -1670,8 +1744,10 @@ namespace BPASmartClient.MorkF
Laser2CoordinateState laser2CoordinateState = LaserDistance2MaterialCount(distance, x, out boxCount);
if (laser2CoordinateState == Laser2CoordinateState.MaterialNormal)
{
+ int compensateHeight = boxCount > 1 ? 500 : 0;//补偿高度,超过1层盒子增加补偿
+
//盒子高度计算除去起始位置的那个盒子
- x_high = (boxCount - 1) * materialBoxHeight;
+ x_high = (boxCount - 1) * materialBoxHeight + compensateHeight;
}
return laser2CoordinateState;
@@ -1722,6 +1798,7 @@ namespace BPASmartClient.MorkF
if(heightDifferent < 0)
{
MessageLog.GetInstance.ShowEx($"菜品库检测{x}处的菜品量时,传感器获取的高度差为负数,请校准该层高度");
+ return Laser2CoordinateState.MaterialEmpty; ;
}
//盒子高度为45,但是需要考虑到误差,不足35,则认为为空
@@ -2216,11 +2293,7 @@ namespace BPASmartClient.MorkF
GoodsKey = item.GoodsKey,
StirPotActions = OrderSort(item.StirPotActions),
});
- GlobalFoodMenu.LocalFoodMenus.Add(new FoodMenuModel
- {
- GoodKey = item.GoodsKey.ToString(),
- GoodName = "",
- });
+
}
}
@@ -2357,9 +2430,9 @@ namespace BPASmartClient.MorkF
///
///
///
- private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS)
+ private void OrderChange(string Id , string goodName, ORDER_STATUS oRDER_STATUS,int deviceId)
{
- EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid });
+ EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, GoodName = goodName,DeviceId = deviceId, SubOrderId =Id });
}
///
@@ -2405,7 +2478,7 @@ namespace BPASmartClient.MorkF
if (materialInfo != null)
{
//if
- if(Convert.ToInt32(materialInfo.Qty) - goodBatching.BatchingCount < 0)
+ if(System.Convert.ToInt32(materialInfo.Qty) - goodBatching.BatchingCount < 0)
{
MessageLog.GetInstance.ShowEx($"{materialInfo.Name}不够,请更新菜品库,并点击检测");
return;
@@ -2487,13 +2560,14 @@ namespace BPASmartClient.MorkF
if (morkFs[i].AutoMode && morkFs[i].FryPot1_InitialComplete && ml_morkf.InitialComplete &&
!morkFs[i].FryWorking)//炒锅在自动状态&&初始化完成&&菜品库初始化&&是否在炒菜中
{
- Thread.Sleep(5000);
+ Thread.Sleep(4000);
lock(lock_MainProcessExcute)
{
//待炒小炒队列出队列
if (StirFryGoodsQuenes.TryDequeue(out var res))
{
+ OrderChange(res.SuborderId, res.GoodName, ORDER_STATUS.WAIT, DeviceId = i);
//设置当前炒制菜品
nowStirFryGood[i] = res;
//炒锅工作状态置为正在工作中
@@ -2519,7 +2593,7 @@ namespace BPASmartClient.MorkF
bool ret = true;
MessageLog.GetInstance.Show($"炒锅{i}开始炒制菜品{res.GoodName}");
-
+ OrderChange(res.SuborderId, res.GoodName, ORDER_STATUS.COOKING, DeviceId = i);
morkFs[i].GoodName = res.GoodName;
Coordinate myCoordinate = new Coordinate();
@@ -2542,7 +2616,7 @@ namespace BPASmartClient.MorkF
//更新
morkFs[i].UpdateProcess(potActions);
-
+
switch (potActions.Actions)
{
case nameof(StirFryPotActionEnum.加热开启):
@@ -2608,6 +2682,16 @@ namespace BPASmartClient.MorkF
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.取原料):
+ if(potActions.SeasoningLists[0].Loc == 1 ||
+ potActions.SeasoningLists[0].Loc == 9 ||
+ potActions.SeasoningLists[0].Loc == 10 ||
+ potActions.SeasoningLists[0].Loc == 18 ||
+ potActions.SeasoningLists[0].Loc == 19 ||
+ potActions.SeasoningLists[0].Loc == 27 )
+ {
+ MessageLog.GetInstance.ShowEx("该取料位置禁止使用");
+ return;
+ }
//炒锅取菜状态置为未取到
morkFs[i].GetMaterialComplete = false;
@@ -2678,7 +2762,7 @@ namespace BPASmartClient.MorkF
ret = OutFood(i, out error, true);
if(ret == false)
{
- alarmModel.Add(new AlarmModel() { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = error });
+ alarmModel.Add(new BPA.Message.AlarmModel() { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = error });
}
break;
case nameof(StirFryPotActionEnum.炒制菜品):
@@ -2696,7 +2780,7 @@ namespace BPASmartClient.MorkF
}
if (ret == false)
{
- alarmModel.Add(new AlarmModel() { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = error });
+ alarmModel.Add(new BPA.Message.AlarmModel() { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = error });
}
MessageLog.GetInstance.Show(potActions.Actions);
break;
@@ -2713,9 +2797,9 @@ namespace BPASmartClient.MorkF
Thread.Sleep(3000);
//回原点位
StirArmGoOrigin(i);
-
+ OrderChange(res.SuborderId, res.GoodName, ORDER_STATUS.COMPLETED_COOK, DeviceId = i);
//同时只能允许有一个出餐
- lock(lock_OutMeal)
+ lock (lock_OutMeal)
{
//出餐启动
OutMeal(i);
@@ -2804,12 +2888,12 @@ namespace BPASmartClient.MorkF
if (batchingInfo == null)
{
//为空就新增
- BatchingInfos.Add(new BatchingInfo() { BatchingCount = Convert.ToInt32(surplus.Qty) - stagingCount, BatchingLoc = surplus.Loc, BatchingId = surplus.Key });
+ BatchingInfos.Add(new BatchingInfo() { BatchingCount = System.Convert.ToInt32(surplus.Qty) - stagingCount, BatchingLoc = surplus.Loc, BatchingId = surplus.Key });
}
else
{
batchingInfo.BatchingLoc = surplus.Loc;
- batchingInfo.BatchingCount = Convert.ToInt32(surplus.Qty) - stagingCount;
+ batchingInfo.BatchingCount = System.Convert.ToInt32(surplus.Qty) - stagingCount;
}
}
Thread.Sleep(1000);
diff --git a/BPASmartClient.MorkF/Convert/PotActionToVisibilityConvert.cs b/BPASmartClient.MorkF/Convert/PotActionToVisibilityConvert.cs
new file mode 100644
index 00000000..f63a3b2d
--- /dev/null
+++ b/BPASmartClient.MorkF/Convert/PotActionToVisibilityConvert.cs
@@ -0,0 +1,35 @@
+using AlibabaCloud.SDK.Iot20180120.Models;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace BPASmartClient.MorkF.Convert
+{
+ internal class PotActionToVisibilityConvert : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ Visibility vs = Visibility.Collapsed;
+ if(value is string action)
+ {
+ switch (action)
+ {
+ case "":
+ default:
+ break;
+ }
+ }
+ return vs;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/BPASmartClient.MorkF/ML_MorkF.cs b/BPASmartClient.MorkF/ML_MorkF.cs
index 993de6c1..4ce879a3 100644
--- a/BPASmartClient.MorkF/ML_MorkF.cs
+++ b/BPASmartClient.MorkF/ML_MorkF.cs
@@ -35,6 +35,15 @@ namespace BPASmartClient.MorkF
///
public bool InitialComplete { get; set; }
+ ///
+ /// 爪子伸出到位
+ ///
+ public bool PawOutComplete { get; set; }
+ ///
+ /// 爪子缩回到位
+ ///
+ public bool PawInComplete { get; set; }
+
private bool _ArriveComplete = false;
///
/// 定位到达,上升沿捕获需要特殊处理
diff --git a/BPASmartClient.MorkF/Model/FoodMenuModel.cs b/BPASmartClient.MorkF/Model/FoodMenuModel.cs
new file mode 100644
index 00000000..48d0f862
--- /dev/null
+++ b/BPASmartClient.MorkF/Model/FoodMenuModel.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.MorkF.Model
+{
+ public class FoodMenuModel
+ {
+ public string ID { get; set; }
+ public string FoodName { get; set; }
+ public Dictionary FoodHouseMaterials { get; set; } = new Dictionary();
+
+ }
+
+
+
+
+
+}
diff --git a/BPASmartClient.MorkF/Model/MaterialSurplus.cs b/BPASmartClient.MorkF/Model/MaterialSurplus.cs
index b75043fd..0bef04b9 100644
--- a/BPASmartClient.MorkF/Model/MaterialSurplus.cs
+++ b/BPASmartClient.MorkF/Model/MaterialSurplus.cs
@@ -87,7 +87,7 @@ namespace BPASmartClient.MorkF
foreach(MaterialInfo material in materials)
{
//surplus += int.Parse(material.Qty.ToString());
- surplus += Convert.ToInt32(material.Qty);
+ surplus += System.Convert.ToInt32(material.Qty);
}
return true;
}
diff --git a/BPASmartClient.MorkF/View/DebugView.xaml b/BPASmartClient.MorkF/View/DebugView.xaml
index 186c5233..e6baed2a 100644
--- a/BPASmartClient.MorkF/View/DebugView.xaml
+++ b/BPASmartClient.MorkF/View/DebugView.xaml
@@ -55,16 +55,16 @@
-
-
-
+
+
+
-
+
-
+
diff --git a/BPASmartClient.MorkF/View/LocalMenu.xaml b/BPASmartClient.MorkF/View/LocalMenu.xaml
index a950c91c..56e6dba7 100644
--- a/BPASmartClient.MorkF/View/LocalMenu.xaml
+++ b/BPASmartClient.MorkF/View/LocalMenu.xaml
@@ -7,61 +7,102 @@
xmlns:local="clr-namespace:BPASmartClient.MorkF.View"
xmlns:vm="clr-namespace:BPASmartClient.MorkF.ViewModel"
mc:Ignorable="d"
- Title="LocalMenu" Height="800" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True" MouseLeftButtonDown="Window_MouseLeftButtonDown">
+ Title="LocalMenu" Height="900" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True" MouseLeftButtonDown="Window_MouseLeftButtonDown" Background="Gray"
+ >
-
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
-
+
@@ -77,9 +118,9 @@
-
diff --git a/BPASmartClient.MorkF/View/LocalMenu.xaml.cs b/BPASmartClient.MorkF/View/LocalMenu.xaml.cs
index e5d001f4..d3c98d16 100644
--- a/BPASmartClient.MorkF/View/LocalMenu.xaml.cs
+++ b/BPASmartClient.MorkF/View/LocalMenu.xaml.cs
@@ -233,7 +233,7 @@ namespace BPASmartClient.MorkF.View
private void Materials_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
- string str = Materials.SelectedValue.ToString();
+ string str = Materials.SelectedValue?.ToString();
if(str != string.Empty)
{
ActionManage.GetInstance.Send("LoacMenuSelectMaterial", str);
diff --git a/BPASmartClient.MorkF/View/MaterialCalibration.xaml b/BPASmartClient.MorkF/View/MaterialCalibration.xaml
index 2cf13469..0212c0f6 100644
--- a/BPASmartClient.MorkF/View/MaterialCalibration.xaml
+++ b/BPASmartClient.MorkF/View/MaterialCalibration.xaml
@@ -82,6 +82,10 @@
+
+
+
+
@@ -627,7 +631,7 @@
-
+
@@ -657,6 +661,8 @@
+
+
@@ -725,6 +731,7 @@
+
@@ -740,6 +747,7 @@
+
@@ -749,56 +757,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+ Style="{DynamicResource UserTextBoxStyle}"
+ Foreground="#a2c2e8" Text="{Binding Str}"/>
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
diff --git a/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs
index c2caa4fa..4c093fa1 100644
--- a/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs
+++ b/BPASmartClient.MorkF/ViewModel/DebugViewModel.cs
@@ -33,7 +33,7 @@ namespace BPASmartClient.MorkF.ViewModel
public RelayCommand FoodPlcInite { get; set; }
public RelayCommand Plc1Reset { get; set; }
public RelayCommand StartOrder { get; set; }
- public RelayCommand StartLocalOrder { get; set; }
+
public RelayCommand StopLocalOrder { get; set; }
public RelayCommand ModeChange { get; set; }
@@ -205,7 +205,6 @@ namespace BPASmartClient.MorkF.ViewModel
PlcInite = new RelayCommand(() => { ActionManage.GetInstance.Send("InitCommand"); });
Plc1Reset = new RelayCommand(() => { ActionManage.GetInstance.Send("Plc1Reset"); });
StartOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("StartOrder", FoodMenuID); });
- StartLocalOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("StartLocalOrder"); });
StopLocalOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("StopLocalOrder"); });
ModeChange = new RelayCommand(() => {
ActionManage.GetInstance.Send("ModeChange");
diff --git a/BPASmartClient.MorkF/ViewModel/LocalMenuViewModel.cs b/BPASmartClient.MorkF/ViewModel/LocalMenuViewModel.cs
index 39ec33cd..67d12347 100644
--- a/BPASmartClient.MorkF/ViewModel/LocalMenuViewModel.cs
+++ b/BPASmartClient.MorkF/ViewModel/LocalMenuViewModel.cs
@@ -1,6 +1,9 @@
using BPA.Models;
using BPASmartClient.Helper;
+using BPASmartClient.Model;
+using BPASmartClient.Model.小炒机;
using BPASmartClient.MorkF.Model;
+using BPASmartClient.ViewModel;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
@@ -17,20 +20,33 @@ namespace BPASmartClient.MorkF.ViewModel
partial class LocalMenuViewModel:ObservableObject
{
+ ///
+ /// 单个菜品流程
+ ///
public ObservableCollection PotActionStep { get { return _PotActionStep; }
set { _PotActionStep = value; OnPropertyChanged(); } }
private ObservableCollection _PotActionStep = new ObservableCollection();
+
public string MaterialName { get; set; }
-
- public string SelectMaterialName { get; set; }
-
+ ///
+ /// 选中的菜品
+ ///
+ public string SelectMaterialName { get { return _selectMaterialName; } set { _selectMaterialName = value; OnPropertyChanged(); } }
+ private string _selectMaterialName;
+ ///
+ /// 菜品combox集合
+ ///
public ObservableCollection MaterialNames { get; set; } = new ObservableCollection();
-
+ ///
+ /// 动作名称combox集合
+ ///
public ObservableCollection strPotActions { get; set; } = new ObservableCollection();
-
- public MaterialAndFryingTime materialAndFryingTime { get; set; } = new MaterialAndFryingTime();
+ ///
+ /// 全部菜品流程集合
+ ///
+ public MaterialAndFryingTime materialAndFryingTime { get; set; } = Json.Data;
public RelayCommand Delete { get; set; }
public RelayCommand AddFryTime { get; set; }
@@ -106,34 +122,33 @@ namespace BPASmartClient.MorkF.ViewModel
else
{
MaterialNames.Add(MaterialName);
+ SelectMaterialName = MaterialName;
}
});
DeleteMaterial = new RelayCommand(() =>
{
- //尝试是否能找到
- if (MaterialNames.FirstOrDefault(o => o == SelectMaterialName) == SelectMaterialName)
+ if (materialAndFryingTime.materials.ContainsKey(SelectMaterialName))
{
- MaterialNames.Remove(SelectMaterialName);
- if(materialAndFryingTime.materials.ContainsKey(SelectMaterialName))
- {
- materialAndFryingTime.materials.Remove(SelectMaterialName);
- }
- }
- });
- RenameMaterial = new RelayCommand(() =>
- {
- //尝试是否能找到
- if (MaterialNames.FirstOrDefault(o => o == SelectMaterialName) == SelectMaterialName)
- {
- MaterialNames.Remove(SelectMaterialName);
- MaterialNames.Add(MaterialName);
- if (materialAndFryingTime.materials.ContainsKey(SelectMaterialName))
- {
- materialAndFryingTime.materials.Add(MaterialName, materialAndFryingTime.materials[SelectMaterialName]);
- materialAndFryingTime.materials.Remove(SelectMaterialName);
- }
+ materialAndFryingTime.materials.Remove(SelectMaterialName);
}
+ MaterialNames.Remove(SelectMaterialName);
+ PotActionStep.Clear();
});
+ //RenameMaterial = new RelayCommand(() =>
+ //{
+ // //尝试是否能找到
+ // if (MaterialNames.FirstOrDefault(o => o == SelectMaterialName) == SelectMaterialName)
+ // {
+ // MaterialNames.Remove(SelectMaterialName);
+ // MaterialNames.Add(MaterialName);
+ // if (materialAndFryingTime.materials.ContainsKey(SelectMaterialName))
+ // {
+ // materialAndFryingTime.materials.Add(MaterialName, materialAndFryingTime.materials[SelectMaterialName]);
+ // materialAndFryingTime.materials.Remove(SelectMaterialName);
+
+ // }
+ // }
+ //});
Save = new RelayCommand(new Action(() =>
{
if(PotActionStep.Count > 0)
@@ -155,8 +170,9 @@ namespace BPASmartClient.MorkF.ViewModel
//Json.Data.LocalstirFryGoods.GoodsKey = 11;
//Json.Data.LocalstirFryGoods.StirPotActions = new List(PotActionStep);
//Json.Save();
- Json.Data.materials = materialAndFryingTime.materials;
+ //Json.Data.materials = materialAndFryingTime.materials;
Json.Save();
+
//ActionManage.GetInstance.Send("LocalMenuClose");
}));
@@ -209,8 +225,5 @@ namespace BPASmartClient.MorkF.ViewModel
}
}
- partial class MaterialAndFryingTime
- {
- public Dictionary> materials { get; set; } = new Dictionary>();
- }
+
}
diff --git a/BPASmartClient.MorkF/ViewModel/MaterialCalibrationViewModel.cs b/BPASmartClient.MorkF/ViewModel/MaterialCalibrationViewModel.cs
index 49fe6251..ab0449ea 100644
--- a/BPASmartClient.MorkF/ViewModel/MaterialCalibrationViewModel.cs
+++ b/BPASmartClient.MorkF/ViewModel/MaterialCalibrationViewModel.cs
@@ -280,6 +280,30 @@ namespace BPASmartClient.MorkF.ViewModel
private int _Distance_2;
public int Distance_3 { get { return _Distance_3; } set { _Distance_3 = value; OnPropertyChanged(); } }
private int _Distance_3;
+ #endregion
+
+ #region 控制
+ public int SettingX { get { return _settingX; } set { _settingX = value; OnPropertyChanged(); } }
+ private int _settingX = 0;
+ public int SettingY { get { return _settingY; } set { _settingY = value; OnPropertyChanged(); } }
+ private int _settingY = 0;
+ public int MoveSpeed { get { return _moveSpeed; } set { _moveSpeed = value; OnPropertyChanged(); } }
+ private int _moveSpeed;
+
+ public int SensingDistance_1 { get { return _sensingDistance_1; } set { _sensingDistance_1 = value; OnPropertyChanged(); } }
+ private int _sensingDistance_1;
+ public int SensingDistance_2 { get { return _sensingDistance_2; } set { _sensingDistance_2 = value; OnPropertyChanged(); } }
+ private int _sensingDistance_2;
+ public int SensingDistance_3 { get { return _sensingDistance_3; } set { _sensingDistance_3 = value; OnPropertyChanged(); } }
+ private int _sensingDistance_3;
+
+ public RelayCommand SetSpeed { get; set; }//速度设定
+ public RelayCommand SetArmPosition { get; set; }//机器臂位置设定
+
+ public RelayCommand GetTestDistance_1 { get; set; }//获取感应器距离1
+ public RelayCommand GetTestDistance_2 { get; set; }//获取感应器距离2
+ public RelayCommand GetTestDistance_3 { get; set; }//获取感应器距离3
+
#endregion
public bool Up { get { return _Up; } set { _Up = value; OnPropertyChanged(); } }
private bool _Up;
@@ -355,9 +379,9 @@ namespace BPASmartClient.MorkF.ViewModel
public RelayCommand StopElectromagnetism { get; set; }
public RelayCommand PawTurnFront { get; set; }//夹爪正转
public RelayCommand PawTurnBack { get; set; }//夹爪反转
- public RelayCommand PawToPoint1 { get; set; }//感应测距1
- public RelayCommand PawToPoint2 { get; set; }//感应测距2
- public RelayCommand PawToPoint3 { get; set; }//感应测距3
+ public RelayCommand PawToPoint1 { get; set; }//夹爪位置1
+ public RelayCommand PawToPoint2 { get; set; }//夹爪位置2
+ public RelayCommand PawToPoint3 { get; set; }//夹爪位置3
public RelayCommand GetDistance_1 { get; set; }//感应测距1
public RelayCommand GetDistance_2 { get; set; }//感应测距2
public RelayCommand GetDistance_3 { get; set; }//感应测距3
@@ -844,10 +868,10 @@ namespace BPASmartClient.MorkF.ViewModel
return;
}
- if (PositionOne)
- {
- ActionManage.GetInstance.Send("CalibrationCoordination", new List {"1", OneX + OperationX, OneY + OperationY });//设定机械臂当前位置
- }
+ //if (PositionOne)
+ //{
+ // ActionManage.GetInstance.Send("CalibrationCoordination", new List {"1", OneX + OperationX, OneY + OperationY });//设定机械臂当前位置
+ //}
if (PositionTwo)
{
ActionManage.GetInstance.Send("CalibrationCoordination", new List { "2", TwoX + OperationX, TwoY + OperationY });//设定机械臂当前位置
@@ -876,14 +900,14 @@ namespace BPASmartClient.MorkF.ViewModel
{
ActionManage.GetInstance.Send("CalibrationCoordination", new List { "8", EightX + OperationX, EightY + OperationY });//设定机械臂当前位置
}
- if (PositionNine)
- {
- ActionManage.GetInstance.Send("CalibrationCoordination", new List { "9", NineX + OperationX, NineY + OperationY });//设定机械臂当前位置
- }
- if (PositionTen)
- {
- ActionManage.GetInstance.Send("CalibrationCoordination", new List { "10", TenX + OperationX, TenY + OperationY });//设定机械臂当前位置
- }
+ //if (PositionNine)
+ //{
+ // ActionManage.GetInstance.Send("CalibrationCoordination", new List { "9", NineX + OperationX, NineY + OperationY });//设定机械臂当前位置
+ //}
+ //if (PositionTen)
+ //{
+ // ActionManage.GetInstance.Send("CalibrationCoordination", new List { "10", TenX + OperationX, TenY + OperationY });//设定机械臂当前位置
+ //}
if (PositionEleven)
{
ActionManage.GetInstance.Send("CalibrationCoordination", new List { "11", ElevenX + OperationX, ElevenY + OperationY });//设定机械臂当前位置
@@ -912,14 +936,14 @@ namespace BPASmartClient.MorkF.ViewModel
{
ActionManage.GetInstance.Send("CalibrationCoordination", new List { "17", SeventeenX + OperationX, SeventeenY + OperationY });//设定机械臂当前位置
}
- if (PositionEighteen)
- {
- ActionManage.GetInstance.Send("CalibrationCoordination", new List { "18", EighteenX + OperationX, EighteenY + OperationY });//设定机械臂当前位置
- }
- if (PositionNineteen)
- {
- ActionManage.GetInstance.Send("CalibrationCoordination", new List { "19", NineteenX + OperationX, NineteenY + OperationY });//设定机械臂当前位置
- }
+ //if (PositionEighteen)
+ //{
+ // ActionManage.GetInstance.Send("CalibrationCoordination", new List { "18", EighteenX + OperationX, EighteenY + OperationY });//设定机械臂当前位置
+ //}
+ //if (PositionNineteen)
+ //{
+ // ActionManage.GetInstance.Send("CalibrationCoordination", new List { "19", NineteenX + OperationX, NineteenY + OperationY });//设定机械臂当前位置
+ //}
if (PositionTwenty)
{
ActionManage.GetInstance.Send("CalibrationCoordination", new List { "20", TwentyX + OperationX, TwentyY + OperationY });//设定机械臂当前位置
@@ -948,10 +972,10 @@ namespace BPASmartClient.MorkF.ViewModel
{
ActionManage.GetInstance.Send("CalibrationCoordination", new List { "26", TwentySixX + OperationX, TwentySixY + OperationY });//设定机械臂当前位置
}
- if (PositionTwentySeven)
- {
- ActionManage.GetInstance.Send("CalibrationCoordination", new List { "27", TwentySevenX + OperationX, TwentySevenY + OperationY });//设定机械臂当前位置
- }
+ //if (PositionTwentySeven)
+ //{
+ // ActionManage.GetInstance.Send("CalibrationCoordination", new List { "27", TwentySevenX + OperationX, TwentySevenY + OperationY });//设定机械臂当前位置
+ //}
if (PositionMaterialHeight)
{
ActionManage.GetInstance.Send("CalibrationCoordination", new List { "MaterialHeight", MaterialHeightX + OperationX, MaterialHeightY + OperationY });//设定机械臂当前位置
@@ -987,12 +1011,21 @@ namespace BPASmartClient.MorkF.ViewModel
PawToPoint1 = new RelayCommand(() => { ActionManage.GetInstance.Send("PawToPoint1"); });//爪子去1号位
PawToPoint2 = new RelayCommand(() => { ActionManage.GetInstance.Send("PawToPoint2"); });//爪子去2号位
PawToPoint3 = new RelayCommand(() => { ActionManage.GetInstance.Send("PawToPoint3"); });//爪子去3号位
- PawTurnFront = new RelayCommand(() => { ActionManage.GetInstance.Send("PawTurnFront"); });//夹爪正转
- PawTurnBack = new RelayCommand(() => { ActionManage.GetInstance.Send("PawTurnBack"); });//夹爪反转
+ PawTurnFront = new RelayCommand(() => {
+ ActionManage.GetInstance.Send("PawTurnFront");
+ });//夹爪伸出
+ PawTurnBack = new RelayCommand(() => {
+ ActionManage.GetInstance.Send("PawTurnBack");
+ });//夹爪收缩
GetDistance_1 = new RelayCommand(() => { ActionManage.GetInstance.Send("GetDistance_1"); });//感应距离1
GetDistance_2 = new RelayCommand(() => { ActionManage.GetInstance.Send("GetDistance_2"); });//感应距离2
GetDistance_3 = new RelayCommand(() => { ActionManage.GetInstance.Send("GetDistance_3"); });//感应距离3
+ SetSpeed = new RelayCommand(() => { ActionManage.GetInstance.Send("SetSpeed", new List { MoveSpeed }); });//速度设定
+ SetArmPosition = new RelayCommand(() => {
+ ActionManage.GetInstance.Send("SetArmPosition", new List { SettingX, SettingY });
+ });//设定移动位置
+
PhysicalMaterialCoordinate();
ActionManage.GetInstance.Register(new Action((o) =>
{
diff --git a/BPASmartClient.S7Net/SiemensHelper.cs b/BPASmartClient.S7Net/SiemensHelper.cs
index 01c59f24..5d943ecf 100644
--- a/BPASmartClient.S7Net/SiemensHelper.cs
+++ b/BPASmartClient.S7Net/SiemensHelper.cs
@@ -120,7 +120,7 @@ namespace BPASmartClient.S7Net
}
public void WriteInt16(int db, short txt, int startAddress = 0)
{
- var bytes =BitConverter.GetBytes(txt);
+ var bytes = BitConverter.GetBytes(txt);
myPlc.WriteBytes(DataType.DataBlock, db, startAddress, bytes);
}
diff --git a/BPASmartClient.SmallBatchingSystem/BPASmartClient.SmallBatchingSystem.csproj b/BPASmartClient.SmallBatchingSystem/BPASmartClient.SmallBatchingSystem.csproj
index 00d07de3..3a434956 100644
--- a/BPASmartClient.SmallBatchingSystem/BPASmartClient.SmallBatchingSystem.csproj
+++ b/BPASmartClient.SmallBatchingSystem/BPASmartClient.SmallBatchingSystem.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/BPASmartClient.Update/App.xaml b/BPASmartClient.Update/App.xaml
new file mode 100644
index 00000000..ef55777f
--- /dev/null
+++ b/BPASmartClient.Update/App.xaml
@@ -0,0 +1,8 @@
+
+
+
diff --git a/BPASmartClient.Update/App.xaml.cs b/BPASmartClient.Update/App.xaml.cs
new file mode 100644
index 00000000..d59b4ae7
--- /dev/null
+++ b/BPASmartClient.Update/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace BPASmartClient.Update
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/BPASmartClient.Update/AssemblyInfo.cs b/BPASmartClient.Update/AssemblyInfo.cs
new file mode 100644
index 00000000..8b5504ec
--- /dev/null
+++ b/BPASmartClient.Update/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
diff --git a/BPASmartClient.Update/BPASmartClient.Update.csproj b/BPASmartClient.Update/BPASmartClient.Update.csproj
new file mode 100644
index 00000000..01761f98
--- /dev/null
+++ b/BPASmartClient.Update/BPASmartClient.Update.csproj
@@ -0,0 +1,14 @@
+
+
+
+ WinExe
+ net6.0-windows
+ enable
+ true
+
+
+
+
+
+
+
diff --git a/BPASmartClient.Update/MainViewsModel.cs b/BPASmartClient.Update/MainViewsModel.cs
new file mode 100644
index 00000000..a4c464ce
--- /dev/null
+++ b/BPASmartClient.Update/MainViewsModel.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using BPA.Helper;
+using BPASmartClient.Update.Model;
+
+namespace BPASmartClient.Update
+{
+ public class MainViewsModel : NotifyBase
+ {
+ public MainViewsModel()
+ {
+
+ }
+ public UpdateModel um { get { return _mum; } set { _mum = value; OnPropertyChanged(); } }
+ private UpdateModel _mum = new UpdateModel();
+
+ }
+}
diff --git a/BPASmartClient.Update/MainWindow.xaml b/BPASmartClient.Update/MainWindow.xaml
new file mode 100644
index 00000000..004b2e85
--- /dev/null
+++ b/BPASmartClient.Update/MainWindow.xaml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.Update/MainWindow.xaml.cs b/BPASmartClient.Update/MainWindow.xaml.cs
new file mode 100644
index 00000000..cece6f13
--- /dev/null
+++ b/BPASmartClient.Update/MainWindow.xaml.cs
@@ -0,0 +1,85 @@
+using BPA.Helper;
+using BPASmartClient.Update.Model;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading;
+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.Update
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ this.grProgressbar.Visibility = Visibility.Collapsed;
+ }
+
+ private void cancel_Click(object sender, RoutedEventArgs e)
+ {
+ this.Close();
+ }
+
+ private async void ok_Click(object sender, RoutedEventArgs e)
+ {
+ this.cancel.Visibility = Visibility.Collapsed;
+ this.grProgressbar.Visibility = Visibility.Visible;
+ await Task.Run(() =>
+ {
+ App.Current.Dispatcher.Invoke(() =>
+ {
+ this.progressbar.Value = 25;
+ this.tb.Text = "当前更新进度:1/4";
+ });
+ Thread.Sleep(2000);
+
+ App.Current.Dispatcher.Invoke(() =>
+ {
+ this.progressbar.Value = 50;
+ this.tb.Text = "当前更新进度:2/4";
+ });
+ Thread.Sleep(1500);
+
+ App.Current.Dispatcher.Invoke(() =>
+ {
+ this.progressbar.Value = 75;
+ this.tb.Text = "当前更新进度:3/4";
+ });
+ Thread.Sleep(3000);
+
+ App.Current.Dispatcher.Invoke(() =>
+ {
+ this.progressbar.Value = 100;
+ this.tb.Text = "当前更新进度:4/4";
+ });
+ Thread.Sleep(1500);
+
+ App.Current.Dispatcher.Invoke(() =>
+ {
+ this.progressbar.Value = 100;
+ this.tb.Text = "当前更新进度:更新完成";
+ });
+ Thread.Sleep(1500);
+ });
+ string directory = AppDomain.CurrentDomain.BaseDirectory;
+ Process.Start($"{directory}BPASmartClient.DosingSystem.exe");
+ Json.Save();
+ this.Close();
+ }
+ }
+}
diff --git a/BPASmartClient.Update/Models/UpdateModel.cs b/BPASmartClient.Update/Models/UpdateModel.cs
new file mode 100644
index 00000000..a97ddfad
--- /dev/null
+++ b/BPASmartClient.Update/Models/UpdateModel.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using BPA.Helper;
+
+namespace BPASmartClient.Update.Model
+{
+ public class UpdateModel : NotifyBase
+ {
+ ///
+ /// 软件名称
+ ///
+ public string Name { get { return _mName; } set { _mName = value; OnPropertyChanged(); } }
+ private string _mName = "味魔方管理系统软件[简称:味魔方] ";
+
+
+ ///
+ /// 软件当前版本号
+ ///
+ public string Version { get { return _mVersion; } set { _mVersion = value; OnPropertyChanged(); } }
+ private string _mVersion = "V1.0.1";
+
+
+ ///
+ /// 软件升级版本号
+ ///
+ public string UpgradeVersion { get { return _mUpgradeVersion; } set { _mUpgradeVersion = value; OnPropertyChanged(); } }
+ private string _mUpgradeVersion = "V1.0.2";
+
+
+ ///
+ /// 软件更新说明
+ ///
+ public string UpdateDescription { get { return _mUpdateDescription; } set { _mUpdateDescription = value; OnPropertyChanged(); } }
+ private string _mUpdateDescription = "下列 Bug 问题已修复:\n1、当在某些语言环境中保存文档后重新打开时,Canvas的缩放级别与文件保存时不同。\n2、删除样本数据后执行“另存为”时,有时无法使用串行打印机打印。\n3、如果显示放大率设置为100%以外的值,有时仅部分显示最小化、最大化和关闭按钮。\n4、其他小Bug。";
+
+
+ }
+}
diff --git a/BPASmartClient.ViewModel/FoodMenuViewModel.cs b/BPASmartClient.ViewModel/FoodMenuViewModel.cs
index 4de85018..68efee72 100644
--- a/BPASmartClient.ViewModel/FoodMenuViewModel.cs
+++ b/BPASmartClient.ViewModel/FoodMenuViewModel.cs
@@ -1,5 +1,6 @@
using BPASmartClient.Helper;
using BPASmartClient.Model;
+using BPASmartClient.Model.小炒机;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
@@ -13,17 +14,23 @@ namespace BPASmartClient.ViewModel
{
public class FoodMenuViewModel: ObservableObject
{
- public ObservableCollection FoodMenus { get; set; } = GlobalFoodMenu.LocalFoodMenus;
+ ///
+ /// 菜单
+ ///
+ public ObservableCollection FoodMenus { get; set; } = new ObservableCollection();
public RelayCommand StartOrder { get; set; }
public FoodMenuViewModel()
{
-
+ Json.Data.materials?.Keys?.ToList().ForEach(key => FoodMenus.Add(new FoodMenuModel { GoodName = key }));
+
StartOrder = new RelayCommand((o) =>
{
ActionManage.GetInstance.Send("开始下单", o);
});
}
+
+
}
}
diff --git a/BPASmartClient/Control/FoodMenu.xaml b/BPASmartClient/Control/FoodMenu.xaml
new file mode 100644
index 00000000..dc0e436c
--- /dev/null
+++ b/BPASmartClient/Control/FoodMenu.xaml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient/Control/FoodMenu.xaml.cs b/BPASmartClient/Control/FoodMenu.xaml.cs
new file mode 100644
index 00000000..245a4e39
--- /dev/null
+++ b/BPASmartClient/Control/FoodMenu.xaml.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+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 Control
+{
+ ///
+ /// FoodMenu.xaml 的交互逻辑
+ ///
+ public partial class FoodMenu : UserControl
+ {
+ public FoodMenu()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/BPASmartClient/Control/FoodMenuView.xaml b/BPASmartClient/Control/FoodMenuView.xaml
index 7e2efe5b..f7b0fd57 100644
--- a/BPASmartClient/Control/FoodMenuView.xaml
+++ b/BPASmartClient/Control/FoodMenuView.xaml
@@ -6,10 +6,8 @@
xmlns:local="clr-namespace:Control"
xmlns:vm="clr-namespace:BPASmartClient.ViewModel;assembly=BPASmartClient.ViewModel"
mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
-
-
-
+ d:DesignHeight="850" d:DesignWidth="800">
+
@@ -23,6 +21,7 @@
+
@@ -47,11 +46,12 @@
+ CommandParameter="{Binding .}"/>
+
diff --git a/BPASmartClient/Control/FoodMenuView.xaml.cs b/BPASmartClient/Control/FoodMenuView.xaml.cs
index 6cc782da..33bd5be3 100644
--- a/BPASmartClient/Control/FoodMenuView.xaml.cs
+++ b/BPASmartClient/Control/FoodMenuView.xaml.cs
@@ -1,4 +1,5 @@
-using System;
+using BPASmartClient.ViewModel;
+using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
@@ -21,6 +22,7 @@ namespace BPASmartClient.Control
public FoodMenuView()
{
InitializeComponent();
+ this.DataContext = new FoodMenuViewModel();
}
}
}
diff --git a/BPASmartClient/MainWindow.xaml b/BPASmartClient/MainWindow.xaml
index 35bc41c3..69810d4f 100644
--- a/BPASmartClient/MainWindow.xaml
+++ b/BPASmartClient/MainWindow.xaml
@@ -80,6 +80,14 @@
Content="订单监视"
Cursor="Hand"
Tag="OrderStatusView" />
+
diff --git a/DosingSystem/Model/DeviceInquire.cs b/DosingSystem/Model/DeviceInquire.cs
index d674e6c9..8b6902e7 100644
--- a/DosingSystem/Model/DeviceInquire.cs
+++ b/DosingSystem/Model/DeviceInquire.cs
@@ -87,14 +87,13 @@ namespace BPASmartClient.DosingSystem
private void TestData()
{
- //aa(1, "盐");
- //aa(2, "郫县豆瓣");
- //aa(3, "芥菜");
- //aa(4, "调味剂");
- //aa(5, "香料");
- //aa(6, "鸡精");
- //aa(7, "味精");
-
+ aa(1, "盐");
+ aa(2, "郫县豆瓣");
+ aa(3, "芥菜");
+ aa(4, "调味剂");
+ aa(5, "香料");
+ aa(6, "鸡精");
+ aa(7, "味精");
for (int i = 0; i < 8; i++)
{
DeviceLists.TryAdd($"192.168.1.{i + 1}", new DeviceStatus() { DeviceName = $"测试设备{i + 1}" });
@@ -144,7 +143,7 @@ namespace BPASmartClient.DosingSystem
{
if (!string.IsNullOrEmpty(Json.Data.BaseParModel.NetworkSegAddress)) IPSegment = Json.Data.BaseParModel.NetworkSegAddress;
else Json.Data.BaseParModel.NetworkSegAddress = IPSegment;
- //TestData();
+ TestData();
IpAddressLines();
SiemensDevice.GetInstance.Connect(Json.Data.BaseParModel.DeviceAddress);
DeviceDataInit();
diff --git a/DosingSystem/View/DeviceMaterialParView.xaml b/DosingSystem/View/DeviceMaterialParView.xaml
index 0a20bd8d..0d8cdd3a 100644
--- a/DosingSystem/View/DeviceMaterialParView.xaml
+++ b/DosingSystem/View/DeviceMaterialParView.xaml
@@ -62,8 +62,7 @@