コード例 #1
0
        public void Calc_Grid_Stats_Test()
        {
            Continuum thisInst = new Continuum("");


            string Filename = testingFolder + "\\Grid_Info testing Paulding 0206.cfm";

            thisInst.Open(Filename);
            thisInst.topo.GetElevsAndSRDH_ForCalcs(thisInst, null, false);

            // Test 1
            int thisX = 710541;
            int thisY = 4552553;

            TopoInfo.TopoGrid[] Grid_Array = thisInst.metList.metItem[0].gridStats.GetGridArray(thisX, thisY, thisInst);

            for (int i = 0; i < Grid_Array.Length; i++)
            {
                Grid_Array[i].elev = thisInst.topo.CalcElevs(Grid_Array[i].UTMX, Grid_Array[i].UTMY);
            }

            Grid_Info thisGridInfo = new Grid_Info();

            Node_table[] dummyNulls = null;
            thisGridInfo.CalcGridStats(0, ref Grid_Array, ref dummyNulls, null, thisInst, false, "");

            Assert.AreEqual(1.1504, thisGridInfo.stats[0].P10_UW[4], 0.01, "Wrong P10 UW Expo for Test 1");
            Assert.AreEqual(-0.43314, thisGridInfo.stats[0].P10_DW[4], 0.01, "Wrong P10 DW Expo for Test 1");

            thisInst.Close();
        }
コード例 #2
0
        public void ExportGridExpos()
        {
            Continuum thisInst = new Continuum("");

            string Filename = testingFolder + "\\Grid_Info testing Paulding 0206.cfm";

            thisInst.Open(Filename);
            thisInst.topo.GetElevsAndSRDH_ForCalcs(thisInst, null, false);

            int thisX = 710541;
            int thisY = 4552553;

            TopoInfo.TopoGrid[] Grid_Array = thisInst.metList.metItem[0].gridStats.GetGridArray(thisX, thisY, thisInst);

            for (int i = 0; i < Grid_Array.Length; i++)
            {
                Grid_Array[i].elev = thisInst.topo.CalcElevs(Grid_Array[i].UTMX, Grid_Array[i].UTMY);
            }

            Grid_Info thisGridInfo = new Grid_Info();

            Node_table[] dummyNulls = null;
            thisGridInfo.CalcGridStats(0, ref Grid_Array, ref dummyNulls, null, thisInst, true, testingFolder + "\\Paulding");

            thisInst.Close();
        }
コード例 #3
0
        //人员数据绑定
        public void BindPeople()
        {
            List <UserInfo> Users = User.FindByAgencyName(agen.SelectAgencyID(AgencyName2.Text.Trim()), Convert.ToInt32(Session["SecrecyLevel"]));

            Grid_Info.RecordCount = Users.Count;
            Grid_Info.DataSource  = Users.Skip(Grid_Info.PageIndex * Grid_Info.PageSize).Take(Grid_Info.PageSize).ToList();
            Grid_Info.DataBind();
        }
コード例 #4
0
        public void FindSectorsForGrid_Test()
        {
            Continuum thisInst = new Continuum("");

            StreamReader sr = new StreamReader(testingFolder + "\\WindRose 1.txt");

            double[] windRose = new double[16];

            for (int i = 0; i < 16; i++)
            {
                string thisData = sr.ReadLine();
                windRose[i] = Convert.ToDouble(thisData);
            }

            sr.Close();
            Grid_Info gridStats = new Grid_Info();

            bool[] Sectors_to_use = gridStats.FindSectorsForGrid(windRose);

            // All sectors should be included (true)
            for (int i = 0; i < 16; i++)
            {
                Assert.AreEqual(true, Sectors_to_use[i], "Wrong Sector " + i);
            }

            // Test 2
            sr = new StreamReader(testingFolder + "\\WindRose 2.txt");

            for (int i = 0; i < 16; i++)
            {
                string thisData = sr.ReadLine();
                windRose[i] = Convert.ToDouble(thisData);
            }
            sr.Close();

            Sectors_to_use = gridStats.FindSectorsForGrid(windRose);

            Assert.AreEqual(true, Sectors_to_use[0], "Wrong Sector 0");
            Assert.AreEqual(true, Sectors_to_use[1], "Wrong Sector 1");
            Assert.AreEqual(true, Sectors_to_use[2], "Wrong Sector 2");
            Assert.AreEqual(false, Sectors_to_use[3], "Wrong Sector 3");
            Assert.AreEqual(false, Sectors_to_use[4], "Wrong Sector 4");
            Assert.AreEqual(false, Sectors_to_use[5], "Wrong Sector 5");
            Assert.AreEqual(true, Sectors_to_use[6], "Wrong Sector 6");
            Assert.AreEqual(true, Sectors_to_use[7], "Wrong Sector 7");
            Assert.AreEqual(true, Sectors_to_use[8], "Wrong Sector 8");
            Assert.AreEqual(true, Sectors_to_use[9], "Wrong Sector 9");
            Assert.AreEqual(true, Sectors_to_use[10], "Wrong Sector 10");
            Assert.AreEqual(false, Sectors_to_use[11], "Wrong Sector 11");
            Assert.AreEqual(false, Sectors_to_use[12], "Wrong Sector 12");
            Assert.AreEqual(false, Sectors_to_use[13], "Wrong Sector 13");
            Assert.AreEqual(true, Sectors_to_use[14], "Wrong Sector 14");
            Assert.AreEqual(true, Sectors_to_use[15], "Wrong Sector 15");

            thisInst.Close();
        }
コード例 #5
0
        public Intersection_Grid(Spatial.Grids.Grid_Info Grid_Info)
        {
            this.grid_info = Grid_Info;

            grids = new Spatial_Hash_Grid[grid_info.groups];

            for (int u = 0; u < grid_info.groups; u++)
                grids[u] = new Spatial_Hash_Grid();

            neutral = grids[(int)Col_Slot.Neutral];
            player = grids[(int)Col_Slot.Player];
        }
コード例 #6
0
        public Intersection_Grid(Spatial.Grids.Grid_Info Grid_Info)
        {
            this.grid_info = Grid_Info;

            grids = new Spatial_Hash_Grid[grid_info.groups];

            for (int u = 0; u < grid_info.groups; u++)
            {
                grids[u] = new Spatial_Hash_Grid();
            }

            neutral = grids[(int)Col_Slot.Neutral];
            player  = grids[(int)Col_Slot.Player];
        }