Ejemplo n.º 1
0
        private UndoRedoSetup()
        {
            UtilTrace.Ini();
            UndoEnable = new UndoEnableEnt();
            //UndoEnable.redoRect = new System.Drawing.Rectangle(912, 95, 16, 18);
            //UndoEnable.undoRect = new System.Drawing.Rectangle(884, 95, 16, 18);
            //this.tabControl1.OnDrawControl += new PaintEventHandler(UndoEnable.ShowIcons);

            RegEnt             = new RegUndoEnt();
            RegEnt.funHandler += delegate()
            {
                //BindToControl();
            };
            RegEnt.enable = UndoEnable;
            //newUtilTrace.UtilTrace.ViewModel = this;
            //UtilTrace.tbMain = tabControl1;
            //regEnt.vm = this;
            //regEnt.tb = tabControl1;
            //UtilTrace.SaveHistoryTraces();
            //UtilTrace.SaveHistoryTraces("tab", this.tabControl1.SelectedTab, null);
            UtilTrace.RegUndo(RegEnt);
            UtilTrace.ChkMainUndo += delegate()
            {
                //BindToControl();
                RegEnt.ChkUndoEnable();
                //this.Invalidate();
            };
            IsInitialized = false;
        }
Ejemplo n.º 2
0
 public static void SetInstanceNullWithInitalizedProjectStack()
 {
     lock (padlock)
     {
         instance = null;
         ResetUndoRedo?.Invoke();
         UtilTrace.SaveHistoryTraces();
     }
 }
Ejemplo n.º 3
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);
        }