refactor: 将Framework库和RT、UI放在同一个解决方案中。
This commit is contained in:
@@ -0,0 +1,509 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Aitex.Core.RT.Log;
|
||||
using MECF.Framework.Simulator.Core.Driver;
|
||||
|
||||
namespace MECF.Framework.Simulator.Core.LoadPorts.Hirata
|
||||
{
|
||||
public enum StateIndex : int
|
||||
{
|
||||
EquipmentStatus,
|
||||
Mode,
|
||||
InitialPosition,
|
||||
OperationStatus,
|
||||
ErrorCodeUpper,
|
||||
|
||||
ErrorCodeLower,
|
||||
Present,
|
||||
ClampClosed,
|
||||
LatchClosed,
|
||||
VacuumOn,
|
||||
|
||||
DoorClosed,
|
||||
WaferProtrusion,
|
||||
Z_AxisPos,
|
||||
Y_AxisPos,
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class HirataLoadPortSimulator : SerialPortDeviceSimulator
|
||||
{
|
||||
public string SlotMap
|
||||
{
|
||||
get { return string.Join("", _slotMap); }
|
||||
}
|
||||
//public event Action<string> WriteDeviceEvent;
|
||||
|
||||
private string[] _slotMap = new string[25];
|
||||
private string[] _state = new string[20];
|
||||
private string[] _led = new string[13];
|
||||
|
||||
public string InforPadState { get; set; } = "0";
|
||||
|
||||
//private bool _isPlaced;
|
||||
//private bool _isPresent;
|
||||
|
||||
//private int _moveTime = 5000; //
|
||||
|
||||
public HirataLoadPortSimulator(string portName)
|
||||
: base(portName, -1, "\r", ' ',true)
|
||||
|
||||
{
|
||||
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
_slotMap[i] = "0";
|
||||
for (int i = 0; i < _state.Length; i++)
|
||||
_state[i] = "0";
|
||||
for (int i = 0; i < _led.Length; i++)
|
||||
_led[i] = "0";
|
||||
|
||||
|
||||
//00110 01?10 10001 01100
|
||||
|
||||
//A000A 41010 10001 01000
|
||||
_state[0] = "0"; //Equipment status 0 = Normal A = Recoverable error E = Fatal error
|
||||
_state[1] = "0"; //Mode 0 = Online 1 = Teaching
|
||||
_state[2] = "0"; //Initial position 0 = Unexecuted 1 = Executed
|
||||
_state[3] = "0"; //Operation status 0 = Stopped 1 = Operating
|
||||
_state[4] = "0"; //Error code Error code (upper)
|
||||
|
||||
_state[5] = "0"; // Error code Error code (lower)
|
||||
_state[6] = "0"; //Cassette presence 0 = None 1 = Normal position 2 = Error load
|
||||
_state[7] = "0"; //FOUP clamp status 0 = Open 1 = Close ? = Not defined
|
||||
_state[8] = "0"; //Latch key status 0 = Open 1 = Close ? = Not defined
|
||||
_state[9] = "0"; //Vacuum 0 = OFF 1 = ON
|
||||
|
||||
_state[10] = "1"; //Door position 0 = Open position 1 = Close position ? = Not defined
|
||||
_state[11] = "0"; //Wafer protrusion sensor 0 = Blocked. 1 = Unblocked.
|
||||
_state[12] = "0";
|
||||
_state[13] = "0"; //Dock Position 0 = Undock, 1 = dock;
|
||||
_state[14] = "0";
|
||||
|
||||
_state[15] = "0";
|
||||
_state[16] = "0";
|
||||
_state[17] = "0";
|
||||
_state[18] = "0";
|
||||
_state[19] = InforPadState;
|
||||
|
||||
//A000A 41010 10001 01000
|
||||
_led[0] = "0"; //LOAD
|
||||
_led[1] = "0"; //UNLOAD
|
||||
_led[2] = "0"; //OP.ACCESS
|
||||
_led[3] = "0"; //PRESENCE
|
||||
_led[4] = "0"; //PLACEMENT
|
||||
|
||||
_led[5] = "0"; // ALARM
|
||||
_led[6] = "0"; //STATUS1
|
||||
_led[7] = "0"; //STATUS2
|
||||
_led[8] = "0"; //
|
||||
_led[9] = "0"; //
|
||||
|
||||
_led[10] = "0"; //
|
||||
_led[11] = "0"; //
|
||||
_led[12] = "0";
|
||||
}
|
||||
|
||||
//public void ChangeSlotMap(SlotMapChangedEventArgs obj)
|
||||
//{
|
||||
// string slotMap = obj.SlotMap.Replace("'", "");
|
||||
// for (int i = 0; i < slotMap.Length; i++)
|
||||
// _slotMap[i] = slotMap.Substring(i, 1);
|
||||
//}
|
||||
|
||||
protected override void ProcessUnsplitMessage(string message)
|
||||
{
|
||||
|
||||
//string message = Encoding.ASCII.GetString(data);
|
||||
|
||||
|
||||
//message = message.Replace("s00", "").Replace(";\r", "");
|
||||
if (message.Length >= 8)
|
||||
{
|
||||
int cmdlength = message.Length - 8;
|
||||
message = message.Substring(5, cmdlength).Replace(";", "");
|
||||
//message = message.Replace("s00", "").Replace(";", "");
|
||||
}
|
||||
string[] msg = message.Split(':');
|
||||
|
||||
if (msg.Length < 2)
|
||||
return;
|
||||
|
||||
|
||||
string type = msg[0];
|
||||
string cmd = msg[1];
|
||||
switch (type)
|
||||
{
|
||||
case "SET":
|
||||
ReceiveSetCommand(cmd);
|
||||
break;
|
||||
case "MOD":
|
||||
ReceiveModCommand(cmd);
|
||||
break;
|
||||
case "GET":
|
||||
ReceiveGetCommand(cmd);
|
||||
break;
|
||||
case "FIN":
|
||||
ReceiveFinCommand(cmd);
|
||||
break;
|
||||
case "MOV":
|
||||
ReceiveMovCommand(cmd);
|
||||
break;
|
||||
case "EVT":
|
||||
ReceiveEvtCommand(cmd);
|
||||
break;
|
||||
case "TCH":
|
||||
ReceiveTchCommand(cmd);
|
||||
break;
|
||||
default:
|
||||
ReceiveUnknownCommand(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ReceiveMovCommand(string cmd)
|
||||
{
|
||||
bool needINF = true;
|
||||
switch (cmd)
|
||||
{
|
||||
case "ORGSH": //back to initial
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
|
||||
break;
|
||||
case "ABORG": //Force back to initial
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
|
||||
break;
|
||||
case "PODCL": //FOUP clamp: Close
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
//needINF = false;
|
||||
break;
|
||||
case "PODOP": //FOUP clamp: open
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
break;
|
||||
case "CLDDK": //FOUP dock:
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
break;
|
||||
case "CUDCL": //FOUP undock
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
break;
|
||||
case "CULFC": //FOUP undock
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
break;
|
||||
case "CULDK": //Door Close
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
break;
|
||||
case "CLMPO": //Door open
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
break;
|
||||
case "CLDMP": //Maps and loads the FOUP.
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1"; //Dock
|
||||
break;
|
||||
case "CLOAD": //loads the FOUP.
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1";
|
||||
break;
|
||||
case "CULOD": //Unloads the FOUP (at the ejection position).
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "0";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "0"; //Dock
|
||||
break;
|
||||
case "YDOOR": //move to dock pos in fosb mode
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1";
|
||||
break;
|
||||
case "YWAIT": //move to undock pos in fosb mode
|
||||
_state[(int)StateIndex.Y_AxisPos] = "0";
|
||||
break;
|
||||
case "DORBK": //move to door open pos in fosb mode
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
break;
|
||||
case "DORFW": //move to door close pos in fosb mode
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
break;
|
||||
case "ZDRDW": //move to door down pos in fosb mode
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
break;
|
||||
case "ZDRUP": //move to door up pos in fosb mode
|
||||
_state[(int)StateIndex.Z_AxisPos] = "0";
|
||||
break;
|
||||
case "STOP_":
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
SendAck(cmd);
|
||||
|
||||
Thread.Sleep(2000);
|
||||
if (needINF) SendInf(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveSetCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
if (cmd.Contains("FSB")) return;
|
||||
SendInf(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveModCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
#region GET Command
|
||||
|
||||
private void ReceiveGetCommand(string cmdGet)
|
||||
{
|
||||
_state[19] = InforPadState;
|
||||
switch (cmdGet)
|
||||
{
|
||||
case "STATE":
|
||||
FeedbackGetStatus(cmdGet);
|
||||
break;
|
||||
|
||||
case "VERSN":
|
||||
FeedbackGetVersion();
|
||||
break;
|
||||
|
||||
case "LEDST":
|
||||
FeedbackGetIndicator(cmdGet);
|
||||
break;
|
||||
|
||||
case "MAPDT":
|
||||
FeedbackGetWaferMapDescendingOrder(cmdGet);
|
||||
break;
|
||||
|
||||
case "MAPRD":
|
||||
FeedbackGetWaferMapAscendingOrder(cmdGet);
|
||||
break;
|
||||
|
||||
case "WFCNT":
|
||||
FeedbackGetWaferCount();
|
||||
break;
|
||||
|
||||
case "FSBxx":
|
||||
FeedbackGetFOSBMode(cmdGet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void FeedbackGetStatus(string cmd)
|
||||
{
|
||||
//string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _state));
|
||||
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}/{string.Join("", _state)}"));
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetIndicator(string cmd)
|
||||
{
|
||||
//string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _led));
|
||||
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}/{string.Join("", _led)}"));
|
||||
OnWriteMessage(message);
|
||||
//OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
//25 - 1
|
||||
private void FeedbackGetWaferMapDescendingOrder(string cmd)
|
||||
{
|
||||
var sm = _slotMap.Reverse();
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}/{string.Join("", sm)}"));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
//1-25
|
||||
private void FeedbackGetWaferMapAscendingOrder(string cmd)
|
||||
{
|
||||
//string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _slotMap));
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}/{string.Join("", _slotMap)}"));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
private void FeedbackGetWaferCount()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetFOSBMode(string cmd)
|
||||
{
|
||||
//string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _state));
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}/{string.Join("", _state)}"));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void ReceiveFinCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void ReceiveEvtCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveTchCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveUnknownCommand(string message)
|
||||
{
|
||||
//LOG.Write("LoadPort" + _loadPortNumber + " Receive Unknown message," + message);
|
||||
}
|
||||
|
||||
|
||||
private void SendInf(string cmd)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
|
||||
//string msg = _isPlaced ? "s00INF:PODON;\r" : "s00INF:PODOF;\r";
|
||||
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"INF:{cmd}"));
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
private void SendAck(string cmd)
|
||||
{
|
||||
|
||||
|
||||
string ack = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}"));
|
||||
|
||||
OnWriteMessage(ack);
|
||||
|
||||
}
|
||||
public static byte[] BuildMesage(string data)
|
||||
{
|
||||
List<byte> ret = new List<byte>();
|
||||
|
||||
ret.Add(0x1);
|
||||
|
||||
List<byte> cmd = new List<byte>();
|
||||
foreach (char c in data)
|
||||
{
|
||||
cmd.Add((byte)c);
|
||||
}
|
||||
//cmd.Add((byte)(':')); //3A
|
||||
|
||||
cmd.Add((byte)(';')); //3B
|
||||
|
||||
int length = cmd.Count + 4;
|
||||
|
||||
int checksum = length;
|
||||
foreach (byte bvalue in cmd)
|
||||
{
|
||||
checksum += bvalue;
|
||||
}
|
||||
|
||||
byte[] byteschecksum = Encoding.ASCII.GetBytes(Convert.ToString((int)((byte)(checksum & 0xFF)), 16));
|
||||
byte[] blength = BitConverter.GetBytes((short)length);
|
||||
ret.Add(blength[1]);
|
||||
ret.Add(blength[0]);
|
||||
ret.AddRange(new byte[] { 0, 0 });
|
||||
ret.AddRange(cmd);
|
||||
ret.AddRange(byteschecksum);
|
||||
ret.Add(0xD);
|
||||
return ret.ToArray();
|
||||
|
||||
}
|
||||
|
||||
public void PlaceCarrier()
|
||||
{
|
||||
//SimManager.Instance.PlaceFoup(_loadPortNumber);
|
||||
|
||||
//_isPlaced = _isPresent = true;
|
||||
|
||||
_state[6] = "1";
|
||||
|
||||
//_led[(int) Indicator.PLACEMENT] = _isPlaced ? "1" : "0";
|
||||
//_led[(int) Indicator.PRESENCE] = _isPresent ? "1" : "0";
|
||||
|
||||
//string msg = "s00INF:PODON;\r";
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"INF:PODON"));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
public void RemoveCarrier()
|
||||
{
|
||||
//SimManager.Instance.RemoveFoup(_loadPortNumber);
|
||||
|
||||
//_isPlaced = _isPresent = false;
|
||||
_state[6] = "0";
|
||||
|
||||
//_led[(int) Indicator.PLACEMENT] = "0";
|
||||
//_led[(int) Indicator.PRESENCE] = "0";
|
||||
|
||||
//string msg = "s00INF:PODOF;\r";
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"INF:PODOF"));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
public void ClearWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = "0";
|
||||
}
|
||||
}
|
||||
|
||||
public void SetAllWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = "1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetUpWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = i > 15 ? "1" : "0";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetLowWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = i < 10 ? "1" : "0";
|
||||
}
|
||||
}
|
||||
|
||||
public void RandomWafer()
|
||||
{
|
||||
Random _rd = new Random();
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = _rd.Next(0, 10) < 6 ? "0" : "2";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<UserControl x:Class="MECF.Framework.Simulator.Core.LoadPorts.HirataLoadPortView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MECF.Framework.Simulator.Core.Aligners"
|
||||
xmlns:deviceControl="clr-namespace:MECF.Framework.UI.Core.DeviceControl;assembly=MECF.Framework.UI.Core"
|
||||
xmlns:commons="clr-namespace:MECF.Framework.Simulator.Core.Commons"
|
||||
Height="900" Width="900">
|
||||
<UserControl.Resources>
|
||||
<DataTemplate x:Key="DataTemplate1">
|
||||
<StackPanel Orientation="Horizontal" Width="200" Height="15">
|
||||
<TextBox Text="{Binding Index}"></TextBox>
|
||||
<TextBox Text="{Binding State}"></TextBox>
|
||||
<Button Content="{Binding State}" Margin="0" Width="100" Height="15" Background="LightBlue" VerticalAlignment="Center"></Button>
|
||||
<TextBox Text="{Binding Index}"></TextBox>
|
||||
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="100"></RowDefinition>
|
||||
<RowDefinition Height="350"></RowDefinition>
|
||||
<RowDefinition Height="50"></RowDefinition>
|
||||
<RowDefinition Height="400"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<commons:SerialPortTitleView Grid.Row="0"></commons:SerialPortTitleView>
|
||||
|
||||
<Canvas Grid.Row="1" Height="350" Width="900">
|
||||
<Label Content="{Binding WaferMap}" Width="300" Height="30" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="32" Canvas.Top="50"></Label>
|
||||
<Label Content="InfoPad Status" Width="161" Height="30" HorizontalContentAlignment="Center" Background="Transparent" BorderThickness="2" Canvas.Left="32" Canvas.Top="197"></Label>
|
||||
|
||||
<Label Content="{Binding InfoPadStatus}" Width="82" Height="41" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="198" Canvas.Top="194"></Label>
|
||||
|
||||
<TextBox Text="{Binding InfoPadSet}" IsReadOnly ="False" Width="69" Height="38" Margin="0" RenderTransformOrigin="0.471,-0.188" Canvas.Left="285" Canvas.Top="198"></TextBox>
|
||||
<Button Content="SetInfoPad" Width="138" Height="42" Command="{Binding SetInfoPadCommand}"
|
||||
Canvas.Left="400" Margin="0" Canvas.Top="194" ></Button>
|
||||
|
||||
<Button Content="Place" Width="100" Height="35" Command="{Binding PlaceCommand}" Canvas.Left="10" Margin="0" Canvas.Top="136"></Button>
|
||||
<Button Content="Remove" Width="100" Height="35" Command="{Binding RemoveCommand}" Canvas.Left="141" Margin="0" Canvas.Top="136"></Button>
|
||||
|
||||
<ItemsControl Width="300" Height="300" Background="LightGray" Canvas.Left="576" ItemsSource="{Binding WaferList}" ItemTemplate="{DynamicResource DataTemplate1}" >
|
||||
|
||||
</ItemsControl>
|
||||
|
||||
<Button Content="SetAll" Width="100" Height="35" Command="{Binding SetAllCommand}" Canvas.Left="513" Margin="0" Canvas.Top="305"></Button>
|
||||
<Button Content="Random" Width="100" Height="35" Command="{Binding RandomCommand}" Canvas.Left="646" Margin="0" Canvas.Top="305"></Button>
|
||||
<Button Content="Clear" Width="100" Height="35" Command="{Binding ClearCommand}" Canvas.Left="766" Margin="0" Canvas.Top="305"></Button>
|
||||
|
||||
</Canvas>
|
||||
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" Width="900">
|
||||
<Button Content="Clear Log" Width="100" Height="35" Command="{Binding ClearLogCommand}"></Button>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<DataGrid Grid.Row="3" FontSize="16" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserSortColumns="False" ItemsSource="{Binding TransactionLogItems}"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Width="900" Height="380" VerticalAlignment="Top">
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTextColumn Header="Time" Width="160" IsReadOnly="True" Binding="{Binding OccurTime, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
|
||||
<DataGridTextColumn Header="Incoming" Width="350" IsReadOnly="True" Binding="{Binding Incoming, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Height" Value="auto"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
|
||||
<DataGridTextColumn Header="Outgoing" Width="350" IsReadOnly="True" Binding="{Binding Outgoing, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Height" Value="auto"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,182 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Aitex.Core.UI.MVVM;
|
||||
using Aitex.Core.Utilities;
|
||||
using MECF.Framework.Simulator.Core.Commons;
|
||||
using MECF.Framework.Simulator.Core.Driver;
|
||||
using MECF.Framework.Simulator.Core.LoadPorts;
|
||||
using MECF.Framework.Simulator.Core.LoadPorts.Hirata;
|
||||
using MECF.Framework.Simulator.Core.Robots;
|
||||
|
||||
namespace MECF.Framework.Simulator.Core.LoadPorts
|
||||
{
|
||||
//public class WaferItem
|
||||
//{
|
||||
// public int index { get; set; }
|
||||
|
||||
// public string Display { get; set; }
|
||||
|
||||
// public int State { get; set; }
|
||||
//}
|
||||
/// <summary>
|
||||
/// TDKLoadPort.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class HirataLoadPortView : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty PortNameProperty = DependencyProperty.Register(
|
||||
"PortName", typeof(string), typeof(HirataLoadPortView),
|
||||
new FrameworkPropertyMetadata("COM1", FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public string PortName
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)this.GetValue(PortNameProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue(PortNameProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty PortNumberProperty = DependencyProperty.Register(
|
||||
"PortNumber", typeof(int), typeof(HirataLoadPortView),
|
||||
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public int PortNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this.GetValue(PortNumberProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue(PortNumberProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
public HirataLoadPortView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.Loaded += OnViewLoaded;
|
||||
}
|
||||
|
||||
private void OnViewLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext == null)
|
||||
{
|
||||
DataContext = new HirataLoadPortViewModel(PortName, PortNumber);
|
||||
(DataContext as TimerViewModelBase).Start();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class HirataLoadPortViewModel : SerialPortDeviceViewModel
|
||||
{
|
||||
public string Title
|
||||
{
|
||||
get { return "Hirata LoadPort Simulator"; }
|
||||
}
|
||||
|
||||
public string WaferMap
|
||||
{
|
||||
get { return _sim.SlotMap; }
|
||||
}
|
||||
|
||||
public string InfoPadStatus
|
||||
{
|
||||
get { return _sim.InforPadState; }
|
||||
|
||||
}
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public string InfoPadSet { get; set; }
|
||||
|
||||
public ObservableCollection<WaferItem> WaferList { get; set; }
|
||||
|
||||
public ICommand PlaceCommand { get; set; }
|
||||
public ICommand RemoveCommand { get; set; }
|
||||
|
||||
public ICommand ClearCommand { get; set; }
|
||||
public ICommand SetAllCommand { get; set; }
|
||||
public ICommand RandomCommand { get; set; }
|
||||
|
||||
public ICommand SetInfoPadCommand { get; set; }
|
||||
|
||||
private HirataLoadPortSimulator _sim;
|
||||
|
||||
|
||||
public HirataLoadPortViewModel(string port, int index) : base("HirataLoadPortViewModel")
|
||||
{
|
||||
PlaceCommand = new DelegateCommand<string>(Place);
|
||||
RemoveCommand = new DelegateCommand<string>(Remove);
|
||||
|
||||
ClearCommand = new DelegateCommand<string>(Clear);
|
||||
SetAllCommand = new DelegateCommand<string>(SetAll);
|
||||
RandomCommand = new DelegateCommand<string>(RandomGenerateWafer);
|
||||
SetInfoPadCommand = new DelegateCommand<string>(SetInfoPadStatus);
|
||||
|
||||
_sim = new HirataLoadPortSimulator(port);
|
||||
Init(_sim);
|
||||
|
||||
|
||||
WaferList = new ObservableCollection<WaferItem>()
|
||||
{
|
||||
new WaferItem {Display = "1", Index = 2, State = 3}
|
||||
};
|
||||
|
||||
if (index == 1)
|
||||
_sim.SetUpWafer();
|
||||
else
|
||||
{
|
||||
_sim.SetLowWafer();
|
||||
}
|
||||
|
||||
}
|
||||
private void SetInfoPadStatus(string obj)
|
||||
{
|
||||
_sim.InforPadState = InfoPadSet;
|
||||
}
|
||||
|
||||
private void RandomGenerateWafer(string obj)
|
||||
{
|
||||
_sim.RandomWafer();
|
||||
}
|
||||
|
||||
private void SetAll(string obj)
|
||||
{
|
||||
_sim.SetAllWafer();
|
||||
}
|
||||
|
||||
private void Clear(string obj)
|
||||
{
|
||||
_sim.ClearWafer();
|
||||
}
|
||||
|
||||
private void Remove(string obj)
|
||||
{
|
||||
_sim.RemoveCarrier();
|
||||
}
|
||||
|
||||
private void Place(string obj)
|
||||
{
|
||||
_sim.PlaceCarrier();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,488 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Aitex.Core.RT.Log;
|
||||
using MECF.Framework.Simulator.Core.Driver;
|
||||
|
||||
namespace MECF.Framework.Simulator.Core.LoadPorts.Hirata
|
||||
{
|
||||
|
||||
|
||||
public class HirataLoadPortTCPSimulator : SocketDeviceSimulator
|
||||
{
|
||||
public string SlotMap
|
||||
{
|
||||
get { return string.Join("", _slotMap); }
|
||||
}
|
||||
//public event Action<string> WriteDeviceEvent;
|
||||
|
||||
private string[] _slotMap = new string[25];
|
||||
private string[] _state = new string[20];
|
||||
private string[] _led = new string[13];
|
||||
|
||||
public string InforPadState { get; set; } = "0";
|
||||
|
||||
//private bool _isPlaced;
|
||||
//private bool _isPresent;
|
||||
|
||||
//private int _moveTime = 5000; //
|
||||
|
||||
public HirataLoadPortTCPSimulator(int tcpPort)
|
||||
: base(tcpPort, -1, "\r", ' ')
|
||||
{
|
||||
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
_slotMap[i] = "0";
|
||||
for (int i = 0; i < _state.Length; i++)
|
||||
_state[i] = "0";
|
||||
for (int i = 0; i < _led.Length; i++)
|
||||
_led[i] = "0";
|
||||
|
||||
|
||||
//00110 01?10 10001 01100
|
||||
|
||||
//A000A 41010 10001 01000
|
||||
_state[0] = "0"; //Equipment status 0 = Normal A = Recoverable error E = Fatal error
|
||||
_state[1] = "0"; //Mode 0 = Online 1 = Teaching
|
||||
_state[2] = "0"; //Initial position 0 = Unexecuted 1 = Executed
|
||||
_state[3] = "0"; //Operation status 0 = Stopped 1 = Operating
|
||||
_state[4] = "0"; //Error code Error code (upper)
|
||||
|
||||
_state[5] = "0"; // Error code Error code (lower)
|
||||
_state[6] = "0"; //Cassette presence 0 = None 1 = Normal position 2 = Error load
|
||||
_state[7] = "0"; //FOUP clamp status 0 = Open 1 = Close ? = Not defined
|
||||
_state[8] = "0"; //Latch key status 0 = Open 1 = Close ? = Not defined
|
||||
_state[9] = "0"; //Vacuum 0 = OFF 1 = ON
|
||||
|
||||
_state[10] = "1"; //Door position 0 = Open position 1 = Close position ? = Not defined
|
||||
_state[11] = "0"; //Wafer protrusion sensor 0 = Blocked. 1 = Unblocked.
|
||||
_state[12] = "0";
|
||||
_state[13] = "0"; //Dock Position 0 = Undock, 1 = dock;
|
||||
_state[14] = "0";
|
||||
|
||||
_state[15] = "0";
|
||||
_state[16] = "0";
|
||||
_state[17] = "0";
|
||||
_state[18] = "0";
|
||||
_state[19] = InforPadState;
|
||||
|
||||
//A000A 41010 10001 01000
|
||||
_led[0] = "0"; //LOAD
|
||||
_led[1] = "0"; //UNLOAD
|
||||
_led[2] = "0"; //OP.ACCESS
|
||||
_led[3] = "0"; //PRESENCE
|
||||
_led[4] = "0"; //PLACEMENT
|
||||
|
||||
_led[5] = "0"; // ALARM
|
||||
_led[6] = "0"; //STATUS1
|
||||
_led[7] = "0"; //STATUS2
|
||||
_led[8] = "0"; //
|
||||
_led[9] = "0"; //
|
||||
|
||||
_led[10] = "0"; //
|
||||
_led[11] = "0"; //
|
||||
_led[12] = "0";
|
||||
}
|
||||
|
||||
//public void ChangeSlotMap(SlotMapChangedEventArgs obj)
|
||||
//{
|
||||
// string slotMap = obj.SlotMap.Replace("'", "");
|
||||
// for (int i = 0; i < slotMap.Length; i++)
|
||||
// _slotMap[i] = slotMap.Substring(i, 1);
|
||||
//}
|
||||
|
||||
protected override void ProcessUnsplitMessage(string message)
|
||||
{
|
||||
|
||||
//string message = Encoding.ASCII.GetString(data);
|
||||
|
||||
|
||||
//message = message.Replace("s00", "").Replace(";\r", "");
|
||||
if (message.Length >= 8)
|
||||
{
|
||||
int cmdlength = message.Length - 8;
|
||||
message = message.Substring(5, cmdlength).Replace(";", "");
|
||||
//message = message.Replace("s00", "").Replace(";", "");
|
||||
}
|
||||
string[] msg = message.Split(':');
|
||||
|
||||
if (msg.Length < 2)
|
||||
return;
|
||||
|
||||
|
||||
string type = msg[0];
|
||||
string cmd = msg[1];
|
||||
switch (type)
|
||||
{
|
||||
case "SET":
|
||||
ReceiveSetCommand(cmd);
|
||||
break;
|
||||
case "MOD":
|
||||
ReceiveModCommand(cmd);
|
||||
break;
|
||||
case "GET":
|
||||
ReceiveGetCommand(cmd);
|
||||
break;
|
||||
case "FIN":
|
||||
ReceiveFinCommand(cmd);
|
||||
break;
|
||||
case "MOV":
|
||||
ReceiveMovCommand(cmd);
|
||||
break;
|
||||
case "EVT":
|
||||
ReceiveEvtCommand(cmd);
|
||||
break;
|
||||
case "TCH":
|
||||
ReceiveTchCommand(cmd);
|
||||
break;
|
||||
default:
|
||||
ReceiveUnknownCommand(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ReceiveMovCommand(string cmd)
|
||||
{
|
||||
bool needINF = true;
|
||||
switch (cmd)
|
||||
{
|
||||
case "ORGSH": //back to initial
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
|
||||
break;
|
||||
case "ABORG": //Force back to initial
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
|
||||
break;
|
||||
case "PODCL": //FOUP clamp: Close
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
//needINF = false;
|
||||
break;
|
||||
case "PODOP": //FOUP clamp: open
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
break;
|
||||
case "CLDDK": //FOUP dock:
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
break;
|
||||
case "CUDCL": //FOUP undock
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
break;
|
||||
case "CULFC": //FOUP undock
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
break;
|
||||
case "CULDK": //Door Close
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
break;
|
||||
case "CLMPO": //Door open
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
break;
|
||||
case "CLDMP": //Maps and loads the FOUP.
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1"; //Dock
|
||||
break;
|
||||
case "CLOAD": //loads the FOUP.
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1";
|
||||
break;
|
||||
case "CULOD": //Unloads the FOUP (at the ejection position).
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "0";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "0"; //Dock
|
||||
break;
|
||||
case "YDOOR": //move to dock pos in fosb mode
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1";
|
||||
break;
|
||||
case "YWAIT": //move to undock pos in fosb mode
|
||||
_state[(int)StateIndex.Y_AxisPos] = "0";
|
||||
break;
|
||||
case "DORBK": //move to door open pos in fosb mode
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
break;
|
||||
case "DORFW": //move to door close pos in fosb mode
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
break;
|
||||
case "ZDRDW": //move to door down pos in fosb mode
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
break;
|
||||
case "ZDRUP": //move to door up pos in fosb mode
|
||||
_state[(int)StateIndex.Z_AxisPos] = "0";
|
||||
break;
|
||||
case "STOP_":
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
SendAck(cmd);
|
||||
|
||||
Thread.Sleep(2000);
|
||||
if (needINF) SendInf(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveSetCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
if (cmd.Contains("FSB")) return;
|
||||
SendInf(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveModCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
#region GET Command
|
||||
|
||||
private void ReceiveGetCommand(string cmdGet)
|
||||
{
|
||||
_state[19] = InforPadState;
|
||||
switch (cmdGet)
|
||||
{
|
||||
case "STATE":
|
||||
FeedbackGetStatus(cmdGet);
|
||||
break;
|
||||
|
||||
case "VERSN":
|
||||
FeedbackGetVersion();
|
||||
break;
|
||||
|
||||
case "LEDST":
|
||||
FeedbackGetIndicator(cmdGet);
|
||||
break;
|
||||
|
||||
case "MAPDT":
|
||||
FeedbackGetWaferMapDescendingOrder(cmdGet);
|
||||
break;
|
||||
|
||||
case "MAPRD":
|
||||
FeedbackGetWaferMapAscendingOrder(cmdGet);
|
||||
break;
|
||||
|
||||
case "WFCNT":
|
||||
FeedbackGetWaferCount();
|
||||
break;
|
||||
|
||||
case "FSBxx":
|
||||
FeedbackGetFOSBMode(cmdGet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void FeedbackGetStatus(string cmd)
|
||||
{
|
||||
//string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _state));
|
||||
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}/{string.Join("", _state)}"));
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetIndicator(string cmd)
|
||||
{
|
||||
//string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _led));
|
||||
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}/{string.Join("", _led)}"));
|
||||
OnWriteMessage(message);
|
||||
//OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
//25 - 1
|
||||
private void FeedbackGetWaferMapDescendingOrder(string cmd)
|
||||
{
|
||||
var sm = _slotMap.Reverse();
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}/{string.Join("", sm)}"));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
//1-25
|
||||
private void FeedbackGetWaferMapAscendingOrder(string cmd)
|
||||
{
|
||||
//string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _slotMap));
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}/{string.Join("", _slotMap)}"));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
private void FeedbackGetWaferCount()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetFOSBMode(string cmd)
|
||||
{
|
||||
//string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _state));
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}/{string.Join("", _state)}"));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void ReceiveFinCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void ReceiveEvtCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveTchCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveUnknownCommand(string message)
|
||||
{
|
||||
//LOG.Write("LoadPort" + _loadPortNumber + " Receive Unknown message," + message);
|
||||
}
|
||||
|
||||
|
||||
private void SendInf(string cmd)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
|
||||
//string msg = _isPlaced ? "s00INF:PODON;\r" : "s00INF:PODOF;\r";
|
||||
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"INF:{cmd}"));
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
private void SendAck(string cmd)
|
||||
{
|
||||
|
||||
|
||||
string ack = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}"));
|
||||
|
||||
OnWriteMessage(ack);
|
||||
|
||||
}
|
||||
public static byte[] BuildMesage(string data)
|
||||
{
|
||||
List<byte> ret = new List<byte>();
|
||||
|
||||
ret.Add(0x1);
|
||||
|
||||
List<byte> cmd = new List<byte>();
|
||||
foreach (char c in data)
|
||||
{
|
||||
cmd.Add((byte)c);
|
||||
}
|
||||
//cmd.Add((byte)(':')); //3A
|
||||
|
||||
cmd.Add((byte)(';')); //3B
|
||||
|
||||
int length = cmd.Count + 4;
|
||||
|
||||
int checksum = length;
|
||||
foreach (byte bvalue in cmd)
|
||||
{
|
||||
checksum += bvalue;
|
||||
}
|
||||
|
||||
byte[] byteschecksum = Encoding.ASCII.GetBytes(Convert.ToString((int)((byte)(checksum & 0xFF)), 16));
|
||||
byte[] blength = BitConverter.GetBytes((short)length);
|
||||
ret.Add(blength[1]);
|
||||
ret.Add(blength[0]);
|
||||
ret.AddRange(new byte[] { 0, 0 });
|
||||
ret.AddRange(cmd);
|
||||
ret.AddRange(byteschecksum);
|
||||
ret.Add(0xD);
|
||||
return ret.ToArray();
|
||||
|
||||
}
|
||||
|
||||
public void PlaceCarrier()
|
||||
{
|
||||
//SimManager.Instance.PlaceFoup(_loadPortNumber);
|
||||
|
||||
//_isPlaced = _isPresent = true;
|
||||
|
||||
_state[6] = "1";
|
||||
|
||||
//_led[(int) Indicator.PLACEMENT] = _isPlaced ? "1" : "0";
|
||||
//_led[(int) Indicator.PRESENCE] = _isPresent ? "1" : "0";
|
||||
|
||||
//string msg = "s00INF:PODON;\r";
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"INF:PODON"));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
public void RemoveCarrier()
|
||||
{
|
||||
//SimManager.Instance.RemoveFoup(_loadPortNumber);
|
||||
|
||||
//_isPlaced = _isPresent = false;
|
||||
_state[6] = "0";
|
||||
|
||||
//_led[(int) Indicator.PLACEMENT] = "0";
|
||||
//_led[(int) Indicator.PRESENCE] = "0";
|
||||
|
||||
//string msg = "s00INF:PODOF;\r";
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"INF:PODOF"));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
public void ClearWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = "0";
|
||||
}
|
||||
}
|
||||
|
||||
public void SetAllWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = "1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetUpWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = i > 15 ? "1" : "0";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetLowWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = i < 10 ? "1" : "0";
|
||||
}
|
||||
}
|
||||
|
||||
public void RandomWafer()
|
||||
{
|
||||
Random _rd = new Random();
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = _rd.Next(0, 10) < 6 ? "0" : "2";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<UserControl x:Class="MECF.Framework.Simulator.Core.LoadPorts.HirataLoadPortTCPView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MECF.Framework.Simulator.Core.Aligners"
|
||||
xmlns:deviceControl="clr-namespace:MECF.Framework.UI.Core.DeviceControl;assembly=MECF.Framework.UI.Core"
|
||||
xmlns:commons="clr-namespace:MECF.Framework.Simulator.Core.Commons"
|
||||
Height="900" Width="900">
|
||||
<UserControl.Resources>
|
||||
<DataTemplate x:Key="DataTemplate1">
|
||||
<StackPanel Orientation="Horizontal" Width="200" Height="15">
|
||||
<TextBox Text="{Binding Index}"></TextBox>
|
||||
<TextBox Text="{Binding State}"></TextBox>
|
||||
<Button Content="{Binding State}" Margin="0" Width="100" Height="15" Background="LightBlue" VerticalAlignment="Center"></Button>
|
||||
<TextBox Text="{Binding Index}"></TextBox>
|
||||
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="100"></RowDefinition>
|
||||
<RowDefinition Height="350"></RowDefinition>
|
||||
<RowDefinition Height="50"></RowDefinition>
|
||||
<RowDefinition Height="400"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<commons:SerialPortTitleView Grid.Row="0"></commons:SerialPortTitleView>
|
||||
|
||||
<Canvas Grid.Row="1" Height="350" Width="900">
|
||||
<Label Content="{Binding WaferMap}" Width="300" Height="30" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="32" Canvas.Top="50"></Label>
|
||||
<Label Content="InfoPad Status" Width="161" Height="30" HorizontalContentAlignment="Center" Background="Transparent" BorderThickness="2" Canvas.Left="32" Canvas.Top="197"></Label>
|
||||
|
||||
<Label Content="{Binding InfoPadStatus}" Width="82" Height="41" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="198" Canvas.Top="194"></Label>
|
||||
|
||||
<TextBox Text="{Binding InfoPadSet}" IsReadOnly ="False" Width="69" Height="38" Margin="0" RenderTransformOrigin="0.471,-0.188" Canvas.Left="285" Canvas.Top="198"></TextBox>
|
||||
<Button Content="SetInfoPad" Width="138" Height="42" Command="{Binding SetInfoPadCommand}"
|
||||
Canvas.Left="400" Margin="0" Canvas.Top="194" ></Button>
|
||||
|
||||
<Button Content="Place" Width="100" Height="35" Command="{Binding PlaceCommand}" Canvas.Left="10" Margin="0" Canvas.Top="136"></Button>
|
||||
<Button Content="Remove" Width="100" Height="35" Command="{Binding RemoveCommand}" Canvas.Left="141" Margin="0" Canvas.Top="136"></Button>
|
||||
|
||||
<ItemsControl Width="300" Height="300" Background="LightGray" Canvas.Left="576" ItemsSource="{Binding WaferList}" ItemTemplate="{DynamicResource DataTemplate1}" >
|
||||
|
||||
</ItemsControl>
|
||||
|
||||
<Button Content="SetAll" Width="100" Height="35" Command="{Binding SetAllCommand}" Canvas.Left="513" Margin="0" Canvas.Top="305"></Button>
|
||||
<Button Content="Random" Width="100" Height="35" Command="{Binding RandomCommand}" Canvas.Left="646" Margin="0" Canvas.Top="305"></Button>
|
||||
<Button Content="Clear" Width="100" Height="35" Command="{Binding ClearCommand}" Canvas.Left="766" Margin="0" Canvas.Top="305"></Button>
|
||||
|
||||
</Canvas>
|
||||
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" Width="900">
|
||||
<Button Content="Clear Log" Width="100" Height="35" Command="{Binding ClearLogCommand}"></Button>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<DataGrid Grid.Row="3" FontSize="16" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserSortColumns="False" ItemsSource="{Binding TransactionLogItems}"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Width="900" Height="380" VerticalAlignment="Top">
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTextColumn Header="Time" Width="160" IsReadOnly="True" Binding="{Binding OccurTime, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
|
||||
<DataGridTextColumn Header="Incoming" Width="350" IsReadOnly="True" Binding="{Binding Incoming, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Height" Value="auto"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
|
||||
<DataGridTextColumn Header="Outgoing" Width="350" IsReadOnly="True" Binding="{Binding Outgoing, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Height" Value="auto"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,168 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Aitex.Core.UI.MVVM;
|
||||
using Aitex.Core.Utilities;
|
||||
using MECF.Framework.Simulator.Core.Commons;
|
||||
using MECF.Framework.Simulator.Core.Driver;
|
||||
using MECF.Framework.Simulator.Core.LoadPorts;
|
||||
using MECF.Framework.Simulator.Core.LoadPorts.Hirata;
|
||||
using MECF.Framework.Simulator.Core.Robots;
|
||||
|
||||
namespace MECF.Framework.Simulator.Core.LoadPorts
|
||||
{
|
||||
//public class WaferItem
|
||||
//{
|
||||
// public int index { get; set; }
|
||||
|
||||
// public string Display { get; set; }
|
||||
|
||||
// public int State { get; set; }
|
||||
//}
|
||||
/// <summary>
|
||||
/// TDKLoadPort.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class HirataLoadPortTCPView : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty PortProperty = DependencyProperty.Register(
|
||||
"Port", typeof(int), typeof(HirataLoadPortTCPView),
|
||||
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public int Port
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this.GetValue(PortProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue(PortProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public HirataLoadPortTCPView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.Loaded += OnViewLoaded;
|
||||
}
|
||||
|
||||
private void OnViewLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext == null)
|
||||
{
|
||||
DataContext = new HirataLoadPortTCPViewModel(Port,0);
|
||||
(DataContext as TimerViewModelBase).Start();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class HirataLoadPortTCPViewModel:SocketDeviceViewModel
|
||||
{
|
||||
public string Title
|
||||
{
|
||||
get { return "Hirata LoadPort Simulator"; }
|
||||
}
|
||||
|
||||
public string WaferMap
|
||||
{
|
||||
get { return _sim.SlotMap; }
|
||||
}
|
||||
|
||||
public string InfoPadStatus
|
||||
{
|
||||
get { return _sim.InforPadState; }
|
||||
|
||||
}
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public string InfoPadSet { get; set; }
|
||||
|
||||
public ObservableCollection<WaferItem> WaferList { get; set; }
|
||||
|
||||
public ICommand PlaceCommand { get; set; }
|
||||
public ICommand RemoveCommand { get; set; }
|
||||
|
||||
public ICommand ClearCommand { get; set; }
|
||||
public ICommand SetAllCommand { get; set; }
|
||||
public ICommand RandomCommand { get; set; }
|
||||
|
||||
public ICommand SetInfoPadCommand { get; set; }
|
||||
|
||||
private HirataLoadPortTCPSimulator _sim;
|
||||
|
||||
|
||||
public HirataLoadPortTCPViewModel(int port, int index) : base("HirataLoadPortViewModel")
|
||||
{
|
||||
PlaceCommand = new DelegateCommand<string>(Place);
|
||||
RemoveCommand = new DelegateCommand<string>(Remove);
|
||||
|
||||
ClearCommand = new DelegateCommand<string>(Clear);
|
||||
SetAllCommand = new DelegateCommand<string>(SetAll);
|
||||
RandomCommand = new DelegateCommand<string>(RandomGenerateWafer);
|
||||
SetInfoPadCommand = new DelegateCommand<string>(SetInfoPadStatus);
|
||||
|
||||
_sim = new HirataLoadPortTCPSimulator(port);
|
||||
Init(_sim);
|
||||
|
||||
|
||||
WaferList = new ObservableCollection<WaferItem>()
|
||||
{
|
||||
new WaferItem {Display = "1", Index = 2, State = 3}
|
||||
};
|
||||
|
||||
if (index == 1)
|
||||
_sim.SetUpWafer();
|
||||
else
|
||||
{
|
||||
_sim.SetLowWafer();
|
||||
}
|
||||
|
||||
}
|
||||
private void SetInfoPadStatus(string obj)
|
||||
{
|
||||
_sim.InforPadState = InfoPadSet;
|
||||
}
|
||||
|
||||
private void RandomGenerateWafer(string obj)
|
||||
{
|
||||
_sim.RandomWafer();
|
||||
}
|
||||
|
||||
private void SetAll(string obj)
|
||||
{
|
||||
_sim.SetAllWafer();
|
||||
}
|
||||
|
||||
private void Clear(string obj)
|
||||
{
|
||||
_sim.ClearWafer();
|
||||
}
|
||||
|
||||
private void Remove(string obj)
|
||||
{
|
||||
_sim.RemoveCarrier();
|
||||
}
|
||||
|
||||
private void Place(string obj)
|
||||
{
|
||||
_sim.PlaceCarrier();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,738 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Aitex.Core.RT.Log;
|
||||
using MECF.Framework.Simulator.Core.Driver;
|
||||
|
||||
namespace MECF.Framework.Simulator.Core.LoadPorts.Hirata
|
||||
{
|
||||
public class PrsEfemSimulator : SocketDeviceSimulator
|
||||
{
|
||||
public string LP1SlotMap
|
||||
{
|
||||
get { return string.Join("", _lp1slotMap); }
|
||||
}
|
||||
public string LP2SlotMap
|
||||
{
|
||||
get { return string.Join("", _lp2slotMap); }
|
||||
}
|
||||
//public event Action<string> WriteDeviceEvent;
|
||||
|
||||
private bool[] _lp1SigStateData1 = new bool[32];
|
||||
private bool[] _lp1SigStateData2 = new bool[32];
|
||||
|
||||
private bool[] _lp2SigStateData1 = new bool[32];
|
||||
private bool[] _lp2SigStateData2 = new bool[32];
|
||||
|
||||
|
||||
private string[] _lp1slotMap = new string[25];
|
||||
private string[] _lp2slotMap = new string[25];
|
||||
|
||||
private string[] _stationslotMap = new string[25];
|
||||
|
||||
|
||||
public string FoupID { get; set; }
|
||||
public string LP1InforPadState { get; set; } = "0";
|
||||
public string LP2InforPadState { get; set; } = "0";
|
||||
//private bool _isPlaced;
|
||||
//private bool _isPresent;
|
||||
|
||||
//private int _moveTime = 5000; //
|
||||
|
||||
public PrsEfemSimulator(int tcpPort)
|
||||
: base(tcpPort, -1, "\r", ' ')
|
||||
{
|
||||
|
||||
for (int i = 0; i < _lp1slotMap.Length; i++)
|
||||
_lp1slotMap[i] = "0";
|
||||
for (int i = 0; i < _lp2slotMap.Length; i++)
|
||||
_lp2slotMap[i] = "0";
|
||||
for (int i = 0; i < _stationslotMap.Length; i++)
|
||||
_stationslotMap[i] = "0";
|
||||
|
||||
|
||||
for (int i = 0; i < _lp1SigStateData1.Length; i++)
|
||||
_lp1SigStateData1[i] = false;
|
||||
for (int i = 0; i < _lp1SigStateData2.Length; i++)
|
||||
_lp1SigStateData2[i] = false;
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < _lp2SigStateData1.Length; i++)
|
||||
_lp2SigStateData1[i] = false;
|
||||
for (int i = 0; i < _lp2SigStateData2.Length; i++)
|
||||
_lp2SigStateData2[i] = false;
|
||||
|
||||
_lp1SigStateData1[0] = false; //LP Placement
|
||||
_lp1SigStateData1[1] = false; //Pod Present
|
||||
_lp1SigStateData1[2] = false; //Access SW
|
||||
_lp1SigStateData1[3] = false; //Pod lock
|
||||
_lp1SigStateData1[4] = false; //Cover close
|
||||
|
||||
_lp1SigStateData1[5] = false; // Cover lock
|
||||
_lp1SigStateData1[6] = false;
|
||||
_lp1SigStateData1[7] = false;
|
||||
_lp1SigStateData1[8] = false; //Info pad A
|
||||
_lp1SigStateData1[9] = false; //Info pad B
|
||||
|
||||
_lp1SigStateData1[10] = false; //Info pad C
|
||||
_lp1SigStateData1[11] = false; //Info pad D
|
||||
|
||||
_lp1SigStateData1[24] = false; //VALID (E84)
|
||||
_lp1SigStateData1[25] = false; //CS_0 (E84)
|
||||
_lp1SigStateData1[26] = false; //CS_1 (E84)
|
||||
_lp1SigStateData1[27] = false; //Valid
|
||||
_lp1SigStateData1[28] = false; //TR_REQ (E84)
|
||||
_lp1SigStateData1[29] = false; //BUSY (E84)
|
||||
_lp1SigStateData1[30] = false; //COMPT (E84)
|
||||
_lp1SigStateData1[31] = false; //CONT (E84)
|
||||
|
||||
|
||||
|
||||
_lp1SigStateData2[0] = false; //PRESENCE
|
||||
_lp1SigStateData2[1] = false; //PLACEMENT
|
||||
_lp1SigStateData2[2] = false; //LOAD
|
||||
_lp1SigStateData2[3] = false; //UNLOAD
|
||||
_lp1SigStateData2[4] = false; //MANUAL MODE
|
||||
|
||||
_lp1SigStateData2[5] = false; //ERROR
|
||||
_lp1SigStateData2[6] = false; //CLAMP / UNCLAMP
|
||||
_lp1SigStateData2[7] = false; //DOCK/UNDOCK
|
||||
_lp1SigStateData2[8] = false; //ACCESS SW
|
||||
|
||||
|
||||
//A000A 41010 10001 01000
|
||||
_lp2SigStateData1[0] = false; //LP Placement
|
||||
_lp2SigStateData1[1] = false; //Pod Present
|
||||
_lp2SigStateData1[2] = false; //Access SW
|
||||
_lp2SigStateData1[3] = false; //Pod lock
|
||||
_lp2SigStateData1[4] = false; //Cover close
|
||||
|
||||
_lp2SigStateData1[5] = false; // Cover lock
|
||||
_lp2SigStateData1[6] = false;
|
||||
_lp2SigStateData1[7] = false;
|
||||
_lp2SigStateData1[8] = false; //Info pad A
|
||||
_lp2SigStateData1[9] = false; //Info pad B
|
||||
|
||||
_lp2SigStateData1[10] = false; //Info pad C
|
||||
_lp2SigStateData1[11] = false; //Info pad D
|
||||
|
||||
_lp2SigStateData1[24] = false; //VALID (E84)
|
||||
_lp2SigStateData1[25] = false; //CS_0 (E84)
|
||||
_lp2SigStateData1[26] = false; //CS_1 (E84)
|
||||
_lp2SigStateData1[27] = false; //Valid
|
||||
_lp2SigStateData1[28] = false; //TR_REQ (E84)
|
||||
_lp2SigStateData1[29] = false; //BUSY (E84)
|
||||
_lp2SigStateData1[30] = false; //COMPT (E84)
|
||||
_lp2SigStateData1[31] = false; //CONT (E84)
|
||||
|
||||
|
||||
_lp2SigStateData2[0] = false; //PRESENCE
|
||||
_lp2SigStateData2[1] = false; //PLACEMENT
|
||||
_lp2SigStateData2[2] = false; //LOAD
|
||||
_lp2SigStateData2[3] = false; //UNLOAD
|
||||
_lp2SigStateData2[4] = false; //MANUAL MODE
|
||||
|
||||
_lp2SigStateData2[5] = false; //ERROR
|
||||
_lp2SigStateData2[6] = false; //CLAMP / UNCLAMP
|
||||
_lp2SigStateData2[7] = false; //DOCK/UNDOCK
|
||||
_lp2SigStateData2[8] = false; //ACCESS SW
|
||||
|
||||
}
|
||||
|
||||
//public void ChangeSlotMap(SlotMapChangedEventArgs obj)
|
||||
//{
|
||||
// string slotMap = obj.SlotMap.Replace("'", "");
|
||||
// for (int i = 0; i < slotMap.Length; i++)
|
||||
// _slotMap[i] = slotMap.Substring(i, 1);
|
||||
//}
|
||||
|
||||
protected override void ProcessUnsplitMessage(string message)
|
||||
{
|
||||
string[] msg = message.Split(':');
|
||||
if (msg.Length < 2)
|
||||
return;
|
||||
string type = msg[0];
|
||||
string cmd = msg[1];
|
||||
switch (type)
|
||||
{
|
||||
case "SET":
|
||||
ReceiveSetCommand(cmd);
|
||||
break;
|
||||
case "MOD":
|
||||
ReceiveModCommand(cmd);
|
||||
break;
|
||||
case "GET":
|
||||
ReceiveGetCommand(cmd);
|
||||
break;
|
||||
case "FIN":
|
||||
ReceiveFinCommand(cmd);
|
||||
break;
|
||||
case "MOV":
|
||||
ReceiveMovCommand(cmd);
|
||||
break;
|
||||
case "EVT":
|
||||
ReceiveEvtCommand(cmd);
|
||||
break;
|
||||
case "TCH":
|
||||
ReceiveTchCommand(cmd);
|
||||
break;
|
||||
default:
|
||||
ReceiveUnknownCommand(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ReceiveMovCommand(string cmd)
|
||||
{
|
||||
bool needINF = true;
|
||||
string[] data = cmd.Split('/');
|
||||
switch (data[0])
|
||||
{
|
||||
case "INIT":
|
||||
|
||||
break;
|
||||
case "ORGSH": //back to initial
|
||||
|
||||
if (data[1] == "ALL")
|
||||
{
|
||||
|
||||
}
|
||||
if (data[1] == "P1")
|
||||
{
|
||||
|
||||
}
|
||||
if (data[1] == "P2")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case "ABORG": //Force back to initial
|
||||
|
||||
|
||||
break;
|
||||
case "UNLOCK": //FOUP clamp: Close
|
||||
//needINF = false;
|
||||
break;
|
||||
case "LOCK": //FOUP clamp: open
|
||||
|
||||
break;
|
||||
case "DOCK": //FOUP dock:
|
||||
|
||||
break;
|
||||
case "UNDOCK": //FOUP undock
|
||||
|
||||
break;
|
||||
case "OPEN": //FOUP undock
|
||||
|
||||
break;
|
||||
case "CLOSE": //Door Close
|
||||
|
||||
break;
|
||||
case "WAFSH": //Door open
|
||||
|
||||
break;
|
||||
case "GOTO": //Maps and loads the FOUP.
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
SendAck(cmd);
|
||||
|
||||
Thread.Sleep(2000);
|
||||
if (needINF) SendInf(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveSetCommand(string cmd)
|
||||
{
|
||||
string[] data = cmd.Split('/');
|
||||
switch (data[0])
|
||||
{
|
||||
case "LED":
|
||||
if (data[1] == "P1")
|
||||
{
|
||||
if (data[2] == "LOAD")
|
||||
{
|
||||
if (data[3] == "ON")
|
||||
{
|
||||
_lp1SigStateData2[2] = true;
|
||||
}
|
||||
else _lp1SigStateData2[2] = false;
|
||||
|
||||
}
|
||||
if (data[2] == "UNLOAD")
|
||||
{
|
||||
if (data[3] == "ON")
|
||||
{
|
||||
_lp1SigStateData2[3] = true;
|
||||
}
|
||||
else _lp1SigStateData2[3] = false;
|
||||
|
||||
}
|
||||
if (data[2] == "MANUAL MODE")
|
||||
{
|
||||
if (data[3] == "ON")
|
||||
{
|
||||
_lp1SigStateData2[4] = true;
|
||||
}
|
||||
else _lp1SigStateData2[4] = false;
|
||||
|
||||
}
|
||||
}
|
||||
if (data[1] == "P2")
|
||||
{
|
||||
if (data[2] == "LOAD")
|
||||
{
|
||||
if (data[3] == "ON")
|
||||
{
|
||||
_lp2SigStateData2[2] = true;
|
||||
}
|
||||
else _lp2SigStateData2[2] = false;
|
||||
|
||||
}
|
||||
if (data[2] == "UNLOAD")
|
||||
{
|
||||
if (data[3] == "ON")
|
||||
{
|
||||
_lp2SigStateData2[3] = true;
|
||||
}
|
||||
else _lp2SigStateData2[3] = false;
|
||||
|
||||
}
|
||||
if (data[2] == "MANUAL MODE")
|
||||
{
|
||||
if (data[3] == "ON")
|
||||
{
|
||||
_lp2SigStateData2[4] = true;
|
||||
}
|
||||
else _lp2SigStateData2[4] = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "SIZE":
|
||||
if (data[1] == "ARM1")
|
||||
robotArm1Wafersize = data[2];
|
||||
if (data[1] == "ARM2")
|
||||
robotArm2Wafersize = data[2];
|
||||
if (data[1] == "ALIGN1")
|
||||
alignerwafersize = data[2];
|
||||
break;
|
||||
}
|
||||
SendAck(cmd);
|
||||
if (cmd.Contains("FSB")) return;
|
||||
SendInf(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveModCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
#region GET Command
|
||||
|
||||
private void ReceiveGetCommand(string cmdGet)
|
||||
{
|
||||
string message = $"ACK:{cmdGet}";
|
||||
OnWriteMessage(message);
|
||||
string[] data = cmdGet.Split('/');
|
||||
|
||||
switch (data[0])
|
||||
{
|
||||
case "MAPDT":
|
||||
FeedbackGetWaferMapDescendingOrder(cmdGet);
|
||||
break;
|
||||
case "ERROR":
|
||||
break;
|
||||
case "CLAMP":
|
||||
break;
|
||||
case "STATE":
|
||||
FeedbackGetStatus(cmdGet);
|
||||
break;
|
||||
case "MODE":
|
||||
break;
|
||||
case "TRANSREQ":
|
||||
break;
|
||||
case "SIGSTAT":
|
||||
FeedbackGetSigStatus(cmdGet);
|
||||
break;
|
||||
case "EVENT":
|
||||
break;
|
||||
case "CSTID":
|
||||
FeedbackCarrierID(cmdGet);
|
||||
break;
|
||||
case "SIZE":
|
||||
FeedbackWaferSize(cmdGet);
|
||||
break;
|
||||
case "ADPLOCK":
|
||||
break;
|
||||
case "ADPUNLOCK":
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void FeedbackWaferSize(string cmdGet)
|
||||
{
|
||||
//string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _state));
|
||||
string[] data = cmdGet.Replace(";", "").Split('/');
|
||||
|
||||
string message = $"INF:{cmdGet.Replace(";", "")}/{robotArm1Wafersize};";
|
||||
|
||||
if (message.Contains("BF5") || message.Contains("BF6"))
|
||||
message = message.Replace("300", "NONE");
|
||||
|
||||
if (message.Contains("STATION"))
|
||||
message = message.Replace("300", "NONE");
|
||||
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
private string robotArm1Wafersize = "300";
|
||||
private string robotArm2Wafersize = "300";
|
||||
private string alignerwafersize = "300";
|
||||
|
||||
private int _cid = 0;
|
||||
|
||||
private void FeedbackCarrierID(string cmd)
|
||||
{
|
||||
//string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _state));
|
||||
string[] data = cmd.Replace(";", "").Split('/');
|
||||
|
||||
_cid++;
|
||||
if (_cid > 1)
|
||||
_cid = 1;
|
||||
|
||||
string fup = string.IsNullOrEmpty(FoupID) ? $"EF{ _cid}" : FoupID;
|
||||
|
||||
string message = $"INF:{cmd.Replace(";", "")}/{fup};";
|
||||
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetStatus(string cmd)
|
||||
{
|
||||
//string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _state));
|
||||
string[] data = cmd.Split('/');
|
||||
string reply = "";
|
||||
if (data[1] == "TRACK;")
|
||||
{
|
||||
reply = "00100";
|
||||
}
|
||||
if (data[1] == "VER;")
|
||||
{
|
||||
reply = "01.000(2021-03-11)";
|
||||
}
|
||||
if (data[1] == "INF1;")
|
||||
{
|
||||
reply = "0.06";
|
||||
}
|
||||
string message = $"INF:{cmd.Replace(";", "")}/{reply};";
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
private void FeedbackGetSigStatus(string cmd)
|
||||
{
|
||||
string message = "";
|
||||
string[] data = cmd.Split('/');
|
||||
if (data[1] == "SYSTEM;")
|
||||
{
|
||||
message = "FFFF/FFFF";
|
||||
}
|
||||
if (data[1] == "P1;")
|
||||
{
|
||||
message = $"{ConvertBinToHexString(_lp1SigStateData1)}/{ConvertBinToHexString(_lp1SigStateData2)}";
|
||||
|
||||
}
|
||||
if (data[1] == "P2;")
|
||||
{
|
||||
message = $"{ConvertBinToHexString(_lp2SigStateData1)}/{ConvertBinToHexString(_lp2SigStateData2)}";
|
||||
|
||||
}
|
||||
string datamsg = $"INF:{cmd.Replace(";", "")}/{message};";
|
||||
OnWriteMessage(datamsg);
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//25 - 1
|
||||
private void FeedbackGetWaferMapDescendingOrder(string cmd)
|
||||
{
|
||||
var sm = _lp1slotMap.Reverse();
|
||||
|
||||
if (cmd.Contains("P2"))
|
||||
sm = _lp2slotMap.Reverse();
|
||||
|
||||
if (cmd.Contains("STATION"))
|
||||
sm = _stationslotMap.Reverse();
|
||||
//sm =Enumerable.Repeat("3",25);
|
||||
|
||||
string message = $"INF:{cmd.Replace(";", "")}/{string.Join("", sm)};";
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
//1-25
|
||||
|
||||
|
||||
private void FeedbackGetWaferCount()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
private void ReceiveFinCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void ReceiveEvtCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveTchCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveUnknownCommand(string message)
|
||||
{
|
||||
//LOG.Write("LoadPort" + _loadPortNumber + " Receive Unknown message," + message);
|
||||
}
|
||||
|
||||
|
||||
private void SendInf(string cmd)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
|
||||
//string msg = _isPlaced ? "s00INF:PODON;\r" : "s00INF:PODOF;\r";
|
||||
|
||||
string message = Encoding.ASCII.GetString(BuildMesage($"INF:{cmd}"));
|
||||
OnWriteMessage("INF:" + cmd);
|
||||
|
||||
}
|
||||
|
||||
private void SendAck(string cmd)
|
||||
{
|
||||
|
||||
|
||||
string ack = Encoding.ASCII.GetString(BuildMesage($"ACK:{cmd}"));
|
||||
|
||||
OnWriteMessage("ACK:" + cmd);
|
||||
|
||||
}
|
||||
public static byte[] BuildMesage(string data)
|
||||
{
|
||||
List<byte> ret = new List<byte>();
|
||||
|
||||
ret.Add(0x1);
|
||||
|
||||
List<byte> cmd = new List<byte>();
|
||||
foreach (char c in data)
|
||||
{
|
||||
cmd.Add((byte)c);
|
||||
}
|
||||
//cmd.Add((byte)(':')); //3A
|
||||
|
||||
cmd.Add((byte)(';')); //3B
|
||||
|
||||
int length = cmd.Count + 4;
|
||||
|
||||
int checksum = length;
|
||||
foreach (byte bvalue in cmd)
|
||||
{
|
||||
checksum += bvalue;
|
||||
}
|
||||
|
||||
byte[] byteschecksum = Encoding.ASCII.GetBytes(Convert.ToString((int)((byte)(checksum & 0xFF)), 16));
|
||||
byte[] blength = BitConverter.GetBytes((short)length);
|
||||
ret.Add(blength[1]);
|
||||
ret.Add(blength[0]);
|
||||
ret.AddRange(new byte[] { 0, 0 });
|
||||
ret.AddRange(cmd);
|
||||
ret.AddRange(byteschecksum);
|
||||
ret.Add(0xD);
|
||||
return ret.ToArray();
|
||||
|
||||
}
|
||||
|
||||
public void PlaceCarrier(string lp)
|
||||
{
|
||||
|
||||
string message = "";
|
||||
if (lp == "P1")
|
||||
{
|
||||
_lp1SigStateData1[0] = true; //LP Placement
|
||||
_lp1SigStateData1[1] = false; //Pod Present.
|
||||
|
||||
message = $"EVT:SIGSTAT/{lp}/{ConvertBinToHexString(_lp1SigStateData1)}" +
|
||||
$"/{ConvertBinToHexString(_lp1SigStateData2)}";
|
||||
|
||||
}
|
||||
if (lp == "P2")
|
||||
{
|
||||
_lp2SigStateData1[0] = true; //LP Placement
|
||||
_lp2SigStateData1[1] = false; //Pod Present
|
||||
message = $"EVT:SIGSTAT/{lp}/{ConvertBinToHexString(_lp2SigStateData1)}" +
|
||||
$"/{ConvertBinToHexString(_lp2SigStateData2)}";
|
||||
|
||||
}
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
private string ConvertBinToHexString(bool[] data)
|
||||
{
|
||||
int intdata = 0;
|
||||
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
intdata += data[i] ? (int)Math.Pow(2, i) : 0;
|
||||
}
|
||||
return intdata.ToString("X4");
|
||||
}
|
||||
|
||||
public void RemoveCarrier(string lp)
|
||||
{
|
||||
|
||||
string message = "";
|
||||
if (lp == "P1")
|
||||
{
|
||||
_lp1SigStateData1[0] = false; //LP Placement
|
||||
_lp1SigStateData1[1] = false; //Pod Present.
|
||||
|
||||
message = $"EVT:SIGSTAT/{lp}/{ConvertBinToHexString(_lp1SigStateData1)}" +
|
||||
$"/{ConvertBinToHexString(_lp1SigStateData2)}";
|
||||
|
||||
}
|
||||
if (lp == "P2")
|
||||
{
|
||||
_lp2SigStateData1[0] = false; //LP Placement
|
||||
_lp2SigStateData1[1] = false; //Pod Present
|
||||
message = $"EVT:SIGSTAT/{lp}/{ConvertBinToHexString(_lp2SigStateData1)}" +
|
||||
$"/{ConvertBinToHexString(_lp2SigStateData2)}";
|
||||
|
||||
}
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
public void ClearWafer(string lp)
|
||||
{
|
||||
if (lp == "P1")
|
||||
{
|
||||
for (int i = 0; i < _lp1slotMap.Length; i++)
|
||||
{
|
||||
_lp1slotMap[i] = "0";
|
||||
}
|
||||
}
|
||||
if (lp == "P2")
|
||||
{
|
||||
for (int i = 0; i < _lp2slotMap.Length; i++)
|
||||
{
|
||||
_lp2slotMap[i] = "0";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void SetAllWafer(string lp)
|
||||
{
|
||||
if (lp == "P1")
|
||||
{
|
||||
for (int i = 0; i < _lp1slotMap.Length; i++)
|
||||
{
|
||||
_lp1slotMap[i] = "1";
|
||||
}
|
||||
}
|
||||
if (lp == "P2")
|
||||
{
|
||||
for (int i = 0; i < _lp2slotMap.Length; i++)
|
||||
{
|
||||
_lp2slotMap[i] = "1";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetUpWafer(string lp)
|
||||
{
|
||||
if (lp == "P1")
|
||||
{
|
||||
for (int i = 0; i < _lp1slotMap.Length; i++)
|
||||
{
|
||||
_lp1slotMap[i] = i > 15 ? "1" : "0";
|
||||
}
|
||||
}
|
||||
if (lp == "P2")
|
||||
{
|
||||
for (int i = 0; i < _lp2slotMap.Length; i++)
|
||||
{
|
||||
_lp2slotMap[i] = i > 15 ? "1" : "0";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void SetLowWafer(string lp)
|
||||
{
|
||||
if (lp == "P1")
|
||||
{
|
||||
for (int i = 0; i < _lp1slotMap.Length; i++)
|
||||
{
|
||||
_lp1slotMap[i] = i < 10 ? "1" : "0";
|
||||
}
|
||||
}
|
||||
if (lp == "P2")
|
||||
{
|
||||
for (int i = 0; i < _lp2slotMap.Length; i++)
|
||||
{
|
||||
_lp2slotMap[i] = i < 10 ? "1" : "0";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void RandomWafer(string lp)
|
||||
{
|
||||
Random _rd = new Random();
|
||||
if (lp == "P1")
|
||||
{
|
||||
for (int i = 0; i < _lp1slotMap.Length; i++)
|
||||
{
|
||||
_lp1slotMap[i] = _rd.Next(0, 10) < 6 ? "0" : "1";
|
||||
}
|
||||
}
|
||||
if (lp == "P2")
|
||||
{
|
||||
for (int i = 0; i < _lp2slotMap.Length; i++)
|
||||
{
|
||||
_lp2slotMap[i] = _rd.Next(0, 10) < 6 ? "0" : "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<UserControl x:Class="MECF.Framework.Simulator.Core.LoadPorts.PrsEfemSimulatorView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MECF.Framework.Simulator.Core.Aligners"
|
||||
xmlns:deviceControl="clr-namespace:MECF.Framework.UI.Core.DeviceControl;assembly=MECF.Framework.UI.Core"
|
||||
xmlns:commons="clr-namespace:MECF.Framework.Simulator.Core.Commons"
|
||||
Height="900" Width="900">
|
||||
<UserControl.Resources>
|
||||
<DataTemplate x:Key="DataTemplate1">
|
||||
<StackPanel Orientation="Horizontal" Width="200" Height="15">
|
||||
<TextBox Text="{Binding Index}"></TextBox>
|
||||
<TextBox Text="{Binding State}"></TextBox>
|
||||
<Button Content="{Binding State}" Margin="0" Width="100" Height="15" Background="LightBlue" VerticalAlignment="Center"></Button>
|
||||
<TextBox Text="{Binding Index}"></TextBox>
|
||||
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="100"></RowDefinition>
|
||||
<RowDefinition Height="350"></RowDefinition>
|
||||
<RowDefinition Height="50"></RowDefinition>
|
||||
<RowDefinition Height="400"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<commons:SerialPortTitleView Grid.Row="0"></commons:SerialPortTitleView>
|
||||
|
||||
<Canvas Grid.Row="1" Height="350" Width="900">
|
||||
<Label Content="{Binding LP1WaferMap}" Width="231" Height="30" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="10" Canvas.Top="50"></Label>
|
||||
|
||||
<Label Content="{Binding LP2WaferMap}" Width="231" Height="30" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="307" Canvas.Top="50"></Label>
|
||||
<Label Content="LP1InfoPad Status" Width="193" Height="39" HorizontalContentAlignment="Center" Background="Transparent" BorderThickness="2" Canvas.Top="197"/>
|
||||
|
||||
<Label Content="{Binding LP1InfoPadStatus}" Width="82" Height="41" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="198" Canvas.Top="194"></Label>
|
||||
|
||||
<TextBox Text="{Binding LP1InfoPadSet}" IsReadOnly ="False" Width="69" Height="38" Margin="0" RenderTransformOrigin="0.471,-0.188" Canvas.Left="285" Canvas.Top="198"></TextBox>
|
||||
<Button Content="SetInfoPad" Width="138" Height="42" Command="{Binding SetLP1InfoPadCommand}"
|
||||
Canvas.Left="400" Margin="0" Canvas.Top="194" ></Button>
|
||||
|
||||
<Label Content="LP2InfoPad Status" Width="193" Height="39" HorizontalContentAlignment="Center" Background="Transparent" BorderThickness="2" Canvas.Top="261"/>
|
||||
|
||||
<Label Content="{Binding LP2InfoPadStatus}" Width="82" Height="41" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="198" Canvas.Top="259"></Label>
|
||||
|
||||
<TextBox Text="{Binding LP2InfoPadSet}" IsReadOnly ="False" Width="69" Height="38" Margin="0" RenderTransformOrigin="0.471,-0.188" Canvas.Left="285" Canvas.Top="259"></TextBox>
|
||||
<Button Content="SetInfoPad" Width="138" Height="42" Command="{Binding SetLP2InfoPadCommand}"
|
||||
Canvas.Left="400" Margin="0" Canvas.Top="255" ></Button>
|
||||
|
||||
<Label Content="FOUP ID" Width="150" Height="39" HorizontalContentAlignment="Center" Background="Transparent" BorderThickness="2" Canvas.Top="308" Canvas.Left="15"/>
|
||||
<TextBox Text="{Binding FoupID,Mode=OneWayToSource}" IsReadOnly ="False" Width="116" Height="38" Margin="0" Canvas.Left="199" Canvas.Top="308"></TextBox>
|
||||
|
||||
<Button Content="LP1 Place" Width="100" Height="35" Command="{Binding PlaceCommand}" CommandParameter="P1" Canvas.Left="10" Margin="0" Canvas.Top="136"></Button>
|
||||
<Button Content="LP1 Remove" Width="100" Height="35" Command="{Binding RemoveCommand}" CommandParameter="P1" Canvas.Left="141" Margin="0" Canvas.Top="136"></Button>
|
||||
|
||||
<Button Content="LP2 Place" Width="100" Height="35" Command="{Binding PlaceCommand}" CommandParameter="P2" Canvas.Left="320" Margin="0" Canvas.Top="136" RenderTransformOrigin="2.05,0.686"></Button>
|
||||
<Button Content="LP2 Remove" Width="107" Height="35" Command="{Binding RemoveCommand}" CommandParameter="P2" Canvas.Left="438" Margin="0" Canvas.Top="136" RenderTransformOrigin="2.34,0.543"></Button>
|
||||
|
||||
<ItemsControl Width="300" Height="300" Background="LightGray" Canvas.Left="576" ItemsSource="{Binding WaferList}" ItemTemplate="{DynamicResource DataTemplate1}" >
|
||||
|
||||
</ItemsControl>
|
||||
|
||||
<Button Content="LP1 SetAll" Width="100" Height="35" Command="{Binding SetAllCommand}"
|
||||
CommandParameter="P1" Canvas.Left="513" Margin="0" Canvas.Top="305"></Button>
|
||||
<Button Content="LP1 Random" Width="100" Height="35" Command="{Binding RandomCommand}"
|
||||
CommandParameter="P1" Canvas.Left="646" Margin="0" Canvas.Top="305"></Button>
|
||||
<Button Content="LP1 Clear" Width="100" Height="35" Command="{Binding ClearCommand}"
|
||||
CommandParameter="P1" Canvas.Left="766" Margin="0" Canvas.Top="305"></Button>
|
||||
|
||||
<Button Content="LP2 SetAll" Width="100" Height="35" Command="{Binding SetAllCommand}"
|
||||
CommandParameter="P2" Canvas.Left="513" Margin="0" Canvas.Top="345"></Button>
|
||||
<Button Content="LP2 Random" Width="100" Height="35" Command="{Binding RandomCommand}"
|
||||
CommandParameter="P2" Canvas.Left="646" Margin="0" Canvas.Top="345"></Button>
|
||||
<Button Content="LP2 Clear" Width="100" Height="35" Command="{Binding ClearCommand}"
|
||||
CommandParameter="P2" Canvas.Left="766" Margin="0" Canvas.Top="345"></Button>
|
||||
|
||||
</Canvas>
|
||||
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" Width="900">
|
||||
<Button Content="Clear Log" Width="100" Height="35" Command="{Binding ClearLogCommand}"></Button>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<DataGrid Grid.Row="3" FontSize="16" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserSortColumns="False" ItemsSource="{Binding TransactionLogItems}"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Width="900" Height="390" VerticalAlignment="Top">
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTextColumn Header="Time" Width="160" IsReadOnly="True" Binding="{Binding OccurTime, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
|
||||
<DataGridTextColumn Header="Incoming" Width="350" IsReadOnly="True" Binding="{Binding Incoming, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Height" Value="auto"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
|
||||
<DataGridTextColumn Header="Outgoing" Width="350" IsReadOnly="True" Binding="{Binding Outgoing, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Height" Value="auto"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,188 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Aitex.Core.UI.MVVM;
|
||||
using Aitex.Core.Utilities;
|
||||
using MECF.Framework.Simulator.Core.Commons;
|
||||
using MECF.Framework.Simulator.Core.Driver;
|
||||
using MECF.Framework.Simulator.Core.LoadPorts;
|
||||
using MECF.Framework.Simulator.Core.LoadPorts.Hirata;
|
||||
using MECF.Framework.Simulator.Core.Robots;
|
||||
|
||||
namespace MECF.Framework.Simulator.Core.LoadPorts
|
||||
{
|
||||
//public class WaferItem
|
||||
//{
|
||||
// public int index { get; set; }
|
||||
|
||||
// public string Display { get; set; }
|
||||
|
||||
// public int State { get; set; }
|
||||
//}
|
||||
/// <summary>
|
||||
/// TDKLoadPort.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PrsEfemSimulatorView : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty PortProperty = DependencyProperty.Register(
|
||||
"Port", typeof(int), typeof(HirataLoadPortTCPView),
|
||||
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public int Port
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this.GetValue(PortProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue(PortProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public PrsEfemSimulatorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.Loaded += OnViewLoaded;
|
||||
}
|
||||
|
||||
private void OnViewLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext == null)
|
||||
{
|
||||
DataContext = new PrsEfemSimulatorViewModel(Port, 0);
|
||||
(DataContext as TimerViewModelBase).Start();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class PrsEfemSimulatorViewModel : SocketDeviceViewModel
|
||||
{
|
||||
public string Title
|
||||
{
|
||||
get { return "Prs Efem Simulator"; }
|
||||
}
|
||||
|
||||
public string LP1WaferMap
|
||||
{
|
||||
get { return _sim.LP1SlotMap; }
|
||||
}
|
||||
public string LP2WaferMap
|
||||
{
|
||||
get { return _sim.LP2SlotMap; }
|
||||
}
|
||||
|
||||
public string FoupID
|
||||
{
|
||||
get { return _sim.FoupID; }
|
||||
set { _sim.FoupID = value; }
|
||||
}
|
||||
|
||||
public string LP2InfoPadStatus
|
||||
{
|
||||
get { return _sim.LP2InforPadState; }
|
||||
|
||||
}
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public string InfoPadSet { get; set; }
|
||||
|
||||
public ObservableCollection<WaferItem> WaferList { get; set; }
|
||||
|
||||
public ICommand PlaceCommand { get; set; }
|
||||
public ICommand RemoveCommand { get; set; }
|
||||
|
||||
public ICommand ClearCommand { get; set; }
|
||||
public ICommand SetAllCommand { get; set; }
|
||||
public ICommand RandomCommand { get; set; }
|
||||
|
||||
public ICommand SetInfoPadCommand { get; set; }
|
||||
|
||||
private PrsEfemSimulator _sim;
|
||||
|
||||
|
||||
public PrsEfemSimulatorViewModel(int port, int index) : base("PrsEfemSimulatorViewModel")
|
||||
{
|
||||
PlaceCommand = new DelegateCommand<string>(Place);
|
||||
RemoveCommand = new DelegateCommand<string>(Remove);
|
||||
|
||||
ClearCommand = new DelegateCommand<string>(Clear);
|
||||
SetAllCommand = new DelegateCommand<string>(SetAll);
|
||||
RandomCommand = new DelegateCommand<string>(RandomGenerateWafer);
|
||||
SetInfoPadCommand = new DelegateCommand<string>(SetInfoPadStatus);
|
||||
|
||||
_sim = new PrsEfemSimulator(port);
|
||||
Init(_sim);
|
||||
WaferList = new ObservableCollection<WaferItem>()
|
||||
{
|
||||
new WaferItem {Display = "1", Index = 2, State = 3}
|
||||
};
|
||||
if (index == 1)
|
||||
{
|
||||
_sim.SetUpWafer("LP1");
|
||||
_sim.SetUpWafer("LP2");
|
||||
}
|
||||
else
|
||||
{
|
||||
_sim.SetLowWafer("LP1");
|
||||
_sim.SetLowWafer("LP2");
|
||||
}
|
||||
|
||||
}
|
||||
private void SetInfoPadStatus(string obj)
|
||||
{
|
||||
if (obj == "LP1")
|
||||
{
|
||||
_sim.LP1InforPadState = InfoPadSet;
|
||||
}
|
||||
if (obj == "LP2")
|
||||
{
|
||||
_sim.LP2InforPadState = InfoPadSet;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void RandomGenerateWafer(string obj)
|
||||
{
|
||||
_sim.RandomWafer(obj);
|
||||
}
|
||||
|
||||
private void SetAll(string obj)
|
||||
{
|
||||
_sim.SetAllWafer(obj);
|
||||
}
|
||||
|
||||
private void Clear(string obj)
|
||||
{
|
||||
_sim.ClearWafer(obj);
|
||||
}
|
||||
|
||||
private void Remove(string obj)
|
||||
{
|
||||
_sim.RemoveCarrier(obj);
|
||||
}
|
||||
|
||||
private void Place(string obj)
|
||||
{
|
||||
_sim.PlaceCarrier(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,529 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Aitex.Core.RT.Log;
|
||||
using MECF.Framework.Simulator.Core.Driver;
|
||||
|
||||
namespace MECF.Framework.Simulator.Core.LoadPorts
|
||||
{
|
||||
|
||||
|
||||
public class SGLoadPortSimulator : SocketDeviceSimulator
|
||||
{
|
||||
public string SlotMap
|
||||
{
|
||||
get { return string.Join("", _slotMap); }
|
||||
}
|
||||
//public event Action<string> WriteDeviceEvent;
|
||||
|
||||
private string[] _slotMap = new string[25];
|
||||
private string[] _state = new string[20];
|
||||
private string[] _led = new string[13];
|
||||
|
||||
public string InforPadState { get; set; } = "0";
|
||||
|
||||
//private bool _isPlaced;
|
||||
//private bool _isPresent;
|
||||
|
||||
//private int _moveTime = 5000; //
|
||||
|
||||
public SGLoadPortSimulator(int tcpPort)
|
||||
: base(tcpPort, -1, "\r", ' ')
|
||||
{
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
_slotMap[i] = "0";
|
||||
for (int i = 0; i < _state.Length; i++)
|
||||
_state[i] = "0";
|
||||
for (int i = 0; i < _led.Length; i++)
|
||||
_led[i] = "0";
|
||||
|
||||
|
||||
//00110 01?10 10001 01100
|
||||
|
||||
//A000A 41010 10001 01000
|
||||
_state[0] = "0"; //Equipment status 0 = Normal A = Recoverable error E = Fatal error
|
||||
_state[1] = "0"; //Mode 0 = Online 1 = Teaching
|
||||
_state[2] = "0"; //Initial position 0 = Unexecuted 1 = Executed
|
||||
_state[3] = "0"; //Operation status 0 = Stopped 1 = Operating
|
||||
_state[4] = "0"; //Error code Error code (upper)
|
||||
|
||||
_state[5] = "0"; // Error code Error code (lower)
|
||||
_state[6] = "0"; //Cassette presence 0 = None 1 = Normal position 2 = Error load
|
||||
_state[7] = "0"; //FOUP clamp status 0 = Open 1 = Close ? = Not defined
|
||||
_state[8] = "0"; //Latch key status 0 = Open 1 = Close ? = Not defined
|
||||
_state[9] = "0"; //Vacuum 0 = OFF 1 = ON
|
||||
|
||||
_state[10] = "1"; //Door position 0 = Open position 1 = Close position ? = Not defined
|
||||
_state[11] = "0"; //Wafer protrusion sensor 0 = Blocked. 1 = Unblocked.
|
||||
_state[12] = "0";
|
||||
_state[13] = "0"; //Dock Position 0 = Undock, 1 = dock;
|
||||
_state[14] = "0";
|
||||
|
||||
_state[15] = "0";
|
||||
_state[16] = "0";
|
||||
_state[17] = "0";
|
||||
_state[18] = "0";
|
||||
_state[19] = InforPadState;
|
||||
|
||||
//A000A 41010 10001 01000
|
||||
_led[0] = "0"; //LOAD
|
||||
_led[1] = "0"; //UNLOAD
|
||||
_led[2] = "0"; //OP.ACCESS
|
||||
_led[3] = "0"; //PRESENCE
|
||||
_led[4] = "0"; //PLACEMENT
|
||||
|
||||
_led[5] = "0"; // ALARM
|
||||
_led[6] = "0"; //STATUS1
|
||||
_led[7] = "0"; //STATUS2
|
||||
_led[8] = "0"; //
|
||||
_led[9] = "0"; //
|
||||
|
||||
_led[10] = "0"; //
|
||||
_led[11] = "0"; //
|
||||
_led[12] = "0";
|
||||
}
|
||||
|
||||
//public void ChangeSlotMap(SlotMapChangedEventArgs obj)
|
||||
//{
|
||||
// string slotMap = obj.SlotMap.Replace("'", "");
|
||||
// for (int i = 0; i < slotMap.Length; i++)
|
||||
// _slotMap[i] = slotMap.Substring(i, 1);
|
||||
//}
|
||||
|
||||
protected override void ProcessUnsplitMessage(string message)
|
||||
{
|
||||
message = message.Replace("s00", "").Replace("\r", "").Replace(";","");
|
||||
|
||||
//message = message.Replace("s00", "").Replace(";", "");
|
||||
string[] msg = message.Split(':');
|
||||
|
||||
if (msg.Length < 2)
|
||||
return;
|
||||
|
||||
|
||||
string type = msg[0];
|
||||
string cmd = msg[1];
|
||||
switch (type)
|
||||
{
|
||||
case "SET":
|
||||
ReceiveSetCommand(cmd);
|
||||
break;
|
||||
|
||||
case "MOD":
|
||||
ReceiveModCommand(cmd);
|
||||
break;
|
||||
case "GET":
|
||||
ReceiveGetCommand(cmd);
|
||||
break;
|
||||
case "FIN":
|
||||
ReceiveFinCommand(cmd);
|
||||
break;
|
||||
case "MOV":
|
||||
ReceiveMovCommand(cmd);
|
||||
break;
|
||||
case "EVT":
|
||||
ReceiveEvtCommand(cmd);
|
||||
break;
|
||||
case "TCH":
|
||||
ReceiveTchCommand(cmd);
|
||||
break;
|
||||
default:
|
||||
ReceiveUnknownCommand(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ReceiveMovCommand(string cmd)
|
||||
{
|
||||
bool needINF = true;
|
||||
switch (cmd)
|
||||
{
|
||||
case "ORGSH": //back to initial
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
|
||||
break;
|
||||
case "CUDNC":
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.VacuumOn] = "0";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "0";
|
||||
break;
|
||||
case "ABORG": //Force back to initial
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
|
||||
break;
|
||||
case "PODCL": //FOUP clamp: Close
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
//needINF = false;
|
||||
break;
|
||||
case "PODOP": //FOUP clamp: open
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
break;
|
||||
case "CLDDK": //FOUP dock:
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1";
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
break;
|
||||
case "CLDOP": //FOUP dock:
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
break;
|
||||
case "CUDCL": //FOUP undock
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
break;
|
||||
case "CULFC": //FOUP undock
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
break;
|
||||
case "CULDK": //Door Close
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "0";
|
||||
break;
|
||||
case "CLMPO": //Door open
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
break;
|
||||
case "CLDMP": //Maps and loads the FOUP.
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1"; //Dock
|
||||
break;
|
||||
case "CLOAD": //loads the FOUP.
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1";
|
||||
break;
|
||||
case "CULOD": //Unloads the FOUP (at the ejection position).
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "0";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "0"; //Dock
|
||||
break;
|
||||
case "YDOOR": //move to dock pos in fosb mode
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1";
|
||||
break;
|
||||
case "YWAIT": //move to undock pos in fosb mode
|
||||
_state[(int)StateIndex.Y_AxisPos] = "0";
|
||||
break;
|
||||
case "DORBK": //move to door open pos in fosb mode
|
||||
_state[(int) StateIndex.DoorClosed] = "0";
|
||||
break;
|
||||
case "DORFW": //move to door close pos in fosb mode
|
||||
_state[(int) StateIndex.DoorClosed] = "1";
|
||||
break;
|
||||
case "ZDRDW": //move to door down pos in fosb mode
|
||||
_state[0] = "0";
|
||||
_state[1] = "0";
|
||||
_state[2] = "1";
|
||||
_state[3] = "0";
|
||||
_state[4] = "0";
|
||||
_state[5] = "0";
|
||||
_state[6] = "1";
|
||||
_state[7] = "1";
|
||||
_state[8] = "0";
|
||||
_state[9] = "1";
|
||||
_state[10] = "0";
|
||||
_state[11] = "1";
|
||||
_state[12] = "1";
|
||||
_state[13] = "1";
|
||||
_state[14] = "1";
|
||||
_state[15] = "1";
|
||||
_state[16] = "1";
|
||||
_state[17] = "1";
|
||||
_state[18] = "0";
|
||||
_state[19] = "B";
|
||||
|
||||
|
||||
|
||||
//_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
break;
|
||||
case "ZDRUP": //move to door up pos in fosb mode
|
||||
_state[(int)StateIndex.Z_AxisPos] = "0";
|
||||
break;
|
||||
case "STOP_":
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
SendAck(cmd);
|
||||
|
||||
Thread.Sleep(2000);
|
||||
if(needINF)
|
||||
{
|
||||
//if (cmd == "CLDMP")
|
||||
//{
|
||||
// SendABS(cmd);
|
||||
// return;
|
||||
//}
|
||||
SendInf(cmd);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
private void SendABS(string cmd)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
|
||||
//string msg = _isPlaced ? "s00INF:PODON;\r" : "s00INF:PODOF;\r";
|
||||
|
||||
string message = string.Format("s00ABS:{0};\r", cmd+ "/DLMIT");
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
private void ReceiveSetCommand(string cmd)
|
||||
{
|
||||
|
||||
if (cmd.Contains("FSB"))
|
||||
{
|
||||
SendAck(cmd); return;
|
||||
}
|
||||
if(cmd.Contains("LOF"))
|
||||
SendAckAndInf(cmd);
|
||||
else
|
||||
{
|
||||
SendAck(cmd);
|
||||
SendInf(cmd);
|
||||
}
|
||||
//SendInf(cmd);
|
||||
}
|
||||
private void SendAckAndInf(string cmd)
|
||||
{
|
||||
string ack = string.Format("s00ACK:{0};\rs00INF:{0};\r", cmd);
|
||||
|
||||
OnWriteMessage(ack);
|
||||
|
||||
}
|
||||
|
||||
private void ReceiveModCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
#region GET Command
|
||||
|
||||
private void ReceiveGetCommand(string cmdGet)
|
||||
{
|
||||
_state[19] = InforPadState;
|
||||
switch (cmdGet)
|
||||
{
|
||||
case "STATE":
|
||||
FeedbackGetStatus(cmdGet);
|
||||
break;
|
||||
|
||||
case "VERSN":
|
||||
FeedbackGetVersion();
|
||||
break;
|
||||
|
||||
case "LEDST":
|
||||
FeedbackGetIndicator(cmdGet);
|
||||
break;
|
||||
|
||||
case "MAPDT":
|
||||
FeedbackGetWaferMapDescendingOrder(cmdGet);
|
||||
break;
|
||||
|
||||
case "MAPRD":
|
||||
FeedbackGetWaferMapAscendingOrder(cmdGet);
|
||||
break;
|
||||
|
||||
case "WFCNT":
|
||||
FeedbackGetWaferCount();
|
||||
break;
|
||||
|
||||
case "FSBxx":
|
||||
FeedbackGetFOSBMode(cmdGet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void FeedbackGetStatus(string cmd)
|
||||
{
|
||||
string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _state));
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetIndicator(string cmd)
|
||||
{
|
||||
string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _led));
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
//25 - 1
|
||||
private void FeedbackGetWaferMapDescendingOrder(string cmd)
|
||||
{
|
||||
var sm = _slotMap.Reverse();
|
||||
string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", sm));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
//1-25
|
||||
private void FeedbackGetWaferMapAscendingOrder(string cmd)
|
||||
{
|
||||
string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _slotMap));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
private void FeedbackGetWaferCount()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetFOSBMode(string cmd)
|
||||
{
|
||||
string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _state));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void ReceiveFinCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void ReceiveEvtCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveTchCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveUnknownCommand(string message)
|
||||
{
|
||||
//LOG.Write("LoadPort" + _loadPortNumber + " Receive Unknown message," + message);
|
||||
}
|
||||
|
||||
|
||||
private void SendInf(string cmd)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
|
||||
//string msg = _isPlaced ? "s00INF:PODON;\r" : "s00INF:PODOF;\r";
|
||||
|
||||
string message = string.Format("s00INF:{0};\r", cmd);
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
private void SendAck(string cmd)
|
||||
{
|
||||
string ack = string.Format("s00ACK:{0};\r", cmd);
|
||||
|
||||
OnWriteMessage(ack);
|
||||
|
||||
}
|
||||
|
||||
public void PlaceCarrier()
|
||||
{
|
||||
//SimManager.Instance.PlaceFoup(_loadPortNumber);
|
||||
|
||||
//_isPlaced = _isPresent = true;
|
||||
|
||||
_state[6] = "1";
|
||||
//_state[10] = "0";
|
||||
|
||||
//_led[(int) Indicator.PLACEMENT] = _isPlaced ? "1" : "0";
|
||||
//_led[(int) Indicator.PRESENCE] = _isPresent ? "1" : "0";
|
||||
|
||||
string msg = "s00INF:PODON;\r";
|
||||
OnWriteMessage(msg);
|
||||
}
|
||||
|
||||
public void RemoveCarrier()
|
||||
{
|
||||
//SimManager.Instance.RemoveFoup(_loadPortNumber);
|
||||
|
||||
//_isPlaced = _isPresent = false;
|
||||
_state[6] = "0";
|
||||
|
||||
//_led[(int) Indicator.PLACEMENT] = "0";
|
||||
//_led[(int) Indicator.PRESENCE] = "0";
|
||||
|
||||
string msg = "s00INF:PODOF;\r";
|
||||
OnWriteMessage(msg);
|
||||
}
|
||||
|
||||
public void ClearWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = "0";
|
||||
}
|
||||
}
|
||||
|
||||
public void SetAllWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = "1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetUpWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = i>15 ? "1" : "0";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetLowWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = i <10 ? "1" : "0";
|
||||
}
|
||||
}
|
||||
|
||||
public void RandomWafer()
|
||||
{
|
||||
Random _rd = new Random();
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
var rtn= _rd.Next(0, 10) % 4;
|
||||
switch (rtn)
|
||||
{
|
||||
case 0:
|
||||
_slotMap[i] = "0";
|
||||
break;
|
||||
case 1:
|
||||
_slotMap[i] = "1";
|
||||
break;
|
||||
case 2:
|
||||
_slotMap[i] = "2";
|
||||
break;
|
||||
case 3:
|
||||
_slotMap[i] = "W";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<UserControl x:Class="MECF.Framework.Simulator.Core.LoadPorts.SGLoadPortView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MECF.Framework.Simulator.Core.Aligners"
|
||||
xmlns:deviceControl="clr-namespace:MECF.Framework.UI.Core.DeviceControl;assembly=MECF.Framework.UI.Core"
|
||||
xmlns:commons="clr-namespace:MECF.Framework.Simulator.Core.Commons"
|
||||
Height="900" Width="900">
|
||||
<UserControl.Resources>
|
||||
<DataTemplate x:Key="DataTemplate1">
|
||||
<StackPanel Orientation="Horizontal" Width="200" Height="15">
|
||||
<TextBox Text="{Binding Index}"></TextBox>
|
||||
<TextBox Text="{Binding State}"></TextBox>
|
||||
<Button Content="{Binding State}" Margin="0" Width="100" Height="15" Background="LightBlue" VerticalAlignment="Center"></Button>
|
||||
<TextBox Text="{Binding Index}"></TextBox>
|
||||
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="100"></RowDefinition>
|
||||
<RowDefinition Height="350"></RowDefinition>
|
||||
<RowDefinition Height="50"></RowDefinition>
|
||||
<RowDefinition Height="400"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<commons:SerialPortTitleView Grid.Row="0"></commons:SerialPortTitleView>
|
||||
|
||||
<Canvas Grid.Row="1" Height="350" Width="900">
|
||||
<Label Content="{Binding WaferMap}" Width="300" Height="30" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="32" Canvas.Top="50"></Label>
|
||||
<Label Content="InfoPad Status" Width="161" Height="30" HorizontalContentAlignment="Center" Background="Transparent" BorderThickness="2" Canvas.Left="32" Canvas.Top="197"></Label>
|
||||
|
||||
<Label Content="{Binding InfoPadStatus}" Width="82" Height="41" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="198" Canvas.Top="194"></Label>
|
||||
|
||||
<TextBox Text="{Binding InfoPadSet}" IsReadOnly ="False" Width="69" Height="38" Margin="0" RenderTransformOrigin="0.471,-0.188" Canvas.Left="285" Canvas.Top="198"></TextBox>
|
||||
<Button Content="SetInfoPad" Width="138" Height="42" Command="{Binding SetInfoPadCommand}"
|
||||
Canvas.Left="400" Margin="0" Canvas.Top="194" ></Button>
|
||||
|
||||
<Button Content="Place" Width="100" Height="35" Command="{Binding PlaceCommand}" Canvas.Left="10" Margin="0" Canvas.Top="136"></Button>
|
||||
<Button Content="Remove" Width="100" Height="35" Command="{Binding RemoveCommand}" Canvas.Left="141" Margin="0" Canvas.Top="136"></Button>
|
||||
|
||||
<ItemsControl Width="300" Height="300" Background="LightGray" Canvas.Left="576" ItemsSource="{Binding WaferList}" ItemTemplate="{DynamicResource DataTemplate1}" >
|
||||
|
||||
</ItemsControl>
|
||||
|
||||
<Button Content="SetAll" Width="100" Height="35" Command="{Binding SetAllCommand}" Canvas.Left="513" Margin="0" Canvas.Top="305"></Button>
|
||||
<Button Content="Random" Width="100" Height="35" Command="{Binding RandomCommand}" Canvas.Left="646" Margin="0" Canvas.Top="305"></Button>
|
||||
<Button Content="Clear" Width="100" Height="35" Command="{Binding ClearCommand}" Canvas.Left="766" Margin="0" Canvas.Top="305"></Button>
|
||||
|
||||
</Canvas>
|
||||
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" Width="900">
|
||||
<Button Content="Clear Log" Width="100" Height="35" Command="{Binding ClearLogCommand}"></Button>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<DataGrid Grid.Row="3" FontSize="16" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserSortColumns="False" ItemsSource="{Binding TransactionLogItems}"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Width="900" Height="380" VerticalAlignment="Top">
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTextColumn Header="Time" Width="160" IsReadOnly="True" Binding="{Binding OccurTime, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
|
||||
<DataGridTextColumn Header="Incoming" Width="350" IsReadOnly="True" Binding="{Binding Incoming, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Height" Value="auto"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
|
||||
<DataGridTextColumn Header="Outgoing" Width="350" IsReadOnly="True" Binding="{Binding Outgoing, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Height" Value="auto"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,158 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Aitex.Core.UI.MVVM;
|
||||
using Aitex.Core.Utilities;
|
||||
using MECF.Framework.Simulator.Core.Commons;
|
||||
using MECF.Framework.Simulator.Core.Driver;
|
||||
using MECF.Framework.Simulator.Core.Robots;
|
||||
|
||||
namespace MECF.Framework.Simulator.Core.LoadPorts
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// TDKLoadPort.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SGLoadPortView : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty PortProperty = DependencyProperty.Register(
|
||||
"Port", typeof(int), typeof(HirataLoadPortTCPView),
|
||||
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public int Port
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this.GetValue(PortProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue(PortProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SGLoadPortView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.Loaded += OnViewLoaded;
|
||||
}
|
||||
|
||||
private void OnViewLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext == null)
|
||||
{
|
||||
DataContext = new SGLoadPortViewModel(Port, 0);
|
||||
(DataContext as TimerViewModelBase).Start();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class SGLoadPortViewModel : SocketDeviceViewModel
|
||||
{
|
||||
public string Title
|
||||
{
|
||||
get { return "SG LoadPort Simulator"; }
|
||||
}
|
||||
|
||||
public string WaferMap
|
||||
{
|
||||
get { return _sim.SlotMap; }
|
||||
}
|
||||
|
||||
public string InfoPadStatus
|
||||
{
|
||||
get { return _sim.InforPadState; }
|
||||
|
||||
}
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public string InfoPadSet { get; set; }
|
||||
|
||||
public ObservableCollection<WaferItem> WaferList { get; set; }
|
||||
|
||||
public ICommand PlaceCommand { get; set; }
|
||||
public ICommand RemoveCommand { get; set; }
|
||||
|
||||
public ICommand ClearCommand { get; set; }
|
||||
public ICommand SetAllCommand { get; set; }
|
||||
public ICommand RandomCommand { get; set; }
|
||||
|
||||
public ICommand SetInfoPadCommand { get; set; }
|
||||
|
||||
private SGLoadPortSimulator _sim;
|
||||
|
||||
|
||||
public SGLoadPortViewModel(int port, int index) : base("SGLoadPortViewModel")
|
||||
{
|
||||
PlaceCommand = new DelegateCommand<string>(Place);
|
||||
RemoveCommand = new DelegateCommand<string>(Remove);
|
||||
|
||||
ClearCommand = new DelegateCommand<string>(Clear);
|
||||
SetAllCommand = new DelegateCommand<string>(SetAll);
|
||||
RandomCommand = new DelegateCommand<string>(RandomGenerateWafer);
|
||||
SetInfoPadCommand = new DelegateCommand<string>(SetInfoPadStatus);
|
||||
|
||||
_sim = new SGLoadPortSimulator(port);
|
||||
Init(_sim);
|
||||
|
||||
|
||||
WaferList = new ObservableCollection<WaferItem>()
|
||||
{
|
||||
new WaferItem {Display = "1", Index = 2, State = 3}
|
||||
};
|
||||
|
||||
if (index == 1)
|
||||
_sim.SetUpWafer();
|
||||
else
|
||||
{
|
||||
_sim.SetLowWafer();
|
||||
}
|
||||
|
||||
}
|
||||
private void SetInfoPadStatus(string obj)
|
||||
{
|
||||
_sim.InforPadState = InfoPadSet;
|
||||
}
|
||||
|
||||
private void RandomGenerateWafer(string obj)
|
||||
{
|
||||
_sim.RandomWafer();
|
||||
}
|
||||
|
||||
private void SetAll(string obj)
|
||||
{
|
||||
_sim.SetAllWafer();
|
||||
}
|
||||
|
||||
private void Clear(string obj)
|
||||
{
|
||||
_sim.ClearWafer();
|
||||
}
|
||||
|
||||
private void Remove(string obj)
|
||||
{
|
||||
_sim.RemoveCarrier();
|
||||
}
|
||||
|
||||
private void Place(string obj)
|
||||
{
|
||||
_sim.PlaceCarrier();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,548 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Aitex.Core.RT.Log;
|
||||
using MECF.Framework.Simulator.Core.Driver;
|
||||
|
||||
namespace MECF.Framework.Simulator.Core.LoadPorts
|
||||
{
|
||||
public enum StateIndex : int
|
||||
{
|
||||
EquipmentStatus,
|
||||
Mode,
|
||||
InitialPosition,
|
||||
OperationStatus,
|
||||
ErrorCodeUpper,
|
||||
|
||||
ErrorCodeLower,
|
||||
Present,
|
||||
ClampClosed,
|
||||
LatchClosed,
|
||||
VacuumOn,
|
||||
|
||||
DoorClosed,
|
||||
WaferProtrusion,
|
||||
Z_AxisPos,
|
||||
Y_AxisPos,
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class TDKLoadPortSimulator : SerialPortDeviceSimulator
|
||||
{
|
||||
public string SlotMap
|
||||
{
|
||||
get { return string.Join("", _slotMap); }
|
||||
}
|
||||
//public event Action<string> WriteDeviceEvent;
|
||||
|
||||
private string[] _slotMap = new string[25];
|
||||
private string[] _state = new string[20];
|
||||
private string[] _led = new string[13];
|
||||
|
||||
public string InforPadState { get; set; } = "0";
|
||||
|
||||
//private bool _isPlaced;
|
||||
//private bool _isPresent;
|
||||
|
||||
//private int _moveTime = 5000; //
|
||||
|
||||
public TDKLoadPortSimulator(string portName)
|
||||
: base(portName, -1, "\r", ' ')
|
||||
{
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
_slotMap[i] = "0";
|
||||
for (int i = 0; i < _state.Length; i++)
|
||||
_state[i] = "0";
|
||||
for (int i = 0; i < _led.Length; i++)
|
||||
_led[i] = "0";
|
||||
|
||||
|
||||
//00110 01?10 10001 01100
|
||||
|
||||
//A000A 41010 10001 01000
|
||||
_state[0] = "0"; //Equipment status 0 = Normal A = Recoverable error E = Fatal error
|
||||
_state[1] = "0"; //Mode 0 = Online 1 = Teaching
|
||||
_state[2] = "0"; //Initial position 0 = Unexecuted 1 = Executed
|
||||
_state[3] = "0"; //Operation status 0 = Stopped 1 = Operating
|
||||
_state[4] = "0"; //Error code Error code (upper)
|
||||
|
||||
_state[5] = "0"; // Error code Error code (lower)
|
||||
_state[6] = "0"; //Cassette presence 0 = None 1 = Normal position 2 = Error load
|
||||
_state[7] = "0"; //FOUP clamp status 0 = Open 1 = Close ? = Not defined
|
||||
_state[8] = "0"; //Latch key status 0 = Open 1 = Close ? = Not defined
|
||||
_state[9] = "0"; //Vacuum 0 = OFF 1 = ON
|
||||
|
||||
_state[10] = "1"; //Door position 0 = Open position 1 = Close position ? = Not defined
|
||||
_state[11] = "0"; //Wafer protrusion sensor 0 = Blocked. 1 = Unblocked.
|
||||
_state[12] = "0";
|
||||
_state[13] = "0"; //Dock Position 0 = Undock, 1 = dock;
|
||||
_state[14] = "0";
|
||||
|
||||
_state[15] = "0";
|
||||
_state[16] = "0";
|
||||
_state[17] = "0";
|
||||
_state[18] = "0";
|
||||
_state[19] = InforPadState;
|
||||
|
||||
//A000A 41010 10001 01000
|
||||
_led[0] = "0"; //LOAD
|
||||
_led[1] = "0"; //UNLOAD
|
||||
_led[2] = "0"; //OP.ACCESS
|
||||
_led[3] = "0"; //PRESENCE
|
||||
_led[4] = "0"; //PLACEMENT
|
||||
|
||||
_led[5] = "0"; // ALARM
|
||||
_led[6] = "0"; //STATUS1
|
||||
_led[7] = "0"; //STATUS2
|
||||
_led[8] = "0"; //
|
||||
_led[9] = "0"; //
|
||||
|
||||
_led[10] = "0"; //
|
||||
_led[11] = "0"; //
|
||||
_led[12] = "0";
|
||||
}
|
||||
|
||||
//public void ChangeSlotMap(SlotMapChangedEventArgs obj)
|
||||
//{
|
||||
// string slotMap = obj.SlotMap.Replace("'", "");
|
||||
// for (int i = 0; i < slotMap.Length; i++)
|
||||
// _slotMap[i] = slotMap.Substring(i, 1);
|
||||
//}
|
||||
|
||||
protected override void ProcessUnsplitMessage(string message)
|
||||
{
|
||||
message = message.Replace("s00", "").Replace(";\r", "").Replace("\n","");
|
||||
|
||||
//message = message.Replace("s00", "").Replace(";", "");
|
||||
string[] msg = message.Split(':');
|
||||
|
||||
if (msg.Length < 2)
|
||||
return;
|
||||
|
||||
|
||||
string type = msg[0];
|
||||
string cmd = msg[1];
|
||||
switch (type)
|
||||
{
|
||||
case "SET":
|
||||
ReceiveSetCommand(cmd);
|
||||
break;
|
||||
case "MOD":
|
||||
ReceiveModCommand(cmd);
|
||||
break;
|
||||
case "GET":
|
||||
ReceiveGetCommand(cmd);
|
||||
break;
|
||||
case "FIN":
|
||||
ReceiveFinCommand(cmd);
|
||||
break;
|
||||
case "MOV":
|
||||
ReceiveMovCommand(cmd);
|
||||
break;
|
||||
case "EVT":
|
||||
ReceiveEvtCommand(cmd);
|
||||
break;
|
||||
case "TCH":
|
||||
ReceiveTchCommand(cmd);
|
||||
break;
|
||||
default:
|
||||
ReceiveUnknownCommand(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ReceiveMovCommand(string cmd)
|
||||
{
|
||||
bool needINF = true;
|
||||
switch (cmd)
|
||||
{
|
||||
case "ORGSH": //back to initial
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
|
||||
break;
|
||||
case "CUDNC":
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.VacuumOn] = "0";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "0";
|
||||
break;
|
||||
case "ABORG": //Force back to initial
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
|
||||
break;
|
||||
case "PODCL": //FOUP clamp: Close
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
//needINF = false;
|
||||
break;
|
||||
case "PODOP": //FOUP clamp: open
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
break;
|
||||
case "CLDDK": //FOUP dock:
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1";
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
break;
|
||||
case "CLDOP": //FOUP dock:
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
break;
|
||||
case "CUDCL": //FOUP undock
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
break;
|
||||
case "CULFC": //FOUP undock
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
break;
|
||||
case "CULDK": //Door Close
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "0";
|
||||
break;
|
||||
case "CLMPO": //Door open
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
break;
|
||||
case "CLDMP": //Maps and loads the FOUP.
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1"; //Dock
|
||||
break;
|
||||
case "CLOAD": //loads the FOUP.
|
||||
_state[(int)StateIndex.DoorClosed] = "0";
|
||||
_state[(int)StateIndex.ClampClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1";
|
||||
break;
|
||||
case "CULOD": //Unloads the FOUP (at the ejection position).
|
||||
_state[(int)StateIndex.ClampClosed] = "0";
|
||||
_state[(int)StateIndex.DoorClosed] = "1";
|
||||
_state[(int)StateIndex.Z_AxisPos] = "0";
|
||||
_state[(int)StateIndex.Y_AxisPos] = "0"; //Dock
|
||||
break;
|
||||
case "YDOOR": //move to dock pos in fosb mode
|
||||
_state[(int)StateIndex.Y_AxisPos] = "1";
|
||||
break;
|
||||
case "YWAIT": //move to undock pos in fosb mode
|
||||
_state[(int)StateIndex.Y_AxisPos] = "0";
|
||||
break;
|
||||
case "DORBK": //move to door open pos in fosb mode
|
||||
_state[(int) StateIndex.DoorClosed] = "0";
|
||||
break;
|
||||
case "DORFW": //move to door close pos in fosb mode
|
||||
_state[(int) StateIndex.DoorClosed] = "1";
|
||||
break;
|
||||
case "ZDRDW": //move to door down pos in fosb mode
|
||||
_state[0] = "0";
|
||||
_state[1] = "0";
|
||||
_state[2] = "1";
|
||||
_state[3] = "0";
|
||||
_state[4] = "0";
|
||||
_state[5] = "0";
|
||||
_state[6] = "1";
|
||||
_state[7] = "1";
|
||||
_state[8] = "0";
|
||||
_state[9] = "1";
|
||||
_state[10] = "0";
|
||||
_state[11] = "1";
|
||||
_state[12] = "1";
|
||||
_state[13] = "1";
|
||||
_state[14] = "1";
|
||||
_state[15] = "1";
|
||||
_state[16] = "1";
|
||||
_state[17] = "1";
|
||||
_state[18] = "0";
|
||||
_state[19] = "B";
|
||||
|
||||
|
||||
|
||||
//_state[(int)StateIndex.Z_AxisPos] = "1";
|
||||
break;
|
||||
case "ZDRUP": //move to door up pos in fosb mode
|
||||
_state[(int)StateIndex.Z_AxisPos] = "0";
|
||||
break;
|
||||
case "STOP_":
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
SendAck(cmd);
|
||||
|
||||
Thread.Sleep(2000);
|
||||
if(needINF)
|
||||
{
|
||||
//if (cmd == "CLDMP")
|
||||
//{
|
||||
// SendABS(cmd);
|
||||
// return;
|
||||
//}
|
||||
SendInf(cmd);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
private void SendABS(string cmd)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
|
||||
//string msg = _isPlaced ? "s00INF:PODON;\r" : "s00INF:PODOF;\r";
|
||||
|
||||
string message = string.Format("s00ABS:{0};\r", cmd+ "/DLMIT");
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
private void ReceiveSetCommand(string cmd)
|
||||
{
|
||||
|
||||
if (cmd.Contains("FSB"))
|
||||
{
|
||||
SendAck(cmd); return;
|
||||
}
|
||||
if(cmd.Contains("LOF"))
|
||||
SendAckAndInf(cmd);
|
||||
else
|
||||
{
|
||||
SendAck(cmd);
|
||||
SendInf(cmd);
|
||||
}
|
||||
//SendInf(cmd);
|
||||
}
|
||||
private void SendAckAndInf(string cmd)
|
||||
{
|
||||
string ack = string.Format("s00ACK:{0};\rs00INF:{0};\r", cmd);
|
||||
|
||||
OnWriteMessage(ack);
|
||||
|
||||
}
|
||||
|
||||
private void ReceiveModCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
#region GET Command
|
||||
|
||||
private void ReceiveGetCommand(string cmdGet)
|
||||
{
|
||||
_state[19] = InforPadState;
|
||||
switch (cmdGet)
|
||||
{
|
||||
case "STATE":
|
||||
FeedbackGetStatus(cmdGet);
|
||||
break;
|
||||
|
||||
case "VERSN":
|
||||
FeedbackGetVersion();
|
||||
break;
|
||||
|
||||
case "LEDST":
|
||||
FeedbackGetIndicator(cmdGet);
|
||||
break;
|
||||
|
||||
case "MAPDT":
|
||||
FeedbackGetWaferMapDescendingOrder(cmdGet);
|
||||
break;
|
||||
|
||||
case "MAPRD":
|
||||
FeedbackGetWaferMapAscendingOrder(cmdGet);
|
||||
break;
|
||||
|
||||
case "WFCNT":
|
||||
FeedbackGetWaferCount();
|
||||
break;
|
||||
|
||||
case "FSBxx":
|
||||
FeedbackGetFOSBMode(cmdGet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void FeedbackGetStatus(string cmd)
|
||||
{
|
||||
string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _state));
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetIndicator(string cmd)
|
||||
{
|
||||
string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _led));
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
//25 - 1
|
||||
private void FeedbackGetWaferMapDescendingOrder(string cmd)
|
||||
{
|
||||
var sm = _slotMap.Reverse();
|
||||
string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", sm));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
//1-25
|
||||
private void FeedbackGetWaferMapAscendingOrder(string cmd)
|
||||
{
|
||||
string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _slotMap));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
private void FeedbackGetWaferCount()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void FeedbackGetFOSBMode(string cmd)
|
||||
{
|
||||
string message = string.Format("s00ACK:{0}/{1};\r", cmd, string.Join("", _state));
|
||||
OnWriteMessage(message);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void ReceiveFinCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void ReceiveEvtCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveTchCommand(string cmd)
|
||||
{
|
||||
SendAck(cmd);
|
||||
}
|
||||
|
||||
private void ReceiveUnknownCommand(string message)
|
||||
{
|
||||
//LOG.Write("LoadPort" + _loadPortNumber + " Receive Unknown message," + message);
|
||||
}
|
||||
|
||||
|
||||
private void SendInf(string cmd)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
|
||||
//string msg = _isPlaced ? "s00INF:PODON;\r" : "s00INF:PODOF;\r";
|
||||
|
||||
string message = string.Format("s00INF:{0};\r", cmd);
|
||||
OnWriteMessage(message);
|
||||
|
||||
}
|
||||
|
||||
private void SendAck(string cmd)
|
||||
{
|
||||
string ack = string.Format("s00ACK:{0};\r", cmd);
|
||||
|
||||
OnWriteMessage(ack);
|
||||
|
||||
}
|
||||
|
||||
public void PlaceCarrier()
|
||||
{
|
||||
//SimManager.Instance.PlaceFoup(_loadPortNumber);
|
||||
|
||||
//_isPlaced = _isPresent = true;
|
||||
|
||||
_state[6] = "1";
|
||||
//_state[10] = "0";
|
||||
|
||||
//_led[(int) Indicator.PLACEMENT] = _isPlaced ? "1" : "0";
|
||||
//_led[(int) Indicator.PRESENCE] = _isPresent ? "1" : "0";
|
||||
|
||||
string msg = "s00INF:PODON;\r";
|
||||
OnWriteMessage(msg);
|
||||
}
|
||||
|
||||
public void RemoveCarrier()
|
||||
{
|
||||
//SimManager.Instance.RemoveFoup(_loadPortNumber);
|
||||
|
||||
//_isPlaced = _isPresent = false;
|
||||
_state[6] = "0";
|
||||
|
||||
//_led[(int) Indicator.PLACEMENT] = "0";
|
||||
//_led[(int) Indicator.PRESENCE] = "0";
|
||||
|
||||
string msg = "s00INF:PODOF;\r";
|
||||
OnWriteMessage(msg);
|
||||
}
|
||||
|
||||
public void ClearWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = "0";
|
||||
}
|
||||
}
|
||||
|
||||
public void SetAllWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = "1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetUpWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = i>15 ? "1" : "0";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetLowWafer()
|
||||
{
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
_slotMap[i] = i <10 ? "1" : "0";
|
||||
}
|
||||
}
|
||||
|
||||
public void RandomWafer()
|
||||
{
|
||||
Random _rd = new Random();
|
||||
for (int i = 0; i < _slotMap.Length; i++)
|
||||
{
|
||||
var rtn= _rd.Next(0, 10) % 4;
|
||||
switch (rtn)
|
||||
{
|
||||
case 0:
|
||||
_slotMap[i] = "0";
|
||||
break;
|
||||
case 1:
|
||||
_slotMap[i] = "1";
|
||||
break;
|
||||
case 2:
|
||||
_slotMap[i] = "2";
|
||||
break;
|
||||
case 3:
|
||||
_slotMap[i] = "W";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<UserControl x:Class="MECF.Framework.Simulator.Core.LoadPorts.TDKLoadPortView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MECF.Framework.Simulator.Core.Aligners"
|
||||
xmlns:deviceControl="clr-namespace:MECF.Framework.UI.Core.DeviceControl;assembly=MECF.Framework.UI.Core"
|
||||
xmlns:commons="clr-namespace:MECF.Framework.Simulator.Core.Commons"
|
||||
Height="900" Width="900">
|
||||
<UserControl.Resources>
|
||||
<DataTemplate x:Key="DataTemplate1">
|
||||
<StackPanel Orientation="Horizontal" Width="200" Height="15">
|
||||
<TextBox Text="{Binding Index}"></TextBox>
|
||||
<TextBox Text="{Binding State}"></TextBox>
|
||||
<Button Content="{Binding State}" Margin="0" Width="100" Height="15" Background="LightBlue" VerticalAlignment="Center"></Button>
|
||||
<TextBox Text="{Binding Index}"></TextBox>
|
||||
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="100"></RowDefinition>
|
||||
<RowDefinition Height="350"></RowDefinition>
|
||||
<RowDefinition Height="50"></RowDefinition>
|
||||
<RowDefinition Height="400"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<commons:SerialPortTitleView Grid.Row="0"></commons:SerialPortTitleView>
|
||||
|
||||
<Canvas Grid.Row="1" Height="350" Width="900">
|
||||
<Label Content="{Binding WaferMap}" Width="300" Height="30" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="32" Canvas.Top="50"></Label>
|
||||
<Label Content="InfoPad Status" Width="161" Height="30" HorizontalContentAlignment="Center" Background="Transparent" BorderThickness="2" Canvas.Left="32" Canvas.Top="197"></Label>
|
||||
|
||||
<Label Content="{Binding InfoPadStatus}" Width="82" Height="41" HorizontalContentAlignment="Center" Background="LightBlue" BorderThickness="2" Canvas.Left="198" Canvas.Top="194"></Label>
|
||||
|
||||
<TextBox Text="{Binding InfoPadSet}" IsReadOnly ="False" Width="69" Height="38" Margin="0" RenderTransformOrigin="0.471,-0.188" Canvas.Left="285" Canvas.Top="198"></TextBox>
|
||||
<Button Content="SetInfoPad" Width="138" Height="42" Command="{Binding SetInfoPadCommand}"
|
||||
Canvas.Left="400" Margin="0" Canvas.Top="194" ></Button>
|
||||
|
||||
<Button Content="Place" Width="100" Height="35" Command="{Binding PlaceCommand}" Canvas.Left="10" Margin="0" Canvas.Top="136"></Button>
|
||||
<Button Content="Remove" Width="100" Height="35" Command="{Binding RemoveCommand}" Canvas.Left="141" Margin="0" Canvas.Top="136"></Button>
|
||||
|
||||
<ItemsControl Width="300" Height="300" Background="LightGray" Canvas.Left="576" ItemsSource="{Binding WaferList}" ItemTemplate="{DynamicResource DataTemplate1}" >
|
||||
|
||||
</ItemsControl>
|
||||
|
||||
<Button Content="SetAll" Width="100" Height="35" Command="{Binding SetAllCommand}" Canvas.Left="513" Margin="0" Canvas.Top="305"></Button>
|
||||
<Button Content="Random" Width="100" Height="35" Command="{Binding RandomCommand}" Canvas.Left="646" Margin="0" Canvas.Top="305"></Button>
|
||||
<Button Content="Clear" Width="100" Height="35" Command="{Binding ClearCommand}" Canvas.Left="766" Margin="0" Canvas.Top="305"></Button>
|
||||
|
||||
</Canvas>
|
||||
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" Width="900">
|
||||
<Button Content="Clear Log" Width="100" Height="35" Command="{Binding ClearLogCommand}"></Button>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<DataGrid Grid.Row="3" FontSize="16" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserSortColumns="False" ItemsSource="{Binding TransactionLogItems}"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Width="900" Height="380" VerticalAlignment="Top">
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTextColumn Header="Time" Width="160" IsReadOnly="True" Binding="{Binding OccurTime, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
|
||||
<DataGridTextColumn Header="Incoming" Width="350" IsReadOnly="True" Binding="{Binding Incoming, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Height" Value="auto"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
|
||||
<DataGridTextColumn Header="Outgoing" Width="350" IsReadOnly="True" Binding="{Binding Outgoing, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Height" Value="auto"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,180 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Aitex.Core.UI.MVVM;
|
||||
using Aitex.Core.Utilities;
|
||||
using MECF.Framework.Simulator.Core.Commons;
|
||||
using MECF.Framework.Simulator.Core.Driver;
|
||||
using MECF.Framework.Simulator.Core.Robots;
|
||||
|
||||
namespace MECF.Framework.Simulator.Core.LoadPorts
|
||||
{
|
||||
public class WaferItem
|
||||
{
|
||||
public int Index { get; set; }
|
||||
|
||||
public string Display { get; set; }
|
||||
|
||||
public int State { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// TDKLoadPort.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TDKLoadPortView : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty PortNameProperty = DependencyProperty.Register(
|
||||
"PortName", typeof(string), typeof(TDKLoadPortView),
|
||||
new FrameworkPropertyMetadata("COM1", FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public string PortName
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)this.GetValue(PortNameProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue(PortNameProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty PortNumberProperty = DependencyProperty.Register(
|
||||
"PortNumber", typeof(int), typeof(TDKLoadPortView),
|
||||
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public int PortNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this.GetValue(PortNumberProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue(PortNumberProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
public TDKLoadPortView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.Loaded += OnViewLoaded;
|
||||
}
|
||||
|
||||
private void OnViewLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext == null)
|
||||
{
|
||||
DataContext = new TDKLoadPortViewModel(PortName, PortNumber);
|
||||
(DataContext as TimerViewModelBase).Start();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class TDKLoadPortViewModel : SerialPortDeviceViewModel
|
||||
{
|
||||
public string Title
|
||||
{
|
||||
get { return "TDK LoadPort Simulator"; }
|
||||
}
|
||||
|
||||
public string WaferMap
|
||||
{
|
||||
get { return _sim.SlotMap; }
|
||||
}
|
||||
|
||||
public string InfoPadStatus
|
||||
{
|
||||
get { return _sim.InforPadState; }
|
||||
|
||||
}
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public string InfoPadSet { get; set; }
|
||||
|
||||
public ObservableCollection<WaferItem> WaferList { get; set; }
|
||||
|
||||
public ICommand PlaceCommand { get; set; }
|
||||
public ICommand RemoveCommand { get; set; }
|
||||
|
||||
public ICommand ClearCommand { get; set; }
|
||||
public ICommand SetAllCommand { get; set; }
|
||||
public ICommand RandomCommand { get; set; }
|
||||
|
||||
public ICommand SetInfoPadCommand { get; set; }
|
||||
|
||||
private TDKLoadPortSimulator _sim;
|
||||
|
||||
|
||||
public TDKLoadPortViewModel(string port, int index) : base("TDKLoadPortViewModel")
|
||||
{
|
||||
PlaceCommand = new DelegateCommand<string>(Place);
|
||||
RemoveCommand = new DelegateCommand<string>(Remove);
|
||||
|
||||
ClearCommand = new DelegateCommand<string>(Clear);
|
||||
SetAllCommand = new DelegateCommand<string>(SetAll);
|
||||
RandomCommand = new DelegateCommand<string>(RandomGenerateWafer);
|
||||
SetInfoPadCommand = new DelegateCommand<string>(SetInfoPadStatus);
|
||||
|
||||
_sim = new TDKLoadPortSimulator(port);
|
||||
Init(_sim);
|
||||
|
||||
|
||||
WaferList = new ObservableCollection<WaferItem>()
|
||||
{
|
||||
new WaferItem {Display = "1", Index = 2, State = 3}
|
||||
};
|
||||
|
||||
if (index == 1)
|
||||
_sim.SetUpWafer();
|
||||
else
|
||||
{
|
||||
_sim.SetLowWafer();
|
||||
}
|
||||
|
||||
}
|
||||
private void SetInfoPadStatus(string obj)
|
||||
{
|
||||
_sim.InforPadState = InfoPadSet;
|
||||
}
|
||||
|
||||
private void RandomGenerateWafer(string obj)
|
||||
{
|
||||
_sim.RandomWafer();
|
||||
}
|
||||
|
||||
private void SetAll(string obj)
|
||||
{
|
||||
_sim.SetAllWafer();
|
||||
}
|
||||
|
||||
private void Clear(string obj)
|
||||
{
|
||||
_sim.ClearWafer();
|
||||
}
|
||||
|
||||
private void Remove(string obj)
|
||||
{
|
||||
_sim.RemoveCarrier();
|
||||
}
|
||||
|
||||
private void Place(string obj)
|
||||
{
|
||||
_sim.PlaceCarrier();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user