VPWDegasControl.xaml.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using MECF.Framework.Common.OperationCenter;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace PunkHPX8_Themes.UserControls
  17. {
  18. /// <summary>
  19. /// VPWDegasControl.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class VPWDegasControl : UserControl
  22. {
  23. public VPWDegasControl()
  24. {
  25. InitializeComponent();
  26. }
  27. public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
  28. "ModuleName", typeof(string), typeof(VPWDegasControl),
  29. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  30. /// <summary>
  31. /// 模块名称
  32. /// </summary>
  33. public string ModuleName
  34. {
  35. get
  36. {
  37. return (string)this.GetValue(ModuleNameProperty);
  38. }
  39. set
  40. {
  41. this.SetValue(ModuleNameProperty, value);
  42. }
  43. }
  44. public static readonly DependencyProperty PumpEnableProperty = DependencyProperty.Register(
  45. "PumpEnable", typeof(bool), typeof(VPWDegasControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  46. /// <summary>
  47. /// PumpEnable
  48. /// </summary>
  49. public bool PumpEnable
  50. {
  51. get
  52. {
  53. return (bool)this.GetValue(PumpEnableProperty);
  54. }
  55. set
  56. {
  57. this.SetValue(PumpEnableProperty, value);
  58. }
  59. }
  60. public static readonly DependencyProperty PumpPressureProperty = DependencyProperty.Register(
  61. "PumpPressure", typeof(double), typeof(VPWDegasControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
  62. /// <summary>
  63. /// "PumpPressure
  64. /// </summary>
  65. public double PumpPressure
  66. {
  67. get
  68. {
  69. return (double)this.GetValue(PumpPressureProperty);
  70. }
  71. set
  72. {
  73. this.SetValue(PumpPressureProperty, value);
  74. }
  75. }
  76. public static readonly DependencyProperty DiwLoopDoProperty = DependencyProperty.Register(
  77. "DiwLoopDo", typeof(double), typeof(VPWDegasControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
  78. /// <summary>
  79. /// "DiwLoopDo
  80. /// </summary>
  81. public double DiwLoopDo
  82. {
  83. get
  84. {
  85. return (double)this.GetValue(DiwLoopDoProperty);
  86. }
  87. set
  88. {
  89. this.SetValue(DiwLoopDoProperty, value);
  90. }
  91. }
  92. private void PumpOff_Click(object sender, RoutedEventArgs e)
  93. {
  94. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DegasPumpDisable");
  95. }
  96. private void PumpOn_Click(object sender, RoutedEventArgs e)
  97. {
  98. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DegasPumpEnable");
  99. }
  100. }
  101. }