123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Threading.Tasks;
- namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.EndPoints.CytEndPoints
- {
- public class EPDDefine
- {
- public static Dictionary<int, string> ErrorMap = new Dictionary<int, string>()
- {
- {0x0000, "OK"},
- {0x1000, "Format error"},
- {0x1001, "Parameter invalid"},
- {0x1002, "EPD not online"},
- {0x1003, "EPD is initializing"},
- {0x1004, "EPD config file has invalid setting"},
- {0x1005, "EPD calculation failed"},
- {0x1006, "EPD not remote"},
- { 0x1100, "Device has other error" },
- { 0x1101, "Device invalid" },
- { 0x1102, "No Device" },
- { 0x1103, "Device close failed" },
- { 0x1104, "Device: order not implemented" },
- { 0x1105, "Device: a features not found" },
- { 0x1106, "Device: transfer Error" },
- { 0x1107, "Device: bad user buffer" },
- { 0x1108, "Device: out of bounds" },
- { 0x1109, "Device Saturated" },
- {0x2000, "EPD device error"},
- };
- public static Dictionary<int, string> StateMap = new Dictionary<int, string>()
- {
- {0, "Device not ready"},
- {1, "Running"},
- {2, "Paused"},
- {3, "Idle"},
- };
- public static Dictionary<int, string> RunStatusMap = new Dictionary<int, string>()
- {
- {1, "Monitor"},
- {2, "Monitor Save"},
- {3, "Capture"},
- {4, "Process"},
- };
- public static Dictionary<int, string> ModeMap = new Dictionary<int, string>()
- {
- {1, "Local"},
- {2, "Remote"},
- };
- }
- public enum ErrorCode
- {
- OK = 0,
- InvalidZeroInHeader = 1, // 1-20 Horiba Error
- InvalidZeroInBody = 2,
- NoMatchHeaderWithBodyItems = 3,
- RequireCorrectValue = 4,
- RequireRecognizableTextCh = 5,
- MessageError = 6,
- BeyondRangeInHeader = 7,
- SizeErrorInHeader = 8,
- BeyondRangeInBody = 9,
- SizeErrorInBody = 10,
- NoMatchSensorID = 11,
- RemoteNotReady = 12,
- SensorNotReady = 13,
- ClusterNotReady = 14,
- UpperLimitOfHardDisk = 15,
- MismatchStepNames = 16,
- MissingStepName = 17,
- BeyondRangeRequiredAction = 18,
- RecipeNotExist = 19,
- AlreadyMeasuring = 20,
- InvalidPackage = 0x1000, // EPD Error
- InvalidParameter = 0x1001,
- NotOnline = 0x1002, //未连接
- Busy = 0x1003,
- SyntaxError = 0x1004, //模型语法错误
- CalcError = 0x1005,
- NotRemote = 0x1006,
- InvalidDevice = 0x1101, // RH Error
- NoDevice = 0x1102,
- FailedToClose = 0x1103,
- NotImplemented = 0x1104,
- FeatureNotFound = 0x1105,
- TransferError = 0x1106,
- BadUserBuffer = 0x1107,
- InputOutOfBounds = 0x1108,
- SpectrometerSaturated = 0x1109,
- HardwareNotReady = 0x2000,
- }
- public enum EPDEvent
- {
- Event_Message = 0x01,
- Event_SystemError = 0x02,
- Event_StepStart = 0x03,
- Event_StepDelay = 0x04,
- Event_StepNormalize = 0x05,
- Event_StepSatisfied = 0x06,
- Event_StepTrigger = 0x07,
- Event_StepStop = 0x08,
- Event_TrendData = 0x10,
- }
- public enum EPDCommand
- {
- Reset = 0x00,
- RecipeStart = 0x01,
- RecipeStop = 0x02,
- Complete = 0x03,
- Start = 0x04,
- Stop = 0x05,
- SetWaferInfo = 0x06,
- QueryCfgList = 0x07,
- QueryState = 0x08,
- QueryVer = 0x09,
- Event = 0x0A,
- Connect = 0x10,
- Disconnect = 0x11,
- HeartBeat = 0x20,
- QueryData = 0x30,
- QueryRunStatus = 0x31,
- SetRunStatus = 0x32,
- QueryOperateMode = 0x33,
- SetOperateMode = 0x34,
- QueryCurrentConfig = 0x40,
- GetSensorStatus = 0x101,
- StartMeasurement = 0x102,
- GetRecipesList = 0x103,
- StopMeasurement = 0x104,
- HoribaEvent = 0x105
- }
- [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 10, CharSet = CharSet.Ansi)]
- public struct PacketHeader
- {
- public static readonly int Size = Marshal.SizeOf(typeof(PacketHeader));
- [MarshalAs(UnmanagedType.U4, SizeConst = 4)]
- public int token;
- [MarshalAs(UnmanagedType.U1, SizeConst = 1)]
- public byte channel;
- [MarshalAs(UnmanagedType.U1, SizeConst = 1)]
- public byte command;
- [MarshalAs(UnmanagedType.U4, SizeConst = 4)]
- public int length;
- }
- [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 14, CharSet = CharSet.Ansi)]
- public struct ResponseHeader
- {
- public static readonly int Size = Marshal.SizeOf(typeof(ResponseHeader));
- [MarshalAs(UnmanagedType.U4, SizeConst = 4)]
- public int token;
- [MarshalAs(UnmanagedType.U1, SizeConst = 1)]
- public byte channel;
- [MarshalAs(UnmanagedType.U1, SizeConst = 1)]
- public byte command;
- [MarshalAs(UnmanagedType.U4, SizeConst = 4)]
- public int errorcode;
- [MarshalAs(UnmanagedType.U4, SizeConst = 4)]
- public int length;
- }
- [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1792, CharSet = CharSet.Ansi)]
- public struct WaferData
- {
- public static readonly int Size = Marshal.SizeOf(typeof(WaferData));
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] WaferID;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] Recipe;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] LotName;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] Cassette;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] Slot;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] ToolID;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] WorkFlow;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] Custom1;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] Custom2;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] Custom3;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] Custom4;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] Custom5;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] Date;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
- public char[] Time;
- public WaferData(int _)
- {
- WaferID = new char[128];
- Recipe = new char[128];
- LotName = new char[128];
- Cassette = new char[128];
- Slot = new char[128];
- ToolID = new char[128];
- WorkFlow = new char[128];
- Custom1 = new char[128];
- Custom2 = new char[128];
- Custom3 = new char[128];
- Custom4 = new char[128];
- Custom5 = new char[128];
- Date = new char[128];
- Time = new char[128];
- }
- }
- }
|