コード例 #1
0
        public ElectrostaticPrecipitatorEditor(ElectrostaticPrecipitatorControl electrostaticPrecipitatorCtrl) : base(electrostaticPrecipitatorCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.UpdateStreamsUI();

            ElectrostaticPrecipitator electrostaticPrecipitator = this.ElectrostaticPrecipitatorCtrl.ElectrostaticPrecipitator;

            this.Text = "Electrostatic Precipitator: " + electrostaticPrecipitator.Name;

            this.groupBoxUnitOpVars.Location = new System.Drawing.Point(644, 24);
            this.groupBoxUnitOpVars.Size     = new System.Drawing.Size(280, 260);
            this.groupBoxUnitOpVars.Controls.Clear();
            this.groupBoxUnitOpVars.Text = "Electrostatic Precipitator";

            ProcessVarLabelsControl electrostaticPrecipitatorLabelsCtrl = new ProcessVarLabelsControl(this.solvableCtrl.Solvable.VarList);

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

            ProcessVarValuesControl electrostaticPrecipitatorValuesCtrl = new ProcessVarValuesControl(this.solvableCtrl);

            this.groupBoxUnitOpVars.Controls.Add(electrostaticPrecipitatorValuesCtrl);
            electrostaticPrecipitatorValuesCtrl.Location = new Point(196, 12 + 20 + 2);
        }
コード例 #2
0
        public DetailedFuelStreamLabelAndValuesControl(DetailedFuelStreamControl streamCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.comboBoxDryingFuelSelection.Items.AddRange(fuelCatalog.GetFossilFuelArray());
            this.comboBoxDryingFuelSelection.SelectedIndexChanged += comboBoxDryingFuelSelection_SelectedIndexChanged;

            this.streamCtrl = streamCtrl;
            ArrayList varList = streamCtrl.Solvable.VarList;

            ProcessVarLabelsControl gasLabelsCtrl = new ProcessVarLabelsControl(varList);

            this.Controls.Add(gasLabelsCtrl);
            gasLabelsCtrl.Location = new Point(0, 24);

            ProcessVarValuesControl gasValuesCtrl = new ProcessVarValuesControl(streamCtrl);

            this.Controls.Add(gasValuesCtrl);
            gasValuesCtrl.Location = new Point(192, 24);

            this.Text       = streamCtrl.Name;
            this.ClientSize = new System.Drawing.Size(274, varList.Count * 20 + 67);

            InitializeDryingFuelComboBox(streamCtrl);

            fuelCatalog.FossilFuelAdded   += DetailedFuelStreamEditor_FossilFuelAdded;
            fuelCatalog.FossilFuelDeleted += DetailedFuelStreamEditor_FossilFuelDeleted;
        }
コード例 #3
0
        public BurnerEditor(BurnerControl bCtrl)
            : base(bCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //this.inConstruction = true;
            //Burner b = this.BurnerCtrl.Burner;
            //this.Text = "Combustor: " + b.Name;
            this.Text = this.solvableCtrl.SolvableDispalyTitle;

            this.UpdateStreamsUI();

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

            ProcessVarLabelsControl bLabelsCtrl = new ProcessVarLabelsControl(this.BurnerCtrl.Burner.VarList);

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

            ProcessVarValuesControl bValuesCtrl = new ProcessVarValuesControl(this.BurnerCtrl);

            this.groupBoxBurner.Controls.Add(bValuesCtrl);
            bValuesCtrl.Location = new Point(196, 12 + 20 + 2);
            this.ClientSize      = new System.Drawing.Size(930, 330);
        }
