public static void SetInstanceNullWithInitalizedProjectStack() { lock (padlock) { instance = null; ResetUndoRedo?.Invoke(); UtilTrace.SaveHistoryTraces(); } }
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); }