ソースを参照

提交重量截图与抓拍优化

BourneCao 3 年 前
コミット
2719544ee6

+ 3 - 1
CarMeterSystem/OptionCls/CameraShotCls.cs

@@ -14,6 +14,7 @@ namespace CarMeterSystem.OptionCls
     /// </summary>
     public class CameraShotCls
     {
+
         public void Connection()
         {
             foreach (DhCameraShot shot in CarCache.cameraShots)
@@ -60,7 +61,8 @@ namespace CarMeterSystem.OptionCls
             {
                 //放在tempImg文件夹下面就进行图片的压缩操作,否则不进行图片压缩
                 //shot.CapPic(iCnt < 3 ? 0 : 1, PbCache.path + string.Format("\\imgShort\\tempImg\\{0}_{1}_{2}.jpg", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo, iCnt));
-                shot.CapPicFromVedio(PbCache.path + string.Format("\\imgShort\\formalImg\\{0}_{1}_", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo));
+                bool shotSuccess = shot.CapPicFromVedio(PbCache.path + string.Format("\\imgShort\\formalImg\\{0}_{1}_", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo));
+                PbCache.shotSuccess = shotSuccess;
             }
 
         }

+ 11 - 1
CarMeterSystem/frmOneYardToEnd.cs

@@ -195,6 +195,7 @@ namespace CarMeterSystem
                 if (PbCache.tempImgId == null || PbCache.tempImgId == "")
                 {
                     PbCache.tempImgId = Guid.NewGuid().ToString();
+                    lg.WriteLog(35, "启动拍照    车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
                     _ = BeginInvoke(new Action(() => { shotImage(PbCache.tempImgId+"_temp"); }));
                 }
 
@@ -762,6 +763,8 @@ namespace CarMeterSystem
                     //    }
                     //}
 
+                    isMeasureSuccess = true;
+
                     /*
                      * 图片上传,先截图,数据保存成功后,再修改为正式文件名,并上传
                      * 解决抓图重量与实际重量不一致问题
@@ -787,12 +790,13 @@ namespace CarMeterSystem
                     //语音提醒部分
                     //flag =true表示称重成功
                     readVoicd();
+                    lg.WriteLog(35, "语音提示    成功标识:" + PbCache.shotSuccess.ToString() + "车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
 
                     wgt = PbCache.lockWgt;
                     temporaryResult = PbCache.ResultMessage;
                     temporaryCarNo = PbCache.collect.carno;
 
-                    isMeasureSuccess = true;
+                    
                     //提示信息,
                     //txtMsgInfo.Text = PbCache.ResultMessage;
                     lblog = string.IsNullOrEmpty(PbCache.ResultMessage) ? strMsg : PbCache.ResultMessage;//偶尔出现ResultMessage为空的情况
@@ -954,6 +958,9 @@ namespace CarMeterSystem
                 //最后进行截图操作
                 CameraShotCls cameraShot = new CameraShotCls();
                 cameraShot.CapMethod(tempID);
+
+                lg.WriteLog(35, "完成拍照    成功标识:" + PbCache.shotSuccess.ToString() +"车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
+
                 //*/
 
                 #endregion 截取图片信息
@@ -983,6 +990,8 @@ namespace CarMeterSystem
                 img.Save(string.Format("{0}imgShort\\formalImg\\{1}_{2}_{3}.jpg",
                     AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
                     PbCache.sportInfo.baseSpotNo, "C" + PbCache.actualFirstNo, 7), System.Drawing.Imaging.ImageFormat.Jpeg);
+
+                lg.WriteLog(35, "完成截图    成功标识:" + PbCache.shotSuccess.ToString() + "车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
                 #endregion 截取图片信息
             }
             catch (Exception ex)
@@ -2483,6 +2492,7 @@ namespace CarMeterSystem
                 PbCache.ResultMessage = "";
                 PbCache.voiceType = 0;  // 清除语音
                 PbCache.tempImgId = ""; // 清除临时抓图ID
+                PbCache.shotSuccess = false;  // 清除拍照成功标识
                 btnSave.Enabled = true;
                 btnSelPreType.Visible = false;
 

+ 5 - 0
Common/cacheCls/PbCache.cs

@@ -377,6 +377,11 @@ namespace Common
         /// </summary>
         public static string tempImgId { get; set; }
 
+        /// <summary>
+        /// 硬盘录像机拍照是否成功
+        /// </summary>
+        public static bool shotSuccess { get; set; }
+
 
         #region 扫码器相关
         /// <summary>

+ 3 - 0
Common/log/Log.cs

@@ -149,6 +149,9 @@ namespace Common
                     case 34:
                         strLogName = "重量保存_";
                         break;
+                    case 35:
+                        strLogName = "硬盘录像机拍照_";
+                        break;
                     case 99:
                         strLogName = "双扫码";
                         break;

+ 2 - 2
MeterSceneLibrary/JISCO/InnerCarJISCO.cs

@@ -118,7 +118,7 @@ namespace MeterSceneLibrary
                     {
                         if (PbCache.ResultMessage == "")
                         {
-                            PbCache.ResultMessage = "重量类型为皮重且不在皮重误差内";
+                            PbCache.ResultMessage = "当前皮重不符合历史皮重";
                         }
                         PbCache.voiceType = 13;
                         rt = saveMethod.doError(PbCache.ResultMessage);
@@ -130,7 +130,7 @@ namespace MeterSceneLibrary
                     {
                         if (PbCache.ResultMessage == "")
                         {
-                            PbCache.ResultMessage = "重量类型为毛重,在皮重误差内";
+                            PbCache.ResultMessage = "当前毛重接近历史皮重";
                         }
                         PbCache.voiceType = 23;
                         rt = saveMethod.doError(PbCache.ResultMessage);