Esempio n. 1
0
        public WetScrubberEditor(WetScrubberControl wetScrubberCtrl)
            : base(wetScrubberCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.inConstruction = true;
            WetScrubber wetScrubber = this.WetScrubberCtrl.WetScrubber;

            this.Text = "Wet Scrubber: " + wetScrubber.Name;
            this.UpdateStreamsUI();

            this.groupBoxWetScrubber          = new System.Windows.Forms.GroupBox();
            this.groupBoxWetScrubber.Location = new System.Drawing.Point(724, 24);
            this.groupBoxWetScrubber.Name     = "groupBoxWetScrubber";
            this.groupBoxWetScrubber.Text     = "Wet Scrubber";
            this.groupBoxWetScrubber.Size     = new System.Drawing.Size(280, 180);
            this.groupBoxWetScrubber.TabIndex = 128;
            this.groupBoxWetScrubber.TabStop  = false;
            this.panel.Controls.Add(this.groupBoxWetScrubber);

            // TO DO: to customizs the height? or not

            //         if (wetScrubber.GasInlet is DryingGasStream)
            //         {
            //            this.groupBoxGasStream.Size = new System.Drawing.Size(360, 280);
            //            this.panel.Size = new System.Drawing.Size(1010, 309);
            //            this.ClientSize = new System.Drawing.Size(1010, 331);
            //         }
            //         else if (wetScrubber.GasInlet is DryingMaterialStream)
            //         {
            this.groupBoxGasStream.Size = new System.Drawing.Size(360, 300);
            this.panel.Size             = new System.Drawing.Size(1010, 329);
            this.ClientSize             = new System.Drawing.Size(1010, 351);
            //         }
            this.groupBoxLiquidStream.Size = new System.Drawing.Size(360, 300);

            ProcessVarLabelsControl wetScrubberLabelsCtrl = new ProcessVarLabelsControl(this.WetScrubberCtrl.WetScrubber.VarList);

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

            ProcessVarValuesControl wetScrubberValuesCtrl = new ProcessVarValuesControl(this.WetScrubberCtrl);

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

            wetScrubberCtrl.WetScrubber.StreamAttached += new StreamAttachedEventHandler(WetScrubber_StreamAttached);
            wetScrubberCtrl.WetScrubber.StreamDetached += new StreamDetachedEventHandler(WetScrubber_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.comboBoxCalculationType        = new System.Windows.Forms.ComboBox();
            this.labelCalculationType           = new System.Windows.Forms.Label();
            this.labelCalculationType.BackColor = Color.DarkGray;

            // 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);

            // labelCalculationType
            this.labelCalculationType.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.labelCalculationType.Location    = new System.Drawing.Point(300, 0);
            this.labelCalculationType.Name        = "labelCalculationType";
            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;

            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.WetScrubberCtrl.WetScrubber.CalculationType);
        }
