public MaterialStreamEditor(MaterialStreamControl materialStreamCtrl) : base(materialStreamCtrl) { // // Required for Windows Form Designer support // InitializeComponent(); MaterialStreamLabelsControl materialLabelsCtrl = new MaterialStreamLabelsControl(this.MaterialStreamCtrl.MaterialStream); this.panel.Controls.Add(materialLabelsCtrl); materialLabelsCtrl.Location = new Point(0, 24); MaterialStreamValuesControl materialValuesCtrl = new MaterialStreamValuesControl(this.MaterialStreamCtrl); this.panel.Controls.Add(materialValuesCtrl); materialValuesCtrl.Location = new Point(192, 24); if (this.MaterialStreamCtrl.MaterialStream.MaterialStateType == MaterialStateType.Liquid) { this.Text = "Material Stream (Liquid): " + this.solvableCtrl.Solvable.Name; } else if (this.MaterialStreamCtrl.MaterialStream.MaterialStateType == MaterialStateType.Solid) { this.Text = "Material Stream (Solid): " + this.solvableCtrl.Solvable.Name; } }
public ProcessStreamBaseControl GetProcessStreamBaseControl(string name) { ProcessStreamBaseControl psCtrl = null; IEnumerator e = this.flowsheet.Controls.GetEnumerator(); while (e.MoveNext()) { if (e.Current is SolvableControl) { SolvableControl sCtrl = (SolvableControl)e.Current; if (sCtrl is ProcessStreamBaseControl) { if (sCtrl is GasStreamControl) { GasStreamControl sc = (GasStreamControl)sCtrl; if (sc.GasStream.Name.Equals(name)) { psCtrl = sc; break; } } if (sCtrl is MaterialStreamControl) { MaterialStreamControl sc = (MaterialStreamControl)sCtrl; if (sc.MaterialStream.Name.Equals(name)) { psCtrl = sc; break; } } if (sCtrl is WaterStreamControl) { WaterStreamControl sc = (WaterStreamControl)sCtrl; if (sc.WaterStream.Name.Equals(name)) { psCtrl = sc; break; } } if (sCtrl is DetailedFuelStreamControl) { DetailedFuelStreamControl sc = (DetailedFuelStreamControl)sCtrl; if (sc.DetailedFuelStream.Name.Equals(name)) { psCtrl = sc; break; } } } } } return(psCtrl); }
public void InitializeVariableTextBoxes(MaterialStreamControl ctrl) { this.textBoxMassFlowRateDryBase.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.MassFlowRateDryBase); this.textBoxMassFlowRate.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.MassFlowRate); this.textBoxVolumeFlowRate.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.VolumeFlowRate); this.textBoxPressure.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.Pressure); this.textBoxTemperature.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.Temperature); this.textBoxMoistureContentDryBase.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.MoistureContentDryBase); this.textBoxMoistureContentWetBase.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.MoistureContentWetBase); this.textBoxConcentration.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.MassConcentration); this.textBoxSpecificHeat.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.SpecificHeat); this.textBoxSpecificHeatDryBase.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.SpecificHeatDryBase); this.textBoxDensity.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.Density); this.textBoxSpecificEnthalpy.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.SpecificEnthalpy); this.textBoxVaporFraction.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.MaterialStream.VaporFraction); }
public MaterialStreamControl GetShowableInEditorMaterialStreamControl(string name) { MaterialStreamControl ctrl = null; ArrayList ctrls = this.GetShowableInEditorMaterialStreamControls(); IEnumerator e = ctrls.GetEnumerator(); while (e.MoveNext()) { MaterialStreamControl ctrl2 = (MaterialStreamControl)e.Current; if (ctrl2.ProcessStreamBase.Name.Equals(name)) { ctrl = ctrl2; break; } } return(ctrl); }
private void EvaporationAndDryingSystem_StreamAdded(ProcessStreamBase processStreamBase) { Point location = new System.Drawing.Point(this.flowsheet.X, this.flowsheet.Y); ProcessStreamBaseControl control = null; if (processStreamBase is DryingGasStream) { DryingGasStream stream = (DryingGasStream)processStreamBase; control = new GasStreamControl(this.flowsheet, location, stream); } else if (processStreamBase is DryingMaterialStream) { DryingMaterialStream stream = (DryingMaterialStream)processStreamBase; control = new MaterialStreamControl(this.flowsheet, location, stream); } else if (processStreamBase is WaterStream) { WaterStream stream = (WaterStream)processStreamBase; control = new WaterStreamControl(this.flowsheet, location, stream); } else if (processStreamBase is DetailedFuelStream) { DetailedFuelStream stream = (DetailedFuelStream)processStreamBase; control = new DetailedFuelStreamControl(this.flowsheet, location, stream); } // adjust the location if at the limit of the flowsheet if (this.flowsheet.X > this.flowsheet.Width - control.Width / 2) { int newX = this.flowsheet.Width - control.Width; Point newLocation = new Point(newX, control.Location.Y); control.Location = newLocation; } if (this.flowsheet.Y > this.flowsheet.Height - control.Height / 2) { int newY = this.flowsheet.Height - control.Height; Point newLocation = new Point(control.Location.X, newY); control.Location = newLocation; } this.flowsheet.Controls.Add(control); this.flowsheet.IsDirty = true; }
public MaterialStreamValuesControl(MaterialStreamControl materialStreamCtrl) : this() { this.materialStreamCtrl = materialStreamCtrl; this.InitializeVariableTextBoxes(materialStreamCtrl); }