using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Aitex.Core.UI.MVVM;
using MECF.Framework.Simulator.Core.Commons;
using Virgo_DSimulator.Devices;
namespace Virgo_DSimulator.Views
{
///
/// Interaction logic for Simu_EfemView.xaml
///
public partial class Simu_EfemView : UserControl
{
public Simu_EfemView()
{
InitializeComponent();
this.DataContext = new EfemSimulatorViewModel();
this.Loaded += OnViewLoaded;
}
private void OnViewLoaded(object sender, RoutedEventArgs e)
{
(DataContext as TimerViewModelBase)?.Start();
}
}
class EfemSimulatorViewModel : SocketDeviceViewModel
{
public string Title
{
get { return "EFEM Simulator"; }
}
public string WaferMap
{
get { return _sim.SlotMap; }
}
private EfemSimulatorServer _sim;
public ICommand PlaceCommand { get; set; }
public ICommand RemoveCommand { get; set; }
public ICommand ClearCommand { get; set; }
public ICommand SetAllCommand { get; set; }
public ICommand RandomCommand { get; set; }
public EfemSimulatorViewModel() : base("EfemSimuViewModel")
{
PlaceCommand = new DelegateCommand(Place);
RemoveCommand = new DelegateCommand(Remove);
ClearCommand = new DelegateCommand(Clear);
SetAllCommand = new DelegateCommand(SetAll);
RandomCommand = new DelegateCommand(RandomGenerateWafer);
_sim = new EfemSimulatorServer();
Init(_sim);
}
private void RandomGenerateWafer(string obj)
{
_sim.RandomWafer();
}
private void SetAll(string obj)
{
_sim.SetAllWafer();
}
private void Clear(string obj)
{
_sim.ClearWafer();
}
private void Remove(string obj)
{
_sim.RemoveCarrier();
}
private void Place(string obj)
{
_sim.PlaceCarrier();
}
}
}