| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 | 
							- 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.NX100
 
- {
 
-     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 = "C1";
 
-                     break;
 
-                 case ModuleName.LP2:
 
-                     st = "C2";
 
-                     break;
 
-                 case ModuleName.LP3:
 
-                     st = "C3";
 
-                     break;
 
-                 case ModuleName.LP4:
 
-                     st = "C4";
 
-                     break;
 
-                 case ModuleName.LP5:
 
-                     st = "C5";
 
-                     break;
 
-                 case ModuleName.LP6:
 
-                     st = "C6";
 
-                     break;
 
-                 case ModuleName.LP7:
 
-                     st = "C7";
 
-                     break;
 
-                 case ModuleName.LP8:
 
-                     st = "C8";
 
-                     break;
 
-                 case ModuleName.LP9:
 
-                     st = "C9";
 
-                     break;
 
-                 case ModuleName.LP10:
 
-                     st = "CA";
 
-                     break;
 
-                 case ModuleName.Aligner:
 
-                     st = "P1";
 
-                     break;
 
-                 case ModuleName.PM1:
 
-                 case ModuleName.PMA:
 
-                     st = "S1";
 
-                     break;
 
-                 case ModuleName.PM2:
 
-                 case ModuleName.PMB:
 
-                     st = "S2";
 
-                     break;
 
-                 case ModuleName.PM3:
 
-                      st = "S3";
 
-                     break;
 
-                 case ModuleName.PM4:
 
-                      st = "S4";
 
-                     break;
 
-                 case ModuleName.PM5:
 
-                      st = "S5";
 
-                     break;
 
-                 case ModuleName.PM6:
 
-                      st = "S6";
 
-                     break;
 
-                 case ModuleName.PM7:
 
-                      st = "S7";
 
-                     break;
 
-                 case ModuleName.PM8:
 
-                      st = "S8";
 
-                     break;
 
-                 case ModuleName.LL1:
 
-                     st = "S9";
 
-                     break;
 
-                 case ModuleName.LL2:
 
-                     st = "SA";
 
-                     break;
 
-                 case ModuleName.LL3:
 
-                     st = "SB";
 
-                     break;
 
-                 case ModuleName.LL4:
 
-                     st = "SC";
 
-                     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:
 
-                     sslot = string.Format("{0:D2}", slot + 1);
 
-                     break;
 
-                 case ModuleName.Aligner:
 
-                 case ModuleName.Robot:
 
-                 case ModuleName.PM1:
 
-                 case ModuleName.PM2:
 
-                 case ModuleName.PM3:
 
-                 case ModuleName.PM4:
 
-                 case ModuleName.PM5:
 
-                 case ModuleName.PM6:
 
-                 case ModuleName.PM7:
 
-                 case ModuleName.PM8:
 
-                 case ModuleName.LL1:
 
-                 case ModuleName.LL2:
 
-                 case ModuleName.LL3:
 
-                 case ModuleName.LL4:
 
-                     sslot = "00";
 
-                     break;
 
-             }
 
-             return sslot;
 
-         }
 
-         public static string hand2string(Hand hand)
 
-         {
 
-             string st = "";
 
-             switch (hand)
 
-             {
 
-                 case Hand.Blade1:   
 
-                     st = "B";      //单手臂 下
 
-                     break;
 
-                 case Hand.Blade2:
 
-                     st = "A";     //4手臂  上
 
-                     break;
 
-                 case Hand.Both:
 
-                     st = "W";
 
-                     break;
 
-             }
 
-             return st;
 
-         }
 
-         public static string NextMotion2String(Motion motion,Hand hand)
 
-         {
 
-             string st = "";
 
-             switch (motion)
 
-             {
 
-                 case Motion.Pick:
 
-                     st = string.Format("G{0}", hand2string(hand));
 
-                     break;
 
-                 case Motion.Place:
 
-                     st = string.Format("P{0}", hand2string(hand));
 
-                     break;
 
-                 case Motion.Exchange:
 
-                     st = string.Format("E{0}", hand2string(hand));
 
-                     break;
 
-                 default:
 
-                     st = "AL";
 
-                     break;
 
-             }
 
-             return st;
 
-         }
 
-         public static string Offset2String(int offset)
 
-         {
 
-             string st = "";
 
-             if (offset > 0)
 
-             {
 
-                 st = string.Format("{0:D5}", offset);
 
-             }
 
-             else
 
-             {
 
-                 st = string.Format("{0:D4}", offset);
 
-             }
 
-             return st;
 
-         }
 
-     }
 
- }
 
 
  |