private void UpdateStreamsUI() { // clear the streams boxes and start again this.groupBoxStreams.Controls.Clear(); FlashTank flashTank = this.FlashTankCtrl.FlashTank; bool hasInlet = false; bool hasVaporOut = false; bool hasLiquidOut = false; ProcessStreamBase inlet = flashTank.Inlet; if (inlet != null) { hasInlet = true; } ProcessStreamBase vaporOut = flashTank.VaporOutlet; if (vaporOut != null) { hasVaporOut = true; } ProcessStreamBase liquidOut = flashTank.LiquidOutlet; if (liquidOut != null) { hasLiquidOut = true; } if (hasInlet || hasVaporOut || hasLiquidOut) { ProcessStreamBase labelsStream = null; if (hasInlet) { labelsStream = inlet; } else if (hasVaporOut) { labelsStream = vaporOut; } else if (hasLiquidOut) { labelsStream = liquidOut; } UserControl ctrl = null; if (labelsStream is ProcessStream) { ctrl = new ProcessStreamLabelsControl((ProcessStream)labelsStream); } else if (labelsStream is DryingGasStream) { ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream); } else if (labelsStream is DryingMaterialStream) { ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream); } this.groupBoxStreams.Controls.Add(ctrl); ctrl.Location = new Point(4, 12 + 20 + 2); } if (hasInlet) { UserControl ctrl = null; if (inlet is ProcessStream) { ProcessStreamControl processInCtrl = (ProcessStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.Inlet.Name); ctrl = new ProcessStreamValuesControl(processInCtrl); } else if (inlet is DryingGasStream) { GasStreamControl gasInCtrl = (GasStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.Inlet.Name); ctrl = new GasStreamValuesControl(gasInCtrl); } else if (inlet is DryingMaterialStream) { MaterialStreamControl matInCtrl = (MaterialStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.Inlet.Name); ctrl = new MaterialStreamValuesControl(matInCtrl); } this.groupBoxStreams.Controls.Add(ctrl); ctrl.Location = new Point(196, 12 + 20 + 2); this.textBoxInName.SetSolvable(flashTank.Inlet); this.groupBoxStreams.Controls.Add(this.textBoxInName); this.textBoxInName.Text = flashTank.Inlet.Name; UI.SetStatusColor(this.textBoxInName, flashTank.Inlet.SolveState); } if (hasVaporOut) { UserControl ctrl = null; if (vaporOut is ProcessStream) { ProcessStreamControl processOutCtrl = (ProcessStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.VaporOutlet.Name); ctrl = new ProcessStreamValuesControl(processOutCtrl); } else if (vaporOut is DryingGasStream) { GasStreamControl gasOutCtrl = (GasStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.VaporOutlet.Name); ctrl = new GasStreamValuesControl(gasOutCtrl); } else if (vaporOut is DryingMaterialStream) { MaterialStreamControl matOutCtrl = (MaterialStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.VaporOutlet.Name); ctrl = new MaterialStreamValuesControl(matOutCtrl); } this.groupBoxStreams.Controls.Add(ctrl); ctrl.Location = new Point(276, 12 + 20 + 2); this.textBoxVaporOutName.SetSolvable(flashTank.VaporOutlet); this.groupBoxStreams.Controls.Add(this.textBoxVaporOutName); this.textBoxVaporOutName.Text = flashTank.VaporOutlet.Name; UI.SetStatusColor(this.textBoxVaporOutName, flashTank.VaporOutlet.SolveState); } if (hasLiquidOut) { UserControl ctrl = null; if (liquidOut is ProcessStream) { ProcessStreamControl processOutCtrl = (ProcessStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name); ctrl = new ProcessStreamValuesControl(processOutCtrl); } else if (liquidOut is DryingGasStream) { GasStreamControl gasOutCtrl = (GasStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name); ctrl = new GasStreamValuesControl(gasOutCtrl); } else if (liquidOut is DryingMaterialStream) { MaterialStreamControl matOutCtrl = (MaterialStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name); ctrl = new MaterialStreamValuesControl(matOutCtrl); } this.groupBoxStreams.Controls.Add(ctrl); ctrl.Location = new Point(356, 12 + 20 + 2); this.textBoxLiquidOutName.SetSolvable(flashTank.LiquidOutlet); this.groupBoxStreams.Controls.Add(this.textBoxLiquidOutName); this.textBoxLiquidOutName.Text = flashTank.LiquidOutlet.Name; UI.SetStatusColor(this.textBoxLiquidOutName, flashTank.LiquidOutlet.SolveState); } }
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); } }
private void UpdateTheUI() { this.panel.Visible = false; this.userCtrlFractions.Visible = false; this.userCtrlFractions.Controls.Clear(); this.groupBoxStreams.Visible = false; this.groupBoxStreams.Controls.Clear(); this.outletControls.Clear(); int x = INITIAL_LOCATION; int w = VALUE_WIDTH; int s = INITIAL_GROUPBOX_WIDTH; int p = INITIAL_FORM_WIDTH; Tee tee = this.TeeCtrl.Tee; bool hasStreamIn = false; bool hasStreamOut = false; ProcessStreamBase streamOut = null; if (tee.OutletStreams.Count > 0) { hasStreamOut = true; streamOut = (ProcessStreamBase)tee.OutletStreams[0]; this.userCtrlFractions.Visible = true; } ProcessStreamBase streamIn = tee.Inlet; if (streamIn != null) { hasStreamIn = true; } if (hasStreamIn || hasStreamOut) { this.groupBoxStreams.Visible = true; ProcessStreamBase labelsStream = null; if (hasStreamIn) { labelsStream = streamIn; } else if (hasStreamOut) { labelsStream = streamOut; } UserControl ctrl = null; if (labelsStream is ProcessStream) { ctrl = new ProcessStreamLabelsControl((ProcessStream)labelsStream); } else if (labelsStream is DryingGasStream) { ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream); } else if (labelsStream is DryingMaterialStream) { ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream); } ctrl.Location = new Point(4, 12 + 20 + 2); this.groupBoxStreams.Size = new Size(s, this.groupBoxHeight); this.groupBoxFractions.Location = new System.Drawing.Point(this.groupBoxStreams.Width + 4, 24); this.groupBoxStreams.Controls.Add(ctrl); s = s + w; p = p + w; } if (hasStreamIn) { UserControl ctrl = null; if (streamIn is ProcessStream) { ProcessStreamControl processInCtrl = (ProcessStreamControl)this.TeeCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(streamIn.Name); ctrl = new ProcessStreamValuesControl(processInCtrl); } else if (streamOut is DryingGasStream) { GasStreamControl gasInCtrl = (GasStreamControl)this.TeeCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(streamIn.Name); ctrl = new GasStreamValuesControl(gasInCtrl); } else if (streamOut is DryingMaterialStream) { MaterialStreamControl materialInCtrl = (MaterialStreamControl)this.TeeCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(streamIn.Name); ctrl = new MaterialStreamValuesControl(materialInCtrl); } ctrl.Location = new Point(x, 12 + 20 + 2); this.groupBoxStreams.Size = new Size(s, this.groupBoxHeight); this.groupBoxFractions.Location = new System.Drawing.Point(this.groupBoxStreams.Width + 4, 24); this.groupBoxStreams.Controls.Add(ctrl); this.Size = new Size(p, this.formHeight); this.textBoxStreamInName.Text = streamIn.Name; this.textBoxStreamInName.Location = new Point(x, 12); this.textBoxStreamInName.SetSolvable(streamIn); this.groupBoxStreams.Controls.Add(this.textBoxStreamInName); UI.SetStatusColor(this.textBoxStreamInName, streamIn.SolveState); } if (hasStreamOut) { IEnumerator e = tee.OutletStreams.GetEnumerator(); while (e.MoveNext()) { s = s + w; x = x + w; p = p + w; ProcessStreamBase processStreamBase = (ProcessStreamBase)e.Current; UserControl ctrl = null; if (processStreamBase is ProcessStream) { ProcessStreamControl processOutCtrl = (ProcessStreamControl)this.TeeCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(processStreamBase.Name); ctrl = new ProcessStreamValuesControl(processOutCtrl); } else if (processStreamBase is DryingGasStream) { GasStreamControl gasOutCtrl = (GasStreamControl)this.TeeCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(processStreamBase.Name); ctrl = new GasStreamValuesControl(gasOutCtrl); } else if (processStreamBase is DryingMaterialStream) { MaterialStreamControl materialOutCtrl = (MaterialStreamControl)this.TeeCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(processStreamBase.Name); ctrl = new MaterialStreamValuesControl(materialOutCtrl); } ctrl.Location = new Point(x, 12 + 20 + 2); this.groupBoxStreams.Size = new Size(s, this.groupBoxHeight); this.groupBoxFractions.Location = new System.Drawing.Point(this.groupBoxStreams.Width + 4, 24); this.groupBoxStreams.Controls.Add(ctrl); this.Size = new Size(p, this.formHeight); ProsimoUI.SolvableNameTextBox textBoxStreamOutName = new ProsimoUI.SolvableNameTextBox(processStreamBase); textBoxStreamOutName.Width = 80; textBoxStreamOutName.Height = 20; textBoxStreamOutName.Text = processStreamBase.Name; textBoxStreamOutName.Location = new Point(x, 12); this.outletControls.Add(textBoxStreamOutName, textBoxStreamOutName.Text); this.groupBoxStreams.Controls.Add(textBoxStreamOutName); UI.SetStatusColor(textBoxStreamOutName, processStreamBase.SolveState); } // build the fractions for (int i = 0; i < this.TeeCtrl.Tee.OutletStreamAndFractions.Count; i++) { StreamAndFraction sf = (StreamAndFraction)this.TeeCtrl.Tee.OutletStreamAndFractions[i]; TeeStreamAndFractionControl sfCtrl = new TeeStreamAndFractionControl(this.TeeCtrl.Flowsheet, sf); sfCtrl.Location = new Point(0, i * sfCtrl.Height); this.userCtrlFractions.Controls.Add(sfCtrl); sfCtrl.textBoxFraction.KeyUp += new KeyEventHandler(KeyUpNavigator); } } this.Size = new Size(p + this.groupBoxFractions.Width, this.formHeight); this.panel.Visible = true; }
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; if (motiveIn != null) { hasMotiveIn = true; } ProcessStreamBase suctionIn = ejector.SuctionInlet; if (suctionIn != null) { hasSuctionIn = true; } ProcessStreamBase dischargeOut = ejector.DischargeOutlet; if (dischargeOut != null) { hasDischargeOut = true; } 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 ProcessStream) { ctrl = new ProcessStreamLabelsControl((ProcessStream)labelsStream); } else if (labelsStream is DryingGasStream) { ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream); } else if (labelsStream is DryingMaterialStream) { ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream); } this.groupBoxMotiveSuction.Controls.Add(ctrl); ctrl.Location = new Point(4, 12 + 20 + 2); } if (hasMotiveIn) { UserControl ctrl = null; if (motiveIn is ProcessStream) { ProcessStreamControl processInCtrl = (ProcessStreamControl)this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.MotiveInlet.Name); ctrl = new ProcessStreamValuesControl(processInCtrl); } else if (motiveIn is DryingGasStream) { GasStreamControl gasInCtrl = (GasStreamControl)this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.MotiveInlet.Name); ctrl = new GasStreamValuesControl(gasInCtrl); } else if (motiveIn is DryingMaterialStream) { MaterialStreamControl materialInCtrl = (MaterialStreamControl)this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.MotiveInlet.Name); ctrl = new MaterialStreamValuesControl(materialInCtrl); } 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) { UserControl ctrl = null; if (suctionIn is ProcessStream) { ProcessStreamControl processInCtrl = (ProcessStreamControl)this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.SuctionInlet.Name); ctrl = new ProcessStreamValuesControl(processInCtrl); } else if (suctionIn is DryingGasStream) { GasStreamControl gasInCtrl = (GasStreamControl)this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.SuctionInlet.Name); ctrl = new GasStreamValuesControl(gasInCtrl); } else if (suctionIn is DryingMaterialStream) { MaterialStreamControl materialInCtrl = (MaterialStreamControl)this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.SuctionInlet.Name); ctrl = new MaterialStreamValuesControl(materialInCtrl); } 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) { UserControl ctrl = null; if (dischargeOut is ProcessStream) { ProcessStreamControl processOutCtrl = (ProcessStreamControl)this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.DischargeOutlet.Name); ctrl = new ProcessStreamValuesControl(processOutCtrl); } else if (dischargeOut is DryingMaterialStream) { MaterialStreamControl matOutCtrl = (MaterialStreamControl)this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.DischargeOutlet.Name); ctrl = new MaterialStreamValuesControl(matOutCtrl); } else if (dischargeOut is DryingGasStream) { GasStreamControl gasOutCtrl = (GasStreamControl)this.EjectorCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.EjectorCtrl.Ejector.DischargeOutlet.Name); ctrl = new GasStreamValuesControl(gasOutCtrl); } 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); } }
private void UpdateStreamsUI() { // clear the streams boxes and start again this.groupBoxMixtureFluid.Controls.Clear(); this.groupBoxParticle.Controls.Clear(); Cyclone cyclone = this.CycloneCtrl.Cyclone; bool hasGasIn = false; bool hasGasOut = false; bool hasParticleOut = false; ProcessStreamBase mixtureIn = cyclone.GasInlet; hasGasIn = mixtureIn != null; ProcessStreamBase fluidOut = cyclone.GasOutlet; hasGasOut = fluidOut != null; ProcessStreamBase particleOut = cyclone.ParticleOutlet; if (particleOut != null) { hasParticleOut = true; } if (hasGasIn || hasGasOut) { ProcessStreamBase labelsStream = hasGasIn ? mixtureIn : fluidOut; UserControl ctrl = null; //UserControl ctrl = new ProcessVarLabelsControl(labelsStream.VarList); if (labelsStream is DryingGasStream) { ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream); } this.groupBoxMixtureFluid.Controls.Add(ctrl); ctrl.Location = new Point(4, 12 + 20 + 2); } if (hasGasIn) { ProcessStreamBaseControl gasInCtrl = this.CycloneCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.CycloneCtrl.Cyclone.GasInlet.Name); //UserControl ctrl = new ProcessVarValuesControl(gasInCtrl); UserControl ctrl = new GasStreamValuesControl((GasStreamControl)gasInCtrl); this.groupBoxMixtureFluid.Controls.Add(ctrl); ctrl.Location = new Point(196, 12 + 20 + 2); this.textBoxGasInName.SetSolvable(cyclone.GasInlet); this.groupBoxMixtureFluid.Controls.Add(this.textBoxGasInName); this.textBoxGasInName.Text = cyclone.GasInlet.Name; UI.SetStatusColor(this.textBoxGasInName, cyclone.GasInlet.SolveState); } if (hasGasOut) { ProcessStreamBaseControl gasOutCtrl = this.CycloneCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.CycloneCtrl.Cyclone.GasOutlet.Name); //UserControl ctrl = new ProcessVarValuesControl(gasOutCtrl); UserControl ctrl = new GasStreamValuesControl((GasStreamControl)gasOutCtrl); this.groupBoxMixtureFluid.Controls.Add(ctrl); ctrl.Location = new Point(276, 12 + 20 + 2); this.textBoxGasOutName.SetSolvable(cyclone.GasOutlet); this.groupBoxMixtureFluid.Controls.Add(this.textBoxGasOutName); this.textBoxGasOutName.Text = cyclone.GasOutlet.Name; UI.SetStatusColor(this.textBoxGasOutName, cyclone.GasOutlet.SolveState); } if (hasParticleOut) { // add the labels UserControl ctrl = null; if (particleOut is DryingMaterialStream) { ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)particleOut); //ctrl = new ProcessVarLabelsControl(particleOut.VarList); } this.groupBoxParticle.Controls.Add(ctrl); ctrl.Location = new Point(4, 12 + 20 + 2); // add the values ProcessStreamBaseControl matOutCtrl = this.CycloneCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.CycloneCtrl.Cyclone.ParticleOutlet.Name); if (particleOut is DryingMaterialStream) { //ctrl = new ProcessVarValuesControl(matOutCtrl); ctrl = new MaterialStreamValuesControl((MaterialStreamControl)matOutCtrl); } this.groupBoxParticle.Controls.Add(ctrl); ctrl.Location = new Point(196, 12 + 20 + 2); this.textBoxParticleOutName.SetSolvable(cyclone.ParticleOutlet); this.groupBoxParticle.Controls.Add(this.textBoxParticleOutName); this.textBoxParticleOutName.Text = cyclone.ParticleOutlet.Name; UI.SetStatusColor(this.textBoxParticleOutName, cyclone.ParticleOutlet.SolveState); } }
protected override void UpdateStreamsUI() { // clear the streams boxes and start again this.groupBoxAirInlet.Controls.Clear(); this.groupBoxFuelInlet.Controls.Clear(); Burner burner = this.BurnerCtrl.Burner; bool hasAirIn = false; bool hasFuelIn = false; bool hasFlueGasOut = false; ProcessStreamBase airIn = burner.AirInlet; hasAirIn = airIn != null; ProcessStreamBase fuelIn = burner.FuelInlet; hasFuelIn = fuelIn != null; ProcessStreamBase flueGasOut = burner.FlueGasOutlet; hasFlueGasOut = flueGasOut != null; if (fuelIn != null) { //ProcessVarLabelsControl ctrl = new ProcessVarLabelsControl(fuelIn.VarList); //ctrl.Location = new Point(4, 12 + 20 + 2); //this.groupBoxFuelInlet.Controls.Add(ctrl); //ProcessStreamBaseControl baseCtrl = this.BurnerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.BurnerCtrl.Burner.FuelInlet.Name); //ProcessVarValuesControl valuesCtrl = new ProcessVarValuesControl(baseCtrl); //this.groupBoxFuelInlet.Controls.Add(valuesCtrl); //valuesCtrl.Location = new Point(196, 12 + 20 + 2); ProcessStreamBaseControl baseCtrl = this.BurnerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.BurnerCtrl.Burner.FuelInlet.Name); DetailedFuelStreamLabelAndValuesControl fuelLableValuesControl = new DetailedFuelStreamLabelAndValuesControl(baseCtrl as DetailedFuelStreamControl); fuelLableValuesControl.Location = new Point(4, 12 + 20 + 2); this.groupBoxFuelInlet.Controls.Add(fuelLableValuesControl); this.textBoxFuelInName.SetSolvable(burner.FuelInlet); this.groupBoxFuelInlet.Controls.Add(this.textBoxFuelInName); this.textBoxAirInName.Text = burner.FuelInlet.Name; UI.SetStatusColor(this.textBoxFuelInName, burner.FuelInlet.SolveState); } if (hasAirIn || hasFlueGasOut) { ProcessStreamBase labelsStream = hasAirIn ? airIn : flueGasOut; GasStreamLabelsControl gasLabelsCtrl = new GasStreamLabelsControl(labelsStream as DryingGasStream); this.groupBoxAirInlet.Controls.Add(gasLabelsCtrl); gasLabelsCtrl.Location = new Point(4, 12 + 20 + 2); } if (hasAirIn) { ProcessStreamBaseControl airInCtrl = this.BurnerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.BurnerCtrl.Burner.AirInlet.Name); GasStreamValuesControl airInValuesCtrl = new GasStreamValuesControl((GasStreamControl)airInCtrl); this.groupBoxAirInlet.Controls.Add(airInValuesCtrl); airInValuesCtrl.Location = new Point(196, 12 + 20 + 2); this.textBoxAirInName.SetSolvable(burner.AirInlet); this.groupBoxAirInlet.Controls.Add(this.textBoxAirInName); this.textBoxAirInName.Text = burner.AirInlet.Name; UI.SetStatusColor(this.textBoxAirInName, burner.AirInlet.SolveState); } if (hasFlueGasOut) { ProcessStreamBaseControl flueGasOutCtrl = this.BurnerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.BurnerCtrl.Burner.FlueGasOutlet.Name); GasStreamValuesControl flueGasOutValuesCtrl = new GasStreamValuesControl((GasStreamControl)flueGasOutCtrl); this.groupBoxAirInlet.Controls.Add(flueGasOutValuesCtrl); flueGasOutValuesCtrl.Location = new Point(276, 12 + 20 + 2); this.textBoxFlueGasOutName.SetSolvable(burner.FlueGasOutlet); this.groupBoxAirInlet.Controls.Add(this.textBoxFlueGasOutName); this.textBoxFlueGasOutName.Text = burner.FlueGasOutlet.Name; UI.SetStatusColor(this.textBoxFlueGasOutName, burner.FlueGasOutlet.SolveState); } }
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; if (gasIn != null) { hasGasIn = true; } ProcessStreamBase gasOut = wetScrubber.GasOutlet; if (gasOut != null) { hasGasOut = true; } ProcessStreamBase liquidIn = wetScrubber.LiquidInlet; if (liquidIn != null) { hasLiquidIn = true; } ProcessStreamBase liquidOut = wetScrubber.LiquidOutlet; if (liquidOut != null) { hasLiquidOut = true; } if (hasGasIn || hasGasOut) { ProcessStreamBase labelsStream = null; if (hasGasIn) { labelsStream = gasIn; } else if (hasGasOut) { labelsStream = gasOut; } UserControl ctrl = null; if (labelsStream is ProcessStream) { ctrl = new ProcessStreamLabelsControl((ProcessStream)labelsStream); } else if (labelsStream is DryingGasStream) { ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream); } else if (labelsStream is DryingMaterialStream) { ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream); } this.groupBoxGasStream.Controls.Add(ctrl); ctrl.Location = new Point(4, 12 + 20 + 2); } if (hasGasIn) { UserControl ctrl = null; ProcessStreamBaseControl baseCtrl = (ProcessStreamBaseControl)this.WetScrubberCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.WetScrubberCtrl.WetScrubber.GasInlet.Name); if (gasIn is ProcessStream) { ProcessStreamControl processInCtrl = baseCtrl as ProcessStreamControl; ctrl = new ProcessStreamValuesControl(processInCtrl); } else if (gasIn is DryingGasStream) { GasStreamControl gasInCtrl = baseCtrl as GasStreamControl; ctrl = new GasStreamValuesControl(gasInCtrl); } else if (gasIn is DryingMaterialStream) { MaterialStreamControl matInCtrl = baseCtrl as MaterialStreamControl; ctrl = new MaterialStreamValuesControl(matInCtrl); } 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 = (ProcessStreamBaseControl)this.WetScrubberCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.WetScrubberCtrl.WetScrubber.GasOutlet.Name); UserControl ctrl = null; if (gasOut is ProcessStream) { ProcessStreamControl processOutCtrl = baseCtrl as ProcessStreamControl; ctrl = new ProcessStreamValuesControl(processOutCtrl); } else if (gasOut is DryingGasStream) { GasStreamControl gasOutCtrl = baseCtrl as GasStreamControl; ctrl = new GasStreamValuesControl(gasOutCtrl); } else if (gasOut is DryingMaterialStream) { MaterialStreamControl matOutCtrl = baseCtrl as MaterialStreamControl; ctrl = new MaterialStreamValuesControl(matOutCtrl); } 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 ProcessStream) { ctrl = new ProcessStreamLabelsControl((ProcessStream)labelsStream); } else if (labelsStream is DryingGasStream) { ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream); } else if (labelsStream is DryingMaterialStream) { ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream); } this.groupBoxLiquidStream.Controls.Add(ctrl); ctrl.Location = new Point(4, 12 + 20 + 2); } if (hasLiquidIn) { UserControl ctrl = null; ProcessStreamBaseControl baseCtrl = (ProcessStreamBaseControl)this.WetScrubberCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.WetScrubberCtrl.WetScrubber.LiquidInlet.Name); if (liquidIn is ProcessStream) { ProcessStreamControl processInCtrl = baseCtrl as ProcessStreamControl; ctrl = new ProcessStreamValuesControl(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); } 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 = (ProcessStreamBaseControl)this.WetScrubberCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.WetScrubberCtrl.WetScrubber.LiquidOutlet.Name); UserControl ctrl = null; if (liquidOut is ProcessStream) { ProcessStreamControl processOutCtrl = baseCtrl as ProcessStreamControl; ctrl = new ProcessStreamValuesControl(processOutCtrl); } else if (liquidOut is DryingGasStream) { GasStreamControl gasOutCtrl = baseCtrl as GasStreamControl; ctrl = new GasStreamValuesControl(gasOutCtrl); } else if (liquidOut is DryingMaterialStream) { MaterialStreamControl matOutCtrl = baseCtrl as MaterialStreamControl; ctrl = new MaterialStreamValuesControl(matOutCtrl); } 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); } }
private void UpdateUI() { this.panel.Visible = false; this.groupBox.Visible = false; this.groupBox.Controls.Clear(); this.inletControls.Clear(); int x = INITIAL_LOCATION; int w = VALUE_WIDTH; int s = INITIAL_GROUPBOX_WIDTH; int p = INITIAL_FORM_WIDTH; Mixer mixer = this.MixerCtrl.Mixer; bool hasStreamIn = false; bool hasStreamOut = false; ProcessStreamBase streamIn = null; if (mixer.InletStreams.Count > 0) { hasStreamIn = true; streamIn = (ProcessStreamBase)mixer.InletStreams[0]; } ProcessStreamBase streamOut = mixer.Outlet; if (streamOut != null) { hasStreamOut = true; } if (hasStreamIn || hasStreamOut) { this.groupBox.Visible = true; ProcessStreamBase labelsStream = null; if (hasStreamIn) { labelsStream = streamIn; } else if (hasStreamOut) { labelsStream = streamOut; } UserControl ctrl = null; if (labelsStream is ProcessStream) { ctrl = new ProcessStreamLabelsControl((ProcessStream)labelsStream); } else if (labelsStream is DryingGasStream) { ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream); } else if (labelsStream is DryingMaterialStream) { ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream); } ctrl.Location = new Point(4, 12 + 20 + 2); this.groupBox.Size = new Size(s, this.groupBoxHeight); this.groupBox.Controls.Add(ctrl); this.Size = new Size(p, this.formHeight); s = s + w; p = p + w; } if (hasStreamIn) { IEnumerator e = mixer.InletStreams.GetEnumerator(); while (e.MoveNext()) { ProcessStreamBase processStreamBase = (ProcessStreamBase)e.Current; UserControl ctrl = null; if (processStreamBase is ProcessStream) { ProcessStreamControl processInCtrl = (ProcessStreamControl)this.MixerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(processStreamBase.Name); ctrl = new ProcessStreamValuesControl(processInCtrl); } else if (processStreamBase is DryingGasStream) { GasStreamControl gasInCtrl = (GasStreamControl)this.MixerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(processStreamBase.Name); ctrl = new GasStreamValuesControl(gasInCtrl); } else if (processStreamBase is DryingMaterialStream) { MaterialStreamControl materialInCtrl = (MaterialStreamControl)this.MixerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(processStreamBase.Name); ctrl = new MaterialStreamValuesControl(materialInCtrl); } ctrl.Location = new Point(x, 12 + 20 + 2); this.groupBox.Size = new Size(s, this.groupBoxHeight); this.groupBox.Controls.Add(ctrl); this.Size = new Size(p, this.formHeight); ProsimoUI.SolvableNameTextBox textBoxStreamInName = new ProsimoUI.SolvableNameTextBox(processStreamBase); textBoxStreamInName.Width = 80; textBoxStreamInName.Height = 20; textBoxStreamInName.Text = processStreamBase.Name; textBoxStreamInName.Location = new Point(x, 12); this.inletControls.Add(textBoxStreamInName, textBoxStreamInName.Text); this.groupBox.Controls.Add(textBoxStreamInName); UI.SetStatusColor(textBoxStreamInName, processStreamBase.SolveState); s = s + w; x = x + w; p = p + w; } } if (hasStreamOut) { UserControl ctrl = null; if (streamOut is ProcessStream) { ProcessStreamControl processOutCtrl = (ProcessStreamControl)this.MixerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(streamOut.Name); ctrl = new ProcessStreamValuesControl(processOutCtrl); } else if (streamOut is DryingGasStream) { GasStreamControl gasOutCtrl = (GasStreamControl)this.MixerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(streamOut.Name); ctrl = new GasStreamValuesControl(gasOutCtrl); } else if (streamOut is DryingMaterialStream) { MaterialStreamControl materialOutCtrl = (MaterialStreamControl)this.MixerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(streamOut.Name); ctrl = new MaterialStreamValuesControl(materialOutCtrl); } ctrl.Location = new Point(x, 12 + 20 + 2); this.groupBox.Size = new Size(s, this.groupBoxHeight); this.groupBox.Controls.Add(ctrl); this.Size = new Size(p, this.formHeight); textBoxStreamOutName.Text = streamOut.Name; textBoxStreamOutName.Location = new Point(x, 12); this.textBoxStreamOutName.SetSolvable(streamOut); this.groupBox.Controls.Add(this.textBoxStreamOutName); UI.SetStatusColor(this.textBoxStreamOutName, streamOut.SolveState); } this.panel.Visible = true; }
private void UpdateStreamsUI() { // clear the stream group-boxes and start again this.groupBoxDryingMedium.Controls.Clear(); this.groupBoxMaterial.Controls.Clear(); Dryer dryer = this.DryerCtrl.Dryer; bool hasGasIn = false; bool hasGasOut = false; bool hasMaterialIn = false; bool hasMaterialOut = false; DryingGasStream gasIn = dryer.GasInlet; if (gasIn != null) { hasGasIn = true; } DryingGasStream gasOut = dryer.GasOutlet; if (gasOut != null) { hasGasOut = true; } DryingMaterialStream materialIn = dryer.MaterialInlet; if (materialIn != null) { hasMaterialIn = true; } DryingMaterialStream materialOut = dryer.MaterialOutlet; if (materialOut != null) { hasMaterialOut = true; } if (hasGasIn || hasGasOut) { DryingGasStream labelsStream = null; if (hasGasIn) { labelsStream = gasIn; } else if (hasGasOut) { labelsStream = gasOut; } gasLabelsCtrl = new GasStreamLabelsControl(labelsStream); this.groupBoxDryingMedium.Controls.Add(gasLabelsCtrl); gasLabelsCtrl.Location = new Point(4, 12 + 20 + 2); } if (hasGasIn) { GasStreamControl gasInCtrl = (GasStreamControl)this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.GasInlet.Name); gasValuesInCtrl = new GasStreamValuesControl(gasInCtrl); this.groupBoxDryingMedium.Controls.Add(gasValuesInCtrl); gasValuesInCtrl.Location = new Point(196, 12 + 20 + 2); this.textBoxGasInName.SetSolvable(dryer.GasInlet); this.groupBoxDryingMedium.Controls.Add(this.textBoxGasInName); this.textBoxGasInName.Text = dryer.GasInlet.Name; UI.SetStatusColor(this.textBoxGasInName, dryer.GasInlet.SolveState); } if (hasGasOut) { GasStreamControl gasOutCtrl = (GasStreamControl)this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.GasOutlet.Name); gasValuesOutCtrl = new GasStreamValuesControl(gasOutCtrl); this.groupBoxDryingMedium.Controls.Add(gasValuesOutCtrl); gasValuesOutCtrl.Location = new Point(276, 12 + 20 + 2); this.textBoxGasOutName.SetSolvable(dryer.GasOutlet); this.groupBoxDryingMedium.Controls.Add(this.textBoxGasOutName); this.textBoxGasOutName.Text = dryer.GasOutlet.Name; UI.SetStatusColor(this.textBoxGasOutName, dryer.GasOutlet.SolveState); } if (hasMaterialIn || hasMaterialOut) { DryingMaterialStream labelsStream = null; if (hasMaterialIn) { labelsStream = materialIn; } else if (hasMaterialOut) { labelsStream = materialOut; } materialLabelsCtrl = new MaterialStreamLabelsControl(labelsStream); this.groupBoxMaterial.Controls.Add(materialLabelsCtrl); materialLabelsCtrl.Location = new Point(4, 12 + 20 + 2); } if (hasMaterialIn) { MaterialStreamControl materialInCtrl = (MaterialStreamControl)this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.MaterialInlet.Name); materialValuesInCtrl = new MaterialStreamValuesControl(materialInCtrl); this.groupBoxMaterial.Controls.Add(materialValuesInCtrl); materialValuesInCtrl.Location = new Point(196, 12 + 20 + 2); this.textBoxMaterialInName.SetSolvable(dryer.MaterialInlet); this.groupBoxMaterial.Controls.Add(this.textBoxMaterialInName); this.textBoxMaterialInName.Text = dryer.MaterialInlet.Name; UI.SetStatusColor(this.textBoxMaterialInName, dryer.MaterialInlet.SolveState); } if (hasMaterialOut) { MaterialStreamControl materialOutCtrl = (MaterialStreamControl)this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.MaterialOutlet.Name); materialValuesOutCtrl = new MaterialStreamValuesControl(materialOutCtrl); this.groupBoxMaterial.Controls.Add(materialValuesOutCtrl); materialValuesOutCtrl.Location = new Point(276, 12 + 20 + 2); this.textBoxMaterialOutName.SetSolvable(dryer.MaterialOutlet); this.groupBoxMaterial.Controls.Add(this.textBoxMaterialOutName); this.textBoxMaterialOutName.Text = dryer.MaterialOutlet.Name; UI.SetStatusColor(this.textBoxMaterialOutName, dryer.MaterialOutlet.SolveState); } }
//private void Dryer_StreamAttached(UnitOperation uo, ProcessStreamBase ps, int desc) { // this.UpdateStreamsUI(); //} //private void Dryer_StreamDetached(UnitOperation uo, ProcessStreamBase ps) { // this.UpdateStreamsUI(); //} protected override void UpdateStreamsUI() { // clear the stream group-boxes and start again this.groupBoxDryingMedium.Controls.Clear(); this.groupBoxMaterial.Controls.Clear(); Dryer dryer = this.DryerCtrl.Dryer; bool hasGasIn = false; bool hasGasOut = false; bool hasMaterialIn = false; bool hasMaterialOut = false; DryingGasStream gasIn = dryer.GasInlet; hasGasIn = gasIn != null; DryingGasStream gasOut = dryer.GasOutlet; hasGasOut = gasOut != null; DryingMaterialStream materialIn = dryer.MaterialInlet; hasMaterialIn = materialIn != null; DryingMaterialStream materialOut = dryer.MaterialOutlet; hasMaterialOut = materialOut != null; if (hasGasIn || hasGasOut) { DryingGasStream labelsStream = hasGasIn ? gasIn : gasOut; //gasLabelsCtrl = new ProcessVarLabelsControl(labelsStream.VarList); gasLabelsCtrl = new GasStreamLabelsControl(labelsStream); this.groupBoxDryingMedium.Controls.Add(gasLabelsCtrl); gasLabelsCtrl.Location = new Point(4, 12 + 20 + 2); } if (hasGasIn) { ProcessStreamBaseControl gasInCtrl = this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.GasInlet.Name); //gasValuesInCtrl = new ProcessVarValuesControl(gasInCtrl); gasValuesInCtrl = new GasStreamValuesControl((GasStreamControl)gasInCtrl); this.groupBoxDryingMedium.Controls.Add(gasValuesInCtrl); gasValuesInCtrl.Location = new Point(196, 12 + 20 + 2); this.textBoxGasInName.SetSolvable(dryer.GasInlet); this.groupBoxDryingMedium.Controls.Add(this.textBoxGasInName); this.textBoxGasInName.Text = dryer.GasInlet.Name; UI.SetStatusColor(this.textBoxGasInName, dryer.GasInlet.SolveState); } if (hasGasOut) { ProcessStreamBaseControl gasOutCtrl = this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.GasOutlet.Name); //gasValuesOutCtrl = new ProcessVarValuesControl(gasOutCtrl); gasValuesOutCtrl = new GasStreamValuesControl((GasStreamControl)gasOutCtrl); this.groupBoxDryingMedium.Controls.Add(gasValuesOutCtrl); gasValuesOutCtrl.Location = new Point(276, 12 + 20 + 2); this.textBoxGasOutName.SetSolvable(dryer.GasOutlet); this.groupBoxDryingMedium.Controls.Add(this.textBoxGasOutName); this.textBoxGasOutName.Text = dryer.GasOutlet.Name; UI.SetStatusColor(this.textBoxGasOutName, dryer.GasOutlet.SolveState); } if (hasMaterialIn || hasMaterialOut) { DryingMaterialStream labelsStream = hasMaterialIn ? materialIn : materialOut; //materialLabelsCtrl = new ProcessVarLabelsControl(labelsStream.VarList); materialLabelsCtrl = new MaterialStreamLabelsControl(labelsStream); this.groupBoxMaterial.Controls.Add(materialLabelsCtrl); materialLabelsCtrl.Location = new Point(4, 12 + 20 + 2); } if (hasMaterialIn) { ProcessStreamBaseControl materialInCtrl = this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.MaterialInlet.Name); //materialValuesInCtrl = new ProcessVarValuesControl(materialInCtrl); materialValuesInCtrl = new MaterialStreamValuesControl((MaterialStreamControl)materialInCtrl); this.groupBoxMaterial.Controls.Add(materialValuesInCtrl); materialValuesInCtrl.Location = new Point(196, 12 + 20 + 2); this.textBoxMaterialInName.SetSolvable(dryer.MaterialInlet); this.groupBoxMaterial.Controls.Add(this.textBoxMaterialInName); this.textBoxMaterialInName.Text = dryer.MaterialInlet.Name; UI.SetStatusColor(this.textBoxMaterialInName, dryer.MaterialInlet.SolveState); } if (hasMaterialOut) { ProcessStreamBaseControl materialOutCtrl = this.DryerCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.DryerCtrl.Dryer.MaterialOutlet.Name); //materialValuesOutCtrl = new ProcessVarValuesControl(materialOutCtrl); materialValuesOutCtrl = new MaterialStreamValuesControl((MaterialStreamControl)materialOutCtrl); this.groupBoxMaterial.Controls.Add(materialValuesOutCtrl); materialValuesOutCtrl.Location = new Point(276, 12 + 20 + 2); this.textBoxMaterialOutName.SetSolvable(dryer.MaterialOutlet); this.groupBoxMaterial.Controls.Add(this.textBoxMaterialOutName); this.textBoxMaterialOutName.Text = dryer.MaterialOutlet.Name; UI.SetStatusColor(this.textBoxMaterialOutName, dryer.MaterialOutlet.SolveState); } }
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); } }
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); } }
//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); } }
protected override void UpdateStreamsUI() { // clear the streams boxes and start again this.groupBoxStreams.Controls.Clear(); BagFilter bagFilter = this.BagFilterCtrl.BagFilter; bool hasStreamIn = false; bool hasStreamOut = false; bool hasParticleOut = false; ProcessStreamBase streamIn = bagFilter.GasInlet; hasStreamIn = streamIn != null; ProcessStreamBase streamOut = bagFilter.GasOutlet; hasStreamOut = streamOut != null; ProcessStreamBase particleOut = bagFilter.ParticleOutlet; if (particleOut != null) { hasParticleOut = true; } if (hasStreamIn || hasStreamOut) { ProcessStreamBase labelsStream = hasStreamIn ? streamIn : streamOut; UserControl ctrl = null; if (labelsStream is DryingGasStream) { ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream); } //UserControl ctrl = new ProcessVarLabelsControl(labelsStream.VarList); this.groupBoxStreams.Controls.Add(ctrl); ctrl.Location = new Point(4, 12 + 20 + 2); } if (hasStreamIn && streamIn is DryingGasStream) { GasStreamControl gasInCtrl = (GasStreamControl)this.BagFilterCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.BagFilterCtrl.BagFilter.GasInlet.Name); UserControl ctrl = new GasStreamValuesControl(gasInCtrl); 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 = bagFilter.Inlet.Name; UI.SetStatusColor(this.textBoxStreamInName, bagFilter.Inlet.SolveState); } if (hasStreamOut && streamOut is DryingGasStream) { ProcessStreamBaseControl baseControl = this.BagFilterCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.BagFilterCtrl.BagFilter.GasOutlet.Name); GasStreamControl gasOutCtrl = (GasStreamControl)this.BagFilterCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.BagFilterCtrl.BagFilter.GasOutlet.Name); UserControl ctrl = new GasStreamValuesControl(gasOutCtrl); 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 = bagFilter.Outlet.Name; UI.SetStatusColor(this.textBoxStreamOutName, bagFilter.Outlet.SolveState); } if (hasParticleOut && particleOut is DryingMaterialStream) { // add the labels UserControl ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)particleOut); this.groupBoxParticle.Controls.Add(ctrl); ctrl.Location = new Point(4, 12 + 20 + 2); // add the values ProcessStreamBaseControl matOutCtrl = this.BagFilterCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.BagFilterCtrl.BagFilter.ParticleOutlet.Name); //ctrl = new ProcessVarValuesControl(matOutCtrl); ctrl = new MaterialStreamValuesControl((MaterialStreamControl)matOutCtrl); this.groupBoxParticle.Controls.Add(ctrl); ctrl.Location = new Point(196, 12 + 20 + 2); this.textBoxParticleOutName.SetSolvable(bagFilter.ParticleOutlet); this.groupBoxParticle.Controls.Add(this.textBoxParticleOutName); this.textBoxParticleOutName.Text = bagFilter.ParticleOutlet.Name; UI.SetStatusColor(this.textBoxParticleOutName, bagFilter.ParticleOutlet.SolveState); } }