private void RecalculateMaxHeightDifference(List <NextGenModel.MyNode> nodes)
        {
            double MaxOutdoorLength = 0.0;

            NextGenBLL.PipingBLL pipBll = new NextGenBLL.PipingBLL(this.Project);

            pipBll.StatisticsSystem_HighDiff(sysItemSource, nodes);

            if (sysItemSource.MaxUpperHeightDifferenceLength > sysItemSource.MaxLowerHeightDifferenceLength)
            {
                MaxOutdoorLength = sysItemSource.MaxUpperHeightDifferenceLength;
            }
            else
            {
                MaxOutdoorLength = sysItemSource.MaxLowerHeightDifferenceLength;
            }
            //TxtMaxIndoorHeightDifferences = "Maximum height difference between each Indoor unit  : " + sysItemSource.MaxIndoorHeightDifferenceLength.ToString("n1") + ut_length;
            //TxtMaxOutdoorHeightDifferences = "Maximum height difference between outdoor unit and  indoor units  :" + MaxOutdoorLength.ToString("n1") + ut_length;
            //----------------- Code below for multi-langauge------------//
            TxtMaxIndoorHeightDifferences  = Language.Current.GetMessage("MAXIMUM_HEIGHT_DIFFERENCE") + sysItemSource.MaxIndoorHeightDifferenceLength.ToString("n1") + ut_length;
            TxtMaxOutdoorHeightDifferences = Language.Current.GetMessage("MAXIMUM_HEIGHT_DIFFERENCE_BETWEEN_ODU_IDU") + MaxOutdoorLength.ToString("n1") + ut_length;


            VerificationHighDiff();
        }
Exemple #2
0
 public void UpdatePipingNodeStructure(JCHVRF.Model.NextGen.SystemVRF CurrentSystem)
 {
     try
     {
         NextGenBLL.PipingBLL pipBll = GetPipingBLLInstance();
         pipBll.CreatePipingNodeStructure(CurrentSystem);
         //newUtilTrace.UtilTrace.SaveHistoryTraces();
     }
     catch (Exception ex)
     {
         JCHMessageBox.Show("Error Occured : " + ex.Message);
     }
 }
 private void UpdatePipingNodeStructure(JCHVRF.Model.NextGen.SystemVRF CurrentSystem)
 {
     try
     {
         NextGenBLL.PipingBLL pipBll = GetPipingBLLInstance();
         pipBll.CreatePipingNodeStructure(CurrentSystem);
     }
     catch (Exception ex)
     {
         //JCHMessageBox.Show("Error Occured : " + ex.Message);
         //----------------- Code below for multi-langauge------------//
         JCHMessageBox.Show(Language.Current.GetMessage("ERROR_OCCURED"), MessageType.Error);
     }
 }
