Esempio n. 1
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;
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        private void InitializeDryingFuelComboBox(DetailedFuelStreamControl streamCtrl)
        {
            ArrayList dryingFuels = fuelCatalog.GetFossilFuelList();
            int       index       = 0;

            for (int i = 0; i < dryingFuels.Count; i++)
            {
                FossilFuel fuel = dryingFuels[i] as FossilFuel;
                if (fuel.Name == streamCtrl.DetailedFuelStream.DryingFuel.Name)
                {
                    index = i;
                    break;
                }
            }
            this.comboBoxDryingFuelSelection.SelectedIndex = index;
        }
Esempio 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;
        }
Esempio n. 5
0
        public DetailedFuelStreamEditor(DetailedFuelStreamControl streamCtrl)
            : base(streamCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //ArrayList varList = solvableCtrl.Solvable.VarList;

            //ProcessVarLabelsControl gasLabelsCtrl = new ProcessVarLabelsControl(varList);
            //this.panel.Controls.Add(gasLabelsCtrl);
            //gasLabelsCtrl.Location = new Point(0, 44);

            //ProcessVarValuesControl gasValuesCtrl = new ProcessVarValuesControl(streamCtrl);
            //this.panel.Controls.Add(gasValuesCtrl);
            //gasValuesCtrl.Location = new Point(192, 44);

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

            //IList dryingFuels = fuelCatalog.GetFossilFuelArray();
            //int index = dryingFuels.IndexOf(streamCtrl.DetailedFuelStream.DryingFuel);
            //this.comboBoxFossilFuelSelection.SelectedIndex = index;

            //fuelCatalog.FossilFuelAdded += DetailedFuelStreamEditor_FossilFuelAdded;
            //fuelCatalog.FossilFuelDeleted += DetailedFuelStreamEditor_FossilFuelDeleted;

            DetailedFuelStreamLabelAndValuesControl fuelLableValuesControl = new DetailedFuelStreamLabelAndValuesControl(streamCtrl);

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

            this.Text       = streamCtrl.Name;
            this.ClientSize = new System.Drawing.Size(274, solvableCtrl.Solvable.VarList.Count * 20 + 73);
        }