Пример #1
0
        public override SolvableConnection CreateConnection(UnitOperation uo, ProcessStreamBase ps, int ad)
        {
            //StreamType streamType = StreamType.Unknown;
            //if (ps is DryingGasStream) {
            //   streamType = StreamType.Gas;
            //}
            //else if (ps is ProcessStream) {
            //   streamType = StreamType.Process;
            //}
            //else if (ps is DryingMaterialStream) {
            //   streamType = StreamType.Material;
            //}

            ProcessStreamBaseControl ctrl = this.flowsheet.StreamManager.GetProcessStreamBaseControl(ps);
            SolvableConnection       conn = null;

            if (ad > 0)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = ad;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetStreamInConnectionPoint(ad, uo.InletStreams.Count);
                PointOrientation uoOrientation = MixerControl.INLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }
            else if (ad == Mixer.OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Mixer.OUTLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetStreamOutConnectionPoint();
                PointOrientation uoOrientation = MixerControl.OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }

            if (conn != null)
            {
                this.flowsheet.ConnectionManager.AddConnection(conn);
                //this.flowsheet.ConnectionManager.Connections.Add(conn);
                //this.flowsheet.ConnectionManager.UpdateConnections(this);
                //this.flowsheet.ConnectionManager.DrawConnections();
                //this.DoThePaint();
                this.flowsheet.ConnectionManager.UpdateConnections(this);
            }
            return(conn);
        }
Пример #2
0
        public override SolvableConnection CreateConnection(UnitOperation uo, ProcessStreamBase ps, int ad)
        {
            ProcessStreamBaseControl ctrl = this.flowsheet.StreamManager.GetProcessStreamBaseControl(ps);
            SolvableConnection       conn = null;

            if (ad == TwoStreamUnitOperation.INLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = TwoStreamUnitOperation.INLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetStreamInConnectionPoint();
                PointOrientation uoOrientation = TwoStreamUnitOpControl.INLET_ORIENTATION;
                // adjust for Recycle
                if (uo is Recycle)
                {
                    uoOrientation = RecycleControl.INLET_ORIENTATION;
                }
                ConnectionPoint uoConnPoint = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }
            else if (ad == TwoStreamUnitOperation.OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = TwoStreamUnitOperation.OUTLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetStreamOutConnectionPoint();
                PointOrientation uoOrientation = TwoStreamUnitOpControl.OUTLET_ORIENTATION;
                // adjust for Recycle
                if (uo is Recycle)
                {
                    uoOrientation = RecycleControl.OUTLET_ORIENTATION;
                }
                ConnectionPoint uoConnPoint = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);
                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }

            if (conn != null)
            {
                //this.flowsheet.ConnectionManager.DrawConnection(conn);
                this.flowsheet.ConnectionManager.AddConnection(conn);
                //this.flowsheet.ConnectionManager.Connections.Add(conn);
                //this.flowsheet.ConnectionManager.DrawConnections();
            }
            return(conn);
        }
Пример #3
0
        public override SolvableConnection CreateConnection(UnitOperation uo, ProcessStreamBase ps, int ad)
        {
            ProcessStreamBaseControl ctrl = this.flowsheet.StreamManager.GetProcessStreamBaseControl(ps);
            SolvableConnection       conn = null;

            if (ad == ScrubberCondenser.GAS_INLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = ScrubberCondenser.GAS_INLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetGasInConnectionPoint();
                PointOrientation uoOrientation = ScrubberCondenserControl.GAS_INLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }
            else if (ad == ScrubberCondenser.GAS_OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = ScrubberCondenser.GAS_OUTLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetGasOutConnectionPoint();
                PointOrientation uoOrientation = ScrubberCondenserControl.GAS_OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }
            else if (ad == ScrubberCondenser.LIQUID_OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = ScrubberCondenser.LIQUID_OUTLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetLiquidOutConnectionPoint();
                PointOrientation uoOrientation = ScrubberCondenserControl.LIQUID_OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }
            else if (ad == ScrubberCondenser.WATER_INLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = ScrubberCondenser.WATER_INLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetWaterInConnectionPoint();
                PointOrientation uoOrientation = ScrubberCondenserControl.WATER_INLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }
            else if (ad == ScrubberCondenser.WATER_OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = ScrubberCondenser.WATER_OUTLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetWaterOutConnectionPoint();
                PointOrientation uoOrientation = ScrubberCondenserControl.WATER_OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }


            if (conn != null)
            {
                this.flowsheet.ConnectionManager.AddConnection(conn);
                //this.flowsheet.ConnectionManager.Connections.Add(conn);
                //this.flowsheet.ConnectionManager.DrawConnections();
            }
            return(conn);
        }
