Пример #1
0
        private void MenuItem_Add_Defaults_V3DataCollection_Click(object sender, RoutedEventArgs e)
        {
            V3DataCollection data = new V3DataCollection("default", new DateTime());

            data.InitRandom(5, 2, 2, 0, 1);
            Collection.Add(data);
        }
Пример #2
0
        public override string ToLongString()
        {
            string res = this.ToString();

            foreach (DataItem cur in collect)
            {
                res += '\n' + cur.ToString();
            }
            return(res);
        }
Пример #3
0
        public void AddDefaults()
        {
            V3DataOnGrid     don1 = new V3DataOnGrid(new Grid1D(5.0f, 0), new Grid1D(5.0f, 0), "a", new DateTime(2020, 11, 20));
            V3DataCollection dc1  = new V3DataCollection("a", new DateTime(2020, 11, 20));
            V3DataOnGrid     don2 = new V3DataOnGrid(new Grid1D(0.5f, 6), new Grid1D(0.5f, 6), "aa", new DateTime(2020, 11, 20));

            don2.InitRandom(0.0f, 1.0f);
            V3DataCollection dc2 = new V3DataCollection("aa", new DateTime(2020, 11, 20));

            dc2.InitRandom(10, 3.0f, 3.0f, 0.0f, 1.0f);
            V3DataOnGrid don3 = new V3DataOnGrid(new Grid1D(1.0f, 5), new Grid1D(0.5f, 7), "aaa", new DateTime(2020, 11, 20));

            don3.InitRandom(0.0f, 1.0f);
            V3DataCollection dc3 = (V3DataCollection)(don3);

            collect.Add(don1);
            collect.Add(dc1);
            collect.Add(don2);
            collect.Add(dc2);
            collect.Add(don3);
            collect.Add(dc3);
        }
Пример #4
0
        public void AddDefaults()
        {
            V3DataOnGrid     don1 = new V3DataOnGrid(new Grid1D(5.0f, 0), new Grid1D(5.0f, 0), "a", new DateTime(2020, 11, 20));
            V3DataCollection dc1  = new V3DataCollection("a", new DateTime(2020, 11, 20));
            V3DataOnGrid     don2 = new V3DataOnGrid(new Grid1D(0.5f, 6), new Grid1D(0.5f, 6), "aa", new DateTime(2020, 11, 20));

            don2.InitRandom(0.0f, 1.0f);
            V3DataCollection dc2 = new V3DataCollection("aa", new DateTime(2020, 11, 20));

            dc2.InitRandom(10, 3.0f, 3.0f, 0.0f, 1.0f);
            V3DataOnGrid don3 = new V3DataOnGrid(new Grid1D(1.0f, 5), new Grid1D(0.5f, 7), "aaa", new DateTime(2020, 11, 20));

            don3.InitRandom(0.0f, 1.0f);
            V3DataCollection dc3 = (V3DataCollection)(don3);

            collect.Add(don1);
            collect.Add(dc1);
            collect.Add(don2);
            collect.Add(dc2);
            collect.Add(don3);
            collect.Add(dc3);
            CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
        }
Пример #5
0
        static void Main()
        {
            V3MainCollection mainCollection = new V3MainCollection();

            mainCollection.DataChanged += DataChangesCollector;
            mainCollection.AddDefaults();
            V3DataCollection collection1 = new V3DataCollection("test1.txt");

            mainCollection.Add(collection1);

            //Console.WriteLine(mainCollection.ToString("F3"));

            mainCollection[2].Info = "--- CHANGED INFO ---";
            mainCollection[4].Time = DateTime.Now;
            mainCollection[1]      = new V3DataCollection("test2.txt");

            V3Data temp = mainCollection[3];

            mainCollection.Remove(3);
            temp.Info = "REMOVED OBJECT";                            // Это изменение не вызывает событие

            //Console.WriteLine(mainCollection.ToString("F3"));
        }
 public DataItemModel(V3DataCollection collection)
 {
     Collection = collection;
     X          = Y = 0;
     Value      = 1;
 }