Пример #1
0
        static void Main(string[] args)
        {
            Grid new_grid = new Grid(3, 1, 3);

            float[]      t;
            V1DataOnGrid element = new V1DataOnGrid("blablabla", DateTime.UtcNow, new_grid);

            Console.WriteLine("TASK1\n" + element.ToLongString());
            V1DataCollection element_transformed = element;

            Console.WriteLine("transformed element\n" + element_transformed.ToLongString());

            V1MainCollection element_collection = new V1MainCollection();

            element_collection.AddDefaults();

            /* V1DataOnGrid value1;
             * element_collection.Add(element_collection.elements[0]);
             * Console.WriteLine("\n\nTASK2\n" + element_collection.ToString());
             * element_collection.Remove(element_collection.elements[0].data, element_collection.elements[0].date);*/
            Console.WriteLine("\n\nTASK2\n" + element_collection.ToString());


            Console.WriteLine("\n\nTASK3");
            foreach (V1Data elem in element_collection)
            {
                t = elem.NearZero(30);
                Console.WriteLine(elem.ToLongString() + "\nList of values:");
                if (t.Length == 0)
                {
                    Console.WriteLine("No elements" + "\n");
                }
                foreach (float val in t)
                {
                    Console.Write(val + " ");
                }
                Console.WriteLine("\n\n");
            }
            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("dgs\n\n\n\n\n");
            string   info1 = "information1";
            DateTime date  = DateTime.Now;
            Grid     grid  = new Grid {
                t_begin = 0f, t_step = 5f, count = 10
            };
            float        minValue1 = -10f;
            float        maxValue1 = 10f;
            V1DataOnGrid Obj1      = new V1DataOnGrid(info1, date, grid);

            Obj1.InitRandom(minValue1, maxValue1);
            Console.WriteLine(Obj1.ToLongString());
            V1DataCollection Obj2 = (V1DataCollection)Obj1;

            Console.WriteLine(Obj2.ToLongString());
            V1MainCollection Obj3 = new V1MainCollection();

            Obj3.AddDefaults();
            Console.WriteLine(Obj3.ToString());
            foreach (V1Data value in Obj3)
            {
                Console.WriteLine(value.ToLongString());
                float[] array = value.NearZero(10f);
                if (array.Length == 0)
                {
                    Console.WriteLine("empty");
                }
                else
                {
                    foreach (float x in array)
                    {
                        Console.WriteLine(x);
                    }
                }
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            V1MainCollection element_collection = new V1MainCollection();

            element_collection.AddDefaults();
            Console.WriteLine("\n\n*********************\nLab_2*");
            Console.WriteLine("Exercise 1");
            V1DataCollection V1DataCollection_element = new V1DataCollection("init.txt");

            Console.WriteLine(V1DataCollection_element.ToLongString("{0,3:00.00}"));
            Console.WriteLine("\n\n*********************\nExercise 2");
            Console.WriteLine("max measurement`s count: " + element_collection.max_count + "\n\nelements in descending order\n");
            foreach (var elem in element_collection.V1Data_ordered_by_coordinates_length)
            {
                // Console.WriteLine("OK");
                Console.WriteLine(elem.ToString("{0,3:00.00}"));
            }
            Console.WriteLine("\n***********************\none time t");
            foreach (var elem in element_collection.time_one_time)
            {
                Console.WriteLine(/*elem.ToString("{0,3:00.00}")*/ String.Format("{0,3:00.00}", elem));
            }
            Console.ReadLine();
        }