コード例 #4
0
        public BagFilterEditor(BagFilterControl bagFilterCtrl) : base(bagFilterCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.UpdateStreamsUI();

            this.Text = "Bag Filter: " + UnitOpCtrl.UnitOperation.Name;

            this.groupBoxUnitOpVars.Location = new System.Drawing.Point(644, 24);
            this.groupBoxUnitOpVars.Size     = new System.Drawing.Size(280, 260);
            this.groupBoxUnitOpVars.Controls.Clear();
            this.groupBoxUnitOpVars.Text = "Bag Filter";

            ProcessVarLabelsControl bagFilterLabelsCtrl = new ProcessVarLabelsControl(solvableCtrl.Solvable.VarList);

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

            //BagFilterValuesControl bagFilterValuesCtrl = new BagFilterValuesControl(this.BagFilterCtrl);
            ProcessVarValuesControl bagFilterValuesCtrl = new ProcessVarValuesControl(solvableCtrl);

            this.groupBoxUnitOpVars.Controls.Add(bagFilterValuesCtrl);
            bagFilterValuesCtrl.Location = new Point(196, 12 + 20 + 2);
        }
コード例 #5
0
        public BagFilterEditor(BagFilterControl bagFilterCtrl) : base(bagFilterCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.Text = "Bag Filter: " + bagFilterCtrl.BagFilter.Name;

            this.groupBoxTwoStreamUnitOp.Size = new System.Drawing.Size(280, 260);
            this.groupBoxTwoStreamUnitOp.Controls.Clear();
            this.groupBoxTwoStreamUnitOp.Text = "Bag Filter";

            //BagFilterLabelsControl bagFilterLabelsCtrl = new BagFilterLabelsControl(bagFilterCtrl.BagFilter);
            ProcessVarLabelsControl bagFilterLabelsCtrl = new ProcessVarLabelsControl(bagFilterCtrl.BagFilter.VarList);

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

            //BagFilterValuesControl bagFilterValuesCtrl = new BagFilterValuesControl(this.BagFilterCtrl);
            ProcessVarValuesControl bagFilterValuesCtrl = new ProcessVarValuesControl(this.BagFilterCtrl);

            this.groupBoxTwoStreamUnitOp.Controls.Add(bagFilterValuesCtrl);
            bagFilterValuesCtrl.Location = new Point(196, 12 + 20 + 2);
        }
コード例 #6
0
        public FabricFilterEditor(FabricFilterControl fabricFilterCtrl) : base(fabricFilterCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.UpdateStreamsUI();

            this.groupBoxFabricFilter.Location = new System.Drawing.Point(644, 24);
            this.groupBoxFabricFilter.Size     = new System.Drawing.Size(280, 260);
            this.groupBoxFabricFilter.Controls.Clear();

            //BagFilterLabelsControl bagFilterLabelsCtrl = new BagFilterLabelsControl(bagFilterCtrl.BagFilter);
            ProcessVarLabelsControl fabricFilterLabelsCtrl = new ProcessVarLabelsControl(this.solvableCtrl.Solvable.VarList);

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

            //BagFilterValuesControl bagFilterValuesCtrl = new BagFilterValuesControl(this.BagFilterCtrl);
            ProcessVarValuesControl fabricFilterValuesCtrl = new ProcessVarValuesControl(this.solvableCtrl);

            this.groupBoxFabricFilter.Controls.Add(fabricFilterValuesCtrl);
            fabricFilterValuesCtrl.Location = new Point(196, 12 + 20 + 2);
        }
コード例 #7
0
        public AirFilterEditor(AirFilterControl airFilterCtrl) : base(airFilterCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.Text = "Air Filter: " + airFilterCtrl.AirFilter.Name;
            this.groupBoxTwoStreamUnitOp.Size = new System.Drawing.Size(280, 200);
            this.groupBoxTwoStreamUnitOp.Text = "Air Filter";

            ProcessVarLabelsControl airFilterLabelsCtrl = new ProcessVarLabelsControl(airFilterCtrl.Solvable.VarList);

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

            ProcessVarValuesControl airFilterValuesCtrl = new ProcessVarValuesControl(airFilterCtrl);

            this.groupBoxTwoStreamUnitOp.Controls.Add(airFilterValuesCtrl);
            airFilterValuesCtrl.Location = new Point(196, 12 + 20 + 2);
        }
