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;
namespace PunkHPX8_Themes.UserControls
{
    /// 
    /// VPWDegasControl.xaml 的交互逻辑
    /// 
    public partial class VPWDegasControl : UserControl
    {
        public VPWDegasControl()
        {
            InitializeComponent();
        }
        public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
           "ModuleName", typeof(string), typeof(VPWDegasControl),
           new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// 模块名称
        /// 
        public string ModuleName
        {
            get
            {
                return (string)this.GetValue(ModuleNameProperty);
            }
            set
            {
                this.SetValue(ModuleNameProperty, value);
            }
        }
        public static readonly DependencyProperty PumpEnableProperty = DependencyProperty.Register(
            "PumpEnable", typeof(bool), typeof(VPWDegasControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// PumpEnable
        /// 
        public bool PumpEnable
        {
            get
            {
                return (bool)this.GetValue(PumpEnableProperty);
            }
            set
            {
                this.SetValue(PumpEnableProperty, value);
            }
        }
        public static readonly DependencyProperty PumpPressureProperty = DependencyProperty.Register(
       "PumpPressure", typeof(double), typeof(VPWDegasControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// "PumpPressure
        /// 
        public double PumpPressure
        {
            get
            {
                return (double)this.GetValue(PumpPressureProperty);
            }
            set
            {
                this.SetValue(PumpPressureProperty, value);
            }
        }
        public static readonly DependencyProperty DiwLoopDoProperty = DependencyProperty.Register(
        "DiwLoopDo", typeof(double), typeof(VPWDegasControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// "DiwLoopDo
        /// 
        public double DiwLoopDo
        {
            get
            {
                return (double)this.GetValue(DiwLoopDoProperty);
            }
            set
            {
                this.SetValue(DiwLoopDoProperty, value);
            }
        }
        private void PumpOff_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DegasPumpDisable");
        }
        private void PumpOn_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DegasPumpEnable");
        }
    }
}