diff --git a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
index b5146049..3a68670b 100644
--- a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
+++ b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
@@ -76,6 +76,7 @@
+
@@ -88,6 +89,7 @@
+
@@ -114,6 +116,7 @@
+
@@ -186,6 +189,7 @@
+
@@ -264,10 +268,12 @@
+
+
@@ -277,6 +283,7 @@
+
@@ -296,6 +303,7 @@
+
diff --git a/BPASmartClient.CustomResource/Image/textBox.png b/BPASmartClient.CustomResource/Image/textBox.png
new file mode 100644
index 00000000..2231646c
Binary files /dev/null and b/BPASmartClient.CustomResource/Image/textBox.png differ
diff --git a/BPASmartClient.CustomResource/Image/光柱.png b/BPASmartClient.CustomResource/Image/光柱.png
new file mode 100644
index 00000000..da3a0b42
Binary files /dev/null and b/BPASmartClient.CustomResource/Image/光柱.png differ
diff --git a/BPASmartClient.CustomResource/Image/弹窗2.png b/BPASmartClient.CustomResource/Image/弹窗2.png
new file mode 100644
index 00000000..6f69f62a
Binary files /dev/null and b/BPASmartClient.CustomResource/Image/弹窗2.png differ
diff --git a/BPASmartClient.CustomResource/Image/蓝边框.png b/BPASmartClient.CustomResource/Image/蓝边框.png
new file mode 100644
index 00000000..61b3ac5a
Binary files /dev/null and b/BPASmartClient.CustomResource/Image/蓝边框.png differ
diff --git a/BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs b/BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs
index 91b14921..3c19179c 100644
--- a/BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs
@@ -12,45 +12,48 @@ namespace BPASmartClient.CustomResource.Pages.Model
{
}
+
///
/// 1 号滚筒线故障
///
- [Alarm("【1】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
+ [Alarm("【1】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort LOneRollerTrouble { get; set; }
///
/// 2 号滚筒线故障
///
- [Alarm("【2】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
+ [Alarm("【2】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort LTwoRollerTrouble { get; set; }
///
/// 3 号滚筒线故障
///
- [Alarm("【3】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
+ [Alarm("【3】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort LThreeRollerTrouble { get; set; }
///
/// 1 号炒锅滚筒运行故障
///
- [Alarm("【1】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
+ [Alarm("【1】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort FryPotOneRollerTrouble { get; set; }
///
/// 2 号炒锅滚筒运行故障
///
- [Alarm("【2】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
+ [Alarm("【2】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort FryPotTwoRollerTrouble { get; set; }
///
/// 3 号炒锅滚筒运行故障
///
- [Alarm("【3】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
+ [Alarm("【3】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort FryPotThreeRollerTrouble { get; set; }
///
/// 4 号炒锅滚筒运行故障
///
- [Alarm("【4】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
+ [Alarm("【4】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort FryPotFourRollerTrouble { get; set; }
///
/// 5 号炒锅滚筒运行故障
///
- [Alarm("【5】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
+ [Alarm("【5】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort FryPotFiveRollerTrouble { get; set; }
+
+
}
}
diff --git a/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs b/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs
index 1db6aa44..f3b0efb4 100644
--- a/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs
+++ b/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs
@@ -9,23 +9,23 @@ using System.Threading.Tasks;
namespace BPASmartClient.CustomResource.Pages.Model
{
- public class UserInfo:ObservableObject
+ public class UserInfo : ObservableObject
{
public String LastLogInTime { get; set; } = "无";
public List userTreeViewModels { get; set; }
- public string Id { get { return _id; }set { _id = value;OnPropertyChanged(); } }
+ public string Id { get { return _id; } set { _id = value; OnPropertyChanged(); } }
private string _id;
- public Permission permission { get { return _perimission; } set { _perimission = value;OnPropertyChanged(); } }
+ public Permission permission { get { return _perimission; } set { _perimission = value; OnPropertyChanged(); } }
private Permission _perimission;
- public string UserName { get { return _userName; } set { _userName = value;OnPropertyChanged(); } }
- private string _userName;
+ public string UserName { get { return _userName; } set { _userName = value; OnPropertyChanged(); } }
+ private string _userName = "admin";
- public string Password { get { return _password; } set { _password = value;OnPropertyChanged(); } }
- private string _password;
+ public string Password { get { return _password; } set { _password = value; OnPropertyChanged(); } }
+ private string _password = "admin";
public string CardId { get; set; } = String.Empty;
diff --git a/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml b/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml
index 9abfd756..5247d35a 100644
--- a/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml
+++ b/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml
@@ -373,8 +373,9 @@
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BPASmartClient.CustomResource/UserControls/BatchingMachine.xaml b/BPASmartClient.CustomResource/UserControls/BatchingMachine.xaml
new file mode 100644
index 00000000..12af351a
--- /dev/null
+++ b/BPASmartClient.CustomResource/UserControls/BatchingMachine.xaml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.CustomResource/UserControls/BatchingMachine.xaml.cs b/BPASmartClient.CustomResource/UserControls/BatchingMachine.xaml.cs
new file mode 100644
index 00000000..f4651dac
--- /dev/null
+++ b/BPASmartClient.CustomResource/UserControls/BatchingMachine.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.CustomResource.UserControls
+{
+ ///
+ /// BatchingMachine.xaml 的交互逻辑
+ ///
+ public partial class BatchingMachine : UserControl
+ {
+ public BatchingMachine()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/BPASmartClient.CustomResource/UserControls/Cylinder.xaml b/BPASmartClient.CustomResource/UserControls/Cylinder.xaml
new file mode 100644
index 00000000..97f5d6f8
--- /dev/null
+++ b/BPASmartClient.CustomResource/UserControls/Cylinder.xaml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.CustomResource/UserControls/Cylinder.xaml.cs b/BPASmartClient.CustomResource/UserControls/Cylinder.xaml.cs
new file mode 100644
index 00000000..b115ba13
--- /dev/null
+++ b/BPASmartClient.CustomResource/UserControls/Cylinder.xaml.cs
@@ -0,0 +1,31 @@
+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.CustomResource.UserControls
+{
+ ///
+ /// Cylinder.xaml 的交互逻辑
+ ///
+ public partial class Cylinder : UserControl
+ {
+ public Cylinder()
+ {
+ InitializeComponent();
+
+ }
+
+
+ }
+}
diff --git a/BPASmartClient.CustomResource/UserControls/MotorBottle.xaml b/BPASmartClient.CustomResource/UserControls/MotorBottle.xaml
index 68a35f91..35310f71 100644
--- a/BPASmartClient.CustomResource/UserControls/MotorBottle.xaml
+++ b/BPASmartClient.CustomResource/UserControls/MotorBottle.xaml
@@ -9,17 +9,23 @@
d:DesignWidth="700"
mc:Ignorable="d">
-
+
@@ -36,7 +44,10 @@
-
+
-
+
@@ -55,7 +70,11 @@
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0:0:1" />
-
+
diff --git a/BPASmartClient.Helper/BPASmartClient.Helper.csproj b/BPASmartClient.Helper/BPASmartClient.Helper.csproj
index 743e00b3..4dda4155 100644
--- a/BPASmartClient.Helper/BPASmartClient.Helper.csproj
+++ b/BPASmartClient.Helper/BPASmartClient.Helper.csproj
@@ -2,6 +2,7 @@
net6.0
+ True
diff --git a/BPASmartClient.Helper/DataRecord.cs b/BPASmartClient.Helper/DataRecord.cs
new file mode 100644
index 00000000..72c81029
--- /dev/null
+++ b/BPASmartClient.Helper/DataRecord.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Runtime.Serialization.Formatters.Binary;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.Helper
+{
+ public class DataRecord
+ {
+
+ ///
+ /// 读取序列化文件
+ ///
+ /// 需要读取序列化文件的文件名,包括后缀名
+ /// 返回序列化读取到的信息,需要自行转换成对应的类型
+ public ReadT Read(string FilePath)
+ {
+ if (File.Exists(FilePath))
+ {
+ FileStream fs = new FileStream(FilePath, FileMode.Open);
+ BinaryFormatter bf = new BinaryFormatter();
+ var res = (ReadT)bf.Deserialize(fs);
+ fs.Close();
+ return res;
+ }
+ return default;
+ }
+
+ ///
+ /// 保存序列化文件
+ ///
+ /// 需要通过序列化保存的对象
+ /// 设置保存的文件名,包括后缀名,后缀名可以自定义
+ public void Save(SaveT obj, string FileName)
+ {
+ Directory.CreateDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"AccessFile\\ProductionData"));
+ string path = $"{AppDomain.CurrentDomain.BaseDirectory}AccessFile\\ProductionData\\{FileName}";
+ if (obj != null)
+ {
+ FileStream fs = new FileStream(path, FileMode.Create);
+ BinaryFormatter bf = new BinaryFormatter();//创建一个二进制格式化器
+ bf?.Serialize(fs, obj);
+ fs.Close();
+ }
+ }
+
+ }
+}
diff --git a/BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj b/BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj
index a55223f5..8282b987 100644
--- a/BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj
+++ b/BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj
@@ -20,6 +20,7 @@
+
diff --git a/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs b/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs
index 4affbc7e..a2fe649c 100644
--- a/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs
+++ b/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs
@@ -26,8 +26,8 @@ namespace BPASmartClient.Model
///
/// 原料重量设置
///
- public uint RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } }
- private uint _mRawMaterialWeight;
+ public float RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } }
+ private float _mRawMaterialWeight;
///
@@ -86,7 +86,7 @@ namespace BPASmartClient.Model
///
/// 原料设备执行状态
- /// 1:空闲状态
+ /// 1:等待配料
/// 2:下料中
/// 3:下料完成
///
diff --git a/DosingSystem/App.xaml b/DosingSystem/App.xaml
index b4732c63..4fea0d7a 100644
--- a/DosingSystem/App.xaml
+++ b/DosingSystem/App.xaml
@@ -17,6 +17,7 @@
+
diff --git a/DosingSystem/App.xaml.cs b/DosingSystem/App.xaml.cs
index 6bece580..2ec8c014 100644
--- a/DosingSystem/App.xaml.cs
+++ b/DosingSystem/App.xaml.cs
@@ -30,12 +30,13 @@ namespace BPASmartClient.DosingSystem
MenuInit();
DataInit();
DeviceInquire.GetInstance.Init();//配料机设备上线监听,设备列表初始化
-
+ //NewMaterialDeviceParView newMaterialDeviceParView = new NewMaterialDeviceParView();
+ //newMaterialDeviceParView.ShowDialog();
MainView mv = new MainView();
//mv.Show();
LoginView lv = new LoginView();
var res = lv.ShowDialog();
- if (res != null && res == true)
+ if (res != null && res == true)
{
MessageLog.GetInstance.ShowUserLog("用户登录");
mv.Show();
diff --git a/DosingSystem/Converter/RunStatusConvert.cs b/DosingSystem/Converter/RunStatusConvert.cs
new file mode 100644
index 00000000..7ac57ada
--- /dev/null
+++ b/DosingSystem/Converter/RunStatusConvert.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace BPASmartClient.DosingSystem.Converter
+{
+ public class RunStatusConvert : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is int tempValue)
+ {
+ if (tempValue == 1) return ":等待配料";
+ if (tempValue == 2) return ":配料中";
+ if (tempValue == 3) return ":配料完成";
+ }
+ return ":未知";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/DosingSystem/Model/DeviceAddress.cs b/DosingSystem/Model/DeviceAddress.cs
index ba25028c..7752c667 100644
--- a/DosingSystem/Model/DeviceAddress.cs
+++ b/DosingSystem/Model/DeviceAddress.cs
@@ -16,27 +16,72 @@ namespace BPASmartClient.DosingSystem.Model
///
/// 料仓重量反馈起始地址
///
- public static string WeightFeedback { get; set; } = "LW52";//LW204
+ public static string WeightFeedback { get; set; } = "LW52";
///
/// 重量设置地址
///
- public static string WeightSet { get; set; } = "LW21";//LW200
+ public static string WeightSet { get; set; } = "LW21";
///
/// 启动信号地址
///
- public static string Start { get; set; } = "LW20";//LW210
+ public static string Start { get; set; } = "LW20";
///
/// 下料重量反馈地址
///
- public static string CutWeightFeedback { get; set; } = "LW54";//LW202
+ public static string CutWeightFeedback { get; set; } = "LW54";
+
+ ///
+ /// 设备编号
+ ///
+ public static string DeviceNum { get; set; } = "LW57";
///
/// 设备运行状态地址
///
- public static string RunStatus { get; set; } = "LW51";//LW206
+ public static string RunStatus { get; set; } = "LW60";
+
+ ///
+ /// 慢加重量
+ ///
+ public static string SlowlyAddWeight { get; set; } = "LW23";
+
+ ///
+ /// 提前关阀重量
+ ///
+ public static string PreCloseValveWeight { get; set; } = "LW25";
+
+ ///
+ /// 快加速度
+ ///
+ public static string RapidAcceleration { get; set; } = "LW27";
+
+ ///
+ /// 慢加速度
+ ///
+ public static string SlowAcceleration { get; set; } = "LW29";
+
+ ///
+ /// 伺服手动速度
+ ///
+ public static string ServoManualSpeed { get; set; } = "LW31";
+
+ ///
+ /// 料仓上限重量
+ ///
+ public static string SiloUpperLimitWeight { get; set; } = "LW33";
+
+ ///
+ /// 料仓下限重量
+ ///
+ public static string LowerLimitWeightOfSilo { get; set; } = "LW35";
+
+ ///
+ /// 搅拌速度
+ ///
+ public static string StirringSpeed { get; set; } = "LW37";
}
diff --git a/DosingSystem/Model/DeviceInquire.cs b/DosingSystem/Model/DeviceInquire.cs
index db5dad76..a1258241 100644
--- a/DosingSystem/Model/DeviceInquire.cs
+++ b/DosingSystem/Model/DeviceInquire.cs
@@ -87,7 +87,7 @@ namespace BPASmartClient.DosingSystem.Model
DS.modbusTcp.ConnectOk = new Action(() =>
{
- string DeviceName = DS.modbusTcp.GetString(DeviceAddress.DeviceName, 20);//读取设备名称
+ string DeviceName = DS.modbusTcp.GetString(DeviceAddress.DeviceName, 20).Trim();//读取设备名称
if (DeviceName.Length > 0)
{
DeviceLists.TryAdd(ip, DS);
@@ -111,9 +111,9 @@ namespace BPASmartClient.DosingSystem.Model
}
}
}
- if(Global.DeviceRawMaterials.Count > 0)
+ if (Global.DeviceRawMaterials.Count > 0)
{
- if(Global.DeviceRawMaterials.FirstOrDefault(p=>p.RawMaterialName == DeviceName) == null)
+ if (Global.DeviceRawMaterials.FirstOrDefault(p => p.RawMaterialName == DeviceName) == null)
{
Global.DeviceRawMaterials.Add(new RawMaterialModel() { RawMaterialName = DeviceName, DeviceIp = ip ,RawMaterialSource = 1});
}
@@ -146,7 +146,7 @@ namespace BPASmartClient.DosingSystem.Model
{
DeviceListViewModel.devices.Remove(res);
var item = Global.DeviceRawMaterials.FirstOrDefault(P => P.RawMaterialName == res.DeviceName);
- if (item!=null) Global.DeviceRawMaterials.Remove(item);
+ if (item != null) Global.DeviceRawMaterials.Remove(item);
}));
if (DeviceLists.ContainsKey(ip)) DeviceLists[ip].Dispose();
@@ -176,7 +176,7 @@ namespace BPASmartClient.DosingSystem.Model
///
public RawMaterialDeviceStatus deviceStatus { get; set; } = new RawMaterialDeviceStatus();
-
+
public ModbusTcp modbusTcp = new ModbusTcp();
@@ -198,8 +198,11 @@ namespace BPASmartClient.DosingSystem.Model
}
//获取设备料仓剩余重量
- deviceStatus.WeightFeedback = this.modbusTcp.GetUint(DeviceAddress.WeightFeedback) * 10;
- deviceStatus.CutWeightFeedback = this.modbusTcp.GetUint(DeviceAddress.CutWeightFeedback) * 10;
+ deviceStatus.WeightFeedback = this.modbusTcp.GetUint(DeviceAddress.WeightFeedback);
+ var resddd = this.modbusTcp.GetUint(DeviceAddress.WeightFeedback);
+ var rrr = this.modbusTcp.Read(DeviceAddress.WeightFeedback);
+ var t = this.modbusTcp.GetReal(DeviceAddress.CutWeightFeedback);
+
Thread.Sleep(100);
}), $"{DeviceName} 开始监听", true);
}
@@ -221,11 +224,11 @@ namespace BPASmartClient.DosingSystem.Model
ThreadManage.GetInstance().StopTask($"{DeviceName} 开始监听");
}
- public void Start(uint Value)
+ public void Start(float Value)
{
if (modbusTcp.Connected)
{
- modbusTcp.SetUint(DeviceAddress.WeightSet, Value);//写入配方量
+ modbusTcp.SetReal(DeviceAddress.WeightSet, Value);//写入配方量
modbusTcp.Write(DeviceAddress.Start, (ushort)1);//设备启动写入
}
}
diff --git a/DosingSystem/Model/DevicePar.cs b/DosingSystem/Model/DevicePar.cs
new file mode 100644
index 00000000..e3e7efbc
--- /dev/null
+++ b/DosingSystem/Model/DevicePar.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmartClient.DosingSystem.Model
+{
+ public class DevicePar
+ {
+ ///
+ /// 慢加重量
+ ///
+ public float SlowlyAddWeight { get; set; }
+
+ ///
+ /// 提前关阀重量
+ ///
+ public float PreCloseValveWeight { get; set; }
+
+ ///
+ /// 快加速度
+ ///
+ public int RapidAcceleration { get; set; }
+
+ ///
+ /// 慢加速度
+ ///
+ public int SlowAcceleration { get; set; }
+
+ ///
+ /// 伺服手动速度
+ ///
+ public int ServoManualSpeed { get; set; }
+
+ ///
+ /// 料仓上限重量
+ ///
+ public int SiloUpperLimitWeight { get; set; }
+
+ ///
+ /// 料仓下限重量
+ ///
+ public int LowerLimitWeightOfSilo { get; set; }
+
+ ///
+ /// 搅拌速度
+ ///
+ public int StirringSpeed { get; set; }
+ }
+}
diff --git a/DosingSystem/Model/RecipeProcess.cs b/DosingSystem/Model/RecipeProcess.cs
new file mode 100644
index 00000000..23864689
--- /dev/null
+++ b/DosingSystem/Model/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.DosingSystem.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/DosingSystem/View/DeviceListView.xaml b/DosingSystem/View/DeviceListView.xaml
index 19d96251..7021d8db 100644
--- a/DosingSystem/View/DeviceListView.xaml
+++ b/DosingSystem/View/DeviceListView.xaml
@@ -44,15 +44,7 @@
-
-
-
-
-
-
+
@@ -129,6 +122,7 @@
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
+ Foreground="#00BEFA"
Width="130"
Height="30"
Margin="0,0,0,10"
@@ -136,8 +130,12 @@
VerticalAlignment="Bottom"
Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding IpAddress}"
- Content="修改设备名称"
- IsEnabled="{Binding IsEnable}" />
+ Content="修改原料名称"
+ IsEnabled="{Binding IsEnable}">
+
+
+
+
diff --git a/DosingSystem/View/HardwareStatusView.xaml b/DosingSystem/View/HardwareStatusView.xaml
index 7562583c..405d9e5f 100644
--- a/DosingSystem/View/HardwareStatusView.xaml
+++ b/DosingSystem/View/HardwareStatusView.xaml
@@ -21,7 +21,7 @@
-
-
+ -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -180,16 +246,21 @@
Grid.Row="1"
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
- Margin="0,0,400,0"
+ Margin="10,0,400,0"
ConveyorBeltWidth="70"
- Direction="1"
- StrokeBrush="Red"
+ Direction="0"
+ StrokeBrush="#00BEFA"
StrokeDashArray="1.5 1.5"
- StrokeFillBrush="Red"
+ StrokeFillBrush="#00BEFA"
StrokeThickness="2" />
+
+
+
+
+
-
+
diff --git a/DosingSystem/View/NewMaterialDeviceParView.xaml b/DosingSystem/View/NewMaterialDeviceParView.xaml
new file mode 100644
index 00000000..56e9ec52
--- /dev/null
+++ b/DosingSystem/View/NewMaterialDeviceParView.xaml
@@ -0,0 +1,362 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DosingSystem/View/NewMaterialDeviceParView.xaml.cs b/DosingSystem/View/NewMaterialDeviceParView.xaml.cs
new file mode 100644
index 00000000..0d14e72b
--- /dev/null
+++ b/DosingSystem/View/NewMaterialDeviceParView.xaml.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace BPASmartClient.DosingSystem.View
+{
+ ///
+ /// NewMaterialDeviceParView.xaml 的交互逻辑
+ ///
+ public partial class NewMaterialDeviceParView : Window
+ {
+ public NewMaterialDeviceParView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/DosingSystem/View/NewMaterialView.xaml b/DosingSystem/View/NewMaterialView.xaml
index 1158e4ed..a7b70333 100644
--- a/DosingSystem/View/NewMaterialView.xaml
+++ b/DosingSystem/View/NewMaterialView.xaml
@@ -1,21 +1,22 @@
-
+
-
+
@@ -24,7 +25,7 @@
-
+
+ M 0 0 L 3.5 4 L 7 0 Z
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -26,6 +399,9 @@
+
+
+
@@ -51,25 +427,28 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/FryPot_DosingSystem/View/FlowProcessView.xaml.cs b/FryPot_DosingSystem/View/FlowProcessView.xaml.cs
index 318c8402..57576935 100644
--- a/FryPot_DosingSystem/View/FlowProcessView.xaml.cs
+++ b/FryPot_DosingSystem/View/FlowProcessView.xaml.cs
@@ -1,4 +1,5 @@
using BPASmartClient.Helper;
+using FryPot_DosingSystem.Model;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -20,16 +21,93 @@ namespace FryPot_DosingSystem.View
///
public partial class FlowProcessView : Window
{
+
public FlowProcessView()
{
InitializeComponent();
this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); };
ActionManage.GetInstance.CancelRegister("CloseFlowProcessView");
- ActionManage.GetInstance.Register(new Action(() => {
+ ActionManage.GetInstance.Register(new Action(() =>
+ {
this.Close();
}), "CloseFlowProcessView");
+
+
}
-
+ private void Label_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ Label txt = sender as Label;
+ if (txt != null)
+ {
+ StackPanel oldSp = FindFirstVisualChild(itemcontrols, "stk");
+ if (oldSp != null)
+ oldSp.Background = new SolidColorBrush(Color.FromRgb(38, 76, 115));
+ StackPanel sp = VisualTreeHelper.GetParent(txt) as StackPanel;
+ sp.Background = new SolidColorBrush(Color.FromRgb(8, 20, 36));
+ ActionManage.GetInstance.Send("CurrentItemId", txt.Content);
+ }
+ }
+
+
+ public StackPanel FindFirstVisualChild(DependencyObject obj, string childName)
+ {
+ for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++)
+ {
+ DependencyObject child = VisualTreeHelper.GetChild(obj, i);
+ if (child != null && child is StackPanel && child.GetValue(NameProperty).ToString() == childName)
+ {
+ if (child is StackPanel stack && stack.Background?.ToString() == "#FF081424")
+ return stack;
+ }
+ else
+ {
+ StackPanel SP = FindFirstVisualChild(child, childName);
+ if (SP != null)
+ {
+ return SP;
+ }
+ }
+ }
+ return null;
+ }
+
+ //private void ComboBox_KeyUp(object sender, KeyEventArgs e)
+ //{
+ // var res = sender as ComboBox;
+ // Json.Read();
+
+ // if (res.Text != null && res.Text != String.Empty)
+ // {
+ // var datas = Json.Data.Names.Where(s => s.Contains(res.Text.Trim()));
+ // // var datas = Json.Data.Names.ToList().FindAll(s => s.Contains(res.Text.Trim()));
+ // if (datas.Count() > 0)
+ // {
+ // res.ItemsSource = datas;
+ // res.IsDropDownOpen = true;
+ // }
+ // else
+ // {
+ // res.IsDropDownOpen = false;
+ // }
+ // }
+ //}
+
+ //private void ComboBox_LostFocus(object sender, RoutedEventArgs e)
+ //{
+ // var res = sender as ComboBox;
+ // if (res.Text != null && res.Text != String.Empty)
+ // {
+ // if (!Json.Data.Names.Contains(res.Text.Trim()))//判断是否存在原料
+ // {
+ // //FlowProcessNames.GetInstance.Names.Add(res.Text.Trim());
+ // //Json.Data = FlowProcessNames.GetInstance;
+ // Json.Data.Names.Add(res.Text.Trim());
+ // Json.Save();
+
+ // }
+
+ // }
+ //}
}
}
diff --git a/FryPot_DosingSystem/View/MainWindow.xaml.cs b/FryPot_DosingSystem/View/MainWindow.xaml.cs
index 73691795..87151823 100644
--- a/FryPot_DosingSystem/View/MainWindow.xaml.cs
+++ b/FryPot_DosingSystem/View/MainWindow.xaml.cs
@@ -40,7 +40,7 @@ namespace FryPot_DosingSystem.View
var res = JsonConvert.DeserializeObject(o.ToString());
});
- HubHelper.GetInstance.Connect("192.168.1.56", 8089);
+ HubHelper.GetInstance.Connect("192.168.1.40", 8089);
}
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
diff --git a/FryPot_DosingSystem/View/NewRecipeView.xaml.cs b/FryPot_DosingSystem/View/NewRecipeView.xaml.cs
index a923dbfd..efac7617 100644
--- a/FryPot_DosingSystem/View/NewRecipeView.xaml.cs
+++ b/FryPot_DosingSystem/View/NewRecipeView.xaml.cs
@@ -40,7 +40,7 @@ namespace FryPot_DosingSystem.View
var res = sender as ComboBox;
Json.Read();
- if (res.Text != null)
+ if (res.Text != null && res.Text != String.Empty)
{
var datas = Json.Data.Names.Where(s => s.Contains(res.Text.Trim()));
// var datas = Json.Data.Names.ToList().FindAll(s => s.Contains(res.Text.Trim()));
@@ -59,7 +59,7 @@ namespace FryPot_DosingSystem.View
private void ComboBox_LostFocus(object sender, RoutedEventArgs e)
{
var res = sender as ComboBox;
- if (res.Text != null)
+ if (res.Text != null && res.Text != String.Empty)
{
if (!MaterialNames.GetInstance.Names.Contains(res.Text.Trim()))//判断是否存在原料
{
diff --git a/FryPot_DosingSystem/View/RecipesSendDown.xaml b/FryPot_DosingSystem/View/RecipesSendDown.xaml
new file mode 100644
index 00000000..eaa15085
--- /dev/null
+++ b/FryPot_DosingSystem/View/RecipesSendDown.xaml
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/FryPot_DosingSystem/View/RecipesSendDown.xaml.cs b/FryPot_DosingSystem/View/RecipesSendDown.xaml.cs
new file mode 100644
index 00000000..2b243032
--- /dev/null
+++ b/FryPot_DosingSystem/View/RecipesSendDown.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 FryPot_DosingSystem.View
+{
+ ///
+ /// RecipesSendDown.xaml 的交互逻辑
+ ///
+ public partial class RecipesSendDown : UserControl
+ {
+ public RecipesSendDown()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/FryPot_DosingSystem/ViewModel/DebugViewModel.cs b/FryPot_DosingSystem/ViewModel/DebugViewModel.cs
index afbcbdd8..4f8ff62a 100644
--- a/FryPot_DosingSystem/ViewModel/DebugViewModel.cs
+++ b/FryPot_DosingSystem/ViewModel/DebugViewModel.cs
@@ -22,7 +22,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand FryPotInputArrive { get; set; }
public RelayCommand FryPotEmptyRollerArrive { get; set; }
public RelayCommand LineOneTaskExit { get; set; }
-
+ public RelayCommand LineOneRecipeComSignal { get; set; }
public RelayCommand AGVLOneArrive { get; set; }
public RelayCommand AGVFryPotDownArrive { get; set; }
@@ -36,7 +36,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand FryPotTwoInputArrive { get; set; }
public RelayCommand FryPotTwoEmptyRollerArrive { get; set; }
public RelayCommand LineTwoTaskExit { get; set; }
-
+ public RelayCommand LineTwoRecipeComSignal { get; set; }
public RelayCommand AGVLTwoArrive { get; set; }
public RelayCommand AGVFryPotTwoDownArrive { get; set; }
@@ -49,6 +49,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand FryPotThreeInputArrive { get; set; }
public RelayCommand FryPotThreeEmptyRollerArrive { get; set; }
public RelayCommand LineThreeTaskExit { get; set; }
+ public RelayCommand LineThreeRecipeComSignal { get; set; }
public RelayCommand AGVLThreeArrive { get; set; }
public RelayCommand AGVFryPotThreeDownArrive { get; set; }
@@ -69,10 +70,11 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand AgvLineThreeLoadEmptyCom { get; set; }
public RelayCommand CleanPlateCallAgv { get; set; }
public RelayCommand AgvArriveCleanPlateLoc { get; set; }//下料
- public RelayCommand AgvArriveLineFourLoc { get; set; }
-
+ public RelayCommand AgvArriveCleanPlateLocCom { get; set; }//下料完成
+ public RelayCommand AgvArriveLineFourLoc { get; set; }//下料
+ public RelayCommand AgvArriveLineFourLocCom { get; set; }//4号线空桶下料完成
public RelayCommand AgvArriveCleanPlateLocLoad { get; set; }//上料
-
+ public RelayCommand AgvArriveCleanPlateLocLoadCom { get; set; }//上料完成
public RelayCommand EmptyRollerCleanTaskRestart { get; set; }
public DebugViewModel()
{
@@ -80,7 +82,31 @@ namespace FryPot_DosingSystem.ViewModel
{
ActionManage.GetInstance.Send("AgvDebug");
}));
+ AgvArriveCleanPlateLocCom = new RelayCommand(() =>
+ {
+ ActionManage.GetInstance.Send("AgvArriveCleanPlateLocCom");
+ });
+ AgvArriveLineFourLocCom = new RelayCommand(() =>
+ {
+ ActionManage.GetInstance.Send("AgvArriveLineFourLocCom");
+ });
+ AgvArriveCleanPlateLocLoadCom = new RelayCommand(() =>
+ {
+ ActionManage.GetInstance.Send("AgvArriveCleanPlateLocLoadCom");
+ });
+ LineOneRecipeComSignal = new RelayCommand(() =>
+ {
+ ActionManage.GetInstance.Send("LineOneRecipeComSignal");
+ });
+ LineTwoRecipeComSignal = new RelayCommand(() =>
+ {
+ ActionManage.GetInstance.Send("LineTwoRecipeComSignal");
+ });
+ LineThreeRecipeComSignal = new RelayCommand(() =>
+ {
+ ActionManage.GetInstance.Send("LineThreeRecipeComSignal");
+ });
EmptyRollerCleanTaskRestart = new RelayCommand(() =>
{
diff --git a/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs b/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs
index aad1f5bf..42198778 100644
--- a/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs
+++ b/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs
@@ -13,65 +13,162 @@ namespace FryPot_DosingSystem.ViewModel
internal class FlowProcessSetViewModel
{
public int Id { get; set; } = 0;
+ public static int materialNum { get; set; }
public ObservableCollection flowProcessModels { get; set; } = new ObservableCollection();
- public string currnetRecipeName { get; set;}
+ public string currentRecipeName { get; set; }
+ public static int currentItemId { get; set; }
public RelayCommand CloseWindowCommand { get; set; }
+ public ObservableCollection FlowItems { get; set; } = new ObservableCollection();
public RelayCommand ConfirmCommand { get; set; }
+ public RelayCommand AddLastFlowItemCommand { get; set; }
+ public RelayCommand AddFrontFlowItemCommand { get; set; }
+ public RelayCommand DeleteFlowItemCommand { get; set; }
public FlowProcessSetViewModel()
{
+ Json.Read();
+ // FlowProcessNames.GetInstance.Names = Json.Data.Names;
+ FlowItems = Json.Data.Names;
+ ActionManage.GetInstance.Register(new Action