CheckQuantityByAddr2方法发指令时添加延时
This commit is contained in:
		
							parent
							
								
									ed5850523b
								
							
						
					
					
						commit
						61fae180e5
					
				| 
						 | 
					@ -16,6 +16,8 @@ namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					            bool bFlag = int.Parse(value.ToString()) == (Int32)BoardTypeEnum.single || int.Parse(value.ToString()) == (Int32)BoardTypeEnum.weigh || int.Parse(value.ToString()) == (Int32)BoardTypeEnum.weighBox || int.Parse(value.ToString()) == (Int32)BoardTypeEnum.weighSmartBox ? ReadOnlyValue : NotReadOnlyValue;
 | 
				
			||||||
 | 
					            return bFlag;
 | 
				
			||||||
            return int.Parse(value.ToString()) == (Int32)BoardTypeEnum.single || int.Parse(value.ToString()) == (Int32)BoardTypeEnum.weigh || int.Parse(value.ToString()) == (Int32)BoardTypeEnum.weighSmartBox ? ReadOnlyValue : NotReadOnlyValue;
 | 
					            return int.Parse(value.ToString()) == (Int32)BoardTypeEnum.single || int.Parse(value.ToString()) == (Int32)BoardTypeEnum.weigh || int.Parse(value.ToString()) == (Int32)BoardTypeEnum.weighSmartBox ? ReadOnlyValue : NotReadOnlyValue;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -94,6 +94,9 @@
 | 
				
			||||||
    <None Update="App.config">
 | 
					    <None Update="App.config">
 | 
				
			||||||
      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
 | 
					      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
 | 
				
			||||||
    </None>
 | 
					    </None>
 | 
				
			||||||
 | 
					    <None Update="favicon.ico">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
    <None Update="log4net.config">
 | 
					    <None Update="log4net.config">
 | 
				
			||||||
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
    </None>
 | 
					    </None>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1258,6 +1258,7 @@ namespace DM_Weight.Port
 | 
				
			||||||
            int[] res = new int[9];
 | 
					            int[] res = new int[9];
 | 
				
			||||||
            for (int i = 0; i < ColNos.Length; i++)
 | 
					            for (int i = 0; i < ColNos.Length; i++)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
					                await Task.Delay(300);
 | 
				
			||||||
                canBusSerial.DiscardInBuffer();
 | 
					                canBusSerial.DiscardInBuffer();
 | 
				
			||||||
                //var index = (int)Math.Ceiling(Convert.ToDecimal(ColNos[i]) / 3); // > 3 ? 2 : 1;
 | 
					                //var index = (int)Math.Ceiling(Convert.ToDecimal(ColNos[i]) / 3); // > 3 ? 2 : 1;
 | 
				
			||||||
                //var lock1 = ColNos[i] % 3 == 0 ? 3 : ColNos[i] % 3;
 | 
					                //var lock1 = ColNos[i] % 3 == 0 ? 3 : ColNos[i] % 3;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue