示例#1
0
        private void heatExchanger_SolveComplete(object sender, SolveState solveState)
        {
            HXRatingModel     ratingModel   = (sender as HeatExchanger).CurrentRatingModel as HXRatingModel;
            FlowDirectionType flowDirection = ratingModel.FlowDirection;

            this.SetFlowDirection(flowDirection);
        }
示例#2
0
        public HXRatingSimpleGenericEditor(HeatExchangerControl heatExchangerCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.inConstruction = true;
            this.Text           = "Simple Generic Rating: " + heatExchangerCtrl.HeatExchanger.Name;
            this.heatExchanger  = heatExchangerCtrl.HeatExchanger;

            HXRatingModel ratingModel = this.heatExchanger.CurrentRatingModel as HXRatingModel;

            this.checkBoxIncludeWallEffect.Checked           = ratingModel.IncludeWallEffect;
            this.hxRatingSimpleGeneric2LabelsControl.Visible = this.checkBoxIncludeWallEffect.Checked;
            this.hxRatingSimpleGeneric2ValuesControl.Visible = this.checkBoxIncludeWallEffect.Checked;

            this.hxRatingSimpleGenericLabelsControl.InitializeVariableLabels(heatExchangerCtrl.HeatExchanger.CurrentRatingModel);
            this.hxRatingSimpleGenericValuesControl.InitializeTheUI(heatExchangerCtrl.Flowsheet, heatExchangerCtrl.HeatExchanger);

            this.hxRatingSimpleGeneric2LabelsControl.InitializeVariableLabels(heatExchangerCtrl.HeatExchanger.CurrentRatingModel);
            this.hxRatingSimpleGeneric2ValuesControl.InitializeVariableTextBoxes(heatExchangerCtrl.Flowsheet, heatExchangerCtrl.HeatExchanger.CurrentRatingModel);

            this.heatExchanger.SolveComplete += new SolveCompleteEventHandler(heatExchanger_SolveComplete);

            this.inConstruction = false;
        }
示例#3
0
        private void comboBoxFlowDirection_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (!this.inConstruction)
            {
                ErrorMessage error = null;

                HXRatingModel ratingModel = heatExchanger.CurrentRatingModel as HXRatingModel;
                int           idx         = this.comboBoxFlowDirection.SelectedIndex;
                if (idx == HXRatingSimpleGenericValuesControl.INDEX_PARALLEL)
                {
                    error = ratingModel.SpecifyFlowDirection(FlowDirectionType.Parallel);
                }
                else if (idx == HXRatingSimpleGenericValuesControl.INDEX_COUNTER)
                {
                    error = ratingModel.SpecifyFlowDirection(FlowDirectionType.Counter);
                }
                else if (idx == HXRatingSimpleGenericValuesControl.INDEX_CROSS)
                {
                    error = ratingModel.SpecifyFlowDirection(FlowDirectionType.Cross);
                }

                if (error != null)
                {
                    UI.ShowError(error);
                    this.SetFlowDirection(ratingModel.FlowDirection);
                }
            }
        }
示例#4
0
        public HXRating2ValuesControl(Flowsheet flowsheet, HeatExchanger heatExchanger)
        {
            // NOTE: this constructor is not used
            InitializeComponent();

            HXRatingModel ratingModel = heatExchanger.CurrentRatingModel as HXRatingModel;

            this.InitializeVariableTextBoxes(flowsheet, ratingModel);
        }
示例#5
0
 public void InitializeVariableLabels(HXRatingModel rating)
 {
     this.labelColdSideHeatTransferCoefficient.InitializeVariable(rating.ColdSideHeatTransferCoefficient);
     this.labelHotSideHeatTransferCoefficient.InitializeVariable(rating.HotSideHeatTransferCoefficient);
     this.labelColdSideFoulingFactor.InitializeVariable(rating.ColdSideFoulingFactor);
     this.labelHotSideFoulingFactor.InitializeVariable(rating.HotSideFoulingFactor);
     this.labelTotalHeatTransferCoefficient.InitializeVariable(rating.TotalHeatTransferCoefficient);
     this.labelTotalHeatTransferArea.InitializeVariable(rating.TotalHeatTransferArea);
     this.labelNumberOfHeatTransferUnits.InitializeVariable(rating.NumberOfHeatTransferUnits);
     this.labelExchangerEffectiveness.InitializeVariable(rating.ExchangerEffectiveness);
 }
