コード例 #1
0
ファイル: ValidateViewModel.cs プロジェクト: vijju1608/VRF
        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;
        }
コード例 #2
0
        public WL.AddFlow DoDrawingPiping(bool reset, JCHVRF.Model.NextGen.SystemVRF CurrentSystem, WL.AddFlow AddFlowAutoPiping)
        {
            try
            {
                AddFlowAutoPiping.Clear();
                if (CurrentSystem.MyPipingNodeOut.AddFlow != null)
                {
                    AddFlowAutoPiping = CurrentSystem.MyPipingNodeOut.AddFlow;
                }
                NextGenBLL.UtilPiping utilPiping = new NextGenBLL.UtilPiping();

                NextGenBLL.PipingBLL pipBll = GetPipingBLLInstance();
                //pipBll.SaveAllPipingStructure();
                //pipBll.CreatePipingNodeStructure(CurrentSystem);
                bool isHitachi = projectLegacy.BrandCode == "H";
                bool isHR      = NextGenBLL.PipingBLL.IsHeatRecovery(CurrentSystem);
                //string dir = GetBinDirectoryPath(ConfigurationManager.AppSettings["PipingNodeImageDirectory"].ToString());
                //TO DO Pick VRF system in case of multi system
                string dir = GetImagePathPiping();
                NextGenModel.MyNodeOut pipingNodeOut = CurrentSystem.MyPipingNodeOut;
                if (pipingNodeOut == null || CurrentSystem.OutdoorItem == null)
                {
                    return(AddFlowAutoPiping);
                }
                if (pipingNodeOut.ChildNode == null)
                {
                    return(AddFlowAutoPiping);
                }
                if (isHR)
                {
                    //SetAllNodesIsCoolingonlyFrom();
                    pipBll.SetIsCoolingOnly(CurrentSystem.MyPipingNodeOut);
                }
                if (!reset)
                {
                    utilPiping.ResetColors();
                    InitAndRemovePipingNodes(ref AddFlowAutoPiping);
                    pipBll.DrawPipingNodes(CurrentSystem, dir, ref AddFlowAutoPiping);
                    pipBll.DrawPipingLinks(CurrentSystem, ref AddFlowAutoPiping);
                    pipBll.DrawLegendText(CurrentSystem, ref AddFlowAutoPiping);
                    pipBll.LoadPipingPlottingScaleNode(CurrentSystem, ref AddFlowAutoPiping);
                    CurrentSystem.MyPipingOrphanNodes     = null;
                    CurrentSystem.MyPipingOrphanNodesTemp = null;
                }
                if (reset)
                {
                    CurrentSystem.IsManualPiping = false;
                    utilPiping.ResetColors();
                    InitAndRemovePipingNodes(ref AddFlowAutoPiping);
                    pipBll.DrawPipingNodes(CurrentSystem, dir, ref AddFlowAutoPiping);
                    pipBll.DrawPipingLinks(CurrentSystem, ref AddFlowAutoPiping);
                    pipBll.DrawLegendText(CurrentSystem, ref AddFlowAutoPiping);
                    pipBll.LoadPipingPlottingScaleNode(CurrentSystem, ref AddFlowAutoPiping);
                    CurrentSystem.MyPipingOrphanNodes     = null;
                    CurrentSystem.MyPipingOrphanNodesTemp = null;
                }
                else
                {
                    if (CurrentSystem.IsManualPiping)
                    {
                    }
                    else
                    {
                        utilPiping.ResetColors();
                    }
                    pipBll.DrawPipingNodesNoCaculation(dir, CurrentSystem);
                }
                //added for internal Bug Find zero length Issue
                pipBll.DrawCorrectionFactorText(CurrentSystem);
                if (CurrentSystem.IsPipingOK)
                {
                    if (CurrentSystem.IsInputLengthManually && CurrentSystem.IsPipingOK)
                    {
                        pipBll.DrawAddRefrigerationText(CurrentSystem);
                    }

                    pipBll.SetDefaultColor(ref AddFlowAutoPiping, isHR);
                }
                pipBll.drawPipelegend(isHR, ref AddFlowAutoPiping);
            }
            catch (Exception ex)
            {
                int?id = Project.GetProjectInstance?.projectID;
                Logger.LogProjectError(id, ex, false);
            }
            return(AddFlowAutoPiping);
        }
