Parcourir la source

Merge branch 'master' of https://git.steerinfo.com/caol/jisco_winform_wzjl.git

duyong il y a 3 ans
Parent
commit
646038a73f

+ 1 - 1
CarMeterMonitor/fromContect.cs

@@ -354,7 +354,7 @@ namespace CarMeterMonitor
                     {
                         firstCode = "";
                         PbCache.strCode = "";
-                        l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
+                        //l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
                     }
                 }
                 else

+ 4 - 3
CarMeterSystem/App.config

@@ -5,17 +5,18 @@
 	</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://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://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:2101" />
+    <add key="icoredbTcp" value="tarantool://guest@10.99.200.86:21019" />
+    <add key="icoredbTcp2" value="tarantool://guest@10.99.200.86:2101" />
     <!--<add key="icoredbTcp" value="tarantool://guest@10.130.1.3:2101" />-->
     <!--SFTP或者vsftp服务端连接及地址-->
 		<add key="fip" value="192.168.185.238" />

+ 1 - 1
CarMeterSystem/Form1.cs

@@ -451,7 +451,7 @@ namespace CarMeterSystem
                             codeFlag = false;
                             firstCode = "";
                             PbCache.strCode = "";
-                            l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
+                            //l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
                         }
                     }
                     else

+ 1 - 1
CarMeterSystem/frmMain.cs

@@ -525,7 +525,7 @@ namespace CarMeterSystem
                             codeFlag = false;
                             firstCode = "";
                             PbCache.strCode = "";
-                            l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
+                            //l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
                         }
                     }
                     else

+ 13 - 13
CarMeterSystem/frmOneYardToEnd.cs

@@ -446,7 +446,7 @@ namespace CarMeterSystem
 
                     // 启动拍照
                     PbCache.tempImgId = Guid.NewGuid().ToString();
