Bläddra i källkod

winfrom提交

duyong 3 år sedan
förälder
incheckning
1e44786181

+ 0 - 22
CarMeterSystem/OptionCls/CameraShotCls.cs

@@ -56,33 +56,11 @@ namespace CarMeterSystem.OptionCls
         /// <param name="actualFirstNo"></param>
         public void CapPicFromVideo(string actualFirstNo)
         {
-            string fullfilename = Path.Combine(AppConfigCache.ftpPath, DateTime.Now.ToString("yyyy-MM-dd"));
-            if (fullfilename.Substring(0, 8) == "https://")
-            {
-                fullfilename = fullfilename.Substring(0, 8) + fullfilename.Substring(8).Replace("//", "/").Replace("//", "/");
-            }
-            else if (fullfilename.Substring(0, 7) == "http://")
-            {
-                fullfilename = fullfilename.Substring(0, 7) + fullfilename.Substring(7).Replace("//", "/").Replace("//", "/");
-            }
-            else
-            {
-                fullfilename = fullfilename.Replace("//", "/").Replace("//", "/");
-            }
-
-            fullfilename = fullfilename.Replace("upload", "download");
-
             foreach (DhCameraShot shot in CarCache.cameraShots)
             {
                 //放在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));
-                PbCache.listImage[0].imageFile1 = fullfilename + string.Format("/{0}_{1}_", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo) + "1.jpg";
-                PbCache.listImage[0].imageFile2 = fullfilename + string.Format("/{0}_{1}_", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo) + "2.jpg";
-                PbCache.listImage[0].imageFile3 = fullfilename + string.Format("/{0}_{1}_", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo) + "3.jpg";
-                PbCache.listImage[0].imageFile4 = fullfilename + string.Format("/{0}_{1}_", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo) + "4.jpg";
-                PbCache.listImage[0].imageFile5 = fullfilename + string.Format("/{0}_{1}_", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo) + "5.jpg";
-                PbCache.listImage[0].imageFile6 = fullfilename + string.Format("/{0}_{1}_", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo) + "6.jpg";
             }
 
         }

+ 4 - 39
CarMeterSystem/frmOneYardToEnd.cs

@@ -389,12 +389,6 @@ namespace CarMeterSystem
                     //    btnSave.Enabled = true;
                     //}
 
-                    //判断储存图片list是否为空,为空则保存图片
-                    if (PbCache.listImage.Count == 0)
-                    {
-                        _ = BeginInvoke(new Action(() => { shotImage(); }));
-                    }
-
 
                     isStop = true;
                     #region 酒钢业务流程判断
@@ -744,6 +738,8 @@ namespace CarMeterSystem
                     //    }
                     //}
 
+                    //图片截取
+                    _ = BeginInvoke(new Action(() => { shotImage(); }));
 
                     //语音提醒部分
                     //flag =true表示称重成功
