SkySGMPumpView.xaml.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using Aitex.Core.UI.MVVM;
  2. using Aitex.Core.Utilities;
  3. using MECF.Framework.Simulator.Core.Commons;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Imaging;
  16. using System.Windows.Navigation;
  17. using System.Windows.Shapes;
  18. namespace MECF.Framework.Simulator.Core.Pumps.SkySGM
  19. {
  20. /// <summary>
  21. /// SkySGMPumpView.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class SkySGMPumpView : UserControl
  24. {
  25. public SkySGMPumpView()
  26. {
  27. InitializeComponent();
  28. this.DataContext = new SkySGMPumpViewModel();
  29. this.Loaded += OnViewLoaded;
  30. }
  31. private void OnViewLoaded(object sender, RoutedEventArgs e)
  32. {
  33. (DataContext as TimerViewModelBase).Start();
  34. }
  35. }
  36. class SkySGMPumpViewModel : SocketDeviceViewModel
  37. {
  38. public string Title
  39. {
  40. get { return "SkySGM Pump Simulator"; }
  41. }
  42. private SkySGMPumpSimulator _skySGMPump;
  43. public SkySGMPumpViewModel() : base("SkySGMPumpViewModel")
  44. {
  45. _skySGMPump = new SkySGMPumpSimulator(1104,0,"\r\n",'\r',10);
  46. Init(_skySGMPump);
  47. }
  48. }
  49. }