示例#6
0
 public void InitializeVariableTextBoxes(Flowsheet flowsheet, HXRatingModel rating)
 {
     this.textBoxNumberOfHeatTransferUnits.InitializeVariable(flowsheet, rating.NumberOfHeatTransferUnits);
     this.textBoxTotalHeatTransferArea.InitializeVariable(flowsheet, rating.TotalHeatTransferArea);
     this.textBoxHotSideFoulingFactor.InitializeVariable(flowsheet, rating.HotSideFoulingFactor);
     this.textBoxColdSideFoulingFactor.InitializeVariable(flowsheet, rating.ColdSideFoulingFactor);
     this.textBoxHotSideHeatTransferCoefficient.InitializeVariable(flowsheet, rating.HotSideHeatTransferCoefficient);
     this.textBoxExchangerEffectiveness.InitializeVariable(flowsheet, rating.ExchangerEffectiveness);
     this.textBoxTotalHeatTransferCoefficient.InitializeVariable(flowsheet, rating.TotalHeatTransferCoefficient);
     this.textBoxColdSideHeatTransferCoefficient.InitializeVariable(flowsheet, rating.ColdSideHeatTransferCoefficient);
 }
示例#7
0
        public void InitializeTheUI(Flowsheet flowsheet, HeatExchanger heatExchanger)
        {
            this.inConstruction = true;
            this.heatExchanger  = heatExchanger;
            HXRatingModel ratingModel = heatExchanger.CurrentRatingModel as HXRatingModel;

            this.InitializeVariableTextBoxes(flowsheet, ratingModel);
            heatExchanger.SolveComplete += new SolveCompleteEventHandler(heatExchanger_SolveComplete);
            this.comboBoxFlowDirection.SelectedIndex = -1;
            this.inConstruction = false;
            this.SetFlowDirection(ratingModel.FlowDirection);
        }
示例#8
0
        private void checkBoxIncludeWallEffect_CheckedChanged(object sender, System.EventArgs e)
        {
            this.hxRating2LabelsControl.Visible = this.checkBoxIncludeWallEffect.Checked;
            this.hxRating2ValuesControl.Visible = this.checkBoxIncludeWallEffect.Checked;

            if (!this.inConstruction)
            {
                HXRatingModel ratingModel = heatExchanger.CurrentRatingModel as HXRatingModel;
                ErrorMessage  error       = ratingModel.SpecifyIncludeWallEffect(this.checkBoxIncludeWallEffect.Checked);
                if (error != null)
                {
                    UI.ShowError(error);
                }
            }
        }
示例#9
0
 public void InitializeVariableLabels(HXRatingModel rating)
 {
     this.labelWallThermalConductivity.InitializeVariable(rating.WallThermalConductivity);
     this.labelWallThickness.InitializeVariable(rating.WallThickness);
 }
示例#10
0
 public HXRating2LabelsControl(HXRatingModel rating)
 {
     // NOTE: this constructor is not used
     InitializeComponent();
     this.InitializeVariableLabels(rating);
 }
示例#11
0
        private void heatExchanger_SolveComplete(object sender, SolveState solveState)
        {
            HXRatingModel ratingModel = (sender as HeatExchanger).CurrentRatingModel as HXRatingModel;

            this.checkBoxIncludeWallEffect.Checked = ratingModel.IncludeWallEffect;
        }
示例#12
0
 public void InitializeVariableTextBoxes(Flowsheet flowsheet, HXRatingModel rating)
 {
     this.textBoxWallThermalConductivity.InitializeVariable(flowsheet, rating.WallThermalConductivity);
     this.textBoxWallThickness.InitializeVariable(flowsheet, rating.WallThickness);
 }