优化和中控弹框

master
lhiven 2 years ago
parent 80a3d3b5f0
commit 822d5f3482

@ -157,6 +157,17 @@ namespace Rs.MotionPlat.Commom
}); });
} }
public static void Stop()
{
WorkFlow.Instance.Stop();
TurnoverFlow.Instance.Stop();
TakeTrayFlow.Instance.Stop();
StockManager.Instance.Stop();
MachineManage.Instance.SetCenterMachineStatus(ERunStatus.Stopped);
MachineManage.Instance.SetLoadUnloadStatus(ERunState.Interrupt);
MachineManage.Instance.MachineStatus = EMachineStatus.Stop;
}
public static void GoHome() public static void GoHome()
{ {
if (MachineManage.Instance.MachineStatus == EMachineStatus.Homed if (MachineManage.Instance.MachineStatus == EMachineStatus.Homed
@ -171,17 +182,7 @@ namespace Rs.MotionPlat.Commom
MessageQueue.Instance.Warn($"device state {MachineManage.Instance.MachineStatus} cann't home!"); MessageQueue.Instance.Warn($"device state {MachineManage.Instance.MachineStatus} cann't home!");
} }
} }
public static void Stop()
{
WorkFlow.Instance.Stop();
TurnoverFlow.Instance.Stop();
TakeTrayFlow.Instance.Stop();
StockManager.Instance.Stop();
MachineManage.Instance.SetCenterMachineStatus(ERunStatus.Stopped);
MachineManage.Instance.SetLoadUnloadStatus(ERunState.Interrupt);
MachineManage.Instance.MachineStatus = EMachineStatus.Stop;
}
public static bool IsStop(params string[] axies) public static bool IsStop(params string[] axies)
{ {
foreach (var axisname in axies) foreach (var axisname in axies)

@ -1,7 +1,9 @@
using Rs.MotionPlat.Flow; using Rs.MotionPlat.Flow;
using System; using System;
using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.CompilerServices;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -11,63 +13,67 @@ namespace Rs.MotionPlat.Commom
{ {
public class TestCenterMessageBox public class TestCenterMessageBox
{ {
private int ID; static Dictionary<int,ManualResetEvent> msgSentEvent;
private SchedulingMessageBox msgBox; static Dictionary<int, SchedulingMessageBox> resultMessageBox;
private ManualResetEvent msgRecivedEvent; static object msgLock = new object();
public TestCenterMessageBox() static TestCenterMessageBox()
{ {
msgBox = new SchedulingMessageBox(); msgSentEvent = new Dictionary<int,ManualResetEvent>();
msgRecivedEvent = new ManualResetEvent(false); resultMessageBox = new Dictionary<int, SchedulingMessageBox>();
} }
public void Show(int id,string message,ETipButton button,Dictionary<ETipButton,string> buttonTexts) public static void Show(int id, string message, ETipButton button)
{ {
ID = id; Show(id, message, button, null);
msgBox.ButtonContexts = buttonTexts; }
public static void Show(int id,string message,ETipButton button,Dictionary<ETipButton,string> buttonTexts)
{
SchedulingMessageBox msgBox = new SchedulingMessageBox();
if(buttonTexts!=null)
msgBox.ButtonContexts = buttonTexts;
msgBox.Message = message; msgBox.Message = message;
msgBox.Button = button; msgBox.Button = button;
msgBox.Instruction = EInstruction.ShowMessage; msgBox.Instruction = EInstruction.ShowMessage;
msgBox.ID = id; msgBox.ID = id;
TestCenter.Instance.ShowMsgBox(msgBox); TestCenter.Instance.ShowMsgBox(msgBox);
TestCenterMessageBoxManager.Add(id, this); msgSentEvent.Add(id, new ManualResetEvent(false));
} }
public SchedulingMessageBox Result; public static void RecivedMsg(SchedulingMessageBox result)
public void Recived(SchedulingMessageBox result)
{ {
Result = result; if (msgSentEvent.ContainsKey(result.ID))
msgRecivedEvent.Set(); {
if (!resultMessageBox.ContainsKey(result.ID))
} {
resultMessageBox.Add(result.ID, result);
}
msgSentEvent[result.ID].Set();
}
public SchedulingMessageBox WaitResult()
{
msgRecivedEvent.WaitOne();
TestCenterMessageBoxManager.Remove(ID);
return Result;
}
}
public class TestCenterMessageBoxManager
{
private static Dictionary<int, TestCenterMessageBox> msgBoxDic = new Dictionary<int, TestCenterMessageBox>();
public static void Add(int id,TestCenterMessageBox msgBox)
{
msgBoxDic.Add(id,msgBox);
} }
public static TestCenterMessageBox GetMsgbox(int id) public static SchedulingMessageBox WaitResult(int id)
{ {
if(msgBoxDic.ContainsKey(id)) SchedulingMessageBox box = new SchedulingMessageBox();
return msgBoxDic[id]; if (msgSentEvent.ContainsKey(id))
return null; {
msgSentEvent[id].WaitOne();
msgSentEvent.Remove(id);
box = resultMessageBox[id];
resultMessageBox.Remove(id);
}
return box;
} }
public static void Remove(int id) public static int GetMsgID()
{ {
if( msgBoxDic.ContainsKey(id)) if(msgSentEvent.Count==1)
msgBoxDic.Remove(id); {
return msgSentEvent.ElementAt(0).Key;
}
return -1;
} }
} }
} }

@ -14,6 +14,7 @@ namespace Rs.MotionPlat.Flow
protected bool b_IsStop = true; protected bool b_IsStop = true;
private Task mainTask; private Task mainTask;
protected string logInfo = ""; protected string logInfo = "";
protected string alarmInfo = "";
protected int stopWaitTime = 10; protected int stopWaitTime = 10;
protected int sleepTime = 10; protected int sleepTime = 10;
public BaseFlow() { public BaseFlow() {

@ -23,7 +23,11 @@ namespace Rs.MotionPlat.Flow
StopButtonUp,//停止按钮抬起, StopButtonUp,//停止按钮抬起,
DoorOpend,//门被打开, DoorOpend,//门被打开,
LightButtonPressed,//照明被按下 LightButtonPressed,//照明被按下
LightButtonUp//照明被抬起 LightButtonUp,//照明被抬起
SkipButtonPressed,//跳过被按下
SkipButtonUp,//跳过被抬起
RetryButtonPressed,//重试被按下
RetryButtonUp//重试被抬起
} }
public enum ESystemButton public enum ESystemButton
@ -49,6 +53,7 @@ namespace Rs.MotionPlat.Flow
EMonitorButtonStep step = EMonitorButtonStep.Monitoring; EMonitorButtonStep step = EMonitorButtonStep.Monitoring;
private static MonitorSystemButton instance; private static MonitorSystemButton instance;
private short signalValue = 0; private short signalValue = 0;
int msgID = -1;
public static MonitorSystemButton Instance public static MonitorSystemButton Instance
{ {
get get
@ -127,6 +132,20 @@ namespace Rs.MotionPlat.Flow
step = EMonitorButtonStep.LightButtonPressed; step = EMonitorButtonStep.LightButtonPressed;
break; break;
} }
signalValue = IoManager.Instance.ReadIn("跳过");
if (signalValue == 1)
{
step = EMonitorButtonStep.SkipButtonPressed;
break;
}
signalValue = IoManager.Instance.ReadIn("重试");
if (signalValue == 1)
{
step = EMonitorButtonStep.RetryButtonPressed;
break;
}
break; break;
case EMonitorButtonStep.EStopButtonPressed: case EMonitorButtonStep.EStopButtonPressed:
MessageQueue.Instance.Insert("急停按钮按下"); MessageQueue.Instance.Insert("急停按钮按下");
@ -155,15 +174,16 @@ namespace Rs.MotionPlat.Flow
if (MachineManage.Instance.MachineStatus== EMachineStatus.Stop if (MachineManage.Instance.MachineStatus== EMachineStatus.Stop
|| MachineManage.Instance.MachineStatus== EMachineStatus.Homed) || MachineManage.Instance.MachineStatus== EMachineStatus.Homed)
{ {
if(MachineManage.Instance.NeedRestoreMove) Ops.Start();
{ //if(MachineManage.Instance.NeedRestoreMove)
MachineManage.Instance.NeedRestoreMove = false; //{
//WorkFlow.Instance.Restore(); // MachineManage.Instance.NeedRestoreMove = false;
Thread.Sleep(100); // //WorkFlow.Instance.Restore();
} // Thread.Sleep(100);
WorkFlow.Instance.Start(); //}
MachineManage.Instance.MachineStatus = EMachineStatus.Working; //WorkFlow.Instance.Start();
LightManger.Instance.SetStatus(ELightStatus.Green); //MachineManage.Instance.MachineStatus = EMachineStatus.Working;
//LightManger.Instance.SetStatus(ELightStatus.Green);
} }
else else
{ {
@ -210,8 +230,9 @@ namespace Rs.MotionPlat.Flow
} }
else else
{ {
WorkFlow.Instance.Stop(); //WorkFlow.Instance.Stop();
MachineManage.Instance.MachineStatus = EMachineStatus.Stop; Ops.Stop();
//MachineManage.Instance.MachineStatus = EMachineStatus.Stop;
} }
LightManger.Instance.SetStatus(ELightStatus.Yellow); LightManger.Instance.SetStatus(ELightStatus.Yellow);
} }
@ -251,6 +272,52 @@ namespace Rs.MotionPlat.Flow
step = EMonitorButtonStep.Monitoring; step = EMonitorButtonStep.Monitoring;
} }
break; break;
case EMonitorButtonStep.SkipButtonPressed:
//关闭消息
MessageQueue.Instance.Insert("跳过按钮按下");
msgID = TestCenterMessageBox.GetMsgID();
if (msgID>0)
{
SchedulingMessageBox box = new SchedulingMessageBox();
box.Button = SchedulingMessageBox.ETipButton.Skip;
box.Instruction = EInstruction.CloseMessage;
box.TurnoverID = 0;
box.GroupID= 0;
box.ID = msgID;
TestCenter.Instance.Send(box);
}
step = EMonitorButtonStep.SkipButtonUp;
break;
case EMonitorButtonStep.SkipButtonUp:
if (Ops.IsOff("跳过"))
{
MessageQueue.Instance.Insert("跳过按钮抬起");
step = EMonitorButtonStep.Monitoring;
}
break;
case EMonitorButtonStep.RetryButtonPressed:
//关闭消息
MessageQueue.Instance.Insert("重试按钮按下");
msgID = TestCenterMessageBox.GetMsgID();
if (msgID > 0)
{
SchedulingMessageBox box = new SchedulingMessageBox();
box.Button = SchedulingMessageBox.ETipButton.Retry;
box.Instruction = EInstruction.CloseMessage;
box.TurnoverID = 0;
box.GroupID = 0;
box.ID = msgID;
TestCenter.Instance.Send(box);
}
step = EMonitorButtonStep.RetryButtonUp;
break;
case EMonitorButtonStep.RetryButtonUp:
if (Ops.IsOff("重试"))
{
MessageQueue.Instance.Insert("重试按钮抬起");
step = EMonitorButtonStep.Monitoring;
}
break;
default: default:
break; break;
} }