コード例 #8
0
        public HeaterEditor(HeaterControl heaterCtrl) : base(heaterCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            Heater heater = this.HeaterCtrl.Heater;

            this.Text = "Heater: " + heater.Name;
            this.groupBoxTwoStreamUnitOp.Size = new System.Drawing.Size(280, 100);
            this.groupBoxTwoStreamUnitOp.Text = "Heater";

            ProcessVarLabelsControl heaterLabelsCtrl = new ProcessVarLabelsControl(heaterCtrl.Heater.VarList);

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

            ProcessVarValuesControl heaterValuesCtrl = new ProcessVarValuesControl(this.HeaterCtrl);

            this.groupBoxTwoStreamUnitOp.Controls.Add(heaterValuesCtrl);
            heaterValuesCtrl.Location = new Point(196, 12 + 20 + 2);
        }
コード例 #9
0
        public ValveEditor(ValveControl valveCtrl) : base(valveCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            Valve valve = this.ValveCtrl.Valve;

            this.Text = "Valve: " + valve.Name;
            this.groupBoxTwoStreamUnitOp.Size = new System.Drawing.Size(280, 60);
            this.groupBoxTwoStreamUnitOp.Text = "Valve";

            ProcessVarLabelsControl valveLabelsCtrl = new ProcessVarLabelsControl(valveCtrl.Valve.VarList);

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

            ProcessVarValuesControl valveValuesCtrl = new ProcessVarValuesControl(this.ValveCtrl);

            this.groupBoxTwoStreamUnitOp.Controls.Add(valveValuesCtrl);
            valveValuesCtrl.Location = new Point(196, 12 + 20 + 2);
        }
コード例 #10
0
        public ProcessStreamBaseEditor(ProcessStreamBaseControl processStreamBaseCtrl)
            : base(processStreamBaseCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            ArrayList varList = processStreamBaseCtrl.ProcessStreamBase.VarList;

            ProcessVarLabelsControl gasLabelsCtrl = new ProcessVarLabelsControl(varList);

            this.panel.Controls.Add(gasLabelsCtrl);
            gasLabelsCtrl.Location = new Point(0, 24);

            ProcessVarValuesControl gasValuesCtrl = new ProcessVarValuesControl(processStreamBaseCtrl);

            this.panel.Controls.Add(gasValuesCtrl);
            gasValuesCtrl.Location = new Point(192, 24);

            this.Text       = processStreamBaseCtrl.Name;
            this.ClientSize = new System.Drawing.Size(274, varList.Count * 20 + 47);
        }
