using Caliburn.Micro; using Caliburn.Micro.Core; using FurnaceUI.Models; using MECF.Framework.Common.DataCenter; using OpenSEMI.ClientBase; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows; namespace FurnaceUI.Views.Jobs { public class InputCarrierInfoViewModel: FurnaceModuleUIViewModelBase { private string _carrierID; public string CarrierID { get => _carrierID; set { _carrierID = value; NotifyOfPropertyChange(nameof(CarrierID)); } } private string _waferCount = "0"; public string WaferCount { get => _waferCount; set { _waferCount = value; NotifyOfPropertyChange(nameof(WaferCount)); } } private string _waferType; public string WaferType { get => _waferType; set { _waferType = value; NotifyOfPropertyChange(nameof(WaferType)); } } private string _waferNo; public string WaferNo { get => _waferNo; set { _waferNo = value; NotifyOfPropertyChange(nameof(WaferNo)); } } private bool _isExistChecked = true; public bool IsExistChecked { get => _isExistChecked; set { _isExistChecked = value; NotifyOfPropertyChange(nameof(IsExistChecked)); } } private bool _isNoneChecked = true; public bool IsNoneChecked { get => _isNoneChecked; set { _isNoneChecked = value; NotifyOfPropertyChange(nameof(IsNoneChecked)); } } private string _slotMap; public string SlotMap { get => _slotMap; set { _slotMap = value; NotifyOfPropertyChange(nameof(SlotMap)); } } protected override void OnActivate() { base.OnActivate(); for (int i = 0; i < (int)QueryDataClient.Instance.Service.GetConfig("System.CassetteSlotCount"); i++) { SlotMap += 0; } } public void EditMap() { var windowManager = IoC.Get(); SpecifiedMapViewModel specifiedMapViewModel = new SpecifiedMapViewModel(); specifiedMapViewModel.WaferType = WaferType; if((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(specifiedMapViewModel, null, "Slot Map Info")) { SlotMap = specifiedMapViewModel.SlotMap; WaferCount = Regex.Matches(SlotMap, "1").Count.ToString(); if (SlotMap.Contains("1")) IsExistChecked = true; else IsNoneChecked = !IsExistChecked; } } public void AcceptCmd() { if (string.IsNullOrEmpty(SlotMap)) { DialogBox.ShowWarning("Specified Map is empty"); return; } ((Window)GetView()).DialogResult = true; } public void ClosedCmd(string cmdPar) { ((Window)GetView()).DialogResult = false; } } }