diff --git a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKPlcCommAddress.cs b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKPlcCommAddress.cs index 07f5fe58..35938e45 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKPlcCommAddress.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKPlcCommAddress.cs @@ -95,7 +95,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC /// /// 工位上是否有小车 /// - public static string StationIsExistCar { get; set; } = "M4007"; + public static string StationIsExistTray { get; set; } = "M4007"; #endregion } } diff --git a/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs b/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs index 7788c885..c45af3fe 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs @@ -106,7 +106,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model string Siemens_PLC_IP = ConfigurationManager.AppSettings["Siemens_IP"]; try { - //HKDevice.HK_PLC_S7.Connect(S7.Net.CpuType.S7200Smart, HK_PLC_IP); + //HKDevice.HK_PLC_S7.Connect(S7.Net.CpuType.S71500, HK_PLC_IP); //SiemensDevice.Siemens_PLC_S7.Connect(S7.Net.CpuType.S71500, Siemens_PLC_IP); if (HKDevice.IsConnected) { @@ -190,28 +190,28 @@ namespace BPASmartClient.JXJFoodBigStation.Model /// private void AGV_Pick(int bitNum) { - if (ReadSiemens("M4003"+ bitNum) is bool && BigStation.AgvPickUpPosition == 0) + if (ReadSiemens("M4003."+ bitNum) is bool && BigStation.AgvPickUpPosition == 0) { BigStation.AgvPickUpPosition = 1; - WriteHKPLC("M4003" + bitNum, true); - WriteSiemens("M4003" + bitNum, false); + WriteHKPLC("M4003." + bitNum, true); + WriteSiemens("M4003." + bitNum, false); } - if (ReadHK("M5003" + bitNum) is bool && BigStation.AgvPickUpPosition == 1) + if (ReadHK("M5003." + bitNum) is bool && BigStation.AgvPickUpPosition == 1) { BigStation.AgvPickUpPosition = 2; - WriteSiemens("M5003" + bitNum, true); - WriteHKPLC("M5003" + bitNum,false); + WriteSiemens("M5003." + bitNum, true); + WriteHKPLC("M5003." + bitNum,false); } - if (ReadSiemens("M4006" + bitNum) is bool && BigStation.AgvPickUpPosition == 2) + if (ReadSiemens("M4006." + bitNum) is bool && BigStation.AgvPickUpPosition == 2) { BigStation.AgvPickUpPosition = 3; - WriteHKPLC("M4006" + bitNum, true); - WriteSiemens("M4006" + bitNum, false); + WriteHKPLC("M4006." + bitNum, true); + WriteSiemens("M4006." + bitNum, false); } - if (ReadHK("M5006" + bitNum) is bool && BigStation.AgvPickUpPosition == 3) + if (ReadHK("M5006." + bitNum) is bool && BigStation.AgvPickUpPosition == 3) { - WriteSiemens("M5006" + bitNum, true); - WriteHKPLC("M5006" + bitNum, false); + WriteSiemens("M5006." + bitNum, true); + WriteHKPLC("M5006." + bitNum, false); } } /// @@ -221,26 +221,26 @@ namespace BPASmartClient.JXJFoodBigStation.Model { //获取工位上是否有小车 SiemensDevice.Siemens_PLC_S7.Write(SiemensCommAddress.StationIsExistCar, (bool) - HKDevice.HK_PLC_S7.Read(HKPlcCommAddress.StationIsExistCar)); + HKDevice.HK_PLC_S7.Read(HKPlcCommAddress.StationIsExistTray)); //检测AGV到站信号 if (AGVToWorkStationQueue.Count > 0) { int index = Array.FindIndex(RemoteRecipes.ToArray(), p => p.RecipeCode == AGVToWorkStationQueue.ElementAt(0)); int TrayLocation = RemoteRecipes.ElementAt(index).TrayCode;//根据配方编号,找到托盘的ID 托盘ID1-6 - int recipe = (int)RemoteRecipes.ElementAt(index).RecipeCode; + int RecipeCode = (int)RemoteRecipes.ElementAt(index).RecipeCode; if (TrayLocation > 0 && TrayLocation < 7) { AGV_Delivery(TrayLocation - 1); if (BigStation.AgvDeliveryPosition == 5) { BigStation.AgvDeliveryPosition = 0; - AGVToWorkStationQueue.TryDequeue(out recipe); + //AGVToWorkStationQueue.TryDequeue(out RecipeCode); } AGV_Pick(TrayLocation - 1); if (BigStation.AgvPickUpPosition == 3) { BigStation.AgvPickUpPosition = 0; - AGVToWorkStationQueue.TryDequeue(out recipe); + AGVToWorkStationQueue.TryDequeue(out RecipeCode); } } } @@ -293,6 +293,8 @@ namespace BPASmartClient.JXJFoodBigStation.Model } public ConcurrentDictionary ReadHKPLCData = new ConcurrentDictionary(); public ConcurrentDictionary ReadSiemensData = new ConcurrentDictionary(); + + private void ReadSiemensCommData() { if (SiemensDevice.IsConnected) @@ -310,7 +312,13 @@ namespace BPASmartClient.JXJFoodBigStation.Model { if (HKDevice.IsConnected) { + GetSiemensStatus("", new Action((obj) => + { + if (obj is bool[] bools && bools.Length > 0) + { + } + })); } } private void GetHKStatus(string key,Action action) diff --git a/BPASmartClient.JXJFoodSmallStation/App.xaml.cs b/BPASmartClient.JXJFoodSmallStation/App.xaml.cs index f7904b09..1be9c6f8 100644 --- a/BPASmartClient.JXJFoodSmallStation/App.xaml.cs +++ b/BPASmartClient.JXJFoodSmallStation/App.xaml.cs @@ -105,6 +105,25 @@ namespace BPASmartClient.JXJFoodSmallStation }); #endregion + #region 手动控制 + ObservableCollection ManualControl = new ObservableCollection(); + ManualControl.Add(new SubMenumodel() + { + SubMenuName = "手动控制", + SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, + AssemblyName = "BPASmartClient.JXJFoodSmallStation", + ToggleWindowPath = "View.ManualControlView" + }); + + MenuManage.GetInstance.menuModels.Add(new MenuModel() + { + MainMenuIcon = "", + MainMenuName = "手动控制", + Alias = "Parameter Set", + subMenumodels = ManualControl, + }); + #endregion + #region 消息日志 ObservableCollection InfoLog = new ObservableCollection(); InfoLog.Add(new SubMenumodel() diff --git a/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj b/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj index f033f6a2..0857cd1a 100644 --- a/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj +++ b/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj @@ -32,6 +32,9 @@ $(DefaultXamlRuntime) + + $(DefaultXamlRuntime) + $(DefaultXamlRuntime) diff --git a/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs b/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs index 7f26f5d4..198b6706 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs @@ -11,20 +11,25 @@ namespace BPASmartClient.JXJFoodSmallStation.Model { public class GVL_SmallStation { + + /// + /// 往输送带下发配方完成 + /// + public bool IssueRecipeFinishStation1 { get; set; } = false; + /// - /// 配方数据 + /// 托盘1配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方 /// - public ObservableCollection RemoteRecipes = new ObservableCollection(); + public int RecipeStatusIDTray1 { get; set; } = 0; /// - /// 配方队列 + /// 托盘2配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方 /// - public ConcurrentQueue RecipeQueue = new ConcurrentQueue(); - + public int RecipeStatusIDTray2 { get; set; } = 0; /// /// 往输送带下发配方完成 /// - public bool IssueRecipeFinish { get; set; } = false; - + public bool IssueRecipeFinishStation2 { get; set; } = false; + public bool IsAllow { get; set; } = false; public bool IsAllowOut { set; get; } = false; @@ -45,5 +50,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model /// 记录AGV进站取货的指令顺序 /// public int AgvPickUpPosition { get; set; } = 0; + + + + #region AGV进出站 从HK PLC读取 + public bool Agv { get; set; } = false; + #endregion } } diff --git a/BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKPlcCommAddress.cs b/BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKPlcCommAddress.cs index 80a9398b..56bebdb7 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKPlcCommAddress.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKPlcCommAddress.cs @@ -44,11 +44,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC public static string RecipeDosingFinish { get; set; } = ""; #endregion - #region AGV进出站 + #region AGV进出站1 /// /// Agv送货 进站申请 /// - public static string DeliveryAGVApply { get; set; } = ""; + public static string DeliveryAGVApply { get; set; } = "DB3.DBX0.1"; /// /// Agv送货 进站申请 /// @@ -88,7 +88,53 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC /// /// 工位上是否有小车 /// - public static string StationIsExistCar { get; set; } = ""; + public static string StationIsExistTray { get; set; } = ""; + #endregion + #region AGV进出站2 + /// + /// Agv送货 进站申请 + /// + public static string DeliveryAGVApplyStation2 { get; set; } = ""; + /// + /// Agv送货 进站申请 + /// + public static string DeliveryAGVIsApplyStation2 { get; set; } = ""; + /// + /// Agv送货 进站顶升申请 + /// + public static string DeliveryAGVApplyJackStation2 { get; set; } = ""; + /// + /// Agv送货 进站顶升申请 + /// + public static string DeliveryAGVIsApplyJackStation2 { get; set; } = ""; + /// + /// Agv送货 送货完成 + /// + public static string DeliveryAGVFinsihStation2 { get; set; } = ""; + /// + /// Agv送货 工位上有货架 + /// + public static string StationHaveCargoStation2 { get; set; } = ""; + /// + /// Agv送货 进站申请 + /// + public static string PickAGVApplyStation2 { get; set; } = ""; + /// + /// Agv送货 进站申请 + /// + public static string PickAGVIsApplyStation2 { get; set; } = ""; + /// + /// Agv送货 取货架完成 + /// + public static string PickCargoAGVFinishStation2 { get; set; } = ""; + /// + /// Agv送货 取料完成 + /// + public static string PickAGVFinishStation2 { get; set; } = ""; + /// + /// 工位上是否有货架 + /// + public static string StationIsExistTrayStation2 { get; set; } = ""; #endregion } } diff --git a/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs b/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs index c27a8b9f..cc8e1b58 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs @@ -1,4 +1,5 @@ -using BPASmartClient.Helper; +using BPASmartClient.CustomResource.Pages.Model; +using BPASmartClient.Helper; using BPASmartClient.JXJFoodSmallStation.Model.HK_PLC; using BPASmartClient.JXJFoodSmallStation.Model.Siemens; using BPASmartClient.Modbus; @@ -21,6 +22,18 @@ namespace BPASmartClient.JXJFoodSmallStation.Model private ProcessControl() { } public ObservableCollection RawMaterials { get; set; } = new ObservableCollection(); + /// + /// 配方数据 + /// + public ObservableCollection RemoteRecipes = new ObservableCollection(); + /// + /// 托盘1 配方队列 + /// + public ConcurrentQueue RecipeTray1Queue = new ConcurrentQueue(); + /// + /// 托盘2 配方队列 + /// + public ConcurrentQueue RecipeTray2Queue = new ConcurrentQueue(); public SiemensDeviceStatus SiemensDevice = new SiemensDeviceStatus(); public HKDeviceStatus HKDevice = new HKDeviceStatus(); @@ -96,7 +109,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model { } - SmallStation.RecipeQueue.Clear(); + RecipeTray1Queue.Clear(); //Json.Data.Recipes = TestData.GetInstance.Recipes;//添加测试数据 ThreadManage.GetInstance().StartLong(new Action(() => { @@ -113,6 +126,287 @@ namespace BPASmartClient.JXJFoodSmallStation.Model } Thread.Sleep(10); }), "AGV进站送取货", true); + ThreadManage.GetInstance().StartLong(new Action(() => + { + if (HKDevice.IsConnected) + { + ManualOpen(); + ManualClose(); + } + Thread.Sleep(10); + }), "手动操作", true); + } + private void ManualOpen() + { + ActionManage.GetInstance.Register(new Action((o) => + { + if (o != null) + { + if (o.ToString().Contains("升降气缸")) + { + int index = Convert.ToInt16(o.ToString().Substring(o.ToString().Length - 1)); + switch (index) + { + case 1: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 2: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 3: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 4: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 5: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 6: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 7: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 8: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 9: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 10: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 11: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 12: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 13: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 14: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 15: + HKDevice.HK_PLC_S7.Write("", true); + break; + default: + break; + + } + } + else if (o.ToString().Contains("阻挡气缸")) + { + int index = Convert.ToInt16(o.ToString().Substring(o.ToString().Length - 1)); + switch (index) + { + case 1: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 2: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 3: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 4: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 5: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 6: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 7: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 8: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 9: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 10: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 11: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 12: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 13: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 14: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 15: + HKDevice.HK_PLC_S7.Write("", true); + break; + default: + break; + + } + } + else if (o.ToString().Contains("托盘气缸")) + { + int index = Convert.ToInt16(o.ToString().Substring(o.ToString().Length - 1)); + switch (index) + { + case 1: + HKDevice.HK_PLC_S7.Write("", true); + break; + case 2: + HKDevice.HK_PLC_S7.Write("", true); + break; + default: + break; + + } + } + + } + }), "ManualOpen", true);//根据下发的配方ID将 托盘的位置信息添加到配方中 + } + private void ManualClose() + { + ActionManage.GetInstance.Register(new Action((o) => + { + if (o != null) + { + if (o.ToString().Contains("升降气缸")) + { + int index = Convert.ToInt16(o.ToString().Substring(o.ToString().Length - 1)); + switch (index) + { + case 1: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 2: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 3: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 4: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 5: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 6: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 7: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 8: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 9: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 10: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 11: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 12: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 13: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 14: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 15: + HKDevice.HK_PLC_S7.Write("", false); + break; + default: + break; + + } + } + else if (o.ToString().Contains("阻挡气缸")) + { + int index = Convert.ToInt16(o.ToString().Substring(o.ToString().Length - 1)); + switch (index) + { + case 1: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 2: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 3: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 4: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 5: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 6: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 7: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 8: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 9: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 10: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 11: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 12: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 13: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 14: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 15: + HKDevice.HK_PLC_S7.Write("", false); + break; + default: + break; + + } + } + else if (o.ToString().Contains("托盘气缸")) + { + int index = Convert.ToInt16(o.ToString().Substring(o.ToString().Length - 1)); + switch (index) + { + case 1: + HKDevice.HK_PLC_S7.Write("", false); + break; + case 2: + HKDevice.HK_PLC_S7.Write("", false); + break; + default: + break; + + } + } + + } + }), "ManualClose", true);//根据下发的配方ID将 托盘的位置信息添加到配方中 } /// /// AGV进站送货 @@ -168,7 +462,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model } //获取工位上是否有小车 SiemensDevice.Siemens_PLC_S7.Write(SiemensCommAddress.StationIsExistCar, (bool) - HKDevice.HK_PLC_S7.Read(HKPlcCommAddress.StationIsExistCar)); + HKDevice.HK_PLC_S7.Read(HKPlcCommAddress.StationIsExistTray)); } /// /// AGV进站取货 @@ -211,59 +505,252 @@ namespace BPASmartClient.JXJFoodSmallStation.Model } private void ReceviceData() { - SmallStation.RemoteRecipes = Json.Data.Recipes; - if (Json.Data.Recipes.Count > 0) + RemoteRecipes = Json.Data.Recipes; + if (RemoteRecipes.Count > 0) { - foreach (var data in Json.Data.Recipes) + foreach (var data in RemoteRecipes) { - if(!(SmallStation.RecipeQueue.Contains(data.RecipeCode))) - SmallStation.RecipeQueue.Enqueue(data.RecipeCode); + if (data.TrayCode == 1) + { + if (!(RecipeTray1Queue.Contains(data.RecipeCode))) + RecipeTray1Queue.Enqueue(data.RecipeCode); + } + else if (data.TrayCode == 2) + { + if (!(RecipeTray2Queue.Contains(data.RecipeCode))) + RecipeTray2Queue.Enqueue(data.RecipeCode); + } } } } private void RecipeInfoToHKPLC() { - if (SmallStation.RecipeQueue.Count > 0) + if (RecipeTray1Queue.Count > 0) { - int index = Array.FindIndex(SmallStation.RemoteRecipes.ToArray(), p => p.RecipeCode == SmallStation.RecipeQueue.ElementAt(0)); - if (index >= 0 && index <= SmallStation.RemoteRecipes.Count) + int index = Array.FindIndex(RemoteRecipes.ToArray(), p => p.RecipeCode == RecipeTray1Queue.ElementAt(0)); + if (index >= 0 && index < RemoteRecipes.Count) { - long code = SmallStation.RemoteRecipes.ElementAt(index).RecipeCode; - if (RTrig.GetInstance("IsAllowDosing").Start(HKDevice.HK_PLC_S7.Read(HKPlcCommAddress.IsAllowDosing) is bool a)) + long code = RemoteRecipes.ElementAt(index).RecipeCode; + int trayCode = RemoteRecipes.ElementAt(index).TrayCode; + if (trayCode == 1 && SmallStation.RecipeStatusIDTray1 == 0) { - foreach (var item in SmallStation.RemoteRecipes.ElementAt(index).RawMaterial) + if (HKDevice.HK_PLC_S7.Read("DB3.DBX1.5") is bool && SmallStation.RecipeStatusIDTray1 == 0) { - HKDevice.StockBinPar((uint)item.RawMaterialBarrelNum, (ushort)item.RawMaterialLocation); + foreach (var item in RemoteRecipes.ElementAt(index).RawMaterial) + { + HKDevice.StockBinPar((uint)item.RawMaterialBarrelNum, (ushort)item.RawMaterialLocation); + } + HKDevice.HK_PLC_S7.Write("DB3.DBX1.5", false); + HKDevice.HK_PLC_S7.Write("DB4.DBX1.3", true); + SmallStation.RecipeStatusIDTray1 = 1; } - HKDevice.AllowDosingSignReset(); - SmallStation.IssueRecipeFinish = true; - } - if (RTrig.GetInstance("StockState").Start(HKDevice.HK_PLC_S7.Read(HKPlcCommAddress.StockState) is bool) && SmallStation.IssueRecipeFinish) - { - var res = HKDevice.HK_PLC_S7.Read(HKPlcCommAddress.StockBinLocation); - if (res != null && res is int loc) + if (HKDevice.HK_PLC_S7.Read("DB3.DBX1.3") is bool && SmallStation.RecipeStatusIDTray1 == 1) { - int loc_index = Array.FindIndex(SmallStation.RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); - double weight = SmallStation.RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; - if (loc_index >= 1 && loc_index <= 15) + HKDevice.HK_PLC_S7.Write("DB3.DBX1.3", false); + SmallStation.RecipeStatusIDTray1 = 2; + } + if (SmallStation.RecipeStatusIDTray1 == 2) + { + if (HKDevice.HK_PLC_S7.Read("DB3.DBX50.0") is bool) + { + var res = HKDevice.HK_PLC_S7.Read("DB3.DBD10"); + if (res != null && res is float loc) + { + int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); + double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; + if (loc_index >= 1 && loc_index <= 15) + { + DeviceInquire.GetInstance.GetDevice(loc_index)?.Start((uint)weight);//根据料仓编号 启动并写入每个原料重量 + SmallStation.StockInIsWork = loc_index; + HKDevice.HK_PLC_S7.Write("DB3.DBX50.0", false); + } + } + } + else if(HKDevice.HK_PLC_S7.Read("DB3.DBX50.1") is bool) + { + var res = HKDevice.HK_PLC_S7.Read("DB3.DBD14"); + if (res != null && res is float loc) + { + int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); + double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; + if (loc_index >= 1 && loc_index <= 15) + { + DeviceInquire.GetInstance.GetDevice(loc_index)?.Start((uint)weight);//启动并写入每个原料重量 + SmallStation.StockInIsWork = loc_index; + HKDevice.HK_PLC_S7.Write("DB3.DBX50.1", false); + } + } + } + else if (HKDevice.HK_PLC_S7.Read("DB3.DBX50.2") is bool) + { + var res = HKDevice.HK_PLC_S7.Read("DB3.DBD18"); + if (res != null && res is float loc) + { + int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); + double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; + if (loc_index >= 1 && loc_index <= 15) + { + DeviceInquire.GetInstance.GetDevice(loc_index)?.Start((uint)weight);//启动并写入每个原料重量 + SmallStation.StockInIsWork = loc_index; + HKDevice.HK_PLC_S7.Write("DB3.DBX50.2", false); + } + } + } + else if (HKDevice.HK_PLC_S7.Read("DB3.DBX50.3") is bool) + { + var res = HKDevice.HK_PLC_S7.Read("DB3.DBD22"); + if (res != null && res is float loc) + { + int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); + double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; + if (loc_index >= 1 && loc_index <= 15) + { + DeviceInquire.GetInstance.GetDevice(loc_index)?.Start((uint)weight);//启动并写入每个原料重量 + SmallStation.StockInIsWork = loc_index; + HKDevice.HK_PLC_S7.Write("DB3.DBX50.3", false); + } + } + } + for (int i = 1; i < 16; i++) { - //DeviceInquire.GetInstance.GetDeviceObject(loc_index)?.Start((uint)weight);//启动并写入每个原料重量 - SmallStation.StockInIsWork = loc_index; - HKDevice.StockStateSignReset(); + if (DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3) + { + DeviceInquire.GetInstance.GetDevice(i).StatusReset(); + if (i >= 1 && i <= 8) + { + HKDevice.HK_PLC_S7.Write("DB4.DBX30."+ (i-1), true); + } + else if (i >= 9 && i <= 15) + { + HKDevice.HK_PLC_S7.Write("DB4.DBX31." + (i - 9), true); + } + } + } + if (HKDevice.HK_PLC_S7.Read("DB3.DBX1.1") is bool) + { + var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeCode == code); + MessageLog.GetInstance.ShowRunLog($"托盘1 配方{res.RecipeName}配料完成"); + Json.Data.Recipes.Remove(res); + RecipeTray1Queue.TryDequeue(out code); + HKDevice.HK_PLC_S7.Write("DB3.DBX1.1", false); + SmallStation.RecipeStatusIDTray1 = 0; } } - } - /*if (RTrig.GetInstance("OutRawMaterialFinish").Start(DeviceInquire.GetInstance.GetDeviceObject(SmallStation.StockInIsWork).modbusTcp.Read(DeviceAddress.OutRawMaterialFinish) is bool)) + } + } + } + if (RecipeTray2Queue.Count > 0) + { + int index = Array.FindIndex(RemoteRecipes.ToArray(), p => p.RecipeCode == RecipeTray2Queue.ElementAt(0)); + if (index >= 0 && index < RemoteRecipes.Count) + { + long code = RemoteRecipes.ElementAt(index).RecipeCode; + int trayCode = RemoteRecipes.ElementAt(index).TrayCode; + if (trayCode == 2 && SmallStation.RecipeStatusIDTray2 == 0) { - HKDevice.SingleDosing((uint)SmallStation.StockInIsWork); - DeviceInquire.GetInstance.GetDeviceObject(SmallStation.StockInIsWork).OutRawMaterialReset(); + if (HKDevice.HK_PLC_S7.Read("DB3.DBX1.6") is bool && SmallStation.RecipeStatusIDTray2 == 0) + { + foreach (var item in RemoteRecipes.ElementAt(index).RawMaterial) + { + HKDevice.StockBinPar((uint)item.RawMaterialBarrelNum, (ushort)item.RawMaterialLocation); + } + HKDevice.HK_PLC_S7.Write("DB3.DBX1.6", false); + HKDevice.HK_PLC_S7.Write("DB4.DBX1.4", true); + SmallStation.RecipeStatusIDTray2 = 1; + } + if (HKDevice.HK_PLC_S7.Read("DB3.DBX1.4") is bool && SmallStation.RecipeStatusIDTray2 == 1) + { + HKDevice.HK_PLC_S7.Write("DB3.DBX1.4", false); + SmallStation.RecipeStatusIDTray2 = 2; + } + if (SmallStation.RecipeStatusIDTray2 == 2) + { + if (HKDevice.HK_PLC_S7.Read("DB3.DBX50.4") is bool) + { + var res = HKDevice.HK_PLC_S7.Read("DB3.DBD26"); + if (res != null && res is float loc) + { + int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); + double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; + if (loc_index >= 1 && loc_index <= 15) + { + DeviceInquire.GetInstance.GetDevice(loc_index)?.Start((uint)weight);//根据料仓编号 启动并写入每个原料重量 + SmallStation.StockInIsWork = loc_index; + HKDevice.HK_PLC_S7.Write("DB3.DBX50.4", false); + } + } + } + else if (HKDevice.HK_PLC_S7.Read("DB3.DBX50.5") is bool) + { + var res = HKDevice.HK_PLC_S7.Read("DB3.DBD30"); + if (res != null && res is float loc) + { + int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); + double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; + if (loc_index >= 1 && loc_index <= 15) + { + DeviceInquire.GetInstance.GetDevice(loc_index)?.Start((uint)weight);//启动并写入每个原料重量 + SmallStation.StockInIsWork = loc_index; + HKDevice.HK_PLC_S7.Write("DB3.DBX50.5", false); + } + } + } + else if (HKDevice.HK_PLC_S7.Read("DB3.DBX50.6") is bool) + { + var res = HKDevice.HK_PLC_S7.Read("DB3.DBD34"); + if (res != null && res is float loc) + { + int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); + double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; + if (loc_index >= 1 && loc_index <= 15) + { + DeviceInquire.GetInstance.GetDevice(loc_index)?.Start((uint)weight);//启动并写入每个原料重量 + SmallStation.StockInIsWork = loc_index; + HKDevice.HK_PLC_S7.Write("DB3.DBX50.6", false); + } + } + } + else if (HKDevice.HK_PLC_S7.Read("DB3.DBX50.7") is bool) + { + var res = HKDevice.HK_PLC_S7.Read("DB3.DBD38"); + if (res != null && res is float loc) + { + int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); + double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; + if (loc_index >= 1 && loc_index <= 15) + { + DeviceInquire.GetInstance.GetDevice(loc_index)?.Start((uint)weight);//启动并写入每个原料重量 + SmallStation.StockInIsWork = loc_index; + HKDevice.HK_PLC_S7.Write("DB3.DBX50.7", false); + } + } + } + for (int i = 1; i < 16; i++) + { + if (DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3) + { + DeviceInquire.GetInstance.GetDevice(i).StatusReset(); + if (i >= 1 && i <= 8) + { + HKDevice.HK_PLC_S7.Write("DB4.DBX30." + (i - 1), true); + } + else if (i >= 9 && i <= 15) + { + HKDevice.HK_PLC_S7.Write("DB4.DBX31." + (i - 9), true); + } + } + } + if (HKDevice.HK_PLC_S7.Read("DB3.DBX1.2") is bool) + { + var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeCode == code); + MessageLog.GetInstance.ShowRunLog($"托盘2 配方{res.RecipeName}配料完成"); + Json.Data.Recipes.Remove(res); + RecipeTray1Queue.TryDequeue(out code); + HKDevice.HK_PLC_S7.Write("DB3.DBX1.2", false); + SmallStation.RecipeStatusIDTray2 = 0; + } + } } - if (RTrig.GetInstance("StockState").Start(HKDevice.HK_PLC_S7.Read(HKPlcCommAddress.RecipeDosingFinish) is bool)) - { - HKDevice.RecipeDosingFinishReset(); - SmallStation.RecipeQueue.TryDequeue(out code); - Json.Data.Recipes.RemoveAt(index);//制作完成,移除当前配方 - }*/ } } } diff --git a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ActionMenu.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ActionMenu.cs new file mode 100644 index 00000000..8b075561 --- /dev/null +++ b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ActionMenu.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Toolkit.Mvvm.ComponentModel; +using Microsoft.Toolkit.Mvvm.Input; + +namespace BPASmartClient.JXJFoodSmallStation.Model +{ + public class ActionMenu : ObservableObject + { + public string CommandParameter { get { return _mCommandParameter; } set { _mCommandParameter = value; OnPropertyChanged(); } } + private string _mCommandParameter; + + //public Permission[] permission { get { return _mpermission; } set { _mpermission = value; OnPropertyChanged(); } } + //private Permission[] _mpermission; + + public string MenuName { get { return _mMenuName; } set { _mMenuName = value; OnPropertyChanged(); } } + private string _mMenuName; + + + //public string NameSpace { get { return _mNameSpace; } set { _mNameSpace = value; OnPropertyChanged(); } } + //private string _mNameSpace; + + + } +} diff --git a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ConveyorServer.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ConveyorServer.cs new file mode 100644 index 00000000..f5afcca4 --- /dev/null +++ b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ConveyorServer.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Toolkit.Mvvm.ComponentModel; + +namespace BPASmartClient.JXJFoodSmallStation.Model +{ + public class ConveyorServer + { + public ConveyorServer() + { + + } + } +} diff --git a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/CylinderStatusModel.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/CylinderStatusModel.cs new file mode 100644 index 00000000..dac384d5 --- /dev/null +++ b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/CylinderStatusModel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Toolkit.Mvvm.ComponentModel; + +namespace BPASmartClient.JXJFoodSmallStation.Model +{ + public class CylinderStatusModel : ObservableObject + { + /// + /// 气缸原点信号 + /// + public bool HomeStatus { get { return _mHomeStatus; } set { _mHomeStatus = value; OnPropertyChanged(); } } + private bool _mHomeStatus; + + /// + /// 气缸到位信号 + /// + public bool InPlace { get { return _mInPlace; } set { _mInPlace = value; OnPropertyChanged(); } } + private bool _mInPlace; + + + + } +} diff --git a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceAddress.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceAddress.cs index 85307518..80fbd5c2 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceAddress.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceAddress.cs @@ -54,6 +54,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model /// public static string RunStatus { get; set; } = "LW60"; + /// + /// 出料完成,置位该信号,plc复位运行状态 + /// + public static string FinfishStatus { get; set; } = "LW40"; + /// /// 慢加重量 /// diff --git a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceCurrentStatus.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceCurrentStatus.cs index b122df2b..0cfa5646 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceCurrentStatus.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceCurrentStatus.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using Microsoft.Toolkit.Mvvm.ComponentModel; -namespace BPASmartClient.JXJFoodSmallStation +namespace BPASmartClient.JXJFoodSmallStation.Model { public class DeviceCurrentStatus : ObservableObject { diff --git a/BPASmartClient.JXJFoodSmallStation/Model/DeviceInquire.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceInquire.cs similarity index 94% rename from BPASmartClient.JXJFoodSmallStation/Model/DeviceInquire.cs rename to BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceInquire.cs index afff4ad6..9fa18cdf 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/DeviceInquire.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceInquire.cs @@ -1,19 +1,16 @@ -using BPASmartClient.Helper; -using BPASmartClient.Modbus; +using BPASmartClient.CustomResource.Pages.Model; using BPASmartClient.JXJFoodSmallStation.ViewModel; +using BPASmartClient.Helper; +using BPASmartClient.Modbus; +using BPASmartClient.Model; using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Diagnostics; +using System.Collections.ObjectModel; using System.Linq; using System.Net.NetworkInformation; -using System.Text; using System.Threading; using System.Threading.Tasks; -using BPASmartClient.CustomResource.UserControls.MessageShow; -using BPASmartClient.CustomResource.Pages.Model; -using System.Collections.ObjectModel; -using BPASmartClient.Model; namespace BPASmartClient.JXJFoodSmallStation.Model { @@ -54,10 +51,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model BottomDeviceCurrentStatuses.ElementAt(BottomIndex).DeviceNum = DeviceLists.ElementAt(i).Value.deviceStatus.DeviceNum; } - int deviceIndex = Array.FindIndex(devices.ToArray(), p => p.IpAddress == DeviceLists.ElementAt(i).Key); + int deviceIndex = Array.FindIndex(devices.ToArray(), p => p.IpAddress == DeviceLists.ElementAt(i).Key && p.DeviceName != DeviceLists.ElementAt(i).Value.DeviceName); if (deviceIndex >= 0 && deviceIndex < devices.Count) { - devices.ElementAt(i).DeviceName = DeviceLists.ElementAt(i).Value.DeviceName; + devices.ElementAt(deviceIndex).DeviceName = DeviceLists.ElementAt(i).Value.DeviceName; } } Thread.Sleep(200); @@ -66,7 +63,6 @@ namespace BPASmartClient.JXJFoodSmallStation.Model public void Init() { - devices.Add(new Devices() { DeviceName = "测试", IpAddress = "192.168.0.1" }); IpAddressLines(); DeviceDataInit(); ThreadManage.GetInstance().StartLong(new Action(() => @@ -91,6 +87,15 @@ namespace BPASmartClient.JXJFoodSmallStation.Model } return new DeviceStatus(); } + public DeviceStatus GetDevice(int location) + { + if (location > 0 && location < 16) + { + var res = DeviceLists.Values.FirstOrDefault(p => p.deviceStatus.DeviceNum == location); + if (res != null) return res; + } + return new DeviceStatus(); + } public List GetDevice() { @@ -150,7 +155,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model devices.Add(new Devices() { DeviceName = DeviceName, IpAddress = ip }); - if (TopDeviceCurrentStatuses.Count <= 8) + if (TopDeviceCurrentStatuses.Count <= 7) TopDeviceCurrentStatuses.Add(new DeviceCurrentStatus() { DeviceName = DeviceName }); else BottomDeviceCurrentStatuses.Add(new DeviceCurrentStatus() { DeviceName = DeviceName }); @@ -170,7 +175,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model { if (Global.DeviceRawMaterials.FirstOrDefault(p => p.RawMaterialName == DeviceName) == null) { - Global.DeviceRawMaterials.Add(new RawMaterialModel() { RawMaterialName = DeviceName, DeviceIp = ip, RawMaterialSource = 1 }); + Global.DeviceRawMaterials.Add(new RawMaterialModel() { RawMaterialName = DeviceName, DeviceIp = ip, RawMaterialSource = 1}); } } else @@ -235,7 +240,6 @@ namespace BPASmartClient.JXJFoodSmallStation.Model #region 对象属性声明 public string DeviceName = String.Empty; public string IpAddress => modbusTcp.IPAdress; - /// /// 设备状态 /// @@ -276,6 +280,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model AlarmHelper.Alarm.EStop2 = deviceStatus.DeviceAlarmCode.Get16bitValue(7); AlarmHelper.Alarm.SiloUpperLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(8); AlarmHelper.Alarm.SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9); + AlarmHelper.Alarm.EStop1 = true; Thread.Sleep(100); }), $"{DeviceName} 开始监听", true); } @@ -289,7 +294,8 @@ namespace BPASmartClient.JXJFoodSmallStation.Model public void StatusReset() { - this.modbusTcp.Write(DeviceAddress.RunStatus, (ushort)0); + this.modbusTcp.Write(DeviceAddress.FinfishStatus, (ushort)1); + //var res = modbusTcp.Read(DeviceAddress.RunStatus); } public void Dispose() @@ -314,7 +320,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model modbusTcp.SetUint(DeviceAddress.ServoManualSpeed, (uint)res.ServoManualSpeed); modbusTcp.SetUint(DeviceAddress.SiloUpperLimitWeight, (uint)res.SiloUpperLimitWeight); modbusTcp.SetUint(DeviceAddress.LowerLimitWeightOfSilo, (uint)res.LowerLimitWeightOfSilo); - modbusTcp.SetUint(DeviceAddress.StirringSpeed, (uint)res.StirringSpeed); + modbusTcp.SetUint(DeviceAddress.StirringSpeed, (uint)res.StirringSpeed * 100); } } } diff --git a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DevicePar.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DevicePar.cs index f402a8b1..3b083760 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DevicePar.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DevicePar.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Microsoft.Toolkit.Mvvm.ComponentModel; using System.Collections.ObjectModel; -namespace BPASmartClient.JXJFoodSmallStation +namespace BPASmartClient.JXJFoodSmallStation.Model { public class DevicePar { diff --git a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceParModel.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceParModel.cs index d768b403..73131f06 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceParModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceParModel.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using Microsoft.Toolkit.Mvvm.ComponentModel; -namespace BPASmartClient.JXJFoodSmallStation +namespace BPASmartClient.JXJFoodSmallStation.Model { public class DeviceParModel : ObservableObject { diff --git a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RecipeProcess.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RecipeProcess.cs new file mode 100644 index 00000000..053cf5d2 --- /dev/null +++ b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RecipeProcess.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Toolkit.Mvvm.ComponentModel; + +namespace BPASmartClient.JXJFoodSmallStation.Model +{ + public class RecipeProcess : ObservableObject + { + public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } } + private string _mRawMaterialName; + + + public int RawMaterialStatus { get { return _mRawMaterialStatus; } set { _mRawMaterialStatus = value; OnPropertyChanged(); } } + private int _mRawMaterialStatus; + + } +} diff --git a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeRawMaterial.cs b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeRawMaterial.cs index b012fc71..2e0bbe27 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeRawMaterial.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeRawMaterial.cs @@ -8,9 +8,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model { public class RemoteRecipeRawMaterial { - private int _mIp; public int DeviceIp { get { return _mIp; } set { _mIp = value; }} + private int _mIp; + public int RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; } } + private int _mRawMaterialName; /// /// 原料对应的桶号 /// diff --git a/BPASmartClient.JXJFoodSmallStation/View/DeviceListView.xaml b/BPASmartClient.JXJFoodSmallStation/View/DeviceListView.xaml index 2bb91f48..7b766109 100644 --- a/BPASmartClient.JXJFoodSmallStation/View/DeviceListView.xaml +++ b/BPASmartClient.JXJFoodSmallStation/View/DeviceListView.xaml @@ -60,7 +60,7 @@ + Columns="8" /> @@ -68,7 +68,9 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BPASmartClient.JXJFoodSmallStation/View/ManualControlView.xaml.cs b/BPASmartClient.JXJFoodSmallStation/View/ManualControlView.xaml.cs new file mode 100644 index 00000000..92557371 --- /dev/null +++ b/BPASmartClient.JXJFoodSmallStation/View/ManualControlView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BPASmartClient.JXJFoodSmallStation.View +{ + /// + /// ManualControlView.xaml 的交互逻辑 + /// + public partial class ManualControlView : UserControl + { + public ManualControlView() + { + InitializeComponent(); + } + } +} diff --git a/BPASmartClient.JXJFoodSmallStation/View/RecipeControlView.xaml b/BPASmartClient.JXJFoodSmallStation/View/RecipeControlView.xaml index b6282a75..453719a9 100644 --- a/BPASmartClient.JXJFoodSmallStation/View/RecipeControlView.xaml +++ b/BPASmartClient.JXJFoodSmallStation/View/RecipeControlView.xaml @@ -9,8 +9,8 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel" - d:DesignHeight="450" - d:DesignWidth="800" + d:DesignHeight="800" + d:DesignWidth="1400" mc:Ignorable="d"> @@ -20,8 +20,8 @@ - - + + - - + - - + + - - + + - - - - - - - + - + - + + - + - + - + - - - - - - - - + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - - --> - + + + + - + - + - + + + + - - - + + + - - - - + + + + - - + + + + - - + + - - + + - - - + + + - - -