1.SunwayRobot Map功能完善
This commit is contained in:
parent
b26310b608
commit
b804306bbb
|
@ -75,11 +75,7 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Sunway
|
|||
RobotMap(args);
|
||||
return true;
|
||||
});
|
||||
OP.Subscribe($"{Module}.RSR", (string cmd, object[] args) =>
|
||||
{
|
||||
RobotRsr();
|
||||
return true;
|
||||
});
|
||||
|
||||
OP.Subscribe($"{Module}.HOME", (string cmd, object[] args) =>
|
||||
{
|
||||
RobotHome();
|
||||
|
@ -622,27 +618,33 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Sunway
|
|||
|
||||
public virtual void SetWaferData(string data)
|
||||
{
|
||||
//0:未扫片 1:有 2:没有 3:斜放 4:两片 5:薄片
|
||||
//0:无片 1:单片 2:叠片 3:跨槽 ?:未知
|
||||
string errorMessage = "";
|
||||
int waferCount = 1;
|
||||
int count = 1;
|
||||
if (CurrentInteractModule == ModuleName.CassAL || CurrentInteractModule == ModuleName.CassAR)
|
||||
{
|
||||
waferCount = 25;
|
||||
count = 25;
|
||||
}
|
||||
|
||||
if (data.Length == 25)//Wafer Cassette
|
||||
if (CurrentInteractModule == ModuleName.CassBL)
|
||||
{
|
||||
for (int i = 0; i < waferCount; i++)
|
||||
count = 8;
|
||||
}
|
||||
|
||||
if (data.Length == 53)//Wafer Cassette
|
||||
{
|
||||
data = data.Replace("MAP", "").Trim().Replace(" ", "");
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
string waferStatue = data.Substring(i, 1);
|
||||
if (waferStatue == "1")
|
||||
{
|
||||
if (!WaferManager.Instance.CheckHasWafer(CurrentInteractModule, i))
|
||||
{
|
||||
WaferManager.Instance.CreateWafer(CurrentInteractModule, i, Aitex.Core.Common.WaferStatus.Normal);
|
||||
WaferManager.Instance.CreateWafer(CurrentInteractModule, i, WaferStatus.Normal);
|
||||
}
|
||||
}
|
||||
else if (waferStatue == "0" || waferStatue == "X")
|
||||
else if (waferStatue == "0" || waferStatue == "?")
|
||||
{
|
||||
if (WaferManager.Instance.CheckHasWafer(CurrentInteractModule, i))
|
||||
{
|
||||
|
@ -663,6 +665,41 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Sunway
|
|||
errorMessage += $"slot {i + 1} has {msg}!" + "\r\n";
|
||||
}
|
||||
}
|
||||
} //Wafer Cassette
|
||||
else if (data.Length == 19)//Tray Cassette
|
||||
{
|
||||
data = data.Replace("MAP", "").Trim().Replace(" ", "");
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
string tryaStatue = data.Substring(i, 1);
|
||||
if (tryaStatue == "1")
|
||||
{
|
||||
if (!WaferManager.Instance.CheckHasWafer(CurrentInteractModule, i))
|
||||
{
|
||||
WaferManager.Instance.CreateWafer(CurrentInteractModule, i, WaferStatus.Normal);
|
||||
}
|
||||
}
|
||||
else if (tryaStatue == "0" || tryaStatue == "?")
|
||||
{
|
||||
if (WaferManager.Instance.CheckHasWafer(CurrentInteractModule, i))
|
||||
{
|
||||
WaferManager.Instance.DeleteWafer(CurrentInteractModule, i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string msg = "";
|
||||
if (!WaferManager.Instance.CheckHasWafer(CurrentInteractModule, i))
|
||||
{
|
||||
WaferManager.Instance.CreateWafer(CurrentInteractModule, i, GetWaferStarusByNum(tryaStatue, out msg));
|
||||
}
|
||||
else
|
||||
{
|
||||
WaferManager.Instance.GetWafer(CurrentInteractModule, i).WaferStatus = GetWaferStarusByNum(tryaStatue, out msg);// Aitex.Core.Common.WaferStatus.Crossed;
|
||||
}
|
||||
errorMessage += $"slot {i + 1} has {msg}!" + "\r\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (data.Length <=10)
|
||||
{
|
||||
|
@ -698,25 +735,23 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Sunway
|
|||
}
|
||||
}
|
||||
|
||||
private Aitex.Core.Common.WaferStatus GetWaferStarusByNum(string num, out string msg)
|
||||
//0:无片 1:单片 2:叠片 3:跨槽 ?:未知
|
||||
private WaferStatus GetWaferStarusByNum(string num, out string msg)
|
||||
{
|
||||
switch (num)
|
||||
{
|
||||
case "2":
|
||||
msg = "crossed wafer";
|
||||
return Aitex.Core.Common.WaferStatus.Crossed;
|
||||
return WaferStatus.Crossed;
|
||||
case "3":
|
||||
msg = "double wafer";
|
||||
return Aitex.Core.Common.WaferStatus.Double;
|
||||
case "4":
|
||||
return WaferStatus.Double;
|
||||
case "?":
|
||||
msg = "thin wafer";
|
||||
return Aitex.Core.Common.WaferStatus.Double;
|
||||
case "5":
|
||||
msg = "flimsy wafer";
|
||||
return Aitex.Core.Common.WaferStatus.Double;
|
||||
return WaferStatus.Double;
|
||||
default:
|
||||
msg = "wafer";
|
||||
return Aitex.Core.Common.WaferStatus.Crossed;
|
||||
return WaferStatus.Crossed;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -747,20 +782,12 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Sunway
|
|||
}
|
||||
}
|
||||
|
||||
public virtual void RobotRsr()
|
||||
{
|
||||
_lstHandler.Clear();
|
||||
lock (_locker)
|
||||
{
|
||||
_lstHandler.AddLast(new SunwayRobotRSRHandler(this));
|
||||
}
|
||||
}
|
||||
|
||||
public void RobotMap(object[] args)
|
||||
{
|
||||
lock (_locker)
|
||||
{
|
||||
_lstHandler.Clear();
|
||||
_lstHandler.AddLast(new SunwayRobotGotoMapHandler(this, args[0].ToString(),false));
|
||||
CheckStateThenDo(() => { _lstHandler.AddLast(new SunwayRobotMapHandler(this, args[0].ToString())); });
|
||||
}
|
||||
}
|
||||
|
@ -976,9 +1003,10 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Sunway
|
|||
{
|
||||
lock (_locker)
|
||||
{
|
||||
_lstHandler.AddLast(new SunwayRobotGotoMapHandler(this, param[0].ToString(), false));
|
||||
_lstHandler.AddLast(new SunwayRobotMapHandler(this, param[0].ToString(), _scMotionTimeout.IntValue));
|
||||
_lstHandler.AddLast(new SunwayRobotRSRHandler(this, _scMotionTimeout.IntValue));
|
||||
_lstHandler.AddLast(new SunwayRobotHomeHandler(this, _scMotionTimeout.IntValue));
|
||||
_lstHandler.AddLast(new SunwayRobotRSRHandler(this, param[0].ToString(), _scMotionTimeout.IntValue));
|
||||
_lstHandler.AddLast(new SunwayRobotGotoMapHandler(this, param[0].ToString(), true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,8 +165,8 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Sunway
|
|||
public class SunwayRobotGotoMapHandler : SunwayRobotHandler
|
||||
{
|
||||
//GOTO N station [MAP (EX|RE)] [[RX] R1|R2|R3]
|
||||
public SunwayRobotGotoMapHandler(SunwayRobot device, ModuleName module, bool isRetract,int timeout = 60)
|
||||
: base(device, "GOTO", $"N {device.ModuleAssociateStationDic[module.ToString()]} MAP {(isRetract ? "RE" : "EX")}")
|
||||
public SunwayRobotGotoMapHandler(SunwayRobot device, string module, bool isRetract,int timeout = 60)
|
||||
: base(device, "GOTO", $"N {device.ModuleAssociateStationDic[module]} MAP {(isRetract ? "RE" : "EX")}")
|
||||
{
|
||||
AckTimeout = TimeSpan.FromSeconds(timeout);
|
||||
CompleteTimeout = TimeSpan.FromSeconds(timeout);
|
||||
|
@ -214,10 +214,105 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Sunway
|
|||
}
|
||||
}
|
||||
|
||||
public class RobotSiasunPhoenixBGotoHandler : RobotSiasunPhoenixBHandler
|
||||
public class SunwayRobotMapHandler : SunwayRobotHandler
|
||||
{
|
||||
//MAP station
|
||||
public SunwayRobotMapHandler(SunwayRobot device, string module, int timeout = 60)
|
||||
: base(device, $"MAP {device.ModuleAssociateStationDic[module]}")
|
||||
{
|
||||
AckTimeout = TimeSpan.FromSeconds(timeout);
|
||||
CompleteTimeout = TimeSpan.FromSeconds(timeout);
|
||||
|
||||
device.MoveInfo = new RobotMoveInfo()
|
||||
{
|
||||
Action = RobotAction.Moving,
|
||||
ArmTarget = RobotArm.Both,
|
||||
BladeTarget = "ArmA.System",
|
||||
};
|
||||
}
|
||||
|
||||
public override bool HandleMessage(MessageBase msg, out bool handled)
|
||||
{
|
||||
var result = msg as SunwayRobotMessage;
|
||||
handled = false;
|
||||
if (!result.IsResponse)
|
||||
{
|
||||
Device.NoteError("Robot Goto Map Timeout");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (result.Data == "_RDY")
|
||||
{
|
||||
Device.IsBusy = false;
|
||||
}
|
||||
else if (result.Data.Contains("ERR"))
|
||||
{
|
||||
Device.NoteError("Robot Goto Map Response Error");
|
||||
return false;
|
||||
}
|
||||
|
||||
Device.MoveInfo = new RobotMoveInfo()
|
||||
{
|
||||
Action = RobotAction.Moving,
|
||||
ArmTarget = RobotArm.ArmA,
|
||||
BladeTarget = ModuleName.System.ToString(),
|
||||
};
|
||||
|
||||
ResponseMessage = msg;
|
||||
handled = true;
|
||||
_onHandlerEndTask?.Invoke();
|
||||
Device.NoteActionCompleted();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class SunwayRobotRSRHandler : SunwayRobotHandler
|
||||
{
|
||||
//RSR station
|
||||
public SunwayRobotRSRHandler(SunwayRobot device, string module, int timeout = 60)
|
||||
: base(device, $"RSR {device.ModuleAssociateStationDic[module]}")
|
||||
{
|
||||
AckTimeout = TimeSpan.FromSeconds(timeout);
|
||||
CompleteTimeout = TimeSpan.FromSeconds(timeout);
|
||||
}
|
||||
|
||||
public override bool HandleMessage(MessageBase msg, out bool handled)
|
||||
{
|
||||
var result = msg as SunwayRobotMessage;
|
||||
handled = false;
|
||||
if (!result.IsResponse)
|
||||
{
|
||||
Device.NoteError("Robot RSR Timeout");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (result.Data.Length == 53 || result.Data.Length == 19)
|
||||
{
|
||||
Device.SetWaferData(result.Data);
|
||||
}
|
||||
else if (result.Data.Contains("ERR"))
|
||||
{
|
||||
Device.NoteError("Robot RSR Response Error");
|
||||
return false;
|
||||
}
|
||||
|
||||
Device.MoveInfo = new RobotMoveInfo()
|
||||
{
|
||||
Action = RobotAction.Moving,
|
||||
ArmTarget = RobotArm.ArmA,
|
||||
BladeTarget = ModuleName.System.ToString(),
|
||||
};
|
||||
ResponseMessage = msg;
|
||||
Device.NoteActionCompleted();
|
||||
handled = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class SunwayRobotGotoHandler : SunwayRobotHandler
|
||||
{
|
||||
//GOTO N station [R (EX|RE)] [Z (UP|DN)] [SLOT num] [[ARM] arm]
|
||||
public RobotSiasunPhoenixBGotoHandler(RobotSiasunPhoenixB device, ModuleName module, int slot, RobotArmEnum blade,
|
||||
public SunwayRobotGotoHandler(SunwayRobot device, ModuleName module, int slot, RobotArmEnum blade,
|
||||
bool isRetract = true, bool isZaxisDown = true, int timeout = 60)
|
||||
: base(device, "GOTO", $"N {device.ModuleAssociateStationDic[module.ToString()]} R {(isRetract ? "RE" : "EX")}" +
|
||||
$" Z {(isZaxisDown ? "DN" : "UP")} SLOT {slot} ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")}")
|
||||
|
@ -256,54 +351,6 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Sunway
|
|||
|
||||
}
|
||||
|
||||
public class SunwayRobotMapHandler : SunwayRobotHandler
|
||||
{
|
||||
//MAP [module]
|
||||
public SunwayRobotMapHandler(SunwayRobot device, string module, int timeout = 60)
|
||||
: base(device, $"MAP {device.ModuleAssociateStationDic[module]}")
|
||||
{
|
||||
AckTimeout = TimeSpan.FromSeconds(timeout);
|
||||
CompleteTimeout = TimeSpan.FromSeconds(timeout);
|
||||
|
||||
device.MoveInfo = new RobotMoveInfo()
|
||||
{
|
||||
Action = RobotAction.Picking,
|
||||
ArmTarget = RobotArm.ArmA,
|
||||
BladeTarget = module,
|
||||
};
|
||||
}
|
||||
|
||||
public override bool HandleMessage(MessageBase msg, out bool handled)
|
||||
{
|
||||
var result = msg as SunwayRobotMessage;
|
||||
handled = false;
|
||||
if (!result.IsResponse)
|
||||
{
|
||||
Device.NoteError("Robot MAP Timeout");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (result.Data == "_RDY")
|
||||
{
|
||||
|
||||
}
|
||||
else if (result.Data.Contains("ERR"))
|
||||
{
|
||||
Device.NoteError("Robot MAP Response Error");
|
||||
return false;
|
||||
}
|
||||
Device.MoveInfo = new RobotMoveInfo()
|
||||
{
|
||||
Action = RobotAction.Moving,
|
||||
ArmTarget = RobotArm.ArmA,
|
||||
BladeTarget = ModuleName.System.ToString(),
|
||||
};
|
||||
ResponseMessage = msg;
|
||||
handled = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class SunwayRobotSTATHandler : SunwayRobotHandler
|
||||
{
|
||||
|
@ -856,8 +903,6 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Sunway
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class SunwayRobotINPUTHandler : SunwayRobotHandler
|
||||
{
|
||||
// INPUT A 3
|
||||
|
@ -1089,49 +1134,6 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Sunway
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class SunwayRobotRSRHandler : SunwayRobotHandler
|
||||
{
|
||||
//RSR
|
||||
public SunwayRobotRSRHandler(SunwayRobot device, int timeout = 60)
|
||||
: base(device, $"RSR")
|
||||
{
|
||||
AckTimeout = TimeSpan.FromSeconds(timeout);
|
||||
CompleteTimeout = TimeSpan.FromSeconds(timeout);
|
||||
}
|
||||
|
||||
public override bool HandleMessage(MessageBase msg, out bool handled)
|
||||
{
|
||||
var result = msg as SunwayRobotMessage;
|
||||
handled = false;
|
||||
if (!result.IsResponse)
|
||||
{
|
||||
Device.NoteError("Robot RSR Timeout");
|
||||
return true;
|
||||
}
|
||||
if (result.Data.Length == 25)
|
||||
{
|
||||
Device.SetWaferData(result.Data);
|
||||
}
|
||||
else if (result.Data.Contains("ERR"))
|
||||
{
|
||||
Device.NoteError("Robot RSR Response Error");
|
||||
return false;
|
||||
}
|
||||
Device.MoveInfo = new RobotMoveInfo()
|
||||
{
|
||||
Action = RobotAction.Moving,
|
||||
ArmTarget = RobotArm.ArmA,
|
||||
BladeTarget = ModuleName.System.ToString(),
|
||||
};
|
||||
ResponseMessage = msg;
|
||||
Device.NoteActionCompleted();
|
||||
handled = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class SunwayRobotBRSRHandler : SunwayRobotHandler
|
||||
{
|
||||
//RSR
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MECF.Framework.Simulator.Core.SubstrateTrackings;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Simulator.Core.SubstrateTrackings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
|
@ -18,6 +19,8 @@ namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
|||
INPUT,
|
||||
STAT,
|
||||
RQ,
|
||||
RSRWafer,
|
||||
RSRTray
|
||||
}
|
||||
|
||||
protected Random _rd = new Random();
|
||||
|
@ -33,8 +36,8 @@ namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
|||
|
||||
private static string msgDone = "_RDY";
|
||||
private static string msgError = "_ERR";
|
||||
private static string msgRSRCassA = "0022133000011111111211541"; //cd
|
||||
private static string msgRSRCassB = "1111111111111"; //f
|
||||
private static string msgRSRCassA = "MAP 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 ?";
|
||||
private static string msgRSRCassB = "MAP 1 2 3 0 1 2 3 0";
|
||||
private static string msgRSR = "1";
|
||||
|
||||
private string lastMsg = "";
|
||||
|
@ -45,14 +48,16 @@ namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
|||
|
||||
public string CassetteResult { get; set; }
|
||||
|
||||
Dictionary<int, string> ModuleAssociateStationDic;
|
||||
|
||||
public SunwayRobotSimulator() : base(1103, 0, "\r\n", ' ', 5)
|
||||
|
||||
public SunwayRobotSimulator(int port) : base(port, 0, "\r\n", ' ', 5)
|
||||
{
|
||||
AddCommandHandler("HOME", HandleHome);
|
||||
AddCommandHandler("RQ", HandleRQLoad);
|
||||
AddCommandHandler("GOTO", HandleHome);
|
||||
|
||||
AddCommandHandler("MAP", HandleMap);
|
||||
AddCommandHandler("RSR", HandleRSR);
|
||||
|
||||
AddCommandHandler("SVON", HandleHome);
|
||||
|
||||
|
@ -66,6 +71,21 @@ namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
|||
|
||||
ErrorCode = "0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000";
|
||||
|
||||
ModuleAssociateStationDic = new Dictionary<int, string>()
|
||||
{
|
||||
{1,$"{ModuleName.PM1 }"},
|
||||
{2,$"{ModuleName.PM2}" },
|
||||
{3,$"{ModuleName.Buffer}1"},
|
||||
{4,$"{ModuleName.Buffer}2"},
|
||||
{5,$"{ModuleName.Buffer}3"},
|
||||
{6,$"{ModuleName.LoadLock}"},
|
||||
{7,$"{ModuleName.UnLoad}"},
|
||||
{8,$"{ModuleName.Aligner}"},
|
||||
{9,$"{ModuleName.CassAL}"},
|
||||
{10,$"{ModuleName.CassAR}"},
|
||||
{12,$"{ModuleName.CassBL}"},
|
||||
};
|
||||
|
||||
timer = new System.Timers.Timer();
|
||||
timer.Enabled = false;
|
||||
timer.AutoReset = false;
|
||||
|
@ -123,7 +143,17 @@ namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
|||
}
|
||||
internal void HandleRSR(string msg)
|
||||
{
|
||||
operateEnum = OperateEnum.RSR;
|
||||
int cassette = int.Parse(msg.Replace("RSR", "").Trim());
|
||||
|
||||
if (ModuleAssociateStationDic[cassette] == ModuleName.CassAL.ToString() || ModuleAssociateStationDic[cassette] == ModuleName.CassAR.ToString())
|
||||
{
|
||||
operateEnum = OperateEnum.RSRWafer;
|
||||
}
|
||||
else
|
||||
{
|
||||
operateEnum = OperateEnum.RSRTray;
|
||||
}
|
||||
|
||||
HandleRSR(RobotStateEnum.RSR, new string[] { "" });
|
||||
}
|
||||
internal void HandleSTAT(string msg)
|
||||
|
@ -146,7 +176,6 @@ namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
double delay = 1;
|
||||
timer.Interval = delay * 1000;
|
||||
timer.Enabled = true;
|
||||
|
@ -262,10 +291,14 @@ namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
|||
{
|
||||
OnWriteMessage("19568");
|
||||
}
|
||||
else if (operateEnum == OperateEnum.RSR)
|
||||
else if (operateEnum == OperateEnum.RSRWafer)
|
||||
{
|
||||
OnWriteMessage(msgRSRCassA);
|
||||
}
|
||||
else if (operateEnum == OperateEnum.RSRTray)
|
||||
{
|
||||
OnWriteMessage(msgRSRCassB);
|
||||
}
|
||||
else if (operateEnum == OperateEnum.INPUT)
|
||||
{
|
||||
OnWriteMessage("1");
|
||||
|
@ -275,8 +308,5 @@ namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
|||
OnWriteMessage(msgDone);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<UserControl
|
||||
x:Class="MECF.Framework.Simulator.Core.Robots.Sunway.SunwayRobotView"
|
||||
x:Class="MECF.Framework.Simulator.Core.Robots.Sunway.SunwayTrayRobotView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:commons="clr-namespace:MECF.Framework.Simulator.Core.Commons"
|
|
@ -19,14 +19,14 @@ using System.Windows.Shapes;
|
|||
namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
||||
{
|
||||
/// <summary>
|
||||
/// SunwayRobotView.xaml 的交互逻辑
|
||||
/// SunwayTrayRobotView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SunwayRobotView : UserControl
|
||||
public partial class SunwayTrayRobotView : UserControl
|
||||
{
|
||||
public SunwayRobotView()
|
||||
public SunwayTrayRobotView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new SunwayRobotViewModel();
|
||||
this.DataContext = new SunwayTrayRobotViewModel();
|
||||
|
||||
this.Loaded += OnViewLoaded;
|
||||
}
|
||||
|
@ -37,9 +37,9 @@ namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
|||
}
|
||||
}
|
||||
|
||||
class SunwayRobotViewModel : SocketDeviceViewModel
|
||||
class SunwayTrayRobotViewModel : SocketDeviceViewModel
|
||||
{
|
||||
public string Title => "Sunway Robot Simulator";
|
||||
public string Title => "Sunway Tray Robot Simulator";
|
||||
|
||||
private SunwayRobotSimulator _robot;
|
||||
public bool IsError
|
||||
|
@ -87,11 +87,12 @@ namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
|||
get => _robot.EventCode;
|
||||
set => _robot.EventCode = value;
|
||||
}
|
||||
public SunwayRobotViewModel() : base("SunwayRobotViewModel")
|
||||
public SunwayTrayRobotViewModel() : base("SunwayRobotViewModel")
|
||||
{
|
||||
_robot = new SunwayRobotSimulator();
|
||||
_robot = new SunwayRobotSimulator(1104);
|
||||
Init(_robot);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
<UserControl
|
||||
x:Class="MECF.Framework.Simulator.Core.Robots.Sunway.SunwayWaferRobotView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:commons="clr-namespace:MECF.Framework.Simulator.Core.Commons"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MECF.Framework.Simulator.Core.Robots.Sunway"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Width="900"
|
||||
Height="900"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="100" />
|
||||
<RowDefinition Height="150" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="400" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<commons:SocketTitleView Grid.Row="0" />
|
||||
|
||||
<Canvas Grid.Row="1" Width="900">
|
||||
<CheckBox
|
||||
Canvas.Left="36"
|
||||
Canvas.Top="73"
|
||||
Content="Error"
|
||||
IsChecked="{Binding IsError}" />
|
||||
<TextBlock
|
||||
Canvas.Left="204"
|
||||
Canvas.Top="52"
|
||||
Text="_ERR {Code}" />
|
||||
<TextBlock
|
||||
Canvas.Left="99"
|
||||
Canvas.Top="72"
|
||||
Text="Error Code:" />
|
||||
<!--<TextBox Text="{Binding ResultValue, UpdateSourceTrigger=PropertyChanged }" Canvas.Left="358" Canvas.Top="31" Margin="0" Width="284"></TextBox>
|
||||
<TextBlock Text="Error:" Canvas.Left="310" Canvas.Top="45"></TextBlock>-->
|
||||
|
||||
<TextBox
|
||||
Canvas.Left="203"
|
||||
Canvas.Top="70"
|
||||
Width="369"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding ErrorCode, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<TextBlock
|
||||
Canvas.Left="204"
|
||||
Canvas.Top="10"
|
||||
Text="_STA {Code}" />
|
||||
<TextBlock
|
||||
Canvas.Left="99"
|
||||
Canvas.Top="30"
|
||||
Text="State Code:" />
|
||||
<TextBox
|
||||
Canvas.Left="203"
|
||||
Canvas.Top="28"
|
||||
Width="74"
|
||||
Margin="0"
|
||||
IsReadOnly="False"
|
||||
Text="{Binding StateCode, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<CheckBox
|
||||
Canvas.Left="36"
|
||||
Canvas.Top="110"
|
||||
Content="Event"
|
||||
IsChecked="{Binding EventChecked}" />
|
||||
|
||||
<TextBlock
|
||||
Canvas.Left="204"
|
||||
Canvas.Top="91"
|
||||
Text="_Event {Code}" />
|
||||
<TextBlock
|
||||
Canvas.Left="99"
|
||||
Canvas.Top="110"
|
||||
Text="Event Code:" />
|
||||
|
||||
|
||||
<TextBox
|
||||
Canvas.Left="203"
|
||||
Canvas.Top="107"
|
||||
Width="550"
|
||||
Margin="0"
|
||||
IsReadOnly="False"
|
||||
Text="{Binding EventCode, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
</Canvas>
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Width="900"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Width="100"
|
||||
Height="35"
|
||||
Command="{Binding ClearLogCommand}"
|
||||
Content="Clear Log" />
|
||||
<Label
|
||||
Width="150"
|
||||
Height="35"
|
||||
Padding="5,5"
|
||||
Background="White"
|
||||
Content="CassetteResult" />
|
||||
<TextBox
|
||||
Name="textBoxResult"
|
||||
Width="500"
|
||||
Height="35"
|
||||
Padding="5,5"
|
||||
Background="White"
|
||||
Text="{Binding CassetteResult}"
|
||||
TextAlignment="Center" />
|
||||
<Button
|
||||
Width="100"
|
||||
Height="35"
|
||||
Command="{Binding SetResult}"
|
||||
Content="Set Result" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<DataGrid
|
||||
Grid.Row="3"
|
||||
Width="900"
|
||||
Height="380"
|
||||
VerticalAlignment="Top"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
CanUserResizeRows="False"
|
||||
CanUserSortColumns="False"
|
||||
FontSize="16"
|
||||
ItemsSource="{Binding TransactionLogItems}"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTextColumn
|
||||
Width="160"
|
||||
Binding="{Binding OccurTime, UpdateSourceTrigger=PropertyChanged}"
|
||||
Header="Time"
|
||||
IsReadOnly="True" />
|
||||
|
||||
<DataGridTextColumn
|
||||
Width="350"
|
||||
Binding="{Binding Incoming, UpdateSourceTrigger=PropertyChanged}"
|
||||
Header="Incoming"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="Height" Value="auto" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
|
||||
<DataGridTextColumn
|
||||
Width="350"
|
||||
Binding="{Binding Outgoing, UpdateSourceTrigger=PropertyChanged}"
|
||||
Header="Outgoing"
|
||||
IsReadOnly="True">
|
||||
<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,96 @@
|
|||
using Aitex.Core.UI.MVVM;
|
||||
using Aitex.Core.Utilities;
|
||||
using MECF.Framework.Simulator.Core.Commons;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
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;
|
||||
|
||||
namespace MECF.Framework.Simulator.Core.Robots.Sunway
|
||||
{
|
||||
/// <summary>
|
||||
/// SunwayWaferRobotView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SunwayWaferRobotView : UserControl
|
||||
{
|
||||
public SunwayWaferRobotView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new SunwayWaferRobotViewModel();
|
||||
|
||||
this.Loaded += OnViewLoaded;
|
||||
}
|
||||
|
||||
private void OnViewLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(DataContext as TimerViewModelBase).Start();
|
||||
}
|
||||
}
|
||||
|
||||
class SunwayWaferRobotViewModel : SocketDeviceViewModel
|
||||
{
|
||||
public string Title => "Sunway Wafer Robot Simulator";
|
||||
|
||||
private SunwayRobotSimulator _robot;
|
||||
public bool IsError
|
||||
{
|
||||
get => _robot.IsError;
|
||||
set => _robot.IsError = value;
|
||||
}
|
||||
|
||||
|
||||
//private string _value;
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public string ErrorCode
|
||||
{
|
||||
get => _robot.ErrorCode;
|
||||
|
||||
set => _robot.ErrorCode = value;
|
||||
}
|
||||
public bool StateChecked
|
||||
{
|
||||
get => _robot.StateChecked;
|
||||
set => _robot.StateChecked = value;
|
||||
}
|
||||
|
||||
public int StateCode
|
||||
{
|
||||
get => _robot.StateCode;
|
||||
set => _robot.StateCode = value;
|
||||
}
|
||||
public bool EventChecked
|
||||
{
|
||||
get => _robot.EventChecked;
|
||||
|
||||
set
|
||||
{
|
||||
_robot.EventChecked = value;
|
||||
if (value) EventCode = "_EVENT ROBOR 02610 0003 B -00028 000028 000028 -00002\r";
|
||||
else EventCode = null;
|
||||
}
|
||||
}
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public string EventCode
|
||||
{
|
||||
get => _robot.EventCode;
|
||||
set => _robot.EventCode = value;
|
||||
}
|
||||
public SunwayWaferRobotViewModel() : base("SunwayRobotViewModel")
|
||||
{
|
||||
_robot = new SunwayRobotSimulator(1103);
|
||||
Init(_robot);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -233,8 +233,11 @@
|
|||
<DependentUpon>JelRobot5000_2View.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Robots\Sunway\SunwayRobotSimulator.cs" />
|
||||
<Compile Include="Robots\Sunway\SunwayRobotView.xaml.cs">
|
||||
<DependentUpon>SunwayRobotView.xaml</DependentUpon>
|
||||
<Compile Include="Robots\Sunway\SunwayWaferRobotView.xaml.cs">
|
||||
<DependentUpon>SunwayWaferRobotView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Robots\Sunway\SunwayTrayRobotView.xaml.cs">
|
||||
<DependentUpon>SunwayTrayRobotView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Robots\TrayRobot\TrayRobotSimulator.cs" />
|
||||
<Compile Include="Robots\TrayRobot\TrayRobotView.xaml.cs">
|
||||
|
@ -480,7 +483,11 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Robots\Sunway\SunwayRobotView.xaml">
|
||||
<Page Include="Robots\Sunway\SunwayWaferRobotView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Robots\Sunway\SunwayTrayRobotView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
@ -590,7 +597,7 @@
|
|||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties robots_4hiratar4_4iosimulatoritems_1json__JsonSchema="https://jenkins-x.io/schemas/jx-schema.json" vce_4brooksvce_4iosimulatoritems_1json__JsonSchema="http://json.schemastore.org/apibuilder.json" />
|
||||
<UserProperties vce_4brooksvce_4iosimulatoritems_1json__JsonSchema="http://json.schemastore.org/apibuilder.json" robots_4hiratar4_4iosimulatoritems_1json__JsonSchema="https://jenkins-x.io/schemas/jx-schema.json" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
Loading…
Reference in New Issue