-                    lg.WriteLog(35, "启动拍照    车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
+                    //lg.WriteLog(35, "启动拍照    车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
                     // 先截取重量仪表截图
                     frmVoice.CapturePictrue(PbCache.tempImgId + "_temp");
                     // 后截取其它摄像头截图
@@ -877,7 +877,7 @@ namespace CarMeterSystem
                     //语音提醒部分
                     //flag =true表示称重成功
                     readVoicd();
-                    lg.WriteLog(35, "语音提示    成功标识:" + PbCache.shotSuccess.ToString() + "车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
+                    //lg.WriteLog(35, "语音提示    成功标识:" + PbCache.shotSuccess.ToString() + "车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
 
                     wgt = PbCache.lockWgt;
                     temporaryResult = PbCache.ResultMessage;
@@ -1062,7 +1062,7 @@ namespace CarMeterSystem
                 CameraShotCls cameraShot = new CameraShotCls();
                 cameraShot.CapMethod(tempID);
 
-                lg.WriteLog(35, "完成全部拍照    成功标识:" + PbCache.shotSuccess.ToString() + "车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
+                //lg.WriteLog(35, "完成全部拍照    成功标识:" + PbCache.shotSuccess.ToString() + "车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
 
                 //*/
 
@@ -1094,7 +1094,7 @@ namespace CarMeterSystem
                     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());
+                //lg.WriteLog(35, "完成截图    成功标识:" + PbCache.shotSuccess.ToString() + "车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
                 #endregion 截取图片信息
             }
             catch (Exception ex)
@@ -1289,11 +1289,11 @@ namespace CarMeterSystem
                         ucWeightCarTJXJG1.setStable(PbCache.collect.weightStatus != 1 ? true : false);
 
                         #region 远程计量交互代码
-                        lg.WriteLog(99, "PbCache.monitor:" + PbCache.monitor.ToString());
+                        //lg.WriteLog(99, "PbCache.monitor:" + PbCache.monitor.ToString());
                         //如果处于远程计量状态,且远程保存完成了,则提示保存完成,让司机知道
                         if (PbCache.monitor != null)// && PbCache.collect.weight > 500)
                         {
-                            lg.WriteLog(99, "PbCache.monitor.isOverWgt:" + PbCache.monitor.isOverWgt + "PbCache.monitor.isTakeOver:" + PbCache.monitor.isTakeOver + "isOverSound:" + isOverSound);
+                            //lg.WriteLog(99, "PbCache.monitor.isOverWgt:" + PbCache.monitor.isOverWgt + "PbCache.monitor.isTakeOver:" + PbCache.monitor.isTakeOver + "isOverSound:" + isOverSound);
 
                             if (!string.IsNullOrEmpty(PbCache.monitor.isOverWgt) && PbCache.monitor.isTakeOver == "2" && !isOverSound) //&& !PbCache.isLockFrm)
                             {
@@ -1329,10 +1329,10 @@ namespace CarMeterSystem
                         }
                         #endregion 远程计量交互代码
 
-                        lg.WriteLog(99, "PbCache.collect.carno1:" + PbCache.collect.carno+ ";TrackCarNo:"+ TrackCarNo);
+                        //lg.WriteLog(99, "PbCache.collect.carno1:" + PbCache.collect.carno+ ";TrackCarNo:"+ TrackCarNo);
                         if (string.IsNullOrEmpty(TrackCarNo))
                         {
-                            lg.WriteLog(99, "PbCache.collect.carno2:" + PbCache.collect.carno);
+                            //lg.WriteLog(99, "PbCache.collect.carno2:" + PbCache.collect.carno);
                             setMsgInfo(txtCarNo, PbCache.collect.carno, "0");
                             //txtCarNo.Text = PbCache.collect.carno;
                         }
@@ -1769,7 +1769,7 @@ namespace CarMeterSystem
                     #endregion 毛皮净赋值;存在一次重量firstWgt的情况下才赋值毛皮净重
 
                     #region 界面未锁定的情况下,如果,有车号,重量稳定了,停车线验证通过,完成了扫码验证
-                    lg.WriteLog(37, string.Format("PbCache.monitor:{0},PbCache.monitor.isTakeOver:{1},bRailwayActual:{2},PbCache.collect.carno:{3},PbCache.collect.weightStatus:{4},ucWeightT1.isGreenWgt:{5},PbCache.isLockFrm:{6},isVoiceDownCar:{7},btnSave.Visible:{8}", PbCache.monitor, PbCache.monitor.isTakeOver, bRailwayActual, PbCache.collect.carno, PbCache.collect.weightStatus, ucWeightT1.isGreenWgt, PbCache.isLockFrm, isVoiceDownCar, btnSave.Visible));
+                    //lg.WriteLog(37, string.Format("PbCache.monitor:{0},PbCache.monitor.isTakeOver:{1},bRailwayActual:{2},PbCache.collect.carno:{3},PbCache.collect.weightStatus:{4},ucWeightT1.isGreenWgt:{5},PbCache.isLockFrm:{6},isVoiceDownCar:{7},btnSave.Visible:{8}", PbCache.monitor, PbCache.monitor.isTakeOver, bRailwayActual, PbCache.collect.carno, PbCache.collect.weightStatus, ucWeightT1.isGreenWgt, PbCache.isLockFrm, isVoiceDownCar, btnSave.Visible));
                     //没有远程接管,且已查过一次数据,且界面未锁定的情况下,如果,有车号,重量稳定了,停车线验证通过,完成了扫码验证的情况下,则按钮可用
                     if (PbCache.monitor != null && PbCache.monitor.isTakeOver == "0" && !bRailwayActual && !string.IsNullOrEmpty(PbCache.collect.carno)
                         && PbCache.collect.weightStatus == 0 && ucWeightT1.isGreenWgt)
@@ -1784,7 +1784,7 @@ namespace CarMeterSystem
                             if (!isVoiceDownCar)
                             {
                                 isVoiceDownCar = true;
-                                lg.WriteLog(25, PbCache.lockCarNo + "GetVoicePlay前");
+                                //lg.WriteLog(25, PbCache.lockCarNo + "GetVoicePlay前");
                                 vicPlayClass.GetVoicePlay("车上人员请下车", PbCache.collect.carno);
                                 //txtMsgInfo.Text = "请核对车号后,扫描您手机中的二维码";
                             }
@@ -1794,15 +1794,15 @@ namespace CarMeterSystem
 
                             if (!PbCache.isSelFrmMat)
                             {
-                                lg.WriteLog(25, PbCache.lockCarNo + "Sleep前点击保存按钮");
+                                //lg.WriteLog(25, PbCache.lockCarNo + "Sleep前点击保存按钮");
                                 Thread.Sleep(3000);
-                                lg.WriteLog(25, PbCache.lockCarNo + "Sleep后点击保存按钮");
+                                //lg.WriteLog(25, PbCache.lockCarNo + "Sleep后点击保存按钮");
                                 if (PbCache.collect.weight > 500)
                                 {
                                     //this.btnSave.PerformClick();//rxh deleted
                                     setMsgInfo(btnSave, "true", "7");//rxh add
                                 }
-                                lg.WriteLog(25, PbCache.lockCarNo + "PerformClick后保存按钮");
+                                //lg.WriteLog(25, PbCache.lockCarNo + "PerformClick后保存按钮");
                             }
                         }
                         else if (PbCache.monitor.validMatClick == "0")

+ 1 - 1
CarMeterSystem/fromContect.cs

@@ -351,7 +351,7 @@ namespace CarMeterSystem
                     {
                         firstCode = "";
                         PbCache.strCode = "";
-                        l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
+                        //l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
                     }
                 }
                 else

