Exemplo n.º 1
0
        private void DoPipingFinalVerification()
        {
            PipingErrors errorType = PipingErrors.OK;

            if (curSystemItem.OutdoorItem == null)
            {
                return;
            }

            if (curSystemItem.IsManualPiping && curSystemItem.IsUpdated)
            {
                return;
            }
            //this.Cursor = Cursors.WaitCursor;
            JCHVRF.MyPipingBLL.NextGen.PipingBLL pipBll = GetPipingBLLInstance();
            bool isHR = PipingBLL.IsHeatRecovery(curSystemItem);

            pipBll.SetPipingLimitation(curSystemItem);

            errorType = pipBll.ValidateSystemHighDifference(curSystemItem);

            if (errorType == PipingErrors.OK)
            {
                errorType = pipBll.ValidatePipeLength(curSystemItem, ref addFlowPiping);
            }
            #region
            if (errorType == PipingErrors.OK)
            {
                //如果排管未完成或存在错误,每次点击验证按钮都需要将上次标红的对象恢复。add on 20160727 by Yunxiao Lin
                if (!curSystemItem.IsPipingOK)
                {
                    pipBll.SetDefaultColor(ref addFlowPiping, isHR);
                }
                if (errorType == PipingErrors.OK)
                {
                    //前面已经做了“实际管长不小于高度差”校验,所以这里已经不可能成立。 comment by Shen Junjie on 2018/7/18
                    if (curSystemItem.PipeEquivalentLength < curSystemItem.HeightDiff)
                    {
                        errorType = PipingErrors.PIPING_LENGTH_HEIGHT_DIFF; //-32;
                    }
                }

                //检验MainBranch数量-9 和分支室内机容量比例-10 -11
                if (curSystemItem.IsInputLengthManually)
                {
                    errorType = pipBll.ValMainBranch(curSystemItem, ref addFlowPiping);
                }
                if (errorType == PipingErrors.OK)
                {
                    //检验Heat Recovery系统内Cooling Only内机容量是否超过全部室内机容量的50% -12
                    //string HeatType = curSystemItem.OutdoorItem.ModelFull.Substring(3, 1);
                    //string HeatType = curSystemItem.OutdoorItem.ProductType.Contains("Heat Recovery") || curSystemItem.OutdoorItem.ProductType.Contains(", HR") ? "R":"H";
                    if (PipingBLL.IsHeatRecovery(curSystemItem) && !pipBll.ValCoolingOnlyIndoorCapacityRate(curSystemItem, ref addFlowPiping))
                    {
                        errorType = PipingErrors.COOLINGONLYCAPACITY; //-12;
                    }
                }

                if (errorType == PipingErrors.OK)
                {
                    //ANZ 每个multiple CH-Box最多只能连接2个8HP/10HP的IDU
                    errorType = pipBll.ValidateIDUOfMultiCHBox(curSystemItem);
                }

                if (errorType == PipingErrors.OK)
                {
                    SetSystemPipingOK(curSystemItem, true);
                    // 执行配管计算并绑定配管数据,连接管管径规格等
                    DoPipingCalculation(pipBll, curSystemItem.MyPipingNodeOut, out errorType);
                    if (curSystemItem.IsPipingOK)
                    {
                        //检验CH-Box到远端Indoor的总长-8 add on 20160516 by Yunxiao Lin
                        if (curSystemItem.IsInputLengthManually && !pipBll.ValCHToIndoorMaxTotalLength(curSystemItem, ref addFlowPiping))
                        {
                            errorType = PipingErrors.MKTOINDOORLENGTH1; //-8;
                        }
                        //检验CH-Box连接的室内机数量 -13
                        else if (!pipBll.ValMaxIndoorNumberConnectToCH(curSystemItem, ref addFlowPiping))
                        {
                            errorType = PipingErrors.INDOORNUMBERTOCH; //-13;
                        }
                        else
                        {
                            SetSystemPipingOK(curSystemItem, true);

                            // 计算冷媒追加量
                            if (curSystemItem.IsInputLengthManually)
                            {
                                double d1 = pipBll.GetAddRefrigeration(curSystemItem, ref addFlowPiping);
                                curSystemItem.AddRefrigeration = d1;

                                //为管线图添加加注冷媒标注 2016-12-22 by shen junjie
                                pipBll.DrawAddRefrigerationText(curSystemItem);
                            }
                            else
                            {
                                curSystemItem.AddRefrigeration = 0;
                            }
                        }
                    }
                    pipBll.DrawTextToAllNodes(curSystemItem.MyPipingNodeOut, null, curSystemItem);
                    //UtilTrace.SaveHistoryTraces();//保存历史痕迹 add by axj 20161228
                }
            }
            #endregion
            if (errorType != PipingErrors.OK)
            {
                SetSystemPipingOK(curSystemItem, false);
            }
            ShowWarningMsg(errorType);
            //UtilTrace.SaveHistoryTraces();//保存历史痕迹 add by axj 20161228

            //SetTabControlImageKey();
            //SetTreeViewOutdoorState();
            //this.Cursor = Cursors.Default;
        }