示例#1
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);
        }