diff --git a/BPA.SingleDevice/Business/DeviceAbs.cs b/BPA.SingleDevice/Business/DeviceAbs.cs index 2509b57..43f6b80 100644 --- a/BPA.SingleDevice/Business/DeviceAbs.cs +++ b/BPA.SingleDevice/Business/DeviceAbs.cs @@ -16,21 +16,23 @@ namespace BPA.SingleDevice.Business { string IpAddress { get; set; } EDeviceType DeviceType { get; set; } + int Port { get; set; } public Action Complete { get; set; } ModbusTcp mt { get; set; } = new ModbusTcp(); public Action ArrivalFingerPos { get; set; } public bool AllowBatching { get; set; } public bool[] DeviceStationDetection { get; set; } = new bool[4]; - public void SetPar(string ip, EDeviceType deviceType) + public void SetPar(string ip, EDeviceType deviceType, int port = 502) { IpAddress = ip; DeviceType = deviceType; + Port = port; } public void Start() { - mt.WithModbusTcp(IpAddress).UseConnected(() => + mt.WithModbusTcp(IpAddress, Port).UseConnected(() => { TaskManage.GetInstance.StartLong(new Action(() => { diff --git a/BPA.SingleDevice/Business/MainControl.cs b/BPA.SingleDevice/Business/MainControl.cs index a707f7c..214f748 100644 --- a/BPA.SingleDevice/Business/MainControl.cs +++ b/BPA.SingleDevice/Business/MainControl.cs @@ -49,6 +49,7 @@ namespace BPA.SingleDevice.Business { if (GlobalData.GoodsModels.TryDequeue(out GoodsModel gm)) { + //对设备进行分组,筛选出对应设备所需要的料仓中的原料信息 var res = gm.RawMaters.GroupBy(p => p.DeviceNum).ToDictionary(p => p.Key, p => p.ToList()); res.ToList().ForEach(item => { diff --git a/BPA.SingleDevice/Helper/SqlHelper.cs b/BPA.SingleDevice/Helper/SqlHelper.cs index 553ba5f..67c8d80 100644 --- a/BPA.SingleDevice/Helper/SqlHelper.cs +++ b/BPA.SingleDevice/Helper/SqlHelper.cs @@ -151,23 +151,6 @@ namespace BPA.SingleDevice.Helper return result; } - public async Task>> GetRecipeDetailInfoAsync(string recipeName) - { - OperateResult> result = new OperateResult>(); - try - { - if (Db == null) return new OperateResult>("DB 实例为空"); - result.Content = await Db.Queryable().Where(p => p.Name == recipeName).ToListAsync(); - result.IsSuccess = true; - } - catch (Exception ex) - { - MessageLog.GetInstance.Show(ex.ToString()); - result.SetMsg(ex.ToString()); - } - return result; - } - public async Task>> GetRawMaterIds(string RecipeId) { OperateResult> result = new OperateResult>(); diff --git a/BPA.SingleDevice/Interface/IDeviceAbs.cs b/BPA.SingleDevice/Interface/IDeviceAbs.cs index 6c377d4..7869157 100644 --- a/BPA.SingleDevice/Interface/IDeviceAbs.cs +++ b/BPA.SingleDevice/Interface/IDeviceAbs.cs @@ -34,7 +34,8 @@ namespace BPA.SingleDevice.Interface /// /// /// - void SetPar(string ip, EDeviceType deviceType); + /// 端口号 + void SetPar(string ip, EDeviceType deviceType, int port = 502); /// /// 定位完成通知 diff --git a/BPA.SingleDevice/Interface/ISqlHelper.cs b/BPA.SingleDevice/Interface/ISqlHelper.cs index 128a374..ddf5e42 100644 --- a/BPA.SingleDevice/Interface/ISqlHelper.cs +++ b/BPA.SingleDevice/Interface/ISqlHelper.cs @@ -69,13 +69,6 @@ namespace BPA.SingleDevice.Interface /// Task>> GetListAsync(); - /// - /// 根据配方名称获取配方物料详细信息 - /// - /// - /// - Task>> GetRecipeDetailInfoAsync(string recipeName); - /// /// 通过配方ID获取物料ID集合 /// diff --git a/BPA.SingleDevice/View/MainView.xaml b/BPA.SingleDevice/View/MainView.xaml index cf9f3d2..9f9633e 100644 --- a/BPA.SingleDevice/View/MainView.xaml +++ b/BPA.SingleDevice/View/MainView.xaml @@ -2,10 +2,10 @@ x:Class="BPA.SingleDevice.View.MainView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:bpa="http://BPAUIControl.io/winfx/xaml/toolkit" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:BPA.SingleDevice.View" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:bpa="http://BPAUIControl.io/winfx/xaml/toolkit" xmlns:vm="clr-namespace:BPA.SingleDevice.ViewModel" Title="味魔方自动配料系统" Width="1200"