Beispiel #1
0
 public void InitializeVariableTextBoxes(ProcessStreamControl ctrl)
 {
     this.textBoxMassFlowRate.InitializeVariable(ctrl.Flowsheet, ctrl.ProcessStream.MassFlowRate);
     this.textBoxVolumeFlowRate.InitializeVariable(ctrl.Flowsheet, ctrl.ProcessStream.VolumeFlowRate);
     this.textBoxPressure.InitializeVariable(ctrl.Flowsheet, ctrl.ProcessStream.Pressure);
     this.textBoxTemperature.InitializeVariable(ctrl.Flowsheet, ctrl.ProcessStream.Temperature);
     this.textBoxEnthalpy.InitializeVariable(ctrl.Flowsheet, ctrl.ProcessStream.SpecificEnthalpy);
     this.textBoxSpecificHeat.InitializeVariable(ctrl.Flowsheet, ctrl.ProcessStream.SpecificHeat);
     this.textBoxDensity.InitializeVariable(ctrl.Flowsheet, ctrl.ProcessStream.Density);
 }
Beispiel #2
0
        public ProcessStreamEditor(ProcessStreamControl processStreamCtrl) : base(processStreamCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            ProcessStreamLabelsControl labelsCtrl = new ProcessStreamLabelsControl(this.ProcessStreamCtrl.ProcessStream);

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

            ProcessStreamValuesControl valuesCtrl = new ProcessStreamValuesControl(this.ProcessStreamCtrl);

            this.panel.Controls.Add(valuesCtrl);
            valuesCtrl.Location = new Point(192, 24);
        }
Beispiel #3
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 ProcessStreamControl)
                        {
                            ProcessStreamControl sc = (ProcessStreamControl)sCtrl;
                            if (sc.ProcessStream.Name.Equals(name))
                            {
                                psCtrl = sc;
                                break;
                            }
                        }
                    }
                }
            }
            return(psCtrl);
        }
Beispiel #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 ProcessStream)
            {
                ProcessStream stream = (ProcessStream)processStreamBase;
                control = new ProcessStreamControl(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;
        }
Beispiel #5
0
 public ProcessStreamValuesControl(ProcessStreamControl processStreamCtrl) : this()
 {
     this.InitializeVariableTextBoxes(processStreamCtrl);
 }