|
|
@ -26,7 +26,7 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
public class TestCenter
|
|
|
|
public class TestCenter
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TcpClientHelper client = new TcpClientHelper("127.0.0.1",2048);
|
|
|
|
TcpClientHelper client = new TcpClientHelper("127.0.0.1",2048);
|
|
|
|
//TcpClientHelper client = new TcpClientHelper("192.168.31.120", 2048);
|
|
|
|
//TcpClientHelper client = new TcpClientHelper("192.168.110.162", 2048);
|
|
|
|
SchedulingResult schedulResult = new SchedulingResult();
|
|
|
|
SchedulingResult schedulResult = new SchedulingResult();
|
|
|
|
SchedulingMaterial sm;
|
|
|
|
SchedulingMaterial sm;
|
|
|
|
Dictionary<int, AlarmItem> alarmInfos = new Dictionary<int, AlarmItem>();
|
|
|
|
Dictionary<int, AlarmItem> alarmInfos = new Dictionary<int, AlarmItem>();
|
|
|
@ -72,41 +72,13 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(ssi.Info== "Stopped")
|
|
|
|
else if(ssi.Info== "Stopped")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MessageQueue.Instance.Insert("收到中控停止命令,等待各个料盘就绪");
|
|
|
|
MessageQueue.Instance.Insert($"收到中控停止命令:{ssi.Info}");
|
|
|
|
Task.Run(() => {
|
|
|
|
Ops.Stop();
|
|
|
|
while(true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool bInput = (StockManager.Instance.GetStock(ETrayType.Input).Status == EStockTrayStatus.Loaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Input).Status == EStockTrayStatus.Unloaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Input).Status == EStockTrayStatus.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool bOk = (StockManager.Instance.GetStock(ETrayType.Ok).Status == EStockTrayStatus.Loaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Ok).Status == EStockTrayStatus.Unloaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Ok).Status == EStockTrayStatus.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool bNg = (StockManager.Instance.GetStock(ETrayType.Ng).Status == EStockTrayStatus.Loaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Ng).Status == EStockTrayStatus.Unloaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Ng).Status == EStockTrayStatus.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool bMulti = (StockManager.Instance.GetStock(ETrayType.Multi).Status == EStockTrayStatus.Loaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Multi).Status == EStockTrayStatus.Unloaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Multi).Status == EStockTrayStatus.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool bEmpty2 = (StockManager.Instance.GetStock(ETrayType.Empty2).Status == EStockTrayStatus.Loaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Empty2).Status == EStockTrayStatus.Unloaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Empty2).Status == EStockTrayStatus.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bInput && bOk && bNg && bMulti && bEmpty2)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DischargeFlow.Instance.ResetScanNum();
|
|
|
|
|
|
|
|
Ops.Stop();
|
|
|
|
|
|
|
|
MessageQueue.Instance.Insert("料仓已全部就绪,设备停止运行");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Thread.Sleep(100);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//else if(ssi.Info== "EndFlow")//Stopped
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
//WorkEnvironment.Instance.Ready();
|
|
|
|
//WorkEnvironment.Instance.Ready();
|
|
|
|
//Task.Run(() => {
|
|
|
|
//Task.Run(() => {
|
|
|
|
// if (WorkEnvironment.Instance.EnvReadyOkEvent.WaitOne())
|
|
|
|
// if (WorkEnvironment.Instance.EnvReadyOkEvent.WaitOne())
|
|
|
@ -156,6 +128,10 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch (eInstructioneInstruction)
|
|
|
|
switch (eInstructioneInstruction)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
case EInstruction.EndFlow:
|
|
|
|
|
|
|
|
MessageQueue.Instance.Insert("收到中控停止命令:EndFlow,等待各个料盘就绪");
|
|
|
|
|
|
|
|
EndFlow();
|
|
|
|
|
|
|
|
break;
|
|
|
|
case EInstruction.CheckTray:
|
|
|
|
case EInstruction.CheckTray:
|
|
|
|
MachineManage.Instance.SetLoadUnloadStatus(ERunState.Busying);
|
|
|
|
MachineManage.Instance.SetLoadUnloadStatus(ERunState.Busying);
|
|
|
|
ReportToTestCenter(schedule);
|
|
|
|
ReportToTestCenter(schedule);
|
|
|
@ -702,6 +678,46 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
Send(content, Encoding.ASCII);
|
|
|
|
Send(content, Encoding.ASCII);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void EndFlow()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Task.Run(() => {
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool bInput = (StockManager.Instance.GetStock(ETrayType.Input).Status == EStockTrayStatus.Loaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Input).Status == EStockTrayStatus.Unloaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Input).Status == EStockTrayStatus.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool bOk = (StockManager.Instance.GetStock(ETrayType.Ok).Status == EStockTrayStatus.Loaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Ok).Status == EStockTrayStatus.Unloaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Ok).Status == EStockTrayStatus.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool bNg = (StockManager.Instance.GetStock(ETrayType.Ng).Status == EStockTrayStatus.Loaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Ng).Status == EStockTrayStatus.Unloaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Ng).Status == EStockTrayStatus.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool bMulti = (StockManager.Instance.GetStock(ETrayType.Multi).Status == EStockTrayStatus.Loaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Multi).Status == EStockTrayStatus.Unloaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Multi).Status == EStockTrayStatus.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool bEmpty2 = (StockManager.Instance.GetStock(ETrayType.Empty2).Status == EStockTrayStatus.Loaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Empty2).Status == EStockTrayStatus.Unloaded
|
|
|
|
|
|
|
|
|| StockManager.Instance.GetStock(ETrayType.Empty2).Status == EStockTrayStatus.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bInput && bOk && bNg && bMulti && bEmpty2)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DischargeFlow.Instance.ResetScanNum();
|
|
|
|
|
|
|
|
Ops.Stop();
|
|
|
|
|
|
|
|
MessageQueue.Instance.Insert("料仓已全部就绪,设备停止运行");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Thread.Sleep(100);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void ShowMsgBox(SchedulingMessageBox msgBox)
|
|
|
|
public void ShowMsgBox(SchedulingMessageBox msgBox)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -753,5 +769,36 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ReportToTestCenter(tray);
|
|
|
|
ReportToTestCenter(tray);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void ReportStatusToCenter(SchedulingStatusInfo.InfoType intoType)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SchedulingStatusInfo statusInto = new SchedulingStatusInfo();
|
|
|
|
|
|
|
|
statusInto.Type=intoType;
|
|
|
|
|
|
|
|
statusInto.Instruction = EInstruction.InquireStatus;
|
|
|
|
|
|
|
|
switch (intoType)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case SchedulingStatusInfo.InfoType.State:
|
|
|
|
|
|
|
|
statusInto.Info = MachineManage.Instance.GetLoadUnloadStatus().ToString();// ERunState.Waiting.ToString();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SchedulingStatusInfo.InfoType.RunStatus:
|
|
|
|
|
|
|
|
statusInto.Info = MachineManage.Instance.GetCenterRunStatus().ToString();// ERunStatus.Started.ToString();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SchedulingStatusInfo.InfoType.RunMode:
|
|
|
|
|
|
|
|
statusInto.Info = MachineManage.Instance.RunMode.ToString();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SchedulingStatusInfo.InfoType.InitializeState:
|
|
|
|
|
|
|
|
statusInto.Info = MachineManage.Instance.InitializeState.ToString();// EInitializeState.Initialized.ToString();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SchedulingStatusInfo.InfoType.AssignMode:
|
|
|
|
|
|
|
|
statusInto.Info = EAssignMode.Normal.ToString();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SchedulingStatusInfo.InfoType.TesterState:
|
|
|
|
|
|
|
|
statusInto.Info = JsonConvert.SerializeObject(MachineManage.Instance.GetTesterInfo());//.ToString();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ReportToTestCenter(statusInto);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|