Ejemplo n.º 1
0
        public ActionResult HisTraceShow(string MineCode)
        {
            LoadModel loadModel = new LoadModel();

            loadModel.UserMineCode = MineCode;
            string sql = "select filename, FileID from G_DPicFile";

            con         = Get128Con();
            ViewBag.Url = "";
            DataTable dt  = null;
            var       dal = new DataDAL();

            try
            {
                string json = "";
                dt = dal.ReturnData(sql, con);

                if (dt.Rows.Count > 0)
                {
                    loadModel.FileID = dt.Rows[0]["FileID"].ToString();
                    string fo = dt.Rows[0]["filename"].ToString();
                    fo          = fo.Substring(fo.LastIndexOf("."), fo.Length - fo.LastIndexOf("."));
                    ViewBag.Url = "temp" + fo;
                }
            }
            catch (Exception e)  { }
            return(View(loadModel));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> LoadAsync([FromBody] LoadModel request)
        {
            if (request == null || request.Password == null)
            {
                return(new ObjectResult(new FailureResponse {
                    Message = "Bad request", Details = ""
                }));
            }

            try
            {
                Network network = Global.Config.Network;
                if (!string.IsNullOrWhiteSpace(request.Network))
                {
                    network = Network.GetNetwork(request.Network);
                    await Global.Config.SetNetworkAsync(network);
                }

                await Global.WalletWrapper.LoadAsync(request.Password, network);

                return(new ObjectResult(new SuccessResponse()));
            }
            catch (Exception ex)
            {
                return(new ObjectResult(new FailureResponse {
                    Message = ex.Message, Details = ex.ToString()
                }));
            }
        }
Ejemplo n.º 3
0
        public async Task DownloadFile()
        {
            using (var client = new WebClient())
            {
                Debug.Log($"Starting download for {name}");
                singleton.debugDisplay.text = ($"Starting download for {name}");
                var url = $"https://archive3d.net/?a=download&do=get&id={id}";

                var location = $"./Assets/Resources/dl/raw/{name}.zip";
                await client.DownloadFileTaskAsync(url, location);

                Debug.Log(name + " download complete");
                singleton.debugDisplay.text = (name + " download complete");

                string extractPath = $"./Assets/Resources/dl/{name}/";

                ZipFile.ExtractToDirectory(location, extractPath);

                Debug.Log(name + " unzip complete");
                singleton.debugDisplay.text = (name + " extract complete");

                // Check if download and extract was successful
                if (Directory.GetFiles(extractPath, "*.3ds").Any())
                {
                    var modelLocation = Directory.GetFiles(extractPath, "*.3ds").First();
                    namedModels[name] = LoadModel.load(modelLocation);
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 加载模拟量查询数据
        /// </summary>
        /// <returns>返回视图</returns>
        public ActionResult AnalogQantity(string MineCode)
        {
            LoadModel loadModel = new LoadModel();

            loadModel.UserMineCode = MineCode;
            return(View(loadModel));
        }
Ejemplo n.º 5
0
        public ActionResult LDKZIndex(string MineCode)
        {
            LoadModel lm = new LoadModel();

            lm.UserMineCode = MineCode;
            return(View(lm));
        }
Ejemplo n.º 6
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        records = LoadModel.ParseEmployeeExp(File.ReadAllLines(dlg.FileName), tbDelimiter.Text, tbDateFormat.Text);

                        if (records.Count < 2)
                        {
                            MessageBox.Show("The file has not enoough records");
                        }
                        else
                        {
                            tbFilename.Text = Path.GetFileName(dlg.FileName);
                            tbCount.Text    = records.Count.ToString();
                            LoadTeamsInGrid();
                            pMain.Enabled = true;
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "Error");
                    }
                }
            }
        }