Exemple #4
0
 public void UpdateAllPipingNodeStructure()
 {
     try
     {
         if (JCHVRF.Model.Project.GetProjectInstance.SystemListNextGen != null)
         {
             foreach (var sysvrf in JCHVRF.Model.Project.GetProjectInstance.SystemListNextGen)
             {
                 sysvrf.MyPipingNodeOut = null;
                 NextGenBLL.PipingBLL pipBll = GetPipingBLLInstance();
                 pipBll.LoadPipingNodeStructure(sysvrf);
                 //pipBll.CreatePipingNodeStructure(sysvrf);
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
        public PipingLengthSettingsViewModel(JCHVRF.Model.Project Project, IEventAggregator eventAggregator, IProjectInfoBAL projectInfoBll)
        {
            this.Project = JCHVRF.Model.Project.GetProjectInstance;
            thisProject  = JCHVRF.Model.Project.GetProjectInstance;
            var ProjcurrentSystem = JCHVRF.Model.Project.GetProjectInstance.SystemListNextGen;
            var Lists             = ProjcurrentSystem.FirstOrDefault(); //.Where(idu => idu.Id == Syste.Id)

            PipeLengthGridSelectionChanged = new DelegateCommand <IList <Object> >(OnSelectionChanged);
            CurrentSystems = Lists;
            LengthUnit     = SystemSetting.UserSetting.unitsSetting.settingLENGTH;
            //NextGenModel.SystemVRF curSystemItem = (NextGenModel.SystemVRF)CurrentSystems;
            if (WorkFlowContext.CurrentSystem != null)
            {
                if (WorkFlowContext.CurrentSystem is NextGenModel.SystemVRF)
                {
                    NextGenModel.SystemVRF curSystemItem = (NextGenModel.SystemVRF)WorkFlowContext.CurrentSystem;
                    this._eventAggregator = eventAggregator;
                    _eventAggregator      = eventAggregator;
                    ListIDU = new ObservableCollection <IDUList>();
                    //SelectedRow = new ObservableCollection<IDUList>();
                    ut_length = SystemSetting.UserSetting.unitsSetting.settingLENGTH;
                    NextGenBLL.PipingBLL pipBll = new NextGenBLL.PipingBLL(this.Project);

                    if (curSystemItem != null)
                    {
                        sysItemSource = curSystemItem;
                        initPipLength();
                        //CreateDataGridViewColumns();
                        //BindPositionType();
                        BindHighDifference();
                    }
                    PopupSettings       = Visibility.Hidden;
                    IsPipingPopupOpened = false;
                    Settings            = new DelegateCommand(OnSettingsClicked);
                    SettingsOk          = new DelegateCommand(OnSettingsOk);
                    SettingsCancel      = new DelegateCommand(OnSettingsCancel);
                }
            }
            Eq_lengthError = "[0-" + Unit.ConvertToControl(sysItemSource.MaxEqPipeLength, UnitType.LENGTH_M, ut_length).ToString("n1") + "]";
            HD_lengthError = "[0-" + Unit.ConvertToControl(sysItemSource.MaxDiffIndoorLength, UnitType.LENGTH_M, ut_length).ToString("n1") + "]";
        }
Exemple #6
0
        private void DoPipingCalculation(NextGenBLL.PipingBLL pipBll, JCHVRF.Model.NextGen.MyNodeOut nodeOut, JCHVRF.Model.NextGen.SystemVRF currentSystem, out NextGenBLL.PipingErrors errorType)
        {
            errorType = NextGenBLL.PipingErrors.OK;
            if (nodeOut.ChildNode == null)
            {
                return;
            }
            pipBll.GetSumCapacity(nodeOut.ChildNode);
            pipBll.IsBranchKitNeedSizeUp(currentSystem);
            PipingBranchKit firstBranchKit = null;

            if (nodeOut.ChildNode is JCHVRF.Model.NextGen.MyNodeYP)
            {
                JCHVRF.Model.NextGen.MyNodeYP nodeYP = nodeOut.ChildNode as JCHVRF.Model.NextGen.MyNodeYP;
                if (nodeYP.IsCP)
                {
                    firstBranchKit = pipBll.getFirstHeaderBranchPipeCalculation(nodeYP, currentSystem, out errorType);
                }
                else
                {
                    firstBranchKit = pipBll.getFirstPipeCalculation(nodeYP, currentSystem, out errorType);
                }
                if (errorType != NextGenBLL.PipingErrors.OK)
                {
                    SetSystemPipingOK(currentSystem, false);
                    return;
                }
            }
            //bug 3489
            var L2SizeDownRule = pipBll.GetL2SizeDownRule(currentSystem);//增大1st branch的管径型号 或者 缩小2nd branch的管径型号 add by Shen Junjie on 2018/2/21

            //bug 3489
            pipBll.getSumCalculationInversion(firstBranchKit, nodeOut, nodeOut.ChildNode, currentSystem, false, out errorType, L2SizeDownRule);
            if (errorType != NextGenBLL.PipingErrors.OK)
            {
                SetSystemPipingOK(currentSystem, false);
                return;
            }
            pipBll.CheckIndoorNumberConnectedCHBox(nodeOut);
        }
Exemple #7
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);
        }
Exemple #8
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;
        }
Exemple #9
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);
        }