123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- using MECF.Framework.Common.OperationCenter;
- using CyberX8_Core;
- 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>
- /// PufMotionCommandControl.xaml 的交互逻辑
- /// </summary>
- public partial class PufMotionCommandControl : UserControl
- {
- public PufMotionCommandControl()
- {
- InitializeComponent();
- }
- public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register("ModuleName", typeof(string), typeof(PufMotionCommandControl));
- /// <summary>
- /// ModuleName
- /// </summary>
- public string ModuleName
- {
- get
- {
- return (string)this.GetValue(ModuleNameProperty);
- }
- set
- {
- this.SetValue(ModuleNameProperty, value);
- }
- }
- public static readonly DependencyProperty VacuumAProperty = DependencyProperty.Register( "VacuumA", typeof(bool), typeof(PufMotionCommandControl));
- /// <summary>
- /// VacuumA
- /// </summary>
- public bool VacuumA
- {
- get
- {
- return (bool)this.GetValue(VacuumAProperty);
- }
- set
- {
- this.SetValue(VacuumAProperty, value);
- }
- }
- public static readonly DependencyProperty VacuumBProperty = DependencyProperty.Register("VacuumB", typeof(bool), typeof(PufMotionCommandControl));
- /// <summary>
- /// VacuumB
- /// </summary>
- public bool VacuumB
- {
- get
- {
- return (bool)this.GetValue(VacuumBProperty);
- }
- set
- {
- this.SetValue(VacuumBProperty, value);
- }
- }
- public static readonly DependencyProperty VacuumAValueProperty = DependencyProperty.Register("VacuumAValue", typeof(double), typeof(PufMotionCommandControl));
- /// <summary>
- /// VacuumAValue
- /// </summary>
- public double VacuumAValue
- {
- get
- {
- return (double)this.GetValue(VacuumAValueProperty);
- }
- set
- {
- this.SetValue(VacuumAValueProperty, value);
- }
- }
- public static readonly DependencyProperty VacuumBValueProperty = DependencyProperty.Register("VacuumBValue", typeof(double), typeof(PufMotionCommandControl));
- /// <summary>
- /// VacuumBValue
- /// </summary>
- public double VacuumBValue
- {
- get
- {
- return (double)this.GetValue(VacuumBValueProperty);
- }
- set
- {
- this.SetValue(VacuumBValueProperty, value);
- }
- }
- public static readonly DependencyProperty VacuumACheckedProperty = DependencyProperty.Register("VacuumAChecked", typeof(bool), typeof(PufMotionCommandControl));
- /// <summary>
- /// VacuumAChecked
- /// </summary>
- public bool VacuumAChecked
- {
- get
- {
- return (bool)this.GetValue(VacuumACheckedProperty);
- }
- set
- {
- this.SetValue(VacuumACheckedProperty, value);
- }
- }
- public static readonly DependencyProperty VacuumBCheckedProperty = DependencyProperty.Register("VacuumBChecked", typeof(bool), typeof(PufMotionCommandControl));
- /// <summary>
- /// VacuumBChecked
- /// </summary>
- public bool VacuumBChecked
- {
- get
- {
- return (bool)this.GetValue(VacuumBCheckedProperty);
- }
- set
- {
- this.SetValue(VacuumBCheckedProperty, value);
- }
- }
- #region button 事件
- private void AllMotorOn_Click(object sender, RoutedEventArgs e)
- {
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.AllMotorOn");
- }
- private void AllMotorOff_Click(object sender, RoutedEventArgs e)
- {
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.AllMotorOff");
- }
- private void HomePuf_Click(object sender, RoutedEventArgs e)
- {
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Home");
- }
- private void VacuumA_Click(object sender, RoutedEventArgs e)
- {
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.VacuumAOn", "VacuumAChecked", VacuumAChecked);
- }
- #endregion
- private void VacuumB_Click(object sender, RoutedEventArgs e)
- {
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.VacuumBOn", "VacuumBChecked", VacuumBChecked);
- }
- }
- }
|