private void AFTER_B_DOING() { // 至上点 bool isOver = false; while (!isOver) { isOver = Z_TO(zeroPos.Z, 1); // 上点 if (!drawOnly) { isOver = ABTask.Z_TO(true, ABTask.zeroPos.Z, ABTask.zSpeed); } Thread.Sleep(10); } int b = currTask.AB_TASK_B; int rest_p = currTask.AB_TASK_B; if (taskList.Count == 1) {// X 横向移动到休息位休息 if (b == 3 || b == 4) { rest_p = 2; } if (b == 5 || b == 6) { rest_p = 7; } if (b == 11 || b == 12) { rest_p = 10; } if (b > 12) { rest_p = 0; } isOver = false; while (!isOver) { isOver = X_TO(loadPoints[rest_p].X, 50); // 平移至休息位 if (!drawOnly) { isOver = ABTask.X_TO(true, ABTask.loadPoints[rest_p].X, ABTask.xSpeed); // 平移至休息位 } Thread.Sleep(10); } } }
private void AFTER_B_DOING() { // 至上点 bool isOver = false; while (!isOver) { isOver = Z_TO(zeroPos.Z, 1); // 上点 GenericOp.GREASEnum++; //每个AB流程中会有两次z轴上升运动,计数 if (!drawOnly) { isOver &= ABTask.Z_TO(true, ABTask.zeroPos.Z, ABTask.zSpeed); } Thread.Sleep(10); } int b = currTask.AB_TASK_B; int rest_p = currTask.AB_TASK_B; if (taskList.Count == 1) {// X 横向移动到休息位休息 if (b == 3 || b == 4) rest_p = 2; if (b == 5 || b == 6) rest_p = 7; if (b >= 9) rest_p = 2; isOver = false; while (!isOver) { isOver = X_TO(loadPoints[rest_p].X, 50); // 平移至休息位 if (!drawOnly) { isOver &= ABTask.X_TO(true, ABTask.loadPoints[rest_p].X, ABTask.xSpeed); // 平移至休息位 } Thread.Sleep(10); } /*if (currTask.AB_TASK_B == hyWorkFlow.POS_UNLOAD)//关闭后门 { SerialManual.CloseStoveLid(8); }*/ } }
private void PRE_DOING(int pos_index) { // ---------------------------------------------------- // 至上点 bool isOver = false; while (!isOver) { isOver = Z_TO(zeroPos.Z, 1); // 上点 if (!drawOnly) { isOver = ABTask.Z_TO(true, ABTask.zeroPos.Z, ABTask.zSpeed); } Thread.Sleep(10); } if (!drawOnly) { int a = currTask.AB_TASK_A; if ((a == 6 || a == 11 || a == 12 || a == 10) && SerialWireless.GetGtryState(SerialWireless.GTRY_STATE_CLAMP)) { Thread.Sleep(100000); } } // 判断炉盖的状态,如果炉盖已经打开,则允许前行,否则不允许前行 // 需要打开炉盖的炉子有 _ _ _ 3、4、5、6 _ _ _ 10、11、12 if (!drawOnly) { int openStoveLidIndex; for (openStoveLidIndex = 0; openStoveLidIndex < 7; openStoveLidIndex++) { if (stoveLidAction[openStoveLidIndex] == STOVE_LID_ACTION.OPEN) { break;// 发现有炉盖需要打开 } } // SerialManual.STOVE_LID_STATE state; if (openStoveLidIndex < 7) { // 有炉盖需要打开,则不断等待炉盖打开到位信号。 state = SerialManual.stoveLidState[openStoveLidIndex]; // 查看当前这个炉盖的状态 while (state != SerialManual.STOVE_LID_STATE.OPENED) { // 等待炉盖打开到位信号。 Thread.Sleep(100); // 等待炉盖打开 state = SerialManual.stoveLidState[openStoveLidIndex]; // 查看当前这个炉盖的状态 // 超时处理 // TODO: 如果60秒都没有等到炉盖打开的话,需要给出提示信息。告诉用户炉盖故障:接近开关故障。 timeout_openStoveLid++; if (timeout_openStoveLid > 600) { GenericOp.errCode |= 0x01; } } GenericOp.errCode &= ~0x01; } } // ---------------------------------------------------- // 进入 A或者B 点区域 isOver = false; while (!isOver) { isOver = X_TO(loadPoints[pos_index].X, 50); // 平移 --> A if (!drawOnly) { isOver = ABTask.X_TO(true, ABTask.loadPoints[pos_index].X, ABTask.xSpeed); // 平移 --> A } Thread.Sleep(10); } }