Пример #4
0
        public override void CreateConnection(UnitOperation uo, ProcessStreamBase ps, int ad)
        {
            StreamType streamType = StreamType.Unknown;

            if (ps is DryingGasStream)
            {
                streamType = StreamType.Gas;
            }
            else if (ps is ProcessStream)
            {
                streamType = StreamType.Process;
            }
            else if (ps is DryingMaterialStream)
            {
                streamType = StreamType.Material;
            }

            ProcessStreamBaseControl ctrl = this.flowsheet.StreamManager.GetProcessStreamBaseControl(ps);
            SolvableConnection       conn = null;

            if (ad == Dryer.GAS_INLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Dryer.GAS_INLET_INDEX;
                string           uoName        = this.Solvable.Name;
                Point            uoPoint       = this.GetGasInConnectionPoint();
                PointOrientation uoOrientation = DryerControl.GAS_INLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, streamType);
            }
            else if (ad == Dryer.GAS_OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Dryer.GAS_OUTLET_INDEX;
                string           uoName        = this.Solvable.Name;
                Point            uoPoint       = this.GetGasOutConnectionPoint();
                PointOrientation uoOrientation = DryerControl.GAS_OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, streamType);
            }
            else if (ad == Dryer.MATERIAL_INLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Dryer.MATERIAL_INLET_INDEX;
                string           uoName        = this.Solvable.Name;
                Point            uoPoint       = this.GetMaterialInConnectionPoint();
                PointOrientation uoOrientation = DryerControl.MATERIAL_INLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, streamType);
            }
            else if (ad == Dryer.MATERIAL_OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Dryer.MATERIAL_OUTLET_INDEX;
                string           uoName        = this.Solvable.Name;
                Point            uoPoint       = this.GetMaterialOutConnectionPoint();
                PointOrientation uoOrientation = DryerControl.MATERIAL_OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, streamType);
            }

            if (conn != null)
            {
                this.flowsheet.ConnectionManager.Connections.Add(conn);
                this.flowsheet.ConnectionManager.DrawConnections();
            }
        }
Пример #5
0
        public override SolvableConnection CreateConnection(UnitOperation uo, ProcessStreamBase ps, int ad)
        {
            StreamType streamType = StreamType.Unknown;

            if (ps is DryingGasStream)
            {
                streamType = StreamType.Gas;
            }
            else if (ps is ProcessStream)
            {
                streamType = StreamType.Process;
            }
            else if (ps is DryingMaterialStream)
            {
                streamType = StreamType.Material;
            }

            ProcessStreamBaseControl ctrl = this.flowsheet.StreamManager.GetProcessStreamBaseControl(ps);
            SolvableConnection       conn = null;

            if (ad == Ejector.MOTIVE_INLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Ejector.MOTIVE_INLET_INDEX;
                string           uoName        = this.Solvable.Name;
                Point            uoPoint       = this.GetMotiveInConnectionPoint();
                PointOrientation uoOrientation = EjectorControl.MOTIVE_INLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, streamType);
            }
            else if (ad == Ejector.SUCTION_INLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Ejector.SUCTION_INLET_INDEX;
                string           uoName        = this.Solvable.Name;
                Point            uoPoint       = this.GetSuctionInConnectionPoint();
                PointOrientation uoOrientation = EjectorControl.SUCTION_INLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, streamType);
            }
            else if (ad == Ejector.DISCHARGE_OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Ejector.DISCHARGE_OUTLET_INDEX;
                string           uoName        = this.Solvable.Name;
                Point            uoPoint       = this.GetDischargeOutConnectionPoint();
                PointOrientation uoOrientation = EjectorControl.DISCHARGE_OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, streamType);
            }

            if (conn != null)
            {
                this.flowsheet.ConnectionManager.AddConnection(conn);
                //this.flowsheet.ConnectionManager.Connections.Add(conn);
                //this.flowsheet.ConnectionManager.DrawConnections();
            }
            return(conn);
        }
Пример #6
0
        public override SolvableConnection CreateConnection(UnitOperation uo, ProcessStreamBase ps, int ad)
        {
            ProcessStreamBaseControl ctrl = this.flowsheet.StreamManager.GetProcessStreamBaseControl(ps);
            SolvableConnection       conn = null;

            if (ad == Burner.AIR_INLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Burner.AIR_INLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetAirInConnectionPoint();
                PointOrientation uoOrientation = BurnerControl.AIR_INLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }
            else if (ad == Burner.FUEL_INLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Burner.FUEL_INLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetFuelInConnectionPoint();
                PointOrientation uoOrientation = BurnerControl.FUEL_INLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }
            else if (ad == Burner.FLUE_GAS_OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Burner.FLUE_GAS_OUTLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetFlueGasOutConnectionPoint();
                PointOrientation uoOrientation = BurnerControl.FLUE_GAS_OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }


            if (conn != null)
            {
                this.flowsheet.ConnectionManager.AddConnection(conn);
                //this.flowsheet.ConnectionManager.Connections.Add(conn);
                //this.flowsheet.ConnectionManager.DrawConnections();
            }
            return(conn);
        }