+ 2 - 0
Common/cacheCls/AppConfigCache.cs

@@ -19,6 +19,8 @@ namespace Common
         /// 最新实时数据库连接地址
         /// </summary>
         public static readonly string icoredbTcp= ConfigurationManager.AppSettings["icoredbTcp"].ToString().Trim();
+
+        public static readonly string icoredbTcp2 = ConfigurationManager.AppSettings["icoredbTcp2"].ToString().Trim();
         #endregion
 
         #region ftp信息

+ 5 - 0
Common/cacheCls/PbCache.cs

@@ -393,6 +393,11 @@ namespace Common
         /// </summary>
         public static JArray jArray { get; set; }
 
+        /// <summary>
+        /// 数采实时库返回结果
+        /// </summary>
+        public static string icoredbType { get; set; }
+
 
         #region 扫码器相关
         /// <summary>

+ 1 - 1
Common/database/DbHelper.cs

@@ -30,7 +30,7 @@ namespace Common
 
             //Type t = typeof(T);
             //t.Name可得List  PageList等名称
-            lg.WriteLog(16, string.Format("开始调用:服务[{0}],接口[{1}]", strServiceName, strMethodName));
+            //lg.WriteLog(16, string.Format("开始调用:服务[{0}],接口[{1}]", strServiceName, strMethodName));
             try
             {
                 if (iType == 0)

+ 39 - 19
Common/database/MemoryTableDataSocket.cs

@@ -20,7 +20,7 @@ namespace Common
             }
             catch (Exception ex)
             {
-                WriteLog("MemoryTableData:" + cln);
+                ChangeCln();
             }
         }
 
@@ -32,7 +32,7 @@ namespace Common
             }
             catch (Exception ex)
             {
-                WriteLog("MemoryTableData:" + cln);
+                ChangeCln();
             }
         }
 
@@ -66,6 +66,7 @@ namespace Common
             }
             catch (Exception ex)
             {
+                ChangeCln();
                 WriteLog("读采集数据异常错误:" + ex.Message);
                 return null;
             }
@@ -90,6 +91,7 @@ namespace Common
             }
             catch (Exception ex)
             {
+                ChangeCln();
                 WriteLog("写入信息到内存表异常!" + ex.Message);
                 errorInfo = "写入信息到内存表异常!" + ex.Message;
                 return false;
@@ -121,6 +123,7 @@ namespace Common
             }
             catch (Exception exp)
             {
+                ChangeCln();
                 WriteLog("LiveTable:" + exp.Message + exp.StackTrace);
                 return null;
             }
