/// 计算指定系统中的管长修正系数 /// <summary> /// 计算当前系统的管长修正系数 /// </summary> /// <returns></returns> private double GetPipeLengthRevisedFactor(SystemVRF curSystemItem, string condition) { PipingBLL pipBll = new PipingBLL(thisProject); //bool isAbove = !(curSystemItem.PipingPositionType == PipingPositionType.Lower); return(pipBll.GetPipeLengthFactor(curSystemItem, condition)); }
//TODO : <sandeep>Will Move this duplicate method to CommonBLL. So that It can be used at MasterDesignerViewmodel and NotificationBarViewModel. public void DoSavePipingTempNodeOutStructure() { try { PipingBLL pipBllNG = GetPipingBLLInstance(); pipBllNG.SaveAllPipingStructure(); } catch (Exception ex) { int?id = Project.GetProjectInstance?.projectID; Logger.LogProjectError(id, ex); } }
private void DoPipingCalculation(PipingBLL pipBll, JCHVRF.Model.NextGen.MyNodeOut nodeOut, out PipingErrors errorType) { errorType = PipingErrors.OK; if (nodeOut.ChildNode == null) { return; } //分歧管型号和管径改为如果后面的大于前面的,则后面的替换为前面的型号和管径 by Shen Junjie on 20170409 //getSumCalculation(ref firstDstNode, factoryCode, type, unitType); pipBll.GetSumCapacity(nodeOut.ChildNode); pipBll.IsBranchKitNeedSizeUp(curSystemItem); 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) { //第一分歧管可能是梳形管 20170711 by Yunxiao Lin firstBranchKit = pipBll.getFirstHeaderBranchPipeCalculation(nodeYP, curSystemItem, out errorType); } else { // 第一分歧管放大一号计算 firstBranchKit = pipBll.getFirstPipeCalculation(nodeYP, curSystemItem, out errorType); } if (errorType != PipingErrors.OK) { SetSystemPipingOK(curSystemItem, false); return; } } //分歧管型号和管径改为如果后面的大于前面的,则后面的替换为前面的型号和管径 by Shen Junjie on 20170409 pipBll.getSumCalculationInversion(firstBranchKit, nodeOut, nodeOut.ChildNode, curSystemItem, false, out errorType); if (errorType != PipingErrors.OK) { SetSystemPipingOK(curSystemItem, false); return; } pipBll.CheckIndoorNumberConnectedCHBox(nodeOut); }
public frmPipingLengthSetting(SystemVRF curSystemItem, List <RoomIndoor> listRISelected, Project thisProject) { InitializeComponent(); this.JCSetLanguage(); this.listRISelected = listRISelected; this.thisProject = thisProject; ut_length = SystemSetting.UserSetting.unitsSetting.settingLENGTH; this.JCCallValidationManager = true; panelHighDifference.Visible = true; pbll = new PipingBLL(thisProject); if (curSystemItem != null) { //初始化数据 sysItemSource = curSystemItem; initPipLength(); CreateDataGridViewColumns(); BindPositionType(); // BindIndoorDiff(); BindHighDifference(); } }
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; }
private void InitData() { if (currSystem == null) { return; } var inds = thisProject.RoomIndoorList.FindAll(p => p.SystemID == currSystem.Id); int indsCount = 0; if (inds != null && inds.Count > 0) { indsCount = inds.Count; } var lengthList = new List <dynamic>(); var heightList = new List <dynamic>(); var pipingRules = new { Length = lengthList, Height = heightList }; int starRow = 0; #region Length dgvPipingRules.Rows.Add(1); //Total pipe length dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Length"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_TotalPipeLength"); dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(currSystem.TotalPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.MaxTotalPipeLength == 0 ? "-" : Unit.ConvertToControl(currSystem.MaxTotalPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.MaxTotalPipeLength == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(currSystem.TotalPipeLength, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.MaxTotalPipeLength, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); //Maximum piping length (Actual length) starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Length"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_PipeActualLength"); dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(currSystem.PipeActualLength, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.MaxPipeLength == 0 ? "-" : Unit.ConvertToControl(currSystem.MaxPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.MaxPipeLength == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(currSystem.PipeActualLength, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.MaxPipeLength, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); //Maximum piping length (Equivalent length) starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Length"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_PipeEquivalentLength"); dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(currSystem.PipeEquivalentLength, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.MaxEqPipeLength == 0 ? "-" : Unit.ConvertToControl(currSystem.MaxEqPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.MaxEqPipeLength == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(currSystem.PipeEquivalentLength, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.MaxEqPipeLength, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); //Maximum Piping Length between Multi-kit of 1st Branch and Each Indoor Unit starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Length"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_FirstPipeLength"); dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(currSystem.FirstPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.MaxIndoorLength == 0 ? "-" : Unit.ConvertToControl(currSystem.MaxIndoorLength, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.MaxIndoorLength == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(currSystem.FirstPipeLength, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.MaxIndoorLength, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); //Maximum Piping Length between Each Multi-kit and Each Indoor Unit starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Length"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_ActualMaxMKIndoorPipeLength"); dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(currSystem.ActualMaxMKIndoorPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.MaxMKIndoorPipeLength == 0 ? "-" : Unit.ConvertToControl(currSystem.MaxMKIndoorPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.MaxMKIndoorPipeLength == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(currSystem.ActualMaxMKIndoorPipeLength, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.MaxMKIndoorPipeLength, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); //Piping Length between Piping Connection Kit 1 and Each Outdoor Unit //单独的室外机不需要显示该项限制 if (!string.IsNullOrEmpty(currSystem.OutdoorItem.JointKitModelG.Trim()) && currSystem.OutdoorItem.JointKitModelG.Trim() != "-") { starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Length"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_PipeLengthes"); double MaxPipeLengths = 0; if (currSystem.IsInputLengthManually) { MaxPipeLengths = PipingBLL.GetMaxPipeLengthOfNodeOut(currSystem.MyPipingNodeOut); } dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(MaxPipeLengths, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.MaxFirstConnectionKitToEachODU == 0 ? "-" : Unit.ConvertToControl(currSystem.MaxFirstConnectionKitToEachODU, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.MaxFirstConnectionKitToEachODU == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(MaxPipeLengths > 0 ? MaxPipeLengths : 0, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.MaxFirstConnectionKitToEachODU, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); } if (HeatRecovery) { bool isAllOK = true; var chBoxs = new List <dynamic>(); JCHVRF.MyPipingBLL.PipingBLL.EachNode(currSystem.MyPipingNodeOut, (node1) => { double actual; double max; string model; if (node1 is MyNodeCH) { var item = (MyNodeCH)node1; actual = item.ActualTotalCHIndoorPipeLength; max = item.MaxTotalCHIndoorPipeLength; model = item.Model; } else if (node1 is MyNodeMultiCH) { var item = (MyNodeMultiCH)node1; actual = item.ActualTotalCHIndoorPipeLength; max = item.MaxTotalCHIndoorPipeLength; model = item.Model; } else { return; } bool isOK = !(max > 0 && actual > max); isAllOK = isAllOK && isOK; var chbox = chBoxs.Find(p => p.Rules == model); if (chbox == null) { chbox = new System.Dynamic.ExpandoObject(); chbox.Rules = model; chbox.Actual = actual; chbox.Max = max; chbox.isOK = isOK; chBoxs.Add(chbox); } else { if ((chbox.isOK && isOK && actual > chbox.Actual) || //高的覆盖低的 (chbox.isOK && !isOK)) //出错的覆盖正常的 { chbox.Actual = actual; chbox.Max = max; chbox.isOK = isOK; } } }); if (chBoxs.Count > 0) { //Total piping length between CH-Box and Each Indoor Unit starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Length"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_CHBoxs"); dgvPipingRules.Rows[starRow].Cells[2].Value = "-"; dgvPipingRules.Rows[starRow].Cells[3].Value = "-"; dgvPipingRules.Rows[starRow].Cells[4].Value = isAllOK ? Properties.Resources.piping_ok : Properties.Resources.piping_error; chBoxs.ForEach((c) => { starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Length"); dgvPipingRules.Rows[starRow].Cells[1].Style.Alignment = DataGridViewContentAlignment.MiddleRight; dgvPipingRules.Rows[starRow].Cells[1].Value = c.Rules == null ? Msg.GetResourceString("PipingRules_CH_Box") : c.Rules; dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(c.Actual, UnitType.LENGTH_M, utLength).ToString("n0"); dgvPipingRules.Rows[starRow].Cells[3].Value = c.Max > 0 ? Unit.ConvertToControl(c.Max, UnitType.LENGTH_M, utLength).ToString("n0") : "-"; dgvPipingRules.Rows[starRow].Cells[4].Value = c.isOK ? Properties.Resources.piping_ok : Properties.Resources.piping_error; }); } } #endregion #region Height //Height Difference between (O.U. is Upper) starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Height"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_HeightDiffH"); dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(currSystem.MaxUpperHeightDifferenceLength, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.MaxOutdoorAboveHeight == 0 ? "-" : Unit.ConvertToControl(currSystem.MaxOutdoorAboveHeight, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.MaxOutdoorAboveHeight == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(currSystem.MaxUpperHeightDifferenceLength, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.MaxOutdoorAboveHeight, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); //Height Difference between (O.U. is Lower) starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Height"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_HeightDiffL"); dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(currSystem.MaxLowerHeightDifferenceLength, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.MaxOutdoorBelowHeight == 0 ? "-" : Unit.ConvertToControl(currSystem.MaxOutdoorBelowHeight, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.MaxOutdoorBelowHeight == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(currSystem.MaxLowerHeightDifferenceLength, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.MaxOutdoorBelowHeight, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); //Height Difference between Indoor units starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Height"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_DiffIndoorHeight"); dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(currSystem.MaxIndoorHeightDifferenceLength, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.MaxDiffIndoorHeight == 0 ? "-" : Unit.ConvertToControl(currSystem.MaxDiffIndoorHeight, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.MaxDiffIndoorHeight == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(currSystem.MaxIndoorHeightDifferenceLength, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.MaxDiffIndoorHeight, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); #endregion if (HeatRecovery) { starRow = starRow + 1; dgvPipingRules.Rows.Add(1); //Height Difference between CH-Box and Indoor Units dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Height"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_DiffCHBox_IndoorHeight"); dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(currSystem.MaxCHBox_IndoorHighDiffLength, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.NormalCHBox_IndoorHighDiffLength == 0 ? "-" : Unit.ConvertToControl(currSystem.NormalCHBox_IndoorHighDiffLength, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.NormalCHBox_IndoorHighDiffLength == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(currSystem.MaxCHBox_IndoorHighDiffLength, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.NormalCHBox_IndoorHighDiffLength, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); starRow = starRow + 1; dgvPipingRules.Rows.Add(1); //Height Difference between Indoor Units using the Same Branch of CH-Box dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Height"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_DiffMulitBoxHeight"); dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(currSystem.MaxSameCHBoxHighDiffLength, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.NormalSameCHBoxHighDiffLength == 0 ? "-" : Unit.ConvertToControl(currSystem.NormalSameCHBoxHighDiffLength, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.NormalSameCHBoxHighDiffLength == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(currSystem.MaxSameCHBoxHighDiffLength, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.NormalSameCHBoxHighDiffLength, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); starRow = starRow + 1; dgvPipingRules.Rows.Add(1); //Height Difference between CH-Boxes dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_Height"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_DiffCHBoxHeight"); dgvPipingRules.Rows[starRow].Cells[2].Value = Unit.ConvertToControl(currSystem.MaxCHBoxHighDiffLength, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[3].Value = currSystem.NormalCHBoxHighDiffLength == 0 ? "-" : Unit.ConvertToControl(currSystem.NormalCHBoxHighDiffLength, UnitType.LENGTH_M, utLength).ToString("0.#"); dgvPipingRules.Rows[starRow].Cells[4].Value = currSystem.NormalCHBoxHighDiffLength == 0 ? Properties.Resources.piping_ok : (Unit.ConvertToControl(currSystem.MaxCHBoxHighDiffLength, UnitType.LENGTH_M, utLength) <= Unit.ConvertToControl(currSystem.NormalCHBoxHighDiffLength, UnitType.LENGTH_M, utLength) ? Properties.Resources.piping_ok : Properties.Resources.piping_error); } starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = ""; dgvPipingRules.Rows[starRow].Cells[1].Value = ""; dgvPipingRules.Rows[starRow].Cells[2].Value = ""; dgvPipingRules.Rows[starRow].Cells[3].Value = ""; dgvPipingRules.Rows[starRow].Cells[4].Value = Properties.Resources.piping_Transparent; starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_IUConnectable"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_IUConnectable"); dgvPipingRules.Rows[starRow].Cells[2].Value = indsCount; dgvPipingRules.Rows[starRow].Cells[3].Value = "1 / " + currSystem.OutdoorItem.RecommendedIU + " / " + currSystem.OutdoorItem.MaxIU; dgvPipingRules.Rows[starRow].Cells[4].Value = Properties.Resources.piping_ok; string Ratio = "50%-130%"; if (currSystem.OutdoorItem.Series.Contains("FSNP") || currSystem.OutdoorItem.Series.Contains("FSXNP") || currSystem.OutdoorItem.Series.Contains("FSNS7B") || currSystem.OutdoorItem.Series.Contains("FSNS5B") || currSystem.OutdoorItem.Series.Contains("FSNC7B") || currSystem.OutdoorItem.Series.Contains("FSNC5B") //巴西的Connection Ratio可以达到150% 20190105 by Yunxiao Lin ) { Ratio = "50%-150%"; } if (currSystem.OutdoorItem.Series.Contains("FSXNPE")) { if (currSystem.OutdoorItem.CoolingCapacity > 150) { Ratio = "50%-130%"; } } starRow = starRow + 1; dgvPipingRules.Rows.Add(1); dgvPipingRules.Rows[starRow].Cells[0].Value = Msg.GetResourceString("PipingRules_ConnectedCap"); dgvPipingRules.Rows[starRow].Cells[1].Value = Msg.GetResourceString("PipingRules_ConnectedCap"); dgvPipingRules.Rows[starRow].Cells[2].Value = (currSystem.Ratio * 100).ToString("n0") + "%"; dgvPipingRules.Rows[starRow].Cells[3].Value = Ratio; dgvPipingRules.Rows[starRow].Cells[4].Value = Properties.Resources.piping_ok; }
/// <summary> /// 创建PipingRules 列 /// </summary> private void CreateDataGridViewColumns() { //创建表头 固定列 dgvPipingRules.Columns.Add("IndexNumber", ""); dgvPipingRules.Columns.Add("Title", currSystem.OutdoorItem.Series + " " + currSystem.OutdoorItem.AuxModelName); dgvPipingRules.Columns.Add("ProjectLength", Msg.GetResourceString("PipingRules_Project") + " \n" + utLength); dgvPipingRules.Columns.Add("MaxLength", Msg.GetResourceString("PipingRules_Max") + "\n" + utLength); DataGridViewImageColumn column = new DataGridViewImageColumn(); column.HeaderText = Msg.GetResourceString("PipingRules_Result"); dgvPipingRules.Columns.Add(column); //指定列不可编辑及列宽 InitializeDataGridView_ColumnsWidth(); //添加行 if (!string.IsNullOrEmpty(currSystem.OutdoorItem.JointKitModelG.Trim()) && currSystem.OutdoorItem.JointKitModelG.Trim() != "-") { // dgvPipingRules.Rows.Add(strarRow + 1); row = row + 1; } else { // dgvPipingRules.Rows.Add(strarRow); } var inds = thisProject.RoomIndoorList.FindAll(p => p.SystemID == currSystem.Id); int indsCount = 0; if (inds != null && inds.Count > 0) { indsCount = inds.Count; } //判断 当前系统是否是2pipe 3pipe if (currSystem.OutdoorItem.ProductType.Contains("Heat Recovery") || currSystem.OutdoorItem.ProductType.Contains(", HR")) { var chBoxs = new List <dynamic>(); row = row + 3; PipingBLL.EachNode(currSystem.MyPipingNodeOut, (node1) => { if (node1 is MyNodeCH) { var item = (MyNodeCH)node1; var chbox = chBoxs.Find(p => p.Rules == item.Model); if (chbox == null) { chbox = new System.Dynamic.ExpandoObject(); chbox.Rules = item.Model; chbox.Actual = Unit.ConvertToControl(item.ActualTotalCHIndoorPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); chbox.Max = Unit.ConvertToControl(item.MaxTotalCHIndoorPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); chBoxs.Add(chbox); } else { var actual = Unit.ConvertToControl(item.ActualTotalCHIndoorPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); if (Convert.ToDouble(chbox.Actual) < Convert.ToDouble(actual)) { chbox.Actual = actual; } } } else if (node1 is MyNodeMultiCH) { var item = (MyNodeMultiCH)node1; var chbox = chBoxs.Find(p => p.Rules == item.Model); if (chbox == null) { chbox = new System.Dynamic.ExpandoObject(); chbox.Rules = item.Model; chbox.Actual = Unit.ConvertToControl(item.ActualTotalCHIndoorPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); chbox.Max = Unit.ConvertToControl(item.MaxTotalCHIndoorPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); chBoxs.Add(chbox); } else { var actual = Unit.ConvertToControl(item.ActualTotalCHIndoorPipeLength, UnitType.LENGTH_M, utLength).ToString("n0"); if (Convert.ToDouble(chbox.Actual) < Convert.ToDouble(actual)) { chbox.Actual = actual; } } } }); if (chBoxs.Count > 0) { row = row + chBoxs.Count + 1; // dgvPipingRules.Rows.Add(chBoxs.Count + 4); } } }
/// <summary> /// The BindPipingInfoLength /// </summary> public void BindPipingInfoLength(JCHVRF.Model.NextGen.SystemVRF currentSystem) { ListPipingInfoLength = new ObservableCollection <PipingInfoModel>(); PipingInfoModel PipingObjectLength = new PipingInfoModel(); PipingObjectLength.Description = TOTAL_LENGTH; PipingObjectLength.LongDescription = Msg.GetResourceString("PipingRules_TotalPipeLength"); PipingObjectLength.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.TotalPipeLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectLength.Max = currentSystem.MaxTotalPipeLength == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxTotalPipeLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectLength.IsValid = currentSystem.MaxTotalPipeLength == 0 ? true : (Unit.ConvertToControl(currentSystem.TotalPipeLength, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currentSystem.MaxTotalPipeLength, UnitType.LENGTH_M, LengthUnit) ? true : false); //if (PipingObjectLength.Max.Equals("-")) //{ // PipingObjectLength.IsValid = true; //} //else //{ // PipingObjectLength.IsValid = JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectLength.Value) >= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectLength.Min) && JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectLength.Value) <= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectLength.Max); //} ListPipingInfoLength.Add(PipingObjectLength); PipingInfoModel PipingObjectMaxLengthActual = new PipingInfoModel(); FormattedText actualLength = new FormattedText("Actuals", System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface(FONT_STYLE), 9, System.Windows.Media.Brushes.Black); PipingObjectMaxLengthActual.Description = MAX_LENGTH + " " + actualLength.Text; PipingObjectMaxLengthActual.LongDescription = Msg.GetResourceString("PipingRules_PipeActualLength"); PipingObjectMaxLengthActual.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.PipeActualLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectMaxLengthActual.Max = currentSystem.MaxPipeLength == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxPipeLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectMaxLengthActual.IsValid = currentSystem.MaxPipeLength == 0 ? true : (Unit.ConvertToControl(currentSystem.PipeActualLength, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currentSystem.MaxPipeLength, UnitType.LENGTH_M, LengthUnit) ? true : false); //if (PipingObjectMaxLengthActual.Max.Equals("-")) //{ // PipingObjectLength.IsValid = true; //} //else //{ // PipingObjectMaxLengthActual.IsValid = JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthActual.Value) >= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthActual.Min) && JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthActual.Value) <= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthActual.Max); //} ListPipingInfoLength.Add(PipingObjectMaxLengthActual); PipingInfoModel PipingObjectMaxLengthEquiVal = new PipingInfoModel(); FormattedText equivalLength = new FormattedText("Equival", System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface(FONT_STYLE), 9, System.Windows.Media.Brushes.Black); PipingObjectMaxLengthEquiVal.Description = MAX_LENGTH + " " + equivalLength.Text; PipingObjectMaxLengthEquiVal.LongDescription = Msg.GetResourceString("PipingRules_PipeEquivalentLength"); PipingObjectMaxLengthEquiVal.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.PipeEquivalentLength, UnitType.LENGTH_M, LengthUnit).ToString("n0")); PipingObjectMaxLengthEquiVal.Max = currentSystem.MaxEqPipeLength == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxEqPipeLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectMaxLengthEquiVal.IsValid = currentSystem.MaxEqPipeLength == 0 ? true : (Unit.ConvertToControl(currentSystem.PipeEquivalentLength, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currentSystem.MaxEqPipeLength, UnitType.LENGTH_M, LengthUnit) ? true : false); //if (PipingObjectMaxLengthEquiVal.Max.Equals("-")) //{ // PipingObjectLength.IsValid = true; //} //else //{ // PipingObjectMaxLengthEquiVal.IsValid = JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthEquiVal.Value) >= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthEquiVal.Min) && JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthEquiVal.Value) <= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthEquiVal.Max); //} ListPipingInfoLength.Add(PipingObjectMaxLengthEquiVal); PipingInfoModel PipingObjectMaxLengthFirstPipeLength = new PipingInfoModel(); FormattedText firstPipeLength = new FormattedText("Mkit-IDU", System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface(FONT_STYLE), 9, System.Windows.Media.Brushes.Black); PipingObjectMaxLengthFirstPipeLength.Description = MAX_LENGTH + " " + firstPipeLength.Text; PipingObjectMaxLengthFirstPipeLength.LongDescription = Msg.GetResourceString("PipingRules_FirstPipeLength"); PipingObjectMaxLengthFirstPipeLength.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.FirstPipeLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectMaxLengthFirstPipeLength.Max = currentSystem.MaxIndoorLength == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxIndoorLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectMaxLengthFirstPipeLength.IsValid = currentSystem.MaxIndoorLength == 0 ? true : (Unit.ConvertToControl(currentSystem.FirstPipeLength, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currentSystem.MaxIndoorLength, UnitType.LENGTH_M, LengthUnit) ? true : false); //if (PipingObjectMaxLengthFirstPipeLength.Max.Equals("-")) //{ // PipingObjectLength.IsValid = true; //} //else //{ // PipingObjectMaxLengthFirstPipeLength.IsValid = JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthFirstPipeLength.Value) >= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthFirstPipeLength.Min) && JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthFirstPipeLength.Value) <= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthFirstPipeLength.Max); //} ListPipingInfoLength.Add(PipingObjectMaxLengthFirstPipeLength); PipingInfoModel PipingObjectMaxLengthActualMaxMKIndoorPipeLength = new PipingInfoModel(); FormattedText eachIndoorLength = new FormattedText("Mkit-IDU", System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface(FONT_STYLE), 9, System.Windows.Media.Brushes.Black); PipingObjectMaxLengthActualMaxMKIndoorPipeLength.Description = MAX_LENGTH + " " + eachIndoorLength.Text; PipingObjectMaxLengthActualMaxMKIndoorPipeLength.LongDescription = Msg.GetResourceString("PipingRules_ActualMaxMKIndoorPipeLength"); PipingObjectMaxLengthActualMaxMKIndoorPipeLength.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.ActualMaxMKIndoorPipeLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectMaxLengthActualMaxMKIndoorPipeLength.Max = currentSystem.MaxMKIndoorPipeLength == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxMKIndoorPipeLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectMaxLengthActualMaxMKIndoorPipeLength.IsValid = currentSystem.MaxMKIndoorPipeLength == 0 ? true : (Unit.ConvertToControl(currentSystem.ActualMaxMKIndoorPipeLength, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currentSystem.MaxMKIndoorPipeLength, UnitType.LENGTH_M, LengthUnit) ? true : false); //if (PipingObjectMaxLengthActualMaxMKIndoorPipeLength.Max.Equals("-")) //{ // PipingObjectLength.IsValid = true; //} //else //{ // PipingObjectMaxLengthActualMaxMKIndoorPipeLength.IsValid = JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthActualMaxMKIndoorPipeLength.Value) >= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthActualMaxMKIndoorPipeLength.Min) && JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthActualMaxMKIndoorPipeLength.Value) <= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectMaxLengthActualMaxMKIndoorPipeLength.Max); //} ListPipingInfoLength.Add(PipingObjectMaxLengthActualMaxMKIndoorPipeLength); if ((currentSystem != null) && (currentSystem.OutdoorItem != null)) { if (!string.IsNullOrEmpty(currentSystem.OutdoorItem.JointKitModelG) && !string.IsNullOrEmpty(currentSystem.OutdoorItem.JointKitModelG.Trim()) && currentSystem.OutdoorItem.JointKitModelG.Trim() != "-") { PipingInfoModel PipingObjectPipingLengthConKitOutdoorPipeLength = new PipingInfoModel(); FormattedText conKitOutdoorPipeLength = new FormattedText("Ckit-ODU", System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface(FONT_STYLE), 9, System.Windows.Media.Brushes.Black); double MaxPipeLengths = 0; if (currentSystem.IsInputLengthManually) { MaxPipeLengths = PipingBLL.GetMaxPipeLengthOfNodeOut(currentSystem.MyPipingNodeOut); } PipingObjectPipingLengthConKitOutdoorPipeLength.Description = PIPE_LENGTH + " " + conKitOutdoorPipeLength.Text; PipingObjectPipingLengthConKitOutdoorPipeLength.LongDescription = Msg.GetResourceString("PipingRules_PipeLengthes"); PipingObjectPipingLengthConKitOutdoorPipeLength.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(MaxPipeLengths, UnitType.LENGTH_M, LengthUnit)); PipingObjectPipingLengthConKitOutdoorPipeLength.Max = currentSystem.MaxFirstConnectionKitToEachODU == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxFirstConnectionKitToEachODU, UnitType.LENGTH_M, LengthUnit)); PipingObjectPipingLengthConKitOutdoorPipeLength.IsValid = currentSystem.MaxFirstConnectionKitToEachODU == 0 ? true : (Unit.ConvertToControl(MaxPipeLengths > 0 ? MaxPipeLengths : 0, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currentSystem.MaxFirstConnectionKitToEachODU, UnitType.LENGTH_M, LengthUnit) ? true : false); ListPipingInfoLength.Add(PipingObjectPipingLengthConKitOutdoorPipeLength); } } var ishrModel = IsHeatRecovery(currentSystem); if (ishrModel) { AddCHBoxPipingLengthInfo(currentSystem); } }