Пример #7
0
        public override SolvableConnection CreateConnection(UnitOperation uo, ProcessStreamBase ps, int ad)
        {
            //StreamType streamType = StreamType.Unknown;
            //if (ps is DryingGasStream) {
            //   streamType = StreamType.Gas;
            //}
            //else if (ps is ProcessStream) {
            //   streamType = StreamType.Process;
            //}
            //else if (ps is DryingMaterialStream) {
            //   streamType = StreamType.Material;
            //}

            ProcessStreamBaseControl ctrl = this.flowsheet.StreamManager.GetProcessStreamBaseControl(ps);
            SolvableConnection       conn = null;

            if (ad == Cyclone.GAS_INLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Cyclone.GAS_INLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetGasInConnectionPoint();
                PointOrientation uoOrientation = CycloneControl.MIXTURE_INLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }
            else if (ad == Cyclone.GAS_OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Cyclone.GAS_OUTLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetGasOutConnectionPoint();
                PointOrientation uoOrientation = CycloneControl.FLUID_OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }
            else if (ad == Cyclone.PARTICLE_OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = Cyclone.PARTICLE_OUTLET_INDEX;
                string           uoName        = this.solvable.Name;
                Point            uoPoint       = this.GetParticleOutConnectionPoint();
                PointOrientation uoOrientation = CycloneControl.PARTICLE_OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, ps.GetType());
            }

            if (conn != null)
            {
                this.flowsheet.ConnectionManager.AddConnection(conn);
                //this.flowsheet.ConnectionManager.Connections.Add(conn);
                //this.flowsheet.ConnectionManager.DrawConnections();
            }
            return(conn);
        }
Пример #8
0
        public override SolvableConnection CreateConnection(UnitOperation uo, ProcessStreamBase ps, int ad)
        {
            StreamType streamType = StreamType.Unknown;

            if (ps is DryingGasStream)
            {
                streamType = StreamType.Gas;
            }
            else if (ps is ProcessStream)
            {
                streamType = StreamType.Process;
            }
            else if (ps is DryingMaterialStream)
            {
                streamType = StreamType.Material;
            }

            ProcessStreamBaseControl ctrl = this.flowsheet.StreamManager.GetProcessStreamBaseControl(ps);
            SolvableConnection       conn = null;

            if (ad == FlashTank.INLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.OUT_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetOutConnectionPoint();
                PointOrientation strOrientation = ctrl.OutOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = FlashTank.INLET_INDEX;
                string           uoName        = this.Solvable.Name;
                Point            uoPoint       = this.GetInConnectionPoint();
                PointOrientation uoOrientation = FlashTankControl.INLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, streamType);
            }
            else if (ad == FlashTank.VAPOR_OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = FlashTank.VAPOR_OUTLET_INDEX;
                string           uoName        = this.Solvable.Name;
                Point            uoPoint       = this.GetVaporOutConnectionPoint();
                PointOrientation uoOrientation = FlashTankControl.VAPOR_OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, streamType);
            }
            else if (ad == FlashTank.LIQUID_OUTLET_INDEX)
            {
                int              strIdx         = ProcessStreamBaseControl.IN_INDEX;
                string           strName        = ctrl.Solvable.Name;
                Point            strPoint       = ctrl.GetInConnectionPoint();
                PointOrientation strOrientation = ctrl.InOrientation;
                ConnectionPoint  strConnPoint   = new ConnectionPoint(strIdx, strName, strPoint, strOrientation);

                int              uoIdx         = FlashTank.LIQUID_OUTLET_INDEX;
                string           uoName        = this.Solvable.Name;
                Point            uoPoint       = this.GetLiquidOutConnectionPoint();
                PointOrientation uoOrientation = FlashTankControl.LIQUID_OUTLET_ORIENTATION;
                ConnectionPoint  uoConnPoint   = new ConnectionPoint(uoIdx, uoName, uoPoint, uoOrientation);

                conn = new SolvableConnection(this.flowsheet, strConnPoint, uoConnPoint, streamType);
            }

            if (conn != null)
            {
                this.flowsheet.ConnectionManager.AddConnection(conn);
                //this.flowsheet.ConnectionManager.Connections.Add(conn);
                //this.flowsheet.ConnectionManager.DrawConnections();
            }
            return(conn);
        }