Ejemplo n.º 1
0
 public LynxDefaultNode()//默认的用于设计器的节点
 {
     InitializeComponent();
     MoveArea   = textBlockTitle;
     ActiveArea = image1;
     EnableControlMove();
     EnableActive();
     AnchorPointList.Add(lynxAnchorPoint1);
     lynxAnchorPoint1.ParentConnectControl = this;
 }
Ejemplo n.º 2
0
        public bool AddRange(Point center, AnchorPointList list, PetrochemicalType petrochemicaltype, float concentration = 0.0f, float watertime = 0.0f)
        {
            list.ForEach(p => this.Add(new GroundPollution(p,
                                                           p.coordinates.Distance(center.coordinates),
                                                           Helper.GeoAngle(center, p),
                                                           petrochemicaltype,
                                                           concentration,
                                                           watertime
                                                           )));

            return(true);
        }
Ejemplo n.º 3
0
        public GroundBlur(SpreadPoint spreadpoint)
        {
            this.spreadpoint = spreadpoint;
            RGEContext db = new RGEContext();    // заглушка, выставить правильный контекст //blinova

            this.bordercoordinateslist = new CoordinatesList();

            if (this.spreadpoint.groundtype.watercapacity >= this.spreadpoint.groundtype.porosity)
            {
                throw new EGHDBException(string.Format(errormssageformat, "Влагоемкость грунта не может быть  больше или равна  пористости"));
            }

            if (this.spreadpoint.groundtype.watercapacity >= this.spreadpoint.groundtype.soilmoisture)
            {
                throw new EGHDBException(string.Format(errormssageformat, "Влагоемкость грунта не может быть  больше или равна  влажности грунта"));
            }

            if (this.spreadpoint.petrochemicaltype.tension <= 0)
            {
                throw new EGHDBException(string.Format(errormssageformat, "Коэффициент поверностного натяжение нефтеродукта не может быть меньше или равным нулю "));
            }


            { // коэф. разлива
                float k = SpreadingCoefficient.GetByData(db, this.spreadpoint.groundtype, this.spreadpoint.petrochemicaltype, this.spreadpoint.volume, 0.0f);
                this.spreadingcoefficient = new SpreadingCoefficient(0, this.spreadpoint.groundtype, this.spreadpoint.petrochemicaltype, 0.0f, this.spreadpoint.volume, 0.0f, 0.02f, k);
            }
            if (this.spreadingcoefficient.koef <= 0.0f)
            {
                //this.spreadingcoefficient = new SpreadingCoefficient(0, this.spreadpoint.groundtype, this.spreadpoint.petrochemicaltype, 0.0f, this.spreadpoint.volume, 0.0f, 0.02f, 5.0f);  // заглушка
                throw new EGHDBException(string.Format(errormssageformat, "Коэффициент разлива не может быть меньше или равен нулю"));
            }



            { // свойства воды
                WaterProperties x = new WaterProperties();
                // RGEContext db = new RGEContext();// заглушка, выставить правильный контекст //blinova
                float delta = 0.0f;
                if (WaterProperties.Get(db, 20.0f, out x, out delta))
                {
                    this.waterproperties = x;
                }
            }
            if (this.waterproperties.viscocity <= 0)
            {
                throw new EGHDBException(string.Format(errormssageformat, "Вязкость воды  не может быть меньше или равным нулю "));
            }


            this.square = this.spreadpoint.volume * this.spreadingcoefficient.koef;                  // площадь  пятна

            this.radius = (float)Math.Sqrt(square / Math.PI);                                        // радиус  пятна

            this.petrochemicalheight = this.spreadpoint.volume / this.square;                        // высота слоя разлитого нефтепродукта (м)

            this.totalmass = this.spreadpoint.volume * this.spreadpoint.petrochemicaltype.density;   // масса пролива



            this.anchorpointlist = AnchorPointList.CreateNear(this.spreadpoint.coordinates, this.radius);

            this.ecoobjectsearchradius = this.radius;
            this.ecoobjecstlist        = EcoObjectsList.CreateEcoObjectsList(db, this.spreadpoint, this.ecoobjectsearchradius);

            this.groundpolutionlist = new GroundPollutionList(this.spreadpoint);
            this.groundpolutionlist.AddRange(this.spreadpoint, this.anchorpointlist, this.spreadpoint.petrochemicaltype);
            this.groundpolutionlist.AddRange(this.spreadpoint, this.ecoobjecstlist, this.spreadpoint.petrochemicaltype);


            //  переделать как метод this.groundpolutionlist
            this.avgdeep =                                                                              // средняя глубина грунтовых вод по опорным точкам  и техногенному  объекту
                           (
                anchorpointlist.sumwaterdeep +
                (this.spreadpoint.riskobject != null ? this.spreadpoint.waterdeep : 0.0f)
                           ) /
                           (anchorpointlist.Count + 1);


            this.limitadsorbedmass =                                                                           // максиальная маса нефтепродукта, кот. может быть адсорбирована грунтом (кг)
                                     this.avgdeep *                                                            // средняя глубина грутовы вод
                                     this.square *                                                             // площадь пролива
                                     this.waterproperties.density *                                            // плотность воды
                                     this.spreadpoint.groundtype.porosity * (0.01f) *                          // пористость грунта  * 0.01 (smw 2017.06.18)
                                     this.spreadpoint.groundtype.watercapacity *                               // капилярная влагоемкость грунта                                                     // максиальная маса нефтепродукта, кот. может быть адсорбирована грунтом (кг)
                                     (float)Math.Pow(this.spreadpoint.petrochemicaltype.dynamicviscosity, 2) * // динамическая вязкость
                                     this.waterproperties.tension /                                            // коэфициент поверхностного натяжения воды
                                     (
                this.spreadpoint.petrochemicaltype.tension *                                                   // коэфициент поверхностного натяжения нефтепродукта
                (float)Math.Pow(this.waterproperties.viscocity, 2)                                             //  вязкость воды
                                     );



            this.adsorbedmass = (limitadsorbedmass >= this.totalmass ? this.totalmass : limitadsorbedmass);             // адсорбированная масса нефтепродукта в грунте т - М1

            this.restmass = (this.adsorbedmass >= this.totalmass ? 0 : this.totalmass - this.adsorbedmass);             // масса нефтепродукта достигшая грунтовых вод



            this.depth = (this.restmass > 0 ? this.avgdeep : (float)Math.Round(this.avgdeep * (this.totalmass / this.limitadsorbedmass), 3)); // глубина проникновения нефтепродукта в грунт

            if (this.depth > 0)                                                                                                               // если глубина проникновения > 0
            {
                this.concentrationinsoil =                                                                                                    // средняя концентрация нефтепродуктов в грунте

                                           this.adsorbedmass /                                                                                // адсорбированная масса нефтепродукта в грунте
                                           (
                    this.square *                                                                                                             // площадь  пятна
                    this.depth *                                                                                                              // глубина проникновения нефтепродукта в грунт
                    this.spreadpoint.groundtype.density                                                                                       // средняя плотность грунта
                                           );
            }
            else
            {
                this.concentrationinsoil = 0.0f;
            }



            {                                                        //   вертикальная скорость проникновения нефтепродукта в грунт (м/с)
                float ka =                                           // формула аверьянова
                           this.spreadpoint.groundtype.waterfilter * // коэф. фильтрации воды
                           (
                    this.spreadpoint.groundtype.soilmoisture -       // влажность грунта
                    this.spreadpoint.groundtype.watercapacity        // капилярная влагоемкость грунта
                           ) /
                           (
                    this.spreadpoint.groundtype.porosity -                                        //  пористость грунта
                    this.spreadpoint.groundtype.watercapacity                                     // капилярная влагоемкость грунта
                           );

                float r =                                                                          // коэффициент задержки
                          (
                    this.spreadpoint.petrochemicaltype.dynamicviscosity *                          // вязкость нефтепродукта
                    this.waterproperties.density                                                   // плотность воды
                          ) /
                          (
                    this.waterproperties.viscocity *                                               // вязкость воды
                    this.spreadpoint.petrochemicaltype.density                                     // плотность нефтепродукта
                          );

                this.speedvertical = this.petrochemicalheight *                                    //  А.Авхимович: высота слоя разлитого нефтепродукта (м)             // вы
                                     (ka / r);                                                     // вертикальная скорость проникновения нефтепродукта в грунт (м/с)
            }

            this.timeconcentrationinsoil =                                                         // время достижения усреднееной концентации  в грунте
                                           this.depth /                                            // глубина проникновения нефтепродукта в грунт
                                           this.speedvertical;                                     // вертикальная скорость проникновения нефтепродукта в грунт (м/с)


            if (this.restmass > 0)
            {
                this.timewatercomletion =                                                           // время продвижения нефтепродукта до грунтовых вод
                                          this.avgdeep /                                            // средняя глубина грунтовых вод по опорным точкам (м)
                                          this.speedvertical;                                       // вертикальная скорость проникновения нефтепродукта в грунт (м/с)

                this.dtimemaxwaterconc =                                                            // время (с) достижения  максимальной концентрации  нефтепродуктом грунтовых вод  после достиженич границы грунтовых вод
                                         this.petrochemicalheight /                                 // высота слоя разлитого нефтепродукта (м)
                                         (
                    this.speedvertical *                                                            // вертикальная скорость проникновения нефтепродукта в грунт (м/с)
                    this.spreadpoint.groundtype.porosity                                            // пористость грунта
                                         );

                this.timemaxwaterconc = this.timewatercomletion + this.dtimemaxwaterconc;                // время (с) достижения  максимальной концентрации на уровне грунтовых вод
            }
            else
            {
                this.timewatercomletion = Const.TIME_INFINITY;                                         // никогда
                this.dtimemaxwaterconc  = Const.TIME_INFINITY;                                         // никогда
                this.timemaxwaterconc   = Const.TIME_INFINITY;                                         // никогда
            }


            {
                if (restmass > 0)                                    // если не все адсорбировалось в грунте
                {
                    this.ozcorrection =                              // OZ-поправка
                                        this.petrochemicalheight *   // высота слоя разлитого нефтепродукта (м)
                                        this.restmass /              // масса нефтепродукта достигшая грунтовых вод (кг)
                                        this.totalmass;              // масса пролива (кг)

                    this.maxconcentrationwater = (float)             // максимальной концентрация на уровне грунтовых вод кг/м3
                                                 (
                        this.restmass /                              // масса нефтепродукта достигшая грунтовых вод (кг)
                        (Math.PI * this.radius * this.radius) * 1.0f // объем воды
                        /
                        (this.ozcorrection * Math.Sqrt(2 * Math.PI)) // поправка 0Z
                                                 );
                }
                else // если все адсорбировалось в грунте
                {
                    this.ozcorrection          = 0.0f;
                    this.maxconcentrationwater = 0.0f;
                }
            }
        }
