TeachViewModel.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using OHV.Module.Interactivity;
  2. using OHV.SqliteDAL;
  3. using Prism.Commands;
  4. using Prism.Events;
  5. using Prism.Mvvm;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Input;
  12. using VehicleControlSystem;
  13. namespace OHV.Module.MainViews.Views
  14. {
  15. public class TeachViewModel : BindableBase
  16. {
  17. IEventAggregator eventAggregator = null;
  18. VCSystem vcSystem = null;
  19. MessageController msgController = null;
  20. SqliteManager sql = null;
  21. public ICommand ServoConfigCommand { get; set; }
  22. public ICommand JogPopup { get; set; }
  23. public ICommand LockPopup { get; set; }
  24. public ICommand DriveTeachPopup { get; set; }
  25. public ICommand InOutControlPopup { get; set; }
  26. public TeachViewModel( IEventAggregator _ea , VCSystem _vcSystem , MessageController _msgController, SqliteManager _sql )
  27. {
  28. this.eventAggregator = _ea;
  29. this.vcSystem = _vcSystem;
  30. this.msgController = _msgController;
  31. this.sql = _sql;
  32. this.JogPopup = new DelegateCommand( ExecuteServoConfigCommand );
  33. this.LockPopup = new DelegateCommand( ExecuteLockPopupCommand );
  34. this.DriveTeachPopup = new DelegateCommand( ExecuteDriveTeachPopupCommand );
  35. this.InOutControlPopup = new DelegateCommand( ExecuteInOutControlPopup );
  36. }
  37. private void ExecuteInOutControlPopup( )
  38. {
  39. this.msgController.ShowInOutControlPopupView();
  40. }
  41. private void ExecuteDriveTeachPopupCommand( )
  42. {
  43. this.msgController.ShowDrivePopupView();
  44. }
  45. private void ExecuteLockPopupCommand( )
  46. {
  47. this.msgController.ShowLockPopupView();
  48. }
  49. private void ExecuteServoConfigCommand( )
  50. {
  51. this.msgController.ShowServoConfigPopupView();
  52. }
  53. private void ExecuteMapCommand( )
  54. {
  55. this.msgController.ShowMapPopupView();
  56. }
  57. public void Init( )
  58. {
  59. }
  60. }
  61. }