修改查询状态时间为5s一查询
This commit is contained in:
		
							parent
							
								
									3b7ef9e29f
								
							
						
					
					
						commit
						f2614723e2
					
				| 
						 | 
					@ -860,7 +860,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                    bool loop = true;
 | 
					                    bool loop = true;
 | 
				
			||||||
                    while (loop)
 | 
					                    while (loop)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        await Task.Delay(3000);
 | 
					                        await Task.Delay(5000);
 | 
				
			||||||
                        bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
 | 
					                        bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
 | 
				
			||||||
                        bool state = Array.TrueForAll(boolsl, b => b == false);
 | 
					                        bool state = Array.TrueForAll(boolsl, b => b == false);
 | 
				
			||||||
                        if (state)
 | 
					                        if (state)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -285,25 +285,29 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
            //        _regionManager.RequestNavigate("ContentRegion", SelectedMenu.Children[0].PremissionPath);
 | 
					            //        _regionManager.RequestNavigate("ContentRegion", SelectedMenu.Children[0].PremissionPath);
 | 
				
			||||||
            //    }
 | 
					            //    }
 | 
				
			||||||
            //}
 | 
					            //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (!ModbusHelper.BoxOperate)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
                if (SelectedMenu != null && SelectedMenu.PremissionName == "退出")
 | 
					                if (SelectedMenu != null && SelectedMenu.PremissionName == "退出")
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    //bool[] boolArrs = ModbusHelper.GetInstance().GetAllBoxState();
 | 
					                    //bool[] boolArrs = ModbusHelper.GetInstance().GetAllBoxState();
 | 
				
			||||||
                    //bool allTrue = Array.TrueForAll(boolArrs, b => b);
 | 
					                    //bool allTrue = Array.TrueForAll(boolArrs, b => b);
 | 
				
			||||||
                    //false是关着,true是开着
 | 
					                    //false是关着,true是开着
 | 
				
			||||||
                if (!ModbusHelper.BoxOperate)
 | 
					                    //if (!ModbusHelper.BoxOperate)
 | 
				
			||||||
                {
 | 
					                    //{
 | 
				
			||||||
                        logger.Info($"用户【{Operator?.Nickname}】退出登录");
 | 
					                        logger.Info($"用户【{Operator?.Nickname}】退出登录");
 | 
				
			||||||
                        Operator = null;
 | 
					                        Operator = null;
 | 
				
			||||||
                        Reviewer = null;
 | 
					                        Reviewer = null;
 | 
				
			||||||
                        _regionManager.RequestNavigate("MainRegion", "LoginWindow");
 | 
					                        _regionManager.RequestNavigate("MainRegion", "LoginWindow");
 | 
				
			||||||
 | 
					                    //}
 | 
				
			||||||
 | 
					                    //else
 | 
				
			||||||
 | 
					                    //{
 | 
				
			||||||
 | 
					                    //    //还有药箱开着不能退出
 | 
				
			||||||
 | 
					                    //    _portUtil.SpeakAsync("请关闭药箱后再退出");
 | 
				
			||||||
 | 
					                    //    SelectedMenu = _premissionDmList[0];
 | 
				
			||||||
 | 
					                    //}
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					
 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    //还有药箱开着不能退出
 | 
					 | 
				
			||||||
                    _portUtil.SpeakAsync("请关闭药箱后再退出");
 | 
					 | 
				
			||||||
                    SelectedMenu = _premissionDmList[0];
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    //SelectedMenu.Children = SelectedMenu.Children;
 | 
					                    //SelectedMenu.Children = SelectedMenu.Children;
 | 
				
			||||||
| 
						 | 
					@ -314,6 +318,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        #region 子菜单点击
 | 
					        #region 子菜单点击
 | 
				
			||||||
        private DelegateCommand _selectionChildCommon;
 | 
					        private DelegateCommand _selectionChildCommon;
 | 
				
			||||||
        public DelegateCommand SelectionChildCommon
 | 
					        public DelegateCommand SelectionChildCommon
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -674,7 +674,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                    bool loop = true;
 | 
					                    bool loop = true;
 | 
				
			||||||
                    while (loop)
 | 
					                    while (loop)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        await Task.Delay(3000);
 | 
					                        await Task.Delay(5000);
 | 
				
			||||||
                        bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
 | 
					                        bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
 | 
				
			||||||
                        bool state = Array.TrueForAll(boolsl, b => b == false);
 | 
					                        bool state = Array.TrueForAll(boolsl, b => b == false);
 | 
				
			||||||
                        if(state)
 | 
					                        if(state)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -232,7 +232,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                        bool loop = true;
 | 
					                        bool loop = true;
 | 
				
			||||||
                        while (loop)
 | 
					                        while (loop)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            await Task.Delay(3000);
 | 
					                            await Task.Delay(5000);
 | 
				
			||||||
                            bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
 | 
					                            bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
 | 
				
			||||||
                            bool state = Array.TrueForAll(boolsl, b => b == false);
 | 
					                            bool state = Array.TrueForAll(boolsl, b => b == false);
 | 
				
			||||||
                            if (state)
 | 
					                            if (state)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue