yi eason vor 3 Jahren
Ursprung
Commit
74c7090bf2

+ 42 - 61
CarMeterSystem/frmMain.cs

@@ -131,6 +131,9 @@ namespace CarMeterSystem
                     //}
                     if (bd.setBaseDb() && bd.getBaseDb())
                     {
+                        updateEventDataMonitor.validFlag = "1";
+                        updateEventDataMonitor.pointNo = PbCache.sportInfo.baseSpotNo;
+
                         if (!string.IsNullOrEmpty(PbCache.sportInfo.ledIp))
                         {
                             led_controler = new LED_Control(PbCache.sportInfo.ledIp);
@@ -402,7 +405,6 @@ namespace CarMeterSystem
                             if (string.IsNullOrEmpty(sweepCodeClass.StrCode))
                             {
                                 if (string.IsNullOrEmpty(PbCache.strCode))
-                                
                                 {
                                     PbCache.isValidScan = true;
                                     codeFlag = false;
@@ -531,7 +533,6 @@ namespace CarMeterSystem
                 {
                     PbCache.collect.pointid = PbCache.sportInfo.baseSpotNo;
                     PbCache.collect.weight = e.weight;
-                    PbCache.collect.weight = e.weight;
                     PbCache.collect.weightStatus = e.weightStatus;
                     PbCache.collect.parkStatus = e.parkStatus;
                     PbCache.collect.datetime = e.datetime;
@@ -605,8 +606,6 @@ namespace CarMeterSystem
                     if (iCount % 2 == 0)
                     {
                         //调用该方法时已赋值
-                        updateEventDataMonitor.validFlag = "1";
-                        updateEventDataMonitor.pointNo = PbCache.sportInfo.baseSpotNo;
                         rmUpdateEventDataMonitor = meterWorkMonitor.doQueryOneWf(updateEventDataMonitor);
                         if (!rmUpdateEventDataMonitor.Succeed)
                         {
@@ -618,6 +617,8 @@ namespace CarMeterSystem
                             {
                                 PbCache.monitor = rmUpdateEventDataMonitor.Data[0];
 
+                                //l.WriteLog(0, $"获取Monitor传入值:validFlag:{updateEventDataMonitor.validFlag},pointNo:{updateEventDataMonitor.pointNo},返回值:pointNo:{PbCache.monitor.pointNo},isTakeOver:{PbCache.monitor.isTakeOver},isOverWgt:{PbCache.monitor.isOverWgt}");
+
                                 if (string.IsNullOrEmpty(PbCache.collect_no))
                                 {
                                     PbCache.collect_no = rmUpdateEventDataMonitor.Data[0].collectionCode;
@@ -849,10 +850,14 @@ namespace CarMeterSystem
                 {
                     isOpened = false; //下次上秤直接打开主界面
 
+                    /*
+                    meterWorkMonitorEventDataI.isZeroState = "0";
                     if (e.weight > 0 && e.weight < 200)
                     {
                         doOperateLive();
+                        meterWorkMonitorEventDataI.isZeroState = "1";
                     }
+                    //*/
                     if (e.weight == 0)
                     {
                         PbCache.isZeroAlarm = false;
@@ -949,7 +954,7 @@ namespace CarMeterSystem
                         meterWorkMonitorEventDataI.photoCar = "";
                         meterWorkMonitorEventDataI.scanCar = "";
                         meterWorkMonitorEventDataI.editCar = "";
-                        meterWorkMonitorEventDataI.zeroState = "0";
+                        //meterWorkMonitorEventDataI.zeroState = "0";
                         meterWorkMonitorEventDataI.carErr = "0";
                         meterWorkMonitorEventDataI.ferroalloyResult = "0";
                         meterWorkMonitorEventDataI.wgtErr = "0";
@@ -961,19 +966,21 @@ namespace CarMeterSystem
                         meterWorkMonitorEventDataI.weightStatus = 0;
                         meterWorkMonitorEventDataI.wgt = e.weight;
 
-                        meterWorkMonitorEventDataI.isZeroState = "1";
+                        
                         meterWorkMonitorEventDataI.isEnableSound = "1";
 
+                        //*
                         // DVR,MOXA,PLC状态监控
                         // 20220928 by BourneCao
                         bool DVR_Online = PingIp(PbCache.sportInfo.videoIp);
                         meterWorkMonitorEventDataI.dvrState = DVR_Online == true ? "0" : "1";
-                        bool Power_Online = PingIp(PbCache.sportInfo.controlIp);
-                        meterWorkMonitorEventDataI.powerState = Power_Online == true ? "0" : "1";
+                        //bool Power_Online = PingIp(PbCache.sportInfo.controlIp);
+                        //meterWorkMonitorEventDataI.powerState = Power_Online == true ? "0" : "1";
                         bool MOXA_Online = PingIp(PbCache.sportInfo.moxaIp);
                         meterWorkMonitorEventDataI.moxaState = MOXA_Online == true ? "0" : "1";
-                        bool PLC_Online = PingIp(PbCache.sportInfo.plcIp);
-                        meterWorkMonitorEventDataI.plcState = PLC_Online == true ? "0" : "1";
+                        //bool PLC_Online = PingIp(PbCache.sportInfo.plcIp);
+                        //meterWorkMonitorEventDataI.plcState = PLC_Online == true ? "0" : "1";
+                        //*/
 
                         //*
                         //另外初始化一次监控数据
@@ -1002,49 +1009,6 @@ namespace CarMeterSystem
         private delegate void ShowBtnTare(bool flag);//定义委托  期限皮重按钮
 
 
-        List<LiveData> lldoOperateLive = new List<LiveData>();
-        /// <summary>
-        /// 操作Live表的数据:零点报警
-        /// </summary>
-        private void doOperateLive () {
-            if (PbCache.collect_no==null)
-            {
-                return;
-            }
-            lldoOperateLive = MemoClass.getWarnInfo(PbCache.collect_no);
-            if (lldoOperateLive != null)
-            {
-                foreach (LiveData lv in lldoOperateLive)
-                {
-                    switch (lv.Tagname.Replace(PbCache.collect_no, ""))
-                    {
-                        case "StaticStatus"://车辆检测	"0、东西方向激光均无报警;否则报警
-
-                            break;
-                        case "SwitchLight"://PLC红绿灯控制模式状态	"PLC有三种控制模式:1、自动、2、远控;3、检修
-
-                            break;
-                        case "LightWest"://红绿灯:1、为绿灯;2、为红灯;"
-
-                            break;
-                        case "ZeroWeightStatus": //0、其它,1、零点报警,红绿灯变红,
-                            if (((lv.Value ?? "0") + "").Equals("1"))
-                            {
-                                doInsertZeroAlarm();
-                                PbCache.isZeroAlarm = true;
-                            }
-                            else 
-                            {
-                                PbCache.isZeroAlarm = false;
-                            }
-                            break;
-                        case "ZeroWeight":
-                            mwmdoLive.zeroWeight = lv.Value.ToString();
-                            break;
-                    }
-                }
-            }
-        }
 
         List<LiveData> lldoLive = new List<LiveData>();
         MeterWorkMonitor mwmdoLive = new MeterWorkMonitor();
@@ -1137,14 +1101,20 @@ namespace CarMeterSystem
                             break;
                         case "ZeroWeightStatus":
                             mwmdoLive.zeroState = lv.Value.ToString();
-                            if (((lv.Value ?? "0") + "").Equals("1"))
+                            //============eason add 2023-3-28 ==========================
+                            //若存在零点报警则进行提示
+                            if (PbCache.monitor.wgt < 500) 
                             {
-                                doInsertZeroAlarm();
-                                PbCache.isZeroAlarm = true;
-                            }
-                            else
-                            {
-                                PbCache.isZeroAlarm = false;
+                                //===============================================================
+                                if (((lv.Value ?? "0") + "").Equals("1"))
+                                {
+                                    doInsertZeroAlarm();
+                                    PbCache.isZeroAlarm = true;
+                                }
+                                else
+                                {
+                                    PbCache.isZeroAlarm = false;
+                                }
                             }
                             break;
                         case "ZeroWeight":
@@ -1193,6 +1163,7 @@ namespace CarMeterSystem
         /// <param name="e"></param>
         private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
         {
+            liveFlag = false;
             StopWriteMonitor();//结束更新监控表线程
             collection.Stop();
             imageCurlControl.Stop();
@@ -1200,6 +1171,15 @@ namespace CarMeterSystem
             sweepCodeClass2.CloseThread();
             timer1.Stop();
             timer1.Dispose();
+
+            if (!string.IsNullOrEmpty(meterWorkMonitorEventDataI.pointNo)) 
+            {
+                if (!meterWorkMonitor.doUpdateWf(meterWorkMonitorEventDataI).Succeed)
+                {
+                    l.WriteLog(0, "frmMain.EventData异常754:写入信息异常");
+                }
+            }
+            
         }
 
         private bool SystemUpdate(bool isMessage)
@@ -1311,12 +1291,13 @@ namespace CarMeterSystem
         }
 
         #region 更新监控表线程
+        bool liveFlag = true;
         //rxh add
         private Thread thWriteMonitor;//更新监控表线程
         private int writeMonitorInterval;//时间间隔
         private void WriteMonitorInTime()
         {
-            while (true)
+            while (liveFlag)
             {
                 try
                 {

+ 3 - 4
CarMeterSystem/frmOneYardToEnd.cs

@@ -64,10 +64,10 @@ namespace CarMeterSystem
 
         private MeterWorkCarActualFirst meterWorkCarActualFirst = null;
 
-        private ImageCurlControl imageCurlControl = new ImageCurlControl();
+        //private ImageCurlControl imageCurlControl = new ImageCurlControl();
 
         // 抓图用的界面 20220808 by BourneCao
-        private frmVoice frmVoice = new frmVoice();
+        //private frmVoice frmVoice = new frmVoice();
 
         private DateTime weighTime; //上秤时间
         private DateTime showButtonTime; //出现按钮时间
@@ -471,7 +471,7 @@ namespace CarMeterSystem
 
 
                     //txtMsgInfo.Text = "称重保存中......";
-                    setMsg("称重保存中......" + PbCache.collect.weightStatus + ";" + PbCache.collect.weight);
+                    setMsg("称重保存中......");
 
                     /* 
                      * 锁界面,修改图标,锁定重量,拍照,截图
@@ -2492,7 +2492,6 @@ namespace CarMeterSystem
                     validPredictionDiff = "1",
                     validLianda = "1",
                     validMatClick = "1",
-                    isZeroState = "1",
                     isEnableSound = "1",
                     setCar = "",
                     rfidCar = "",

+ 13 - 13
CarRemoteMeter/frmMeterMain.Designer.cs

@@ -682,7 +682,7 @@
             // ultraTabPageControl5
             // 
             this.ultraTabPageControl5.Controls.Add(this.ultraGridYb);
-            this.ultraTabPageControl5.Location = new System.Drawing.Point(-10000, -10000);
+            this.ultraTabPageControl5.Location = new System.Drawing.Point(1, 25);
             this.ultraTabPageControl5.Margin = new System.Windows.Forms.Padding(2);
             this.ultraTabPageControl5.Name = "ultraTabPageControl5";
             this.ultraTabPageControl5.Size = new System.Drawing.Size(804, 308);
@@ -3237,7 +3237,7 @@
             // ultraTabPageControl9
             // 
             this.ultraTabPageControl9.Controls.Add(this.ultraGridPW);
-            this.ultraTabPageControl9.Location = new System.Drawing.Point(-10000, -10000);
+            this.ultraTabPageControl9.Location = new System.Drawing.Point(1, 25);
             this.ultraTabPageControl9.Name = "ultraTabPageControl9";
             this.ultraTabPageControl9.Size = new System.Drawing.Size(292, 147);
             // 
@@ -3405,7 +3405,7 @@
             // 
             // ultraTabSharedControlsPage1
             // 
-            this.ultraTabSharedControlsPage1.Location = new System.Drawing.Point(1, 25);
+            this.ultraTabSharedControlsPage1.Location = new System.Drawing.Point(-10000, -10000);
             this.ultraTabSharedControlsPage1.Margin = new System.Windows.Forms.Padding(2);
             this.ultraTabSharedControlsPage1.Name = "ultraTabSharedControlsPage1";
             this.ultraTabSharedControlsPage1.Size = new System.Drawing.Size(804, 308);
@@ -4215,7 +4215,7 @@
             this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35F));
             this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 50F));
             this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 60F));
-            this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 151F));
+            this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 153F));
             this.tableLayoutPanel7.Controls.Add(this.txtCarNo, 6, 0);
             this.tableLayoutPanel7.Controls.Add(this.cbCarNo, 5, 0);
             this.tableLayoutPanel7.Controls.Add(this.lbPointName, 1, 0);
@@ -4235,10 +4235,10 @@
             // 
             this.txtCarNo.Dock = System.Windows.Forms.DockStyle.Fill;
             this.txtCarNo.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtCarNo.Location = new System.Drawing.Point(654, 2);
+            this.txtCarNo.Location = new System.Drawing.Point(652, 2);
             this.txtCarNo.Margin = new System.Windows.Forms.Padding(2);
             this.txtCarNo.Name = "txtCarNo";
-            this.txtCarNo.Size = new System.Drawing.Size(148, 24);
+            this.txtCarNo.Size = new System.Drawing.Size(150, 24);
             this.txtCarNo.TabIndex = 81;
             this.txtCarNo.Text = " ";
             this.txtCarNo.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtCarNo_KeyDown);
@@ -4311,7 +4311,7 @@
             "琼",
             "",
             "云"});
-            this.cbCarNo.Location = new System.Drawing.Point(594, 2);
+            this.cbCarNo.Location = new System.Drawing.Point(592, 2);
             this.cbCarNo.Margin = new System.Windows.Forms.Padding(2);
             this.cbCarNo.Name = "cbCarNo";
             this.cbCarNo.Size = new System.Drawing.Size(56, 24);
@@ -4327,7 +4327,7 @@
             this.lbPointName.ForeColor = System.Drawing.Color.Black;
             this.lbPointName.Location = new System.Drawing.Point(73, 0);
             this.lbPointName.Name = "lbPointName";
-            this.lbPointName.Size = new System.Drawing.Size(255, 30);
+            this.lbPointName.Size = new System.Drawing.Size(254, 30);
             this.lbPointName.TabIndex = 3;
             this.lbPointName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
             // 
@@ -4352,7 +4352,7 @@
             this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
             this.label2.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.ForeColor = System.Drawing.Color.Blue;
-            this.label2.Location = new System.Drawing.Point(545, 0);
+            this.label2.Location = new System.Drawing.Point(543, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(44, 30);
             this.label2.TabIndex = 8;
@@ -4366,7 +4366,7 @@
             this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.label1.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.ForeColor = System.Drawing.Color.Blue;
-            this.label1.Location = new System.Drawing.Point(334, 0);
+            this.label1.Location = new System.Drawing.Point(333, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(64, 30);
             this.label1.TabIndex = 7;
@@ -4380,9 +4380,9 @@
             this.lbMeterMan.Dock = System.Windows.Forms.DockStyle.Fill;
             this.lbMeterMan.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lbMeterMan.ForeColor = System.Drawing.Color.Black;
-            this.lbMeterMan.Location = new System.Drawing.Point(404, 0);
+            this.lbMeterMan.Location = new System.Drawing.Point(403, 0);
             this.lbMeterMan.Name = "lbMeterMan";
-            this.lbMeterMan.Size = new System.Drawing.Size(135, 30);
+            this.lbMeterMan.Size = new System.Drawing.Size(134, 30);
             this.lbMeterMan.TabIndex = 5;
             this.lbMeterMan.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
             // 
@@ -4671,7 +4671,7 @@
             // 
             // ultraTabSharedControlsPage2
             // 
-            this.ultraTabSharedControlsPage2.Location = new System.Drawing.Point(1, 25);
+            this.ultraTabSharedControlsPage2.Location = new System.Drawing.Point(-10000, -10000);
             this.ultraTabSharedControlsPage2.Margin = new System.Windows.Forms.Padding(2);
             this.ultraTabSharedControlsPage2.Name = "ultraTabSharedControlsPage2";
             this.ultraTabSharedControlsPage2.Size = new System.Drawing.Size(292, 147);

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

@@ -102,6 +102,9 @@ namespace MeterPlugInLibrary
                         string carNo1 = jArray[8].ToString();
                         string carNo2 = jArray[14].ToString();
 
+                        if (carNo1.Contains("挂")) carNo1 = "";
+                        if (carNo2.Contains("挂")) carNo2 = "";
+
                         arg.videoCarNo1 = carNo1;
                         arg.videoCarNo2 = carNo2;
 

+ 12 - 0
MeterSceneLibrary/JISCO/InnerDoubleJISCO.cs

@@ -206,6 +206,18 @@ namespace MeterSceneLibrary
                             //存在一条一次计量数据
                             else if (firstList.Count == 1)
                             {
+                                //==============eason add 2023-03-27 暂未启用===============================
+                                /*
+                                if (!string.IsNullOrEmpty(firstList[0].predictionNo) && !string.IsNullOrEmpty(rmScale.Data[0].predictionNo) && firstList[0].predictionNo != rmScale.Data[0].predictionNo)
+                                {
+                                    rt = saveMethod.doError("计量失败,委托选择异常,请联系计量大厅");
+                                    PbCache.voiceType = 19;
+                                    PbCache.LEDResultMessage = "计量失败,委托选择异常,请联系计量大厅";
+                                    return rt;
+                                }
+                                //*/
+                                //=============================end===================================
+
                                 //存在的一次数据为毛重
                                 if (firstList[0].weightType == "0")
                                 {