@@ -879,23 +875,6 @@ namespace CarMeterSystem
             {
                 #region 截取图片信息
 
-                string fullfilename = Path.Combine(AppConfigCache.ftpPath, DateTime.Now.ToString("yyyy-MM-dd"));
-                if (fullfilename.Substring(0, 8) == "https://")
-                {
-                    fullfilename = fullfilename.Substring(0, 8) + fullfilename.Substring(8).Replace("//", "/").Replace("//", "/");
-                }
-                else if (fullfilename.Substring(0, 7) == "http://")
-                {
-                    fullfilename = fullfilename.Substring(0, 7) + fullfilename.Substring(7).Replace("//", "/").Replace("//", "/");
-                }
-                else
-                {
-                    fullfilename = fullfilename.Replace("//", "/").Replace("//", "/");
-                }
-
-                fullfilename = fullfilename.Replace("upload", "download");
-
-                string actualFirstNo = DateTime.Now.ToString("yyyyMMddHHmmssffff");//替换PbCache.actualFirstNo
                 //截取屏幕信息
 
                 Point screenPoint = this.PointToScreen(new Point());
@@ -903,22 +882,13 @@ namespace CarMeterSystem
                 Image img = new Bitmap(rect.Width, rect.Height);
                 Graphics g = Graphics.FromImage(img);
                 g.CopyFromScreen(rect.X - 1, rect.Y - 1, 0, 0, rect.Size);//"D://file/1.jpg"
-                //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);
                 img.Save(string.Format("{0}imgShort\\formalImg\\{1}_{2}_{3}.jpg",
                     AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
-                    PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo, 7), System.Drawing.Imaging.ImageFormat.Jpeg);
-                //(PbCache.videoChild.Count + 1)), System.Drawing.Imaging.ImageFormat.Jpeg);
-                MeterWorkImage meterWorkImage = new MeterWorkImage();
-                meterWorkImage.imageFile7 = string.Format("{0}{1}_{2}_{3}.jpg",
-                    fullfilename + "/",
-                    PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo, 7);
-                PbCache.listImage.Add(meterWorkImage);
+                    PbCache.sportInfo.baseSpotNo, "C" + PbCache.actualFirstNo, 7), System.Drawing.Imaging.ImageFormat.Jpeg);
                 //*
                 //最后进行截图操作
                 CameraShotCls cameraShot = new CameraShotCls();
-                cameraShot.CapMethod(actualFirstNo);
+                cameraShot.CapMethod(PbCache.actualFirstNo);
                 //*/
 
                 #endregion 截取图片信息
@@ -2412,11 +2382,6 @@ namespace CarMeterSystem
                 ucWeightCarTJXJG1.setWeightType(" ");
                 ucCarMeterInfoJisco1.setFormControlValue(new MeterWorkCarActualFirst() { });
 
-                //重置保存返回的一次编号
-                PbCache.actualFirstNo = "";
-
-                //清楚临时储存的listImage
-                PbCache.listImage.Clear();
 
                 // 重置PbCache变量
                 PbCache.isLockFrm = false;  // 清除页面锁定

+ 1 - 9
MeterPlugInLibrary/图片处理/ImageCurlControl.cs

@@ -251,15 +251,7 @@ namespace MeterPlugInLibrary
             }
 
             //ci.image_time = DateTime.ParseExact(segs[0].Substring(segs[0].Length - 14, 14), "yyyyMMddHHmmss", CultureInfo.CurrentCulture);
-            if (!string.IsNullOrEmpty(PbCache.actualFirstNo))
-            {
-                PbCache.listImage[0].actualFirstNo = "C" + PbCache.actualFirstNo;
-                ci = PbCache.listImage[0];
-            }
-            else
-            {
-                return null;
-            }
+            ci.actualFirstNo = segs[1];
             return ci;
         }
 

+ 7 - 7
MeterSceneLibrary/JISCO/InnerCarJISCO.cs

@@ -677,13 +677,13 @@ namespace MeterSceneLibrary
                                 // 重量类型为皮重
                                 if (list[0].weightTypeNo == "001033002")
                                 {
-                                    if (PbCache.lockWgt > 25)
-                                    {
-                                        rt = saveMethod.doError(string.Format("当前重量:{0},请确认是否为皮重", PbCache.lockWgt));
-                                        PbCache.voiceType = 26;
-                                        PbCache.LEDResultMessage = string.Format("当前重量:{0},请确认是否为皮重", PbCache.lockWgt);
-                                        return rt;
-                                    }
+                                    //if (PbCache.lockWgt > 25)
+                                    //{
+                                    //    rt = saveMethod.doError(string.Format("当前重量:{0},请确认是否为皮重", PbCache.lockWgt));
+                                    //    PbCache.voiceType = 26;
+                                    //    PbCache.LEDResultMessage = string.Format("当前重量:{0},请确认是否为皮重", PbCache.lockWgt);
+                                    //    return rt;
+                                    //}
 
                                     // 历史皮重验证
                                     rt = saveMethod.validHisTare(list[0].weightTypeNo);