yi eason 3 rokov pred
rodič
commit
bc60077180

+ 2 - 0
CarLocalMeter/App.config

@@ -105,6 +105,8 @@
 		<add key="ledIp" value="10.130.0.68"/>
 		
 		<!--RFID配置只考虑tcp_ip的,如果串口很简单,不过这里不考虑-->
+		<!--0不启用rfid,1启用rfid-->
+		<add key="rfidStart" value="0" />
 		<!--rfid的IP地址-->
 		<add key="rfidIP" value="10.130.0.67" />
 		<!--rfid的Port地址-->

+ 5 - 2
CarLocalMeter/PbCls/AppConfigCache.cs

@@ -287,6 +287,11 @@ namespace CarLocalMeter
 
 
         #region rfid配置
+        /// <summary>
+        /// 0不启用rfid,1启用rfid
+        /// </summary>
+        public static string rfidStart = ConfigurationManager.AppSettings["rfidStart"].ToString();
+
         /// <summary>
         /// 断开重连持续时间 分钟
         /// </summary>
@@ -301,8 +306,6 @@ namespace CarLocalMeter
         /// 走tcp的采集方式 rfid的port
         /// </summary>
         public static int rfidPort = Convert.ToInt32(ConfigurationManager.AppSettings["rfidPort"].ToString());
-
-        
         #endregion
 
         /// <summary>

+ 7 - 7
CarLocalMeter/frmMain.Designer.cs

@@ -851,7 +851,7 @@ namespace CarLocalMeter
             this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 90F));
             this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 222F));
             this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 50F));
-            this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 83F));
+            this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 85F));
             this.tableLayoutPanel7.Controls.Add(this.label1, 5, 0);
             this.tableLayoutPanel7.Controls.Add(this.txtCarNo, 4, 0);
             this.tableLayoutPanel7.Controls.Add(this.cbCarNo, 3, 0);
@@ -875,7 +875,7 @@ namespace CarLocalMeter
             this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.ForeColor = System.Drawing.Color.Blue;
-            this.label1.Location = new System.Drawing.Point(722, 1);
+            this.label1.Location = new System.Drawing.Point(720, 1);
             this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(42, 36);
@@ -887,7 +887,7 @@ namespace CarLocalMeter
             // 
             this.txtCarNo.Dock = System.Windows.Forms.DockStyle.Fill;
             this.txtCarNo.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtCarNo.Location = new System.Drawing.Point(498, 3);
+            this.txtCarNo.Location = new System.Drawing.Point(496, 3);
             this.txtCarNo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.txtCarNo.Name = "txtCarNo";
             this.txtCarNo.Size = new System.Drawing.Size(216, 32);
@@ -935,7 +935,7 @@ namespace CarLocalMeter
             "琼",
             "京",
             "津"});
-            this.cbCarNo.Location = new System.Drawing.Point(407, 3);
+            this.cbCarNo.Location = new System.Drawing.Point(405, 3);
             this.cbCarNo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cbCarNo.Name = "cbCarNo";
             this.cbCarNo.Size = new System.Drawing.Size(84, 31);
@@ -952,7 +952,7 @@ namespace CarLocalMeter
             this.lbPointName.Location = new System.Drawing.Point(86, 1);
             this.lbPointName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.lbPointName.Name = "lbPointName";
-            this.lbPointName.Size = new System.Drawing.Size(252, 36);
+            this.lbPointName.Size = new System.Drawing.Size(250, 36);
             this.lbPointName.TabIndex = 3;
             this.lbPointName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
             // 
@@ -978,7 +978,7 @@ namespace CarLocalMeter
             this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
             this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.ForeColor = System.Drawing.Color.Blue;
-            this.label2.Location = new System.Drawing.Point(347, 1);
+            this.label2.Location = new System.Drawing.Point(345, 1);
             this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(52, 36);
@@ -989,7 +989,7 @@ namespace CarLocalMeter
             // pbLineOn
             // 
             this.pbLineOn.Image = ((System.Drawing.Image)(resources.GetObject("pbLineOn.Image")));
-            this.pbLineOn.Location = new System.Drawing.Point(772, 4);
+            this.pbLineOn.Location = new System.Drawing.Point(770, 4);
             this.pbLineOn.Name = "pbLineOn";
             this.pbLineOn.Size = new System.Drawing.Size(39, 30);
             this.pbLineOn.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

+ 4 - 3
CarLocalMeter/frmMain.cs

@@ -171,8 +171,9 @@ namespace CarLocalMeter
             else
                 mx.start();
 
-
-            rfid.Start();
+            if (AppConfigCache.rfidStart == "1")
+                rfid.Start();
+            
             imgControl.Start();
             carCls.Login(AppConfigCache.voiceCarNoIp, AppConfigCache.voiceCarNoPort, AppConfigCache.voiceCarNoUid, AppConfigCache.voiceCarNoPwd);
             //*/
@@ -864,7 +865,7 @@ namespace CarLocalMeter
             } catch { }
 
 
-            try { rfid?.ClosingCollect(); } catch { }
+            try { if (AppConfigCache.rfidStart == "1") rfid?.ClosingCollect(); } catch { }
             try { if (bVoice) ce?.StopTalk(); } catch { }