Esempio n. 2
0
        private void UpdateStreamsUI()
        {
            // clear the stream group-boxes and start again
            this.groupBoxColdStream.Controls.Clear();
            this.groupBoxHotStream.Controls.Clear();

            HeatExchanger heatExchanger = this.HeatExchangerCtrl.HeatExchanger;
            bool          hasColdIn     = false;
            bool          hasColdOut    = false;
            bool          hasHotIn      = false;
            bool          hasHotOut     = false;

            ProcessStreamBase coldIn = heatExchanger.ColdSideInlet;

            hasColdIn = coldIn != null;

            ProcessStreamBase coldOut = heatExchanger.ColdSideOutlet;

            hasColdOut = coldOut != null;

            ProcessStreamBase hotIn = heatExchanger.HotSideInlet;

            hasHotIn = hotIn != null;

            ProcessStreamBase hotOut = heatExchanger.HotSideOutlet;

            hasHotOut = hotOut != null;

            if (hasColdIn || hasColdOut)
            {
                ProcessStreamBase labelsStream = hasColdIn ? coldIn : coldOut;

                UserControl ctrl = null;
                if (labelsStream is WaterStream)
                {
                    ctrl = new ProcessVarLabelsControl(labelsStream.VarList);
                }
                else if (labelsStream is DryingGasStream)
                {
                    ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream);
                }
                else if (labelsStream is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream);
                }
                this.groupBoxColdStream.Controls.Add(ctrl);
                ctrl.Location = new Point(4, 12 + 20 + 2);
            }

            if (hasColdIn)
            {
                UserControl ctrl = null;
                ProcessStreamBaseControl baseCtrl = (ProcessStreamBaseControl)this.HeatExchangerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.HeatExchangerCtrl.HeatExchanger.ColdSideInlet.Name);
                if (coldIn is WaterStream)
                {
                    WaterStreamControl processInCtrl = baseCtrl as WaterStreamControl;
                    ctrl = new ProcessVarValuesControl(processInCtrl);
                }
                else if (coldIn is DryingGasStream)
                {
                    GasStreamControl gasInCtrl = baseCtrl as GasStreamControl;
                    ctrl = new GasStreamValuesControl(gasInCtrl);
                }
                else if (coldIn is DryingMaterialStream)
                {
                    MaterialStreamControl matInCtrl = baseCtrl as MaterialStreamControl;
                    ctrl = new MaterialStreamValuesControl(matInCtrl);
                }

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

                this.textBoxColdInName.SetSolvable(heatExchanger.ColdSideInlet);
                this.groupBoxColdStream.Controls.Add(this.textBoxColdInName);
                this.textBoxColdInName.Text = heatExchanger.ColdSideInlet.Name;
                UI.SetStatusColor(this.textBoxColdInName, heatExchanger.ColdSideInlet.SolveState);
            }

            if (hasColdOut)
            {
                ProcessStreamBaseControl baseCtrl = (ProcessStreamBaseControl)this.HeatExchangerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.HeatExchangerCtrl.HeatExchanger.ColdSideOutlet.Name);
                UserControl ctrl = null;
                if (coldOut is WaterStream)
                {
                    WaterStreamControl processOutCtrl = baseCtrl as WaterStreamControl;
                    ctrl = new ProcessVarValuesControl(processOutCtrl);
                }
                else if (coldOut is DryingGasStream)
                {
                    GasStreamControl gasOutCtrl = baseCtrl as GasStreamControl;
                    ctrl = new GasStreamValuesControl(gasOutCtrl);
                }
                else if (coldOut is DryingMaterialStream)
                {
                    MaterialStreamControl matOutCtrl = baseCtrl as MaterialStreamControl;
                    ctrl = new MaterialStreamValuesControl(matOutCtrl);
                }
                this.groupBoxColdStream.Controls.Add(ctrl);
                ctrl.Location = new Point(276, 12 + 20 + 2);

                this.textBoxColdOutName.SetSolvable(heatExchanger.ColdSideOutlet);
                this.groupBoxColdStream.Controls.Add(this.textBoxColdOutName);
                this.textBoxColdOutName.Text = heatExchanger.ColdSideOutlet.Name;
                UI.SetStatusColor(this.textBoxColdOutName, heatExchanger.ColdSideOutlet.SolveState);
            }

            if (hasHotIn || hasHotOut)
            {
                ProcessStreamBase labelsStream = hasHotIn ? hotIn : hotOut;

                UserControl ctrl = null;
                if (labelsStream is WaterStream)
                {
                    ctrl = new ProcessVarLabelsControl(labelsStream.VarList);
                }
                else if (labelsStream is DryingGasStream)
                {
                    ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream);
                }
                else if (labelsStream is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream);
                }
                this.groupBoxHotStream.Controls.Add(ctrl);
                ctrl.Location = new Point(4, 12 + 20 + 2);
            }

            if (hasHotIn)
            {
                UserControl ctrl = null;
                ProcessStreamBaseControl baseCtrl = (ProcessStreamBaseControl)this.HeatExchangerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.HeatExchangerCtrl.HeatExchanger.HotSideInlet.Name);
                if (hotIn is WaterStream)
                {
                    WaterStreamControl processInCtrl = baseCtrl as WaterStreamControl;
                    ctrl = new ProcessVarValuesControl(processInCtrl);
                }
                else if (hotIn is DryingGasStream)
                {
                    GasStreamControl gasInCtrl = baseCtrl as GasStreamControl;
                    ctrl = new GasStreamValuesControl(gasInCtrl);
                }
                else if (hotIn is DryingMaterialStream)
                {
                    MaterialStreamControl matInCtrl = baseCtrl as MaterialStreamControl;
                    ctrl = new MaterialStreamValuesControl(matInCtrl);
                }

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

                this.textBoxHotInName.SetSolvable(heatExchanger.HotSideInlet);
                this.groupBoxHotStream.Controls.Add(this.textBoxHotInName);
                this.textBoxHotInName.Text = heatExchanger.HotSideInlet.Name;
                UI.SetStatusColor(this.textBoxHotInName, heatExchanger.HotSideInlet.SolveState);
            }

            if (hasHotOut)
            {
                ProcessStreamBaseControl baseCtrl = (ProcessStreamBaseControl)this.HeatExchangerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.HeatExchangerCtrl.HeatExchanger.HotSideOutlet.Name);
                UserControl ctrl = null;
                if (hotOut is WaterStream)
                {
                    WaterStreamControl processOutCtrl = baseCtrl as WaterStreamControl;
                    ctrl = new ProcessVarValuesControl(processOutCtrl);
                }
                else if (hotOut is DryingGasStream)
                {
                    GasStreamControl gasOutCtrl = baseCtrl as GasStreamControl;
                    ctrl = new GasStreamValuesControl(gasOutCtrl);
                }
                else if (hotOut is DryingMaterialStream)
                {
                    MaterialStreamControl matOutCtrl = baseCtrl as MaterialStreamControl;
                    ctrl = new MaterialStreamValuesControl(matOutCtrl);
                }
                this.groupBoxHotStream.Controls.Add(ctrl);
                ctrl.Location = new Point(276, 12 + 20 + 2);

                this.textBoxHotOutName.SetSolvable(heatExchanger.HotSideOutlet);
                this.groupBoxHotStream.Controls.Add(this.textBoxHotOutName);
                this.textBoxHotOutName.Text = heatExchanger.HotSideOutlet.Name;
                UI.SetStatusColor(this.textBoxHotOutName, heatExchanger.HotSideOutlet.SolveState);
            }
        }
