diff --git a/Aucma.Scada.Business/InStoreBusiness.cs b/Aucma.Scada.Business/InStoreBusiness.cs index fb179dae..672d5915 100644 --- a/Aucma.Scada.Business/InStoreBusiness.cs +++ b/Aucma.Scada.Business/InStoreBusiness.cs @@ -94,20 +94,24 @@ namespace Aucma.Scada.Business _baseSpaceDetailService = registerServices.GetService(); _baseBomInfoService = registerServices.GetService(); _recordInStore = registerServices.GetService(); - taskHandle.InStoreFinsihEvent += TaskFeedback; + + taskHandle.InStoreFinsihEvent += InStoreFinish; + taskHandle.InStoreAnswerEvent += InStoreAnswer; + grabImage.RefreshMaterialCodeStrEvent += InStore; grabImage.RefreshLogMessageEvent += PrintLogInfoMessage; + StartPassDown(); Task.Run(() => { Thread.Sleep(6000); - for (int i = 1; i < 12; i++) + for (int i = 1; i < 4; i++) { - //InStore(appConfig.shellStoreCode, "B2360000078110600" + i.ToString().PadLeft(2, '0')); + //InStore(appConfig.shellStoreCode, "B23600000781110800" + i.ToString().PadLeft(2, '0')); //Thread.Sleep(1000*60*1); - //InStore(appConfig.linerStoreCode, "L2360000078110600" + i.ToString().PadLeft(2, '0')); - //Thread.Sleep(1000 * 60 * 1); + InStore(appConfig.linerStoreCode, "L23600000781110800" + i.ToString().PadLeft(2, '0')); + Thread.Sleep(1000 * 30); } }); @@ -159,7 +163,7 @@ namespace Aucma.Scada.Business private bool CreateInStoreTask(BaseSpaceInfo spaceInfo, string materialCode) { bool result = false; - + #region 任务赋值 RealTaskInfo realTaskInfo = new RealTaskInfo(); realTaskInfo.taskType = 1; @@ -195,26 +199,28 @@ namespace Aucma.Scada.Business private SemaphoreSlim linerSemaphore = new SemaphoreSlim(0); + /// + /// 任务下发 + /// private void StartPassDown() { + Thread.Sleep(5000); Task.Run(() => { - Thread.Sleep(5000); while (true) { PassDownShellTask(); - Thread.Sleep(1000); + Thread.Sleep(2000); } }); Task.Run(() => { - Thread.Sleep(5000); while (true) { PassDownLinerTask(); - Thread.Sleep(1000); + Thread.Sleep(2000); } }); } @@ -227,40 +233,41 @@ namespace Aucma.Scada.Business /// private void PassDownShellTask() { - RealTaskInfo taskInfo = GetAwaitSendTask(appConfig.shellStoreCode); - if (taskInfo != null) + try { - PrintLogInfoMessage($"下发箱壳入库任务:{taskInfo.taskCode};仓库{taskInfo.storeCode};货道:{taskInfo.spaceCode}"); - //taskHandle.SendShellTask_InStore(taskInfo); - - if (taskHandle.SendShellTask_InStore(taskInfo)) + RealTaskInfo taskInfo = taskInfo = _taskInfoService.GetTaskInfoByStoreCode(appConfig.shellStoreCode, appConfig.instoreTaskType); + if (taskInfo != null) { - PrintLogInfoMessage($"箱壳入库任务:{taskInfo.taskCode};下发成功,等待PLC执行反馈"); - taskInfo.taskStatus = 2; + PrintLogInfoMessage($"下发箱壳入库任务:{taskInfo.taskCode};仓库{taskInfo.storeCode};货道:{taskInfo.spaceCode}"); + + if (taskHandle.SendShellTask_InStore(taskInfo)) + { + PrintLogInfoMessage($"箱壳入库任务:{taskInfo.taskCode};下发成功,等待PLC执行反馈"); - _taskInfoService.UpdateTaskInfo(taskInfo); + shellSemaphore.Wait(); //一直堵塞直到信号量释放 - RefreshInStoreTaskEvent?.Invoke(taskInfo); + PrintLogInfoMessage($"箱壳入库任务:{taskInfo.taskCode};开始执行"); - taskHandle.WritePlc(taskInfo.storeCode, taskInfo.spaceCode, false); + taskInfo.taskStatus = 2; - shellSemaphore.Wait(); //一直堵塞直到信号量释放 + _taskInfoService.UpdateTaskInfo(taskInfo); - PrintLogInfoMessage($"箱壳入库任务:{taskInfo.taskCode};执行完成"); + RefreshInStoreTaskEvent?.Invoke(taskInfo); + } + else + { + PrintLogInfoMessage($"箱壳入库任务:{taskInfo.taskCode};下发失败,请排除PLC连接"); + } - RefreshInStoreTaskEvent?.Invoke(taskInfo,true); } else { - PrintLogInfoMessage($"箱壳入库任务:{taskInfo.taskCode};下发失败,请排除PLC连接"); + PrintLogInfoMessage("未获取到需要下发的箱壳入库任务"); } - - } - else + }catch(Exception ex) { - PrintLogInfoMessage("未获取到需要下发的箱壳入库任务"); + PrintLogErrorMessage("依次获取箱壳任务队列进行下发逻辑异常", ex); } - Thread.Sleep(3000); } /// @@ -268,121 +275,99 @@ namespace Aucma.Scada.Business /// private void PassDownLinerTask() { - RealTaskInfo taskInfo = GetAwaitSendTask(appConfig.linerStoreCode); - if (taskInfo != null) + try { - PrintLogInfoMessage($"下发内胆入库任务:{taskInfo.taskCode};仓库{taskInfo.storeCode};货道:{taskInfo.spaceCode}"); - - if (taskHandle.SendLinerTask_InStore(taskInfo)) + RealTaskInfo taskInfo = taskInfo = _taskInfoService.GetTaskInfoByStoreCode(appConfig.linerStoreCode, appConfig.instoreTaskType); + if (taskInfo != null) { - PrintLogInfoMessage($"内胆入库任务:{taskInfo.taskCode};下发成功,等待PLC执行反馈"); - taskInfo.taskStatus = 2; + PrintLogInfoMessage($"下发内胆入库任务:{taskInfo.taskCode};仓库{taskInfo.storeCode};货道:{taskInfo.spaceCode}"); - _taskInfoService.UpdateTaskInfo(taskInfo); + if (taskHandle.SendLinerTask_InStore(taskInfo)) + { + PrintLogInfoMessage($"内胆入库任务:{taskInfo.taskCode};下发成功,等待PLC执行反馈"); - RefreshInStoreTaskEvent?.Invoke(taskInfo); + linerSemaphore.Wait(); //一直堵塞直到信号量释放 - taskHandle.WritePlc(taskInfo.storeCode, taskInfo.spaceCode, false); + PrintLogInfoMessage($"内胆入库任务:{taskInfo.taskCode};开始执行"); - linerSemaphore.Wait(); //一直堵塞直到信号量释放 + taskInfo.taskStatus = 2; - PrintLogInfoMessage($"内胆入库任务:{taskInfo.taskCode};执行完成"); + _taskInfoService.UpdateTaskInfo(taskInfo); - RefreshInStoreTaskEvent?.Invoke(taskInfo,true); + RefreshInStoreTaskEvent?.Invoke(taskInfo); + } + else + { + PrintLogInfoMessage($"内胆入库任务:{taskInfo.taskCode};下发失败,请排除PLC连接"); + } } else { - PrintLogInfoMessage($"内胆入库任务:{taskInfo.taskCode};下发失败,请排除PLC连接"); + PrintLogInfoMessage("未获取到需要下发的内胆入库任务"); } - } - else + }catch(Exception ex) { - PrintLogInfoMessage("未获取到需要下发的内胆入库任务"); - + PrintLogErrorMessage("依次获取内胆任务队列进行下发逻辑异常", ex); } - Thread.Sleep(3000); } + #endregion /// - /// 获取待执行的入库任务 + /// 入库应答,PLC收到入库任务后进行应答 /// /// - /// - private RealTaskInfo GetAwaitSendTask(string storeCode) + /// + private void InStoreAnswer(string storeCode, string taskCode) { - RealTaskInfo taskInfo = null; - - try + if (storeCode == appConfig.shellStoreCode) { - taskInfo = _taskInfoService.GetTaskInfoByStoreCode(storeCode, 1); + PrintLogInfoMessage("箱壳应答成功,自动释放信号量,进行下发新任务"); + shellSemaphore.Release(); } - catch (Exception ex) + else { - PrintLogErrorMessage("获取待执行的入库任务异常", ex); - } + PrintLogInfoMessage("内胆应答成功,自动释放信号量,进行下发新任务"); - return taskInfo; + linerSemaphore.Release(); + } } /// - /// 任务反馈(入库完成) + /// 入库完成 /// /// /// - private void TaskFeedback(string storeCode,string taskCode) + private void InStoreFinish(string storeCode, string taskCode) { - if(storeCode == appConfig.shellStoreCode) + if (storeCode == appConfig.shellStoreCode) { - ShellTaskFeedback(taskCode); + PrintLogInfoMessage($"箱壳任务:{taskCode};执行完成"); + + InStoreFinishHandle(taskCode, appConfig.shellStoreCode); } else { - LinerTaskFeedback(taskCode); - } - } - - /// - /// 箱壳执行反馈 - /// - private void ShellTaskFeedback(string taskCode) - { - - PrintLogInfoMessage("箱壳执行完成,自动释放信号量"); - - InStoreFinish(taskCode, appConfig.shellStoreCode); - - shellSemaphore.Release(); - - } - - /// - /// 内胆执行反馈 - /// - private void LinerTaskFeedback(string taskCode) - { - PrintLogInfoMessage("内胆执行完成,自动释放信号量"); - - InStoreFinish(taskCode, appConfig.linerStoreCode); - - linerSemaphore.Release(); + PrintLogInfoMessage($"内胆任务:{taskCode};执行完成"); + InStoreFinishHandle(taskCode, appConfig.linerStoreCode); + } } - #endregion /// - /// 入库完成 + /// 入库完成逻辑处理 /// /// /// /// - private void InStoreFinish(string taskCode, string storeCode) + private void InStoreFinishHandle(string taskCode, string storeCode) { try { var taskInfo = _taskInfoService.GetTaskInfoByTaskCode(taskCode, storeCode); if (taskInfo != null) { + var spaceInfo = _spaceInfoService.GetSpaceInfoBySpaceCode(taskInfo.storeCode, taskInfo.spaceCode); if (spaceInfo != null) @@ -431,7 +416,7 @@ namespace Aucma.Scada.Business //清除任务信息 _taskInfoService.DeleteTaskInfo(taskCode, storeCode); } - + RefreshInStoreTaskEvent?.Invoke(taskInfo, true); } catch (Exception ex) { @@ -439,27 +424,6 @@ namespace Aucma.Scada.Business } } - /// - /// 日志输出,界面刷新同时记录文件 - /// - /// - private void PrintLogInfoMessage(string message) - { - RefreshLogMessageEvent?.Invoke(message); - logHelper.Info(message); - } - - /// - /// 异常日志输出 - /// - /// - /// - private void PrintLogErrorMessage(string message, Exception ex = null) - { - RefreshLogMessageEvent?.Invoke(message); - logHelper.Error(message, ex); - } - /// /// 截取条码 /// @@ -476,9 +440,13 @@ namespace Aucma.Scada.Business return result; } + /// + /// 获取已创建的所有入库任务 + /// + /// public List GetInStoreTask() { - return _taskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.shellStoreCode,appConfig.linerStoreCode }, 1); + return _taskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.shellStoreCode,appConfig.linerStoreCode }, appConfig.instoreTaskType); } /// @@ -507,13 +475,14 @@ namespace Aucma.Scada.Business return _spaceInfoService.GetMaterialStock(appConfig.shellStoreCode, appConfig.linerStoreCode); } + #region 通过PLC读取货道信息:在库、在途、货道状态 /// /// 通过PLC读取货道信息(在途数量、在库数量、货道状态) /// /// /// /// - private BaseSpaceInfo GetSpaceInfoByMaterialType(string storeCode,string materialType) + private BaseSpaceInfo GetSpaceInfoByMaterialType(string storeCode, string materialType) { BaseSpaceInfo result = null; @@ -527,16 +496,17 @@ namespace Aucma.Scada.Business { result = GetSpaceInfosByPlc(info); - if(result == null) + if (result == null) { - var list = _spaceInfoService.GetEmptySpaceInfo(storeCode); + var list = _spaceInfoService.GetEmptySpaceInfo(storeCode); result = GetSpaceInfosByPlc(list); } } } - }catch (Exception ex) + } + catch (Exception ex) { PrintLogErrorMessage("货道信息读取异常", ex); } @@ -569,7 +539,7 @@ namespace Aucma.Scada.Business var list = info.Where(x => x.spaceStock > 0 ? x.spaceCapacity > (x.spaceStock + x.onRouteAmount) : 1 == 1 && x.spaceStatus == 1).ToList(); - if(list.Count > 0) + if (list.Count > 0) { result = list.OrderByDescending(x => x.spaceStock).OrderBy(x => x.spaceCode).First(); } @@ -578,5 +548,29 @@ namespace Aucma.Scada.Business } return result; } + #endregion + + #region 日志输出 + /// + /// 日志输出,界面刷新同时记录文件 + /// + /// + private void PrintLogInfoMessage(string message) + { + RefreshLogMessageEvent?.Invoke(message); + logHelper.Info(message); + } + + /// + /// 异常日志输出 + /// + /// + /// + private void PrintLogErrorMessage(string message, Exception ex = null) + { + RefreshLogMessageEvent?.Invoke(message); + logHelper.Error(message, ex); + } + #endregion } } diff --git a/Aucma.Scada.Business/InStoreTaskHandle.cs b/Aucma.Scada.Business/InStoreTaskHandle.cs index a6caa076..41197e50 100644 --- a/Aucma.Scada.Business/InStoreTaskHandle.cs +++ b/Aucma.Scada.Business/InStoreTaskHandle.cs @@ -4,6 +4,7 @@ using HighWayIot.Log4net; using HighWayIot.Plc; using System; using System.Collections.Generic; +using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -39,6 +40,8 @@ namespace Aucma.Scada.Business #region 私有变量 private Dictionary _plcDictionary = new Dictionary(); + private Dictionary shellKeyValuePairs = new Dictionary(); + private Dictionary linerKeyValuePairs = new Dictionary(); /// /// 箱壳任务编号,PLC反馈后进行赋值 @@ -49,6 +52,12 @@ namespace Aucma.Scada.Business /// 内胆任务编号,PLC反馈后进行赋值 /// private string linerTaskCode = string.Empty; + + /// + /// 已下传的任务信息 + /// + private List shellTaskInfos = new List(); + private List linerTaskInfos = new List(); #endregion #region 委托事件 @@ -59,11 +68,21 @@ namespace Aucma.Scada.Business /// public delegate void InStoreFinsih(string storeCode, string taskCode); public event InStoreFinsih InStoreFinsihEvent; + + /// + /// 入库应答,PLC收到下发的入库任务后进行应答 + /// + /// + /// + public delegate void InStoreAnswer(string storeCode, string taskCode); + public event InStoreAnswer InStoreAnswerEvent; #endregion private InStoreTaskHandle() { _plcDictionary = _pool.GetAll(); + + RealReadPlcSpace(); } #region 箱壳入库任务下发处理 @@ -86,7 +105,7 @@ namespace Aucma.Scada.Business _plc.writeStringByAddress(plcConfig.in_shell_task, taskInfo.taskCode); //写入完成后读取应答字进行复位 - ReadShellAnswer_InStore(taskInfo.taskCode); + ReadShellAnswer_InStore(taskInfo); result = true; } @@ -111,7 +130,7 @@ namespace Aucma.Scada.Business /// /// 读取箱壳入库应答 /// - private void ReadShellAnswer_InStore(string taskCode) + private void ReadShellAnswer_InStore(RealTaskInfo taskInfo) { lock (string.Empty) { @@ -138,60 +157,12 @@ namespace Aucma.Scada.Business _plc.writeStringByAddress(plcConfig.in_shell_task, string.Empty); isFlag = false; - ReadShellFinish_InStore(taskCode); - } - - Thread.Sleep(1000); - } while (isFlag); - } - else - { - logHelper.Info($"仓库{appConfig.shellStoreCode};PLC未连接"); - } - } - else - { - logHelper.Info($"PLC信息为空,通过{appConfig.shellStoreCode}未获取到该仓库对应的PLC信息"); - } - }); - } - catch (Exception ex) - { - logHelper.Error("读取箱壳入库应答字异常", ex); - } - } - } - - /// - /// 读取箱壳入库完成 - /// - private void ReadShellFinish_InStore(string taskCode) - { - lock (string.Empty) - { - bool isFlag = true; - IPlc _plc = _plcDictionary[appConfig.shellStoreCode]; - shellTaskCode = taskCode; - try - { - Task.Run(() => - { - if (_plc != null) - { - if (_plc.IsConnected) - { - do - { - //读取PLC入库任务完成 - if (_plc.readInt32ByAddress(plcConfig.in_shell_finish) == 1) - { - _plc.writeInt32ByAddress(plcConfig.in_shell_finish, 0); - - //string taskCode = _plc.readStringByAddress(plcConfig.out_shell_task, 10); + WritePlc(taskInfo.storeCode, taskInfo.spaceCode, false); - InStoreFinsihEvent?.Invoke(appConfig.shellStoreCode, taskCode); + //ReadShellFinish_InStore(taskCode); + InStoreAnswerEvent?.Invoke(appConfig.shellStoreCode, taskInfo.taskCode); - isFlag = false; + shellTaskInfos.Add(taskInfo); } Thread.Sleep(1000); @@ -210,7 +181,7 @@ namespace Aucma.Scada.Business } catch (Exception ex) { - logHelper.Error("读取箱壳入库完成异常", ex); + logHelper.Error("读取箱壳入库应答字异常", ex); } } } @@ -240,7 +211,7 @@ namespace Aucma.Scada.Business _plc.writeStringByAddress(plcConfig.in_liner_task, taskInfo.taskCode); //写入完成后读取应答字进行复位 - ReadLinerAnswer_InStore(taskInfo.taskCode); + ReadLinerAnswer_InStore(taskInfo); result = true; } @@ -264,13 +235,12 @@ namespace Aucma.Scada.Business /// /// 读取内胆入库应答 /// - private void ReadLinerAnswer_InStore(string taskCode) + private void ReadLinerAnswer_InStore(RealTaskInfo taskInfo) { lock (string.Empty) { bool isFlag = true; IPlc _plc = _plcDictionary[appConfig.linerStoreCode]; - linerTaskCode = taskCode; try { Task.Run(() => @@ -293,7 +263,12 @@ namespace Aucma.Scada.Business _plc.writeStringByAddress(plcConfig.in_liner_task, string.Empty); isFlag = false; - ReadLinerFinish_InStore(taskCode); + //ReadLinerFinish_InStore(taskCode); + WritePlc(taskInfo.storeCode, taskInfo.spaceCode, false); + + InStoreAnswerEvent?.Invoke(appConfig.linerStoreCode, taskInfo.taskCode); + + linerTaskInfos.Add(taskInfo); } Thread.Sleep(1000); @@ -316,11 +291,66 @@ namespace Aucma.Scada.Business } } } + #endregion + + #region 读取PLC入库完成 Delete By Wenjy 2023-11-08 15:05:00,经讨论入库完成改为监测在途数量变化 + /// + /// 读取箱壳入库完成 + /// + /*private void ReadShellFinish_InStore(string taskCode) + { + lock (string.Empty) + { + bool isFlag = true; + IPlc _plc = _plcDictionary[appConfig.shellStoreCode]; + shellTaskCode = taskCode; + try + { + Task.Run(() => + { + if (_plc != null) + { + if (_plc.IsConnected) + { + do + { + //读取PLC入库任务完成 + if (_plc.readInt32ByAddress(plcConfig.in_shell_finish) == 1) + { + _plc.writeInt32ByAddress(plcConfig.in_shell_finish, 0); + + //string taskCode = _plc.readStringByAddress(plcConfig.out_shell_task, 10); + + InStoreFinsihEvent?.Invoke(appConfig.shellStoreCode, taskCode); + + isFlag = false; + } + + Thread.Sleep(1000); + } while (isFlag); + } + else + { + logHelper.Info($"仓库{appConfig.shellStoreCode};PLC未连接"); + } + } + else + { + logHelper.Info($"PLC信息为空,通过{appConfig.shellStoreCode}未获取到该仓库对应的PLC信息"); + } + }); + } + catch (Exception ex) + { + logHelper.Error("读取箱壳入库完成异常", ex); + } + } + }*/ /// /// 读取内胆入库完成 /// - private void ReadLinerFinish_InStore(string taskCode) + /*private void ReadLinerFinish_InStore(string taskCode) { lock (string.Empty) { @@ -368,6 +398,137 @@ namespace Aucma.Scada.Business logHelper.Error("读取内胆入库完成异常", ex); } } + }*/ + #endregion + + #region 监测PLC在途数量变化,完成入库任务 + + private void RealReadPlcSpace() + { + Thread.Sleep(5000); + Task.Run(() => + { + while (true) + { + RealReadShellPlcSpace(); + + Thread.Sleep(500); + } + }); + + Task.Run(() => + { + while (true) + { + RealReadLinerPlcSpace(); + + Thread.Sleep(500); + } + }); + } + + /// + /// 读取箱壳已下发任务的货道信息,读取后将货道编号及在途数量写入Dictionary进行比较,在途数减少则入库完成 + /// + private void RealReadShellPlcSpace() + { + if (shellTaskInfos != null) + { + List spaceCodes = shellTaskInfos.Select(x => x.spaceCode).Distinct().ToList(); + + for (int i = 0; i < spaceCodes.Count; i++) + { + + string spaceCode = spaceCodes[i]; + + BaseSpaceInfo spaceInfo = new BaseSpaceInfo() { storeCode = appConfig.shellStoreCode, spaceCode = spaceCode }; + + spaceInfo = ReadSpaceInfoByPlc(spaceInfo); + + if (shellKeyValuePairs.ContainsKey(spaceInfo.spaceCode)) + { + shellKeyValuePairs.TryGetValue(spaceInfo.spaceCode, out int value); + //判断前次读取的数据和当前数据,如果前次数据大于当前数据则代表入库完成,然后筛选任务中对应货道的首个任务进行完成 + //如果前次数据不大于当前数据则更新字典中存放的数据 + if (value > spaceInfo.onRouteAmount) + { + //筛选任务 + var list = shellTaskInfos.Where(x => x.spaceCode == spaceInfo.spaceCode).ToList(); + if (list.Count > 0) + { + RealTaskInfo taskInfo = list.OrderBy(x => x.createTime).First(); + + InStoreFinsihEvent?.Invoke(taskInfo.storeCode, taskInfo.taskCode); + + shellTaskInfos.Remove(taskInfo); + } + shellKeyValuePairs.Remove(spaceInfo.spaceCode); + } + else + { + shellKeyValuePairs[spaceInfo.spaceCode] = spaceInfo.onRouteAmount; + } + + } + else + { + shellKeyValuePairs.Add(spaceInfo.spaceCode, spaceInfo.onRouteAmount); + } + } + + } + } + + /// + /// 读取内胆已下发任务的货道信息,读取后将货道编号及在途数量写入Dictionary进行比较,在途数减少则入库完成 + /// + private void RealReadLinerPlcSpace() + { + if (linerTaskInfos != null) + { + List spaceCodes = linerTaskInfos.Select(x => x.spaceCode).Distinct().ToList(); + + for (int i = 0; i < spaceCodes.Count; i++) + { + + string spaceCode = spaceCodes[i]; + + BaseSpaceInfo spaceInfo = new BaseSpaceInfo() { storeCode = appConfig.linerStoreCode, spaceCode = spaceCode }; + + spaceInfo = ReadSpaceInfoByPlc(spaceInfo); + + if (linerKeyValuePairs.ContainsKey(spaceInfo.spaceCode)) + { + linerKeyValuePairs.TryGetValue(spaceInfo.spaceCode, out int value); + //判断前次读取的数据和当前数据,如果前次数据大于当前数据则代表入库完成,然后筛选任务中对应货道的首个任务进行完成 + //如果前次数据不大于当前数据则更新字典中存放的数据 + if (value > spaceInfo.onRouteAmount) + { + //筛选任务 + var list = linerTaskInfos.Where(x => x.spaceCode == spaceInfo.spaceCode).ToList(); + if (list.Count > 0) + { + RealTaskInfo taskInfo = list.OrderBy(x => x.createTime).First(); + + InStoreFinsihEvent?.Invoke(taskInfo.storeCode, taskInfo.taskCode); + + linerTaskInfos.Remove(taskInfo); + } + linerKeyValuePairs.Remove(spaceInfo.spaceCode); + } + else + { + linerKeyValuePairs[spaceInfo.spaceCode] = spaceInfo.onRouteAmount; + } + + } + else + { + linerKeyValuePairs.Add(spaceInfo.spaceCode, spaceInfo.onRouteAmount); + } + } + + } } #endregion @@ -415,7 +576,7 @@ namespace Aucma.Scada.Business if (flag) { _plc.writeInt32ByAddress(spaceAddress.onStore, spaceStock + 1); - _plc.writeInt32ByAddress(spaceAddress.onRoute, onRouteAmount - 1); + //_plc.writeInt32ByAddress(spaceAddress.onRoute, onRouteAmount - 1); } else { diff --git a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll index 0b7054e3..21955b4c 100644 Binary files a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll and b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll differ diff --git a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb index 638c9b6d..bab5843c 100644 Binary files a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb and b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb differ diff --git a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll index 0b7054e3..21955b4c 100644 Binary files a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll and b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll differ diff --git a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb index 638c9b6d..bab5843c 100644 Binary files a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb and b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb differ diff --git a/Aucma.Scada.UI/bin/Debug/config/Plc.Ini b/Aucma.Scada.UI/bin/Debug/config/Plc.Ini index 44139439..ba20d718 100644 --- a/Aucma.Scada.UI/bin/Debug/config/Plc.Ini +++ b/Aucma.Scada.UI/bin/Debug/config/Plc.Ini @@ -8,14 +8,12 @@ [shell_inStore_address] =D7000 Ӧ=D7010 -=D7020 -= +=D7020 #ڵַ [liner_inStore_address] =D7000 Ӧ=D7010 -=D7020 -= +=D7020 #dzַ [shell_outStore_address] =D7100 @@ -23,7 +21,6 @@ =D7120 Ӧ=D7130 =D7140 -= #ڵַ [liner_outStore_address] =D7100 @@ -31,4 +28,3 @@ =D7120 Ӧ=D7130 =D7140 -=