Ejemplo n.º 7
0
 public Building( LoadModel model, int _capacity, int _durability, int _cost, float _buildingTime)
     : base(model)
 {
     this.model = model;
     this.capacity = _capacity;
     this.cost = _cost;
     this.buildingTime = _buildingTime;
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 开关量状态曲线
        /// </summary>
        /// <returns></returns>
        public ActionResult SwitchState(string MineCode)
        {
            LoadModel loadModel = new LoadModel();

            loadModel.UserMineCode = MineCode;
            return(View(loadModel));
            //return View();
        }
Ejemplo n.º 9
0
 public Beetle(int hp, float armor, float strength, float range, int cost, float buildingTime, LoadModel model, int maxCapacity, float gaterTime, float atackInterval,float Scope,float ArmorBuff)
     : base(hp, armor, strength, range, cost, buildingTime, model, atackInterval)
 {
     this.Scope = Scope;
     this.ArmorBuffValue = ArmorBuff;
     this.modelHeight = 30;
     this.MaxHp = 100;
 }
Ejemplo n.º 10
0
 public Rock(LoadModel model, int clusterSize)
     : base(model, clusterSize)
 {
     for (int i = 0; i < clusterSize; i++)
     {
         stone.Add(new Stone());
     }
 }
 /// <summary>
 ///the constructor of  LoadViewModel.
 /// </summary>
 public LoadViewModel(LoadModel lm)
 {
     this.lmodel             = lm;
     this.dmodel             = DataModel.Instance;
     lmodel.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
 }
Ejemplo n.º 12
0
 public Cone(LoadModel model)
     : base(model)
 {
     selectable = false;
     this.hp = 350;
        // LifeBar.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/health_bar"));
        // circle.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/elipsa"));
     //LifeBar.LifeLength = model.Scale.X * 100;
 }
Ejemplo n.º 13
0
        public static void LoadAsyncObject(string path, System.Action callback = null, string tag = "Default", Transform parent = null)
        {
            LoadModel.LoadAsyncObject <GameObject>(path,
                                                   () => {
                Modeling.LoadPrefab(path, tag, parent);

                callback?.Invoke();
            });
        }
Ejemplo n.º 14
0
 public Log(LoadModel model,int ClusterSize)
     : base(model,ClusterSize)
 {
     this.ClusterSize = ClusterSize;
        for (int i = 0; i < ClusterSize; i++)
        {
        wood.Add(new Wood());
        }
 }
Ejemplo n.º 15
0
 public AntPeasant(int hp, float armor, float strength, float range, int cost, float buildingTime, LoadModel model, int maxCapacity, float gaterTime)
     : base(hp, armor, strength, range, cost, buildingTime, model)
 {
     this.maxCapacity = maxCapacity;
     this.capacity = 0;
     this.gaterTime = gaterTime;
     rock2 = 0;
     wood2 = 0;
 }
Ejemplo n.º 16
0
 public AntPeasant(LoadModel model)
     : base(model)
 {
     this.maxCapacity = 100;
     this.capacity = 0;
     this.gaterTime = 10;
     rock2 = 0;
     wood2 = 0;
 }
Ejemplo n.º 17
0
 public GrassHopper(int hp, float armor, float strength, float range, int cost, float buildingTime, LoadModel model, int maxCapacity, float gaterTime, float atackInterval,float Scope,float ArmorBuff)
     : base(hp, armor, strength, range, cost, buildingTime, model, atackInterval)
 {
     this.Scope = Scope;
     hp = 80;
     this.MaxHp = 80;
     this.modelHeight = 28;
     this.strength = 5;
     this.armor = 20;
 }
Ejemplo n.º 18
0
 public void EndInit()
 {
     if (IsTracingEnabled)
     {
         ImportTracer();
     }
     ImportPersister();
     SaveModel.RaiseCanExecuteChanged();
     LoadModel.RaiseCanExecuteChanged();
 }
Ejemplo n.º 19
0
 public void LoadAll(string dest, ulong taskId, LoadModel kwargs)
 {
     /// 获取input数据
     /// 组合,发送消息
     /// 等待响应返回
     /// 循环数清零
     GetInputMsg(kwargs);
     SendLoadMsg();
     _turn = 0;
 }
Ejemplo n.º 20
0
 public Spider(LoadModel model)
     : base(model)
 {
     LifeBar.LifeLength = model.Scale.X * 100;
        selectable = false;
        LifeBar.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/health_bar"));
        this.Hp = 100;
        this.modelHeight = 26;
        this.MaxHp = this.Hp;
        this.home = this.model.Position;
 }
Ejemplo n.º 21
0
        public ActionResult MCDay(string PageName, string UserAbility, string MineCode, string Height)
        {
            LoadModel loadModel = new LoadModel();

            loadModel.Height = Height;

            loadModel.UserAbility  = UserAbility;
            loadModel.UserMineCode = MineCode;

            return(View());
        }
Ejemplo n.º 22
0
        public Log(LoadModel model, int ClusterSize)
            : base(model, ClusterSize)
        {
            this.ClusterSize = ClusterSize;
            for (int i = 0; i < ClusterSize; i++)
            {
                wood.Add(new Wood());
            }

               // this.Model.BoundingSphere = new BoundingSphere(this.Model.BoundingSphere.Center, this.Model.BoundingSphere.Radius/10);
        }
Ejemplo n.º 23
0
 public StrongAnt(int hp, float armor, float strength, float range, int cost, float buildingTime, LoadModel model, float atackInterval)
     : base(hp, armor, strength, range, cost, buildingTime, model, atackInterval)
 {
     this.armor = 50;
     LifeBar.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/health_bar"));
     circle.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/elipsa"));
     LifeBar.LifeLength = model.Scale.X * 100;
     circle.Scale = this.model.Scale.Y * 120;
     this.armorAfterBuff = armor * 2;
     this.modelHeight = 14;
     this.MaxHp = 100;
 }
Ejemplo n.º 24
0
 public SunDew(LoadModel model, List<InteractiveModel> ants)
     : base(model)
 {
     selectable = false;
     this.Ants = ants;
     LifeBar.LifeLength = model.Scale.X * 100;
     circle.Scale = this.model.Scale.Y * 120;
     LifeBar.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/health_bar"));
     circle.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/elipsa"));
     this.Hp = 100;
     this.MaxHp = 100;
     this.Model.Position = new Vector3(this.Model.Position.X, 0.0f, this.Model.Position.Z);
     this.modelHeight = 10;
 }
Ejemplo n.º 25
0
 public Queen(int hp, float armor, float strength, float range, int cost, float buildingTime, LoadModel model, int maxCapacity, float gaterTime, float atackInterval)
     : base(hp, armor, strength, range, cost, buildingTime, model, atackInterval)
 {
     this.armor = 20;
     base.elapsedTime = 0;
     LifeBar.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/health_bar"));
     LifeBar.LifeLength = model.Scale.X;
     circle.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/elipsa"));
     circle.Scale = model.Scale.X * 10;
     this.Model.switchAnimation("Idle");
     this.armorAfterBuff = armor * 2;
     hp = 100;
     this.modelHeight = 1;
     this.MaxHp = 100;
 }
Ejemplo n.º 26
0
        public ActionResult RtCurve(string MineCode, string IsFromAQSS)
        {
            LoadModel loadModel = new LoadModel();

            loadModel.UserMineCode = MineCode;
            if (!string.IsNullOrEmpty(IsFromAQSS))
            {
                loadModel.PreLoadData = "y";
            }
            else
            {
                loadModel.PreLoadData = "n";
            }
            return(View(loadModel));
        }
Ejemplo n.º 27
0
 public GrassHopper(LoadModel model)
     : base(model)
 {
     Scope = 100;
     LifeBar.LifeLength = model.Scale.X * 100;
     circle.Scale = this.model.Scale.Y * 120;
     LifeBar.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/health_bar"));
     circle.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/elipsa"));
     hp = 80;
     this.MaxHp = 80;
     this.modelHeight = 28;
     this.strength = 5;
     this.armor = 20;
     this.model.switchAnimation("Idle");
 }
Ejemplo n.º 28
0
 public Beetle(LoadModel model)
     : base(model)
 {
     sfereModel = new InteractiveModel(new LoadModel(StaticHelpers.StaticHelper.Content.Load<Model>("Models/sferazuka"), model.Position, Vector3.Zero, new Vector3(4.5f), StaticHelpers.StaticHelper.Device, model.light));
     Scope = 300;
     ArmorBuffValue = 100;
     LifeBar.LifeLength = model.Scale.X * 100;
     circle.Scale = this.model.Scale.Y * 120;
     LifeBar.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/health_bar"));
     circle.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/elipsa"));
     this.Hp = 200;
     this.modelHeight = 30;
     this.MaxHp = this.Hp;
     this.strength = 10;
     model.switchAnimation("Idle");
 }
Ejemplo n.º 29
0
        public Queen(LoadModel model)
            : base(model)
        {
            this.armor = 20;

            elapsedTime = 0;
            LifeBar.LifeLength = model.Scale.X * 100;
            circle.Scale = this.model.Scale.Y * 120;
            LifeBar.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/health_bar"));
            circle.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/elipsa"));
            this.armorAfterBuff = armor * 2;
            hp = 100;
            this.Model.switchAnimation("Idle");
            this.modelHeight = 1;
            this.MaxHp = 100;
        }
Ejemplo n.º 30
0
        static void Main(string[] args)
        {
            try
            {
                string filePath = "..//..//testData";

                //Console.WriteLine("Filepath or file name, if it is in the application folder:");
                //do
                //{
                //    filePath = Console.ReadLine();
                //} while (!File.Exists(filePath));

                string[] fileLines = File.ReadAllLines(filePath);
                if (fileLines.Length > 1)
                {
                    List <EmployeeExp> records = LoadModel.ParseEmployeeExp(fileLines, ",", null);
                    Console.WriteLine("Records count:" + records.Count);
                    Console.WriteLine();

                    if (records.Count > 0)
                    {
                        List <TeamWork> teamWorkExp = Statistics.GetTeamWorkPeriods(records);
                        foreach (TeamWork work in teamWorkExp)
                        {
                            Console.WriteLine($"Team {work.TeamKey} has work experiance together {work.TotalDays}");

                            foreach (Work w in work.WorkTogether)
                            {
                                Console.WriteLine($"\t ProjectId - {w.ProjectId} From: {w.DateFrom.ToShortDateString()} To: {w.DateTo.ToShortDateString()}");
                            }

                            Console.WriteLine();
                        }

                        TeamWork maxDays = teamWorkExp.OrderBy(x => x.TotalDays).Last();
                        Console.WriteLine($"Team {maxDays.TeamKey} has the longest experiance together {maxDays.TotalDays} days.");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            Console.ReadLine();
        }
Ejemplo n.º 31
0
 public StrongAnt(LoadModel model)
     : base(model)
 {
     this.armor = 50;
     LifeBar.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/health_bar"));
     circle.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/elipsa"));
     hp = 100;
     range = 1000;
     atackInterval = 10;
     LifeBar.LifeLength = model.Scale.X * 100;
     circle.Scale = this.model.Scale.Y * 120;
     this.armorAfterBuff = armor * 2;
     this.modelHeight = 0;
     this.MaxHp = 100;
     this.strength = 10;
     this.Model.switchAnimation("Idle");
 }
Ejemplo n.º 32
0
 public AntSpitter(LoadModel model)
     : base(model)
 {
     this.armor = 20; bullets = new List<SpitMissle>();
     LifeBar.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/health_bar"));
     circle.update(StaticHelpers.StaticHelper.Content.Load<Microsoft.Xna.Framework.Graphics.Texture2D>("Textures/HudTextures/elipsa"));
     hp = 100;
     range = 1000;
     atackInterval = 6000;
     LifeBar.LifeLength = model.Scale.X * 100;
     circle.Scale = this.model.Scale.Y * 120;
     this.armorAfterBuff = armor * 2;
     this.modelHeight = 14;
     this.MaxHp = 100;
     this.Model.switchAnimation("Idle");
     this.rangeOfSight=300;
 }
Ejemplo n.º 33
0
        /// <summary>
        ///     負荷更新
        /// </summary>
        /// <param name="id"></param>
        /// <param name="loadName"></param>
        /// <returns></returns>
        public bool UpdateLoad(int id, string loadName)
        {
            var model = new LoadModel
            {
                Id       = id,
                LoadName = loadName
            };

            using (var db = new SQLiteConnection(DbConst.DbPath))
            {
                var result = db.Update(model);
                if (result == DbConst.Failed)
                {
                    return(false);
                }
                db.Commit();
                return(true);
            }
        }
Ejemplo n.º 34
0
        /// <summary>
        ///     負荷登録
        /// </summary>
        /// <param name="loadName"></param>
        /// <returns></returns>
        public bool RegistLoad(string loadName)
        {
            var model = new LoadModel
            {
                LoadName     = loadName,
                RegistedDate = DateTime.Now
            };

            using (var db = new SQLiteConnection(DbConst.DbPath))
            {
                var result = db.Insert(model);
                if (result == DbConst.Failed)
                {
                    return(false);
                }
                db.Commit();
                return(true);
            }
        }
Ejemplo n.º 35
0
    public T Readjson <T>(string path) where T : new()
    {
        string jsonfile = path;
        T      instance = new T();

        using (System.IO.StreamReader file = System.IO.File.OpenText(jsonfile))
        {
            using (JsonTextReader reader = new JsonTextReader(file))
            {
                JObject o = (JObject)JToken.ReadFrom(reader);
                Dictionary <string, object> r = JsonConvert.DeserializeObject <Dictionary <string, object> >(o.ToString());
                if (r.ContainsKey("app_id_submodel"))
                {
                    instance = JsonConvert.DeserializeObject <T>(r["app_id_submodel"].ToString());
                }
            }
        }
        return(instance);
    }
Ejemplo n.º 36
0
        public void GetInputMsg(LoadModel kwargs)
        {
            Dictionary <string, Dictionary <string, string> > load = kwargs.Load;

            foreach (KeyValuePair <string, Dictionary <string, string> > materialList in load)
            {
                _inputsModel.Material = materialList.Key;
                foreach (KeyValuePair <string, string> posList in materialList.Value)
                {
                    _inputsModel.Position = posList.Key;
                    GetParamList(posList.Value, out string area, out string src, out string location,
                                 out bool?sealing, out bool?tear, out bool?centrifuge, out string centrifugePn);

                    if (src == "hotel")
                    {
                        /// 从冰箱上料
                        //FindGoodsFromHotel();
                    }
                }
            }
        }
Ejemplo n.º 37
0
 public Trigger(LoadModel model)
     : base(model)
 {
 }
        public static Result CreateVisualizationSheets(UIDocument uiDoc)
        {
            //ToDo: these objects would be better passed to/from a UI, or possibly stored somewhere as settings

            BuildingLoadModel _buildingLoadModel = new BuildingLoadModel(0, 0, 7.0, 7.0, 7.0, 7.0, 7.0);

            List <ILoadModel> _levelLiveLoadPerSquareFoots = new List <ILoadModel>
            {
                LoadModel.Create("ROOF", LoadType.Capacity, 40),
                LoadModel.Create("Level 18", LoadType.Capacity, 24),
                LoadModel.Create("Level 17", LoadType.Capacity, 24),
                LoadModel.Create("Level 16", LoadType.Capacity, 24),
                LoadModel.Create("Level 15", LoadType.Capacity, 24),
                LoadModel.Create("Level 14", LoadType.Capacity, 24),
                LoadModel.Create("Level 13", LoadType.Capacity, 24),
                LoadModel.Create("Level 12", LoadType.Capacity, 24),
                LoadModel.Create("Level 11", LoadType.Capacity, 24),
                LoadModel.Create("Level 10", LoadType.Capacity, 24),
                LoadModel.Create("Level 09", LoadType.Capacity, 24),
                LoadModel.Create("Level 08", LoadType.Capacity, 24),
                LoadModel.Create("Level 07", LoadType.Capacity, 24),
                LoadModel.Create("Level 06", LoadType.Capacity, 24),
                LoadModel.Create("Level 05", LoadType.Capacity, 24),
                LoadModel.Create("Level 04", LoadType.Capacity, 24),
                LoadModel.Create("Level 03", LoadType.Capacity, 24),
                LoadModel.Create("Level 02", LoadType.Capacity, 100),
                LoadModel.Create("Level 01", LoadType.Capacity, 100),
                LoadModel.Create("P01", LoadType.Capacity, 40),
                LoadModel.Create("P02", LoadType.Capacity, 40),
                LoadModel.Create("P03", LoadType.Capacity, 40),
                LoadModel.Create("P04", LoadType.Capacity, 40),
                LoadModel.Create("P05", LoadType.Capacity, 40),

                LoadModel.Create("ROOF", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 18", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 17", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 16", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 15", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 14", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 13", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 12", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 11", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 10", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 09", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 08", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 07", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 06", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 05", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 04", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 03", LoadType.LiveLoad, 40),
                LoadModel.Create("Level 02", LoadType.LiveLoad, 100),
                LoadModel.Create("Level 01", LoadType.LiveLoad, 100),
                LoadModel.Create("P01", LoadType.LiveLoad, 45),
                LoadModel.Create("P02", LoadType.LiveLoad, 45),
                LoadModel.Create("P03", LoadType.LiveLoad, 45),
                LoadModel.Create("P04", LoadType.LiveLoad, 45),
                LoadModel.Create("P05", LoadType.LiveLoad, 45),

                LoadModel.Create("Level 18", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 17", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 16", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 15", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 14", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 13", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 12", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 11", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 10", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 09", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 08", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 07", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 06", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 05", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 04", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 03", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 02", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("Level 01", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("P01", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("P02", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("P03", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("P04", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                LoadModel.Create("P05", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
            };

            Result _result = Result.Cancelled;

            using (Transaction _trans = new Transaction(uiDoc.Document, "Create Visualization View"))
            {
                _trans.Start();
                try
                {
                    _result = createVisualizationSheets(uiDoc, _buildingLoadModel, _levelLiveLoadPerSquareFoots);

                    _trans.Commit();
                }
                catch (Exception _ex)
                {
                    _trans.RollBack();
#if DEBUG
                    string _error = _ex.Message + Environment.NewLine + Environment.NewLine + _ex.StackTrace;
                    TaskDialog.Show("Error", _error);
#endif
                    return(Result.Failed);
                }
            }

            return(_result);
        }
Ejemplo n.º 39
0
        public static Result PlaceTemporaryShoring(UIDocument uiDoc)
        {
            Result _result = Result.Cancelled;

            using (Transaction _trans = new Transaction(uiDoc.Document, "Place Temporary Shoring"))
            {
                _trans.Start();
                try
                {
                    //ToDo: these objects would be better passed to/from a UI, or possibly stored somewhere as settings
                    BuildingLoadModel _buildingLoadModel = new BuildingLoadModel(0, 0, 7.0, 7.0, 7.0, 7.0, 7.0);

                    List <ILoadModel> _loadModels = new List <ILoadModel>
                    {
                        LoadModel.Create("Level 18", LoadType.Capacity, 24),
                        LoadModel.Create("Level 17", LoadType.Capacity, 24),
                        LoadModel.Create("Level 16", LoadType.Capacity, 24),
                        LoadModel.Create("Level 15", LoadType.Capacity, 24),
                        LoadModel.Create("Level 14", LoadType.Capacity, 24),
                        LoadModel.Create("Level 13", LoadType.Capacity, 24),
                        LoadModel.Create("Level 12", LoadType.Capacity, 24),
                        LoadModel.Create("Level 11", LoadType.Capacity, 24),
                        LoadModel.Create("Level 10", LoadType.Capacity, 24),
                        LoadModel.Create("Level 09", LoadType.Capacity, 24),
                        LoadModel.Create("Level 08", LoadType.Capacity, 24),
                        LoadModel.Create("Level 07", LoadType.Capacity, 24),
                        LoadModel.Create("Level 06", LoadType.Capacity, 24),
                        LoadModel.Create("Level 05", LoadType.Capacity, 24),
                        LoadModel.Create("Level 04", LoadType.Capacity, 24),
                        LoadModel.Create("Level 03", LoadType.Capacity, 24),
                        LoadModel.Create("Level 02", LoadType.Capacity, 100),
                        LoadModel.Create("Level 01", LoadType.Capacity, 100),
                        LoadModel.Create("P1", LoadType.Capacity, 40),
                        LoadModel.Create("P2", LoadType.Capacity, 40),
                        LoadModel.Create("P3", LoadType.Capacity, 40),
                        LoadModel.Create("P4", LoadType.Capacity, 40),
                        LoadModel.Create("P5", LoadType.Capacity, 40),

                        LoadModel.Create("ROOF", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 18", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 17", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 16", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 15", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 14", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 13", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 12", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 11", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 10", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 09", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 08", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 07", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 06", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 05", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 04", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 03", LoadType.LiveLoad, 40),
                        LoadModel.Create("Level 02", LoadType.LiveLoad, 100),
                        LoadModel.Create("Level 01", LoadType.LiveLoad, 100),
                        LoadModel.Create("P1", LoadType.LiveLoad, 45),
                        LoadModel.Create("P2", LoadType.LiveLoad, 45),
                        LoadModel.Create("P3", LoadType.LiveLoad, 45),
                        LoadModel.Create("P4", LoadType.LiveLoad, 45),
                        LoadModel.Create("P5", LoadType.LiveLoad, 45),

                        LoadModel.Create("Level 18", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 17", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 16", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 15", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 14", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 13", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 12", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 11", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 10", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 09", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 08", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 07", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 06", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 05", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 04", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 03", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 02", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("Level 01", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("P1", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("P2", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("P3", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("P4", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                        LoadModel.Create("P5", LoadType.Formwork, _buildingLoadModel.FormWeightPerSquareFoot),
                    };


                    _result = placeTemporaryShoring(uiDoc, _buildingLoadModel, _loadModels, @"C:\ProgramData\Autodesk\Revit\Addins\2021\ApatosReshoring\Reshoring Poles Ellis 4x4.rfa", "6-on-6");

                    _trans.Commit();
                }
                catch (Exception _ex)
                {
                    _trans.RollBack();
#if DEBUG
                    string _error = _ex.Message + Environment.NewLine + Environment.NewLine + _ex.StackTrace;
                    TaskDialog.Show("Error", _error);
#endif
                    return(Result.Failed);
                }
            }

            return(_result);
        }
Ejemplo n.º 40
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     LoadModel.Invoke(sender, e);
 }
Ejemplo n.º 41
0
 public GrassHopper(LoadModel model)
     : base(model)
 {
     Scope = 100;
     ArmorBuffValue = 100;
 }
Ejemplo n.º 42
0
        public IHttpActionResult Upload([FromUri] LoadModel parametros)
        {
            RegistroControlModel recordCreated = null;
            FileStream           xfile         = null;

            try
            {
                //var value = registroService.IsValidLoad(DateTime.Now);
                //if (!value)
                //    return BadRequest("Fecha de carga no permitida");
                string path   = WebConfigurationManager.AppSettings["upLoadPath"];
                var    userId = User.Identity.GetUserId();
                if (!Request.Content.IsMimeMultipartContent())
                {
                    this.Request.CreateResponse(HttpStatusCode.UnsupportedMediaType);
                }
                //var path = string.Empty;
                var file = HttpContext.Current.Request.Files.Count > 0 ?
                           HttpContext.Current.Request.Files[0] : null;
                if (file != null && file.ContentLength > 0)
                {
                    var fileName = Path.GetFileName(file.FileName);
                    path = Path.Combine(
                        path,
                        fileName
                        );
                    if (File.Exists(path))
                    {
                        File.Delete(path);
                    }
                    file.SaveAs(path);
                }
                else
                {
                    return(BadRequest("Debe proveer un archivo de carga contable."));
                }
                if (File.Exists(path))
                {
                    MemoryStream ms = new MemoryStream();
                    xfile = new FileStream(path, FileMode.Open, FileAccess.Read);

                    xfile.CopyTo(ms);
                    using (var reader = ExcelReaderFactory.CreateReader(ms))
                    {
                        var result = reader.AsDataSet(new ExcelDataSetConfiguration()
                        {
                            UseColumnDataType  = true,
                            ConfigureDataTable = (tableReader) => new ExcelDataTableConfiguration()
                            {
                                EmptyColumnNamePrefix = "Column",
                                UseHeaderRow          = false,
                                ReadHeaderRow         = (rowReader) =>
                                {
                                    rowReader.Read();
                                },
                                FilterRow = (rowReader) =>
                                {
                                    return(true);
                                },
                                FilterColumn = (rowReader, columnIndex) =>
                                {
                                    return(true);
                                }
                            }
                        });
                        PartidasContent data = new PartidasContent();
                        if (parametros.tipoOperacion == Convert.ToInt16(BusinessEnumerations.TipoOperacion.CARGA_MASIVA))
                        {
                            data = fileService.cargaMasiva(result, userId, parametros.area);
                        }
                        else
                        {
                            data = fileService.cargaInicial(result, userId, parametros.area);
                        }

                        var registroModel = new RegistroControlModel()
                        {
                            RC_USUARIO_CREACION = userId,
                            CA_ID_AREA          = parametros.area,
                            EV_COD_EVENTO       = parametros.cod_event
                        };
                        if (data.ListError.Count == 0)
                        {
                            registroService.FileName = file.FileName;
                            recordCreated            = registroService.LoadFileData(registroModel, data.ListPartidas, parametros.tipoOperacion);
                            reader.Close();
                        }

                        else
                        {
                            reader.Close();
                            return(Ok(new { Messaje = "El contenido del archivo no cumple con el formato requerido.", Listerror = data.ListError }));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                return(BadRequest($"Error en la carga del archivo. {ex.Message}"));
            }
            finally
            {
                if (xfile != null)
                {
                    xfile.Close();
                }
            }

            return(Ok(new { Message = "The file has been loaded into database.Please check contents.", RegistroControl = recordCreated.RC_REGISTRO_CONTROL }));
        }
Ejemplo n.º 43
0
 public override void DrawOpaque(GameCamera.FreeCamera camera, float Alpha,LoadModel model2)
 {
     if (StaticHelpers.StaticHelper.buffOn)
      {
          StaticHelpers.StaticHelper.Device.BlendState = BlendState.AlphaBlend;
          base.DrawOpaque(camera, Alpha, model2);
          StaticHelpers.StaticHelper.Device.BlendState = BlendState.Opaque;
      }
 }
Ejemplo n.º 44
0
 void Brain.IObserver.onLoadModel(LoadModel response)
 {
 }
Ejemplo n.º 45
0
 void Start()
 {
     LoadModel PlayerModels = new LoadModel(PathOfPlayerModels, SizeboxExtension._micro.ToString());
 }
Ejemplo n.º 46
0
        public ActionResult EditOrder(int orderId)
        {
            IOrderRepository orderRepository = new OrderRepository();
            var order = orderRepository.getOrder(orderId);

            CustomerModel customer = new CustomerModel()
            {
                Name        = order.Customer.Name,
                Surname     = order.Customer.Surname,
                Address     = order.Customer.Address,
                PhoneNumber = order.Customer.PhoneNumber,
                Firm        = order.Customer.Firm
            };


            DriverModel driver = new DriverModel()
            {
                Name        = (order.Driver != null) ? order.Driver.Name : string.Empty,
                Surname     = (order.Driver != null) ? order.Driver.Surname : string.Empty,
                Address     = (order.Driver != null) ? order.Driver.Address : string.Empty,
                PhoneNumber = (order.Driver != null) ? order.Driver.PhoneNumber : string.Empty,
                Firm        = (order.Driver != null) ? order.Driver.Firm : string.Empty
            };

            RouteModel route = new RouteModel()
            {
                StartPoint = order.Route.StartPoint,
                EndPoint   = order.Route.EndPoint
            };

            LoadModel load = new LoadModel()
            {
                Name     = order.Load.Name,
                LoadType = order.Load.TypesFreight.TypeName,
                Weight   = order.Load.Weight ?? 0,
                Price    = order.Load.Price ?? 0
            };
            VehicleModel vehicle = new VehicleModel()
            {
                Name = order.TypesVehicle.TypeName
            };


            OrderEditModel orderModel = new OrderEditModel()
            {
                id       = order.id,
                load     = load,
                vehicle  = vehicle,
                route    = route,
                customer = customer,
                driver   = driver
            };

            ViewBag.Data = orderModel;
            var selectList = new List <SelectListItem>();

            foreach (var state in new StatusOrderRepository().GetAllStatus().ToList())
            {
                selectList.Add(new SelectListItem
                {
                    Text     = state.Status,
                    Value    = state.id.ToString(),
                    Selected = (state.id == order.idStatus)
                });
            }
            ViewBag.StateList = new SelectList(selectList, "Value", "Text");
            return(View());
        }
Ejemplo n.º 47
0
 public BlueWhaleRecognizer(LoadModel modelLoader)
 {
     _modelLoader = modelLoader;
 }
Ejemplo n.º 48
0
 public Material(LoadModel model, int ClusterSize)
     : base(model)
 {
     this.MaxClusterSize = ClusterSize;
        this.ClusterSize = ClusterSize;
 }
Ejemplo n.º 49
0
 public HyacyntFarm( LoadModel model, int _capacity, int _durability, int _cost, float _buildingTime,float cropTime)
     : base(model,_capacity,_durability,_cost,_buildingTime,cropTime)
 {
 }
Ejemplo n.º 50
0
        public JObject Load(LoadModel model)
        {
            string response = File.ReadAllText(@"" + model.Path);

            return(JObject.Parse(response));
        }
Ejemplo n.º 51
0
 public DicentraFarm( LoadModel model, int _capacity, int _durability, int _cost, float _buildingTime,float cropTime)
     : base(model,_capacity,_durability,_cost,_buildingTime,cropTime)
 {
     base.cropTime = cropTime;
 }
Ejemplo n.º 52
0
 public AntGranary(LoadModel model)
     : base(model)
 {
 }
Ejemplo n.º 53
0
 public Material(LoadModel model)
     : base(model)
 {
 }
 public void Load(LoadModel config)
 {
     m_Load.Add(config);
 }
 public GrassHopperBuilding(LoadModel model)
     : base(model)
 {
     Model.BuildBoundingSphereGrassHopper();
 }
Ejemplo n.º 56
0
 public Beetle(LoadModel model)
     : base(model)
 {
 }
Ejemplo n.º 57
0
 public AntGranary(LoadModel model, int _capacity, int _durability, int _cost, float _buildingTime,int _materialCapacity)
     : base(model,_capacity,_durability,_cost,_buildingTime)
 {
     this.materialsCapacity = _materialCapacity;
 }
        private static Result createVisualizationSheets(UIDocument uiDoc, BuildingLoadModel buildingLoadModel, IEnumerable <ILoadModel> levelLiveLoadPerSquareFoots)
        {
            //Setup
            Document _doc = uiDoc.Document;

            double _concreteDensityPoundsForcePerCubicFoot = 153.0;

            XYZ _capacityViewCoordinate = new XYZ(2.17649771769026, 0.766954561856788, 0);
            XYZ _combinedViewCoordinate = new XYZ(0.780872717690263, 0.766954561856788, 0);
            XYZ _demandViewCoordinate   = new XYZ(0.780872717690263, 1.83481042377296, 0);

            var _levels = Getters.GetLevels(_doc).OrderByDescending(p => p.Elevation).ToList();

            var _floors            = Getters.GetFloors(_doc).OrderBy(p => p.get_BoundingBox(null)?.Max.Z).ToList();
            var _structuralColumns = new FilteredElementCollector(_doc).OfCategory(BuiltInCategory.OST_StructuralColumns).OfType <FamilyInstance>().OrderBy(p => p.get_BoundingBox(null)?.Max.Z).ToList();
            var _structuralFraming = new FilteredElementCollector(_doc).OfCategory(BuiltInCategory.OST_StructuralFraming).OfType <FamilyInstance>().OrderBy(p => p.get_BoundingBox(null)?.Max.Z).ToList();
            var _walls             = new FilteredElementCollector(_doc).OfClass(typeof(Wall)).OfType <Wall>().OrderBy(p => p.get_BoundingBox(null)?.Max.Z).ToList();

            BoundingBoxXYZ _modelExtents =
                GeometryHelpers.GetElementsBBox(
                    new FilteredElementCollector(_doc).WhereElementIsViewIndependent().WhereElementIsNotElementType().ToList());

            _modelExtents.Min = new XYZ(_modelExtents.Min.X, _modelExtents.Min.Y, _levels.LastOrDefault().Elevation - 1.0);

            Category _directShapeCategory = Category.GetCategory(_doc, BuiltInCategory.OST_GenericModel);

            Level _levelAbove  = null;
            Level _bottomLevel = _levels.LastOrDefault();
            Level _topLevel    = _levels.FirstOrDefault();

            //Begin to generate our VisualizationDeliverables - these are sheets with 3 plan-orientation isometric views.
            //  NOTE - isometric views were used so that semi-transparent color overrides can be overlayed over each other to represent demands vs capacities
            //  ToDo: it would be valuable to scale transparency by percentage of overall demand/capacity
            List <VisualizationDeliverable> _visualizationDeliverables = new List <VisualizationDeliverable>();

            foreach (Level _level in _levels)
            {
                if (_levelAbove == null)
                {
                    _levelAbove = _level;
                }

                //Get the elements that are on our current Level
                List <Floor>          _currentLevelFloors            = _floors.Where(p => p.LevelId == _level.Id).ToList();
                List <FamilyInstance> _currentLevelStructuralColumns = new List <FamilyInstance>();
                List <FamilyInstance> _currentLevelStructuralFraming = new List <FamilyInstance>();
                List <Wall>           _currentLevelWalls             = new List <Wall>();

                BoundingBoxXYZ _levelBounds = new BoundingBoxXYZ
                {
                    Min = new XYZ(_modelExtents.Min.X, _modelExtents.Min.Y, _level.Elevation),
                    Max = new XYZ(_modelExtents.Max.X, _modelExtents.Max.Y, _levelAbove.Elevation)
                };

                BoundingBoxIsInsideFilter   _withinLevelBoundsFilter     = new BoundingBoxIsInsideFilter(new Outline(_levelBounds.Min, _levelBounds.Max));
                BoundingBoxIntersectsFilter _intersectsLevelBoundsFilter = new BoundingBoxIntersectsFilter(new Outline(_levelBounds.Min, _levelBounds.Max));

                if (_structuralColumns.Count > 0)
                {
                    _currentLevelStructuralColumns = new FilteredElementCollector(_doc, _structuralColumns.Select(p => p.Id).ToList()).WherePasses(_intersectsLevelBoundsFilter).OfType <FamilyInstance>().ToList();
                }
                else
                {
                    _currentLevelStructuralColumns = new List <FamilyInstance>();
                }

                if (_structuralFraming.Count > 0)
                {
                    _currentLevelStructuralFraming = new FilteredElementCollector(_doc, _structuralFraming.Select(p => p.Id).ToList()).WherePasses(_withinLevelBoundsFilter).OfType <FamilyInstance>().ToList();
                }
                else
                {
                    _currentLevelStructuralFraming = new List <FamilyInstance>();
                }

                if (_walls.Count > 0)
                {
                    _currentLevelWalls = new FilteredElementCollector(_doc, _walls.Select(p => p.Id).ToList()).WherePasses(_withinLevelBoundsFilter).OfType <Wall>().ToList();
                }
                else
                {
                    _currentLevelWalls = new List <Wall>();
                }

                //Generate LoadModels to populate a full LevelLoadModel
                LevelLoadModel _currentLevelLoadModel = LevelLoadModel.Create(_level);
                foreach (Floor _floor in _currentLevelFloors)
                {
                    //The "top" floor is where the initial Demand is determined, which is to be supported via reshores propagating down through the building
                    //ToDo: it would be valuable to be able to pick which Level to start from
                    if (_level.Id == _topLevel.Id)
                    {
                        Parameter _floorThicknessParameter = _floor.get_Parameter(BuiltInParameter.FLOOR_ATTR_THICKNESS_PARAM);
                        double    _floorThickness          = _floorThicknessParameter == null
                            ? 0.0
                            : _floorThicknessParameter.AsDouble();

                        _currentLevelLoadModel.addFloorDemandLoadModel(_floor, _concreteDensityPoundsForcePerCubicFoot * _floorThickness);
                    }

                    //Add loads from other sources that are also distributed evenly along a level
                    ILoadModel _floorCapacityLoadModel = levelLiveLoadPerSquareFoots.FirstOrDefault(p => p.Name == _level.Name);
                    if (_floorCapacityLoadModel == null)
                    {
                        continue;
                    }

                    List <LoadModel> _floorLoadModels = _currentLevelLoadModel.addFloorCapacityLoadModel(_floor, _floorCapacityLoadModel.PoundsForcePerSquareFoot);

                    foreach (ILoadModel _loadModel in levelLiveLoadPerSquareFoots.Where(p => p.Name.Equals(_level.Name)))
                    {
                        List <ILoadModel> _otherLoadModels = new List <ILoadModel>();
                        foreach (LoadModel _floorLoadModel in _floorLoadModels)
                        {
                            LoadModel _otherLoadModel = LoadModel.Create();
                            _otherLoadModel.Name     = _loadModel.Name;
                            _otherLoadModel.LoadType = _loadModel.LoadType;
                            _otherLoadModel.PoundsForcePerSquareFoot = _loadModel.PoundsForcePerSquareFoot;
                            _otherLoadModel.AreaSquareFeetXY         = _floorLoadModel.AreaSquareFeetXY;
                            _otherLoadModel.HeightFeetZ = _floorLoadModel.HeightFeetZ;
                            _otherLoadModel.OriginXFeet = _floorLoadModel.OriginXFeet;
                            _otherLoadModel.OriginYFeet = _floorLoadModel.OriginYFeet;

                            _otherLoadModel.Curves     = _floorLoadModel.Curves;
                            _otherLoadModel.PlanarFace = _floorLoadModel.PlanarFace;
                            _otherLoadModel.Element    = _floorLoadModel.Element;

                            _currentLevelLoadModel.addLoadModel(_otherLoadModel);
                        }
                    }
                }
                foreach (FamilyInstance _structuralColumn in _currentLevelStructuralColumns)
                {
                    _currentLevelLoadModel.addFamilyInstanceLoadModel(_structuralColumn, LoadType.Demand, buildingLoadModel.StructuralColumnWeightPerSquareFoot);
                    _currentLevelLoadModel.addFamilyInstanceLoadModel(_structuralColumn, LoadType.Capacity, buildingLoadModel.StructuralColumnWeightPerSquareFoot);
                }
                foreach (FamilyInstance _structuralFrame in _currentLevelStructuralFraming)
                {
                    _currentLevelLoadModel.addFamilyInstanceLoadModel(_structuralFrame, LoadType.Demand, buildingLoadModel.StructuralBeamWeightPerSquareFoot);
                }
                foreach (Wall _wall in _currentLevelWalls)
                {
                    _currentLevelLoadModel.addWallLoadModel(_wall, LoadType.Demand, buildingLoadModel.StructuralWallWeightPerSquareFoot);
                    _currentLevelLoadModel.addWallLoadModel(_wall, LoadType.Capacity, buildingLoadModel.StructuralWallWeightPerSquareFoot);
                }

                //Set the Solid elements that we will project through the building, to represent demands/capacities
                LoadModel.SetSolids(_currentLevelLoadModel.LoadModels.OfType <LoadModel>(), _level, _topLevel, _bottomLevel);

                VisualizationDeliverable _visualizationDeliverable = new VisualizationDeliverable(_currentLevelLoadModel)
                {
                    Floors            = _currentLevelFloors,
                    StructuralColumns = _currentLevelStructuralColumns,
                    StructuralFraming = _currentLevelStructuralFraming,
                    Walls             = _currentLevelWalls,
                };
                _visualizationDeliverables.Add(_visualizationDeliverable);

                _levelAbove = _level;
            }

            //Now that we've gathered all of our LoadModels, let's read the data about their actual demands/capacities
            buildingLoadModel.LevelLoadModels = _visualizationDeliverables.Select(p => p.LevelLoadModel as ILevelLoadModel).Where(p => p != null).ToList();

            buildingLoadModel.ReadLoads();

            foreach (LoadModel _loadModel in _visualizationDeliverables.Select(p => p.LevelLoadModel).SelectMany(p => p.LoadModels))
            {
                _loadModel.SetDirectShapeWithParameters(_doc, _directShapeCategory.Id, _loadModel.Name);
            }

            //Update Levels in the model with Load details
            foreach (LevelLoadModel _levelLoadModel in _visualizationDeliverables.Select(p => p.LevelLoadModel))
            {
                _levelLoadModel.SetLevelParameters();
            }

            //Color our active View for the visualization
            colorActiveView(_doc, _visualizationDeliverables);

            //ToDo: something happened which broke colors being correctly applied to these sheets - will need to sort this out
            //createSheetsAndViews(_doc, _visualizationDeliverables, _modelExtents);
            //
            //colorViews(_doc, _visualizationDeliverables);
            //
            //createViewports(_doc, _visualizationDeliverables, _capacityViewCoordinate, _combinedViewCoordinate, _demandViewCoordinate);

            return(Result.Succeeded);
        }
Ejemplo n.º 59
0
 public Tree(LoadModel model)
     : base(model)
 {
     selectable = false;
 }
Ejemplo n.º 60
0
        private async Task GetResults()
        {
            try
            {
                string url = "http://app.bilibili.com/x/splash?plat=0&build=414000&channel=master&width=1080&height=1920";
                bool   pc  = SettingHelper.IsPc();
                if (pc)
                {
                    img.Stretch = Stretch.Uniform;
                    url         = "http://app.bilibili.com/x/splash?plat=0&build=414000&channel=master&width=1920&height=1080";
                }

                string Result = await WebClientClass.GetResults(new Uri(url));

                LoadModel obj = JsonConvert.DeserializeObject <LoadModel>(Result);

                if (obj.code == 0)
                {
                    if (obj.data.Count != 0)
                    {
                        var buff = await WebClientClass.GetBuffer(new Uri(obj.data[0].image));

                        BitmapImage bit = new BitmapImage();
                        await bit.SetSourceAsync(buff.AsStream().AsRandomAccessStream());

                        if (!pc)
                        {
                            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
                            {
                                var applicationView = ApplicationView.GetForCurrentView();
                                applicationView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);

                                // StatusBar.GetForCurrentView().HideAsync();
                                StatusBar statusBar = StatusBar.GetForCurrentView();
                                statusBar.ForegroundColor   = Colors.Gray;
                                statusBar.BackgroundColor   = Color.FromArgb(255, 55, 63, 76);
                                statusBar.BackgroundOpacity = 0;
                            }
                        }
                        else
                        {
                            img_bg.Source = bit;
                            InitializedFrostedGlass(GlassHost);
                        }
                        img.Source = bit;
                        _url       = obj.data[0].param;
                        maxnum     = 5;
                        //await Task.Delay(3000);
                        //this.Frame.Navigate(typeof(MainPage), m);
                    }
                    else
                    {
                        // await Task.Delay(2000);
                    }
                }
                else
                {
                    // await Task.Delay(2000);
                    //this.Frame.Navigate(typeof(MainPage), m);
                }
            }
            catch (Exception)
            {
                // await Task.Delay(2000);
                //this.Frame.Navigate(typeof(MainPage), m);
            }
            finally
            {
            }
        }