schangxiang@126.com
2024-11-28 ef3318c39fe8358b663e66daeb98adf1de1b97a8
CC/iWareCC_ASRS/FormCC.cs
@@ -6,6 +6,7 @@
using iWareCC.StationService;
using iWareCC.ThreadService;
using iWareCC.ThreadService._03_BZ12_机器人码包工位_;
using iWareCC.ThreadService._04_BZ21_搬运整垛机器人_;
using iWareCC.WCF;
using iWareCommon.Common.Globle;
using iWareCommon.Utils;
@@ -37,6 +38,11 @@
        /// 全局—是否可以运行执行出库模式
        /// </summary>
        public static bool IsAllowRunOutMode = false;
        /// <summary>
        /// 当前下发出库任务的包号
        /// </summary>
        public static string currHandlerPackageCodeForIssueOutboundTask = "";
        /// <summary>
        /// 1号堆垛机入库口扫码强制验证通过
@@ -214,33 +220,34 @@
            // rgvService.StartService();
            //处理【下发中】的出库计划任务
            // new Thread(OutPlanTaskDecompose.HandlerIssuingTask).Start();
            //任务分解线程-出库
            // new Thread(MainTaskDecompose.HandlerMainTaskDecompose).Start();
            new Thread(DataProcess_RobotBuffer_ModeChange.Handler).Start();
            //任务分解线程-组盘入库
            // new Thread(MainTaskDecompose_ZPRK.HandlerMainTaskDecompose_ZPRK).Start();
            new Thread(DataProcess_RobotBuffer_IssueOutboundTask.Handler).Start();
            new Thread(DataProcess_RobotBuffer_AutoQiTaoOutbound.Handler).Start();
            new Thread(DataProcess_RobotBuffer_FinishTaskForOutbound.Handler).Start();
            //自动组盘任务
            new Thread(DataProcess_RobotBuffer_FinishTask.Handler).Start();
            new Thread(DataProcess_BZ01.Handler).Start();
            //重新获取发动机信息
            new Thread(DataProcess_269.Handler).Start();
            //1014库位转运到1020线程
            new Thread(DataProcess_BZ39.Handler).Start();
            new Thread(DataProcess_BZ12.Hander).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(LineInSacnResult.HandlerLineInSacnResult).Start();
            //new Thread(PrintHandler.Handler).Start();
@@ -346,7 +353,7 @@
                    this.lbl_Alert_Srm4ReleaseFinish.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm4ReleaseFinish;
                    this.lbl_Alert_RgvRelease.Text = showNowTime + SystemWarningMsg._lbl_Alert_RgvRelease;
                    this.lbl_Alert_RgvReleaseFinish.Text = showNowTime + SystemWarningMsg._lbl_Alert_RgvReleaseFinish;
                    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;
@@ -355,13 +362,13 @@
                    this.lbl_MainTaskDecompose.Text = showNowTime + SystemWarningMsg._lbl_Alert_MainTaskDecompose;
                    this.lbl_MainTaskDecompose_ZPRK.Text = showNowTime + SystemWarningMsg._lbl_Alert_MainTaskDecompose_ZPRK;
                    this.lbl_DataProcess_RobotBuffer_ModeChange.Text = showNowTime + SystemWarningMsg._lbl_Alert_MainTaskDecompose_ZPRK;
                    this.lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound;
                    this.lbl_Alert_DeleteData.Text = showNowTime + SystemWarningMsg._lbl_Alert_DeleteData;
                    this.lbl_Alert_EmptySalverTransfer.Text = showNowTime + SystemWarningMsg._lbl_Alert_EmptySalverTransfer;
                    this.lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound;
                    this.lbl_alert_DataProcess_BZ39.Text = showNowTime + SystemWarningMsg._lbl_alert_DataProcess_BZ39;
@@ -369,7 +376,7 @@
                    this.lbl_alert_DataProcess_269.Text = showNowTime + SystemWarningMsg._lbl_alert_DataProcess_269;
                    this.lbl_Alert_Place1014ClearStoreTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_Place1014To1020TaskTask;
                    this.lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask;
                    this.lbl_Alter_OutTaskRetryToMes.Text = showNowTime + SystemWarningMsg._lbl_Alert_OutTaskRetryToMes;
