Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public void InitializeVariableTextBoxes(GasStreamControl ctrl)
 {
     this.textBoxMassFlowRateDry.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.MassFlowRateDryBase);
     this.textBoxMassFlowRate.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.MassFlowRate);
     this.textBoxVolumeFlowRate.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.VolumeFlowRate);
     this.textBoxPressure.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.Pressure);
     this.textBoxTemperature.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.Temperature);
     this.textBoxWetBulbTemperature.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.WetBulbTemperature);
     this.textBoxDewPoint.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.DewPoint);
     this.textBoxHumidity.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.Humidity);
     this.textBoxRelativeHumidity.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.RelativeHumidity);
     this.textBoxEnthalpy.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.SpecificEnthalpy);
     this.textBoxSpecificHeatDryBase.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.SpecificHeatDryBase);
     this.textBoxDensity.InitializeVariable(ctrl.Flowsheet.ApplicationPrefs, ctrl.GasStream.Density);
 }
Ejemplo n.º 3
0
        public GasStreamControl GetShowableInEditorGasStreamControl(string name)
        {
            GasStreamControl ctrl  = null;
            ArrayList        ctrls = this.GetShowableInEditorGasStreamControls();
            IEnumerator      e     = ctrls.GetEnumerator();

            while (e.MoveNext())
            {
                GasStreamControl ctrl2 = (GasStreamControl)e.Current;
                if (ctrl2.ProcessStreamBase.Name.Equals(name))
                {
                    ctrl = ctrl2;
                    break;
                }
            }
            return(ctrl);
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
        public GasStreamEditor(GasStreamControl gasStreamCtrl) : base(gasStreamCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            GasStreamLabelsControl gasLabelsCtrl = new GasStreamLabelsControl(this.GasStreamCtrl.GasStream);

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

            GasStreamValuesControl gasValuesCtrl = new GasStreamValuesControl(this.GasStreamCtrl);

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

            this.Text = "Gas Stream: " + this.solvableCtrl.Solvable.Name;
        }
Ejemplo n.º 6
0
 public GasStreamValuesControl(GasStreamControl gasStreamCtrl) : this()
 {
     this.InitializeVariableTextBoxes(gasStreamCtrl);
 }