Sic.Framework/SimulatorCore/Robots/Sunway/SunwayWaferRobotView.xaml.cs

97 lines
2.4 KiB
C#
Raw Normal View History

2023-12-05 15:53:17 +08:00
using Aitex.Core.UI.MVVM;
using Aitex.Core.Utilities;
using MECF.Framework.Simulator.Core.Commons;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace MECF.Framework.Simulator.Core.Robots.Sunway
{
/// <summary>
2023-12-06 11:06:45 +08:00
/// SunwayWaferRobotView.xaml 的交互逻辑
2023-12-05 15:53:17 +08:00
/// </summary>
2023-12-06 11:06:45 +08:00
public partial class SunwayWaferRobotView : UserControl
2023-12-05 15:53:17 +08:00
{
2023-12-06 11:06:45 +08:00
public SunwayWaferRobotView()
2023-12-05 15:53:17 +08:00
{
InitializeComponent();
2023-12-06 11:06:45 +08:00
this.DataContext = new SunwayWaferRobotViewModel();
2023-12-05 15:53:17 +08:00
this.Loaded += OnViewLoaded;
}
private void OnViewLoaded(object sender, RoutedEventArgs e)
{
(DataContext as TimerViewModelBase).Start();
}
}
2023-12-06 11:06:45 +08:00
class SunwayWaferRobotViewModel : SocketDeviceViewModel
2023-12-05 15:53:17 +08:00
{
2023-12-06 11:06:45 +08:00
public string Title => "Sunway Wafer Robot Simulator";
2023-12-05 15:53:17 +08:00
private SunwayRobotSimulator _robot;
public bool IsError
{
get => _robot.IsError;
set => _robot.IsError = value;
}
//private string _value;
[IgnorePropertyChange]
public string ErrorCode
{
get => _robot.ErrorCode;
set => _robot.ErrorCode = value;
}
public bool StateChecked
{
get => _robot.StateChecked;
set => _robot.StateChecked = value;
}
public int StateCode
{
get => _robot.StateCode;
set => _robot.StateCode = value;
}
public bool EventChecked
{
get => _robot.EventChecked;
set
{
_robot.EventChecked = value;
if (value) EventCode = "_EVENT ROBOR 02610 0003 B -00028 000028 000028 -00002\r";
else EventCode = null;
}
}
[IgnorePropertyChange]
public string EventCode
{
get => _robot.EventCode;
set => _robot.EventCode = value;
}
2023-12-06 11:06:45 +08:00
public SunwayWaferRobotViewModel() : base("SunwayRobotViewModel")
2023-12-05 15:53:17 +08:00
{
2023-12-06 11:06:45 +08:00
_robot = new SunwayRobotSimulator(1103);
2023-12-05 15:53:17 +08:00
Init(_robot);
}
}
}