using System; using System.Collections.Generic; using System.Linq; using System.Text; using Aitex.Sorter.Common; using MECF.Framework.Common.Equipment; namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot.SR100 { public class ProtocolTag { public const string tag_end = "\r"; public const string tag_cmd_start = "$"; public const string cmd_token = ","; public const string resp_tag_normal = "$"; public const string resp_tag_error = "?"; public const string resp_tag_excute = "!"; public const string resp_tag_event = ">"; public const string resp_evt_error = "100"; } public class RobotConvertor { public static string chamber2staion(ModuleName chamber) { string st = ""; switch (chamber) { case ModuleName.LP1: st = "C01"; break; case ModuleName.LP2: st = "C02"; break; case ModuleName.LP3: st = "C03"; break; case ModuleName.LP4: st = "C04"; break; case ModuleName.LP5: st = "C05"; break; case ModuleName.LP6: st = "C06"; break; case ModuleName.LP7: st = "C07"; break; case ModuleName.LP8: st = "C08"; break; case ModuleName.Aligner: st = "P01"; break; } return st; } public static string chamberSlot2Slot(ModuleName chamber, int slot) { string sslot = ""; switch (chamber) { case ModuleName.LP1: case ModuleName.LP2: case ModuleName.LP3: case ModuleName.LP4: case ModuleName.LP5: case ModuleName.LP6: case ModuleName.LP7: case ModuleName.LP8: case ModuleName.LP9: case ModuleName.LP10: sslot = string.Format("{0:D2}", slot + 1); break; case ModuleName.Aligner: sslot = "00"; break; } return sslot; } public static string hand2string(Hand hand) { string st = ""; switch (hand) { case Hand.Blade1: st = "1"; break; case Hand.Blade2: st = "2"; break; case Hand.Both: st = "F"; break; } return st; } public static string IsPick2Position(bool isPick) { var pos = isPick ? "P1" : "G1"; return pos; } public static string Offset2String(int offset) { string st = ""; if (offset >= 0) { st = string.Format("{0:D8}", offset); } else { st = string.Format("{0:D7}", offset); } return st; } } }