Example #1
0
        public void AddDefaults()
        {
            // random init
            V2DataOnGrid data_grid_1 = new V2DataOnGrid("data_grid_2", 6.0f, new Grid1D(2, 2), new Grid1D(3, 2));

            data_grid_1.InitRandom(-10.0, 15.0);
            V2DataOnGrid data_grid_2 = new V2DataOnGrid("data_grid_2", 6.0f, new Grid1D(1, 0), new Grid1D(2, 0));

            data_grid_2.InitRandom(-10.0, 15.0);


            V2DataCollection data_collection_1 = new V2DataCollection("data_collection_1", 2.0f);

            data_collection_1.InitRandom(0, 10.0f, 20.0f, -11.0f, -5.0f);
            V2DataCollection data_collection_2 = new V2DataCollection("data_collection_2", 3.0f);

            data_collection_2.InitRandom(2, 10.0f, 20.0f, -2.0f, 2.0f);
            V2DataCollection data_collection_3 = new V2DataCollection("data_collection_1", 2.0f);

            data_collection_3.InitRandom(4, 1.0f, 12.0f, 11.0f, 25.0f);

            V2data_list.Add(data_grid_1);
            V2data_list.Add(data_collection_1);
            V2data_list.Add(data_collection_2);
            V2data_list.Add(data_grid_2);
            V2data_list.Add(data_collection_3);
        }
Example #2
0
        static void Main(string[] args)
        {
            // ------------------------------

            try
            {
                V2MainCollection main_collection = new V2MainCollection();

                main_collection.DataChanged += HandleDataChanged;

                V2DataOnGrid data_grid_1 = new V2DataOnGrid("data_grid_1", 1.0f, new Grid1D(2, 2), new Grid1D(3, 2));
                data_grid_1.InitRandom(-10.0, 15.0);
                V2DataOnGrid data_grid_2 = new V2DataOnGrid("data_grid_2", 8.0f, new Grid1D(1, 2), new Grid1D(4, 2));
                data_grid_2.InitRandom(-10.0, 15.0);
                V2DataCollection data_collection_1 = new V2DataCollection("data_collection_1", 2.0f);
                data_collection_1.InitRandom(0, 10.0f, 20.0f, -11.0f, -5.0f);
                V2DataCollection data_collection_2 = new V2DataCollection("data_collection_2", 3.0f);
                data_collection_2.InitRandom(0, 10.0f, 20.0f, -11.0f, -5.0f);

                main_collection.Add(data_grid_1);
                main_collection.Add(data_collection_1);
                main_collection[1].EM_frequency = 5.0f;
                main_collection.Add(data_collection_2);
                main_collection.Remove("data_collection_1", 5.0f);
                main_collection[0].info = "changed info";
                main_collection[1]      = main_collection[0];

                Console.WriteLine(main_collection.ToString());
            }
            catch (Exception e)
            {
                Console.WriteLine("--------<ERROR: " + e.Message + ">--------");
                return;
            }

            // ------------------------------
        }