コード例 #11
0
        public HeatExchangerEditor(HeatExchangerControl heatExchangerCtrl) : base(heatExchangerCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.inConstruction = true;
            HeatExchanger heatExchanger = this.HeatExchangerCtrl.HeatExchanger;

            this.Text = "Heat Exchanger: " + heatExchanger.Name;
            this.UpdateStreamsUI();

            this.groupBoxHeatExchanger          = new System.Windows.Forms.GroupBox();
            this.groupBoxHeatExchanger.Location = new System.Drawing.Point(724, 24);
            this.groupBoxHeatExchanger.Name     = "groupBoxHeatExchanger";
            this.groupBoxHeatExchanger.Text     = "Heat Exchanger";
            this.groupBoxHeatExchanger.Size     = new System.Drawing.Size(280, 300);
            this.groupBoxHeatExchanger.TabIndex = 128;
            this.groupBoxHeatExchanger.TabStop  = false;
            this.panel.Controls.Add(this.groupBoxHeatExchanger);

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

//         if (heatExchanger.ColdSideInlet is DryingGasStream)
//         {
//            this.groupBoxColdStream.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 (heatExchanger.ColdSideInlet is DryingMaterialStream)
//         {
            this.groupBoxColdStream.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.groupBoxHotStream.Size = new System.Drawing.Size(360, 300);

            //HeatExchangerLabelsControl heatExchangerLabelsCtrl = new HeatExchangerLabelsControl(this.HeatExchangerCtrl.HeatExchanger);
            ProcessVarLabelsControl heatExchangerLabelsCtrl = new ProcessVarLabelsControl(this.HeatExchangerCtrl.HeatExchanger.VarList);

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

            //HeatExchangerValuesControl heatExchangerValuesCtrl = new HeatExchangerValuesControl(this.HeatExchangerCtrl);
            ProcessVarValuesControl heatExchangerValuesCtrl = new ProcessVarValuesControl(this.HeatExchangerCtrl);

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

            // shell and tube hot side
            this.groupBoxHotSide         = new System.Windows.Forms.GroupBox();
            this.radioButtonHotSideTube  = new System.Windows.Forms.RadioButton();
            this.radioButtonHotSideShell = new System.Windows.Forms.RadioButton();
            //
            // groupBoxHotSide
            //
            this.groupBoxHotSide.Controls.Add(this.radioButtonHotSideTube);
            this.groupBoxHotSide.Controls.Add(this.radioButtonHotSideShell);
            this.groupBoxHotSide.Location = new System.Drawing.Point(0, 0);
            this.groupBoxHotSide.Name     = "groupBoxHotSide";
            this.groupBoxHotSide.Size     = new System.Drawing.Size(104, 68);
            this.groupBoxHotSide.TabIndex = 0;
            this.groupBoxHotSide.TabStop  = false;
            this.groupBoxHotSide.Text     = "Hot Side";
            //
            // radioButtonHotSideTube
            //
            this.radioButtonHotSideTube.Location        = new System.Drawing.Point(8, 44);
            this.radioButtonHotSideTube.Name            = "radioButtonHotSideTube";
            this.radioButtonHotSideTube.Size            = new System.Drawing.Size(72, 20);
            this.radioButtonHotSideTube.TabIndex        = 1;
            this.radioButtonHotSideTube.Text            = "Tube";
            this.radioButtonHotSideTube.CheckedChanged += new System.EventHandler(this.HotSideHandler);
            //
            // radioButtonHotSideShell
            //
            this.radioButtonHotSideShell.Location        = new System.Drawing.Point(8, 20);
            this.radioButtonHotSideShell.Name            = "radioButtonHotSideShell";
            this.radioButtonHotSideShell.Size            = new System.Drawing.Size(72, 20);
            this.radioButtonHotSideShell.TabIndex        = 0;
            this.radioButtonHotSideShell.Text            = "Shell";
            this.radioButtonHotSideShell.CheckedChanged += new System.EventHandler(this.HotSideHandler);

            this.groupBoxHeatExchanger.Controls.Add(this.groupBoxHotSide);
            this.groupBoxHotSide.Location = new Point(20, 112);

            heatExchangerCtrl.HeatExchanger.StreamAttached += new StreamAttachedEventHandler(HeatExchanger_StreamAttached);
            heatExchangerCtrl.HeatExchanger.StreamDetached += new StreamDetachedEventHandler(HeatExchanger_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.comboBoxExchangerType          = new System.Windows.Forms.ComboBox();
            this.labelCalculationType           = new System.Windows.Forms.Label();
            this.labelCalculationType.BackColor = Color.DarkGray;
            this.labelExchangerType             = new System.Windows.Forms.Label();
            this.labelExchangerType.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);

            // comboBoxExchangerType
            this.comboBoxExchangerType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBoxExchangerType.Items.AddRange(new object[] {
                "Simple Generic",
                "Shell And Tube",
                "Plate And Frame"
            });
            this.comboBoxExchangerType.Location              = new System.Drawing.Point(792, 0);
            this.comboBoxExchangerType.Name                  = "comboBoxExchangerType";
            this.comboBoxExchangerType.Size                  = new System.Drawing.Size(108, 21);
            this.comboBoxExchangerType.TabIndex              = 6;
            this.comboBoxExchangerType.SelectedIndexChanged += new EventHandler(comboBoxExchangerType_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;

            // labelExchangerType
            this.labelExchangerType.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.labelExchangerType.Location    = new System.Drawing.Point(600, 0);
            this.labelExchangerType.Name        = "labelExchangerType";
            this.labelExchangerType.Size        = new System.Drawing.Size(192, 20);
            this.labelExchangerType.TabIndex    = 4;
            this.labelExchangerType.Text        = "Exchanger Type:";
            this.labelExchangerType.TextAlign   = System.Drawing.ContentAlignment.MiddleLeft;

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

            this.HeatExchangerCtrl.HeatExchanger.HXHotSideChanged += new HXHotSideChangedEventHandler(HeatExchanger_HXHotSideChanged);

            this.comboBoxCalculationType.SelectedIndex = -1;
            this.comboBoxExchangerType.SelectedIndex   = -1;
            this.inConstruction = false;

            this.SetExchangerType(this.HeatExchangerCtrl.HeatExchanger.ExchangerType);
            this.SetCalculationType(this.HeatExchangerCtrl.HeatExchanger.CalculationType);
            if (this.HeatExchangerCtrl.HeatExchanger.CurrentRatingModel != null)
            {
                if (this.HeatExchangerCtrl.HeatExchanger.ExchangerType == ExchangerType.ShellAndTube)
                {
                    HXRatingModelShellAndTube ratingModel = this.HeatExchangerCtrl.HeatExchanger.CurrentRatingModel as HXRatingModelShellAndTube;
                    this.SetHotSideShell(ratingModel.IsShellSideHot);
                }
            }
        }
コード例 #12
0
        public DryerEditor(DryerControl dryerCtrl)
            : base(dryerCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.inConstruction = true;
            Dryer dryer = this.DryerCtrl.Dryer;

            this.Text = "Dryer: " + dryer.Name;

            this.UpdateStreamsUI();

            this.groupBoxDryer          = new System.Windows.Forms.GroupBox();
            this.groupBoxDryer.Location = new System.Drawing.Point(724, 24);
            this.groupBoxDryer.Name     = "groupBoxDryer";
            this.groupBoxDryer.Text     = "Dryer";
            //this.groupBoxDryer.Size = new System.Drawing.Size(280, 240);
            this.groupBoxDryer.Size     = new System.Drawing.Size(280, 264);
            this.groupBoxDryer.TabIndex = 128;
            this.groupBoxDryer.TabStop  = false;
            this.panel.Controls.Add(this.groupBoxDryer);

            // for the other UOs we do some resizing here!

            //DryerLabelsControl dryerLabelsCtrl = new DryerLabelsControl(this.DryerCtrl.Dryer);
            ProcessVarLabelsControl dryerLabelsCtrl = new ProcessVarLabelsControl(this.DryerCtrl.Dryer.VarList);

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

            //DryerValuesControl dryerValuesCtrl = new DryerValuesControl(this.DryerCtrl);
            ProcessVarValuesControl dryerValuesCtrl = new ProcessVarValuesControl(this.DryerCtrl);

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

            //dryerCtrl.Dryer.StreamAttached += new StreamAttachedEventHandler(Dryer_StreamAttached);
            //dryerCtrl.Dryer.StreamDetached += new StreamDetachedEventHandler(Dryer_StreamDetached);

            this.menuItemScoping        = new MenuItem();
            this.menuItemScoping.Index  = this.menuItemReport.Index + 1;
            this.menuItemScoping.Text   = "Scoping";
            this.menuItemScoping.Click += new EventHandler(menuItemScoping_Click);
            this.mainMenu.MenuItems.Add(this.menuItemScoping);

            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",
                "Scoping"
            });
            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.DryerCtrl.Dryer.DryerCalculationType);
        }
