yi eason hace 3 años
padre
commit
24091ac386
Se han modificado 2 ficheros con 30 adiciones y 22 borrados
  1. 2 0
      CarMeterSystem/App.config
  2. 28 22
      CarMeterSystem/frmMain.cs

+ 2 - 0
CarMeterSystem/App.config

@@ -71,6 +71,8 @@
 		<add key="undulateValue" value="50" />
 		<!--硬盘录像机仪表抓拍设置的通道-->
 		<add key="channel" value="5" />
+		<!--是否启用重量曲线值写入 0写入,1不写入-->
+		<add key="isWriteWgt" value="0" />
 	</appSettings>
 	<system.web>
 		<membership defaultProvider="ClientAuthenticationMembershipProvider">

+ 28 - 22
CarMeterSystem/frmMain.cs

@@ -31,6 +31,8 @@ namespace CarMeterSystem
 
         private Log l = Log.GetInstance();
 
+        string isWriteWgt = ConfigurationManager.AppSettings["isWriteWgt"]?.ToString();
+
         //内存表
         private MemoryTableDataSocket MemoClass = new MemoryTableDataSocket("");
 
@@ -65,7 +67,7 @@ namespace CarMeterSystem
 
         private LED_Control led_controler = null;
 
-        //监控表操作
+        //实时重量写入表操作
         private MeterMonitorWeightService monitorWeightService = new MeterMonitorWeightService();
 
         private MeterWorkScheduledHelpService meterWorkScheduledHelpService = new MeterWorkScheduledHelpService();
@@ -677,32 +679,36 @@ namespace CarMeterSystem
                         #region 每隔1秒写入一次重量曲线
                         try
                         {
-                            if (preWgt != e.weight)
+                            if (isWriteWgt == "0") 
                             {
-                                preWgt = e.weight;
-                                sPreNo = PbCache.sportInfo.baseSpotNo + DateTime.Now.ToString("yyyyMMddHHmmssfff");
-                                meterMonitorWeightEventData1.weightNo = sPreNo;
-                                meterMonitorWeightEventData1.baseSpotNo = PbCache.sportInfo.baseSpotNo;
-                                meterMonitorWeightEventData1.baseSpotName = PbCache.sportInfo.baseSpotName;
-                                meterMonitorWeightEventData1.collectWeight = e.weight + "";
-                                meterMonitorWeightEventData1.collectStartTime = PbCache.dtStartTime.Value;
-                                meterMonitorWeightEventData1.collectEndTime = DateTime.Now;
-                                meterMonitorWeightEventData1.spotTypeNo = "001002001";
-                                meterMonitorWeightEventData1.spotTypeName = "汽车衡";
-                                meterMonitorWeightEventData1.actualFirstNo = PbCache.actualFirstNo;
-                                monitorWeightService.doAddWf(meterMonitorWeightEventData1);
-                            }
-                            else
-                            {
-                                if (!string.IsNullOrEmpty(sPreNo))
+                                if (preWgt != e.weight)
+                                {
+                                    preWgt = e.weight;
+                                    sPreNo = PbCache.sportInfo.baseSpotNo + DateTime.Now.ToString("yyyyMMddHHmmssfff");
+                                    meterMonitorWeightEventData1.weightNo = sPreNo;
+                                    meterMonitorWeightEventData1.baseSpotNo = PbCache.sportInfo.baseSpotNo;
+                                    meterMonitorWeightEventData1.baseSpotName = PbCache.sportInfo.baseSpotName;
+                                    meterMonitorWeightEventData1.collectWeight = e.weight + "";
+                                    meterMonitorWeightEventData1.collectStartTime = PbCache.dtStartTime.Value;
+                                    meterMonitorWeightEventData1.collectEndTime = DateTime.Now;
+                                    meterMonitorWeightEventData1.spotTypeNo = "001002001";
+                                    meterMonitorWeightEventData1.spotTypeName = "汽车衡";
+                                    meterMonitorWeightEventData1.actualFirstNo = PbCache.actualFirstNo;
+                                    monitorWeightService.doAddWf(meterMonitorWeightEventData1);
+                                }
+                                else
                                 {
-                                    meterMonitorWeightEventData2.weightNo = sPreNo;
-                                    meterMonitorWeightEventData2.collectEndTime = DateTime.Now;
-                                    monitorWeightService.doUpdateWf(meterMonitorWeightEventData2);
+                                    if (!string.IsNullOrEmpty(sPreNo))
+                                    {
+                                        meterMonitorWeightEventData2.weightNo = sPreNo;
+                                        meterMonitorWeightEventData2.collectEndTime = DateTime.Now;
+                                        monitorWeightService.doUpdateWf(meterMonitorWeightEventData2);
+                                    }
                                 }
                             }
                         }
                         catch { }
+                        //*/
                         #endregion
 
                         #region 停留超时
@@ -954,7 +960,7 @@ namespace CarMeterSystem
                         meterWorkMonitorEventDataI.photoCar = "";
                         meterWorkMonitorEventDataI.scanCar = "";
                         meterWorkMonitorEventDataI.editCar = "";
-                        //meterWorkMonitorEventDataI.zeroState = "0";
+                        meterWorkMonitorEventDataI.zeroState = "0";
                         meterWorkMonitorEventDataI.carErr = "0";
                         meterWorkMonitorEventDataI.ferroalloyResult = "0";
                         meterWorkMonitorEventDataI.wgtErr = "0";