void SetWaterValues(WaterProperties waterProperties) { setFreezeTemp = waterProperties.freezeTemp; setBurnTemp = waterProperties.burnTemp; setMinTemp = waterProperties.minTemp; setMaxTemp = waterProperties.maxTemp; setNextTouchRate = waterProperties.nextTouchRate; }
// Use this for initialization void Start() { p = transform.gameObject.GetComponent <pickItems>(); e = transform.gameObject.GetComponent <ElementControl>(); well = wellwater.GetComponent <WaterProperties>(); w1 = lake1.GetComponent <WaterProperties>(); w2 = lake2.GetComponent <WaterProperties>(); L = GameObject.FindGameObjectWithTag("fire base1").transform.gameObject.GetComponent <DoorTorchLight>(); L2 = firebase2.GetComponent <DoorTorchLight>(); }
private void OnTriggerEnter(Collider trigger) { if (base.enabled && pilotBody != null) { WaterProperties component = trigger.gameObject.GetComponent <WaterProperties>(); if (component != null) { mutableData.WaterProperties = component.properties; pilotBody.drag = mutableData.WaterProperties.Drag; } } }
public ActionResult WaterPropertiesUpdate(WaterPropertiesView wpv) { RGEContext db = null; ViewBag.EGHLayout = "RGE.WaterProperties"; ActionResult view = View("Index"); string menuitem = this.HttpContext.Request.Params["menuitem"] ?? "Empty"; try { db = new RGEContext(); if (menuitem.Equals("WaterProperties.Update.Update")) { int water_code = wpv.water_code; string strtemperature = this.HttpContext.Request.Params["temperature"] ?? "Empty"; float temperature; Helper.FloatTryParse(strtemperature, out temperature); string strviscocity = this.HttpContext.Request.Params["viscocity"] ?? "Empty"; float viscocity; Helper.FloatTryParse(strviscocity, out viscocity); string strdensity = this.HttpContext.Request.Params["density"] ?? "Empty"; float density; Helper.FloatTryParse(strdensity, out density); string strtension = this.HttpContext.Request.Params["tension"] ?? "Empty"; float tension; Helper.FloatTryParse(strtension, out tension); WaterProperties wp = new WaterProperties((int)water_code, (float)temperature, (float)viscocity, (float)density, (float)tension); if (EGH01DB.Primitives.WaterProperties.Update(db, wp)) { view = View("WaterProperties", db); } } else if (menuitem.Equals("WaterProperties.Update.Cancel")) { view = View("WaterProperties", db); } } catch (RGEContext.Exception e) { ViewBag.msg = e.message; } catch (Exception e) { ViewBag.msg = e.Message; } return(view); }
// Use this for initialization void Start() { targetrotation = Quaternion.Euler(-89.999f, 180f, 0f); targetrotation2 = Quaternion.Euler(-89.999f, 180f, -100f); //cam = headObject.Find("Camera").GetComponent<Camera>(); if (water != null) { wp = water.GetComponent <WaterProperties> (); } E = GameObject.FindGameObjectWithTag("Player").transform.gameObject.GetComponent <ElementControl>(); P = transform.gameObject.GetComponent <ParentFollowChild>(); // waterLevel = wp.GetActualHeight(); // transform.position = new Vector3 ( // transform.position.x, // waterLevel+21f, //wp.GetActualHeight (), // transform.position.z // ); }
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; } } }
public ActionResult WaterProperties() { RGEContext db = null; ActionResult view = View("Index"); ViewBag.EGHLayout = "RGE.WaterProperties"; string menuitem = this.HttpContext.Request.Params["menuitem"] ?? "Empty"; try { db = new RGEContext(); ViewBag.msg = "Соединение с базой данных установлено"; view = View("WaterProperties", db); if (menuitem.Equals("WaterProperties.Create")) { view = View("WaterPropertiesCreate"); } else if (menuitem.Equals("WaterProperties.Delete")) { string water_code = this.HttpContext.Request.Params["water_code"]; if (water_code != null) { int c = 0; if (int.TryParse(water_code, out c)) { EGH01DB.Primitives.WaterProperties wp = new EGH01DB.Primitives.WaterProperties(); if (EGH01DB.Primitives.WaterProperties.GetByCode(db, c, out wp)) { view = View("WaterPropertiesDelete", wp); } } } } else if (menuitem.Equals("WaterProperties.Update")) { string water_code = this.HttpContext.Request.Params["water_code"]; if (water_code != null) { int c = 0; if (int.TryParse(water_code, out c)) { WaterProperties wp = new WaterProperties(); if (EGH01DB.Primitives.WaterProperties.GetByCode(db, c, out wp)) { view = View("WaterPropertiesUpdate", wp); } } } } else if (menuitem.Equals("WaterProperties.Excel")) { EGH01DB.Primitives.WaterPropertiesList list = new EGH01DB.Primitives.WaterPropertiesList(db); XmlNode node = list.toXmlNode(); XmlDocument doc = new XmlDocument(); XmlNode nnode = doc.ImportNode(node, true); doc.AppendChild(nnode); doc.Save(Server.MapPath("~/App_Data/WaterProperties.xml")); view = View("Index"); view = File(Server.MapPath("~/App_Data/WaterProperties.xml"), "text/plain", "Свойства воды.xml"); } } catch (RGEContext.Exception e) { ViewBag.msg = e.message; } catch (Exception e) { ViewBag.msg = e.Message; } return(view); }
void Start() { w1 = lake1.GetComponent <WaterProperties>(); begin = this.transform.localPosition; target = new Vector3(-170f, 72.37f, -113.8f); }
public void SetValues() { ElementType type = GetComponent <Element>().CurrentType; switch (type) { case ElementType.Wood: if (GameObject.FindGameObjectWithTag("WoodManager") == null) { if (this.gameObject.GetComponent <WoodProperties>() != null) { WoodProperties woodValues = this.gameObject.GetComponent <WoodProperties>() as WoodProperties; SetWoodValues(woodValues); break; } else { WoodProperties woodValues = this.gameObject.AddComponent <WoodProperties>() as WoodProperties; SetWoodValues(woodValues); break; } } else { if (this.gameObject.GetComponent <WoodProperties>() == null) { WoodManagerValues woodManagerValues = GameObject.FindGameObjectWithTag("WoodManager").GetComponent <WoodManagerValues>() as WoodManagerValues; SetWoodValues(woodManagerValues); //SetWoodValues(); break; } else { WoodProperties woodValues = this.gameObject.GetComponent <WoodProperties>() as WoodProperties; SetWoodValues(woodValues); break; } } case ElementType.Water: if (GameObject.FindGameObjectWithTag("WaterManager") == null) { if (this.gameObject.GetComponent <WaterProperties>() != null) { WaterProperties waterValues = this.gameObject.GetComponent <WaterProperties>() as WaterProperties; SetWaterValues(waterValues); break; } else { WaterProperties waterValues = this.gameObject.AddComponent <WaterProperties>() as WaterProperties; SetWaterValues(waterValues); break; } } else { if (this.gameObject.GetComponent <WaterProperties>() == null) { GameObject waterManagerValues = GameObject.FindGameObjectWithTag("WaterManager"); SetWaterValues(waterManagerValues); break; } else { WaterProperties waterValues = this.gameObject.GetComponent <WaterProperties>() as WaterProperties; SetWaterValues(waterValues); break; } } case ElementType.Fire: if (GameObject.FindGameObjectWithTag("FireManager") == null) { if (this.gameObject.GetComponent <FireProperties>() != null) { FireProperties fireValues = this.gameObject.GetComponent <FireProperties>() as FireProperties; SetFireValues(fireValues); break; } else { FireProperties fireValues = this.gameObject.AddComponent <FireProperties>() as FireProperties; SetFireValues(fireValues); break; } } else { if (this.gameObject.GetComponent <FireProperties>() == null) { GameObject fireManagerValues = GameObject.FindGameObjectWithTag("FireManager"); SetFireValues(fireManagerValues); break; } else { FireProperties fireValues = this.gameObject.GetComponent <FireProperties>() as FireProperties; SetFireValues(fireValues); break; } } case ElementType.Ice: if (GameObject.FindGameObjectWithTag("IceManager") == null) { if (this.gameObject.GetComponent <IceProperties>() != null) { IceProperties iceValues = this.gameObject.GetComponent <IceProperties>() as IceProperties; SetIceValues(iceValues); break; } else { IceProperties iceValues = this.gameObject.AddComponent <IceProperties>() as IceProperties; SetIceValues(iceValues); break; } } else { if (this.gameObject.GetComponent <IceProperties>() == null) { GameObject iceManagerValues = GameObject.FindGameObjectWithTag("IceManager"); SetIceValues(iceManagerValues); break; } else { IceProperties iceValues = this.gameObject.GetComponent <IceProperties>() as IceProperties; SetIceValues(iceValues); break; } } } }