From 61fae180e588d558e87102ba1d3af6f789adc1b6 Mon Sep 17 00:00:00 2001
From: maqiao <625215135@qq.com>
Date: Fri, 28 Feb 2025 17:27:22 +0800
Subject: [PATCH] =?UTF-8?q?CheckQuantityByAddr2=E6=96=B9=E6=B3=95=E5=8F=91?=
=?UTF-8?q?=E6=8C=87=E4=BB=A4=E6=97=B6=E6=B7=BB=E5=8A=A0=E5=BB=B6=E6=97=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
DM_Weight/Converter/InputQuantityConverter.cs | 2 ++
DM_Weight/DM_Weight.csproj | 3 +++
DM_Weight/Port/PortUtil.cs | 1 +
3 files changed, 6 insertions(+)
diff --git a/DM_Weight/Converter/InputQuantityConverter.cs b/DM_Weight/Converter/InputQuantityConverter.cs
index 19e9516..523c825 100644
--- a/DM_Weight/Converter/InputQuantityConverter.cs
+++ b/DM_Weight/Converter/InputQuantityConverter.cs
@@ -16,6 +16,8 @@ namespace DM_Weight.Converter
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;
}
diff --git a/DM_Weight/DM_Weight.csproj b/DM_Weight/DM_Weight.csproj
index e41984e..7981b1a 100644
--- a/DM_Weight/DM_Weight.csproj
+++ b/DM_Weight/DM_Weight.csproj
@@ -94,6 +94,9 @@
Never
+
+ Always
+
Always
diff --git a/DM_Weight/Port/PortUtil.cs b/DM_Weight/Port/PortUtil.cs
index 43b48d8..03de52a 100644
--- a/DM_Weight/Port/PortUtil.cs
+++ b/DM_Weight/Port/PortUtil.cs
@@ -1258,6 +1258,7 @@ namespace DM_Weight.Port
int[] res = new int[9];
for (int i = 0; i < ColNos.Length; i++)
{
+ await Task.Delay(300);
canBusSerial.DiscardInBuffer();
//var index = (int)Math.Ceiling(Convert.ToDecimal(ColNos[i]) / 3); // > 3 ? 2 : 1;
//var lock1 = ColNos[i] % 3 == 0 ? 3 : ColNos[i] % 3;