private void confirmPort1CmdHandler() { bool? result = true; string newline = Environment.NewLine; // First check if we can confirm string cantConfirm = ""; if (string.IsNullOrEmpty(OperatorID) || OperatorLevel == null || OperatorLevel.Equals("InvalidUser")) { cantConfirm = "- Must have a valid Operator " + newline; } if (ToolStatus == null || ToolStatus == "../Images/CheckBoxRed.png") { cantConfirm += "- Must have a valid Tool " + newline; } // TODO: if (string.IsNullOrEmpty(Port1Lot1) && string.IsNullOrEmpty(Port1Lot2)) { cantConfirm += "- Must enter some valid lots " + newline; } if (!EquipmentReady) { cantConfirm += "- Control State must be 'REMOTE'"; } if (!ProcessStateReady) { cantConfirm += "- Process State must be 'READY'"; } if (!string.IsNullOrEmpty(cantConfirm)) { cantConfirm = "Confirmation cannot proceed until errors are fixed: " + newline + cantConfirm; var vm = new DialogViewModel(cantConfirm, "", "Ok"); result = dialogService.ShowDialog(vm); return; } if (CurrentToolConfig.Dialogs.ShowConfirmationBox) { var vm = new DialogViewModel("Are you sure you want to Confirm this lot?", "Yes", "No"); result = dialogService.ShowDialog(vm); } if (result.HasValue && result.GetValueOrDefault() == true) { // 2/22 Check if equipment is ready first // TODO: //if (currentTool.ReadyToStart()) { Messenger.Default.Send(new LoadingWafersMessage(thisPortNo, true, "Moving in wafers in Camstar...")); // TimerText = "Moving in wafers in Camstar..."; MyLog.Debug("ConfirmButtonPressed->"); MoveInAfterConfirmAsync(); } } }
/// <summary> /// 转化为逆波兰表达式 /// </summary> /// <param name="source"></param> /// <returns></returns> public static string ConvertToRPN(string source) { StringBuilder result = new StringBuilder(); Stack <string> stack = new Stack <string>(); string[] list = source.Split(' '); for (int i = 0; i < list.Length; i++) { string current = list[i]; if (Regex.IsMatch(current, "^([0-9]{1,}){1}")) { result.Append(current + " "); } else if (OperatorLevel.ContainsKey(current)) { if (stack.Count > 0) { var prev = stack.Peek(); if (prev == "(") { stack.Push(current); continue; } if (current == "(") { stack.Push(current); continue; } if (current == ")") { while (stack.Count > 0 && stack.Peek() != "(") { result.Append(stack.Pop() + " "); } //Pop the "(" stack.Pop(); continue; } if (OperatorLevel[current] < OperatorLevel[prev]) { while (stack.Count > 0) { var top = stack.Pop(); if (top != "(" && top != ")") { result.Append(top + " "); } else { break; } } stack.Push(current); } else { stack.Push(current); } } else { stack.Push(current); } } } if (stack.Count > 0) { while (stack.Count > 0) { var top = stack.Pop(); if (top != "(" && top != ")") { result.Append(top + " "); } } } return(result.ToString()); }