Beispiel #1
0
        protected override void ValidatingHandler(object sender, System.ComponentModel.CancelEventArgs e)
        {
            FlashTank flashTank = this.FlashTankCtrl.FlashTank;
            TextBox   tb        = (TextBox)sender;

            if (tb.Text != null)
            {
                if (tb.Text.Trim().Equals(""))
                {
                    if (sender == this.textBoxName)
                    {
                        e.Cancel = true;
                        string message3 = "Please specify a name!";
                        MessageBox.Show(message3, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
                else
                {
                    if (sender == this.textBoxName)
                    {
                        ErrorMessage error = flashTank.SpecifyName(this.textBoxName.Text);
                        if (error != null)
                        {
                            UI.ShowError(error);
                        }
                    }
                }
            }
        }
Beispiel #2
0
        public FlashTankEditor(FlashTankControl flashTankCtrl) : base(flashTankCtrl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            FlashTank flashTank = this.FlashTankCtrl.FlashTank;

            this.Text = "Flash Tank: " + flashTank.Name;

            this.UpdateStreamsUI();

            if (flashTank.Inlet is DryingGasStream)
            {
                this.groupBoxStreams.Size = new System.Drawing.Size(440, 280);
                this.panel.Size           = new System.Drawing.Size(448, 269);
                this.ClientSize           = new System.Drawing.Size(448, 331);
            }
            else if (flashTank.Inlet is DryingMaterialStream)
            {
                this.groupBoxStreams.Size = new System.Drawing.Size(440, 300);
                this.panel.Size           = new System.Drawing.Size(448, 289);
                this.ClientSize           = new System.Drawing.Size(448, 351);
            }

            flashTankCtrl.FlashTank.StreamAttached += new StreamAttachedEventHandler(FlashTank_StreamAttached);
            flashTankCtrl.FlashTank.StreamDetached += new StreamDetachedEventHandler(FlashTank_StreamDetached);
        }
Beispiel #3
0
        public FlashTankControl(Flowsheet flowsheet, Point location, FlashTank flashTank) :
            base(flowsheet, location, flashTank)
        {
            InitializeComponent();

            this.Size = new System.Drawing.Size(UI.UNIT_OP_CTRL_H, UI.UNIT_OP_CTRL_H);
            UI.SetStatusColor(this, this.FlashTank.SolveState);
            this.UpdateBackImage();
        }
Beispiel #4
0
        private void UpdateStreamsUI()
        {
            // clear the streams boxes and start again
            this.groupBoxStreams.Controls.Clear();

            FlashTank flashTank    = this.FlashTankCtrl.FlashTank;
            bool      hasInlet     = false;
            bool      hasVaporOut  = false;
            bool      hasLiquidOut = false;

            ProcessStreamBase inlet = flashTank.Inlet;

            if (inlet != null)
            {
                hasInlet = true;
            }

            ProcessStreamBase vaporOut = flashTank.VaporOutlet;

            if (vaporOut != null)
            {
                hasVaporOut = true;
            }

            ProcessStreamBase liquidOut = flashTank.LiquidOutlet;

            if (liquidOut != null)
            {
                hasLiquidOut = true;
            }

            if (hasInlet || hasVaporOut || hasLiquidOut)
            {
                ProcessStreamBase labelsStream = null;
                if (hasInlet)
                {
                    labelsStream = inlet;
                }
                else if (hasVaporOut)
                {
                    labelsStream = vaporOut;
                }
                else if (hasLiquidOut)
                {
                    labelsStream = liquidOut;
                }

                UserControl ctrl = null;
                if (labelsStream is ProcessStream)
                {
                    ctrl = new ProcessStreamLabelsControl((ProcessStream)labelsStream);
                }
                else if (labelsStream is DryingGasStream)
                {
                    ctrl = new GasStreamLabelsControl((DryingGasStream)labelsStream);
                }
                else if (labelsStream is DryingMaterialStream)
                {
                    ctrl = new MaterialStreamLabelsControl((DryingMaterialStream)labelsStream);
                }
                this.groupBoxStreams.Controls.Add(ctrl);
                ctrl.Location = new Point(4, 12 + 20 + 2);
            }

            if (hasInlet)
            {
                UserControl ctrl = null;
                if (inlet is ProcessStream)
                {
                    ProcessStreamControl processInCtrl = (ProcessStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.Inlet.Name);
                    ctrl = new ProcessStreamValuesControl(processInCtrl);
                }
                else if (inlet is DryingGasStream)
                {
                    GasStreamControl gasInCtrl = (GasStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.Inlet.Name);
                    ctrl = new GasStreamValuesControl(gasInCtrl);
                }
                else if (inlet is DryingMaterialStream)
                {
                    MaterialStreamControl matInCtrl = (MaterialStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.Inlet.Name);
                    ctrl = new MaterialStreamValuesControl(matInCtrl);
                }
                this.groupBoxStreams.Controls.Add(ctrl);
                ctrl.Location = new Point(196, 12 + 20 + 2);

                this.textBoxInName.SetSolvable(flashTank.Inlet);
                this.groupBoxStreams.Controls.Add(this.textBoxInName);
                this.textBoxInName.Text = flashTank.Inlet.Name;
                UI.SetStatusColor(this.textBoxInName, flashTank.Inlet.SolveState);
            }

            if (hasVaporOut)
            {
                UserControl ctrl = null;
                if (vaporOut is ProcessStream)
                {
                    ProcessStreamControl processOutCtrl = (ProcessStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.VaporOutlet.Name);
                    ctrl = new ProcessStreamValuesControl(processOutCtrl);
                }
                else if (vaporOut is DryingGasStream)
                {
                    GasStreamControl gasOutCtrl = (GasStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.VaporOutlet.Name);
                    ctrl = new GasStreamValuesControl(gasOutCtrl);
                }
                else if (vaporOut is DryingMaterialStream)
                {
                    MaterialStreamControl matOutCtrl = (MaterialStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.VaporOutlet.Name);
                    ctrl = new MaterialStreamValuesControl(matOutCtrl);
                }
                this.groupBoxStreams.Controls.Add(ctrl);
                ctrl.Location = new Point(276, 12 + 20 + 2);

                this.textBoxVaporOutName.SetSolvable(flashTank.VaporOutlet);
                this.groupBoxStreams.Controls.Add(this.textBoxVaporOutName);
                this.textBoxVaporOutName.Text = flashTank.VaporOutlet.Name;
                UI.SetStatusColor(this.textBoxVaporOutName, flashTank.VaporOutlet.SolveState);
            }

            if (hasLiquidOut)
            {
                UserControl ctrl = null;
                if (liquidOut is ProcessStream)
                {
                    ProcessStreamControl processOutCtrl = (ProcessStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name);
                    ctrl = new ProcessStreamValuesControl(processOutCtrl);
                }
                else if (liquidOut is DryingGasStream)
                {
                    GasStreamControl gasOutCtrl = (GasStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name);
                    ctrl = new GasStreamValuesControl(gasOutCtrl);
                }
                else if (liquidOut is DryingMaterialStream)
                {
                    MaterialStreamControl matOutCtrl = (MaterialStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name);
                    ctrl = new MaterialStreamValuesControl(matOutCtrl);
                }
                this.groupBoxStreams.Controls.Add(ctrl);
                ctrl.Location = new Point(356, 12 + 20 + 2);

                this.textBoxLiquidOutName.SetSolvable(flashTank.LiquidOutlet);
                this.groupBoxStreams.Controls.Add(this.textBoxLiquidOutName);
                this.textBoxLiquidOutName.Text = flashTank.LiquidOutlet.Name;
                UI.SetStatusColor(this.textBoxLiquidOutName, flashTank.LiquidOutlet.SolveState);
            }
        }
Beispiel #5
0
        private Flowsheet SetFlowsheetContent(NewProcessSettings newProcessSettings, ApplicationPreferences appPrefs, ArrayList items, string flowsheetName)
        {
            Flowsheet   flowsheet = null;
            IEnumerator e         = items.GetEnumerator();

            while (e.MoveNext())
            {
                object obj = e.Current;

                if (obj is EvaporationAndDryingSystem)
                {
                    EvaporationAndDryingSystem persisted = (EvaporationAndDryingSystem)obj;
                    persisted.SetSystemFileName(flowsheetName); // call this before SetObjectData()
                    persisted.SetObjectData();
                    flowsheet = new Flowsheet(newProcessSettings, appPrefs, persisted);
                }

                else if (obj is GasStreamControl)
                {
                    GasStreamControl persistedCtrl = (GasStreamControl)obj;
                    string           solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    DryingGasStream  stream        = flowsheet.EvaporationAndDryingSystem.GetGasStream(solvableName);
                    GasStreamControl newCtrl       = new GasStreamControl(flowsheet, new Point(0, 0), stream);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is MaterialStreamControl)
                {
                    MaterialStreamControl persistedCtrl = (MaterialStreamControl)obj;
                    string solvableName           = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    DryingMaterialStream  stream  = flowsheet.EvaporationAndDryingSystem.GetMaterialStream(solvableName);
                    MaterialStreamControl newCtrl = new MaterialStreamControl(flowsheet, new Point(0, 0), stream);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is DryerControl)
                {
                    DryerControl persistedCtrl = (DryerControl)obj;
                    string       solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Dryer        uo            = flowsheet.EvaporationAndDryingSystem.GetDryer(solvableName);
                    DryerControl newCtrl       = new DryerControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is HeatExchangerControl)
                {
                    HeatExchangerControl persistedCtrl = (HeatExchangerControl)obj;
                    string               solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    HeatExchanger        uo            = flowsheet.EvaporationAndDryingSystem.GetHeatExchanger(solvableName);
                    HeatExchangerControl newCtrl       = new HeatExchangerControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is CycloneControl)
                {
                    CycloneControl persistedCtrl = (CycloneControl)obj;
                    string         solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Cyclone        uo            = flowsheet.EvaporationAndDryingSystem.GetCyclone(solvableName);
                    CycloneControl newCtrl       = new CycloneControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is EjectorControl)
                {
                    EjectorControl persistedCtrl = (EjectorControl)obj;
                    string         solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Ejector        uo            = flowsheet.EvaporationAndDryingSystem.GetEjector(solvableName);
                    EjectorControl newCtrl       = new EjectorControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is WetScrubberControl)
                {
                    WetScrubberControl persistedCtrl = (WetScrubberControl)obj;
                    string             solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    WetScrubber        uo            = flowsheet.EvaporationAndDryingSystem.GetWetScrubber(solvableName);
                    WetScrubberControl newCtrl       = new WetScrubberControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is ScrubberCondenserControl)
                {
                    ScrubberCondenserControl persistedCtrl = (ScrubberCondenserControl)obj;
                    string                   solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    ScrubberCondenser        uo            = flowsheet.EvaporationAndDryingSystem.GetScrubberCondenser(solvableName);
                    ScrubberCondenserControl newCtrl       = new ScrubberCondenserControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is MixerControl)
                {
                    MixerControl persistedCtrl = (MixerControl)obj;
                    string       solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Mixer        uo            = flowsheet.EvaporationAndDryingSystem.GetMixer(solvableName);
                    MixerControl newCtrl       = new MixerControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is TeeControl)
                {
                    TeeControl persistedCtrl = (TeeControl)obj;
                    string     solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Tee        uo            = flowsheet.EvaporationAndDryingSystem.GetTee(solvableName);
                    TeeControl newCtrl       = new TeeControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is FlashTankControl)
                {
                    FlashTankControl persistedCtrl = (FlashTankControl)obj;
                    string           solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    FlashTank        uo            = flowsheet.EvaporationAndDryingSystem.GetFlashTank(solvableName);
                    FlashTankControl newCtrl       = new FlashTankControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is FanControl)
                {
                    FanControl persistedCtrl = (FanControl)obj;
                    string     solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Fan        uo            = flowsheet.EvaporationAndDryingSystem.GetFan(solvableName);
                    FanControl newCtrl       = new FanControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is ValveControl)
                {
                    ValveControl persistedCtrl = (ValveControl)obj;
                    string       solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Valve        uo            = flowsheet.EvaporationAndDryingSystem.GetValve(solvableName);
                    ValveControl newCtrl       = new ValveControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is BagFilterControl)
                {
                    BagFilterControl persistedCtrl = (BagFilterControl)obj;
                    string           solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    BagFilter        uo            = flowsheet.EvaporationAndDryingSystem.GetBagFilter(solvableName);
                    BagFilterControl newCtrl       = new BagFilterControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is AirFilterControl)
                {
                    AirFilterControl persistedCtrl = (AirFilterControl)obj;
                    string           solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    AirFilter        uo            = flowsheet.EvaporationAndDryingSystem.GetAirFilter(solvableName);
                    AirFilterControl newCtrl       = new AirFilterControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is CompressorControl)
                {
                    CompressorControl persistedCtrl = (CompressorControl)obj;
                    string            solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Compressor        uo            = flowsheet.EvaporationAndDryingSystem.GetCompressor(solvableName);
                    CompressorControl newCtrl       = new CompressorControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is HeaterControl)
                {
                    HeaterControl persistedCtrl = (HeaterControl)obj;
                    string        solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Heater        uo            = flowsheet.EvaporationAndDryingSystem.GetHeater(solvableName);
                    HeaterControl newCtrl       = new HeaterControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is CoolerControl)
                {
                    CoolerControl persistedCtrl = (CoolerControl)obj;
                    string        solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Cooler        uo            = flowsheet.EvaporationAndDryingSystem.GetCooler(solvableName);
                    CoolerControl newCtrl       = new CoolerControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is ElectrostaticPrecipitatorControl)
                {
                    ElectrostaticPrecipitatorControl persistedCtrl = (ElectrostaticPrecipitatorControl)obj;
                    string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    ElectrostaticPrecipitator        uo      = flowsheet.EvaporationAndDryingSystem.GetElectrostaticPrecipitator(solvableName);
                    ElectrostaticPrecipitatorControl newCtrl = new ElectrostaticPrecipitatorControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is PumpControl)
                {
                    PumpControl persistedCtrl = (PumpControl)obj;
                    string      solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Pump        uo            = flowsheet.EvaporationAndDryingSystem.GetPump(solvableName);
                    PumpControl newCtrl       = new PumpControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is RecycleControl)
                {
                    RecycleControl persistedCtrl = (RecycleControl)obj;
                    string         solvableName  = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string));
                    Recycle        uo            = flowsheet.EvaporationAndDryingSystem.GetRecycle(solvableName);
                    RecycleControl newCtrl       = new RecycleControl(flowsheet, new Point(0, 0), uo);
                    newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext);
                    flowsheet.Controls.Add(newCtrl);
                }
                else if (obj is SolvableConnection)
                {
                    SolvableConnection persistedDc = (SolvableConnection)obj;
                    SolvableConnection dc          = new SolvableConnection(flowsheet);
                    dc.SetObjectData(persistedDc.SerializationInfo, persistedDc.StreamingContext);
                    flowsheet.ConnectionManager.Connections.Add(dc);
                }
                else if (obj is FlowsheetPreferences)
                {
                    FlowsheetPreferences flowsheetPrefs = obj as FlowsheetPreferences;
                    flowsheetPrefs.SetObjectData(flowsheetPrefs.SerializationInfo, flowsheetPrefs.StreamingContext);
                    flowsheet.BackColor = flowsheetPrefs.BackColor;
                }
                else if (obj is ProsimoUI.CustomEditor.CustomEditor)
                {
                    ProsimoUI.CustomEditor.CustomEditor persistedEditor = (ProsimoUI.CustomEditor.CustomEditor)obj;
                    flowsheet.CustomEditor.SetObjectData(persistedEditor.SerializationInfo, persistedEditor.StreamingContext);
                }
            }

            if (this.CheckFlowsheetVersion(items, flowsheet))
            {
                flowsheet.IsDirty = false;
            }
            else
            {
                flowsheet = null;
            }

            return(flowsheet);
        }
