YaskawaNX100RobotView.xaml.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  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. using Aitex.Core.UI.MVVM;
  17. using Aitex.Core.Utilities;
  18. using MECF.Framework.Simulator.Core.Aligners;
  19. using MECF.Framework.Simulator.Core.Commons;
  20. using MECF.Framework.Simulator.Core.Driver;
  21. namespace MECF.Framework.Simulator.Core.Robots
  22. {
  23. /// <summary>
  24. /// YaskawaNX100RobotView.xaml 的交互逻辑
  25. /// </summary>
  26. public partial class YaskawaNX100RobotView : UserControl
  27. {
  28. public YaskawaNX100RobotView()
  29. {
  30. InitializeComponent();
  31. this.DataContext = new YaskawaNX100RobotViewModel();
  32. this.Loaded += OnViewLoaded;
  33. }
  34. private void OnViewLoaded(object sender, RoutedEventArgs e)
  35. {
  36. (DataContext as TimerViewModelBase).Start();
  37. }
  38. }
  39. class YaskawaNX100RobotViewModel : SocketDeviceViewModel
  40. {
  41. public string Title
  42. {
  43. get { return "Yaskawa NX100 Robot Simulator"; }
  44. }
  45. private YaskawaNX100RobotSimulator _robot;
  46. public bool IsFailed
  47. {
  48. get
  49. {
  50. return _robot.Failed;
  51. }
  52. set
  53. {
  54. _robot.Failed = value;
  55. }
  56. }
  57. //private string _value;
  58. [IgnorePropertyChange]
  59. public string ResultValue
  60. {
  61. get
  62. {
  63. return _robot.ResultValue;
  64. }
  65. set
  66. {
  67. _robot.ResultValue = value;
  68. }
  69. }
  70. public YaskawaNX100RobotViewModel() : base("YaskawaNX100RobotViewModel")
  71. {
  72. _robot = new YaskawaNX100RobotSimulator();
  73. Init(_robot);
  74. }
  75. }
  76. }