public void InitializeVariableTextBoxes(WaterStreamControl ctrl) { this.textBoxMassFlowRate.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.WaterStream.MassFlowRate); this.textBoxVolumeFlowRate.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.WaterStream.VolumeFlowRate); this.textBoxPressure.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.WaterStream.Pressure); this.textBoxTemperature.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.WaterStream.Temperature); this.textBoxEnthalpy.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.WaterStream.VaporFraction); this.textBoxEnthalpy.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.WaterStream.SpecificEnthalpy); this.textBoxSpecificHeat.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.WaterStream.SpecificHeat); this.textBoxDensity.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.WaterStream.Density); }
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 WaterStreamEditor(WaterStreamControl waterStreamCtrl) : base(waterStreamCtrl) { // // Required for Windows Form Designer support // InitializeComponent(); WaterStreamLabelsControl labelsCtrl = new WaterStreamLabelsControl(this.WaterStreamCtrl.WaterStream); this.panel.Controls.Add(labelsCtrl); labelsCtrl.Location = new Point(0, 24); WaterStreamValuesControl valuesCtrl = new WaterStreamValuesControl(this.WaterStreamCtrl); this.panel.Controls.Add(valuesCtrl); valuesCtrl.Location = new Point(192, 24); }
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 WaterStreamValuesControl(WaterStreamControl waterStreamCtrl) : this() { this.InitializeVariableTextBoxes(waterStreamCtrl); }