Beispiel #6
0
        private void UpdateStreamsUI()
        {
            // clear the streams boxes and start again
            //this.groupBoxStreams.Controls.Clear();

            FlashTank flashTank    = this.FlashTankCtrl.FlashTank;
            bool      hasInlet     = false;
            bool      hasVaporOut  = false;
            bool      hasLiquidOut = false;

            ProcessStreamBase inlet = flashTank.Inlet;

            if (inlet != null)
            {
                hasInlet = true;
            }

            ProcessStreamBase vaporOut = flashTank.VaporOutlet;

            if (vaporOut != null)
            {
                hasVaporOut = true;
            }

            ProcessStreamBase liquidOut = flashTank.LiquidOutlet;

            if (liquidOut != null)
            {
                hasLiquidOut = true;
            }

            if (hasInlet)
            {
                ProcessStreamBaseControl processInCtrl = (ProcessStreamBaseControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.Inlet.Name);
                initializeGrid(processInCtrl, columnIndex, false, "Inlet/Vapor Outlet/Liquid Outlet");
                columnIndex += 2;
                if (hasVaporOut)
                {
                    ProcessStreamBaseControl processOutCtrl = (ProcessStreamBaseControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.VaporOutlet.Name);
                    initializeGrid(processOutCtrl, columnIndex, true, "Inlet/Vapor Outlet");
                    columnIndex++;
                }
                if (hasLiquidOut)
                {
                    ProcessStreamBaseControl processOutCtrl = (ProcessStreamBaseControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name);
                    initializeGrid(processOutCtrl, columnIndex, false, "Liquid Outlet");
                    columnIndex++;
                }

                //this.textBoxInName.Text = flashTank.Inlet.Name;
                //UI.SetStatusColor(this.textBoxInName, flashTank.Inlet.SolveState);
            }
            else
            if (hasVaporOut)
            {
                ProcessStreamBaseControl processOutCtrl = (ProcessStreamBaseControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.VaporOutlet.Name);
                initializeGrid(processOutCtrl, columnIndex, false, "Inlet/Vapor Outlet/Liquid Outlet");
                columnIndex += 2;
                if (hasLiquidOut)
                {
                    processOutCtrl = (ProcessStreamBaseControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name);
                    initializeGrid(processOutCtrl, columnIndex, true, "Inlet/Vapor Outlet/Liquid Outlet");
                    columnIndex++;
                }

                //this.textBoxVaporOutName.Text = flashTank.VaporOutlet.Name;
                //UI.SetStatusColor(this.textBoxVaporOutName, flashTank.VaporOutlet.SolveState);
            }
            else
            if (hasLiquidOut)
            {
                ProcessStreamBaseControl processOutCtrl = (ProcessStreamBaseControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name);
                initializeGrid(processOutCtrl, columnIndex, false, "Inlet/Vapor Outlet/Liquid Outlet");
                columnIndex += 2;
                //UserControl ctrl = null;
                //if (liquidOut is ProcessStream)
                //{
                //   ProcessStreamControl processOutCtrl = (ProcessStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name);
                //   ctrl = new ProcessStreamValuesControl(processOutCtrl);
                //}
                //else if (liquidOut is DryingGasStream)
                //{
                //   GasStreamControl gasOutCtrl = (GasStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name);
                //   ctrl = new GasStreamValuesControl(gasOutCtrl);
                //}
                //else if (liquidOut is DryingMaterialStream)
                //{
                //   MaterialStreamControl matOutCtrl = (MaterialStreamControl)this.FlashTankCtrl.Flowsheet.StreamManager.GetProcessStreamBaseControl(this.FlashTankCtrl.FlashTank.LiquidOutlet.Name);
                //   ctrl = new MaterialStreamValuesControl(matOutCtrl);
                //}
                //this.groupBoxStreams.Controls.Add(ctrl);
                //ctrl.Location = new Point(356, 12 + 20 + 2);

                //this.textBoxLiquidOutName.SetSolvable(flashTank.LiquidOutlet);
                //this.groupBoxStreams.Controls.Add(this.textBoxLiquidOutName);
                //this.textBoxLiquidOutName.Text = flashTank.LiquidOutlet.Name;
                UI.SetStatusColor(this.statusBar, flashTank.LiquidOutlet.SolveState);
            }
        }
Beispiel #7
0
 public FlashTankControl(Flowsheet flowsheet, Point location, FlashTank flashTank)
     : base(flowsheet, location, flashTank)
 {
 }