@@ -155,9 +158,9 @@ namespace Common
         {
             try
             {
-                Log.GetInstance().WriteLog(36, "开始读取数采实时库    车号:" + PbCache.lockCarNo + ";重量:" + PbCache.collect.weight + ";时间:" + DateTime.Now.ToLongTimeString());
+                //Log.GetInstance().WriteLog(36, "开始读取数采实时库    车号:" + PbCache.lockCarNo + ";重量:" + PbCache.collect.weight + ";时间:" + DateTime.Now.ToLongTimeString());
                 List<Track> arr = (List<Track>)cln.CallRpc<Track>("Track.Table:select", new object[] { PointIdKey });//读
-                Log.GetInstance().WriteLog(36, "完成读取数采实时库    车号:" + PbCache.lockCarNo + ";重量:" + PbCache.collect.weight + ";时间:" + DateTime.Now.ToLongTimeString());
+                //Log.GetInstance().WriteLog(36, "完成读取数采实时库    车号:" + PbCache.lockCarNo + ";重量:" + PbCache.collect.weight + ";时间:" + DateTime.Now.ToLongTimeString());
 
                 if (arr != null && arr.Count > 0)
                 {
@@ -224,11 +227,7 @@ namespace Common
             }
             catch (Exception exp)
             {
-                try
-                {
-                    cln = new CoredbClient(AppConfigCache.icoredbTcp);
-                }
-                catch { }
+                ChangeCln();
 
                 WriteLog(PointIdKey + "_TrackTable:" + exp.Message + exp.StackTrace + "空值");
                 return null;
@@ -295,11 +294,8 @@ namespace Common
             }
             catch (Exception exp)
             {
-                try
-                {
-                    cln = new CoredbClient(AppConfigCache.icoredbTcp);
-                }
-                catch { }
+                ChangeCln();
+
                 WriteLog("調用TrackTable异常:" + exp.Message + exp.StackTrace + "空值");
                 return null;
             }
@@ -379,11 +375,8 @@ namespace Common
             }
             catch (Exception exp)
             {
-                try
-                {
-                    cln = new CoredbClient(AppConfigCache.icoredbTcp);
-                }
-                catch { }
+                ChangeCln();
+
                 WriteLog("調用TrackTable异常:" + exp.Message + exp.StackTrace + "空值");
                 return null;
             }
@@ -447,5 +440,32 @@ namespace Common
             }
             catch { }
         }
+
+        private void ChangeCln()
+        {
+            // 自动切换主备数采平台
+            if(PbCache.icoredbType == "icoredb2")
+            {
+                PbCache.icoredbType = "icoredb1";
+
+                try
+                {
+                    cln = new CoredbClient(AppConfigCache.icoredbTcp);
+                }
+                catch { }
+            }
+            else
+            {
+                PbCache.icoredbType = "icoredb2";
+
+                try
+                {
+                    cln = new CoredbClient(AppConfigCache.icoredbTcp2);
+                }
+                catch { }
+            }
+
+            WriteLog("MemoryTableData:" + cln);
+        }
     }
 }

+ 3 - 0
MeterPlugInLibrary/图片处理/ImageControl.cs

@@ -351,6 +351,9 @@ namespace MeterPlugInLibrary
 
         private static void WriteLog(string str)
         {
+            // 20220925 By BourneCao 暂时屏蔽语音播放日志
+            return;
+
             try
             {
                 string m_szRunPath;

+ 3 - 0
MeterPlugInLibrary/图片处理/ImageCurlControl.cs

@@ -260,6 +260,9 @@ namespace MeterPlugInLibrary
 
         private static void WriteLog(string str)
         {
+            // 20220925 By BourneCao 暂时屏蔽语音播放日志
+            return;
+
             try
             {
                 string m_szRunPath;

+ 3 - 0
MeterPlugInLibrary/语音播报/VoiceMCI.cs

@@ -198,6 +198,9 @@ namespace MeterPlugInLibrary
         }
         public void WriteLog(string str)
         {
+            // 20220925 By BourneCao 暂时屏蔽语音播放日志
+            return;
+
             string m_szRunPath;
             m_szRunPath = System.Environment.CurrentDirectory;
             if (System.IO.Directory.Exists(m_szRunPath + "\\log") == false)

+ 3 - 0
MeterPlugInLibrary/语音播报/VoicePlay.cs

@@ -53,6 +53,9 @@ namespace MeterPlugInLibrary
         
         private void WriteLog(string str)
         {
+            // 20220925 By BourneCao 暂时屏蔽语音播放日志
+            return ;
+
             string m_szRunPath;
             m_szRunPath = System.Environment.CurrentDirectory;
             if (System.IO.Directory.Exists(m_szRunPath + "\\log") == false)