@ -188,7 +188,8 @@ namespace Rs.MotionPlat.Flow
break; break;
case EInstruction.CloseMessage: case EInstruction.CloseMessage:
SchedulingMessageBox mbox = JsonConvert.DeserializeObject<SchedulingMessageBox>(json); SchedulingMessageBox mbox = JsonConvert.DeserializeObject<SchedulingMessageBox>(json);
TestCenterMessageBoxManager.GetMsgbox(mbox.ID)?.Recived(mbox); TestCenterMessageBox.RecivedMsg(mbox);
//TestCenterMessageBoxManager.GetMsgbox(mbox.ID)?.Recived(mbox);
break; break;
case EInstruction.MachineButtonDown: case EInstruction.MachineButtonDown:
break; break;

@ -155,7 +155,6 @@ namespace Rs.MotionPlat.Flow
} }
logInfo = $"到周转盘取料位上方"; logInfo = $"到周转盘取料位上方";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
LogHelper.Debug(logInfo);
Step = ETurnoverFlowStep.; Step = ETurnoverFlowStep.;
} }
else else
@ -168,7 +167,6 @@ namespace Rs.MotionPlat.Flow
{ {
logInfo = $"已运动到周转盘取料位上方 TurnoverY at:{Ops.GetCurPosition( AxisAlias.TurnoverY)}"; logInfo = $"已运动到周转盘取料位上方 TurnoverY at:{Ops.GetCurPosition( AxisAlias.TurnoverY)}";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
LogHelper.Debug(logInfo);
Step = ETurnoverFlowStep.1; Step = ETurnoverFlowStep.1;
} }
break; break;