Esempio n. 3
0
        public EjectorEditor(EjectorControl ejectorCtrl)
            : base(ejectorCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.inConstruction = true;
            Ejector ejector = this.EjectorCtrl.Ejector;

            this.Text = "Ejector: " + ejector.Name;

            this.UpdateStreamsUI();

            this.groupBoxEjector          = new System.Windows.Forms.GroupBox();
            this.groupBoxEjector.Location = new System.Drawing.Point(452, 24);
            this.groupBoxEjector.Name     = "groupBoxEjector";
            this.groupBoxEjector.Text     = "Ejector";
            this.groupBoxEjector.Size     = new System.Drawing.Size(280, 100);
            this.groupBoxEjector.TabIndex = 127;
            this.groupBoxEjector.TabStop  = false;
            this.panel.Controls.Add(this.groupBoxEjector);

            //         this.panel.Size = new System.Drawing.Size(930, 329);
            //         this.ClientSize = new System.Drawing.Size(930, 351);

            //EjectorLabelsControl ejectorLabelsCtrl = new EjectorLabelsControl(this.EjectorCtrl.Ejector);
            ProcessVarLabelsControl ejectorLabelsCtrl = new ProcessVarLabelsControl(this.EjectorCtrl.Ejector.VarList);

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

            //EjectorValuesControl ejectorValuesCtrl = new EjectorValuesControl(this.EjectorCtrl);
            ProcessVarValuesControl ejectorValuesCtrl = new ProcessVarValuesControl(this.EjectorCtrl);

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

            //ejectorCtrl.Ejector.StreamAttached += new StreamAttachedEventHandler(Ejector_StreamAttached);
            //ejectorCtrl.Ejector.StreamDetached += new StreamDetachedEventHandler(Ejector_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.EjectorCtrl.Ejector.CalculationType);
        }
