Browse Source

代码提交

BourneCao 3 years ago
parent
commit
8da122765c

+ 9 - 9
CarMeterSystem/App.config

@@ -4,18 +4,18 @@
 		<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
 	</startup>
 	<appSettings>
-		<add key="ServiceUrl" value="http://127.0.0.1:9004/v1" />
-    <!--<add key="ServiceUrl" value="http://10.104.4.105:9004/v1" />-->
-    <!--<add key="ServiceUrl" value="http://192.168.216.143:9004/v1" />-->
-    <!--<add key="ServiceUrl" value="http://192.168.137.136:9004/v1" />-->
-    <!--<add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />-->
-    <!--<add key="ServiceUrl" value="http://192.168.107.60:8888/icore.icp.winform/pass/jlcar"/>-->
-    <!--<add key="ServiceUrl" value="http://192.168.185.29/icore.icp.winform/pass/jlcar"/>-->
-    <!--<add key="ServiceUrl" value="http://10.99.81.20/icore.icp.web/pass/systemBase/v1"/>-->
+    <!--<add key="ServiceUrl" value="http://127.0.0.1:9004/v1" />-->
+  <!--<add key="ServiceUrl" value="http://10.104.4.105:9004/v1" />-->
+  <!--<add key="ServiceUrl" value="http://192.168.216.143:9004/v1" />-->
+  <!--<add key="ServiceUrl" value="http://192.168.137.136:9004/v1" />-->
+  <!--<add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />-->
+  <!--<add key="ServiceUrl" value="http://192.168.107.60:8888/icore.icp.winform/pass/jlcar"/>-->
+  <!--<add key="ServiceUrl" value="http://192.168.185.29/icore.icp.winform/pass/jlcar"/>-->
+  <add key="ServiceUrl" value="http://10.99.81.20/icore.icp.web/pass/systemBase/v1"/>
     <!--<add key="ServiceUrl" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/systemBase/v1"/>-->
     <!--<add key="ServiceUrl" value="http://10.130.1.2/icore.icp.web/pass/systemBase/v1"/>-->
     <!--实时库地址-->
-    <add key="icoredbTcp" value="tarantool://guest@10.99.200.86:21019" />
+    <add key="icoredbTcp" value="tarantool://guest@10.99.200.86:2101" />
     <add key="icoredbTcp2" value="tarantool://guest@10.130.1.3:2101" />
     <!--<add key="icoredbTcp" value="tarantool://guest@10.130.1.3:2101" />-->
     <!--SFTP或者vsftp服务端连接及地址-->

+ 22 - 0
CarMeterSystem/CamerEs.cs

@@ -132,6 +132,28 @@ namespace CarMeterSystem
 
         }
 