@ -55,7 +55,7 @@ namespace Rs.MotionPlat.Flow
} }
else else
{ {
StockManager.Instance.ChangeStatus(EStockType.Input, AutoDischarge.V3.Flow.ETrayStatus.Loaded); //StockManager.Instance.ChangeStatus(EStockType.Input, AutoDischarge.V3.Flow.ETrayStatus.Loaded);
} }
if (!StockManager.Instance.HasTray(EStockType.Empty2) || GlobalVar.VirtualAxis) if (!StockManager.Instance.HasTray(EStockType.Empty2) || GlobalVar.VirtualAxis)

@ -1,4 +1,5 @@
using HalconDotNet; using HalconDotNet;
using Rs.AutoDischarge.V3.Flow;
using Rs.Camera; using Rs.Camera;
using Rs.Controls; using Rs.Controls;
using Rs.Framework; using Rs.Framework;
@ -15,6 +16,7 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using static Rs.MotionPlat.Commom.SchedulingMessageBox;
namespace Rs.MotionPlat.Flow namespace Rs.MotionPlat.Flow
{ {
@ -398,14 +400,27 @@ namespace Rs.MotionPlat.Flow
FetchNum++; FetchNum++;
if (FetchNum == 6) if (FetchNum == 6)
{ {
Dictionary<ETipButton, string> buttonText = new Dictionary<ETipButton, string>();
if(curTask.FromType== TurnoverType.ToBeTested)
{
buttonText.Add(ETipButton.No, "结束上料|EndInput");
}
buttonText.Add(ETipButton.Yes, "继续|Continue");
buttonText.Add(ETipButton.Skip, "跳过|Skip");
buttonText.Add(ETipButton.Retry, "重试|Retry");
//DialogResult dr = Msg.ShowError($"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定", MessageBoxButtons.RetryCancel); //DialogResult dr = Msg.ShowError($"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定", MessageBoxButtons.RetryCancel);
CloseResult cr = new TakeFailMsg().ShowMsg($"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定"); //CloseResult cr = new TakeFailMsg().ShowMsg($"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定");
if (cr.Result == ECloseButton.Retry) //结束上料/跳过/重试/继续
ETipButton btnText = (ETipButton.Retry | ETipButton.Skip | ETipButton.Yes | ETipButton.No);
alarmInfo = $"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定";
TestCenterMessageBox.Show(AlarmConstID.TrayTakeFailAlarm,alarmInfo , btnText);
SchedulingMessageBox box = TestCenterMessageBox.WaitResult(AlarmConstID.TrayTakeFailAlarm);
if (box.Button== ETipButton.Retry)
{ {
FetchNum = 0; FetchNum = 0;
flowStep = EWorkFlowStep.; flowStep = EWorkFlowStep.;
} }
else if (cr.Result == ECloseButton.Skip)//switch else if (box.Button== ETipButton.Skip)//switch
{ {
FetchNum = 0; FetchNum = 0;
if (curTask.FromType == TurnoverType.Turnover) if (curTask.FromType == TurnoverType.Turnover)
@ -425,7 +440,7 @@ namespace Rs.MotionPlat.Flow
flowStep = EWorkFlowStep.; flowStep = EWorkFlowStep.;
} }
} }
else if(cr.Result== ECloseButton.EndInput) else if(box.Button== ETipButton.No)//结束上料
{ {
FetchNum = 0; FetchNum = 0;
TestCenter.Instance.EndInput(); TestCenter.Instance.EndInput();
@ -439,7 +454,7 @@ namespace Rs.MotionPlat.Flow
flowStep = EWorkFlowStep.; flowStep = EWorkFlowStep.;
} }
} }
else if (cr.Result == ECloseButton.Continue) else if (box.Button== ETipButton.Yes)//继续
{ {
FetchNum = 0; FetchNum = 0;
curNozzle.Status = ENozzleStatus.ToUnload; curNozzle.Status = ENozzleStatus.ToUnload;
@ -469,26 +484,7 @@ namespace Rs.MotionPlat.Flow
} }
else else
{ {
if(GlobalVar.VirtualAxis) flowStep = EWorkFlowStep.;
{
foreach (Nozzle nl in NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToUnload))
{
if (string.IsNullOrEmpty(nl.SN))
nl.SN = nl.FromIndex.ToString().PadLeft(18, '0');
//nl.SN = GuidHelper.Create();
}
mrs = new List<MatchResult>();
for (int i = 0; i < needGrabNum; i++)
{
mrs.Add(new MatchResult());
}
flowStep = EWorkFlowStep.;
}
else
{
flowStep = EWorkFlowStep.;
}
} }
} }
} }
@ -947,7 +943,6 @@ namespace Rs.MotionPlat.Flow
{ {
logInfo = "放料完成抬起"; logInfo = "放料完成抬起";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
LogHelper.Debug(logInfo);
flowStep = EWorkFlowStep.; flowStep = EWorkFlowStep.;
} }
break; break;
@ -956,7 +951,6 @@ namespace Rs.MotionPlat.Flow
{ {
logInfo = "放料完成已运动到抬起位,准备真空检测"; logInfo = "放料完成已运动到抬起位,准备真空检测";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
LogHelper.Debug(logInfo);
flowStep = EWorkFlowStep.; flowStep = EWorkFlowStep.;
} }
break; break;
@ -967,16 +961,14 @@ namespace Rs.MotionPlat.Flow
{ {
logInfo = $"周转盘{curNozzle.ToIndex + 1}号穴位真空吸检测 OK"; logInfo = $"周转盘{curNozzle.ToIndex + 1}号穴位真空吸检测 OK";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
LogHelper.Debug(logInfo);
flowStep = EWorkFlowStep.; flowStep = EWorkFlowStep.;
} }
else else
{ {
logInfo = $"放料时周转盘{curNozzle.ToIndex + 1}号穴位真空吸异常"; logInfo = $"放料时周转盘{curNozzle.ToIndex + 1}号穴位真空吸异常";
MessageQueue.Instance.Warn(logInfo); MessageQueue.Instance.Warn(logInfo);
LogHelper.Debug(logInfo);
DialogResult dr = Msg.ShowError($"周转盘{curNozzle.ToIndex + 1}号穴位真空吸异常,点击确定后跳过"); DialogResult dr = Msg.ShowError($"周转盘{curNozzle.ToIndex + 1}号穴位真空吸异常,点击确定后跳过");
//TestCenterMessageBox.Show(AlarmConstID)
if (dr == DialogResult.OK) if (dr == DialogResult.OK)
{ {
flowStep = EWorkFlowStep.; flowStep = EWorkFlowStep.;
@ -991,7 +983,6 @@ namespace Rs.MotionPlat.Flow
case EWorkFlowStep.: case EWorkFlowStep.:
logInfo = "放料任务完成"; logInfo = "放料任务完成";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
LogHelper.Debug(logInfo);
AxisControl.GetAxis($"NozzleZ{curNozzle.NozzleIndex}").Home(); AxisControl.GetAxis($"NozzleZ{curNozzle.NozzleIndex}").Home();
//Ops.HomeAndGoStartPos($"NozzleR{NozzleIndex}"); //Ops.HomeAndGoStartPos($"NozzleR{NozzleIndex}");
if (curNozzle.ToType == TurnoverType.Turnover) if (curNozzle.ToType == TurnoverType.Turnover)
@ -1061,17 +1052,13 @@ namespace Rs.MotionPlat.Flow
{ {
logInfo = "任务结束已回到安全位"; logInfo = "任务结束已回到安全位";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
LogHelper.Debug(logInfo);
if (TestCenter.Instance.LoadResult()) if (TestCenter.Instance.LoadResult())
{ {
logInfo = "通知中控任务完成"; logInfo = "通知中控任务完成";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
LogHelper.Debug(logInfo);
LoadAndUnloadTask.Instance.Clear(); LoadAndUnloadTask.Instance.Clear();
logInfo = "任务完成,清除任务"; logInfo = "任务完成,清除任务";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
LogHelper.Debug(logInfo);
} }
MachineManage.Instance.SetLoadUnloadStatus(ERunState.Waiting); MachineManage.Instance.SetLoadUnloadStatus(ERunState.Waiting);
flowStep = EWorkFlowStep.; flowStep = EWorkFlowStep.;
@ -1143,49 +1130,49 @@ namespace Rs.MotionPlat.Flow
} }
break; break;
case EWorkFlowStep.Input: case EWorkFlowStep.Input:
if(StockManager.Instance.GetStockStatus(EStockType.Input)== AutoDischarge.V3.Flow.ETrayStatus.Loaded) if(StockManager.Instance.GetStockStatus(EStockType.Input)== ETrayStatus.Loaded)
{ {
flowStep = restoreFlowStep; flowStep = restoreFlowStep;
restoreFlowStep = EWorkFlowStep.IDLE; restoreFlowStep = EWorkFlowStep.IDLE;
} }
break; break;
case EWorkFlowStep.Ok: case EWorkFlowStep.Ok:
if(StockManager.Instance.GetStockStatus( EStockType.Ok)== AutoDischarge.V3.Flow.ETrayStatus.Unloaded) if(StockManager.Instance.GetStockStatus( EStockType.Ok)== ETrayStatus.Unloaded)
{ {
flowStep = EWorkFlowStep.Ok; flowStep = EWorkFlowStep.Ok;
TakeTrayFlow.Instance.Take(EStockType.Empty2, EStockType.Ok); TakeTrayFlow.Instance.Take(EStockType.Empty2, EStockType.Ok);
} }
break; break;
case EWorkFlowStep.Ok: case EWorkFlowStep.Ok:
if(TakeTrayFlow.Instance.TakeStatus== ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus( EStockType.Ok)== AutoDischarge.V3.Flow.ETrayStatus.Loaded) if(TakeTrayFlow.Instance.TakeStatus== ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus( EStockType.Ok)== ETrayStatus.Loaded)
{ {
flowStep = restoreFlowStep; flowStep = restoreFlowStep;
restoreFlowStep = EWorkFlowStep.IDLE; restoreFlowStep = EWorkFlowStep.IDLE;
} }
break; break;
case EWorkFlowStep.Ng: case EWorkFlowStep.Ng:
if (StockManager.Instance.GetStockStatus(EStockType.Ng) == AutoDischarge.V3.Flow.ETrayStatus.Unloaded) if (StockManager.Instance.GetStockStatus(EStockType.Ng) == ETrayStatus.Unloaded)
{ {
flowStep = EWorkFlowStep.Ng; flowStep = EWorkFlowStep.Ng;
TakeTrayFlow.Instance.Take(EStockType.Empty2, EStockType.Ng); TakeTrayFlow.Instance.Take(EStockType.Empty2, EStockType.Ng);
} }
break; break;
case EWorkFlowStep.Ng: case EWorkFlowStep.Ng:
if (TakeTrayFlow.Instance.TakeStatus == ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus(EStockType.Ng) == AutoDischarge.V3.Flow.ETrayStatus.Loaded) if (TakeTrayFlow.Instance.TakeStatus == ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus(EStockType.Ng) == ETrayStatus.Loaded)
{ {
flowStep = restoreFlowStep; flowStep = restoreFlowStep;
restoreFlowStep = EWorkFlowStep.IDLE; restoreFlowStep = EWorkFlowStep.IDLE;
} }
break; break;
case EWorkFlowStep.Multi: case EWorkFlowStep.Multi:
if (StockManager.Instance.GetStockStatus(EStockType.Multi) == AutoDischarge.V3.Flow.ETrayStatus.Unloaded) if (StockManager.Instance.GetStockStatus(EStockType.Multi) == ETrayStatus.Unloaded)
{ {
flowStep = EWorkFlowStep.Multi; flowStep = EWorkFlowStep.Multi;
TakeTrayFlow.Instance.Take(EStockType.Empty2, EStockType.Multi); TakeTrayFlow.Instance.Take(EStockType.Empty2, EStockType.Multi);
} }
break; break;
case EWorkFlowStep.Multi: case EWorkFlowStep.Multi:
if (TakeTrayFlow.Instance.TakeStatus == ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus(EStockType.Multi) == AutoDischarge.V3.Flow.ETrayStatus.Loaded) if (TakeTrayFlow.Instance.TakeStatus == ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus(EStockType.Multi) == ETrayStatus.Loaded)
{ {
flowStep = restoreFlowStep; flowStep = restoreFlowStep;
restoreFlowStep = EWorkFlowStep.IDLE; restoreFlowStep = EWorkFlowStep.IDLE;

@ -81,15 +81,32 @@ namespace Rs.MotionPlat.SysConfig
private void button9_Click_1(object sender, EventArgs e) private void button9_Click_1(object sender, EventArgs e)
{ {
TestCenterMessageBox box = new TestCenterMessageBox();
Dictionary<ETipButton, string> buttonText = new Dictionary<ETipButton, string>(); Dictionary<ETipButton, string> buttonText = new Dictionary<ETipButton, string>();
buttonText.Add(ETipButton.Yes, "继续|Continue"); buttonText.Add(ETipButton.Yes, "继续|Continue");
buttonText.Add(ETipButton.Cancel, "跳过|Skip"); buttonText.Add(ETipButton.Cancel, "跳过|Skip");
buttonText.Add(ETipButton.Retry, "重试|Retry"); buttonText.Add(ETipButton.Retry, "重试|Retry");
buttonText.Add(ETipButton.No, "结束上料|EndInput"); buttonText.Add(ETipButton.No, "结束上料|EndInput");
box.Show(111,"fasdf", (ETipButton.Yes| ETipButton.No| ETipButton.Retry|ETipButton.Cancel),buttonText); // TestCenterMessageBox.Show(111,"fasdf", (ETipButton.Yes| ETipButton.No| ETipButton.Retry|ETipButton.Cancel),buttonText);
SchedulingMessageBox msgbox = box.WaitResult();
Msg.ShowInfo(msgbox.Button.ToString()); TestCenterMessageBox.Show(AlarmConstID.TrayTakeFailAlarm, $"吸嘴次失败报警,请处理后点击确定", (ETipButton.Retry | ETipButton.Skip | ETipButton.Yes | ETipButton.No), buttonText);
//TestCenterMessageBox.Show(AlarmConstID.TurnoverTakeFailAlarm, $"请处理后点击确定", (ETipButton.Retry | ETipButton.Skip | ETipButton.Yes | ETipButton.No), buttonText);
Task.Run(() => {
while (true)
{
SchedulingMessageBox box1 = TestCenterMessageBox.WaitResult(AlarmConstID.TrayTakeFailAlarm);
Msg.ShowInfo(box1.Button.ToString());
break;
}
});
//Task.Run(() => {
// while (true)
// {
// SchedulingMessageBox box2 = TestCenterMessageBox.WaitResult(AlarmConstID.TurnoverTakeFailAlarm);
// Msg.ShowInfo(box2.Button.ToString());
// break;
// }
//});
} }
} }
} }

Loading…
Cancel
Save