using LiveCharts;
using LiveCharts.Wpf;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace FLY.Thick.Base.UI
{
    class SeriesInfo : INotifyPropertyChanged
    {
        /// <summary>
        /// 显示的标题，肯定是 0，1，2，3，4，5.。。。
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 是反向数据
        /// </summary>
        public bool? IsBackw { get; set; }

        public string Header
        {
            get {
                if (IsBackw == null)
                    return Title;
                else
                {
                    if (IsBackw == false)
                        return $"{Title} 正";
                    else
                        return $"{Title} 反";
                }
            }
        }
        /// <summary>
        /// 颜色
        /// </summary>
        public Brush Fill { get; set; }

        /// <summary>
        /// 当前被选中
        /// </summary>
        public bool IsSelected { get; set; }
        /// <summary>
        /// 对应的曲线
        /// </summary>
        public LineSeries Series { get; set; }

        /// <summary>
        /// 测量区平均值
        /// </summary>
        public double Avg { get; set; } = double.NaN;
        /// <summary>
        /// 当非AD值模式时，显示的厚度值
        /// </summary>
        public ChartValues<double> Thicks { get; } = new ChartValues<double>();
        /// <summary>
        /// 当为AD值模式时，显示的AD值
        /// </summary>
        public ChartValues<double> ADs { get; } = new ChartValues<double>();

        public void Clear()
        {
            Thicks.Clear();
            ADs.Clear();
            Avg = double.NaN;
            IsBackw = null;
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
