| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 | 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{    /// <summary>    /// VPWMainStateControl.xaml 的交互逻辑    /// </summary>    public partial class VPWMainStateControl : UserControl    {        public VPWMainStateControl()        {            InitializeComponent();        }        public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(          "ModuleName", typeof(string), typeof(VPWMainStateControl),          new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));        /// <summary>        /// 模块名称        /// </summary>        public string ModuleName        {            get            {                return (string)this.GetValue(ModuleNameProperty);            }            set            {                this.SetValue(ModuleNameProperty, value);            }        }        public static readonly DependencyProperty MachineStateProperty = DependencyProperty.Register(                "MachineState", typeof(string), typeof(VPWMainStateControl),                    new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));        /// <summary>        /// MachineState        /// </summary>        public string MachineState        {            get            {                return (string)this.GetValue(MachineStateProperty);            }            set            {                this.SetValue(MachineStateProperty, value);            }        }        public static readonly DependencyProperty FluidInContainmentProperty = DependencyProperty.Register(        "FluidInContainment", typeof(bool), typeof(VPWMainStateControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));        /// <summary>        /// FluidInContainment        /// </summary>        public bool FluidInContainment        {            get            {                return (bool)this.GetValue(FluidInContainmentProperty);            }            set            {                this.SetValue(FluidInContainmentProperty, value);            }        }        public static readonly DependencyProperty WaterPressureProperty = DependencyProperty.Register(            "WaterPressure", typeof(double), typeof(VPWMainStateControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));        /// <summary>        /// WaterPressure        /// </summary>        public double WaterPressure        {            get            {                return (double)this.GetValue(WaterPressureProperty);            }            set            {                this.SetValue(WaterPressureProperty, value);            }        }        public static readonly DependencyProperty PressureTargetProperty = DependencyProperty.Register(            "PressureTarget", typeof(double), typeof(VPWMainStateControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));        /// <summary>        /// PressureTarget        /// </summary>        public double PressureTarget        {            get            {                return (double)this.GetValue(PressureTargetProperty);            }            set            {                this.SetValue(PressureTargetProperty, value);            }        }        public static readonly DependencyProperty DIWInletValveOpenProperty = DependencyProperty.Register(            "DIWInletValveOpen", typeof(bool), typeof(VPWMainStateControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));        /// <summary>        /// DIWInletValveOpen        /// </summary>        public bool DIWInletValveOpen        {            get            {                return (bool)this.GetValue(DIWInletValveOpenProperty);            }            set            {                this.SetValue(DIWInletValveOpenProperty, value);            }        }        public static readonly DependencyProperty ChamberOpenProperty = DependencyProperty.Register(            "ChamberOpen", typeof(bool), typeof(VPWMainStateControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));        /// <summary>        /// ChamberOpen        /// </summary>        public bool ChamberOpen        {            get            {                return (bool)this.GetValue(ChamberOpenProperty);            }            set            {                this.SetValue(ChamberOpenProperty, value);            }        }        public static readonly DependencyProperty ChamberCloseProperty = DependencyProperty.Register(    "ChamberClose", typeof(bool), typeof(VPWMainStateControl), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsRender));        /// <summary>        /// ChamberClose        /// </summary>        public bool ChamberClose        {            get            {                return (bool)this.GetValue(ChamberCloseProperty);            }            set            {                this.SetValue(ChamberCloseProperty, value);            }        }        private void DIWInletValveOpen_Click(object sender, RoutedEventArgs e)        {            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DiwEnable");        }        private void DIWInletValveClose_Click(object sender, RoutedEventArgs e)        {            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DiwDisable");        }        private void ChamberOpen_Click(object sender, RoutedEventArgs e)        {            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ChamberDown");        }        private void ChamberClose_Click(object sender, RoutedEventArgs e)        {            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ChamberUp");        }    }}
 |