using CyberX8_Core;
using MECF.Framework.Common.Equipment;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CyberX8_Themes.UserControls
{
    /// <summary>
    /// WaferHolderBuffer.xaml 的交互逻辑
    /// </summary>
    public partial class WaferHolderProcessCell : UserControl
    {
        public WaferHolderProcessCell()
        {
            InitializeComponent();
        }

        public static readonly DependencyProperty CellNameProperty = DependencyProperty.Register(
        "CellName", typeof(string), typeof(WaferHolderProcessCell), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));

        public string CellName
        {
            get { return this.GetValue(CellNameProperty).ToString(); }
            set { this.SetValue(CellNameProperty, value); }
        }

        public static readonly DependencyProperty WaferHolderVisibleProperty = DependencyProperty.Register(
      "WaferHolderVisible", typeof(bool), typeof(WaferHolderProcessCell), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));

        public bool WaferHolderVisible
        {
            get { return (bool)this.GetValue(WaferHolderVisibleProperty); }
            set { this.SetValue(WaferHolderVisibleProperty, value); }
        }

        public static readonly DependencyProperty CellStatusProperty = DependencyProperty.Register(
      "CellStatus", typeof(int), typeof(WaferHolderProcessCell), new FrameworkPropertyMetadata((int)UserControls.CellStatus.Idle, FrameworkPropertyMetadataOptions.AffectsRender));
        /// <summary>
        /// Cell 状态
        /// </summary>
        public int CellStatus
        {
            get { return (int)this.GetValue(CellStatusProperty); }
            set
            {
                this.SetValue(CellStatusProperty, value);
            }
        }

        public static readonly DependencyProperty IsWHEnableProperty = DependencyProperty.Register(
      "IsWHEnable", typeof(bool), typeof(WaferHolderProcessCell), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsRender));
        /// <summary>
        /// IsWHEnable
        /// </summary>
        public bool IsWHEnable
        {
            get { return (bool)this.GetValue(IsWHEnableProperty); }
            set
            {
                this.SetValue(IsWHEnableProperty, value);
            }
        }

        private void Canvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            GlobalEvents.OnSwitchFixedTabItem("HardWare", "Modules", $"{CellName}");
        }
    }
    /// <summary>
    /// Cell状态枚举
    /// </summary>
    internal enum CellStatus
    {
        Init=0,
        //Idle
        Idle = 1,
        //Busy
        Busy = 2,
        //Disable
        Disabled = 3,
        //Error
        Error = 4
    }


}