public void NotifyOpcJobFinished(string panelNo, string tolocation, string reallocation, bool panelfull) { try { var pState = panelfull ? PanelState.Full : PanelState.HalfFull; switch (pState) { case PanelState.HalfFull: var lcode = FrmMain.taskQ.UFGetPanelLastRoll(tolocation, panelNo); LableCode.UserSetPanelLastRoll(lcode); //设置板最后一卷布。 FrmMain.logOpt.Write($"{reallocation} 半板信号发出,最后一卷布标签{lcode}。slot: ", LogType.ROBOT_STACK); break; case PanelState.Full: FrmMain.logOpt.Write($"{reallocation}: 满板信号发出。slot: ", LogType.ROBOT_STACK); LableCode.SetPanelFinished(panelNo); // 满板时设置自由板位标志。 lock (TaskQueues.LOCK_LOCHELPER) { TaskQueues.lochelper.OnFull(reallocation); } break; case PanelState.LessHalf: break; default: FrmMain.logOpt.Write($"!板状态不明,不发信号, {pState}", LogType.ROBOT_STACK); break; } } catch (Exception ex) { FrmMain.logOpt.Write($"!来源: {nameof(NotifyOpcJobFinished)}, {ex}", LogType.ROBOT_STACK); } }
public void NotifyOpcJobFinished(string panelNo, string tolocation, string reallocation, bool panelfull) { try { var pState = panelfull ? PanelState.Full : PanelState.HalfFull; switch (pState) { case PanelState.HalfFull: var lcode = FrmMain.taskQ.UFGetPanelLastRoll(tolocation, panelNo); LableCode.UserSetPanelLastRoll(lcode); //设置板最后一卷布。 log($"{reallocation} 半板信号发出,最后一卷布标签{lcode}。slot: {param.BAreaFloorFinish[reallocation]}", LogType.ROBOT_STACK); client.TryWrite(param.BAreaFloorFinish[reallocation], true); break; case PanelState.Full: string msg; ErpHelper.NotifyPanelEnd(erpapi, panelNo, reallocation, out msg); log(msg, LogType.ROBOT_STACK); LableCode.SetPanelFinished(panelNo); // 满板时设置自由板位标志。 lock (TaskQueues.LOCK_LOCHELPER) { TaskQueues.lochelper.OnFull(reallocation); } lock (client) { PlcHelper.NotifyFullPanel(client, param, reallocation); } break; case PanelState.LessHalf: break; default: log($"!板状态不明,不发信号, {pState}", LogType.ROBOT_STACK); break; } } catch (Exception ex) { log($"!来源: {nameof(NotifyOpcJobFinished)}, {ex}", LogType.ROBOT_STACK); } }