コード例 #13
0
        private 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);
            }
        }
コード例 #14
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);
            }
        }
コード例 #15
0
        private void UpdateStreamsUI()
        {
            // clear the streams boxes and start again
            this.groupBoxStreams.Controls.Clear();
            TwoStreamUnitOperation twoStreamUnitOp = this.TwoStreamUnitOpCtrl.TwoStreamUnitOp;
            bool hasStreamIn  = false;
            bool hasStreamOut = false;

            ProcessStreamBase streamIn = twoStreamUnitOp.Inlet;

            hasStreamIn = streamIn != null;

            ProcessStreamBase streamOut = twoStreamUnitOp.Outlet;

            hasStreamOut = streamOut != null;

            if (hasStreamIn || hasStreamOut)
            {
                ProcessStreamBase labelsStream = hasStreamIn ? streamIn : streamOut;
                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.groupBoxStreams.Controls.Add(ctrl);
                ctrl.Location = new Point(4, 12 + 20 + 2);
            }

            if (hasStreamIn)
            {
                ProcessStreamBaseControl myControl = this.TwoStreamUnitOpCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.TwoStreamUnitOpCtrl.TwoStreamUnitOp.Inlet.Name);
                UserControl ctrl = null;
                if (streamIn is WaterStream)
                {
                    WaterStreamControl processInCtrl = (WaterStreamControl)this.TwoStreamUnitOpCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.TwoStreamUnitOpCtrl.TwoStreamUnitOp.Inlet.Name);
                    ctrl = new ProcessVarValuesControl(processInCtrl);
                }
                else if (streamIn is DryingGasStream)
                {
                    GasStreamControl gasInCtrl = (GasStreamControl)this.TwoStreamUnitOpCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.TwoStreamUnitOpCtrl.TwoStreamUnitOp.Inlet.Name);
                    ctrl = new GasStreamValuesControl(gasInCtrl);
                }
                else if (streamIn is DryingMaterialStream)
                {
                    MaterialStreamControl materialInCtrl = (MaterialStreamControl)this.TwoStreamUnitOpCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.TwoStreamUnitOpCtrl.TwoStreamUnitOp.Inlet.Name);
                    ctrl = new MaterialStreamValuesControl(materialInCtrl);
                }

                //UserControl ctrl = new ProcessVarValuesControl(myControl);

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

                this.textBoxStreamInName.SetSolvable(streamIn);
                this.groupBoxStreams.Controls.Add(this.textBoxStreamInName);
                this.textBoxStreamInName.Text = twoStreamUnitOp.Inlet.Name;
                UI.SetStatusColor(this.textBoxStreamInName, twoStreamUnitOp.Inlet.SolveState);
            }

            if (hasStreamOut)
            {
                ProcessStreamBaseControl baseControl = this.TwoStreamUnitOpCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.TwoStreamUnitOpCtrl.TwoStreamUnitOp.Outlet.Name);
                UserControl ctrl = null;
                if (streamOut is WaterStream)
                {
                    WaterStreamControl processOutCtrl = (WaterStreamControl)this.TwoStreamUnitOpCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.TwoStreamUnitOpCtrl.TwoStreamUnitOp.Outlet.Name);
                    ctrl = new ProcessVarValuesControl(processOutCtrl);
                }
                else if (streamOut is DryingGasStream)
                {
                    GasStreamControl gasOutCtrl = (GasStreamControl)this.TwoStreamUnitOpCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.TwoStreamUnitOpCtrl.TwoStreamUnitOp.Outlet.Name);
                    ctrl = new GasStreamValuesControl(gasOutCtrl);
                }
                else if (streamOut is DryingMaterialStream)
                {
                    MaterialStreamControl materialOutCtrl = (MaterialStreamControl)this.TwoStreamUnitOpCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.TwoStreamUnitOpCtrl.TwoStreamUnitOp.Outlet.Name);
                    ctrl = new MaterialStreamValuesControl(materialOutCtrl);
                }
                //UserControl ctrl = new ProcessVarValuesControl(baseControl);

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

                this.textBoxStreamOutName.SetSolvable(streamOut);
                this.groupBoxStreams.Controls.Add(this.textBoxStreamOutName);
                this.textBoxStreamOutName.Text = twoStreamUnitOp.Outlet.Name;
                UI.SetStatusColor(this.textBoxStreamOutName, twoStreamUnitOp.Outlet.SolveState);
            }
        }
