diff --git a/Admin.Core.Model/Model_New/RecordSidePanelComplate.cs b/Admin.Core.Model/Model_New/RecordSidePanelComplate.cs index 27cf817e..9cbae34c 100644 --- a/Admin.Core.Model/Model_New/RecordSidePanelComplate.cs +++ b/Admin.Core.Model/Model_New/RecordSidePanelComplate.cs @@ -10,7 +10,7 @@ namespace Admin.Core.Model /// /// 完成记录 /// - [SugarTable("RECORD_SIDEPANEL_COMPLAte", "AUCMA_SCADA")] + [SugarTable("RECORD_SIDEPANEL_COMPLATE", "AUCMA_SCADA")] public class RecordSidePanelComplate { /// diff --git a/Aucma.Core.HwPLc/Impl/MelsecPlc.cs b/Aucma.Core.HwPLc/Impl/MelsecPlc.cs index 4ac238a4..a6648ecc 100644 --- a/Aucma.Core.HwPLc/Impl/MelsecPlc.cs +++ b/Aucma.Core.HwPLc/Impl/MelsecPlc.cs @@ -76,7 +76,7 @@ namespace Aucma.Core.HwPLc /// public bool Connect(string iP, int port) { - melsecMcNet.IpAddress = iP;//正式环境开启 + //melsecMcNet.IpAddress = iP;//正式环境开启 melsecMcNet.Port = port; // 如果网络不太理想,配置了两个端口,一个有问题,立即切换另一个的话,可以配置如下的代码 diff --git a/Aucma.Core.SheetMetal/Business/SheetMetalPlanTaskHandle.cs b/Aucma.Core.SheetMetal/Business/SheetMetalPlanTaskHandle.cs index 7b7db0dc..002d7760 100644 --- a/Aucma.Core.SheetMetal/Business/SheetMetalPlanTaskHandle.cs +++ b/Aucma.Core.SheetMetal/Business/SheetMetalPlanTaskHandle.cs @@ -110,6 +110,7 @@ public class SheetMetalPlanTaskHandle { do { + //D6030 //计划编号:D6030-D6039,物料编号:D6040-D6049,计划完成数:D6050,计划下线数:D6051,设备状态:D6052-D6056,生产节拍:D6057-D6058 byte[] info = obj.plc.Read("D6030", 59); //计划编号 diff --git a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs index 5dfe8c8a..4b73af46 100644 --- a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs @@ -23,6 +23,8 @@ using LiveCharts.Defaults; using Aucma.Core.SheetMetal.Business; using static Aucma.Core.SheetMetal.Business.SheetMetalPlanTaskHandle; using System.Threading; +using NetTaste; +using Aucma.Core.HwPLc; /* * 首页信息 * @@ -46,7 +48,7 @@ namespace Aucma.Core.SheetMetal.ViewModels TypeName="自动" }}; public Func Formatter { get; set; } - + public HwPLc.PlcModel obj = null; #region 构造函数 public IndexPageViewModel() { @@ -68,7 +70,20 @@ namespace Aucma.Core.SheetMetal.ViewModels Task.Run(() => { Thread.Sleep(5000); - //_taskHandle.SendPlanTaskToDevice(); + while (true) + { + obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("OldTypePlc1")); + if (obj!=null) + { + if (obj.plc.IsConnected) + { + _taskHandle.ReadDeviceComplate_WB(obj); + _taskHandle.ReadDeviceComplate_BB(obj); + } + } + + + } }); } #endregion @@ -188,13 +203,13 @@ namespace Aucma.Core.SheetMetal.ViewModels #region 加载DataGrid数据 private async Task LoadData() { - string productLineCode = Appsettings.app("StoreInfo", "ProductLineCode"); - var list = await _taskExecutionPlanInfoServices.QueryAsync(d => d.ProductLineCode.Contains(productLineCode)); + string productLineCode = Appsettings.app("StationInfo", "ProductLineCode"); + string stationCode = Appsettings.app("StationInfo", "StationCode"); + var list = await _taskExecutionPlanInfoServices.QueryAsync(d => d.ProductLineCode.Contains(stationCode)); if (list == null) return; var execList = list.OrderBy(d => d.ExecuteOrder); int i = 1; string planType = string.Empty; - foreach (var item in execList) { TaskExecModel task = new TaskExecModel(); diff --git a/Aucma.Core.SheetMetal/ViewModels/SplitPlanViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/SplitPlanViewModel.cs index 23c2b0e2..7fef00c1 100644 --- a/Aucma.Core.SheetMetal/ViewModels/SplitPlanViewModel.cs +++ b/Aucma.Core.SheetMetal/ViewModels/SplitPlanViewModel.cs @@ -48,7 +48,7 @@ namespace Aucma.Core.SheetMetal.ViewModels { MaterialDataGrid.Clear(); int i = 1; - string station = Appsettings.app("StoreInfo", "StationCode"); + string station = Appsettings.app("StationInfo", "StationCode"); var planlist = await _productPlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station)); var execList = await _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station)); foreach (var item in planlist) diff --git a/Aucma.Core.SheetMetal/appsettings.json b/Aucma.Core.SheetMetal/appsettings.json index 8392a81b..9ed432f5 100644 --- a/Aucma.Core.SheetMetal/appsettings.json +++ b/Aucma.Core.SheetMetal/appsettings.json @@ -119,7 +119,7 @@ "ShellStoreCode": "XKJCK-001", "LinerStoreCode": "NDJCK-001", "FoamBeforeStoreCode": "PBSCK-001", - "ProductLineCode": "1001" + "ProductLineCode": "CX_01" }, "PLCServer": [ {