Exemplo n.º 1
0
        public void AddDefaults()
        {
            Grid1D Ox = new Grid1D(10, 3);
            Grid1D Oy = new Grid1D(10, 3);

            v2Datas = new List <V2Data>();
            V2DataOnGrid[]     grid        = new V2DataOnGrid[4];
            V2DataCollection[] collections = new V2DataCollection[4];

            for (int i = 0; i < 3; i++)
            {
                grid[i]        = new V2DataOnGrid("data info2" /*+ i.ToString()*/, 2, Ox, Oy); // test i = 2
                collections[i] = new V2DataCollection("collection info" + i.ToString(), i);
            }

            for (int i = 0; i < 3; i++)
            {
                grid[i].initRandom(0, 100);
                collections[i].initRandom(4, 100, 100, 0, 100);
                this.Add(grid[i]);
                this.Add(collections[i]);
            }

            Grid1D nullOx = new Grid1D(0, 0);
            Grid1D nullOy = new Grid1D(0, 0);

            grid[3]        = new V2DataOnGrid("null", 100, nullOx, nullOy);
            collections[3] = new V2DataCollection("null", 100);

            grid[3].initRandom(0, 100);
            collections[3].initRandom(0, 100, 100, 0, 100);
            this.Add(grid[3]);
            this.Add(collections[3]);
        }
Exemplo n.º 2
0
        public void AddDefaultDataCollection()
        {
            V2DataCollection collection = new V2DataCollection("aaaaaaaaa ", 1);

            collection.initRandom(4, 100, 100, 0, 100);
            this.Add(collection);
        }
Exemplo n.º 3
0
        public void AddDefaults()
        {
            Grid1D Ox = new Grid1D(1, 3);
            Grid1D Oy = new Grid1D(1, 3);

            v2Datas = new List <V2Data>();
            V2DataOnGrid[]     mag         = new V2DataOnGrid[4];
            V2DataCollection[] collections = new V2DataCollection[4];
            for (int i = 0; i < 4; i++)
            {
                //mag[i] = new V2DataOnGrid("Data", 123, Ox, Oy);
                //collections[i] = new V2DataCollection("Data", 123);
                mag[i]         = new V2DataOnGrid("Data " + i.ToString(), i, Ox, Oy);
                collections[i] = new V2DataCollection("Collection number: " + i.ToString(), i);
            }
            for (int i = 0; i < 4; i++)
            {
                mag[i].initRandom(0, 10);
                collections[i].initRandom(4, 10, 10, 0, 100);
                this.Add(mag[i]);
                this.Add(collections[i]);
            }

            Grid1D NULLOX = new Grid1D(0, 0);
            Grid1D NULLOY = new Grid1D(0, 0);

            mag[3]         = new V2DataOnGrid("NULL", 10, NULLOX, NULLOY);
            collections[3] = new V2DataCollection("NULL", 10);

            mag[3].initRandom(0, 10);
            collections[3].initRandom(0, 10, 10, 0, 10);
            this.Add(mag[3]);
            this.Add(collections[3]);
        }
Exemplo n.º 4
0
        public IEnumerator <DataItem> GetEnumerator()
        {
            V2DataCollection ret = new V2DataCollection(Info, Freq);

            for (int i = 0; i < Grids[0].Count; i++)
            {
                for (int j = 0; j < Grids[1].Count; j++)
                {
                    yield return(new DataItem(new Vector2((i + 1) * Grids[0].Step, (j + 1) * Grids[1].Step), Node[i, j]));
                }
            }
        }
Exemplo n.º 5
0
        IEnumerator IEnumerable.GetEnumerator()
        {
            V2DataCollection ret = new V2DataCollection(Info, Freq);

            for (int i = 0; i < Grids[0].Count; i++)
            {
                for (int j = 0; j < Grids[1].Count; j++)
                {
                    ret.dataItems.Add(new DataItem(new Vector2((i + 1) * Grids[0].Step, (j + 1) * Grids[1].Step), Node[i, j]));
                }
            }
            return(((IEnumerable)ret.dataItems).GetEnumerator());
        }
Exemplo n.º 6
0
        public void AddDefaults()
        {
            for (int i = 0; i < 2; ++i)
            {
                V2DataOnGrid v2_data_on_grid = new V2DataOnGrid(0.0, "Default info", new double[] { 0.01, 0.01 }, new int[] { 3, 3 });
                v2_data_on_grid.InitRandom(-10.0f, 10.0f);
                ListData.Add(v2_data_on_grid);
                V2DataCollection v2_data_collection = new V2DataCollection(0.0, "Default info");
                v2_data_collection.InitRandom(3, 10.0f, 10.0f, -10.0f, 10.0f);
                ListData.Add(v2_data_collection);
            }

            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Averege"));
            CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, ListData));
        }
Exemplo n.º 7
0
        public IEnumerator <DataItem> GetEnumerator()
        {
            V2DataCollection ret = new V2DataCollection(Info, Freq);

            if (Grids != null)
            {
                for (int i = 0; i < Grids[0].Num; i++)
                {
                    for (int j = 0; j < Grids[1].Num; j++)
                    {
                        ret.dataItems.Add(new DataItem(new Vector2((i + 1) * Grids[0].Step,
                                                                   (j + 1) * Grids[1].Step), Node[i, j]));
                    }
                }
            }
            return(((IEnumerable <DataItem>)ret.dataItems).GetEnumerator());
        }
Exemplo n.º 8
0
        public override string ToLongString()
        {
            string ret = "";

            for (int i = 0; i < Grids[0].Num; i++)
            {
                for (int j = 0; j < Grids[1].Num; j++)
                {
                    ret = ret + (" (" + (Grids[0].Step * (i + 1)).ToString() + ", " + (Grids[1].Step * (j + 1)).ToString()
                                 + ") Value: " + Node[i, j].ToString()) + "\n";
                }
                ret = ret + "\n";
            }

            return("Type: 2DataOnGrid Base: Info: " + Info + " Freq: " + Freq.ToString()
                   + " Ox: " + Grids[0].ToString() + " Oy: " + Grids[1].ToString() + "\n" + ret);
        }
Exemplo n.º 9
0
        public void AddTest()
        {
            Grid1D Ox = new Grid1D(10, 3);
            Grid1D Oy = new Grid1D(10, 3);

            //v2Datas = new List<V2Data>();
            V2DataOnGrid[]     grid        = new V2DataOnGrid[4];
            V2DataCollection[] collections = new V2DataCollection[4];


            for (int i = 0; i < 3; i++)
            {
                grid[i]        = new V2DataOnGrid("TEST", 2, Ox, Oy);
                collections[i] = new V2DataCollection("sklnskvjzdfbjnsk" + i.ToString(), i);
            }

            for (int i = 0; i < 3; i++)
            {
                grid[i].initRandom(0, 100);
                collections[i].initTest(4, 100, 100, 0, 100);
                this.Add(grid[i]);
                this.Add(collections[i]);
            }
        }