| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 | using Aitex.Core.RT.IOCore;using Aitex.Core.UI.MVVM;using MECF.Framework.Simulator.Core.Commons;using System;using System.Collections.Generic;using System.Configuration;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;using Venus_Core;using Venus_Simulator.Devices;namespace Venus_Simulator.Views{    /// <summary>    /// Simu_VCEView.xaml 的交互逻辑    /// </summary>    public partial class Simu_VCEView : UserControl    {        public Simu_VCEView()        {            InitializeComponent();            DataContext = new VceViewModel("COM161","VCEA");        }    }    class VceViewModel : SerialPortDeviceViewModel    {        public ICommand CassArrive { get; set; }        public ICommand CassLeave { get; set; }        public ICommand AllExist { get; set; }        public ICommand AllEmpty { get; set; }        public string Title        {            get { return "VCE simulator"; }        }        private VceSimulator _vce;        private string chamber;        private ConfigType type;        public VceViewModel(string port,string _chamber) : base(_chamber)        {            chamber = _chamber;            Init(_vce = new VceSimulator(port));            CassArrive = new DelegateCommand<string>(cassArrive);            CassLeave  = new DelegateCommand<string>(cassLeave);            AllExist   = new DelegateCommand<string>(allExist);            AllEmpty   = new DelegateCommand<string>(allEmpty);            var section = ConfigurationManager.GetSection("customSettings") as System.Collections.Specialized.NameValueCollection;            type = (ConfigType)Convert.ToInt32(section["SimulatorType"]);        }        private void cassArrive(string obj)        {            if(type == ConfigType.VenusSE)                IO.DI[$"SETM.DI_{chamber}_Cassette_Present"].Value = true;            if (type == ConfigType.VenusDE)                IO.DI[$"DETM.DI_{chamber}_Cassette_Present"].Value = true;        }        private void cassLeave(string obj)        {            if (type == ConfigType.VenusSE)                IO.DI[$"SETM.DI_{chamber.ToString()}_Cassette_Present"].Value = false;            if (type == ConfigType.VenusDE)                IO.DI[$"DETM.DI_{chamber.ToString()}_Cassette_Present"].Value = false;        }        private void allExist(string obj)        {            _vce.Wafermap(false);        }        private void allEmpty(string obj)        {            _vce.Wafermap(true);        }    }}
 |