Esempio n. 4
0
        //private void Ejector_StreamAttached(UnitOperation uo, ProcessStreamBase ps, int desc) {
        //   this.UpdateStreamsUI();
        //}

        //private void Ejector_StreamDetached(UnitOperation uo, ProcessStreamBase ps) {
        //   this.UpdateStreamsUI();
        //}

        protected override void UpdateStreamsUI()
        {
            // clear the streams boxes and start again
            this.groupBoxMotiveSuction.Controls.Clear();

            Ejector ejector         = this.EjectorCtrl.Ejector;
            bool    hasMotiveIn     = false;
            bool    hasSuctionIn    = false;
            bool    hasDischargeOut = false;

            ProcessStreamBase motiveIn = ejector.MotiveInlet;

            hasMotiveIn = motiveIn != null;

            ProcessStreamBase suctionIn = ejector.SuctionInlet;

            hasSuctionIn = suctionIn != null;

            ProcessStreamBase dischargeOut = ejector.DischargeOutlet;

            hasDischargeOut = dischargeOut != null;

            if (hasMotiveIn || hasSuctionIn || hasDischargeOut)
            {
                ProcessStreamBase labelsStream = null;
                if (hasMotiveIn)
                {
                    labelsStream = motiveIn;
                }
                else if (hasSuctionIn)
                {
                    labelsStream = suctionIn;
                }
                else if (hasDischargeOut)
                {
                    labelsStream = dischargeOut;
                }

                UserControl ctrl = null;
                if (labelsStream is WaterStream)
                {
                    ctrl = new ProcessVarLabelsControl(labelsStream.VarList);
                }
                else if (labelsStream is DryingGasStream)
                {
                    ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream);
                }
                else if (labelsStream is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream);
                }
                //UserControl ctrl = new ProcessVarLabelsControl(labelsStream.VarList);
                this.groupBoxMotiveSuction.Controls.Add(ctrl);
                ctrl.Location = new Point(4, 12 + 20 + 2);
            }

            if (hasMotiveIn)
            {
                ProcessStreamBaseControl baseCtrl = this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.MotiveInlet.Name);
                UserControl ctrl = null;
                if (motiveIn is WaterStream)
                {
                    ctrl = new ProcessVarValuesControl(baseCtrl);
                }
                else if (motiveIn is DryingGasStream)
                {
                    ctrl = new GasStreamValuesControl((GasStreamControl)baseCtrl);
                }
                else if (motiveIn is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamValuesControl((MaterialStreamControl)baseCtrl);
                }
                //UserControl ctrl = new ProcessVarValuesControl(baseCtrl);

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

                this.textBoxMotiveInName.SetSolvable(ejector.MotiveInlet);
                this.groupBoxMotiveSuction.Controls.Add(this.textBoxMotiveInName);
                this.textBoxMotiveInName.Text = ejector.MotiveInlet.Name;
                UI.SetStatusColor(this.textBoxMotiveInName, ejector.MotiveInlet.SolveState);
            }

            if (hasSuctionIn)
            {
                ProcessStreamBaseControl baseCtrl = this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.SuctionInlet.Name);
                UserControl ctrl = null;
                if (suctionIn is WaterStream)
                {
                    ctrl = new ProcessVarValuesControl(baseCtrl);
                }
                else if (suctionIn is DryingGasStream)
                {
                    ctrl = new GasStreamValuesControl((GasStreamControl)baseCtrl);
                }
                else if (suctionIn is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamValuesControl((MaterialStreamControl)baseCtrl);
                }
                //UserControl ctrl = new ProcessVarValuesControl(baseCtrl);

                this.groupBoxMotiveSuction.Controls.Add(ctrl);
                ctrl.Location = new Point(276, 12 + 20 + 2);

                this.textBoxSuctionInName.SetSolvable(ejector.SuctionInlet);
                this.groupBoxMotiveSuction.Controls.Add(this.textBoxSuctionInName);
                this.textBoxSuctionInName.Text = ejector.SuctionInlet.Name;
                UI.SetStatusColor(this.textBoxSuctionInName, ejector.SuctionInlet.SolveState);
            }

            if (hasDischargeOut)
            {
                ProcessStreamBaseControl baseCtrl = this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.DischargeOutlet.Name);
                UserControl ctrl = null;
                if (dischargeOut is WaterStream)
                {
                    ctrl = new ProcessVarValuesControl(baseCtrl);
                }
                else if (dischargeOut is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamValuesControl((MaterialStreamControl)baseCtrl);
                }
                else if (dischargeOut is DryingGasStream)
                {
                    ctrl = new GasStreamValuesControl((GasStreamControl)baseCtrl);
                }
                //UserControl ctrl = new ProcessVarValuesControl(baseCtrl);
                this.groupBoxMotiveSuction.Controls.Add(ctrl);
                ctrl.Location = new Point(356, 12 + 20 + 2);

                this.textBoxDischargeOutName.SetSolvable(ejector.DischargeOutlet);
                this.groupBoxMotiveSuction.Controls.Add(this.textBoxDischargeOutName);
                this.textBoxDischargeOutName.Text = ejector.DischargeOutlet.Name;
                UI.SetStatusColor(this.textBoxDischargeOutName, ejector.DischargeOutlet.SolveState);
            }
        }
