11
schangxiang@126.com
2024-12-03 e8734db76fbbb3149ba663beff3b4f7451012b03
CC/iWareCC_ASRS/FormCC.cs
@@ -28,6 +28,7 @@
using System.Windows.Forms;
using XiGang.Core.Model;
using XiGang.Core.Model.ViewModels;
using static iWareCC.ThreadService._04_BZ21_搬运整垛机器人_.DataProcess_BZ21;
namespace iWareCC
{
@@ -201,13 +202,14 @@
            //堆垛机UI赋值
            SetSrmUI();
            tskSetSrmLable = new Thread(SrmRead_Label);
            tskSetSrmLable.Start();
            #endregion
            #region 设置显示UI
            tskSetSrmLable = new Thread(SrmRead_Label);
            tskSetSrmLable.Start();
            tskSetRgvLable = new Thread(SetRgvLable);
            tskSetRgvLable.Start();
            #endregion
            #region 服务线程启动
@@ -240,14 +242,18 @@
            new Thread(DataProcess_BZ39.Handler).Start();
            new Thread(DataProcess_BZ39_IssueInboundTask.Handler).Start();
            new Thread(DataProcess_BZ12.Hander).Start();
            new Thread(DataProcess_BZ12_IssueTask.Handler).Start();
            new Thread(DataProcess_BZ12_FinishTask.Handler).Start();
            new Thread(DataProcess_BZ21.Hander).Start();
            new Thread(DataProcess_BZ21_FinishTask.Handler).Start();
            new Thread(DeleteData).Start();
            new Thread(PrintHandler.Handler).Start();
            //new Thread(PrintHandler.Handler).Start();
@@ -325,10 +331,6 @@
            //btn_Start_Click(null, null);
        }
        #region 堆垛机线程和UI处理
        /// <summary>
        /// 设置1/2号堆垛机的前端显示
        /// </summary>
@@ -342,7 +344,7 @@
                    var showNowTime = "(" + DateTimeHelper.ConvertToStringForOnlyShowTime(DateTime.Now) + ")";
                    //设置堆垛机任务下发和任务确认线程消息
                    this.lbl_Alter_Srm1Release.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm1Release;
                    this.lbl_Alert_DataProcess_BZ39_IssueInboundTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_BZ39_IssueInboundTask;
                    this.lbl_Alert_Srm2Release.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm2Release;
                    this.lbl_Alert_Srm3Release.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm3Release;
                    this.lbl_Alert_Srm4Release.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm4Release;
@@ -356,7 +358,7 @@
                    this.lbl_Alert_RgvReleaseFinish.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange;
                    this.lbl_Alert_RgvReleaseFinish_BuChang.Text = showNowTime + SystemWarningMsg._lbl_Alert_RgvReleaseFinish_BuChang;
                    this.lbl_Alert_HandlerIssuingTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_HandlerIssuingTask;
                    this.lbl_Alert_DataProcess_BZ12_IssueTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_BZ12_IssueTask;
                    this.lbl_Alert_DataProcess_RobotBuffer_FinishTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTask;
@@ -387,11 +389,14 @@
                }
                catch (Exception ex)
                {
                    Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.SrmTheadService, "方法SrmRead_Label出现异常:" + ex.Message, ex);
                    continue;
                }
            }
        }
        #region 堆垛机线程和UI处理
        /// <summary>
        /// 获取堆垛机的实时信息
@@ -416,18 +421,18 @@
                            {
                                for (int i = 0; i < waringList.Count; i++)
                                {
                                    DeviceWarningHandler.SaveWarning(device, iWareCommon.Utils.LogType.SrmTheadService,
                                    DeviceWarningHandler.SaveWarning(device, iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask,
                                        waringList[i].Code, waringList[i].Address, waringList[i].Context);//新增报警
                                    warningAddressList.Add(waringList[i].Address);
                                }
                            }
                        }
                        DeviceWarningHandler.AutoCloseWarning(device, iWareCommon.Utils.LogType.SrmTheadService, warningAddressList);//自动关闭报警
                        DeviceWarningHandler.AutoCloseWarning(device, iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask, warningAddressList);//自动关闭报警
                    }
                }
                catch (Exception ex)
                {
                    Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.SrmTheadService, "获取" + device.ToString() + "的实时信息异常:" + ex.Message, ex);
                    Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask, "获取" + device.ToString() + "的实时信息异常:" + ex.Message, ex);
                    continue;
                }
            };
@@ -468,7 +473,7 @@
            };
            realTimeList.Add(obj);
            DeviceSrmRealTimeHandler.Update(realTimeList, iWareCommon.Utils.LogType.SrmTheadService);
            DeviceSrmRealTimeHandler.Update(realTimeList, iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask);
        }
@@ -1180,7 +1185,7 @@
                using (var opcClinet = new SrmService.SrmServiceClient())
                {
                    var result = opcClinet.SendEStop((int)_EDevice);
                    Log4NetHelper.WriteInfoLog(iWareCommon.Utils.LogType.SrmTheadService, "字符串:" + JsonConvert.SerializeObject(result));
                    Log4NetHelper.WriteInfoLog(iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask, "字符串:" + JsonConvert.SerializeObject(result));
                    if (result.result)
                    {
                        WZ.Useful.Commons.MessageUtil.ShowTips("发送" + _EDevice.ToString() + "急停指令成功");
@@ -1483,7 +1488,7 @@
                this.lbl_ModelText.Text = title + currentCheckModelText;
                SetAllCheckBoxChecked(true);
                //将特殊的取消
                this.ckHandlerIssuingTask.Checked = false;
                this.ck_DataProcess_BZ12_IssueTask.Checked = false;
                this.ckMainTaskDecompose.Checked = false;
                this.gBoxThread.Enabled = true;
@@ -1520,7 +1525,7 @@
        private void CommonCheckedChanged(object sender, EventArgs e)
        {
            //堆垛机1任务下发
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_1, ckBSrm1Release);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_1, ckB_DataProcess_BZ39_IssueInboundTask);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_1_Finish, ckBSrm1FinishedHandle);
            //堆垛机2任务下发
@@ -1541,7 +1546,7 @@
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_RgvThreadService_Finish, ckBRgvFinishedHandle);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_RgvThreadService_Finish_BuChang, ckBRgvFinishedHandle_BuChang);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_HandlerIssuingTask, ckHandlerIssuingTask);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_HandlerIssuingTask, ck_DataProcess_BZ12_IssueTask);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_FinishTask, ck_DataProcess_RobotBuffer_FinishTask);
@@ -1549,7 +1554,7 @@
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_ModeChange, ck_DataProcess_RobotBuffer_ModeChange);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_PrintHandler, ck_PrintHandler);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_ValidateQiTao, ck_DataProcess_ValidateQiTao);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_FinishTaskForOutbound, checkBox_DataProcess_RobotBuffer_FinishTaskForOutbound);