Ejemplo n.º 1
0
        protected override void ValidatingHandler(object sender, System.ComponentModel.CancelEventArgs e)
        {
            FiredHeater firedHeater = this.FiredHeaterCtrl.FiredHeater;
            TextBox     tb          = (TextBox)sender;

            if (tb.Text != null)
            {
                if (tb.Text.Trim().Equals(""))
                {
                    if (sender == this.textBoxName)
                    {
                        e.Cancel = true;
                        string message3 = "Please specify a name!";
                        MessageBox.Show(message3, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
                else
                {
                    if (sender == this.textBoxName)
                    {
                        ErrorMessage error = firedHeater.SpecifyName(this.textBoxName.Text);
                        if (error != null)
                        {
                            UI.ShowError(error);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void UpdateStreamsUI()
        {
            // clear the streams boxes and start again
            this.groupBoxAirInletOutlet.Controls.Clear();
            this.groupBoxFuelFlueGasInletOutlet.Controls.Clear();

            FiredHeater firedHeater   = this.FiredHeaterCtrl.FiredHeater;
            bool        hasFuelIn     = false;
            bool        hasAirIn      = false;
            bool        hasFlueGasOut = false;
            bool        hasHeatedIn   = false;
            bool        hasHeatedOut  = false;

            ProcessStreamBase airIn = firedHeater.AirInlet;

            hasAirIn = airIn != null;

            ProcessStreamBase fuelIn = firedHeater.FuelInlet;

            hasFuelIn = fuelIn != null;

            ProcessStreamBase flueGasOut = firedHeater.FlueGasOutlet;

            hasFlueGasOut = flueGasOut != null;

            ProcessStreamBase heatedIn = firedHeater.HeatedInlet;

            hasHeatedIn = heatedIn != null;

            ProcessStreamBase heatedOut = firedHeater.HeatedOutlet;

            hasHeatedOut = heatedOut != null;

            //TODO.....
        }
Ejemplo n.º 3
0
        public FiredHeaterEditor(FiredHeaterControl firedHeaterCtrl)
            : base(firedHeaterCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.inConstruction = true;
            FiredHeater firedHeater = this.FiredHeaterCtrl.FiredHeater;

            this.Text = "Fired Heater: " + firedHeater.Name;

            this.UpdateStreamsUI();

            this.groupBoxFiredHeater          = new System.Windows.Forms.GroupBox();
            this.groupBoxFiredHeater.Location = new System.Drawing.Point(644, 24);
            //this.groupBoxFiredHeater.Location = new System.Drawing.Point(1010, 24);
            this.groupBoxFiredHeater.Name     = "groupBoxFiredHeater";
            this.groupBoxFiredHeater.Text     = "Scrubber Condenser";
            this.groupBoxFiredHeater.Size     = new System.Drawing.Size(280, 240);
            this.groupBoxFiredHeater.TabIndex = 127;
            this.groupBoxFiredHeater.TabStop  = false;
            this.panel.Controls.Add(this.groupBoxFiredHeater);

            ProcessVarLabelsControl firedHeaterLabelsCtrl = new ProcessVarLabelsControl(this.FiredHeaterCtrl.FiredHeater.VarList);

            this.groupBoxFiredHeater.Controls.Add(firedHeaterLabelsCtrl);
            firedHeaterLabelsCtrl.Location = new Point(4, 12 + 20 + 2);

            ProcessVarValuesControl firedHeaterValuesCtrl = new ProcessVarValuesControl(this.FiredHeaterCtrl);

            this.groupBoxFiredHeater.Controls.Add(firedHeaterValuesCtrl);
            firedHeaterValuesCtrl.Location = new Point(196, 12 + 20 + 2);

            firedHeaterCtrl.FiredHeater.StreamAttached += new StreamAttachedEventHandler(FiredHeater_StreamAttached);
            firedHeaterCtrl.FiredHeater.StreamDetached += new StreamDetachedEventHandler(FiredHeater_StreamDetached);

            this.menuItemRating        = new MenuItem();
            this.menuItemRating.Index  = this.menuItemReport.Index + 1;
            this.menuItemRating.Text   = "Rating";
            this.menuItemRating.Click += new EventHandler(menuItemRating_Click);
            this.mainMenu.MenuItems.Add(this.menuItemRating);

            this.labelCalculationType    = new System.Windows.Forms.Label();
            this.comboBoxCalculationType = new System.Windows.Forms.ComboBox();

            // labelCalculationType
            this.labelCalculationType.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.labelCalculationType.Location    = new System.Drawing.Point(300, 0);
            this.labelCalculationType.Name        = "labelCalculationType";
            this.labelCalculationType.BackColor   = Color.DarkGray;
            this.labelCalculationType.Size        = new System.Drawing.Size(192, 20);
            this.labelCalculationType.TabIndex    = 5;
            this.labelCalculationType.Text        = "Calculation Type:";
            this.labelCalculationType.TextAlign   = System.Drawing.ContentAlignment.MiddleLeft;

            // comboBoxCalculationType
            this.comboBoxCalculationType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBoxCalculationType.Items.AddRange(new object[] {
                "Balance",
                "Rating"
            });
            this.comboBoxCalculationType.Location              = new System.Drawing.Point(492, 0);
            this.comboBoxCalculationType.Name                  = "comboBoxCalculationType";
            this.comboBoxCalculationType.Size                  = new System.Drawing.Size(80, 21);
            this.comboBoxCalculationType.TabIndex              = 7;
            this.comboBoxCalculationType.SelectedIndexChanged += new EventHandler(comboBoxCalculationType_SelectedIndexChanged);

            this.panel.Controls.Add(this.labelCalculationType);
            this.panel.Controls.Add(this.comboBoxCalculationType);

            this.comboBoxCalculationType.SelectedIndex = -1;
            comboBoxCalculationType.Enabled            = false; // TODO: remove later
            this.inConstruction = false;
            this.SetCalculationType(this.FiredHeaterCtrl.FiredHeater.CalculationType);
        }
Ejemplo n.º 4
0
 public FiredHeaterControl(Flowsheet flowsheet, Point location, FiredHeater firedHeater)
     : base(flowsheet, location, firedHeater)
 {
 }