Ejemplo n.º 4
0
        public GroundBlur(XmlNode node)
        {
            {
                XmlNode x = node.SelectSingleNode(".//SpreadPoint");
                if (x != null)
                {
                    this.spreadpoint = new SpreadPoint(x);
                }
                else
                {
                    this.spreadpoint = null;
                }
            }


            XmlNode coordinates_list = node.SelectSingleNode(".//CoordinatesList");

            if (coordinates_list != null)
            {
                this.bordercoordinateslist = CoordinatesList.CreateCoordinatesList(coordinates_list);
            }
            else
            {
                this.bordercoordinateslist = null;
            }

            XmlNode spreading_coef = node.SelectSingleNode(".//SpreadingCoefficient");

            if (spreading_coef != null)
            {
                this.spreadingcoefficient = new SpreadingCoefficient(spreading_coef);
            }
            else
            {
                this.spreadingcoefficient = null;
            }

            this.square            = Helper.GetFloatAttribute(node, "square", 0.0f);
            this.radius            = Helper.GetFloatAttribute(node, "radius", 0.0f);
            this.totalmass         = Helper.GetFloatAttribute(node, "totalmass", 0.0f);
            this.limitadsorbedmass = Helper.GetFloatAttribute(node, "limitadsorbedmass", 0.0f);

            this.avgdeep             = Helper.GetFloatAttribute(node, "avgdeep", 0.0f);
            this.petrochemicalheight = Helper.GetFloatAttribute(node, "petrochemicalheight", 0.0f);
            this.adsorbedmass        = Helper.GetFloatAttribute(node, "adsorbedmass", 0.0f);
            this.restmass            = Helper.GetFloatAttribute(node, "restmass", 0.0f);

            this.depth = Helper.GetFloatAttribute(node, "depth", 0.0f);
            this.concentrationinsoil     = Helper.GetFloatAttribute(node, "concentrationinsoil", 0.0f);
            this.timeconcentrationinsoil = Helper.GetFloatAttribute(node, "timeconcentrationinsoil", 0.0f);
            this.speedvertical           = Helper.GetFloatAttribute(node, "speedvertical", 0.0f);

            this.timewatercomletion    = Helper.GetFloatAttribute(node, "timewatercomletion", 0.0f);
            this.dtimemaxwaterconc     = Helper.GetFloatAttribute(node, "dtimemaxwaterconc", 0.0f);
            this.timemaxwaterconc      = Helper.GetFloatAttribute(node, "timemaxwaterconc", 0.0f);
            this.maxconcentrationwater = Helper.GetFloatAttribute(node, "maxconcentrationwater", 0.0f);
            this.ozcorrection          = Helper.GetFloatAttribute(node, "ozcorrection", 0.0f);
            this.ecoobjectsearchradius = Helper.GetFloatAttribute(node, "ecoobjectsearchradius", 0.0f);

            {
                XmlNode x = node.SelectSingleNode(".//AnchorPointList");
                if (x != null)
                {
                    this.anchorpointlist = AnchorPointList.CreateAnchorPointList(x);
                }
                else
                {
                    this.anchorpointlist = null;
                }
            }
            {
                XmlNode x = node.SelectSingleNode(".//GroundPollutionList");
                if (x != null)
                {
                    this.groundpolutionlist = GroundPollutionList.Create(x);
                }
                else
                {
                    this.groundpolutionlist = null;
                }
            }
            {
                XmlNode x = node.SelectSingleNode(".//WaterProperties");
                if (x != null)
                {
                    this.waterproperties = new WaterProperties(x);
                }
                else
                {
                    this.waterproperties = null;
                }
            }
            {
                XmlNode x = node.SelectSingleNode(".//EcoObjectsList");
                if (x != null)
                {
                    this.ecoobjecstlist = EcoObjectsList.CreateEcoObjectsList(x);
                }
                else
                {
                    this.ecoobjecstlist = null;
                }
            }
        }