+        public void SaveRealData(string fileUrl)
+        {
+            if (!CHCNetSDK.NET_DVR_SaveRealData_V30(m_lRealHandle, 0x1, fileUrl))
+            {
+                iLastErr = CHCNetSDK.NET_DVR_GetLastError();
+                str = "NET_DVR_SaveRealData_V30 failed, error code= " + iLastErr;
+                DebugInfo(str);
+                return;
+            }
+        }
+
+        public void StopRealData()
+        {
+            if (!CHCNetSDK.NET_DVR_StopSaveRealData(m_lRealHandle))
+            {
+                iLastErr = CHCNetSDK.NET_DVR_GetLastError();
+                str = "NET_DVR_StopSaveRealData failed, error code= " + iLastErr;
+                DebugInfo(str);
+                return;
+            }
+        }
+
         #region
         protected void DebugInfo(string strMsg)
         {

+ 10 - 1
CarMeterSystem/frmOneYardToEnd.cs

@@ -146,6 +146,11 @@ namespace CarMeterSystem
 
         public void init()
         {
+            // 启动拍照和视频截图
+            PbCache.tempImgId = Guid.NewGuid().ToString();
+            frmVoice.SaveRealData(PbCache.tempImgId);
+
+
             weighTime = DateTime.Now;
             isMeasureSuccess = false;
 
@@ -476,7 +481,7 @@ namespace CarMeterSystem
                     lg.WriteLog(34, "车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
 
                     // 启动拍照
-                    PbCache.tempImgId = Guid.NewGuid().ToString();
+                    
                     //lg.WriteLog(35, "启动拍照    车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
                     // 先截取重量仪表截图
                     frmVoice.CapturePictrue(PbCache.tempImgId + "_temp");
@@ -2739,6 +2744,10 @@ namespace CarMeterSystem
         {
             try
             {
+                // 20221110 By BourneCao
+                // 停止保存视频
+                frmVoice.StopRealData();
+
                 // 20220930 By BourneCao
                 // 清楚本地判稳参数
                 localWeightStatus = false;

+ 23 - 0
CarMeterSystem/frmVoice.cs

@@ -76,6 +76,29 @@ namespace CarMeterSystem
             */
         }
 
+        /// <summary>
+        /// 传入了值,则按传入的路径及Ip进行截图,否则则全部截图
+        /// </summary>
+        /// <param name="imgUrl"></param>
+        /// <param name="ip"></param>
+        public void SaveRealData(string actualFirstNo)
+        {
+            string strUrl = PbCache.path + string.Format("\\imgShort\\formalImg\\{0}_{1}_{2}.3gp", PbCache.sportInfo.baseSpotNo, "V" + actualFirstNo, 1);
+            lc[0]?.CapturePictrue(strUrl);
+            
+        }
+
+        /// <summary>
+        /// 传入了值,则按传入的路径及Ip进行截图,否则则全部截图
+        /// </summary>
+        /// <param name="imgUrl"></param>
+        /// <param name="ip"></param>
+        public void StopRealData()
+        {
+            lc[0]?.StopRealData();
+
+        }
+
         internal void LoadVoiceInfo() 
         {
             List<MeterBaseVideoChild> lt = PbCache.videoChild;

+ 46 - 8
Common/database/MemoryTableDataSocket.cs

@@ -170,6 +170,44 @@ namespace Common
                     //静态衡
                     Dictionary<string, double> WgtList = arr[0].WeightList == null ? new Dictionary<string, double>() : arr[0].WeightList;
 
+                    string CarNo1 = "";
+                    string CarNo2 = "";
+
+                    if (PlateNoList.Count == 0)
+                    {
+                    }
+                    else if(PlateNoList.Count == 1)
+                    {
+                        if(PlateNoList[0].Direct == "West")
+                        {
+                            CarNo1 = PlateNoList[0].CarNo;
+                        }
+                        else if(PlateNoList[0].Direct == "East")
+                        {
+                            CarNo2 = PlateNoList[0].CarNo;
+                        }
+                    }
+                    else if (PlateNoList.Count == 2)
+                    {
+                        if (PlateNoList[0].Direct == "West")
+                        {
+                            CarNo1 = PlateNoList[0].CarNo;
+                        }
+                        else if (PlateNoList[0].Direct == "East")
+                        {
+                            CarNo2 = PlateNoList[0].CarNo;
+                        }
+
+                        if (PlateNoList[1].Direct == "West")
+                        {
+                            CarNo1 = PlateNoList[1].CarNo;
+                        }
+                        else if (PlateNoList[1].Direct == "East")
+                        {
+                            CarNo2 = PlateNoList[1].CarNo;
+                        }
+                    }
+
                     JArray jArray = new JArray(
                         arr[0].Pointid, //0
                         arr[0].Status,  //1
@@ -180,20 +218,20 @@ namespace Common
                         arr[0].StopStatus, //5
                         arr[0].Datetime, //6
                         arr[0].LicType, //7
-                        // 20221011 By BourneCao 
-                        // 增加双摄像头支持
-                        //PlateNoList.Count == 0 ? "" : PlateNoList[PlateNoList.Count - 1].CarNo, //8
-                        PlateNoList.Count == 0 ? "" : PlateNoList[0].CarNo, //8
+                                        // 20221011 By BourneCao 
+                                        // 增加双摄像头支持
+                                        //PlateNoList.Count == 0 ? "" : PlateNoList[PlateNoList.Count - 1].CarNo, //8
+                        CarNo1, //8
                         //"甘B32619",
                         RfidList.Count == 0 ? "" : RfidList[RfidList.Count - 1].CarNo, //9
                         arr[0].WeightSave, //10
                         arr[0].FinishTime, //11
                         arr[0].Entry, //12
                         arr[0].Exit,  //13
-                        // 20221011 By BourneCao 
-                        // 增加双摄像头支持
-                        PlateNoList.Count <= 1 ? "" : PlateNoList[1].CarNo //14
-                        //"甘B32639"
+                                      // 20221011 By BourneCao 
+                                      // 增加双摄像头支持
+                        CarNo2 //14
+                               //"甘B32639"
                     ); 
 
                     double mainWgt = 0;

+ 3 - 3
MeterPlugInLibrary/实时库数据采集/DataCollectionControl.cs

@@ -91,10 +91,10 @@ namespace MeterPlugInLibrary
                         arg.datetime = Convert.ToDateTime(jArray[6].ToString().Replace("T", " ").Replace("Z", ""));
                         arg.licType = Convert.ToInt32(jArray[7].ToString());
 
-                        if (jArray[2].ToString() != "")
-                        {
+                        //if (jArray[2].ToString() != "" || jArray[8].ToString() != "" || jArray[14].ToString() != "")
+                        //{
                             WriteThreadLog("jArray:"+jArray.ToString());
-                        }
+                        //}
 
                         // 20221011 By BourneCao 
                         // 增加双摄像头支持