Bladeren bron

修复bug

zhangliwen 1 jaar geleden
bovenliggende
commit
9298d57c47

+ 2 - 2
SCADA_DAQ/Customer/Machines/ScannerMachine.cs

@@ -41,7 +41,7 @@ namespace SCADA_DAQ.Customer.Machines
     /// 二维扫码枪
     /// </summary>
     [DisplayName("二维扫码枪")]
-    public class ScannerMachine_v1 : BaseBarcodeReaderMachine
+    public class ScannerMachine : BaseBarcodeReaderMachine
     {
         // 数据库对象
         private static SqlSchema.DIL.DILDB DAL = Env.SgIDAL;
@@ -74,7 +74,7 @@ namespace SCADA_DAQ.Customer.Machines
         /// 构造函数
         /// </summary>
         /// <param name="id"></param>
-        public ScannerMachine_v1(string id) : base(id)
+        public ScannerMachine(string id) : base(id)
         {
             Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;   // 注册定时器事件
 

+ 17 - 17
SCADA_DAQ/Customer/UctFrmCodeScanningGun.xaml.cs

@@ -35,8 +35,8 @@ namespace SCADA_DAQ.Customer
     [UctMenu("扫码界面", Icon = "看板")]
     public partial class UctFrmCodeScanningGun : BaseUctFrm
     {
-        private ScannerMachine_v1 FirstMachinelCodeScanningSun = MachineServer.GetInstance().GetMachine<ScannerMachine_v1>("上料扫码枪");
-        private ScannerMachine_v1 SencndMachinelCodeScanningSun = MachineServer.GetInstance().GetMachine<ScannerMachine_v1>("下料扫码枪");
+        private ScannerMachine FirstMachinelCodeScanningSun = MachineServer.GetInstance().GetMachine<ScannerMachine>("上料扫码枪");
+        //private ScannerMachine SencndMachinelCodeScanningSun = MachineServer.GetInstance().GetMachine<ScannerMachine>("下料扫码枪");
 
         private List<SolidColorBrush> brushesList = new List<SolidColorBrush>()
         {
@@ -56,10 +56,10 @@ namespace SCADA_DAQ.Customer
                 FirstMachinelCodeScanningSun.BarCodeReceived += Machinel_BarCodeReceived;
 
             }
-            else if (SencndMachinelCodeScanningSun != null)
-            {
-                SencndMachinelCodeScanningSun.BarCodeReceived += Machinel_BarCodeReceived;
-            }
+            //else if (SencndMachinelCodeScanningSun != null)
+            //{
+            //    SencndMachinelCodeScanningSun.BarCodeReceived += Machinel_BarCodeReceived;
+            //}
 
 
             Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
@@ -76,18 +76,18 @@ namespace SCADA_DAQ.Customer
         private void Machinel_BarCodeReceived(object sender, BarcodeReceivedEventArgs e)
         {
             Dispatcher.Invoke(() =>
+            {
+                TextContent.Text = e.Barcode;
+                TextContent.Background = brushesList[brushListIndex];
+                brushListIndex++;
+                if (brushListIndex > brushesList.Count - 1)
                 {
-                    TextContent.Text = e.Barcode;
-                    TextContent.Background = brushesList[brushListIndex];
-                    brushListIndex++;
-                    if (brushListIndex > brushesList.Count - 1)
-                    {
-                        brushListIndex = 0;
-                    }
-                    TextContentTime.Text = e.TimeStamp.ToLongTimeString();
-                    // 全屏提示、语音播报
-                    FrmShowMessage.ShowMessage(e.Barcode, "扫码成功", SCADA.CommonCtrl.MessageLevel.Info, 2500);
-                });
+                    brushListIndex = 0;
+                }
+                TextContentTime.Text = e.TimeStamp.ToLongTimeString();
+                // 全屏提示、语音播报
+                FrmShowMessage.ShowMessage(e.Barcode, "扫码成功", SCADA.CommonCtrl.MessageLevel.Info, 2500);
+            });
         }
 
         private void Schedual_DateTimeChanged(object sender, DateTimeChangedArgs e)

File diff suppressed because it is too large
+ 0 - 0
SCADA_DAQ/SCADA_DAQ.csproj


Some files were not shown because too many files changed in this diff