Ejemplo n.º 5
0
 public GroundPollutionList(Point center, AnchorPointList list, PetrochemicalType petrochemicaltype, float concentration = 0.0f, float watertime = 0.0f)
 {
     this.AddRange(center, list, petrochemicaltype, concentration, watertime);
 }
Ejemplo n.º 6
0
        public ActionResult AnchorPoint()
        {
            RGEContext db = null;

            ViewBag.EGHLayout = "RGE.AnchorPoint";
            ActionResult view     = View("Index");
            string       menuitem = this.HttpContext.Request.Params["menuitem"] ?? "Empty";

            try
            {
                db          = new RGEContext();
                ViewBag.msg = "Соединение с базой данных установлено";
                view        = View("AnchorPoint", db);

                if (menuitem.Equals("AnchorPoint.Create"))
                {
                    view = View("AnchorPointCreate");
                }

                else if (menuitem.Equals("AnchorPoint.Delete"))
                {
                    string type_code_item = this.HttpContext.Request.Params["type_code"];
                    if (type_code_item != null)
                    {
                        int c = 0;
                        if (int.TryParse(type_code_item, out c))
                        {
                            EGH01DB.Points.AnchorPoint ah = new EGH01DB.Points.AnchorPoint();
                            if (EGH01DB.Points.AnchorPoint.GetById(db, c, ref ah))
                            {
                                view = View("AnchorPointDelete", ah);
                            }
                        }
                    }
                }
                else if (menuitem.Equals("AnchorPoint.Update"))
                {
                    string type_code_item = this.HttpContext.Request.Params["type_code"];

                    if (type_code_item != null)
                    {
                        int c = 0;
                        if (int.TryParse(type_code_item, out c))
                        {
                            EGH01DB.Points.AnchorPoint ah = new EGH01DB.Points.AnchorPoint();
                            if (EGH01DB.Points.AnchorPoint.GetById(db, c, ref ah))
                            {
                                view = View("AnchorPointUpdate", ah);
                            }
                        }
                    }
                }
                else if (menuitem.Equals("AnchorPointCrearePoint.Create"))
                {
                    view = View("AnchorPointCreatePoint");
                }
                else if (menuitem.Equals("AnchorPoint.Excel"))
                {
                    EGH01DB.Points.AnchorPointList list = new AnchorPointList(db);
                    XmlNode     node  = list.toXmlNode();
                    XmlDocument doc   = new XmlDocument();
                    XmlNode     nnode = doc.ImportNode(node, true);
                    doc.AppendChild(nnode);
                    doc.Save(Server.MapPath("~/App_Data/AnchorPoint.xml"));
                    view = View("Index");

                    view = File(Server.MapPath("~/App_Data/AnchorPoint.xml"), "text/plain", "Опорные точки.xml");
                }
            }
            catch (RGEContext.Exception e)
            {
                ViewBag.msg = e.message;
            }
            catch (Exception e)
            {
                ViewBag.msg = e.Message;
            }

            return(view);
        }