PlatingCellCCRControl.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. /// PlatingCellCCRControl.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class PlatingCellCCRControl : UserControl
  22. {
  23. public PlatingCellCCRControl()
  24. {
  25. InitializeComponent();
  26. }
  27. public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
  28. "ModuleName", typeof(string), typeof(PlatingCellCCRControl), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  29. /// <summary>
  30. /// 模块名称
  31. /// </summary>
  32. public string ModuleName
  33. {
  34. get
  35. {
  36. return (string)this.GetValue(ModuleNameProperty);
  37. }
  38. set
  39. {
  40. this.SetValue(ModuleNameProperty, value);
  41. }
  42. }
  43. public static readonly DependencyProperty StepProperty = DependencyProperty.Register(
  44. "Step", typeof(string), typeof(PlatingCellCCRControl), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  45. /// <summary>
  46. /// Step
  47. /// </summary>
  48. public string Step
  49. {
  50. get
  51. {
  52. return (string)this.GetValue(StepProperty);
  53. }
  54. set
  55. {
  56. this.SetValue(StepProperty, value);
  57. }
  58. }
  59. public static readonly DependencyProperty SpeedProperty = DependencyProperty.Register(
  60. "Speed", typeof(int), typeof(PlatingCellCCRControl), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
  61. /// <summary>
  62. /// Speed
  63. /// </summary>
  64. public int Speed
  65. {
  66. get
  67. {
  68. return (int)this.GetValue(SpeedProperty);
  69. }
  70. set
  71. {
  72. this.SetValue(SpeedProperty, value);
  73. }
  74. }
  75. public static readonly DependencyProperty TimeRemainProperty = DependencyProperty.Register(
  76. "TimeRemain", typeof(int), typeof(PlatingCellCCRControl), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
  77. /// <summary>
  78. /// TimeRemain
  79. /// </summary>
  80. public int TimeRemain
  81. {
  82. get
  83. {
  84. return (int)this.GetValue(TimeRemainProperty);
  85. }
  86. set
  87. {
  88. this.SetValue(TimeRemainProperty, value);
  89. }
  90. }
  91. private void Start_Click(object sender, RoutedEventArgs e)
  92. {
  93. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ManualCCRStart");
  94. }
  95. private void Stop_Click(object sender, RoutedEventArgs e)
  96. {
  97. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ManualCCRStop");
  98. }
  99. }
  100. }