Exemple #1
0
        public void UpdateConnections(DryerControl dryerCtrl)
        {
            string name = dryerCtrl.Dryer.Name;

            PointOrientation gasInOrientation = DryerControl.GAS_INLET_ORIENTATION;
            int             gasInIdx          = Dryer.GAS_INLET_INDEX;
            Point           gasInPoint        = dryerCtrl.GetGasInConnectionPoint();
            ConnectionPoint gasInCp           = new ConnectionPoint(gasInIdx, name, gasInPoint, gasInOrientation);

            PointOrientation gasOutOrientation = DryerControl.GAS_OUTLET_ORIENTATION;
            int             gasOutIdx          = Dryer.GAS_OUTLET_INDEX;
            Point           gasOutPoint        = dryerCtrl.GetGasOutConnectionPoint();
            ConnectionPoint gasOutCp           = new ConnectionPoint(gasOutIdx, name, gasOutPoint, gasOutOrientation);

            PointOrientation matInOrientation = DryerControl.MATERIAL_INLET_ORIENTATION;
            int             matInIdx          = Dryer.MATERIAL_INLET_INDEX;
            Point           matInPoint        = dryerCtrl.GetMaterialInConnectionPoint();
            ConnectionPoint matInCp           = new ConnectionPoint(matInIdx, name, matInPoint, matInOrientation);

            PointOrientation matOutOrientation = DryerControl.MATERIAL_OUTLET_ORIENTATION;
            int             matOutIdx          = Dryer.MATERIAL_OUTLET_INDEX;
            Point           matOutPoint        = dryerCtrl.GetMaterialOutConnectionPoint();
            ConnectionPoint matOutCp           = new ConnectionPoint(matOutIdx, name, matOutPoint, matOutOrientation);

            IEnumerator e = this.Connections.GetEnumerator();

            while (e.MoveNext())
            {
                SolvableConnection dc        = (SolvableConnection)e.Current;
                Boolean            isChanged = false;

                if (dc.UnitOpPoint.Equals(gasInCp))
                {
                    isChanged            = true;
                    dc.UnitOpPoint.Point = gasInPoint;
                }
                if (dc.UnitOpPoint.Equals(gasOutCp))
                {
                    isChanged            = true;
                    dc.UnitOpPoint.Point = gasOutPoint;
                }
                if (dc.UnitOpPoint.Equals(matInCp))
                {
                    isChanged            = true;
                    dc.UnitOpPoint.Point = matInPoint;
                }
                if (dc.UnitOpPoint.Equals(matOutCp))
                {
                    isChanged            = true;
                    dc.UnitOpPoint.Point = matOutPoint;
                }
                if (isChanged)
                {
                    this.flowsheet.Controls.Remove(dc);
                    dc.UpdateConnection();
                    this.flowsheet.Controls.Add(dc);
                    isChanged = false;
                }
            }
        }
Exemple #2
0
        public void UpdateConnections(DryerControl dryerCtrl)
        {
            string name = dryerCtrl.Dryer.Name;

            PointOrientation gasInOrientation = DryerControl.GAS_INLET_ORIENTATION;
            int             gasInIdx          = Dryer.GAS_INLET_INDEX;
            Point           gasInPoint        = dryerCtrl.GetGasInConnectionPoint();
            ConnectionPoint gasInCp           = new ConnectionPoint(gasInIdx, name, gasInPoint, gasInOrientation);

            PointOrientation gasOutOrientation = DryerControl.GAS_OUTLET_ORIENTATION;
            int             gasOutIdx          = Dryer.GAS_OUTLET_INDEX;
            Point           gasOutPoint        = dryerCtrl.GetGasOutConnectionPoint();
            ConnectionPoint gasOutCp           = new ConnectionPoint(gasOutIdx, name, gasOutPoint, gasOutOrientation);

            PointOrientation matInOrientation = DryerControl.MATERIAL_INLET_ORIENTATION;
            int             matInIdx          = Dryer.MATERIAL_INLET_INDEX;
            Point           matInPoint        = dryerCtrl.GetMaterialInConnectionPoint();
            ConnectionPoint matInCp           = new ConnectionPoint(matInIdx, name, matInPoint, matInOrientation);

            PointOrientation matOutOrientation = DryerControl.MATERIAL_OUTLET_ORIENTATION;
            int             matOutIdx          = Dryer.MATERIAL_OUTLET_INDEX;
            Point           matOutPoint        = dryerCtrl.GetMaterialOutConnectionPoint();
            ConnectionPoint matOutCp           = new ConnectionPoint(matOutIdx, name, matOutPoint, matOutOrientation);

            IEnumerator e = this.Connections.GetEnumerator();

            while (e.MoveNext())
            {
                SolvableConnection dc = (SolvableConnection)e.Current;

                if (dc.UnitOpPoint.Equals(gasInCp))
                {
                    dc.UnitOpPoint.Point = gasInPoint;
                }
                if (dc.UnitOpPoint.Equals(gasOutCp))
                {
                    dc.UnitOpPoint.Point = gasOutPoint;
                }
                if (dc.UnitOpPoint.Equals(matInCp))
                {
                    dc.UnitOpPoint.Point = matInPoint;
                }
                if (dc.UnitOpPoint.Equals(matOutCp))
                {
                    dc.UnitOpPoint.Point = matOutPoint;
                }
            }
            this.DrawConnections();
        }