using MECF.Framework.Common.OperationCenter;
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;
using OpenSEMI.ClientBase;
namespace PunkHPX8_Themes.UserControls
{
    /// 
    /// VPWMainUIControl.xaml 的交互逻辑
    /// 
    public partial class VPWMainUIControl : UserControl
    {
        public VPWMainUIControl()
        {
            InitializeComponent();
        }
        public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
          "ModuleName", typeof(string), typeof(VPWMainUIControl),
          new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// 模块名称
        /// 
        public string ModuleName
        {
            get
            {
                return (string)this.GetValue(ModuleNameProperty);
            }
            set
            {
                this.SetValue(ModuleNameProperty, value);
            }
        }
        public static readonly DependencyProperty DIWProcessValveProerty = DependencyProperty.Register(
            "DIWProcessValve", typeof(bool), typeof(VPWMainUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// DIWProcessValve
        /// 
        public bool DIWProcessValve
        {
            get
            {
                return (bool)this.GetValue(DIWProcessValveProerty);
            }
            set
            {
                this.SetValue(DIWProcessValveProerty, value);
            }
        }
        public static readonly DependencyProperty DIWDegasValveProerty = DependencyProperty.Register(
            "DIWDegasValve", typeof(bool), typeof(VPWMainUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// DIWDegasValve
        /// 
        public bool DIWDegasValve
        {
            get
            {
                return (bool)this.GetValue(DIWDegasValveProerty);
            }
            set
            {
                this.SetValue(DIWDegasValveProerty, value);
            }
        }
        public static readonly DependencyProperty DegasAdjustValveProerty = DependencyProperty.Register(
            "DegasAdjustValve", typeof(bool), typeof(VPWMainUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// DegasAdjustValve
        /// 
        public bool DegasAdjustValve
        {
            get
            {
                return (bool)this.GetValue(DegasAdjustValveProerty);
            }
            set
            {
                this.SetValue(DegasAdjustValveProerty, value);
            }
        }
        public static readonly DependencyProperty VPW1VACValveProerty = DependencyProperty.Register(
           "VPW1VACValve", typeof(bool), typeof(VPWMainUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// VPW1VACValve
        /// 
        public bool VPW1VACValve
        {
            get
            {
                return (bool)this.GetValue(VPW1VACValveProerty);
            }
            set
            {
                this.SetValue(VPW1VACValveProerty, value);
            }
        }
        public static readonly DependencyProperty VPW2VACValveProerty = DependencyProperty.Register(
           "VPW2VACValve", typeof(bool), typeof(VPWMainUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// VPW2VACValve
        /// 
        public bool VPW2VACValve
        {
            get
            {
                return (bool)this.GetValue(VPW2VACValveProerty);
            }
            set
            {
                this.SetValue(VPW2VACValveProerty, value);
            }
        }
        public static readonly DependencyProperty IsBoosterPumpOpenProerty = DependencyProperty.Register(
                "IsBoosterPumpOpen", typeof(bool), typeof(VPWMainUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// IsBoosterPumpOpen
        /// 
        public bool IsBoosterPumpOpen
        {
            get
            {
                return (bool)this.GetValue(IsBoosterPumpOpenProerty);
            }
            set
            {
                this.SetValue(IsBoosterPumpOpenProerty, value);
            }
        }
        public static readonly DependencyProperty IsDegasPumpOpenProerty = DependencyProperty.Register(
            "IsDegasPumpOpen", typeof(bool), typeof(VPWMainUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// IsDegasPumpOpen
        /// 
        public bool IsDegasPumpOpen
        {
            get
            {
                return (bool)this.GetValue(IsDegasPumpOpenProerty);
            }
            set
            {
                this.SetValue(IsDegasPumpOpenProerty, value);
            }
        }
        public static readonly DependencyProperty IsVacuumPumpOpenProerty = DependencyProperty.Register(
            "IsVacuumPumpOpen", typeof(bool), typeof(VPWMainUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        ///IsVacuumPumpOpen
        /// 
        public bool IsVacuumPumpOpen
        {
            get
            {
                return (bool)this.GetValue(IsVacuumPumpOpenProerty);
            }
            set
            {
                this.SetValue(IsVacuumPumpOpenProerty, value);
            }
        }
        public static readonly DependencyProperty TotalFlowProperty = DependencyProperty.Register(
        "TotalFlow", typeof(double), typeof(VPWMainUIControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// TotalFlow
        /// 
        public double TotalFlow
        {
            get
            {
                return (double)this.GetValue(TotalFlowProperty);
            }
            set
            {
                this.SetValue(TotalFlowProperty, value);
            }
        }
        public static readonly DependencyProperty Cell1DIWFlowProperty = DependencyProperty.Register(
 "Cell1DIWFlow", typeof(double), typeof(VPWMainUIControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// Cell1DIWFlow
        /// 
        public double Cell1DIWFlow
        {
            get
            {
                return (double)this.GetValue(Cell1DIWFlowProperty);
            }
            set
            {
                this.SetValue(Cell1DIWFlowProperty, value);
            }
        }
        public static readonly DependencyProperty Cell2DIWFlowProperty = DependencyProperty.Register(
"Cell2DIWFlow", typeof(double), typeof(VPWMainUIControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// Cell2DIWFlow
        /// 
        public double Cell2DIWFlow
        {
            get
            {
                return (double)this.GetValue(Cell2DIWFlowProperty);
            }
            set
            {
                this.SetValue(Cell2DIWFlowProperty, value);
            }
        }
        public static readonly DependencyProperty VPW1WaferInfoProperty = DependencyProperty.Register(
            "VPW1WaferInfo", typeof(WaferInfo), typeof(VPWMainUIControl));
        /// 
        /// VPW1WaferInfo
        /// 
        public WaferInfo VPW1WaferInfo
        {
            get
            {
                return (WaferInfo)this.GetValue(VPW1WaferInfoProperty);
            }
            set
            {
                this.SetValue(VPW1WaferInfoProperty, value);
            }
        }
        public static readonly DependencyProperty VPW2WaferInfoProperty = DependencyProperty.Register(
      "VPW2WaferInfo", typeof(WaferInfo), typeof(VPWMainUIControl));
        /// 
        /// VPW2WaferInfo
        /// 
        public WaferInfo VPW2WaferInfo
        {
            get
            {
                return (WaferInfo)this.GetValue(VPW2WaferInfoProperty);
            }
            set
            {
                this.SetValue(VPW2WaferInfoProperty, value);
            }
        }
        private void OpenDIWProcessValve_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DiwProcessOn");
        }
        private void CloseDIWProcessValve_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DiwProcessOff");
        }
        private void OpenDIWDegasValve_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DiwDegasValveOn");
        }
        private void CloseDIWDegasValve_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DiwDegasValveOff");
        }
        private void OpenDegasAdjustValve_Click(object sender, RoutedEventArgs e)
        {
             InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DegasAdjustOn");
        }
        private void CloseDegasAdjustValve_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DegasAdjustOff");
        }
        private void OpenVPW1VACValve_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"VPW1.VacuumValveOn");
        }
        private void CloseVPW1VACValve_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"VPW1.VacuumValveOff");
        }
        private void OpenVPW2VACValve_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"VPW2.VacuumValveOn");
        }
        private void CloseVPW2VACValve_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"VPW2.VacuumValveOff");
        }
    }
}