Esempio n. 5
0
        private void UpdateStreamsUI()
        {
            // clear the streams boxes and start again
            this.groupBoxGasInletOutlet.Controls.Clear();
            this.groupBoxLiquidOutlet.Controls.Clear();
            this.groupBoxWaterInletOutlet.Controls.Clear();

            ScrubberCondenser scrubberCondenser = this.ScrubberCondenserCtrl.ScrubberCondenser;
            bool hasGasIn     = false;
            bool hasGasOut    = false;
            bool hasLiquidOut = false;
            bool hasWaterIn   = false;
            bool hasWaterOut  = false;

            ProcessStreamBase gasIn = scrubberCondenser.GasInlet;

            hasGasIn = gasIn != null;

            ProcessStreamBase gasOut = scrubberCondenser.GasOutlet;

            hasGasOut = gasOut != null;

            ProcessStreamBase liquidOut = scrubberCondenser.LiquidOutlet;

            hasLiquidOut = liquidOut != null;

            ProcessStreamBase waterIn = scrubberCondenser.WaterInlet;

            hasWaterIn = waterIn != null;

            ProcessStreamBase waterOut = scrubberCondenser.WaterOutlet;

            hasWaterOut = waterOut != null;

            if (hasGasIn || hasGasOut)
            {
                ProcessStreamBase labelsStream = hasGasIn ? gasIn : gasOut;

                //UserControl ctrl = new ProcessVarLabelsControl(labelsStream.VarList);
                UserControl ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream);
                this.groupBoxGasInletOutlet.Controls.Add(ctrl);
                ctrl.Location = new Point(4, 12 + 20 + 2);
            }

            if (hasGasIn)
            {
                ProcessStreamBaseControl gasInCtrl = this.ScrubberCondenserCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.ScrubberCondenserCtrl.ScrubberCondenser.GasInlet.Name);
                //UserControl ctrl = new ProcessVarValuesControl(gasInCtrl);
                UserControl ctrl = new GasStreamValuesControl((GasStreamControl)gasInCtrl);

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

                this.textBoxGasInName.SetSolvable(scrubberCondenser.GasInlet);
                this.groupBoxGasInletOutlet.Controls.Add(this.textBoxGasInName);
                this.textBoxGasInName.Text = scrubberCondenser.GasInlet.Name;
                UI.SetStatusColor(this.textBoxGasInName, scrubberCondenser.GasInlet.SolveState);
            }

            if (hasGasOut)
            {
                ProcessStreamBaseControl gasOutCtrl = this.ScrubberCondenserCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.ScrubberCondenserCtrl.ScrubberCondenser.GasOutlet.Name);
                //UserControl ctrl = new ProcessVarValuesControl(gasOutCtrl);
                UserControl ctrl = new GasStreamValuesControl((GasStreamControl)gasOutCtrl);
                this.groupBoxGasInletOutlet.Controls.Add(ctrl);
                ctrl.Location = new Point(276, 12 + 20 + 2);

                this.textBoxGasOutName.SetSolvable(scrubberCondenser.GasOutlet);
                this.groupBoxGasInletOutlet.Controls.Add(this.textBoxGasOutName);
                this.textBoxGasOutName.Text = scrubberCondenser.GasOutlet.Name;
                UI.SetStatusColor(this.textBoxGasOutName, scrubberCondenser.GasOutlet.SolveState);
            }

            if (hasLiquidOut)
            {
                // add the labels
                //UserControl ctrl = new ProcessVarLabelsControl(liquidOut.VarList);
                UserControl ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)liquidOut);
                this.groupBoxLiquidOutlet.Controls.Add(ctrl);
                ctrl.Location = new Point(4, 12 + 20 + 2);

                ProcessStreamBaseControl matOutCtrl = this.ScrubberCondenserCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.ScrubberCondenserCtrl.ScrubberCondenser.LiquidOutlet.Name);
                //ctrl = new ProcessVarValuesControl(matOutCtrl);
                ctrl = new MaterialStreamValuesControl((MaterialStreamControl)matOutCtrl);
                this.groupBoxLiquidOutlet.Controls.Add(ctrl);
                ctrl.Location = new Point(196, 12 + 20 + 2);

                this.textBoxLiquidOutName.SetSolvable(scrubberCondenser.LiquidOutlet);
                this.groupBoxLiquidOutlet.Controls.Add(this.textBoxLiquidOutName);
                this.textBoxLiquidOutName.Text = scrubberCondenser.LiquidOutlet.Name;
                UI.SetStatusColor(this.textBoxLiquidOutName, scrubberCondenser.LiquidOutlet.SolveState);
            }

            if (hasWaterIn || hasWaterOut)
            {
                UserControl       ctrl         = null;
                ProcessStreamBase labelsStream = hasWaterIn ? waterIn : waterOut;
                if (waterIn is WaterStream)
                {
                    ctrl = new ProcessVarLabelsControl(labelsStream.VarList);
                }
                else if (waterIn is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream);
                }

                this.groupBoxWaterInletOutlet.Controls.Add(ctrl);
                ctrl.Location = new Point(4, 12 + 20 + 2);
            }

            if (hasWaterIn)
            {
                UserControl ctrl = null;
                ProcessStreamBaseControl waterInCtrl = this.ScrubberCondenserCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.ScrubberCondenserCtrl.ScrubberCondenser.WaterInlet.Name);
                if (waterIn is WaterStream)
                {
                    ctrl = new ProcessVarValuesControl(waterInCtrl);
                }
                else if (waterIn is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamValuesControl((MaterialStreamControl)waterInCtrl);
                }
                this.groupBoxWaterInletOutlet.Controls.Add(ctrl);
                ctrl.Location = new Point(196, 12 + 20 + 2);

                this.textBoxWaterInName.SetSolvable(scrubberCondenser.WaterInlet);
                this.groupBoxWaterInletOutlet.Controls.Add(this.textBoxWaterInName);
                this.textBoxWaterInName.Text = scrubberCondenser.WaterInlet.Name;
                UI.SetStatusColor(this.textBoxWaterInName, scrubberCondenser.WaterInlet.SolveState);
            }

            if (hasWaterOut)
            {
                UserControl ctrl = null;
                ProcessStreamBaseControl waterOutCtrl = this.ScrubberCondenserCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.ScrubberCondenserCtrl.ScrubberCondenser.WaterOutlet.Name);
                if (waterOut is WaterStream)
                {
                    ctrl = new ProcessVarValuesControl(waterOutCtrl);
                }
                else if (waterOut is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamValuesControl((MaterialStreamControl)waterOutCtrl);
                }

                this.groupBoxWaterInletOutlet.Controls.Add(ctrl);
                ctrl.Location = new Point(276, 12 + 20 + 2);

                this.textBoxWaterOutName.SetSolvable(scrubberCondenser.WaterOutlet);
                this.groupBoxWaterInletOutlet.Controls.Add(this.textBoxWaterOutName);
                this.textBoxWaterOutName.Text = scrubberCondenser.WaterOutlet.Name;
                UI.SetStatusColor(this.textBoxWaterOutName, scrubberCondenser.WaterOutlet.SolveState);
            }
        }