@@ -969,53 +976,6 @@
        #endregion
        #region AGV
        /// <summary>
        /// 获取AGV车辆列表
        /// </summary>
        public void GetAgvVehicles()
        {
            while (true)
            {
                try
                {
                    if (SystemValue.isAllowRuning_Agv && SystemValue.isStartedModel)
                    {
                        AGVRetModel list = AgvRequestHelper.GetVehicles();
                        AgvHandler.SaveAgvData(list);
                        List<String> warningAddressList = new List<string>();
                        if (list.alarms != null && list.alarms.errors != null && list.alarms.errors.Count > 0)
                        {
                            var waringList = list.alarms.errors;
                            if (waringList != null && waringList.Count > 0)
                            {
                                for (int i = 0; i < waringList.Count; i++)
                                {
                                    DeviceWarningHandler.SaveWarning(EDevice.AGV, iWareCommon.Utils.LogType.AGVTheadService,
                                        waringList[i].code, waringList[i].code, waringList[i].desc);//新增报警
                                    warningAddressList.Add(waringList[i].code);
                                }
                            }
                        }
                        DeviceWarningHandler.AutoCloseWarning(EDevice.AGV, iWareCommon.Utils.LogType.AGVTheadService, warningAddressList);//自动关闭报警
                        this.lbl_Alert_Agv.Text = "获取AGV车辆信息成功";
                    }
                }
                catch (Exception ex)
                {
                    Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.CCWCFService, "获取AGV车辆列表 出现异常:" + ex.Message, ex);
                    this.lbl_Alert_Agv.Text = "获取AGV车辆信息异常:" + ex.Message;
                }
                finally
                {
                    Thread.Sleep(5000);//5秒一次
                }
            }
        }
        #endregion
        #region 其他线程
@@ -1587,16 +1547,16 @@
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_MainTaskDecompose, ckMainTaskDecompose);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_MainTaskDecompose_ZPRK, ckMainTaskDecompose_ZPRK);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_ModeChange, ck_DataProcess_RobotBuffer_ModeChange);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_ValidateQiTao, ck_DataProcess_ValidateQiTao);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_FinishTaskForOutbound, checkBox_DataProcess_RobotBuffer_FinishTaskForOutbound);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DeleteData, ckDeleteData);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_Agv, ckAgv);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_EmptySalverTransfer, ckEmptySalverTransfer);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_AutoQiTaoOutbound, ckDataProcess_RobotBuffer_AutoQiTaoOutbound);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_BZ39, ck_DataProcess_BZ39);
@@ -1604,7 +1564,7 @@
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_269, ck_DataProcess_269);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_Place1014To1020Task, ckPlace1014ClearStoreTask);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_IssueOutboundTask, ck_DataProcess_RobotBuffer_IssueOutboundTask);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_OutTaskRetryToMes, checkBox_OutTaskRetryToMes);
        }
@@ -1881,6 +1841,9 @@
                        this.btn_Start.BackColor = default_btn_Start_Color;//还原颜色
                    }
                }
                this.lbl_RobotMode.Text = "缓存岛机器人模式:" + (IsAllowRunOutMode ? "出库模式" : "入库模式");
                this.lbl_currHandlerPackageCodeForIssueOutboundTask.Text = "当前下发出库任务的包号:" + currHandlerPackageCodeForIssueOutboundTask;
            }
        }
@@ -3580,5 +3543,27 @@
                "转换后:" + "\r\n" +
                JsonConvert.SerializeObject(retModel);
        }
        private void lbl_Alert_Place1014ClearStoreTask_Click(object sender, EventArgs e)
        {
        }
        private void button24_Click(object sender, EventArgs e)
        {
            //强制该包号出库
            var packageCode = this.tb_PackageCode.Text.Trim();
            var alertMsg = "";
            DataProcess_RobotBuffer_ForceOutbound.Handler(packageCode, ref alertMsg);
            if (!string.IsNullOrEmpty(alertMsg))
            {
                MessageBox.Show("错误:" + alertMsg);
            }
            else
            {
                MessageBox.Show("已处理");
            }
        }
    }
}