private SystemBase createVRFSystem() { string Count = (CurrentProject.SystemListNextGen.Count + 1).ToString(); SystemBase system = new JCHVRF.Model.NextGen.SystemVRF { Name = SystemName, SystemTypeNexGen = SelectedsystemName.Name, HvacSystemType = SelectedsystemName.SystemID, IsActiveSystem = true, FloorCount = FloorCount, IsRegular = IsRegular, DBCooling = Convert.ToDouble(CurrentProject.DesignCondition.outdoorCoolingDB), DBHeating = Convert.ToDouble(CurrentProject.DesignCondition.outdoorHeatingDB), WBHeating = Convert.ToDouble(CurrentProject.DesignCondition.outdoorHeatingWB), IWCooling = Convert.ToDouble(CurrentProject.DesignCondition.outdoorCoolingIW), IWHeating = Convert.ToDouble(CurrentProject.DesignCondition.outdoorHeatingIW), RHHeating = Convert.ToDouble(CurrentProject.DesignCondition.outdoorHeatingRH), // TO DO // PLEASE DO NOT DELETE PipeEquivalentLength = SystemSetting.UserSetting.pipingSetting.pipingEqLength, PipeEquivalentLengthbuff = SystemSetting.UserSetting.pipingSetting.pipingEqLength, FirstPipeLength = SystemSetting.UserSetting.pipingSetting.firstBranchLength, FirstPipeLengthbuff = SystemSetting.UserSetting.pipingSetting.firstBranchLength, HeightDiff = SystemSetting.UserSetting.pipingSetting.pipingHighDifference, PipingLengthFactor = SystemSetting.UserSetting.pipingSetting.pipingCorrectionFactor, PipingPositionType = SystemSetting.UserSetting.pipingSetting.pipingPositionType, }; return(system); }
public ValidateViewModel(JCHVRF.Model.Project project, ref AddFlow addFlow) { this.ProjectLegacy = project; this.addFlowPiping = addFlow; if (ProjectLegacy.SystemListNextGen[0] == null) { return; } if (curSystemItem == null && ProjectLegacy.SystemListNextGen[0] != null) { if (ProjectLegacy.SystemListNextGen.Count == 0) { return; } curSystemItem = ProjectLegacy.SystemListNextGen[0]; } utilPiping = new UtilPiping(); ut_length = SystemSetting.UserSetting.unitsSetting.settingLENGTH; ut_power = SystemSetting.UserSetting.unitsSetting.settingPOWER; ut_temperature = SystemSetting.UserSetting.unitsSetting.settingTEMPERATURE; ut_airflow = SystemSetting.UserSetting.unitsSetting.settingAIRFLOW; ut_weight = SystemSetting.UserSetting.unitsSetting.settingWEIGHT; DoPipingFinalVerification(); addFlow = this.addFlowPiping; }
private void SetSystemPipingOK(JCHVRF.Model.NextGen.SystemVRF CurrentSystem, bool isPipingOK) { if (CurrentSystem.IsPipingOK != isPipingOK) { CurrentSystem.IsPipingOK = isPipingOK; } }
private void OnFindZeroLengthClicked(NextGenModel.SystemVRF currentSystem) { try { if (!currentSystem.IsManualPiping) { if (currentSystem.MyPipingNodeOut != null) { currentSystem.IsInputLengthManually = true; designerCanvas.DoFindZeroLength(); UndoRedoSetup.SetInstanceNullWithInitalizedProjectStack(); } } else { if ((currentSystem.MyPipingOrphanNodes != null && currentSystem.MyPipingOrphanNodes.Count > 0) || currentSystem.SystemStatus == SystemStatus.INVALID) { JCHMessageBox.Show(Langauge.Current.GetMessage("ALERT_CHANGES_CANVAS")); return; } } } catch (Exception ex) { // To DO } }
public void DrawTextToAllNodes(Node node, Node parent, ng.SystemVRF sysItem) { // RND if (sysItem.editrpt == false) { sysItem.IsExportToReport = true; } if (node is ng.MyNodeOut) { ng.MyNodeOut nodeOut = node as ng.MyNodeOut; DrawTextToAllNodes(nodeOut.ChildNode, nodeOut, sysItem); nodeOut.Stroke = System.Windows.Media.Brushes.RoyalBlue; } else if (node is ng.MyNodeYP) { ng.MyNodeYP nodeYP = node as ng.MyNodeYP; drawTextToOtherNode(node, parent, sysItem); foreach (Node item in nodeYP.ChildNodes) { DrawTextToAllNodes(item, nodeYP, sysItem); } } else if (node is ng.MyNodeCH) { ng.MyNodeCH nodeCH = node as ng.MyNodeCH; drawTextToOtherNode(node, parent, sysItem); DrawTextToAllNodes(nodeCH.ChildNode, nodeCH, sysItem); } else if (node is ng.MyNodeMultiCH) { ng.MyNodeMultiCH nodeMCH = node as ng.MyNodeMultiCH; drawTextToOtherNode(node, parent, sysItem); foreach (Node item in nodeMCH.ChildNodes) { DrawTextToAllNodes(item, nodeMCH, sysItem); } } else if (node is ng.MyNodeIn) { ng.MyNodeIn nodeIn = node as ng.MyNodeIn; drawTextToIDUNode(sysItem, nodeIn); } if (node is ng.MyNode) { ng.MyNode myNode = node as ng.MyNode; if (myNode != null && myNode.MyInLinks != null && myNode.MyInLinks.Count > 0) { for (int i = 0; i < myNode.MyInLinks.Count; i++) { ng.MyLink myLink = myNode.MyInLinks[i] as ng.MyLink; drawTextToLink(myLink, i, parent, node, isInch, sysItem); } } } }
private void RefreshData(JCHVRF.Model.NextGen.SystemVRF currentSys) { CurrentSystem = currentSys; var IDUList = new List <RoomIndoor>(); if (WorkFlowContext.CurrentSystem is JCHVRF.Model.NextGen.SystemVRF) { if (CurrentSystem != null) { IDUList = JCHVRF.Model.Project.GetProjectInstance.RoomIndoorList.Where(idu => idu.SystemID == ((JCHVRF.Model.SystemBase)CurrentSystem).Id).ToList(); } } BindIndoorCapacityDetails(IDUList); BindOutdoorCapacityDetails(); BindAdditionalCapacityDetails(); BindModelDetails(); if (CurrentSystem != null && CurrentSystem.OutdoorItem != null) { ActualRatio = CurrentSystem.Ratio * 100; minConnections = IDUList.Count(); maxConnections = CurrentSystem.OutdoorItem.MaxIU; if (CurrentSystem.IsInputLengthManually == false) { AdditionalRefrigerantQty = 0; } else { AdditionalRefrigerantQty = CurrentSystem.OutdoorItem.RefrigerantCharge; } } }
private void AddCHBoxPipingHeightInfo(JCHVRF.Model.NextGen.SystemVRF currSystem) { //Height Difference between CH-Box and Indoor Units var pipingHeightModel = new PipingInfoModel(); pipingHeightModel.Description = Msg.GetResourceString("PipingRules_DiffCHBox_IndoorHeight"); pipingHeightModel.LongDescription = Msg.GetResourceString("PipingRules_DiffCHBox_IndoorHeight"); pipingHeightModel.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currSystem.MaxCHBox_IndoorHighDiffLength, UnitType.LENGTH_M, LengthUnit)); pipingHeightModel.Max = currSystem.NormalCHBox_IndoorHighDiffLength == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currSystem.NormalCHBox_IndoorHighDiffLength, UnitType.LENGTH_M, LengthUnit)); pipingHeightModel.IsValid = currSystem.NormalCHBox_IndoorHighDiffLength == 0 ? true : (Unit.ConvertToControl(currSystem.MaxCHBox_IndoorHighDiffLength, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currSystem.NormalCHBox_IndoorHighDiffLength, UnitType.LENGTH_M, LengthUnit) ? true : false); //JCHVRF.BLL.CommonBLL.DoubleParser(pipingHeightModel.Value) >= JCHVRF.BLL.CommonBLL.DoubleParser(pipingHeightModel.Min) && JCHVRF.BLL.CommonBLL.DoubleParser(pipingHeightModel.Value) <= JCHVRF.BLL.CommonBLL.DoubleParser(pipingHeightModel.Max); ListPipingInfoHeight.Add(pipingHeightModel); //Height Difference between Indoor Units using the Same Branch of CH-Box var pipingHeightBwIndoors = new PipingInfoModel(); pipingHeightBwIndoors.Description = Msg.GetResourceString("PipingRules_DiffMulitBoxHeight"); pipingHeightBwIndoors.LongDescription = Msg.GetResourceString("PipingRules_DiffMulitBoxHeight"); pipingHeightBwIndoors.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currSystem.MaxSameCHBoxHighDiffLength, UnitType.LENGTH_M, LengthUnit)); pipingHeightBwIndoors.Max = currSystem.NormalSameCHBoxHighDiffLength == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currSystem.NormalSameCHBoxHighDiffLength, UnitType.LENGTH_M, LengthUnit)); pipingHeightBwIndoors.IsValid = currSystem.NormalSameCHBoxHighDiffLength == 0 ? true : (Unit.ConvertToControl(currSystem.MaxSameCHBoxHighDiffLength, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currSystem.NormalSameCHBoxHighDiffLength, UnitType.LENGTH_M, LengthUnit) ? true : false); ListPipingInfoHeight.Add(pipingHeightBwIndoors); //Height Difference between CH-Boxes var pipingBwChBoxes = new PipingInfoModel(); pipingBwChBoxes.Description = Msg.GetResourceString("PipingRules_DiffCHBoxHeight"); pipingBwChBoxes.LongDescription = Msg.GetResourceString("PipingRules_DiffCHBoxHeight"); pipingBwChBoxes.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currSystem.MaxCHBoxHighDiffLength, UnitType.LENGTH_M, LengthUnit)); pipingBwChBoxes.Max = currSystem.NormalCHBoxHighDiffLength == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currSystem.NormalCHBoxHighDiffLength, UnitType.LENGTH_M, LengthUnit)); pipingBwChBoxes.IsValid = currSystem.NormalCHBoxHighDiffLength == 0 ? true : (Unit.ConvertToControl(currSystem.MaxCHBoxHighDiffLength, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currSystem.NormalCHBoxHighDiffLength, UnitType.LENGTH_M, LengthUnit) ? true : false); ListPipingInfoHeight.Add(pipingBwChBoxes); }
private void SetSystemPipingOK(JCHVRF.Model.NextGen.SystemVRF sysItem, bool isPipingOK) { if (sysItem.IsPipingOK != isPipingOK) { sysItem.IsPipingOK = isPipingOK; //SetTabControlImageKey(); } }
public Wiring(JCHVRF.Model.Project project, ng.SystemVRF systemVRF, AddFlow AddFlowWiring) { thisProject = project; sysItem = systemVRF; addFlowWiring = AddFlowWiring; DoDrawingWiring(thisProject, sysItem); utilWiring = new UtilityWiring(thisProject); }
private bool ReselectOutdoor(JCHVRF.Model.NextGen.SystemVRF CurrentSystem, int IsNodeUpdateRequired = 1) { string ErrMsg = string.Empty; this.projectLegacy = JCHVRF.Model.Project.GetProjectInstance; bool IsValidDraw = Utility.Validation.IsValidatedSystemVRF(this.projectLegacy, CurrentSystem, out ErrMsg); try { //bug fix 3422 SetCompositeMode(CurrentSystem, JCHVRF.Model.Project.GetProjectInstance.RoomIndoorList); //bug fix 3422 NextGenModel.SystemVRF CurrVRF = new NextGenModel.SystemVRF(); AutoSelectOutdoor SelectODU = new AutoSelectOutdoor(); if (IsValidDraw) { AutoSelectODUModel result = SelectODU.ReselectOutdoor(CurrentSystem, JCHVRF.Model.Project.GetProjectInstance.RoomIndoorList); if (result.SelectionResult == SelectOutdoorResult.OK) { if (IsNodeUpdateRequired == 1) { UpdatePipingNodeStructure(CurrentSystem); UpdateWiringNodeStructure(CurrentSystem); } IsValidDraw = true; } else { IsValidDraw = false; if (result.ERRList != null && result.ERRList.Count > 0) { _eventAggregator.GetEvent <ErrorLogVM>().Publish(result.ERRList); // JCHMessageBox.Show("No suitable outdoor unit available\n", MessageType.Error); JCHMessageBox.Show(GetErrorMassage(result.ERRList), MessageType.Error); } else if (result.MSGList != null && result.MSGList.Count > 0) { _eventAggregator.GetEvent <ErrorLogVM>().Publish(result.MSGList); JCHMessageBox.Show(Langauge.Current.GetMessage("CAPCITYREQIREMENT"), MessageType.Error); } else { JCHMessageBox.Show(Langauge.Current.GetMessage("CAPCITYREQIREMENT"), MessageType.Error); } } } else { IsValidDraw = false; JCHMessageBox.Show(string.Format(ErrMsg)); ErrorLog.LogError(Model.ErrorType.Error, Model.ErrorCategory.PipingErrors, ErrMsg); } } catch (Exception ex) { } return(IsValidDraw); }
public override void OnNavigatedTo(NavigationContext context) { OduImageData = context.Parameters.GetValue <ImageData>("OduImageData"); CurrentSystem = context.Parameters.GetValue <SystemVRF>("CurrentSystem"); //OutdoorName = SystemSetting.UserSetting.defaultSetting.OutdoorName + _currentSystem.Name; Initializations(); ////if (OduImageData != null) //// this.SelectedSeries = OduImageData.imageName; }
private void BindPipingInfo(JCHVRF.Model.NextGen.SystemVRF currentSystem) { if (currentSystem != null && currentSystem.MyPipingNodeOut != null) { BindPipingInfoLength(currentSystem); BindPipingInfoHeight(currentSystem); BindAdditionalPipingInfo(currentSystem); } }
private bool IsHeatRecovery(JCHVRF.Model.NextGen.SystemVRF system) { if (system == null || system.OutdoorItem == null) { return(false); } return(system.OutdoorItem.ProductType.Contains("Heat Recovery") || system.OutdoorItem.ProductType.Contains(", HR")); }
public AutoSelectODUModel ReselectOutdoor(NextGenModel.SystemVRF CurrVRF, List <RoomIndoor> RoomIndoorList) { List <string> MSGList = new List <string>(); List <string> ERRList = new List <string>(); SelectOutdoorResult result; try { var IndoorListForCurrentSystem = RoomIndoorList.Where(ri => ri.SystemID == (((JCHVRF.Model.SystemBase)CurrVRF).Id)).ToList(); if (!Validation.IsIndoorIsValidForODUSeries(CurrVRF)) { result = SelectOutdoorResult.NotMatch; } else if (IndoorListForCurrentSystem != null && IndoorListForCurrentSystem.Count > 0) { if (CurrVRF.IsAuto == true) { if (ProjectBLL.IsSupportedUniversalSelection(JCHVRF.Model.Project.GetProjectInstance)) { result = Global.DoSelectUniversalODUFirst(CurrVRF, IndoorListForCurrentSystem, JCHVRF.Model.Project.GetProjectInstance, CurrVRF.Series, out ERRList, out MSGList); } else { result = Global.DoSelectOutdoorODUFirst(CurrVRF, IndoorListForCurrentSystem, JCHVRF.Model.Project.GetProjectInstance, out ERRList, out MSGList); } } else { if (ProjectBLL.IsSupportedUniversalSelection(JCHVRF.Model.Project.GetProjectInstance)) { result = Global.DoSelectUniversalOduManual(CurrVRF, IndoorListForCurrentSystem, JCHVRF.Model.Project.GetProjectInstance, CurrVRF.Series, out ERRList); } else { result = Global.DoSelectOutdoorManual(CurrVRF, IndoorListForCurrentSystem, JCHVRF.Model.Project.GetProjectInstance, out ERRList); } } //if (result == SelectOutdoorResult.OK) //{ // int SysIndex = JCHVRF.Model.Project.CurrentProject.SystemListNextGen.FindIndex(sys => sys.Id == CurrVRF.Id); // if (SysIndex != -1) // JCHVRF.Model.Project.GetProjectInstance.SystemListNextGen[SysIndex] = CurrVRF; //} } else { result = SelectOutdoorResult.NotMatch; } } catch (Exception ex) { result = SelectOutdoorResult.NotMatch; } return(new AutoSelectODUModel { ERRList = ERRList, MSGList = MSGList, SelectionResult = result }); }
private void OnBeforeSaveVRF(JCHVRF.Model.NextGen.SystemVRF currentSystem) { this.SystemName = SystemName; var index = JCHVRF.Model.Project.CurrentProject.SystemListNextGen.FindIndex(mm => mm.Name == currentSystem.Name); if (index != -1) { JCHVRF.Model.Project.CurrentProject.SystemListNextGen[index].Name = this.SystemName; } }
/// <summary> /// The BindPipingInfoHeight /// </summary> public void BindPipingInfoHeight(JCHVRF.Model.NextGen.SystemVRF currentSystem) { ListPipingInfoHeight = new ObservableCollection <PipingInfoModel>(); PipingInfoModel PipingObjectHeightDiffUpper = new PipingInfoModel(); FormattedText upperOULength = new FormattedText("O.U is upper", System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface(FONT_STYLE), 9, System.Windows.Media.Brushes.Black); PipingObjectHeightDiffUpper.Description = HEIGHT_DIFF + " " + upperOULength.Text; PipingObjectHeightDiffUpper.LongDescription = Msg.GetResourceString("PipingRules_HeightDiffH"); PipingObjectHeightDiffUpper.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxUpperHeightDifferenceLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectHeightDiffUpper.Max = currentSystem.MaxOutdoorAboveHeight == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxOutdoorAboveHeight, UnitType.LENGTH_M, LengthUnit)); PipingObjectHeightDiffUpper.IsValid = currentSystem.MaxOutdoorAboveHeight == 0 ? true : (Unit.ConvertToControl(currentSystem.MaxUpperHeightDifferenceLength, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currentSystem.MaxOutdoorAboveHeight, UnitType.LENGTH_M, LengthUnit) ? true : true); //PipingObjectHeightDiffUpper.IsValid = JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffUpper.Value) >= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffUpper.Min) && JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffUpper.Value) <= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffUpper.Max); ListPipingInfoHeight.Add(PipingObjectHeightDiffUpper); PipingInfoModel PipingObjectHeightDiffLower = new PipingInfoModel(); FormattedText lowerOULength = new FormattedText("O.U is lower", System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface(FONT_STYLE), 9, System.Windows.Media.Brushes.Black); PipingObjectHeightDiffLower.Description = HEIGHT_DIFF + " " + lowerOULength.Text; PipingObjectHeightDiffLower.LongDescription = Msg.GetResourceString("PipingRules_HeightDiffL"); PipingObjectHeightDiffLower.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxLowerHeightDifferenceLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectHeightDiffLower.Max = currentSystem.MaxOutdoorBelowHeight == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxOutdoorBelowHeight, UnitType.LENGTH_M, LengthUnit)); PipingObjectHeightDiffLower.IsValid = currentSystem.MaxOutdoorBelowHeight == 0 ? true : (Unit.ConvertToControl(currentSystem.MaxLowerHeightDifferenceLength, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currentSystem.MaxOutdoorBelowHeight, UnitType.LENGTH_M, LengthUnit) ? true : false); //JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffLower.Value) >= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffLower.Min) && JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffLower.Value) <= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffLower.Max); ListPipingInfoHeight.Add(PipingObjectHeightDiffLower); PipingInfoModel PipingObjectHeightDiffIDU = new PipingInfoModel(); PipingObjectHeightDiffIDU.Description = HEIGHT_DIFF + " " + "between IDU"; PipingObjectHeightDiffIDU.LongDescription = Msg.GetResourceString("PipingRules_DiffIndoorHeight"); PipingObjectHeightDiffIDU.Value = JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxIndoorHeightDifferenceLength, UnitType.LENGTH_M, LengthUnit)); PipingObjectHeightDiffIDU.Max = currentSystem.MaxDiffIndoorHeight == 0 ? "-" : JCHVRF.BLL.CommonBLL.StringConversion(Unit.ConvertToControl(currentSystem.MaxDiffIndoorHeight, UnitType.LENGTH_M, LengthUnit)); PipingObjectHeightDiffIDU.IsValid = currentSystem.MaxDiffIndoorHeight == 0 ? true : (Unit.ConvertToControl(currentSystem.MaxIndoorHeightDifferenceLength, UnitType.LENGTH_M, LengthUnit) <= Unit.ConvertToControl(currentSystem.MaxDiffIndoorHeight, UnitType.LENGTH_M, LengthUnit) ? true : false); //JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffIDU.Value) >= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffIDU.Min) && JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffIDU.Value) <= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectHeightDiffIDU.Max); ListPipingInfoHeight.Add(PipingObjectHeightDiffIDU); var ishrModel = IsHeatRecovery(currentSystem); if (ishrModel) { AddCHBoxPipingHeightInfo(currentSystem); } }
public void UpdateWiringNodeStructure(JCHVRF.Model.NextGen.SystemVRF CurrentSystem) { try { string imageDir = @"/Image/TypeImages/"; JCHVRF_New.Utility.WiringBLL bll = new JCHVRF_New.Utility.WiringBLL(JCHVRF.Model.Project.GetProjectInstance, imageDir); bll.CreateWiringNodeStructure(CurrentSystem); } catch (Exception ex) { JCHMessageBox.Show("Error Occured : " + ex.Message); } }
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 DoDrawingWiring(JCHVRF.Model.Project thisProject, ng.SystemVRF sysItem) { //if (tnOut == null) return; //if (this.tabControl1.SelectedTab.Name != "tpgWiring" && this.tabControl1.SelectedTab.Name != "tpgReport") // return; //SystemVRF sysItem = tnOut.Tag as SystemVRF; //if (sysItem == null || sysItem.OutdoorItem == null) // return; //curSystemItem = sysItem; string imgDir = @"/Image/TypeImages/"; InitWiringNodes(addFlowWiring); //if (addFlowPiping.Nodes.Count == 0) DOUBT // BindPipingDrawing(tnOut); //ControllerWiringBLL bll = new ControllerWiringBLL(thisProject, addFlowControllerWiring); WiringBLL bll = new WiringBLL(thisProject, addFlowWiring); bll.CreateWiringNodeStructure(sysItem); ptArrayList.Clear(); ptArrayList_power.Clear(); ptArrayList_ground.Clear(); ptArrayList_mainpower.Clear(); strArrayList_powerType.Clear(); strArrayList_powerVoltage.Clear(); dArrayList_powerCurrent.Clear(); if (sysItem == null || sysItem.MyWiringNodeOut == null) { return; } ng.WiringNodeOut nodeOut = sysItem.MyWiringNodeOut; if (nodeOut.ChildNodes.Count == 0 || sysItem.OutdoorItem == null) { DrawDiagError(); return; } if (bll.IsHeatRecovery(sysItem)) { DoDrawingHRWiring(sysItem, nodeOut, imgDir); } else { DoDrawingWiring(sysItem, nodeOut, imgDir); } }
/// <summary> /// The BindAdditionalPipingInfo /// </summary> public void BindAdditionalPipingInfo(JCHVRF.Model.NextGen.SystemVRF currentSystem) { if (currentSystem.OutdoorItem == null) { return; } ListPipingInfoAdditional = new ObservableCollection <PipingInfoModel>(); PipingInfoModel PipingObjectIUConnectable = new PipingInfoModel(); int indoorsCount = 0; indoorsCount = Project.CurrentProject.RoomIndoorList.FindAll(p => p.SystemID == currentSystem.Id).Count; PipingObjectIUConnectable.Description = "IU Connectable (Min / recommended / Max)"; PipingObjectIUConnectable.LongDescription = Msg.GetResourceString("PipingRules_IUConnectable"); PipingObjectIUConnectable.ValueDescription = indoorsCount.ToString(); PipingObjectIUConnectable.MaxDescription = ("1/" + currentSystem.OutdoorItem.RecommendedIU.ToString() + "/" + currentSystem.OutdoorItem.MaxIU).Trim(); PipingObjectIUConnectable.IsValid = JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectIUConnectable.Value) >= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectIUConnectable.Min) && JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectIUConnectable.Value) <= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectIUConnectable.Max); ListPipingInfoAdditional.Add(PipingObjectIUConnectable); PipingInfoModel PipingObjectConnectedCap = new PipingInfoModel(); string Ratio = "50%-130%"; if (currentSystem.OutdoorItem.Series.Contains("FSNP") || currentSystem.OutdoorItem.Series.Contains("FSXNP") || currentSystem.OutdoorItem.Series.Contains("FSNS7B") || currentSystem.OutdoorItem.Series.Contains("FSNS5B") || currentSystem.OutdoorItem.Series.Contains("FSNC7B") || currentSystem.OutdoorItem.Series.Contains("FSNC5B") //巴西的Connection Ratio可以达到150% 20190105 by Yunxiao Lin ) { Ratio = "50%-150%"; } if (currentSystem.OutdoorItem.Series.Contains("FSXNPE")) { if (currentSystem.OutdoorItem.CoolingCapacity > 150) { Ratio = "50%-130%"; } } PipingObjectConnectedCap.Description = "Connected Cap. (Min - Max)"; PipingObjectConnectedCap.LongDescription = Msg.GetResourceString("PipingRules_ConnectedCap"); PipingObjectConnectedCap.ValueDescription = (currentSystem.Ratio * 100).ToString("n0") + "%"; PipingObjectConnectedCap.MaxDescription = Ratio; PipingObjectConnectedCap.IsValid = JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectConnectedCap.Value) >= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectConnectedCap.Min) && JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectConnectedCap.Value) <= JCHVRF.BLL.CommonBLL.DoubleParser(PipingObjectConnectedCap.Max); ListPipingInfoAdditional.Add(PipingObjectConnectedCap); }
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); } }
private void SetOutDoorSystemSpecific() { if (!string.IsNullOrEmpty(JCHVRF.Model.Project.CurrentSystemId)) { JCHVRF.Model.NextGen.SystemVRF _currentSystem = JCHVRF.Model.Project.CurrentProject.SystemListNextGen.FirstOrDefault(x => ((SystemBase)x).Id.Equals(JCHVRF.Model.Project.CurrentSystemId)); if (_currentSystem != null) { SelectedProductCategory = _currentSystem.ProductCategory; SelectedSeries = _currentSystem.Series; SelectedMaxRatio = Convert.ToInt32(_currentSystem.MaxRatio * 100); BindOutDoorImageUI(SelectedSeries); } } }
public static bool IsSystemValidForDuplication(NextGenModel.SystemVRF vrfSystem, out string validationMessage) { var result = true; validationMessage = string.Empty; var nodeOut = vrfSystem.MyPipingNodeOut; if (nodeOut == null || nodeOut.ChildNode == null) { result = false; validationMessage = CurrentLanguage.GetMessage("DUPLICATION_ERROR_INVALID_SYSTEM"); } return(result); }
public void UpdateWiringNodeStructure(JCHVRF.Model.NextGen.SystemVRF CurrentSystem) { try { string imageDir = @"/Image/TypeImages/"; JCHVRF_New.Utility.WiringBLL bll = new JCHVRF_New.Utility.WiringBLL(JCHVRF.Model.Project.GetProjectInstance, imageDir); bll.CreateWiringNodeStructure(CurrentSystem); } catch (Exception ex) { //JCHMessageBox.Show("Error Occured : " + ex.Message); //----------------- Code below for multi-langauge------------// JCHMessageBox.Show(Language.Current.GetMessage("ERROR_OCCURED"), MessageType.Error); } }
public WL.AddFlow Validate(JCHVRF.Model.NextGen.SystemVRF CurrentSystem, WL.AddFlow AddFlowAutoPiping) { if (CurrentSystem == null) { return(AddFlowAutoPiping); } utilPiping = new NextGenBLL.UtilPiping(); ut_length = SystemSetting.UserSetting.unitsSetting.settingLENGTH; ut_power = SystemSetting.UserSetting.unitsSetting.settingPOWER; ut_temperature = SystemSetting.UserSetting.unitsSetting.settingTEMPERATURE; ut_airflow = SystemSetting.UserSetting.unitsSetting.settingAIRFLOW; ut_weight = SystemSetting.UserSetting.unitsSetting.settingWEIGHT; AddFlowAutoPiping = DoPipingFinalVerification(CurrentSystem, AddFlowAutoPiping); return(AddFlowAutoPiping); }
private void OnSaveClick() { if (!string.IsNullOrEmpty(JCHVRF.Model.Project.CurrentSystemId)) { JCHVRF.Model.NextGen.SystemVRF _currentSystem = JCHVRF.Model.Project.CurrentProject.SystemListNextGen.FirstOrDefault(x => ((SystemBase)x).Id.Equals(JCHVRF.Model.Project.CurrentSystemId)); if (_currentSystem != null) { _currentSystem.Name = SystemName; } if (HvacSystem.HvacSystemType.Equals(2)) { JCHVRF.Model.SystemHeatExchanger objHE = JCHVRF.Model.Project.CurrentProject.HeatExchangerSystems.Find(x => x.Id.Equals(JCHVRF.Model.Project.CurrentSystemId)); objHE.Name = SystemName; } } }
private void OduTypeNextClick() { if (Project.isSystemPropertyWiz) { OduNextToClick(); } else { ODUErrorMessage = null; string errorMessage = string.Empty; if (OutDoorInfoProjectLegacyValidation(out errorMessage)) { JCHVRF.Model.NextGen.SystemVRF newSystem = (JCHVRF.Model.NextGen.SystemVRF)WorkFlowContext.NewSystem; newSystem.MaxRatio = Convert.ToDouble(Convert.ToDecimal(SelectedMaxRatio) / 100); newSystem.Power = ListPower.FirstOrDefault().SelectedValues; if (newSystem.Power != null) { newSystem.SelOutdoorType = listType.FirstOrDefault(); } //newSystem.ProductType = ListType.FirstOrDefault(); newSystem.ProductCategory = SelectedProductCategory; newSystem.ProductSeries = SelProductSeries.DisplayName; newSystem.Series = SelectedSeries; newSystem.ProductType = ProductType; newSystem.OutdoorItem = new Outdoor { ProductType = ProductType, Series = SelectedSeries, MaxRatio = SelectedMaxRatio, TypeImage = OduImagePath }; if (!String.IsNullOrEmpty(OduImagePath)) { newSystem.DisplayImageName = OduImagePath; } _eventAggregator.GetEvent <OduTabSubscriber>().Publish(true); } else { ODUErrorMessage = errorMessage; // JCHMessageBox.Show(errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error); _eventAggregator.GetEvent <OduTabSubscriber>().Publish(false); } } }
private void SetCompositeMode(JCHVRF.Model.NextGen.SystemVRF CurrentSys, List <RoomIndoor> RoomIndoorList) { if (CurrentSys != null) { if (RoomIndoorList != null && RoomIndoorList.Count > 0) { //if (RoomIndoorList.Count(mm => mm.IndoorItem.Flag == IndoorType.FreshAir) >= 1) //{ // //CurrentSys.SysType = SystemType.CompositeMode; //} //else //{ CurrentSys.SysType = SystemType.OnlyIndoor; //} } } }
private void OduNextToClick() { if (!string.IsNullOrEmpty(JCHVRF.Model.Project.CurrentSystemId)) { JCHVRF.Model.NextGen.SystemVRF _currentSystem = JCHVRF.Model.Project.CurrentProject.SystemListNextGen.FirstOrDefault(x => ((SystemBase)x).Id.Equals(JCHVRF.Model.Project.CurrentSystemId)); //_currentSystem.MyPipingNodeOut = null; var proj = JCHVRF.Model.Project.CurrentProject; JCHVRF.Model.NextGen.SystemVRF selectedSys = _currentSystem.DeepCopy(); if (proj.RoomIndoorList != null && proj.RoomIndoorList.Count > 0) { selectedSys.OutdoorItem = new Outdoor { ProductType = ProductType, Series = SelectedSeries, MaxRatio = Convert.ToDouble(Convert.ToDecimal(SelectedMaxRatio) / 100), TypeImage = OduImagePath, Type = ListType.FirstOrDefault(), }; selectedSys.ProductCategory = SelectedProductCategory; selectedSys.ProductSeries = SelProductSeries.DisplayName; selectedSys.ProductType = ProductType; selectedSys.MaxRatio = Convert.ToDouble(Convert.ToDecimal(SelectedMaxRatio) / 100); selectedSys.SelOutdoorType = ListType.FirstOrDefault(); selectedSys.Power = ListPower.FirstOrDefault().SelectedValues; selectedSys.Series = SelectedSeries; //selectedSys.Name = _currentSystem.Name; //selectedSys.Id = JCHVRF.Model.Project.CurrentSystemId; //ReSelectOutDoor:: Check If Valid System selectedSys.IsInputLengthManually = false; selectedSys.MyPipingNodeOut = null; selectedSys.MyPipingNodeOutTemp = null; selectedSys.IsOutDoorUpdated = false; var IsValid = ReselectOutdoor(selectedSys); if (IsValid == false) { _currentSystem.IsOutDoorUpdated = false; } } } }
private void loadFloorTabVisibility() { JCHVRF.Model.NextGen.SystemVRF _currentSystem = JCHVRF.Model.Project.CurrentProject.SystemListNextGen.FirstOrDefault(x => ((SystemBase)x).Id.Equals(JCHVRF.Model.Project.CurrentSystemId)); if (_currentSystem != null) { if (_currentSystem.FloorCount > 1) { IsSingleFoorChecked = false; IsMultipleFloorChecked = true; FloorCount = _currentSystem.FloorCount; ShowMethod(); } else { IsSingleFoorChecked = true; IsMultipleFloorChecked = false; } } }