コード例 #16
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 (labelsStream is WaterStream)
                {
                    ctrl = new ProcessVarLabelsControl(labelsStream.VarList);
                }
                else if (waterIn is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream);
                }

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

                this.panel.Size = new System.Drawing.Size(1292, 329);
                this.ClientSize = new System.Drawing.Size(1292, 351);
            }
            else
            {
                this.panel.Size = new System.Drawing.Size(932, 329);
                this.ClientSize = new System.Drawing.Size(932, 351);
            }

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

                if (ctrl != null)
                {
                    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);
                }

                if (ctrl != null)
                {
                    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);
            }
        }
コード例 #17
0
        private void UpdateStreamsUI()
        {
            // clear the stream group-boxes and start again
            this.groupBoxGasStream.Controls.Clear();
            this.groupBoxLiquidStream.Controls.Clear();

            WetScrubber wetScrubber  = this.WetScrubberCtrl.WetScrubber;
            bool        hasGasIn     = false;
            bool        hasGasOut    = false;
            bool        hasLiquidIn  = false;
            bool        hasLiquidOut = false;

            ProcessStreamBase gasIn = wetScrubber.GasInlet;

            hasGasIn = gasIn != null;

            ProcessStreamBase gasOut = wetScrubber.GasOutlet;

            hasGasOut = gasOut != null;

            ProcessStreamBase liquidIn = wetScrubber.LiquidInlet;

            hasLiquidIn = liquidIn != null;

            ProcessStreamBase liquidOut = wetScrubber.LiquidOutlet;

            hasLiquidOut = liquidOut != null;

            if (hasGasIn || hasGasOut)
            {
                ProcessStreamBase labelsStream = null;
                if (hasGasIn)
                {
                    labelsStream = gasIn;
                }
                else if (hasGasOut)
                {
                    labelsStream = gasOut;
                }

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

            if (hasGasIn)
            {
                ProcessStreamBaseControl baseCtrl = (ProcessStreamBaseControl)this.WetScrubberCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.WetScrubberCtrl.WetScrubber.GasInlet.Name);
                UserControl ctrl = null;
                //UserControl ctrl = new ProcessVarValuesControl(baseCtrl);
                if (gasIn is DryingGasStream)
                {
                    GasStreamControl gasInCtrl = baseCtrl as GasStreamControl;
                    ctrl = new GasStreamValuesControl(gasInCtrl);
                }

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

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

            if (hasGasOut)
            {
                ProcessStreamBaseControl baseCtrl = this.WetScrubberCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.WetScrubberCtrl.WetScrubber.GasOutlet.Name);
                UserControl ctrl = null;
                //UserControl ctrl = new ProcessVarValuesControl(baseCtrl);
                if (gasOut is DryingGasStream)
                {
                    GasStreamControl gasOutCtrl = baseCtrl as GasStreamControl;
                    ctrl = new GasStreamValuesControl(gasOutCtrl);
                }
                this.groupBoxGasStream.Controls.Add(ctrl);
                ctrl.Location = new Point(276, 12 + 20 + 2);

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

            if (hasLiquidIn || hasLiquidOut)
            {
                ProcessStreamBase labelsStream = null;
                if (hasLiquidIn)
                {
                    labelsStream = liquidIn;
                }
                else if (hasLiquidOut)
                {
                    labelsStream = liquidOut;
                }

                UserControl ctrl = null;
                //if (labelsStream is WaterStream) {
                //   ctrl = new ProcessVarLabelsControl(labelsStream.VarList);
                //}
                //else if (labelsStream is DryingGasStream)
                //{
                //   ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream);
                //}
                if (labelsStream is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream);
                }
                //UserControl ctrl = new ProcessVarLabelsControl(labelsStream.VarList);

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

            if (hasLiquidIn)
            {
                ProcessStreamBaseControl baseCtrl = this.WetScrubberCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.WetScrubberCtrl.WetScrubber.LiquidInlet.Name);
                UserControl ctrl = null;
                if (liquidIn is WaterStream)
                {
                    WaterStreamControl processInCtrl = baseCtrl as WaterStreamControl;
                    ctrl = new ProcessVarValuesControl(processInCtrl);
                }
                //else if (liquidIn is DryingGasStream)
                //{
                //   GasStreamControl gasInCtrl = baseCtrl as GasStreamControl;
                //   ctrl = new GasStreamValuesControl(gasInCtrl);
                //}
                else if (liquidIn is DryingMaterialStream)
                {
                    MaterialStreamControl matInCtrl = baseCtrl as MaterialStreamControl;
                    ctrl = new MaterialStreamValuesControl(matInCtrl);
                }
                //UserControl ctrl = new ProcessVarValuesControl(baseCtrl);

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

                this.textBoxLiquidInName.SetSolvable(wetScrubber.LiquidInlet);
                this.groupBoxLiquidStream.Controls.Add(this.textBoxLiquidInName);
                this.textBoxLiquidInName.Text = wetScrubber.LiquidInlet.Name;
                UI.SetStatusColor(this.textBoxLiquidInName, wetScrubber.LiquidInlet.SolveState);
            }

            if (hasLiquidOut)
            {
                ProcessStreamBaseControl baseCtrl = this.WetScrubberCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.WetScrubberCtrl.WetScrubber.LiquidOutlet.Name);
                UserControl ctrl = null;
                //else if (liquidOut is DryingGasStream) {
                //   GasStreamControl gasOutCtrl = baseCtrl as GasStreamControl;
                //   ctrl = new GasStreamValuesControl(gasOutCtrl);
                //}
                if (liquidOut is DryingMaterialStream)
                {
                    MaterialStreamControl matOutCtrl = baseCtrl as MaterialStreamControl;
                    ctrl = new MaterialStreamValuesControl(matOutCtrl);
                }

                //UserControl ctrl = new ProcessVarValuesControl(baseCtrl);
                this.groupBoxLiquidStream.Controls.Add(ctrl);
                ctrl.Location = new Point(276, 12 + 20 + 2);

                this.textBoxLiquidOutName.SetSolvable(wetScrubber.LiquidOutlet);
                this.groupBoxLiquidStream.Controls.Add(this.textBoxLiquidOutName);
                this.textBoxLiquidOutName.Text = wetScrubber.LiquidOutlet.Name;
                UI.SetStatusColor(this.textBoxLiquidOutName, wetScrubber.LiquidOutlet.SolveState);
            }
        }
