Przeglądaj źródła

一码到底优化

BourneCao 3 lat temu
rodzic
commit
7330e9bf06

+ 2 - 2
CarMeterSystem/frmMain.cs

@@ -76,7 +76,7 @@ namespace CarMeterSystem
         /// 计量页
         /// </summary>
         private frmOneYardToEnd fcc = null;
-
+        
         /// <summary>
         /// 基础数据载入
         /// </summary>
@@ -88,7 +88,7 @@ namespace CarMeterSystem
         private List<ucBusinessType> lu = new List<ucBusinessType>();
 
         private bool isVoiceDownCar = false;//车上人员请下车播放一次
-        private bool isShowFrmWelcome = true; //是否显示欢迎界面
+        private bool isShowFrmWelcome = false; //是否显示欢迎界面
 
         private bool isOpened = false;//是否已经打开了扫码计量界面
 

+ 1 - 1
CarMeterSystem/frmOneYardToEnd.Designer.cs

@@ -265,7 +265,7 @@
             this.txtCarNo.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
             this.txtCarNo.Enabled = false;
             this.txtCarNo.Font = new System.Drawing.Font("宋体", 35F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(200)));
-            this.txtCarNo.Location = new System.Drawing.Point(1002, 0);
+            this.txtCarNo.Location = new System.Drawing.Point(1001, -3);
             this.txtCarNo.Multiline = true;
             this.txtCarNo.Name = "txtCarNo";
             this.txtCarNo.ReadOnly = true;

+ 30 - 1
CarMeterSystem/frmOneYardToEnd.cs

@@ -120,6 +120,7 @@ namespace CarMeterSystem
 
         public void init()
         {
+
             PbCache.mwPreFirst = meterWorkCarActualFirst;
             
             PbCache.isPre = false;
@@ -132,6 +133,8 @@ namespace CarMeterSystem
                 btnFH.Visible = true;
             }
             btnTare.Visible = false;
+
+            btnSave.Enabled = true;
             timer1.Start();
             lbPointName.Text = PbCache.sportInfo.baseSpotName;
             ucCarMeterInfoJisco1.setMeterType(PbCache.bussinessTypeName);
@@ -2345,6 +2348,32 @@ namespace CarMeterSystem
                     isHelp = "0",
                     wgt = 0
                 });
+
+                // 重置局部变量
+                firstWgt = 0;
+                bRailwayActual = true;
+                isVoiceDownCar = false;//车上人员请下车播放一次
+                firstCode = "";//上次扫码编号
+                TrackCarNo = "";//预报车号
+                sPreCarNo = "";//摄像头识别车号
+                limsMsg = "";
+                wgt = 0;
+                temporaryResult = "";
+                temporaryCarNo = "";
+
+                // 清空Message控件
+                setMsg("");
+                // 清空显示区
+                ucWeightCarTJXJG1.setWeightType(" ");
+                ucCarMeterInfoJisco1.setFormControlValue(new MeterWorkCarActualFirst() { });
+
+                // 重置PbCache变量
+                PbCache.isLockFrm = false;  // 清除页面锁定
+                PbCache.lockCarNo = "";
+                PbCache.lockWgt = 0;
+                PbCache.ResultMessage = "";
+                PbCache.voiceType = 0;  // 清除语音
+                btnSave.Enabled = true;
             }
             catch (Exception ex)
             {
@@ -2485,7 +2514,7 @@ namespace CarMeterSystem
                     break;
             }
 
-            if(PbCache.collect.weight > 500)
+            if(PbCache.collect.weight > 500 && PbCache.voiceType != 0)
             {
                 vicPlayClass.GetVoicePlay(voiceContent, PbCache.lockCarNo);
             }