From 5b02db498ac895d6f01398a6b9904751d8bde639 Mon Sep 17 00:00:00 2001 From: lyw <刘耀文@DESKTOP-E1TI268> Date: Sun, 6 Oct 2024 11:29:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=B8=BF=E9=B9=84=E4=B8=AD=E5=AD=A6=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BPASmartClient.Device/BaseDevice.cs | 5 ++++- .../Control_MorkSUpgradedVer.cs | 19 ++++++++++--------- BPASmartClient/App.xaml | 2 +- BPASmartClient/App.xaml.cs | 15 +++++++++++++-- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/BPASmartClient.Device/BaseDevice.cs b/BPASmartClient.Device/BaseDevice.cs index 4a19f640..716046d0 100644 --- a/BPASmartClient.Device/BaseDevice.cs +++ b/BPASmartClient.Device/BaseDevice.cs @@ -405,7 +405,10 @@ namespace BPASmartClient.Device #region 任务流程 TaskManage.GetInstance.StartLong(new Action(() => { - MainTask(); + if (IsConnected) + { + MainTask(); + } Thread.Sleep(10); }), $"MainTask:{DeviceId}", true); #endregion diff --git a/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs b/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs index 61120716..697178a5 100644 --- a/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs +++ b/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs @@ -863,15 +863,16 @@ namespace BPASmartClient.MorkSUpgradedVer { if (mORKS.RBTakeNoodleTask.ElementAt(0).Loc != 0) { - if (!mORKS.TurntableLocLists.Contains(mORKS.RBTakeNoodleTask.ElementAt(0).Loc)) - { - TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc); - } - else - { - DeviceProcessLogShow("未找到可用的物料信息"); - mORKS.TurntableLocLists.Clear(); - } + TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc); + //if (!mORKS.TurntableLocLists.Contains(mORKS.RBTakeNoodleTask.ElementAt(0).Loc)) + //{ + // TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc); + //} + //else + //{ + // DeviceProcessLogShow("未找到可用的物料信息"); + // mORKS.TurntableLocLists.Clear(); + //} } else { diff --git a/BPASmartClient/App.xaml b/BPASmartClient/App.xaml index 9a8dd9aa..13e0a8a6 100644 --- a/BPASmartClient/App.xaml +++ b/BPASmartClient/App.xaml @@ -4,7 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource" xmlns:local="clr-namespace:BPASmartClient" - xmlns:myConvert="[myConvert ]clr-namespace:MyConvert" + xmlns:myConvert="clr-namespace:MyConvert" xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"> diff --git a/BPASmartClient/App.xaml.cs b/BPASmartClient/App.xaml.cs index 8ce468d3..2e584d5c 100644 --- a/BPASmartClient/App.xaml.cs +++ b/BPASmartClient/App.xaml.cs @@ -31,7 +31,7 @@ namespace BPASmartClient protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); - InternetInfo.IsEnableNetwork = true; + InternetInfo.IsEnableNetwork = false; DataRead(); SystemHelper.GetInstance.CreateDesktopShortcut(); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; @@ -40,7 +40,7 @@ namespace BPASmartClient mainView.Show(); SplitScreenDisplay(); - NoCompleteOrderInit(); + //NoCompleteOrderInit(); ActionManage.GetInstance.Register(new Action(par => { if (par != null) @@ -149,6 +149,16 @@ namespace BPASmartClient } } + public void OrderClean() + { + Json.Data.historyOrderLists.ToList().ForEach(o => + { + if (DateTime.Now.Month- o.Date.Month>2) + { + Json.Data.historyOrderLists.Remove(o); + } + }); + } /// /// 输入读取 /// @@ -156,6 +166,7 @@ namespace BPASmartClient { Json.Read(); Json.Read(); + OrderClean(); Task.Run(new Action(() => { Sqlite.GetInstance.GetData(); })); }