diff --git a/BPASmartClient.JXJFoodBigStation/App.xaml.cs b/BPASmartClient.JXJFoodBigStation/App.xaml.cs
index 6c30552b..9d89af9c 100644
--- a/BPASmartClient.JXJFoodBigStation/App.xaml.cs
+++ b/BPASmartClient.JXJFoodBigStation/App.xaml.cs
@@ -27,8 +27,8 @@ namespace BPASmartClient.JXJFoodBigStation
base.OnStartup(e);
MenuInit();
DataInit();
- ProcessControl.GetInstance.Init();
MainView mv = new MainView();
+ ProcessControl.GetInstance.Init();
LoginView lv = new LoginView();
var res = lv.ShowDialog();
if (res != null && res == true)
@@ -134,6 +134,14 @@ namespace BPASmartClient.JXJFoodBigStation
AssemblyName = "BPASmartClient.JXJFoodBigStation",
ToggleWindowPath = "View.HardwareStatusView"
});
+ DeviceMonitor.Add(new SubMenumodel()
+ {
+ SubMenuName = "通讯状态",
+ SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
+ AssemblyName = "BPASmartClient.JXJFoodBigStation",
+ ToggleWindowPath = "View.HKPlcCommMonitorView"
+ });
+
MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "",
diff --git a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DB_Read.cs b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DB_Read.cs
index a0138be2..11f6b211 100644
--- a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DB_Read.cs
+++ b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DB_Read.cs
@@ -8,55 +8,86 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
{
public class DB_Read
{
+ [PlcComm("plc心跳上报")]
///
/// plc心跳上报
///
public bool HeartBeat { get; set; }
+ [PlcComm("配方1允许下发配方")]
///
/// 配方1允许下发配方
///
public bool IsAllowIssueRecipe1 { get; set; }
+
+ [PlcComm("配方2允许下发配方")]
public bool IsAllowIssueRecipe2 { get; set; }
+
+ [PlcComm("配方3允许下发配方")]
public bool IsAllowIssueRecipe3 { get; set; }
+
+ [PlcComm("配方4允许下发配方")]
public bool IsAllowIssueRecipe4 { get; set; }
+ [PlcComm("配方1接收配方完成")]
///
/// 配方1 接收配方完成
///
public bool ReceiveFinishRecipe1 { get; set; }
+ [PlcComm("配方2接收配方完成")]
public bool ReceiveFinishRecipe2 { get; set; }
+ [PlcComm("配方3接收配方完成")]
public bool ReceiveFinishRecipe3 { get; set; }
+ [PlcComm("配方4接收配方完成")]
public bool ReceiveFinishRecipe4 { get; set; }
-
+ [PlcComm("配方1配料完成")]
///
/// 配方1 配料完成
///
public bool Recipe1DosingFinish { get; set; }
+ [PlcComm("配方2配料完成")]
public bool Recipe2DosingFinish { get; set; }
+ [PlcComm("配方3配料完成")]
public bool Recipe3DosingFinish { get; set; }
+ [PlcComm("配方4配料完成")]
public bool Recipe4DosingFinish { get; set; }
-
+ [PlcComm("配方1托盘编号")]
///
/// 配方1 托盘编号
///
public short Recipe1TrayCode { get; set; }
+ [PlcComm("配方2托盘编号")]
public short Recipe2TrayCode { get; set; }
+ [PlcComm("配方3托盘编号")]
public short Recipe3TrayCode { get; set; }
+ [PlcComm("配方4托盘编号")]
public short Recipe4TrayCode { get; set; }
-
+ [PlcComm("料仓1实际下料重量")]
public float StockBin1ActualWeight { get; set; }
+ [PlcComm("料仓2实际下料重量")]
public float StockBin2ActualWeight { get; set; }
+ [PlcComm("料仓3实际下料重量")]
public float StockBin3ActualWeight { get; set; }
+ [PlcComm("料仓4实际下料重量")]
public float StockBin4ActualWeight { get; set; }
+ [PlcComm("料仓5实际下料重量")]
public float StockBin5ActualWeight { get; set; }
+ [PlcComm("料仓6实际下料重量")]
public float StockBin6ActualWeight { get; set; }
+ [PlcComm("料仓7实际下料重量")]
public float StockBin7ActualWeight { get; set; }
+ [PlcComm("料仓8实际下料重量")]
public float StockBin8ActualWeight { get; set; }
+ [PlcComm("料仓9实际下料重量")]
public float StockBin9ActualWeight { get; set; }
+ [PlcComm("料仓10实际下料重量")]
public float StockBin10ActualWeight { get; set; }
+ [PlcComm("料仓11实际下料重量")]
public float StockBin11ActualWeight { get; set; }
+ [PlcComm("料仓12实际下料重量")]
public float StockBin12ActualWeight { get; set; }
+ [PlcComm("料仓13实际下料重量")]
public float StockBin13ActualWeight { get; set; }
+ [PlcComm("料仓14实际下料重量")]
public float StockBin14ActualWeight { get; set; }
}
}
diff --git a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs
index c056e608..aa47784a 100644
--- a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs
+++ b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs
@@ -30,6 +30,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
if (res1 != null && res1 is DB_Read data1)
{
PlcRead = data1;
+ GVL_BigStation.HeartBeatFromPlc = data1.HeartBeat;//读取plc心跳
}
if (res2 != null && res2 is StockBinName data2)
{
diff --git a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/PlcCommAttribute.cs b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/PlcCommAttribute.cs
new file mode 100644
index 00000000..38ac837a
--- /dev/null
+++ b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/PlcCommAttribute.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
+{
+ [AttributeUsage(AttributeTargets.Property)]
+ public sealed class PlcCommAttribute:Attribute
+ {
+ public PlcCommAttribute(string describe)
+ {
+ Describe = describe;
+ }
+ public string Describe { get; set; }
+ }
+}
diff --git a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/StockBinName.cs b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/StockBinName.cs
index 69529513..d3fc305f 100644
--- a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/StockBinName.cs
+++ b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/StockBinName.cs
@@ -10,32 +10,32 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
public class StockBinName
{
[Siemens(6)]
- public string RawMaterialName1 { get; set; }
+ public string RawMaterialName1 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName2 { get; set; }
+ public string RawMaterialName2 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName3 { get; set; }
+ public string RawMaterialName3 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName4 { get; set; }
+ public string RawMaterialName4 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName5 { get; set; }
+ public string RawMaterialName5 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName6 { get; set; }
+ public string RawMaterialName6 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName7 { get; set; }
+ public string RawMaterialName7 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName8 { get; set; }
+ public string RawMaterialName8 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName9 { get; set; }
+ public string RawMaterialName9 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName10 { get; set; }
+ public string RawMaterialName10 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName11 { get; set; }
+ public string RawMaterialName11 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName12 { get; set; }
+ public string RawMaterialName12 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName13 { get; set; }
+ public string RawMaterialName13 { get; set; } = "";
[Siemens(6)]
- public string RawMaterialName14 { get; set; }
+ public string RawMaterialName14 { get; set; } = "";
}
}
diff --git a/BPASmartClient.JXJFoodBigStation/Model/PlcVarMonitor.cs b/BPASmartClient.JXJFoodBigStation/Model/PlcVarMonitor.cs
new file mode 100644
index 00000000..b7e7110b
--- /dev/null
+++ b/BPASmartClient.JXJFoodBigStation/Model/PlcVarMonitor.cs
@@ -0,0 +1,32 @@
+using Microsoft.Toolkit.Mvvm.ComponentModel;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.JXJFoodBigStation.Model
+{
+ public class PlcVarMonitor: ObservableObject
+ {
+ private int _serialNum;
+ public int SerialNum { get { return _serialNum; } set { _serialNum = value;OnPropertyChanged(); } }
+
+ private string _variable;
+ public string Variable { get { return _variable; } set { _variable = value; OnPropertyChanged(); } }
+
+ private string _address;
+ public string Address { get { return _address; } set { _address = value; OnPropertyChanged(); } }
+
+ private string _type;
+ public string Type { get { return _type; } set { _type = value; OnPropertyChanged(); } }
+
+ private string _describe;
+ public string Describe { get { return _describe; } set { _describe = value; OnPropertyChanged(); } }
+
+ private string _nowValue;
+ public string NowValue { get { return _nowValue; } set { _nowValue = value; OnPropertyChanged(); } }
+ private string _setValue;
+ public string SetValue { get { return _setValue; } set { _setValue = value; OnPropertyChanged(); } }
+ }
+}
diff --git a/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs b/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
index a716d295..9bda9e19 100644
--- a/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
+++ b/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
@@ -24,27 +24,47 @@ namespace BPASmartClient.JXJFoodBigStation.Model
public HKDeviceStatus HKDevice = new HKDeviceStatus();
DL_Finish_DB FinishData = new DL_Finish_DB();
///
- /// 配方数据
+ /// 西门子配方数据
///
- public ObservableCollection Recipes = new ObservableCollection();
+ public ObservableCollection SiemensRecipes = new ObservableCollection();
///
- /// 配方数据
+ /// 本地配方数据
///
- public ObservableCollection IssuedComplete = new ObservableCollection();
+ public ObservableCollection LocalRecipes = new ObservableCollection();
+
+ ///
+ /// 配方等待执行
+ ///
+ public ObservableCollection RecipeWaitExecute = new ObservableCollection();
+ ///
+ /// 配方正在执行
+ ///
+ public ObservableCollection RecipeExecuting = new ObservableCollection();
+ ///
+ /// 配方执行完成
+ ///
+ public ObservableCollection RecipeExecuteComple = new ObservableCollection();
///
/// 原料的名称和料仓的位置对应
///
public Dictionary RawMaterialsNamePos = new Dictionary();
///
- /// 配方队列
+ /// 西门子配方队列
///
- public ConcurrentQueue RecipeQueue1 = new ConcurrentQueue();
- public ConcurrentQueue RecipeQueue2 = new ConcurrentQueue();
- public ConcurrentQueue RecipeQueue3 = new ConcurrentQueue();
- public ConcurrentQueue RecipeQueue4 = new ConcurrentQueue();
+ public ConcurrentQueue SiemensRecipeQueue1 = new ConcurrentQueue();
+ public ConcurrentQueue SiemensRecipeQueue2 = new ConcurrentQueue();
+ public ConcurrentQueue SiemensRecipeQueue3 = new ConcurrentQueue();
+ public ConcurrentQueue SiemensRecipeQueue4 = new ConcurrentQueue();
+ ///
+ /// 本地配方队列
+ ///
+ public ConcurrentQueue LocalRecipeQueue1 = new ConcurrentQueue();
+ public ConcurrentQueue LocalRecipeQueue2 = new ConcurrentQueue();
+ public ConcurrentQueue LocalRecipeQueue3 = new ConcurrentQueue();
+ public ConcurrentQueue LocalRecipeQueue4 = new ConcurrentQueue();
public void Init()
{
- testData();
+ testRawMaterialNameData();//自定义料仓名称
ActionManage.GetInstance.CancelRegister("SiemensSendRecipe");
ActionManage.GetInstance.Register(new Action