Esempio n. 6
0
        public CycloneEditor(CycloneControl cycloneCtrl)
            : base(cycloneCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.inConstruction = true;
            Cyclone cyclone = this.CycloneCtrl.Cyclone;

            this.Text = "Cyclone: " + cyclone.Name;

            this.UpdateStreamsUI();

            this.groupBoxCyclone          = new System.Windows.Forms.GroupBox();
            this.groupBoxCyclone.Location = new System.Drawing.Point(644, 24);
            this.groupBoxCyclone.Name     = "groupBoxCyclone";
            this.groupBoxCyclone.Text     = "Cyclone";
            this.groupBoxCyclone.Size     = new System.Drawing.Size(280, 160);
            this.groupBoxCyclone.TabIndex = 127;
            this.groupBoxCyclone.TabStop  = false;
            this.panel.Controls.Add(this.groupBoxCyclone);

            if (cyclone.ParticleOutlet is DryingGasStream)
            {
                this.groupBoxParticle.Size = new System.Drawing.Size(280, 300);
                this.panel.Size            = new System.Drawing.Size(930, 329);
                this.ClientSize            = new System.Drawing.Size(930, 351);
            }
            else if (cyclone.ParticleOutlet is DryingMaterialStream)
            {
                this.groupBoxParticle.Size = new System.Drawing.Size(280, 300);
                this.panel.Size            = new System.Drawing.Size(930, 329);
                this.ClientSize            = new System.Drawing.Size(930, 351);
            }

            ProcessVarLabelsControl cycloneLabelsCtrl = new ProcessVarLabelsControl(this.CycloneCtrl.Cyclone.VarList);

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

            ProcessVarValuesControl cycloneValuesCtrl = new ProcessVarValuesControl(this.CycloneCtrl);

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

            cycloneCtrl.Cyclone.StreamAttached += new StreamAttachedEventHandler(Cyclone_StreamAttached);
            cycloneCtrl.Cyclone.StreamDetached += new StreamDetachedEventHandler(Cyclone_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;
            this.inConstruction = false;
            this.SetCalculationType(this.CycloneCtrl.Cyclone.CalculationType);
        }