コード例 #18
0
        public ScrubberCondenserEditor(ScrubberCondenserControl scrubberCondenserCtrl)
            : base(scrubberCondenserCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.inConstruction = true;
            ScrubberCondenser scrubberCondenser = this.ScrubberCondenserCtrl.ScrubberCondenser;

            this.Text = "Scrubber Condenser: " + scrubberCondenser.Name;

            this.UpdateStreamsUI();

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

            this.groupBoxLiquidOutlet.Size = new System.Drawing.Size(280, 300);
            //this.panel.Size = new System.Drawing.Size(1010, 329);
            //this.ClientSize = new System.Drawing.Size(1010, 351);
            //   this.panel.Size = new System.Drawing.Size(1292, 329);
            //   this.ClientSize = new System.Drawing.Size(1292, 351);

            ProcessVarLabelsControl scrubberCondenserLabelsCtrl = new ProcessVarLabelsControl(this.ScrubberCondenserCtrl.ScrubberCondenser.VarList);

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

            ProcessVarValuesControl scrubberCondenserValuesCtrl = new ProcessVarValuesControl(this.ScrubberCondenserCtrl);

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

            scrubberCondenserCtrl.ScrubberCondenser.StreamAttached += new StreamAttachedEventHandler(ScrubberCondenser_StreamAttached);
            scrubberCondenserCtrl.ScrubberCondenser.StreamDetached += new StreamDetachedEventHandler(ScrubberCondenser_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.ScrubberCondenserCtrl.ScrubberCondenser.CalculationType);
        }
コード例 #19
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);
        }