using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Q3.SL.Demos.ExClasses;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace Q3.SL.Demos.ViewModels
{
    public class ChartViewModel
    {
        public ObservableCollection<DataByte> chartDataOne { get; set; }
        public ObservableCollection<DataByte> chartDataTwo { get; set; }
        public ObservableCollection<DataByte> polarData { get; set; }
        public ObservableCollection<DataByte> polarData2 { get; set; }

        public ChartViewModel()
        {
            chartDataOne = MakeChartOne();
            chartDataTwo = MakeChartTwo();
            polarData = MakePolarData();
            polarData2 = MakePolarData2();
        }

        ObservableCollection<DataByte> MakeChartOne()
        {
            ObservableCollection<DataByte> tempList = new ObservableCollection<DataByte>();

            Random rnd = new Random();

            for (int i = 0; i < 2000; i++)
            {
                DataByte db = new DataByte();
                db.Id = i;
                db.Val1 = rnd.NextDouble() * 1000;
                db.Val2 = rnd.NextDouble() * 100;

                tempList.Add(db);
            }

            return tempList;
        }

        ObservableCollection<DataByte> MakeChartTwo()
        {
            ObservableCollection<DataByte> tempList = new ObservableCollection<DataByte>();

            Random rnd = new Random();

            for (int i = 0; i < 2000; i++)
            {
                DataByte db = new DataByte();
                db.Id = i;
                db.Val1 = rnd.NextDouble() * 1000;
                db.Val2 = rnd.NextDouble() * 100;

                tempList.Add(db);
            }

            return tempList;
        }

        ObservableCollection<DataByte> MakePolarData()
        {
            ObservableCollection<DataByte> tempList = new ObservableCollection<DataByte>();

            Random rnd = new Random();

            for (int i = 0; i < 45; i++)
            {
                DataByte db = new DataByte();
                db.Id = i;
                db.Val1 = rnd.NextDouble() * 50;
                db.Val2 = i * 8;

                tempList.Add(db);
            }
            
            return tempList;
        }

        ObservableCollection<DataByte> MakePolarData2()
        {
            ObservableCollection<DataByte> tempList = new ObservableCollection<DataByte>();

            Random rnd = new Random();

            for (int i = 0; i < 30; i++)
            {
                DataByte db = new DataByte();
                db.Id = i;
                db.Val1 = rnd.NextDouble() * 40;
                db.Val2 = i * 12;

                tempList.Add(db);
            }

            return tempList;
        }
    }
}
