| | |
| | | else |
| | | { |
| | | /// 检查是否关门 |
| | | if (parent.executionWrapper?.GetStationGlobalValue<bool>($"StationState.DoorClose[{this.index}]", 0) != true) |
| | | if (!GetDoorClose(parent.executionWrapper)) |
| | | { |
| | | /// 没关门不允许启动 |
| | | MsgBoxHelper2.Warn("请先关闭舱门!"); |
| | |
| | | scanner = null; |
| | | } |
| | | |
| | | public bool GetDoorClose(ITestExecutionWrapper wrapper) |
| | | { |
| | | return wrapper?.GetStationGlobalValue<bool>($"StationState.DoorClose[{this.index}]", 0) == true; |
| | | } |
| | | |
| | | private void Scanner_FinishBarcode(object sender, BarcodeEventArg e) |
| | | { |
| | | if (parent.executionWrapper == null) return; |
| | |
| | | CellInfo cellInfo = ScannerParser.GetCellInfoByCode(CbProduct.SelectedItem?.ToString(), mainGrid.Columns, rows, e.positionCode); |
| | | string positionCode = e.positionCode, snrCode = e.snrCode; |
| | | |
| | | //将读到的条码写入到SN中 |
| | | int dutNo = this.index * this.cellCount + cellInfo.Index; |
| | | //if (cellInfo.OvenName != this.title) |
| | | //{ |
| | | // MsgBoxHelper2.Warn($"请切换至 [{cellInfo.OvenName}] 区扫码,当前为 [{this.title}] 区!"); |
| | | // return; |
| | | //} |
| | | |
| | | |
| | | var targetTable = TestResultView.nameTables[cellInfo.OvenName]; |
| | | |
| | | //将读到的条码写入到SN中 |
| | | int dutNo = targetTable.index * targetTable.cellCount + cellInfo.Index; |
| | | string LookupStr = $"StationState.SN[{dutNo}]"; |
| | | cellInfo.LookUpStr = LookupStr; |
| | | |
| | | ViewControl.Logger.Debug($"PositionCode: [{e.positionCode}], SNR: [{e.snrCode}], LookUpStr: [{LookupStr}]"); |
| | | ViewControl.Logger.Debug($"OvenName: [{cellInfo.OvenName}], CellIndex: [{cellInfo.Index}]"); |
| | | var cell = TestResultView.nameTables[cellInfo.OvenName].GetSingleCell(cellInfo.Index); |
| | | ViewControl.Logger.Info($"PositionCode: [{e.positionCode}], SNR: [{e.snrCode}], LookUpStr: [{LookupStr}]"); |
| | | ViewControl.Logger.Info($"OvenName: [{cellInfo.OvenName}], CellIndex: [{cellInfo.Index}]"); |
| | | var cell = targetTable.GetSingleCell(cellInfo.Index); |
| | | |
| | | if (targetTable.GetDoorClose(parent.executionWrapper)) |
| | | { |
| | | /// 关门了就不允许清条码 |
| | | MsgBoxHelper2.Warn($"{targetTable.title}炉生产中,不允许操作条码"); |
| | | //MsgBoxHelper2.Warn(this.lang("Tr.CantClearSNR")); |
| | | return; |
| | | } |
| | | |
| | | if (snrCode == null) |
| | | { |
| | | var oldCellInfo = e.lastInfo; |
| | | var oldCell = TestResultView.nameTables[oldCellInfo.OvenName].GetSingleCell(oldCellInfo.Index); |
| | | var oldTable = TestResultView.nameTables[oldCellInfo.OvenName]; |
| | | var oldCell = oldTable.GetSingleCell(oldCellInfo.Index); |
| | | if (oldCell.status != "hadCode") |
| | | { |
| | | throw new Exception(this.lang("Tr.PositionCantClearSNR", oldCellInfo.OriginCode)); |
| | |
| | | //parent.engine.Globals.SetValString(LookupStr, 1, snrCode); |
| | | //parent.engine.CommitGlobalsToDisk(promptOnSaveConflicts: false); |
| | | |
| | | TestResultView.nameTables[cellInfo.OvenName].GetSingleCell(cellInfo.Index).SetStatus("hadCode"); |
| | | TestResultView.nameTables[cellInfo.OvenName].GetSingleCell(cellInfo.Index).sn = snrCode; |
| | | cell.SetStatus("hadCode"); |
| | | cell.sn = snrCode; |
| | | Scanner.InsertNewCode(snrCode, cellInfo); |
| | | var light = $"Oven{this.index + 1}_Cell{cell.index + 1}_Light_OK"; |
| | | if (cell.LightGreen(true, out string msg)) |
| | | { |
| | | ViewControl.Logger.Debug($"Open Light [{light}] ON."); |
| | | } |
| | | else |
| | | { |
| | | ViewControl.Logger.Debug($"Open Light [{light}] Error.{msg}"); |
| | | } |
| | | cell.LightGreen(true, out string msg); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | string strs = datas_10015[2]; |
| | | string[] values = strs.Split(','); |
| | | |
| | | GetSingleCell(cellIndex).SetInfos(new Info |
| | | Dispatcher.Invoke(() => |
| | | { |
| | | step = values[0], |
| | | value = values[1], |
| | | limitUp = values[2], |
| | | limitDown = values[3], |
| | | unit = values[4], |
| | | result = values[5], |
| | | updateTime = values[6] |
| | | GetSingleCell(cellIndex).SetInfos(new Info |
| | | { |
| | | step = values[0], |
| | | value = values[1], |
| | | limitUp = values[2], |
| | | limitDown = values[3], |
| | | unit = values[4], |
| | | result = values[5], |
| | | updateTime = values[6] |
| | | }); |
| | | }); |
| | | //session.Send("1"); |
| | | } |
| | |
| | | |
| | | private void ClearAllSnr_Click(object sender, RoutedEventArgs e) |
| | | { |
| | | if (parent.executionWrapper?.GetStationGlobalValue<bool>($"StationState.DoorClose[{this.index}]", 0) == true) |
| | | if (GetDoorClose(parent.executionWrapper)) |
| | | { |
| | | /// 关门了就不允许清条码 |
| | | MsgBoxHelper2.Warn(this.lang("Tr.CantClearSNR")); |
| | |
| | | |
| | | public void TryClearCellSN(int cellIndex) |
| | | { |
| | | if (parent.executionWrapper?.GetStationGlobalValue<bool>($"StationState.DoorClose[{this.index}]", 0) == true) |
| | | if (GetDoorClose(parent.executionWrapper)) |
| | | { |
| | | MsgBoxHelper.Error(Window.GetWindow(this), this.lang("Tr.CantClearSNR")); |
| | | return; |
| | |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | string key = $"StationState.Start[{this.index}]"; |
| | | //string key = $"StationState.Start[{this.index}]"; |
| | | //if (parent.executionWrapper?.GetStationGlobalValue<bool>(key, 0) == true) |
| | | //{ |
| | | // MsgBoxHelper2.Warn("测试启动中,不允许Abort"); |
| | |
| | | { |
| | | return; |
| | | } |
| | | LogHelper.Info("UI", "Abort按钮按下", out _); |
| | | ViewControl.Logger.Info("Abort按钮按下"); |
| | | key = $"StationState.Abort[{this.index}]"; |
| | | LogHelper.Info("UI", $"{title} Abort按钮按下", out _); |
| | | ViewControl.Logger.Info($"{title} Abort按钮按下"); |
| | | string key = $"StationState.Abort[{this.index}]"; |
| | | parent.executionWrapper?.SetStationGlobalValue(key, 0, true); |
| | | } |
| | | } |