コード例 #3
0
        private WL.AddFlow DoPipingFinalVerification(JCHVRF.Model.NextGen.SystemVRF currentSystem, WL.AddFlow AddFlowAutoPiping)
        {
            NextGenBLL.PipingErrors errorType = NextGenBLL.PipingErrors.OK;
            if (currentSystem.OutdoorItem == null)
            {
                return(AddFlowAutoPiping);
            }
            if (currentSystem.IsManualPiping && currentSystem.IsUpdated)
            {
                return(AddFlowAutoPiping);
            }
            //this.Cursor = Cursors.WaitCursor;
            UtilityValidation ObjPipValidation = new UtilityValidation(this.projectLegacy, ref AddFlowAutoPiping);

            JCHVRF.MyPipingBLL.NextGen.PipingBLL pipBll = GetPipingBLLInstanceValidation(AddFlowAutoPiping);
            bool isHR = NextGenBLL.PipingBLL.IsHeatRecovery(currentSystem);

            pipBll.SetPipingLimitation(currentSystem);

            errorType = pipBll.ValidateSystemHighDifference(currentSystem);

            if (errorType == NextGenBLL.PipingErrors.OK)
            {
                errorType = pipBll.ValidatePipeLength(currentSystem, ref AddFlowAutoPiping);
            }
            #region
            if (errorType == NextGenBLL.PipingErrors.OK)
            {
                if (!currentSystem.IsManualPiping)
                {
                    AddFlowAutoPiping = autoPipingObj.DoDrawingPiping(true, currentSystem, AddFlowAutoPiping);
                }
                if (!currentSystem.IsPipingOK)
                {
                    pipBll.SetDefaultColor(ref AddFlowAutoPiping, isHR);
                }
                if (errorType == NextGenBLL.PipingErrors.OK)
                {
                    if (currentSystem.PipeEquivalentLength < currentSystem.HeightDiff)
                    {
                        errorType = NextGenBLL.PipingErrors.PIPING_LENGTH_HEIGHT_DIFF; //-32;
                    }
                }

                if (currentSystem.IsInputLengthManually)
                {
                    errorType = pipBll.ValMainBranch(currentSystem, ref AddFlowAutoPiping);
                }
                if (errorType == NextGenBLL.PipingErrors.OK)
                {
                    if (NextGenBLL.PipingBLL.IsHeatRecovery(currentSystem) && !pipBll.ValCoolingOnlyIndoorCapacityRate(currentSystem, ref AddFlowAutoPiping))
                    {
                        errorType = NextGenBLL.PipingErrors.COOLINGONLYCAPACITY; //-12;
                    }
                }

                if (errorType == NextGenBLL.PipingErrors.OK)
                {
                    errorType = pipBll.ValidateIDUOfMultiCHBox(currentSystem);
                }

                if (errorType == NextGenBLL.PipingErrors.OK)
                {
                    // SetSystemPipingOK(currentSystem, true);
                    DoPipingCalculation(pipBll, currentSystem.MyPipingNodeOut, currentSystem, out errorType);
                    if (currentSystem.IsPipingOK)
                    {
                        if (currentSystem.IsInputLengthManually && !pipBll.ValCHToIndoorMaxTotalLength(currentSystem, ref AddFlowAutoPiping))
                        {
                            errorType = NextGenBLL.PipingErrors.MKTOINDOORLENGTH1; //-8;
                        }
                        else if (!pipBll.ValMaxIndoorNumberConnectToCH(currentSystem, ref AddFlowAutoPiping))
                        {
                            errorType = NextGenBLL.PipingErrors.INDOORNUMBERTOCH; //-13;
                        }
                        else
                        {
                            //SetSystemPipingOK(currentSystem, true);

                            if (currentSystem.IsInputLengthManually)
                            {
                                double d1 = pipBll.GetAddRefrigeration(currentSystem, ref AddFlowAutoPiping);
                                currentSystem.AddRefrigeration = d1;

                                pipBll.DrawAddRefrigerationText(currentSystem);
                            }
                            else
                            {
                                currentSystem.AddRefrigeration = 0;
                            }
                        }
                    }
                    ObjPipValidation.DrawTextToAllNodes(currentSystem.MyPipingNodeOut, null, currentSystem);
                    UtilTrace.SaveHistoryTraces();
                }
            }
            #endregion
            if (errorType != NextGenBLL.PipingErrors.OK)
            {
                SetSystemPipingOK(currentSystem, false);

                ErrorLog.LogError(Model.ErrorType.Error, Model.ErrorCategory.PipingErrors, WarningMessageObj.ShowWarningMsg(errorType, currentSystem));
            }
            WarningMessageObj.ShowWarningMsg(errorType, currentSystem);
            return(AddFlowAutoPiping);
        }