取放料增加一个是否受停止按钮的控制

master
lhiven 10 months ago
parent 845dac2c83
commit ef28c6bf22

@ -374,7 +374,7 @@ namespace Rs.MotionPlat.Flow
ProductLocationResult ret = productLocationResult.Where(r => r.SlotIndex == takeSlotIndex).FirstOrDefault(); ProductLocationResult ret = productLocationResult.Where(r => r.SlotIndex == takeSlotIndex).FirstOrDefault();
if(ret != null || GlobalVar.RunSpace) if(ret != null || GlobalVar.RunSpace)
{ {
if((ret!= null && ret.Result== EOneGrabSixteenResult.Ok) || GlobalVar.RunSpace) if((ret!= null && ret.Result== EOneGrabSixteenResult.Ok) ||(ret!=null &&ret.Result== EOneGrabSixteenResult.LocationOkScanBarcodeFail && GlobalVar.EnableVirtualBarCode) || GlobalVar.RunSpace)
{ {
StockTakeFlow.Instance.Take( ETrayType.Input, takeSlotIndex, NozzleManager.GetIdelNozzle().NozzleIndex); StockTakeFlow.Instance.Take( ETrayType.Input, takeSlotIndex, NozzleManager.GetIdelNozzle().NozzleIndex);
takeSlotIndex++; takeSlotIndex++;
@ -677,6 +677,7 @@ namespace Rs.MotionPlat.Flow
if (placeSlotIndex > 0) if (placeSlotIndex > 0)
{ {
StockPlaceFlow.Instance.Place(ETrayType.Ok, placeSlotIndex, placeNozzleIndex); StockPlaceFlow.Instance.Place(ETrayType.Ok, placeSlotIndex, placeNozzleIndex);
} }
else if (placeSlotIndex == 0)//此区域已经无穴位放产品 else if (placeSlotIndex == 0)//此区域已经无穴位放产品
{ {

@ -49,7 +49,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
/// 三点定位(左上/右上/左下) /// 三点定位(左上/右上/左下)
/// </summary> /// </summary>
/// <param name="trayType"></param> /// <param name="trayType"></param>
public void Location(ETrayType trayType) public void Location(ETrayType trayType,bool needStop=true)
{ {
step = EThreePointLocationFlowStep.; step = EThreePointLocationFlowStep.;
List<int> points = new List<int>() { 1, 16, 241 }; List<int> points = new List<int>() { 1, 16, 241 };
@ -65,7 +65,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
//Task.Run(() => { //Task.Run(() => {
while (!finished) while (!finished)
{ {
if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop) if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop)
{ {
Thread.Sleep(10); Thread.Sleep(10);
continue; continue;

@ -56,12 +56,13 @@ namespace Rs.MotionPlat.Flow.SafePosFlow
private AlarmEntity alarmEntity = null; private AlarmEntity alarmEntity = null;
EDischargeModuleGoSafePosFlowStep step = EDischargeModuleGoSafePosFlowStep.; EDischargeModuleGoSafePosFlowStep step = EDischargeModuleGoSafePosFlowStep.;
TargetPosition targetPos = new TargetPosition();
/// <summary> /// <summary>
/// 排料头回安全位 /// 排料头回安全位
/// </summary> /// </summary>
public void GoSafePostion() public void GoSafePostion()
{ {
TargetPosition targetPos = new TargetPosition();
if (finished) if (finished)
{ {
taskFinishedEvent.Reset(); taskFinishedEvent.Reset();
@ -138,6 +139,7 @@ namespace Rs.MotionPlat.Flow.SafePosFlow
/// </summary> /// </summary>
public void MoveXToSafe() public void MoveXToSafe()
{ {
TargetPosition targetPos = new TargetPosition();
bool arrivedSafePos = false; bool arrivedSafePos = false;
EDischargeModuleGoSafePosFlowStep moveXStep = EDischargeModuleGoSafePosFlowStep.; EDischargeModuleGoSafePosFlowStep moveXStep = EDischargeModuleGoSafePosFlowStep.;
//判断Y1当前在治具还是在料仓只有在治具侧才需要把X先移动到安全位 //判断Y1当前在治具还是在料仓只有在治具侧才需要把X先移动到安全位
@ -184,6 +186,7 @@ namespace Rs.MotionPlat.Flow.SafePosFlow
/// </summary> /// </summary>
public void MoveY1ToFixtureSide(double targetLoadX) public void MoveY1ToFixtureSide(double targetLoadX)
{ {
TargetPosition targetPos = new TargetPosition();
bool arrivedSafePos = false; bool arrivedSafePos = false;
EDischargeModuleGoSafePosFlowStep moveY1Step = EDischargeModuleGoSafePosFlowStep.; EDischargeModuleGoSafePosFlowStep moveY1Step = EDischargeModuleGoSafePosFlowStep.;
//判断Y1当前在治具还是在料仓只有在料仓侧才需要把Y1先移动治具那边 //判断Y1当前在治具还是在料仓只有在料仓侧才需要把Y1先移动治具那边

@ -65,7 +65,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
/// <param name="tray">需要放入的料盘</param> /// <param name="tray">需要放入的料盘</param>
/// <param name="nozzleIndex">哪个吸嘴放</param> /// <param name="nozzleIndex">哪个吸嘴放</param>
/// <param name="className"></param> /// <param name="className"></param>
public void Place(ETrayType trayType,int slotIndex,int nozzleIndex) public void Place(ETrayType trayType,int slotIndex,int nozzleIndex,bool needStop=true)
{ {
RsTray tray = null; RsTray tray = null;
if (finished) if (finished)
@ -99,7 +99,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
TraySlot curPlaceSlot = null; TraySlot curPlaceSlot = null;
while (!finished) while (!finished)
{ {
if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop) if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop)
{ {
Thread.Sleep(10); Thread.Sleep(10);
continue; continue;

@ -60,7 +60,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
/// 料仓取料 /// 料仓取料
/// </summary> /// </summary>
/// <param name="className"></param> /// <param name="className"></param>
public void Take(ETrayType trayType, int slotIndex,int nozzleIndex, ProductLocationResult locaResult=null) public void Take(ETrayType trayType, int slotIndex,int nozzleIndex, ProductLocationResult locaResult=null,bool needStop=true)
{ {
if (finished) if (finished)
finished = false; finished = false;
@ -71,7 +71,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
TargetPosition targetPosition = new TargetPosition(); TargetPosition targetPosition = new TargetPosition();
while (!finished) while (!finished)
{ {
if (MachineManage.Instance.MachineStatus== EMachineStatus.Stop) if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop && needStop)
{ {
Thread.Sleep(10); Thread.Sleep(10);
continue; continue;
@ -188,9 +188,19 @@ namespace Rs.MotionPlat.Flow.SubFlow
} }
else else
{ {
if(OneGrabSixteenManager.Instance.GetResultBySlotIndex(slotIndex)!=null) ProductLocationResult vResult = OneGrabSixteenManager.Instance.GetResultBySlotIndex(slotIndex);
if (vResult!=null)
{ {
curNozzle.Product = new TestProduct() { SN = OneGrabSixteenManager.Instance.GetResultBySlotIndex(slotIndex).SN, TestNum = 0, From = $"R{waitTakeProductSlot.Row + 1}C{waitTakeProductSlot.Column + 1}" }; string sn = string.Empty;
if(GlobalVar.EnableVirtualBarCode)
{
sn = VirtualBarCode.Code;
}
else
{
sn = vResult.SN;
}
curNozzle.Product = new TestProduct() { SN = sn, TestNum = 0, From = $"R{waitTakeProductSlot.Row + 1}C{waitTakeProductSlot.Column + 1}" };
} }
} }
curNozzle.Status = ENozzleStatus.ToTest; curNozzle.Status = ENozzleStatus.ToTest;

Loading…
Cancel
Save